scalar BigInt

scalar Bytes

scalar BigDecimal

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 = TestEvent | PoolCreatedEvent | InitializeEvent

type TestEvent {
  param1: String!
  param2: Int!
  param3: BigInt!
}

type PoolCreatedEvent {
  token0: String!
  token1: String!
  fee: Int!
  tickSpacing: Int!
  pool: String!
}

type InitializeEvent {
  sqrtPriceX96: BigInt!
  tick: Int!
}

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!]
  getMethod(blockHash: String!, contractAddress: String!): ResultString!
  _test(blockHash: String!, contractAddress: String!): ResultBigInt!
  blog(id: String!, block: Block_height): Blog!
  author(id: String!, block: Block_height): Author!
  category(id: String!, block: Block_height): Category!
  getStateByCID(cid: String!): ResultIPLDBlock
  getState(blockHash: String!, contractAddress: String!, kind: String): ResultIPLDBlock
}

enum BlogKind {
  short
  long
}

type Blog {
  id: ID!
  kind: BlogKind!
  isActive: Boolean!
  reviews: [BigInt!]!
  author: Author!
  categories: [Category!]!
}

type Category {
  id: ID!
  count: BigInt!
  name: String!
}

type Author {
  id: ID!
  blogCount: BigInt!
  name: String!
  rating: BigDecimal!
  paramInt: Int!
  paramBigInt: BigInt!
  paramBytes: Bytes!
  blogs: [Blog!]!
}

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

type Subscription {
  onEvent: ResultEvent!
}
