directive @cacheControl(maxAge: Int, inheritMaxAge: Boolean, scope: CacheControlScope) on FIELD_DEFINITION | OBJECT | INTERFACE | UNION

enum CacheControlScope {
  PUBLIC
  PRIVATE
}

scalar BigInt

scalar BigDecimal

scalar Bytes

type Proof {
  data: String!
}

type _Block_ {
  cid: String
  hash: String!
  number: Int!
  timestamp: Int!
  parentHash: String!
}

type _Transaction_ {
  hash: String!
  index: Int!
  from: String!
  to: String!
}

type ResultEvent {
  block: _Block_!
  tx: _Transaction_!
  contract: String!
  eventIndex: Int!
  event: Event!
  proof: Proof
}

union Event = OwnershipTransferredEvent | RouteEvent

type OwnershipTransferredEvent {
  previousOwner: String!
  newOwner: String!
}

type RouteEvent {
  from: String!
  to: String!
  tokenIn: String!
  tokenOut: String!
  amountIn: BigInt!
  amountOutMin: BigInt!
  amountOut: BigInt!
}

input Block_height {
  hash: Bytes
  number: Int
}

input BlockChangedFilter {
  number_gte: Int!
}

enum OrderDirection {
  asc
  desc
}

enum RouteProcessor_orderBy {
  id
  routeCount
  userCount
}

input RouteProcessor_filter {
  id: ID
  id_not: ID
  id_gt: ID
  id_lt: ID
  id_gte: ID
  id_lte: ID
  id_in: [ID!]
  id_not_in: [ID!]
  routeCount: BigInt
  routeCount_not: BigInt
  routeCount_gt: BigInt
  routeCount_lt: BigInt
  routeCount_gte: BigInt
  routeCount_lte: BigInt
  routeCount_in: [BigInt!]
  routeCount_not_in: [BigInt!]
  userCount: BigInt
  userCount_not: BigInt
  userCount_gt: BigInt
  userCount_lt: BigInt
  userCount_gte: BigInt
  userCount_lte: BigInt
  userCount_in: [BigInt!]
  userCount_not_in: [BigInt!]
  _change_block: BlockChangedFilter
  and: [RouteProcessor_filter]
  or: [RouteProcessor_filter]
}

enum Route_orderBy {
  id
  from
  to
  tokenIn
  tokenOut
  amountIn
  amountOutMin
  amountOut
  timestamp
}

input Route_filter {
  id: ID
  id_not: ID
  id_gt: ID
  id_lt: ID
  id_gte: ID
  id_lte: ID
  id_in: [ID!]
  id_not_in: [ID!]
  from: Bytes
  from_not: Bytes
  from_gt: Bytes
  from_lt: Bytes
  from_gte: Bytes
  from_lte: Bytes
  from_in: [Bytes!]
  from_not_in: [Bytes!]
  from_contains: Bytes
  from_not_contains: Bytes
  to: Bytes
  to_not: Bytes
  to_gt: Bytes
  to_lt: Bytes
  to_gte: Bytes
  to_lte: Bytes
  to_in: [Bytes!]
  to_not_in: [Bytes!]
  to_contains: Bytes
  to_not_contains: Bytes
  tokenIn: Bytes
  tokenIn_not: Bytes
  tokenIn_gt: Bytes
  tokenIn_lt: Bytes
  tokenIn_gte: Bytes
  tokenIn_lte: Bytes
  tokenIn_in: [Bytes!]
  tokenIn_not_in: [Bytes!]
  tokenIn_contains: Bytes
  tokenIn_not_contains: Bytes
  tokenOut: Bytes
  tokenOut_not: Bytes
  tokenOut_gt: Bytes
  tokenOut_lt: Bytes
  tokenOut_gte: Bytes
  tokenOut_lte: Bytes
  tokenOut_in: [Bytes!]
  tokenOut_not_in: [Bytes!]
  tokenOut_contains: Bytes
  tokenOut_not_contains: Bytes
  amountIn: BigInt
  amountIn_not: BigInt
  amountIn_gt: BigInt
  amountIn_lt: BigInt
  amountIn_gte: BigInt
  amountIn_lte: BigInt
  amountIn_in: [BigInt!]
  amountIn_not_in: [BigInt!]
  amountOutMin: BigInt
  amountOutMin_not: BigInt
  amountOutMin_gt: BigInt
  amountOutMin_lt: BigInt
  amountOutMin_gte: BigInt
  amountOutMin_lte: BigInt
  amountOutMin_in: [BigInt!]
  amountOutMin_not_in: [BigInt!]
  amountOut: BigInt
  amountOut_not: BigInt
  amountOut_gt: BigInt
  amountOut_lt: BigInt
  amountOut_gte: BigInt
  amountOut_lte: BigInt
  amountOut_in: [BigInt!]
  amountOut_not_in: [BigInt!]
  timestamp: BigInt
  timestamp_not: BigInt
  timestamp_gt: BigInt
  timestamp_lt: BigInt
  timestamp_gte: BigInt
  timestamp_lte: BigInt
  timestamp_in: [BigInt!]
  timestamp_not_in: [BigInt!]
  _change_block: BlockChangedFilter
  and: [Route_filter]
  or: [Route_filter]
}

