@cosmosapp/pay_sdkDefinicionesServidor

PrivatePayment

A private payment, from client.privatePayments: an amount in XLM whose value is hidden on-chain.

A private payment, from client.privatePayments: an amount in XLM whose value is hidden on-chain. The payer pays it with confidential transfers on Cosmos Pay's confidential token (net to {@link recipient}, the commission to {@link feeAccount}, and a third one when there is a {@link merchantFee}) and confirms them through the private checkout. Poll with await payment.fetch().

Constructor

PrivatePayment

constructor(client: Client, data: PrivatePaymentData)

Parameters

  • client: Client
  • data: PrivatePaymentData

Properties

status

As it reads now: a PENDING payment past {@link expiresAt} reads EXPIRED.

status: PrivatePaymentStatus

network

network: PrivatePaymentNetwork

tokenContract

The confidential token every transfer must be made on.

tokenContract: string

amount

What the payer pays in total, in XLM.

amount: string

netAmount

What the merchant receives, in XLM.

netAmount: string

feeAmount

The commission, in XLM.

feeAmount: string

feeBps

The commission rate the payment was priced at, in basis points.

feeBps: number

recipient

The merchant (G...).

recipient: string

feeAccount

Cosmos Pay's account the commission is paid to.

feeAccount: string

payer

The account the transfers came from, once settled.

payer: string | null

paymentTxHash

paymentTxHash: string | null

feeTxHash

feeTxHash: string | null

merchantFee

merchantFee: MerchantFeeData | null

merchantFeeTxHash

merchantFeeTxHash: string | null

description

description: string | null

idempotencyKey

idempotencyKey: string

expiresAt

Every transfer must close before this.

expiresAt: Date

settledAt

settledAt: Date | null

createdAt

createdAt: Date

updatedAt

updatedAt: Date

protected

protected _patch(data: PrivatePaymentData): this

get

Whether the payment is still waiting for its transfers.

get isPending(): boolean

get

Whether every transfer has been confirmed.

get isSucceeded(): boolean

get

Whether it passed {@link expiresAt} without settling (it can still settle with transfers that closed in time).

get isExpired(): boolean

Methods

fetch()

Re-fetch from the API, updating this instance in place.

fetch(): Promise<this>

Returns Promise<this>

toJSON()

toJSON(): PrivatePaymentData

Returns PrivatePaymentData

En esta página