@xyo-network/evm-token-interface-diviner 5.3.1 → 5.3.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,5 +1,5 @@
1
1
  // src/Diviner.ts
2
- import { assertEx } from "@xylabs/assert";
2
+ import { assertEx } from "@xylabs/sdk-js";
3
3
  import { AbstractDiviner } from "@xyo-network/diviner-abstract";
4
4
  import { isEvmContract } from "@xyo-network/evm-contract-witness";
5
5
  import {
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/Diviner.ts","../../src/Payload.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type { DivinerConfig, DivinerParams } from '@xyo-network/diviner-model'\nimport type { EvmContract } from '@xyo-network/evm-contract-witness'\nimport { isEvmContract } from '@xyo-network/evm-contract-witness'\nimport type { AnyConfigSchema } from '@xyo-network/module-model'\nimport {\n ERC20__factory,\n ERC721__factory,\n ERC1155__factory,\n IERC721Enumerable__factory,\n IERC721Metadata__factory,\n IERC721Receiver__factory,\n IERC1155MetadataURI__factory,\n IERC1155Receiver__factory,\n} from '@xyo-network/open-zeppelin-typechain'\nimport { asSchema, type Schema } from '@xyo-network/payload-model'\nimport type { JsonFragment } from 'ethers'\nimport { Interface } from 'ethers'\n\nimport type { EvmTokenInterfaceImplemented, TokenInterface } from './Payload.ts'\nimport { EvmTokenInterfaceImplementedSchema } from './Payload.ts'\n\nexport const EvmTokenInterfaceImplementedDivinerConfigSchema = asSchema(`${EvmTokenInterfaceImplementedSchema}.diviner.config`, true)\nexport type EvmTokenInterfaceImplementedDivinerConfigSchema = typeof EvmTokenInterfaceImplementedDivinerConfigSchema\n\nexport type EvmTokenInterfaceImplementedDivinerConfig = DivinerConfig<{\n schema: EvmTokenInterfaceImplementedDivinerConfigSchema\n tokenInterfaces?: TokenInterface[]\n}>\n\nexport type EvmTokenInterfaceImplementedDivinerParams = DivinerParams<AnyConfigSchema<EvmTokenInterfaceImplementedDivinerConfig>>\n\ntype DistributiveMappedType<T> = T extends string ? { [K in T]: readonly JsonFragment[] } : never\ntype TokenInterfaceDictionary = DistributiveMappedType<TokenInterface>\n\n/**\n * A diviner that checks if a contract implements a token interface\n */\nexport class EvmTokenInterfaceImplementedDiviner<\n TParams extends EvmTokenInterfaceImplementedDivinerParams = EvmTokenInterfaceImplementedDivinerParams,\n> extends AbstractDiviner<TParams, EvmContract, EvmTokenInterfaceImplemented> {\n /**\n * The list of supported token interfaces\n */\n static readonly SupportedTokenInterfaces: Readonly<Record<TokenInterface, readonly JsonFragment[]>> = {\n ERC1155: ERC1155__factory.abi,\n ERC1155Metadata_URI: IERC1155MetadataURI__factory.abi,\n ERC1155TokenReceiver: IERC1155Receiver__factory.abi,\n ERC20: ERC20__factory.abi,\n ERC721: ERC721__factory.abi,\n ERC721Enumerable: IERC721Enumerable__factory.abi,\n ERC721Metadata: IERC721Metadata__factory.abi,\n ERC721TokenReceiver: IERC721Receiver__factory.abi,\n }\n\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EvmTokenInterfaceImplementedDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = EvmTokenInterfaceImplementedDivinerConfigSchema\n\n private _tokenInterfaces?: TokenInterfaceDictionary\n\n /**\n * The list of token interfaces to check against the contract\n */\n get tokenInterfaces() {\n if (!this._tokenInterfaces) {\n this._tokenInterfaces\n = this.config?.tokenInterfaces\n ? ((Object.fromEntries(\n this.config?.tokenInterfaces.map((tokenInterface) => {\n return [tokenInterface, EvmTokenInterfaceImplementedDiviner.SupportedTokenInterfaces[tokenInterface]] as const\n }),\n ) as TokenInterfaceDictionary) ?? {})\n : EvmTokenInterfaceImplementedDiviner.SupportedTokenInterfaces\n }\n return this._tokenInterfaces\n }\n\n protected override async divineHandler(inPayloads: EvmContract[] = []): Promise<EvmTokenInterfaceImplemented[]> {\n await this.started('throw')\n try {\n const allResults = await Promise.all(\n // Iterate over each contract passed in\n inPayloads.filter(isEvmContract).map(({\n address, code, chainId,\n }) => {\n // Ensure we have the contract code\n const byteCode = assertEx(code, () => 'Missing code')\n const results: EvmTokenInterfaceImplemented[] = []\n // Iterate over each token interface\n for (const [tokenInterface, abi] of Object.entries(this.tokenInterfaces)) {\n // Check if the contract implements the interface abi\n const contractInterface = new Interface(abi)\n const implementations: boolean[] = []\n contractInterface.forEachFunction(({ selector }) => {\n implementations.push(byteCode.includes(BigInt(selector).toString(16)))\n })\n const implemented = implementations.every(Boolean)\n const result: EvmTokenInterfaceImplemented = {\n address,\n chainId,\n implemented,\n schema: EvmTokenInterfaceImplementedSchema,\n tokenInterface: tokenInterface as TokenInterface,\n }\n results.push(result)\n }\n\n return results\n }),\n )\n return allResults.flat()\n } catch (ex) {\n const error = ex as Error\n console.log(`Error [${this.config.name}]: ${error.message}`)\n throw error\n }\n }\n}\n","import type { Payload } from '@xyo-network/payload-model'\nimport { asSchema, isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\n/**\n * ERC20 Token Interfaces\n */\nexport type ERC20TokenInterfaces = 'ERC20'\n\n/**\n * ERC721 Token Interfaces\n */\nexport type ERC721TokenInterfaces = 'ERC721' | 'ERC721TokenReceiver' | 'ERC721Metadata' | 'ERC721Enumerable'\n\n/**\n * ERC1155 Token Interfaces\n */\nexport type ERC1155TokenInterfaces = 'ERC1155' | 'ERC1155TokenReceiver' | 'ERC1155Metadata_URI'\n\n/**\n * All Token Interfaces\n */\nexport type TokenInterface = ERC20TokenInterfaces | ERC721TokenInterfaces | ERC1155TokenInterfaces\n\n/**\n * The schema for the EVM Token Interface Implemented payload\n */\nexport const EvmTokenInterfaceImplementedSchema = asSchema('network.xyo.evm.token.interface.implemented', true)\n/**\n * The schema for the EVM Token Interface Implemented payload\n */\nexport type EvmTokenInterfaceImplementedSchema = typeof EvmTokenInterfaceImplementedSchema\n\n/**\n * The EVM Token Interface Implemented payload\n */\nexport type EvmTokenInterfaceImplemented = Payload<\n {\n /**\n * The contract address\n */\n address: string\n /**\n * The chain id\n */\n chainId: number\n /**\n * True if the contract implements the interface\n */\n implemented: boolean\n /**\n * The specific token interface\n */\n tokenInterface: TokenInterface\n },\n EvmTokenInterfaceImplementedSchema\n>\n\n/**\n * Identity function for EvmTokenInterfaceImplemented payload\n */\nexport const isEvmTokenInterfaceImplemented = isPayloadOfSchemaType<EvmTokenInterfaceImplemented>(EvmTokenInterfaceImplementedSchema)\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAGhC,SAAS,qBAAqB;AAE9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,YAAAA,iBAA6B;AAEtC,SAAS,iBAAiB;;;ACjB1B,SAAS,UAAU,6BAA6B;AAyBzC,IAAM,qCAAqC,SAAS,+CAA+C,IAAI;AAkCvG,IAAM,iCAAiC,sBAAoD,kCAAkC;;;ADrC7H,IAAM,kDAAkDC,UAAS,GAAG,kCAAkC,mBAAmB,IAAI;AAgB7H,IAAM,sCAAN,MAAM,6CAEH,gBAAoE;AAAA;AAAA;AAAA;AAAA,EAI5E,OAAgB,2BAAsF;AAAA,IACpG,SAAS,iBAAiB;AAAA,IAC1B,qBAAqB,6BAA6B;AAAA,IAClD,sBAAsB,0BAA0B;AAAA,IAChD,OAAO,eAAe;AAAA,IACtB,QAAQ,gBAAgB;AAAA,IACxB,kBAAkB,2BAA2B;AAAA,IAC7C,gBAAgB,yBAAyB;AAAA,IACzC,qBAAqB,yBAAyB;AAAA,EAChD;AAAA,EAEA,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,+CAA+C;AAAA,EAC3H,OAAyB,sBAA8B;AAAA,EAE/C;AAAA;AAAA;AAAA;AAAA,EAKR,IAAI,kBAAkB;AACpB,QAAI,CAAC,KAAK,kBAAkB;AAC1B,WAAK,mBACD,KAAK,QAAQ,kBACT,OAAO;AAAA,QACP,KAAK,QAAQ,gBAAgB,IAAI,CAAC,mBAAmB;AACnD,iBAAO,CAAC,gBAAgB,qCAAoC,yBAAyB,cAAc,CAAC;AAAA,QACtG,CAAC;AAAA,MACH,KAAkC,CAAC,IACnC,qCAAoC;AAAA,IAC5C;AACA,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAyB,cAAc,aAA4B,CAAC,GAA4C;AAC9G,UAAM,KAAK,QAAQ,OAAO;AAC1B,QAAI;AACF,YAAM,aAAa,MAAM,QAAQ;AAAA;AAAA,QAE/B,WAAW,OAAO,aAAa,EAAE,IAAI,CAAC;AAAA,UACpC;AAAA,UAAS;AAAA,UAAM;AAAA,QACjB,MAAM;AAEJ,gBAAM,WAAW,SAAS,MAAM,MAAM,cAAc;AACpD,gBAAM,UAA0C,CAAC;AAEjD,qBAAW,CAAC,gBAAgB,GAAG,KAAK,OAAO,QAAQ,KAAK,eAAe,GAAG;AAExE,kBAAM,oBAAoB,IAAI,UAAU,GAAG;AAC3C,kBAAM,kBAA6B,CAAC;AACpC,8BAAkB,gBAAgB,CAAC,EAAE,SAAS,MAAM;AAClD,8BAAgB,KAAK,SAAS,SAAS,OAAO,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;AAAA,YACvE,CAAC;AACD,kBAAM,cAAc,gBAAgB,MAAM,OAAO;AACjD,kBAAM,SAAuC;AAAA,cAC3C;AAAA,cACA;AAAA,cACA;AAAA,cACA,QAAQ;AAAA,cACR;AAAA,YACF;AACA,oBAAQ,KAAK,MAAM;AAAA,UACrB;AAEA,iBAAO;AAAA,QACT,CAAC;AAAA,MACH;AACA,aAAO,WAAW,KAAK;AAAA,IACzB,SAAS,IAAI;AACX,YAAM,QAAQ;AACd,cAAQ,IAAI,UAAU,KAAK,OAAO,IAAI,MAAM,MAAM,OAAO,EAAE;AAC3D,YAAM;AAAA,IACR;AAAA,EACF;AACF;","names":["asSchema","asSchema"]}
1
+ {"version":3,"sources":["../../src/Diviner.ts","../../src/Payload.ts"],"sourcesContent":["import { assertEx } from '@xylabs/sdk-js'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type { DivinerConfig, DivinerParams } from '@xyo-network/diviner-model'\nimport type { EvmContract } from '@xyo-network/evm-contract-witness'\nimport { isEvmContract } from '@xyo-network/evm-contract-witness'\nimport type { AnyConfigSchema } from '@xyo-network/module-model'\nimport {\n ERC20__factory,\n ERC721__factory,\n ERC1155__factory,\n IERC721Enumerable__factory,\n IERC721Metadata__factory,\n IERC721Receiver__factory,\n IERC1155MetadataURI__factory,\n IERC1155Receiver__factory,\n} from '@xyo-network/open-zeppelin-typechain'\nimport { asSchema, type Schema } from '@xyo-network/payload-model'\nimport type { JsonFragment } from 'ethers'\nimport { Interface } from 'ethers'\n\nimport type { EvmTokenInterfaceImplemented, TokenInterface } from './Payload.ts'\nimport { EvmTokenInterfaceImplementedSchema } from './Payload.ts'\n\nexport const EvmTokenInterfaceImplementedDivinerConfigSchema = asSchema(`${EvmTokenInterfaceImplementedSchema}.diviner.config`, true)\nexport type EvmTokenInterfaceImplementedDivinerConfigSchema = typeof EvmTokenInterfaceImplementedDivinerConfigSchema\n\nexport type EvmTokenInterfaceImplementedDivinerConfig = DivinerConfig<{\n schema: EvmTokenInterfaceImplementedDivinerConfigSchema\n tokenInterfaces?: TokenInterface[]\n}>\n\nexport type EvmTokenInterfaceImplementedDivinerParams = DivinerParams<AnyConfigSchema<EvmTokenInterfaceImplementedDivinerConfig>>\n\ntype DistributiveMappedType<T> = T extends string ? { [K in T]: readonly JsonFragment[] } : never\ntype TokenInterfaceDictionary = DistributiveMappedType<TokenInterface>\n\n/**\n * A diviner that checks if a contract implements a token interface\n */\nexport class EvmTokenInterfaceImplementedDiviner<\n TParams extends EvmTokenInterfaceImplementedDivinerParams = EvmTokenInterfaceImplementedDivinerParams,\n> extends AbstractDiviner<TParams, EvmContract, EvmTokenInterfaceImplemented> {\n /**\n * The list of supported token interfaces\n */\n static readonly SupportedTokenInterfaces: Readonly<Record<TokenInterface, readonly JsonFragment[]>> = {\n ERC1155: ERC1155__factory.abi,\n ERC1155Metadata_URI: IERC1155MetadataURI__factory.abi,\n ERC1155TokenReceiver: IERC1155Receiver__factory.abi,\n ERC20: ERC20__factory.abi,\n ERC721: ERC721__factory.abi,\n ERC721Enumerable: IERC721Enumerable__factory.abi,\n ERC721Metadata: IERC721Metadata__factory.abi,\n ERC721TokenReceiver: IERC721Receiver__factory.abi,\n }\n\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EvmTokenInterfaceImplementedDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = EvmTokenInterfaceImplementedDivinerConfigSchema\n\n private _tokenInterfaces?: TokenInterfaceDictionary\n\n /**\n * The list of token interfaces to check against the contract\n */\n get tokenInterfaces() {\n if (!this._tokenInterfaces) {\n this._tokenInterfaces\n = this.config?.tokenInterfaces\n ? ((Object.fromEntries(\n this.config?.tokenInterfaces.map((tokenInterface) => {\n return [tokenInterface, EvmTokenInterfaceImplementedDiviner.SupportedTokenInterfaces[tokenInterface]] as const\n }),\n ) as TokenInterfaceDictionary) ?? {})\n : EvmTokenInterfaceImplementedDiviner.SupportedTokenInterfaces\n }\n return this._tokenInterfaces\n }\n\n protected override async divineHandler(inPayloads: EvmContract[] = []): Promise<EvmTokenInterfaceImplemented[]> {\n await this.started('throw')\n try {\n const allResults = await Promise.all(\n // Iterate over each contract passed in\n inPayloads.filter(isEvmContract).map(({\n address, code, chainId,\n }) => {\n // Ensure we have the contract code\n const byteCode = assertEx(code, () => 'Missing code')\n const results: EvmTokenInterfaceImplemented[] = []\n // Iterate over each token interface\n for (const [tokenInterface, abi] of Object.entries(this.tokenInterfaces)) {\n // Check if the contract implements the interface abi\n const contractInterface = new Interface(abi)\n const implementations: boolean[] = []\n contractInterface.forEachFunction(({ selector }) => {\n implementations.push(byteCode.includes(BigInt(selector).toString(16)))\n })\n const implemented = implementations.every(Boolean)\n const result: EvmTokenInterfaceImplemented = {\n address,\n chainId,\n implemented,\n schema: EvmTokenInterfaceImplementedSchema,\n tokenInterface: tokenInterface as TokenInterface,\n }\n results.push(result)\n }\n\n return results\n }),\n )\n return allResults.flat()\n } catch (ex) {\n const error = ex as Error\n console.log(`Error [${this.config.name}]: ${error.message}`)\n throw error\n }\n }\n}\n","import type { Payload } from '@xyo-network/payload-model'\nimport { asSchema, isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\n/**\n * ERC20 Token Interfaces\n */\nexport type ERC20TokenInterfaces = 'ERC20'\n\n/**\n * ERC721 Token Interfaces\n */\nexport type ERC721TokenInterfaces = 'ERC721' | 'ERC721TokenReceiver' | 'ERC721Metadata' | 'ERC721Enumerable'\n\n/**\n * ERC1155 Token Interfaces\n */\nexport type ERC1155TokenInterfaces = 'ERC1155' | 'ERC1155TokenReceiver' | 'ERC1155Metadata_URI'\n\n/**\n * All Token Interfaces\n */\nexport type TokenInterface = ERC20TokenInterfaces | ERC721TokenInterfaces | ERC1155TokenInterfaces\n\n/**\n * The schema for the EVM Token Interface Implemented payload\n */\nexport const EvmTokenInterfaceImplementedSchema = asSchema('network.xyo.evm.token.interface.implemented', true)\n/**\n * The schema for the EVM Token Interface Implemented payload\n */\nexport type EvmTokenInterfaceImplementedSchema = typeof EvmTokenInterfaceImplementedSchema\n\n/**\n * The EVM Token Interface Implemented payload\n */\nexport type EvmTokenInterfaceImplemented = Payload<\n {\n /**\n * The contract address\n */\n address: string\n /**\n * The chain id\n */\n chainId: number\n /**\n * True if the contract implements the interface\n */\n implemented: boolean\n /**\n * The specific token interface\n */\n tokenInterface: TokenInterface\n },\n EvmTokenInterfaceImplementedSchema\n>\n\n/**\n * Identity function for EvmTokenInterfaceImplemented payload\n */\nexport const isEvmTokenInterfaceImplemented = isPayloadOfSchemaType<EvmTokenInterfaceImplemented>(EvmTokenInterfaceImplementedSchema)\n"],"mappings":";AAAA,SAAS,gBAAgB;AACzB,SAAS,uBAAuB;AAGhC,SAAS,qBAAqB;AAE9B;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,YAAAA,iBAA6B;AAEtC,SAAS,iBAAiB;;;ACjB1B,SAAS,UAAU,6BAA6B;AAyBzC,IAAM,qCAAqC,SAAS,+CAA+C,IAAI;AAkCvG,IAAM,iCAAiC,sBAAoD,kCAAkC;;;ADrC7H,IAAM,kDAAkDC,UAAS,GAAG,kCAAkC,mBAAmB,IAAI;AAgB7H,IAAM,sCAAN,MAAM,6CAEH,gBAAoE;AAAA;AAAA;AAAA;AAAA,EAI5E,OAAgB,2BAAsF;AAAA,IACpG,SAAS,iBAAiB;AAAA,IAC1B,qBAAqB,6BAA6B;AAAA,IAClD,sBAAsB,0BAA0B;AAAA,IAChD,OAAO,eAAe;AAAA,IACtB,QAAQ,gBAAgB;AAAA,IACxB,kBAAkB,2BAA2B;AAAA,IAC7C,gBAAgB,yBAAyB;AAAA,IACzC,qBAAqB,yBAAyB;AAAA,EAChD;AAAA,EAEA,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,+CAA+C;AAAA,EAC3H,OAAyB,sBAA8B;AAAA,EAE/C;AAAA;AAAA;AAAA;AAAA,EAKR,IAAI,kBAAkB;AACpB,QAAI,CAAC,KAAK,kBAAkB;AAC1B,WAAK,mBACD,KAAK,QAAQ,kBACT,OAAO;AAAA,QACP,KAAK,QAAQ,gBAAgB,IAAI,CAAC,mBAAmB;AACnD,iBAAO,CAAC,gBAAgB,qCAAoC,yBAAyB,cAAc,CAAC;AAAA,QACtG,CAAC;AAAA,MACH,KAAkC,CAAC,IACnC,qCAAoC;AAAA,IAC5C;AACA,WAAO,KAAK;AAAA,EACd;AAAA,EAEA,MAAyB,cAAc,aAA4B,CAAC,GAA4C;AAC9G,UAAM,KAAK,QAAQ,OAAO;AAC1B,QAAI;AACF,YAAM,aAAa,MAAM,QAAQ;AAAA;AAAA,QAE/B,WAAW,OAAO,aAAa,EAAE,IAAI,CAAC;AAAA,UACpC;AAAA,UAAS;AAAA,UAAM;AAAA,QACjB,MAAM;AAEJ,gBAAM,WAAW,SAAS,MAAM,MAAM,cAAc;AACpD,gBAAM,UAA0C,CAAC;AAEjD,qBAAW,CAAC,gBAAgB,GAAG,KAAK,OAAO,QAAQ,KAAK,eAAe,GAAG;AAExE,kBAAM,oBAAoB,IAAI,UAAU,GAAG;AAC3C,kBAAM,kBAA6B,CAAC;AACpC,8BAAkB,gBAAgB,CAAC,EAAE,SAAS,MAAM;AAClD,8BAAgB,KAAK,SAAS,SAAS,OAAO,QAAQ,EAAE,SAAS,EAAE,CAAC,CAAC;AAAA,YACvE,CAAC;AACD,kBAAM,cAAc,gBAAgB,MAAM,OAAO;AACjD,kBAAM,SAAuC;AAAA,cAC3C;AAAA,cACA;AAAA,cACA;AAAA,cACA,QAAQ;AAAA,cACR;AAAA,YACF;AACA,oBAAQ,KAAK,MAAM;AAAA,UACrB;AAEA,iBAAO;AAAA,QACT,CAAC;AAAA,MACH;AACA,aAAO,WAAW,KAAK;AAAA,IACzB,SAAS,IAAI;AACX,YAAM,QAAQ;AACd,cAAQ,IAAI,UAAU,KAAK,OAAO,IAAI,MAAM,MAAM,OAAO,EAAE;AAC3D,YAAM;AAAA,IACR;AAAA,EACF;AACF;","names":["asSchema","asSchema"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xyo-network/evm-token-interface-diviner",
3
- "version": "5.3.1",
3
+ "version": "5.3.3",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -30,46 +30,52 @@
30
30
  "types": "dist/neutral/index.d.ts",
31
31
  "files": [
32
32
  "dist",
33
- "src",
34
- "!**/*.bench.*",
35
- "!**/*.spec.*",
36
- "!**/*.test.*"
33
+ "README.md"
37
34
  ],
38
35
  "dependencies": {
39
- "@xylabs/assert": "~5.0.64",
40
- "@xyo-network/diviner-abstract": "~5.3.2",
41
- "@xyo-network/diviner-model": "~5.3.2",
42
- "@xyo-network/evm-contract-witness": "5.3.1",
43
- "@xyo-network/module-model": "~5.3.2",
44
- "@xyo-network/open-zeppelin-typechain": "~4.1.1",
45
- "@xyo-network/payload-model": "~5.3.2",
46
- "ethers": "^6.16.0"
36
+ "@xyo-network/evm-contract-witness": "workspace:^"
47
37
  },
48
38
  "devDependencies": {
49
- "@xylabs/delay": "~5.0.64",
50
- "@xylabs/ts-scripts-yarn3": "~7.3.2",
51
- "@xylabs/tsconfig": "~7.3.2",
52
- "@xylabs/vitest-extended": "~5.0.64",
53
- "@xyo-network/archivist-memory": "~5.3.2",
54
- "@xyo-network/boundwitness-model": "~5.3.2",
55
- "@xyo-network/diviner-boundwitness-memory": "~5.3.2",
56
- "@xyo-network/diviner-jsonpatch": "~5.3.2",
57
- "@xyo-network/diviner-payload-generic": "~5.3.2",
58
- "@xyo-network/diviner-payload-memory": "~5.3.2",
59
- "@xyo-network/diviner-payload-model": "~5.3.2",
60
- "@xyo-network/diviner-stateful": "~5.3.2",
61
- "@xyo-network/diviner-temporal-indexing": "~5.3.2",
62
- "@xyo-network/manifest": "~5.3.2",
63
- "@xyo-network/module-factory-locator": "~5.3.2",
64
- "@xyo-network/node-memory": "~5.3.2",
39
+ "@xylabs/sdk-js": "^5.0.90",
40
+ "@xylabs/ts-scripts-common": "~7.5.10",
41
+ "@xylabs/ts-scripts-yarn3": "~7.5.10",
42
+ "@xylabs/tsconfig": "~7.5.10",
43
+ "@xylabs/vitest-extended": "~5.0.90",
44
+ "@xyo-network/archivist-memory": "~5.3.5",
45
+ "@xyo-network/boundwitness-model": "~5.3.5",
46
+ "@xyo-network/diviner-abstract": "~5.3.5",
47
+ "@xyo-network/diviner-boundwitness-memory": "~5.3.5",
48
+ "@xyo-network/diviner-jsonpatch": "~5.3.5",
49
+ "@xyo-network/diviner-model": "~5.3.5",
50
+ "@xyo-network/diviner-payload-generic": "~5.3.5",
51
+ "@xyo-network/diviner-payload-model": "~5.3.5",
52
+ "@xyo-network/diviner-stateful": "~5.3.5",
53
+ "@xyo-network/diviner-temporal-indexing": "~5.3.5",
54
+ "@xyo-network/module-factory-locator": "~5.3.5",
55
+ "@xyo-network/module-model": "~5.3.5",
56
+ "@xyo-network/node-memory": "~5.3.5",
65
57
  "@xyo-network/open-zeppelin-typechain": "~4.1.1",
66
- "@xyo-network/sentinel-model": "~5.3.2",
67
- "@xyo-network/wallet": "~5.3.2",
68
- "@xyo-network/wallet-model": "~5.3.2",
69
- "@xyo-network/witness-evm-abstract": "~5.3.2",
70
- "@xyo-network/witness-timestamp": "~5.3.2",
58
+ "@xyo-network/payload-model": "~5.3.5",
59
+ "@xyo-network/sdk-js": "~5.3.5",
60
+ "@xyo-network/sentinel-model": "~5.3.5",
61
+ "@xyo-network/wallet": "~5.3.5",
62
+ "@xyo-network/wallet-model": "~5.3.5",
63
+ "@xyo-network/witness-evm-abstract": "~5.3.5",
64
+ "@xyo-network/witness-timestamp": "~5.3.5",
65
+ "ethers": "^6.16.0",
71
66
  "typescript": "~5.9.3",
72
- "vitest": "~4.0.18"
67
+ "vitest": "~4.1.2",
68
+ "zod": "^4.3.6"
69
+ },
70
+ "peerDependencies": {
71
+ "@xylabs/sdk-js": "^5",
72
+ "@xyo-network/diviner-abstract": "^5",
73
+ "@xyo-network/diviner-model": "^5",
74
+ "@xyo-network/module-model": "^5",
75
+ "@xyo-network/open-zeppelin-typechain": "^4",
76
+ "@xyo-network/payload-model": "^5",
77
+ "ethers": "^6",
78
+ "zod": "^4"
73
79
  },
74
80
  "publishConfig": {
75
81
  "access": "public"
package/src/Diviner.ts DELETED
@@ -1,119 +0,0 @@
1
- import { assertEx } from '@xylabs/assert'
2
- import { AbstractDiviner } from '@xyo-network/diviner-abstract'
3
- import type { DivinerConfig, DivinerParams } from '@xyo-network/diviner-model'
4
- import type { EvmContract } from '@xyo-network/evm-contract-witness'
5
- import { isEvmContract } from '@xyo-network/evm-contract-witness'
6
- import type { AnyConfigSchema } from '@xyo-network/module-model'
7
- import {
8
- ERC20__factory,
9
- ERC721__factory,
10
- ERC1155__factory,
11
- IERC721Enumerable__factory,
12
- IERC721Metadata__factory,
13
- IERC721Receiver__factory,
14
- IERC1155MetadataURI__factory,
15
- IERC1155Receiver__factory,
16
- } from '@xyo-network/open-zeppelin-typechain'
17
- import { asSchema, type Schema } from '@xyo-network/payload-model'
18
- import type { JsonFragment } from 'ethers'
19
- import { Interface } from 'ethers'
20
-
21
- import type { EvmTokenInterfaceImplemented, TokenInterface } from './Payload.ts'
22
- import { EvmTokenInterfaceImplementedSchema } from './Payload.ts'
23
-
24
- export const EvmTokenInterfaceImplementedDivinerConfigSchema = asSchema(`${EvmTokenInterfaceImplementedSchema}.diviner.config`, true)
25
- export type EvmTokenInterfaceImplementedDivinerConfigSchema = typeof EvmTokenInterfaceImplementedDivinerConfigSchema
26
-
27
- export type EvmTokenInterfaceImplementedDivinerConfig = DivinerConfig<{
28
- schema: EvmTokenInterfaceImplementedDivinerConfigSchema
29
- tokenInterfaces?: TokenInterface[]
30
- }>
31
-
32
- export type EvmTokenInterfaceImplementedDivinerParams = DivinerParams<AnyConfigSchema<EvmTokenInterfaceImplementedDivinerConfig>>
33
-
34
- type DistributiveMappedType<T> = T extends string ? { [K in T]: readonly JsonFragment[] } : never
35
- type TokenInterfaceDictionary = DistributiveMappedType<TokenInterface>
36
-
37
- /**
38
- * A diviner that checks if a contract implements a token interface
39
- */
40
- export class EvmTokenInterfaceImplementedDiviner<
41
- TParams extends EvmTokenInterfaceImplementedDivinerParams = EvmTokenInterfaceImplementedDivinerParams,
42
- > extends AbstractDiviner<TParams, EvmContract, EvmTokenInterfaceImplemented> {
43
- /**
44
- * The list of supported token interfaces
45
- */
46
- static readonly SupportedTokenInterfaces: Readonly<Record<TokenInterface, readonly JsonFragment[]>> = {
47
- ERC1155: ERC1155__factory.abi,
48
- ERC1155Metadata_URI: IERC1155MetadataURI__factory.abi,
49
- ERC1155TokenReceiver: IERC1155Receiver__factory.abi,
50
- ERC20: ERC20__factory.abi,
51
- ERC721: ERC721__factory.abi,
52
- ERC721Enumerable: IERC721Enumerable__factory.abi,
53
- ERC721Metadata: IERC721Metadata__factory.abi,
54
- ERC721TokenReceiver: IERC721Receiver__factory.abi,
55
- }
56
-
57
- static override readonly configSchemas: Schema[] = [...super.configSchemas, EvmTokenInterfaceImplementedDivinerConfigSchema]
58
- static override readonly defaultConfigSchema: Schema = EvmTokenInterfaceImplementedDivinerConfigSchema
59
-
60
- private _tokenInterfaces?: TokenInterfaceDictionary
61
-
62
- /**
63
- * The list of token interfaces to check against the contract
64
- */
65
- get tokenInterfaces() {
66
- if (!this._tokenInterfaces) {
67
- this._tokenInterfaces
68
- = this.config?.tokenInterfaces
69
- ? ((Object.fromEntries(
70
- this.config?.tokenInterfaces.map((tokenInterface) => {
71
- return [tokenInterface, EvmTokenInterfaceImplementedDiviner.SupportedTokenInterfaces[tokenInterface]] as const
72
- }),
73
- ) as TokenInterfaceDictionary) ?? {})
74
- : EvmTokenInterfaceImplementedDiviner.SupportedTokenInterfaces
75
- }
76
- return this._tokenInterfaces
77
- }
78
-
79
- protected override async divineHandler(inPayloads: EvmContract[] = []): Promise<EvmTokenInterfaceImplemented[]> {
80
- await this.started('throw')
81
- try {
82
- const allResults = await Promise.all(
83
- // Iterate over each contract passed in
84
- inPayloads.filter(isEvmContract).map(({
85
- address, code, chainId,
86
- }) => {
87
- // Ensure we have the contract code
88
- const byteCode = assertEx(code, () => 'Missing code')
89
- const results: EvmTokenInterfaceImplemented[] = []
90
- // Iterate over each token interface
91
- for (const [tokenInterface, abi] of Object.entries(this.tokenInterfaces)) {
92
- // Check if the contract implements the interface abi
93
- const contractInterface = new Interface(abi)
94
- const implementations: boolean[] = []
95
- contractInterface.forEachFunction(({ selector }) => {
96
- implementations.push(byteCode.includes(BigInt(selector).toString(16)))
97
- })
98
- const implemented = implementations.every(Boolean)
99
- const result: EvmTokenInterfaceImplemented = {
100
- address,
101
- chainId,
102
- implemented,
103
- schema: EvmTokenInterfaceImplementedSchema,
104
- tokenInterface: tokenInterface as TokenInterface,
105
- }
106
- results.push(result)
107
- }
108
-
109
- return results
110
- }),
111
- )
112
- return allResults.flat()
113
- } catch (ex) {
114
- const error = ex as Error
115
- console.log(`Error [${this.config.name}]: ${error.message}`)
116
- throw error
117
- }
118
- }
119
- }
package/src/Payload.ts DELETED
@@ -1,61 +0,0 @@
1
- import type { Payload } from '@xyo-network/payload-model'
2
- import { asSchema, isPayloadOfSchemaType } from '@xyo-network/payload-model'
3
-
4
- /**
5
- * ERC20 Token Interfaces
6
- */
7
- export type ERC20TokenInterfaces = 'ERC20'
8
-
9
- /**
10
- * ERC721 Token Interfaces
11
- */
12
- export type ERC721TokenInterfaces = 'ERC721' | 'ERC721TokenReceiver' | 'ERC721Metadata' | 'ERC721Enumerable'
13
-
14
- /**
15
- * ERC1155 Token Interfaces
16
- */
17
- export type ERC1155TokenInterfaces = 'ERC1155' | 'ERC1155TokenReceiver' | 'ERC1155Metadata_URI'
18
-
19
- /**
20
- * All Token Interfaces
21
- */
22
- export type TokenInterface = ERC20TokenInterfaces | ERC721TokenInterfaces | ERC1155TokenInterfaces
23
-
24
- /**
25
- * The schema for the EVM Token Interface Implemented payload
26
- */
27
- export const EvmTokenInterfaceImplementedSchema = asSchema('network.xyo.evm.token.interface.implemented', true)
28
- /**
29
- * The schema for the EVM Token Interface Implemented payload
30
- */
31
- export type EvmTokenInterfaceImplementedSchema = typeof EvmTokenInterfaceImplementedSchema
32
-
33
- /**
34
- * The EVM Token Interface Implemented payload
35
- */
36
- export type EvmTokenInterfaceImplemented = Payload<
37
- {
38
- /**
39
- * The contract address
40
- */
41
- address: string
42
- /**
43
- * The chain id
44
- */
45
- chainId: number
46
- /**
47
- * True if the contract implements the interface
48
- */
49
- implemented: boolean
50
- /**
51
- * The specific token interface
52
- */
53
- tokenInterface: TokenInterface
54
- },
55
- EvmTokenInterfaceImplementedSchema
56
- >
57
-
58
- /**
59
- * Identity function for EvmTokenInterfaceImplemented payload
60
- */
61
- export const isEvmTokenInterfaceImplemented = isPayloadOfSchemaType<EvmTokenInterfaceImplemented>(EvmTokenInterfaceImplementedSchema)
package/src/index.ts DELETED
@@ -1,2 +0,0 @@
1
- export * from './Diviner.ts'
2
- export * from './Payload.ts'
@@ -1,226 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/compilations/schema.json",
3
- "nodes": [
4
- {
5
- "config": {
6
- "accountPath": "3",
7
- "name": "ContractWitnessIndexNode",
8
- "schema": "network.xyo.node.config"
9
- },
10
- "modules": {
11
- "private": [
12
- {
13
- "config": {
14
- "language": "javascript",
15
- "name": "AddressStateArchivist",
16
- "schema": "network.xyo.archivist.config",
17
- "storeQueries": false
18
- }
19
- },
20
- {
21
- "config": {
22
- "archivist": "AddressStateArchivist",
23
- "language": "javascript",
24
- "name": "AddressStateBoundWitnessDiviner",
25
- "schema": "network.xyo.diviner.boundwitness.config"
26
- }
27
- },
28
- {
29
- "config": {
30
- "archivist": "AddressStateArchivist",
31
- "language": "javascript",
32
- "name": "AddressStatePayloadDiviner",
33
- "schema": "network.xyo.diviner.payload.config"
34
- }
35
- },
36
- {
37
- "config": {
38
- "language": "javascript",
39
- "name": "EvmContractDivinerIndexArchivist",
40
- "schema": "network.xyo.archivist.config"
41
- }
42
- },
43
- {
44
- "config": {
45
- "archivist": "EvmContractDivinerIndexArchivist",
46
- "language": "javascript",
47
- "name": "EvmContractDivinerIndexBoundWitnessDiviner",
48
- "schema": "network.xyo.diviner.boundwitness.config"
49
- }
50
- },
51
- {
52
- "config": {
53
- "archivist": "EvmContractDivinerIndexArchivist",
54
- "language": "javascript",
55
- "name": "EvmContractDivinerIndexPayloadDiviner",
56
- "schema": "network.xyo.diviner.payload.config"
57
- }
58
- },
59
- {
60
- "config": {
61
- "filter": {
62
- "payload_schemas": [
63
- "network.xyo.evm.contract"
64
- ]
65
- },
66
- "labels": {
67
- "network.xyo.diviner.stage": "stateToIndexCandidateDiviner"
68
- },
69
- "language": "javascript",
70
- "name": "EvmContractStateToIndexCandidateDiviner",
71
- "payloadStore": {
72
- "archivist": "Archivist",
73
- "boundWitnessDiviner": "BoundWitnessDiviner",
74
- "payloadDiviner": "PayloadDiviner"
75
- },
76
- "schema": "network.xyo.diviner.indexing.temporal.stage.stateToIndexCandidateDiviner.config"
77
- }
78
- },
79
- {
80
- "config": {
81
- "labels": {
82
- "network.xyo.diviner.stage": "indexCandidateToIndexDiviner"
83
- },
84
- "language": "javascript",
85
- "name": "EvmContractIndexCandidateToEvmContractIndexDiviner",
86
- "schema": "network.xyo.diviner.indexing.temporal.stage.indexCandidateToIndexDiviner.config",
87
- "schemaTransforms": {
88
- "network.xyo.evm.contract": [
89
- {
90
- "destinationField": "address",
91
- "sourcePathExpression": "$.address"
92
- },
93
- {
94
- "destinationField": "chainId",
95
- "sourcePathExpression": "$.chainId"
96
- }
97
- ],
98
- "network.xyo.timestamp": [
99
- {
100
- "destinationField": "timestamp",
101
- "sourcePathExpression": "$.timestamp"
102
- }
103
- ]
104
- }
105
- }
106
- },
107
- {
108
- "config": {
109
- "divinerQuerySchema": "network.xyo.diviner.payload.query",
110
- "indexQuerySchema": "network.xyo.diviner.payload.query",
111
- "indexSchema": "network.xyo.diviner.indexing.temporal.result.index",
112
- "labels": {
113
- "network.xyo.diviner.stage": "divinerQueryToIndexQueryDiviner"
114
- },
115
- "language": "javascript",
116
- "name": "EvmContractQueryToEvmContractIndexQueryDiviner",
117
- "schema": "network.xyo.diviner.indexing.temporal.stage.divinerQueryToIndexQueryDiviner.config",
118
- "schemaTransforms": {
119
- "network.xyo.diviner.payload.query": [
120
- {
121
- "destinationField": "address",
122
- "sourcePathExpression": "$.address"
123
- },
124
- {
125
- "defaultValue": 1,
126
- "destinationField": "chainId",
127
- "sourcePathExpression": "$.chainId"
128
- },
129
- {
130
- "defaultValue": 1,
131
- "destinationField": "limit",
132
- "sourcePathExpression": "$.limit"
133
- },
134
- {
135
- "defaultValue": 0,
136
- "destinationField": "offset",
137
- "sourcePathExpression": "$.offset"
138
- },
139
- {
140
- "defaultValue": "desc",
141
- "destinationField": "order",
142
- "sourcePathExpression": "$.order"
143
- }
144
- ]
145
- }
146
- }
147
- },
148
- {
149
- "config": {
150
- "labels": {
151
- "network.xyo.diviner.stage": "indexQueryResponseToDivinerQueryResponseDiviner"
152
- },
153
- "language": "javascript",
154
- "name": "EvmContractIndexQueryResponseToEvmContractQueryResponseDiviner",
155
- "schema": "network.xyo.diviner.indexing.temporal.stage.indexQueryResponseToDivinerQueryResponseDiviner.config"
156
- }
157
- },
158
- {
159
- "config": {
160
- "language": "javascript",
161
- "name": "EvmContractWitness",
162
- "schema": "network.xyo.evm.contract.witness.config"
163
- }
164
- },
165
- {
166
- "config": {
167
- "language": "javascript",
168
- "name": "TimestampWitness",
169
- "schema": "network.xyo.witness.timestamp.config"
170
- }
171
- }
172
- ],
173
- "public": [
174
- {
175
- "config": {
176
- "indexStore": {
177
- "archivist": "EvmContractDivinerIndexArchivist",
178
- "boundWitnessDiviner": "EvmContractDivinerIndexBoundWitnessDiviner",
179
- "payloadDiviner": "EvmContractDivinerIndexPayloadDiviner"
180
- },
181
- "indexingDivinerStages": {
182
- "divinerQueryToIndexQueryDiviner": "EvmContractQueryToEvmContractIndexQueryDiviner",
183
- "indexCandidateToIndexDiviner": "EvmContractIndexCandidateToEvmContractIndexDiviner",
184
- "indexQueryResponseToDivinerQueryResponseDiviner": "EvmContractIndexQueryResponseToEvmContractQueryResponseDiviner",
185
- "stateToIndexCandidateDiviner": "EvmContractStateToIndexCandidateDiviner"
186
- },
187
- "language": "javascript",
188
- "name": "EvmContractIndexDiviner",
189
- "pollFrequency": 1,
190
- "schema": "network.xyo.diviner.indexing.temporal.config",
191
- "stateStore": {
192
- "archivist": "AddressStateArchivist",
193
- "boundWitnessDiviner": "AddressStateBoundWitnessDiviner",
194
- "payloadDiviner": "AddressStatePayloadDiviner"
195
- }
196
- }
197
- },
198
- {
199
- "config": {
200
- "archiving": {
201
- "archivists": [
202
- "Archivist"
203
- ]
204
- },
205
- "language": "javascript",
206
- "name": "EvmContractSentinel",
207
- "schema": "network.xyo.sentinel.config",
208
- "synchronous": "true",
209
- "tasks": [
210
- {
211
- "input": true,
212
- "mod": "TimestampWitness"
213
- },
214
- {
215
- "input": true,
216
- "mod": "EvmContractWitness"
217
- }
218
- ]
219
- }
220
- }
221
- ]
222
- }
223
- }
224
- ],
225
- "schema": "network.xyo.manifest"
226
- }
@@ -1,280 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/compilations/schema.json",
3
- "nodes": [
4
- {
5
- "config": {
6
- "accountPath": "2",
7
- "name": "TokenDivinerIndexNode",
8
- "schema": "network.xyo.node.config"
9
- },
10
- "modules": {
11
- "private": [
12
- {
13
- "config": {
14
- "language": "javascript",
15
- "name": "AddressStateArchivist",
16
- "schema": "network.xyo.archivist.config",
17
- "storeQueries": false
18
- }
19
- },
20
- {
21
- "config": {
22
- "archivist": "AddressStateArchivist",
23
- "language": "javascript",
24
- "name": "AddressStateBoundWitnessDiviner",
25
- "schema": "network.xyo.diviner.boundwitness.config"
26
- }
27
- },
28
- {
29
- "config": {
30
- "archivist": "AddressStateArchivist",
31
- "language": "javascript",
32
- "name": "AddressStatePayloadDiviner",
33
- "schema": "network.xyo.diviner.payload.config"
34
- }
35
- },
36
- {
37
- "config": {
38
- "language": "javascript",
39
- "name": "EvmContractDivinerIndexArchivist",
40
- "schema": "network.xyo.archivist.config"
41
- }
42
- },
43
- {
44
- "config": {
45
- "archivist": "EvmContractDivinerIndexArchivist",
46
- "language": "javascript",
47
- "name": "EvmContractDivinerIndexBoundWitnessDiviner",
48
- "schema": "network.xyo.diviner.boundwitness.config"
49
- }
50
- },
51
- {
52
- "config": {
53
- "archivist": "EvmContractDivinerIndexArchivist",
54
- "language": "javascript",
55
- "name": "EvmContractDivinerIndexPayloadDiviner",
56
- "schema": "network.xyo.diviner.payload.config"
57
- }
58
- },
59
- {
60
- "config": {
61
- "filter": {
62
- "payload_schemas": [
63
- "network.xyo.evm.token.interface.implemented"
64
- ]
65
- },
66
- "labels": {
67
- "network.xyo.diviner.stage": "stateToIndexCandidateDiviner"
68
- },
69
- "language": "javascript",
70
- "name": "EvmContractStateToIndexCandidateDiviner",
71
- "payloadStore": {
72
- "archivist": "Archivist",
73
- "boundWitnessDiviner": "BoundWitnessDiviner",
74
- "payloadDiviner": "PayloadDiviner"
75
- },
76
- "schema": "network.xyo.diviner.indexing.temporal.stage.stateToIndexCandidateDiviner.config"
77
- }
78
- },
79
- {
80
- "config": {
81
- "labels": {
82
- "network.xyo.diviner.stage": "indexCandidateToIndexDiviner"
83
- },
84
- "language": "javascript",
85
- "name": "EvmContractIndexCandidateToEvmContractIndexDiviner",
86
- "schema": "network.xyo.diviner.indexing.temporal.stage.indexCandidateToIndexDiviner.config",
87
- "schemaTransforms": {
88
- "network.xyo.evm.token.interface.implemented": [
89
- {
90
- "destinationField": "address",
91
- "sourcePathExpression": "$.address"
92
- },
93
- {
94
- "destinationField": "chainId",
95
- "sourcePathExpression": "$.chainId"
96
- },
97
- {
98
- "destinationField": "tokenInterface",
99
- "sourcePathExpression": "$.tokenInterface"
100
- },
101
- {
102
- "destinationField": "implemented",
103
- "sourcePathExpression": "$.implemented"
104
- }
105
- ],
106
- "network.xyo.timestamp": [
107
- {
108
- "destinationField": "timestamp",
109
- "sourcePathExpression": "$.timestamp"
110
- }
111
- ]
112
- }
113
- }
114
- },
115
- {
116
- "config": {
117
- "divinerQuerySchema": "network.xyo.diviner.payload.query",
118
- "indexQuerySchema": "network.xyo.diviner.payload.query",
119
- "indexSchema": "network.xyo.diviner.indexing.temporal.result.index",
120
- "labels": {
121
- "network.xyo.diviner.stage": "divinerQueryToIndexQueryDiviner"
122
- },
123
- "language": "javascript",
124
- "name": "EvmContractQueryToEvmContractIndexQueryDiviner",
125
- "schema": "network.xyo.diviner.indexing.temporal.stage.divinerQueryToIndexQueryDiviner.config",
126
- "schemaTransforms": {
127
- "network.xyo.diviner.payload.query": [
128
- {
129
- "destinationField": "address",
130
- "sourcePathExpression": "$.address"
131
- },
132
- {
133
- "defaultValue": 1,
134
- "destinationField": "chainId",
135
- "sourcePathExpression": "$.chainId"
136
- },
137
- {
138
- "defaultValue": 1,
139
- "destinationField": "tokenInterface",
140
- "sourcePathExpression": "$.tokenInterface"
141
- },
142
- {
143
- "defaultValue": 1,
144
- "destinationField": "implemented",
145
- "sourcePathExpression": "$.implemented"
146
- },
147
- {
148
- "defaultValue": 1,
149
- "destinationField": "limit",
150
- "sourcePathExpression": "$.limit"
151
- },
152
- {
153
- "defaultValue": 0,
154
- "destinationField": "offset",
155
- "sourcePathExpression": "$.offset"
156
- },
157
- {
158
- "defaultValue": "desc",
159
- "destinationField": "order",
160
- "sourcePathExpression": "$.order"
161
- }
162
- ]
163
- }
164
- }
165
- },
166
- {
167
- "config": {
168
- "labels": {
169
- "network.xyo.diviner.stage": "indexQueryResponseToDivinerQueryResponseDiviner"
170
- },
171
- "language": "javascript",
172
- "name": "EvmContractIndexQueryResponseToEvmContractQueryResponseDiviner",
173
- "schema": "network.xyo.diviner.indexing.temporal.stage.indexQueryResponseToDivinerQueryResponseDiviner.config"
174
- }
175
- },
176
- {
177
- "config": {
178
- "language": "javascript",
179
- "name": "TimestampWitness",
180
- "schema": "network.xyo.witness.timestamp.config"
181
- }
182
- }
183
- ],
184
- "public": [
185
- {
186
- "config": {
187
- "language": "javascript",
188
- "name": "ERC721TokenInterfaceImplementedDiviner",
189
- "schema": "network.xyo.evm.token.interface.implemented.diviner.config",
190
- "tokenInterfaces": [
191
- "ERC721"
192
- ]
193
- }
194
- },
195
- {
196
- "config": {
197
- "language": "javascript",
198
- "name": "ERC1155TokenInterfaceImplementedDiviner",
199
- "schema": "network.xyo.evm.token.interface.implemented.diviner.config",
200
- "tokenInterfaces": [
201
- "ERC1155"
202
- ]
203
- }
204
- },
205
- {
206
- "config": {
207
- "indexStore": {
208
- "archivist": "EvmContractDivinerIndexArchivist",
209
- "boundWitnessDiviner": "EvmContractDivinerIndexBoundWitnessDiviner",
210
- "payloadDiviner": "EvmContractDivinerIndexPayloadDiviner"
211
- },
212
- "indexingDivinerStages": {
213
- "divinerQueryToIndexQueryDiviner": "EvmContractQueryToEvmContractIndexQueryDiviner",
214
- "indexCandidateToIndexDiviner": "EvmContractIndexCandidateToEvmContractIndexDiviner",
215
- "indexQueryResponseToDivinerQueryResponseDiviner": "EvmContractIndexQueryResponseToEvmContractQueryResponseDiviner",
216
- "stateToIndexCandidateDiviner": "EvmContractStateToIndexCandidateDiviner"
217
- },
218
- "language": "javascript",
219
- "name": "EvmTokenInterfaceImplementedIndexDiviner",
220
- "pollFrequency": 1,
221
- "schema": "network.xyo.diviner.indexing.temporal.config",
222
- "stateStore": {
223
- "archivist": "AddressStateArchivist",
224
- "boundWitnessDiviner": "AddressStateBoundWitnessDiviner",
225
- "payloadDiviner": "AddressStatePayloadDiviner"
226
- }
227
- }
228
- },
229
- {
230
- "config": {
231
- "archiving": {
232
- "archivists": [
233
- "Archivist"
234
- ]
235
- },
236
- "language": "javascript",
237
- "name": "ERC721TokenInterfaceImplementedSentinel",
238
- "schema": "network.xyo.sentinel.config",
239
- "synchronous": "true",
240
- "tasks": [
241
- {
242
- "input": true,
243
- "mod": "TimestampWitness"
244
- },
245
- {
246
- "input": true,
247
- "mod": "ERC721TokenInterfaceImplementedDiviner"
248
- }
249
- ]
250
- }
251
- },
252
- {
253
- "config": {
254
- "archiving": {
255
- "archivists": [
256
- "Archivist"
257
- ]
258
- },
259
- "language": "javascript",
260
- "name": "ERC1155TokenInterfaceImplementedSentinel",
261
- "schema": "network.xyo.sentinel.config",
262
- "synchronous": "true",
263
- "tasks": [
264
- {
265
- "input": true,
266
- "mod": "TimestampWitness"
267
- },
268
- {
269
- "input": true,
270
- "mod": "ERC1155TokenInterfaceImplementedDiviner"
271
- }
272
- ]
273
- }
274
- }
275
- ]
276
- }
277
- }
278
- ],
279
- "schema": "network.xyo.manifest"
280
- }
@@ -1,42 +0,0 @@
1
- {
2
- "$schema": "https://raw.githubusercontent.com/XYOracleNetwork/sdk-xyo-client-js/main/packages/manifest/src/compilations/schema.json",
3
- "nodes": [
4
- {
5
- "config": {
6
- "accountPath": "1",
7
- "name": "TokenNode",
8
- "schema": "network.xyo.node.config"
9
- },
10
- "modules": {
11
- "private": [],
12
- "public": [
13
- {
14
- "config": {
15
- "language": "javascript",
16
- "name": "Archivist",
17
- "schema": "network.xyo.archivist.config",
18
- "storeQueries": false
19
- }
20
- },
21
- {
22
- "config": {
23
- "archivist": "Archivist",
24
- "language": "javascript",
25
- "name": "BoundWitnessDiviner",
26
- "schema": "network.xyo.diviner.boundwitness.config"
27
- }
28
- },
29
- {
30
- "config": {
31
- "archivist": "Archivist",
32
- "language": "javascript",
33
- "name": "PayloadDiviner",
34
- "schema": "network.xyo.diviner.payload.config"
35
- }
36
- }
37
- ]
38
- }
39
- }
40
- ],
41
- "schema": "network.xyo.manifest"
42
- }