From 1f45671ebb6cfdc2bcf7d182a655020fed32e634 Mon Sep 17 00:00:00 2001 From: nabarun Date: Wed, 26 Apr 2023 18:37:41 +0530 Subject: [PATCH] Remove methods from imported contracts that are not inherited in Censures --- packages/censures-watcher/.husky/pre-commit | 0 packages/censures-watcher/src/client.ts | 315 ----- packages/censures-watcher/src/database.ts | 610 +-------- .../src/gql/queries/canManage.gql | 8 - .../src/gql/queries/canSpawnAs.gql | 8 - .../src/gql/queries/canTransfer.gql | 8 - .../src/gql/queries/canVoteAs.gql | 8 - .../src/gql/queries/getContinuityNumber.gql | 8 - .../src/gql/queries/getEscapeRequest.gql | 8 - .../src/gql/queries/getEscapeRequests.gql | 8 - .../gql/queries/getEscapeRequestsCount.gql | 8 - .../src/gql/queries/getKeyRevisionNumber.gql | 8 - .../src/gql/queries/getManagementProxy.gql | 8 - .../src/gql/queries/getManagerFor.gql | 8 - .../src/gql/queries/getManagerForCount.gql | 8 - .../src/gql/queries/getOwnedPointAtIndex.gql | 8 - .../src/gql/queries/getOwnedPointCount.gql | 8 - .../src/gql/queries/getOwnedPoints.gql | 8 - .../src/gql/queries/getOwner.gql | 8 - .../src/gql/queries/getSpawnCount.gql | 8 - .../src/gql/queries/getSpawnProxy.gql | 8 - .../src/gql/queries/getSpawned.gql | 8 - .../src/gql/queries/getSpawningFor.gql | 8 - .../src/gql/queries/getSpawningForCount.gql | 8 - .../src/gql/queries/getSponsor.gql | 8 - .../src/gql/queries/getSponsoring.gql | 8 - .../src/gql/queries/getSponsoringCount.gql | 8 - .../src/gql/queries/getTransferProxy.gql | 8 - .../src/gql/queries/getTransferringFor.gql | 8 - .../gql/queries/getTransferringForCount.gql | 8 - .../src/gql/queries/getVotingFor.gql | 8 - .../src/gql/queries/getVotingForCount.gql | 8 - .../src/gql/queries/getVotingProxy.gql | 8 - .../src/gql/queries/hasBeenLinked.gql | 8 - .../src/gql/queries/hasSponsor.gql | 8 - .../censures-watcher/src/gql/queries/index.ts | 43 - .../src/gql/queries/isActive.gql | 8 - .../src/gql/queries/isEscaping.gql | 8 - .../src/gql/queries/isLive.gql | 8 - .../src/gql/queries/isManagementProxy.gql | 8 - .../src/gql/queries/isOperator.gql | 8 - .../src/gql/queries/isOwner.gql | 8 - .../src/gql/queries/isRequestingEscapeTo.gql | 8 - .../src/gql/queries/isSpawnProxy.gql | 8 - .../src/gql/queries/isSponsor.gql | 8 - .../src/gql/queries/isTransferProxy.gql | 8 - .../src/gql/queries/isVotingProxy.gql | 8 - packages/censures-watcher/src/indexer.ts | 1180 +---------------- packages/censures-watcher/src/resolvers.ts | 774 ----------- packages/censures-watcher/src/schema.gql | 53 - 50 files changed, 11 insertions(+), 3308 deletions(-) mode change 100644 => 100755 packages/censures-watcher/.husky/pre-commit delete mode 100644 packages/censures-watcher/src/gql/queries/canManage.gql delete mode 100644 packages/censures-watcher/src/gql/queries/canSpawnAs.gql delete mode 100644 packages/censures-watcher/src/gql/queries/canTransfer.gql delete mode 100644 packages/censures-watcher/src/gql/queries/canVoteAs.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getContinuityNumber.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getEscapeRequest.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getEscapeRequests.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getEscapeRequestsCount.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getKeyRevisionNumber.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getManagementProxy.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getManagerFor.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getManagerForCount.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getOwnedPointAtIndex.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getOwnedPointCount.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getOwnedPoints.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getOwner.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getSpawnCount.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getSpawnProxy.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getSpawned.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getSpawningFor.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getSpawningForCount.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getSponsor.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getSponsoring.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getSponsoringCount.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getTransferProxy.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getTransferringFor.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getTransferringForCount.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getVotingFor.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getVotingForCount.gql delete mode 100644 packages/censures-watcher/src/gql/queries/getVotingProxy.gql delete mode 100644 packages/censures-watcher/src/gql/queries/hasBeenLinked.gql delete mode 100644 packages/censures-watcher/src/gql/queries/hasSponsor.gql delete mode 100644 packages/censures-watcher/src/gql/queries/isActive.gql delete mode 100644 packages/censures-watcher/src/gql/queries/isEscaping.gql delete mode 100644 packages/censures-watcher/src/gql/queries/isLive.gql delete mode 100644 packages/censures-watcher/src/gql/queries/isManagementProxy.gql delete mode 100644 packages/censures-watcher/src/gql/queries/isOperator.gql delete mode 100644 packages/censures-watcher/src/gql/queries/isOwner.gql delete mode 100644 packages/censures-watcher/src/gql/queries/isRequestingEscapeTo.gql delete mode 100644 packages/censures-watcher/src/gql/queries/isSpawnProxy.gql delete mode 100644 packages/censures-watcher/src/gql/queries/isSponsor.gql delete mode 100644 packages/censures-watcher/src/gql/queries/isTransferProxy.gql delete mode 100644 packages/censures-watcher/src/gql/queries/isVotingProxy.gql diff --git a/packages/censures-watcher/.husky/pre-commit b/packages/censures-watcher/.husky/pre-commit old mode 100644 new mode 100755 diff --git a/packages/censures-watcher/src/client.ts b/packages/censures-watcher/src/client.ts index 5ff346a..fe694f8 100644 --- a/packages/censures-watcher/src/client.ts +++ b/packages/censures-watcher/src/client.ts @@ -17,321 +17,6 @@ export class Client { this._client = new GraphQLClient(config); } - async getIsActive (blockHash: string, contractAddress: string, _point: bigint): Promise { - const { isActive } = await this._client.query( - gql(queries.isActive), - { blockHash, contractAddress, _point } - ); - - return isActive; - } - - async getGetKeyRevisionNumber (blockHash: string, contractAddress: string, _point: bigint): Promise { - const { getKeyRevisionNumber } = await this._client.query( - gql(queries.getKeyRevisionNumber), - { blockHash, contractAddress, _point } - ); - - return getKeyRevisionNumber; - } - - async getHasBeenLinked (blockHash: string, contractAddress: string, _point: bigint): Promise { - const { hasBeenLinked } = await this._client.query( - gql(queries.hasBeenLinked), - { blockHash, contractAddress, _point } - ); - - return hasBeenLinked; - } - - async getIsLive (blockHash: string, contractAddress: string, _point: bigint): Promise { - const { isLive } = await this._client.query( - gql(queries.isLive), - { blockHash, contractAddress, _point } - ); - - return isLive; - } - - async getGetContinuityNumber (blockHash: string, contractAddress: string, _point: bigint): Promise { - const { getContinuityNumber } = await this._client.query( - gql(queries.getContinuityNumber), - { blockHash, contractAddress, _point } - ); - - return getContinuityNumber; - } - - async getGetSpawnCount (blockHash: string, contractAddress: string, _point: bigint): Promise { - const { getSpawnCount } = await this._client.query( - gql(queries.getSpawnCount), - { blockHash, contractAddress, _point } - ); - - return getSpawnCount; - } - - async getHasSponsor (blockHash: string, contractAddress: string, _point: bigint): Promise { - const { hasSponsor } = await this._client.query( - gql(queries.hasSponsor), - { blockHash, contractAddress, _point } - ); - - return hasSponsor; - } - - async getGetSponsor (blockHash: string, contractAddress: string, _point: bigint): Promise { - const { getSponsor } = await this._client.query( - gql(queries.getSponsor), - { blockHash, contractAddress, _point } - ); - - return getSponsor; - } - - async getIsSponsor (blockHash: string, contractAddress: string, _point: bigint, _sponsor: bigint): Promise { - const { isSponsor } = await this._client.query( - gql(queries.isSponsor), - { blockHash, contractAddress, _point, _sponsor } - ); - - return isSponsor; - } - - async getGetSponsoringCount (blockHash: string, contractAddress: string, _sponsor: bigint): Promise { - const { getSponsoringCount } = await this._client.query( - gql(queries.getSponsoringCount), - { blockHash, contractAddress, _sponsor } - ); - - return getSponsoringCount; - } - - async getIsEscaping (blockHash: string, contractAddress: string, _point: bigint): Promise { - const { isEscaping } = await this._client.query( - gql(queries.isEscaping), - { blockHash, contractAddress, _point } - ); - - return isEscaping; - } - - async getGetEscapeRequest (blockHash: string, contractAddress: string, _point: bigint): Promise { - const { getEscapeRequest } = await this._client.query( - gql(queries.getEscapeRequest), - { blockHash, contractAddress, _point } - ); - - return getEscapeRequest; - } - - async getIsRequestingEscapeTo (blockHash: string, contractAddress: string, _point: bigint, _sponsor: bigint): Promise { - const { isRequestingEscapeTo } = await this._client.query( - gql(queries.isRequestingEscapeTo), - { blockHash, contractAddress, _point, _sponsor } - ); - - return isRequestingEscapeTo; - } - - async getGetEscapeRequestsCount (blockHash: string, contractAddress: string, _sponsor: bigint): Promise { - const { getEscapeRequestsCount } = await this._client.query( - gql(queries.getEscapeRequestsCount), - { blockHash, contractAddress, _sponsor } - ); - - return getEscapeRequestsCount; - } - - async getGetOwner (blockHash: string, contractAddress: string, _point: bigint): Promise { - const { getOwner } = await this._client.query( - gql(queries.getOwner), - { blockHash, contractAddress, _point } - ); - - return getOwner; - } - - async getIsOwner (blockHash: string, contractAddress: string, _point: bigint, _address: string): Promise { - const { isOwner } = await this._client.query( - gql(queries.isOwner), - { blockHash, contractAddress, _point, _address } - ); - - return isOwner; - } - - async getGetOwnedPointCount (blockHash: string, contractAddress: string, _whose: string): Promise { - const { getOwnedPointCount } = await this._client.query( - gql(queries.getOwnedPointCount), - { blockHash, contractAddress, _whose } - ); - - return getOwnedPointCount; - } - - async getGetOwnedPointAtIndex (blockHash: string, contractAddress: string, _whose: string, _index: bigint): Promise { - const { getOwnedPointAtIndex } = await this._client.query( - gql(queries.getOwnedPointAtIndex), - { blockHash, contractAddress, _whose, _index } - ); - - return getOwnedPointAtIndex; - } - - async getGetManagementProxy (blockHash: string, contractAddress: string, _point: bigint): Promise { - const { getManagementProxy } = await this._client.query( - gql(queries.getManagementProxy), - { blockHash, contractAddress, _point } - ); - - return getManagementProxy; - } - - async getIsManagementProxy (blockHash: string, contractAddress: string, _point: bigint, _proxy: string): Promise { - const { isManagementProxy } = await this._client.query( - gql(queries.isManagementProxy), - { blockHash, contractAddress, _point, _proxy } - ); - - return isManagementProxy; - } - - async getCanManage (blockHash: string, contractAddress: string, _point: bigint, _who: string): Promise { - const { canManage } = await this._client.query( - gql(queries.canManage), - { blockHash, contractAddress, _point, _who } - ); - - return canManage; - } - - async getGetManagerForCount (blockHash: string, contractAddress: string, _proxy: string): Promise { - const { getManagerForCount } = await this._client.query( - gql(queries.getManagerForCount), - { blockHash, contractAddress, _proxy } - ); - - return getManagerForCount; - } - - async getGetSpawnProxy (blockHash: string, contractAddress: string, _point: bigint): Promise { - const { getSpawnProxy } = await this._client.query( - gql(queries.getSpawnProxy), - { blockHash, contractAddress, _point } - ); - - return getSpawnProxy; - } - - async getIsSpawnProxy (blockHash: string, contractAddress: string, _point: bigint, _proxy: string): Promise { - const { isSpawnProxy } = await this._client.query( - gql(queries.isSpawnProxy), - { blockHash, contractAddress, _point, _proxy } - ); - - return isSpawnProxy; - } - - async getCanSpawnAs (blockHash: string, contractAddress: string, _point: bigint, _who: string): Promise { - const { canSpawnAs } = await this._client.query( - gql(queries.canSpawnAs), - { blockHash, contractAddress, _point, _who } - ); - - return canSpawnAs; - } - - async getGetSpawningForCount (blockHash: string, contractAddress: string, _proxy: string): Promise { - const { getSpawningForCount } = await this._client.query( - gql(queries.getSpawningForCount), - { blockHash, contractAddress, _proxy } - ); - - return getSpawningForCount; - } - - async getGetVotingProxy (blockHash: string, contractAddress: string, _point: bigint): Promise { - const { getVotingProxy } = await this._client.query( - gql(queries.getVotingProxy), - { blockHash, contractAddress, _point } - ); - - return getVotingProxy; - } - - async getIsVotingProxy (blockHash: string, contractAddress: string, _point: bigint, _proxy: string): Promise { - const { isVotingProxy } = await this._client.query( - gql(queries.isVotingProxy), - { blockHash, contractAddress, _point, _proxy } - ); - - return isVotingProxy; - } - - async getCanVoteAs (blockHash: string, contractAddress: string, _point: bigint, _who: string): Promise { - const { canVoteAs } = await this._client.query( - gql(queries.canVoteAs), - { blockHash, contractAddress, _point, _who } - ); - - return canVoteAs; - } - - async getGetVotingForCount (blockHash: string, contractAddress: string, _proxy: string): Promise { - const { getVotingForCount } = await this._client.query( - gql(queries.getVotingForCount), - { blockHash, contractAddress, _proxy } - ); - - return getVotingForCount; - } - - async getGetTransferProxy (blockHash: string, contractAddress: string, _point: bigint): Promise { - const { getTransferProxy } = await this._client.query( - gql(queries.getTransferProxy), - { blockHash, contractAddress, _point } - ); - - return getTransferProxy; - } - - async getIsTransferProxy (blockHash: string, contractAddress: string, _point: bigint, _proxy: string): Promise { - const { isTransferProxy } = await this._client.query( - gql(queries.isTransferProxy), - { blockHash, contractAddress, _point, _proxy } - ); - - return isTransferProxy; - } - - async getCanTransfer (blockHash: string, contractAddress: string, _point: bigint, _who: string): Promise { - const { canTransfer } = await this._client.query( - gql(queries.canTransfer), - { blockHash, contractAddress, _point, _who } - ); - - return canTransfer; - } - - async getGetTransferringForCount (blockHash: string, contractAddress: string, _proxy: string): Promise { - const { getTransferringForCount } = await this._client.query( - gql(queries.getTransferringForCount), - { blockHash, contractAddress, _proxy } - ); - - return getTransferringForCount; - } - - async getIsOperator (blockHash: string, contractAddress: string, _owner: string, _operator: string): Promise { - const { isOperator } = await this._client.query( - gql(queries.isOperator), - { blockHash, contractAddress, _owner, _operator } - ); - - return isOperator; - } - async getGetCensuringCount (blockHash: string, contractAddress: string, _whose: number): Promise { const { getCensuringCount } = await this._client.query( gql(queries.getCensuringCount), diff --git a/packages/censures-watcher/src/database.ts b/packages/censures-watcher/src/database.ts index 562a618..b5cdef5 100644 --- a/packages/censures-watcher/src/database.ts +++ b/packages/censures-watcher/src/database.ts @@ -20,45 +20,10 @@ import { SyncStatus } from './entity/SyncStatus'; import { StateSyncStatus } from './entity/StateSyncStatus'; import { BlockProgress } from './entity/BlockProgress'; import { State } from './entity/State'; -import { IsActive } from './entity/IsActive'; -import { GetKeyRevisionNumber } from './entity/GetKeyRevisionNumber'; -import { HasBeenLinked } from './entity/HasBeenLinked'; -import { IsLive } from './entity/IsLive'; -import { GetContinuityNumber } from './entity/GetContinuityNumber'; -import { GetSpawnCount } from './entity/GetSpawnCount'; -import { HasSponsor } from './entity/HasSponsor'; -import { GetSponsor } from './entity/GetSponsor'; -import { IsSponsor } from './entity/IsSponsor'; -import { GetSponsoringCount } from './entity/GetSponsoringCount'; -import { IsEscaping } from './entity/IsEscaping'; -import { GetEscapeRequest } from './entity/GetEscapeRequest'; -import { IsRequestingEscapeTo } from './entity/IsRequestingEscapeTo'; -import { GetEscapeRequestsCount } from './entity/GetEscapeRequestsCount'; -import { GetOwner } from './entity/GetOwner'; -import { IsOwner } from './entity/IsOwner'; -import { GetOwnedPointCount } from './entity/GetOwnedPointCount'; -import { GetOwnedPointAtIndex } from './entity/GetOwnedPointAtIndex'; -import { GetManagementProxy } from './entity/GetManagementProxy'; -import { IsManagementProxy } from './entity/IsManagementProxy'; -import { CanManage } from './entity/CanManage'; -import { GetManagerForCount } from './entity/GetManagerForCount'; -import { GetSpawnProxy } from './entity/GetSpawnProxy'; -import { IsSpawnProxy } from './entity/IsSpawnProxy'; -import { CanSpawnAs } from './entity/CanSpawnAs'; -import { GetSpawningForCount } from './entity/GetSpawningForCount'; -import { GetVotingProxy } from './entity/GetVotingProxy'; -import { IsVotingProxy } from './entity/IsVotingProxy'; -import { CanVoteAs } from './entity/CanVoteAs'; -import { GetVotingForCount } from './entity/GetVotingForCount'; -import { GetTransferProxy } from './entity/GetTransferProxy'; -import { IsTransferProxy } from './entity/IsTransferProxy'; -import { CanTransfer } from './entity/CanTransfer'; -import { GetTransferringForCount } from './entity/GetTransferringForCount'; -import { IsOperator } from './entity/IsOperator'; import { GetCensuringCount } from './entity/GetCensuringCount'; import { GetCensuredByCount } from './entity/GetCensuredByCount'; -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, GetCensuringCount, GetCensuredByCount]; +export const ENTITIES = [GetCensuringCount, GetCensuredByCount]; export class Database implements DatabaseInterface { _config: ConnectionOptions; @@ -91,334 +56,6 @@ export class Database implements DatabaseInterface { return this._baseDatabase.close(); } - async getIsActive ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise { - return this._conn.getRepository(IsActive) - .findOne({ - blockHash, - contractAddress, - _point - }); - } - - async getGetKeyRevisionNumber ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise { - return this._conn.getRepository(GetKeyRevisionNumber) - .findOne({ - blockHash, - contractAddress, - _point - }); - } - - async getHasBeenLinked ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise { - return this._conn.getRepository(HasBeenLinked) - .findOne({ - blockHash, - contractAddress, - _point - }); - } - - async getIsLive ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise { - return this._conn.getRepository(IsLive) - .findOne({ - blockHash, - contractAddress, - _point - }); - } - - async getGetContinuityNumber ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise { - return this._conn.getRepository(GetContinuityNumber) - .findOne({ - blockHash, - contractAddress, - _point - }); - } - - async getGetSpawnCount ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise { - return this._conn.getRepository(GetSpawnCount) - .findOne({ - blockHash, - contractAddress, - _point - }); - } - - async getHasSponsor ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise { - return this._conn.getRepository(HasSponsor) - .findOne({ - blockHash, - contractAddress, - _point - }); - } - - async getGetSponsor ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise { - return this._conn.getRepository(GetSponsor) - .findOne({ - blockHash, - contractAddress, - _point - }); - } - - async getIsSponsor ({ blockHash, contractAddress, _point, _sponsor }: { blockHash: string, contractAddress: string, _point: bigint, _sponsor: bigint }): Promise { - return this._conn.getRepository(IsSponsor) - .findOne({ - blockHash, - contractAddress, - _point, - _sponsor - }); - } - - async getGetSponsoringCount ({ blockHash, contractAddress, _sponsor }: { blockHash: string, contractAddress: string, _sponsor: bigint }): Promise { - return this._conn.getRepository(GetSponsoringCount) - .findOne({ - blockHash, - contractAddress, - _sponsor - }); - } - - async getIsEscaping ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise { - return this._conn.getRepository(IsEscaping) - .findOne({ - blockHash, - contractAddress, - _point - }); - } - - async getGetEscapeRequest ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise { - return this._conn.getRepository(GetEscapeRequest) - .findOne({ - blockHash, - contractAddress, - _point - }); - } - - async getIsRequestingEscapeTo ({ blockHash, contractAddress, _point, _sponsor }: { blockHash: string, contractAddress: string, _point: bigint, _sponsor: bigint }): Promise { - return this._conn.getRepository(IsRequestingEscapeTo) - .findOne({ - blockHash, - contractAddress, - _point, - _sponsor - }); - } - - async getGetEscapeRequestsCount ({ blockHash, contractAddress, _sponsor }: { blockHash: string, contractAddress: string, _sponsor: bigint }): Promise { - return this._conn.getRepository(GetEscapeRequestsCount) - .findOne({ - blockHash, - contractAddress, - _sponsor - }); - } - - async getGetOwner ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise { - return this._conn.getRepository(GetOwner) - .findOne({ - blockHash, - contractAddress, - _point - }); - } - - async getIsOwner ({ blockHash, contractAddress, _point, _address }: { blockHash: string, contractAddress: string, _point: bigint, _address: string }): Promise { - return this._conn.getRepository(IsOwner) - .findOne({ - blockHash, - contractAddress, - _point, - _address - }); - } - - async getGetOwnedPointCount ({ blockHash, contractAddress, _whose }: { blockHash: string, contractAddress: string, _whose: string }): Promise { - return this._conn.getRepository(GetOwnedPointCount) - .findOne({ - blockHash, - contractAddress, - _whose - }); - } - - async getGetOwnedPointAtIndex ({ blockHash, contractAddress, _whose, _index }: { blockHash: string, contractAddress: string, _whose: string, _index: bigint }): Promise { - return this._conn.getRepository(GetOwnedPointAtIndex) - .findOne({ - blockHash, - contractAddress, - _whose, - _index - }); - } - - async getGetManagementProxy ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise { - return this._conn.getRepository(GetManagementProxy) - .findOne({ - blockHash, - contractAddress, - _point - }); - } - - async getIsManagementProxy ({ blockHash, contractAddress, _point, _proxy }: { blockHash: string, contractAddress: string, _point: bigint, _proxy: string }): Promise { - return this._conn.getRepository(IsManagementProxy) - .findOne({ - blockHash, - contractAddress, - _point, - _proxy - }); - } - - async getCanManage ({ blockHash, contractAddress, _point, _who }: { blockHash: string, contractAddress: string, _point: bigint, _who: string }): Promise { - return this._conn.getRepository(CanManage) - .findOne({ - blockHash, - contractAddress, - _point, - _who - }); - } - - async getGetManagerForCount ({ blockHash, contractAddress, _proxy }: { blockHash: string, contractAddress: string, _proxy: string }): Promise { - return this._conn.getRepository(GetManagerForCount) - .findOne({ - blockHash, - contractAddress, - _proxy - }); - } - - async getGetSpawnProxy ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise { - return this._conn.getRepository(GetSpawnProxy) - .findOne({ - blockHash, - contractAddress, - _point - }); - } - - async getIsSpawnProxy ({ blockHash, contractAddress, _point, _proxy }: { blockHash: string, contractAddress: string, _point: bigint, _proxy: string }): Promise { - return this._conn.getRepository(IsSpawnProxy) - .findOne({ - blockHash, - contractAddress, - _point, - _proxy - }); - } - - async getCanSpawnAs ({ blockHash, contractAddress, _point, _who }: { blockHash: string, contractAddress: string, _point: bigint, _who: string }): Promise { - return this._conn.getRepository(CanSpawnAs) - .findOne({ - blockHash, - contractAddress, - _point, - _who - }); - } - - async getGetSpawningForCount ({ blockHash, contractAddress, _proxy }: { blockHash: string, contractAddress: string, _proxy: string }): Promise { - return this._conn.getRepository(GetSpawningForCount) - .findOne({ - blockHash, - contractAddress, - _proxy - }); - } - - async getGetVotingProxy ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise { - return this._conn.getRepository(GetVotingProxy) - .findOne({ - blockHash, - contractAddress, - _point - }); - } - - async getIsVotingProxy ({ blockHash, contractAddress, _point, _proxy }: { blockHash: string, contractAddress: string, _point: bigint, _proxy: string }): Promise { - return this._conn.getRepository(IsVotingProxy) - .findOne({ - blockHash, - contractAddress, - _point, - _proxy - }); - } - - async getCanVoteAs ({ blockHash, contractAddress, _point, _who }: { blockHash: string, contractAddress: string, _point: bigint, _who: string }): Promise { - return this._conn.getRepository(CanVoteAs) - .findOne({ - blockHash, - contractAddress, - _point, - _who - }); - } - - async getGetVotingForCount ({ blockHash, contractAddress, _proxy }: { blockHash: string, contractAddress: string, _proxy: string }): Promise { - return this._conn.getRepository(GetVotingForCount) - .findOne({ - blockHash, - contractAddress, - _proxy - }); - } - - async getGetTransferProxy ({ blockHash, contractAddress, _point }: { blockHash: string, contractAddress: string, _point: bigint }): Promise { - return this._conn.getRepository(GetTransferProxy) - .findOne({ - blockHash, - contractAddress, - _point - }); - } - - async getIsTransferProxy ({ blockHash, contractAddress, _point, _proxy }: { blockHash: string, contractAddress: string, _point: bigint, _proxy: string }): Promise { - return this._conn.getRepository(IsTransferProxy) - .findOne({ - blockHash, - contractAddress, - _point, - _proxy - }); - } - - async getCanTransfer ({ blockHash, contractAddress, _point, _who }: { blockHash: string, contractAddress: string, _point: bigint, _who: string }): Promise { - return this._conn.getRepository(CanTransfer) - .findOne({ - blockHash, - contractAddress, - _point, - _who - }); - } - - async getGetTransferringForCount ({ blockHash, contractAddress, _proxy }: { blockHash: string, contractAddress: string, _proxy: string }): Promise { - return this._conn.getRepository(GetTransferringForCount) - .findOne({ - blockHash, - contractAddress, - _proxy - }); - } - - async getIsOperator ({ blockHash, contractAddress, _owner, _operator }: { blockHash: string, contractAddress: string, _owner: string, _operator: string }): Promise { - return this._conn.getRepository(IsOperator) - .findOne({ - blockHash, - contractAddress, - _owner, - _operator - }); - } - async getGetCensuringCount ({ blockHash, contractAddress, _whose }: { blockHash: string, contractAddress: string, _whose: number }): Promise { return this._conn.getRepository(GetCensuringCount) .findOne({ @@ -437,216 +74,6 @@ export class Database implements DatabaseInterface { }); } - async saveIsActive ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(IsActive); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof }); - return repo.save(entity); - } - - async saveGetKeyRevisionNumber ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetKeyRevisionNumber); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof }); - return repo.save(entity); - } - - async saveHasBeenLinked ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(HasBeenLinked); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof }); - return repo.save(entity); - } - - async saveIsLive ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(IsLive); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof }); - return repo.save(entity); - } - - async saveGetContinuityNumber ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetContinuityNumber); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof }); - return repo.save(entity); - } - - async saveGetSpawnCount ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetSpawnCount); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof }); - return repo.save(entity); - } - - async saveHasSponsor ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(HasSponsor); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof }); - return repo.save(entity); - } - - async saveGetSponsor ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetSponsor); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof }); - return repo.save(entity); - } - - async saveIsSponsor ({ blockHash, blockNumber, contractAddress, _point, _sponsor, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(IsSponsor); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, _sponsor, value, proof }); - return repo.save(entity); - } - - async saveGetSponsoringCount ({ blockHash, blockNumber, contractAddress, _sponsor, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetSponsoringCount); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _sponsor, value, proof }); - return repo.save(entity); - } - - async saveIsEscaping ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(IsEscaping); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof }); - return repo.save(entity); - } - - async saveGetEscapeRequest ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetEscapeRequest); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof }); - return repo.save(entity); - } - - async saveIsRequestingEscapeTo ({ blockHash, blockNumber, contractAddress, _point, _sponsor, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(IsRequestingEscapeTo); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, _sponsor, value, proof }); - return repo.save(entity); - } - - async saveGetEscapeRequestsCount ({ blockHash, blockNumber, contractAddress, _sponsor, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetEscapeRequestsCount); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _sponsor, value, proof }); - return repo.save(entity); - } - - async saveGetOwner ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetOwner); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof }); - return repo.save(entity); - } - - async saveIsOwner ({ blockHash, blockNumber, contractAddress, _point, _address, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(IsOwner); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, _address, value, proof }); - return repo.save(entity); - } - - async saveGetOwnedPointCount ({ blockHash, blockNumber, contractAddress, _whose, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetOwnedPointCount); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _whose, value, proof }); - return repo.save(entity); - } - - async saveGetOwnedPointAtIndex ({ blockHash, blockNumber, contractAddress, _whose, _index, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetOwnedPointAtIndex); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _whose, _index, value, proof }); - return repo.save(entity); - } - - async saveGetManagementProxy ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetManagementProxy); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof }); - return repo.save(entity); - } - - async saveIsManagementProxy ({ blockHash, blockNumber, contractAddress, _point, _proxy, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(IsManagementProxy); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, _proxy, value, proof }); - return repo.save(entity); - } - - async saveCanManage ({ blockHash, blockNumber, contractAddress, _point, _who, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(CanManage); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, _who, value, proof }); - return repo.save(entity); - } - - async saveGetManagerForCount ({ blockHash, blockNumber, contractAddress, _proxy, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetManagerForCount); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _proxy, value, proof }); - return repo.save(entity); - } - - async saveGetSpawnProxy ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetSpawnProxy); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof }); - return repo.save(entity); - } - - async saveIsSpawnProxy ({ blockHash, blockNumber, contractAddress, _point, _proxy, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(IsSpawnProxy); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, _proxy, value, proof }); - return repo.save(entity); - } - - async saveCanSpawnAs ({ blockHash, blockNumber, contractAddress, _point, _who, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(CanSpawnAs); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, _who, value, proof }); - return repo.save(entity); - } - - async saveGetSpawningForCount ({ blockHash, blockNumber, contractAddress, _proxy, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetSpawningForCount); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _proxy, value, proof }); - return repo.save(entity); - } - - async saveGetVotingProxy ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetVotingProxy); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof }); - return repo.save(entity); - } - - async saveIsVotingProxy ({ blockHash, blockNumber, contractAddress, _point, _proxy, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(IsVotingProxy); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, _proxy, value, proof }); - return repo.save(entity); - } - - async saveCanVoteAs ({ blockHash, blockNumber, contractAddress, _point, _who, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(CanVoteAs); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, _who, value, proof }); - return repo.save(entity); - } - - async saveGetVotingForCount ({ blockHash, blockNumber, contractAddress, _proxy, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetVotingForCount); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _proxy, value, proof }); - return repo.save(entity); - } - - async saveGetTransferProxy ({ blockHash, blockNumber, contractAddress, _point, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetTransferProxy); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, value, proof }); - return repo.save(entity); - } - - async saveIsTransferProxy ({ blockHash, blockNumber, contractAddress, _point, _proxy, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(IsTransferProxy); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, _proxy, value, proof }); - return repo.save(entity); - } - - async saveCanTransfer ({ blockHash, blockNumber, contractAddress, _point, _who, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(CanTransfer); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _point, _who, value, proof }); - return repo.save(entity); - } - - async saveGetTransferringForCount ({ blockHash, blockNumber, contractAddress, _proxy, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(GetTransferringForCount); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _proxy, value, proof }); - return repo.save(entity); - } - - async saveIsOperator ({ blockHash, blockNumber, contractAddress, _owner, _operator, value, proof }: DeepPartial): Promise { - const repo = this._conn.getRepository(IsOperator); - const entity = repo.create({ blockHash, blockNumber, contractAddress, _owner, _operator, value, proof }); - return repo.save(entity); - } - async saveGetCensuringCount ({ blockHash, blockNumber, contractAddress, _whose, value, proof }: DeepPartial): Promise { const repo = this._conn.getRepository(GetCensuringCount); const entity = repo.create({ blockHash, blockNumber, contractAddress, _whose, value, proof }); @@ -864,41 +291,6 @@ export class Database implements DatabaseInterface { } _setPropColMaps (): void { - this._propColMaps.IsActive = this._getPropertyColumnMapForEntity('IsActive'); - this._propColMaps.GetKeyRevisionNumber = this._getPropertyColumnMapForEntity('GetKeyRevisionNumber'); - this._propColMaps.HasBeenLinked = this._getPropertyColumnMapForEntity('HasBeenLinked'); - this._propColMaps.IsLive = this._getPropertyColumnMapForEntity('IsLive'); - this._propColMaps.GetContinuityNumber = this._getPropertyColumnMapForEntity('GetContinuityNumber'); - this._propColMaps.GetSpawnCount = this._getPropertyColumnMapForEntity('GetSpawnCount'); - this._propColMaps.HasSponsor = this._getPropertyColumnMapForEntity('HasSponsor'); - this._propColMaps.GetSponsor = this._getPropertyColumnMapForEntity('GetSponsor'); - this._propColMaps.IsSponsor = this._getPropertyColumnMapForEntity('IsSponsor'); - this._propColMaps.GetSponsoringCount = this._getPropertyColumnMapForEntity('GetSponsoringCount'); - this._propColMaps.IsEscaping = this._getPropertyColumnMapForEntity('IsEscaping'); - this._propColMaps.GetEscapeRequest = this._getPropertyColumnMapForEntity('GetEscapeRequest'); - this._propColMaps.IsRequestingEscapeTo = this._getPropertyColumnMapForEntity('IsRequestingEscapeTo'); - this._propColMaps.GetEscapeRequestsCount = this._getPropertyColumnMapForEntity('GetEscapeRequestsCount'); - this._propColMaps.GetOwner = this._getPropertyColumnMapForEntity('GetOwner'); - this._propColMaps.IsOwner = this._getPropertyColumnMapForEntity('IsOwner'); - this._propColMaps.GetOwnedPointCount = this._getPropertyColumnMapForEntity('GetOwnedPointCount'); - this._propColMaps.GetOwnedPointAtIndex = this._getPropertyColumnMapForEntity('GetOwnedPointAtIndex'); - this._propColMaps.GetManagementProxy = this._getPropertyColumnMapForEntity('GetManagementProxy'); - this._propColMaps.IsManagementProxy = this._getPropertyColumnMapForEntity('IsManagementProxy'); - this._propColMaps.CanManage = this._getPropertyColumnMapForEntity('CanManage'); - this._propColMaps.GetManagerForCount = this._getPropertyColumnMapForEntity('GetManagerForCount'); - this._propColMaps.GetSpawnProxy = this._getPropertyColumnMapForEntity('GetSpawnProxy'); - this._propColMaps.IsSpawnProxy = this._getPropertyColumnMapForEntity('IsSpawnProxy'); - this._propColMaps.CanSpawnAs = this._getPropertyColumnMapForEntity('CanSpawnAs'); - this._propColMaps.GetSpawningForCount = this._getPropertyColumnMapForEntity('GetSpawningForCount'); - this._propColMaps.GetVotingProxy = this._getPropertyColumnMapForEntity('GetVotingProxy'); - this._propColMaps.IsVotingProxy = this._getPropertyColumnMapForEntity('IsVotingProxy'); - this._propColMaps.CanVoteAs = this._getPropertyColumnMapForEntity('CanVoteAs'); - this._propColMaps.GetVotingForCount = this._getPropertyColumnMapForEntity('GetVotingForCount'); - this._propColMaps.GetTransferProxy = this._getPropertyColumnMapForEntity('GetTransferProxy'); - this._propColMaps.IsTransferProxy = this._getPropertyColumnMapForEntity('IsTransferProxy'); - this._propColMaps.CanTransfer = this._getPropertyColumnMapForEntity('CanTransfer'); - this._propColMaps.GetTransferringForCount = this._getPropertyColumnMapForEntity('GetTransferringForCount'); - this._propColMaps.IsOperator = this._getPropertyColumnMapForEntity('IsOperator'); this._propColMaps.GetCensuringCount = this._getPropertyColumnMapForEntity('GetCensuringCount'); this._propColMaps.GetCensuredByCount = this._getPropertyColumnMapForEntity('GetCensuredByCount'); } diff --git a/packages/censures-watcher/src/gql/queries/canManage.gql b/packages/censures-watcher/src/gql/queries/canManage.gql deleted file mode 100644 index dad1626..0000000 --- a/packages/censures-watcher/src/gql/queries/canManage.gql +++ /dev/null @@ -1,8 +0,0 @@ -query canManage($blockHash: String!, $contractAddress: String!, $_point: BigInt!, $_who: String!){ - canManage(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point, _who: $_who){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/canSpawnAs.gql b/packages/censures-watcher/src/gql/queries/canSpawnAs.gql deleted file mode 100644 index 040dd32..0000000 --- a/packages/censures-watcher/src/gql/queries/canSpawnAs.gql +++ /dev/null @@ -1,8 +0,0 @@ -query canSpawnAs($blockHash: String!, $contractAddress: String!, $_point: BigInt!, $_who: String!){ - canSpawnAs(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point, _who: $_who){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/canTransfer.gql b/packages/censures-watcher/src/gql/queries/canTransfer.gql deleted file mode 100644 index 994578f..0000000 --- a/packages/censures-watcher/src/gql/queries/canTransfer.gql +++ /dev/null @@ -1,8 +0,0 @@ -query canTransfer($blockHash: String!, $contractAddress: String!, $_point: BigInt!, $_who: String!){ - canTransfer(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point, _who: $_who){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/canVoteAs.gql b/packages/censures-watcher/src/gql/queries/canVoteAs.gql deleted file mode 100644 index 87871a2..0000000 --- a/packages/censures-watcher/src/gql/queries/canVoteAs.gql +++ /dev/null @@ -1,8 +0,0 @@ -query canVoteAs($blockHash: String!, $contractAddress: String!, $_point: BigInt!, $_who: String!){ - canVoteAs(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point, _who: $_who){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getContinuityNumber.gql b/packages/censures-watcher/src/gql/queries/getContinuityNumber.gql deleted file mode 100644 index 244398d..0000000 --- a/packages/censures-watcher/src/gql/queries/getContinuityNumber.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getContinuityNumber($blockHash: String!, $contractAddress: String!, $_point: BigInt!){ - getContinuityNumber(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getEscapeRequest.gql b/packages/censures-watcher/src/gql/queries/getEscapeRequest.gql deleted file mode 100644 index 7215f8b..0000000 --- a/packages/censures-watcher/src/gql/queries/getEscapeRequest.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getEscapeRequest($blockHash: String!, $contractAddress: String!, $_point: BigInt!){ - getEscapeRequest(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getEscapeRequests.gql b/packages/censures-watcher/src/gql/queries/getEscapeRequests.gql deleted file mode 100644 index 13b81ac..0000000 --- a/packages/censures-watcher/src/gql/queries/getEscapeRequests.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getEscapeRequests($blockHash: String!, $contractAddress: String!, $_sponsor: BigInt!){ - getEscapeRequests(blockHash: $blockHash, contractAddress: $contractAddress, _sponsor: $_sponsor){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getEscapeRequestsCount.gql b/packages/censures-watcher/src/gql/queries/getEscapeRequestsCount.gql deleted file mode 100644 index ca7f8ef..0000000 --- a/packages/censures-watcher/src/gql/queries/getEscapeRequestsCount.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getEscapeRequestsCount($blockHash: String!, $contractAddress: String!, $_sponsor: BigInt!){ - getEscapeRequestsCount(blockHash: $blockHash, contractAddress: $contractAddress, _sponsor: $_sponsor){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getKeyRevisionNumber.gql b/packages/censures-watcher/src/gql/queries/getKeyRevisionNumber.gql deleted file mode 100644 index fdccc8b..0000000 --- a/packages/censures-watcher/src/gql/queries/getKeyRevisionNumber.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getKeyRevisionNumber($blockHash: String!, $contractAddress: String!, $_point: BigInt!){ - getKeyRevisionNumber(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getManagementProxy.gql b/packages/censures-watcher/src/gql/queries/getManagementProxy.gql deleted file mode 100644 index a9be364..0000000 --- a/packages/censures-watcher/src/gql/queries/getManagementProxy.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getManagementProxy($blockHash: String!, $contractAddress: String!, $_point: BigInt!){ - getManagementProxy(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getManagerFor.gql b/packages/censures-watcher/src/gql/queries/getManagerFor.gql deleted file mode 100644 index 12e6ca0..0000000 --- a/packages/censures-watcher/src/gql/queries/getManagerFor.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getManagerFor($blockHash: String!, $contractAddress: String!, $_proxy: String!){ - getManagerFor(blockHash: $blockHash, contractAddress: $contractAddress, _proxy: $_proxy){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getManagerForCount.gql b/packages/censures-watcher/src/gql/queries/getManagerForCount.gql deleted file mode 100644 index afc9de7..0000000 --- a/packages/censures-watcher/src/gql/queries/getManagerForCount.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getManagerForCount($blockHash: String!, $contractAddress: String!, $_proxy: String!){ - getManagerForCount(blockHash: $blockHash, contractAddress: $contractAddress, _proxy: $_proxy){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getOwnedPointAtIndex.gql b/packages/censures-watcher/src/gql/queries/getOwnedPointAtIndex.gql deleted file mode 100644 index 0d3d02c..0000000 --- a/packages/censures-watcher/src/gql/queries/getOwnedPointAtIndex.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getOwnedPointAtIndex($blockHash: String!, $contractAddress: String!, $_whose: String!, $_index: BigInt!){ - getOwnedPointAtIndex(blockHash: $blockHash, contractAddress: $contractAddress, _whose: $_whose, _index: $_index){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getOwnedPointCount.gql b/packages/censures-watcher/src/gql/queries/getOwnedPointCount.gql deleted file mode 100644 index f506e9e..0000000 --- a/packages/censures-watcher/src/gql/queries/getOwnedPointCount.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getOwnedPointCount($blockHash: String!, $contractAddress: String!, $_whose: String!){ - getOwnedPointCount(blockHash: $blockHash, contractAddress: $contractAddress, _whose: $_whose){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getOwnedPoints.gql b/packages/censures-watcher/src/gql/queries/getOwnedPoints.gql deleted file mode 100644 index 869ed24..0000000 --- a/packages/censures-watcher/src/gql/queries/getOwnedPoints.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getOwnedPoints($blockHash: String!, $contractAddress: String!, $_whose: String!){ - getOwnedPoints(blockHash: $blockHash, contractAddress: $contractAddress, _whose: $_whose){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getOwner.gql b/packages/censures-watcher/src/gql/queries/getOwner.gql deleted file mode 100644 index cc665d0..0000000 --- a/packages/censures-watcher/src/gql/queries/getOwner.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getOwner($blockHash: String!, $contractAddress: String!, $_point: BigInt!){ - getOwner(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getSpawnCount.gql b/packages/censures-watcher/src/gql/queries/getSpawnCount.gql deleted file mode 100644 index f990551..0000000 --- a/packages/censures-watcher/src/gql/queries/getSpawnCount.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getSpawnCount($blockHash: String!, $contractAddress: String!, $_point: BigInt!){ - getSpawnCount(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getSpawnProxy.gql b/packages/censures-watcher/src/gql/queries/getSpawnProxy.gql deleted file mode 100644 index f542279..0000000 --- a/packages/censures-watcher/src/gql/queries/getSpawnProxy.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getSpawnProxy($blockHash: String!, $contractAddress: String!, $_point: BigInt!){ - getSpawnProxy(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getSpawned.gql b/packages/censures-watcher/src/gql/queries/getSpawned.gql deleted file mode 100644 index ab9ea11..0000000 --- a/packages/censures-watcher/src/gql/queries/getSpawned.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getSpawned($blockHash: String!, $contractAddress: String!, $_point: BigInt!){ - getSpawned(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getSpawningFor.gql b/packages/censures-watcher/src/gql/queries/getSpawningFor.gql deleted file mode 100644 index 5059aa6..0000000 --- a/packages/censures-watcher/src/gql/queries/getSpawningFor.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getSpawningFor($blockHash: String!, $contractAddress: String!, $_proxy: String!){ - getSpawningFor(blockHash: $blockHash, contractAddress: $contractAddress, _proxy: $_proxy){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getSpawningForCount.gql b/packages/censures-watcher/src/gql/queries/getSpawningForCount.gql deleted file mode 100644 index df6f040..0000000 --- a/packages/censures-watcher/src/gql/queries/getSpawningForCount.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getSpawningForCount($blockHash: String!, $contractAddress: String!, $_proxy: String!){ - getSpawningForCount(blockHash: $blockHash, contractAddress: $contractAddress, _proxy: $_proxy){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getSponsor.gql b/packages/censures-watcher/src/gql/queries/getSponsor.gql deleted file mode 100644 index 56a5305..0000000 --- a/packages/censures-watcher/src/gql/queries/getSponsor.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getSponsor($blockHash: String!, $contractAddress: String!, $_point: BigInt!){ - getSponsor(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getSponsoring.gql b/packages/censures-watcher/src/gql/queries/getSponsoring.gql deleted file mode 100644 index cb6a4b4..0000000 --- a/packages/censures-watcher/src/gql/queries/getSponsoring.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getSponsoring($blockHash: String!, $contractAddress: String!, $_sponsor: BigInt!){ - getSponsoring(blockHash: $blockHash, contractAddress: $contractAddress, _sponsor: $_sponsor){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getSponsoringCount.gql b/packages/censures-watcher/src/gql/queries/getSponsoringCount.gql deleted file mode 100644 index ee62745..0000000 --- a/packages/censures-watcher/src/gql/queries/getSponsoringCount.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getSponsoringCount($blockHash: String!, $contractAddress: String!, $_sponsor: BigInt!){ - getSponsoringCount(blockHash: $blockHash, contractAddress: $contractAddress, _sponsor: $_sponsor){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getTransferProxy.gql b/packages/censures-watcher/src/gql/queries/getTransferProxy.gql deleted file mode 100644 index c14c0ab..0000000 --- a/packages/censures-watcher/src/gql/queries/getTransferProxy.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getTransferProxy($blockHash: String!, $contractAddress: String!, $_point: BigInt!){ - getTransferProxy(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getTransferringFor.gql b/packages/censures-watcher/src/gql/queries/getTransferringFor.gql deleted file mode 100644 index 0911c39..0000000 --- a/packages/censures-watcher/src/gql/queries/getTransferringFor.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getTransferringFor($blockHash: String!, $contractAddress: String!, $_proxy: String!){ - getTransferringFor(blockHash: $blockHash, contractAddress: $contractAddress, _proxy: $_proxy){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getTransferringForCount.gql b/packages/censures-watcher/src/gql/queries/getTransferringForCount.gql deleted file mode 100644 index b3245eb..0000000 --- a/packages/censures-watcher/src/gql/queries/getTransferringForCount.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getTransferringForCount($blockHash: String!, $contractAddress: String!, $_proxy: String!){ - getTransferringForCount(blockHash: $blockHash, contractAddress: $contractAddress, _proxy: $_proxy){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getVotingFor.gql b/packages/censures-watcher/src/gql/queries/getVotingFor.gql deleted file mode 100644 index 30186d8..0000000 --- a/packages/censures-watcher/src/gql/queries/getVotingFor.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getVotingFor($blockHash: String!, $contractAddress: String!, $_proxy: String!){ - getVotingFor(blockHash: $blockHash, contractAddress: $contractAddress, _proxy: $_proxy){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getVotingForCount.gql b/packages/censures-watcher/src/gql/queries/getVotingForCount.gql deleted file mode 100644 index 6f7e1e0..0000000 --- a/packages/censures-watcher/src/gql/queries/getVotingForCount.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getVotingForCount($blockHash: String!, $contractAddress: String!, $_proxy: String!){ - getVotingForCount(blockHash: $blockHash, contractAddress: $contractAddress, _proxy: $_proxy){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/getVotingProxy.gql b/packages/censures-watcher/src/gql/queries/getVotingProxy.gql deleted file mode 100644 index 49d37ab..0000000 --- a/packages/censures-watcher/src/gql/queries/getVotingProxy.gql +++ /dev/null @@ -1,8 +0,0 @@ -query getVotingProxy($blockHash: String!, $contractAddress: String!, $_point: BigInt!){ - getVotingProxy(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/hasBeenLinked.gql b/packages/censures-watcher/src/gql/queries/hasBeenLinked.gql deleted file mode 100644 index a50505c..0000000 --- a/packages/censures-watcher/src/gql/queries/hasBeenLinked.gql +++ /dev/null @@ -1,8 +0,0 @@ -query hasBeenLinked($blockHash: String!, $contractAddress: String!, $_point: BigInt!){ - hasBeenLinked(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/hasSponsor.gql b/packages/censures-watcher/src/gql/queries/hasSponsor.gql deleted file mode 100644 index 0261c6e..0000000 --- a/packages/censures-watcher/src/gql/queries/hasSponsor.gql +++ /dev/null @@ -1,8 +0,0 @@ -query hasSponsor($blockHash: String!, $contractAddress: String!, $_point: BigInt!){ - hasSponsor(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/index.ts b/packages/censures-watcher/src/gql/queries/index.ts index 47f34f3..438178f 100644 --- a/packages/censures-watcher/src/gql/queries/index.ts +++ b/packages/censures-watcher/src/gql/queries/index.ts @@ -3,49 +3,6 @@ import path from 'path'; export const events = fs.readFileSync(path.join(__dirname, 'events.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 getKeyRevisionNumber = fs.readFileSync(path.join(__dirname, 'getKeyRevisionNumber.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 getContinuityNumber = fs.readFileSync(path.join(__dirname, 'getContinuityNumber.gql'), 'utf8'); -export const getSpawnCount = fs.readFileSync(path.join(__dirname, 'getSpawnCount.gql'), 'utf8'); -export const getSpawned = fs.readFileSync(path.join(__dirname, 'getSpawned.gql'), 'utf8'); -export const hasSponsor = fs.readFileSync(path.join(__dirname, 'hasSponsor.gql'), 'utf8'); -export const getSponsor = fs.readFileSync(path.join(__dirname, 'getSponsor.gql'), 'utf8'); -export const isSponsor = fs.readFileSync(path.join(__dirname, 'isSponsor.gql'), 'utf8'); -export const getSponsoringCount = fs.readFileSync(path.join(__dirname, 'getSponsoringCount.gql'), 'utf8'); -export const getSponsoring = fs.readFileSync(path.join(__dirname, 'getSponsoring.gql'), 'utf8'); -export const isEscaping = fs.readFileSync(path.join(__dirname, 'isEscaping.gql'), 'utf8'); -export const getEscapeRequest = fs.readFileSync(path.join(__dirname, 'getEscapeRequest.gql'), 'utf8'); -export const isRequestingEscapeTo = fs.readFileSync(path.join(__dirname, 'isRequestingEscapeTo.gql'), 'utf8'); -export const getEscapeRequestsCount = fs.readFileSync(path.join(__dirname, 'getEscapeRequestsCount.gql'), 'utf8'); -export const getEscapeRequests = fs.readFileSync(path.join(__dirname, 'getEscapeRequests.gql'), 'utf8'); -export const getOwner = fs.readFileSync(path.join(__dirname, 'getOwner.gql'), 'utf8'); -export const isOwner = fs.readFileSync(path.join(__dirname, 'isOwner.gql'), 'utf8'); -export const getOwnedPointCount = fs.readFileSync(path.join(__dirname, 'getOwnedPointCount.gql'), 'utf8'); -export const getOwnedPoints = fs.readFileSync(path.join(__dirname, 'getOwnedPoints.gql'), 'utf8'); -export const getOwnedPointAtIndex = fs.readFileSync(path.join(__dirname, 'getOwnedPointAtIndex.gql'), 'utf8'); -export const getManagementProxy = fs.readFileSync(path.join(__dirname, 'getManagementProxy.gql'), 'utf8'); -export const isManagementProxy = fs.readFileSync(path.join(__dirname, 'isManagementProxy.gql'), 'utf8'); -export const canManage = fs.readFileSync(path.join(__dirname, 'canManage.gql'), 'utf8'); -export const getManagerForCount = fs.readFileSync(path.join(__dirname, 'getManagerForCount.gql'), 'utf8'); -export const getManagerFor = fs.readFileSync(path.join(__dirname, 'getManagerFor.gql'), 'utf8'); -export const getSpawnProxy = fs.readFileSync(path.join(__dirname, 'getSpawnProxy.gql'), 'utf8'); -export const isSpawnProxy = fs.readFileSync(path.join(__dirname, 'isSpawnProxy.gql'), 'utf8'); -export const canSpawnAs = fs.readFileSync(path.join(__dirname, 'canSpawnAs.gql'), 'utf8'); -export const getSpawningForCount = fs.readFileSync(path.join(__dirname, 'getSpawningForCount.gql'), 'utf8'); -export const getSpawningFor = fs.readFileSync(path.join(__dirname, 'getSpawningFor.gql'), 'utf8'); -export const getVotingProxy = fs.readFileSync(path.join(__dirname, 'getVotingProxy.gql'), 'utf8'); -export const isVotingProxy = fs.readFileSync(path.join(__dirname, 'isVotingProxy.gql'), 'utf8'); -export const canVoteAs = fs.readFileSync(path.join(__dirname, 'canVoteAs.gql'), 'utf8'); -export const getVotingForCount = fs.readFileSync(path.join(__dirname, 'getVotingForCount.gql'), 'utf8'); -export const getVotingFor = fs.readFileSync(path.join(__dirname, 'getVotingFor.gql'), 'utf8'); -export const getTransferProxy = fs.readFileSync(path.join(__dirname, 'getTransferProxy.gql'), 'utf8'); -export const isTransferProxy = fs.readFileSync(path.join(__dirname, 'isTransferProxy.gql'), 'utf8'); -export const canTransfer = fs.readFileSync(path.join(__dirname, 'canTransfer.gql'), 'utf8'); -export const getTransferringForCount = fs.readFileSync(path.join(__dirname, 'getTransferringForCount.gql'), 'utf8'); -export const getTransferringFor = fs.readFileSync(path.join(__dirname, 'getTransferringFor.gql'), 'utf8'); -export const isOperator = fs.readFileSync(path.join(__dirname, 'isOperator.gql'), 'utf8'); export const getCensuringCount = fs.readFileSync(path.join(__dirname, 'getCensuringCount.gql'), 'utf8'); export const getCensuring = fs.readFileSync(path.join(__dirname, 'getCensuring.gql'), 'utf8'); export const getCensuredByCount = fs.readFileSync(path.join(__dirname, 'getCensuredByCount.gql'), 'utf8'); diff --git a/packages/censures-watcher/src/gql/queries/isActive.gql b/packages/censures-watcher/src/gql/queries/isActive.gql deleted file mode 100644 index 74bc87f..0000000 --- a/packages/censures-watcher/src/gql/queries/isActive.gql +++ /dev/null @@ -1,8 +0,0 @@ -query isActive($blockHash: String!, $contractAddress: String!, $_point: BigInt!){ - isActive(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/isEscaping.gql b/packages/censures-watcher/src/gql/queries/isEscaping.gql deleted file mode 100644 index 4ed499f..0000000 --- a/packages/censures-watcher/src/gql/queries/isEscaping.gql +++ /dev/null @@ -1,8 +0,0 @@ -query isEscaping($blockHash: String!, $contractAddress: String!, $_point: BigInt!){ - isEscaping(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/isLive.gql b/packages/censures-watcher/src/gql/queries/isLive.gql deleted file mode 100644 index 78a61fd..0000000 --- a/packages/censures-watcher/src/gql/queries/isLive.gql +++ /dev/null @@ -1,8 +0,0 @@ -query isLive($blockHash: String!, $contractAddress: String!, $_point: BigInt!){ - isLive(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/isManagementProxy.gql b/packages/censures-watcher/src/gql/queries/isManagementProxy.gql deleted file mode 100644 index 64b7656..0000000 --- a/packages/censures-watcher/src/gql/queries/isManagementProxy.gql +++ /dev/null @@ -1,8 +0,0 @@ -query isManagementProxy($blockHash: String!, $contractAddress: String!, $_point: BigInt!, $_proxy: String!){ - isManagementProxy(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point, _proxy: $_proxy){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/isOperator.gql b/packages/censures-watcher/src/gql/queries/isOperator.gql deleted file mode 100644 index c67f1e2..0000000 --- a/packages/censures-watcher/src/gql/queries/isOperator.gql +++ /dev/null @@ -1,8 +0,0 @@ -query isOperator($blockHash: String!, $contractAddress: String!, $_owner: String!, $_operator: String!){ - isOperator(blockHash: $blockHash, contractAddress: $contractAddress, _owner: $_owner, _operator: $_operator){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/isOwner.gql b/packages/censures-watcher/src/gql/queries/isOwner.gql deleted file mode 100644 index 9378225..0000000 --- a/packages/censures-watcher/src/gql/queries/isOwner.gql +++ /dev/null @@ -1,8 +0,0 @@ -query isOwner($blockHash: String!, $contractAddress: String!, $_point: BigInt!, $_address: String!){ - isOwner(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point, _address: $_address){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/isRequestingEscapeTo.gql b/packages/censures-watcher/src/gql/queries/isRequestingEscapeTo.gql deleted file mode 100644 index f1c9afb..0000000 --- a/packages/censures-watcher/src/gql/queries/isRequestingEscapeTo.gql +++ /dev/null @@ -1,8 +0,0 @@ -query isRequestingEscapeTo($blockHash: String!, $contractAddress: String!, $_point: BigInt!, $_sponsor: BigInt!){ - isRequestingEscapeTo(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point, _sponsor: $_sponsor){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/isSpawnProxy.gql b/packages/censures-watcher/src/gql/queries/isSpawnProxy.gql deleted file mode 100644 index 2223af6..0000000 --- a/packages/censures-watcher/src/gql/queries/isSpawnProxy.gql +++ /dev/null @@ -1,8 +0,0 @@ -query isSpawnProxy($blockHash: String!, $contractAddress: String!, $_point: BigInt!, $_proxy: String!){ - isSpawnProxy(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point, _proxy: $_proxy){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/isSponsor.gql b/packages/censures-watcher/src/gql/queries/isSponsor.gql deleted file mode 100644 index 3e1b3cc..0000000 --- a/packages/censures-watcher/src/gql/queries/isSponsor.gql +++ /dev/null @@ -1,8 +0,0 @@ -query isSponsor($blockHash: String!, $contractAddress: String!, $_point: BigInt!, $_sponsor: BigInt!){ - isSponsor(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point, _sponsor: $_sponsor){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/isTransferProxy.gql b/packages/censures-watcher/src/gql/queries/isTransferProxy.gql deleted file mode 100644 index feccdf0..0000000 --- a/packages/censures-watcher/src/gql/queries/isTransferProxy.gql +++ /dev/null @@ -1,8 +0,0 @@ -query isTransferProxy($blockHash: String!, $contractAddress: String!, $_point: BigInt!, $_proxy: String!){ - isTransferProxy(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point, _proxy: $_proxy){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/gql/queries/isVotingProxy.gql b/packages/censures-watcher/src/gql/queries/isVotingProxy.gql deleted file mode 100644 index 3bf33c8..0000000 --- a/packages/censures-watcher/src/gql/queries/isVotingProxy.gql +++ /dev/null @@ -1,8 +0,0 @@ -query isVotingProxy($blockHash: String!, $contractAddress: String!, $_point: BigInt!, $_proxy: String!){ - isVotingProxy(blockHash: $blockHash, contractAddress: $contractAddress, _point: $_point, _proxy: $_proxy){ - value - proof{ - data - } - } -} \ No newline at end of file diff --git a/packages/censures-watcher/src/indexer.ts b/packages/censures-watcher/src/indexer.ts index 26d3179..7e70229 100644 --- a/packages/censures-watcher/src/indexer.ts +++ b/packages/censures-watcher/src/indexer.ts @@ -93,1167 +93,6 @@ export class Indexer implements IndexerInterface { return getResultEvent(event); } - async isActive (blockHash: string, contractAddress: string, _point: bigint): Promise { - const entity = await this._db.getIsActive({ blockHash, contractAddress, _point }); - if (entity) { - log('isActive: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('isActive: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.isActive(_point, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveIsActive({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getKeyRevisionNumber (blockHash: string, contractAddress: string, _point: bigint): Promise { - const entity = await this._db.getGetKeyRevisionNumber({ blockHash, contractAddress, _point }); - if (entity) { - log('getKeyRevisionNumber: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getKeyRevisionNumber: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getKeyRevisionNumber(_point, { blockTag: blockHash }); - value = value.toString(); - value = BigInt(value); - - const result: ValueResult = { value }; - - await this._db.saveGetKeyRevisionNumber({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async hasBeenLinked (blockHash: string, contractAddress: string, _point: bigint): Promise { - const entity = await this._db.getHasBeenLinked({ blockHash, contractAddress, _point }); - if (entity) { - log('hasBeenLinked: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('hasBeenLinked: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.hasBeenLinked(_point, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveHasBeenLinked({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async isLive (blockHash: string, contractAddress: string, _point: bigint): Promise { - const entity = await this._db.getIsLive({ blockHash, contractAddress, _point }); - if (entity) { - log('isLive: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('isLive: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.isLive(_point, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveIsLive({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getContinuityNumber (blockHash: string, contractAddress: string, _point: bigint): Promise { - const entity = await this._db.getGetContinuityNumber({ blockHash, contractAddress, _point }); - if (entity) { - log('getContinuityNumber: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getContinuityNumber: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getContinuityNumber(_point, { blockTag: blockHash }); - value = value.toString(); - value = BigInt(value); - - const result: ValueResult = { value }; - - await this._db.saveGetContinuityNumber({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getSpawnCount (blockHash: string, contractAddress: string, _point: bigint): Promise { - const entity = await this._db.getGetSpawnCount({ blockHash, contractAddress, _point }); - if (entity) { - log('getSpawnCount: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getSpawnCount: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getSpawnCount(_point, { blockTag: blockHash }); - value = value.toString(); - value = BigInt(value); - - const result: ValueResult = { value }; - - await this._db.saveGetSpawnCount({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getSpawned (blockHash: string, contractAddress: string, _point: bigint): Promise { - log('getSpawned: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getSpawned(_point, { blockTag: blockHash }); - value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt()); - - const result: ValueResult = { value }; - - return result; - } - - async hasSponsor (blockHash: string, contractAddress: string, _point: bigint): Promise { - const entity = await this._db.getHasSponsor({ blockHash, contractAddress, _point }); - if (entity) { - log('hasSponsor: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('hasSponsor: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.hasSponsor(_point, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveHasSponsor({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getSponsor (blockHash: string, contractAddress: string, _point: bigint): Promise { - const entity = await this._db.getGetSponsor({ blockHash, contractAddress, _point }); - if (entity) { - log('getSponsor: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getSponsor: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getSponsor(_point, { blockTag: blockHash }); - value = value.toString(); - value = BigInt(value); - - const result: ValueResult = { value }; - - await this._db.saveGetSponsor({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async isSponsor (blockHash: string, contractAddress: string, _point: bigint, _sponsor: bigint): Promise { - const entity = await this._db.getIsSponsor({ blockHash, contractAddress, _point, _sponsor }); - if (entity) { - log('isSponsor: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('isSponsor: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.isSponsor(_point, _sponsor, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveIsSponsor({ blockHash, blockNumber, contractAddress, _point, _sponsor, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getSponsoringCount (blockHash: string, contractAddress: string, _sponsor: bigint): Promise { - const entity = await this._db.getGetSponsoringCount({ blockHash, contractAddress, _sponsor }); - if (entity) { - log('getSponsoringCount: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getSponsoringCount: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getSponsoringCount(_sponsor, { blockTag: blockHash }); - value = value.toString(); - value = BigInt(value); - - const result: ValueResult = { value }; - - await this._db.saveGetSponsoringCount({ blockHash, blockNumber, contractAddress, _sponsor, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getSponsoring (blockHash: string, contractAddress: string, _sponsor: bigint): Promise { - log('getSponsoring: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getSponsoring(_sponsor, { blockTag: blockHash }); - value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt()); - - const result: ValueResult = { value }; - - return result; - } - - async isEscaping (blockHash: string, contractAddress: string, _point: bigint): Promise { - const entity = await this._db.getIsEscaping({ blockHash, contractAddress, _point }); - if (entity) { - log('isEscaping: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('isEscaping: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.isEscaping(_point, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveIsEscaping({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getEscapeRequest (blockHash: string, contractAddress: string, _point: bigint): Promise { - const entity = await this._db.getGetEscapeRequest({ blockHash, contractAddress, _point }); - if (entity) { - log('getEscapeRequest: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getEscapeRequest: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getEscapeRequest(_point, { blockTag: blockHash }); - value = value.toString(); - value = BigInt(value); - - const result: ValueResult = { value }; - - await this._db.saveGetEscapeRequest({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async isRequestingEscapeTo (blockHash: string, contractAddress: string, _point: bigint, _sponsor: bigint): Promise { - const entity = await this._db.getIsRequestingEscapeTo({ blockHash, contractAddress, _point, _sponsor }); - if (entity) { - log('isRequestingEscapeTo: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('isRequestingEscapeTo: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.isRequestingEscapeTo(_point, _sponsor, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveIsRequestingEscapeTo({ blockHash, blockNumber, contractAddress, _point, _sponsor, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getEscapeRequestsCount (blockHash: string, contractAddress: string, _sponsor: bigint): Promise { - const entity = await this._db.getGetEscapeRequestsCount({ blockHash, contractAddress, _sponsor }); - if (entity) { - log('getEscapeRequestsCount: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getEscapeRequestsCount: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getEscapeRequestsCount(_sponsor, { blockTag: blockHash }); - value = value.toString(); - value = BigInt(value); - - const result: ValueResult = { value }; - - await this._db.saveGetEscapeRequestsCount({ blockHash, blockNumber, contractAddress, _sponsor, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getEscapeRequests (blockHash: string, contractAddress: string, _sponsor: bigint): Promise { - log('getEscapeRequests: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getEscapeRequests(_sponsor, { blockTag: blockHash }); - value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt()); - - const result: ValueResult = { value }; - - return result; - } - - async getOwner (blockHash: string, contractAddress: string, _point: bigint): Promise { - const entity = await this._db.getGetOwner({ blockHash, contractAddress, _point }); - if (entity) { - log('getOwner: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getOwner: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.getOwner(_point, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveGetOwner({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async isOwner (blockHash: string, contractAddress: string, _point: bigint, _address: string): Promise { - const entity = await this._db.getIsOwner({ blockHash, contractAddress, _point, _address }); - if (entity) { - log('isOwner: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('isOwner: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.isOwner(_point, _address, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveIsOwner({ blockHash, blockNumber, contractAddress, _point, _address, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getOwnedPointCount (blockHash: string, contractAddress: string, _whose: string): Promise { - const entity = await this._db.getGetOwnedPointCount({ blockHash, contractAddress, _whose }); - if (entity) { - log('getOwnedPointCount: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getOwnedPointCount: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getOwnedPointCount(_whose, { blockTag: blockHash }); - value = value.toString(); - value = BigInt(value); - - const result: ValueResult = { value }; - - await this._db.saveGetOwnedPointCount({ blockHash, blockNumber, contractAddress, _whose, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getOwnedPoints (blockHash: string, contractAddress: string, _whose: string): Promise { - log('getOwnedPoints: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getOwnedPoints(_whose, { blockTag: blockHash }); - value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt()); - - const result: ValueResult = { value }; - - return result; - } - - async getOwnedPointAtIndex (blockHash: string, contractAddress: string, _whose: string, _index: bigint): Promise { - const entity = await this._db.getGetOwnedPointAtIndex({ blockHash, contractAddress, _whose, _index }); - if (entity) { - log('getOwnedPointAtIndex: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getOwnedPointAtIndex: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getOwnedPointAtIndex(_whose, _index, { blockTag: blockHash }); - value = value.toString(); - value = BigInt(value); - - const result: ValueResult = { value }; - - await this._db.saveGetOwnedPointAtIndex({ blockHash, blockNumber, contractAddress, _whose, _index, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getManagementProxy (blockHash: string, contractAddress: string, _point: bigint): Promise { - const entity = await this._db.getGetManagementProxy({ blockHash, contractAddress, _point }); - if (entity) { - log('getManagementProxy: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getManagementProxy: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.getManagementProxy(_point, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveGetManagementProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async isManagementProxy (blockHash: string, contractAddress: string, _point: bigint, _proxy: string): Promise { - const entity = await this._db.getIsManagementProxy({ blockHash, contractAddress, _point, _proxy }); - if (entity) { - log('isManagementProxy: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('isManagementProxy: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.isManagementProxy(_point, _proxy, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveIsManagementProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async canManage (blockHash: string, contractAddress: string, _point: bigint, _who: string): Promise { - const entity = await this._db.getCanManage({ blockHash, contractAddress, _point, _who }); - if (entity) { - log('canManage: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('canManage: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.canManage(_point, _who, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveCanManage({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getManagerForCount (blockHash: string, contractAddress: string, _proxy: string): Promise { - const entity = await this._db.getGetManagerForCount({ blockHash, contractAddress, _proxy }); - if (entity) { - log('getManagerForCount: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getManagerForCount: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getManagerForCount(_proxy, { blockTag: blockHash }); - value = value.toString(); - value = BigInt(value); - - const result: ValueResult = { value }; - - await this._db.saveGetManagerForCount({ blockHash, blockNumber, contractAddress, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getManagerFor (blockHash: string, contractAddress: string, _proxy: string): Promise { - log('getManagerFor: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getManagerFor(_proxy, { blockTag: blockHash }); - value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt()); - - const result: ValueResult = { value }; - - return result; - } - - async getSpawnProxy (blockHash: string, contractAddress: string, _point: bigint): Promise { - const entity = await this._db.getGetSpawnProxy({ blockHash, contractAddress, _point }); - if (entity) { - log('getSpawnProxy: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getSpawnProxy: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.getSpawnProxy(_point, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveGetSpawnProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async isSpawnProxy (blockHash: string, contractAddress: string, _point: bigint, _proxy: string): Promise { - const entity = await this._db.getIsSpawnProxy({ blockHash, contractAddress, _point, _proxy }); - if (entity) { - log('isSpawnProxy: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('isSpawnProxy: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.isSpawnProxy(_point, _proxy, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveIsSpawnProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async canSpawnAs (blockHash: string, contractAddress: string, _point: bigint, _who: string): Promise { - const entity = await this._db.getCanSpawnAs({ blockHash, contractAddress, _point, _who }); - if (entity) { - log('canSpawnAs: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('canSpawnAs: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.canSpawnAs(_point, _who, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveCanSpawnAs({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getSpawningForCount (blockHash: string, contractAddress: string, _proxy: string): Promise { - const entity = await this._db.getGetSpawningForCount({ blockHash, contractAddress, _proxy }); - if (entity) { - log('getSpawningForCount: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getSpawningForCount: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getSpawningForCount(_proxy, { blockTag: blockHash }); - value = value.toString(); - value = BigInt(value); - - const result: ValueResult = { value }; - - await this._db.saveGetSpawningForCount({ blockHash, blockNumber, contractAddress, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getSpawningFor (blockHash: string, contractAddress: string, _proxy: string): Promise { - log('getSpawningFor: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getSpawningFor(_proxy, { blockTag: blockHash }); - value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt()); - - const result: ValueResult = { value }; - - return result; - } - - async getVotingProxy (blockHash: string, contractAddress: string, _point: bigint): Promise { - const entity = await this._db.getGetVotingProxy({ blockHash, contractAddress, _point }); - if (entity) { - log('getVotingProxy: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getVotingProxy: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.getVotingProxy(_point, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveGetVotingProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async isVotingProxy (blockHash: string, contractAddress: string, _point: bigint, _proxy: string): Promise { - const entity = await this._db.getIsVotingProxy({ blockHash, contractAddress, _point, _proxy }); - if (entity) { - log('isVotingProxy: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('isVotingProxy: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.isVotingProxy(_point, _proxy, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveIsVotingProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async canVoteAs (blockHash: string, contractAddress: string, _point: bigint, _who: string): Promise { - const entity = await this._db.getCanVoteAs({ blockHash, contractAddress, _point, _who }); - if (entity) { - log('canVoteAs: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('canVoteAs: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.canVoteAs(_point, _who, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveCanVoteAs({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getVotingForCount (blockHash: string, contractAddress: string, _proxy: string): Promise { - const entity = await this._db.getGetVotingForCount({ blockHash, contractAddress, _proxy }); - if (entity) { - log('getVotingForCount: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getVotingForCount: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getVotingForCount(_proxy, { blockTag: blockHash }); - value = value.toString(); - value = BigInt(value); - - const result: ValueResult = { value }; - - await this._db.saveGetVotingForCount({ blockHash, blockNumber, contractAddress, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getVotingFor (blockHash: string, contractAddress: string, _proxy: string): Promise { - log('getVotingFor: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getVotingFor(_proxy, { blockTag: blockHash }); - value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt()); - - const result: ValueResult = { value }; - - return result; - } - - async getTransferProxy (blockHash: string, contractAddress: string, _point: bigint): Promise { - const entity = await this._db.getGetTransferProxy({ blockHash, contractAddress, _point }); - if (entity) { - log('getTransferProxy: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getTransferProxy: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.getTransferProxy(_point, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveGetTransferProxy({ blockHash, blockNumber, contractAddress, _point, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async isTransferProxy (blockHash: string, contractAddress: string, _point: bigint, _proxy: string): Promise { - const entity = await this._db.getIsTransferProxy({ blockHash, contractAddress, _point, _proxy }); - if (entity) { - log('isTransferProxy: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('isTransferProxy: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.isTransferProxy(_point, _proxy, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveIsTransferProxy({ blockHash, blockNumber, contractAddress, _point, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async canTransfer (blockHash: string, contractAddress: string, _point: bigint, _who: string): Promise { - const entity = await this._db.getCanTransfer({ blockHash, contractAddress, _point, _who }); - if (entity) { - log('canTransfer: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('canTransfer: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.canTransfer(_point, _who, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveCanTransfer({ blockHash, blockNumber, contractAddress, _point, _who, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getTransferringForCount (blockHash: string, contractAddress: string, _proxy: string): Promise { - const entity = await this._db.getGetTransferringForCount({ blockHash, contractAddress, _proxy }); - if (entity) { - log('getTransferringForCount: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('getTransferringForCount: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getTransferringForCount(_proxy, { blockTag: blockHash }); - value = value.toString(); - value = BigInt(value); - - const result: ValueResult = { value }; - - await this._db.saveGetTransferringForCount({ blockHash, blockNumber, contractAddress, _proxy, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - - async getTransferringFor (blockHash: string, contractAddress: string, _proxy: string): Promise { - log('getTransferringFor: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getTransferringFor(_proxy, { blockTag: blockHash }); - value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt()); - - const result: ValueResult = { value }; - - return result; - } - - async isOperator (blockHash: string, contractAddress: string, _owner: string, _operator: string): Promise { - const entity = await this._db.getIsOperator({ blockHash, contractAddress, _owner, _operator }); - if (entity) { - log('isOperator: db hit.'); - - return { - value: entity.value, - proof: JSON.parse(entity.proof) - }; - } - - const { block: { number } } = await this._ethClient.getBlockByHash(blockHash); - const blockNumber = ethers.BigNumber.from(number).toNumber(); - - log('isOperator: db miss, fetching from upstream server'); - - const abi = this._abiMap.get(KIND_CENSURES); - assert(abi); - - const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.isOperator(_owner, _operator, { blockTag: blockHash }); - - const result: ValueResult = { value }; - - await this._db.saveIsOperator({ blockHash, blockNumber, contractAddress, _owner, _operator, value: result.value, proof: JSONbigNative.stringify(result.proof) }); - - return result; - } - async getCensuringCount (blockHash: string, contractAddress: string, _whose: number): Promise { const entity = await this._db.getGetCensuringCount({ blockHash, contractAddress, _whose }); if (entity) { @@ -1274,9 +113,9 @@ export class Indexer implements IndexerInterface { assert(abi); const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getCensuringCount(_whose, { blockTag: blockHash }); - value = value.toString(); - value = BigInt(value); + const contractResult = await contract.getCensuringCount(_whose, { blockTag: blockHash }); + + const value = ethers.BigNumber.from(contractResult).toBigInt(); const result: ValueResult = { value }; @@ -1292,9 +131,9 @@ export class Indexer implements IndexerInterface { assert(abi); const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getCensuring(_whose, { blockTag: blockHash }); - value = value.map((val: ethers.BigNumber) => ethers.BigNumber.from(val).toBigInt()); + const contractResult = await contract.getCensuring(_whose, { blockTag: blockHash }); + const value = contractResult.map((val: ethers.BigNumber | number) => ethers.BigNumber.from(val).toBigInt()); const result: ValueResult = { value }; return result; @@ -1320,9 +159,9 @@ export class Indexer implements IndexerInterface { assert(abi); const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - let value = await contract.getCensuredByCount(_who, { blockTag: blockHash }); - value = value.toString(); - value = BigInt(value); + const contractResult = await contract.getCensuredByCount(_who, { blockTag: blockHash }); + + const value = ethers.BigNumber.from(contractResult).toBigInt(); const result: ValueResult = { value }; @@ -1338,8 +177,9 @@ export class Indexer implements IndexerInterface { assert(abi); const contract = new ethers.Contract(contractAddress, abi, this._ethProvider); - const value = await contract.getCensuredBy(_who, { blockTag: blockHash }); + const contractResult = await contract.getCensuredBy(_who, { blockTag: blockHash }); + const value = contractResult; const result: ValueResult = { value }; return result; diff --git a/packages/censures-watcher/src/resolvers.ts b/packages/censures-watcher/src/resolvers.ts index 9fa4569..348f880 100644 --- a/packages/censures-watcher/src/resolvers.ts +++ b/packages/censures-watcher/src/resolvers.ts @@ -72,780 +72,6 @@ export const createResolvers = async (indexerArg: IndexerInterface, eventWatcher }, Query: { - isActive: ( - _: 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 => { - log('isActive', blockHash, contractAddress, _point); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('isActive').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.isActive(blockHash, contractAddress, _point); - }, - - getKeyRevisionNumber: ( - _: 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 => { - log('getKeyRevisionNumber', blockHash, contractAddress, _point); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getKeyRevisionNumber').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getKeyRevisionNumber(blockHash, contractAddress, _point); - }, - - hasBeenLinked: ( - _: 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 => { - log('hasBeenLinked', blockHash, contractAddress, _point); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('hasBeenLinked').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.hasBeenLinked(blockHash, contractAddress, _point); - }, - - isLive: ( - _: 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 => { - log('isLive', blockHash, contractAddress, _point); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('isLive').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.isLive(blockHash, contractAddress, _point); - }, - - getContinuityNumber: ( - _: 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 => { - log('getContinuityNumber', blockHash, contractAddress, _point); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getContinuityNumber').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getContinuityNumber(blockHash, contractAddress, _point); - }, - - getSpawnCount: ( - _: 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 => { - log('getSpawnCount', blockHash, contractAddress, _point); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getSpawnCount').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getSpawnCount(blockHash, contractAddress, _point); - }, - - getSpawned: ( - _: 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 => { - log('getSpawned', blockHash, contractAddress, _point); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getSpawned').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getSpawned(blockHash, contractAddress, _point); - }, - - hasSponsor: ( - _: 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 => { - log('hasSponsor', blockHash, contractAddress, _point); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('hasSponsor').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.hasSponsor(blockHash, contractAddress, _point); - }, - - getSponsor: ( - _: 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 => { - log('getSponsor', blockHash, contractAddress, _point); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getSponsor').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getSponsor(blockHash, contractAddress, _point); - }, - - isSponsor: ( - _: any, - { blockHash, contractAddress, _point, _sponsor }: { blockHash: string, contractAddress: string, _point: bigint, _sponsor: bigint }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('isSponsor', blockHash, contractAddress, _point, _sponsor); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('isSponsor').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.isSponsor(blockHash, contractAddress, _point, _sponsor); - }, - - getSponsoringCount: ( - _: any, - { blockHash, contractAddress, _sponsor }: { blockHash: string, contractAddress: string, _sponsor: bigint }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('getSponsoringCount', blockHash, contractAddress, _sponsor); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getSponsoringCount').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getSponsoringCount(blockHash, contractAddress, _sponsor); - }, - - getSponsoring: ( - _: any, - { blockHash, contractAddress, _sponsor }: { blockHash: string, contractAddress: string, _sponsor: bigint }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('getSponsoring', blockHash, contractAddress, _sponsor); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getSponsoring').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getSponsoring(blockHash, contractAddress, _sponsor); - }, - - isEscaping: ( - _: 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 => { - log('isEscaping', blockHash, contractAddress, _point); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('isEscaping').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.isEscaping(blockHash, contractAddress, _point); - }, - - getEscapeRequest: ( - _: 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 => { - log('getEscapeRequest', blockHash, contractAddress, _point); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getEscapeRequest').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getEscapeRequest(blockHash, contractAddress, _point); - }, - - isRequestingEscapeTo: ( - _: any, - { blockHash, contractAddress, _point, _sponsor }: { blockHash: string, contractAddress: string, _point: bigint, _sponsor: bigint }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('isRequestingEscapeTo', blockHash, contractAddress, _point, _sponsor); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('isRequestingEscapeTo').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.isRequestingEscapeTo(blockHash, contractAddress, _point, _sponsor); - }, - - getEscapeRequestsCount: ( - _: any, - { blockHash, contractAddress, _sponsor }: { blockHash: string, contractAddress: string, _sponsor: bigint }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('getEscapeRequestsCount', blockHash, contractAddress, _sponsor); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getEscapeRequestsCount').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getEscapeRequestsCount(blockHash, contractAddress, _sponsor); - }, - - getEscapeRequests: ( - _: any, - { blockHash, contractAddress, _sponsor }: { blockHash: string, contractAddress: string, _sponsor: bigint }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('getEscapeRequests', blockHash, contractAddress, _sponsor); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getEscapeRequests').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getEscapeRequests(blockHash, contractAddress, _sponsor); - }, - - getOwner: ( - _: 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 => { - log('getOwner', blockHash, contractAddress, _point); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getOwner').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getOwner(blockHash, contractAddress, _point); - }, - - isOwner: ( - _: any, - { blockHash, contractAddress, _point, _address }: { blockHash: string, contractAddress: string, _point: bigint, _address: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('isOwner', blockHash, contractAddress, _point, _address); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('isOwner').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.isOwner(blockHash, contractAddress, _point, _address); - }, - - getOwnedPointCount: ( - _: any, - { blockHash, contractAddress, _whose }: { blockHash: string, contractAddress: string, _whose: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('getOwnedPointCount', blockHash, contractAddress, _whose); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getOwnedPointCount').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getOwnedPointCount(blockHash, contractAddress, _whose); - }, - - getOwnedPoints: ( - _: any, - { blockHash, contractAddress, _whose }: { blockHash: string, contractAddress: string, _whose: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('getOwnedPoints', blockHash, contractAddress, _whose); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getOwnedPoints').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getOwnedPoints(blockHash, contractAddress, _whose); - }, - - getOwnedPointAtIndex: ( - _: any, - { blockHash, contractAddress, _whose, _index }: { blockHash: string, contractAddress: string, _whose: string, _index: bigint }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('getOwnedPointAtIndex', blockHash, contractAddress, _whose, _index); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getOwnedPointAtIndex').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getOwnedPointAtIndex(blockHash, contractAddress, _whose, _index); - }, - - getManagementProxy: ( - _: 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 => { - log('getManagementProxy', blockHash, contractAddress, _point); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getManagementProxy').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getManagementProxy(blockHash, contractAddress, _point); - }, - - isManagementProxy: ( - _: any, - { blockHash, contractAddress, _point, _proxy }: { blockHash: string, contractAddress: string, _point: bigint, _proxy: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('isManagementProxy', blockHash, contractAddress, _point, _proxy); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('isManagementProxy').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.isManagementProxy(blockHash, contractAddress, _point, _proxy); - }, - - canManage: ( - _: any, - { blockHash, contractAddress, _point, _who }: { blockHash: string, contractAddress: string, _point: bigint, _who: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('canManage', blockHash, contractAddress, _point, _who); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('canManage').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.canManage(blockHash, contractAddress, _point, _who); - }, - - getManagerForCount: ( - _: any, - { blockHash, contractAddress, _proxy }: { blockHash: string, contractAddress: string, _proxy: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('getManagerForCount', blockHash, contractAddress, _proxy); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getManagerForCount').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getManagerForCount(blockHash, contractAddress, _proxy); - }, - - getManagerFor: ( - _: any, - { blockHash, contractAddress, _proxy }: { blockHash: string, contractAddress: string, _proxy: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('getManagerFor', blockHash, contractAddress, _proxy); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getManagerFor').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getManagerFor(blockHash, contractAddress, _proxy); - }, - - getSpawnProxy: ( - _: 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 => { - log('getSpawnProxy', blockHash, contractAddress, _point); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getSpawnProxy').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getSpawnProxy(blockHash, contractAddress, _point); - }, - - isSpawnProxy: ( - _: any, - { blockHash, contractAddress, _point, _proxy }: { blockHash: string, contractAddress: string, _point: bigint, _proxy: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('isSpawnProxy', blockHash, contractAddress, _point, _proxy); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('isSpawnProxy').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.isSpawnProxy(blockHash, contractAddress, _point, _proxy); - }, - - canSpawnAs: ( - _: any, - { blockHash, contractAddress, _point, _who }: { blockHash: string, contractAddress: string, _point: bigint, _who: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('canSpawnAs', blockHash, contractAddress, _point, _who); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('canSpawnAs').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.canSpawnAs(blockHash, contractAddress, _point, _who); - }, - - getSpawningForCount: ( - _: any, - { blockHash, contractAddress, _proxy }: { blockHash: string, contractAddress: string, _proxy: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('getSpawningForCount', blockHash, contractAddress, _proxy); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getSpawningForCount').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getSpawningForCount(blockHash, contractAddress, _proxy); - }, - - getSpawningFor: ( - _: any, - { blockHash, contractAddress, _proxy }: { blockHash: string, contractAddress: string, _proxy: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('getSpawningFor', blockHash, contractAddress, _proxy); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getSpawningFor').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getSpawningFor(blockHash, contractAddress, _proxy); - }, - - getVotingProxy: ( - _: 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 => { - log('getVotingProxy', blockHash, contractAddress, _point); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getVotingProxy').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getVotingProxy(blockHash, contractAddress, _point); - }, - - isVotingProxy: ( - _: any, - { blockHash, contractAddress, _point, _proxy }: { blockHash: string, contractAddress: string, _point: bigint, _proxy: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('isVotingProxy', blockHash, contractAddress, _point, _proxy); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('isVotingProxy').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.isVotingProxy(blockHash, contractAddress, _point, _proxy); - }, - - canVoteAs: ( - _: any, - { blockHash, contractAddress, _point, _who }: { blockHash: string, contractAddress: string, _point: bigint, _who: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('canVoteAs', blockHash, contractAddress, _point, _who); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('canVoteAs').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.canVoteAs(blockHash, contractAddress, _point, _who); - }, - - getVotingForCount: ( - _: any, - { blockHash, contractAddress, _proxy }: { blockHash: string, contractAddress: string, _proxy: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('getVotingForCount', blockHash, contractAddress, _proxy); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getVotingForCount').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getVotingForCount(blockHash, contractAddress, _proxy); - }, - - getVotingFor: ( - _: any, - { blockHash, contractAddress, _proxy }: { blockHash: string, contractAddress: string, _proxy: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('getVotingFor', blockHash, contractAddress, _proxy); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getVotingFor').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getVotingFor(blockHash, contractAddress, _proxy); - }, - - getTransferProxy: ( - _: 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 => { - log('getTransferProxy', blockHash, contractAddress, _point); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getTransferProxy').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getTransferProxy(blockHash, contractAddress, _point); - }, - - isTransferProxy: ( - _: any, - { blockHash, contractAddress, _point, _proxy }: { blockHash: string, contractAddress: string, _point: bigint, _proxy: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('isTransferProxy', blockHash, contractAddress, _point, _proxy); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('isTransferProxy').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.isTransferProxy(blockHash, contractAddress, _point, _proxy); - }, - - canTransfer: ( - _: any, - { blockHash, contractAddress, _point, _who }: { blockHash: string, contractAddress: string, _point: bigint, _who: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('canTransfer', blockHash, contractAddress, _point, _who); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('canTransfer').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.canTransfer(blockHash, contractAddress, _point, _who); - }, - - getTransferringForCount: ( - _: any, - { blockHash, contractAddress, _proxy }: { blockHash: string, contractAddress: string, _proxy: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('getTransferringForCount', blockHash, contractAddress, _proxy); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getTransferringForCount').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getTransferringForCount(blockHash, contractAddress, _proxy); - }, - - getTransferringFor: ( - _: any, - { blockHash, contractAddress, _proxy }: { blockHash: string, contractAddress: string, _proxy: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('getTransferringFor', blockHash, contractAddress, _proxy); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('getTransferringFor').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.getTransferringFor(blockHash, contractAddress, _proxy); - }, - - isOperator: ( - _: any, - { blockHash, contractAddress, _owner, _operator }: { blockHash: string, contractAddress: string, _owner: string, _operator: string }, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - __: any, - // eslint-disable-next-line @typescript-eslint/no-unused-vars - info: GraphQLResolveInfo - ): Promise => { - log('isOperator', blockHash, contractAddress, _owner, _operator); - gqlTotalQueryCount.inc(1); - gqlQueryCount.labels('isOperator').inc(1); - - // Set cache-control hints - // setGQLCacheHints(info, {}, gqlCacheConfig); - - return indexer.isOperator(blockHash, contractAddress, _owner, _operator); - }, - getCensuringCount: ( _: any, { blockHash, contractAddress, _whose }: { blockHash: string, contractAddress: string, _whose: number }, diff --git a/packages/censures-watcher/src/schema.gql b/packages/censures-watcher/src/schema.gql index f80cded..c9abff2 100644 --- a/packages/censures-watcher/src/schema.gql +++ b/packages/censures-watcher/src/schema.gql @@ -51,11 +51,6 @@ type ForgivenEvent { who: BigInt! } -type ResultBoolean { - value: Boolean! - proof: Proof -} - type ResultBigInt { value: BigInt! proof: Proof @@ -66,11 +61,6 @@ type ResultBigIntArray { proof: Proof } -type ResultString { - value: String! - proof: Proof -} - type ResultIntArray { value: [Int!]! proof: Proof @@ -94,49 +84,6 @@ type ResultState { type Query { events(blockHash: String!, contractAddress: String!, name: String): [ResultEvent!] eventsInRange(fromBlockNumber: Int!, toBlockNumber: Int!): [ResultEvent!] - isActive(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean! - getKeyRevisionNumber(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBigInt! - hasBeenLinked(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean! - isLive(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean! - getContinuityNumber(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBigInt! - getSpawnCount(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBigInt! - getSpawned(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBigIntArray! - hasSponsor(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean! - getSponsor(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBigInt! - isSponsor(blockHash: String!, contractAddress: String!, _point: BigInt!, _sponsor: BigInt!): ResultBoolean! - getSponsoringCount(blockHash: String!, contractAddress: String!, _sponsor: BigInt!): ResultBigInt! - getSponsoring(blockHash: String!, contractAddress: String!, _sponsor: BigInt!): ResultBigIntArray! - isEscaping(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBoolean! - getEscapeRequest(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultBigInt! - isRequestingEscapeTo(blockHash: String!, contractAddress: String!, _point: BigInt!, _sponsor: BigInt!): ResultBoolean! - getEscapeRequestsCount(blockHash: String!, contractAddress: String!, _sponsor: BigInt!): ResultBigInt! - getEscapeRequests(blockHash: String!, contractAddress: String!, _sponsor: BigInt!): ResultBigIntArray! - getOwner(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultString! - isOwner(blockHash: String!, contractAddress: String!, _point: BigInt!, _address: String!): ResultBoolean! - getOwnedPointCount(blockHash: String!, contractAddress: String!, _whose: String!): ResultBigInt! - getOwnedPoints(blockHash: String!, contractAddress: String!, _whose: String!): ResultBigIntArray! - getOwnedPointAtIndex(blockHash: String!, contractAddress: String!, _whose: String!, _index: BigInt!): ResultBigInt! - getManagementProxy(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultString! - isManagementProxy(blockHash: String!, contractAddress: String!, _point: BigInt!, _proxy: String!): ResultBoolean! - canManage(blockHash: String!, contractAddress: String!, _point: BigInt!, _who: String!): ResultBoolean! - getManagerForCount(blockHash: String!, contractAddress: String!, _proxy: String!): ResultBigInt! - getManagerFor(blockHash: String!, contractAddress: String!, _proxy: String!): ResultBigIntArray! - getSpawnProxy(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultString! - isSpawnProxy(blockHash: String!, contractAddress: String!, _point: BigInt!, _proxy: String!): ResultBoolean! - canSpawnAs(blockHash: String!, contractAddress: String!, _point: BigInt!, _who: String!): ResultBoolean! - getSpawningForCount(blockHash: String!, contractAddress: String!, _proxy: String!): ResultBigInt! - getSpawningFor(blockHash: String!, contractAddress: String!, _proxy: String!): ResultBigIntArray! - getVotingProxy(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultString! - isVotingProxy(blockHash: String!, contractAddress: String!, _point: BigInt!, _proxy: String!): ResultBoolean! - canVoteAs(blockHash: String!, contractAddress: String!, _point: BigInt!, _who: String!): ResultBoolean! - getVotingForCount(blockHash: String!, contractAddress: String!, _proxy: String!): ResultBigInt! - getVotingFor(blockHash: String!, contractAddress: String!, _proxy: String!): ResultBigIntArray! - getTransferProxy(blockHash: String!, contractAddress: String!, _point: BigInt!): ResultString! - isTransferProxy(blockHash: String!, contractAddress: String!, _point: BigInt!, _proxy: String!): ResultBoolean! - canTransfer(blockHash: String!, contractAddress: String!, _point: BigInt!, _who: String!): ResultBoolean! - getTransferringForCount(blockHash: String!, contractAddress: String!, _proxy: String!): ResultBigInt! - getTransferringFor(blockHash: String!, contractAddress: String!, _proxy: String!): ResultBigIntArray! - isOperator(blockHash: String!, contractAddress: String!, _owner: String!, _operator: String!): ResultBoolean! getCensuringCount(blockHash: String!, contractAddress: String!, _whose: Int!): ResultBigInt! getCensuring(blockHash: String!, contractAddress: String!, _whose: Int!): ResultBigIntArray! getCensuredByCount(blockHash: String!, contractAddress: String!, _who: Int!): ResultBigInt!