Class: Buyer

messages~ Buyer


new Buyer(connection, attrs)

A DZBYUPDT Buyer message. From the Whitepaper:

Buyer Declarations are optional for buyers, but are available for buyers to declare some form of identity metadata. These can be declared at any time, and in the case that multiple buyer declarations exist on the same public key, the most recent declaration will serve as the relevant declaration.

receiverAddr: Buyer messages should be addressed to the same address it is being sent from, unless the transferAddr property is specfied (in which the receiverAddr should match the transferAddr)

NOTE: All attributes that are specified below are also getter properties that can be accessed on this instantiated object.

Parameters:
Name Type Description
connection Driver

blockchain connection

attrs object

Attributes that this Invoice contains

Properties
Name Type Description
alias String

This is the alias of the buyer, meant to identify the seller in a non-unique and colloquial fashion (i.e., "Satoshi").

description String

This is the description of the buyer, and can contain text and/or URLs.

transferAddr String

This is enabled for identity transfer, and not intended for use at the time of the addresses first declaration. This value specifies the new address of the buyer, to which all existing earned reputation will transfer. All messages after this attribute is declared are no longer valid from this address.

Extends

Methods


isValid(cb)

Determine whether this message has been properly formatted, and is 'in consensus' with the Drop Zone protocol. Further documentation for this validation result, and it's error messages can be found in the async-validate library.

Parameters:
Name Type Description
cb function

Callback to receive the results of the validity test form: function(err, res)

Inherited From:

save(cb)

Save this message into the blockchain, if it hasn't yet been persisted, and was instantiated without a txid.

NOTE: Validation is not performed as part of this method. It's entirely possible to persist a message into the blockchain that will be ommitted from search/scan results by clients. Validation is performed as part of #find() not #save().

Parameters:
Name Type Description
cb function

Callback which receives the mempool-persisted message in the form: function(err, message)

NOTE: Due to transaction-maleability, the persisted txid may change at the time of actual confirmation. This method merely broadcasts the message into the mempool.

Inherited From:

toTransaction()

Return a hash object representing the serialized components of this transaction suitable for passing onto TxEncode.

Inherited From:
Returns:
Type
object