Skip to content

Commit

Permalink
Merge pull request #33 from tetu-io/dev-ruby
Browse files Browse the repository at this point in the history
Added check tetubal balances from subgraph
  • Loading branch information
belbix authored Feb 22, 2024
2 parents bd919c7 + 5d7ca02 commit 9f072c8
Show file tree
Hide file tree
Showing 11 changed files with 11,959 additions and 10,291 deletions.
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

0 comments on commit 9f072c8

Please sign in to comment.