@xyo-network/evm-token-interface-diviner 5.3.2 → 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.
@@ -0,0 +1,39 @@
1
+ import { AbstractDiviner } from '@xyo-network/diviner-abstract';
2
+ import type { DivinerConfig, DivinerParams } from '@xyo-network/diviner-model';
3
+ import type { EvmContract } from '@xyo-network/evm-contract-witness';
4
+ import type { AnyConfigSchema } from '@xyo-network/module-model';
5
+ import { type Schema } from '@xyo-network/payload-model';
6
+ import type { JsonFragment } from 'ethers';
7
+ import type { EvmTokenInterfaceImplemented, TokenInterface } from './Payload.ts';
8
+ export declare const EvmTokenInterfaceImplementedDivinerConfigSchema: string & {
9
+ readonly __schema: true;
10
+ };
11
+ export type EvmTokenInterfaceImplementedDivinerConfigSchema = typeof EvmTokenInterfaceImplementedDivinerConfigSchema;
12
+ export type EvmTokenInterfaceImplementedDivinerConfig = DivinerConfig<{
13
+ schema: EvmTokenInterfaceImplementedDivinerConfigSchema;
14
+ tokenInterfaces?: TokenInterface[];
15
+ }>;
16
+ export type EvmTokenInterfaceImplementedDivinerParams = DivinerParams<AnyConfigSchema<EvmTokenInterfaceImplementedDivinerConfig>>;
17
+ type DistributiveMappedType<T> = T extends string ? {
18
+ [K in T]: readonly JsonFragment[];
19
+ } : never;
20
+ type TokenInterfaceDictionary = DistributiveMappedType<TokenInterface>;
21
+ /**
22
+ * A diviner that checks if a contract implements a token interface
23
+ */
24
+ export declare class EvmTokenInterfaceImplementedDiviner<TParams extends EvmTokenInterfaceImplementedDivinerParams = EvmTokenInterfaceImplementedDivinerParams> extends AbstractDiviner<TParams, EvmContract, EvmTokenInterfaceImplemented> {
25
+ /**
26
+ * The list of supported token interfaces
27
+ */
28
+ static readonly SupportedTokenInterfaces: Readonly<Record<TokenInterface, readonly JsonFragment[]>>;
29
+ static readonly configSchemas: Schema[];
30
+ static readonly defaultConfigSchema: Schema;
31
+ private _tokenInterfaces?;
32
+ /**
33
+ * The list of token interfaces to check against the contract
34
+ */
35
+ get tokenInterfaces(): TokenInterfaceDictionary;
36
+ protected divineHandler(inPayloads?: EvmContract[]): Promise<EvmTokenInterfaceImplemented[]>;
37
+ }
38
+ export {};
39
+ //# sourceMappingURL=Diviner.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC9E,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAA;AAEpE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAWhE,OAAO,EAAY,KAAK,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAClE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,QAAQ,CAAA;AAG1C,OAAO,KAAK,EAAE,4BAA4B,EAAE,cAAc,EAAE,MAAM,cAAc,CAAA;AAGhF,eAAO,MAAM,+CAA+C;;CAAyE,CAAA;AACrI,MAAM,MAAM,+CAA+C,GAAG,OAAO,+CAA+C,CAAA;AAEpH,MAAM,MAAM,yCAAyC,GAAG,aAAa,CAAC;IACpE,MAAM,EAAE,+CAA+C,CAAA;IACvD,eAAe,CAAC,EAAE,cAAc,EAAE,CAAA;CACnC,CAAC,CAAA;AAEF,MAAM,MAAM,yCAAyC,GAAG,aAAa,CAAC,eAAe,CAAC,yCAAyC,CAAC,CAAC,CAAA;AAEjI,KAAK,sBAAsB,CAAC,CAAC,IAAI,CAAC,SAAS,MAAM,GAAG;KAAG,CAAC,IAAI,CAAC,GAAG,SAAS,YAAY,EAAE;CAAE,GAAG,KAAK,CAAA;AACjG,KAAK,wBAAwB,GAAG,sBAAsB,CAAC,cAAc,CAAC,CAAA;AAEtE;;GAEG;AACH,qBAAa,mCAAmC,CAC9C,OAAO,SAAS,yCAAyC,GAAG,yCAAyC,CACrG,SAAQ,eAAe,CAAC,OAAO,EAAE,WAAW,EAAE,4BAA4B,CAAC;IAC3E;;OAEG;IACH,MAAM,CAAC,QAAQ,CAAC,wBAAwB,EAAE,QAAQ,CAAC,MAAM,CAAC,cAAc,EAAE,SAAS,YAAY,EAAE,CAAC,CAAC,CASlG;IAED,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA4E;IAC5H,gBAAyB,mBAAmB,EAAE,MAAM,CAAkD;IAEtG,OAAO,CAAC,gBAAgB,CAAC,CAA0B;IAEnD;;OAEG;IACH,IAAI,eAAe,6BAYlB;cAEwB,aAAa,CAAC,UAAU,GAAE,WAAW,EAAO,GAAG,OAAO,CAAC,4BAA4B,EAAE,CAAC;CAwChH"}
@@ -1,61 +1,53 @@
1
- import type { Payload } from '@xyo-network/payload-model'
2
- import { asSchema, isPayloadOfSchemaType } from '@xyo-network/payload-model'
3
-
1
+ import type { Payload } from '@xyo-network/payload-model';
4
2
  /**
5
3
  * ERC20 Token Interfaces
6
4
  */
