Add watcher in eth_call
mode for LinearStarRelease contract (#7)
* Create watcher in eth_call mode for Linear Star Release contract * Update readme about unhandled queries --------- Co-authored-by: Dhruv Srivastava <dhruvdhs.ds@gmail.com>
This commit is contained in:
parent
1e11139c9a
commit
203c1292ff
2
packages/linear-star-release-watcher/.eslintignore
Normal file
2
packages/linear-star-release-watcher/.eslintignore
Normal file
@ -0,0 +1,2 @@
|
||||
# Don't lint build output.
|
||||
dist
|
28
packages/linear-star-release-watcher/.eslintrc.json
Normal file
28
packages/linear-star-release-watcher/.eslintrc.json
Normal file
@ -0,0 +1,28 @@
|
||||
{
|
||||
"env": {
|
||||
"browser": true,
|
||||
"es2021": true
|
||||
},
|
||||
"extends": [
|
||||
"semistandard",
|
||||
"plugin:@typescript-eslint/recommended"
|
||||
],
|
||||
"parser": "@typescript-eslint/parser",
|
||||
"parserOptions": {
|
||||
"ecmaVersion": 12,
|
||||
"sourceType": "module"
|
||||
},
|
||||
"plugins": [
|
||||
"@typescript-eslint"
|
||||
],
|
||||
"rules": {
|
||||
"indent": ["error", 2, { "SwitchCase": 1 }],
|
||||
"@typescript-eslint/no-explicit-any": "off",
|
||||
"@typescript-eslint/explicit-module-boundary-types": [
|
||||
"warn",
|
||||
{
|
||||
"allowArgumentsExplicitlyTypedAsAny": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
210
packages/linear-star-release-watcher/README.md
Normal file
210
packages/linear-star-release-watcher/README.md
Normal file
@ -0,0 +1,210 @@
|
||||
# linear-star-release-watcher
|
||||
|
||||
## Currently unsupported queries
|
||||
|
||||
The watcher was generated in `eth_call` mode and does not support the following queries in its current state:
|
||||
|
||||
* `getRemainingStars(address _participant) returns (uint16[] stars)`
|
||||
|
||||
## Setup
|
||||
|
||||
* Run the following command to install required packages:
|
||||
|
||||
```bash
|
||||
yarn
|
||||
```
|
||||
|
||||
* Create a postgres12 database for the watcher:
|
||||
|
||||
```bash
|
||||
sudo su - postgres
|
||||
createdb linear-star-release-watcher
|
||||
```
|
||||
|
||||
* If the watcher is an `active` watcher:
|
||||
|
||||
Create database for the job queue and enable the `pgcrypto` extension on them (https://github.com/timgit/pg-boss/blob/master/docs/usage.md#intro):
|
||||
|
||||
```
|
||||
createdb linear-star-release-watcher-job-queue
|
||||
```
|
||||
|
||||
```
|
||||
postgres@tesla:~$ psql -U postgres -h localhost linear-star-release-watcher-job-queue
|
||||
Password for user postgres:
|
||||
psql (12.7 (Ubuntu 12.7-1.pgdg18.04+1))
|
||||
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, bits: 256, compression: off)
|
||||
Type "help" for help.
|
||||
|
||||
linear-star-release-watcher-job-queue=# CREATE EXTENSION pgcrypto;
|
||||
CREATE EXTENSION
|
||||
linear-star-release-watcher-job-queue=# exit
|
||||
```
|
||||
|
||||
* In the [config file](./environments/local.toml):
|
||||
|
||||
* Update the database connection settings.
|
||||
|
||||
* Update the `upstream` config and provide the `ipld-eth-server` GQL API endpoint.
|
||||
|
||||
* Update the `server` config with state checkpoint settings.
|
||||
|
||||
## Customize
|
||||
|
||||
* Indexing on an event:
|
||||
|
||||
* Edit the custom hook function `handleEvent` (triggered on an event) in [hooks.ts](./src/hooks.ts) to perform corresponding indexing using the `Indexer` object.
|
||||
|
||||
* While using the indexer storage methods for indexing, pass `diff` as true if default state is desired to be generated using the state variables being indexed.
|
||||
|
||||
* Generating state:
|
||||
|
||||
* Edit the custom hook function `createInitialState` (triggered if the watcher passes the start block, checkpoint: `true`) in [hooks.ts](./src/hooks.ts) to save an initial `State` using the `Indexer` object.
|
||||
|
||||
* Edit the custom hook function `createStateDiff` (triggered on a block) in [hooks.ts](./src/hooks.ts) to save the state in a `diff` `State` using the `Indexer` object. The default state (if exists) is updated.
|
||||
|
||||
* Edit the custom hook function `createStateCheckpoint` (triggered just before default and CLI checkpoint) in [hooks.ts](./src/hooks.ts) to save the state in a `checkpoint` `State` using the `Indexer` object.
|
||||
|
||||
### GQL Caching
|
||||
|
||||
To enable GQL requests caching:
|
||||
|
||||
* Update the `server.gqlCache` config with required settings.
|
||||
|
||||
* In the GQL [schema file](./src/schema.gql), use the `cacheControl` directive to apply cache hints at schema level.
|
||||
|
||||
* Eg. Set `inheritMaxAge` to true for non-scalar fields of a type.
|
||||
|
||||
* In the GQL [resolvers file](./src/resolvers.ts), uncomment the `setGQLCacheHints()` calls in resolvers for required queries.
|
||||
|
||||
## Run
|
||||
|
||||
* If the watcher is a `lazy` watcher:
|
||||
|
||||
* Run the server:
|
||||
|
||||
```bash
|
||||
yarn server
|
||||
```
|
||||
|
||||
GQL console: http://localhost:3009/graphql
|
||||
|
||||
* If the watcher is an `active` watcher:
|
||||
|
||||
* Run the job-runner:
|
||||
|
||||
```bash
|
||||
yarn job-runner
|
||||
```
|
||||
|
||||
* Run the server:
|
||||
|
||||
```bash
|
||||
yarn server
|
||||
```
|
||||
|
||||
GQL console: http://localhost:3009/graphql
|
||||
|
||||
* To watch a contract:
|
||||
|
||||
```bash
|
||||
yarn watch:contract --address <contract-address> --kind <contract-kind> --checkpoint <true | false> --starting-block [block-number]
|
||||
```
|
||||
|
||||
* `address`: Address or identifier of the contract to be watched.
|
||||
* `kind`: Kind of the contract.
|
||||
* `checkpoint`: Turn checkpointing on (`true` | `false`).
|
||||
* `starting-block`: Starting block for the contract (default: `1`).
|
||||
|
||||
Examples:
|
||||
|
||||
Watch a contract with its address and checkpointing on:
|
||||
|
||||
```bash
|
||||
yarn watch:contract --address 0x1F78641644feB8b64642e833cE4AFE93DD6e7833 --kind ERC20 --checkpoint true
|
||||
```
|
||||
|
||||
Watch a contract with its identifier and checkpointing on:
|
||||
|
||||
```bash
|
||||
yarn watch:contract --address MyProtocol --kind protocol --checkpoint true
|
||||
```
|
||||
|
||||
* To fill a block range:
|
||||
|
||||
```bash
|
||||
yarn fill --start-block <from-block> --end-block <to-block>
|
||||
```
|
||||
|
||||
* `start-block`: Block number to start filling from.
|
||||
* `end-block`: Block number till which to fill.
|
||||
|
||||
* To create a checkpoint for a contract:
|
||||
|
||||
```bash
|
||||
yarn checkpoint create --address <contract-address> --block-hash [block-hash]
|
||||
```
|
||||
|
||||
* `address`: Address or identifier of the contract for which to create a checkpoint.
|
||||
* `block-hash`: Hash of a block (in the pruned region) at which to create the checkpoint (default: latest canonical block hash).
|
||||
|
||||
* To reset the watcher to a previous block number:
|
||||
|
||||
* Reset watcher:
|
||||
|
||||
```bash
|
||||
yarn reset watcher --block-number <previous-block-number>
|
||||
```
|
||||
|
||||
* Reset job-queue:
|
||||
|
||||
```bash
|
||||
yarn reset job-queue
|
||||
```
|
||||
|
||||
* Reset state:
|
||||
|
||||
```bash
|
||||
yarn reset state --block-number <previous-block-number>
|
||||
```
|
||||
|
||||
* `block-number`: Block number to which to reset the watcher.
|
||||
|
||||
* To export and import the watcher state:
|
||||
|
||||
* In source watcher, export watcher state:
|
||||
|
||||
```bash
|
||||
yarn export-state --export-file [export-file-path] --block-number [snapshot-block-height]
|
||||
```
|
||||
|
||||
* `export-file`: Path of file to which to export the watcher data.
|
||||
* `block-number`: Block height at which to take snapshot for export.
|
||||
|
||||
* In target watcher, run job-runner:
|
||||
|
||||
```bash
|
||||
yarn job-runner
|
||||
```
|
||||
|
||||
* Import watcher state:
|
||||
|
||||
```bash
|
||||
yarn import-state --import-file <import-file-path>
|
||||
```
|
||||
|
||||
* `import-file`: Path of file from which to import the watcher data.
|
||||
|
||||
* Run server:
|
||||
|
||||
```bash
|
||||
yarn server
|
||||
```
|
||||
|
||||
* To inspect a CID:
|
||||
|
||||
```bash
|
||||
yarn inspect-cid --cid <cid>
|
||||
```
|
||||
|
||||
* `cid`: CID to be inspected.
|
66
packages/linear-star-release-watcher/environments/local.toml
Normal file
66
packages/linear-star-release-watcher/environments/local.toml
Normal file
@ -0,0 +1,66 @@
|
||||
[server]
|
||||
host = "127.0.0.1"
|
||||
port = 3009
|
||||
kind = "lazy"
|
||||
|
||||
# Checkpointing state.
|
||||
checkpointing = true
|
||||
|
||||
# Checkpoint interval in number of blocks.
|
||||
checkpointInterval = 2000
|
||||
|
||||
# Enable state creation
|
||||
# CAUTION: Disable only if state creation is not desired or can be filled subsequently
|
||||
enableState = true
|
||||
|
||||
# Boolean to filter logs by contract.
|
||||
filterLogs = false
|
||||
|
||||
# Max block range for which to return events in eventsInRange GQL query.
|
||||
# Use -1 for skipping check on block range.
|
||||
maxEventsBlockRange = 1000
|
||||
|
||||
# GQL cache settings
|
||||
[server.gqlCache]
|
||||
enabled = true
|
||||
|
||||
# Max in-memory cache size (in bytes) (default 8 MB)
|
||||
# maxCacheSize
|
||||
|
||||
# GQL cache-control max-age settings (in seconds)
|
||||
maxAge = 15
|
||||
|
||||
[metrics]
|
||||
host = "127.0.0.1"
|
||||
port = 9000
|
||||
[metrics.gql]
|
||||
port = 9001
|
||||
|
||||
[database]
|
||||
type = "postgres"
|
||||
host = "localhost"
|
||||
port = 5432
|
||||
database = "linear-star-release-watcher"
|
||||
username = "postgres"
|
||||
password = "postgres"
|
||||
synchronize = true
|
||||
logging = false
|
||||
|
||||
[upstream]
|
||||
[upstream.ethServer]
|
||||
gqlApiEndpoint = "http://127.0.0.1:8082/graphql"
|
||||
rpcProviderEndpoint = "http://127.0.0.1:8081"
|
||||
|
||||
[upstream.cache]
|
||||
name = "requests"
|
||||
enabled = false
|
||||
deleteOnStart = false
|
||||
|
||||
[jobQueue]
|
||||
dbConnectionString = "postgres://postgres:postgres@localhost/linear-star-release-watcher-job-queue"
|
||||
maxCompletionLagInSecs = 300
|
||||
jobDelayInMilliSecs = 100
|
||||
eventsInBatch = 50
|
||||
blockDelayInMilliSecs = 2000
|
||||
prefetchBlocksInMem = true
|
||||
prefetchBlockCount = 10
|
73
packages/linear-star-release-watcher/package.json
Normal file
73
packages/linear-star-release-watcher/package.json
Normal file
@ -0,0 +1,73 @@
|
||||
{
|
||||
"name": "@cerc-io/linear-star-release-watcher",
|
||||
"version": "0.1.0",
|
||||
"description": "linear-star-release-watcher",
|
||||
"private": true,
|
||||
"main": "dist/index.js",
|
||||
"scripts": {
|
||||
"lint": "eslint .",
|
||||
"build": "yarn clean && tsc && yarn copy-assets",
|
||||
"clean": "rm -rf ./dist",
|
||||
"copy-assets": "copyfiles -u 1 src/**/*.gql dist/",
|
||||
"server": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true node --enable-source-maps dist/server.js",
|
||||
"server:dev": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true ts-node src/server.ts",
|
||||
"job-runner": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true node --enable-source-maps dist/job-runner.js",
|
||||
"job-runner:dev": "DEBUG=vulcanize:* YARN_CHILD_PROCESS=true ts-node src/job-runner.ts",
|
||||
"watch:contract": "DEBUG=vulcanize:* ts-node src/cli/watch-contract.ts",
|
||||
"fill": "DEBUG=vulcanize:* ts-node src/fill.ts",
|
||||
"reset": "DEBUG=vulcanize:* ts-node src/cli/reset.ts",
|
||||
"checkpoint": "DEBUG=vulcanize:* node --enable-source-maps dist/cli/checkpoint.js",
|
||||
"checkpoint:dev": "DEBUG=vulcanize:* ts-node src/cli/checkpoint.ts",
|
||||
"export-state": "DEBUG=vulcanize:* node --enable-source-maps dist/cli/export-state.js",
|
||||
"export-state:dev": "DEBUG=vulcanize:* ts-node src/cli/export-state.ts",
|
||||
"import-state": "DEBUG=vulcanize:* node --enable-source-maps dist/cli/import-state.js",
|
||||
"import-state:dev": "DEBUG=vulcanize:* ts-node src/cli/import-state.ts",
|
||||
"inspect-cid": "DEBUG=vulcanize:* ts-node src/cli/inspect-cid.ts",
|
||||
"index-block": "DEBUG=vulcanize:* ts-node src/cli/index-block.ts"
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/cerc-io/watcher-ts.git"
|
||||
},
|
||||
"author": "",
|
||||
"license": "AGPL-3.0",
|
||||
"bugs": {
|
||||
"url": "https://github.com/cerc-io/watcher-ts/issues"
|
||||
},
|
||||
"homepage": "https://github.com/cerc-io/watcher-ts#readme",
|
||||
"dependencies": {
|
||||
"@apollo/client": "^3.3.19",
|
||||
"@ethersproject/providers": "^5.4.4",
|
||||
"@cerc-io/cli": "^0.2.34",
|
||||
"@cerc-io/ipld-eth-client": "^0.2.34",
|
||||
"@cerc-io/solidity-mapper": "^0.2.34",
|
||||
"@cerc-io/util": "^0.2.34",
|
||||
"apollo-type-bigint": "^0.1.3",
|
||||
"debug": "^4.3.1",
|
||||
"ethers": "^5.4.4",
|
||||
"graphql": "^15.5.0",
|
||||
"json-bigint": "^1.0.0",
|
||||
"reflect-metadata": "^0.1.13",
|
||||
"typeorm": "^0.2.32",
|
||||
"yargs": "^17.0.1",
|
||||
"decimal.js": "^10.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@ethersproject/abi": "^5.3.0",
|
||||
"@types/yargs": "^17.0.0",
|
||||
"@types/debug": "^4.1.5",
|
||||
"@types/json-bigint": "^1.0.1",
|
||||
"@typescript-eslint/eslint-plugin": "^5.47.1",
|
||||
"@typescript-eslint/parser": "^5.47.1",
|
||||
"eslint": "^8.35.0",
|
||||
"eslint-config-semistandard": "^15.0.1",
|
||||
"eslint-config-standard": "^16.0.3",
|
||||
"eslint-plugin-import": "^2.27.5",
|
||||
"eslint-plugin-node": "^11.1.0",
|
||||
"eslint-plugin-promise": "^5.1.0",
|
||||
"eslint-plugin-standard": "^5.0.0",
|
||||
"ts-node": "^10.2.1",
|
||||
"typescript": "^5.0.2",
|
||||
"copyfiles": "^2.4.1"
|
||||
}
|
||||
}
|
@ -0,0 +1,331 @@
|
||||
{
|
||||
"abi": [
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "startReleasing",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "withdraw",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "_to",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "withdraw",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [],
|
||||
"name": "renounceOwnership",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "_participant",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "getRemainingStars",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "stars",
|
||||
"type": "uint16[]"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "owner",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "_participant",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"name": "_to",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "withdrawOverdue",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "_participant",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "verifyBalance",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "correct",
|
||||
"type": "bool"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "start",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "_from",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "transferBatch",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "_participant",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"name": "_windup",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"name": "_amount",
|
||||
"type": "uint16"
|
||||
},
|
||||
{
|
||||
"name": "_rate",
|
||||
"type": "uint16"
|
||||
},
|
||||
{
|
||||
"name": "_rateUnit",
|
||||
"type": "uint256"
|
||||
}
|
||||
],
|
||||
"name": "register",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [],
|
||||
"name": "azimuth",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "batches",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "windup",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"name": "rateUnit",
|
||||
"type": "uint256"
|
||||
},
|
||||
{
|
||||
"name": "withdrawn",
|
||||
"type": "uint16"
|
||||
},
|
||||
{
|
||||
"name": "rate",
|
||||
"type": "uint16"
|
||||
},
|
||||
{
|
||||
"name": "amount",
|
||||
"type": "uint16"
|
||||
},
|
||||
{
|
||||
"name": "approvedTransferTo",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "_to",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "approveBatchTransfer",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "_participant",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"name": "_star",
|
||||
"type": "uint16"
|
||||
}
|
||||
],
|
||||
"name": "deposit",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": false,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "_newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "transferOwnership",
|
||||
"outputs": [],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"constant": true,
|
||||
"inputs": [
|
||||
{
|
||||
"name": "_participant",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "withdrawLimit",
|
||||
"outputs": [
|
||||
{
|
||||
"name": "limit",
|
||||
"type": "uint16"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "view",
|
||||
"type": "function"
|
||||
},
|
||||
{
|
||||
"inputs": [
|
||||
{
|
||||
"name": "_azimuth",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"payable": false,
|
||||
"stateMutability": "nonpayable",
|
||||
"type": "constructor"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"name": "previousOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "OwnershipRenounced",
|
||||
"type": "event"
|
||||
},
|
||||
{
|
||||
"anonymous": false,
|
||||
"inputs": [
|
||||
{
|
||||
"indexed": true,
|
||||
"name": "previousOwner",
|
||||
"type": "address"
|
||||
},
|
||||
{
|
||||
"indexed": true,
|
||||
"name": "newOwner",
|
||||
"type": "address"
|
||||
}
|
||||
],
|
||||
"name": "OwnershipTransferred",
|
||||
"type": "event"
|
||||
}
|
||||
]
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
//
|
||||
// Copyright 2022 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { CreateCheckpointCmd } from '@cerc-io/cli';
|
||||
|
||||
import { Database } from '../../database';
|
||||
import { Indexer } from '../../indexer';
|
||||
|
||||
export const command = 'create';
|
||||
|
||||
export const desc = 'Create checkpoint';
|
||||
|
||||
export const builder = {
|
||||
address: {
|
||||
type: 'string',
|
||||
require: true,
|
||||
demandOption: true,
|
||||
describe: 'Contract address to create the checkpoint for.'
|
||||
},
|
||||
blockHash: {
|
||||
type: 'string',
|
||||
describe: 'Blockhash at which to create the checkpoint.'
|
||||
}
|
||||
};
|
||||
|
||||
export const handler = async (argv: any): Promise<void> => {
|
||||
const createCheckpointCmd = new CreateCheckpointCmd();
|
||||
await createCheckpointCmd.init(argv, Database);
|
||||
|
||||
await createCheckpointCmd.initIndexer(Indexer);
|
||||
|
||||
await createCheckpointCmd.exec();
|
||||
};
|
39
packages/linear-star-release-watcher/src/cli/checkpoint.ts
Normal file
39
packages/linear-star-release-watcher/src/cli/checkpoint.ts
Normal file
@ -0,0 +1,39 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import yargs from 'yargs';
|
||||
import 'reflect-metadata';
|
||||
import debug from 'debug';
|
||||
|
||||
import { DEFAULT_CONFIG_PATH } from '@cerc-io/util';
|
||||
|
||||
import { hideBin } from 'yargs/helpers';
|
||||
|
||||
const log = debug('vulcanize:checkpoint');
|
||||
|
||||
const main = async () => {
|
||||
return yargs(hideBin(process.argv))
|
||||
.parserConfiguration({
|
||||
'parse-numbers': false
|
||||
}).options({
|
||||
configFile: {
|
||||
alias: 'f',
|
||||
type: 'string',
|
||||
require: true,
|
||||
demandOption: true,
|
||||
describe: 'configuration file path (toml)',
|
||||
default: DEFAULT_CONFIG_PATH
|
||||
}
|
||||
})
|
||||
.commandDir('checkpoint-cmds', { extensions: ['ts', 'js'], exclude: /([a-zA-Z0-9\s_\\.\-:])+(.d.ts)$/ })
|
||||
.demandCommand(1)
|
||||
.help()
|
||||
.argv;
|
||||
};
|
||||
|
||||
main().then(() => {
|
||||
process.exit();
|
||||
}).catch(err => {
|
||||
log(err);
|
||||
});
|
28
packages/linear-star-release-watcher/src/cli/export-state.ts
Normal file
28
packages/linear-star-release-watcher/src/cli/export-state.ts
Normal file
@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import 'reflect-metadata';
|
||||
import debug from 'debug';
|
||||
|
||||
import { ExportStateCmd } from '@cerc-io/cli';
|
||||
|
||||
import { Database } from '../database';
|
||||
import { Indexer } from '../indexer';
|
||||
|
||||
const log = debug('vulcanize:export-state');
|
||||
|
||||
const main = async (): Promise<void> => {
|
||||
const exportStateCmd = new ExportStateCmd();
|
||||
await exportStateCmd.init(Database);
|
||||
|
||||
await exportStateCmd.initIndexer(Indexer);
|
||||
|
||||
await exportStateCmd.exec();
|
||||
};
|
||||
|
||||
main().catch(err => {
|
||||
log(err);
|
||||
}).finally(() => {
|
||||
process.exit(0);
|
||||
});
|
29
packages/linear-star-release-watcher/src/cli/import-state.ts
Normal file
29
packages/linear-star-release-watcher/src/cli/import-state.ts
Normal file
@ -0,0 +1,29 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import 'reflect-metadata';
|
||||
import debug from 'debug';
|
||||
|
||||
import { ImportStateCmd } from '@cerc-io/cli';
|
||||
|
||||
import { Database } from '../database';
|
||||
import { Indexer } from '../indexer';
|
||||
import { State } from '../entity/State';
|
||||
|
||||
const log = debug('vulcanize:import-state');
|
||||
|
||||
export const main = async (): Promise<any> => {
|
||||
const importStateCmd = new ImportStateCmd();
|
||||
await importStateCmd.init(Database);
|
||||
|
||||
await importStateCmd.initIndexer(Indexer);
|
||||
|
||||
await importStateCmd.exec(State);
|
||||
};
|
||||
|
||||
main().catch(err => {
|
||||
log(err);
|
||||
}).finally(() => {
|
||||
process.exit(0);
|
||||
});
|
28
packages/linear-star-release-watcher/src/cli/index-block.ts
Normal file
28
packages/linear-star-release-watcher/src/cli/index-block.ts
Normal file
@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright 2022 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import 'reflect-metadata';
|
||||
import debug from 'debug';
|
||||
|
||||
import { IndexBlockCmd } from '@cerc-io/cli';
|
||||
|
||||
import { Database } from '../database';
|
||||
import { Indexer } from '../indexer';
|
||||
|
||||
const log = debug('vulcanize:index-block');
|
||||
|
||||
const main = async (): Promise<void> => {
|
||||
const indexBlockCmd = new IndexBlockCmd();
|
||||
await indexBlockCmd.init(Database);
|
||||
|
||||
await indexBlockCmd.initIndexer(Indexer);
|
||||
|
||||
await indexBlockCmd.exec();
|
||||
};
|
||||
|
||||
main().catch(err => {
|
||||
log(err);
|
||||
}).finally(() => {
|
||||
process.exit(0);
|
||||
});
|
28
packages/linear-star-release-watcher/src/cli/inspect-cid.ts
Normal file
28
packages/linear-star-release-watcher/src/cli/inspect-cid.ts
Normal file
@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import 'reflect-metadata';
|
||||
import debug from 'debug';
|
||||
|
||||
import { InspectCIDCmd } from '@cerc-io/cli';
|
||||
|
||||
import { Database } from '../database';
|
||||
import { Indexer } from '../indexer';
|
||||
|
||||
const log = debug('vulcanize:inspect-cid');
|
||||
|
||||
const main = async (): Promise<void> => {
|
||||
const inspectCIDCmd = new InspectCIDCmd();
|
||||
await inspectCIDCmd.init(Database);
|
||||
|
||||
await inspectCIDCmd.initIndexer(Indexer);
|
||||
|
||||
await inspectCIDCmd.exec();
|
||||
};
|
||||
|
||||
main().catch(err => {
|
||||
log(err);
|
||||
}).finally(() => {
|
||||
process.exit(0);
|
||||
});
|
@ -0,0 +1,22 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import debug from 'debug';
|
||||
|
||||
import { getConfig, resetJobs, Config } from '@cerc-io/util';
|
||||
|
||||
const log = debug('vulcanize:reset-job-queue');
|
||||
|
||||
export const command = 'job-queue';
|
||||
|
||||
export const desc = 'Reset job queue';
|
||||
|
||||
export const builder = {};
|
||||
|
||||
export const handler = async (argv: any): Promise<void> => {
|
||||
const config: Config = await getConfig(argv.configFile);
|
||||
await resetJobs(config);
|
||||
|
||||
log('Job queue reset successfully');
|
||||
};
|
@ -0,0 +1,24 @@
|
||||
//
|
||||
// Copyright 2022 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { ResetStateCmd } from '@cerc-io/cli';
|
||||
|
||||
import { Database } from '../../database';
|
||||
|
||||
export const command = 'state';
|
||||
|
||||
export const desc = 'Reset State to a given block number';
|
||||
|
||||
export const builder = {
|
||||
blockNumber: {
|
||||
type: 'number'
|
||||
}
|
||||
};
|
||||
|
||||
export const handler = async (argv: any): Promise<void> => {
|
||||
const resetStateCmd = new ResetStateCmd();
|
||||
await resetStateCmd.init(argv, Database);
|
||||
|
||||
await resetStateCmd.exec();
|
||||
};
|
@ -0,0 +1,27 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { ResetWatcherCmd } from '@cerc-io/cli';
|
||||
|
||||
import { Database } from '../../database';
|
||||
import { Indexer } from '../../indexer';
|
||||
|
||||
export const command = 'watcher';
|
||||
|
||||
export const desc = 'Reset watcher to a block number';
|
||||
|
||||
export const builder = {
|
||||
blockNumber: {
|
||||
type: 'number'
|
||||
}
|
||||
};
|
||||
|
||||
export const handler = async (argv: any): Promise<void> => {
|
||||
const resetWatcherCmd = new ResetWatcherCmd();
|
||||
await resetWatcherCmd.init(argv, Database);
|
||||
|
||||
await resetWatcherCmd.initIndexer(Indexer);
|
||||
|
||||
await resetWatcherCmd.exec();
|
||||
};
|
24
packages/linear-star-release-watcher/src/cli/reset.ts
Normal file
24
packages/linear-star-release-watcher/src/cli/reset.ts
Normal file
@ -0,0 +1,24 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import 'reflect-metadata';
|
||||
import debug from 'debug';
|
||||
|
||||
import { getResetYargs } from '@cerc-io/util';
|
||||
|
||||
const log = debug('vulcanize:reset');
|
||||
|
||||
const main = async () => {
|
||||
return getResetYargs()
|
||||
.commandDir('reset-cmds', { extensions: ['ts', 'js'], exclude: /([a-zA-Z0-9\s_\\.\-:])+(.d.ts)$/ })
|
||||
.demandCommand(1)
|
||||
.help()
|
||||
.argv;
|
||||
};
|
||||
|
||||
main().then(() => {
|
||||
process.exit();
|
||||
}).catch(err => {
|
||||
log(err);
|
||||
});
|
@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import 'reflect-metadata';
|
||||
import debug from 'debug';
|
||||
|
||||
import { WatchContractCmd } from '@cerc-io/cli';
|
||||
|
||||
import { Database } from '../database';
|
||||
import { Indexer } from '../indexer';
|
||||
|
||||
const log = debug('vulcanize:watch-contract');
|
||||
|
||||
const main = async (): Promise<void> => {
|
||||
const watchContractCmd = new WatchContractCmd();
|
||||
await watchContractCmd.init(Database);
|
||||
|
||||
await watchContractCmd.initIndexer(Indexer);
|
||||
|
||||
await watchContractCmd.exec();
|
||||
};
|
||||
|
||||
main().catch(err => {
|
||||
log(err);
|
||||
}).finally(() => {
|
||||
process.exit(0);
|
||||
});
|
559
packages/linear-star-release-watcher/src/client.ts
Normal file
559
packages/linear-star-release-watcher/src/client.ts
Normal file
@ -0,0 +1,559 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { gql } from '@apollo/client/core';
|
||||
import { GraphQLClient, GraphQLConfig } from '@cerc-io/ipld-eth-client';
|
||||
|
||||
import { queries, mutations, subscriptions } from './gql';
|
||||
|
||||
export class Client {
|
||||
_config: GraphQLConfig;
|
||||
_client: GraphQLClient;
|
||||
|
||||
constructor (config: GraphQLConfig) {
|
||||
this._config = config;
|
||||
|
||||
this._client = new GraphQLClient(config);
|
||||
}
|
||||
|
||||
async getIsActive (blockHash: string, contractAddress: string, _point: number): Promise<any> {
|
||||
const { isActive } = await this._client.query(
|
||||
gql(queries.isActive),
|
||||
{ blockHash, contractAddress, _point }
|
||||
);
|
||||
|
||||
return isActive;
|
||||
}
|
||||
|
||||
async getGetKeyRevisionNumber (blockHash: string, contractAddress: string, _point: number): Promise<any> {
|
||||
const { getKeyRevisionNumber } = await this._client.query(
|
||||
gql(queries.getKeyRevisionNumber),
|
||||
{ blockHash, contractAddress, _point }
|
||||
);
|
||||
|
||||
return getKeyRevisionNumber;
|
||||
}
|
||||
|
||||
async getHasBeenLinked (blockHash: string, contractAddress: string, _point: number): Promise<any> {
|
||||
const { hasBeenLinked } = await this._client.query(
|
||||
gql(queries.hasBeenLinked),
|
||||
{ blockHash, contractAddress, _point }
|
||||
);
|
||||
|
||||
return hasBeenLinked;
|
||||
}
|
||||
|
||||
async getIsLive (blockHash: string, contractAddress: string, _point: number): Promise<any> {
|
||||
const { isLive } = await this._client.query(
|
||||
gql(queries.isLive),
|
||||
{ blockHash, contractAddress, _point }
|
||||
);
|
||||
|
||||
return isLive;
|
||||
}
|
||||
|
||||
async getGetContinuityNumber (blockHash: string, contractAddress: string, _point: number): Promise<any> {
|
||||
const { getContinuityNumber } = await this._client.query(
|
||||
gql(queries.getContinuityNumber),
|
||||
{ blockHash, contractAddress, _point }
|
||||
);
|
||||
|
||||
return getContinuityNumber;
|
||||
}
|
||||
|
||||
async getGetSpawnCount (blockHash: string, contractAddress: string, _point: number): Promise<any> {
|
||||
const { getSpawnCount } = await this._client.query(
|
||||
gql(queries.getSpawnCount),
|
||||
{ blockHash, contractAddress, _point }
|
||||
);
|
||||
|
||||
return getSpawnCount;
|
||||
}
|
||||
|
||||
async getHasSponsor (blockHash: string, contractAddress: string, _point: number): Promise<any> {
|
||||
const { hasSponsor } = await this._client.query(
|
||||
gql(queries.hasSponsor),
|
||||
{ blockHash, contractAddress, _point }
|
||||
);
|
||||
|
||||
return hasSponsor;
|
||||
}
|
||||
|
||||
async getGetSponsor (blockHash: string, contractAddress: string, _point: number): Promise<any> {
|
||||
const { getSponsor } = await this._client.query(
|
||||
gql(queries.getSponsor),
|
||||
{ blockHash, contractAddress, _point }
|
||||
);
|
||||
|
||||
return getSponsor;
|
||||
}
|
||||
|
||||
async getIsSponsor (blockHash: string, contractAddress: string, _point: number, _sponsor: number): Promise<any> {
|
||||
const { isSponsor } = await this._client.query(
|
||||
gql(queries.isSponsor),
|
||||
{ blockHash, contractAddress, _point, _sponsor }
|
||||
);
|
||||
|
||||
return isSponsor;
|
||||
}
|
||||
|
||||
async getGetSponsoringCount (blockHash: string, contractAddress: string, _sponsor: number): Promise<any> {
|
||||
const { getSponsoringCount } = await this._client.query(
|
||||
gql(queries.getSponsoringCount),
|
||||
{ blockHash, contractAddress, _sponsor }
|
||||
);
|
||||
|
||||
return getSponsoringCount;
|
||||
}
|
||||
|
||||
async getIsEscaping (blockHash: string, contractAddress: string, _point: number): Promise<any> {
|
||||
const { isEscaping } = await this._client.query(
|
||||
gql(queries.isEscaping),
|
||||
{ blockHash, contractAddress, _point }
|
||||
);
|
||||
|
||||
return isEscaping;
|
||||
}
|
||||
|
||||
async getGetEscapeRequest (blockHash: string, contractAddress: string, _point: number): Promise<any> {
|
||||
const { getEscapeRequest } = await this._client.query(
|
||||
gql(queries.getEscapeRequest),
|
||||
{ blockHash, contractAddress, _point }
|
||||
);
|
||||
|
||||
return getEscapeRequest;
|
||||
}
|
||||
|
||||
async getIsRequestingEscapeTo (blockHash: string, contractAddress: string, _point: number, _sponsor: number): Promise<any> {
|
||||
const { isRequestingEscapeTo } = await this._client.query(
|
||||
gql(queries.isRequestingEscapeTo),
|
||||
{ blockHash, contractAddress, _point, _sponsor }
|
||||
);
|
||||
|
||||
return isRequestingEscapeTo;
|
||||
}
|
||||
|
||||
async getGetEscapeRequestsCount (blockHash: string, contractAddress: string, _sponsor: number): Promise<any> {
|
||||
const { getEscapeRequestsCount } = await this._client.query(
|
||||
gql(queries.getEscapeRequestsCount),
|
||||
{ blockHash, contractAddress, _sponsor }
|
||||
);
|
||||
|
||||
return getEscapeRequestsCount;
|
||||
}
|
||||
|
||||
async getGetOwner (blockHash: string, contractAddress: string, _point: number): Promise<any> {
|
||||
const { getOwner } = await this._client.query(
|
||||
gql(queries.getOwner),
|
||||
{ blockHash, contractAddress, _point }
|
||||
);
|
||||
|
||||
return getOwner;
|
||||
}
|
||||
|
||||
async getIsOwner (blockHash: string, contractAddress: string, _point: number, _address: string): Promise<any> {
|
||||
const { isOwner } = await this._client.query(
|
||||
gql(queries.isOwner),
|
||||
{ blockHash, contractAddress, _point, _address }
|
||||
);
|
||||
|
||||
return isOwner;
|
||||
}
|
||||
|
||||
async getGetOwnedPointCount (blockHash: string, contractAddress: string, _whose: string): Promise<any> {
|
||||
const { getOwnedPointCount } = await this._client.query(
|
||||
gql(queries.getOwnedPointCount),
|
||||
{ blockHash, contractAddress, _whose }
|
||||
);
|
||||
|
||||
return getOwnedPointCount;
|
||||
}
|
||||
|
||||
async getGetOwnedPointAtIndex (blockHash: string, contractAddress: string, _whose: string, _index: bigint): Promise<any> {
|
||||
const { getOwnedPointAtIndex } = await this._client.query(
|
||||
gql(queries.getOwnedPointAtIndex),
|
||||
{ blockHash, contractAddress, _whose, _index }
|
||||
);
|
||||
|
||||
return getOwnedPointAtIndex;
|
||||
}
|
||||
|
||||
async getGetManagementProxy (blockHash: string, contractAddress: string, _point: number): Promise<any> {
|
||||
const { getManagementProxy } = await this._client.query(
|
||||
gql(queries.getManagementProxy),
|
||||
{ blockHash, contractAddress, _point }
|
||||
);
|
||||
|
||||
return getManagementProxy;
|
||||
}
|
||||
|
||||
async getIsManagementProxy (blockHash: string, contractAddress: string, _point: number, _proxy: string): Promise<any> {
|
||||
const { isManagementProxy } = await this._client.query(
|
||||
gql(queries.isManagementProxy),
|
||||
{ blockHash, contractAddress, _point, _proxy }
|
||||
);
|
||||
|
||||
return isManagementProxy;
|
||||
}
|
||||
|
||||
async getCanManage (blockHash: string, contractAddress: string, _point: number, _who: string): Promise<any> {
|
||||
const { canManage } = await this._client.query(
|
||||
gql(queries.canManage),
|
||||
{ blockHash, contractAddress, _point, _who }
|
||||
);
|
||||
|
||||
return canManage;
|
||||
}
|
||||
|
||||
async getGetManagerForCount (blockHash: string, contractAddress: string, _proxy: string): Promise<any> {
|
||||
const { getManagerForCount } = await this._client.query(
|
||||
gql(queries.getManagerForCount),
|
||||
{ blockHash, contractAddress, _proxy }
|
||||
);
|
||||
|
||||
return getManagerForCount;
|
||||
}
|
||||
|
||||
async getGetSpawnProxy (blockHash: string, contractAddress: string, _point: number): Promise<any> {
|
||||
const { getSpawnProxy } = await this._client.query(
|
||||
gql(queries.getSpawnProxy),
|
||||
{ blockHash, contractAddress, _point }
|
||||
);
|
||||
|
||||
return getSpawnProxy;
|
||||
}
|
||||
|
||||
async getIsSpawnProxy (blockHash: string, contractAddress: string, _point: number, _proxy: string): Promise<any> {
|
||||
const { isSpawnProxy } = await this._client.query(
|
||||
gql(queries.isSpawnProxy),
|
||||
{ blockHash, contractAddress, _point, _proxy }
|
||||
);
|
||||
|
||||
return isSpawnProxy;
|
||||
}
|
||||
|
||||
async getCanSpawnAs (blockHash: string, contractAddress: string, _point: number, _who: string): Promise<any> {
|
||||
const { canSpawnAs } = await this._client.query(
|
||||
gql(queries.canSpawnAs),
|
||||
{ blockHash, contractAddress, _point, _who }
|
||||
);
|
||||
|
||||
return canSpawnAs;
|
||||
}
|
||||
|
||||
async getGetSpawningForCount (blockHash: string, contractAddress: string, _proxy: string): Promise<any> {
|
||||
const { getSpawningForCount } = await this._client.query(
|
||||
gql(queries.getSpawningForCount),
|
||||
{ blockHash, contractAddress, _proxy }
|
||||
);
|
||||
|
||||
return getSpawningForCount;
|
||||
}
|
||||
|
||||
async getGetVotingProxy (blockHash: string, contractAddress: string, _point: number): Promise<any> {
|
||||
const { getVotingProxy } = await this._client.query(
|
||||
gql(queries.getVotingProxy),
|
||||
{ blockHash, contractAddress, _point }
|
||||
);
|
||||
|
||||
return getVotingProxy;
|
||||
}
|
||||
|
||||
async getIsVotingProxy (blockHash: string, contractAddress: string, _point: number, _proxy: string): Promise<any> {
|
||||
const { isVotingProxy } = await this._client.query(
|
||||
gql(queries.isVotingProxy),
|
||||
{ blockHash, contractAddress, _point, _proxy }
|
||||
);
|
||||
|
||||
return isVotingProxy;
|
||||
}
|
||||
|
||||
async getCanVoteAs (blockHash: string, contractAddress: string, _point: number, _who: string): Promise<any> {
|
||||
const { canVoteAs } = await this._client.query(
|
||||
gql(queries.canVoteAs),
|
||||
{ blockHash, contractAddress, _point, _who }
|
||||
);
|
||||
|
||||
return canVoteAs;
|
||||
}
|
||||
|
||||
async getGetVotingForCount (blockHash: string, contractAddress: string, _proxy: string): Promise<any> {
|
||||
const { getVotingForCount } = await this._client.query(
|
||||
gql(queries.getVotingForCount),
|
||||
{ blockHash, contractAddress, _proxy }
|
||||
);
|
||||
|
||||
return getVotingForCount;
|
||||
}
|
||||
|
||||
async getGetTransferProxy (blockHash: string, contractAddress: string, _point: number): Promise<any> {
|
||||
const { getTransferProxy } = await this._client.query(
|
||||
gql(queries.getTransferProxy),
|
||||
{ blockHash, contractAddress, _point }
|
||||
);
|
||||
|
||||
return getTransferProxy;
|
||||
}
|
||||
|
||||
async getIsTransferProxy (blockHash: string, contractAddress: string, _point: number, _proxy: string): Promise<any> {
|
||||
const { isTransferProxy } = await this._client.query(
|
||||
gql(queries.isTransferProxy),
|
||||
{ blockHash, contractAddress, _point, _proxy }
|
||||
);
|
||||
|
||||
return isTransferProxy;
|
||||
}
|
||||
|
||||
async getCanTransfer (blockHash: string, contractAddress: string, _point: number, _who: string): Promise<any> {
|
||||
const { canTransfer } = await this._client.query(
|
||||
gql(queries.canTransfer),
|
||||
{ blockHash, contractAddress, _point, _who }
|
||||
);
|
||||
|
||||
return canTransfer;
|
||||
}
|
||||
|
||||
async getGetTransferringForCount (blockHash: string, contractAddress: string, _proxy: string): Promise<any> {
|
||||
const { getTransferringForCount } = await this._client.query(
|
||||
gql(queries.getTransferringForCount),
|
||||
{ blockHash, contractAddress, _proxy }
|
||||
);
|
||||
|
||||
return getTransferringForCount;
|
||||
}
|
||||
|
||||
async getIsOperator (blockHash: string, contractAddress: string, _owner: string, _operator: string): Promise<any> {
|
||||
const { isOperator } = await this._client.query(
|
||||
gql(queries.isOperator),
|
||||
{ blockHash, contractAddress, _owner, _operator }
|
||||
);
|
||||
|
||||
return isOperator;
|
||||
}
|
||||
|
||||
async getGetUpgradeProposalCount (blockHash: string, contractAddress: string): Promise<any> {
|
||||
const { getUpgradeProposalCount } = await this._client.query(
|
||||
gql(queries.getUpgradeProposalCount),
|
||||
{ blockHash, contractAddress }
|
||||
);
|
||||
|
||||
return getUpgradeProposalCount;
|
||||
}
|
||||
|
||||
async getGetDocumentProposalCount (blockHash: string, contractAddress: string): Promise<any> {
|
||||
const { getDocumentProposalCount } = await this._client.query(
|
||||
gql(queries.getDocumentProposalCount),
|
||||
{ blockHash, contractAddress }
|
||||
);
|
||||
|
||||
return getDocumentProposalCount;
|
||||
}
|
||||
|
||||
async getHasVotedOnUpgradePoll (blockHash: string, contractAddress: string, _galaxy: number, _proposal: string): Promise<any> {
|
||||
const { hasVotedOnUpgradePoll } = await this._client.query(
|
||||
gql(queries.hasVotedOnUpgradePoll),
|
||||
{ blockHash, contractAddress, _galaxy, _proposal }
|
||||
);
|
||||
|
||||
return hasVotedOnUpgradePoll;
|
||||
}
|
||||
|
||||
async getHasVotedOnDocumentPoll (blockHash: string, contractAddress: string, _galaxy: number, _proposal: string): Promise<any> {
|
||||
const { hasVotedOnDocumentPoll } = await this._client.query(
|
||||
gql(queries.hasVotedOnDocumentPoll),
|
||||
{ blockHash, contractAddress, _galaxy, _proposal }
|
||||
);
|
||||
|
||||
return hasVotedOnDocumentPoll;
|
||||
}
|
||||
|
||||
async getFindClaim (blockHash: string, contractAddress: string, _whose: number, _protocol: string, _claim: string): Promise<any> {
|
||||
const { findClaim } = await this._client.query(
|
||||
gql(queries.findClaim),
|
||||
{ blockHash, contractAddress, _whose, _protocol, _claim }
|
||||
);
|
||||
|
||||
return findClaim;
|
||||
}
|
||||
|
||||
async getSupportsInterface (blockHash: string, contractAddress: string, _interfaceId: string): Promise<any> {
|
||||
const { supportsInterface } = await this._client.query(
|
||||
gql(queries.supportsInterface),
|
||||
{ blockHash, contractAddress, _interfaceId }
|
||||
);
|
||||
|
||||
return supportsInterface;
|
||||
}
|
||||
|
||||
async getBalanceOf (blockHash: string, contractAddress: string, _owner: string): Promise<any> {
|
||||
const { balanceOf } = await this._client.query(
|
||||
gql(queries.balanceOf),
|
||||
{ blockHash, contractAddress, _owner }
|
||||
);
|
||||
|
||||
return balanceOf;
|
||||
}
|
||||
|
||||
async getOwnerOf (blockHash: string, contractAddress: string, _tokenId: bigint): Promise<any> {
|
||||
const { ownerOf } = await this._client.query(
|
||||
gql(queries.ownerOf),
|
||||
{ blockHash, contractAddress, _tokenId }
|
||||
);
|
||||
|
||||
return ownerOf;
|
||||
}
|
||||
|
||||
async getExists (blockHash: string, contractAddress: string, _tokenId: bigint): Promise<any> {
|
||||
const { exists } = await this._client.query(
|
||||
gql(queries.exists),
|
||||
{ blockHash, contractAddress, _tokenId }
|
||||
);
|
||||
|
||||
return exists;
|
||||
}
|
||||
|
||||
async getGetApproved (blockHash: string, contractAddress: string, _tokenId: bigint): Promise<any> {
|
||||
const { getApproved } = await this._client.query(
|
||||
gql(queries.getApproved),
|
||||
{ blockHash, contractAddress, _tokenId }
|
||||
);
|
||||
|
||||
return getApproved;
|
||||
}
|
||||
|
||||
async getIsApprovedForAll (blockHash: string, contractAddress: string, _owner: string, _operator: string): Promise<any> {
|
||||
const { isApprovedForAll } = await this._client.query(
|
||||
gql(queries.isApprovedForAll),
|
||||
{ blockHash, contractAddress, _owner, _operator }
|
||||
);
|
||||
|
||||
return isApprovedForAll;
|
||||
}
|
||||
|
||||
async getTotalSupply (blockHash: string, contractAddress: string): Promise<any> {
|
||||
const { totalSupply } = await this._client.query(
|
||||
gql(queries.totalSupply),
|
||||
{ blockHash, contractAddress }
|
||||
);
|
||||
|
||||
return totalSupply;
|
||||
}
|
||||
|
||||
async getTokenOfOwnerByIndex (blockHash: string, contractAddress: string, _owner: string, _index: bigint): Promise<any> {
|
||||
const { tokenOfOwnerByIndex } = await this._client.query(
|
||||
gql(queries.tokenOfOwnerByIndex),
|
||||
{ blockHash, contractAddress, _owner, _index }
|
||||
);
|
||||
|
||||
return tokenOfOwnerByIndex;
|
||||
}
|
||||
|
||||
async getTokenByIndex (blockHash: string, contractAddress: string, _index: bigint): Promise<any> {
|
||||
const { tokenByIndex } = await this._client.query(
|
||||
gql(queries.tokenByIndex),
|
||||
{ blockHash, contractAddress, _index }
|
||||
);
|
||||
|
||||
return tokenByIndex;
|
||||
}
|
||||
|
||||
async getName (blockHash: string, contractAddress: string): Promise<any> {
|
||||
const { name } = await this._client.query(
|
||||
gql(queries.name),
|
||||
{ blockHash, contractAddress }
|
||||
);
|
||||
|
||||
return name;
|
||||
}
|
||||
|
||||
async getSymbol (blockHash: string, contractAddress: string): Promise<any> {
|
||||
const { symbol } = await this._client.query(
|
||||
gql(queries.symbol),
|
||||
{ blockHash, contractAddress }
|
||||
);
|
||||
|
||||
return symbol;
|
||||
}
|
||||
|
||||
async getTokenURI (blockHash: string, contractAddress: string, _tokenId: bigint): Promise<any> {
|
||||
const { tokenURI } = await this._client.query(
|
||||
gql(queries.tokenURI),
|
||||
{ blockHash, contractAddress, _tokenId }
|
||||
);
|
||||
|
||||
return tokenURI;
|
||||
}
|
||||
|
||||
async getGetSpawnLimit (blockHash: string, contractAddress: string, _point: number, _time: bigint): Promise<any> {
|
||||
const { getSpawnLimit } = await this._client.query(
|
||||
gql(queries.getSpawnLimit),
|
||||
{ blockHash, contractAddress, _point, _time }
|
||||
);
|
||||
|
||||
return getSpawnLimit;
|
||||
}
|
||||
|
||||
async getCanEscapeTo (blockHash: string, contractAddress: string, _point: number, _sponsor: number): Promise<any> {
|
||||
const { canEscapeTo } = await this._client.query(
|
||||
gql(queries.canEscapeTo),
|
||||
{ blockHash, contractAddress, _point, _sponsor }
|
||||
);
|
||||
|
||||
return canEscapeTo;
|
||||
}
|
||||
|
||||
async getWithdrawLimit (blockHash: string, contractAddress: string, _participant: string): Promise<any> {
|
||||
const { withdrawLimit } = await this._client.query(
|
||||
gql(queries.withdrawLimit),
|
||||
{ blockHash, contractAddress, _participant }
|
||||
);
|
||||
|
||||
return withdrawLimit;
|
||||
}
|
||||
|
||||
async getVerifyBalance (blockHash: string, contractAddress: string, _participant: string): Promise<any> {
|
||||
const { verifyBalance } = await this._client.query(
|
||||
gql(queries.verifyBalance),
|
||||
{ blockHash, contractAddress, _participant }
|
||||
);
|
||||
|
||||
return verifyBalance;
|
||||
}
|
||||
|
||||
async getEvents (blockHash: string, contractAddress: string, name: string): Promise<any> {
|
||||
const { events } = await this._client.query(
|
||||
gql(queries.events),
|
||||
{ blockHash, contractAddress, name }
|
||||
);
|
||||
|
||||
return events;
|
||||
}
|
||||
|
||||
async getEventsInRange (fromBlockNumber: number, toBlockNumber: number): Promise<any> {
|
||||
const { eventsInRange } = await this._client.query(
|
||||
gql(queries.eventsInRange),
|
||||
{ fromBlockNumber, toBlockNumber }
|
||||
);
|
||||
|
||||
return eventsInRange;
|
||||
}
|
||||
|
||||
async watchContract (contractAddress: string, startingBlock?: number): Promise<any> {
|
||||
const { watchContract } = await this._client.mutate(
|
||||
gql(mutations.watchContract),
|
||||
{ contractAddress, startingBlock }
|
||||
);
|
||||
|
||||
return watchContract;
|
||||
}
|
||||
|
||||
async watchEvents (onNext: (value: any) => void): Promise<ZenObservable.Subscription> {
|
||||
return this._client.subscribe(
|
||||
gql(subscriptions.onEvent),
|
||||
({ data }) => {
|
||||
onNext(data.onEvent);
|
||||
}
|
||||
);
|
||||
}
|
||||
}
|
1233
packages/linear-star-release-watcher/src/database.ts
Normal file
1233
packages/linear-star-release-watcher/src/database.ts
Normal file
File diff suppressed because it is too large
Load Diff
31
packages/linear-star-release-watcher/src/entity/BalanceOf.ts
Normal file
31
packages/linear-star-release-watcher/src/entity/BalanceOf.ts
Normal file
@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_owner'], { unique: true })
|
||||
export class BalanceOf {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_owner!: string;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
value!: bigint;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,48 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index, CreateDateColumn } from 'typeorm';
|
||||
import { BlockProgressInterface } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash'], { unique: true })
|
||||
@Index(['blockNumber'])
|
||||
@Index(['parentHash'])
|
||||
export class BlockProgress implements BlockProgressInterface {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar')
|
||||
cid!: string;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
parentHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('integer')
|
||||
blockTimestamp!: number;
|
||||
|
||||
@Column('integer')
|
||||
numEvents!: number;
|
||||
|
||||
@Column('integer')
|
||||
numProcessedEvents!: number;
|
||||
|
||||
@Column('integer')
|
||||
lastProcessedEventIndex!: number;
|
||||
|
||||
@Column('boolean')
|
||||
isComplete!: boolean;
|
||||
|
||||
@Column('boolean', { default: false })
|
||||
isPruned!: boolean;
|
||||
|
||||
@CreateDateColumn()
|
||||
createdAt!: Date;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point', '_sponsor'], { unique: true })
|
||||
export class CanEscapeTo {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('integer')
|
||||
_sponsor!: number;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
33
packages/linear-star-release-watcher/src/entity/CanManage.ts
Normal file
33
packages/linear-star-release-watcher/src/entity/CanManage.ts
Normal file
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point', '_who'], { unique: true })
|
||||
export class CanManage {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_who!: string;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point', '_who'], { unique: true })
|
||||
export class CanSpawnAs {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_who!: string;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point', '_who'], { unique: true })
|
||||
export class CanTransfer {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_who!: string;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
33
packages/linear-star-release-watcher/src/entity/CanVoteAs.ts
Normal file
33
packages/linear-star-release-watcher/src/entity/CanVoteAs.ts
Normal file
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point', '_who'], { unique: true })
|
||||
export class CanVoteAs {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_who!: string;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
24
packages/linear-star-release-watcher/src/entity/Contract.ts
Normal file
24
packages/linear-star-release-watcher/src/entity/Contract.ts
Normal file
@ -0,0 +1,24 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['address'], { unique: true })
|
||||
export class Contract {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
address!: string;
|
||||
|
||||
@Column('varchar')
|
||||
kind!: string;
|
||||
|
||||
@Column('boolean')
|
||||
checkpoint!: boolean;
|
||||
|
||||
@Column('integer')
|
||||
startingBlock!: number;
|
||||
}
|
38
packages/linear-star-release-watcher/src/entity/Event.ts
Normal file
38
packages/linear-star-release-watcher/src/entity/Event.ts
Normal file
@ -0,0 +1,38 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index, ManyToOne } from 'typeorm';
|
||||
import { BlockProgress } from './BlockProgress';
|
||||
|
||||
@Entity()
|
||||
@Index(['block', 'contract'])
|
||||
@Index(['block', 'contract', 'eventName'])
|
||||
export class Event {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@ManyToOne(() => BlockProgress, { onDelete: 'CASCADE' })
|
||||
block!: BlockProgress;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
txHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
index!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contract!: string;
|
||||
|
||||
@Column('varchar', { length: 256 })
|
||||
eventName!: string;
|
||||
|
||||
@Column('text')
|
||||
eventInfo!: string;
|
||||
|
||||
@Column('text')
|
||||
extraInfo!: string;
|
||||
|
||||
@Column('text')
|
||||
proof!: string;
|
||||
}
|
31
packages/linear-star-release-watcher/src/entity/Exists.ts
Normal file
31
packages/linear-star-release-watcher/src/entity/Exists.ts
Normal file
@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_tokenId'], { unique: true })
|
||||
export class Exists {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
_tokenId!: bigint;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
36
packages/linear-star-release-watcher/src/entity/FindClaim.ts
Normal file
36
packages/linear-star-release-watcher/src/entity/FindClaim.ts
Normal file
@ -0,0 +1,36 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_whose', '_protocol', '_claim'], { unique: true })
|
||||
export class FindClaim {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_whose!: number;
|
||||
|
||||
@Column('varchar')
|
||||
_protocol!: string;
|
||||
|
||||
@Column('varchar')
|
||||
_claim!: string;
|
||||
|
||||
@Column('integer')
|
||||
value!: number;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_tokenId'], { unique: true })
|
||||
export class GetApproved {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
_tokenId!: bigint;
|
||||
|
||||
@Column('varchar')
|
||||
value!: string;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point'], { unique: true })
|
||||
export class GetContinuityNumber {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('integer')
|
||||
value!: number;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress'], { unique: true })
|
||||
export class GetDocumentProposalCount {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
value!: bigint;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point'], { unique: true })
|
||||
export class GetEscapeRequest {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('integer')
|
||||
value!: number;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_sponsor'], { unique: true })
|
||||
export class GetEscapeRequestsCount {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_sponsor!: number;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
value!: bigint;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point'], { unique: true })
|
||||
export class GetKeyRevisionNumber {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('integer')
|
||||
value!: number;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point'], { unique: true })
|
||||
export class GetManagementProxy {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('varchar')
|
||||
value!: string;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_proxy'], { unique: true })
|
||||
export class GetManagerForCount {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_proxy!: string;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
value!: bigint;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_whose', '_index'], { unique: true })
|
||||
export class GetOwnedPointAtIndex {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_whose!: string;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
_index!: bigint;
|
||||
|
||||
@Column('integer')
|
||||
value!: number;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_whose'], { unique: true })
|
||||
export class GetOwnedPointCount {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_whose!: string;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
value!: bigint;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
30
packages/linear-star-release-watcher/src/entity/GetOwner.ts
Normal file
30
packages/linear-star-release-watcher/src/entity/GetOwner.ts
Normal file
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point'], { unique: true })
|
||||
export class GetOwner {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('varchar')
|
||||
value!: string;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point'], { unique: true })
|
||||
export class GetSpawnCount {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('integer')
|
||||
value!: number;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point', '_time'], { unique: true })
|
||||
export class GetSpawnLimit {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
_time!: bigint;
|
||||
|
||||
@Column('integer')
|
||||
value!: number;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point'], { unique: true })
|
||||
export class GetSpawnProxy {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('varchar')
|
||||
value!: string;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_proxy'], { unique: true })
|
||||
export class GetSpawningForCount {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_proxy!: string;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
value!: bigint;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point'], { unique: true })
|
||||
export class GetSponsor {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('integer')
|
||||
value!: number;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_sponsor'], { unique: true })
|
||||
export class GetSponsoringCount {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_sponsor!: number;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
value!: bigint;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point'], { unique: true })
|
||||
export class GetTransferProxy {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('varchar')
|
||||
value!: string;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_proxy'], { unique: true })
|
||||
export class GetTransferringForCount {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_proxy!: string;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
value!: bigint;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress'], { unique: true })
|
||||
export class GetUpgradeProposalCount {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
value!: bigint;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_proxy'], { unique: true })
|
||||
export class GetVotingForCount {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_proxy!: string;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
value!: bigint;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point'], { unique: true })
|
||||
export class GetVotingProxy {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('varchar')
|
||||
value!: string;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point'], { unique: true })
|
||||
export class HasBeenLinked {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point'], { unique: true })
|
||||
export class HasSponsor {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_galaxy', '_proposal'], { unique: true })
|
||||
export class HasVotedOnDocumentPoll {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_galaxy!: number;
|
||||
|
||||
@Column('varchar')
|
||||
_proposal!: string;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_galaxy', '_proposal'], { unique: true })
|
||||
export class HasVotedOnUpgradePoll {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_galaxy!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_proposal!: string;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
30
packages/linear-star-release-watcher/src/entity/IsActive.ts
Normal file
30
packages/linear-star-release-watcher/src/entity/IsActive.ts
Normal file
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point'], { unique: true })
|
||||
export class IsActive {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_owner', '_operator'], { unique: true })
|
||||
export class IsApprovedForAll {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_owner!: string;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_operator!: string;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point'], { unique: true })
|
||||
export class IsEscaping {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
30
packages/linear-star-release-watcher/src/entity/IsLive.ts
Normal file
30
packages/linear-star-release-watcher/src/entity/IsLive.ts
Normal file
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point'], { unique: true })
|
||||
export class IsLive {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point', '_proxy'], { unique: true })
|
||||
export class IsManagementProxy {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_proxy!: string;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_owner', '_operator'], { unique: true })
|
||||
export class IsOperator {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_owner!: string;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_operator!: string;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
33
packages/linear-star-release-watcher/src/entity/IsOwner.ts
Normal file
33
packages/linear-star-release-watcher/src/entity/IsOwner.ts
Normal file
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point', '_address'], { unique: true })
|
||||
export class IsOwner {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_address!: string;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point', '_sponsor'], { unique: true })
|
||||
export class IsRequestingEscapeTo {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('integer')
|
||||
_sponsor!: number;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point', '_proxy'], { unique: true })
|
||||
export class IsSpawnProxy {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_proxy!: string;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
33
packages/linear-star-release-watcher/src/entity/IsSponsor.ts
Normal file
33
packages/linear-star-release-watcher/src/entity/IsSponsor.ts
Normal file
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point', '_sponsor'], { unique: true })
|
||||
export class IsSponsor {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('integer')
|
||||
_sponsor!: number;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point', '_proxy'], { unique: true })
|
||||
export class IsTransferProxy {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_proxy!: string;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_point', '_proxy'], { unique: true })
|
||||
export class IsVotingProxy {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('integer')
|
||||
_point!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_proxy!: string;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
27
packages/linear-star-release-watcher/src/entity/Name.ts
Normal file
27
packages/linear-star-release-watcher/src/entity/Name.ts
Normal file
@ -0,0 +1,27 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress'], { unique: true })
|
||||
export class Name {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('varchar')
|
||||
value!: string;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
31
packages/linear-star-release-watcher/src/entity/OwnerOf.ts
Normal file
31
packages/linear-star-release-watcher/src/entity/OwnerOf.ts
Normal file
@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_tokenId'], { unique: true })
|
||||
export class OwnerOf {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
_tokenId!: bigint;
|
||||
|
||||
@Column('varchar')
|
||||
value!: string;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
31
packages/linear-star-release-watcher/src/entity/State.ts
Normal file
31
packages/linear-star-release-watcher/src/entity/State.ts
Normal file
@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index, ManyToOne } from 'typeorm';
|
||||
import { StateKind } from '@cerc-io/util';
|
||||
import { BlockProgress } from './BlockProgress';
|
||||
|
||||
@Entity()
|
||||
@Index(['cid'], { unique: true })
|
||||
@Index(['block', 'contractAddress'])
|
||||
@Index(['block', 'contractAddress', 'kind'], { unique: true })
|
||||
export class State {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@ManyToOne(() => BlockProgress, { onDelete: 'CASCADE' })
|
||||
block!: BlockProgress;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('varchar')
|
||||
cid!: string;
|
||||
|
||||
@Column({ type: 'enum', enum: StateKind })
|
||||
kind!: StateKind;
|
||||
|
||||
@Column('bytea')
|
||||
data!: Buffer;
|
||||
}
|
@ -0,0 +1,17 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
export class StateSyncStatus {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('integer')
|
||||
latestIndexedBlockNumber!: number;
|
||||
|
||||
@Column('integer', { nullable: true })
|
||||
latestCheckpointBlockNumber!: number;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_interfaceId'], { unique: true })
|
||||
export class SupportsInterface {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('varchar')
|
||||
_interfaceId!: string;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
27
packages/linear-star-release-watcher/src/entity/Symbol.ts
Normal file
27
packages/linear-star-release-watcher/src/entity/Symbol.ts
Normal file
@ -0,0 +1,27 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress'], { unique: true })
|
||||
export class Symbol {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('varchar')
|
||||
value!: string;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column } from 'typeorm';
|
||||
import { SyncStatusInterface } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
export class SyncStatus implements SyncStatusInterface {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
chainHeadBlockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
chainHeadBlockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
latestIndexedBlockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
latestIndexedBlockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
latestCanonicalBlockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
latestCanonicalBlockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
initialIndexedBlockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
initialIndexedBlockNumber!: number;
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_index'], { unique: true })
|
||||
export class TokenByIndex {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
_index!: bigint;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
value!: bigint;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_owner', '_index'], { unique: true })
|
||||
export class TokenOfOwnerByIndex {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_owner!: string;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
_index!: bigint;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
value!: bigint;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
31
packages/linear-star-release-watcher/src/entity/TokenURI.ts
Normal file
31
packages/linear-star-release-watcher/src/entity/TokenURI.ts
Normal file
@ -0,0 +1,31 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_tokenId'], { unique: true })
|
||||
export class TokenURI {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
_tokenId!: bigint;
|
||||
|
||||
@Column('varchar')
|
||||
value!: string;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
import { bigintTransformer } from '@cerc-io/util';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress'], { unique: true })
|
||||
export class TotalSupply {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('numeric', { transformer: bigintTransformer })
|
||||
value!: bigint;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_participant'], { unique: true })
|
||||
export class VerifyBalance {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_participant!: string;
|
||||
|
||||
@Column('boolean')
|
||||
value!: boolean;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
@ -0,0 +1,30 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import { Entity, PrimaryGeneratedColumn, Column, Index } from 'typeorm';
|
||||
|
||||
@Entity()
|
||||
@Index(['blockHash', 'contractAddress', '_participant'], { unique: true })
|
||||
export class WithdrawLimit {
|
||||
@PrimaryGeneratedColumn()
|
||||
id!: number;
|
||||
|
||||
@Column('varchar', { length: 66 })
|
||||
blockHash!: string;
|
||||
|
||||
@Column('integer')
|
||||
blockNumber!: number;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
contractAddress!: string;
|
||||
|
||||
@Column('varchar', { length: 42 })
|
||||
_participant!: string;
|
||||
|
||||
@Column('integer')
|
||||
value!: number;
|
||||
|
||||
@Column('text', { nullable: true })
|
||||
proof!: string;
|
||||
}
|
33
packages/linear-star-release-watcher/src/fill.ts
Normal file
33
packages/linear-star-release-watcher/src/fill.ts
Normal file
@ -0,0 +1,33 @@
|
||||
//
|
||||
// Copyright 2021 Vulcanize, Inc.
|
||||
//
|
||||
|
||||
import 'reflect-metadata';
|
||||
import debug from 'debug';
|
||||
|
||||
import { FillCmd } from '@cerc-io/cli';
|
||||
|
||||
import { Database } from './database';
|
||||
import { Indexer } from './indexer';
|
||||
|
||||
const log = debug('vulcanize:fill');
|
||||
|
||||
export const main = async (): Promise<any> => {
|
||||
const fillCmd = new FillCmd();
|
||||
await fillCmd.init(Database);
|
||||
|
||||
await fillCmd.initIndexer(Indexer);
|
||||
|
||||
await fillCmd.exec();
|
||||
};
|
||||
|
||||
main().catch(err => {
|
||||
log(err);
|
||||
}).finally(() => {
|
||||
process.exit();
|
||||
});
|
||||
|
||||
process.on('SIGINT', () => {
|
||||
log(`Exiting process ${process.pid} with code 0`);
|
||||
process.exit(0);
|
||||
});
|
3
packages/linear-star-release-watcher/src/gql/index.ts
Normal file
3
packages/linear-star-release-watcher/src/gql/index.ts
Normal file
@ -0,0 +1,3 @@
|
||||
export * as mutations from './mutations';
|
||||
export * as queries from './queries';
|
||||
export * as subscriptions from './subscriptions';
|
@ -0,0 +1,4 @@
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
export const watchContract = fs.readFileSync(path.join(__dirname, 'watchContract.gql'), 'utf8');
|
@ -0,0 +1,3 @@
|
||||
mutation watchContract($address: String!, $kind: String!, $checkpoint: Boolean!, $startingBlock: Int){
|
||||
watchContract(address: $address, kind: $kind, checkpoint: $checkpoint, startingBlock: $startingBlock)
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
query balanceOf($blockHash: String!, $contractAddress: String!, $_owner: String!){
|
||||
balanceOf(blockHash: $blockHash, contractAddress: $contractAddress, _owner: $_owner){
|
||||
value
|
||||
proof{
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
query canEscapeTo($blockHash: String!, $contractAddress: String!, $_point: Int!, $_sponsor: Int!){
|
||||
canEscapeTo(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point, _sponsor: $_sponsor){
|
||||
value
|
||||
proof{
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
query canManage($blockHash: String!, $contractAddress: String!, $_point: Int!, $_who: String!){
|
||||
canManage(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point, _who: $_who){
|
||||
value
|
||||
proof{
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
query canSpawnAs($blockHash: String!, $contractAddress: String!, $_point: Int!, $_who: String!){
|
||||
canSpawnAs(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point, _who: $_who){
|
||||
value
|
||||
proof{
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
query canTransfer($blockHash: String!, $contractAddress: String!, $_point: Int!, $_who: String!){
|
||||
canTransfer(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point, _who: $_who){
|
||||
value
|
||||
proof{
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
query canVoteAs($blockHash: String!, $contractAddress: String!, $_point: Int!, $_who: String!){
|
||||
canVoteAs(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point, _who: $_who){
|
||||
value
|
||||
proof{
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
query events($blockHash: String!, $contractAddress: String!, $name: String){
|
||||
events(blockHash: $blockHash, contractAddress: $contractAddress, name: $name){
|
||||
block{
|
||||
cid
|
||||
hash
|
||||
number
|
||||
timestamp
|
||||
parentHash
|
||||
}
|
||||
tx{
|
||||
hash
|
||||
index
|
||||
from
|
||||
to
|
||||
}
|
||||
contract
|
||||
eventIndex
|
||||
event{
|
||||
... on OwnershipRenouncedEvent {
|
||||
previousOwner
|
||||
}
|
||||
... on OwnershipTransferredEvent {
|
||||
previousOwner
|
||||
newOwner
|
||||
}
|
||||
}
|
||||
proof{
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,31 @@
|
||||
query eventsInRange($fromBlockNumber: Int!, $toBlockNumber: Int!){
|
||||
eventsInRange(fromBlockNumber: $fromBlockNumber, toBlockNumber: $toBlockNumber){
|
||||
block{
|
||||
cid
|
||||
hash
|
||||
number
|
||||
timestamp
|
||||
parentHash
|
||||
}
|
||||
tx{
|
||||
hash
|
||||
index
|
||||
from
|
||||
to
|
||||
}
|
||||
contract
|
||||
eventIndex
|
||||
event{
|
||||
... on OwnershipRenouncedEvent {
|
||||
previousOwner
|
||||
}
|
||||
... on OwnershipTransferredEvent {
|
||||
previousOwner
|
||||
newOwner
|
||||
}
|
||||
}
|
||||
proof{
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
query exists($blockHash: String!, $contractAddress: String!, $_tokenId: BigInt!){
|
||||
exists(blockHash: $blockHash, contractAddress: $contractAddress, _tokenId: $_tokenId){
|
||||
value
|
||||
proof{
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
query findClaim($blockHash: String!, $contractAddress: String!, $_whose: Int!, $_protocol: String!, $_claim: String!){
|
||||
findClaim(blockHash: $blockHash, contractAddress: $contractAddress, _whose: $_whose, _protocol: $_protocol, _claim: $_claim){
|
||||
value
|
||||
proof{
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
query getApproved($blockHash: String!, $contractAddress: String!, $_tokenId: BigInt!){
|
||||
getApproved(blockHash: $blockHash, contractAddress: $contractAddress, _tokenId: $_tokenId){
|
||||
value
|
||||
proof{
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
query getContinuityNumber($blockHash: String!, $contractAddress: String!, $_point: Int!){
|
||||
getContinuityNumber(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){
|
||||
value
|
||||
proof{
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
query getDocumentProposalCount($blockHash: String!, $contractAddress: String!){
|
||||
getDocumentProposalCount(blockHash: $blockHash, contractAddress: $contractAddress){
|
||||
value
|
||||
proof{
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
query getEscapeRequest($blockHash: String!, $contractAddress: String!, $_point: Int!){
|
||||
getEscapeRequest(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){
|
||||
value
|
||||
proof{
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,8 @@
|
||||
query getEscapeRequestsCount($blockHash: String!, $contractAddress: String!, $_sponsor: Int!){
|
||||
getEscapeRequestsCount(blockHash: $blockHash, contractAddress: $contractAddress, _sponsor: $_sponsor){
|
||||
value
|
||||
proof{
|
||||
data
|
||||
}
|
||||
}
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user