├── .gitignore ├── bnb-native-transfers ├── bnb-transfers-squid │ ├── src │ │ ├── model │ │ │ ├── index.ts │ │ │ └── generated │ │ │ │ ├── index.ts │ │ │ │ ├── transaction.model.ts │ │ │ │ └── marshal.ts │ │ ├── processor.ts │ │ └── main.ts │ ├── .gitignore │ ├── .dockerignore │ ├── .env │ ├── schema.graphql │ ├── assets │ │ └── README.MD │ ├── docker-compose.yml │ ├── abi │ │ └── README.md │ ├── tsconfig.json │ ├── db │ │ └── migrations │ │ │ └── 1695903016828-Data.js │ ├── squid.yaml │ ├── renovate.json │ ├── package.json │ ├── LICENSE │ ├── .gitpod.yml │ ├── commands.json │ └── README.md └── README.MD ├── bnb-tranfers-usdtc ├── bnb-transfers-usdc-squid │ ├── src │ │ ├── model │ │ │ ├── index.ts │ │ │ └── generated │ │ │ │ ├── index.ts │ │ │ │ ├── transaction.model.ts │ │ │ │ └── marshal.ts │ │ ├── processor.ts │ │ ├── main.ts │ │ └── abi │ │ │ ├── abi.support.ts │ │ │ ├── busdc.ts │ │ │ ├── multicall.ts │ │ │ └── busdc.abi.ts │ ├── .dockerignore │ ├── .gitignore │ ├── .env │ ├── schema.graphql │ ├── assets │ │ └── README.MD │ ├── docker-compose.yml │ ├── abi │ │ ├── README.md │ │ └── busdc.json │ ├── tsconfig.json │ ├── db │ │ └── migrations │ │ │ └── 1695903016828-Data.js │ ├── squid.yaml │ ├── renovate.json │ ├── package.json │ ├── LICENSE │ ├── .gitpod.yml │ ├── commands.json │ └── README.md └── README.MD ├── bnb-transfers-usdt ├── bnb-transfers-usdt-squid │ ├── src │ │ ├── model │ │ │ ├── index.ts │ │ │ └── generated │ │ │ │ ├── index.ts │ │ │ │ ├── transaction.model.ts │ │ │ │ └── marshal.ts │ │ ├── processor.ts │ │ ├── main.ts │ │ └── abi │ │ │ ├── abi.support.ts │ │ │ ├── busdc.ts │ │ │ ├── busdt.ts │ │ │ ├── multicall.ts │ │ │ ├── busdc.abi.ts │ │ │ └── busdt.abi.ts │ ├── .gitignore │ ├── .dockerignore │ ├── .env │ ├── schema.graphql │ ├── assets │ │ └── README.MD │ ├── docker-compose.yml │ ├── abi │ │ ├── README.md │ │ └── busdt.json │ ├── tsconfig.json │ ├── db │ │ └── migrations │ │ │ └── 1695903016828-Data.js │ ├── squid.yaml │ ├── renovate.json │ ├── package.json │ ├── LICENSE │ ├── .gitpod.yml │ ├── commands.json │ └── README.md └── README.md ├── README.md ├── ethereum-nft-transfers └── README.MD └── ethereum-contracts └── README.MD /.gitignore: -------------------------------------------------------------------------------- 1 | .DS_Store 2 | **/node_modules/ 3 | **/lib/ 4 | 5 | *.png 6 | llamaTest.ipynb -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/src/model/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./generated" 2 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/src/model/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./generated" 2 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/src/model/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./generated" 2 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/src/model/generated/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./transaction.model" 2 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/src/model/generated/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./transaction.model" 2 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/src/model/generated/index.ts: -------------------------------------------------------------------------------- 1 | export * from "./transaction.model" 2 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /lib 3 | /builds 4 | 5 | /**Versions.json 6 | 7 | # IDE files 8 | /.idea 9 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /lib 3 | /builds 4 | 5 | /**Versions.json 6 | 7 | # IDE files 8 | /.idea 9 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/.dockerignore: -------------------------------------------------------------------------------- 1 | /.git 2 | /node_modules 3 | /lib 4 | /*Versions.json 5 | npm-debug.log 6 | 7 | # OS Files 8 | .DS_Store 9 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/.dockerignore: -------------------------------------------------------------------------------- 1 | /.git 2 | /node_modules 3 | /lib 4 | /*Versions.json 5 | npm-debug.log 6 | 7 | # OS Files 8 | .DS_Store 9 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/.gitignore: -------------------------------------------------------------------------------- 1 | /node_modules 2 | /lib 3 | /builds 4 | 5 | /**Versions.json 6 | 7 | # IDE files 8 | /.idea 9 | llamaTest.ipynb -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/.dockerignore: -------------------------------------------------------------------------------- 1 | /.git 2 | /node_modules 3 | /lib 4 | /*Versions.json 5 | npm-debug.log 6 | 7 | # OS Files 8 | .DS_Store 9 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/.env: -------------------------------------------------------------------------------- 1 | DB_NAME=squid 2 | DB_PORT=23798 3 | GQL_PORT=4350 4 | # JSON-RPC node endpoint, both wss and https endpoints are accepted 5 | RPC_ENDPOINT= 6 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/.env: -------------------------------------------------------------------------------- 1 | DB_NAME=squid 2 | DB_PORT=23798 3 | GQL_PORT=4350 4 | # JSON-RPC node endpoint, both wss and https endpoints are accepted 5 | RPC_ENDPOINT= 6 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/.env: -------------------------------------------------------------------------------- 1 | DB_NAME=squid 2 | DB_PORT=23798 3 | GQL_PORT=4350 4 | # JSON-RPC node endpoint, both wss and https endpoints are accepted 5 | RPC_ENDPOINT= 6 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/schema.graphql: -------------------------------------------------------------------------------- 1 | type Transaction @entity { 2 | id: ID! 3 | from: String! 4 | to: String! 5 | value: BigInt! 6 | timestamp: BigInt! 7 | blockNumber: BigInt! 8 | hash: String! 9 | } 10 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/schema.graphql: -------------------------------------------------------------------------------- 1 | type Transaction @entity { 2 | id: ID! 3 | from: String! 4 | to: String! 5 | value: BigInt! 6 | timestamp: BigInt! 7 | blockNumber: BigInt! 8 | hash: String! 9 | } 10 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/schema.graphql: -------------------------------------------------------------------------------- 1 | type Transaction @entity { 2 | id: ID! 3 | from: String! 4 | to: String! 5 | value: BigInt! 6 | timestamp: BigInt! 7 | blockNumber: BigInt! 8 | hash: String! 9 | } 10 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/assets/README.MD: -------------------------------------------------------------------------------- 1 | # Assets 2 | 3 | `assets` is the designated folder for any additional files to be used by the squid, for example a static data file. The folder is added by default to `Dockerfile` and is kept when the squid is deployed to the Aquairum. -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/assets/README.MD: -------------------------------------------------------------------------------- 1 | # Assets 2 | 3 | `assets` is the designated folder for any additional files to be used by the squid, for example a static data file. The folder is added by default to `Dockerfile` and is kept when the squid is deployed to the Aquairum. -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/assets/README.MD: -------------------------------------------------------------------------------- 1 | # Assets 2 | 3 | `assets` is the designated folder for any additional files to be used by the squid, for example a static data file. The folder is added by default to `Dockerfile` and is kept when the squid is deployed to the Aquairum. -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | 3 | services: 4 | db: 5 | image: postgres:15 6 | environment: 7 | POSTGRES_DB: squid 8 | POSTGRES_PASSWORD: postgres 9 | ports: 10 | - "${DB_PORT}:5432" 11 | # command: ["postgres", "-c", "log_statement=all"] 12 | shm_size: 1gb 13 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | 3 | services: 4 | db: 5 | image: postgres:15 6 | environment: 7 | POSTGRES_DB: squid 8 | POSTGRES_PASSWORD: postgres 9 | ports: 10 | - "${DB_PORT}:5432" 11 | # command: ["postgres", "-c", "log_statement=all"] 12 | shm_size: 1gb 13 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/docker-compose.yml: -------------------------------------------------------------------------------- 1 | version: "3" 2 | 3 | services: 4 | db: 5 | image: postgres:15 6 | environment: 7 | POSTGRES_DB: squid 8 | POSTGRES_PASSWORD: postgres 9 | ports: 10 | - "${DB_PORT}:5432" 11 | # command: ["postgres", "-c", "log_statement=all"] 12 | shm_size: 1gb 13 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/abi/README.md: -------------------------------------------------------------------------------- 1 | # ABI folder 2 | 3 | This is a dedicated folder for ABI files. Place you contract ABI here and generate facade classes for type-safe decoding of the event, function data and contract state queries with 4 | 5 | ```sh 6 | sqd typegen 7 | ``` 8 | 9 | This `typegen` command is defined in `commands.json`. 10 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/abi/README.md: -------------------------------------------------------------------------------- 1 | # ABI folder 2 | 3 | This is a dedicated folder for ABI files. Place you contract ABI here and generate facade classes for type-safe decoding of the event, function data and contract state queries with 4 | 5 | ```sh 6 | sqd typegen 7 | ``` 8 | 9 | This `typegen` command is defined in `commands.json`. 10 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/abi/README.md: -------------------------------------------------------------------------------- 1 | # ABI folder 2 | 3 | This is a dedicated folder for ABI files. Place you contract ABI here and generate facade classes for type-safe decoding of the event, function data and contract state queries with 4 | 5 | ```sh 6 | sqd typegen 7 | ``` 8 | 9 | This `typegen` command is defined in `commands.json`. 10 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es2020", 5 | "outDir": "lib", 6 | "rootDir": "src", 7 | "strict": true, 8 | "declaration": false, 9 | "sourceMap": true, 10 | "esModuleInterop": true, 11 | "experimentalDecorators": true, 12 | "emitDecoratorMetadata": true, 13 | "skipLibCheck": true, 14 | "resolveJsonModule": true 15 | }, 16 | "include": ["src"], 17 | "exclude": [ 18 | "node_modules" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es2020", 5 | "outDir": "lib", 6 | "rootDir": "src", 7 | "strict": true, 8 | "declaration": false, 9 | "sourceMap": true, 10 | "esModuleInterop": true, 11 | "experimentalDecorators": true, 12 | "emitDecoratorMetadata": true, 13 | "skipLibCheck": true, 14 | "resolveJsonModule": true 15 | }, 16 | "include": ["src"], 17 | "exclude": [ 18 | "node_modules" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/tsconfig.json: -------------------------------------------------------------------------------- 1 | { 2 | "compilerOptions": { 3 | "module": "commonjs", 4 | "target": "es2020", 5 | "outDir": "lib", 6 | "rootDir": "src", 7 | "strict": true, 8 | "declaration": false, 9 | "sourceMap": true, 10 | "esModuleInterop": true, 11 | "experimentalDecorators": true, 12 | "emitDecoratorMetadata": true, 13 | "skipLibCheck": true, 14 | "resolveJsonModule": true 15 | }, 16 | "include": ["src"], 17 | "exclude": [ 18 | "node_modules" 19 | ] 20 | } 21 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/db/migrations/1695903016828-Data.js: -------------------------------------------------------------------------------- 1 | module.exports = class Data1695903016828 { 2 | name = 'Data1695903016828' 3 | 4 | async up(db) { 5 | await db.query(`CREATE TABLE "transaction" ("id" character varying NOT NULL, "from" text NOT NULL, "to" text NOT NULL, "value" text NOT NULL, "timestamp" numeric NOT NULL, "block_number" numeric NOT NULL, "hash" text NOT NULL, CONSTRAINT "PK_89eadb93a89810556e1cbcd6ab9" PRIMARY KEY ("id"))`) 6 | } 7 | 8 | async down(db) { 9 | await db.query(`DROP TABLE "transaction"`) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/db/migrations/1695903016828-Data.js: -------------------------------------------------------------------------------- 1 | module.exports = class Data1695903016828 { 2 | name = 'Data1695903016828' 3 | 4 | async up(db) { 5 | await db.query(`CREATE TABLE "transaction" ("id" character varying NOT NULL, "from" text NOT NULL, "to" text NOT NULL, "value" text NOT NULL, "timestamp" numeric NOT NULL, "block_number" numeric NOT NULL, "hash" text NOT NULL, CONSTRAINT "PK_89eadb93a89810556e1cbcd6ab9" PRIMARY KEY ("id"))`) 6 | } 7 | 8 | async down(db) { 9 | await db.query(`DROP TABLE "transaction"`) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/db/migrations/1695903016828-Data.js: -------------------------------------------------------------------------------- 1 | module.exports = class Data1695903016828 { 2 | name = 'Data1695903016828' 3 | 4 | async up(db) { 5 | await db.query(`CREATE TABLE "transaction" ("id" character varying NOT NULL, "from" text NOT NULL, "to" text NOT NULL, "value" text NOT NULL, "timestamp" numeric NOT NULL, "block_number" numeric NOT NULL, "hash" text NOT NULL, CONSTRAINT "PK_89eadb93a89810556e1cbcd6ab9" PRIMARY KEY ("id"))`) 6 | } 7 | 8 | async down(db) { 9 | await db.query(`DROP TABLE "transaction"`) 10 | } 11 | } 12 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/squid.yaml: -------------------------------------------------------------------------------- 1 | manifestVersion: subsquid.io/v0.1 2 | name: bnb-transfers 3 | version: 1 4 | description: 'The very first evm squid from manifest ' 5 | build: 6 | deploy: 7 | addons: 8 | postgres: 9 | rpc: 10 | - bsc:http 11 | processor: 12 | cmd: 13 | - node 14 | - lib/main 15 | api: 16 | cmd: 17 | - npx 18 | - squid-graphql-server 19 | - '--dumb-cache' 20 | - in-memory 21 | - '--dumb-cache-ttl' 22 | - '1000' 23 | - '--dumb-cache-size' 24 | - '100' 25 | - '--dumb-cache-max-age' 26 | - '1000' 27 | scale: 28 | dedicated: true 29 | 30 | 31 | processor: 32 | profile: medium -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/squid.yaml: -------------------------------------------------------------------------------- 1 | manifestVersion: subsquid.io/v0.1 2 | name: bnb-transfers-usdc 3 | version: 1 4 | description: 'The very first evm squid from manifest ' 5 | build: 6 | deploy: 7 | addons: 8 | postgres: 9 | rpc: 10 | - bsc:http 11 | processor: 12 | cmd: 13 | - node 14 | - lib/main 15 | api: 16 | cmd: 17 | - npx 18 | - squid-graphql-server 19 | - '--dumb-cache' 20 | - in-memory 21 | - '--dumb-cache-ttl' 22 | - '1000' 23 | - '--dumb-cache-size' 24 | - '100' 25 | - '--dumb-cache-max-age' 26 | - '1000' 27 | scale: 28 | dedicated: true 29 | 30 | 31 | processor: 32 | profile: medium -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/squid.yaml: -------------------------------------------------------------------------------- 1 | manifestVersion: subsquid.io/v0.1 2 | name: bnb-transfers-usdt 3 | version: 1 4 | description: 'The very first evm squid from manifest ' 5 | build: 6 | deploy: 7 | addons: 8 | postgres: 9 | rpc: 10 | - bsc:http 11 | processor: 12 | cmd: 13 | - node 14 | - lib/main 15 | api: 16 | cmd: 17 | - npx 18 | - squid-graphql-server 19 | - '--dumb-cache' 20 | - in-memory 21 | - '--dumb-cache-ttl' 22 | - '1000' 23 | - '--dumb-cache-size' 24 | - '100' 25 | - '--dumb-cache-max-age' 26 | - '1000' 27 | scale: 28 | dedicated: true 29 | 30 | 31 | processor: 32 | profile: medium -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:base" 5 | ], 6 | "packageRules": [ 7 | { 8 | "groupName": "@subsquid", 9 | "matchPackagePatterns": [ 10 | "^@subsquid/" 11 | ], 12 | "matchUpdateTypes": [ 13 | "minor", 14 | "patch", 15 | "pin", 16 | "digest" 17 | ] 18 | }, 19 | { 20 | "matchPackagePatterns": ["*"], 21 | "excludePackagePatterns": ["^@subsquid/"], 22 | "enabled": false 23 | } 24 | ], 25 | "automerge": true, 26 | "automergeType": "pr", 27 | "automergeStrategy": "squash", 28 | "ignoreTests": true 29 | } -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:base" 5 | ], 6 | "packageRules": [ 7 | { 8 | "groupName": "@subsquid", 9 | "matchPackagePatterns": [ 10 | "^@subsquid/" 11 | ], 12 | "matchUpdateTypes": [ 13 | "minor", 14 | "patch", 15 | "pin", 16 | "digest" 17 | ] 18 | }, 19 | { 20 | "matchPackagePatterns": ["*"], 21 | "excludePackagePatterns": ["^@subsquid/"], 22 | "enabled": false 23 | } 24 | ], 25 | "automerge": true, 26 | "automergeType": "pr", 27 | "automergeStrategy": "squash", 28 | "ignoreTests": true 29 | } -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/renovate.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://docs.renovatebot.com/renovate-schema.json", 3 | "extends": [ 4 | "config:base" 5 | ], 6 | "packageRules": [ 7 | { 8 | "groupName": "@subsquid", 9 | "matchPackagePatterns": [ 10 | "^@subsquid/" 11 | ], 12 | "matchUpdateTypes": [ 13 | "minor", 14 | "patch", 15 | "pin", 16 | "digest" 17 | ] 18 | }, 19 | { 20 | "matchPackagePatterns": ["*"], 21 | "excludePackagePatterns": ["^@subsquid/"], 22 | "enabled": false 23 | } 24 | ], 25 | "automerge": true, 26 | "automergeType": "pr", 27 | "automergeStrategy": "squash", 28 | "ignoreTests": true 29 | } -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "squid-evm-template", 3 | "private": true, 4 | "scripts": { 5 | "build": "rm -rf lib && tsc" 6 | }, 7 | "dependencies": { 8 | "@subsquid/archive-registry": "^3.0.0", 9 | "@subsquid/evm-processor": "^1.4.0", 10 | "@subsquid/file-store": "^1.4.0", 11 | "@subsquid/file-store-parquet": "^1.1.0", 12 | "@subsquid/file-store-s3": "^1.2.0", 13 | "@subsquid/graphql-server": "^4.2.0", 14 | "@subsquid/typeorm-migration": "^1.2.0", 15 | "@subsquid/typeorm-store": "^1.2.0", 16 | "dotenv": "^16.1.4", 17 | "ethers": "^6.5.1", 18 | "pg": "^8.11.0", 19 | "typeorm": "^0.3.16" 20 | }, 21 | "devDependencies": { 22 | "@subsquid/evm-typegen": "^3.2.0", 23 | "@subsquid/typeorm-codegen": "^1.2.0", 24 | "@types/node": "^18.16.17", 25 | "typescript": "~5.1.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "squid-evm-template", 3 | "private": true, 4 | "scripts": { 5 | "build": "rm -rf lib && tsc" 6 | }, 7 | "dependencies": { 8 | "@subsquid/archive-registry": "^3.0.0", 9 | "@subsquid/evm-processor": "^1.4.0", 10 | "@subsquid/file-store": "^1.4.0", 11 | "@subsquid/file-store-parquet": "^1.1.0", 12 | "@subsquid/file-store-s3": "^1.2.0", 13 | "@subsquid/graphql-server": "^4.2.0", 14 | "@subsquid/typeorm-migration": "^1.2.0", 15 | "@subsquid/typeorm-store": "^1.2.0", 16 | "dotenv": "^16.1.4", 17 | "ethers": "^6.5.1", 18 | "pg": "^8.11.0", 19 | "typeorm": "^0.3.16" 20 | }, 21 | "devDependencies": { 22 | "@subsquid/evm-typegen": "^3.2.0", 23 | "@subsquid/typeorm-codegen": "^1.2.0", 24 | "@types/node": "^18.16.17", 25 | "typescript": "~5.1.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "squid-evm-template", 3 | "private": true, 4 | "scripts": { 5 | "build": "rm -rf lib && tsc" 6 | }, 7 | "dependencies": { 8 | "@subsquid/archive-registry": "^3.0.0", 9 | "@subsquid/evm-processor": "^1.4.0", 10 | "@subsquid/file-store": "^1.4.0", 11 | "@subsquid/file-store-parquet": "^1.1.0", 12 | "@subsquid/file-store-s3": "^1.2.0", 13 | "@subsquid/graphql-server": "^4.2.0", 14 | "@subsquid/typeorm-migration": "^1.2.0", 15 | "@subsquid/typeorm-store": "^1.2.0", 16 | "dotenv": "^16.1.4", 17 | "ethers": "^6.5.1", 18 | "pg": "^8.11.0", 19 | "typeorm": "^0.3.16" 20 | }, 21 | "devDependencies": { 22 | "@subsquid/evm-typegen": "^3.2.0", 23 | "@subsquid/typeorm-codegen": "^1.2.0", 24 | "@types/node": "^18.16.17", 25 | "typescript": "~5.1.3" 26 | } 27 | } 28 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/src/model/generated/transaction.model.ts: -------------------------------------------------------------------------------- 1 | import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_} from "typeorm" 2 | import * as marshal from "./marshal" 3 | 4 | @Entity_() 5 | export class Transaction { 6 | constructor(props?: Partial) { 7 | Object.assign(this, props) 8 | } 9 | 10 | @PrimaryColumn_() 11 | id!: string 12 | 13 | @Column_("text", {nullable: false}) 14 | from!: string 15 | 16 | @Column_("text", {nullable: false}) 17 | to!: string 18 | 19 | @Column_("text", {nullable: false}) 20 | value!: string 21 | 22 | @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) 23 | timestamp!: bigint 24 | 25 | @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) 26 | blockNumber!: bigint 27 | 28 | @Column_("text", {nullable: false}) 29 | hash!: string 30 | } 31 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/src/model/generated/transaction.model.ts: -------------------------------------------------------------------------------- 1 | import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_} from "typeorm" 2 | import * as marshal from "./marshal" 3 | 4 | @Entity_() 5 | export class Transaction { 6 | constructor(props?: Partial) { 7 | Object.assign(this, props) 8 | } 9 | 10 | @PrimaryColumn_() 11 | id!: string 12 | 13 | @Column_("text", {nullable: false}) 14 | from!: string 15 | 16 | @Column_("text", {nullable: false}) 17 | to!: string 18 | 19 | @Column_("text", {nullable: false}) 20 | value!: string 21 | 22 | @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) 23 | timestamp!: bigint 24 | 25 | @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) 26 | blockNumber!: bigint 27 | 28 | @Column_("text", {nullable: false}) 29 | hash!: string 30 | } 31 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/src/model/generated/transaction.model.ts: -------------------------------------------------------------------------------- 1 | import {Entity as Entity_, Column as Column_, PrimaryColumn as PrimaryColumn_} from "typeorm" 2 | import * as marshal from "./marshal" 3 | 4 | @Entity_() 5 | export class Transaction { 6 | constructor(props?: Partial) { 7 | Object.assign(this, props) 8 | } 9 | 10 | @PrimaryColumn_() 11 | id!: string 12 | 13 | @Column_("text", {nullable: false}) 14 | from!: string 15 | 16 | @Column_("text", {nullable: false}) 17 | to!: string 18 | 19 | @Column_("text", {nullable: false}) 20 | value!: string 21 | 22 | @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) 23 | timestamp!: bigint 24 | 25 | @Column_("numeric", {transformer: marshal.bigintTransformer, nullable: false}) 26 | blockNumber!: bigint 27 | 28 | @Column_("text", {nullable: false}) 29 | hash!: string 30 | } 31 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Subsquid Labs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Subsquid Labs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2023 Subsquid Labs 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/src/processor.ts: -------------------------------------------------------------------------------- 1 | import { lookupArchive } from "@subsquid/archive-registry"; 2 | import { 3 | BlockHeader, 4 | DataHandlerContext, 5 | EvmBatchProcessor, 6 | EvmBatchProcessorFields, 7 | Log as _Log, 8 | Transaction as _Transaction, 9 | } from "@subsquid/evm-processor"; 10 | 11 | export const processor = new EvmBatchProcessor() 12 | .setDataSource({ 13 | // Change the Archive endpoints for run the squid 14 | // against the other EVM networks 15 | // For a full list of supported networks and config options 16 | // see https://docs.subsquid.io/evm-indexing/ 17 | archive: lookupArchive("binance"), 18 | // Must be set for RPC ingestion (https://docs.subsquid.io/evm-indexing/evm-processor/) 19 | // OR to enable contract state queries (https://docs.subsquid.io/evm-indexing/query-state/) 20 | chain: "https://rpc.ankr.com/bsc", 21 | }) 22 | .setFinalityConfirmation(75) 23 | .setFields({ 24 | transaction: { 25 | from: true, 26 | to: true, 27 | value: true, 28 | hash: true, 29 | }, 30 | }) 31 | .setBlockRange({ 32 | from: 0, 33 | }) 34 | .addTransaction({}); 35 | 36 | export type Fields = EvmBatchProcessorFields; 37 | export type Block = BlockHeader; 38 | export type Log = _Log; 39 | export type Transaction = _Transaction; 40 | export type ProcessorContext = DataHandlerContext; 41 | -------------------------------------------------------------------------------- /bnb-native-transfers/README.MD: -------------------------------------------------------------------------------- 1 | # Ethereum Contracts Dataset 2 | 3 | This is a dataset of all historical BNB transfers on Binance Smart Chain. 4 | 5 | # Usage 6 | 7 | Some example uses of this dataset include: 8 | 9 | - look up BNB amounts transferred to an address 10 | - analyze distribution of BNB transfers over time 11 | 12 | # Schema 13 | 14 | NFT transfers Dataset 15 | 16 | | column | type | description | 17 | | ------------ | ------ | ----------------- | 18 | | from | STRING | sender address | 19 | | to | STRING | receiver address | 20 | | tx_hash | STRING | transaction hash | 21 | | value | STRING | value transferred | 22 | | timestamp | INT64 | timestamp | 23 | | block_number | INT64 | block number | 24 | 25 | # Querying 26 | 27 | List Objects in the bucket using AWS SDK. Prefixes represent block ranges. 28 | Now you can query desired block range file using duck db: 29 | `SELECT * FROM 'https://all-contracts-eth-hex.sqd-datasets.io/0000000000-0000646199/contracts.parquet';` 30 | 31 | # Dataset Access 32 | 33 | - `endpoint_url = 'https://7a28e49ec5f4a60c66f216392792ac38.r2.cloudflarestorage.com',` 34 | - `aws_access_key_id = '1f25ab4babdb705e3f184709dc88c837',` 35 | - `aws_secret_access_key = '0e853ebdf7872e96cb845f64237c14f1c29131c09565b5a610923526aea06791'` 36 | 37 | - Bucket info 38 | 39 | - bucket name: bnb-transfer-values 40 | - [https://bnb-transfers.sqd-datasets.io](https://bnb-transfers.sqd-datasets.io) 41 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/README.MD: -------------------------------------------------------------------------------- 1 | # Ethereum Contracts Dataset 2 | 3 | This is a dataset of all historical USDC transfers on Binance Smart Chain. 4 | 5 | # Usage 6 | 7 | Some example uses of this dataset include: 8 | 9 | - look up USDC amounts transferred to an address 10 | - analyze distribution of USDC transfers over time 11 | 12 | # Schema 13 | 14 | NFT transfers Dataset 15 | 16 | | column | type | description | 17 | | ------------ | ------ | ----------------- | 18 | | from | STRING | sender address | 19 | | to | STRING | receiver address | 20 | | tx_hash | STRING | transaction hash | 21 | | value | STRING | value transferred | 22 | | timestamp | INT64 | timestamp | 23 | | block_number | INT64 | block number | 24 | 25 | # Querying 26 | 27 | List Objects in the bucket using AWS SDK. Prefixes represent block ranges. 28 | Now you can query desired block range file using duck db: 29 | `SELECT * FROM 'https://all-contracts-eth-hex.sqd-datasets.io/0000000000-0000646199/contracts.parquet';` 30 | 31 | # Dataset Access 32 | 33 | - `endpoint_url = 'https://7a28e49ec5f4a60c66f216392792ac38.r2.cloudflarestorage.com',` 34 | - `aws_access_key_id = '1f25ab4babdb705e3f184709dc88c837',` 35 | - `aws_secret_access_key = '0e853ebdf7872e96cb845f64237c14f1c29131c09565b5a610923526aea06791'` 36 | 37 | - Bucket info 38 | 39 | - bucket name: busdc-transfers 40 | - [https://busdc-transfers.sqd-datasets.io](https://busdc-transfers.sqd-datasets.io) 41 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/README.md: -------------------------------------------------------------------------------- 1 | # Ethereum Contracts Dataset 2 | 3 | This is a dataset of all historical USDT transfers on Binance Smart Chain. 4 | 5 | # Usage 6 | 7 | Some example uses of this dataset include: 8 | 9 | - look up USDT amounts transferred to an address 10 | - analyze distribution of USDT transfers over time 11 | 12 | # Schema 13 | 14 | NFT transfers Dataset 15 | 16 | | column | type | description | 17 | | ------------ | ------ | ----------------- | 18 | | from | STRING | sender address | 19 | | to | STRING | receiver address | 20 | | tx_hash | STRING | transaction hash | 21 | | value | STRING | value transferred | 22 | | timestamp | INT64 | timestamp | 23 | | block_number | INT64 | block number | 24 | 25 | # Querying 26 | 27 | List Objects in the bucket using AWS SDK. Prefixes represent block ranges. 28 | Now you can query desired block range file using duck db: 29 | `SELECT * FROM 'https://all-contracts-eth-hex.sqd-datasets.io/0000000000-0000646199/contracts.parquet';` 30 | 31 | # Dataset Access 32 | 33 | - `endpoint_url = 'https://7a28e49ec5f4a60c66f216392792ac38.r2.cloudflarestorage.com',` 34 | - `aws_access_key_id = '4836dd55b4430430496abc240a56cd41',` 35 | - `aws_secret_access_key = '2ac5990e5e6416be916dd4accb77cc158426285cd8552a14d6d5a52d6a65630c'` 36 | 37 | - Bucket info 38 | 39 | - bucket name: busdt-transfers 40 | - [https://busdt-transfers.sqd-datasets.io](https://busdt-transfers.sqd-datasets.io) 41 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/.gitpod.yml: -------------------------------------------------------------------------------- 1 | # This configuration file was automatically generated by Gitpod. 2 | # Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) 3 | # and commit this file to your remote git repository to share the goodness with others. 4 | 5 | # Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart 6 | github: 7 | prebuilds: 8 | # enable for the master/default branch (defaults to true) 9 | master: true 10 | # enable for all branches in this repo (defaults to false) 11 | branches: false 12 | # enable for pull requests coming from this repo (defaults to true) 13 | pullRequests: true 14 | # add a check to pull requests (defaults to true) 15 | addCheck: true 16 | # add a "Review in Gitpod" button as a comment to pull requests (defaults to false) 17 | addComment: false 18 | 19 | tasks: 20 | - init: | 21 | npm i 22 | npm i -g @subsquid/cli 23 | docker compose pull 24 | gp sync-done setup 25 | - name: DB 26 | command: | 27 | gp sync-await setup 28 | sqd up 29 | - name: GraphQL API 30 | command: | 31 | gp sync-await setup 32 | sqd serve 33 | - command: | 34 | gp ports await 4350 35 | gp preview $(gp url 4350)/graphql 36 | - name: Squid procesor 37 | command: | 38 | gp open src/processor.ts 39 | gp sync-await setup 40 | sqd build 41 | gp ports await 23798 42 | sqd process 43 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/.gitpod.yml: -------------------------------------------------------------------------------- 1 | # This configuration file was automatically generated by Gitpod. 2 | # Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) 3 | # and commit this file to your remote git repository to share the goodness with others. 4 | 5 | # Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart 6 | github: 7 | prebuilds: 8 | # enable for the master/default branch (defaults to true) 9 | master: true 10 | # enable for all branches in this repo (defaults to false) 11 | branches: false 12 | # enable for pull requests coming from this repo (defaults to true) 13 | pullRequests: true 14 | # add a check to pull requests (defaults to true) 15 | addCheck: true 16 | # add a "Review in Gitpod" button as a comment to pull requests (defaults to false) 17 | addComment: false 18 | 19 | tasks: 20 | - init: | 21 | npm i 22 | npm i -g @subsquid/cli 23 | docker compose pull 24 | gp sync-done setup 25 | - name: DB 26 | command: | 27 | gp sync-await setup 28 | sqd up 29 | - name: GraphQL API 30 | command: | 31 | gp sync-await setup 32 | sqd serve 33 | - command: | 34 | gp ports await 4350 35 | gp preview $(gp url 4350)/graphql 36 | - name: Squid procesor 37 | command: | 38 | gp open src/processor.ts 39 | gp sync-await setup 40 | sqd build 41 | gp ports await 23798 42 | sqd process 43 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/.gitpod.yml: -------------------------------------------------------------------------------- 1 | # This configuration file was automatically generated by Gitpod. 2 | # Please adjust to your needs (see https://www.gitpod.io/docs/introduction/learn-gitpod/gitpod-yaml) 3 | # and commit this file to your remote git repository to share the goodness with others. 4 | 5 | # Learn more from ready-to-use templates: https://www.gitpod.io/docs/introduction/getting-started/quickstart 6 | github: 7 | prebuilds: 8 | # enable for the master/default branch (defaults to true) 9 | master: true 10 | # enable for all branches in this repo (defaults to false) 11 | branches: false 12 | # enable for pull requests coming from this repo (defaults to true) 13 | pullRequests: true 14 | # add a check to pull requests (defaults to true) 15 | addCheck: true 16 | # add a "Review in Gitpod" button as a comment to pull requests (defaults to false) 17 | addComment: false 18 | 19 | tasks: 20 | - init: | 21 | npm i 22 | npm i -g @subsquid/cli 23 | docker compose pull 24 | gp sync-done setup 25 | - name: DB 26 | command: | 27 | gp sync-await setup 28 | sqd up 29 | - name: GraphQL API 30 | command: | 31 | gp sync-await setup 32 | sqd serve 33 | - command: | 34 | gp ports await 4350 35 | gp preview $(gp url 4350)/graphql 36 | - name: Squid procesor 37 | command: | 38 | gp open src/processor.ts 39 | gp sync-await setup 40 | sqd build 41 | gp ports await 23798 42 | sqd process 43 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/src/processor.ts: -------------------------------------------------------------------------------- 1 | import { lookupArchive } from "@subsquid/archive-registry"; 2 | import { 3 | BlockHeader, 4 | DataHandlerContext, 5 | EvmBatchProcessor, 6 | EvmBatchProcessorFields, 7 | Log as _Log, 8 | Transaction as _Transaction, 9 | } from "@subsquid/evm-processor"; 10 | import * as busdc from "./abi/busdc"; 11 | export const processor = new EvmBatchProcessor() 12 | .setDataSource({ 13 | // Change the Archive endpoints for run the squid 14 | // against the other EVM networks 15 | // For a full list of supported networks and config options 16 | // see https://docs.subsquid.io/evm-indexing/ 17 | archive: lookupArchive("binance"), 18 | // Must be set for RPC ingestion (https://docs.subsquid.io/evm-indexing/evm-processor/) 19 | // OR to enable contract state queries (https://docs.subsquid.io/evm-indexing/query-state/) 20 | chain: "https://rpc.ankr.com/bsc", 21 | }) 22 | .setFinalityConfirmation(75) 23 | .setFields({ 24 | transaction: { 25 | from: true, 26 | to: true, 27 | value: true, 28 | hash: true, 29 | }, 30 | }) 31 | .setBlockRange({ 32 | from: 0, 33 | }) 34 | .addLog({ 35 | address: ["0x8AC76a51cc950d9822D68b83fE1Ad97B32Cd580d"], 36 | topic0: [busdc.events.Transfer.topic], 37 | transaction: true, 38 | }); 39 | 40 | export type Fields = EvmBatchProcessorFields; 41 | export type Block = BlockHeader; 42 | export type Log = _Log; 43 | export type Transaction = _Transaction; 44 | export type ProcessorContext = DataHandlerContext; 45 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/src/processor.ts: -------------------------------------------------------------------------------- 1 | import { lookupArchive } from "@subsquid/archive-registry"; 2 | import { 3 | BlockHeader, 4 | DataHandlerContext, 5 | EvmBatchProcessor, 6 | EvmBatchProcessorFields, 7 | Log as _Log, 8 | Transaction as _Transaction, 9 | } from "@subsquid/evm-processor"; 10 | import * as busdt from "./abi/busdt"; 11 | export const processor = new EvmBatchProcessor() 12 | .setDataSource({ 13 | // Change the Archive endpoints for run the squid 14 | // against the other EVM networks 15 | // For a full list of supported networks and config options 16 | // see https://docs.subsquid.io/evm-indexing/ 17 | archive: lookupArchive("binance"), 18 | // Must be set for RPC ingestion (https://docs.subsquid.io/evm-indexing/evm-processor/) 19 | // OR to enable contract state queries (https://docs.subsquid.io/evm-indexing/query-state/) 20 | chain: "https://rpc.ankr.com/bsc", 21 | }) 22 | .setFinalityConfirmation(75) 23 | .setFields({ 24 | transaction: { 25 | from: true, 26 | to: true, 27 | value: true, 28 | hash: true, 29 | }, 30 | }) 31 | .setBlockRange({ 32 | from: 176410, 33 | }) 34 | .addLog({ 35 | address: ["0x55d398326f99059fF775485246999027B3197955"], 36 | topic0: [busdt.events.Transfer.topic], 37 | transaction: true, 38 | }); 39 | 40 | export type Fields = EvmBatchProcessorFields; 41 | export type Block = BlockHeader; 42 | export type Log = _Log; 43 | export type Transaction = _Transaction; 44 | export type ProcessorContext = DataHandlerContext; 45 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 | 4 | Subsquid Logo 5 | 6 |

7 | 8 | [![docs.rs](https://docs.rs/leptos/badge.svg)](https://docs.subsquid.io/) 9 | [![Discord](https://img.shields.io/discord/1031524867910148188?color=%237289DA&label=discord)](https://discord.gg/subsquid) 10 | 11 | [Website](https://subsquid.io) | [Docs](https://docs.subsquid.io/) | [Discord](https://discord.gg/subsquid) 12 | 13 | # Subsquid Datasets Repo 14 | 15 | Collection of blockchain datasets gathered with Squid SDK. 16 | 17 | ## Datasets 18 | 19 | - [`ethereum_contracts`](https://github.com/subsquid-labs/Subsquid-Datasets/tree/main/ethereum-contracts): all historical contract deployments 20 | - [`ethereum_nft_transfers`](https://github.com/subsquid-labs/Subsquid-Datasets/tree/main/ethereum-nft-transfers): all native NFT transfers 21 | - [`bnb-native-transfers`](https://github.com/subsquid-labs/Subsquid-Datasets/tree/main/bnb-native-transfers): all native BNB transfers on Binance Smart Chain 22 | - [`bnb-usdc-transfers`](https://github.com/subsquid-labs/Subsquid-Datasets/tree/main/bnb-transfers-usdc): all native USDC transfers on Binance Smart Chain 23 | - [`bnb-usdt-transfers`](https://github.com/subsquid-labs/Subsquid-Datasets/tree/main/bnb-transfers-usdt): all native USDT transfers on Binance Smart Chain 24 | 25 | ## Usage 26 | 27 | This repository contains bucket information for parquet datasets, Puthon notebooks with example usage and the Squids used to gather the data. 28 | -------------------------------------------------------------------------------- /ethereum-nft-transfers/README.MD: -------------------------------------------------------------------------------- 1 | # Ethereum Contracts Dataset 2 | 3 | This is a dataset of all historical NFT transfers. 4 | 5 | # Usage 6 | 7 | Some example uses of this dataset include: 8 | 9 | - look up all NFTs transfered to an address 10 | - analyze distribution of NFT transfers over time 11 | 12 | # Schema 13 | 14 | NFT transfers Dataset 15 | 16 | | column | type | description | 17 | | ---------------- | --------- | -------------------------------------------------- | 18 | | block_height | INTEGER | block number when contract was created | 19 | | transaction_hash | STRING | hash of the transaction where contract was created | 20 | | contract_address | STRING | address of the deployed cotract | 21 | | token_id | STRING | token id | 22 | | block_signed_at | TIMESTAMP | timestamp | 23 | | succesfull | BOOL | if transaction was successful | 24 | | value | STRING | transaction value | 25 | | gas_price | STRING | gas price at the time of transaction | 26 | | gas_spent | STRING | gas spent on transaction | 27 | | fee_paid | STRING | fee paid by the user | 28 | 29 | # Querying 30 | 31 | List Objects in the bucket using AWS SDK. Prefixes represent block ranges. 32 | Now you can query desired block range file using duck db: 33 | `SELECT * FROM 'https://all-contracts-eth-hex.sqd-datasets.io/0000000000-0000646199/contracts.parquet';` 34 | 35 | # Dataset Access 36 | 37 | - `endpoint_url = 'https://7a28e49ec5f4a60c66f216392792ac38.r2.cloudflarestorage.com',` 38 | - `aws_access_key_id = '1c0813c8e198be6695975d424fdeda05',` 39 | - `aws_secret_access_key = '5276c800edd5049f6b6f10487e4e769e440db4e928d1f29cb7202b5158b49b74'` 40 | 41 | - Bucket info 42 | 43 | - bucket name: all-nft-transfers-eth-test-v1 44 | - [https://nft-transfers.sqd-datasets.io](https://nft-transfers.sqd-datasets.io) 45 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/src/main.ts: -------------------------------------------------------------------------------- 1 | import { TypeormDatabase } from "@subsquid/typeorm-store"; 2 | import { Transaction } from "./model"; 3 | import { processor } from "./processor"; 4 | import { Database } from "@subsquid/file-store"; 5 | 6 | import { S3Dest } from "@subsquid/file-store-s3"; 7 | import { Column, Table, Types } from "@subsquid/file-store-parquet"; 8 | const dbOptions = { 9 | tables: { 10 | TransfersTable: new Table( 11 | "transfers.parquet", 12 | { 13 | from: Column(Types.String()), 14 | to: Column(Types.String()), 15 | tx_hash: Column(Types.String()), 16 | value: Column(Types.String()), 17 | timestamp: Column(Types.Int64()), 18 | block_number: Column(Types.Int64()), 19 | }, 20 | { 21 | compression: "GZIP", 22 | rowGroupSize: 300000, 23 | pageSize: 1000, 24 | } 25 | ), 26 | }, 27 | dest: new S3Dest( 28 | "./", 29 | "bnb-transfer-values", //assertNotNull(process.env.S3_BUCKET_NAME), 30 | { 31 | region: "us-east-1", 32 | 33 | endpoint: "ENDPOINT_URL", 34 | credentials: { 35 | accessKeyId: "ACCESS_KEY_ID", //accessKeyId: assertNotNull(process.env.S3_ACCESS_KEY_ID), 36 | secretAccessKey: "SECRET_KEY", // secretAccessKey: assertNotNull(process.env.S3_SECRET_ACCESS_KEY) 37 | }, 38 | } 39 | ), 40 | chunkSizeMb: 10, 41 | }; 42 | 43 | processor.run(new Database(dbOptions), async (ctx) => { 44 | const transactions = []; 45 | for (let c of ctx.blocks) { 46 | for (let tx of c.transactions) { 47 | // decode and normalize the tx data 48 | if (tx.value != BigInt(0)) { 49 | transactions.push({ 50 | block_number: BigInt(c.header.height), 51 | from: tx.from, 52 | to: tx.to || "0x", 53 | timestamp: BigInt(c.header.timestamp), 54 | value: tx.value.toString(), 55 | tx_hash: tx.hash, 56 | }); 57 | } 58 | } 59 | } 60 | // apply vectorized transformations and aggregations 61 | 62 | // upsert batches of entities with batch-optimized ctx.store.save 63 | await ctx.store.TransfersTable.writeMany(transactions); 64 | }); 65 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/src/main.ts: -------------------------------------------------------------------------------- 1 | import { TypeormDatabase } from "@subsquid/typeorm-store"; 2 | import { Transaction } from "./model"; 3 | import { processor } from "./processor"; 4 | import { Database } from "@subsquid/file-store"; 5 | import * as busdc from "./abi/busdc"; 6 | import { S3Dest } from "@subsquid/file-store-s3"; 7 | import { Column, Table, Types } from "@subsquid/file-store-parquet"; 8 | const dbOptions = { 9 | tables: { 10 | TransfersTable: new Table( 11 | "transfers.parquet", 12 | { 13 | from: Column(Types.String()), 14 | to: Column(Types.String()), 15 | tx_hash: Column(Types.String()), 16 | value: Column(Types.String()), 17 | timestamp: Column(Types.Int64()), 18 | block_number: Column(Types.Int64()), 19 | }, 20 | { 21 | compression: "GZIP", 22 | rowGroupSize: 300000, 23 | pageSize: 1000, 24 | } 25 | ), 26 | }, 27 | dest: new S3Dest( 28 | "./", 29 | "busdc-transfers", //assertNotNull(process.env.S3_BUCKET_NAME), 30 | { 31 | region: "us-east-1", 32 | 33 | endpoint: "ENDPOINT_URL", 34 | credentials: { 35 | accessKeyId: "ACCESS_KEY_ID", //accessKeyId: assertNotNull(process.env.S3_ACCESS_KEY_ID), 36 | secretAccessKey: "SECRET_KEY", // secretAccessKey: assertNotNull(process.env.S3_SECRET_ACCESS_KEY) 37 | }, 38 | } 39 | ), 40 | chunkSizeMb: 10, 41 | }; 42 | 43 | processor.run(new Database(dbOptions), async (ctx) => { 44 | const transactions = []; 45 | for (let c of ctx.blocks) { 46 | for (let log of c.logs) { 47 | // decode and normalize the tx data 48 | let { from, to, value } = busdc.events.Transfer.decode(log); 49 | if (value != BigInt(0)) { 50 | transactions.push({ 51 | block_number: BigInt(c.header.height), 52 | from: from, 53 | to: to || "0x", 54 | timestamp: BigInt(c.header.timestamp), 55 | value: value.toString(), 56 | tx_hash: log.transaction?.hash || "0x", 57 | }); 58 | } 59 | } 60 | } 61 | // apply vectorized transformations and aggregations 62 | 63 | // upsert batches of entities with batch-optimized ctx.store.save 64 | await ctx.store.TransfersTable.writeMany(transactions); 65 | }); 66 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/src/main.ts: -------------------------------------------------------------------------------- 1 | import { TypeormDatabase } from "@subsquid/typeorm-store"; 2 | import { Transaction } from "./model"; 3 | import { processor } from "./processor"; 4 | import { Database } from "@subsquid/file-store"; 5 | import * as busdt from "./abi/busdt"; 6 | import { S3Dest } from "@subsquid/file-store-s3"; 7 | import { Column, Table, Types } from "@subsquid/file-store-parquet"; 8 | const dbOptions = { 9 | tables: { 10 | TransfersTable: new Table( 11 | "transfers.parquet", 12 | { 13 | from: Column(Types.String()), 14 | to: Column(Types.String()), 15 | tx_hash: Column(Types.String()), 16 | value: Column(Types.String()), 17 | timestamp: Column(Types.Int64()), 18 | block_number: Column(Types.Int64()), 19 | }, 20 | { 21 | compression: "GZIP", 22 | rowGroupSize: 300000, 23 | pageSize: 1000, 24 | } 25 | ), 26 | }, 27 | dest: new S3Dest( 28 | "./", 29 | "busdt-transfers", //assertNotNull(process.env.S3_BUCKET_NAME), 30 | { 31 | region: "us-east-1", 32 | 33 | endpoint: "ENDPOINT_URL", 34 | credentials: { 35 | accessKeyId: "ACCESS_KEY_ID", //accessKeyId: assertNotNull(process.env.S3_ACCESS_KEY_ID), 36 | secretAccessKey: "SECRET_KEY", // secretAccessKey: assertNotNull(process.env.S3_SECRET_ACCESS_KEY) 37 | }, 38 | } 39 | ), 40 | chunkSizeMb: 10, 41 | }; 42 | 43 | processor.run(new Database(dbOptions), async (ctx) => { 44 | const transactions = []; 45 | for (let c of ctx.blocks) { 46 | for (let log of c.logs) { 47 | // decode and normalize the tx data 48 | let { from, to, value } = busdt.events.Transfer.decode(log); 49 | if (value != BigInt(0)) { 50 | transactions.push({ 51 | block_number: BigInt(c.header.height), 52 | from: from, 53 | to: to || "0x", 54 | timestamp: BigInt(c.header.timestamp), 55 | value: value.toString(), 56 | tx_hash: log.transaction?.hash || "0x", 57 | }); 58 | } 59 | } 60 | } 61 | // apply vectorized transformations and aggregations 62 | 63 | // upsert batches of entities with batch-optimized ctx.store.save 64 | await ctx.store.TransfersTable.writeMany(transactions); 65 | }); 66 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/commands.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://cdn.subsquid.io/schemas/commands.json", 3 | "commands": { 4 | "clean": { 5 | "description": "delete all build artifacts", 6 | "cmd": ["npx", "--yes", "rimraf", "lib"] 7 | }, 8 | "build": { 9 | "description": "Build the squid project", 10 | "deps": ["clean"], 11 | "cmd": ["tsc"] 12 | }, 13 | "up": { 14 | "description": "Start a PG database", 15 | "cmd": ["docker-compose", "up", "-d"] 16 | }, 17 | "down": { 18 | "description": "Drop a PG database", 19 | "cmd": ["docker-compose", "down"] 20 | }, 21 | "migration:apply": { 22 | "description": "Apply the DB migrations", 23 | "cmd": ["squid-typeorm-migration", "apply"] 24 | }, 25 | "migration:generate": { 26 | "description": "Generate a DB migration matching the TypeORM entities", 27 | "deps": ["build", "migration:clean"], 28 | "cmd": ["squid-typeorm-migration", "generate"], 29 | }, 30 | "migration:clean": { 31 | "description": "Clean the migrations folder", 32 | "cmd": ["npx", "--yes", "rimraf", "./db/migrations"], 33 | }, 34 | "migration": { 35 | "deps": ["build"], 36 | "cmd": ["squid-typeorm-migration", "generate"], 37 | "hidden": true 38 | }, 39 | "codegen": { 40 | "description": "Generate TypeORM entities from the schema file", 41 | "cmd": ["squid-typeorm-codegen"] 42 | }, 43 | "typegen": { 44 | "description": "Generate data access classes for an ABI file(s) in the ./abi folder", 45 | "cmd": ["squid-evm-typegen", "./src/abi", {"glob": "./abi/*.json"}, "--multicall"] 46 | }, 47 | "process": { 48 | "description": "Load .env and start the squid processor", 49 | "deps": ["build", "migration:apply"], 50 | "cmd": ["node", "--require=dotenv/config", "lib/main.js"] 51 | }, 52 | "process:prod": { 53 | "description": "Start the squid processor", 54 | "deps": ["migration:apply"], 55 | "cmd": ["node", "lib/main.js"], 56 | "hidden": true 57 | }, 58 | "serve": { 59 | "description": "Start the GraphQL API server", 60 | "cmd": ["squid-graphql-server"] 61 | }, 62 | "serve:prod": { 63 | "description": "Start the GraphQL API server with caching and limits", 64 | "cmd": ["squid-graphql-server", 65 | "--dumb-cache", "in-memory", 66 | "--dumb-cache-ttl", "1000", 67 | "--dumb-cache-size", "100", 68 | "--dumb-cache-max-age", "1000" ] 69 | }, 70 | "check-updates": { 71 | "cmd": ["npx", "--yes", "npm-check-updates", "--filter=/subsquid/", "--upgrade"], 72 | "hidden": true 73 | }, 74 | "bump": { 75 | "description": "Bump @subsquid packages to the latest versions", 76 | "deps": ["check-updates"], 77 | "cmd": ["npm", "i", "-f"] 78 | }, 79 | "open": { 80 | "description": "Open a local browser window", 81 | "cmd": ["npx", "--yes", "opener"] 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/commands.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://cdn.subsquid.io/schemas/commands.json", 3 | "commands": { 4 | "clean": { 5 | "description": "delete all build artifacts", 6 | "cmd": ["npx", "--yes", "rimraf", "lib"] 7 | }, 8 | "build": { 9 | "description": "Build the squid project", 10 | "deps": ["clean"], 11 | "cmd": ["tsc"] 12 | }, 13 | "up": { 14 | "description": "Start a PG database", 15 | "cmd": ["docker-compose", "up", "-d"] 16 | }, 17 | "down": { 18 | "description": "Drop a PG database", 19 | "cmd": ["docker-compose", "down"] 20 | }, 21 | "migration:apply": { 22 | "description": "Apply the DB migrations", 23 | "cmd": ["squid-typeorm-migration", "apply"] 24 | }, 25 | "migration:generate": { 26 | "description": "Generate a DB migration matching the TypeORM entities", 27 | "deps": ["build", "migration:clean"], 28 | "cmd": ["squid-typeorm-migration", "generate"], 29 | }, 30 | "migration:clean": { 31 | "description": "Clean the migrations folder", 32 | "cmd": ["npx", "--yes", "rimraf", "./db/migrations"], 33 | }, 34 | "migration": { 35 | "deps": ["build"], 36 | "cmd": ["squid-typeorm-migration", "generate"], 37 | "hidden": true 38 | }, 39 | "codegen": { 40 | "description": "Generate TypeORM entities from the schema file", 41 | "cmd": ["squid-typeorm-codegen"] 42 | }, 43 | "typegen": { 44 | "description": "Generate data access classes for an ABI file(s) in the ./abi folder", 45 | "cmd": ["squid-evm-typegen", "./src/abi", {"glob": "./abi/*.json"}, "--multicall"] 46 | }, 47 | "process": { 48 | "description": "Load .env and start the squid processor", 49 | "deps": ["build", "migration:apply"], 50 | "cmd": ["node", "--require=dotenv/config", "lib/main.js"] 51 | }, 52 | "process:prod": { 53 | "description": "Start the squid processor", 54 | "deps": ["migration:apply"], 55 | "cmd": ["node", "lib/main.js"], 56 | "hidden": true 57 | }, 58 | "serve": { 59 | "description": "Start the GraphQL API server", 60 | "cmd": ["squid-graphql-server"] 61 | }, 62 | "serve:prod": { 63 | "description": "Start the GraphQL API server with caching and limits", 64 | "cmd": ["squid-graphql-server", 65 | "--dumb-cache", "in-memory", 66 | "--dumb-cache-ttl", "1000", 67 | "--dumb-cache-size", "100", 68 | "--dumb-cache-max-age", "1000" ] 69 | }, 70 | "check-updates": { 71 | "cmd": ["npx", "--yes", "npm-check-updates", "--filter=/subsquid/", "--upgrade"], 72 | "hidden": true 73 | }, 74 | "bump": { 75 | "description": "Bump @subsquid packages to the latest versions", 76 | "deps": ["check-updates"], 77 | "cmd": ["npm", "i", "-f"] 78 | }, 79 | "open": { 80 | "description": "Open a local browser window", 81 | "cmd": ["npx", "--yes", "opener"] 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/commands.json: -------------------------------------------------------------------------------- 1 | { 2 | "$schema": "https://cdn.subsquid.io/schemas/commands.json", 3 | "commands": { 4 | "clean": { 5 | "description": "delete all build artifacts", 6 | "cmd": ["npx", "--yes", "rimraf", "lib"] 7 | }, 8 | "build": { 9 | "description": "Build the squid project", 10 | "deps": ["clean"], 11 | "cmd": ["tsc"] 12 | }, 13 | "up": { 14 | "description": "Start a PG database", 15 | "cmd": ["docker-compose", "up", "-d"] 16 | }, 17 | "down": { 18 | "description": "Drop a PG database", 19 | "cmd": ["docker-compose", "down"] 20 | }, 21 | "migration:apply": { 22 | "description": "Apply the DB migrations", 23 | "cmd": ["squid-typeorm-migration", "apply"] 24 | }, 25 | "migration:generate": { 26 | "description": "Generate a DB migration matching the TypeORM entities", 27 | "deps": ["build", "migration:clean"], 28 | "cmd": ["squid-typeorm-migration", "generate"], 29 | }, 30 | "migration:clean": { 31 | "description": "Clean the migrations folder", 32 | "cmd": ["npx", "--yes", "rimraf", "./db/migrations"], 33 | }, 34 | "migration": { 35 | "deps": ["build"], 36 | "cmd": ["squid-typeorm-migration", "generate"], 37 | "hidden": true 38 | }, 39 | "codegen": { 40 | "description": "Generate TypeORM entities from the schema file", 41 | "cmd": ["squid-typeorm-codegen"] 42 | }, 43 | "typegen": { 44 | "description": "Generate data access classes for an ABI file(s) in the ./abi folder", 45 | "cmd": ["squid-evm-typegen", "./src/abi", {"glob": "./abi/*.json"}, "--multicall"] 46 | }, 47 | "process": { 48 | "description": "Load .env and start the squid processor", 49 | "deps": ["build", "migration:apply"], 50 | "cmd": ["node", "--require=dotenv/config", "lib/main.js"] 51 | }, 52 | "process:prod": { 53 | "description": "Start the squid processor", 54 | "deps": ["migration:apply"], 55 | "cmd": ["node", "lib/main.js"], 56 | "hidden": true 57 | }, 58 | "serve": { 59 | "description": "Start the GraphQL API server", 60 | "cmd": ["squid-graphql-server"] 61 | }, 62 | "serve:prod": { 63 | "description": "Start the GraphQL API server with caching and limits", 64 | "cmd": ["squid-graphql-server", 65 | "--dumb-cache", "in-memory", 66 | "--dumb-cache-ttl", "1000", 67 | "--dumb-cache-size", "100", 68 | "--dumb-cache-max-age", "1000" ] 69 | }, 70 | "check-updates": { 71 | "cmd": ["npx", "--yes", "npm-check-updates", "--filter=/subsquid/", "--upgrade"], 72 | "hidden": true 73 | }, 74 | "bump": { 75 | "description": "Bump @subsquid packages to the latest versions", 76 | "deps": ["check-updates"], 77 | "cmd": ["npm", "i", "-f"] 78 | }, 79 | "open": { 80 | "description": "Open a local browser window", 81 | "cmd": ["npx", "--yes", "opener"] 82 | } 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /ethereum-contracts/README.MD: -------------------------------------------------------------------------------- 1 | # Ethereum Contracts Dataset 2 | 3 | This is a dataset of all historical contract deployments. 4 | 5 | # Usage 6 | 7 | Some example uses of this dataset include: 8 | 9 | - look up all contracts deployed by an address 10 | - look up all contracts that have a given bytecode 11 | - analyze distribution of contract bytecode motifs 12 | 13 | # Schema 14 | 15 | Bin Format Contracts Dataset 16 | 17 | | column | type | description | 18 | | ---------------- | ------- | -------------------------------------------------- | 19 | | block_number | INTEGER | block number when contract was created | 20 | | create_index | INTEGER | transaction index | 21 | | kind | INTEGER | ERC contract type determined by ducktyping | 22 | | transaction_hash | BINARY | hash of the transaction where contract was created | 23 | | contract_address | BINARY | address of the deployed cotract | 24 | | deployer | BINARY | EOA that deployed the contract | 25 | | factory | BINARY | the `from` field in the creation trace | 26 | | init_code | BINARY | initialization bytecode of contract | 27 | | code | BINARY | bytecode of contract | 28 | | init_code_hash | BINARY | keccak hash of contract initialization code | 29 | | code_hash | BINARY | keccak hash of contract bytecode | 30 | 31 | Hex Format Contracts Dataset 32 | 33 | | column | type | description | 34 | | ---------------- | ------- | -------------------------------------------------- | 35 | | block_number | INTEGER | block number when contract was created | 36 | | create_index | INTEGER | transaction index | 37 | | kind | INTEGER | ERC contract type determined by ducktyping | 38 | | transaction_hash | STRING | hash of the transaction where contract was created | 39 | | contract_address | STRING | address of the deployed cotract | 40 | | deployer | STRING | EOA that deployed the contract | 41 | | factory | STRING | the `from` field in the creation trace | 42 | | init_code | STRING | initialization bytecode of contract | 43 | | code | STRING | bytecode of contract | 44 | | init_code_hash | STRING | keccak hash of contract initialization code | 45 | | code_hash | STRING | Ckeccak hash of contract bytecode | 46 | 47 | # Querying 48 | 49 | List Objects in the bucket using AWS SDK. Prefixes represent block ranges. 50 | Now you can query desired block range file using duck db: 51 | `SELECT * FROM 'https://all-contracts-eth-hex.sqd-datasets.io/0000000000-0000646199/contracts.parquet';` 52 | 53 | # Dataset Access 54 | 55 | - `endpoint_url = 'https://7a28e49ec5f4a60c66f216392792ac38.r2.cloudflarestorage.com',` 56 | - `aws_access_key_id = '37d38a72f67e6c2e6afae800b9ba8f1f',` 57 | - `aws_secret_access_key = 'f5c86d7e82445f2b64bd9e260dbbc7fc2042126793149c1ab6c1d7b4672eb224'` 58 | 59 | - Hexadecimal String Format 60 | 61 | - bucket name: all-contracts-hex 62 | - [http://all-contracts-eth-hex.sqd-datasets.io](http://all-contracts-eth-hex.sqd-datasets.io) 63 | 64 | - Binary Format 65 | - bucket name: all-contracts-eth-v2 66 | - [http://all-contracts-eth-v2.sqd-datasets.io](http://all-contracts-eth-v2.sqd-datasets.io) 67 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/src/abi/abi.support.ts: -------------------------------------------------------------------------------- 1 | import assert from 'assert' 2 | import * as ethers from 'ethers' 3 | 4 | 5 | export interface LogRecord { 6 | topics: string[] 7 | data: string 8 | } 9 | 10 | 11 | export class LogEvent { 12 | private fragment: ethers.EventFragment 13 | 14 | constructor(private abi: ethers.Interface, public readonly topic: string) { 15 | let fragment = abi.getEvent(topic) 16 | assert(fragment != null, 'Missing fragment') 17 | this.fragment = fragment 18 | } 19 | 20 | decode(rec: LogRecord): Args { 21 | return this.abi.decodeEventLog(this.fragment, rec.data, rec.topics) as any as Args 22 | } 23 | } 24 | 25 | 26 | export class Func { 27 | private fragment: ethers.FunctionFragment 28 | 29 | constructor(private abi: ethers.Interface, public readonly sighash: string) { 30 | let fragment = abi.getFunction(sighash) 31 | assert(fragment != null, 'Missing fragment') 32 | this.fragment = fragment 33 | } 34 | 35 | decode(input: ethers.BytesLike): Args & FieldArgs { 36 | return this.abi.decodeFunctionData(this.fragment, input) as any as Args & FieldArgs 37 | } 38 | 39 | encode(args: Args): string { 40 | return this.abi.encodeFunctionData(this.fragment, args) 41 | } 42 | 43 | decodeResult(output: ethers.BytesLike): Result { 44 | const decoded = this.abi.decodeFunctionResult(this.fragment, output) 45 | return decoded.length > 1 ? decoded : decoded[0] 46 | } 47 | 48 | tryDecodeResult(output: ethers.BytesLike): Result | undefined { 49 | try { 50 | return this.decodeResult(output) 51 | } catch(err: any) { 52 | return undefined 53 | } 54 | } 55 | } 56 | 57 | 58 | export function isFunctionResultDecodingError(val: unknown): val is Error & {data: string} { 59 | if (!(val instanceof Error)) return false 60 | let err = val as any 61 | return err.code == 'CALL_EXCEPTION' 62 | && typeof err.data == 'string' 63 | && !err.errorArgs 64 | && !err.errorName 65 | } 66 | 67 | 68 | export interface ChainContext { 69 | _chain: Chain 70 | } 71 | 72 | 73 | export interface BlockContext { 74 | _chain: Chain 75 | block: Block 76 | } 77 | 78 | 79 | export interface Block { 80 | height: number 81 | } 82 | 83 | 84 | export interface Chain { 85 | client: { 86 | call: (method: string, params?: unknown[]) => Promise 87 | } 88 | } 89 | 90 | 91 | export class ContractBase { 92 | private readonly _chain: Chain 93 | private readonly blockHeight: number 94 | readonly address: string 95 | 96 | constructor(ctx: BlockContext, address: string) 97 | constructor(ctx: ChainContext, block: Block, address: string) 98 | constructor(ctx: BlockContext, blockOrAddress: Block | string, address?: string) { 99 | this._chain = ctx._chain 100 | if (typeof blockOrAddress === 'string') { 101 | this.blockHeight = ctx.block.height 102 | this.address = ethers.getAddress(blockOrAddress) 103 | } else { 104 | if (address == null) { 105 | throw new Error('missing contract address') 106 | } 107 | this.blockHeight = blockOrAddress.height 108 | this.address = ethers.getAddress(address) 109 | } 110 | } 111 | 112 | async eth_call(func: Func, args: Args): Promise { 113 | let data = func.encode(args) 114 | let result = await this._chain.client.call('eth_call', [ 115 | {to: this.address, data}, 116 | '0x'+this.blockHeight.toString(16) 117 | ]) 118 | return func.decodeResult(result) 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/src/abi/abi.support.ts: -------------------------------------------------------------------------------- 1 | import assert from 'assert' 2 | import * as ethers from 'ethers' 3 | 4 | 5 | export interface LogRecord { 6 | topics: string[] 7 | data: string 8 | } 9 | 10 | 11 | export class LogEvent { 12 | private fragment: ethers.EventFragment 13 | 14 | constructor(private abi: ethers.Interface, public readonly topic: string) { 15 | let fragment = abi.getEvent(topic) 16 | assert(fragment != null, 'Missing fragment') 17 | this.fragment = fragment 18 | } 19 | 20 | decode(rec: LogRecord): Args { 21 | return this.abi.decodeEventLog(this.fragment, rec.data, rec.topics) as any as Args 22 | } 23 | } 24 | 25 | 26 | export class Func { 27 | private fragment: ethers.FunctionFragment 28 | 29 | constructor(private abi: ethers.Interface, public readonly sighash: string) { 30 | let fragment = abi.getFunction(sighash) 31 | assert(fragment != null, 'Missing fragment') 32 | this.fragment = fragment 33 | } 34 | 35 | decode(input: ethers.BytesLike): Args & FieldArgs { 36 | return this.abi.decodeFunctionData(this.fragment, input) as any as Args & FieldArgs 37 | } 38 | 39 | encode(args: Args): string { 40 | return this.abi.encodeFunctionData(this.fragment, args) 41 | } 42 | 43 | decodeResult(output: ethers.BytesLike): Result { 44 | const decoded = this.abi.decodeFunctionResult(this.fragment, output) 45 | return decoded.length > 1 ? decoded : decoded[0] 46 | } 47 | 48 | tryDecodeResult(output: ethers.BytesLike): Result | undefined { 49 | try { 50 | return this.decodeResult(output) 51 | } catch(err: any) { 52 | return undefined 53 | } 54 | } 55 | } 56 | 57 | 58 | export function isFunctionResultDecodingError(val: unknown): val is Error & {data: string} { 59 | if (!(val instanceof Error)) return false 60 | let err = val as any 61 | return err.code == 'CALL_EXCEPTION' 62 | && typeof err.data == 'string' 63 | && !err.errorArgs 64 | && !err.errorName 65 | } 66 | 67 | 68 | export interface ChainContext { 69 | _chain: Chain 70 | } 71 | 72 | 73 | export interface BlockContext { 74 | _chain: Chain 75 | block: Block 76 | } 77 | 78 | 79 | export interface Block { 80 | height: number 81 | } 82 | 83 | 84 | export interface Chain { 85 | client: { 86 | call: (method: string, params?: unknown[]) => Promise 87 | } 88 | } 89 | 90 | 91 | export class ContractBase { 92 | private readonly _chain: Chain 93 | private readonly blockHeight: number 94 | readonly address: string 95 | 96 | constructor(ctx: BlockContext, address: string) 97 | constructor(ctx: ChainContext, block: Block, address: string) 98 | constructor(ctx: BlockContext, blockOrAddress: Block | string, address?: string) { 99 | this._chain = ctx._chain 100 | if (typeof blockOrAddress === 'string') { 101 | this.blockHeight = ctx.block.height 102 | this.address = ethers.getAddress(blockOrAddress) 103 | } else { 104 | if (address == null) { 105 | throw new Error('missing contract address') 106 | } 107 | this.blockHeight = blockOrAddress.height 108 | this.address = ethers.getAddress(address) 109 | } 110 | } 111 | 112 | async eth_call(func: Func, args: Args): Promise { 113 | let data = func.encode(args) 114 | let result = await this._chain.client.call('eth_call', [ 115 | {to: this.address, data}, 116 | '0x'+this.blockHeight.toString(16) 117 | ]) 118 | return func.decodeResult(result) 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/README.md: -------------------------------------------------------------------------------- 1 | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/subsquid/squid-evm-template) 2 | 3 | # Minimal EVM squid 4 | 5 | This is a starter template of a squid indexer for EVM networks (Ethereum, Polygon, BSC, etc.). See [Squid SDK docs](https://docs.subsquid.io/) for a complete reference. 6 | 7 | To extract EVM logs and transactions by a topic or a contract address, use `EvmBatchProcessor.addLog()` and `EvmBatchProcessor.addTransaction()` methods of the `EvmBatchProcessor` instance defined in `src/processor.ts`. 8 | 9 | The requested data is transformed in batches by a single handler provided to the `processor.run()` method. 10 | 11 | For a full list of supported networks and config options, 12 | check the [`EvmBatchProcessor` overview](https://docs.subsquid.io/develop-a-squid/evm-processor/) and the [configuration page](https://docs.subsquid.io/develop-a-squid/evm-processor/configuration/). 13 | 14 | For a step-by-step migration guide from TheGraph, see [the dedicated docs page](https://docs.subsquid.io/migrate/migrate-subgraph/). 15 | 16 | Dependencies: Node.js, Docker. 17 | 18 | ## Quickstart 19 | 20 | ```bash 21 | # 0. Install @subsquid/cli a.k.a. the sqd command globally 22 | npm i -g @subsquid/cli 23 | 24 | # 1. Retrieve the template 25 | sqd init my_squid_name -t evm 26 | cd my_squid_name 27 | 28 | # 2. Install dependencies 29 | npm ci 30 | 31 | # 3. Start a Postgres database container and detach 32 | sqd up 33 | 34 | # 4. Build and start the processor 35 | sqd process 36 | 37 | # 5. The command above will block the terminal 38 | # being busy with fetching the chain data, 39 | # transforming and storing it in the target database. 40 | # 41 | # To start the graphql server open the separate terminal 42 | # and run 43 | sqd serve 44 | ``` 45 | A GraphiQL playground will be available at [localhost:4350/graphql](http://localhost:4350/graphql). 46 | 47 | ## Dev flow 48 | 49 | ### 1. Define database schema 50 | 51 | Start development by defining the schema of the target database via `schema.graphql`. 52 | Schema definition consists of regular graphql type declarations annotated with custom directives. 53 | Full description of `schema.graphql` dialect is available [here](https://docs.subsquid.io/basics/schema-file). 54 | 55 | ### 2. Generate TypeORM classes 56 | 57 | Mapping developers use TypeORM [EntityManager](https://typeorm.io/#/working-with-entity-manager) 58 | to interact with target database during data processing. All necessary entity classes are 59 | generated by the squid framework from `schema.graphql`. This is done by running `sqd codegen` 60 | command. 61 | 62 | ### 3. Generate database migrations 63 | 64 | All database changes are applied through migration files located at `db/migrations`. 65 | `squid-typeorm-migration(1)` tool provides several commands to drive the process. 66 | 67 | ```bash 68 | ## drop create the database 69 | sqd down 70 | sqd up 71 | 72 | ## replace any old schemas with a new one made from the entities 73 | sqd migration:generate 74 | ``` 75 | See [docs on database migrations](https://docs.subsquid.io/basics/db-migrations) for more details. 76 | 77 | ### 4. Import ABI contract and generate interfaces to decode events 78 | 79 | It is necessary to import the respective ABI definition to decode EVM logs. One way to generate a type-safe facade class to decode EVM logs is by placing the relevant JSON ABIs to `./abi`, then using `squid-evm-typegen(1)` via an `sqd` script: 80 | 81 | ```bash 82 | sqd typegen 83 | ``` 84 | 85 | See more details on the [`squid-evm-typegen` doc page](https://docs.subsquid.io/evm-indexing/squid-evm-typegen). 86 | 87 | ## Project conventions 88 | 89 | Squid tools assume a certain [project layout](https://docs.subsquid.io/basics/squid-structure): 90 | 91 | * All compiled js files must reside in `lib` and all TypeScript sources in `src`. 92 | The layout of `lib` must reflect `src`. 93 | * All TypeORM classes must be exported by `src/model/index.ts` (`lib/model` module). 94 | * Database schema must be defined in `schema.graphql`. 95 | * Database migrations must reside in `db/migrations` and must be plain js files. 96 | * `sqd(1)` and `squid-*(1)` executables consult `.env` file for environment variables. 97 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/README.md: -------------------------------------------------------------------------------- 1 | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/subsquid/squid-evm-template) 2 | 3 | # Minimal EVM squid 4 | 5 | This is a starter template of a squid indexer for EVM networks (Ethereum, Polygon, BSC, etc.). See [Squid SDK docs](https://docs.subsquid.io/) for a complete reference. 6 | 7 | To extract EVM logs and transactions by a topic or a contract address, use `EvmBatchProcessor.addLog()` and `EvmBatchProcessor.addTransaction()` methods of the `EvmBatchProcessor` instance defined in `src/processor.ts`. 8 | 9 | The requested data is transformed in batches by a single handler provided to the `processor.run()` method. 10 | 11 | For a full list of supported networks and config options, 12 | check the [`EvmBatchProcessor` overview](https://docs.subsquid.io/develop-a-squid/evm-processor/) and the [configuration page](https://docs.subsquid.io/develop-a-squid/evm-processor/configuration/). 13 | 14 | For a step-by-step migration guide from TheGraph, see [the dedicated docs page](https://docs.subsquid.io/migrate/migrate-subgraph/). 15 | 16 | Dependencies: Node.js, Docker. 17 | 18 | ## Quickstart 19 | 20 | ```bash 21 | # 0. Install @subsquid/cli a.k.a. the sqd command globally 22 | npm i -g @subsquid/cli 23 | 24 | # 1. Retrieve the template 25 | sqd init my_squid_name -t evm 26 | cd my_squid_name 27 | 28 | # 2. Install dependencies 29 | npm ci 30 | 31 | # 3. Start a Postgres database container and detach 32 | sqd up 33 | 34 | # 4. Build and start the processor 35 | sqd process 36 | 37 | # 5. The command above will block the terminal 38 | # being busy with fetching the chain data, 39 | # transforming and storing it in the target database. 40 | # 41 | # To start the graphql server open the separate terminal 42 | # and run 43 | sqd serve 44 | ``` 45 | A GraphiQL playground will be available at [localhost:4350/graphql](http://localhost:4350/graphql). 46 | 47 | ## Dev flow 48 | 49 | ### 1. Define database schema 50 | 51 | Start development by defining the schema of the target database via `schema.graphql`. 52 | Schema definition consists of regular graphql type declarations annotated with custom directives. 53 | Full description of `schema.graphql` dialect is available [here](https://docs.subsquid.io/basics/schema-file). 54 | 55 | ### 2. Generate TypeORM classes 56 | 57 | Mapping developers use TypeORM [EntityManager](https://typeorm.io/#/working-with-entity-manager) 58 | to interact with target database during data processing. All necessary entity classes are 59 | generated by the squid framework from `schema.graphql`. This is done by running `sqd codegen` 60 | command. 61 | 62 | ### 3. Generate database migrations 63 | 64 | All database changes are applied through migration files located at `db/migrations`. 65 | `squid-typeorm-migration(1)` tool provides several commands to drive the process. 66 | 67 | ```bash 68 | ## drop create the database 69 | sqd down 70 | sqd up 71 | 72 | ## replace any old schemas with a new one made from the entities 73 | sqd migration:generate 74 | ``` 75 | See [docs on database migrations](https://docs.subsquid.io/basics/db-migrations) for more details. 76 | 77 | ### 4. Import ABI contract and generate interfaces to decode events 78 | 79 | It is necessary to import the respective ABI definition to decode EVM logs. One way to generate a type-safe facade class to decode EVM logs is by placing the relevant JSON ABIs to `./abi`, then using `squid-evm-typegen(1)` via an `sqd` script: 80 | 81 | ```bash 82 | sqd typegen 83 | ``` 84 | 85 | See more details on the [`squid-evm-typegen` doc page](https://docs.subsquid.io/evm-indexing/squid-evm-typegen). 86 | 87 | ## Project conventions 88 | 89 | Squid tools assume a certain [project layout](https://docs.subsquid.io/basics/squid-structure): 90 | 91 | * All compiled js files must reside in `lib` and all TypeScript sources in `src`. 92 | The layout of `lib` must reflect `src`. 93 | * All TypeORM classes must be exported by `src/model/index.ts` (`lib/model` module). 94 | * Database schema must be defined in `schema.graphql`. 95 | * Database migrations must reside in `db/migrations` and must be plain js files. 96 | * `sqd(1)` and `squid-*(1)` executables consult `.env` file for environment variables. 97 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/README.md: -------------------------------------------------------------------------------- 1 | [![Open in Gitpod](https://gitpod.io/button/open-in-gitpod.svg)](https://gitpod.io/#https://github.com/subsquid/squid-evm-template) 2 | 3 | # Minimal EVM squid 4 | 5 | This is a starter template of a squid indexer for EVM networks (Ethereum, Polygon, BSC, etc.). See [Squid SDK docs](https://docs.subsquid.io/) for a complete reference. 6 | 7 | To extract EVM logs and transactions by a topic or a contract address, use `EvmBatchProcessor.addLog()` and `EvmBatchProcessor.addTransaction()` methods of the `EvmBatchProcessor` instance defined in `src/processor.ts`. 8 | 9 | The requested data is transformed in batches by a single handler provided to the `processor.run()` method. 10 | 11 | For a full list of supported networks and config options, 12 | check the [`EvmBatchProcessor` overview](https://docs.subsquid.io/develop-a-squid/evm-processor/) and the [configuration page](https://docs.subsquid.io/develop-a-squid/evm-processor/configuration/). 13 | 14 | For a step-by-step migration guide from TheGraph, see [the dedicated docs page](https://docs.subsquid.io/migrate/migrate-subgraph/). 15 | 16 | Dependencies: Node.js, Docker. 17 | 18 | ## Quickstart 19 | 20 | ```bash 21 | # 0. Install @subsquid/cli a.k.a. the sqd command globally 22 | npm i -g @subsquid/cli 23 | 24 | # 1. Retrieve the template 25 | sqd init my_squid_name -t evm 26 | cd my_squid_name 27 | 28 | # 2. Install dependencies 29 | npm ci 30 | 31 | # 3. Start a Postgres database container and detach 32 | sqd up 33 | 34 | # 4. Build and start the processor 35 | sqd process 36 | 37 | # 5. The command above will block the terminal 38 | # being busy with fetching the chain data, 39 | # transforming and storing it in the target database. 40 | # 41 | # To start the graphql server open the separate terminal 42 | # and run 43 | sqd serve 44 | ``` 45 | A GraphiQL playground will be available at [localhost:4350/graphql](http://localhost:4350/graphql). 46 | 47 | ## Dev flow 48 | 49 | ### 1. Define database schema 50 | 51 | Start development by defining the schema of the target database via `schema.graphql`. 52 | Schema definition consists of regular graphql type declarations annotated with custom directives. 53 | Full description of `schema.graphql` dialect is available [here](https://docs.subsquid.io/basics/schema-file). 54 | 55 | ### 2. Generate TypeORM classes 56 | 57 | Mapping developers use TypeORM [EntityManager](https://typeorm.io/#/working-with-entity-manager) 58 | to interact with target database during data processing. All necessary entity classes are 59 | generated by the squid framework from `schema.graphql`. This is done by running `sqd codegen` 60 | command. 61 | 62 | ### 3. Generate database migrations 63 | 64 | All database changes are applied through migration files located at `db/migrations`. 65 | `squid-typeorm-migration(1)` tool provides several commands to drive the process. 66 | 67 | ```bash 68 | ## drop create the database 69 | sqd down 70 | sqd up 71 | 72 | ## replace any old schemas with a new one made from the entities 73 | sqd migration:generate 74 | ``` 75 | See [docs on database migrations](https://docs.subsquid.io/basics/db-migrations) for more details. 76 | 77 | ### 4. Import ABI contract and generate interfaces to decode events 78 | 79 | It is necessary to import the respective ABI definition to decode EVM logs. One way to generate a type-safe facade class to decode EVM logs is by placing the relevant JSON ABIs to `./abi`, then using `squid-evm-typegen(1)` via an `sqd` script: 80 | 81 | ```bash 82 | sqd typegen 83 | ``` 84 | 85 | See more details on the [`squid-evm-typegen` doc page](https://docs.subsquid.io/evm-indexing/squid-evm-typegen). 86 | 87 | ## Project conventions 88 | 89 | Squid tools assume a certain [project layout](https://docs.subsquid.io/basics/squid-structure): 90 | 91 | * All compiled js files must reside in `lib` and all TypeScript sources in `src`. 92 | The layout of `lib` must reflect `src`. 93 | * All TypeORM classes must be exported by `src/model/index.ts` (`lib/model` module). 94 | * Database schema must be defined in `schema.graphql`. 95 | * Database migrations must reside in `db/migrations` and must be plain js files. 96 | * `sqd(1)` and `squid-*(1)` executables consult `.env` file for environment variables. 97 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/src/abi/busdc.ts: -------------------------------------------------------------------------------- 1 | import * as ethers from 'ethers' 2 | import {LogEvent, Func, ContractBase} from './abi.support' 3 | import {ABI_JSON} from './busdc.abi' 4 | 5 | export const abi = new ethers.Interface(ABI_JSON); 6 | 7 | export const events = { 8 | Approval: new LogEvent<([owner: string, spender: string, value: bigint] & {owner: string, spender: string, value: bigint})>( 9 | abi, '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925' 10 | ), 11 | OwnershipTransferred: new LogEvent<([previousOwner: string, newOwner: string] & {previousOwner: string, newOwner: string})>( 12 | abi, '0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0' 13 | ), 14 | Transfer: new LogEvent<([from: string, to: string, value: bigint] & {from: string, to: string, value: bigint})>( 15 | abi, '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' 16 | ), 17 | } 18 | 19 | export const functions = { 20 | allowance: new Func<[owner: string, spender: string], {owner: string, spender: string}, bigint>( 21 | abi, '0xdd62ed3e' 22 | ), 23 | approve: new Func<[spender: string, amount: bigint], {spender: string, amount: bigint}, boolean>( 24 | abi, '0x095ea7b3' 25 | ), 26 | balanceOf: new Func<[account: string], {account: string}, bigint>( 27 | abi, '0x70a08231' 28 | ), 29 | burn: new Func<[amount: bigint], {amount: bigint}, boolean>( 30 | abi, '0x42966c68' 31 | ), 32 | decimals: new Func<[], {}, number>( 33 | abi, '0x313ce567' 34 | ), 35 | decreaseAllowance: new Func<[spender: string, subtractedValue: bigint], {spender: string, subtractedValue: bigint}, boolean>( 36 | abi, '0xa457c2d7' 37 | ), 38 | getOwner: new Func<[], {}, string>( 39 | abi, '0x893d20e8' 40 | ), 41 | increaseAllowance: new Func<[spender: string, addedValue: bigint], {spender: string, addedValue: bigint}, boolean>( 42 | abi, '0x39509351' 43 | ), 44 | initialize: new Func<[name: string, symbol: string, decimals: number, amount: bigint, mintable: boolean, owner: string], {name: string, symbol: string, decimals: number, amount: bigint, mintable: boolean, owner: string}, []>( 45 | abi, '0xef3ebcb8' 46 | ), 47 | mint: new Func<[amount: bigint], {amount: bigint}, boolean>( 48 | abi, '0xa0712d68' 49 | ), 50 | mintable: new Func<[], {}, boolean>( 51 | abi, '0x4bf365df' 52 | ), 53 | name: new Func<[], {}, string>( 54 | abi, '0x06fdde03' 55 | ), 56 | renounceOwnership: new Func<[], {}, []>( 57 | abi, '0x715018a6' 58 | ), 59 | symbol: new Func<[], {}, string>( 60 | abi, '0x95d89b41' 61 | ), 62 | totalSupply: new Func<[], {}, bigint>( 63 | abi, '0x18160ddd' 64 | ), 65 | transfer: new Func<[recipient: string, amount: bigint], {recipient: string, amount: bigint}, boolean>( 66 | abi, '0xa9059cbb' 67 | ), 68 | transferFrom: new Func<[sender: string, recipient: string, amount: bigint], {sender: string, recipient: string, amount: bigint}, boolean>( 69 | abi, '0x23b872dd' 70 | ), 71 | transferOwnership: new Func<[newOwner: string], {newOwner: string}, []>( 72 | abi, '0xf2fde38b' 73 | ), 74 | } 75 | 76 | export class Contract extends ContractBase { 77 | 78 | allowance(owner: string, spender: string): Promise { 79 | return this.eth_call(functions.allowance, [owner, spender]) 80 | } 81 | 82 | balanceOf(account: string): Promise { 83 | return this.eth_call(functions.balanceOf, [account]) 84 | } 85 | 86 | decimals(): Promise { 87 | return this.eth_call(functions.decimals, []) 88 | } 89 | 90 | getOwner(): Promise { 91 | return this.eth_call(functions.getOwner, []) 92 | } 93 | 94 | mintable(): Promise { 95 | return this.eth_call(functions.mintable, []) 96 | } 97 | 98 | name(): Promise { 99 | return this.eth_call(functions.name, []) 100 | } 101 | 102 | symbol(): Promise { 103 | return this.eth_call(functions.symbol, []) 104 | } 105 | 106 | totalSupply(): Promise { 107 | return this.eth_call(functions.totalSupply, []) 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/src/abi/busdc.ts: -------------------------------------------------------------------------------- 1 | import * as ethers from 'ethers' 2 | import {LogEvent, Func, ContractBase} from './abi.support' 3 | import {ABI_JSON} from './busdc.abi' 4 | 5 | export const abi = new ethers.Interface(ABI_JSON); 6 | 7 | export const events = { 8 | Approval: new LogEvent<([owner: string, spender: string, value: bigint] & {owner: string, spender: string, value: bigint})>( 9 | abi, '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925' 10 | ), 11 | OwnershipTransferred: new LogEvent<([previousOwner: string, newOwner: string] & {previousOwner: string, newOwner: string})>( 12 | abi, '0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0' 13 | ), 14 | Transfer: new LogEvent<([from: string, to: string, value: bigint] & {from: string, to: string, value: bigint})>( 15 | abi, '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' 16 | ), 17 | } 18 | 19 | export const functions = { 20 | allowance: new Func<[owner: string, spender: string], {owner: string, spender: string}, bigint>( 21 | abi, '0xdd62ed3e' 22 | ), 23 | approve: new Func<[spender: string, amount: bigint], {spender: string, amount: bigint}, boolean>( 24 | abi, '0x095ea7b3' 25 | ), 26 | balanceOf: new Func<[account: string], {account: string}, bigint>( 27 | abi, '0x70a08231' 28 | ), 29 | burn: new Func<[amount: bigint], {amount: bigint}, boolean>( 30 | abi, '0x42966c68' 31 | ), 32 | decimals: new Func<[], {}, number>( 33 | abi, '0x313ce567' 34 | ), 35 | decreaseAllowance: new Func<[spender: string, subtractedValue: bigint], {spender: string, subtractedValue: bigint}, boolean>( 36 | abi, '0xa457c2d7' 37 | ), 38 | getOwner: new Func<[], {}, string>( 39 | abi, '0x893d20e8' 40 | ), 41 | increaseAllowance: new Func<[spender: string, addedValue: bigint], {spender: string, addedValue: bigint}, boolean>( 42 | abi, '0x39509351' 43 | ), 44 | initialize: new Func<[name: string, symbol: string, decimals: number, amount: bigint, mintable: boolean, owner: string], {name: string, symbol: string, decimals: number, amount: bigint, mintable: boolean, owner: string}, []>( 45 | abi, '0xef3ebcb8' 46 | ), 47 | mint: new Func<[amount: bigint], {amount: bigint}, boolean>( 48 | abi, '0xa0712d68' 49 | ), 50 | mintable: new Func<[], {}, boolean>( 51 | abi, '0x4bf365df' 52 | ), 53 | name: new Func<[], {}, string>( 54 | abi, '0x06fdde03' 55 | ), 56 | renounceOwnership: new Func<[], {}, []>( 57 | abi, '0x715018a6' 58 | ), 59 | symbol: new Func<[], {}, string>( 60 | abi, '0x95d89b41' 61 | ), 62 | totalSupply: new Func<[], {}, bigint>( 63 | abi, '0x18160ddd' 64 | ), 65 | transfer: new Func<[recipient: string, amount: bigint], {recipient: string, amount: bigint}, boolean>( 66 | abi, '0xa9059cbb' 67 | ), 68 | transferFrom: new Func<[sender: string, recipient: string, amount: bigint], {sender: string, recipient: string, amount: bigint}, boolean>( 69 | abi, '0x23b872dd' 70 | ), 71 | transferOwnership: new Func<[newOwner: string], {newOwner: string}, []>( 72 | abi, '0xf2fde38b' 73 | ), 74 | } 75 | 76 | export class Contract extends ContractBase { 77 | 78 | allowance(owner: string, spender: string): Promise { 79 | return this.eth_call(functions.allowance, [owner, spender]) 80 | } 81 | 82 | balanceOf(account: string): Promise { 83 | return this.eth_call(functions.balanceOf, [account]) 84 | } 85 | 86 | decimals(): Promise { 87 | return this.eth_call(functions.decimals, []) 88 | } 89 | 90 | getOwner(): Promise { 91 | return this.eth_call(functions.getOwner, []) 92 | } 93 | 94 | mintable(): Promise { 95 | return this.eth_call(functions.mintable, []) 96 | } 97 | 98 | name(): Promise { 99 | return this.eth_call(functions.name, []) 100 | } 101 | 102 | symbol(): Promise { 103 | return this.eth_call(functions.symbol, []) 104 | } 105 | 106 | totalSupply(): Promise { 107 | return this.eth_call(functions.totalSupply, []) 108 | } 109 | } 110 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/src/abi/busdt.ts: -------------------------------------------------------------------------------- 1 | import * as ethers from 'ethers' 2 | import {LogEvent, Func, ContractBase} from './abi.support' 3 | import {ABI_JSON} from './busdt.abi' 4 | 5 | export const abi = new ethers.Interface(ABI_JSON); 6 | 7 | export const events = { 8 | Approval: new LogEvent<([owner: string, spender: string, value: bigint] & {owner: string, spender: string, value: bigint})>( 9 | abi, '0x8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925' 10 | ), 11 | OwnershipTransferred: new LogEvent<([previousOwner: string, newOwner: string] & {previousOwner: string, newOwner: string})>( 12 | abi, '0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0' 13 | ), 14 | Transfer: new LogEvent<([from: string, to: string, value: bigint] & {from: string, to: string, value: bigint})>( 15 | abi, '0xddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef' 16 | ), 17 | } 18 | 19 | export const functions = { 20 | _decimals: new Func<[], {}, number>( 21 | abi, '0x32424aa3' 22 | ), 23 | _name: new Func<[], {}, string>( 24 | abi, '0xd28d8852' 25 | ), 26 | _symbol: new Func<[], {}, string>( 27 | abi, '0xb09f1266' 28 | ), 29 | allowance: new Func<[owner: string, spender: string], {owner: string, spender: string}, bigint>( 30 | abi, '0xdd62ed3e' 31 | ), 32 | approve: new Func<[spender: string, amount: bigint], {spender: string, amount: bigint}, boolean>( 33 | abi, '0x095ea7b3' 34 | ), 35 | balanceOf: new Func<[account: string], {account: string}, bigint>( 36 | abi, '0x70a08231' 37 | ), 38 | burn: new Func<[amount: bigint], {amount: bigint}, boolean>( 39 | abi, '0x42966c68' 40 | ), 41 | decimals: new Func<[], {}, number>( 42 | abi, '0x313ce567' 43 | ), 44 | decreaseAllowance: new Func<[spender: string, subtractedValue: bigint], {spender: string, subtractedValue: bigint}, boolean>( 45 | abi, '0xa457c2d7' 46 | ), 47 | getOwner: new Func<[], {}, string>( 48 | abi, '0x893d20e8' 49 | ), 50 | increaseAllowance: new Func<[spender: string, addedValue: bigint], {spender: string, addedValue: bigint}, boolean>( 51 | abi, '0x39509351' 52 | ), 53 | mint: new Func<[amount: bigint], {amount: bigint}, boolean>( 54 | abi, '0xa0712d68' 55 | ), 56 | name: new Func<[], {}, string>( 57 | abi, '0x06fdde03' 58 | ), 59 | owner: new Func<[], {}, string>( 60 | abi, '0x8da5cb5b' 61 | ), 62 | renounceOwnership: new Func<[], {}, []>( 63 | abi, '0x715018a6' 64 | ), 65 | symbol: new Func<[], {}, string>( 66 | abi, '0x95d89b41' 67 | ), 68 | totalSupply: new Func<[], {}, bigint>( 69 | abi, '0x18160ddd' 70 | ), 71 | transfer: new Func<[recipient: string, amount: bigint], {recipient: string, amount: bigint}, boolean>( 72 | abi, '0xa9059cbb' 73 | ), 74 | transferFrom: new Func<[sender: string, recipient: string, amount: bigint], {sender: string, recipient: string, amount: bigint}, boolean>( 75 | abi, '0x23b872dd' 76 | ), 77 | transferOwnership: new Func<[newOwner: string], {newOwner: string}, []>( 78 | abi, '0xf2fde38b' 79 | ), 80 | } 81 | 82 | export class Contract extends ContractBase { 83 | 84 | _decimals(): Promise { 85 | return this.eth_call(functions._decimals, []) 86 | } 87 | 88 | _name(): Promise { 89 | return this.eth_call(functions._name, []) 90 | } 91 | 92 | _symbol(): Promise { 93 | return this.eth_call(functions._symbol, []) 94 | } 95 | 96 | allowance(owner: string, spender: string): Promise { 97 | return this.eth_call(functions.allowance, [owner, spender]) 98 | } 99 | 100 | balanceOf(account: string): Promise { 101 | return this.eth_call(functions.balanceOf, [account]) 102 | } 103 | 104 | decimals(): Promise { 105 | return this.eth_call(functions.decimals, []) 106 | } 107 | 108 | getOwner(): Promise { 109 | return this.eth_call(functions.getOwner, []) 110 | } 111 | 112 | name(): Promise { 113 | return this.eth_call(functions.name, []) 114 | } 115 | 116 | owner(): Promise { 117 | return this.eth_call(functions.owner, []) 118 | } 119 | 120 | symbol(): Promise { 121 | return this.eth_call(functions.symbol, []) 122 | } 123 | 124 | totalSupply(): Promise { 125 | return this.eth_call(functions.totalSupply, []) 126 | } 127 | } 128 | -------------------------------------------------------------------------------- /bnb-native-transfers/bnb-transfers-squid/src/model/generated/marshal.ts: -------------------------------------------------------------------------------- 1 | import assert from 'assert' 2 | 3 | 4 | export interface Marshal { 5 | fromJSON(value: unknown): T 6 | toJSON(value: T): S 7 | } 8 | 9 | 10 | export const string: Marshal = { 11 | fromJSON(value: unknown): string { 12 | assert(typeof value === 'string', 'invalid String') 13 | return value 14 | }, 15 | toJSON(value) { 16 | return value 17 | } 18 | } 19 | 20 | 21 | export const id = string 22 | 23 | 24 | export const int: Marshal = { 25 | fromJSON(value: unknown): number { 26 | assert(Number.isInteger(value), 'invalid Int') 27 | return value as number 28 | }, 29 | toJSON(value) { 30 | return value 31 | } 32 | } 33 | 34 | 35 | export const float: Marshal = { 36 | fromJSON(value: unknown): number { 37 | assert(typeof value === 'number', 'invalid Float') 38 | return value as number 39 | }, 40 | toJSON(value) { 41 | return value 42 | } 43 | } 44 | 45 | 46 | export const boolean: Marshal = { 47 | fromJSON(value: unknown): boolean { 48 | assert(typeof value === 'boolean', 'invalid Boolean') 49 | return value 50 | }, 51 | toJSON(value: boolean): boolean { 52 | return value 53 | } 54 | } 55 | 56 | 57 | export const bigint: Marshal = { 58 | fromJSON(value: unknown): bigint { 59 | assert(typeof value === 'string', 'invalid BigInt') 60 | return BigInt(value) 61 | }, 62 | toJSON(value: bigint): string { 63 | return value.toString() 64 | } 65 | } 66 | 67 | 68 | export const bigdecimal: Marshal = { 69 | fromJSON(value: unknown): bigint { 70 | assert(typeof value === 'string', 'invalid BigDecimal') 71 | return decimal.BigDecimal(value) 72 | }, 73 | toJSON(value: any): string { 74 | return value.toString() 75 | } 76 | } 77 | 78 | 79 | // credit - https://github.com/Urigo/graphql-scalars/blob/91b4ea8df891be8af7904cf84751930cc0c6613d/src/scalars/iso-date/validator.ts#L122 80 | const RFC_3339_REGEX = 81 | /^(\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60))(\.\d{1,})?([Z])$/ 82 | 83 | 84 | function isIsoDateTimeString(s: string): boolean { 85 | return RFC_3339_REGEX.test(s) 86 | } 87 | 88 | 89 | export const datetime: Marshal = { 90 | fromJSON(value: unknown): Date { 91 | assert(typeof value === 'string', 'invalid DateTime') 92 | assert(isIsoDateTimeString(value), 'invalid DateTime') 93 | return new Date(value) 94 | }, 95 | toJSON(value: Date): string { 96 | return value.toISOString() 97 | } 98 | } 99 | 100 | 101 | export const bytes: Marshal = { 102 | fromJSON(value: unknown): Buffer { 103 | assert(typeof value === 'string', 'invalid Bytes') 104 | assert(value.length % 2 === 0, 'invalid Bytes') 105 | assert(/^0x[0-9a-f]+$/i.test(value), 'invalid Bytes') 106 | return Buffer.from(value.slice(2), 'hex') 107 | }, 108 | toJSON(value: Uint8Array): string { 109 | if (Buffer.isBuffer(value)) { 110 | return '0x' + value.toString('hex') 111 | } else { 112 | return '0x' + Buffer.from(value.buffer, value.byteOffset, value.byteLength).toString('hex') 113 | } 114 | } 115 | } 116 | 117 | 118 | export function fromList(list: unknown, f: (val: unknown) => T): T[] { 119 | assert(Array.isArray(list)) 120 | return list.map((val) => f(val)) 121 | } 122 | 123 | 124 | export function nonNull(val: T | undefined | null): T { 125 | assert(val != null, 'non-nullable value is null') 126 | return val 127 | } 128 | 129 | 130 | export const bigintTransformer = { 131 | to(x?: bigint) { 132 | return x?.toString() 133 | }, 134 | from(s?: string): bigint | undefined { 135 | return s == null ? undefined : BigInt(s) 136 | } 137 | } 138 | 139 | 140 | export const floatTransformer = { 141 | to(x?: number) { 142 | return x?.toString() 143 | }, 144 | from(s?: string): number | undefined { 145 | return s == null ? undefined : Number(s) 146 | } 147 | } 148 | 149 | 150 | export const bigdecimalTransformer = { 151 | to(x?: any) { 152 | return x?.toString() 153 | }, 154 | from(s?: any): any | undefined { 155 | return s == null ? undefined : decimal.BigDecimal(s) 156 | } 157 | } 158 | 159 | 160 | export function enumFromJson(json: unknown, enumObject: E): E[keyof E] { 161 | assert(typeof json == 'string', 'invalid enum value') 162 | let val = (enumObject as any)[json] 163 | assert(typeof val == 'string', `invalid enum value`) 164 | return val as any 165 | } 166 | 167 | 168 | const decimal = { 169 | get BigDecimal(): any { 170 | throw new Error('Package `@subsquid/big-decimal` is not installed') 171 | } 172 | } 173 | 174 | 175 | try { 176 | Object.defineProperty(decimal, "BigDecimal", { 177 | value: require('@subsquid/big-decimal').BigDecimal 178 | }) 179 | } catch (e) {} 180 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/src/model/generated/marshal.ts: -------------------------------------------------------------------------------- 1 | import assert from 'assert' 2 | 3 | 4 | export interface Marshal { 5 | fromJSON(value: unknown): T 6 | toJSON(value: T): S 7 | } 8 | 9 | 10 | export const string: Marshal = { 11 | fromJSON(value: unknown): string { 12 | assert(typeof value === 'string', 'invalid String') 13 | return value 14 | }, 15 | toJSON(value) { 16 | return value 17 | } 18 | } 19 | 20 | 21 | export const id = string 22 | 23 | 24 | export const int: Marshal = { 25 | fromJSON(value: unknown): number { 26 | assert(Number.isInteger(value), 'invalid Int') 27 | return value as number 28 | }, 29 | toJSON(value) { 30 | return value 31 | } 32 | } 33 | 34 | 35 | export const float: Marshal = { 36 | fromJSON(value: unknown): number { 37 | assert(typeof value === 'number', 'invalid Float') 38 | return value as number 39 | }, 40 | toJSON(value) { 41 | return value 42 | } 43 | } 44 | 45 | 46 | export const boolean: Marshal = { 47 | fromJSON(value: unknown): boolean { 48 | assert(typeof value === 'boolean', 'invalid Boolean') 49 | return value 50 | }, 51 | toJSON(value: boolean): boolean { 52 | return value 53 | } 54 | } 55 | 56 | 57 | export const bigint: Marshal = { 58 | fromJSON(value: unknown): bigint { 59 | assert(typeof value === 'string', 'invalid BigInt') 60 | return BigInt(value) 61 | }, 62 | toJSON(value: bigint): string { 63 | return value.toString() 64 | } 65 | } 66 | 67 | 68 | export const bigdecimal: Marshal = { 69 | fromJSON(value: unknown): bigint { 70 | assert(typeof value === 'string', 'invalid BigDecimal') 71 | return decimal.BigDecimal(value) 72 | }, 73 | toJSON(value: any): string { 74 | return value.toString() 75 | } 76 | } 77 | 78 | 79 | // credit - https://github.com/Urigo/graphql-scalars/blob/91b4ea8df891be8af7904cf84751930cc0c6613d/src/scalars/iso-date/validator.ts#L122 80 | const RFC_3339_REGEX = 81 | /^(\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60))(\.\d{1,})?([Z])$/ 82 | 83 | 84 | function isIsoDateTimeString(s: string): boolean { 85 | return RFC_3339_REGEX.test(s) 86 | } 87 | 88 | 89 | export const datetime: Marshal = { 90 | fromJSON(value: unknown): Date { 91 | assert(typeof value === 'string', 'invalid DateTime') 92 | assert(isIsoDateTimeString(value), 'invalid DateTime') 93 | return new Date(value) 94 | }, 95 | toJSON(value: Date): string { 96 | return value.toISOString() 97 | } 98 | } 99 | 100 | 101 | export const bytes: Marshal = { 102 | fromJSON(value: unknown): Buffer { 103 | assert(typeof value === 'string', 'invalid Bytes') 104 | assert(value.length % 2 === 0, 'invalid Bytes') 105 | assert(/^0x[0-9a-f]+$/i.test(value), 'invalid Bytes') 106 | return Buffer.from(value.slice(2), 'hex') 107 | }, 108 | toJSON(value: Uint8Array): string { 109 | if (Buffer.isBuffer(value)) { 110 | return '0x' + value.toString('hex') 111 | } else { 112 | return '0x' + Buffer.from(value.buffer, value.byteOffset, value.byteLength).toString('hex') 113 | } 114 | } 115 | } 116 | 117 | 118 | export function fromList(list: unknown, f: (val: unknown) => T): T[] { 119 | assert(Array.isArray(list)) 120 | return list.map((val) => f(val)) 121 | } 122 | 123 | 124 | export function nonNull(val: T | undefined | null): T { 125 | assert(val != null, 'non-nullable value is null') 126 | return val 127 | } 128 | 129 | 130 | export const bigintTransformer = { 131 | to(x?: bigint) { 132 | return x?.toString() 133 | }, 134 | from(s?: string): bigint | undefined { 135 | return s == null ? undefined : BigInt(s) 136 | } 137 | } 138 | 139 | 140 | export const floatTransformer = { 141 | to(x?: number) { 142 | return x?.toString() 143 | }, 144 | from(s?: string): number | undefined { 145 | return s == null ? undefined : Number(s) 146 | } 147 | } 148 | 149 | 150 | export const bigdecimalTransformer = { 151 | to(x?: any) { 152 | return x?.toString() 153 | }, 154 | from(s?: any): any | undefined { 155 | return s == null ? undefined : decimal.BigDecimal(s) 156 | } 157 | } 158 | 159 | 160 | export function enumFromJson(json: unknown, enumObject: E): E[keyof E] { 161 | assert(typeof json == 'string', 'invalid enum value') 162 | let val = (enumObject as any)[json] 163 | assert(typeof val == 'string', `invalid enum value`) 164 | return val as any 165 | } 166 | 167 | 168 | const decimal = { 169 | get BigDecimal(): any { 170 | throw new Error('Package `@subsquid/big-decimal` is not installed') 171 | } 172 | } 173 | 174 | 175 | try { 176 | Object.defineProperty(decimal, "BigDecimal", { 177 | value: require('@subsquid/big-decimal').BigDecimal 178 | }) 179 | } catch (e) {} 180 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/src/model/generated/marshal.ts: -------------------------------------------------------------------------------- 1 | import assert from 'assert' 2 | 3 | 4 | export interface Marshal { 5 | fromJSON(value: unknown): T 6 | toJSON(value: T): S 7 | } 8 | 9 | 10 | export const string: Marshal = { 11 | fromJSON(value: unknown): string { 12 | assert(typeof value === 'string', 'invalid String') 13 | return value 14 | }, 15 | toJSON(value) { 16 | return value 17 | } 18 | } 19 | 20 | 21 | export const id = string 22 | 23 | 24 | export const int: Marshal = { 25 | fromJSON(value: unknown): number { 26 | assert(Number.isInteger(value), 'invalid Int') 27 | return value as number 28 | }, 29 | toJSON(value) { 30 | return value 31 | } 32 | } 33 | 34 | 35 | export const float: Marshal = { 36 | fromJSON(value: unknown): number { 37 | assert(typeof value === 'number', 'invalid Float') 38 | return value as number 39 | }, 40 | toJSON(value) { 41 | return value 42 | } 43 | } 44 | 45 | 46 | export const boolean: Marshal = { 47 | fromJSON(value: unknown): boolean { 48 | assert(typeof value === 'boolean', 'invalid Boolean') 49 | return value 50 | }, 51 | toJSON(value: boolean): boolean { 52 | return value 53 | } 54 | } 55 | 56 | 57 | export const bigint: Marshal = { 58 | fromJSON(value: unknown): bigint { 59 | assert(typeof value === 'string', 'invalid BigInt') 60 | return BigInt(value) 61 | }, 62 | toJSON(value: bigint): string { 63 | return value.toString() 64 | } 65 | } 66 | 67 | 68 | export const bigdecimal: Marshal = { 69 | fromJSON(value: unknown): bigint { 70 | assert(typeof value === 'string', 'invalid BigDecimal') 71 | return decimal.BigDecimal(value) 72 | }, 73 | toJSON(value: any): string { 74 | return value.toString() 75 | } 76 | } 77 | 78 | 79 | // credit - https://github.com/Urigo/graphql-scalars/blob/91b4ea8df891be8af7904cf84751930cc0c6613d/src/scalars/iso-date/validator.ts#L122 80 | const RFC_3339_REGEX = 81 | /^(\d{4}-(0[1-9]|1[012])-(0[1-9]|[12][0-9]|3[01])T([01][0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9]|60))(\.\d{1,})?([Z])$/ 82 | 83 | 84 | function isIsoDateTimeString(s: string): boolean { 85 | return RFC_3339_REGEX.test(s) 86 | } 87 | 88 | 89 | export const datetime: Marshal = { 90 | fromJSON(value: unknown): Date { 91 | assert(typeof value === 'string', 'invalid DateTime') 92 | assert(isIsoDateTimeString(value), 'invalid DateTime') 93 | return new Date(value) 94 | }, 95 | toJSON(value: Date): string { 96 | return value.toISOString() 97 | } 98 | } 99 | 100 | 101 | export const bytes: Marshal = { 102 | fromJSON(value: unknown): Buffer { 103 | assert(typeof value === 'string', 'invalid Bytes') 104 | assert(value.length % 2 === 0, 'invalid Bytes') 105 | assert(/^0x[0-9a-f]+$/i.test(value), 'invalid Bytes') 106 | return Buffer.from(value.slice(2), 'hex') 107 | }, 108 | toJSON(value: Uint8Array): string { 109 | if (Buffer.isBuffer(value)) { 110 | return '0x' + value.toString('hex') 111 | } else { 112 | return '0x' + Buffer.from(value.buffer, value.byteOffset, value.byteLength).toString('hex') 113 | } 114 | } 115 | } 116 | 117 | 118 | export function fromList(list: unknown, f: (val: unknown) => T): T[] { 119 | assert(Array.isArray(list)) 120 | return list.map((val) => f(val)) 121 | } 122 | 123 | 124 | export function nonNull(val: T | undefined | null): T { 125 | assert(val != null, 'non-nullable value is null') 126 | return val 127 | } 128 | 129 | 130 | export const bigintTransformer = { 131 | to(x?: bigint) { 132 | return x?.toString() 133 | }, 134 | from(s?: string): bigint | undefined { 135 | return s == null ? undefined : BigInt(s) 136 | } 137 | } 138 | 139 | 140 | export const floatTransformer = { 141 | to(x?: number) { 142 | return x?.toString() 143 | }, 144 | from(s?: string): number | undefined { 145 | return s == null ? undefined : Number(s) 146 | } 147 | } 148 | 149 | 150 | export const bigdecimalTransformer = { 151 | to(x?: any) { 152 | return x?.toString() 153 | }, 154 | from(s?: any): any | undefined { 155 | return s == null ? undefined : decimal.BigDecimal(s) 156 | } 157 | } 158 | 159 | 160 | export function enumFromJson(json: unknown, enumObject: E): E[keyof E] { 161 | assert(typeof json == 'string', 'invalid enum value') 162 | let val = (enumObject as any)[json] 163 | assert(typeof val == 'string', `invalid enum value`) 164 | return val as any 165 | } 166 | 167 | 168 | const decimal = { 169 | get BigDecimal(): any { 170 | throw new Error('Package `@subsquid/big-decimal` is not installed') 171 | } 172 | } 173 | 174 | 175 | try { 176 | Object.defineProperty(decimal, "BigDecimal", { 177 | value: require('@subsquid/big-decimal').BigDecimal 178 | }) 179 | } catch (e) {} 180 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/abi/busdc.json: -------------------------------------------------------------------------------- 1 | [ 2 | { "inputs": [], "stateMutability": "nonpayable", "type": "constructor" }, 3 | { 4 | "anonymous": false, 5 | "inputs": [ 6 | { 7 | "indexed": true, 8 | "internalType": "address", 9 | "name": "owner", 10 | "type": "address" 11 | }, 12 | { 13 | "indexed": true, 14 | "internalType": "address", 15 | "name": "spender", 16 | "type": "address" 17 | }, 18 | { 19 | "indexed": false, 20 | "internalType": "uint256", 21 | "name": "value", 22 | "type": "uint256" 23 | } 24 | ], 25 | "name": "Approval", 26 | "type": "event" 27 | }, 28 | { 29 | "anonymous": false, 30 | "inputs": [ 31 | { 32 | "indexed": true, 33 | "internalType": "address", 34 | "name": "previousOwner", 35 | "type": "address" 36 | }, 37 | { 38 | "indexed": true, 39 | "internalType": "address", 40 | "name": "newOwner", 41 | "type": "address" 42 | } 43 | ], 44 | "name": "OwnershipTransferred", 45 | "type": "event" 46 | }, 47 | { 48 | "anonymous": false, 49 | "inputs": [ 50 | { 51 | "indexed": true, 52 | "internalType": "address", 53 | "name": "from", 54 | "type": "address" 55 | }, 56 | { 57 | "indexed": true, 58 | "internalType": "address", 59 | "name": "to", 60 | "type": "address" 61 | }, 62 | { 63 | "indexed": false, 64 | "internalType": "uint256", 65 | "name": "value", 66 | "type": "uint256" 67 | } 68 | ], 69 | "name": "Transfer", 70 | "type": "event" 71 | }, 72 | { 73 | "inputs": [ 74 | { "internalType": "address", "name": "owner", "type": "address" }, 75 | { "internalType": "address", "name": "spender", "type": "address" } 76 | ], 77 | "name": "allowance", 78 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 79 | "stateMutability": "view", 80 | "type": "function" 81 | }, 82 | { 83 | "inputs": [ 84 | { "internalType": "address", "name": "spender", "type": "address" }, 85 | { "internalType": "uint256", "name": "amount", "type": "uint256" } 86 | ], 87 | "name": "approve", 88 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 89 | "stateMutability": "nonpayable", 90 | "type": "function" 91 | }, 92 | { 93 | "inputs": [ 94 | { "internalType": "address", "name": "account", "type": "address" } 95 | ], 96 | "name": "balanceOf", 97 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 98 | "stateMutability": "view", 99 | "type": "function" 100 | }, 101 | { 102 | "inputs": [ 103 | { "internalType": "uint256", "name": "amount", "type": "uint256" } 104 | ], 105 | "name": "burn", 106 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 107 | "stateMutability": "nonpayable", 108 | "type": "function" 109 | }, 110 | { 111 | "inputs": [], 112 | "name": "decimals", 113 | "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], 114 | "stateMutability": "view", 115 | "type": "function" 116 | }, 117 | { 118 | "inputs": [ 119 | { "internalType": "address", "name": "spender", "type": "address" }, 120 | { 121 | "internalType": "uint256", 122 | "name": "subtractedValue", 123 | "type": "uint256" 124 | } 125 | ], 126 | "name": "decreaseAllowance", 127 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 128 | "stateMutability": "nonpayable", 129 | "type": "function" 130 | }, 131 | { 132 | "inputs": [], 133 | "name": "getOwner", 134 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 135 | "stateMutability": "view", 136 | "type": "function" 137 | }, 138 | { 139 | "inputs": [ 140 | { "internalType": "address", "name": "spender", "type": "address" }, 141 | { "internalType": "uint256", "name": "addedValue", "type": "uint256" } 142 | ], 143 | "name": "increaseAllowance", 144 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 145 | "stateMutability": "nonpayable", 146 | "type": "function" 147 | }, 148 | { 149 | "inputs": [ 150 | { "internalType": "string", "name": "name", "type": "string" }, 151 | { "internalType": "string", "name": "symbol", "type": "string" }, 152 | { "internalType": "uint8", "name": "decimals", "type": "uint8" }, 153 | { "internalType": "uint256", "name": "amount", "type": "uint256" }, 154 | { "internalType": "bool", "name": "mintable", "type": "bool" }, 155 | { "internalType": "address", "name": "owner", "type": "address" } 156 | ], 157 | "name": "initialize", 158 | "outputs": [], 159 | "stateMutability": "nonpayable", 160 | "type": "function" 161 | }, 162 | { 163 | "inputs": [ 164 | { "internalType": "uint256", "name": "amount", "type": "uint256" } 165 | ], 166 | "name": "mint", 167 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 168 | "stateMutability": "nonpayable", 169 | "type": "function" 170 | }, 171 | { 172 | "inputs": [], 173 | "name": "mintable", 174 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 175 | "stateMutability": "view", 176 | "type": "function" 177 | }, 178 | { 179 | "inputs": [], 180 | "name": "name", 181 | "outputs": [{ "internalType": "string", "name": "", "type": "string" }], 182 | "stateMutability": "view", 183 | "type": "function" 184 | }, 185 | { 186 | "inputs": [], 187 | "name": "renounceOwnership", 188 | "outputs": [], 189 | "stateMutability": "nonpayable", 190 | "type": "function" 191 | }, 192 | { 193 | "inputs": [], 194 | "name": "symbol", 195 | "outputs": [{ "internalType": "string", "name": "", "type": "string" }], 196 | "stateMutability": "view", 197 | "type": "function" 198 | }, 199 | { 200 | "inputs": [], 201 | "name": "totalSupply", 202 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 203 | "stateMutability": "view", 204 | "type": "function" 205 | }, 206 | { 207 | "inputs": [ 208 | { "internalType": "address", "name": "recipient", "type": "address" }, 209 | { "internalType": "uint256", "name": "amount", "type": "uint256" } 210 | ], 211 | "name": "transfer", 212 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 213 | "stateMutability": "nonpayable", 214 | "type": "function" 215 | }, 216 | { 217 | "inputs": [ 218 | { "internalType": "address", "name": "sender", "type": "address" }, 219 | { "internalType": "address", "name": "recipient", "type": "address" }, 220 | { "internalType": "uint256", "name": "amount", "type": "uint256" } 221 | ], 222 | "name": "transferFrom", 223 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 224 | "stateMutability": "nonpayable", 225 | "type": "function" 226 | }, 227 | { 228 | "inputs": [ 229 | { "internalType": "address", "name": "newOwner", "type": "address" } 230 | ], 231 | "name": "transferOwnership", 232 | "outputs": [], 233 | "stateMutability": "nonpayable", 234 | "type": "function" 235 | } 236 | ] 237 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/src/abi/multicall.ts: -------------------------------------------------------------------------------- 1 | import * as ethers from 'ethers' 2 | import {ContractBase, Func} from './abi.support' 3 | 4 | 5 | const abi = new ethers.Interface([ 6 | { 7 | type: 'function', 8 | name: 'aggregate', 9 | stateMutability: 'nonpayable', 10 | inputs: [ 11 | { 12 | name: 'calls', 13 | type: 'tuple[]', 14 | components: [ 15 | {name: 'target', type: 'address'}, 16 | {name: 'callData', type: 'bytes'}, 17 | ] 18 | } 19 | ], 20 | outputs: [ 21 | {name: 'blockNumber', type: 'uint256'}, 22 | {name: 'returnData', type: 'bytes[]'}, 23 | ] 24 | }, 25 | { 26 | name: 'tryAggregate', 27 | type: 'function', 28 | stateMutability: 'nonpayable', 29 | inputs: [ 30 | {name: 'requireSuccess', type: 'bool'}, 31 | { 32 | name: 'calls', 33 | type: 'tuple[]', 34 | components: [ 35 | {name: 'target', type: 'address'}, 36 | {name: 'callData', type: 'bytes'}, 37 | ] 38 | } 39 | ], 40 | outputs: [ 41 | { 42 | name: 'returnData', 43 | type: 'tuple[]', 44 | components: [ 45 | {name: 'success', type: 'bool'}, 46 | {name: 'returnData', type: 'bytes'}, 47 | ] 48 | }, 49 | ] 50 | } 51 | ]) 52 | 53 | 54 | type AnyFunc = Func 55 | type Call = [address: string, bytes: string] 56 | 57 | 58 | const aggregate = new Func<[calls: Call[]], {}, {blockNumber: bigint, returnData: string[]}>( 59 | abi, abi.getFunction('aggregate')!.selector 60 | ) 61 | 62 | 63 | const try_aggregate = new Func<[requireSuccess: boolean, calls: Array<[target: string, callData: string]>], {}, Array<{success: boolean, returnData: string}>>( 64 | abi, abi.getFunction('tryAggregate')!.selector 65 | ) 66 | 67 | 68 | export type MulticallResult = { 69 | success: true 70 | value: T 71 | } | { 72 | success: false 73 | returnData?: string 74 | value?: undefined 75 | } 76 | 77 | 78 | export class Multicall extends ContractBase { 79 | static aggregate = aggregate 80 | static try_aggregate = try_aggregate 81 | 82 | aggregate( 83 | func: Func, 84 | address: string, 85 | calls: Args[], 86 | paging?: number 87 | ): Promise 88 | 89 | aggregate( 90 | func: Func, 91 | calls: [address: string, args: Args][], 92 | paging?: number 93 | ): Promise 94 | 95 | aggregate( 96 | calls: [func: AnyFunc, address: string, args: any[]][], 97 | paging?: number 98 | ): Promise 99 | 100 | async aggregate(...args: any[]): Promise { 101 | let [calls, funcs, page] = this.makeCalls(args) 102 | let size = calls.length 103 | let results = new Array(size) 104 | for (let [from, to] of splitIntoPages(size, page)) { 105 | let {returnData} = await this.eth_call(aggregate, [calls.slice(from, to)]) 106 | for (let i = from; i < to; i++) { 107 | let data = returnData[i - from] 108 | results[i] = funcs[i].decodeResult(data) 109 | } 110 | } 111 | return results 112 | } 113 | 114 | tryAggregate( 115 | func: Func, 116 | address: string, 117 | calls: Args[], 118 | paging?: number 119 | ): Promise[]> 120 | 121 | tryAggregate( 122 | func: Func, 123 | calls: [address: string, args: Args][], 124 | paging?: number 125 | ): Promise[]> 126 | 127 | tryAggregate( 128 | calls: [func: AnyFunc, address: string, args: any[]][], 129 | paging?: number 130 | ): Promise[]> 131 | 132 | async tryAggregate(...args: any[]): Promise { 133 | let [calls, funcs, page] = this.makeCalls(args) 134 | let size = calls.length 135 | let results = new Array(size) 136 | for (let [from, to] of splitIntoPages(size, page)) { 137 | let response = await this.eth_call(try_aggregate, [false, calls.slice(from, to)]) 138 | for (let i = from; i < to; i++) { 139 | let res = response[i - from] 140 | if (res.success) { 141 | try { 142 | results[i] = { 143 | success: true, 144 | value: funcs[i].decodeResult(res.returnData) 145 | } 146 | } catch(err: any) { 147 | results[i] = {success: false, returnData: res.returnData} 148 | } 149 | } else { 150 | results[i] = {success: false} 151 | } 152 | } 153 | } 154 | return results 155 | } 156 | 157 | private makeCalls(args: any[]): [calls: Call[], funcs: AnyFunc[], page: number] { 158 | let page = typeof args[args.length-1] == 'number' ? args.pop()! : Number.MAX_SAFE_INTEGER 159 | switch(args.length) { 160 | case 1: { 161 | let list: [func: AnyFunc, address: string, args: any[]][] = args[0] 162 | let calls = new Array(list.length) 163 | let funcs = new Array(list.length) 164 | for (let i = 0; i < list.length; i++) { 165 | let [func, address, args] = list[i] 166 | calls[i] = [address, func.encode(args)] 167 | funcs[i] = func 168 | } 169 | return [calls, funcs, page] 170 | } 171 | case 2: { 172 | let func: AnyFunc = args[0] 173 | let list: [address: string, args: any[]][] = args[1] 174 | let calls = new Array(list.length) 175 | let funcs = new Array(list.length) 176 | for (let i = 0; i < list.length; i++) { 177 | let [address, args] = list[i] 178 | calls[i] = [address, func.encode(args)] 179 | funcs[i] = func 180 | } 181 | return [calls, funcs, page] 182 | } 183 | case 3: { 184 | let func: AnyFunc = args[0] 185 | let address: string = args[1] 186 | let list: any[][] = args[2] 187 | let calls = new Array(list.length) 188 | let funcs = new Array(list.length) 189 | for (let i = 0; i < list.length; i++) { 190 | let args = list[i] 191 | calls[i] = [address, func.encode(args)] 192 | funcs[i] = func 193 | } 194 | return [calls, funcs, page] 195 | } 196 | default: 197 | throw new Error('unexpected number of arguments') 198 | } 199 | } 200 | } 201 | 202 | 203 | function* splitIntoPages(size: number, page: number): Iterable<[from: number, to: number]> { 204 | let from = 0 205 | while (size) { 206 | let step = Math.min(page, size) 207 | let to = from + step 208 | yield [from, to] 209 | size -= step 210 | from = to 211 | } 212 | } 213 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/src/abi/multicall.ts: -------------------------------------------------------------------------------- 1 | import * as ethers from 'ethers' 2 | import {ContractBase, Func} from './abi.support' 3 | 4 | 5 | const abi = new ethers.Interface([ 6 | { 7 | type: 'function', 8 | name: 'aggregate', 9 | stateMutability: 'nonpayable', 10 | inputs: [ 11 | { 12 | name: 'calls', 13 | type: 'tuple[]', 14 | components: [ 15 | {name: 'target', type: 'address'}, 16 | {name: 'callData', type: 'bytes'}, 17 | ] 18 | } 19 | ], 20 | outputs: [ 21 | {name: 'blockNumber', type: 'uint256'}, 22 | {name: 'returnData', type: 'bytes[]'}, 23 | ] 24 | }, 25 | { 26 | name: 'tryAggregate', 27 | type: 'function', 28 | stateMutability: 'nonpayable', 29 | inputs: [ 30 | {name: 'requireSuccess', type: 'bool'}, 31 | { 32 | name: 'calls', 33 | type: 'tuple[]', 34 | components: [ 35 | {name: 'target', type: 'address'}, 36 | {name: 'callData', type: 'bytes'}, 37 | ] 38 | } 39 | ], 40 | outputs: [ 41 | { 42 | name: 'returnData', 43 | type: 'tuple[]', 44 | components: [ 45 | {name: 'success', type: 'bool'}, 46 | {name: 'returnData', type: 'bytes'}, 47 | ] 48 | }, 49 | ] 50 | } 51 | ]) 52 | 53 | 54 | type AnyFunc = Func 55 | type Call = [address: string, bytes: string] 56 | 57 | 58 | const aggregate = new Func<[calls: Call[]], {}, {blockNumber: bigint, returnData: string[]}>( 59 | abi, abi.getFunction('aggregate')!.selector 60 | ) 61 | 62 | 63 | const try_aggregate = new Func<[requireSuccess: boolean, calls: Array<[target: string, callData: string]>], {}, Array<{success: boolean, returnData: string}>>( 64 | abi, abi.getFunction('tryAggregate')!.selector 65 | ) 66 | 67 | 68 | export type MulticallResult = { 69 | success: true 70 | value: T 71 | } | { 72 | success: false 73 | returnData?: string 74 | value?: undefined 75 | } 76 | 77 | 78 | export class Multicall extends ContractBase { 79 | static aggregate = aggregate 80 | static try_aggregate = try_aggregate 81 | 82 | aggregate( 83 | func: Func, 84 | address: string, 85 | calls: Args[], 86 | paging?: number 87 | ): Promise 88 | 89 | aggregate( 90 | func: Func, 91 | calls: [address: string, args: Args][], 92 | paging?: number 93 | ): Promise 94 | 95 | aggregate( 96 | calls: [func: AnyFunc, address: string, args: any[]][], 97 | paging?: number 98 | ): Promise 99 | 100 | async aggregate(...args: any[]): Promise { 101 | let [calls, funcs, page] = this.makeCalls(args) 102 | let size = calls.length 103 | let results = new Array(size) 104 | for (let [from, to] of splitIntoPages(size, page)) { 105 | let {returnData} = await this.eth_call(aggregate, [calls.slice(from, to)]) 106 | for (let i = from; i < to; i++) { 107 | let data = returnData[i - from] 108 | results[i] = funcs[i].decodeResult(data) 109 | } 110 | } 111 | return results 112 | } 113 | 114 | tryAggregate( 115 | func: Func, 116 | address: string, 117 | calls: Args[], 118 | paging?: number 119 | ): Promise[]> 120 | 121 | tryAggregate( 122 | func: Func, 123 | calls: [address: string, args: Args][], 124 | paging?: number 125 | ): Promise[]> 126 | 127 | tryAggregate( 128 | calls: [func: AnyFunc, address: string, args: any[]][], 129 | paging?: number 130 | ): Promise[]> 131 | 132 | async tryAggregate(...args: any[]): Promise { 133 | let [calls, funcs, page] = this.makeCalls(args) 134 | let size = calls.length 135 | let results = new Array(size) 136 | for (let [from, to] of splitIntoPages(size, page)) { 137 | let response = await this.eth_call(try_aggregate, [false, calls.slice(from, to)]) 138 | for (let i = from; i < to; i++) { 139 | let res = response[i - from] 140 | if (res.success) { 141 | try { 142 | results[i] = { 143 | success: true, 144 | value: funcs[i].decodeResult(res.returnData) 145 | } 146 | } catch(err: any) { 147 | results[i] = {success: false, returnData: res.returnData} 148 | } 149 | } else { 150 | results[i] = {success: false} 151 | } 152 | } 153 | } 154 | return results 155 | } 156 | 157 | private makeCalls(args: any[]): [calls: Call[], funcs: AnyFunc[], page: number] { 158 | let page = typeof args[args.length-1] == 'number' ? args.pop()! : Number.MAX_SAFE_INTEGER 159 | switch(args.length) { 160 | case 1: { 161 | let list: [func: AnyFunc, address: string, args: any[]][] = args[0] 162 | let calls = new Array(list.length) 163 | let funcs = new Array(list.length) 164 | for (let i = 0; i < list.length; i++) { 165 | let [func, address, args] = list[i] 166 | calls[i] = [address, func.encode(args)] 167 | funcs[i] = func 168 | } 169 | return [calls, funcs, page] 170 | } 171 | case 2: { 172 | let func: AnyFunc = args[0] 173 | let list: [address: string, args: any[]][] = args[1] 174 | let calls = new Array(list.length) 175 | let funcs = new Array(list.length) 176 | for (let i = 0; i < list.length; i++) { 177 | let [address, args] = list[i] 178 | calls[i] = [address, func.encode(args)] 179 | funcs[i] = func 180 | } 181 | return [calls, funcs, page] 182 | } 183 | case 3: { 184 | let func: AnyFunc = args[0] 185 | let address: string = args[1] 186 | let list: any[][] = args[2] 187 | let calls = new Array(list.length) 188 | let funcs = new Array(list.length) 189 | for (let i = 0; i < list.length; i++) { 190 | let args = list[i] 191 | calls[i] = [address, func.encode(args)] 192 | funcs[i] = func 193 | } 194 | return [calls, funcs, page] 195 | } 196 | default: 197 | throw new Error('unexpected number of arguments') 198 | } 199 | } 200 | } 201 | 202 | 203 | function* splitIntoPages(size: number, page: number): Iterable<[from: number, to: number]> { 204 | let from = 0 205 | while (size) { 206 | let step = Math.min(page, size) 207 | let to = from + step 208 | yield [from, to] 209 | size -= step 210 | from = to 211 | } 212 | } 213 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/abi/busdt.json: -------------------------------------------------------------------------------- 1 | [ 2 | { 3 | "inputs": [], 4 | "payable": false, 5 | "stateMutability": "nonpayable", 6 | "type": "constructor" 7 | }, 8 | { 9 | "anonymous": false, 10 | "inputs": [ 11 | { 12 | "indexed": true, 13 | "internalType": "address", 14 | "name": "owner", 15 | "type": "address" 16 | }, 17 | { 18 | "indexed": true, 19 | "internalType": "address", 20 | "name": "spender", 21 | "type": "address" 22 | }, 23 | { 24 | "indexed": false, 25 | "internalType": "uint256", 26 | "name": "value", 27 | "type": "uint256" 28 | } 29 | ], 30 | "name": "Approval", 31 | "type": "event" 32 | }, 33 | { 34 | "anonymous": false, 35 | "inputs": [ 36 | { 37 | "indexed": true, 38 | "internalType": "address", 39 | "name": "previousOwner", 40 | "type": "address" 41 | }, 42 | { 43 | "indexed": true, 44 | "internalType": "address", 45 | "name": "newOwner", 46 | "type": "address" 47 | } 48 | ], 49 | "name": "OwnershipTransferred", 50 | "type": "event" 51 | }, 52 | { 53 | "anonymous": false, 54 | "inputs": [ 55 | { 56 | "indexed": true, 57 | "internalType": "address", 58 | "name": "from", 59 | "type": "address" 60 | }, 61 | { 62 | "indexed": true, 63 | "internalType": "address", 64 | "name": "to", 65 | "type": "address" 66 | }, 67 | { 68 | "indexed": false, 69 | "internalType": "uint256", 70 | "name": "value", 71 | "type": "uint256" 72 | } 73 | ], 74 | "name": "Transfer", 75 | "type": "event" 76 | }, 77 | { 78 | "constant": true, 79 | "inputs": [], 80 | "name": "_decimals", 81 | "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], 82 | "payable": false, 83 | "stateMutability": "view", 84 | "type": "function" 85 | }, 86 | { 87 | "constant": true, 88 | "inputs": [], 89 | "name": "_name", 90 | "outputs": [{ "internalType": "string", "name": "", "type": "string" }], 91 | "payable": false, 92 | "stateMutability": "view", 93 | "type": "function" 94 | }, 95 | { 96 | "constant": true, 97 | "inputs": [], 98 | "name": "_symbol", 99 | "outputs": [{ "internalType": "string", "name": "", "type": "string" }], 100 | "payable": false, 101 | "stateMutability": "view", 102 | "type": "function" 103 | }, 104 | { 105 | "constant": true, 106 | "inputs": [ 107 | { "internalType": "address", "name": "owner", "type": "address" }, 108 | { "internalType": "address", "name": "spender", "type": "address" } 109 | ], 110 | "name": "allowance", 111 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 112 | "payable": false, 113 | "stateMutability": "view", 114 | "type": "function" 115 | }, 116 | { 117 | "constant": false, 118 | "inputs": [ 119 | { "internalType": "address", "name": "spender", "type": "address" }, 120 | { "internalType": "uint256", "name": "amount", "type": "uint256" } 121 | ], 122 | "name": "approve", 123 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 124 | "payable": false, 125 | "stateMutability": "nonpayable", 126 | "type": "function" 127 | }, 128 | { 129 | "constant": true, 130 | "inputs": [ 131 | { "internalType": "address", "name": "account", "type": "address" } 132 | ], 133 | "name": "balanceOf", 134 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 135 | "payable": false, 136 | "stateMutability": "view", 137 | "type": "function" 138 | }, 139 | { 140 | "constant": false, 141 | "inputs": [ 142 | { "internalType": "uint256", "name": "amount", "type": "uint256" } 143 | ], 144 | "name": "burn", 145 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 146 | "payable": false, 147 | "stateMutability": "nonpayable", 148 | "type": "function" 149 | }, 150 | { 151 | "constant": true, 152 | "inputs": [], 153 | "name": "decimals", 154 | "outputs": [{ "internalType": "uint8", "name": "", "type": "uint8" }], 155 | "payable": false, 156 | "stateMutability": "view", 157 | "type": "function" 158 | }, 159 | { 160 | "constant": false, 161 | "inputs": [ 162 | { "internalType": "address", "name": "spender", "type": "address" }, 163 | { 164 | "internalType": "uint256", 165 | "name": "subtractedValue", 166 | "type": "uint256" 167 | } 168 | ], 169 | "name": "decreaseAllowance", 170 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 171 | "payable": false, 172 | "stateMutability": "nonpayable", 173 | "type": "function" 174 | }, 175 | { 176 | "constant": true, 177 | "inputs": [], 178 | "name": "getOwner", 179 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 180 | "payable": false, 181 | "stateMutability": "view", 182 | "type": "function" 183 | }, 184 | { 185 | "constant": false, 186 | "inputs": [ 187 | { "internalType": "address", "name": "spender", "type": "address" }, 188 | { "internalType": "uint256", "name": "addedValue", "type": "uint256" } 189 | ], 190 | "name": "increaseAllowance", 191 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 192 | "payable": false, 193 | "stateMutability": "nonpayable", 194 | "type": "function" 195 | }, 196 | { 197 | "constant": false, 198 | "inputs": [ 199 | { "internalType": "uint256", "name": "amount", "type": "uint256" } 200 | ], 201 | "name": "mint", 202 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 203 | "payable": false, 204 | "stateMutability": "nonpayable", 205 | "type": "function" 206 | }, 207 | { 208 | "constant": true, 209 | "inputs": [], 210 | "name": "name", 211 | "outputs": [{ "internalType": "string", "name": "", "type": "string" }], 212 | "payable": false, 213 | "stateMutability": "view", 214 | "type": "function" 215 | }, 216 | { 217 | "constant": true, 218 | "inputs": [], 219 | "name": "owner", 220 | "outputs": [{ "internalType": "address", "name": "", "type": "address" }], 221 | "payable": false, 222 | "stateMutability": "view", 223 | "type": "function" 224 | }, 225 | { 226 | "constant": false, 227 | "inputs": [], 228 | "name": "renounceOwnership", 229 | "outputs": [], 230 | "payable": false, 231 | "stateMutability": "nonpayable", 232 | "type": "function" 233 | }, 234 | { 235 | "constant": true, 236 | "inputs": [], 237 | "name": "symbol", 238 | "outputs": [{ "internalType": "string", "name": "", "type": "string" }], 239 | "payable": false, 240 | "stateMutability": "view", 241 | "type": "function" 242 | }, 243 | { 244 | "constant": true, 245 | "inputs": [], 246 | "name": "totalSupply", 247 | "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }], 248 | "payable": false, 249 | "stateMutability": "view", 250 | "type": "function" 251 | }, 252 | { 253 | "constant": false, 254 | "inputs": [ 255 | { "internalType": "address", "name": "recipient", "type": "address" }, 256 | { "internalType": "uint256", "name": "amount", "type": "uint256" } 257 | ], 258 | "name": "transfer", 259 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 260 | "payable": false, 261 | "stateMutability": "nonpayable", 262 | "type": "function" 263 | }, 264 | { 265 | "constant": false, 266 | "inputs": [ 267 | { "internalType": "address", "name": "sender", "type": "address" }, 268 | { "internalType": "address", "name": "recipient", "type": "address" }, 269 | { "internalType": "uint256", "name": "amount", "type": "uint256" } 270 | ], 271 | "name": "transferFrom", 272 | "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }], 273 | "payable": false, 274 | "stateMutability": "nonpayable", 275 | "type": "function" 276 | }, 277 | { 278 | "constant": false, 279 | "inputs": [ 280 | { "internalType": "address", "name": "newOwner", "type": "address" } 281 | ], 282 | "name": "transferOwnership", 283 | "outputs": [], 284 | "payable": false, 285 | "stateMutability": "nonpayable", 286 | "type": "function" 287 | } 288 | ] 289 | -------------------------------------------------------------------------------- /bnb-tranfers-usdtc/bnb-transfers-usdc-squid/src/abi/busdc.abi.ts: -------------------------------------------------------------------------------- 1 | export const ABI_JSON = [ 2 | { 3 | "type": "constructor", 4 | "stateMutability": "undefined", 5 | "payable": false, 6 | "inputs": [] 7 | }, 8 | { 9 | "type": "event", 10 | "anonymous": false, 11 | "name": "Approval", 12 | "inputs": [ 13 | { 14 | "type": "address", 15 | "name": "owner", 16 | "indexed": true 17 | }, 18 | { 19 | "type": "address", 20 | "name": "spender", 21 | "indexed": true 22 | }, 23 | { 24 | "type": "uint256", 25 | "name": "value", 26 | "indexed": false 27 | } 28 | ] 29 | }, 30 | { 31 | "type": "event", 32 | "anonymous": false, 33 | "name": "OwnershipTransferred", 34 | "inputs": [ 35 | { 36 | "type": "address", 37 | "name": "previousOwner", 38 | "indexed": true 39 | }, 40 | { 41 | "type": "address", 42 | "name": "newOwner", 43 | "indexed": true 44 | } 45 | ] 46 | }, 47 | { 48 | "type": "event", 49 | "anonymous": false, 50 | "name": "Transfer", 51 | "inputs": [ 52 | { 53 | "type": "address", 54 | "name": "from", 55 | "indexed": true 56 | }, 57 | { 58 | "type": "address", 59 | "name": "to", 60 | "indexed": true 61 | }, 62 | { 63 | "type": "uint256", 64 | "name": "value", 65 | "indexed": false 66 | } 67 | ] 68 | }, 69 | { 70 | "type": "function", 71 | "name": "allowance", 72 | "constant": true, 73 | "stateMutability": "view", 74 | "payable": false, 75 | "inputs": [ 76 | { 77 | "type": "address", 78 | "name": "owner" 79 | }, 80 | { 81 | "type": "address", 82 | "name": "spender" 83 | } 84 | ], 85 | "outputs": [ 86 | { 87 | "type": "uint256", 88 | "name": "" 89 | } 90 | ] 91 | }, 92 | { 93 | "type": "function", 94 | "name": "approve", 95 | "constant": false, 96 | "payable": false, 97 | "inputs": [ 98 | { 99 | "type": "address", 100 | "name": "spender" 101 | }, 102 | { 103 | "type": "uint256", 104 | "name": "amount" 105 | } 106 | ], 107 | "outputs": [ 108 | { 109 | "type": "bool", 110 | "name": "" 111 | } 112 | ] 113 | }, 114 | { 115 | "type": "function", 116 | "name": "balanceOf", 117 | "constant": true, 118 | "stateMutability": "view", 119 | "payable": false, 120 | "inputs": [ 121 | { 122 | "type": "address", 123 | "name": "account" 124 | } 125 | ], 126 | "outputs": [ 127 | { 128 | "type": "uint256", 129 | "name": "" 130 | } 131 | ] 132 | }, 133 | { 134 | "type": "function", 135 | "name": "burn", 136 | "constant": false, 137 | "payable": false, 138 | "inputs": [ 139 | { 140 | "type": "uint256", 141 | "name": "amount" 142 | } 143 | ], 144 | "outputs": [ 145 | { 146 | "type": "bool", 147 | "name": "" 148 | } 149 | ] 150 | }, 151 | { 152 | "type": "function", 153 | "name": "decimals", 154 | "constant": true, 155 | "stateMutability": "view", 156 | "payable": false, 157 | "inputs": [], 158 | "outputs": [ 159 | { 160 | "type": "uint8", 161 | "name": "" 162 | } 163 | ] 164 | }, 165 | { 166 | "type": "function", 167 | "name": "decreaseAllowance", 168 | "constant": false, 169 | "payable": false, 170 | "inputs": [ 171 | { 172 | "type": "address", 173 | "name": "spender" 174 | }, 175 | { 176 | "type": "uint256", 177 | "name": "subtractedValue" 178 | } 179 | ], 180 | "outputs": [ 181 | { 182 | "type": "bool", 183 | "name": "" 184 | } 185 | ] 186 | }, 187 | { 188 | "type": "function", 189 | "name": "getOwner", 190 | "constant": true, 191 | "stateMutability": "view", 192 | "payable": false, 193 | "inputs": [], 194 | "outputs": [ 195 | { 196 | "type": "address", 197 | "name": "" 198 | } 199 | ] 200 | }, 201 | { 202 | "type": "function", 203 | "name": "increaseAllowance", 204 | "constant": false, 205 | "payable": false, 206 | "inputs": [ 207 | { 208 | "type": "address", 209 | "name": "spender" 210 | }, 211 | { 212 | "type": "uint256", 213 | "name": "addedValue" 214 | } 215 | ], 216 | "outputs": [ 217 | { 218 | "type": "bool", 219 | "name": "" 220 | } 221 | ] 222 | }, 223 | { 224 | "type": "function", 225 | "name": "initialize", 226 | "constant": false, 227 | "payable": false, 228 | "inputs": [ 229 | { 230 | "type": "string", 231 | "name": "name" 232 | }, 233 | { 234 | "type": "string", 235 | "name": "symbol" 236 | }, 237 | { 238 | "type": "uint8", 239 | "name": "decimals" 240 | }, 241 | { 242 | "type": "uint256", 243 | "name": "amount" 244 | }, 245 | { 246 | "type": "bool", 247 | "name": "mintable" 248 | }, 249 | { 250 | "type": "address", 251 | "name": "owner" 252 | } 253 | ], 254 | "outputs": [] 255 | }, 256 | { 257 | "type": "function", 258 | "name": "mint", 259 | "constant": false, 260 | "payable": false, 261 | "inputs": [ 262 | { 263 | "type": "uint256", 264 | "name": "amount" 265 | } 266 | ], 267 | "outputs": [ 268 | { 269 | "type": "bool", 270 | "name": "" 271 | } 272 | ] 273 | }, 274 | { 275 | "type": "function", 276 | "name": "mintable", 277 | "constant": true, 278 | "stateMutability": "view", 279 | "payable": false, 280 | "inputs": [], 281 | "outputs": [ 282 | { 283 | "type": "bool", 284 | "name": "" 285 | } 286 | ] 287 | }, 288 | { 289 | "type": "function", 290 | "name": "name", 291 | "constant": true, 292 | "stateMutability": "view", 293 | "payable": false, 294 | "inputs": [], 295 | "outputs": [ 296 | { 297 | "type": "string", 298 | "name": "" 299 | } 300 | ] 301 | }, 302 | { 303 | "type": "function", 304 | "name": "renounceOwnership", 305 | "constant": false, 306 | "payable": false, 307 | "inputs": [], 308 | "outputs": [] 309 | }, 310 | { 311 | "type": "function", 312 | "name": "symbol", 313 | "constant": true, 314 | "stateMutability": "view", 315 | "payable": false, 316 | "inputs": [], 317 | "outputs": [ 318 | { 319 | "type": "string", 320 | "name": "" 321 | } 322 | ] 323 | }, 324 | { 325 | "type": "function", 326 | "name": "totalSupply", 327 | "constant": true, 328 | "stateMutability": "view", 329 | "payable": false, 330 | "inputs": [], 331 | "outputs": [ 332 | { 333 | "type": "uint256", 334 | "name": "" 335 | } 336 | ] 337 | }, 338 | { 339 | "type": "function", 340 | "name": "transfer", 341 | "constant": false, 342 | "payable": false, 343 | "inputs": [ 344 | { 345 | "type": "address", 346 | "name": "recipient" 347 | }, 348 | { 349 | "type": "uint256", 350 | "name": "amount" 351 | } 352 | ], 353 | "outputs": [ 354 | { 355 | "type": "bool", 356 | "name": "" 357 | } 358 | ] 359 | }, 360 | { 361 | "type": "function", 362 | "name": "transferFrom", 363 | "constant": false, 364 | "payable": false, 365 | "inputs": [ 366 | { 367 | "type": "address", 368 | "name": "sender" 369 | }, 370 | { 371 | "type": "address", 372 | "name": "recipient" 373 | }, 374 | { 375 | "type": "uint256", 376 | "name": "amount" 377 | } 378 | ], 379 | "outputs": [ 380 | { 381 | "type": "bool", 382 | "name": "" 383 | } 384 | ] 385 | }, 386 | { 387 | "type": "function", 388 | "name": "transferOwnership", 389 | "constant": false, 390 | "payable": false, 391 | "inputs": [ 392 | { 393 | "type": "address", 394 | "name": "newOwner" 395 | } 396 | ], 397 | "outputs": [] 398 | } 399 | ] 400 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/src/abi/busdc.abi.ts: -------------------------------------------------------------------------------- 1 | export const ABI_JSON = [ 2 | { 3 | "type": "constructor", 4 | "stateMutability": "undefined", 5 | "payable": false, 6 | "inputs": [] 7 | }, 8 | { 9 | "type": "event", 10 | "anonymous": false, 11 | "name": "Approval", 12 | "inputs": [ 13 | { 14 | "type": "address", 15 | "name": "owner", 16 | "indexed": true 17 | }, 18 | { 19 | "type": "address", 20 | "name": "spender", 21 | "indexed": true 22 | }, 23 | { 24 | "type": "uint256", 25 | "name": "value", 26 | "indexed": false 27 | } 28 | ] 29 | }, 30 | { 31 | "type": "event", 32 | "anonymous": false, 33 | "name": "OwnershipTransferred", 34 | "inputs": [ 35 | { 36 | "type": "address", 37 | "name": "previousOwner", 38 | "indexed": true 39 | }, 40 | { 41 | "type": "address", 42 | "name": "newOwner", 43 | "indexed": true 44 | } 45 | ] 46 | }, 47 | { 48 | "type": "event", 49 | "anonymous": false, 50 | "name": "Transfer", 51 | "inputs": [ 52 | { 53 | "type": "address", 54 | "name": "from", 55 | "indexed": true 56 | }, 57 | { 58 | "type": "address", 59 | "name": "to", 60 | "indexed": true 61 | }, 62 | { 63 | "type": "uint256", 64 | "name": "value", 65 | "indexed": false 66 | } 67 | ] 68 | }, 69 | { 70 | "type": "function", 71 | "name": "allowance", 72 | "constant": true, 73 | "stateMutability": "view", 74 | "payable": false, 75 | "inputs": [ 76 | { 77 | "type": "address", 78 | "name": "owner" 79 | }, 80 | { 81 | "type": "address", 82 | "name": "spender" 83 | } 84 | ], 85 | "outputs": [ 86 | { 87 | "type": "uint256", 88 | "name": "" 89 | } 90 | ] 91 | }, 92 | { 93 | "type": "function", 94 | "name": "approve", 95 | "constant": false, 96 | "payable": false, 97 | "inputs": [ 98 | { 99 | "type": "address", 100 | "name": "spender" 101 | }, 102 | { 103 | "type": "uint256", 104 | "name": "amount" 105 | } 106 | ], 107 | "outputs": [ 108 | { 109 | "type": "bool", 110 | "name": "" 111 | } 112 | ] 113 | }, 114 | { 115 | "type": "function", 116 | "name": "balanceOf", 117 | "constant": true, 118 | "stateMutability": "view", 119 | "payable": false, 120 | "inputs": [ 121 | { 122 | "type": "address", 123 | "name": "account" 124 | } 125 | ], 126 | "outputs": [ 127 | { 128 | "type": "uint256", 129 | "name": "" 130 | } 131 | ] 132 | }, 133 | { 134 | "type": "function", 135 | "name": "burn", 136 | "constant": false, 137 | "payable": false, 138 | "inputs": [ 139 | { 140 | "type": "uint256", 141 | "name": "amount" 142 | } 143 | ], 144 | "outputs": [ 145 | { 146 | "type": "bool", 147 | "name": "" 148 | } 149 | ] 150 | }, 151 | { 152 | "type": "function", 153 | "name": "decimals", 154 | "constant": true, 155 | "stateMutability": "view", 156 | "payable": false, 157 | "inputs": [], 158 | "outputs": [ 159 | { 160 | "type": "uint8", 161 | "name": "" 162 | } 163 | ] 164 | }, 165 | { 166 | "type": "function", 167 | "name": "decreaseAllowance", 168 | "constant": false, 169 | "payable": false, 170 | "inputs": [ 171 | { 172 | "type": "address", 173 | "name": "spender" 174 | }, 175 | { 176 | "type": "uint256", 177 | "name": "subtractedValue" 178 | } 179 | ], 180 | "outputs": [ 181 | { 182 | "type": "bool", 183 | "name": "" 184 | } 185 | ] 186 | }, 187 | { 188 | "type": "function", 189 | "name": "getOwner", 190 | "constant": true, 191 | "stateMutability": "view", 192 | "payable": false, 193 | "inputs": [], 194 | "outputs": [ 195 | { 196 | "type": "address", 197 | "name": "" 198 | } 199 | ] 200 | }, 201 | { 202 | "type": "function", 203 | "name": "increaseAllowance", 204 | "constant": false, 205 | "payable": false, 206 | "inputs": [ 207 | { 208 | "type": "address", 209 | "name": "spender" 210 | }, 211 | { 212 | "type": "uint256", 213 | "name": "addedValue" 214 | } 215 | ], 216 | "outputs": [ 217 | { 218 | "type": "bool", 219 | "name": "" 220 | } 221 | ] 222 | }, 223 | { 224 | "type": "function", 225 | "name": "initialize", 226 | "constant": false, 227 | "payable": false, 228 | "inputs": [ 229 | { 230 | "type": "string", 231 | "name": "name" 232 | }, 233 | { 234 | "type": "string", 235 | "name": "symbol" 236 | }, 237 | { 238 | "type": "uint8", 239 | "name": "decimals" 240 | }, 241 | { 242 | "type": "uint256", 243 | "name": "amount" 244 | }, 245 | { 246 | "type": "bool", 247 | "name": "mintable" 248 | }, 249 | { 250 | "type": "address", 251 | "name": "owner" 252 | } 253 | ], 254 | "outputs": [] 255 | }, 256 | { 257 | "type": "function", 258 | "name": "mint", 259 | "constant": false, 260 | "payable": false, 261 | "inputs": [ 262 | { 263 | "type": "uint256", 264 | "name": "amount" 265 | } 266 | ], 267 | "outputs": [ 268 | { 269 | "type": "bool", 270 | "name": "" 271 | } 272 | ] 273 | }, 274 | { 275 | "type": "function", 276 | "name": "mintable", 277 | "constant": true, 278 | "stateMutability": "view", 279 | "payable": false, 280 | "inputs": [], 281 | "outputs": [ 282 | { 283 | "type": "bool", 284 | "name": "" 285 | } 286 | ] 287 | }, 288 | { 289 | "type": "function", 290 | "name": "name", 291 | "constant": true, 292 | "stateMutability": "view", 293 | "payable": false, 294 | "inputs": [], 295 | "outputs": [ 296 | { 297 | "type": "string", 298 | "name": "" 299 | } 300 | ] 301 | }, 302 | { 303 | "type": "function", 304 | "name": "renounceOwnership", 305 | "constant": false, 306 | "payable": false, 307 | "inputs": [], 308 | "outputs": [] 309 | }, 310 | { 311 | "type": "function", 312 | "name": "symbol", 313 | "constant": true, 314 | "stateMutability": "view", 315 | "payable": false, 316 | "inputs": [], 317 | "outputs": [ 318 | { 319 | "type": "string", 320 | "name": "" 321 | } 322 | ] 323 | }, 324 | { 325 | "type": "function", 326 | "name": "totalSupply", 327 | "constant": true, 328 | "stateMutability": "view", 329 | "payable": false, 330 | "inputs": [], 331 | "outputs": [ 332 | { 333 | "type": "uint256", 334 | "name": "" 335 | } 336 | ] 337 | }, 338 | { 339 | "type": "function", 340 | "name": "transfer", 341 | "constant": false, 342 | "payable": false, 343 | "inputs": [ 344 | { 345 | "type": "address", 346 | "name": "recipient" 347 | }, 348 | { 349 | "type": "uint256", 350 | "name": "amount" 351 | } 352 | ], 353 | "outputs": [ 354 | { 355 | "type": "bool", 356 | "name": "" 357 | } 358 | ] 359 | }, 360 | { 361 | "type": "function", 362 | "name": "transferFrom", 363 | "constant": false, 364 | "payable": false, 365 | "inputs": [ 366 | { 367 | "type": "address", 368 | "name": "sender" 369 | }, 370 | { 371 | "type": "address", 372 | "name": "recipient" 373 | }, 374 | { 375 | "type": "uint256", 376 | "name": "amount" 377 | } 378 | ], 379 | "outputs": [ 380 | { 381 | "type": "bool", 382 | "name": "" 383 | } 384 | ] 385 | }, 386 | { 387 | "type": "function", 388 | "name": "transferOwnership", 389 | "constant": false, 390 | "payable": false, 391 | "inputs": [ 392 | { 393 | "type": "address", 394 | "name": "newOwner" 395 | } 396 | ], 397 | "outputs": [] 398 | } 399 | ] 400 | -------------------------------------------------------------------------------- /bnb-transfers-usdt/bnb-transfers-usdt-squid/src/abi/busdt.abi.ts: -------------------------------------------------------------------------------- 1 | export const ABI_JSON = [ 2 | { 3 | "type": "constructor", 4 | "stateMutability": "undefined", 5 | "payable": false, 6 | "inputs": [] 7 | }, 8 | { 9 | "type": "event", 10 | "anonymous": false, 11 | "name": "Approval", 12 | "inputs": [ 13 | { 14 | "type": "address", 15 | "name": "owner", 16 | "indexed": true 17 | }, 18 | { 19 | "type": "address", 20 | "name": "spender", 21 | "indexed": true 22 | }, 23 | { 24 | "type": "uint256", 25 | "name": "value", 26 | "indexed": false 27 | } 28 | ] 29 | }, 30 | { 31 | "type": "event", 32 | "anonymous": false, 33 | "name": "OwnershipTransferred", 34 | "inputs": [ 35 | { 36 | "type": "address", 37 | "name": "previousOwner", 38 | "indexed": true 39 | }, 40 | { 41 | "type": "address", 42 | "name": "newOwner", 43 | "indexed": true 44 | } 45 | ] 46 | }, 47 | { 48 | "type": "event", 49 | "anonymous": false, 50 | "name": "Transfer", 51 | "inputs": [ 52 | { 53 | "type": "address", 54 | "name": "from", 55 | "indexed": true 56 | }, 57 | { 58 | "type": "address", 59 | "name": "to", 60 | "indexed": true 61 | }, 62 | { 63 | "type": "uint256", 64 | "name": "value", 65 | "indexed": false 66 | } 67 | ] 68 | }, 69 | { 70 | "type": "function", 71 | "name": "_decimals", 72 | "constant": true, 73 | "stateMutability": "view", 74 | "payable": false, 75 | "inputs": [], 76 | "outputs": [ 77 | { 78 | "type": "uint8", 79 | "name": "" 80 | } 81 | ] 82 | }, 83 | { 84 | "type": "function", 85 | "name": "_name", 86 | "constant": true, 87 | "stateMutability": "view", 88 | "payable": false, 89 | "inputs": [], 90 | "outputs": [ 91 | { 92 | "type": "string", 93 | "name": "" 94 | } 95 | ] 96 | }, 97 | { 98 | "type": "function", 99 | "name": "_symbol", 100 | "constant": true, 101 | "stateMutability": "view", 102 | "payable": false, 103 | "inputs": [], 104 | "outputs": [ 105 | { 106 | "type": "string", 107 | "name": "" 108 | } 109 | ] 110 | }, 111 | { 112 | "type": "function", 113 | "name": "allowance", 114 | "constant": true, 115 | "stateMutability": "view", 116 | "payable": false, 117 | "inputs": [ 118 | { 119 | "type": "address", 120 | "name": "owner" 121 | }, 122 | { 123 | "type": "address", 124 | "name": "spender" 125 | } 126 | ], 127 | "outputs": [ 128 | { 129 | "type": "uint256", 130 | "name": "" 131 | } 132 | ] 133 | }, 134 | { 135 | "type": "function", 136 | "name": "approve", 137 | "constant": false, 138 | "payable": false, 139 | "inputs": [ 140 | { 141 | "type": "address", 142 | "name": "spender" 143 | }, 144 | { 145 | "type": "uint256", 146 | "name": "amount" 147 | } 148 | ], 149 | "outputs": [ 150 | { 151 | "type": "bool", 152 | "name": "" 153 | } 154 | ] 155 | }, 156 | { 157 | "type": "function", 158 | "name": "balanceOf", 159 | "constant": true, 160 | "stateMutability": "view", 161 | "payable": false, 162 | "inputs": [ 163 | { 164 | "type": "address", 165 | "name": "account" 166 | } 167 | ], 168 | "outputs": [ 169 | { 170 | "type": "uint256", 171 | "name": "" 172 | } 173 | ] 174 | }, 175 | { 176 | "type": "function", 177 | "name": "burn", 178 | "constant": false, 179 | "payable": false, 180 | "inputs": [ 181 | { 182 | "type": "uint256", 183 | "name": "amount" 184 | } 185 | ], 186 | "outputs": [ 187 | { 188 | "type": "bool", 189 | "name": "" 190 | } 191 | ] 192 | }, 193 | { 194 | "type": "function", 195 | "name": "decimals", 196 | "constant": true, 197 | "stateMutability": "view", 198 | "payable": false, 199 | "inputs": [], 200 | "outputs": [ 201 | { 202 | "type": "uint8", 203 | "name": "" 204 | } 205 | ] 206 | }, 207 | { 208 | "type": "function", 209 | "name": "decreaseAllowance", 210 | "constant": false, 211 | "payable": false, 212 | "inputs": [ 213 | { 214 | "type": "address", 215 | "name": "spender" 216 | }, 217 | { 218 | "type": "uint256", 219 | "name": "subtractedValue" 220 | } 221 | ], 222 | "outputs": [ 223 | { 224 | "type": "bool", 225 | "name": "" 226 | } 227 | ] 228 | }, 229 | { 230 | "type": "function", 231 | "name": "getOwner", 232 | "constant": true, 233 | "stateMutability": "view", 234 | "payable": false, 235 | "inputs": [], 236 | "outputs": [ 237 | { 238 | "type": "address", 239 | "name": "" 240 | } 241 | ] 242 | }, 243 | { 244 | "type": "function", 245 | "name": "increaseAllowance", 246 | "constant": false, 247 | "payable": false, 248 | "inputs": [ 249 | { 250 | "type": "address", 251 | "name": "spender" 252 | }, 253 | { 254 | "type": "uint256", 255 | "name": "addedValue" 256 | } 257 | ], 258 | "outputs": [ 259 | { 260 | "type": "bool", 261 | "name": "" 262 | } 263 | ] 264 | }, 265 | { 266 | "type": "function", 267 | "name": "mint", 268 | "constant": false, 269 | "payable": false, 270 | "inputs": [ 271 | { 272 | "type": "uint256", 273 | "name": "amount" 274 | } 275 | ], 276 | "outputs": [ 277 | { 278 | "type": "bool", 279 | "name": "" 280 | } 281 | ] 282 | }, 283 | { 284 | "type": "function", 285 | "name": "name", 286 | "constant": true, 287 | "stateMutability": "view", 288 | "payable": false, 289 | "inputs": [], 290 | "outputs": [ 291 | { 292 | "type": "string", 293 | "name": "" 294 | } 295 | ] 296 | }, 297 | { 298 | "type": "function", 299 | "name": "owner", 300 | "constant": true, 301 | "stateMutability": "view", 302 | "payable": false, 303 | "inputs": [], 304 | "outputs": [ 305 | { 306 | "type": "address", 307 | "name": "" 308 | } 309 | ] 310 | }, 311 | { 312 | "type": "function", 313 | "name": "renounceOwnership", 314 | "constant": false, 315 | "payable": false, 316 | "inputs": [], 317 | "outputs": [] 318 | }, 319 | { 320 | "type": "function", 321 | "name": "symbol", 322 | "constant": true, 323 | "stateMutability": "view", 324 | "payable": false, 325 | "inputs": [], 326 | "outputs": [ 327 | { 328 | "type": "string", 329 | "name": "" 330 | } 331 | ] 332 | }, 333 | { 334 | "type": "function", 335 | "name": "totalSupply", 336 | "constant": true, 337 | "stateMutability": "view", 338 | "payable": false, 339 | "inputs": [], 340 | "outputs": [ 341 | { 342 | "type": "uint256", 343 | "name": "" 344 | } 345 | ] 346 | }, 347 | { 348 | "type": "function", 349 | "name": "transfer", 350 | "constant": false, 351 | "payable": false, 352 | "inputs": [ 353 | { 354 | "type": "address", 355 | "name": "recipient" 356 | }, 357 | { 358 | "type": "uint256", 359 | "name": "amount" 360 | } 361 | ], 362 | "outputs": [ 363 | { 364 | "type": "bool", 365 | "name": "" 366 | } 367 | ] 368 | }, 369 | { 370 | "type": "function", 371 | "name": "transferFrom", 372 | "constant": false, 373 | "payable": false, 374 | "inputs": [ 375 | { 376 | "type": "address", 377 | "name": "sender" 378 | }, 379 | { 380 | "type": "address", 381 | "name": "recipient" 382 | }, 383 | { 384 | "type": "uint256", 385 | "name": "amount" 386 | } 387 | ], 388 | "outputs": [ 389 | { 390 | "type": "bool", 391 | "name": "" 392 | } 393 | ] 394 | }, 395 | { 396 | "type": "function", 397 | "name": "transferOwnership", 398 | "constant": false, 399 | "payable": false, 400 | "inputs": [ 401 | { 402 | "type": "address", 403 | "name": "newOwner" 404 | } 405 | ], 406 | "outputs": [] 407 | } 408 | ] 409 | --------------------------------------------------------------------------------