7
- export type ERC20TokenInterfaces = 'ERC20'
8
-
5
+ export type ERC20TokenInterfaces = 'ERC20';
9
6
  /**
10
7
  * ERC721 Token Interfaces
11
8
  */
12
- export type ERC721TokenInterfaces = 'ERC721' | 'ERC721TokenReceiver' | 'ERC721Metadata' | 'ERC721Enumerable'
13
-
9
+ export type ERC721TokenInterfaces = 'ERC721' | 'ERC721TokenReceiver' | 'ERC721Metadata' | 'ERC721Enumerable';
14
10
  /**
15
11
  * ERC1155 Token Interfaces
16
12
  */
17
- export type ERC1155TokenInterfaces = 'ERC1155' | 'ERC1155TokenReceiver' | 'ERC1155Metadata_URI'
18
-
13
+ export type ERC1155TokenInterfaces = 'ERC1155' | 'ERC1155TokenReceiver' | 'ERC1155Metadata_URI';
19
14
  /**
20
15
  * All Token Interfaces
21
16
  */
22
- export type TokenInterface = ERC20TokenInterfaces | ERC721TokenInterfaces | ERC1155TokenInterfaces
23
-
17
+ export type TokenInterface = ERC20TokenInterfaces | ERC721TokenInterfaces | ERC1155TokenInterfaces;
24
18
  /**
25
19
  * The schema for the EVM Token Interface Implemented payload
26
20
  */
27
- export const EvmTokenInterfaceImplementedSchema = asSchema('network.xyo.evm.token.interface.implemented', true)
21
+ export declare const EvmTokenInterfaceImplementedSchema: "network.xyo.evm.token.interface.implemented" & {
22
+ readonly __schema: true;
23
+ };
28
24
  /**
29
25
  * The schema for the EVM Token Interface Implemented payload
30
26
  */
31
- export type EvmTokenInterfaceImplementedSchema = typeof EvmTokenInterfaceImplementedSchema
32
-
27
+ export type EvmTokenInterfaceImplementedSchema = typeof EvmTokenInterfaceImplementedSchema;
33
28
  /**
34
29
  * The EVM Token Interface Implemented payload
35
30
  */
36
- export type EvmTokenInterfaceImplemented = Payload<
37
- {
31
+ export type EvmTokenInterfaceImplemented = Payload<{
38
32
  /**
39
33
  * The contract address
40
34
  */
41
- address: string
35
+ address: string;
42
36
  /**
43
37
  * The chain id
44
38
  */
45
- chainId: number
39
+ chainId: number;
46
40
  /**
47
41
  * True if the contract implements the interface
48
42
  */
49
- implemented: boolean
43
+ implemented: boolean;
50
44
  /**
51
45
  * The specific token interface
52
46
  */
53
- tokenInterface: TokenInterface
54
- },
55
- EvmTokenInterfaceImplementedSchema
56
- >
57
-
47
+ tokenInterface: TokenInterface;
48
+ }, EvmTokenInterfaceImplementedSchema>;
58
49
  /**
59
50
  * Identity function for EvmTokenInterfaceImplemented payload
60
51
  */
