@xyo-network/crypto-contract-function-read-plugin 2.99.4 → 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/Diviner.d.cts.map +1 -1
- package/dist/browser/Diviner/Diviner.d.mts.map +1 -1
- package/dist/browser/Diviner/Diviner.d.ts.map +1 -1
- package/dist/browser/Diviner/index.d.cts +1 -1
- package/dist/browser/Diviner/index.d.mts +1 -1
- package/dist/browser/Diviner/index.d.ts +1 -1
- package/dist/browser/Plugin.d.cts +1 -1
- package/dist/browser/Plugin.d.cts.map +1 -1
- package/dist/browser/Plugin.d.mts +1 -1
- package/dist/browser/Plugin.d.mts.map +1 -1
- package/dist/browser/Plugin.d.ts +1 -1
- package/dist/browser/Plugin.d.ts.map +1 -1
- package/dist/browser/Witness.d.cts.map +1 -1
- package/dist/browser/Witness.d.mts.map +1 -1
- package/dist/browser/Witness.d.ts.map +1 -1
- package/dist/browser/index.cjs +73 -62
- package/dist/browser/index.cjs.map +1 -1
- package/dist/browser/index.d.cts +3 -3
- package/dist/browser/index.d.cts.map +1 -1
- package/dist/browser/index.d.mts +3 -3
- package/dist/browser/index.d.mts.map +1 -1
- package/dist/browser/index.d.ts +3 -3
- package/dist/browser/index.d.ts.map +1 -1
- package/dist/browser/index.mjs +157 -0
- package/dist/browser/index.mjs.map +1 -0
- package/dist/neutral/Diviner/Diviner.d.cts.map +1 -1
- package/dist/neutral/Diviner/Diviner.d.mts.map +1 -1
- package/dist/neutral/Diviner/Diviner.d.ts.map +1 -1
- package/dist/neutral/Diviner/index.d.cts +1 -1
- package/dist/neutral/Diviner/index.d.mts +1 -1
- package/dist/neutral/Diviner/index.d.ts +1 -1
- package/dist/neutral/Plugin.d.cts +1 -1
- package/dist/neutral/Plugin.d.cts.map +1 -1
- package/dist/neutral/Plugin.d.mts +1 -1
- package/dist/neutral/Plugin.d.mts.map +1 -1
- package/dist/neutral/Plugin.d.ts +1 -1
- package/dist/neutral/Plugin.d.ts.map +1 -1
- package/dist/neutral/Witness.d.cts.map +1 -1
- package/dist/neutral/Witness.d.mts.map +1 -1
- package/dist/neutral/Witness.d.ts.map +1 -1
- package/dist/neutral/index.cjs +73 -62
- package/dist/neutral/index.cjs.map +1 -1
- package/dist/neutral/index.d.cts +3 -3
- package/dist/neutral/index.d.cts.map +1 -1
- package/dist/neutral/index.d.mts +3 -3
- package/dist/neutral/index.d.mts.map +1 -1
- package/dist/neutral/index.d.ts +3 -3
- package/dist/neutral/index.d.ts.map +1 -1
- package/dist/neutral/index.mjs +157 -0
- package/dist/neutral/index.mjs.map +1 -0
- package/dist/node/Diviner/Diviner.d.cts.map +1 -1
- package/dist/node/Diviner/Diviner.d.mts.map +1 -1
- package/dist/node/Diviner/Diviner.d.ts.map +1 -1
- package/dist/node/Diviner/index.d.cts +1 -1
- package/dist/node/Diviner/index.d.mts +1 -1
- package/dist/node/Diviner/index.d.ts +1 -1
- package/dist/node/Plugin.d.cts +1 -1
- package/dist/node/Plugin.d.cts.map +1 -1
- package/dist/node/Plugin.d.mts +1 -1
- package/dist/node/Plugin.d.mts.map +1 -1
- package/dist/node/Plugin.d.ts +1 -1
- package/dist/node/Plugin.d.ts.map +1 -1
- package/dist/node/Witness.d.cts.map +1 -1
- package/dist/node/Witness.d.mts.map +1 -1
- package/dist/node/Witness.d.ts.map +1 -1
- package/dist/node/index.cjs +80 -66
- package/dist/node/index.cjs.map +1 -1
- package/dist/node/index.d.cts +3 -3
- package/dist/node/index.d.cts.map +1 -1
- package/dist/node/index.d.mts +3 -3
- package/dist/node/index.d.mts.map +1 -1
- package/dist/node/index.d.ts +3 -3
- package/dist/node/index.d.ts.map +1 -1
- package/dist/node/index.mjs +163 -0
- package/dist/node/index.mjs.map +1 -0
- package/package.json +38 -38
- package/src/Diviner/Diviner.ts +2 -4
- package/src/Diviner/index.ts +1 -1
- package/src/Plugin.ts +2 -3
- package/src/Witness.ts +1 -2
- package/src/index.ts +3 -4
- package/dist/browser/index.js +0 -154
- package/dist/browser/index.js.map +0 -1
- package/dist/neutral/index.js +0 -154
- package/dist/neutral/index.js.map +0 -1
- package/dist/node/index.js +0 -157
- package/dist/node/index.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/Diviner/Diviner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAEL,YAAY,EAGZ,2BAA2B,EAC3B,2BAA2B,EAC3B,gCAAgC,EAEjC,MAAM,2DAA2D,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EAAyB,OAAO,EAAE,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAGnF,MAAM,MAAM,cAAc,CAAC,OAAO,GAAG,MAAM,EAAE,QAAQ,GAAG,OAAO,IAAI,CAAC,OAAO,EAAE,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,QAAQ,CAAC,GAAG,CAAC,SAAS,EAAE,SAAS,CAAC,CAAA;AAGvI,qBAAa,qBAAqB,CAAC,OAAO,SAAS,2BAA2B,GAAG,2BAA2B,CAAE,SAAQ,eAAe,CAAC,OAAO,CAAC;IAC5I,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA8D;IAC9G,gBAAyB,mBAAmB,EAAE,MAAM,CAAoC;IACxF,OAAgB,MAAM,EAAE,2BAA2B,CAAsD;IAEzG,SAAS,CAAC,MAAM,CAAC,cAAc,CAAC,OAAO,GAAG,MAAM,EAC9C,OAAO,EAAE,MAAM,EACf,YAAY,EAAE,MAAM,EACpB,QAAQ,EAAE,gCAAgC,EAAE,GAC3C,OAAO,GAAG,SAAS;IAKtB,SAAS,CAAC,MAAM,CAAC,qBAAqB,CAAC,CAAC,GAAG,MAAM,EAAE,CAAC,SAAS,OAAO,GAAG,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,EAA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,CAAC,GAAG,SAAS;IASzH,SAAS,CAAC,0BAA0B,CAAC,WAAW,EAAE,gCAAgC,EAAE,GAAG,YAAY;cAQ1E,aAAa,CAAC,UAAU,GAAE,gCAAgC,EAAO,GAAG,OAAO,CAAC,YAAY,EAAE,CAAC;IAyBpH,SAAS,CAAC,aAAa,CAAC,WAAW,EAAE,gCAAgC,EAAE,GAAG,UAAU,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;CAO9G"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Diviner.
|
|
1
|
+
export * from './Diviner.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Diviner.
|
|
1
|
+
export * from './Diviner.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './Diviner.
|
|
1
|
+
export * from './Diviner.ts';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CryptoContractFunctionReadWitness } from './Witness.
|
|
1
|
+
import { CryptoContractFunctionReadWitness } from './Witness.ts';
|
|
2
2
|
export declare const CryptoContractFunctionReadWitnessPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<CryptoContractFunctionReadWitness<import("@xylabs/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
4
4
|
addToResolvers?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iCAAiC,EAAE,MAAM,cAAc,CAAA;AAGhE,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iCAAiC,EAAE,MAAM,cAAc,CAAA;AAGhE,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;;;GAUjD,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CryptoContractFunctionReadWitness } from './Witness.
|
|
1
|
+
import { CryptoContractFunctionReadWitness } from './Witness.ts';
|
|
2
2
|
export declare const CryptoContractFunctionReadWitnessPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<CryptoContractFunctionReadWitness<import("@xylabs/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
4
4
|
addToResolvers?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iCAAiC,EAAE,MAAM,cAAc,CAAA;AAGhE,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iCAAiC,EAAE,MAAM,cAAc,CAAA;AAGhE,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;;;GAUjD,CAAA"}
|
package/dist/neutral/Plugin.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CryptoContractFunctionReadWitness } from './Witness.
|
|
1
|
+
import { CryptoContractFunctionReadWitness } from './Witness.ts';
|
|
2
2
|
export declare const CryptoContractFunctionReadWitnessPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<CryptoContractFunctionReadWitness<import("@xylabs/object").BaseParamsFields & {
|
|
3
3
|
account?: import("@xyo-network/account-model").AccountInstance | "random";
|
|
4
4
|
addToResolvers?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iCAAiC,EAAE,MAAM,cAAc,CAAA;AAGhE,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,iCAAiC,EAAE,MAAM,cAAc,CAAA;AAGhE,eAAO,MAAM,uCAAuC;;;;;;;;;;;;;;;;;;;;;;GAUjD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EACL,0BAA0B,EAE1B,gCAAgC,EAIhC,uCAAuC,EAExC,MAAM,2DAA2D,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAyB,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAY,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAG3C,MAAM,MAAM,uCAAuC,GAAG,aAAa,CACjE,eAAe,CAAC,uCAAuC,CAAC,EACxD;IACE,SAAS,EAAE,QAAQ,EAAE,CAAA;CACtB,CACF,CAAA;AAGD,qBAAa,iCAAiC,
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EACL,0BAA0B,EAE1B,gCAAgC,EAIhC,uCAAuC,EAExC,MAAM,2DAA2D,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAA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"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EACL,0BAA0B,EAE1B,gCAAgC,EAIhC,uCAAuC,EAExC,MAAM,2DAA2D,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAyB,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAY,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAG3C,MAAM,MAAM,uCAAuC,GAAG,aAAa,CACjE,eAAe,CAAC,uCAAuC,CAAC,EACxD;IACE,SAAS,EAAE,QAAQ,EAAE,CAAA;CACtB,CACF,CAAA;AAGD,qBAAa,iCAAiC,CAC5C,OAAO,SAAS,uCAAuC,GAAG,uCAAuC,CACjG,SAAQ,eAAe,CAAC,OAAO,EAAE,0BAA0B,EAAE,gCAAgC,CAAC;IAC9F,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA0E;IAC1H,gBAAyB,mBAAmB,EAAE,MAAM,CAAgD;IAEpG,IAAI,GAAG,iEAEN;cAEwB,cAAc,CAAC,UAAU,GAAE,0BAA0B,EAAO,GAAG,OAAO,CAAC,gCAAgC,EAAE,CAAC;CA8CpI"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EACL,0BAA0B,EAE1B,gCAAgC,EAIhC,uCAAuC,EAExC,MAAM,2DAA2D,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAyB,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAY,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAG3C,MAAM,MAAM,uCAAuC,GAAG,aAAa,CACjE,eAAe,CAAC,uCAAuC,CAAC,EACxD;IACE,SAAS,EAAE,QAAQ,EAAE,CAAA;CACtB,CACF,CAAA;AAGD,qBAAa,iCAAiC,
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAA;AAC/D,OAAO,EACL,0BAA0B,EAE1B,gCAAgC,EAIhC,uCAAuC,EAExC,MAAM,2DAA2D,CAAA;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,2BAA2B,CAAA;AAC3D,OAAO,EAAyB,MAAM,EAAE,MAAM,4BAA4B,CAAA;AAC1E,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAY,QAAQ,EAAE,MAAM,QAAQ,CAAA;AAG3C,MAAM,MAAM,uCAAuC,GAAG,aAAa,CACjE,eAAe,CAAC,uCAAuC,CAAC,EACxD;IACE,SAAS,EAAE,QAAQ,EAAE,CAAA;CACtB,CACF,CAAA;AAGD,qBAAa,iCAAiC,CAC5C,OAAO,SAAS,uCAAuC,GAAG,uCAAuC,CACjG,SAAQ,eAAe,CAAC,OAAO,EAAE,0BAA0B,EAAE,gCAAgC,CAAC;IAC9F,gBAAyB,aAAa,EAAE,MAAM,EAAE,CAA0E;IAC1H,gBAAyB,mBAAmB,EAAE,MAAM,CAAgD;IAEpG,IAAI,GAAG,iEAEN;cAEwB,cAAc,CAAC,UAAU,GAAE,0BAA0B,EAAO,GAAG,OAAO,CAAC,gCAAgC,EAAE,CAAC;CA8CpI"}
|
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 });
|
|
@@ -33,9 +34,18 @@ var import_crypto_contract_function_read_payload_plugin = require("@xyo-network/
|
|
|
33
34
|
var import_diviner_abstract = require("@xyo-network/diviner-abstract");
|
|
34
35
|
var import_payload_model = require("@xyo-network/payload-model");
|
|
35
36
|
var CryptoContractDiviner = class _CryptoContractDiviner extends import_diviner_abstract.AbstractDiviner {
|
|
36
|
-
static
|
|
37
|
+
static {
|
|
38
|
+
__name(this, "CryptoContractDiviner");
|
|
39
|
+
}
|
|
40
|
+
static configSchemas = [
|
|
41
|
+
...super.configSchemas,
|
|
42
|
+
import_crypto_contract_function_read_payload_plugin.CryptoContractDivinerConfigSchema
|
|
43
|
+
];
|
|
37
44
|
static defaultConfigSchema = import_crypto_contract_function_read_payload_plugin.CryptoContractDivinerConfigSchema;
|
|
38
|
-
static labels = {
|
|
45
|
+
static labels = {
|
|
46
|
+
...super.labels,
|
|
47
|
+
...import_crypto_contract_function_read_payload_plugin.CryptoContractDivinerLabels
|
|
48
|
+
};
|
|
39
49
|
static findCallResult(address, functionName, payloads) {
|
|
40
50
|
const foundPayload = payloads.find((payload) => payload.functionName === functionName && payload.address === address);
|
|
41
51
|
return (0, import_crypto_contract_function_read_payload_plugin.asCryptoContractFunctionCallSuccess)(foundPayload)?.result;
|
|
@@ -49,9 +59,7 @@ var CryptoContractDiviner = class _CryptoContractDiviner extends import_diviner_
|
|
|
49
59
|
}
|
|
50
60
|
contractInfoRequiredFields(callResults) {
|
|
51
61
|
return {
|
|
52
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
53
62
|
address: (0, import_assert.assertEx)(_CryptoContractDiviner.matchingExistingField(callResults, "address"), () => "Mismatched address"),
|
|
54
|
-
// eslint-disable-next-line deprecation/deprecation
|
|
55
63
|
chainId: (0, import_assert.assertEx)(_CryptoContractDiviner.matchingExistingField(callResults, "chainId"), () => "Mismatched chainId"),
|
|
56
64
|
schema: import_crypto_contract_function_read_payload_plugin.ContractInfoSchema
|
|
57
65
|
};
|
|
@@ -67,16 +75,14 @@ var CryptoContractDiviner = class _CryptoContractDiviner extends import_diviner_
|
|
|
67
75
|
return prev;
|
|
68
76
|
}, {})
|
|
69
77
|
);
|
|
70
|
-
const result = await Promise.all(
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
})
|
|
79
|
-
);
|
|
78
|
+
const result = await Promise.all(addresses.map(async (address) => {
|
|
79
|
+
const foundCallResults = callResults.filter((callResult) => callResult.address === address);
|
|
80
|
+
const info = {
|
|
81
|
+
results: await this.reduceResults(foundCallResults),
|
|
82
|
+
...this.contractInfoRequiredFields(foundCallResults)
|
|
83
|
+
};
|
|
84
|
+
return info;
|
|
85
|
+
}));
|
|
80
86
|
return result;
|
|
81
87
|
}
|
|
82
88
|
reduceResults(callResults) {
|
|
@@ -99,7 +105,13 @@ var import_crypto_contract_function_read_payload_plugin2 = require("@xyo-network
|
|
|
99
105
|
var import_payload_model2 = require("@xyo-network/payload-model");
|
|
100
106
|
var import_ethers = require("ethers");
|
|
101
107
|
var CryptoContractFunctionReadWitness = class extends import_abstract_witness.AbstractWitness {
|
|
102
|
-
static
|
|
108
|
+
static {
|
|
109
|
+
__name(this, "CryptoContractFunctionReadWitness");
|
|
110
|
+
}
|
|
111
|
+
static configSchemas = [
|
|
112
|
+
...super.configSchemas,
|
|
113
|
+
import_crypto_contract_function_read_payload_plugin2.CryptoContractFunctionReadWitnessConfigSchema
|
|
114
|
+
];
|
|
103
115
|
static defaultConfigSchema = import_crypto_contract_function_read_payload_plugin2.CryptoContractFunctionReadWitnessConfigSchema;
|
|
104
116
|
get abi() {
|
|
105
117
|
return (0, import_assert2.assertEx)(this.config.abi, () => "Missing abi");
|
|
@@ -107,41 +119,41 @@ var CryptoContractFunctionReadWitness = class extends import_abstract_witness.Ab
|
|
|
107
119
|
async observeHandler(inPayloads = []) {
|
|
108
120
|
await this.started("throw");
|
|
109
121
|
try {
|
|
110
|
-
const observations = await Promise.all(
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
}
|
|
144
|
-
);
|
|
122
|
+
const observations = await Promise.all(inPayloads.filter((0, import_payload_model2.isPayloadOfSchemaType)(import_crypto_contract_function_read_payload_plugin2.CryptoContractFunctionCallSchema)).map(async ({ functionName, args, address }) => {
|
|
123
|
+
const { providers } = this.params;
|
|
124
|
+
const provider = providers[Date.now() % providers.length];
|
|
125
|
+
const validatedAddress = (0, import_assert2.assertEx)(address ?? this.config.address, () => "Missing address");
|
|
126
|
+
const validatedFunctionName = (0, import_assert2.assertEx)(functionName ?? this.config.functionName, () => "Missing address");
|
|
127
|
+
const mergedArgs = [
|
|
128
|
+
...args ?? this.config.args ?? []
|
|
129
|
+
];
|
|
130
|
+
const contract = new import_ethers.Contract(validatedAddress, this.abi, provider);
|
|
131
|
+
try {
|
|
132
|
+
const result = await contract[validatedFunctionName](...mergedArgs);
|
|
133
|
+
const transformedResult = typeof result === "bigint" ? result.toString(16) : result;
|
|
134
|
+
const observation = {
|
|
135
|
+
address: validatedAddress,
|
|
136
|
+
args: mergedArgs,
|
|
137
|
+
chainId: Number((await provider.getNetwork()).chainId),
|
|
138
|
+
functionName: validatedFunctionName,
|
|
139
|
+
result: transformedResult,
|
|
140
|
+
schema: import_crypto_contract_function_read_payload_plugin2.CryptoContractFunctionCallResultSchema
|
|
141
|
+
};
|
|
142
|
+
return observation;
|
|
143
|
+
} catch (ex) {
|
|
144
|
+
const error = ex;
|
|
145
|
+
console.log(`Error [${this.config.name}]: ${error.code}`);
|
|
146
|
+
const observation = {
|
|
147
|
+
address: validatedAddress,
|
|
148
|
+
args: mergedArgs,
|
|
149
|
+
chainId: Number((await provider.getNetwork()).chainId),
|
|
150
|
+
error: error.code,
|
|
151
|
+
functionName: validatedFunctionName,
|
|
152
|
+
schema: import_crypto_contract_function_read_payload_plugin2.CryptoContractFunctionCallResultSchema
|
|
153
|
+
};
|
|
154
|
+
return observation;
|
|
155
|
+
}
|
|
156
|
+
}));
|
|
145
157
|
return observations;
|
|
146
158
|
} catch (ex) {
|
|
147
159
|
const error = ex;
|
|
@@ -152,16 +164,15 @@ var CryptoContractFunctionReadWitness = class extends import_abstract_witness.Ab
|
|
|
152
164
|
};
|
|
153
165
|
|
|
154
166
|
// src/Plugin.ts
|
|
155
|
-
var CryptoContractFunctionReadWitnessPlugin = () => (
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
);
|
|
167
|
+
var CryptoContractFunctionReadWitnessPlugin = /* @__PURE__ */ __name(() => (0, import_payloadset_plugin.createPayloadSetWitnessPlugin)({
|
|
168
|
+
required: {
|
|
169
|
+
[import_crypto_nft_payload_plugin.NftSchema]: 1
|
|
170
|
+
},
|
|
171
|
+
schema: import_payload_model3.PayloadSetSchema
|
|
172
|
+
}, {
|
|
173
|
+
witness: /* @__PURE__ */ __name(async (params) => {
|
|
174
|
+
const result = await CryptoContractFunctionReadWitness.create(params);
|
|
175
|
+
return result;
|
|
176
|
+
}, "witness")
|
|
177
|
+
}), "CryptoContractFunctionReadWitnessPlugin");
|
|
167
178
|
//# sourceMappingURL=index.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/index.ts","../../src/Diviner/Diviner.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["export * from './Diviner/index.js'\n// eslint-disable-next-line deprecation/deprecation, import/no-default-export\nexport { CryptoContractFunctionReadWitnessPlugin, CryptoContractFunctionReadWitnessPlugin as default } from './Plugin.js'\nexport * from './Witness.js'\n","import { assertEx } from '@xylabs/assert'\nimport { Promisable } from '@xylabs/promise'\nimport {\n asCryptoContractFunctionCallSuccess,\n ContractInfo,\n ContractInfoSchema,\n CryptoContractDivinerConfigSchema,\n CryptoContractDivinerLabels,\n CryptoContractDivinerParams,\n CryptoContractFunctionCallResult,\n CryptoContractFunctionCallResultSchema,\n} from '@xyo-network/crypto-contract-function-read-payload-plugin'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { isPayloadOfSchemaType, Payload, Schema } from '@xyo-network/payload-model'\n\n/** @deprecated use EvmCallDiviner instead */\nexport type FindCallResult<TResult = string, TPayload = Payload> = [TResult, TPayload] | [undefined, TPayload] | [undefined, undefined]\n\n/** @deprecated use EvmCallDiviner instead */\nexport class CryptoContractDiviner<TParams extends CryptoContractDivinerParams = CryptoContractDivinerParams> extends AbstractDiviner<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, CryptoContractDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = CryptoContractDivinerConfigSchema\n static override labels: CryptoContractDivinerLabels = { ...super.labels, ...CryptoContractDivinerLabels }\n\n protected static findCallResult<TResult = string>(\n address: string,\n functionName: string,\n payloads: CryptoContractFunctionCallResult[],\n ): TResult | undefined {\n const foundPayload = payloads.find((payload) => payload.functionName === functionName && payload.address === address)\n return asCryptoContractFunctionCallSuccess(foundPayload)?.result as TResult | undefined\n }\n\n protected static matchingExistingField<R = string, T extends Payload = Payload>(objs: T[], field: keyof T): R | undefined {\n const expectedValue = objs.at(0)?.[field] as R\n // eslint-disable-next-line unicorn/no-array-reduce\n const didNotMatch = objs.reduce((prev, obj) => {\n return prev || obj[field] !== expectedValue\n }, false)\n return didNotMatch ? undefined : expectedValue\n }\n\n protected contractInfoRequiredFields(callResults: CryptoContractFunctionCallResult[]): ContractInfo {\n return {\n // eslint-disable-next-line deprecation/deprecation\n address: assertEx(CryptoContractDiviner.matchingExistingField(callResults, 'address'), () => 'Mismatched address'),\n // eslint-disable-next-line deprecation/deprecation\n chainId: assertEx(CryptoContractDiviner.matchingExistingField(callResults, 'chainId'), () => 'Mismatched chainId'),\n schema: ContractInfoSchema,\n }\n }\n\n protected override async divineHandler(inPayloads: CryptoContractFunctionCallResult[] = []): Promise<ContractInfo[]> {\n const callResults = inPayloads.filter(isPayloadOfSchemaType<CryptoContractFunctionCallResult>(CryptoContractFunctionCallResultSchema))\n const addresses = Object.keys(\n // eslint-disable-next-line unicorn/no-array-reduce\n callResults.reduce<Record<string, boolean>>((prev, result) => {\n if (result.address) {\n prev[result.address] = true\n }\n return prev\n }, {}),\n )\n const result = await Promise.all(\n addresses.map(async (address) => {\n const foundCallResults = callResults.filter((callResult) => callResult.address === address)\n const info: ContractInfo = {\n results: await this.reduceResults(foundCallResults),\n ...this.contractInfoRequiredFields(foundCallResults),\n }\n return info\n }),\n )\n\n return result\n }\n\n protected reduceResults(callResults: CryptoContractFunctionCallResult[]): Promisable<ContractInfo['results']> {\n // eslint-disable-next-line unicorn/no-array-reduce\n return callResults.reduce<Record<string, unknown>>((prev, callResult) => {\n prev[callResult.functionName] = asCryptoContractFunctionCallSuccess(callResult)?.result\n return prev\n }, {})\n }\n}\n","import { NftSchema } from '@xyo-network/crypto-nft-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\n// eslint-disable-next-line import/no-deprecated\nimport { CryptoContractFunctionReadWitness } from './Witness.js'\n\n/** @deprecated use EvmCallWitness instead */\nexport const CryptoContractFunctionReadWitnessPlugin = () =>\n // eslint-disable-next-line deprecation/deprecation, import/no-deprecated\n createPayloadSetWitnessPlugin<CryptoContractFunctionReadWitness>(\n { required: { [NftSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n // eslint-disable-next-line deprecation/deprecation, import/no-deprecated\n const result = await CryptoContractFunctionReadWitness.create(params)\n return result\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport {\n CryptoContractFunctionCall,\n CryptoContractFunctionCallFailure,\n CryptoContractFunctionCallResult,\n CryptoContractFunctionCallResultSchema,\n CryptoContractFunctionCallSchema,\n CryptoContractFunctionCallSuccess,\n CryptoContractFunctionReadWitnessConfig,\n CryptoContractFunctionReadWitnessConfigSchema,\n} from '@xyo-network/crypto-contract-function-read-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { isPayloadOfSchemaType, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\nimport { Contract, Provider } from 'ethers'\n\n/** @deprecated use EvmCallWitness instead */\nexport type CryptoContractFunctionReadWitnessParams = WitnessParams<\n AnyConfigSchema<CryptoContractFunctionReadWitnessConfig>,\n {\n providers: Provider[]\n }\n>\n\n/** @deprecated use EvmCallWitness instead */\nexport class CryptoContractFunctionReadWitness<\n // eslint-disable-next-line deprecation/deprecation\n TParams extends CryptoContractFunctionReadWitnessParams = CryptoContractFunctionReadWitnessParams,\n> extends AbstractWitness<TParams, CryptoContractFunctionCall, CryptoContractFunctionCallResult> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, CryptoContractFunctionReadWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = CryptoContractFunctionReadWitnessConfigSchema\n\n get abi() {\n return assertEx(this.config.abi, () => 'Missing abi')\n }\n\n protected override async observeHandler(inPayloads: CryptoContractFunctionCall[] = []): Promise<CryptoContractFunctionCallResult[]> {\n await this.started('throw')\n try {\n const observations = await Promise.all(\n inPayloads.filter(isPayloadOfSchemaType(CryptoContractFunctionCallSchema)).map(async ({ functionName, args, address }) => {\n const { providers } = this.params\n const provider = providers[Date.now() % providers.length] //pick a random provider\n const validatedAddress = assertEx(address ?? this.config.address, () => 'Missing address')\n const validatedFunctionName = assertEx(functionName ?? this.config.functionName, () => 'Missing address')\n const mergedArgs = [...(args ?? this.config.args ?? [])]\n\n const contract = new Contract(validatedAddress, this.abi, provider)\n try {\n const result = await contract[validatedFunctionName](...mergedArgs)\n const transformedResult = typeof result === 'bigint' ? result.toString(16) : result\n const observation: CryptoContractFunctionCallSuccess = {\n address: validatedAddress,\n args: mergedArgs,\n chainId: Number((await provider.getNetwork()).chainId),\n functionName: validatedFunctionName,\n result: transformedResult,\n schema: CryptoContractFunctionCallResultSchema,\n }\n return observation\n } catch (ex) {\n const error = ex as Error & { code: string }\n console.log(`Error [${this.config.name}]: ${error.code}`)\n const observation: CryptoContractFunctionCallFailure = {\n address: validatedAddress,\n args: mergedArgs,\n chainId: Number((await provider.getNetwork()).chainId),\n error: error.code,\n functionName: validatedFunctionName,\n schema: CryptoContractFunctionCallResultSchema,\n }\n return observation\n }\n }),\n )\n return observations\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"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACAA,oBAAyB;AAEzB,0DASO;AACP,8BAAgC;AAChC,2BAAuD;AAMhD,IAAM,wBAAN,MAAM,+BAAyG,wCAAyB;AAAA,EAC7I,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,qFAAiC;AAAA,EAC7G,OAAyB,sBAA8B;AAAA,EACvD,OAAgB,SAAsC,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EAAE,GAAG,UAAU;AAClE,kBAAM,oBAAoB,OAAO,WAAW,WAAW,OAAO,SAAS,EAAE,IAAI;AAC7E,kBAAM,cAAiD;AAAA,cACrD,SAAS;AAAA,cACT,MAAM;AAAA,cACN,SAAS,QAAQ,MAAM,SAAS,WAAW,GAAG,OAAO;AAAA,cACrD,cAAc;AAAA,cACd,QAAQ;AAAA,cACR,QAAQ;AAAA,YACV;AACA,mBAAO;AAAA,UACT,SAAS,IAAI;AACX,kBAAM,QAAQ;AACd,oBAAQ,IAAI,UAAU,KAAK,OAAO,IAAI,MAAM,MAAM,IAAI,EAAE;AACxD,kBAAM,cAAiD;AAAA,cACrD,SAAS;AAAA,cACT,MAAM;AAAA,cACN,SAAS,QAAQ,MAAM,SAAS,WAAW,GAAG,OAAO;AAAA,cACrD,OAAO,MAAM;AAAA,cACb,cAAc;AAAA,cACd,QAAQ;AAAA,YACV;AACA,mBAAO;AAAA,UACT;AAAA,QACF,CAAC;AAAA,MACH;AACA,aAAO;AAAA,IACT,SAAS,IAAI;AACX,YAAM,QAAQ;AACd,cAAQ,IAAI,UAAU,KAAK,OAAO,IAAI,MAAM,MAAM,OAAO,EAAE;AAC3D,YAAM;AAAA,IACR;AAAA,EACF;AACF;;;AD3EO,IAAM,0CAA0C;AAAA;AAAA,MAErD;AAAA,IACE,EAAE,UAAU,EAAE,CAAC,0CAAS,GAAG,EAAE,GAAG,QAAQ,uCAAiB;AAAA,IACzD;AAAA,MACE,SAAS,OAAO,WAAW;AAEzB,cAAM,SAAS,MAAM,kCAAkC,OAAO,MAAM;AACpE,eAAO;AAAA,MACT;AAAA,IACF;AAAA,EACF;AAAA;","names":["result","import_payload_model","import_assert","import_crypto_contract_function_read_payload_plugin","import_payload_model"]}
|
|
1
|
+
{"version":3,"sources":["../../src/index.ts","../../src/Diviner/Diviner.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["export * from './Diviner/index.ts'\nexport { CryptoContractFunctionReadWitnessPlugin, CryptoContractFunctionReadWitnessPlugin as default } from './Plugin.ts'\nexport * from './Witness.ts'\n","import { assertEx } from '@xylabs/assert'\nimport { Promisable } from '@xylabs/promise'\nimport {\n asCryptoContractFunctionCallSuccess,\n ContractInfo,\n ContractInfoSchema,\n CryptoContractDivinerConfigSchema,\n CryptoContractDivinerLabels,\n CryptoContractDivinerParams,\n CryptoContractFunctionCallResult,\n CryptoContractFunctionCallResultSchema,\n} from '@xyo-network/crypto-contract-function-read-payload-plugin'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { isPayloadOfSchemaType, Payload, Schema } from '@xyo-network/payload-model'\n\n/** @deprecated use EvmCallDiviner instead */\nexport type FindCallResult<TResult = string, TPayload = Payload> = [TResult, TPayload] | [undefined, TPayload] | [undefined, undefined]\n\n/** @deprecated use EvmCallDiviner instead */\nexport class CryptoContractDiviner<TParams extends CryptoContractDivinerParams = CryptoContractDivinerParams> extends AbstractDiviner<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, CryptoContractDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = CryptoContractDivinerConfigSchema\n static override labels: CryptoContractDivinerLabels = { ...super.labels, ...CryptoContractDivinerLabels }\n\n protected static findCallResult<TResult = string>(\n address: string,\n functionName: string,\n payloads: CryptoContractFunctionCallResult[],\n ): TResult | undefined {\n const foundPayload = payloads.find(payload => payload.functionName === functionName && payload.address === address)\n return asCryptoContractFunctionCallSuccess(foundPayload)?.result as TResult | undefined\n }\n\n protected static matchingExistingField<R = string, T extends Payload = Payload>(objs: T[], field: keyof T): R | undefined {\n const expectedValue = objs.at(0)?.[field] as R\n // eslint-disable-next-line unicorn/no-array-reduce\n const didNotMatch = objs.reduce((prev, obj) => {\n return prev || obj[field] !== expectedValue\n }, false)\n return didNotMatch ? undefined : expectedValue\n }\n\n protected contractInfoRequiredFields(callResults: CryptoContractFunctionCallResult[]): ContractInfo {\n return {\n address: assertEx(CryptoContractDiviner.matchingExistingField(callResults, 'address'), () => 'Mismatched address'),\n chainId: assertEx(CryptoContractDiviner.matchingExistingField(callResults, 'chainId'), () => 'Mismatched chainId'),\n schema: ContractInfoSchema,\n }\n }\n\n protected override async divineHandler(inPayloads: CryptoContractFunctionCallResult[] = []): Promise<ContractInfo[]> {\n const callResults = inPayloads.filter(isPayloadOfSchemaType<CryptoContractFunctionCallResult>(CryptoContractFunctionCallResultSchema))\n const addresses = Object.keys(\n // eslint-disable-next-line unicorn/no-array-reduce\n callResults.reduce<Record<string, boolean>>((prev, result) => {\n if (result.address) {\n prev[result.address] = true\n }\n return prev\n }, {}),\n )\n const result = await Promise.all(\n addresses.map(async (address) => {\n const foundCallResults = callResults.filter(callResult => callResult.address === address)\n const info: ContractInfo = {\n results: await this.reduceResults(foundCallResults),\n ...this.contractInfoRequiredFields(foundCallResults),\n }\n return info\n }),\n )\n\n return result\n }\n\n protected reduceResults(callResults: CryptoContractFunctionCallResult[]): Promisable<ContractInfo['results']> {\n // eslint-disable-next-line unicorn/no-array-reduce\n return callResults.reduce<Record<string, unknown>>((prev, callResult) => {\n prev[callResult.functionName] = asCryptoContractFunctionCallSuccess(callResult)?.result\n return prev\n }, {})\n }\n}\n","import { NftSchema } from '@xyo-network/crypto-nft-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\n// eslint-disable-next-line import/no-deprecated\nimport { CryptoContractFunctionReadWitness } from './Witness.ts'\n\n/** @deprecated use EvmCallWitness instead */\nexport const CryptoContractFunctionReadWitnessPlugin = () =>\n\n createPayloadSetWitnessPlugin<CryptoContractFunctionReadWitness>(\n { required: { [NftSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await CryptoContractFunctionReadWitness.create(params)\n return result\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport {\n CryptoContractFunctionCall,\n CryptoContractFunctionCallFailure,\n CryptoContractFunctionCallResult,\n CryptoContractFunctionCallResultSchema,\n CryptoContractFunctionCallSchema,\n CryptoContractFunctionCallSuccess,\n CryptoContractFunctionReadWitnessConfig,\n CryptoContractFunctionReadWitnessConfigSchema,\n} from '@xyo-network/crypto-contract-function-read-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { isPayloadOfSchemaType, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\nimport { Contract, Provider } from 'ethers'\n\n/** @deprecated use EvmCallWitness instead */\nexport type CryptoContractFunctionReadWitnessParams = WitnessParams<\n AnyConfigSchema<CryptoContractFunctionReadWitnessConfig>,\n {\n providers: Provider[]\n }\n>\n\n/** @deprecated use EvmCallWitness instead */\nexport class CryptoContractFunctionReadWitness<\n TParams extends CryptoContractFunctionReadWitnessParams = CryptoContractFunctionReadWitnessParams,\n> extends AbstractWitness<TParams, CryptoContractFunctionCall, CryptoContractFunctionCallResult> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, CryptoContractFunctionReadWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = CryptoContractFunctionReadWitnessConfigSchema\n\n get abi() {\n return assertEx(this.config.abi, () => 'Missing abi')\n }\n\n protected override async observeHandler(inPayloads: CryptoContractFunctionCall[] = []): Promise<CryptoContractFunctionCallResult[]> {\n await this.started('throw')\n try {\n const observations = await Promise.all(\n inPayloads.filter(isPayloadOfSchemaType(CryptoContractFunctionCallSchema)).map(async ({ functionName, args, address }) => {\n const { providers } = this.params\n const provider = providers[Date.now() % providers.length] // pick a random provider\n const validatedAddress = assertEx(address ?? this.config.address, () => 'Missing address')\n const validatedFunctionName = assertEx(functionName ?? this.config.functionName, () => 'Missing address')\n const mergedArgs = [...(args ?? this.config.args ?? [])]\n\n const contract = new Contract(validatedAddress, this.abi, provider)\n try {\n const result = await contract[validatedFunctionName](...mergedArgs)\n const transformedResult = typeof result === 'bigint' ? result.toString(16) : result\n const observation: CryptoContractFunctionCallSuccess = {\n address: validatedAddress,\n args: mergedArgs,\n chainId: Number((await provider.getNetwork()).chainId),\n functionName: validatedFunctionName,\n result: transformedResult,\n schema: CryptoContractFunctionCallResultSchema,\n }\n return observation\n } catch (ex) {\n const error = ex as Error & { code: string }\n console.log(`Error [${this.config.name}]: ${error.code}`)\n const observation: CryptoContractFunctionCallFailure = {\n address: validatedAddress,\n args: mergedArgs,\n chainId: Number((await provider.getNetwork()).chainId),\n error: error.code,\n functionName: validatedFunctionName,\n schema: CryptoContractFunctionCallResultSchema,\n }\n return observation\n }\n }),\n )\n return observations\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"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;ACAA,oBAAyB;AAEzB,0DASO;AACP,8BAAgC;AAChC,2BAAuD;AAMhD,IAAMA,wBAAN,MAAMA,+BAAyGC,wCAAAA;EAnBtH,OAmBsHA;;;EACpH,OAAyBC,gBAA0B;OAAI,MAAMA;IAAeC;;EAC5E,OAAyBC,sBAA8BD;EACvD,OAAgBE,SAAsC;IAAE,GAAG,MAAMA;IAAQ,GAAGC;EAA4B;EAExG,OAAiBC,eACfC,SACAC,cACAC,UACqB;AACrB,UAAMC,eAAeD,SAASE,KAAKC,CAAAA,YAAWA,QAAQJ,iBAAiBA,gBAAgBI,QAAQL,YAAYA,OAAAA;AAC3G,eAAOM,yFAAoCH,YAAAA,GAAeI;EAC5D;EAEA,OAAiBC,sBAA+DC,MAAWC,OAA+B;AACxH,UAAMC,gBAAgBF,KAAKG,GAAG,CAAA,IAAKF,KAAAA;AAEnC,UAAMG,cAAcJ,KAAKK,OAAO,CAACC,MAAMC,QAAAA;AACrC,aAAOD,QAAQC,IAAIN,KAAAA,MAAWC;IAChC,GAAG,KAAA;AACH,WAAOE,cAAcI,SAAYN;EACnC;EAEUO,2BAA2BC,aAA+D;AAClG,WAAO;MACLnB,aAASoB,wBAAS5B,uBAAsBgB,sBAA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MACF,CAAA,CAAA;AAEF,aAAOxB;IACT,SAAS8B,IAAI;AACX,YAAMC,QAAQD;AACdE,cAAQC,IAAI,UAAU,KAAKrC,OAAOsC,IAAI,MAAMH,MAAMK,OAAO,EAAE;AAC3D,YAAML;IACR;EACF;AACF;;;AD1EO,IAAMM,0CAA0C,iCAErDC,wDACE;EAAEC,UAAU;IAAE,CAACC,0CAAAA,GAAY;EAAE;EAAGC,QAAQC;AAAiB,GACzD;EACEC,SAAS,8BAAOC,WAAAA;AACd,UAAMC,SAAS,MAAMC,kCAAkCC,OAAOH,MAAAA;AAC9D,WAAOC;EACT,GAHS;AAIX,CAAA,GATmD;","names":["CryptoContractDiviner","AbstractDiviner","configSchemas","CryptoContractDivinerConfigSchema","defaultConfigSchema","labels","CryptoContractDivinerLabels","findCallResult","address","functionName","payloads","foundPayload","find","payload","asCryptoContractFunctionCallSuccess","result","matchingExistingField","objs","field","expectedValue","at","didNotMatch","reduce","prev","obj","undefined","contractInfoRequiredFields","callResults","assertEx","chainId","schema","ContractInfoSchema","divineHandler","inPayloads","filter","isPayloadOfSchemaType","CryptoContractFunctionCallResultSchema","addresses","Object","keys","Promise","all","map","foundCallResults","callResult","info","results","reduceResults","import_payload_model","import_assert","import_crypto_contract_function_read_payload_plugin","import_payload_model","CryptoContractFunctionReadWitness","AbstractWitness","configSchemas","CryptoContractFunctionReadWitnessConfigSchema","defaultConfigSchema","abi","assertEx","config","observeHandler","inPayloads","started","observations","Promise","all","filter","isPayloadOfSchemaType","CryptoContractFunctionCallSchema","map","functionName","args","address","providers","params","provider","Date","now","length","validatedAddress","validatedFunctionName","mergedArgs","contract","Contract","result","transformedResult","toString","observation","chainId","Number","getNetwork","schema","CryptoContractFunctionCallResultSchema","ex","error","console","log","name","code","message","CryptoContractFunctionReadWitnessPlugin","createPayloadSetWitnessPlugin","required","NftSchema","schema","PayloadSetSchema","witness","params","result","CryptoContractFunctionReadWitness","create"]}
|
package/dist/neutral/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './Diviner/index.
|
|
2
|
-
export { CryptoContractFunctionReadWitnessPlugin, CryptoContractFunctionReadWitnessPlugin as default } from './Plugin.
|
|
3
|
-
export * from './Witness.
|
|
1
|
+
export * from './Diviner/index.ts';
|
|
2
|
+
export { CryptoContractFunctionReadWitnessPlugin, CryptoContractFunctionReadWitnessPlugin as default } from './Plugin.ts';
|
|
3
|
+
export * from './Witness.ts';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,uCAAuC,EAAE,uCAAuC,IAAI,OAAO,EAAE,MAAM,aAAa,CAAA;AACzH,cAAc,cAAc,CAAA"}
|
package/dist/neutral/index.d.mts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './Diviner/index.
|
|
2
|
-
export { CryptoContractFunctionReadWitnessPlugin, CryptoContractFunctionReadWitnessPlugin as default } from './Plugin.
|
|
3
|
-
export * from './Witness.
|
|
1
|
+
export * from './Diviner/index.ts';
|
|
2
|
+
export { CryptoContractFunctionReadWitnessPlugin, CryptoContractFunctionReadWitnessPlugin as default } from './Plugin.ts';
|
|
3
|
+
export * from './Witness.ts';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,uCAAuC,EAAE,uCAAuC,IAAI,OAAO,EAAE,MAAM,aAAa,CAAA;AACzH,cAAc,cAAc,CAAA"}
|
package/dist/neutral/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export * from './Diviner/index.
|
|
2
|
-
export { CryptoContractFunctionReadWitnessPlugin, CryptoContractFunctionReadWitnessPlugin as default } from './Plugin.
|
|
3
|
-
export * from './Witness.
|
|
1
|
+
export * from './Diviner/index.ts';
|
|
2
|
+
export { CryptoContractFunctionReadWitnessPlugin, CryptoContractFunctionReadWitnessPlugin as default } from './Plugin.ts';
|
|
3
|
+
export * from './Witness.ts';
|
|
4
4
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAA;AAClC,OAAO,EAAE,uCAAuC,EAAE,uCAAuC,IAAI,OAAO,EAAE,MAAM,aAAa,CAAA;AACzH,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
3
|
+
|
|
4
|
+
// src/Diviner/Diviner.ts
|
|
5
|
+
import { assertEx } from "@xylabs/assert";
|
|
6
|
+
import { asCryptoContractFunctionCallSuccess, ContractInfoSchema, CryptoContractDivinerConfigSchema, CryptoContractDivinerLabels, CryptoContractFunctionCallResultSchema } from "@xyo-network/crypto-contract-function-read-payload-plugin";
|
|
7
|
+
import { AbstractDiviner } from "@xyo-network/diviner-abstract";
|
|
8
|
+
import { isPayloadOfSchemaType } from "@xyo-network/payload-model";
|
|
9
|
+
var CryptoContractDiviner = class _CryptoContractDiviner extends AbstractDiviner {
|
|
10
|
+
static {
|
|
11
|
+
__name(this, "CryptoContractDiviner");
|
|
12
|
+
}
|
|
13
|
+
static configSchemas = [
|
|
14
|
+
...super.configSchemas,
|
|
15
|
+
CryptoContractDivinerConfigSchema
|
|
16
|
+
];
|
|
17
|
+
static defaultConfigSchema = CryptoContractDivinerConfigSchema;
|
|
18
|
+
static labels = {
|
|
19
|
+
...super.labels,
|
|
20
|
+
...CryptoContractDivinerLabels
|
|
21
|
+
};
|
|
22
|
+
static findCallResult(address, functionName, payloads) {
|
|
23
|
+
const foundPayload = payloads.find((payload) => payload.functionName === functionName && payload.address === address);
|
|
24
|
+
return asCryptoContractFunctionCallSuccess(foundPayload)?.result;
|
|
25
|
+
}
|
|
26
|
+
static matchingExistingField(objs, field) {
|
|
27
|
+
const expectedValue = objs.at(0)?.[field];
|
|
28
|
+
const didNotMatch = objs.reduce((prev, obj) => {
|
|
29
|
+
return prev || obj[field] !== expectedValue;
|
|
30
|
+
}, false);
|
|
31
|
+
return didNotMatch ? void 0 : expectedValue;
|
|
32
|
+
}
|
|
33
|
+
contractInfoRequiredFields(callResults) {
|
|
34
|
+
return {
|
|
35
|
+
address: assertEx(_CryptoContractDiviner.matchingExistingField(callResults, "address"), () => "Mismatched address"),
|
|
36
|
+
chainId: assertEx(_CryptoContractDiviner.matchingExistingField(callResults, "chainId"), () => "Mismatched chainId"),
|
|
37
|
+
schema: ContractInfoSchema
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
async divineHandler(inPayloads = []) {
|
|
41
|
+
const callResults = inPayloads.filter(isPayloadOfSchemaType(CryptoContractFunctionCallResultSchema));
|
|
42
|
+
const addresses = Object.keys(
|
|
43
|
+
// eslint-disable-next-line unicorn/no-array-reduce
|
|
44
|
+
callResults.reduce((prev, result2) => {
|
|
45
|
+
if (result2.address) {
|
|
46
|
+
prev[result2.address] = true;
|
|
47
|
+
}
|
|
48
|
+
return prev;
|
|
49
|
+
}, {})
|
|
50
|
+
);
|
|
51
|
+
const result = await Promise.all(addresses.map(async (address) => {
|
|
52
|
+
const foundCallResults = callResults.filter((callResult) => callResult.address === address);
|
|
53
|
+
const info = {
|
|
54
|
+
results: await this.reduceResults(foundCallResults),
|
|
55
|
+
...this.contractInfoRequiredFields(foundCallResults)
|
|
56
|
+
};
|
|
57
|
+
return info;
|
|
58
|
+
}));
|
|
59
|
+
return result;
|
|
60
|
+
}
|
|
61
|
+
reduceResults(callResults) {
|
|
62
|
+
return callResults.reduce((prev, callResult) => {
|
|
63
|
+
prev[callResult.functionName] = asCryptoContractFunctionCallSuccess(callResult)?.result;
|
|
64
|
+
return prev;
|
|
65
|
+
}, {});
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// src/Plugin.ts
|
|
70
|
+
import { NftSchema } from "@xyo-network/crypto-nft-payload-plugin";
|
|
71
|
+
import { PayloadSetSchema } from "@xyo-network/payload-model";
|
|
72
|
+
import { createPayloadSetWitnessPlugin } from "@xyo-network/payloadset-plugin";
|
|
73
|
+
|
|
74
|
+
// src/Witness.ts
|
|
75
|
+
import { assertEx as assertEx2 } from "@xylabs/assert";
|
|
76
|
+
import { AbstractWitness } from "@xyo-network/abstract-witness";
|
|
77
|
+
import { CryptoContractFunctionCallResultSchema as CryptoContractFunctionCallResultSchema2, CryptoContractFunctionCallSchema, CryptoContractFunctionReadWitnessConfigSchema } from "@xyo-network/crypto-contract-function-read-payload-plugin";
|
|
78
|
+
import { isPayloadOfSchemaType as isPayloadOfSchemaType2 } from "@xyo-network/payload-model";
|
|
79
|
+
import { Contract } from "ethers";
|
|
80
|
+
var CryptoContractFunctionReadWitness = class extends AbstractWitness {
|
|
81
|
+
static {
|
|
82
|
+
__name(this, "CryptoContractFunctionReadWitness");
|
|
83
|
+
}
|
|
84
|
+
static configSchemas = [
|
|
85
|
+
...super.configSchemas,
|
|
86
|
+
CryptoContractFunctionReadWitnessConfigSchema
|
|
87
|
+
];
|
|
88
|
+
static defaultConfigSchema = CryptoContractFunctionReadWitnessConfigSchema;
|
|
89
|
+
get abi() {
|
|
90
|
+
return assertEx2(this.config.abi, () => "Missing abi");
|
|
91
|
+
}
|
|
92
|
+
async observeHandler(inPayloads = []) {
|
|
93
|
+
await this.started("throw");
|
|
94
|
+
try {
|
|
95
|
+
const observations = await Promise.all(inPayloads.filter(isPayloadOfSchemaType2(CryptoContractFunctionCallSchema)).map(async ({ functionName, args, address }) => {
|
|
96
|
+
const { providers } = this.params;
|
|
97
|
+
const provider = providers[Date.now() % providers.length];
|
|
98
|
+
const validatedAddress = assertEx2(address ?? this.config.address, () => "Missing address");
|
|
99
|
+
const validatedFunctionName = assertEx2(functionName ?? this.config.functionName, () => "Missing address");
|
|
100
|
+
const mergedArgs = [
|
|
101
|
+
...args ?? this.config.args ?? []
|
|
102
|
+
];
|
|
103
|
+
const contract = new Contract(validatedAddress, this.abi, provider);
|
|
104
|
+
try {
|
|
105
|
+
const result = await contract[validatedFunctionName](...mergedArgs);
|
|
106
|
+
const transformedResult = typeof result === "bigint" ? result.toString(16) : result;
|
|
107
|
+
const observation = {
|
|
108
|
+
address: validatedAddress,
|
|
109
|
+
args: mergedArgs,
|
|
110
|
+
chainId: Number((await provider.getNetwork()).chainId),
|
|
111
|
+
functionName: validatedFunctionName,
|
|
112
|
+
result: transformedResult,
|
|
113
|
+
schema: CryptoContractFunctionCallResultSchema2
|
|
114
|
+
};
|
|
115
|
+
return observation;
|
|
116
|
+
} catch (ex) {
|
|
117
|
+
const error = ex;
|
|
118
|
+
console.log(`Error [${this.config.name}]: ${error.code}`);
|
|
119
|
+
const observation = {
|
|
120
|
+
address: validatedAddress,
|
|
121
|
+
args: mergedArgs,
|
|
122
|
+
chainId: Number((await provider.getNetwork()).chainId),
|
|
123
|
+
error: error.code,
|
|
124
|
+
functionName: validatedFunctionName,
|
|
125
|
+
schema: CryptoContractFunctionCallResultSchema2
|
|
126
|
+
};
|
|
127
|
+
return observation;
|
|
128
|
+
}
|
|
129
|
+
}));
|
|
130
|
+
return observations;
|
|
131
|
+
} catch (ex) {
|
|
132
|
+
const error = ex;
|
|
133
|
+
console.log(`Error [${this.config.name}]: ${error.message}`);
|
|
134
|
+
throw error;
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
};
|
|
138
|
+
|
|
139
|
+
// src/Plugin.ts
|
|
140
|
+
var CryptoContractFunctionReadWitnessPlugin = /* @__PURE__ */ __name(() => createPayloadSetWitnessPlugin({
|
|
141
|
+
required: {
|
|
142
|
+
[NftSchema]: 1
|
|
143
|
+
},
|
|
144
|
+
schema: PayloadSetSchema
|
|
145
|
+
}, {
|
|
146
|
+
witness: /* @__PURE__ */ __name(async (params) => {
|
|
147
|
+
const result = await CryptoContractFunctionReadWitness.create(params);
|
|
148
|
+
return result;
|
|
149
|
+
}, "witness")
|
|
150
|
+
}), "CryptoContractFunctionReadWitnessPlugin");
|
|
151
|
+
export {
|
|
152
|
+
CryptoContractDiviner,
|
|
153
|
+
CryptoContractFunctionReadWitness,
|
|
154
|
+
CryptoContractFunctionReadWitnessPlugin,
|
|
155
|
+
CryptoContractFunctionReadWitnessPlugin as default
|
|
156
|
+
};
|
|
157
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/Diviner/Diviner.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport { Promisable } from '@xylabs/promise'\nimport {\n asCryptoContractFunctionCallSuccess,\n ContractInfo,\n ContractInfoSchema,\n CryptoContractDivinerConfigSchema,\n CryptoContractDivinerLabels,\n CryptoContractDivinerParams,\n CryptoContractFunctionCallResult,\n CryptoContractFunctionCallResultSchema,\n} from '@xyo-network/crypto-contract-function-read-payload-plugin'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport { isPayloadOfSchemaType, Payload, Schema } from '@xyo-network/payload-model'\n\n/** @deprecated use EvmCallDiviner instead */\nexport type FindCallResult<TResult = string, TPayload = Payload> = [TResult, TPayload] | [undefined, TPayload] | [undefined, undefined]\n\n/** @deprecated use EvmCallDiviner instead */\nexport class CryptoContractDiviner<TParams extends CryptoContractDivinerParams = CryptoContractDivinerParams> extends AbstractDiviner<TParams> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, CryptoContractDivinerConfigSchema]\n static override readonly defaultConfigSchema: Schema = CryptoContractDivinerConfigSchema\n static override labels: CryptoContractDivinerLabels = { ...super.labels, ...CryptoContractDivinerLabels }\n\n protected static findCallResult<TResult = string>(\n address: string,\n functionName: string,\n payloads: CryptoContractFunctionCallResult[],\n ): TResult | undefined {\n const foundPayload = payloads.find(payload => payload.functionName === functionName && payload.address === address)\n return asCryptoContractFunctionCallSuccess(foundPayload)?.result as TResult | undefined\n }\n\n protected static matchingExistingField<R = string, T extends Payload = Payload>(objs: T[], field: keyof T): R | undefined {\n const expectedValue = objs.at(0)?.[field] as R\n // eslint-disable-next-line unicorn/no-array-reduce\n const didNotMatch = objs.reduce((prev, obj) => {\n return prev || obj[field] !== expectedValue\n }, false)\n return didNotMatch ? undefined : expectedValue\n }\n\n protected contractInfoRequiredFields(callResults: CryptoContractFunctionCallResult[]): ContractInfo {\n return {\n address: assertEx(CryptoContractDiviner.matchingExistingField(callResults, 'address'), () => 'Mismatched address'),\n chainId: assertEx(CryptoContractDiviner.matchingExistingField(callResults, 'chainId'), () => 'Mismatched chainId'),\n schema: ContractInfoSchema,\n }\n }\n\n protected override async divineHandler(inPayloads: CryptoContractFunctionCallResult[] = []): Promise<ContractInfo[]> {\n const callResults = inPayloads.filter(isPayloadOfSchemaType<CryptoContractFunctionCallResult>(CryptoContractFunctionCallResultSchema))\n const addresses = Object.keys(\n // eslint-disable-next-line unicorn/no-array-reduce\n callResults.reduce<Record<string, boolean>>((prev, result) => {\n if (result.address) {\n prev[result.address] = true\n }\n return prev\n }, {}),\n )\n const result = await Promise.all(\n addresses.map(async (address) => {\n const foundCallResults = callResults.filter(callResult => callResult.address === address)\n const info: ContractInfo = {\n results: await this.reduceResults(foundCallResults),\n ...this.contractInfoRequiredFields(foundCallResults),\n }\n return info\n }),\n )\n\n return result\n }\n\n protected reduceResults(callResults: CryptoContractFunctionCallResult[]): Promisable<ContractInfo['results']> {\n // eslint-disable-next-line unicorn/no-array-reduce\n return callResults.reduce<Record<string, unknown>>((prev, callResult) => {\n prev[callResult.functionName] = asCryptoContractFunctionCallSuccess(callResult)?.result\n return prev\n }, {})\n }\n}\n","import { NftSchema } from '@xyo-network/crypto-nft-payload-plugin'\nimport { PayloadSetSchema } from '@xyo-network/payload-model'\nimport { createPayloadSetWitnessPlugin } from '@xyo-network/payloadset-plugin'\n\n// eslint-disable-next-line import/no-deprecated\nimport { CryptoContractFunctionReadWitness } from './Witness.ts'\n\n/** @deprecated use EvmCallWitness instead */\nexport const CryptoContractFunctionReadWitnessPlugin = () =>\n\n createPayloadSetWitnessPlugin<CryptoContractFunctionReadWitness>(\n { required: { [NftSchema]: 1 }, schema: PayloadSetSchema },\n {\n witness: async (params) => {\n const result = await CryptoContractFunctionReadWitness.create(params)\n return result\n },\n },\n )\n","import { assertEx } from '@xylabs/assert'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport {\n CryptoContractFunctionCall,\n CryptoContractFunctionCallFailure,\n CryptoContractFunctionCallResult,\n CryptoContractFunctionCallResultSchema,\n CryptoContractFunctionCallSchema,\n CryptoContractFunctionCallSuccess,\n CryptoContractFunctionReadWitnessConfig,\n CryptoContractFunctionReadWitnessConfigSchema,\n} from '@xyo-network/crypto-contract-function-read-payload-plugin'\nimport { AnyConfigSchema } from '@xyo-network/module-model'\nimport { isPayloadOfSchemaType, Schema } from '@xyo-network/payload-model'\nimport { WitnessParams } from '@xyo-network/witness-model'\nimport { Contract, Provider } from 'ethers'\n\n/** @deprecated use EvmCallWitness instead */\nexport type CryptoContractFunctionReadWitnessParams = WitnessParams<\n AnyConfigSchema<CryptoContractFunctionReadWitnessConfig>,\n {\n providers: Provider[]\n }\n>\n\n/** @deprecated use EvmCallWitness instead */\nexport class CryptoContractFunctionReadWitness<\n TParams extends CryptoContractFunctionReadWitnessParams = CryptoContractFunctionReadWitnessParams,\n> extends AbstractWitness<TParams, CryptoContractFunctionCall, CryptoContractFunctionCallResult> {\n static override readonly configSchemas: Schema[] = [...super.configSchemas, CryptoContractFunctionReadWitnessConfigSchema]\n static override readonly defaultConfigSchema: Schema = CryptoContractFunctionReadWitnessConfigSchema\n\n get abi() {\n return assertEx(this.config.abi, () => 'Missing abi')\n }\n\n protected override async observeHandler(inPayloads: CryptoContractFunctionCall[] = []): Promise<CryptoContractFunctionCallResult[]> {\n await this.started('throw')\n try {\n const observations = await Promise.all(\n inPayloads.filter(isPayloadOfSchemaType(CryptoContractFunctionCallSchema)).map(async ({ functionName, args, address }) => {\n const { providers } = this.params\n const provider = providers[Date.now() % providers.length] // pick a random provider\n const validatedAddress = assertEx(address ?? this.config.address, () => 'Missing address')\n const validatedFunctionName = assertEx(functionName ?? this.config.functionName, () => 'Missing address')\n const mergedArgs = [...(args ?? this.config.args ?? [])]\n\n const contract = new Contract(validatedAddress, this.abi, provider)\n try {\n const result = await contract[validatedFunctionName](...mergedArgs)\n const transformedResult = typeof result === 'bigint' ? result.toString(16) : result\n const observation: CryptoContractFunctionCallSuccess = {\n address: validatedAddress,\n args: mergedArgs,\n chainId: Number((await provider.getNetwork()).chainId),\n functionName: validatedFunctionName,\n result: transformedResult,\n schema: CryptoContractFunctionCallResultSchema,\n }\n return observation\n } catch (ex) {\n const error = ex as Error & { code: string }\n console.log(`Error [${this.config.name}]: ${error.code}`)\n const observation: CryptoContractFunctionCallFailure = {\n address: validatedAddress,\n args: mergedArgs,\n chainId: Number((await provider.getNetwork()).chainId),\n error: error.code,\n functionName: validatedFunctionName,\n schema: CryptoContractFunctionCallResultSchema,\n }\n return observation\n }\n }),\n )\n return observations\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"],"mappings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AAC9D,WAAOC;EACT,GAHS;AAIX,CAAA,GATmD;","names":["assertEx","asCryptoContractFunctionCallSuccess","ContractInfoSchema","CryptoContractDivinerConfigSchema","CryptoContractDivinerLabels","CryptoContractFunctionCallResultSchema","AbstractDiviner","isPayloadOfSchemaType","CryptoContractDiviner","AbstractDiviner","configSchemas","CryptoContractDivinerConfigSchema","defaultConfigSchema","labels","CryptoContractDivinerLabels","findCallResult","address","functionName","payloads","foundPayload","find","payload","asCryptoContractFunctionCallSuccess","result","matchingExistingField","objs","field","expectedValue","at","didNotMatch","reduce","prev","obj","undefined","contractInfoRequiredFields","callResults","assertEx","chainId","schema","ContractInfoSchema","divineHandler","inPayloads","filter","isPayloadOfSchemaType","CryptoContractFunctionCallResultSchema","addresses","Object","keys","Promise","all","map","foundCallResults","callResult","info","results","reduceResults","NftSchema","PayloadSetSchema","createPayloadSetWitnessPlugin","assertEx","AbstractWitness","CryptoContractFunctionCallResultSchema","CryptoContractFunctionCallSchema","CryptoContractFunctionReadWitnessConfigSchema","isPayloadOfSchemaType","Contract","CryptoContractFunctionReadWitness","AbstractWitness","configSchemas","CryptoContractFunctionReadWitnessConfigSchema","defaultConfigSchema","abi","assertEx","config","observeHandler","inPayloads","started","observations","Promise","all","filter","isPayloadOfSchemaType","CryptoContractFunctionCallSchema","map","functionName","args","address","providers","params","provider","Date","now","length","validatedAddress","validatedFunctionName","mergedArgs","contract","Contract","result","transformedResult","toString","observation","chainId","Number","getNetwork","schema","CryptoContractFunctionCallResultSchema","ex","error","console","log","name","code","message","CryptoContractFunctionReadWitnessPlugin","createPayloadSetWitnessPlugin","required","NftSchema","schema","PayloadSetSchema","witness","params","result","CryptoContractFunctionReadWitness","create"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Diviner.d.ts","sourceRoot":"","sources":["../../../src/Diviner/Diviner.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAC5C,OAAO,EAEL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