@xyo-network/crypto-contract-function-read-plugin 3.4.1 → 3.4.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/Diviner/Diviner.d.ts +18 -0
- package/dist/browser/Diviner/Diviner.d.ts.map +1 -0
- package/dist/browser/Diviner/index.d.ts +2 -0
- package/dist/browser/Diviner/index.d.ts.map +1 -0
- package/dist/browser/Plugin.d.ts +16 -0
- package/dist/browser/Plugin.d.ts.map +1 -0
- package/dist/browser/Witness.d.ts +18 -0
- package/dist/browser/Witness.d.ts.map +1 -0
- package/dist/browser/index.d.ts +4 -316
- package/dist/browser/index.d.ts.map +1 -0
- package/dist/browser/index.mjs +6 -2
- package/dist/browser/index.mjs.map +1 -1
- package/dist/neutral/Diviner/Diviner.d.ts +18 -0
- package/dist/neutral/Diviner/Diviner.d.ts.map +1 -0
- package/dist/neutral/Diviner/index.d.ts +2 -0
- package/dist/neutral/Diviner/index.d.ts.map +1 -0
- package/dist/neutral/Plugin.d.ts +16 -0
- package/dist/neutral/Plugin.d.ts.map +1 -0
- package/dist/neutral/Witness.d.ts +18 -0
- package/dist/neutral/Witness.d.ts.map +1 -0
- package/dist/neutral/index.d.ts +4 -316
- package/dist/neutral/index.d.ts.map +1 -0
- package/dist/neutral/index.mjs +6 -2
- package/dist/neutral/index.mjs.map +1 -1
- package/dist/node/Diviner/Diviner.d.ts +18 -0
- package/dist/node/Diviner/Diviner.d.ts.map +1 -0
- package/dist/node/Diviner/index.d.ts +2 -0
- package/dist/node/Diviner/index.d.ts.map +1 -0
- package/dist/node/Plugin.d.ts +16 -0
- package/dist/node/Plugin.d.ts.map +1 -0
- package/dist/node/Witness.d.ts +18 -0
- package/dist/node/Witness.d.ts.map +1 -0
- package/dist/node/index.d.ts +4 -316
- package/dist/node/index.d.ts.map +1 -0
- package/dist/node/index.mjs +6 -2
- package/dist/node/index.mjs.map +1 -1
- package/package.json +31 -31
- package/src/Diviner/Diviner.ts +7 -8
- package/src/Witness.ts +10 -12
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Promisable } from '@xylabs/promise';
|
|
2
|
+
import { ContractInfo, CryptoContractDivinerLabels, CryptoContractDivinerParams, CryptoContractFunctionCallResult } from '@xyo-network/crypto-contract-function-read-payload-plugin';
|
|
3
|
+
import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
4
|
+
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
5
|
+
/** @deprecated use EvmCallDiviner instead */
|
|
6
|
+
export type FindCallResult<TResult = string, TPayload = Payload> = [TResult, TPayload] | [undefined, TPayload] | [undefined, undefined];
|
|
7
|
+
/** @deprecated use EvmCallDiviner instead */
|
|
8
|
+
export declare class CryptoContractDiviner<TParams extends CryptoContractDivinerParams = CryptoContractDivinerParams> extends AbstractDiviner<TParams> {
|
|
9
|
+
static readonly configSchemas: Schema[];
|
|
10
|
+
static readonly defaultConfigSchema: Schema;
|
|
11
|
+
static readonly labels: CryptoContractDivinerLabels;
|
|
12
|
+
protected static findCallResult<TResult = string>(address: string, functionName: string, payloads: CryptoContractFunctionCallResult[]): TResult | undefined;
|
|
13
|
+
protected static matchingExistingField<R = string, T extends Payload = Payload>(objs: T[], field: keyof T): R | undefined;
|
|
14
|
+
protected contractInfoRequiredFields(callResults: CryptoContractFunctionCallResult[]): ContractInfo;
|
|
15
|
+
protected divineHandler(inPayloads?: CryptoContractFunctionCallResult[]): Promise<ContractInfo[]>;
|
|
16
|
+
protected reduceResults(callResults: CryptoContractFunctionCallResult[]): Promisable<ContractInfo['results']>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=Diviner.d.ts.map
|
|
@@ -0,0 +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,2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AAS,CAAC,CAAC;CAO9G"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CryptoContractFunctionReadWitness } from './Witness.ts';
|
|
2
|
+
/** @deprecated use EvmCallWitness instead */
|
|
3
|
+
export declare const CryptoContractFunctionReadWitnessPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<CryptoContractFunctionReadWitness<import("@xylabs/object").BaseParamsFields & {
|
|
4
|
+
account?: import(".store/@xyo-network-account-model-virtual-26592e0d6e/package").AccountInstance | "random";
|
|
5
|
+
addToResolvers?: boolean;
|
|
6
|
+
additionalSigners?: import(".store/@xyo-network-account-model-virtual-26592e0d6e/package").AccountInstance[];
|
|
7
|
+
allowNameResolution?: boolean;
|
|
8
|
+
config: import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/crypto-contract-function-read-payload-plugin").CryptoContractFunctionReadWitnessConfig>;
|
|
9
|
+
ephemeralQueryAccountEnabled?: boolean;
|
|
10
|
+
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
11
|
+
privateChildren?: import("@xyo-network/module-model").ModuleInstance[];
|
|
12
|
+
publicChildren?: import("@xyo-network/module-model").ModuleInstance[];
|
|
13
|
+
} & {
|
|
14
|
+
providers: import("ethers").Provider[];
|
|
15
|
+
}>>;
|
|
16
|
+
//# sourceMappingURL=Plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iCAAiC,EAAE,MAAM,cAAc,CAAA;AAEhE,6CAA6C;AAC7C,eAAO,MAAM,uCAAuC;;;;;;;;;;;;GAUjD,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
2
|
+
import { CryptoContractFunctionCall, CryptoContractFunctionCallResult, CryptoContractFunctionReadWitnessConfig } from '@xyo-network/crypto-contract-function-read-payload-plugin';
|
|
3
|
+
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
4
|
+
import { Schema } from '@xyo-network/payload-model';
|
|
5
|
+
import { WitnessParams } from '@xyo-network/witness-model';
|
|
6
|
+
import { InterfaceAbi, Provider } from 'ethers';
|
|
7
|
+
/** @deprecated use EvmCallWitness instead */
|
|
8
|
+
export type CryptoContractFunctionReadWitnessParams = WitnessParams<AnyConfigSchema<CryptoContractFunctionReadWitnessConfig>, {
|
|
9
|
+
providers: Provider[];
|
|
10
|
+
}>;
|
|
11
|
+
/** @deprecated use EvmCallWitness instead */
|
|
12
|
+
export declare class CryptoContractFunctionReadWitness<TParams extends CryptoContractFunctionReadWitnessParams = CryptoContractFunctionReadWitnessParams> extends AbstractWitness<TParams, CryptoContractFunctionCall, CryptoContractFunctionCallResult> {
|
|
13
|
+
static readonly configSchemas: Schema[];
|
|
14
|
+
static readonly defaultConfigSchema: Schema;
|
|
15
|
+
get abi(): InterfaceAbi;
|
|
16
|
+
protected observeHandler(inPayloads?: CryptoContractFunctionCall[]): Promise<CryptoContractFunctionCallResult[]>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=Witness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AAEA,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,EACK,YAAY,EAAE,QAAQ,EACjC,MAAM,QAAQ,CAAA;AAEf,6CAA6C;AAC7C,MAAM,MAAM,uCAAuC,GAAG,aAAa,CACjE,eAAe,CAAC,uCAAuC,CAAC,EACxD;IACE,SAAS,EAAE,QAAQ,EAAE,CAAA;CACtB,CACF,CAAA;AAED,6CAA6C;AAC7C,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,IACoD,YAAY,CACtE;cAEwB,cAAc,CAAC,UAAU,GAAE,0BAA0B,EAAO,GAAG,OAAO,CAAC,gCAAgC,EAAE,CAAC;CAgDpI"}
|
package/dist/browser/index.d.ts
CHANGED
|
@@ -1,316 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
6
|
-
import * as _xyo_network_payloadset_plugin from '@xyo-network/payloadset-plugin';
|
|
7
|
-
import * as ethers from 'ethers';
|
|
8
|
-
import { Provider, InterfaceAbi } from 'ethers';
|
|
9
|
-
import * as _store__xylabs_logger_npm_4_5_1_a411051254_package from '.store/@xylabs-logger-npm-4.5.1-a411051254/package';
|
|
10
|
-
import * as _xyo_network_module_model from '@xyo-network/module-model';
|
|
11
|
-
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
12
|
-
import * as _store__xyo_network_account_model_virtual_3a3814c98f_package from '.store/@xyo-network-account-model-virtual-3a3814c98f/package';
|
|
13
|
-
import * as _xylabs_object from '@xylabs/object';
|
|
14
|
-
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
15
|
-
import { WitnessParams } from '@xyo-network/witness-model';
|
|
16
|
-
|
|
17
|
-
type FindCallResult<TResult = string, TPayload = Payload> = [TResult, TPayload] | [undefined, TPayload] | [undefined, undefined];
|
|
18
|
-
declare class CryptoContractDiviner<TParams extends CryptoContractDivinerParams = CryptoContractDivinerParams> extends AbstractDiviner<TParams> {
|
|
19
|
-
static readonly configSchemas: Schema[];
|
|
20
|
-
static readonly defaultConfigSchema: Schema;
|
|
21
|
-
static readonly labels: CryptoContractDivinerLabels;
|
|
22
|
-
protected static findCallResult<TResult = string>(address: string, functionName: string, payloads: CryptoContractFunctionCallResult[]): TResult | undefined;
|
|
23
|
-
protected static matchingExistingField<R = string, T extends Payload = Payload>(objs: T[], field: keyof T): R | undefined;
|
|
24
|
-
protected contractInfoRequiredFields(callResults: CryptoContractFunctionCallResult[]): ContractInfo;
|
|
25
|
-
protected divineHandler(inPayloads?: CryptoContractFunctionCallResult[]): Promise<ContractInfo[]>;
|
|
26
|
-
protected reduceResults(callResults: CryptoContractFunctionCallResult[]): Promisable<ContractInfo['results']>;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
type CryptoContractFunctionReadWitnessParams = WitnessParams<AnyConfigSchema<CryptoContractFunctionReadWitnessConfig>, {
|
|
30
|
-
providers: Provider[];
|
|
31
|
-
}>;
|
|
32
|
-
declare class CryptoContractFunctionReadWitness<TParams extends CryptoContractFunctionReadWitnessParams = CryptoContractFunctionReadWitnessParams> extends AbstractWitness<TParams, CryptoContractFunctionCall, CryptoContractFunctionCallResult> {
|
|
33
|
-
static readonly configSchemas: Schema[];
|
|
34
|
-
static readonly defaultConfigSchema: Schema;
|
|
35
|
-
get abi(): InterfaceAbi;
|
|
36
|
-
protected observeHandler(inPayloads?: CryptoContractFunctionCall[]): Promise<CryptoContractFunctionCallResult[]>;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
declare const CryptoContractFunctionReadWitnessPlugin: () => _xyo_network_payloadset_plugin.PayloadSetWitnessPlugin<CryptoContractFunctionReadWitness<_xylabs_object.BaseParamsFields & {
|
|
40
|
-
account?: _store__xyo_network_account_model_virtual_3a3814c98f_package.AccountInstance | "random";
|
|
41
|
-
addToResolvers?: boolean;
|
|
42
|
-
additionalSigners?: _store__xyo_network_account_model_virtual_3a3814c98f_package.AccountInstance[];
|
|
43
|
-
allowNameResolution?: boolean;
|
|
44
|
-
config: _xylabs_object.DeepRestrictToStringKeys<{
|
|
45
|
-
schema: _xyo_network_payload_model.Schema;
|
|
46
|
-
readonly archiving?: {
|
|
47
|
-
readonly archivists?: string[] | undefined;
|
|
48
|
-
readonly queries?: string[] | undefined;
|
|
49
|
-
} | undefined;
|
|
50
|
-
readonly allowedQueries?: string[] | undefined;
|
|
51
|
-
readonly archivist?: _xyo_network_module_model.ModuleIdentifier | undefined;
|
|
52
|
-
readonly consoleLogger?: _store__xylabs_logger_npm_4_5_1_a411051254_package.LogLevel | undefined;
|
|
53
|
-
readonly labels?: {
|
|
54
|
-
[x: string]: string | undefined;
|
|
55
|
-
} | undefined;
|
|
56
|
-
readonly name?: _xyo_network_module_model.ModuleName | undefined;
|
|
57
|
-
readonly paging?: {
|
|
58
|
-
[x: string]: {
|
|
59
|
-
size?: number | undefined;
|
|
60
|
-
};
|
|
61
|
-
} | undefined;
|
|
62
|
-
readonly retry?: {
|
|
63
|
-
backoff?: number | undefined;
|
|
64
|
-
interval?: number | undefined;
|
|
65
|
-
retries?: number | undefined;
|
|
66
|
-
} | undefined;
|
|
67
|
-
readonly security?: {
|
|
68
|
-
readonly allowAnonymous?: boolean | undefined;
|
|
69
|
-
readonly allowed?: {
|
|
70
|
-
[x: string]: (Lowercase<string> | Lowercase<string>[])[];
|
|
71
|
-
} | undefined;
|
|
72
|
-
readonly disallowed?: {
|
|
73
|
-
[x: string]: Lowercase<string>[];
|
|
74
|
-
} | undefined;
|
|
75
|
-
} | undefined;
|
|
76
|
-
readonly sign?: boolean | undefined;
|
|
77
|
-
readonly storeQueries?: boolean | undefined;
|
|
78
|
-
readonly timestamp?: boolean | undefined;
|
|
79
|
-
address?: string | undefined;
|
|
80
|
-
args?: unknown[] | undefined;
|
|
81
|
-
functionName?: string | undefined;
|
|
82
|
-
abi: string | {
|
|
83
|
-
readonly [x: number]: string | {
|
|
84
|
-
readonly name?: string | undefined;
|
|
85
|
-
readonly type?: string | undefined;
|
|
86
|
-
readonly anonymous?: boolean | undefined;
|
|
87
|
-
readonly payable?: boolean | undefined;
|
|
88
|
-
readonly constant?: boolean | undefined;
|
|
89
|
-
readonly stateMutability?: string | undefined;
|
|
90
|
-
readonly inputs?: {
|
|
91
|
-
readonly [x: number]: {
|
|
92
|
-
readonly name?: string | undefined;
|
|
93
|
-
readonly indexed?: boolean | undefined;
|
|
94
|
-
readonly type?: string | undefined;
|
|
95
|
-
readonly internalType?: string | undefined;
|
|
96
|
-
readonly components?: any | undefined;
|
|
97
|
-
};
|
|
98
|
-
readonly length: number;
|
|
99
|
-
toString: {};
|
|
100
|
-
toLocaleString: {};
|
|
101
|
-
concat: {};
|
|
102
|
-
join: {};
|
|
103
|
-
slice: {};
|
|
104
|
-
indexOf: {};
|
|
105
|
-
lastIndexOf: {};
|
|
106
|
-
every: {};
|
|
107
|
-
some: {};
|
|
108
|
-
forEach: {};
|
|
109
|
-
map: {};
|
|
110
|
-
filter: {};
|
|
111
|
-
reduce: {};
|
|
112
|
-
reduceRight: {};
|
|
113
|
-
find: {};
|
|
114
|
-
findIndex: {};
|
|
115
|
-
entries: {};
|
|
116
|
-
keys: {};
|
|
117
|
-
values: {};
|
|
118
|
-
includes: {};
|
|
119
|
-
flatMap: {};
|
|
120
|
-
flat: {};
|
|
121
|
-
at: {};
|
|
122
|
-
findLast: {};
|
|
123
|
-
findLastIndex: {};
|
|
124
|
-
toReversed: {};
|
|
125
|
-
toSorted: {};
|
|
126
|
-
toSpliced: {};
|
|
127
|
-
with: {};
|
|
128
|
-
[Symbol.iterator]: {};
|
|
129
|
-
readonly [Symbol.unscopables]: {
|
|
130
|
-
readonly [x: number]: boolean | undefined;
|
|
131
|
-
readonly length?: boolean | undefined;
|
|
132
|
-
toString?: boolean | undefined;
|
|
133
|
-
toLocaleString?: boolean | undefined;
|
|
134
|
-
concat?: boolean | undefined;
|
|
135
|
-
join?: boolean | undefined;
|
|
136
|
-
slice?: boolean | undefined;
|
|
137
|
-
indexOf?: boolean | undefined;
|
|
138
|
-
lastIndexOf?: boolean | undefined;
|
|
139
|
-
every?: boolean | undefined;
|
|
140
|
-
some?: boolean | undefined;
|
|
141
|
-
forEach?: boolean | undefined;
|
|
142
|
-
map?: boolean | undefined;
|
|
143
|
-
filter?: boolean | undefined;
|
|
144
|
-
reduce?: boolean | undefined;
|
|
145
|
-
reduceRight?: boolean | undefined;
|
|
146
|
-
find?: boolean | undefined;
|
|
147
|
-
findIndex?: boolean | undefined;
|
|
148
|
-
entries?: boolean | undefined;
|
|
149
|
-
keys?: boolean | undefined;
|
|
150
|
-
values?: boolean | undefined;
|
|
151
|
-
includes?: boolean | undefined;
|
|
152
|
-
flatMap?: boolean | undefined;
|
|
153
|
-
flat?: boolean | undefined;
|
|
154
|
-
at?: boolean | undefined;
|
|
155
|
-
findLast?: boolean | undefined;
|
|
156
|
-
findLastIndex?: boolean | undefined;
|
|
157
|
-
toReversed?: boolean | undefined;
|
|
158
|
-
toSorted?: boolean | undefined;
|
|
159
|
-
toSpliced?: boolean | undefined;
|
|
160
|
-
with?: boolean | undefined;
|
|
161
|
-
[Symbol.iterator]?: boolean | undefined;
|
|
162
|
-
readonly [Symbol.unscopables]?: boolean | undefined;
|
|
163
|
-
};
|
|
164
|
-
} | undefined;
|
|
165
|
-
readonly outputs?: {
|
|
166
|
-
readonly [x: number]: {
|
|
167
|
-
readonly name?: string | undefined;
|
|
168
|
-
readonly indexed?: boolean | undefined;
|
|
169
|
-
readonly type?: string | undefined;
|
|
170
|
-
readonly internalType?: string | undefined;
|
|
171
|
-
readonly components?: any | undefined;
|
|
172
|
-
};
|
|
173
|
-
readonly length: number;
|
|
174
|
-
toString: {};
|
|
175
|
-
toLocaleString: {};
|
|
176
|
-
concat: {};
|
|
177
|
-
join: {};
|
|
178
|
-
slice: {};
|
|
179
|
-
indexOf: {};
|
|
180
|
-
lastIndexOf: {};
|
|
181
|
-
every: {};
|
|
182
|
-
some: {};
|
|
183
|
-
forEach: {};
|
|
184
|
-
map: {};
|
|
185
|
-
filter: {};
|
|
186
|
-
reduce: {};
|
|
187
|
-
reduceRight: {};
|
|
188
|
-
find: {};
|
|
189
|
-
findIndex: {};
|
|
190
|
-
entries: {};
|
|
191
|
-
keys: {};
|
|
192
|
-
values: {};
|
|
193
|
-
includes: {};
|
|
194
|
-
flatMap: {};
|
|
195
|
-
flat: {};
|
|
196
|
-
at: {};
|
|
197
|
-
findLast: {};
|
|
198
|
-
findLastIndex: {};
|
|
199
|
-
toReversed: {};
|
|
200
|
-
toSorted: {};
|
|
201
|
-
toSpliced: {};
|
|
202
|
-
with: {};
|
|
203
|
-
[Symbol.iterator]: {};
|
|
204
|
-
readonly [Symbol.unscopables]: {
|
|
205
|
-
readonly [x: number]: boolean | undefined;
|
|
206
|
-
readonly length?: boolean | undefined;
|
|
207
|
-
toString?: boolean | undefined;
|
|
208
|
-
toLocaleString?: boolean | undefined;
|
|
209
|
-
concat?: boolean | undefined;
|
|
210
|
-
join?: boolean | undefined;
|
|
211
|
-
slice?: boolean | undefined;
|
|
212
|
-
indexOf?: boolean | undefined;
|
|
213
|
-
lastIndexOf?: boolean | undefined;
|
|
214
|
-
every?: boolean | undefined;
|
|
215
|
-
some?: boolean | undefined;
|
|
216
|
-
forEach?: boolean | undefined;
|
|
217
|
-
map?: boolean | undefined;
|
|
218
|
-
filter?: boolean | undefined;
|
|
219
|
-
reduce?: boolean | undefined;
|
|
220
|
-
reduceRight?: boolean | undefined;
|
|
221
|
-
find?: boolean | undefined;
|
|
222
|
-
findIndex?: boolean | undefined;
|
|
223
|
-
entries?: boolean | undefined;
|
|
224
|
-
keys?: boolean | undefined;
|
|
225
|
-
values?: boolean | undefined;
|
|
226
|
-
includes?: boolean | undefined;
|
|
227
|
-
flatMap?: boolean | undefined;
|
|
228
|
-
flat?: boolean | undefined;
|
|
229
|
-
at?: boolean | undefined;
|
|
230
|
-
findLast?: boolean | undefined;
|
|
231
|
-
findLastIndex?: boolean | undefined;
|
|
232
|
-
toReversed?: boolean | undefined;
|
|
233
|
-
toSorted?: boolean | undefined;
|
|
234
|
-
toSpliced?: boolean | undefined;
|
|
235
|
-
with?: boolean | undefined;
|
|
236
|
-
[Symbol.iterator]?: boolean | undefined;
|
|
237
|
-
readonly [Symbol.unscopables]?: boolean | undefined;
|
|
238
|
-
};
|
|
239
|
-
} | undefined;
|
|
240
|
-
readonly gas?: string | undefined;
|
|
241
|
-
};
|
|
242
|
-
readonly length: number;
|
|
243
|
-
toString: {};
|
|
244
|
-
toLocaleString: {};
|
|
245
|
-
concat: {};
|
|
246
|
-
join: {};
|
|
247
|
-
slice: {};
|
|
248
|
-
indexOf: {};
|
|
249
|
-
lastIndexOf: {};
|
|
250
|
-
every: {};
|
|
251
|
-
some: {};
|
|
252
|
-
forEach: {};
|
|
253
|
-
map: {};
|
|
254
|
-
filter: {};
|
|
255
|
-
reduce: {};
|
|
256
|
-
reduceRight: {};
|
|
257
|
-
find: {};
|
|
258
|
-
findIndex: {};
|
|
259
|
-
entries: {};
|
|
260
|
-
keys: {};
|
|
261
|
-
values: {};
|
|
262
|
-
includes: {};
|
|
263
|
-
flatMap: {};
|
|
264
|
-
flat: {};
|
|
265
|
-
at: {};
|
|
266
|
-
findLast: {};
|
|
267
|
-
findLastIndex: {};
|
|
268
|
-
toReversed: {};
|
|
269
|
-
toSorted: {};
|
|
270
|
-
toSpliced: {};
|
|
271
|
-
with: {};
|
|
272
|
-
[Symbol.iterator]: {};
|
|
273
|
-
readonly [Symbol.unscopables]: {
|
|
274
|
-
readonly [x: number]: boolean | undefined;
|
|
275
|
-
readonly length?: boolean | undefined;
|
|
276
|
-
toString?: boolean | undefined;
|
|
277
|
-
toLocaleString?: boolean | undefined;
|
|
278
|
-
concat?: boolean | undefined;
|
|
279
|
-
join?: boolean | undefined;
|
|
280
|
-
slice?: boolean | undefined;
|
|
281
|
-
indexOf?: boolean | undefined;
|
|
282
|
-
lastIndexOf?: boolean | undefined;
|
|
283
|
-
every?: boolean | undefined;
|
|
284
|
-
some?: boolean | undefined;
|
|
285
|
-
forEach?: boolean | undefined;
|
|
286
|
-
map?: boolean | undefined;
|
|
287
|
-
filter?: boolean | undefined;
|
|
288
|
-
reduce?: boolean | undefined;
|
|
289
|
-
reduceRight?: boolean | undefined;
|
|
290
|
-
find?: boolean | undefined;
|
|
291
|
-
findIndex?: boolean | undefined;
|
|
292
|
-
entries?: boolean | undefined;
|
|
293
|
-
keys?: boolean | undefined;
|
|
294
|
-
values?: boolean | undefined;
|
|
295
|
-
includes?: boolean | undefined;
|
|
296
|
-
flatMap?: boolean | undefined;
|
|
297
|
-
flat?: boolean | undefined;
|
|
298
|
-
at?: boolean | undefined;
|
|
299
|
-
findLast?: boolean | undefined;
|
|
300
|
-
findLastIndex?: boolean | undefined;
|
|
301
|
-
toReversed?: boolean | undefined;
|
|
302
|
-
toSorted?: boolean | undefined;
|
|
303
|
-
toSpliced?: boolean | undefined;
|
|
304
|
-
with?: boolean | undefined;
|
|
305
|
-
[Symbol.iterator]?: boolean | undefined;
|
|
306
|
-
readonly [Symbol.unscopables]?: boolean | undefined;
|
|
307
|
-
};
|
|
308
|
-
};
|
|
309
|
-
}>;
|
|
310
|
-
ephemeralQueryAccountEnabled?: boolean;
|
|
311
|
-
moduleIdentifierTransformers?: _xyo_network_module_model.ModuleIdentifierTransformer[];
|
|
312
|
-
} & {
|
|
313
|
-
providers: ethers.Provider[];
|
|
314
|
-
}>>;
|
|
315
|
-
|
|
316
|
-
export { CryptoContractDiviner, CryptoContractFunctionReadWitness, type CryptoContractFunctionReadWitnessParams, CryptoContractFunctionReadWitnessPlugin, type FindCallResult, CryptoContractFunctionReadWitnessPlugin as default };
|
|
1
|
+
export * from './Diviner/index.ts';
|
|
2
|
+
export { CryptoContractFunctionReadWitnessPlugin, CryptoContractFunctionReadWitnessPlugin as default } from './Plugin.ts';
|
|
3
|
+
export * from './Witness.ts';
|
|
4
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
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/browser/index.mjs
CHANGED
|
@@ -8,7 +8,9 @@ import {
|
|
|
8
8
|
CryptoContractFunctionCallResultSchema
|
|
9
9
|
} from "@xyo-network/crypto-contract-function-read-payload-plugin";
|
|
10
10
|
import { AbstractDiviner } from "@xyo-network/diviner-abstract";
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
isPayloadOfSchemaType
|
|
13
|
+
} from "@xyo-network/payload-model";
|
|
12
14
|
var CryptoContractDiviner = class _CryptoContractDiviner extends AbstractDiviner {
|
|
13
15
|
static configSchemas = [...super.configSchemas, CryptoContractDivinerConfigSchema];
|
|
14
16
|
static defaultConfigSchema = CryptoContractDivinerConfigSchema;
|
|
@@ -76,7 +78,9 @@ import {
|
|
|
76
78
|
CryptoContractFunctionReadWitnessConfigSchema
|
|
77
79
|
} from "@xyo-network/crypto-contract-function-read-payload-plugin";
|
|
78
80
|
import { isPayloadOfSchemaType as isPayloadOfSchemaType2 } from "@xyo-network/payload-model";
|
|
79
|
-
import {
|
|
81
|
+
import {
|
|
82
|
+
Contract
|
|
83
|
+
} from "ethers";
|
|
80
84
|
var CryptoContractFunctionReadWitness = class extends AbstractWitness {
|
|
81
85
|
static configSchemas = [...super.configSchemas, CryptoContractFunctionReadWitnessConfigSchema];
|
|
82
86
|
static defaultConfigSchema = CryptoContractFunctionReadWitnessConfigSchema;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/Diviner/Diviner.ts","../../src/Plugin.ts","../../src/Witness.ts"],"sourcesContent":["import { assertEx } from '@xylabs/assert'\nimport type { Promisable } from '@xylabs/promise'\nimport type {\n ContractInfo,\n CryptoContractDivinerParams,\n CryptoContractFunctionCallResult,\n} from '@xyo-network/crypto-contract-function-read-payload-plugin'\nimport {\n asCryptoContractFunctionCallSuccess,\n ContractInfoSchema,\n CryptoContractDivinerConfigSchema,\n CryptoContractDivinerLabels,\n CryptoContractFunctionCallResultSchema,\n} from '@xyo-network/crypto-contract-function-read-payload-plugin'\nimport { AbstractDiviner } from '@xyo-network/diviner-abstract'\nimport type { Payload, Schema } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } 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 readonly 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\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 type { JsonObject } from '@xylabs/object'\nimport { AbstractWitness } from '@xyo-network/abstract-witness'\nimport type {\n CryptoContractFunctionCall,\n CryptoContractFunctionCallFailure,\n CryptoContractFunctionCallResult,\n CryptoContractFunctionCallSuccess,\n CryptoContractFunctionReadWitnessConfig,\n} from '@xyo-network/crypto-contract-function-read-payload-plugin'\nimport {\n CryptoContractFunctionCallResultSchema,\n CryptoContractFunctionCallSchema,\n CryptoContractFunctionReadWitnessConfigSchema,\n} from '@xyo-network/crypto-contract-function-read-payload-plugin'\nimport type { AnyConfigSchema } from '@xyo-network/module-model'\nimport type { Schema } from '@xyo-network/payload-model'\nimport { isPayloadOfSchemaType } from '@xyo-network/payload-model'\nimport type { WitnessParams } from '@xyo-network/witness-model'\nimport type { InterfaceAbi, Provider } from 'ethers'\nimport { Contract } 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') as InterfaceAbi\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<CryptoContractFunctionCall>(CryptoContractFunctionCallSchema)).map(async ({\n functionName, args, address,\n }) => {\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 ?? [])] as JsonObject[]\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,SAAS,gBAAgB;AAOzB;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,uBAAuB;AAEhC,SAAS,6BAA6B;AAM/B,IAAM,wBAAN,MAAM,+BAAyG,gBAAyB;AAAA,EAC7I,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,iCAAiC;AAAA,EAC7G,OAAyB,sBAA8B;AAAA,EACvD,OAAyB,SAAsC,EAAE,GAAG,MAAM,QAAQ,GAAG,4BAA4B;AAAA,EAEjH,OAAiB,eACf,SACA,cACA,UACqB;AACrB,UAAM,eAAe,SAAS,KAAK,aAAW,QAAQ,iBAAiB,gBAAgB,QAAQ,YAAY,OAAO;AAClH,WAAO,oCAAoC,YAAY,GAAG;AAAA,EAC5D;AAAA,EAEA,OA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,SAAS,QAAQ,MAAM,SAAS,WAAW,GAAG,OAAO;AAAA,cACrD,cAAc;AAAA,cACd,QAAQ;AAAA,cACR,QAAQC;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,QAAQA;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;;;ADlFO,IAAM,0CAA0C,MAErD;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,SAAS,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EACzD;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,kCAAkC,OAAO,MAAM;AACpE,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["result","assertEx","CryptoContractFunctionCallResultSchema","isPayloadOfSchemaType"]}
|
|
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 {\n isPayloadOfSchemaType, Payload, Schema,\n} 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 readonly 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\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 { JsonObject } from '@xylabs/object'\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 {\n Contract, InterfaceAbi, Provider,\n} 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') as InterfaceAbi\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<CryptoContractFunctionCall>(CryptoContractFunctionCallSchema)).map(async ({\n functionName, args, address,\n }) => {\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 ?? [])] as JsonObject[]\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,SAAS,gBAAgB;AAEzB;AAAA,EACE;AAAA,EAEA;AAAA,EACA;AAAA,EACA;AAAA,EAGA;AAAA,OACK;AACP,SAAS,uBAAuB;AAChC;AAAA,EACE;AAAA,OACK;AAMA,IAAM,wBAAN,MAAM,+BAAyG,gBAAyB;AAAA,EAC7I,OAAyB,gBAA0B,CAAC,GAAG,MAAM,eAAe,iCAAiC;AAAA,EAC7G,OAAyB,sBAA8B;AAAA,EACvD,OAAyB,SAAsC,EAAE,GAAG,MAAM,QAAQ,GAAG,4BAA4B;AAAA,EAEjH,OAAiB,eACf,SACA,cACA,UACqB;AACrB,UAAM,eAAe,SAAS,KAAK,aAAW,QAAQ,iBAAiB,gBAAgB,QAAQ,YAAY,OAAO;AAClH,WAAO,oCAAoC,YAAY,GAAG;AAAA,EAC5D;AAAA,EAEA,OAAiB,sBAA+D,MAAW,OAA+B;AACxH,UAAM,gBAAgB,KAAK,GAAG,CAAC,IAAI,KAAK;AAExC,UAAM,cAAc,KAAK,OAAO,CAAC,MAAM,QAAQ;AAC7C,aAAO,QAAQ,IAAI,KAAK,MAAM;AAAA,IAChC,GAAG,KAAK;AACR,WAAO,cAAc,SAAY;AAAA,EACnC;AAAA,EAEU,2BAA2B,aAA+D;AAClG,WAAO;AAAA,MACL,SAAS,SAAS,uBAAsB,sBAAsB,aAAa,SAAS,GAAG,MAAM,oBAAoB;AAAA,MACjH,SAAS,SAAS,uBAAsB,sBAAsB,aAAa,SAAS,GAAG,MAAM,oBAAoB;AAAA,MACjH,QAAQ;AAAA,IACV;AAAA,EACF;AAAA,EAEA,MAAyB,cAAc,aAAiD,CAAC,GAA4B;AACnH,UAA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,YAAM,QAAQ;AACd,cAAQ,IAAI,UAAU,KAAK,OAAO,IAAI,MAAM,MAAM,OAAO,EAAE;AAC3D,YAAM;AAAA,IACR;AAAA,EACF;AACF;;;ADhFO,IAAM,0CAA0C,MAErD;AAAA,EACE,EAAE,UAAU,EAAE,CAAC,SAAS,GAAG,EAAE,GAAG,QAAQ,iBAAiB;AAAA,EACzD;AAAA,IACE,SAAS,OAAO,WAAW;AACzB,YAAM,SAAS,MAAM,kCAAkC,OAAO,MAAM;AACpE,aAAO;AAAA,IACT;AAAA,EACF;AACF;","names":["result","assertEx","CryptoContractFunctionCallResultSchema","isPayloadOfSchemaType"]}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { Promisable } from '@xylabs/promise';
|
|
2
|
+
import { ContractInfo, CryptoContractDivinerLabels, CryptoContractDivinerParams, CryptoContractFunctionCallResult } from '@xyo-network/crypto-contract-function-read-payload-plugin';
|
|
3
|
+
import { AbstractDiviner } from '@xyo-network/diviner-abstract';
|
|
4
|
+
import { Payload, Schema } from '@xyo-network/payload-model';
|
|
5
|
+
/** @deprecated use EvmCallDiviner instead */
|
|
6
|
+
export type FindCallResult<TResult = string, TPayload = Payload> = [TResult, TPayload] | [undefined, TPayload] | [undefined, undefined];
|
|
7
|
+
/** @deprecated use EvmCallDiviner instead */
|
|
8
|
+
export declare class CryptoContractDiviner<TParams extends CryptoContractDivinerParams = CryptoContractDivinerParams> extends AbstractDiviner<TParams> {
|
|
9
|
+
static readonly configSchemas: Schema[];
|
|
10
|
+
static readonly defaultConfigSchema: Schema;
|
|
11
|
+
static readonly labels: CryptoContractDivinerLabels;
|
|
12
|
+
protected static findCallResult<TResult = string>(address: string, functionName: string, payloads: CryptoContractFunctionCallResult[]): TResult | undefined;
|
|
13
|
+
protected static matchingExistingField<R = string, T extends Payload = Payload>(objs: T[], field: keyof T): R | undefined;
|
|
14
|
+
protected contractInfoRequiredFields(callResults: CryptoContractFunctionCallResult[]): ContractInfo;
|
|
15
|
+
protected divineHandler(inPayloads?: CryptoContractFunctionCallResult[]): Promise<ContractInfo[]>;
|
|
16
|
+
protected reduceResults(callResults: CryptoContractFunctionCallResult[]): Promisable<ContractInfo['results']>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=Diviner.d.ts.map
|
|
@@ -0,0 +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,EACkB,OAAO,EAAE,MAAM,EACvC,MAAM,4BAA4B,CAAA;AAEnC,6CAA6C;AAC7C,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;AAEvI,6CAA6C;AAC7C,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,gBAAyB,MAAM,EAAE,2BAA2B,CAAsD;IAElH,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,EAAE,KAAK,EAAE,MAAM,CAAC,GAAG,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/Diviner/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAA"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { CryptoContractFunctionReadWitness } from './Witness.ts';
|
|
2
|
+
/** @deprecated use EvmCallWitness instead */
|
|
3
|
+
export declare const CryptoContractFunctionReadWitnessPlugin: () => import("@xyo-network/payloadset-plugin").PayloadSetWitnessPlugin<CryptoContractFunctionReadWitness<import("@xylabs/object").BaseParamsFields & {
|
|
4
|
+
account?: import(".store/@xyo-network-account-model-virtual-26592e0d6e/package").AccountInstance | "random";
|
|
5
|
+
addToResolvers?: boolean;
|
|
6
|
+
additionalSigners?: import(".store/@xyo-network-account-model-virtual-26592e0d6e/package").AccountInstance[];
|
|
7
|
+
allowNameResolution?: boolean;
|
|
8
|
+
config: import("@xyo-network/module-model").AnyConfigSchema<import("@xyo-network/crypto-contract-function-read-payload-plugin").CryptoContractFunctionReadWitnessConfig>;
|
|
9
|
+
ephemeralQueryAccountEnabled?: boolean;
|
|
10
|
+
moduleIdentifierTransformers?: import("@xyo-network/module-model").ModuleIdentifierTransformer[];
|
|
11
|
+
privateChildren?: import("@xyo-network/module-model").ModuleInstance[];
|
|
12
|
+
publicChildren?: import("@xyo-network/module-model").ModuleInstance[];
|
|
13
|
+
} & {
|
|
14
|
+
providers: import("ethers").Provider[];
|
|
15
|
+
}>>;
|
|
16
|
+
//# sourceMappingURL=Plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Plugin.d.ts","sourceRoot":"","sources":["../../src/Plugin.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,iCAAiC,EAAE,MAAM,cAAc,CAAA;AAEhE,6CAA6C;AAC7C,eAAO,MAAM,uCAAuC;;;;;;;;;;;;GAUjD,CAAA"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AbstractWitness } from '@xyo-network/abstract-witness';
|
|
2
|
+
import { CryptoContractFunctionCall, CryptoContractFunctionCallResult, CryptoContractFunctionReadWitnessConfig } from '@xyo-network/crypto-contract-function-read-payload-plugin';
|
|
3
|
+
import { AnyConfigSchema } from '@xyo-network/module-model';
|
|
4
|
+
import { Schema } from '@xyo-network/payload-model';
|
|
5
|
+
import { WitnessParams } from '@xyo-network/witness-model';
|
|
6
|
+
import { InterfaceAbi, Provider } from 'ethers';
|
|
7
|
+
/** @deprecated use EvmCallWitness instead */
|
|
8
|
+
export type CryptoContractFunctionReadWitnessParams = WitnessParams<AnyConfigSchema<CryptoContractFunctionReadWitnessConfig>, {
|
|
9
|
+
providers: Provider[];
|
|
10
|
+
}>;
|
|
11
|
+
/** @deprecated use EvmCallWitness instead */
|
|
12
|
+
export declare class CryptoContractFunctionReadWitness<TParams extends CryptoContractFunctionReadWitnessParams = CryptoContractFunctionReadWitnessParams> extends AbstractWitness<TParams, CryptoContractFunctionCall, CryptoContractFunctionCallResult> {
|
|
13
|
+
static readonly configSchemas: Schema[];
|
|
14
|
+
static readonly defaultConfigSchema: Schema;
|
|
15
|
+
get abi(): InterfaceAbi;
|
|
16
|
+
protected observeHandler(inPayloads?: CryptoContractFunctionCall[]): Promise<CryptoContractFunctionCallResult[]>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=Witness.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Witness.d.ts","sourceRoot":"","sources":["../../src/Witness.ts"],"names":[],"mappings":"AAEA,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,EACK,YAAY,EAAE,QAAQ,EACjC,MAAM,QAAQ,CAAA;AAEf,6CAA6C;AAC7C,MAAM,MAAM,uCAAuC,GAAG,aAAa,CACjE,eAAe,CAAC,uCAAuC,CAAC,EACxD;IACE,SAAS,EAAE,QAAQ,EAAE,CAAA;CACtB,CACF,CAAA;AAED,6CAA6C;AAC7C,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,IACoD,YAAY,CACtE;cAEwB,cAAc,CAAC,UAAU,GAAE,0BAA0B,EAAO,GAAG,OAAO,CAAC,gCAAgC,EAAE,CAAC;CAgDpI"}
|