@xyo-network/diviner-evm-call-result-to-token-uri 5.2.4 → 5.3.1
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/neutral/Config.d.ts +3 -1
- package/dist/neutral/Config.d.ts.map +1 -1
- package/dist/neutral/Diviner.d.ts.map +1 -1
- package/dist/neutral/Payload.d.ts.map +1 -1
- package/dist/neutral/Schema.d.ts +3 -1
- package/dist/neutral/Schema.d.ts.map +1 -1
- package/dist/neutral/index.mjs +6 -2
- package/dist/neutral/index.mjs.map +1 -1
- package/package.json +13 -13
- package/src/Config.ts +2 -1
- package/src/Diviner.ts +0 -1
- package/src/Payload.ts +0 -1
- package/src/Schema.ts +3 -1
package/dist/neutral/Config.d.ts
CHANGED
|
@@ -2,7 +2,9 @@ import type { DivinerConfig } from '@xyo-network/diviner-model';
|
|
|
2
2
|
/**
|
|
3
3
|
* The config schema for the EVM call result to NFT token URI diviner
|
|
4
4
|
*/
|
|
5
|
-
export declare const EvmCallResultToNftTokenUriDivinerConfigSchema
|
|
5
|
+
export declare const EvmCallResultToNftTokenUriDivinerConfigSchema: string & {
|
|
6
|
+
readonly __schema: true;
|
|
7
|
+
};
|
|
6
8
|
/**
|
|
7
9
|
* The config schema for the EVM call result to NFT token URI diviner
|
|
8
10
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;
|
|
1
|
+
{"version":3,"file":"Config.d.ts","sourceRoot":"","sources":["../../src/Config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAK/D;;GAEG;AACH,eAAO,MAAM,6CAA6C;;CAAsE,CAAA;AAChI;;GAEG;AACH,MAAM,MAAM,6CAA6C,GAAG,OAAO,6CAA6C,CAAA;AAEhH;;GAEG;AACH,MAAM,MAAM,uCAAuC,GAAG,aAAa,CAAC;IAAE,MAAM,EAAE,6CAA6C,CAAA;CAAE,CAAC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;
|
|
1
|
+
{"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../src/Diviner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAE/D,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAA;AAE5E,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAIjE,OAAO,KAAK,EAAE,uCAAuC,EAAE,MAAM,aAAa,CAAA;AAG1E,qBAAa,iCAAiC,CAC5C,OAAO,SAAS,uCAAuC,GAAG,uCAAuC,CACjG,SAAQ,eAAe,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC;IACzD,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA0E;IAC1H,gBAAyB,mBAAmB,EAAE,MAAM,CAAgD;cAGjF,aAAa,CAAC,QAAQ,GAAE,OAAO,EAAO,GAAG,cAAc,EAAE;CAqB7E"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Payload.d.ts","sourceRoot":"","sources":["../../src/Payload.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAA;AAEnE,MAAM,MAAM,sBAAsB,GAAG,cAAc,GAAG;IAAE,OAAO,EAAE;QAAE,QAAQ,EAAE;YAAE,IAAI,EAAE,CAAC,MAAM,CAAC,CAAC;YAAC,MAAM,CAAC,EAAE,MAAM,CAAA;SAAE,CAAA;KAAE,CAAA;CAAE,CAAA"}
|
package/dist/neutral/Schema.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The schema for the EVM call result to NFT token URI diviner.
|
|
3
3
|
*/
|
|
4
|
-
export declare const EvmCallResultToNftTokenUriDivinerSchema
|
|
4
|
+
export declare const EvmCallResultToNftTokenUriDivinerSchema: "network.xyo.evm.call.results.metadata.uri.diviner" & {
|
|
5
|
+
readonly __schema: true;
|
|
6
|
+
};
|
|
5
7
|
/**
|
|
6
8
|
* The schema for the EVM call result to NFT token URI diviner.
|
|
7
9
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Schema.d.ts","sourceRoot":"","sources":["../../src/Schema.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,eAAO,MAAM,uCAAuC;;CAAsE,CAAA;AAC1H;;GAEG;AACH,MAAM,MAAM,uCAAuC,GAAG,OAAO,uCAAuC,CAAA"}
|
package/dist/neutral/index.mjs
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
+
// src/Config.ts
|
|
2
|
+
import { asSchema as asSchema2 } from "@xyo-network/payload-model";
|
|
3
|
+
|
|
1
4
|
// src/Schema.ts
|
|
2
|
-
|
|
5
|
+
import { asSchema } from "@xyo-network/payload-model";
|
|
6
|
+
var EvmCallResultToNftTokenUriDivinerSchema = asSchema("network.xyo.evm.call.results.metadata.uri.diviner", true);
|
|
3
7
|
|
|
4
8
|
// src/Config.ts
|
|
5
|
-
var EvmCallResultToNftTokenUriDivinerConfigSchema = `${EvmCallResultToNftTokenUriDivinerSchema}.config
|
|
9
|
+
var EvmCallResultToNftTokenUriDivinerConfigSchema = asSchema2(`${EvmCallResultToNftTokenUriDivinerSchema}.config`, true);
|
|
6
10
|
|
|
7
11
|
// src/Diviner.ts
|
|
8
12
|
import { AbstractDiviner } from "@xyo-network/diviner-abstract";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/
|
|
1
|
+
{"version":3,"sources":["../../src/Config.ts","../../src/Schema.ts","../../src/Diviner.ts"],"sourcesContent":["import type { DivinerConfig } from '@xyo-network/diviner-model'\nimport { asSchema } from '@xyo-network/payload-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 = asSchema(`${EvmCallResultToNftTokenUriDivinerSchema}.config`, true)\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 { asSchema } from '@xyo-network/payload-model'\n\n/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport const EvmCallResultToNftTokenUriDivinerSchema = asSchema('network.xyo.evm.call.results.metadata.uri.diviner', true)\n/**\n * The schema for the EVM call result to NFT token URI diviner.\n */\nexport type EvmCallResultToNftTokenUriDivinerSchema = typeof EvmCallResultToNftTokenUriDivinerSchema\n","import { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { type EvmCallResults, EvmCallResultsSchema } from '@xyo-network/evm-call-witness'\nimport type { NftMetadataUri } from '@xyo-network/evm-nft-id-payload-plugin'\nimport { NftMetadataUriSchema } from '@xyo-network/evm-nft-id-payload-plugin'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\n\nimport { EvmCallResultToNftTokenUriDivinerConfigSchema } from './Config.ts'\nimport type { EvmCallResultToNftTokenUriDivinerParams } from './Params.ts'\nimport type { 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<EvmCallResults>(EvmCallResultsSchema))\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 {\n address, chainId, results,\n } = 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 {\n address, chainId, metadataUri, schema: NftMetadataUriSchema, tokenId,\n }\n })\n return erc721CallResults\n }\n}\n"],"mappings":";AACA,SAAS,YAAAA,iBAAgB;;;ACDzB,SAAS,gBAAgB;AAKlB,IAAM,0CAA0C,SAAS,qDAAqD,IAAI;;;ADGlH,IAAM,gDAAgDC,UAAS,GAAG,uCAAuC,WAAW,IAAI;;;AER/H,SAAS,uBAAuB;AAChC,SAA8B,4BAA4B;AAE1D,SAAS,4BAA4B;AAErC,SAAS,6BAA6B;AAM/B,IAAM,oCAAN,cAEG,gBAAkD;AAAA,EAC1D,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,6CAA6C;AAAA,EACzH,OAAyB,sBAA8B;AAAA;AAAA,EAGpC,cAAc,WAAsB,CAAC,GAAqB;AAC3E,UAAM,iBAAiB,SAAS,OAAO,sBAAsC,oBAAoB,CAAC;AAClG,UAAM,oBAAoB,eACvB,OAAO,CAAC,MAAmC;AAC1C,YAAM,SAAS;AACf,aAAO,OAAO,SAAS,UAAU,WAAW,WAAc,EAAE,SAAS,UAAU,MAAM,UAAU,KAAK;AAAA,IACtG,CAAC,EACA,IAAoB,CAAC,MAAM;AAC1B,YAAM;AAAA,QACJ;AAAA,QAAS;AAAA,QAAS;AAAA,MACpB,IAAI;AACJ,YAAM,EAAE,MAAM,OAAO,IAAI,QAAQ;AACjC,YAAM,UAAU,KAAK,CAAC;AACtB,YAAM,MAAM,OAAO,OAAO,OAAO,CAAC,EAAE,SAAS;AAC7C,YAAM,cAAc,QAAQ,SAAS,MAAM,IAAI,OAAO,QAAQ,QAAQ,GAAG,IAAI;AAC7E,aAAO;AAAA,QACL;AAAA,QAAS;AAAA,QAAS;AAAA,QAAa,QAAQ;AAAA,QAAsB;AAAA,MAC/D;AAAA,IACF,CAAC;AACH,WAAO;AAAA,EACT;AACF;","names":["asSchema","asSchema"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xyo-network/diviner-evm-call-result-to-token-uri",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.3.1",
|
|
4
4
|
"description": "Typescript/Javascript Plugins for XYO Platform",
|
|
5
5
|
"homepage": "https://xyo.network",
|
|
6
6
|
"bugs": {
|
|
@@ -36,22 +36,22 @@
|
|
|
36
36
|
"!**/*.test.*"
|
|
37
37
|
],
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@xyo-network/diviner-abstract": "~5.2
|
|
40
|
-
"@xyo-network/diviner-model": "~5.2
|
|
41
|
-
"@xyo-network/evm-call-witness": "
|
|
42
|
-
"@xyo-network/evm-nft-id-payload-plugin": "
|
|
43
|
-
"@xyo-network/module-model": "~5.2
|
|
44
|
-
"@xyo-network/payload-model": "~5.2
|
|
39
|
+
"@xyo-network/diviner-abstract": "~5.3.2",
|
|
40
|
+
"@xyo-network/diviner-model": "~5.3.2",
|
|
41
|
+
"@xyo-network/evm-call-witness": "5.3.1",
|
|
42
|
+
"@xyo-network/evm-nft-id-payload-plugin": "5.3.1",
|
|
43
|
+
"@xyo-network/module-model": "~5.3.2",
|
|
44
|
+
"@xyo-network/payload-model": "~5.3.2"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@xylabs/ts-scripts-yarn3": "~7.2
|
|
48
|
-
"@xylabs/tsconfig": "~7.2
|
|
49
|
-
"@xylabs/vitest-extended": "~5.0.
|
|
50
|
-
"@xyo-network/evm-nft-id-payload-plugin": "
|
|
47
|
+
"@xylabs/ts-scripts-yarn3": "~7.3.2",
|
|
48
|
+
"@xylabs/tsconfig": "~7.3.2",
|
|
49
|
+
"@xylabs/vitest-extended": "~5.0.64",
|
|
50
|
+
"@xyo-network/evm-nft-id-payload-plugin": "5.3.1",
|
|
51
51
|
"typescript": "~5.9.3",
|
|
52
|
-
"vitest": "~4.0.
|
|
52
|
+
"vitest": "~4.0.18"
|
|
53
53
|
},
|
|
54
54
|
"publishConfig": {
|
|
55
55
|
"access": "public"
|
|
56
56
|
}
|
|
57
|
-
}
|
|
57
|
+
}
|
package/src/Config.ts
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import type { DivinerConfig } from '@xyo-network/diviner-model'
|
|
2
|
+
import { asSchema } from '@xyo-network/payload-model'
|
|
2
3
|
|
|
3
4
|
import { EvmCallResultToNftTokenUriDivinerSchema } from './Schema.ts'
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* The config schema for the EVM call result to NFT token URI diviner
|
|
7
8
|
*/
|
|
8
|
-
export const EvmCallResultToNftTokenUriDivinerConfigSchema = `${EvmCallResultToNftTokenUriDivinerSchema}.config
|
|
9
|
+
export const EvmCallResultToNftTokenUriDivinerConfigSchema = asSchema(`${EvmCallResultToNftTokenUriDivinerSchema}.config`, true)
|
|
9
10
|
/**
|
|
10
11
|
* The config schema for the EVM call result to NFT token URI diviner
|
|
11
12
|
*/
|
package/src/Diviner.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { AbstractDiviner } from '@xyo-network/diviner-abstract'
|
|
2
|
-
// eslint-disable-next-line workspaces/no-absolute-imports
|
|
3
2
|
import { type EvmCallResults, EvmCallResultsSchema } from '@xyo-network/evm-call-witness'
|
|
4
3
|
import type { NftMetadataUri } from '@xyo-network/evm-nft-id-payload-plugin'
|
|
5
4
|
import { NftMetadataUriSchema } from '@xyo-network/evm-nft-id-payload-plugin'
|
package/src/Payload.ts
CHANGED
package/src/Schema.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { asSchema } from '@xyo-network/payload-model'
|
|
2
|
+
|
|
1
3
|
/**
|
|
2
4
|
* The schema for the EVM call result to NFT token URI diviner.
|
|
3
5
|
*/
|
|
4
|
-
export const EvmCallResultToNftTokenUriDivinerSchema = 'network.xyo.evm.call.results.metadata.uri.diviner'
|
|
6
|
+
export const EvmCallResultToNftTokenUriDivinerSchema = asSchema('network.xyo.evm.call.results.metadata.uri.diviner', true)
|
|
5
7
|
/**
|
|
6
8
|
* The schema for the EVM call result to NFT token URI diviner.
|
|
7
9
|
*/
|