Skip to main content

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

Index

Constructors

constructor

Methods

free

  • free(): void
  • Returns void

payment_requests

  • Returns the list of payment requests that are part of this transaction request.


    Returns PaymentRequest[]

to_uri

  • to_uri(): string
  • Returns the URI representation of this transaction request.


    Returns string

total

  • total(): bigint
  • Returns the total value of the payments in this transaction request, in zatoshis.


    Returns bigint

staticempty

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..."; // true

    Parameters

    • uri: string

    Returns TransactionRequest