@xyo-network/diviner-evm-call-result-to-token-uri 2.99.3 → 2.99.5
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.
- package/dist/browser/Diviner.d.cts +1 -1
- package/dist/browser/Diviner.d.mts +1 -1
- package/dist/browser/Diviner.d.ts +1 -1
- package/dist/browser/Params.d.cts +1 -1
- package/dist/browser/Params.d.mts +1 -1
- package/dist/browser/Params.d.ts +1 -1
- package/dist/browser/index.cjs +15 -2
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +5 -5
- package/dist/browser/index.d.mts +5 -5
- package/dist/browser/index.d.ts +5 -5
- package/dist/browser/{index.js → index.mjs} +18 -3
- package/dist/{node/index.js.map → browser/index.mjs.map} +1 -1
- package/dist/neutral/Diviner.d.cts +1 -1
- package/dist/neutral/Diviner.d.mts +1 -1
- package/dist/neutral/Diviner.d.ts +1 -1
- package/dist/neutral/Params.d.cts +1 -1
- package/dist/neutral/Params.d.mts +1 -1
- package/dist/neutral/Params.d.ts +1 -1
- package/dist/neutral/index.cjs +15 -2
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.d.cts +5 -5
- package/dist/neutral/index.d.mts +5 -5
- package/dist/neutral/index.d.ts +5 -5
- package/dist/neutral/{index.js → index.mjs} +18 -3
- package/dist/{browser/index.js.map → neutral/index.mjs.map} +1 -1
- package/dist/node/Diviner.d.cts +1 -1
- package/dist/node/Diviner.d.mts +1 -1
- package/dist/node/Diviner.d.ts +1 -1
- package/dist/node/Params.d.cts +1 -1
- package/dist/node/Params.d.mts +1 -1
- package/dist/node/Params.d.ts +1 -1
- package/dist/node/index.cjs +21 -4
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +5 -5
- package/dist/node/index.d.mts +5 -5
- package/dist/node/index.d.ts +5 -5
- package/dist/node/{index.js → index.mjs} +24 -5
- package/dist/{neutral/index.js.map → node/index.mjs.map} +1 -1
- package/package.json +16 -16
- package/src/Config.ts +1 -1
- package/src/Diviner.ts +3 -3
- package/src/Params.ts +1 -1
- package/src/index.ts +5 -5
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
2
2
|
import { NftMetadataUri } from '@xyo-network/evm-nft-id-payload-plugin';
|
|
3
3
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
|
-
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.
|
|
4
|
+
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts';
|
|
5
5
|
export declare class EvmCallResultToNftTokenUriDiviner<TParams extends EvmCallResultToNftTokenUriDivinerParams = EvmCallResultToNftTokenUriDivinerParams> extends AbstractDiviner<TParams, Payload, NftMetadataUri> {
|
|
6
6
|
static readonly configSchemas: Schema[];
|
|
7
7
|
static readonly defaultConfigSchema: Schema;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
2
2
|
import { NftMetadataUri } from '@xyo-network/evm-nft-id-payload-plugin';
|
|
3
3
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
|
-
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.
|
|
4
|
+
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts';
|
|
5
5
|
export declare class EvmCallResultToNftTokenUriDiviner<TParams extends EvmCallResultToNftTokenUriDivinerParams = EvmCallResultToNftTokenUriDivinerParams> extends AbstractDiviner<TParams, Payload, NftMetadataUri> {
|
|
6
6
|
static readonly configSchemas: Schema[];
|
|
7
7
|
static readonly defaultConfigSchema: Schema;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
2
2
|
import { NftMetadataUri } from '@xyo-network/evm-nft-id-payload-plugin';
|
|
3
3
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
|
-
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.
|
|
4
|
+
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts';
|
|
5
5
|
export declare class EvmCallResultToNftTokenUriDiviner<TParams extends EvmCallResultToNftTokenUriDivinerParams = EvmCallResultToNftTokenUriDivinerParams> extends AbstractDiviner<TParams, Payload, NftMetadataUri> {
|
|
6
6
|
static readonly configSchemas: Schema[];
|
|
7
7
|
static readonly defaultConfigSchema: Schema;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DivinerParams } from '@xyo-network/diviner-model';
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
-
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.
|
|
3
|
+
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.ts';
|
|
4
4
|
export type EvmCallResultToNftTokenUriDivinerParams = DivinerParams<AnyConfigSchema<EvmCallResultToNftTokenUriDivinerConfig>>;
|
|
5
5
|
//# sourceMappingURL=Params.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DivinerParams } from '@xyo-network/diviner-model';
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
-
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.
|
|
3
|
+
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.ts';
|
|
4
4
|
export type EvmCallResultToNftTokenUriDivinerParams = DivinerParams<AnyConfigSchema<EvmCallResultToNftTokenUriDivinerConfig>>;
|
|
5
5
|
//# sourceMappingURL=Params.d.ts.map
|
package/dist/browser/Params.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DivinerParams } from '@xyo-network/diviner-model';
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
-
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.
|
|
3
|
+
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.ts';
|
|
4
4
|
export type EvmCallResultToNftTokenUriDivinerParams = DivinerParams<AnyConfigSchema<EvmCallResultToNftTokenUriDivinerConfig>>;
|
|
5
5
|
//# sourceMappingURL=Params.d.ts.map
|
package/dist/browser/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
7
|
var __export = (target, all) => {
|
|
7
8
|
for (var name in all)
|
|
8
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -38,7 +39,13 @@ var import_evm_call_witness = require("@xyo-network/evm-call-witness");
|
|
|
38
39
|
var import_evm_nft_id_payload_plugin = require("@xyo-network/evm-nft-id-payload-plugin");
|
|
39
40
|
var import_payload_model = require("@xyo-network/payload-model");
|
|
40
41
|
var EvmCallResultToNftTokenUriDiviner = class extends import_diviner_abstract.AbstractDiviner {
|
|
41
|
-
static
|
|
42
|
+
static {
|
|
43
|
+
__name(this, "EvmCallResultToNftTokenUriDiviner");
|
|
44
|
+
}
|
|
45
|
+
static configSchemas = [
|
|
46
|
+
...super.configSchemas,
|
|
47
|
+
EvmCallResultToNftTokenUriDivinerConfigSchema
|
|
48
|
+
];
|
|
42
49
|
static defaultConfigSchema = EvmCallResultToNftTokenUriDivinerConfigSchema;
|
|
43
50
|
// TODO: Add support for ERC1155 with `uri` function in addition to current ERC721 `tokenURI` support
|
|
44
51
|
divineHandler(payloads = []) {
|
|
@@ -52,7 +59,13 @@ var EvmCallResultToNftTokenUriDiviner = class extends import_diviner_abstract.Ab
|
|
|
52
59
|
const tokenId = args[0];
|
|
53
60
|
const num = Number(BigInt(tokenId)).toString();
|
|
54
61
|
const metadataUri = result?.includes("{id}") ? result.replace("{id}", num) : result;
|
|
55
|
-
return {
|
|
62
|
+
return {
|
|
63
|
+
address,
|
|
64
|
+
chainId,
|
|
65
|
+
metadataUri,
|
|
66
|
+
schema: import_evm_nft_id_payload_plugin.NftMetadataUriSchema,
|
|
67
|
+
tokenId
|
|
68
|
+
};
|
|
56
69
|
});
|
|
57
70
|
return erc721CallResults;
|
|
58
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Schema.ts","../../src/Config.ts","../../src/Diviner.ts"],"sourcesContent":["export * from './Config.
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Schema.ts","../../src/Config.ts","../../src/Diviner.ts"],"sourcesContent":["export * from './Config.ts'\nexport * from './Diviner.ts'\nexport * from './Params.ts'\nexport * from './Payload.ts'\nexport * from './Schema.ts'\n","/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport const EvmCallResultToNftTokenUriDivinerSchema = 'network.xyo.evm.call.results.metadata.uri.diviner'\n/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport type EvmCallResultToNftTokenUriDivinerSchema = typeof EvmCallResultToNftTokenUriDivinerSchema\n","import { DivinerConfig } from '@xyo-network/diviner-model'\n\nimport { EvmCallResultToNftTokenUriDivinerSchema } from './Schema.ts'\n\n/**\n * The config schema for the EVM call result to NFT token URI diviner\n */\nexport const EvmCallResultToNftTokenUriDivinerConfigSchema = `${EvmCallResultToNftTokenUriDivinerSchema}.config`\n/**\n * The config schema for the EVM call result to NFT token URI diviner\n */\nexport type EvmCallResultToNftTokenUriDivinerConfigSchema = typeof EvmCallResultToNftTokenUriDivinerConfigSchema\n\n/**\n * The config for the EVM call result to NFT token URI diviner\n */\nexport type EvmCallResultToNftTokenUriDivinerConfig = DivinerConfig<{ schema: EvmCallResultToNftTokenUriDivinerConfigSchema }>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\n// eslint-disable-next-line workspaces/no-absolute-imports\nimport { EvmCallResults, EvmCallResultsSchema } from '@xyo-network/evm-call-witness'\nimport { NftMetadataUri, NftMetadataUriSchema } from '@xyo-network/evm-nft-id-payload-plugin'\nimport { isPayloadOfSchemaType, Payload, Schema } from '@xyo-network/payload-model'\n\nimport { EvmCallResultToNftTokenUriDivinerConfigSchema } from './Config.ts'\nimport { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts'\nimport { EvmTokenUriCallResults } from './Payload.ts'\n\nexport class EvmCallResultToNftTokenUriDiviner<\n TParams extends EvmCallResultToNftTokenUriDivinerParams = EvmCallResultToNftTokenUriDivinerParams,\n> extends AbstractDiviner<TParams, Payload, NftMetadataUri> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EvmCallResultToNftTokenUriDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = EvmCallResultToNftTokenUriDivinerConfigSchema\n\n // TODO: Add support for ERC1155 with `uri` function in addition to current ERC721 `tokenURI` support\n protected override divineHandler(payloads: Payload[] = []): NftMetadataUri[] {\n const evmCallResults = payloads.filter(isPayloadOfSchemaType(EvmCallResultsSchema)) as EvmCallResults[]\n const erc721CallResults = evmCallResults\n .filter((p): p is EvmTokenUriCallResults => {\n const casted = p as EvmTokenUriCallResults\n return casted.results?.tokenURI?.result !== undefined && (p.results?.tokenURI?.args?.length ?? 0) > 0\n })\n .map<NftMetadataUri>((p) => {\n const { address, chainId, results } = p\n const { args, result } = results.tokenURI\n const tokenId = args[0]\n const num = Number(BigInt(tokenId)).toString()\n const metadataUri = result?.includes('{id}') ? result.replace('{id}', num) : result\n return { address, chainId, metadataUri, schema: NftMetadataUriSchema, tokenId }\n })\n return erc721CallResults\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;ACGO,IAAMA,0CAA0C;;;ACIhD,IAAMC,gDAAgD,GAAGC,uCAAAA;;;ACPhE,8BAAgC;AAEhC,8BAAqD;AACrD,uCAAqD;AACrD,2BAAuD;AAMhD,IAAMC,oCAAN,cAEGC,wCAAAA;EAZV,OAYUA;;;EACR,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;;EAGpCE,cAAcC,WAAsB,CAAA,GAAsB;AAC3E,UAAMC,iBAAiBD,SAASE,WAAOC,4CAAsBC,4CAAAA,CAAAA;AAC7D,UAAMC,oBAAoBJ,eACvBC,OAAO,CAACI,MAAAA;AACP,YAAMC,SAASD;AACf,aAAOC,OAAOC,SAASC,UAAUC,WAAWC,WAAcL,EAAEE,SAASC,UAAUG,MAAMC,UAAU,KAAK;IACtG,CAAA,EACCC,IAAoB,CAACR,MAAAA;AACpB,YAAM,EAAES,SAASC,SAASR,QAAO,IAAKF;AACtC,YAAM,EAAEM,MAAMF,OAAM,IAAKF,QAAQC;AACjC,YAAMQ,UAAUL,KAAK,CAAA;AACrB,YAAMM,MAAMC,OAAOC,OAAOH,OAAAA,CAAAA,EAAUI,SAAQ;AAC5C,YAAMC,cAAcZ,QAAQa,SAAS,MAAA,IAAUb,OAAOc,QAAQ,QAAQN,GAAAA,IAAOR;AAC7E,aAAO;QAAEK;QAASC;QAASM;QAAaG,QAAQC;QAAsBT;MAAQ;IAChF,CAAA;AACF,WAAOZ;EACT;AACF;","names":["EvmCallResultToNftTokenUriDivinerSchema","EvmCallResultToNftTokenUriDivinerConfigSchema","EvmCallResultToNftTokenUriDivinerSchema","EvmCallResultToNftTokenUriDiviner","AbstractDiviner","configSchemas","EvmCallResultToNftTokenUriDivinerConfigSchema","defaultConfigSchema","divineHandler","payloads","evmCallResults","filter","isPayloadOfSchemaType","EvmCallResultsSchema","erc721CallResults","p","casted","results","tokenURI","result","undefined","args","length","map","address","chainId","tokenId","num","Number","BigInt","toString","metadataUri","includes","replace","schema","NftMetadataUriSchema"]}
|
package/dist/browser/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './Diviner.
|
|
3
|
-
export * from './Params.
|
|
4
|
-
export * from './Payload.
|
|
5
|
-
export * from './Schema.
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './Diviner.ts';
|
|
3
|
+
export * from './Params.ts';
|
|
4
|
+
export * from './Payload.ts';
|
|
5
|
+
export * from './Schema.ts';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/browser/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './Diviner.
|
|
3
|
-
export * from './Params.
|
|
4
|
-
export * from './Payload.
|
|
5
|
-
export * from './Schema.
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './Diviner.ts';
|
|
3
|
+
export * from './Params.ts';
|
|
4
|
+
export * from './Payload.ts';
|
|
5
|
+
export * from './Schema.ts';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './Diviner.
|
|
3
|
-
export * from './Params.
|
|
4
|
-
export * from './Payload.
|
|
5
|
-
export * from './Schema.
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './Diviner.ts';
|
|
3
|
+
export * from './Params.ts';
|
|
4
|
+
export * from './Payload.ts';
|
|
5
|
+
export * from './Schema.ts';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
1
4
|
// src/Schema.ts
|
|
2
5
|
var EvmCallResultToNftTokenUriDivinerSchema = "network.xyo.evm.call.results.metadata.uri.diviner";
|
|
3
6
|
|
|
@@ -10,7 +13,13 @@ import { EvmCallResultsSchema } from "@xyo-network/evm-call-witness";
|
|
|
10
13
|
import { NftMetadataUriSchema } from "@xyo-network/evm-nft-id-payload-plugin";
|
|
11
14
|
import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
12
15
|
var EvmCallResultToNftTokenUriDiviner = class extends AbstractDiviner {
|
|
13
|
-
static
|
|
16
|
+
static {
|
|
17
|
+
__name(this, "EvmCallResultToNftTokenUriDiviner");
|
|
18
|
+
}
|
|
19
|
+
static configSchemas = [
|
|
20
|
+
...super.configSchemas,
|
|
21
|
+
EvmCallResultToNftTokenUriDivinerConfigSchema
|
|
22
|
+
];
|
|
14
23
|
static defaultConfigSchema = EvmCallResultToNftTokenUriDivinerConfigSchema;
|
|
15
24
|
// TODO: Add support for ERC1155 with `uri` function in addition to current ERC721 `tokenURI` support
|
|
16
25
|
divineHandler(payloads = []) {
|
|
@@ -24,7 +33,13 @@ var EvmCallResultToNftTokenUriDiviner = class extends AbstractDiviner {
|
|
|
24
33
|
const tokenId = args[0];
|
|
25
34
|
const num = Number(BigInt(tokenId)).toString();
|
|
26
35
|
const metadataUri = result?.includes("{id}") ? result.replace("{id}", num) : result;
|
|
27
|
-
return {
|
|
36
|
+
return {
|
|
37
|
+
address,
|
|
38
|
+
chainId,
|
|
39
|
+
metadataUri,
|
|
40
|
+
schema: NftMetadataUriSchema,
|
|
41
|
+
tokenId
|
|
42
|
+
};
|
|
28
43
|
});
|
|
29
44
|
return erc721CallResults;
|
|
30
45
|
}
|
|
@@ -34,4 +49,4 @@ export {
|
|
|
34
49
|
EvmCallResultToNftTokenUriDivinerConfigSchema,
|
|
35
50
|
EvmCallResultToNftTokenUriDivinerSchema
|
|
36
51
|
};
|
|
37
|
-
//# sourceMappingURL=index.
|
|
52
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Schema.ts","../../src/Config.ts","../../src/Diviner.ts"],"sourcesContent":["/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport const EvmCallResultToNftTokenUriDivinerSchema = 'network.xyo.evm.call.results.metadata.uri.diviner'\n/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport type EvmCallResultToNftTokenUriDivinerSchema = typeof EvmCallResultToNftTokenUriDivinerSchema\n","import { DivinerConfig } from '@xyo-network/diviner-model'\n\nimport { EvmCallResultToNftTokenUriDivinerSchema } from './Schema.
|
|
1
|
+
{"version":3,"sources":["../../src/Schema.ts","../../src/Config.ts","../../src/Diviner.ts"],"sourcesContent":["/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport const EvmCallResultToNftTokenUriDivinerSchema = 'network.xyo.evm.call.results.metadata.uri.diviner'\n/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport type EvmCallResultToNftTokenUriDivinerSchema = typeof EvmCallResultToNftTokenUriDivinerSchema\n","import { DivinerConfig } from '@xyo-network/diviner-model'\n\nimport { EvmCallResultToNftTokenUriDivinerSchema } from './Schema.ts'\n\n/**\n * The config schema for the EVM call result to NFT token URI diviner\n */\nexport const EvmCallResultToNftTokenUriDivinerConfigSchema = `${EvmCallResultToNftTokenUriDivinerSchema}.config`\n/**\n * The config schema for the EVM call result to NFT token URI diviner\n */\nexport type EvmCallResultToNftTokenUriDivinerConfigSchema = typeof EvmCallResultToNftTokenUriDivinerConfigSchema\n\n/**\n * The config for the EVM call result to NFT token URI diviner\n */\nexport type EvmCallResultToNftTokenUriDivinerConfig = DivinerConfig<{ schema: EvmCallResultToNftTokenUriDivinerConfigSchema }>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\n// eslint-disable-next-line workspaces/no-absolute-imports\nimport { EvmCallResults, EvmCallResultsSchema } from '@xyo-network/evm-call-witness'\nimport { NftMetadataUri, NftMetadataUriSchema } from '@xyo-network/evm-nft-id-payload-plugin'\nimport { isPayloadOfSchemaType, Payload, Schema } from '@xyo-network/payload-model'\n\nimport { EvmCallResultToNftTokenUriDivinerConfigSchema } from './Config.ts'\nimport { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts'\nimport { EvmTokenUriCallResults } from './Payload.ts'\n\nexport class EvmCallResultToNftTokenUriDiviner<\n TParams extends EvmCallResultToNftTokenUriDivinerParams = EvmCallResultToNftTokenUriDivinerParams,\n> extends AbstractDiviner<TParams, Payload, NftMetadataUri> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EvmCallResultToNftTokenUriDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = EvmCallResultToNftTokenUriDivinerConfigSchema\n\n // TODO: Add support for ERC1155 with `uri` function in addition to current ERC721 `tokenURI` support\n protected override divineHandler(payloads: Payload[] = []): NftMetadataUri[] {\n const evmCallResults = payloads.filter(isPayloadOfSchemaType(EvmCallResultsSchema)) as EvmCallResults[]\n const erc721CallResults = evmCallResults\n .filter((p): p is EvmTokenUriCallResults => {\n const casted = p as EvmTokenUriCallResults\n return casted.results?.tokenURI?.result !== undefined && (p.results?.tokenURI?.args?.length ?? 0) > 0\n })\n .map<NftMetadataUri>((p) => {\n const { address, chainId, results } = p\n const { args, result } = results.tokenURI\n const tokenId = args[0]\n const num = Number(BigInt(tokenId)).toString()\n const metadataUri = result?.includes('{id}') ? result.replace('{id}', num) : result\n return { address, chainId, metadataUri, schema: NftMetadataUriSchema, tokenId }\n })\n return erc721CallResults\n }\n}\n"],"mappings":";;;;AAGO,IAAMA,0CAA0C;;;ACIhD,IAAMC,gDAAgD,GAAGC,uCAAAA;;;ACPhE,SAASC,uBAAuB;AAEhC,SAAyBC,4BAA4B;AACrD,SAAyBC,4BAA4B;AACrD,SAASC,6BAA8C;AAMhD,IAAMC,oCAAN,cAEGC,gBAAAA;EAZV,OAYUA;;;EACR,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;;EAGpCE,cAAcC,WAAsB,CAAA,GAAsB;AAC3E,UAAMC,iBAAiBD,SAASE,OAAOC,sBAAsBC,oBAAAA,CAAAA;AAC7D,UAAMC,oBAAoBJ,eACvBC,OAAO,CAACI,MAAAA;AACP,YAAMC,SAASD;AACf,aAAOC,OAAOC,SAASC,UAAUC,WAAWC,WAAcL,EAAEE,SAASC,UAAUG,MAAMC,UAAU,KAAK;IACtG,CAAA,EACCC,IAAoB,CAACR,MAAAA;AACpB,YAAM,EAAES,SAASC,SAASR,QAAO,IAAKF;AACtC,YAAM,EAAEM,MAAMF,OAAM,IAAKF,QAAQC;AACjC,YAAMQ,UAAUL,KAAK,CAAA;AACrB,YAAMM,MAAMC,OAAOC,OAAOH,OAAAA,CAAAA,EAAUI,SAAQ;AAC5C,YAAMC,cAAcZ,QAAQa,SAAS,MAAA,IAAUb,OAAOc,QAAQ,QAAQN,GAAAA,IAAOR;AAC7E,aAAO;QAAEK;QAASC;QAASM;QAAaG,QAAQC;QAAsBT;MAAQ;IAChF,CAAA;AACF,WAAOZ;EACT;AACF;","names":["EvmCallResultToNftTokenUriDivinerSchema","EvmCallResultToNftTokenUriDivinerConfigSchema","EvmCallResultToNftTokenUriDivinerSchema","AbstractDiviner","EvmCallResultsSchema","NftMetadataUriSchema","isPayloadOfSchemaType","EvmCallResultToNftTokenUriDiviner","AbstractDiviner","configSchemas","EvmCallResultToNftTokenUriDivinerConfigSchema","defaultConfigSchema","divineHandler","payloads","evmCallResults","filter","isPayloadOfSchemaType","EvmCallResultsSchema","erc721CallResults","p","casted","results","tokenURI","result","undefined","args","length","map","address","chainId","tokenId","num","Number","BigInt","toString","metadataUri","includes","replace","schema","NftMetadataUriSchema"]}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
2
2
|
import { NftMetadataUri } from '@xyo-network/evm-nft-id-payload-plugin';
|
|
3
3
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
|
-
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.
|
|
4
|
+
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts';
|
|
5
5
|
export declare class EvmCallResultToNftTokenUriDiviner<TParams extends EvmCallResultToNftTokenUriDivinerParams = EvmCallResultToNftTokenUriDivinerParams> extends AbstractDiviner<TParams, Payload, NftMetadataUri> {
|
|
6
6
|
static readonly configSchemas: Schema[];
|
|
7
7
|
static readonly defaultConfigSchema: Schema;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
2
2
|
import { NftMetadataUri } from '@xyo-network/evm-nft-id-payload-plugin';
|
|
3
3
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
|
-
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.
|
|
4
|
+
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts';
|
|
5
5
|
export declare class EvmCallResultToNftTokenUriDiviner<TParams extends EvmCallResultToNftTokenUriDivinerParams = EvmCallResultToNftTokenUriDivinerParams> extends AbstractDiviner<TParams, Payload, NftMetadataUri> {
|
|
6
6
|
static readonly configSchemas: Schema[];
|
|
7
7
|
static readonly defaultConfigSchema: Schema;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
2
2
|
import { NftMetadataUri } from '@xyo-network/evm-nft-id-payload-plugin';
|
|
3
3
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
|
-
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.
|
|
4
|
+
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts';
|
|
5
5
|
export declare class EvmCallResultToNftTokenUriDiviner<TParams extends EvmCallResultToNftTokenUriDivinerParams = EvmCallResultToNftTokenUriDivinerParams> extends AbstractDiviner<TParams, Payload, NftMetadataUri> {
|
|
6
6
|
static readonly configSchemas: Schema[];
|
|
7
7
|
static readonly defaultConfigSchema: Schema;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DivinerParams } from '@xyo-network/diviner-model';
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
-
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.
|
|
3
|
+
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.ts';
|
|
4
4
|
export type EvmCallResultToNftTokenUriDivinerParams = DivinerParams<AnyConfigSchema<EvmCallResultToNftTokenUriDivinerConfig>>;
|
|
5
5
|
//# sourceMappingURL=Params.d.ts.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DivinerParams } from '@xyo-network/diviner-model';
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
-
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.
|
|
3
|
+
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.ts';
|
|
4
4
|
export type EvmCallResultToNftTokenUriDivinerParams = DivinerParams<AnyConfigSchema<EvmCallResultToNftTokenUriDivinerConfig>>;
|
|
5
5
|
//# sourceMappingURL=Params.d.ts.map
|
package/dist/neutral/Params.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DivinerParams } from '@xyo-network/diviner-model';
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
-
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.
|
|
3
|
+
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.ts';
|
|
4
4
|
export type EvmCallResultToNftTokenUriDivinerParams = DivinerParams<AnyConfigSchema<EvmCallResultToNftTokenUriDivinerConfig>>;
|
|
5
5
|
//# sourceMappingURL=Params.d.ts.map
|
package/dist/neutral/index.cjs
CHANGED
|
@@ -3,6 +3,7 @@ var __defProp = Object.defineProperty;
|
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
7
|
var __export = (target, all) => {
|
|
7
8
|
for (var name in all)
|
|
8
9
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -38,7 +39,13 @@ var import_evm_call_witness = require("@xyo-network/evm-call-witness");
|
|
|
38
39
|
var import_evm_nft_id_payload_plugin = require("@xyo-network/evm-nft-id-payload-plugin");
|
|
39
40
|
var import_payload_model = require("@xyo-network/payload-model");
|
|
40
41
|
var EvmCallResultToNftTokenUriDiviner = class extends import_diviner_abstract.AbstractDiviner {
|
|
41
|
-
static
|
|
42
|
+
static {
|
|
43
|
+
__name(this, "EvmCallResultToNftTokenUriDiviner");
|
|
44
|
+
}
|
|
45
|
+
static configSchemas = [
|
|
46
|
+
...super.configSchemas,
|
|
47
|
+
EvmCallResultToNftTokenUriDivinerConfigSchema
|
|
48
|
+
];
|
|
42
49
|
static defaultConfigSchema = EvmCallResultToNftTokenUriDivinerConfigSchema;
|
|
43
50
|
// TODO: Add support for ERC1155 with `uri` function in addition to current ERC721 `tokenURI` support
|
|
44
51
|
divineHandler(payloads = []) {
|
|
@@ -52,7 +59,13 @@ var EvmCallResultToNftTokenUriDiviner = class extends import_diviner_abstract.Ab
|
|
|
52
59
|
const tokenId = args[0];
|
|
53
60
|
const num = Number(BigInt(tokenId)).toString();
|
|
54
61
|
const metadataUri = result?.includes("{id}") ? result.replace("{id}", num) : result;
|
|
55
|
-
return {
|
|
62
|
+
return {
|
|
63
|
+
address,
|
|
64
|
+
chainId,
|
|
65
|
+
metadataUri,
|
|
66
|
+
schema: import_evm_nft_id_payload_plugin.NftMetadataUriSchema,
|
|
67
|
+
tokenId
|
|
68
|
+
};
|
|
56
69
|
});
|
|
57
70
|
return erc721CallResults;
|
|
58
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Schema.ts","../../src/Config.ts","../../src/Diviner.ts"],"sourcesContent":["export * from './Config.
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Schema.ts","../../src/Config.ts","../../src/Diviner.ts"],"sourcesContent":["export * from './Config.ts'\nexport * from './Diviner.ts'\nexport * from './Params.ts'\nexport * from './Payload.ts'\nexport * from './Schema.ts'\n","/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport const EvmCallResultToNftTokenUriDivinerSchema = 'network.xyo.evm.call.results.metadata.uri.diviner'\n/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport type EvmCallResultToNftTokenUriDivinerSchema = typeof EvmCallResultToNftTokenUriDivinerSchema\n","import { DivinerConfig } from '@xyo-network/diviner-model'\n\nimport { EvmCallResultToNftTokenUriDivinerSchema } from './Schema.ts'\n\n/**\n * The config schema for the EVM call result to NFT token URI diviner\n */\nexport const EvmCallResultToNftTokenUriDivinerConfigSchema = `${EvmCallResultToNftTokenUriDivinerSchema}.config`\n/**\n * The config schema for the EVM call result to NFT token URI diviner\n */\nexport type EvmCallResultToNftTokenUriDivinerConfigSchema = typeof EvmCallResultToNftTokenUriDivinerConfigSchema\n\n/**\n * The config for the EVM call result to NFT token URI diviner\n */\nexport type EvmCallResultToNftTokenUriDivinerConfig = DivinerConfig<{ schema: EvmCallResultToNftTokenUriDivinerConfigSchema }>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\n// eslint-disable-next-line workspaces/no-absolute-imports\nimport { EvmCallResults, EvmCallResultsSchema } from '@xyo-network/evm-call-witness'\nimport { NftMetadataUri, NftMetadataUriSchema } from '@xyo-network/evm-nft-id-payload-plugin'\nimport { isPayloadOfSchemaType, Payload, Schema } from '@xyo-network/payload-model'\n\nimport { EvmCallResultToNftTokenUriDivinerConfigSchema } from './Config.ts'\nimport { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts'\nimport { EvmTokenUriCallResults } from './Payload.ts'\n\nexport class EvmCallResultToNftTokenUriDiviner<\n TParams extends EvmCallResultToNftTokenUriDivinerParams = EvmCallResultToNftTokenUriDivinerParams,\n> extends AbstractDiviner<TParams, Payload, NftMetadataUri> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EvmCallResultToNftTokenUriDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = EvmCallResultToNftTokenUriDivinerConfigSchema\n\n // TODO: Add support for ERC1155 with `uri` function in addition to current ERC721 `tokenURI` support\n protected override divineHandler(payloads: Payload[] = []): NftMetadataUri[] {\n const evmCallResults = payloads.filter(isPayloadOfSchemaType(EvmCallResultsSchema)) as EvmCallResults[]\n const erc721CallResults = evmCallResults\n .filter((p): p is EvmTokenUriCallResults => {\n const casted = p as EvmTokenUriCallResults\n return casted.results?.tokenURI?.result !== undefined && (p.results?.tokenURI?.args?.length ?? 0) > 0\n })\n .map<NftMetadataUri>((p) => {\n const { address, chainId, results } = p\n const { args, result } = results.tokenURI\n const tokenId = args[0]\n const num = Number(BigInt(tokenId)).toString()\n const metadataUri = result?.includes('{id}') ? result.replace('{id}', num) : result\n return { address, chainId, metadataUri, schema: NftMetadataUriSchema, tokenId }\n })\n return erc721CallResults\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;ACGO,IAAMA,0CAA0C;;;ACIhD,IAAMC,gDAAgD,GAAGC,uCAAAA;;;ACPhE,8BAAgC;AAEhC,8BAAqD;AACrD,uCAAqD;AACrD,2BAAuD;AAMhD,IAAMC,oCAAN,cAEGC,wCAAAA;EAZV,OAYUA;;;EACR,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;;EAGpCE,cAAcC,WAAsB,CAAA,GAAsB;AAC3E,UAAMC,iBAAiBD,SAASE,WAAOC,4CAAsBC,4CAAAA,CAAAA;AAC7D,UAAMC,oBAAoBJ,eACvBC,OAAO,CAACI,MAAAA;AACP,YAAMC,SAASD;AACf,aAAOC,OAAOC,SAASC,UAAUC,WAAWC,WAAcL,EAAEE,SAASC,UAAUG,MAAMC,UAAU,KAAK;IACtG,CAAA,EACCC,IAAoB,CAACR,MAAAA;AACpB,YAAM,EAAES,SAASC,SAASR,QAAO,IAAKF;AACtC,YAAM,EAAEM,MAAMF,OAAM,IAAKF,QAAQC;AACjC,YAAMQ,UAAUL,KAAK,CAAA;AACrB,YAAMM,MAAMC,OAAOC,OAAOH,OAAAA,CAAAA,EAAUI,SAAQ;AAC5C,YAAMC,cAAcZ,QAAQa,SAAS,MAAA,IAAUb,OAAOc,QAAQ,QAAQN,GAAAA,IAAOR;AAC7E,aAAO;QAAEK;QAASC;QAASM;QAAaG,QAAQC;QAAsBT;MAAQ;IAChF,CAAA;AACF,WAAOZ;EACT;AACF;","names":["EvmCallResultToNftTokenUriDivinerSchema","EvmCallResultToNftTokenUriDivinerConfigSchema","EvmCallResultToNftTokenUriDivinerSchema","EvmCallResultToNftTokenUriDiviner","AbstractDiviner","configSchemas","EvmCallResultToNftTokenUriDivinerConfigSchema","defaultConfigSchema","divineHandler","payloads","evmCallResults","filter","isPayloadOfSchemaType","EvmCallResultsSchema","erc721CallResults","p","casted","results","tokenURI","result","undefined","args","length","map","address","chainId","tokenId","num","Number","BigInt","toString","metadataUri","includes","replace","schema","NftMetadataUriSchema"]}
|
package/dist/neutral/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './Diviner.
|
|
3
|
-
export * from './Params.
|
|
4
|
-
export * from './Payload.
|
|
5
|
-
export * from './Schema.
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './Diviner.ts';
|
|
3
|
+
export * from './Params.ts';
|
|
4
|
+
export * from './Payload.ts';
|
|
5
|
+
export * from './Schema.ts';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/neutral/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './Diviner.
|
|
3
|
-
export * from './Params.
|
|
4
|
-
export * from './Payload.
|
|
5
|
-
export * from './Schema.
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './Diviner.ts';
|
|
3
|
+
export * from './Params.ts';
|
|
4
|
+
export * from './Payload.ts';
|
|
5
|
+
export * from './Schema.ts';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './Diviner.
|
|
3
|
-
export * from './Params.
|
|
4
|
-
export * from './Payload.
|
|
5
|
-
export * from './Schema.
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './Diviner.ts';
|
|
3
|
+
export * from './Params.ts';
|
|
4
|
+
export * from './Payload.ts';
|
|
5
|
+
export * from './Schema.ts';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
1
4
|
// src/Schema.ts
|
|
2
5
|
var EvmCallResultToNftTokenUriDivinerSchema = "network.xyo.evm.call.results.metadata.uri.diviner";
|
|
3
6
|
|
|
@@ -10,7 +13,13 @@ import { EvmCallResultsSchema } from "@xyo-network/evm-call-witness";
|
|
|
10
13
|
import { NftMetadataUriSchema } from "@xyo-network/evm-nft-id-payload-plugin";
|
|
11
14
|
import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
12
15
|
var EvmCallResultToNftTokenUriDiviner = class extends AbstractDiviner {
|
|
13
|
-
static
|
|
16
|
+
static {
|
|
17
|
+
__name(this, "EvmCallResultToNftTokenUriDiviner");
|
|
18
|
+
}
|
|
19
|
+
static configSchemas = [
|
|
20
|
+
...super.configSchemas,
|
|
21
|
+
EvmCallResultToNftTokenUriDivinerConfigSchema
|
|
22
|
+
];
|
|
14
23
|
static defaultConfigSchema = EvmCallResultToNftTokenUriDivinerConfigSchema;
|
|
15
24
|
// TODO: Add support for ERC1155 with `uri` function in addition to current ERC721 `tokenURI` support
|
|
16
25
|
divineHandler(payloads = []) {
|
|
@@ -24,7 +33,13 @@ var EvmCallResultToNftTokenUriDiviner = class extends AbstractDiviner {
|
|
|
24
33
|
const tokenId = args[0];
|
|
25
34
|
const num = Number(BigInt(tokenId)).toString();
|
|
26
35
|
const metadataUri = result?.includes("{id}") ? result.replace("{id}", num) : result;
|
|
27
|
-
return {
|
|
36
|
+
return {
|
|
37
|
+
address,
|
|
38
|
+
chainId,
|
|
39
|
+
metadataUri,
|
|
40
|
+
schema: NftMetadataUriSchema,
|
|
41
|
+
tokenId
|
|
42
|
+
};
|
|
28
43
|
});
|
|
29
44
|
return erc721CallResults;
|
|
30
45
|
}
|
|
@@ -34,4 +49,4 @@ export {
|
|
|
34
49
|
EvmCallResultToNftTokenUriDivinerConfigSchema,
|
|
35
50
|
EvmCallResultToNftTokenUriDivinerSchema
|
|
36
51
|
};
|
|
37
|
-
//# sourceMappingURL=index.
|
|
52
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Schema.ts","../../src/Config.ts","../../src/Diviner.ts"],"sourcesContent":["/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport const EvmCallResultToNftTokenUriDivinerSchema = 'network.xyo.evm.call.results.metadata.uri.diviner'\n/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport type EvmCallResultToNftTokenUriDivinerSchema = typeof EvmCallResultToNftTokenUriDivinerSchema\n","import { DivinerConfig } from '@xyo-network/diviner-model'\n\nimport { EvmCallResultToNftTokenUriDivinerSchema } from './Schema.
|
|
1
|
+
{"version":3,"sources":["../../src/Schema.ts","../../src/Config.ts","../../src/Diviner.ts"],"sourcesContent":["/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport const EvmCallResultToNftTokenUriDivinerSchema = 'network.xyo.evm.call.results.metadata.uri.diviner'\n/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport type EvmCallResultToNftTokenUriDivinerSchema = typeof EvmCallResultToNftTokenUriDivinerSchema\n","import { DivinerConfig } from '@xyo-network/diviner-model'\n\nimport { EvmCallResultToNftTokenUriDivinerSchema } from './Schema.ts'\n\n/**\n * The config schema for the EVM call result to NFT token URI diviner\n */\nexport const EvmCallResultToNftTokenUriDivinerConfigSchema = `${EvmCallResultToNftTokenUriDivinerSchema}.config`\n/**\n * The config schema for the EVM call result to NFT token URI diviner\n */\nexport type EvmCallResultToNftTokenUriDivinerConfigSchema = typeof EvmCallResultToNftTokenUriDivinerConfigSchema\n\n/**\n * The config for the EVM call result to NFT token URI diviner\n */\nexport type EvmCallResultToNftTokenUriDivinerConfig = DivinerConfig<{ schema: EvmCallResultToNftTokenUriDivinerConfigSchema }>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\n// eslint-disable-next-line workspaces/no-absolute-imports\nimport { EvmCallResults, EvmCallResultsSchema } from '@xyo-network/evm-call-witness'\nimport { NftMetadataUri, NftMetadataUriSchema } from '@xyo-network/evm-nft-id-payload-plugin'\nimport { isPayloadOfSchemaType, Payload, Schema } from '@xyo-network/payload-model'\n\nimport { EvmCallResultToNftTokenUriDivinerConfigSchema } from './Config.ts'\nimport { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts'\nimport { EvmTokenUriCallResults } from './Payload.ts'\n\nexport class EvmCallResultToNftTokenUriDiviner<\n TParams extends EvmCallResultToNftTokenUriDivinerParams = EvmCallResultToNftTokenUriDivinerParams,\n> extends AbstractDiviner<TParams, Payload, NftMetadataUri> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EvmCallResultToNftTokenUriDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = EvmCallResultToNftTokenUriDivinerConfigSchema\n\n // TODO: Add support for ERC1155 with `uri` function in addition to current ERC721 `tokenURI` support\n protected override divineHandler(payloads: Payload[] = []): NftMetadataUri[] {\n const evmCallResults = payloads.filter(isPayloadOfSchemaType(EvmCallResultsSchema)) as EvmCallResults[]\n const erc721CallResults = evmCallResults\n .filter((p): p is EvmTokenUriCallResults => {\n const casted = p as EvmTokenUriCallResults\n return casted.results?.tokenURI?.result !== undefined && (p.results?.tokenURI?.args?.length ?? 0) > 0\n })\n .map<NftMetadataUri>((p) => {\n const { address, chainId, results } = p\n const { args, result } = results.tokenURI\n const tokenId = args[0]\n const num = Number(BigInt(tokenId)).toString()\n const metadataUri = result?.includes('{id}') ? result.replace('{id}', num) : result\n return { address, chainId, metadataUri, schema: NftMetadataUriSchema, tokenId }\n })\n return erc721CallResults\n }\n}\n"],"mappings":";;;;AAGO,IAAMA,0CAA0C;;;ACIhD,IAAMC,gDAAgD,GAAGC,uCAAAA;;;ACPhE,SAASC,uBAAuB;AAEhC,SAAyBC,4BAA4B;AACrD,SAAyBC,4BAA4B;AACrD,SAASC,6BAA8C;AAMhD,IAAMC,oCAAN,cAEGC,gBAAAA;EAZV,OAYUA;;;EACR,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;;EAGpCE,cAAcC,WAAsB,CAAA,GAAsB;AAC3E,UAAMC,iBAAiBD,SAASE,OAAOC,sBAAsBC,oBAAAA,CAAAA;AAC7D,UAAMC,oBAAoBJ,eACvBC,OAAO,CAACI,MAAAA;AACP,YAAMC,SAASD;AACf,aAAOC,OAAOC,SAASC,UAAUC,WAAWC,WAAcL,EAAEE,SAASC,UAAUG,MAAMC,UAAU,KAAK;IACtG,CAAA,EACCC,IAAoB,CAACR,MAAAA;AACpB,YAAM,EAAES,SAASC,SAASR,QAAO,IAAKF;AACtC,YAAM,EAAEM,MAAMF,OAAM,IAAKF,QAAQC;AACjC,YAAMQ,UAAUL,KAAK,CAAA;AACrB,YAAMM,MAAMC,OAAOC,OAAOH,OAAAA,CAAAA,EAAUI,SAAQ;AAC5C,YAAMC,cAAcZ,QAAQa,SAAS,MAAA,IAAUb,OAAOc,QAAQ,QAAQN,GAAAA,IAAOR;AAC7E,aAAO;QAAEK;QAASC;QAASM;QAAaG,QAAQC;QAAsBT;MAAQ;IAChF,CAAA;AACF,WAAOZ;EACT;AACF;","names":["EvmCallResultToNftTokenUriDivinerSchema","EvmCallResultToNftTokenUriDivinerConfigSchema","EvmCallResultToNftTokenUriDivinerSchema","AbstractDiviner","EvmCallResultsSchema","NftMetadataUriSchema","isPayloadOfSchemaType","EvmCallResultToNftTokenUriDiviner","AbstractDiviner","configSchemas","EvmCallResultToNftTokenUriDivinerConfigSchema","defaultConfigSchema","divineHandler","payloads","evmCallResults","filter","isPayloadOfSchemaType","EvmCallResultsSchema","erc721CallResults","p","casted","results","tokenURI","result","undefined","args","length","map","address","chainId","tokenId","num","Number","BigInt","toString","metadataUri","includes","replace","schema","NftMetadataUriSchema"]}
|
package/dist/node/Diviner.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
2
2
|
import { NftMetadataUri } from '@xyo-network/evm-nft-id-payload-plugin';
|
|
3
3
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
|
-
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.
|
|
4
|
+
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts';
|
|
5
5
|
export declare class EvmCallResultToNftTokenUriDiviner<TParams extends EvmCallResultToNftTokenUriDivinerParams = EvmCallResultToNftTokenUriDivinerParams> extends AbstractDiviner<TParams, Payload, NftMetadataUri> {
|
|
6
6
|
static readonly configSchemas: Schema[];
|
|
7
7
|
static readonly defaultConfigSchema: Schema;
|
package/dist/node/Diviner.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
2
2
|
import { NftMetadataUri } from '@xyo-network/evm-nft-id-payload-plugin';
|
|
3
3
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
|
-
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.
|
|
4
|
+
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts';
|
|
5
5
|
export declare class EvmCallResultToNftTokenUriDiviner<TParams extends EvmCallResultToNftTokenUriDivinerParams = EvmCallResultToNftTokenUriDivinerParams> extends AbstractDiviner<TParams, Payload, NftMetadataUri> {
|
|
6
6
|
static readonly configSchemas: Schema[];
|
|
7
7
|
static readonly defaultConfigSchema: Schema;
|
package/dist/node/Diviner.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
2
2
|
import { NftMetadataUri } from '@xyo-network/evm-nft-id-payload-plugin';
|
|
3
3
|
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
4
|
-
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.
|
|
4
|
+
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts';
|
|
5
5
|
export declare class EvmCallResultToNftTokenUriDiviner<TParams extends EvmCallResultToNftTokenUriDivinerParams = EvmCallResultToNftTokenUriDivinerParams> extends AbstractDiviner<TParams, Payload, NftMetadataUri> {
|
|
6
6
|
static readonly configSchemas: Schema[];
|
|
7
7
|
static readonly defaultConfigSchema: Schema;
|
package/dist/node/Params.d.cts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DivinerParams } from '@xyo-network/diviner-model';
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
-
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.
|
|
3
|
+
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.ts';
|
|
4
4
|
export type EvmCallResultToNftTokenUriDivinerParams = DivinerParams<AnyConfigSchema<EvmCallResultToNftTokenUriDivinerConfig>>;
|
|
5
5
|
//# sourceMappingURL=Params.d.ts.map
|
package/dist/node/Params.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DivinerParams } from '@xyo-network/diviner-model';
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
-
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.
|
|
3
|
+
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.ts';
|
|
4
4
|
export type EvmCallResultToNftTokenUriDivinerParams = DivinerParams<AnyConfigSchema<EvmCallResultToNftTokenUriDivinerConfig>>;
|
|
5
5
|
//# sourceMappingURL=Params.d.ts.map
|
package/dist/node/Params.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DivinerParams } from '@xyo-network/diviner-model';
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
3
|
-
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.
|
|
3
|
+
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.ts';
|
|
4
4
|
export type EvmCallResultToNftTokenUriDivinerParams = DivinerParams<AnyConfigSchema<EvmCallResultToNftTokenUriDivinerConfig>>;
|
|
5
5
|
//# sourceMappingURL=Params.d.ts.map
|
package/dist/node/index.cjs
CHANGED
|
@@ -2,7 +2,11 @@
|
|
|
2
2
|
var __defProp = Object.defineProperty;
|
|
3
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
+
var __reflectGet = Reflect.get;
|
|
8
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
10
|
var __export = (target, all) => {
|
|
7
11
|
for (var name in all)
|
|
8
12
|
__defProp(target, name, { get: all[name], enumerable: true });
|
|
@@ -16,6 +20,8 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
16
20
|
return to;
|
|
17
21
|
};
|
|
18
22
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
23
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
24
|
+
var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
|
|
19
25
|
|
|
20
26
|
// src/index.ts
|
|
21
27
|
var src_exports = {};
|
|
@@ -37,9 +43,7 @@ var import_diviner_abstract = require("@xyo-network/diviner-abstract");
|
|
|
37
43
|
var import_evm_call_witness = require("@xyo-network/evm-call-witness");
|
|
38
44
|
var import_evm_nft_id_payload_plugin = require("@xyo-network/evm-nft-id-payload-plugin");
|
|
39
45
|
var import_payload_model = require("@xyo-network/payload-model");
|
|
40
|
-
var
|
|
41
|
-
static configSchemas = [...super.configSchemas, EvmCallResultToNftTokenUriDivinerConfigSchema];
|
|
42
|
-
static defaultConfigSchema = EvmCallResultToNftTokenUriDivinerConfigSchema;
|
|
46
|
+
var _EvmCallResultToNftTokenUriDiviner = class _EvmCallResultToNftTokenUriDiviner extends import_diviner_abstract.AbstractDiviner {
|
|
43
47
|
// TODO: Add support for ERC1155 with `uri` function in addition to current ERC721 `tokenURI` support
|
|
44
48
|
divineHandler(payloads = []) {
|
|
45
49
|
const evmCallResults = payloads.filter((0, import_payload_model.isPayloadOfSchemaType)(import_evm_call_witness.EvmCallResultsSchema));
|
|
@@ -53,11 +57,24 @@ var EvmCallResultToNftTokenUriDiviner = class extends import_diviner_abstract.Ab
|
|
|
53
57
|
const tokenId = args[0];
|
|
54
58
|
const num = Number(BigInt(tokenId)).toString();
|
|
55
59
|
const metadataUri = (result == null ? void 0 : result.includes("{id}")) ? result.replace("{id}", num) : result;
|
|
56
|
-
return {
|
|
60
|
+
return {
|
|
61
|
+
address,
|
|
62
|
+
chainId,
|
|
63
|
+
metadataUri,
|
|
64
|
+
schema: import_evm_nft_id_payload_plugin.NftMetadataUriSchema,
|
|
65
|
+
tokenId
|
|
66
|
+
};
|
|
57
67
|
});
|
|
58
68
|
return erc721CallResults;
|
|
59
69
|
}
|
|
60
70
|
};
|
|
71
|
+
__name(_EvmCallResultToNftTokenUriDiviner, "EvmCallResultToNftTokenUriDiviner");
|
|
72
|
+
__publicField(_EvmCallResultToNftTokenUriDiviner, "configSchemas", [
|
|
73
|
+
...__superGet(_EvmCallResultToNftTokenUriDiviner, _EvmCallResultToNftTokenUriDiviner, "configSchemas"),
|
|
74
|
+
EvmCallResultToNftTokenUriDivinerConfigSchema
|
|
75
|
+
]);
|
|
76
|
+
__publicField(_EvmCallResultToNftTokenUriDiviner, "defaultConfigSchema", EvmCallResultToNftTokenUriDivinerConfigSchema);
|
|
77
|
+
var EvmCallResultToNftTokenUriDiviner = _EvmCallResultToNftTokenUriDiviner;
|
|
61
78
|
// Annotate the CommonJS export names for ESM import in node:
|
|
62
79
|
0 && (module.exports = {
|
|
63
80
|
EvmCallResultToNftTokenUriDiviner,
|
package/dist/node/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Schema.ts","../../src/Config.ts","../../src/Diviner.ts"],"sourcesContent":["export * from './Config.
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Schema.ts","../../src/Config.ts","../../src/Diviner.ts"],"sourcesContent":["export * from './Config.ts'\nexport * from './Diviner.ts'\nexport * from './Params.ts'\nexport * from './Payload.ts'\nexport * from './Schema.ts'\n","/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport const EvmCallResultToNftTokenUriDivinerSchema = 'network.xyo.evm.call.results.metadata.uri.diviner'\n/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport type EvmCallResultToNftTokenUriDivinerSchema = typeof EvmCallResultToNftTokenUriDivinerSchema\n","import { DivinerConfig } from '@xyo-network/diviner-model'\n\nimport { EvmCallResultToNftTokenUriDivinerSchema } from './Schema.ts'\n\n/**\n * The config schema for the EVM call result to NFT token URI diviner\n */\nexport const EvmCallResultToNftTokenUriDivinerConfigSchema = `${EvmCallResultToNftTokenUriDivinerSchema}.config`\n/**\n * The config schema for the EVM call result to NFT token URI diviner\n */\nexport type EvmCallResultToNftTokenUriDivinerConfigSchema = typeof EvmCallResultToNftTokenUriDivinerConfigSchema\n\n/**\n * The config for the EVM call result to NFT token URI diviner\n */\nexport type EvmCallResultToNftTokenUriDivinerConfig = DivinerConfig<{ schema: EvmCallResultToNftTokenUriDivinerConfigSchema }>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\n// eslint-disable-next-line workspaces/no-absolute-imports\nimport { EvmCallResults, EvmCallResultsSchema } from '@xyo-network/evm-call-witness'\nimport { NftMetadataUri, NftMetadataUriSchema } from '@xyo-network/evm-nft-id-payload-plugin'\nimport { isPayloadOfSchemaType, Payload, Schema } from '@xyo-network/payload-model'\n\nimport { EvmCallResultToNftTokenUriDivinerConfigSchema } from './Config.ts'\nimport { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts'\nimport { EvmTokenUriCallResults } from './Payload.ts'\n\nexport class EvmCallResultToNftTokenUriDiviner<\n TParams extends EvmCallResultToNftTokenUriDivinerParams = EvmCallResultToNftTokenUriDivinerParams,\n> extends AbstractDiviner<TParams, Payload, NftMetadataUri> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EvmCallResultToNftTokenUriDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = EvmCallResultToNftTokenUriDivinerConfigSchema\n\n // TODO: Add support for ERC1155 with `uri` function in addition to current ERC721 `tokenURI` support\n protected override divineHandler(payloads: Payload[] = []): NftMetadataUri[] {\n const evmCallResults = payloads.filter(isPayloadOfSchemaType(EvmCallResultsSchema)) as EvmCallResults[]\n const erc721CallResults = evmCallResults\n .filter((p): p is EvmTokenUriCallResults => {\n const casted = p as EvmTokenUriCallResults\n return casted.results?.tokenURI?.result !== undefined && (p.results?.tokenURI?.args?.length ?? 0) > 0\n })\n .map<NftMetadataUri>((p) => {\n const { address, chainId, results } = p\n const { args, result } = results.tokenURI\n const tokenId = args[0]\n const num = Number(BigInt(tokenId)).toString()\n const metadataUri = result?.includes('{id}') ? result.replace('{id}', num) : result\n return { address, chainId, metadataUri, schema: NftMetadataUriSchema, tokenId }\n })\n return erc721CallResults\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;ACGO,IAAMA,0CAA0C;;;ACIhD,IAAMC,gDAAgD,GAAGC,uCAAAA;;;ACPhE,8BAAgC;AAEhC,8BAAqD;AACrD,uCAAqD;AACrD,2BAAuD;AAMhD,IAAMC,qCAAN,MAAMA,2CAEHC,wCAAAA;;EAKWC,cAAcC,WAAsB,CAAA,GAAsB;AAC3E,UAAMC,iBAAiBD,SAASE,WAAOC,4CAAsBC,4CAAAA,CAAAA;AAC7D,UAAMC,oBAAoBJ,eACvBC,OAAO,CAACI,MAAAA;AApBf;AAqBQ,YAAMC,SAASD;AACf,eAAOC,kBAAOC,YAAPD,mBAAgBE,aAAhBF,mBAA0BG,YAAWC,aAAcL,mBAAEE,YAAFF,mBAAWG,aAAXH,mBAAqBM,SAArBN,mBAA2BO,WAAU,KAAK;IACtG,CAAA,EACCC,IAAoB,CAACR,MAAAA;AACpB,YAAM,EAAES,SAASC,SAASR,QAAO,IAAKF;AACtC,YAAM,EAAEM,MAAMF,OAAM,IAAKF,QAAQC;AACjC,YAAMQ,UAAUL,KAAK,CAAA;AACrB,YAAMM,MAAMC,OAAOC,OAAOH,OAAAA,CAAAA,EAAUI,SAAQ;AAC5C,YAAMC,eAAcZ,iCAAQa,SAAS,WAAUb,OAAOc,QAAQ,QAAQN,GAAAA,IAAOR;AAC7E,aAAO;QAAEK;QAASC;QAASM;QAAaG,QAAQC;QAAsBT;MAAQ;IAChF,CAAA;AACF,WAAOZ;EACT;AACF;AAtBUP;AACR,cAHWD,oCAGc8B,iBAA0B;KAAI,mFAAMA;EAAeC;;AAC5E,cAJW/B,oCAIcgC,uBAA8BD;AAJlD,IAAM/B,oCAAN;","names":["EvmCallResultToNftTokenUriDivinerSchema","EvmCallResultToNftTokenUriDivinerConfigSchema","EvmCallResultToNftTokenUriDivinerSchema","EvmCallResultToNftTokenUriDiviner","AbstractDiviner","divineHandler","payloads","evmCallResults","filter","isPayloadOfSchemaType","EvmCallResultsSchema","erc721CallResults","p","casted","results","tokenURI","result","undefined","args","length","map","address","chainId","tokenId","num","Number","BigInt","toString","metadataUri","includes","replace","schema","NftMetadataUriSchema","configSchemas","EvmCallResultToNftTokenUriDivinerConfigSchema","defaultConfigSchema"]}
|
package/dist/node/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './Diviner.
|
|
3
|
-
export * from './Params.
|
|
4
|
-
export * from './Payload.
|
|
5
|
-
export * from './Schema.
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './Diviner.ts';
|
|
3
|
+
export * from './Params.ts';
|
|
4
|
+
export * from './Payload.ts';
|
|
5
|
+
export * from './Schema.ts';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './Diviner.
|
|
3
|
-
export * from './Params.
|
|
4
|
-
export * from './Payload.
|
|
5
|
-
export * from './Schema.
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './Diviner.ts';
|
|
3
|
+
export * from './Params.ts';
|
|
4
|
+
export * from './Payload.ts';
|
|
5
|
+
export * from './Schema.ts';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/node/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './Diviner.
|
|
3
|
-
export * from './Params.
|
|
4
|
-
export * from './Payload.
|
|
5
|
-
export * from './Schema.
|
|
1
|
+
export * from './Config.ts';
|
|
2
|
+
export * from './Diviner.ts';
|
|
3
|
+
export * from './Params.ts';
|
|
4
|
+
export * from './Payload.ts';
|
|
5
|
+
export * from './Schema.ts';
|
|
6
6
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
3
|
+
var __reflectGet = Reflect.get;
|
|
4
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
5
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
6
|
+
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
7
|
+
var __superGet = (cls, obj, key) => __reflectGet(__getProtoOf(cls), key, obj);
|
|
8
|
+
|
|
1
9
|
// src/Schema.ts
|
|
2
10
|
var EvmCallResultToNftTokenUriDivinerSchema = "network.xyo.evm.call.results.metadata.uri.diviner";
|
|
3
11
|
|
|
@@ -9,9 +17,7 @@ import { AbstractDiviner } from "@xyo-network/diviner-abstract";
|
|
|
9
17
|
import { EvmCallResultsSchema } from "@xyo-network/evm-call-witness";
|
|
10
18
|
import { NftMetadataUriSchema } from "@xyo-network/evm-nft-id-payload-plugin";
|
|
11
19
|
import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
12
|
-
var
|
|
13
|
-
static configSchemas = [...super.configSchemas, EvmCallResultToNftTokenUriDivinerConfigSchema];
|
|
14
|
-
static defaultConfigSchema = EvmCallResultToNftTokenUriDivinerConfigSchema;
|
|
20
|
+
var _EvmCallResultToNftTokenUriDiviner = class _EvmCallResultToNftTokenUriDiviner extends AbstractDiviner {
|
|
15
21
|
// TODO: Add support for ERC1155 with `uri` function in addition to current ERC721 `tokenURI` support
|
|
16
22
|
divineHandler(payloads = []) {
|
|
17
23
|
const evmCallResults = payloads.filter(isPayloadOfSchemaType(EvmCallResultsSchema));
|
|
@@ -25,14 +31,27 @@ var EvmCallResultToNftTokenUriDiviner = class extends AbstractDiviner {
|
|
|
25
31
|
const tokenId = args[0];
|
|
26
32
|
const num = Number(BigInt(tokenId)).toString();
|
|
27
33
|
const metadataUri = (result == null ? void 0 : result.includes("{id}")) ? result.replace("{id}", num) : result;
|
|
28
|
-
return {
|
|
34
|
+
return {
|
|
35
|
+
address,
|
|
36
|
+
chainId,
|
|
37
|
+
metadataUri,
|
|
38
|
+
schema: NftMetadataUriSchema,
|
|
39
|
+
tokenId
|
|
40
|
+
};
|
|
29
41
|
});
|
|
30
42
|
return erc721CallResults;
|
|
31
43
|
}
|
|
32
44
|
};
|
|
45
|
+
__name(_EvmCallResultToNftTokenUriDiviner, "EvmCallResultToNftTokenUriDiviner");
|
|
46
|
+
__publicField(_EvmCallResultToNftTokenUriDiviner, "configSchemas", [
|
|
47
|
+
...__superGet(_EvmCallResultToNftTokenUriDiviner, _EvmCallResultToNftTokenUriDiviner, "configSchemas"),
|
|
48
|
+
EvmCallResultToNftTokenUriDivinerConfigSchema
|
|
49
|
+
]);
|
|
50
|
+
__publicField(_EvmCallResultToNftTokenUriDiviner, "defaultConfigSchema", EvmCallResultToNftTokenUriDivinerConfigSchema);
|
|
51
|
+
var EvmCallResultToNftTokenUriDiviner = _EvmCallResultToNftTokenUriDiviner;
|
|
33
52
|
export {
|
|
34
53
|
EvmCallResultToNftTokenUriDiviner,
|
|
35
54
|
EvmCallResultToNftTokenUriDivinerConfigSchema,
|
|
36
55
|
EvmCallResultToNftTokenUriDivinerSchema
|
|
37
56
|
};
|
|
38
|
-
//# sourceMappingURL=index.
|
|
57
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Schema.ts","../../src/Config.ts","../../src/Diviner.ts"],"sourcesContent":["/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport const EvmCallResultToNftTokenUriDivinerSchema = 'network.xyo.evm.call.results.metadata.uri.diviner'\n/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport type EvmCallResultToNftTokenUriDivinerSchema = typeof EvmCallResultToNftTokenUriDivinerSchema\n","import { DivinerConfig } from '@xyo-network/diviner-model'\n\nimport { EvmCallResultToNftTokenUriDivinerSchema } from './Schema.
|
|
1
|
+
{"version":3,"sources":["../../src/Schema.ts","../../src/Config.ts","../../src/Diviner.ts"],"sourcesContent":["/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport const EvmCallResultToNftTokenUriDivinerSchema = 'network.xyo.evm.call.results.metadata.uri.diviner'\n/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport type EvmCallResultToNftTokenUriDivinerSchema = typeof EvmCallResultToNftTokenUriDivinerSchema\n","import { DivinerConfig } from '@xyo-network/diviner-model'\n\nimport { EvmCallResultToNftTokenUriDivinerSchema } from './Schema.ts'\n\n/**\n * The config schema for the EVM call result to NFT token URI diviner\n */\nexport const EvmCallResultToNftTokenUriDivinerConfigSchema = `${EvmCallResultToNftTokenUriDivinerSchema}.config`\n/**\n * The config schema for the EVM call result to NFT token URI diviner\n */\nexport type EvmCallResultToNftTokenUriDivinerConfigSchema = typeof EvmCallResultToNftTokenUriDivinerConfigSchema\n\n/**\n * The config for the EVM call result to NFT token URI diviner\n */\nexport type EvmCallResultToNftTokenUriDivinerConfig = DivinerConfig<{ schema: EvmCallResultToNftTokenUriDivinerConfigSchema }>\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\n// eslint-disable-next-line workspaces/no-absolute-imports\nimport { EvmCallResults, EvmCallResultsSchema } from '@xyo-network/evm-call-witness'\nimport { NftMetadataUri, NftMetadataUriSchema } from '@xyo-network/evm-nft-id-payload-plugin'\nimport { isPayloadOfSchemaType, Payload, Schema } from '@xyo-network/payload-model'\n\nimport { EvmCallResultToNftTokenUriDivinerConfigSchema } from './Config.ts'\nimport { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts'\nimport { EvmTokenUriCallResults } from './Payload.ts'\n\nexport class EvmCallResultToNftTokenUriDiviner<\n TParams extends EvmCallResultToNftTokenUriDivinerParams = EvmCallResultToNftTokenUriDivinerParams,\n> extends AbstractDiviner<TParams, Payload, NftMetadataUri> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, EvmCallResultToNftTokenUriDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = EvmCallResultToNftTokenUriDivinerConfigSchema\n\n // TODO: Add support for ERC1155 with `uri` function in addition to current ERC721 `tokenURI` support\n protected override divineHandler(payloads: Payload[] = []): NftMetadataUri[] {\n const evmCallResults = payloads.filter(isPayloadOfSchemaType(EvmCallResultsSchema)) as EvmCallResults[]\n const erc721CallResults = evmCallResults\n .filter((p): p is EvmTokenUriCallResults => {\n const casted = p as EvmTokenUriCallResults\n return casted.results?.tokenURI?.result !== undefined && (p.results?.tokenURI?.args?.length ?? 0) > 0\n })\n .map<NftMetadataUri>((p) => {\n const { address, chainId, results } = p\n const { args, result } = results.tokenURI\n const tokenId = args[0]\n const num = Number(BigInt(tokenId)).toString()\n const metadataUri = result?.includes('{id}') ? result.replace('{id}', num) : result\n return { address, chainId, metadataUri, schema: NftMetadataUriSchema, tokenId }\n })\n return erc721CallResults\n }\n}\n"],"mappings":";;;;;;;;;AAGO,IAAMA,0CAA0C;;;ACIhD,IAAMC,gDAAgD,GAAGC,uCAAAA;;;ACPhE,SAASC,uBAAuB;AAEhC,SAAyBC,4BAA4B;AACrD,SAAyBC,4BAA4B;AACrD,SAASC,6BAA8C;AAMhD,IAAMC,qCAAN,MAAMA,2CAEHC,gBAAAA;;EAKWC,cAAcC,WAAsB,CAAA,GAAsB;AAC3E,UAAMC,iBAAiBD,SAASE,OAAOC,sBAAsBC,oBAAAA,CAAAA;AAC7D,UAAMC,oBAAoBJ,eACvBC,OAAO,CAACI,MAAAA;AApBf;AAqBQ,YAAMC,SAASD;AACf,eAAOC,kBAAOC,YAAPD,mBAAgBE,aAAhBF,mBAA0BG,YAAWC,aAAcL,mBAAEE,YAAFF,mBAAWG,aAAXH,mBAAqBM,SAArBN,mBAA2BO,WAAU,KAAK;IACtG,CAAA,EACCC,IAAoB,CAACR,MAAAA;AACpB,YAAM,EAAES,SAASC,SAASR,QAAO,IAAKF;AACtC,YAAM,EAAEM,MAAMF,OAAM,IAAKF,QAAQC;AACjC,YAAMQ,UAAUL,KAAK,CAAA;AACrB,YAAMM,MAAMC,OAAOC,OAAOH,OAAAA,CAAAA,EAAUI,SAAQ;AAC5C,YAAMC,eAAcZ,iCAAQa,SAAS,WAAUb,OAAOc,QAAQ,QAAQN,GAAAA,IAAOR;AAC7E,aAAO;QAAEK;QAASC;QAASM;QAAaG,QAAQC;QAAsBT;MAAQ;IAChF,CAAA;AACF,WAAOZ;EACT;AACF;AAtBUP;AACR,cAHWD,oCAGc8B,iBAA0B;KAAI,mFAAMA;EAAeC;;AAC5E,cAJW/B,oCAIcgC,uBAA8BD;AAJlD,IAAM/B,oCAAN;","names":["EvmCallResultToNftTokenUriDivinerSchema","EvmCallResultToNftTokenUriDivinerConfigSchema","EvmCallResultToNftTokenUriDivinerSchema","AbstractDiviner","EvmCallResultsSchema","NftMetadataUriSchema","isPayloadOfSchemaType","EvmCallResultToNftTokenUriDiviner","AbstractDiviner","divineHandler","payloads","evmCallResults","filter","isPayloadOfSchemaType","EvmCallResultsSchema","erc721CallResults","p","casted","results","tokenURI","result","undefined","args","length","map","address","chainId","tokenId","num","Number","BigInt","toString","metadataUri","includes","replace","schema","NftMetadataUriSchema","configSchemas","EvmCallResultToNftTokenUriDivinerConfigSchema","defaultConfigSchema"]}
|
package/package.json
CHANGED
|
@@ -10,21 +10,21 @@
|
|
|
10
10
|
"url": "https://github.com/XYOracleNetwork/plugins/issues"
|
|
11
11
|
},
|
|
12
12
|
"dependencies": {
|
|
13
|
-
"@xyo-network/diviner-abstract": "^2.
|
|
14
|
-
"@xyo-network/diviner-model": "^2.
|
|
15
|
-
"@xyo-network/evm-call-witness": "^2.99.
|
|
16
|
-
"@xyo-network/evm-nft-id-payload-plugin": "^2.99.
|
|
17
|
-
"@xyo-network/module-model": "^2.
|
|
18
|
-
"@xyo-network/payload-model": "^2.
|
|
19
|
-
"ethers": "^6.13.
|
|
13
|
+
"@xyo-network/diviner-abstract": "^2.111.2",
|
|
14
|
+
"@xyo-network/diviner-model": "^2.111.2",
|
|
15
|
+
"@xyo-network/evm-call-witness": "^2.99.5",
|
|
16
|
+
"@xyo-network/evm-nft-id-payload-plugin": "^2.99.5",
|
|
17
|
+
"@xyo-network/module-model": "^2.111.2",
|
|
18
|
+
"@xyo-network/payload-model": "^2.111.2",
|
|
19
|
+
"ethers": "^6.13.2"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"@xylabs/jest-helpers": "^3.6.
|
|
23
|
-
"@xylabs/ts-scripts-yarn3": "^3.
|
|
24
|
-
"@xylabs/tsconfig": "^3.
|
|
25
|
-
"@xyo-network/evm-nft-id-payload-plugin": "^2.99.
|
|
22
|
+
"@xylabs/jest-helpers": "^3.6.8",
|
|
23
|
+
"@xylabs/ts-scripts-yarn3": "^3.15.13",
|
|
24
|
+
"@xylabs/tsconfig": "^3.15.13",
|
|
25
|
+
"@xyo-network/evm-nft-id-payload-plugin": "^2.99.5",
|
|
26
26
|
"jest": "^29.7.0",
|
|
27
|
-
"typescript": "^5.5.
|
|
27
|
+
"typescript": "^5.5.4"
|
|
28
28
|
},
|
|
29
29
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
30
30
|
"types": "dist/node/index.d.ts",
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
"import": {
|
|
39
39
|
"types": "./dist/browser/index.d.mts",
|
|
40
|
-
"default": "./dist/browser/index.
|
|
40
|
+
"default": "./dist/browser/index.mjs"
|
|
41
41
|
}
|
|
42
42
|
},
|
|
43
43
|
"node": {
|
|
@@ -47,14 +47,14 @@
|
|
|
47
47
|
},
|
|
48
48
|
"import": {
|
|
49
49
|
"types": "./dist/node/index.d.mts",
|
|
50
|
-
"default": "./dist/node/index.
|
|
50
|
+
"default": "./dist/node/index.mjs"
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
53
|
},
|
|
54
54
|
"./package.json": "./package.json"
|
|
55
55
|
},
|
|
56
56
|
"main": "dist/node/index.cjs",
|
|
57
|
-
"module": "dist/node/index.
|
|
57
|
+
"module": "dist/node/index.mjs",
|
|
58
58
|
"homepage": "https://xyo.network",
|
|
59
59
|
"license": "LGPL-3.0-only",
|
|
60
60
|
"publishConfig": {
|
|
@@ -65,6 +65,6 @@
|
|
|
65
65
|
"url": "https://github.com/XYOracleNetwork/plugins.git"
|
|
66
66
|
},
|
|
67
67
|
"sideEffects": false,
|
|
68
|
-
"version": "2.99.
|
|
68
|
+
"version": "2.99.5",
|
|
69
69
|
"type": "module"
|
|
70
70
|
}
|
package/src/Config.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DivinerConfig } from '@xyo-network/diviner-model'
|
|
2
2
|
|
|
3
|
-
import { EvmCallResultToNftTokenUriDivinerSchema } from './Schema.
|
|
3
|
+
import { EvmCallResultToNftTokenUriDivinerSchema } from './Schema.ts'
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* The config schema for the EVM call result to NFT token URI diviner
|
package/src/Diviner.ts
CHANGED
|
@@ -4,9 +4,9 @@ import { EvmCallResults, EvmCallResultsSchema } from '@xyo-network/evm-call-witn
|
|
|
4
4
|
import { NftMetadataUri, NftMetadataUriSchema } from '@xyo-network/evm-nft-id-payload-plugin'
|
|
5
5
|
import { isPayloadOfSchemaType, Payload, Schema } from '@xyo-network/payload-model'
|
|
6
6
|
|
|
7
|
-
import { EvmCallResultToNftTokenUriDivinerConfigSchema } from './Config.
|
|
8
|
-
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.
|
|
9
|
-
import { EvmTokenUriCallResults } from './Payload.
|
|
7
|
+
import { EvmCallResultToNftTokenUriDivinerConfigSchema } from './Config.ts'
|
|
8
|
+
import { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts'
|
|
9
|
+
import { EvmTokenUriCallResults } from './Payload.ts'
|
|
10
10
|
|
|
11
11
|
export class EvmCallResultToNftTokenUriDiviner<
|
|
12
12
|
TParams extends EvmCallResultToNftTokenUriDivinerParams = EvmCallResultToNftTokenUriDivinerParams,
|
package/src/Params.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { DivinerParams } from '@xyo-network/diviner-model'
|
|
2
2
|
import { AnyConfigSchema } from '@xyo-network/module-model'
|
|
3
3
|
|
|
4
|
-
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.
|
|
4
|
+
import { EvmCallResultToNftTokenUriDivinerConfig } from './Config.ts'
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* The params for the EVM call result to NFT token URI diviner
|
package/src/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './Config.
|
|
2
|
-
export * from './Diviner.
|
|
3
|
-
export * from './Params.
|
|
4
|
-
export * from './Payload.
|
|
5
|
-
export * from './Schema.
|
|
1
|
+
export * from './Config.ts'
|
|
2
|
+
export * from './Diviner.ts'
|
|
3
|
+
export * from './Params.ts'
|
|
4
|
+
export * from './Payload.ts'
|
|
5
|
+
export * from './Schema.ts'
|