Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added check tetubal balances from subgraph #33

Merged
merged 15 commits into from
Feb 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .env_example
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
TETU_MATIC_RPC_URL=https://polygon-mainnet.g.alchemy.com/v2/key
TETU_PRIVATE_KEY=deployer_key
TETU_NETWORK_SCAN_KEY=key
TETU_SUBGRAPH_URL=https://api.thegraph.com/subgraphs/name/alexandersazonof/tetubal
TETU_VALIDATE_USER_BALANCE_ON_CHAIN=true
TETU_VALIDATE_TOTAL_SUPPLY=true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -23,3 +23,4 @@ core_addresses.txt
tool_addresses.txt
.env
docs
generated
15 changes: 15 additions & 0 deletions gql/.graphqlconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "TetuGame GraphQL Schema",
"schemaPath": "schema.graphql",
"extensions": {
"endpoints": {
"Default GraphQL Endpoint": {
"headers": {
"user-agent": "JS GraphQL"
},
"introspect": false,
"url": "https://api.thegraph.com/subgraphs/name/alexandersazonof/tetubal"
}
}
}
}
16 changes: 16 additions & 0 deletions gql/codegen.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
documents: ./gql/*.graphql
generates:
./generated/gql.ts:
plugins:
- typescript
- typescript-operations
config:
immutableTypes: true
addExplicitOverride: true
strictScalars: true
scalars:
BigDecimal: string
BigInt: string
Bytes: string
Int8: number
schema: https://api.thegraph.com/subgraphs/name/alexandersazonof/tetubal
14 changes: 14 additions & 0 deletions gql/user-balance-by-block.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
query GetUserBalanceByBlock($userAdr: String!, $block: BigInt!) {
userBalanceHistoryEntities(
where:{
user: $userAdr
blockNumber_lte: $block
}
first: 1
orderBy: blockNumber
orderDirection: desc
) {
balance
blockNumber
}
}
Loading
Loading