@sentio/sdk 2.40.0-rc.5 → 2.40.0-rc.7

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.
Files changed (81) hide show
  1. package/lib/aptos/builtin/0x1.js +10 -11
  2. package/lib/aptos/builtin/0x3.js +11 -12
  3. package/lib/aptos/builtin/index.js +11 -12
  4. package/lib/aptos/codegen/index.js +3 -4
  5. package/lib/aptos/ext/index.js +10 -11
  6. package/lib/aptos/index.js +10 -11
  7. package/lib/{chunk-VP6Y633M.js → chunk-2NGFZ42P.js} +78 -5
  8. package/lib/chunk-2QEQTKQY.js +1050 -0
  9. package/lib/{chunk-QHHXY7LO.js → chunk-5XM56ENY.js} +5 -5
  10. package/lib/{chunk-RX5G4RN2.js → chunk-7NFMED3E.js} +2 -2
  11. package/lib/{chunk-KA5CLZU6.js → chunk-7NWX3CH7.js} +90 -53
  12. package/lib/{chunk-F2IZC2B6.js → chunk-EMF4HXFG.js} +5 -5
  13. package/lib/chunk-K5OSTLHI.js +916 -0
  14. package/lib/{chunk-WLLDVQFE.js → chunk-KO4GSZCM.js} +3 -3
  15. package/lib/chunk-KTAUVRJN.js +1910 -0
  16. package/lib/{chunk-2QVJGMW4.js → chunk-KVB555XD.js} +2 -2
  17. package/lib/{chunk-TDPQO2SX.js → chunk-LICAL3XW.js} +2 -2
  18. package/lib/{chunk-NBZRHB5V.js → chunk-MWZAET2D.js} +5 -5
  19. package/lib/{chunk-6DDG76PU.js → chunk-P6T5WFAZ.js} +4 -4
  20. package/lib/{chunk-Z7QWETBQ.js → chunk-Q7BI45Z7.js} +2 -2
  21. package/lib/chunk-QKJ5SWA2.js +861 -0
  22. package/lib/{chunk-VJTNBZMU.js → chunk-QTWMU7GQ.js} +1 -1
  23. package/lib/{chunk-OAIP7J4S.js → chunk-RXO7SOTL.js} +2757 -1157
  24. package/lib/{chunk-S727P6WP.js → chunk-SYEQKTIU.js} +1 -1
  25. package/lib/{chunk-7OBRGY7G.js → chunk-YNJXNOVA.js} +2 -2
  26. package/lib/{chunk-N4OQDWM2.js → chunk-YOLIZKGZ.js} +1 -1
  27. package/lib/{chunk-USETTWR7.js → chunk-Z5PQR6UE.js} +100 -54
  28. package/lib/core/index.js +3 -3
  29. package/lib/{eacaggregatorproxy-aed46d4a.d.ts → eacaggregatorproxy-cb8e39be.d.ts} +76 -24
  30. package/lib/{erc1155-80a76eb5.d.ts → erc1155-fb097c50.d.ts} +31 -9
  31. package/lib/{erc20-39aae019.d.ts → erc20-95ba7721.d.ts} +61 -19
  32. package/lib/{erc721-0a429bd4.d.ts → erc721-13bf7a61.d.ts} +49 -15
  33. package/lib/eth/builtin/eacaggregatorproxy.d.ts +1 -1
  34. package/lib/eth/builtin/eacaggregatorproxy.js +5 -5
  35. package/lib/eth/builtin/erc1155.d.ts +1 -1
  36. package/lib/eth/builtin/erc1155.js +5 -5
  37. package/lib/eth/builtin/erc20.d.ts +1 -1
  38. package/lib/eth/builtin/erc20.js +4 -4
  39. package/lib/eth/builtin/erc721.d.ts +1 -1
  40. package/lib/eth/builtin/erc721.js +4 -4
  41. package/lib/eth/builtin/index.d.ts +39 -15
  42. package/lib/eth/builtin/index.js +8 -8
  43. package/lib/eth/builtin/weth9.d.ts +1 -1
  44. package/lib/eth/builtin/weth9.js +5 -5
  45. package/lib/eth/codegen/index.js +190 -10492
  46. package/lib/eth/index.d.ts +1 -0
  47. package/lib/eth/index.js +7 -4
  48. package/lib/fuel/index.js +4 -4
  49. package/lib/index.js +5 -3
  50. package/lib/move/index.js +4 -4
  51. package/lib/solana/builtin/index.js +4 -4
  52. package/lib/solana/index.js +4 -4
  53. package/lib/store/index.js +3 -3
  54. package/lib/sui/builtin/0x1.js +12 -12
  55. package/lib/sui/builtin/0x2.js +13 -13
  56. package/lib/sui/builtin/0x3.js +14 -14
  57. package/lib/sui/builtin/index.js +14 -14
  58. package/lib/sui/codegen/index.js +2 -2
  59. package/lib/sui/ext/index.js +10 -10
  60. package/lib/sui/index.js +11 -11
  61. package/lib/testing/index.js +14 -15
  62. package/lib/utils/index.js +7 -7
  63. package/lib/{weth9-08664cb7.d.ts → weth9-2b52cb06.d.ts} +40 -12
  64. package/package.json +1 -1
  65. package/src/bundle.config.ts +1 -1
  66. package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +1446 -115
  67. package/src/eth/builtin/internal/erc1155-processor.ts +611 -34
  68. package/src/eth/builtin/internal/erc20-processor.ts +1182 -84
  69. package/src/eth/builtin/internal/erc20bytes-processor.ts +595 -45
  70. package/src/eth/builtin/internal/erc721-processor.ts +967 -64
  71. package/src/eth/builtin/internal/weth9-processor.ts +698 -55
  72. package/src/eth/codegen/file.ts +26 -3
  73. package/src/eth/codegen/function-calls.ts +93 -8
  74. package/src/eth/codegen/types.ts +22 -1
  75. package/src/eth/eth-plugin.ts +4 -4
  76. package/src/eth/index.ts +2 -0
  77. package/lib/chunk-76HTCT5F.js +0 -469
  78. package/lib/chunk-ERTIHPSD.js +0 -528
  79. package/lib/chunk-LWKILLQ6.js +0 -820
  80. package/lib/chunk-S36AAZOU.js +0 -417
  81. package/lib/chunk-UHPXAMY7.js +0 -85
