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:Clientdata:ChainSwapData
Properties
chain
chain: OtherSwapChainnetwork
network: stringprovider
The aggregator that built it.
provider: 'jupiter' | 'kuru'status
status: SwapStatussource
The wallet that signs, pays and receives.
source: stringsendAsset
native, or the SPL mint / ERC-20 address.
sendAsset: stringsendAmount
sendAmount: stringdestAsset
destAsset: stringdestEstimated
destEstimated: stringdestMin
destMin: stringfeeBps
feeBps: numberfeeAmount
The commission, in the destination asset.
feeAmount: stringslippageBps
slippageBps: numberpath
path: { code: stringissuer
issuer: string | nullmember
}[]transaction
What the wallet signs.
transaction: ChainSwapTransactionapproval
Monad ERC-20 sales with a short allowance: the approve call to send first.
approval: EvmCallData | nulltxHash
txHash: string | nullidempotencyKey
idempotencyKey: string | nullexpiresAt
Submit refuses the transaction after this.
expiresAt: DatecreatedAt
createdAt: DateupdatedAt
updatedAt: Dateprotected
protected _patch(data: ChainSwapData): thisget
Whether the swap has settled on-chain.
get isSucceeded(): booleanget
Whether the swap is still awaiting submission.
get isPending(): booleanget
Whether the built transaction can no longer be submitted.
get isStale(): booleansubmit
Relay the signed transaction. Mutates this instance from the refreshed swap in the outcome and returns the outcome.
submit(options: { signedTransaction: stringmember
}): Promise<ChainSwapSubmitOutcome>Methods
fetch()
Re-fetch this swap from the API.
fetch(): Promise<ChainSwap>Returns Promise<ChainSwap>
toJSON()
toJSON(): ChainSwapDataReturns ChainSwapData
Related
ProductManager
Manages products / prices — client.products. Reference for the ProductManager class of @cosmosapp/pay_sdk: its members and their signatures.
Swap
A Stellar path-payment swap. Solana and Monad swaps are ChainSwap. Wraps the raw API payload with typed accessors and atomic action methods so you can operate…