TransactionRequest
Index
Constructors
Methods
Constructors
constructor
Construct a new transaction request from a list of payment requests
Parameters
payments: PaymentRequest[]
Returns TransactionRequest
Methods
free
Returns void
payment_requests
Returns the list of payment requests that are part of this transaction request.
Returns PaymentRequest[]
to_uri
Returns the URI representation of this transaction request.
Returns string
total
Returns the total value of the payments in this transaction request, in zatoshis.
Returns bigint
staticempty
Construct an empty transaction request
Returns TransactionRequest
staticfrom_uri
Decode a transaction request from a "zcash:" URI string.
Example
let uri = "zcash:u1mcxxpa0wyyd3qpkl8rftsa6n7tkh9lv8u8j3zpd9f6qz37dqwur38w6tfl5rpv7m8g8mlca7nyn7qxr5qtjemjqehcttwpupz3fk76q8ft82yh4scnyxrxf2jgywgr5f9ttzh8ah8ljpmr8jzzypm2gdkcfxyh4ad93c889qv3l4pa748945c372ku7kdglu388zsjvrg9dskr0v9zj?amount=1&memo=VGhpcyBpcyBhIHNpbXBsZSBtZW1vLg&message=Thank%20you%20for%20your%20purchase"
let request = TransactionRequest.from_uri(uri);
request.total() == 1; // true
request.payment_requests().length == 1; // true
request.payment_requests()[0].recipient_address() == "u1mcxxpa0wyyd3qpk..."; // trueParameters
uri: string
Returns TransactionRequest
A ZIP-321 transaction request
These can be created from a "zcash:" URI string, or constructed from an array of payment requests and encoded as a uri string