🟪Types
Chain
type Chain = {
name: string,
chainId: string,
type: string,
mainnet: number,
multicallAddress: string,
icon: string,
nativeToken: {
"symbol": string,
"address": string,
"coinKey": string,
"chainId": number,
"decimals": number,
"name": string,
"logoURI": string,
}
}
TX
type TX = {
from: string,
//for evm
to?: string,
data?: string,
value?: string,
//for solana
tx?: { keys: {}[], programId: string, data: any }[],
singer?: any
}
Path
type Path = {
type: string,
name: string,
chain: string,
}
Token
type Token = {
chainId: string,
address: string,
decimals: number,
name: string,
symbol: string,
chainName: string,
icon: string,
amount: string,//wei
}
Cost
type Cost = Token & {
title: string
}
Route
type Route = {
key: string,
type: string,
from: Token,
to: Token,
path: Path[],
costs: Cost[],
amountIn: string,
amountOut: string,
receiver: string,
slippage: string,
tx?: TX,
timeEstimated: number,
fees:{
route?:Token,
protocol?:Token,
network?:Token,
gas?:Token & {gasPrice:string,gasLimit:string},
}
}
Last updated