Skip to main content

Router

Imported types#

Token#

type Token {
chainId: ChainId!
address: String!
currency: Currency!
}

TradeOptions#

type TradeOptions {
allowedSlippage: String!
recipient: String!
unixTimestamp: UInt64!
ttl: UInt32
deadline: UInt32
feeOnTransfer: Boolean
}

SwapParameters#

type SwapParameters {
methodName: String!
args: [String!]!
value: String!
}

TxOverrides#

type TxOverrides {
gasPrice: BigInt
gasLimit: BigInt
}

ChainId#

enum ChainId {
MAINNET
ROPSTEN
RINKEBY
GOERLI
KOVAN
}

Query schemas#

swapCallParameters#

Returns the parameters for the swap.

swapCallParameters(
trade: Trade!,
tradeOptions: TradeOptions!
): SwapParameters!

estimateGas#

Estimates the gas being used in the swap.

estimateGas(
parameters: SwapParameters!
chainId: ChainId
): String!

execCallStatic#

Returns empty string if call would be successful, otherwise returns solidity contract error.

execCallStatic(
parameters: SwapParameters!
chainId: ChainId!
txOverrides: TxOverrides
): String!