Implement queries for multiple return type eth_calls (#12)
* Implement multiple return type for ConditionalStarRelease eth_call * Generate ConditionalStarRelease watcher from codegen handling multiple return type * Generate azimuth watcher from codegen handling multiple return type * Upgrade watcher-ts package versions
This commit is contained in:
parent
a1cb80f8ef
commit
9cee144676
0
packages/azimuth-watcher/.husky/pre-commit
Normal file → Executable file
0
packages/azimuth-watcher/.husky/pre-commit
Normal file → Executable file
@ -1,11 +1,5 @@
|
|||||||
# azimuth-watcher
|
# azimuth-watcher
|
||||||
|
|
||||||
## Currently unsupported queries
|
|
||||||
|
|
||||||
The watcher was generated in `eth_call` mode and does not support the following queries in its current state:
|
|
||||||
|
|
||||||
* `getKeys(uint32 _point) returns (bytes32 crypt, bytes32 auth, uint32 suite, uint32 revision)`
|
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
* Run the following command to install required packages:
|
* Run the following command to install required packages:
|
||||||
|
@ -39,10 +39,10 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.3.19",
|
"@apollo/client": "^3.3.19",
|
||||||
"@ethersproject/providers": "^5.4.4",
|
"@ethersproject/providers": "^5.4.4",
|
||||||
"@cerc-io/cli": "^0.2.39",
|
"@cerc-io/cli": "^0.2.40",
|
||||||
"@cerc-io/ipld-eth-client": "^0.2.39",
|
"@cerc-io/ipld-eth-client": "^0.2.40",
|
||||||
"@cerc-io/solidity-mapper": "^0.2.39",
|
"@cerc-io/solidity-mapper": "^0.2.40",
|
||||||
"@cerc-io/util": "^0.2.39",
|
"@cerc-io/util": "^0.2.40",
|
||||||
"apollo-type-bigint": "^0.1.3",
|
"apollo-type-bigint": "^0.1.3",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"ethers": "^5.4.4",
|
"ethers": "^5.4.4",
|
||||||
|
@ -26,6 +26,15 @@ export class Client {
|
|||||||
return isActive;
|
return isActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getGetKeys (blockHash: string, contractAddress: string, _point: bigint): Promise<any> {
|
||||||
|
const { getKeys } = await this._client.query(
|
||||||
|
gql(queries.getKeys),
|
||||||
|
{ blockHash, contractAddress, _point }
|
||||||
|
);
|
||||||
|
|
||||||
|
return getKeys;
|
||||||
|
}
|
||||||
|
|
||||||
async getGetKeyRevisionNumber (blockHash: string, contractAddress: string, _point: bigint): Promise<any> {
|
async getGetKeyRevisionNumber (blockHash: string, contractAddress: string, _point: bigint): Promise<any> {
|
||||||
const { getKeyRevisionNumber } = await this._client.query(
|
const { getKeyRevisionNumber } = await this._client.query(
|
||||||
gql(queries.getKeyRevisionNumber),
|
gql(queries.getKeyRevisionNumber),
|
||||||
|
@ -21,6 +21,7 @@ import { StateSyncStatus } from './entity/StateSyncStatus';
|
|||||||
import { BlockProgress } from './entity/BlockProgress';
|
import { BlockProgress } from './entity/BlockProgress';
|
||||||
import { State } from './entity/State';
|
import { State } from './entity/State';
|
||||||
import { IsActive } from './entity/IsActive';
|
import { IsActive } from './entity/IsActive';
|
||||||
|
import { GetKeys } from './entity/GetKeys';
|
||||||
import { GetKeyRevisionNumber } from './entity/GetKeyRevisionNumber';
|
import { GetKeyRevisionNumber } from './entity/GetKeyRevisionNumber';
|
||||||
import { HasBeenLinked } from './entity/HasBeenLinked';
|
import { HasBeenLinked } from './entity/HasBeenLinked';
|
||||||
import { IsLive } from './entity/IsLive';
|
import { IsLive } from './entity/IsLive';
|
||||||
@ -56,7 +57,7 @@ import { CanTransfer } from './entity/CanTransfer';
|
|||||||
import { GetTransferringForCount } from './entity/GetTransferringForCount';
|
import { GetTransferringForCount } from './entity/GetTransferringForCount';
|
||||||
import { IsOperator } from './entity/IsOperator';
|
import { IsOperator } from './entity/IsOperator';
|
||||||
|
|
||||||
export const ENTITIES = [IsActive, GetKeyRevisionNumber, HasBeenLinked, IsLive, GetContinuityNumber, GetSpawnCount, HasSponsor, GetSponsor, IsSponsor, GetSponsoringCount, IsEscaping, GetEscapeRequest, IsRequestingEscapeTo, GetEscapeRequestsCount, GetOwner, IsOwner, GetOwnedPointCount, GetOwnedPointAtIndex, GetManagementProxy, IsManagementProxy, CanManage, GetManagerForCount, GetSpawnProxy, IsSpawnProxy, CanSpawnAs, GetSpawningForCount, GetVotingProxy, IsVotingProxy, CanVoteAs, GetVotingForCount, GetTransferProxy, IsTransferProxy, CanTransfer, GetTransferringForCount, IsOperator];
|
export const ENTITIES = [IsActive, GetKeys, GetKeyRevisionNumber, HasBeenLinked, IsLive, GetContinuityNumber, GetSpawnCount, HasSponsor, GetSponsor, IsSponsor, GetSponsoringCount, IsEscaping, GetEscapeRequest, IsRequestingEscapeTo, GetEscapeRequestsCount, GetOwner, IsOwner, GetOwnedPointCount, GetOwnedPointAtIndex, GetManagementProxy, IsManagementProxy, CanManage, GetManagerForCount, GetSpawnProxy, IsSpawnProxy, CanSpawnAs, GetSpawningForCount, GetVotingProxy, IsVotingProxy, CanVoteAs, GetVotingForCount, GetTransferProxy, IsTransferProxy, CanTransfer, GetTransferringForCount, IsOperator];
|
||||||
|
|
||||||
export class Database implements DatabaseInterface {
|
export class Database implements DatabaseInterface {
|
||||||
_config: ConnectionOptions;
|
_config: ConnectionOptions;
|
||||||
@ -98,6 +99,15 @@ export class Database implements DatabaseInterface {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getGetKeys ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise<GetKeys | undefined> {
|
||||||
|
return this._conn.getRepository(GetKeys)
|
||||||
|
.findOne({
|
||||||
|
blockHash,
|
||||||
|
contractAddress,
|
||||||
|
_point
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async getGetKeyRevisionNumber ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise<GetKeyRevisionNumber | undefined> {
|
async getGetKeyRevisionNumber ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise<GetKeyRevisionNumber | undefined> {
|
||||||
return this._conn.getRepository(GetKeyRevisionNumber)
|
return this._conn.getRepository(GetKeyRevisionNumber)
|
||||||
.findOne({
|
.findOne({
|
||||||
@ -423,6 +433,12 @@ export class Database implements DatabaseInterface {
|
|||||||
return repo.save(entity);
|
return repo.save(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async saveGetKeys ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial<GetKeys>): Promise<GetKeys> {
|
||||||
|
const repo = this._conn.getRepository(GetKeys);
|
||||||
|
const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof });
|
||||||
|
return repo.save(entity);
|
||||||
|
}
|
||||||
|
|
||||||
async saveGetKeyRevisionNumber ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial<GetKeyRevisionNumber>): Promise<GetKeyRevisionNumber> {
|
async saveGetKeyRevisionNumber ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial<GetKeyRevisionNumber>): Promise<GetKeyRevisionNumber> {
|
||||||
const repo = this._conn.getRepository(GetKeyRevisionNumber);
|
const repo = this._conn.getRepository(GetKeyRevisionNumber);
|
||||||
const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof });
|
const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof });
|
||||||
@ -833,6 +849,7 @@ export class Database implements DatabaseInterface {
|
|||||||
|
|
||||||
_setPropColMaps (): void {
|
_setPropColMaps (): void {
|
||||||
this._propColMaps.IsActive = this._getPropertyColumnMapForEntity('IsActive');
|
this._propColMaps.IsActive = this._getPropertyColumnMapForEntity('IsActive');
|
||||||
|
this._propColMaps.GetKeys = this._getPropertyColumnMapForEntity('GetKeys');
|
||||||
this._propColMaps.GetKeyRevisionNumber = this._getPropertyColumnMapForEntity('GetKeyRevisionNumber');
|
this._propColMaps.GetKeyRevisionNumber = this._getPropertyColumnMapForEntity('GetKeyRevisionNumber');
|
||||||
this._propColMaps.HasBeenLinked = this._getPropertyColumnMapForEntity('HasBeenLinked');
|
this._propColMaps.HasBeenLinked = this._getPropertyColumnMapForEntity('HasBeenLinked');
|
||||||
this._propColMaps.IsLive = this._getPropertyColumnMapForEntity('IsLive');
|
this._propColMaps.IsLive = this._getPropertyColumnMapForEntity('IsLive');
|
||||||
|
31
packages/azimuth-watcher/src/entity/GetKeys.ts
Normal file
31
packages/azimuth-watcher/src/entity/GetKeys.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', '_point'], { unique: true })
|
||||||
|
export class GetKeys {
|
||||||
|
@PrimaryGeneratedColumn()
|
||||||
|
id!: number;
|
||||||
|
|
||||||
|
@Column('varchar', { length: 66 })
|
||||||
|
blockHash!: string;
|
||||||
|
|
||||||
|
@Column('integer')
|
||||||
|
blockNumber!: number;
|
||||||
|
|
||||||
|
@Column('varchar', { length: 42 })
|
||||||
|
contractAddress!: string;
|
||||||
|
|
||||||
|
@Column('numeric', { transformer: bigintTransformer })
|
||||||
|
_point!: bigint;
|
||||||
|
|
||||||
|
@Column('varchar')
|
||||||
|
value!: string;
|
||||||
|
|
||||||
|
@Column('text', { nullable: true })
|
||||||
|
proof!: string;
|
||||||
|
}
|
13
packages/azimuth-watcher/src/gql/queries/getKeys.gql
Normal file
13
packages/azimuth-watcher/src/gql/queries/getKeys.gql
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
query getKeys($blockHash: String!, $contractAddress: String!, $_point: BigInt!){
|
||||||
|
getKeys(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){
|
||||||
|
value{
|
||||||
|
value0
|
||||||
|
value1
|
||||||
|
value2
|
||||||
|
value3
|
||||||
|
}
|
||||||
|
proof{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -4,6 +4,7 @@ import path from 'path';
|
|||||||
export const events = fs.readFileSync(path.join(__dirname, 'events.gql'), 'utf8');
|
export const events = fs.readFileSync(path.join(__dirname, 'events.gql'), 'utf8');
|
||||||
export const eventsInRange = fs.readFileSync(path.join(__dirname, 'eventsInRange.gql'), 'utf8');
|
export const eventsInRange = fs.readFileSync(path.join(__dirname, 'eventsInRange.gql'), 'utf8');
|
||||||
export const isActive = fs.readFileSync(path.join(__dirname, 'isActive.gql'), 'utf8');
|
export const isActive = fs.readFileSync(path.join(__dirname, 'isActive.gql'), 'utf8');
|
||||||
|
export const getKeys = fs.readFileSync(path.join(__dirname, 'getKeys.gql'), 'utf8');
|
||||||
export const getKeyRevisionNumber = fs.readFileSync(path.join(__dirname, 'getKeyRevisionNumber.gql'), 'utf8');
|
export const getKeyRevisionNumber = fs.readFileSync(path.join(__dirname, 'getKeyRevisionNumber.gql'), 'utf8');
|
||||||
export const hasBeenLinked = fs.readFileSync(path.join(__dirname, 'hasBeenLinked.gql'), 'utf8');
|
export const hasBeenLinked = fs.readFileSync(path.join(__dirname, 'hasBeenLinked.gql'), 'utf8');
|
||||||
export const isLive = fs.readFileSync(path.join(__dirname, 'isLive.gql'), 'utf8');
|
export const isLive = fs.readFileSync(path.join(__dirname, 'isLive.gql'), 'utf8');
|
||||||
|
@ -113,8 +113,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isActive(_point, { blockTag: blockHash });
|
const contractResult = await contract.isActive(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsActive({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsActive({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -122,6 +123,27 @@ export class Indexer implements IndexerInterface {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getKeys (blockHash: string, contractAddress: string, _point: bigint): Promise<ValueResult> {
|
||||||
|
log('getKeys: db miss, fetching from upstream server');
|
||||||
|
|
||||||
|
const abi = this._abiMap.get(KIND_AZIMUTH);
|
||||||
|
assert(abi);
|
||||||
|
|
||||||
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
|
const contractResult = await contract.getKeys(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = {
|
||||||
|
value0: contractResult[0],
|
||||||
|
value1: contractResult[1],
|
||||||
|
value2: ethers.BigNumber.from(contractResult[2]).toBigInt(),
|
||||||
|
value3: ethers.BigNumber.from(contractResult[3]).toBigInt()
|
||||||
|
};
|
||||||
|
|
||||||
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
async getKeyRevisionNumber (blockHash: string, contractAddress: string, _point: bigint): Promise<ValueResult> {
|
async getKeyRevisionNumber (blockHash: string, contractAddress: string, _point: bigint): Promise<ValueResult> {
|
||||||
const entity = await this._db.getGetKeyRevisionNumber({ blockHash, contractAddress, _point });
|
const entity = await this._db.getGetKeyRevisionNumber({ blockHash, contractAddress, _point });
|
||||||
if (entity) {
|
if (entity) {
|
||||||
@ -142,9 +164,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getKeyRevisionNumber(_point, { blockTag: blockHash });
|
const contractResult = await contract.getKeyRevisionNumber(_point, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -173,8 +195,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.hasBeenLinked(_point, { blockTag: blockHash });
|
const contractResult = await contract.hasBeenLinked(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveHasBeenLinked({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveHasBeenLinked({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -202,8 +225,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isLive(_point, { blockTag: blockHash });
|
const contractResult = await contract.isLive(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsLive({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsLive({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -231,9 +255,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getContinuityNumber(_point, { blockTag: blockHash });
|
const contractResult = await contract.getContinuityNumber(_point, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -262,9 +286,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getSpawnCount(_point, { blockTag: blockHash });
|
const contractResult = await contract.getSpawnCount(_point, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -280,9 +304,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getSpawned(_point, { blockTag: blockHash });
|
const contractResult = await contract.getSpawned(_point, { blockTag: blockHash });
|
||||||
value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt());
|
|
||||||
|
|
||||||
|
const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt());
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -308,8 +332,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.hasSponsor(_point, { blockTag: blockHash });
|
const contractResult = await contract.hasSponsor(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveHasSponsor({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveHasSponsor({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -337,9 +362,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getSponsor(_point, { blockTag: blockHash });
|
const contractResult = await contract.getSponsor(_point, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -368,8 +393,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isSponsor(_point, _sponsor, { blockTag: blockHash });
|
const contractResult = await contract.isSponsor(_point, _sponsor, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsSponsor({ blockHash, blockNumber, contractAddress, _point, _sponsor, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsSponsor({ blockHash, blockNumber, contractAddress, _point, _sponsor, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -397,9 +423,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getSponsoringCount(_sponsor, { blockTag: blockHash });
|
const contractResult = await contract.getSponsoringCount(_sponsor, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -415,9 +441,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getSponsoring(_sponsor, { blockTag: blockHash });
|
const contractResult = await contract.getSponsoring(_sponsor, { blockTag: blockHash });
|
||||||
value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt());
|
|
||||||
|
|
||||||
|
const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt());
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -443,8 +469,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isEscaping(_point, { blockTag: blockHash });
|
const contractResult = await contract.isEscaping(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsEscaping({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsEscaping({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -472,9 +499,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getEscapeRequest(_point, { blockTag: blockHash });
|
const contractResult = await contract.getEscapeRequest(_point, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -503,8 +530,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isRequestingEscapeTo(_point, _sponsor, { blockTag: blockHash });
|
const contractResult = await contract.isRequestingEscapeTo(_point, _sponsor, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsRequestingEscapeTo({ blockHash, blockNumber, contractAddress, _point, _sponsor, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsRequestingEscapeTo({ blockHash, blockNumber, contractAddress, _point, _sponsor, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -532,9 +560,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getEscapeRequestsCount(_sponsor, { blockTag: blockHash });
|
const contractResult = await contract.getEscapeRequestsCount(_sponsor, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -550,9 +578,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getEscapeRequests(_sponsor, { blockTag: blockHash });
|
const contractResult = await contract.getEscapeRequests(_sponsor, { blockTag: blockHash });
|
||||||
value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt());
|
|
||||||
|
|
||||||
|
const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt());
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -578,8 +606,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getOwner(_point, { blockTag: blockHash });
|
const contractResult = await contract.getOwner(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveGetOwner({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveGetOwner({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -607,8 +636,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isOwner(_point, _address, { blockTag: blockHash });
|
const contractResult = await contract.isOwner(_point, _address, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsOwner({ blockHash, blockNumber, contractAddress, _point, _address, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsOwner({ blockHash, blockNumber, contractAddress, _point, _address, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -636,9 +666,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getOwnedPointCount(_whose, { blockTag: blockHash });
|
const contractResult = await contract.getOwnedPointCount(_whose, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -654,9 +684,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getOwnedPoints(_whose, { blockTag: blockHash });
|
const contractResult = await contract.getOwnedPoints(_whose, { blockTag: blockHash });
|
||||||
value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt());
|
|
||||||
|
|
||||||
|
const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt());
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -682,9 +712,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getOwnedPointAtIndex(_whose, _index, { blockTag: blockHash });
|
const contractResult = await contract.getOwnedPointAtIndex(_whose, _index, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -713,8 +743,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getManagementProxy(_point, { blockTag: blockHash });
|
const contractResult = await contract.getManagementProxy(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveGetManagementProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveGetManagementProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -742,8 +773,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isManagementProxy(_point, _proxy, { blockTag: blockHash });
|
const contractResult = await contract.isManagementProxy(_point, _proxy, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsManagementProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsManagementProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -771,8 +803,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.canManage(_point, _who, { blockTag: blockHash });
|
const contractResult = await contract.canManage(_point, _who, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveCanManage({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveCanManage({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -800,9 +833,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getManagerForCount(_proxy, { blockTag: blockHash });
|
const contractResult = await contract.getManagerForCount(_proxy, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -818,9 +851,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getManagerFor(_proxy, { blockTag: blockHash });
|
const contractResult = await contract.getManagerFor(_proxy, { blockTag: blockHash });
|
||||||
value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt());
|
|
||||||
|
|
||||||
|
const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt());
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -846,8 +879,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getSpawnProxy(_point, { blockTag: blockHash });
|
const contractResult = await contract.getSpawnProxy(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveGetSpawnProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveGetSpawnProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -875,8 +909,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isSpawnProxy(_point, _proxy, { blockTag: blockHash });
|
const contractResult = await contract.isSpawnProxy(_point, _proxy, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsSpawnProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsSpawnProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -904,8 +939,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.canSpawnAs(_point, _who, { blockTag: blockHash });
|
const contractResult = await contract.canSpawnAs(_point, _who, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveCanSpawnAs({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveCanSpawnAs({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -933,9 +969,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getSpawningForCount(_proxy, { blockTag: blockHash });
|
const contractResult = await contract.getSpawningForCount(_proxy, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -951,9 +987,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getSpawningFor(_proxy, { blockTag: blockHash });
|
const contractResult = await contract.getSpawningFor(_proxy, { blockTag: blockHash });
|
||||||
value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt());
|
|
||||||
|
|
||||||
|
const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt());
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -979,8 +1015,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getVotingProxy(_point, { blockTag: blockHash });
|
const contractResult = await contract.getVotingProxy(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveGetVotingProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveGetVotingProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1008,8 +1045,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isVotingProxy(_point, _proxy, { blockTag: blockHash });
|
const contractResult = await contract.isVotingProxy(_point, _proxy, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsVotingProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsVotingProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1037,8 +1075,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.canVoteAs(_point, _who, { blockTag: blockHash });
|
const contractResult = await contract.canVoteAs(_point, _who, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveCanVoteAs({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveCanVoteAs({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1066,9 +1105,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getVotingForCount(_proxy, { blockTag: blockHash });
|
const contractResult = await contract.getVotingForCount(_proxy, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -1084,9 +1123,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getVotingFor(_proxy, { blockTag: blockHash });
|
const contractResult = await contract.getVotingFor(_proxy, { blockTag: blockHash });
|
||||||
value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt());
|
|
||||||
|
|
||||||
|
const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt());
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -1112,8 +1151,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getTransferProxy(_point, { blockTag: blockHash });
|
const contractResult = await contract.getTransferProxy(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveGetTransferProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveGetTransferProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1141,8 +1181,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isTransferProxy(_point, _proxy, { blockTag: blockHash });
|
const contractResult = await contract.isTransferProxy(_point, _proxy, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsTransferProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsTransferProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1170,8 +1211,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.canTransfer(_point, _who, { blockTag: blockHash });
|
const contractResult = await contract.canTransfer(_point, _who, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveCanTransfer({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveCanTransfer({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1199,9 +1241,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getTransferringForCount(_proxy, { blockTag: blockHash });
|
const contractResult = await contract.getTransferringForCount(_proxy, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -1217,9 +1259,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getTransferringFor(_proxy, { blockTag: blockHash });
|
const contractResult = await contract.getTransferringFor(_proxy, { blockTag: blockHash });
|
||||||
value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt());
|
|
||||||
|
|
||||||
|
const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt());
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -1245,8 +1287,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isOperator(_owner, _operator, { blockTag: blockHash });
|
const contractResult = await contract.isOperator(_owner, _operator, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsOperator({ blockHash, blockNumber, contractAddress, _owner, _operator, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsOperator({ blockHash, blockNumber, contractAddress, _owner, _operator, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
|
@ -90,6 +90,24 @@ export const createResolvers = async (indexerArg: IndexerInterface, eventWatcher
|
|||||||
return indexer.isActive(blockHash, contractAddress, _point);
|
return indexer.isActive(blockHash, contractAddress, _point);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getKeys: (
|
||||||
|
_: any,
|
||||||
|
{ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint },
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
__: any,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
info: GraphQLResolveInfo
|
||||||
|
): Promise<ValueResult> => {
|
||||||
|
log('getKeys', blockHash, contractAddress, _point);
|
||||||
|
gqlTotalQueryCount.inc(1);
|
||||||
|
gqlQueryCount.labels('getKeys').inc(1);
|
||||||
|
|
||||||
|
// Set cache-control hints
|
||||||
|
// setGQLCacheHints(info, {}, gqlCacheConfig);
|
||||||
|
|
||||||
|
return indexer.getKeys(blockHash, contractAddress, _point);
|
||||||
|
},
|
||||||
|
|
||||||
getKeyRevisionNumber: (
|
getKeyRevisionNumber: (
|
||||||
_: any,
|
_: any,
|
||||||
{ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint },
|
{ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint },
|
||||||
|
@ -128,6 +128,18 @@ type ResultBoolean {
|
|||||||
proof: Proof
|
proof: Proof
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ResultGetKeysType {
|
||||||
|
value: GetKeysType!
|
||||||
|
proof: Proof
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKeysType {
|
||||||
|
value0: String!
|
||||||
|
value1: String!
|
||||||
|
value2: BigInt!
|
||||||
|
value3: BigInt!
|
||||||
|
}
|
||||||
|
|
||||||
type ResultBigInt {
|
type ResultBigInt {
|
||||||
value: BigInt!
|
value: BigInt!
|
||||||
proof: Proof
|
proof: Proof
|
||||||
@ -162,6 +174,7 @@ type Query {
|
|||||||
events(blockHash: String!, contractAddress: String!, name: String): [ResultEvent!]
|
events(blockHash: String!, contractAddress: String!, name: String): [ResultEvent!]
|
||||||
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!): [ResultEvent!]
|
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!): [ResultEvent!]
|
||||||
isActive(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean!
|
isActive(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean!
|
||||||
|
getKeys(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultGetKeysType!
|
||||||
getKeyRevisionNumber(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBigInt!
|
getKeyRevisionNumber(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBigInt!
|
||||||
hasBeenLinked(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean!
|
hasBeenLinked(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean!
|
||||||
isLive(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean!
|
isLive(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean!
|
||||||
|
@ -39,10 +39,10 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.3.19",
|
"@apollo/client": "^3.3.19",
|
||||||
"@ethersproject/providers": "^5.4.4",
|
"@ethersproject/providers": "^5.4.4",
|
||||||
"@cerc-io/cli": "^0.2.39",
|
"@cerc-io/cli": "^0.2.40",
|
||||||
"@cerc-io/ipld-eth-client": "^0.2.39",
|
"@cerc-io/ipld-eth-client": "^0.2.40",
|
||||||
"@cerc-io/solidity-mapper": "^0.2.39",
|
"@cerc-io/solidity-mapper": "^0.2.40",
|
||||||
"@cerc-io/util": "^0.2.39",
|
"@cerc-io/util": "^0.2.40",
|
||||||
"apollo-type-bigint": "^0.1.3",
|
"apollo-type-bigint": "^0.1.3",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"ethers": "^5.4.4",
|
"ethers": "^5.4.4",
|
||||||
|
@ -39,10 +39,10 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.3.19",
|
"@apollo/client": "^3.3.19",
|
||||||
"@ethersproject/providers": "^5.4.4",
|
"@ethersproject/providers": "^5.4.4",
|
||||||
"@cerc-io/cli": "^0.2.39",
|
"@cerc-io/cli": "^0.2.40",
|
||||||
"@cerc-io/ipld-eth-client": "^0.2.39",
|
"@cerc-io/ipld-eth-client": "^0.2.40",
|
||||||
"@cerc-io/solidity-mapper": "^0.2.39",
|
"@cerc-io/solidity-mapper": "^0.2.40",
|
||||||
"@cerc-io/util": "^0.2.39",
|
"@cerc-io/util": "^0.2.40",
|
||||||
"apollo-type-bigint": "^0.1.3",
|
"apollo-type-bigint": "^0.1.3",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"ethers": "^5.4.4",
|
"ethers": "^5.4.4",
|
||||||
|
0
packages/conditional-star-release-watcher/.husky/pre-commit
Normal file → Executable file
0
packages/conditional-star-release-watcher/.husky/pre-commit
Normal file → Executable file
@ -1,11 +1,5 @@
|
|||||||
# conditional-star-release-watcher
|
# conditional-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:
|
|
||||||
|
|
||||||
* `getConditionsState() returns (bytes32[] conds, uint256[] lives, uint256[] deads, uint256[] times)`
|
|
||||||
|
|
||||||
## Setup
|
## Setup
|
||||||
|
|
||||||
* Run the following command to install required packages:
|
* Run the following command to install required packages:
|
||||||
|
@ -39,10 +39,10 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.3.19",
|
"@apollo/client": "^3.3.19",
|
||||||
"@ethersproject/providers": "^5.4.4",
|
"@ethersproject/providers": "^5.4.4",
|
||||||
"@cerc-io/cli": "^0.2.39",
|
"@cerc-io/cli": "^0.2.40",
|
||||||
"@cerc-io/ipld-eth-client": "^0.2.39",
|
"@cerc-io/ipld-eth-client": "^0.2.40",
|
||||||
"@cerc-io/solidity-mapper": "^0.2.39",
|
"@cerc-io/solidity-mapper": "^0.2.40",
|
||||||
"@cerc-io/util": "^0.2.39",
|
"@cerc-io/util": "^0.2.40",
|
||||||
"apollo-type-bigint": "^0.1.3",
|
"apollo-type-bigint": "^0.1.3",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"ethers": "^5.4.4",
|
"ethers": "^5.4.4",
|
||||||
|
@ -26,6 +26,15 @@ export class Client {
|
|||||||
return isActive;
|
return isActive;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getGetKeys (blockHash: string, contractAddress: string, _point: bigint): Promise<any> {
|
||||||
|
const { getKeys } = await this._client.query(
|
||||||
|
gql(queries.getKeys),
|
||||||
|
{ blockHash, contractAddress, _point }
|
||||||
|
);
|
||||||
|
|
||||||
|
return getKeys;
|
||||||
|
}
|
||||||
|
|
||||||
async getGetKeyRevisionNumber (blockHash: string, contractAddress: string, _point: bigint): Promise<any> {
|
async getGetKeyRevisionNumber (blockHash: string, contractAddress: string, _point: bigint): Promise<any> {
|
||||||
const { getKeyRevisionNumber } = await this._client.query(
|
const { getKeyRevisionNumber } = await this._client.query(
|
||||||
gql(queries.getKeyRevisionNumber),
|
gql(queries.getKeyRevisionNumber),
|
||||||
|
@ -21,6 +21,7 @@ import { StateSyncStatus } from './entity/StateSyncStatus';
|
|||||||
import { BlockProgress } from './entity/BlockProgress';
|
import { BlockProgress } from './entity/BlockProgress';
|
||||||
import { State } from './entity/State';
|
import { State } from './entity/State';
|
||||||
import { IsActive } from './entity/IsActive';
|
import { IsActive } from './entity/IsActive';
|
||||||
|
import { GetKeys } from './entity/GetKeys';
|
||||||
import { GetKeyRevisionNumber } from './entity/GetKeyRevisionNumber';
|
import { GetKeyRevisionNumber } from './entity/GetKeyRevisionNumber';
|
||||||
import { HasBeenLinked } from './entity/HasBeenLinked';
|
import { HasBeenLinked } from './entity/HasBeenLinked';
|
||||||
import { IsLive } from './entity/IsLive';
|
import { IsLive } from './entity/IsLive';
|
||||||
@ -80,7 +81,7 @@ import { GetBatch } from './entity/GetBatch';
|
|||||||
import { GetWithdrawnFromBatch } from './entity/GetWithdrawnFromBatch';
|
import { GetWithdrawnFromBatch } from './entity/GetWithdrawnFromBatch';
|
||||||
import { HasForfeitedBatch } from './entity/HasForfeitedBatch';
|
import { HasForfeitedBatch } from './entity/HasForfeitedBatch';
|
||||||
|
|
||||||
export const ENTITIES = [IsActive, GetKeyRevisionNumber, HasBeenLinked, IsLive, GetContinuityNumber, GetSpawnCount, HasSponsor, GetSponsor, IsSponsor, GetSponsoringCount, IsEscaping, GetEscapeRequest, IsRequestingEscapeTo, GetEscapeRequestsCount, GetOwner, IsOwner, GetOwnedPointCount, GetOwnedPointAtIndex, GetManagementProxy, IsManagementProxy, CanManage, GetManagerForCount, GetSpawnProxy, IsSpawnProxy, CanSpawnAs, GetSpawningForCount, GetVotingProxy, IsVotingProxy, CanVoteAs, GetVotingForCount, GetTransferProxy, IsTransferProxy, CanTransfer, GetTransferringForCount, IsOperator, GetUpgradeProposalCount, GetDocumentProposalCount, HasVotedOnUpgradePoll, HasVotedOnDocumentPoll, FindClaim, SupportsInterface, BalanceOf, OwnerOf, Exists, GetApproved, IsApprovedForAll, TotalSupply, TokenOfOwnerByIndex, TokenByIndex, Name, Symbol, TokenURI, GetSpawnLimit, CanEscapeTo, WithdrawLimit, VerifyBalance, GetBatch, GetWithdrawnFromBatch, HasForfeitedBatch];
|
export const ENTITIES = [IsActive, GetKeys, GetKeyRevisionNumber, HasBeenLinked, IsLive, GetContinuityNumber, GetSpawnCount, HasSponsor, GetSponsor, IsSponsor, GetSponsoringCount, IsEscaping, GetEscapeRequest, IsRequestingEscapeTo, GetEscapeRequestsCount, GetOwner, IsOwner, GetOwnedPointCount, GetOwnedPointAtIndex, GetManagementProxy, IsManagementProxy, CanManage, GetManagerForCount, GetSpawnProxy, IsSpawnProxy, CanSpawnAs, GetSpawningForCount, GetVotingProxy, IsVotingProxy, CanVoteAs, GetVotingForCount, GetTransferProxy, IsTransferProxy, CanTransfer, GetTransferringForCount, IsOperator, GetUpgradeProposalCount, GetDocumentProposalCount, HasVotedOnUpgradePoll, HasVotedOnDocumentPoll, FindClaim, SupportsInterface, BalanceOf, OwnerOf, Exists, GetApproved, IsApprovedForAll, TotalSupply, TokenOfOwnerByIndex, TokenByIndex, Name, Symbol, TokenURI, GetSpawnLimit, CanEscapeTo, WithdrawLimit, VerifyBalance, GetBatch, GetWithdrawnFromBatch, HasForfeitedBatch];
|
||||||
|
|
||||||
export class Database implements DatabaseInterface {
|
export class Database implements DatabaseInterface {
|
||||||
_config: ConnectionOptions;
|
_config: ConnectionOptions;
|
||||||
@ -122,6 +123,15 @@ export class Database implements DatabaseInterface {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getGetKeys ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise<GetKeys | undefined> {
|
||||||
|
return this._conn.getRepository(GetKeys)
|
||||||
|
.findOne({
|
||||||
|
blockHash,
|
||||||
|
contractAddress,
|
||||||
|
_point
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
async getGetKeyRevisionNumber ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise<GetKeyRevisionNumber | undefined> {
|
async getGetKeyRevisionNumber ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise<GetKeyRevisionNumber | undefined> {
|
||||||
return this._conn.getRepository(GetKeyRevisionNumber)
|
return this._conn.getRepository(GetKeyRevisionNumber)
|
||||||
.findOne({
|
.findOne({
|
||||||
@ -671,6 +681,12 @@ export class Database implements DatabaseInterface {
|
|||||||
return repo.save(entity);
|
return repo.save(entity);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async saveGetKeys ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial<GetKeys>): Promise<GetKeys> {
|
||||||
|
const repo = this._conn.getRepository(GetKeys);
|
||||||
|
const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof });
|
||||||
|
return repo.save(entity);
|
||||||
|
}
|
||||||
|
|
||||||
async saveGetKeyRevisionNumber ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial<GetKeyRevisionNumber>): Promise<GetKeyRevisionNumber> {
|
async saveGetKeyRevisionNumber ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial<GetKeyRevisionNumber>): Promise<GetKeyRevisionNumber> {
|
||||||
const repo = this._conn.getRepository(GetKeyRevisionNumber);
|
const repo = this._conn.getRepository(GetKeyRevisionNumber);
|
||||||
const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof });
|
const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof });
|
||||||
@ -1226,6 +1242,7 @@ export class Database implements DatabaseInterface {
|
|||||||
|
|
||||||
_setPropColMaps (): void {
|
_setPropColMaps (): void {
|
||||||
this._propColMaps.IsActive = this._getPropertyColumnMapForEntity('IsActive');
|
this._propColMaps.IsActive = this._getPropertyColumnMapForEntity('IsActive');
|
||||||
|
this._propColMaps.GetKeys = this._getPropertyColumnMapForEntity('GetKeys');
|
||||||
this._propColMaps.GetKeyRevisionNumber = this._getPropertyColumnMapForEntity('GetKeyRevisionNumber');
|
this._propColMaps.GetKeyRevisionNumber = this._getPropertyColumnMapForEntity('GetKeyRevisionNumber');
|
||||||
this._propColMaps.HasBeenLinked = this._getPropertyColumnMapForEntity('HasBeenLinked');
|
this._propColMaps.HasBeenLinked = this._getPropertyColumnMapForEntity('HasBeenLinked');
|
||||||
this._propColMaps.IsLive = this._getPropertyColumnMapForEntity('IsLive');
|
this._propColMaps.IsLive = this._getPropertyColumnMapForEntity('IsLive');
|
||||||
|
@ -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', '_point'], { unique: true })
|
||||||
|
export class GetKeys {
|
||||||
|
@PrimaryGeneratedColumn()
|
||||||
|
id!: number;
|
||||||
|
|
||||||
|
@Column('varchar', { length: 66 })
|
||||||
|
blockHash!: string;
|
||||||
|
|
||||||
|
@Column('integer')
|
||||||
|
blockNumber!: number;
|
||||||
|
|
||||||
|
@Column('varchar', { length: 42 })
|
||||||
|
contractAddress!: string;
|
||||||
|
|
||||||
|
@Column('numeric', { transformer: bigintTransformer })
|
||||||
|
_point!: bigint;
|
||||||
|
|
||||||
|
@Column('varchar')
|
||||||
|
value!: string;
|
||||||
|
|
||||||
|
@Column('text', { nullable: true })
|
||||||
|
proof!: string;
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
query getConditionsState($blockHash: String!, $contractAddress: String!){
|
||||||
|
getConditionsState(blockHash: $blockHash, contractAddress: $contractAddress){
|
||||||
|
value{
|
||||||
|
value0
|
||||||
|
value1
|
||||||
|
value2
|
||||||
|
value3
|
||||||
|
}
|
||||||
|
proof{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,13 @@
|
|||||||
|
query getKeys($blockHash: String!, $contractAddress: String!, $_point: BigInt!){
|
||||||
|
getKeys(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){
|
||||||
|
value{
|
||||||
|
value0
|
||||||
|
value1
|
||||||
|
value2
|
||||||
|
value3
|
||||||
|
}
|
||||||
|
proof{
|
||||||
|
data
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -4,6 +4,7 @@ import path from 'path';
|
|||||||
export const events = fs.readFileSync(path.join(__dirname, 'events.gql'), 'utf8');
|
export const events = fs.readFileSync(path.join(__dirname, 'events.gql'), 'utf8');
|
||||||
export const eventsInRange = fs.readFileSync(path.join(__dirname, 'eventsInRange.gql'), 'utf8');
|
export const eventsInRange = fs.readFileSync(path.join(__dirname, 'eventsInRange.gql'), 'utf8');
|
||||||
export const isActive = fs.readFileSync(path.join(__dirname, 'isActive.gql'), 'utf8');
|
export const isActive = fs.readFileSync(path.join(__dirname, 'isActive.gql'), 'utf8');
|
||||||
|
export const getKeys = fs.readFileSync(path.join(__dirname, 'getKeys.gql'), 'utf8');
|
||||||
export const getKeyRevisionNumber = fs.readFileSync(path.join(__dirname, 'getKeyRevisionNumber.gql'), 'utf8');
|
export const getKeyRevisionNumber = fs.readFileSync(path.join(__dirname, 'getKeyRevisionNumber.gql'), 'utf8');
|
||||||
export const hasBeenLinked = fs.readFileSync(path.join(__dirname, 'hasBeenLinked.gql'), 'utf8');
|
export const hasBeenLinked = fs.readFileSync(path.join(__dirname, 'hasBeenLinked.gql'), 'utf8');
|
||||||
export const isLive = fs.readFileSync(path.join(__dirname, 'isLive.gql'), 'utf8');
|
export const isLive = fs.readFileSync(path.join(__dirname, 'isLive.gql'), 'utf8');
|
||||||
@ -77,6 +78,7 @@ export const getWithdrawnFromBatch = fs.readFileSync(path.join(__dirname, 'getWi
|
|||||||
export const getForfeited = fs.readFileSync(path.join(__dirname, 'getForfeited.gql'), 'utf8');
|
export const getForfeited = fs.readFileSync(path.join(__dirname, 'getForfeited.gql'), 'utf8');
|
||||||
export const hasForfeitedBatch = fs.readFileSync(path.join(__dirname, 'hasForfeitedBatch.gql'), 'utf8');
|
export const hasForfeitedBatch = fs.readFileSync(path.join(__dirname, 'hasForfeitedBatch.gql'), 'utf8');
|
||||||
export const getRemainingStars = fs.readFileSync(path.join(__dirname, 'getRemainingStars.gql'), 'utf8');
|
export const getRemainingStars = fs.readFileSync(path.join(__dirname, 'getRemainingStars.gql'), 'utf8');
|
||||||
|
export const getConditionsState = fs.readFileSync(path.join(__dirname, 'getConditionsState.gql'), 'utf8');
|
||||||
export const getSyncStatus = fs.readFileSync(path.join(__dirname, 'getSyncStatus.gql'), 'utf8');
|
export const getSyncStatus = fs.readFileSync(path.join(__dirname, 'getSyncStatus.gql'), 'utf8');
|
||||||
export const getStateByCID = fs.readFileSync(path.join(__dirname, 'getStateByCID.gql'), 'utf8');
|
export const getStateByCID = fs.readFileSync(path.join(__dirname, 'getStateByCID.gql'), 'utf8');
|
||||||
export const getState = fs.readFileSync(path.join(__dirname, 'getState.gql'), 'utf8');
|
export const getState = fs.readFileSync(path.join(__dirname, 'getState.gql'), 'utf8');
|
||||||
|
@ -113,8 +113,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isActive(_point, { blockTag: blockHash });
|
const contractResult = await contract.isActive(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsActive({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsActive({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -122,6 +123,27 @@ export class Indexer implements IndexerInterface {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getKeys (blockHash: string, contractAddress: string, _point: bigint): Promise<ValueResult> {
|
||||||
|
log('getKeys: db miss, fetching from upstream server');
|
||||||
|
|
||||||
|
const abi = this._abiMap.get(KIND_CONDITIONALSTARRELEASE);
|
||||||
|
assert(abi);
|
||||||
|
|
||||||
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
|
const contractResult = await contract.getKeys(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = {
|
||||||
|
value0: contractResult[0],
|
||||||
|
value1: contractResult[1],
|
||||||
|
value2: ethers.BigNumber.from(contractResult[2]).toBigInt(),
|
||||||
|
value3: ethers.BigNumber.from(contractResult[3]).toBigInt()
|
||||||
|
};
|
||||||
|
|
||||||
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
async getKeyRevisionNumber (blockHash: string, contractAddress: string, _point: bigint): Promise<ValueResult> {
|
async getKeyRevisionNumber (blockHash: string, contractAddress: string, _point: bigint): Promise<ValueResult> {
|
||||||
const entity = await this._db.getGetKeyRevisionNumber({ blockHash, contractAddress, _point });
|
const entity = await this._db.getGetKeyRevisionNumber({ blockHash, contractAddress, _point });
|
||||||
if (entity) {
|
if (entity) {
|
||||||
@ -142,9 +164,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getKeyRevisionNumber(_point, { blockTag: blockHash });
|
const contractResult = await contract.getKeyRevisionNumber(_point, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -173,8 +195,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.hasBeenLinked(_point, { blockTag: blockHash });
|
const contractResult = await contract.hasBeenLinked(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveHasBeenLinked({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveHasBeenLinked({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -202,8 +225,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isLive(_point, { blockTag: blockHash });
|
const contractResult = await contract.isLive(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsLive({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsLive({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -231,9 +255,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getContinuityNumber(_point, { blockTag: blockHash });
|
const contractResult = await contract.getContinuityNumber(_point, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -262,9 +286,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getSpawnCount(_point, { blockTag: blockHash });
|
const contractResult = await contract.getSpawnCount(_point, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -280,9 +304,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getSpawned(_point, { blockTag: blockHash });
|
const contractResult = await contract.getSpawned(_point, { blockTag: blockHash });
|
||||||
value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt());
|
|
||||||
|
|
||||||
|
const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt());
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -308,8 +332,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.hasSponsor(_point, { blockTag: blockHash });
|
const contractResult = await contract.hasSponsor(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveHasSponsor({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveHasSponsor({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -337,9 +362,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getSponsor(_point, { blockTag: blockHash });
|
const contractResult = await contract.getSponsor(_point, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -368,8 +393,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isSponsor(_point, _sponsor, { blockTag: blockHash });
|
const contractResult = await contract.isSponsor(_point, _sponsor, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsSponsor({ blockHash, blockNumber, contractAddress, _point, _sponsor, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsSponsor({ blockHash, blockNumber, contractAddress, _point, _sponsor, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -397,9 +423,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getSponsoringCount(_sponsor, { blockTag: blockHash });
|
const contractResult = await contract.getSponsoringCount(_sponsor, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -415,9 +441,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getSponsoring(_sponsor, { blockTag: blockHash });
|
const contractResult = await contract.getSponsoring(_sponsor, { blockTag: blockHash });
|
||||||
value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt());
|
|
||||||
|
|
||||||
|
const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt());
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -443,8 +469,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isEscaping(_point, { blockTag: blockHash });
|
const contractResult = await contract.isEscaping(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsEscaping({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsEscaping({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -472,9 +499,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getEscapeRequest(_point, { blockTag: blockHash });
|
const contractResult = await contract.getEscapeRequest(_point, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -503,8 +530,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isRequestingEscapeTo(_point, _sponsor, { blockTag: blockHash });
|
const contractResult = await contract.isRequestingEscapeTo(_point, _sponsor, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsRequestingEscapeTo({ blockHash, blockNumber, contractAddress, _point, _sponsor, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsRequestingEscapeTo({ blockHash, blockNumber, contractAddress, _point, _sponsor, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -532,9 +560,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getEscapeRequestsCount(_sponsor, { blockTag: blockHash });
|
const contractResult = await contract.getEscapeRequestsCount(_sponsor, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -550,9 +578,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getEscapeRequests(_sponsor, { blockTag: blockHash });
|
const contractResult = await contract.getEscapeRequests(_sponsor, { blockTag: blockHash });
|
||||||
value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt());
|
|
||||||
|
|
||||||
|
const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt());
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -578,8 +606,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getOwner(_point, { blockTag: blockHash });
|
const contractResult = await contract.getOwner(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveGetOwner({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveGetOwner({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -607,8 +636,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isOwner(_point, _address, { blockTag: blockHash });
|
const contractResult = await contract.isOwner(_point, _address, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsOwner({ blockHash, blockNumber, contractAddress, _point, _address, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsOwner({ blockHash, blockNumber, contractAddress, _point, _address, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -636,9 +666,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getOwnedPointCount(_whose, { blockTag: blockHash });
|
const contractResult = await contract.getOwnedPointCount(_whose, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -654,9 +684,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getOwnedPoints(_whose, { blockTag: blockHash });
|
const contractResult = await contract.getOwnedPoints(_whose, { blockTag: blockHash });
|
||||||
value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt());
|
|
||||||
|
|
||||||
|
const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt());
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -682,9 +712,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getOwnedPointAtIndex(_whose, _index, { blockTag: blockHash });
|
const contractResult = await contract.getOwnedPointAtIndex(_whose, _index, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -713,8 +743,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getManagementProxy(_point, { blockTag: blockHash });
|
const contractResult = await contract.getManagementProxy(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveGetManagementProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveGetManagementProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -742,8 +773,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isManagementProxy(_point, _proxy, { blockTag: blockHash });
|
const contractResult = await contract.isManagementProxy(_point, _proxy, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsManagementProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsManagementProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -771,8 +803,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.canManage(_point, _who, { blockTag: blockHash });
|
const contractResult = await contract.canManage(_point, _who, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveCanManage({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveCanManage({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -800,9 +833,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getManagerForCount(_proxy, { blockTag: blockHash });
|
const contractResult = await contract.getManagerForCount(_proxy, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -818,9 +851,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getManagerFor(_proxy, { blockTag: blockHash });
|
const contractResult = await contract.getManagerFor(_proxy, { blockTag: blockHash });
|
||||||
value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt());
|
|
||||||
|
|
||||||
|
const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt());
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -846,8 +879,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getSpawnProxy(_point, { blockTag: blockHash });
|
const contractResult = await contract.getSpawnProxy(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveGetSpawnProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveGetSpawnProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -875,8 +909,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isSpawnProxy(_point, _proxy, { blockTag: blockHash });
|
const contractResult = await contract.isSpawnProxy(_point, _proxy, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsSpawnProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsSpawnProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -904,8 +939,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.canSpawnAs(_point, _who, { blockTag: blockHash });
|
const contractResult = await contract.canSpawnAs(_point, _who, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveCanSpawnAs({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveCanSpawnAs({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -933,9 +969,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getSpawningForCount(_proxy, { blockTag: blockHash });
|
const contractResult = await contract.getSpawningForCount(_proxy, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -951,9 +987,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getSpawningFor(_proxy, { blockTag: blockHash });
|
const contractResult = await contract.getSpawningFor(_proxy, { blockTag: blockHash });
|
||||||
value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt());
|
|
||||||
|
|
||||||
|
const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt());
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -979,8 +1015,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getVotingProxy(_point, { blockTag: blockHash });
|
const contractResult = await contract.getVotingProxy(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveGetVotingProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveGetVotingProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1008,8 +1045,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isVotingProxy(_point, _proxy, { blockTag: blockHash });
|
const contractResult = await contract.isVotingProxy(_point, _proxy, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsVotingProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsVotingProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1037,8 +1075,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.canVoteAs(_point, _who, { blockTag: blockHash });
|
const contractResult = await contract.canVoteAs(_point, _who, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveCanVoteAs({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveCanVoteAs({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1066,9 +1105,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getVotingForCount(_proxy, { blockTag: blockHash });
|
const contractResult = await contract.getVotingForCount(_proxy, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -1084,9 +1123,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getVotingFor(_proxy, { blockTag: blockHash });
|
const contractResult = await contract.getVotingFor(_proxy, { blockTag: blockHash });
|
||||||
value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt());
|
|
||||||
|
|
||||||
|
const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt());
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -1112,8 +1151,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getTransferProxy(_point, { blockTag: blockHash });
|
const contractResult = await contract.getTransferProxy(_point, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveGetTransferProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveGetTransferProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1141,8 +1181,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isTransferProxy(_point, _proxy, { blockTag: blockHash });
|
const contractResult = await contract.isTransferProxy(_point, _proxy, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsTransferProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsTransferProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1170,8 +1211,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.canTransfer(_point, _who, { blockTag: blockHash });
|
const contractResult = await contract.canTransfer(_point, _who, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveCanTransfer({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveCanTransfer({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1199,9 +1241,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getTransferringForCount(_proxy, { blockTag: blockHash });
|
const contractResult = await contract.getTransferringForCount(_proxy, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -1217,9 +1259,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getTransferringFor(_proxy, { blockTag: blockHash });
|
const contractResult = await contract.getTransferringFor(_proxy, { blockTag: blockHash });
|
||||||
value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt());
|
|
||||||
|
|
||||||
|
const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt());
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -1245,8 +1287,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isOperator(_owner, _operator, { blockTag: blockHash });
|
const contractResult = await contract.isOperator(_owner, _operator, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsOperator({ blockHash, blockNumber, contractAddress, _owner, _operator, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsOperator({ blockHash, blockNumber, contractAddress, _owner, _operator, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1261,8 +1304,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getUpgradeProposals({ blockTag: blockHash });
|
const contractResult = await contract.getUpgradeProposals({ blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -1288,9 +1332,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getUpgradeProposalCount({ blockTag: blockHash });
|
const contractResult = await contract.getUpgradeProposalCount({ blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -1306,8 +1350,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getDocumentProposals({ blockTag: blockHash });
|
const contractResult = await contract.getDocumentProposals({ blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -1333,9 +1378,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getDocumentProposalCount({ blockTag: blockHash });
|
const contractResult = await contract.getDocumentProposalCount({ blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -1351,8 +1396,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getDocumentMajorities({ blockTag: blockHash });
|
const contractResult = await contract.getDocumentMajorities({ blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -1378,8 +1424,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.hasVotedOnUpgradePoll(_galaxy, _proposal, { blockTag: blockHash });
|
const contractResult = await contract.hasVotedOnUpgradePoll(_galaxy, _proposal, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveHasVotedOnUpgradePoll({ blockHash, blockNumber, contractAddress, _galaxy, _proposal, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveHasVotedOnUpgradePoll({ blockHash, blockNumber, contractAddress, _galaxy, _proposal, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1407,8 +1454,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.hasVotedOnDocumentPoll(_galaxy, _proposal, { blockTag: blockHash });
|
const contractResult = await contract.hasVotedOnDocumentPoll(_galaxy, _proposal, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveHasVotedOnDocumentPoll({ blockHash, blockNumber, contractAddress, _galaxy, _proposal, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveHasVotedOnDocumentPoll({ blockHash, blockNumber, contractAddress, _galaxy, _proposal, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1436,8 +1484,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.findClaim(_whose, _protocol, _claim, { blockTag: blockHash });
|
const contractResult = await contract.findClaim(_whose, _protocol, _claim, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveFindClaim({ blockHash, blockNumber, contractAddress, _whose, _protocol, _claim, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveFindClaim({ blockHash, blockNumber, contractAddress, _whose, _protocol, _claim, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1465,8 +1514,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.supportsInterface(_interfaceId, { blockTag: blockHash });
|
const contractResult = await contract.supportsInterface(_interfaceId, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveSupportsInterface({ blockHash, blockNumber, contractAddress, _interfaceId, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveSupportsInterface({ blockHash, blockNumber, contractAddress, _interfaceId, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1494,9 +1544,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.balanceOf(_owner, { blockTag: blockHash });
|
const contractResult = await contract.balanceOf(_owner, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -1525,8 +1575,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.ownerOf(_tokenId, { blockTag: blockHash });
|
const contractResult = await contract.ownerOf(_tokenId, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveOwnerOf({ blockHash, blockNumber, contractAddress, _tokenId, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveOwnerOf({ blockHash, blockNumber, contractAddress, _tokenId, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1554,8 +1605,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.exists(_tokenId, { blockTag: blockHash });
|
const contractResult = await contract.exists(_tokenId, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveExists({ blockHash, blockNumber, contractAddress, _tokenId, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveExists({ blockHash, blockNumber, contractAddress, _tokenId, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1583,8 +1635,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getApproved(_tokenId, { blockTag: blockHash });
|
const contractResult = await contract.getApproved(_tokenId, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveGetApproved({ blockHash, blockNumber, contractAddress, _tokenId, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveGetApproved({ blockHash, blockNumber, contractAddress, _tokenId, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1612,8 +1665,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.isApprovedForAll(_owner, _operator, { blockTag: blockHash });
|
const contractResult = await contract.isApprovedForAll(_owner, _operator, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveIsApprovedForAll({ blockHash, blockNumber, contractAddress, _owner, _operator, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveIsApprovedForAll({ blockHash, blockNumber, contractAddress, _owner, _operator, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1641,9 +1695,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.totalSupply({ blockTag: blockHash });
|
const contractResult = await contract.totalSupply({ blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -1672,9 +1726,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.tokenOfOwnerByIndex(_owner, _index, { blockTag: blockHash });
|
const contractResult = await contract.tokenOfOwnerByIndex(_owner, _index, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -1703,9 +1757,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.tokenByIndex(_index, { blockTag: blockHash });
|
const contractResult = await contract.tokenByIndex(_index, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -1734,8 +1788,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.name({ blockTag: blockHash });
|
const contractResult = await contract.name({ blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveName({ blockHash, blockNumber, contractAddress, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveName({ blockHash, blockNumber, contractAddress, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1763,8 +1818,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.symbol({ blockTag: blockHash });
|
const contractResult = await contract.symbol({ blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveSymbol({ blockHash, blockNumber, contractAddress, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveSymbol({ blockHash, blockNumber, contractAddress, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1792,8 +1848,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.tokenURI(_tokenId, { blockTag: blockHash });
|
const contractResult = await contract.tokenURI(_tokenId, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveTokenURI({ blockHash, blockNumber, contractAddress, _tokenId, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveTokenURI({ blockHash, blockNumber, contractAddress, _tokenId, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1821,9 +1878,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
let value = await contract.getSpawnLimit(_point, _time, { blockTag: blockHash });
|
const contractResult = await contract.getSpawnLimit(_point, _time, { blockTag: blockHash });
|
||||||
value = value.toString();
|
|
||||||
value = BigInt(value);
|
const value = ethers.BigNumber.from(contractResult).toBigInt();
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
@ -1852,8 +1909,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.canEscapeTo(_point, _sponsor, { blockTag: blockHash });
|
const contractResult = await contract.canEscapeTo(_point, _sponsor, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveCanEscapeTo({ blockHash, blockNumber, contractAddress, _point, _sponsor, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveCanEscapeTo({ blockHash, blockNumber, contractAddress, _point, _sponsor, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1881,8 +1939,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.withdrawLimit(_participant, _batch, { blockTag: blockHash });
|
const contractResult = await contract.withdrawLimit(_participant, _batch, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveWithdrawLimit({ blockHash, blockNumber, contractAddress, _participant, _batch, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveWithdrawLimit({ blockHash, blockNumber, contractAddress, _participant, _batch, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1910,8 +1969,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.verifyBalance(_participant, { blockTag: blockHash });
|
const contractResult = await contract.verifyBalance(_participant, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveVerifyBalance({ blockHash, blockNumber, contractAddress, _participant, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveVerifyBalance({ blockHash, blockNumber, contractAddress, _participant, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1926,8 +1986,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getBatches(_participant, { blockTag: blockHash });
|
const contractResult = await contract.getBatches(_participant, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -1953,8 +2014,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getBatch(_participant, _batch, { blockTag: blockHash });
|
const contractResult = await contract.getBatch(_participant, _batch, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveGetBatch({ blockHash, blockNumber, contractAddress, _participant, _batch, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveGetBatch({ blockHash, blockNumber, contractAddress, _participant, _batch, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -1969,8 +2031,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getWithdrawn(_participant, { blockTag: blockHash });
|
const contractResult = await contract.getWithdrawn(_participant, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -1996,8 +2059,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getWithdrawnFromBatch(_participant, _batch, { blockTag: blockHash });
|
const contractResult = await contract.getWithdrawnFromBatch(_participant, _batch, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveGetWithdrawnFromBatch({ blockHash, blockNumber, contractAddress, _participant, _batch, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveGetWithdrawnFromBatch({ blockHash, blockNumber, contractAddress, _participant, _batch, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -2012,8 +2076,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getForfeited(_participant, { blockTag: blockHash });
|
const contractResult = await contract.getForfeited(_participant, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
@ -2039,8 +2104,9 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.hasForfeitedBatch(_participant, _batch, { blockTag: blockHash });
|
const contractResult = await contract.hasForfeitedBatch(_participant, _batch, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
await this._db.saveHasForfeitedBatch({ blockHash, blockNumber, contractAddress, _participant, _batch, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
await this._db.saveHasForfeitedBatch({ blockHash, blockNumber, contractAddress, _participant, _batch, value: result.value, proof: JSONbigNative.stringify(result.proof) });
|
||||||
@ -2055,7 +2121,29 @@ export class Indexer implements IndexerInterface {
|
|||||||
assert(abi);
|
assert(abi);
|
||||||
|
|
||||||
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
const value = await contract.getRemainingStars(_participant, { blockTag: blockHash });
|
const contractResult = await contract.getRemainingStars(_participant, { blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = contractResult;
|
||||||
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
async getConditionsState (blockHash: string, contractAddress: string): Promise<ValueResult> {
|
||||||
|
log('getConditionsState: db miss, fetching from upstream server');
|
||||||
|
|
||||||
|
const abi = this._abiMap.get(KIND_CONDITIONALSTARRELEASE);
|
||||||
|
assert(abi);
|
||||||
|
|
||||||
|
const contract = new ethers.Contract(contractAddress, abi, this._ethProvider);
|
||||||
|
const contractResult = await contract.getConditionsState({ blockTag: blockHash });
|
||||||
|
|
||||||
|
const value = {
|
||||||
|
value0: contractResult[0],
|
||||||
|
value1: contractResult[1].map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt()),
|
||||||
|
value2: contractResult[2].map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt()),
|
||||||
|
value3: contractResult[3].map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt())
|
||||||
|
};
|
||||||
|
|
||||||
const result: ValueResult = { value };
|
const result: ValueResult = { value };
|
||||||
|
|
||||||
|
@ -90,6 +90,24 @@ export const createResolvers = async (indexerArg: IndexerInterface, eventWatcher
|
|||||||
return indexer.isActive(blockHash, contractAddress, _point);
|
return indexer.isActive(blockHash, contractAddress, _point);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getKeys: (
|
||||||
|
_: any,
|
||||||
|
{ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint },
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
__: any,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
info: GraphQLResolveInfo
|
||||||
|
): Promise<ValueResult> => {
|
||||||
|
log('getKeys', blockHash, contractAddress, _point);
|
||||||
|
gqlTotalQueryCount.inc(1);
|
||||||
|
gqlQueryCount.labels('getKeys').inc(1);
|
||||||
|
|
||||||
|
// Set cache-control hints
|
||||||
|
// setGQLCacheHints(info, {}, gqlCacheConfig);
|
||||||
|
|
||||||
|
return indexer.getKeys(blockHash, contractAddress, _point);
|
||||||
|
},
|
||||||
|
|
||||||
getKeyRevisionNumber: (
|
getKeyRevisionNumber: (
|
||||||
_: any,
|
_: any,
|
||||||
{ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint },
|
{ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint },
|
||||||
@ -1404,6 +1422,24 @@ export const createResolvers = async (indexerArg: IndexerInterface, eventWatcher
|
|||||||
return indexer.getRemainingStars(blockHash, contractAddress, _participant);
|
return indexer.getRemainingStars(blockHash, contractAddress, _participant);
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getConditionsState: (
|
||||||
|
_: any,
|
||||||
|
{ blockHash, contractAddress }: { blockHash: string, contractAddress: string },
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
__: any,
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||||
|
info: GraphQLResolveInfo
|
||||||
|
): Promise<ValueResult> => {
|
||||||
|
log('getConditionsState', blockHash, contractAddress);
|
||||||
|
gqlTotalQueryCount.inc(1);
|
||||||
|
gqlQueryCount.labels('getConditionsState').inc(1);
|
||||||
|
|
||||||
|
// Set cache-control hints
|
||||||
|
// setGQLCacheHints(info, {}, gqlCacheConfig);
|
||||||
|
|
||||||
|
return indexer.getConditionsState(blockHash, contractAddress);
|
||||||
|
},
|
||||||
|
|
||||||
events: async (_: any, { blockHash, contractAddress, name }: { blockHash: string, contractAddress: string, name?: string }) => {
|
events: async (_: any, { blockHash, contractAddress, name }: { blockHash: string, contractAddress: string, name?: string }) => {
|
||||||
log('events', blockHash, contractAddress, name);
|
log('events', blockHash, contractAddress, name);
|
||||||
gqlTotalQueryCount.inc(1);
|
gqlTotalQueryCount.inc(1);
|
||||||
|
@ -66,6 +66,18 @@ type ResultBoolean {
|
|||||||
proof: Proof
|
proof: Proof
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ResultGetKeysType {
|
||||||
|
value: GetKeysType!
|
||||||
|
proof: Proof
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetKeysType {
|
||||||
|
value0: String!
|
||||||
|
value1: String!
|
||||||
|
value2: BigInt!
|
||||||
|
value3: BigInt!
|
||||||
|
}
|
||||||
|
|
||||||
type ResultBigInt {
|
type ResultBigInt {
|
||||||
value: BigInt!
|
value: BigInt!
|
||||||
proof: Proof
|
proof: Proof
|
||||||
@ -101,6 +113,18 @@ type ResultBooleanArray {
|
|||||||
proof: Proof
|
proof: Proof
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ResultGetConditionsStateType {
|
||||||
|
value: GetConditionsStateType!
|
||||||
|
proof: Proof
|
||||||
|
}
|
||||||
|
|
||||||
|
type GetConditionsStateType {
|
||||||
|
value0: [String!]!
|
||||||
|
value1: [BigInt!]!
|
||||||
|
value2: [BigInt!]!
|
||||||
|
value3: [BigInt!]!
|
||||||
|
}
|
||||||
|
|
||||||
type SyncStatus {
|
type SyncStatus {
|
||||||
latestIndexedBlockHash: String!
|
latestIndexedBlockHash: String!
|
||||||
latestIndexedBlockNumber: Int!
|
latestIndexedBlockNumber: Int!
|
||||||
@ -120,6 +144,7 @@ type Query {
|
|||||||
events(blockHash: String!, contractAddress: String!, name: String): [ResultEvent!]
|
events(blockHash: String!, contractAddress: String!, name: String): [ResultEvent!]
|
||||||
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!): [ResultEvent!]
|
eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!): [ResultEvent!]
|
||||||
isActive(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean!
|
isActive(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean!
|
||||||
|
getKeys(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultGetKeysType!
|
||||||
getKeyRevisionNumber(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBigInt!
|
getKeyRevisionNumber(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBigInt!
|
||||||
hasBeenLinked(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean!
|
hasBeenLinked(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean!
|
||||||
isLive(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean!
|
isLive(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean!
|
||||||
@ -193,6 +218,7 @@ type Query {
|
|||||||
getForfeited(blockHash: String!, contractAddress: String!, _participant: String!): ResultBooleanArray!
|
getForfeited(blockHash: String!, contractAddress: String!, _participant: String!): ResultBooleanArray!
|
||||||
hasForfeitedBatch(blockHash: String!, contractAddress: String!, _participant: String!, _batch: Int!): ResultBoolean!
|
hasForfeitedBatch(blockHash: String!, contractAddress: String!, _participant: String!, _batch: Int!): ResultBoolean!
|
||||||
getRemainingStars(blockHash: String!, contractAddress: String!, _participant: String!): ResultIntArray!
|
getRemainingStars(blockHash: String!, contractAddress: String!, _participant: String!): ResultIntArray!
|
||||||
|
getConditionsState(blockHash: String!, contractAddress: String!): ResultGetConditionsStateType!
|
||||||
getSyncStatus: SyncStatus
|
getSyncStatus: SyncStatus
|
||||||
getStateByCID(cid: String!): ResultState
|
getStateByCID(cid: String!): ResultState
|
||||||
getState(blockHash: String!, contractAddress: String!, kind: String): ResultState
|
getState(blockHash: String!, contractAddress: String!, kind: String): ResultState
|
||||||
|
@ -39,10 +39,10 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.3.19",
|
"@apollo/client": "^3.3.19",
|
||||||
"@ethersproject/providers": "^5.4.4",
|
"@ethersproject/providers": "^5.4.4",
|
||||||
"@cerc-io/cli": "^0.2.39",
|
"@cerc-io/cli": "^0.2.40",
|
||||||
"@cerc-io/ipld-eth-client": "^0.2.39",
|
"@cerc-io/ipld-eth-client": "^0.2.40",
|
||||||
"@cerc-io/solidity-mapper": "^0.2.39",
|
"@cerc-io/solidity-mapper": "^0.2.40",
|
||||||
"@cerc-io/util": "^0.2.39",
|
"@cerc-io/util": "^0.2.40",
|
||||||
"apollo-type-bigint": "^0.1.3",
|
"apollo-type-bigint": "^0.1.3",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"ethers": "^5.4.4",
|
"ethers": "^5.4.4",
|
||||||
|
@ -39,10 +39,10 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.3.19",
|
"@apollo/client": "^3.3.19",
|
||||||
"@ethersproject/providers": "^5.4.4",
|
"@ethersproject/providers": "^5.4.4",
|
||||||
"@cerc-io/cli": "^0.2.39",
|
"@cerc-io/cli": "^0.2.40",
|
||||||
"@cerc-io/ipld-eth-client": "^0.2.39",
|
"@cerc-io/ipld-eth-client": "^0.2.40",
|
||||||
"@cerc-io/solidity-mapper": "^0.2.39",
|
"@cerc-io/solidity-mapper": "^0.2.40",
|
||||||
"@cerc-io/util": "^0.2.39",
|
"@cerc-io/util": "^0.2.40",
|
||||||
"apollo-type-bigint": "^0.1.3",
|
"apollo-type-bigint": "^0.1.3",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"ethers": "^5.4.4",
|
"ethers": "^5.4.4",
|
||||||
|
@ -39,10 +39,10 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.3.19",
|
"@apollo/client": "^3.3.19",
|
||||||
"@ethersproject/providers": "^5.4.4",
|
"@ethersproject/providers": "^5.4.4",
|
||||||
"@cerc-io/cli": "^0.2.39",
|
"@cerc-io/cli": "^0.2.40",
|
||||||
"@cerc-io/ipld-eth-client": "^0.2.39",
|
"@cerc-io/ipld-eth-client": "^0.2.40",
|
||||||
"@cerc-io/solidity-mapper": "^0.2.39",
|
"@cerc-io/solidity-mapper": "^0.2.40",
|
||||||
"@cerc-io/util": "^0.2.39",
|
"@cerc-io/util": "^0.2.40",
|
||||||
"apollo-type-bigint": "^0.1.3",
|
"apollo-type-bigint": "^0.1.3",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"ethers": "^5.4.4",
|
"ethers": "^5.4.4",
|
||||||
|
@ -39,10 +39,10 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@apollo/client": "^3.3.19",
|
"@apollo/client": "^3.3.19",
|
||||||
"@ethersproject/providers": "^5.4.4",
|
"@ethersproject/providers": "^5.4.4",
|
||||||
"@cerc-io/cli": "^0.2.39",
|
"@cerc-io/cli": "^0.2.40",
|
||||||
"@cerc-io/ipld-eth-client": "^0.2.39",
|
"@cerc-io/ipld-eth-client": "^0.2.40",
|
||||||
"@cerc-io/solidity-mapper": "^0.2.39",
|
"@cerc-io/solidity-mapper": "^0.2.40",
|
||||||
"@cerc-io/util": "^0.2.39",
|
"@cerc-io/util": "^0.2.40",
|
||||||
"apollo-type-bigint": "^0.1.3",
|
"apollo-type-bigint": "^0.1.3",
|
||||||
"debug": "^4.3.1",
|
"debug": "^4.3.1",
|
||||||
"ethers": "^5.4.4",
|
"ethers": "^5.4.4",
|
||||||
|
56
yarn.lock
56
yarn.lock
@ -183,10 +183,10 @@
|
|||||||
chalk "^2.0.0"
|
chalk "^2.0.0"
|
||||||
js-tokens "^4.0.0"
|
js-tokens "^4.0.0"
|
||||||
|
|
||||||
"@cerc-io/cache@^0.2.39":
|
"@cerc-io/cache@^0.2.40":
|
||||||
version "0.2.39"
|
version "0.2.40"
|
||||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fcache/-/0.2.39/cache-0.2.39.tgz#71c78a035d03dda99fdabfc82be89ba493e928a8"
|
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fcache/-/0.2.40/cache-0.2.40.tgz#b44cc8323d1e1a7f6761efdca61b00d4f337823e"
|
||||||
integrity sha512-6Esz687riJRLoHwiso0Qb78iRmL7SjcVjXuxb/VCcAWxHWT6eE5+7GFCXT1gdRQ/A+U/gztaJTjoTcCSr88Ujw==
|
integrity sha512-tQ5kYLTpwX/40hpNg1eEnojHtq2dl0nfkW78+lFUXiqtjc+sVFvO6nIqKLI8NBkeCMWFg3KyNDmv86xn/0mPgw==
|
||||||
dependencies:
|
dependencies:
|
||||||
canonical-json "^0.0.4"
|
canonical-json "^0.0.4"
|
||||||
debug "^4.3.1"
|
debug "^4.3.1"
|
||||||
@ -194,13 +194,13 @@
|
|||||||
fs-extra "^10.0.0"
|
fs-extra "^10.0.0"
|
||||||
level "^7.0.0"
|
level "^7.0.0"
|
||||||
|
|
||||||
"@cerc-io/cli@^0.2.39":
|
"@cerc-io/cli@^0.2.40":
|
||||||
version "0.2.39"
|
version "0.2.40"
|
||||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fcli/-/0.2.39/cli-0.2.39.tgz#3467ce7d34f1aa46e4c849cfff728b558395e905"
|
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fcli/-/0.2.40/cli-0.2.40.tgz#9116f1e190910df4aa1480e9ae28380ff7d59e4b"
|
||||||
integrity sha512-zoRfuQHc2TAcFU4Qoxb0fUMRL/2jzwbkgT/ltifPHSO5PJiojiFpsv0KYVn89k6dsFd5C5x124MemjWW0XSXWQ==
|
integrity sha512-Sxxy86SjSb0QgCbEHdr9xFwhbfGEqv+lG3HBRizCobaIYGZveIWCFU34tzpQJCoEYorRJybkC1uqsJDDCUMCAg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@cerc-io/peer" "^0.2.39"
|
"@cerc-io/peer" "^0.2.40"
|
||||||
"@cerc-io/util" "^0.2.39"
|
"@cerc-io/util" "^0.2.40"
|
||||||
"@ethersproject/providers" "^5.4.4"
|
"@ethersproject/providers" "^5.4.4"
|
||||||
"@graphql-tools/utils" "^9.1.1"
|
"@graphql-tools/utils" "^9.1.1"
|
||||||
"@ipld/dag-cbor" "^8.0.0"
|
"@ipld/dag-cbor" "^8.0.0"
|
||||||
@ -213,13 +213,13 @@
|
|||||||
typeorm "^0.2.32"
|
typeorm "^0.2.32"
|
||||||
yargs "^17.0.1"
|
yargs "^17.0.1"
|
||||||
|
|
||||||
"@cerc-io/ipld-eth-client@^0.2.39":
|
"@cerc-io/ipld-eth-client@^0.2.40":
|
||||||
version "0.2.39"
|
version "0.2.40"
|
||||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fipld-eth-client/-/0.2.39/ipld-eth-client-0.2.39.tgz#db542f7b59badb74ecd076f3b66638f8c61093d9"
|
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fipld-eth-client/-/0.2.40/ipld-eth-client-0.2.40.tgz#aa3a01af6dcb6591388616d9c7e55ce721a44621"
|
||||||
integrity sha512-rZQn0WZ7GYo2btLeNYrR7PX6PeKxe4Cxv4r7LVtYtCv7Q8sOb04Qod3KZKxuHRnP5YIkisdeppv3ZsEVzMR94A==
|
integrity sha512-Oc+WkdeHkLG9fk7Uwwa4YHqBreYAEWu9CnRmqWm9sMwi48bnSEyDDzpuzUvg+R8RenSLlqaH/d9cBqhN9bInKw==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@apollo/client" "^3.7.1"
|
"@apollo/client" "^3.7.1"
|
||||||
"@cerc-io/cache" "^0.2.39"
|
"@cerc-io/cache" "^0.2.40"
|
||||||
cross-fetch "^3.1.4"
|
cross-fetch "^3.1.4"
|
||||||
debug "^4.3.1"
|
debug "^4.3.1"
|
||||||
ethers "^5.4.4"
|
ethers "^5.4.4"
|
||||||
@ -301,10 +301,10 @@
|
|||||||
wherearewe "^2.0.0"
|
wherearewe "^2.0.0"
|
||||||
xsalsa20 "^1.1.0"
|
xsalsa20 "^1.1.0"
|
||||||
|
|
||||||
"@cerc-io/peer@^0.2.39":
|
"@cerc-io/peer@^0.2.40":
|
||||||
version "0.2.39"
|
version "0.2.40"
|
||||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fpeer/-/0.2.39/peer-0.2.39.tgz#2cff14a9fff85d8c77ba6d14d677250cf03d28cf"
|
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fpeer/-/0.2.40/peer-0.2.40.tgz#ba965079c2006195c92f5457e5976a8af54391c3"
|
||||||
integrity sha512-hfgm+1IZ70EnGfJcbLXJNwiyH/kphSRNarNbFNe0swC4PMl0oH4orraHQU/wRVJhkBcJp5qqnSM6KXauVA93Ig==
|
integrity sha512-PFYNDqabyAZYdpOh5ZGLXR/v3jqSELLMHkU1lVFCUOGON8awOeXU/RJlMEt+v6BJjPo5Y7y60et4sUb7fo1MfA==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@cerc-io/libp2p" "0.42.2-laconic-0.1.3"
|
"@cerc-io/libp2p" "0.42.2-laconic-0.1.3"
|
||||||
"@cerc-io/prometheus-metrics" "1.1.4"
|
"@cerc-io/prometheus-metrics" "1.1.4"
|
||||||
@ -342,20 +342,20 @@
|
|||||||
it-stream-types "^1.0.4"
|
it-stream-types "^1.0.4"
|
||||||
promjs "^0.4.2"
|
promjs "^0.4.2"
|
||||||
|
|
||||||
"@cerc-io/solidity-mapper@^0.2.39":
|
"@cerc-io/solidity-mapper@^0.2.40":
|
||||||
version "0.2.39"
|
version "0.2.40"
|
||||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fsolidity-mapper/-/0.2.39/solidity-mapper-0.2.39.tgz#5422f92915887804525ac2343856ebed1bb7a853"
|
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Fsolidity-mapper/-/0.2.40/solidity-mapper-0.2.40.tgz#c4263f86cb3f1f2950118d348e3a9df39fcc861c"
|
||||||
integrity sha512-O7/nQ95pdofMdC/yZyGoHPmHME2yB+h9T4Ua/+pKhfg6SgBpGtReMSSFaeeJEKxWHzetMbiwJPRCzeYtVYFeag==
|
integrity sha512-1gnBxlqaBSnHYlKzindV/lLc+UdJOjf2ytyYqxlT70w1444U39IQ18AWHlykMDCjgScczDTSNobFodQIdwwqNQ==
|
||||||
dependencies:
|
dependencies:
|
||||||
dotenv "^10.0.0"
|
dotenv "^10.0.0"
|
||||||
|
|
||||||
"@cerc-io/util@^0.2.39":
|
"@cerc-io/util@^0.2.40":
|
||||||
version "0.2.39"
|
version "0.2.40"
|
||||||
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Futil/-/0.2.39/util-0.2.39.tgz#7a807756f6007b331066206f7f338cae7e903218"
|
resolved "https://git.vdb.to/api/packages/cerc-io/npm/%40cerc-io%2Futil/-/0.2.40/util-0.2.40.tgz#5ad35b3c57dc3c0997141d3bb82ff2f86046fb9e"
|
||||||
integrity sha512-koJr66RFP64bOkWYfZ1Cj+1YkAGfoW8q+toTtiOo/hUKhEusqUIxIRVG5raXN4KaoruCjH8SMoeWcVMr2sw16w==
|
integrity sha512-PeGYiEd7XEy3tj4YMAku0Jm8bNEeaTcntF0U8Cx1Vo9XntJls34lrwKiz+IU+Rt/sEwk0U0sQrKtgqZzjQ6Opg==
|
||||||
dependencies:
|
dependencies:
|
||||||
"@apollo/utils.keyvaluecache" "^1.0.1"
|
"@apollo/utils.keyvaluecache" "^1.0.1"
|
||||||
"@cerc-io/solidity-mapper" "^0.2.39"
|
"@cerc-io/solidity-mapper" "^0.2.40"
|
||||||
"@ethersproject/providers" "^5.4.4"
|
"@ethersproject/providers" "^5.4.4"
|
||||||
"@graphql-tools/schema" "^9.0.10"
|
"@graphql-tools/schema" "^9.0.10"
|
||||||
"@graphql-tools/utils" "^9.1.1"
|
"@graphql-tools/utils" "^9.1.1"
|
||||||
|
Loading…
Reference in New Issue
Block a user