Skip to main content

Common GraphQL Types

Common GraphQL types represent types that are used by both of Uniswap v2 Web3API's queries and mutations.

Enumeration Types#

ChainId#

enum ChainId {
MAINNET
ROPSTEN
RINKEBY
GOERLI
KOVAN
}

TradeType#

enum TradeType {
EXACT_INPUT
EXACT_OUTPUT
}

Rounding#

enum Rounding {
ROUND_DOWN
ROUND_HALF_UP
ROUND_UP
}

Common Types#

TradeOptions#

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

Token#

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

Currency#

type Currency {
decimals: UInt8!
symbol: String
name: String
}

TokenAmount#

type TokenAmount {
token: Token!
amount: String! # UInt256!
}

Pair#

type Pair {
tokenAmount0: TokenAmount!
tokenAmount1: TokenAmount!
}

Route#

type Route {
path: [Token!]!
pairs: [Pair!]!
input: Token!
output: Token!
}

Trade#

type Trade {
route: Route!
inputAmount: TokenAmount!
outputAmount: TokenAmount!
tradeType: TradeType!
}

Swap Parameters#

type SwapParameters {
methodName: String!
args: [String!]!
value: String!
}
type TxOverrides {
gasPrice: BigInt
gasLimit: BigInt
}