scalar BigInt

scalar BigDecimal

scalar Bytes

input Block_height {
  hash: Bytes
  number: Int
}

type Proof {
  data: String!
}

type ResultBoolean {
  value: Boolean!
  proof: Proof
}

type ResultString {
  value: String!
  proof: Proof
}

type ResultInt {
  value: Int!
  proof: Proof
}

type ResultBigInt {
  value: BigInt!
  proof: Proof
}

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 = ApprovalEvent | ApprovalForAllEvent | TransferEvent

type ApprovalEvent {
  owner: String!
  approved: String!
  tokenId: BigInt!
}

type ApprovalForAllEvent {
  owner: String!
  operator: String!
  approved: Boolean!
}

type TransferEvent {
  from: String!
  to: String!
  tokenId: BigInt!
}

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

type Query {
  events(blockHash: String!, contractAddress: String!, name: String): [ResultEvent!]
  eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!): [ResultEvent!]
  supportsInterface(blockHash: String!, contractAddress: String!, interfaceId: String!): ResultBoolean!
  balanceOf(blockHash: String!, contractAddress: String!, owner: String!): ResultBigInt!
  ownerOf(blockHash: String!, contractAddress: String!, tokenId: BigInt!): ResultString!
  getApproved(blockHash: String!, contractAddress: String!, tokenId: BigInt!): ResultString!
  isApprovedForAll(blockHash: String!, contractAddress: String!, owner: String!, operator: String!): ResultBoolean!
  name(blockHash: String!, contractAddress: String!): ResultString!
  symbol(blockHash: String!, contractAddress: String!): ResultString!
  tokenURI(blockHash: String!, contractAddress: String!, tokenId: BigInt!): ResultString!
  _name(blockHash: String!, contractAddress: String!): ResultString!
  _symbol(blockHash: String!, contractAddress: String!): ResultString!
  _owners(blockHash: String!, contractAddress: String!, key0: BigInt!): ResultString!
  _balances(blockHash: String!, contractAddress: String!, key0: String!): ResultBigInt!
  _tokenApprovals(blockHash: String!, contractAddress: String!, key0: BigInt!): ResultString!
  _operatorApprovals(blockHash: String!, contractAddress: String!, key0: String!, key1: String!): ResultBoolean!
  getStateByCID(cid: String!): ResultIPLDBlock
  getState(blockHash: String!, contractAddress: String!, kind: String): ResultIPLDBlock
  transferCount(id: String!, block: Block_height): TransferCount!
}

type TransferCount {
  id: ID!
  count: Int!
}

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

type Subscription {
  onEvent: ResultEvent!
}