61
- export const isEvmTokenInterfaceImplemented = isPayloadOfSchemaType<EvmTokenInterfaceImplemented>(EvmTokenInterfaceImplementedSchema)
52
+ export declare const isEvmTokenInterfaceImplemented: (x?: unknown | null) => x is EvmTokenInterfaceImplemented;
53
+ //# sourceMappingURL=Payload.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,4BAA4B,CAAA;AAGzD;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG,OAAO,CAAA;AAE1C;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,QAAQ,GAAG,qBAAqB,GAAG,gBAAgB,GAAG,kBAAkB,CAAA;AAE5G;;GAEG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,sBAAsB,GAAG,qBAAqB,CAAA;AAE/F;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,oBAAoB,GAAG,qBAAqB,GAAG,sBAAsB,CAAA;AAElG;;GAEG;AACH,eAAO,MAAM,kCAAkC;;CAAgE,CAAA;AAC/G;;GAEG;AACH,MAAM,MAAM,kCAAkC,GAAG,OAAO,kCAAkC,CAAA;AAE1F;;GAEG;AACH,MAAM,MAAM,4BAA4B,GAAG,OAAO,CAChD;IACE;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAA;IACf;;OAEG;IACH,WAAW,EAAE,OAAO,CAAA;IACpB;;OAEG;IACH,cAAc,EAAE,cAAc,CAAA;CAC/B,EACD,kCAAkC,CACnC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,8BAA8B,2DAA0F,CAAA"}
@@ -0,0 +1,3 @@
1
+ export * from './Diviner.ts';
2
+ export * from './Payload.ts';
3
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA;AAC5B,cAAc,cAAc,CAAA"}
@@ -0,0 +1,100 @@
1
+ // src/Diviner.ts
2
+ import { assertEx } from "@xylabs/sdk-js";
3
+ import { AbstractDiviner } from "@xyo-network/diviner-abstract";
4
+ import { isEvmContract } from "@xyo-network/evm-contract-witness";
5
+ import {
6
+ ERC20__factory,
7
+ ERC721__factory,
8
+ ERC1155__factory,
9
+ IERC721Enumerable__factory,
10
+ IERC721Metadata__factory,
11
+ IERC721Receiver__factory,
12
+ IERC1155MetadataURI__factory,
13
+ IERC1155Receiver__factory
14
+ } from "@xyo-network/open-zeppelin-typechain";
15
+ import { asSchema as asSchema2 } from "@xyo-network/payload-model";
16
+ import { Interface } from "ethers";
17
+
18
+ // src/Payload.ts
19
+ import { asSchema, isPayloadOfSchemaType } from "@xyo-network/payload-model";
20
+ var EvmTokenInterfaceImplementedSchema = asSchema("network.xyo.evm.token.interface.implemented", true);
21
+ var isEvmTokenInterfaceImplemented = isPayloadOfSchemaType(EvmTokenInterfaceImplementedSchema);
22
+
23
+ // src/Diviner.ts
24
+ var EvmTokenInterfaceImplementedDivinerConfigSchema = asSchema2(`${EvmTokenInterfaceImplementedSchema}.diviner.config`, true);
25
+ var EvmTokenInterfaceImplementedDiviner = class _EvmTokenInterfaceImplementedDiviner extends AbstractDiviner {
26
+ /**
27
+ * The list of supported token interfaces
28
+ */
29
+ static SupportedTokenInterfaces = {
30
+ ERC1155: ERC1155__factory.abi,
31
+ ERC1155Metadata_URI: IERC1155MetadataURI__factory.abi,
32
+ ERC1155TokenReceiver: IERC1155Receiver__factory.abi,
33
+ ERC20: ERC20__factory.abi,
34
+ ERC721: ERC721__factory.abi,
35
+ ERC721Enumerable: IERC721Enumerable__factory.abi,
36
+ ERC721Metadata: IERC721Metadata__factory.abi,
37
+ ERC721TokenReceiver: IERC721Receiver__factory.abi
38
+ };
39
+ static configSchemas = [...super.configSchemas, EvmTokenInterfaceImplementedDivinerConfigSchema];
40
+ static defaultConfigSchema = EvmTokenInterfaceImplementedDivinerConfigSchema;
41
+ _tokenInterfaces;
42
+ /**
43
+ * The list of token interfaces to check against the contract
44
+ */
45
+ get tokenInterfaces() {
46
+ if (!this._tokenInterfaces) {
47
+ this._tokenInterfaces = this.config?.tokenInterfaces ? Object.fromEntries(
48
+ this.config?.tokenInterfaces.map((tokenInterface) => {
49
+ return [tokenInterface, _EvmTokenInterfaceImplementedDiviner.SupportedTokenInterfaces[tokenInterface]];
50
+ })
51
+ ) ?? {} : _EvmTokenInterfaceImplementedDiviner.SupportedTokenInterfaces;
52
+ }
53
+ return this._tokenInterfaces;
54
+ }
55
+ async divineHandler(inPayloads = []) {
56
+ await this.started("throw");
57
+ try {
58
+ const allResults = await Promise.all(
59
+ // Iterate over each contract passed in
60
+ inPayloads.filter(isEvmContract).map(({
61
+ address,
62
+ code,
63
+ chainId
64
+ }) => {
65
+ const byteCode = assertEx(code, () => "Missing code");
66
+ const results = [];
67
+ for (const [tokenInterface, abi] of Object.entries(this.tokenInterfaces)) {
68
+ const contractInterface = new Interface(abi);
69
+ const implementations = [];
70
+ contractInterface.forEachFunction(({ selector }) => {
71
+ implementations.push(byteCode.includes(BigInt(selector).toString(16)));
72
+ });
73
+ const implemented = implementations.every(Boolean);
74
+ const result = {
75
+ address,
76
+ chainId,
77
+ implemented,
78
+ schema: EvmTokenInterfaceImplementedSchema,
79
+ tokenInterface
80
+ };
81
+ results.push(result);
82
+ }
83
+ return results;
84
+ })
85
+ );
86
+ return allResults.flat();
87
+ } catch (ex) {
88
+ const error = ex;
89
+ console.log(`Error [${this.config.name}]: ${error.message}`);
90
+ throw error;
91
+ }
92
+ }
93
+ };
94
+ export {
95
+ EvmTokenInterfaceImplementedDiviner,
96
+ EvmTokenInterfaceImplementedDivinerConfigSchema,
97
+ EvmTokenInterfaceImplementedSchema,
98
+ isEvmTokenInterfaceImplemented
99
+ };
100
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1 @@
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.2",
3
+ "version": "5.3.3",
4
4
  "description": "Typescript/Javascript Plugins for XYO Platform",