enum User_orderBy {
  id
  routeCount
}

input User_filter {
  id: ID
  id_not: ID
  id_gt: ID
  id_lt: ID
  id_gte: ID
  id_lte: ID
  id_in: [ID!]
  id_not_in: [ID!]
  routeCount: BigInt
  routeCount_not: BigInt
  routeCount_gt: BigInt
  routeCount_lt: BigInt
  routeCount_gte: BigInt
  routeCount_lte: BigInt
  routeCount_in: [BigInt!]
  routeCount_not_in: [BigInt!]
  _change_block: BlockChangedFilter
  and: [User_filter]
  or: [User_filter]
}

type _MetaBlock_ {
  hash: Bytes
  number: Int!
  timestamp: Int
}

type _Meta_ {
  block: _MetaBlock_!
  deployment: String!
  hasIndexingErrors: Boolean!
}

type ResultState {
  block: _Block_!
  contractAddress: String!
  cid: String!
  kind: String!
  data: String!
}

type SyncStatus {
  latestIndexedBlockHash: String!
  latestIndexedBlockNumber: Int!
  latestCanonicalBlockHash: String!
  latestCanonicalBlockNumber: Int!
  initialIndexedBlockHash: String!
  initialIndexedBlockNumber: Int!
  latestProcessedBlockHash: String!
  latestProcessedBlockNumber: Int!
}

type Query {
  events(blockHash: String!, contractAddress: String!, name: String): [ResultEvent!]
  eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!): [ResultEvent!]
  routeProcessor(id: ID!, block: Block_height): RouteProcessor
  routeProcessors(block: Block_height, where: RouteProcessor_filter, orderBy: RouteProcessor_orderBy, orderDirection: OrderDirection, first: Int = 100, skip: Int = 0): [RouteProcessor!]!
  route(id: ID!, block: Block_height): Route
  routes(block: Block_height, where: Route_filter, orderBy: Route_orderBy, orderDirection: OrderDirection, first: Int = 100, skip: Int = 0): [Route!]!
  user(id: ID!, block: Block_height): User
  users(block: Block_height, where: User_filter, orderBy: User_orderBy, orderDirection: OrderDirection, first: Int = 100, skip: Int = 0): [User!]!
  _meta(block: Block_height): _Meta_
  getStateByCID(cid: String!): ResultState
  getState(blockHash: String!, contractAddress: String!, kind: String): ResultState
  getSyncStatus: SyncStatus
}

type RouteProcessor {
  id: ID!
  routeCount: BigInt!
  userCount: BigInt!
}

type Route {
  id: ID!
  from: Bytes!
  to: Bytes!
  tokenIn: Bytes!
  tokenOut: Bytes!
  amountIn: BigInt!
  amountOutMin: BigInt!
  amountOut: BigInt!
  timestamp: BigInt!
}

type User {
  id: ID!
  routeCount: BigInt!
}

type Mutation {
  watchContract(address: String!, kind: String!, checkpoint: Boolean!, startingBlock: Int): Boolean!
}

type Subscription {
  onEvent: ResultEvent!
}
