Comment on page
Transaction Summary
Whenever the user completes a transaction, the SDK gives you the ability to trigger a callback. This callback will typically be passed in as a prop called
onTxnComplete
. Information about the transaction will be supplied as the first parameter of this callback.It is a union of 4 different transaction summary types. Meaning, it will be one out of these four types. The summary object will always have the
summaryType
field using which you can determine which transaction type was executed.export type TxnSummary =
| SkipTransactionSummary
| KadoTxnSummary
| SquidTxnSummary
| TransferTransactionSummary
Let's look into each of these summary types
This summary type is generated for cosmos swaps, which are executed on the
SwapTab
component, identified by the Tabs.SWAP
enum variant. It has the following structure -type SkipTransactionSummary = {
// this will always be skip
summaryType: 'skip',
// input token amount
amountIn: number
// output token amount
amountOut: number
// the route information for the swap - comes from Skip API
route: any
// info about each individual trasaction in the swap
txnSteps: TxnStatus
// source chain data
sourceChain: ChainBaseData
// destination chain data
destinationChain: ChainBaseData
// input asset information
sourceAsset: Asset
// output asset informatino
destinationAsset: Asset
}
This summary type is generated for Send/IBC transfers, which are executed on the
TransferTab
identified by Tabs.TRANSFER
enum variant. It has the following structure - type TransferTransactionSummary = {
// will always be transfer
summaryType: 'transfer'
// amount of tokens sent
amount: string
// information about asset transfered
asset: Asset
// source chain data
sourceChain: ChainBaseData
// destination chain data
destinationChain: ChainBaseData
// sender wallet address
fromAddress: string
// receiver wallet address
toAddress: string
// transaction hash if confimred on the blockchain
txHash: string | undefined
// if the transaction was succesfull
isSuccess: boolean
}
This summary type is generated for On-Ramp transactions, which are executed on
KadoTab
identified by Tabs.FIAT_ON_RAMP
enum variant. It has the following structure -type KadoTxnSummary = {
// will always be kado
summaryType: 'kado'
// currency user paid with
selectedFiat: Currency
// amount user paid in given currency
amountIn: string
// usd value of the amount user paid
amountInUsd: string
// amount of tokens user is getting
amountOut: string
// data of the chain on which user is receiving tokens
destinationChain: CosmosChainData & {
cryptoNetwork: string
}
// receiving asset information
destinationAsset: Asset
// includes response data from kado
status: OrderStatusResponse
}
This summary type is generated for EVM -> Cosmos Swaps, which are executed on
CrossChainSwapsTab
identified by Tabs.CROSS_CHAIN_SWAPS
and BridgeUSDCTab
identified by Tabs.BRIDGE_USDC
enum variant. It has the following structure -type SquidTxnSummaryBaseUnion =
| {
txnHash: null
error: string | undefined
}
| {
txnHash: string
txnStatus: 'success' | 'partial_success' | 'failed'
axelarScanLink: string
}
type SquidTxnSummary = {
// this will always be squid
summaryType: 'squid'
// source asset amount
fromAmount: string
// destination asset amount
toAmount: string
// source asset information
sourceAsset: Asset
// source chain information
sourceChain: ChainData
// destination asset information
destinationAsset: Asset
// destination chain information
destinationChain: ChainData
// swap route information from Squid SDK
route: RouteData
} & SquidTxnSummaryBaseUnion
Last modified 2d ago