5
5
  "homepage": "https://xyo.network",
6
6
  "bugs": {
@@ -30,13 +30,14 @@
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
  ],
35
+ "dependencies": {
36
+ "@xyo-network/evm-contract-witness": "workspace:^"
37
+ },
38
38
  "devDependencies": {
39
39
  "@xylabs/sdk-js": "^5.0.90",
40
+ "@xylabs/ts-scripts-common": "~7.5.10",
40
41
  "@xylabs/ts-scripts-yarn3": "~7.5.10",
41
42
  "@xylabs/tsconfig": "~7.5.10",
42
43
  "@xylabs/vitest-extended": "~5.0.90",
@@ -50,7 +51,6 @@
50
51
  "@xyo-network/diviner-payload-model": "~5.3.5",
51
52
  "@xyo-network/diviner-stateful": "~5.3.5",
52
53
  "@xyo-network/diviner-temporal-indexing": "~5.3.5",
53
- "@xyo-network/evm-contract-witness": "5.3.2",
54
54
  "@xyo-network/module-factory-locator": "~5.3.5",
55
55
  "@xyo-network/module-model": "~5.3.5",
56
56
  "@xyo-network/node-memory": "~5.3.5",
@@ -69,6 +69,11 @@
69
69
  },
70
70
  "peerDependencies": {
71
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",
72
77
  "ethers": "^6",
73
78
  "zod": "^4"
74
79
  },
package/src/Diviner.ts DELETED
@@ -1,119 +0,0 @@
1
- import { assertEx } from '@xylabs/sdk-js'
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/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
- }