watcher-ts/packages/erc20-watcher/src/queries.ts
Ashwin Phatak a7ec3d8da8
Add APGL license and copyright notices (#212)
* Add license & copyright declarations for add-watcher.

* Add copyright declarations for cache.

* Add copyright declarations for erc20-watcher.

* Add copyright declarations for ipld-eth-client.

* Add copyright declarations for tracing-client.

* Add copyright declarations for uni-watcher.

* Add copyright declarations for solidity-mapper.

* Add copyright declarations for uni-info-watcher.

* Add copyright declarations for util.

* Add copyright declarations for lighthouse-watcher.

* Change license identifier in .sol files.

Co-authored-by: prathamesh0 <prathamesh.musale0@gmail.com>
2021-08-12 15:28:13 +05:30

95 lines
1.7 KiB
TypeScript

//
// Copyright 2021 Vulcanize, Inc.
//
import { gql } from 'graphql-request';
export const queryTotalSupply = gql`
query getTotalSupply($blockHash: String!, $token: String!) {
totalSupply(blockHash: $blockHash, token: $token) {
value
proof {
data
}
}
}
`;
export const queryBalanceOf = gql`
query getBalance($blockHash: String!, $token: String!, $owner: String!) {
balanceOf(blockHash: $blockHash, token: $token, owner: $owner) {
value
proof {
data
}
}
}
`;
export const queryAllowance = gql`
query getAllowance($blockHash: String!, $token: String!, $owner: String!, $spender: String!) {
allowance(blockHash: $blockHash, token: $token, owner: $owner, spender: $spender) {
value
proof {
data
}
}
}
`;
export const queryName = gql`
query getName($blockHash: String!, $token: String!) {
name(blockHash: $blockHash, token: $token) {
value
proof {
data
}
}
}
`;
export const querySymbol = gql`
query getSymbol($blockHash: String!, $token: String!) {
symbol(blockHash: $blockHash, token: $token) {
value
proof {
data
}
}
}
`;
export const queryDecimals = gql`
query getDecimals($blockHash: String!, $token: String!) {
decimals(blockHash: $blockHash, token: $token) {
value
proof {
data
}
}
}
`;
export const queryEvents = gql`
query getEvents($blockHash: String!, $token: String!) {
events(blockHash: $blockHash, token: $token) {
event {
__typename
... on TransferEvent {
from
to
value
}
... on ApprovalEvent {
owner
spender
value
}
}
proof {
data
}
}
}
`;