@cosmosapp/pay_sdkDefiniçõesServidor

ChainSwap

A same-chain swap on Solana (built by Jupiter) or Monad (built by Kuru Flow), from client.swaps with chain: 'solana' | 'monad'.

A same-chain swap on Solana (built by Jupiter) or Monad (built by Kuru Flow), from client.swaps with chain: 'solana' | 'monad'. Non-custodial like a Stellar {@link Swap}: sign {@link transaction} in the wallet that owns {@link source}, then await swap.submit({ signedTransaction }). The server checks it is the transaction it built before broadcasting it. On Monad, when {@link approval} is set, send and confirm that approve call first.

Constructor

ChainSwap

constructor(client: Client, data: ChainSwapData)

Parameters

  • client: Client
  • data: ChainSwapData

Properties

chain

chain: OtherSwapChain

network

network: string

provider

The aggregator that built it.

provider: 'jupiter' | 'kuru'

status

status: SwapStatus

source

The wallet that signs, pays and receives.

source: string

sendAsset

native, or the SPL mint / ERC-20 address.

sendAsset: string

sendAmount

sendAmount: string

destAsset

destAsset: string

destEstimated

destEstimated: string

destMin

destMin: string

feeBps

feeBps: number

feeAmount

The commission, in the destination asset.

feeAmount: string

slippageBps

slippageBps: number

path

path: { code: string

issuer

issuer: string | null

member

}[]

transaction

What the wallet signs.

transaction: ChainSwapTransaction

approval

Monad ERC-20 sales with a short allowance: the approve call to send first.

approval: EvmCallData | null

txHash

txHash: string | null

idempotencyKey

idempotencyKey: string | null

expiresAt

Submit refuses the transaction after this.

expiresAt: Date

createdAt

createdAt: Date

updatedAt

updatedAt: Date

protected

protected _patch(data: ChainSwapData): this

get

Whether the swap has settled on-chain.

get isSucceeded(): boolean

get

Whether the swap is still awaiting submission.

get isPending(): boolean

get

Whether the built transaction can no longer be submitted.

get isStale(): boolean

submit

Relay the signed transaction. Mutates this instance from the refreshed swap in the outcome and returns the outcome.

submit(options: { signedTransaction: string

member

}): Promise<ChainSwapSubmitOutcome>

Methods

fetch()

Re-fetch this swap from the API.

fetch(): Promise<ChainSwap>

Returns Promise<ChainSwap>

toJSON()

toJSON(): ChainSwapData

Returns ChainSwapData

Nesta página