@@ -1,469 +0,0 @@
1
- import { createRequire as createRequireSdkShim } from 'module'; const require = createRequireSdkShim(import.meta.url);
2
- import {
3
- BaseProcessor,
4
- BaseProcessorTemplate,
5
- BoundContractView,
6
- ContractView,
7
- DummyProvider,
8
- ERC1155__factory,
9
- addContractByABI,
10
- addProcessor,
11
- getContractByABI,
12
- getProcessor,
13
- getProvider,
14
- import_chain,
15
- transformEtherError
16
- } from "./chunk-OAIP7J4S.js";
17
- import {
18
- __export,
19
- __publicField
20
- } from "./chunk-AXRHIURD.js";
21
-
22
- // src/eth/builtin/erc1155.ts
23
- var erc1155_exports = {};
24
- __export(erc1155_exports, {
25
- ERC1155BoundContractView: () => ERC1155BoundContractView,
26
- ERC1155ContractView: () => ERC1155ContractView,
27
- ERC1155Processor: () => ERC1155Processor,
28
- ERC1155ProcessorTemplate: () => ERC1155ProcessorTemplate,
29
- ERC1155__factory: () => ERC1155__factory,
30
- getERC1155Contract: () => getERC1155Contract,
31
- getERC1155ContractOnContext: () => getERC1155ContractOnContext,
32
- mockApprovalForAllLog: () => mockApprovalForAllLog,
33
- mockTransferBatchLog: () => mockTransferBatchLog,
34
- mockTransferSingleLog: () => mockTransferSingleLog,
35
- mockURILog: () => mockURILog
36
- });
37
-
38
- // src/eth/builtin/internal/erc1155-processor.ts
39
- var templateContract = ERC1155__factory.connect("0x0", DummyProvider);
40
- var ERC1155ContractView = class extends ContractView {
41
- constructor(contract) {
42
- super(contract);
43
- this.callStatic.contract = contract;
44
- }
45
- async balanceOf(account, id, overrides) {
46
- try {
47
- return await this.contract.getFunction("balanceOf(address,uint256)")(
48
- account,
49
- id,
50
- overrides || {}
51
- );
52
- } catch (e) {
53
- const stack = new Error().stack;
54
- throw transformEtherError(e, void 0, stack);
55
- }
56
- }
57
- async balanceOfBatch(accounts, ids, overrides) {
58
- try {
59
- return await this.contract.getFunction(
60
- "balanceOfBatch(address[],uint256[])"
61
- )(accounts, ids, overrides || {});
62
- } catch (e) {
63
- const stack = new Error().stack;
64
- throw transformEtherError(e, void 0, stack);
65
- }
66
- }
67
- async isApprovedForAll(account, operator, overrides) {
68
- try {
69
- return await this.contract.getFunction(
70
- "isApprovedForAll(address,address)"
71
- )(account, operator, overrides || {});
72
- } catch (e) {
73
- const stack = new Error().stack;
74
- throw transformEtherError(e, void 0, stack);
75
- }
76
- }
77
- async supportsInterface(interfaceId, overrides) {
78
- try {
79
- return await this.contract.getFunction("supportsInterface(bytes4)")(
80
- interfaceId,
81
- overrides || {}
82
- );
83
- } catch (e) {
84
- const stack = new Error().stack;
85
- throw transformEtherError(e, void 0, stack);
86
- }
87
- }
88
- async uri(id, overrides) {
89
- try {
90
- return await this.contract.getFunction("uri(uint256)")(
91
- id,
92
- overrides || {}
93
- );
94
- } catch (e) {
95
- const stack = new Error().stack;
96
- throw transformEtherError(e, void 0, stack);
97
- }
98
- }
99
- callStatic = {
100
- contract: this.contract,
101
- async safeBatchTransferFrom(from, to, ids, amounts, data, overrides) {
102
- try {
103
- return await this.contract.getFunction(
104
- "safeBatchTransferFrom(address,address,uint256[],uint256[],bytes)"
105
- ).staticCall(from, to, ids, amounts, data, overrides || {});
106
- } catch (e) {
107
- const stack = new Error().stack;
108
- throw transformEtherError(e, void 0, stack);
109
- }
110
- },
111
- async safeTransferFrom(from, to, id, amount, data, overrides) {
112
- try {
113
- return await this.contract.getFunction(
114
- "safeTransferFrom(address,address,uint256,uint256,bytes)"
115
- ).staticCall(from, to, id, amount, data, overrides || {});
116
- } catch (e) {
117
- const stack = new Error().stack;
118
- throw transformEtherError(e, void 0, stack);
119
- }
120
- },
121
- async setApprovalForAll(operator, approved, overrides) {
122
- try {
123
- return await this.contract.getFunction("setApprovalForAll(address,bool)").staticCall(operator, approved, overrides || {});
124
- } catch (e) {
125
- const stack = new Error().stack;
126
- throw transformEtherError(e, void 0, stack);
127
- }
128
- }
129
- };
130
- };
131
- var ERC1155BoundContractView = class extends BoundContractView {
132
- async balanceOf(account, id, overrides) {
133
- return await this.view.balanceOf(account, id, {
134
- blockTag: this.context.blockNumber,
135
- ...overrides
136
- });
137
- }
138
- async balanceOfBatch(accounts, ids, overrides) {
139
- return await this.view.balanceOfBatch(accounts, ids, {
140
- blockTag: this.context.blockNumber,
141
- ...overrides
142
- });
143
- }
144
- async isApprovedForAll(account, operator, overrides) {
145
- return await this.view.isApprovedForAll(account, operator, {
146
- blockTag: this.context.blockNumber,
147
- ...overrides
148
- });
149
- }
150
- async supportsInterface(interfaceId, overrides) {
151
- return await this.view.supportsInterface(interfaceId, {
152
- blockTag: this.context.blockNumber,
153
- ...overrides
154
- });
155
- }
156
- async uri(id, overrides) {
157
- return await this.view.uri(id, {
158
- blockTag: this.context.blockNumber,
159
- ...overrides
160
- });
161
- }
162
- callStatic = {
163
- view: this.view,
164
- context: this.context,
165
- async safeBatchTransferFrom(from, to, ids, amounts, data, overrides) {
166
- return await this.view.callStatic.safeBatchTransferFrom(
167
- from,
168
- to,
169
- ids,
170
- amounts,
171
- data,
172
- {
173
- blockTag: this.context.blockNumber,
174
- ...overrides
175
- }
176
- );
177
- },
178
- async safeTransferFrom(from, to, id, amount, data, overrides) {
179
- return await this.view.callStatic.safeTransferFrom(
180
- from,
181
- to,
182
- id,
183
- amount,
184
- data,
185
- {
186
- blockTag: this.context.blockNumber,
187
- ...overrides
188
- }
189
- );
190
- },
191
- async setApprovalForAll(operator, approved, overrides) {
192
- return await this.view.callStatic.setApprovalForAll(operator, approved, {
193
- blockTag: this.context.blockNumber,
194
- ...overrides
195
- });
196
- }
197
- };
198
- };
199
- var _ERC1155Processor = class extends BaseProcessor {
200
- onEventApprovalForAll(handler, filter, fetchConfig, preprocessHandler) {
201
- if (!filter) {
202
- filter = templateContract.filters["ApprovalForAll(address,address,bool)"](
203
- null,
204
- null,
205
- null
206
- );
207
- }
208
- return super.onEthEvent(handler, filter, fetchConfig, preprocessHandler);
209
- }
210
- onEventTransferBatch(handler, filter, fetchConfig, preprocessHandler) {
211
- if (!filter) {
212
- filter = templateContract.filters["TransferBatch(address,address,address,uint256[],uint256[])"](null, null, null, null, null);
213
- }
214
- return super.onEthEvent(handler, filter, fetchConfig, preprocessHandler);
215
- }
216
- onEventTransferSingle(handler, filter, fetchConfig, preprocessHandler) {
217
- if (!filter) {
218
- filter = templateContract.filters["TransferSingle(address,address,address,uint256,uint256)"](null, null, null, null, null);
219
- }
220
- return super.onEthEvent(handler, filter, fetchConfig, preprocessHandler);
221
- }
222
- onEventURI(handler, filter, fetchConfig, preprocessHandler) {
223
- if (!filter) {
224
- filter = templateContract.filters["URI(string,uint256)"](null, null);
225
- }
226
- return super.onEthEvent(handler, filter, fetchConfig, preprocessHandler);
227
- }
228
- onCallBalanceOf(handler, fetchConfig, preprocessHandler) {
229
- return super.onEthTrace(
230
- "0x00fdd58e",
231
- handler,
232
- fetchConfig,
233
- preprocessHandler
234
- );
235
- }
236
- onCallBalanceOfBatch(handler, fetchConfig, preprocessHandler) {
237
- return super.onEthTrace(
238
- "0x4e1273f4",
239
- handler,
240
- fetchConfig,
241
- preprocessHandler
242
- );
243
- }
244
- onCallIsApprovedForAll(handler, fetchConfig, preprocessHandler) {
245
- return super.onEthTrace(
246
- "0xe985e9c5",
247
- handler,
248
- fetchConfig,
249
- preprocessHandler
250
- );
251
- }
252
- onCallSafeBatchTransferFrom(handler, fetchConfig, preprocessHandler) {
253
- return super.onEthTrace(
254
- "0x2eb2c2d6",
255
- handler,
256
- fetchConfig,
257
- preprocessHandler
258
- );
259
- }
260
- onCallSafeTransferFrom(handler, fetchConfig, preprocessHandler) {
261
- return super.onEthTrace(
262
- "0xf242432a",
263
- handler,
264
- fetchConfig,
265
- preprocessHandler
266
- );
267
- }
268
- onCallSetApprovalForAll(handler, fetchConfig, preprocessHandler) {
269
- return super.onEthTrace(
270
- "0xa22cb465",
271
- handler,
272
- fetchConfig,
273
- preprocessHandler
274
- );
275
- }
276
- onCallSupportsInterface(handler, fetchConfig, preprocessHandler) {
277
- return super.onEthTrace(
278
- "0x01ffc9a7",
279
- handler,
280
- fetchConfig,
281
- preprocessHandler
282
- );
283
- }
284
- onCallUri(handler, fetchConfig, preprocessHandler) {
285
- return super.onEthTrace(
286
- "0x0e89341c",
287
- handler,
288
- fetchConfig,
289
- preprocessHandler
290
- );
291
- }
292
- CreateBoundContractView() {
293
- const view = getERC1155Contract(this.config.network, this.config.address);
294
- return new ERC1155BoundContractView(this.config.address, view);
295
- }
296
- static bind(options) {
297
- if (!options.name) {
298
- options.name = "ERC1155";
299
- }
300
- let processor = getProcessor(options);
301
- if (!processor) {
302
- processor = new _ERC1155Processor(options);
303
- addProcessor(options, processor);
304
- }
305
- return processor;
306
- }
307
- };
308
- var ERC1155Processor = _ERC1155Processor;
309
- __publicField(ERC1155Processor, "filters", {
310
- ApprovalForAll(account, operator, approved) {
311
- return templateContract.filters["ApprovalForAll(address,address,bool)"](
312
- account,
313
- operator,
314
- approved
315
- );
316
- },
317
- TransferBatch(operator, from, to, ids, values) {
318
- return templateContract.filters["TransferBatch(address,address,address,uint256[],uint256[])"](operator, from, to, ids, values);
319
- },
320
- TransferSingle(operator, from, to, id, value) {
321
- return templateContract.filters["TransferSingle(address,address,address,uint256,uint256)"](operator, from, to, id, value);
322
- },
323
- URI(value, id) {
324
- return templateContract.filters["URI(string,uint256)"](value, id);
325
- }
326
- });
327
- var ERC1155ProcessorTemplate = class extends BaseProcessorTemplate {
328
- bindInternal(options) {
329
- if (!options.name) {
330
- options.name = "ERC1155";
331
- }
332
- let processor = getProcessor(options);
333
- if (!processor) {
334
- processor = new ERC1155Processor(options);
335
- addProcessor(options, processor);
336
- }
337
- return processor;
338
- }
339
- onEventApprovalForAll(handler, filter, fetchConfig, preprocessHandler) {
340
- if (!filter) {
341
- filter = templateContract.filters["ApprovalForAll(address,address,bool)"](
342
- null,
343
- null,
344
- null
345
- );
346
- }
347
- return super.onEthEvent(handler, filter, fetchConfig, preprocessHandler);
348
- }
349
- onEventTransferBatch(handler, filter, fetchConfig, preprocessHandler) {
350
- if (!filter) {
351
- filter = templateContract.filters["TransferBatch(address,address,address,uint256[],uint256[])"](null, null, null, null, null);
352
- }
353
- return super.onEthEvent(handler, filter, fetchConfig, preprocessHandler);
354
- }
355
- onEventTransferSingle(handler, filter, fetchConfig, preprocessHandler) {
356
- if (!filter) {
357
- filter = templateContract.filters["TransferSingle(address,address,address,uint256,uint256)"](null, null, null, null, null);
358
- }
359
- return super.onEthEvent(handler, filter, fetchConfig, preprocessHandler);
360
- }
361
- onEventURI(handler, filter, fetchConfig, preprocessHandler) {
362
- if (!filter) {
363
- filter = templateContract.filters["URI(string,uint256)"](null, null);
364
- }
365
- return super.onEthEvent(handler, filter, fetchConfig, preprocessHandler);
366
- }
367
- };
368
- function getERC1155Contract(chainId, address) {
369
- let contract = getContractByABI(
370
- "ERC1155",
371
- address,
372
- chainId
373
- );
374
- if (!contract) {
375
- const rawContract = ERC1155__factory.connect(address, getProvider(chainId));
376
- contract = new ERC1155ContractView(rawContract);
377
- addContractByABI("ERC1155", address, chainId, contract);
378
- }
379
- return contract;
380
- }
381
- function getERC1155ContractOnContext(context, address) {
382
- const view = getERC1155Contract(context.getChainId(), address);
383
- const boundView = new ERC1155BoundContractView(address, view);
384
- boundView.context = context;
385
- if (boundView.callStatic) {
386
- boundView.callStatic.context = context;
387
- }
388
- return boundView;
389
- }
390
-
391
- // src/eth/builtin/internal/erc1155-test-utils.ts
392
- var mockField = {
393
- blockHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
394
- blockNumber: 0,
395
- logIndex: 0,
396
- removed: false,
397
- transactionHash: "0x0000000000000000000000000000000000000000000000000000000000000000",
398
- transactionIndex: 0
399
- };
400
- function mockApprovalForAllLog(contractAddress, event) {
401
- const contract = getERC1155Contract(import_chain.EthChainId.ETHEREUM, contractAddress);
402
- const encodedLog = contract.rawContract.interface.encodeEventLog(
403
- "ApprovalForAll(address,address,bool)",
404
- [event.account, event.operator, event.approved]
405
- );
406
- return {
407
- ...mockField,
408
- index: 0,
409
- address: contractAddress,
410
- data: encodedLog.data,
411
- topics: encodedLog.topics
412
- };
413
- }
414
- function mockTransferBatchLog(contractAddress, event) {
415
- const contract = getERC1155Contract(import_chain.EthChainId.ETHEREUM, contractAddress);
416
- const encodedLog = contract.rawContract.interface.encodeEventLog(
417
- "TransferBatch(address,address,address,uint256[],uint256[])",
418
- [event.operator, event.from, event.to, event.ids, event.values]
419
- );
420
- return {
421
- ...mockField,
422
- index: 0,
423
- address: contractAddress,
424
- data: encodedLog.data,
425
- topics: encodedLog.topics
426
- };
427
- }
428
- function mockTransferSingleLog(contractAddress, event) {
429
- const contract = getERC1155Contract(import_chain.EthChainId.ETHEREUM, contractAddress);
430
- const encodedLog = contract.rawContract.interface.encodeEventLog(
431
- "TransferSingle(address,address,address,uint256,uint256)",
432
- [event.operator, event.from, event.to, event.id, event.value]
433
- );
434
- return {
435
- ...mockField,
436
- index: 0,
437
- address: contractAddress,
438
- data: encodedLog.data,
439
- topics: encodedLog.topics
440
- };
441
- }
442
- function mockURILog(contractAddress, event) {
443
- const contract = getERC1155Contract(import_chain.EthChainId.ETHEREUM, contractAddress);
444
- const encodedLog = contract.rawContract.interface.encodeEventLog(
445
- "URI(string,uint256)",
446
- [event.value, event.id]
447
- );
448
- return {
449
- ...mockField,
450
- index: 0,
451
- address: contractAddress,
452
- data: encodedLog.data,
453
- topics: encodedLog.topics
454
- };
455
- }
456
-
457
- export {
458
- ERC1155ContractView,
459
- ERC1155BoundContractView,
460
- ERC1155Processor,
461
- ERC1155ProcessorTemplate,
462
- getERC1155Contract,
463
- getERC1155ContractOnContext,
464
- mockApprovalForAllLog,
465
- mockTransferBatchLog,
466
- mockTransferSingleLog,
467
- mockURILog,
468
- erc1155_exports
469
- };