@cosmosapp/pay_sdkDéfinitionsServeur

OfframpManager

Stablecoin → fiat — client.offramp. Four steps, and the middle one is the one people miss: quote, authorize…

Stablecoin → fiat — client.offramp. Four steps, and the middle one is the one people miss: quote, authorize (which builds the unsigned transaction that moves the stablecoin), the wallet signs it, and only then create the payout with that signature attached. A payout created without a signed transfer is a payout with nothing behind it. authorize is for the chains that need a transaction built for them (Stellar, Solana). On EVM the quote itself carries the approve contract payload, so the caller signs that instead and goes straight to createPayout.

Constructor

OfframpManager

constructor(client: Client)

Parameters

Properties

client

readonly client: Client

Type Client

Methods

quote()

Price a payout. Expires in about five minutes.

quote(options: CreatePayoutQuoteOptions): Promise<PayoutQuoteData>

Parameters

  • options: CreatePayoutQuoteOptions

Returns Promise<PayoutQuoteData>

authorize()

Build the unsigned transfer for a Stellar or Solana payout. What comes back is built by the gateway, not by the caller: bound it against the quote the user confirmed before signing, or the amount that leaves is whatever the response says it is.

authorize(options: AuthorizePayoutOptions): Promise<AuthorizePayoutData>

Parameters

  • options: AuthorizePayoutOptions

Returns Promise<AuthorizePayoutData>

createPayout()

Create the payout from a quote, with the signed transfer attached.

createPayout(options: CreatePayoutOptions): Promise<PayoutData>

Parameters

  • options: CreatePayoutOptions

Returns Promise<PayoutData>

payouts()

List this consumer's payouts (paginated).

payouts(options?: ListPayoutsOptions): Promise<PayoutPage>

Parameters

  • options (optional): ListPayoutsOptions

Returns Promise<PayoutPage>

payout()

One payout. Served from the local mirror, refreshed when stale.

payout(id: string): Promise<PayoutData>

Parameters

  • id: string

Returns Promise<PayoutData>

attachDocument()

Attach a compliance document to a payout — an invoice or proof of funds the rail asks for before it will settle.

attachDocument(id: string, options: AttachPayoutDocumentOptions): Promise<PayoutDocumentData>

Parameters

  • id: string
  • options: AttachPayoutDocumentOptions

Returns Promise<PayoutDocumentData>

Sur cette page