Skip to main content

PaymentRequest

A ZIP-321 transaction request

Index

Constructors

constructor

  • new PaymentRequest(recipient_address: string, amount: bigint, memo: Uint8Array, label: string, message: string, other_params: any): PaymentRequest
  • Construct a new payment request


    Parameters

    • recipient_address: string
    • amount: bigint
    • memo: Uint8Array
    • label: string
    • message: string
    • other_params: any

    Returns PaymentRequest

Methods

amount

  • amount(): bigint
  • Returns the value of the payment that is being requested, in zatoshis.


    Returns bigint

free

  • free(): void
  • Returns void

label

  • label(): string
  • A human-readable label for this payment within the larger structure of the transaction request.

    This will not be part of any generated transactions and is just for display purposes.


    Returns string

memo

  • memo(): Uint8Array
  • Returns the memo that, if included, must be provided with the payment.


    Returns Uint8Array

message

  • message(): string
  • A human-readable message to be displayed to the user describing the purpose of this payment.

    This will not be part of any generated transactions and is just for display purposes.


    Returns string

other_params

  • other_params(): any
  • A list of other arbitrary key/value pairs associated with this payment.

    This will not be part of any generated transactions. How these are used is up to the wallet


    Returns any

recipient_address

  • recipient_address(): string
  • Returns the payment address to which the payment should be sent.


    Returns string

staticsimple_payment

  • simple_payment(recipient_address: string, amount: bigint): PaymentRequest
  • Helper method to construct a simple payment request with no memo, label, message, or other parameters.


    Parameters

    • recipient_address: string
    • amount: bigint

    Returns PaymentRequest