@sentio/sdk 2.40.0-rc.35 → 2.40.0-rc.37

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 (32) hide show
  1. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.d.ts.map +1 -1
  2. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js +0 -69
  3. package/lib/eth/builtin/internal/eacaggregatorproxy-processor.js.map +1 -1
  4. package/lib/eth/builtin/internal/erc1155-processor.d.ts.map +1 -1
  5. package/lib/eth/builtin/internal/erc1155-processor.js +0 -24
  6. package/lib/eth/builtin/internal/erc1155-processor.js.map +1 -1
  7. package/lib/eth/builtin/internal/erc20-processor.d.ts.map +1 -1
  8. package/lib/eth/builtin/internal/erc20-processor.js +0 -54
  9. package/lib/eth/builtin/internal/erc20-processor.js.map +1 -1
  10. package/lib/eth/builtin/internal/erc20bytes-processor.d.ts.map +1 -1
  11. package/lib/eth/builtin/internal/erc20bytes-processor.js +0 -27
  12. package/lib/eth/builtin/internal/erc20bytes-processor.js.map +1 -1
  13. package/lib/eth/builtin/internal/erc721-processor.d.ts.map +1 -1
  14. package/lib/eth/builtin/internal/erc721-processor.js +0 -42
  15. package/lib/eth/builtin/internal/erc721-processor.js.map +1 -1
  16. package/lib/eth/builtin/internal/weth9-processor.d.ts.map +1 -1
  17. package/lib/eth/builtin/internal/weth9-processor.js +0 -33
  18. package/lib/eth/builtin/internal/weth9-processor.js.map +1 -1
  19. package/lib/eth/codegen/function-calls.d.ts.map +1 -1
  20. package/lib/eth/codegen/function-calls.js +0 -3
  21. package/lib/eth/codegen/function-calls.js.map +1 -1
  22. package/lib/tsup.config.ts +1 -15
  23. package/package.json +6 -3
  24. package/src/bundle.config.ts +22 -0
  25. package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +0 -89
  26. package/src/eth/builtin/internal/erc1155-processor.ts +0 -65
  27. package/src/eth/builtin/internal/erc20-processor.ts +0 -102
  28. package/src/eth/builtin/internal/erc20bytes-processor.ts +0 -46
  29. package/src/eth/builtin/internal/erc721-processor.ts +0 -81
  30. package/src/eth/builtin/internal/weth9-processor.ts +0 -40
  31. package/src/eth/codegen/function-calls.ts +0 -5
  32. package/src/tsup.config.ts +1 -15
@@ -172,16 +172,13 @@ export class ERC721ContractView extends ContractView<ERC721> {
172
172
  context: ethCallContext,
173
173
  calldata,
174
174
  });
175
- console.debug("looking up eth call key:", key);
176
175
  const ret = preparedData.ethCallResults[key];
177
176
  if (ret) {
178
- console.debug("prepared eth call found:", key);
179
177
  const result = iface
180
178
  .decodeFunctionResult("totalSupply", ret)
181
179
  .toArray();
182
180
  return result.length == 1 ? result[0] : result;
183
181
  }
184
- console.debug("missing eth call key:", "totalSupply", key);
185
182
  }
186
183
  return await this.contract.getFunction("totalSupply()")(overrides || {});
187
184
  } catch (e) {
@@ -206,14 +203,11 @@ export class ERC721ContractView extends ContractView<ERC721> {
206
203
  context: ethCallContext,
207
204
  calldata,
208
205
  });
209
- console.debug("looking up eth call key:", key);
210
206
  const ret = preparedData.ethCallResults[key];
211
207
  if (ret) {
212
- console.debug("prepared eth call found:", key);
213
208
  const result = iface.decodeFunctionResult("balanceOf", ret).toArray();
214
209
  return result.length == 1 ? result[0] : result;
215
210
  }
216
- console.debug("missing eth call key:", "balanceOf", owner, key);
217
211
  }
218
212
  return await this.contract.getFunction("balanceOf(address)")(
219
213
  owner,
@@ -241,16 +235,13 @@ export class ERC721ContractView extends ContractView<ERC721> {
241
235
  context: ethCallContext,
242
236
  calldata,
243
237
  });
244
- console.debug("looking up eth call key:", key);
245
238
  const ret = preparedData.ethCallResults[key];
246
239
  if (ret) {
247
- console.debug("prepared eth call found:", key);
248
240
  const result = iface
249
241
  .decodeFunctionResult("getApproved", ret)
250
242
  .toArray();
251
243
  return result.length == 1 ? result[0] : result;
252
244
  }
253
- console.debug("missing eth call key:", "getApproved", tokenId, key);
254
245
  }
255
246
  return await this.contract.getFunction("getApproved(uint256)")(
256
247
  tokenId,
@@ -282,22 +273,13 @@ export class ERC721ContractView extends ContractView<ERC721> {
282
273
  context: ethCallContext,
283
274
  calldata,
284
275
  });
285
- console.debug("looking up eth call key:", key);
286
276
  const ret = preparedData.ethCallResults[key];
287
277
  if (ret) {
288
- console.debug("prepared eth call found:", key);
289
278
  const result = iface
290
279
  .decodeFunctionResult("isApprovedForAll", ret)
291
280
  .toArray();
292
281
  return result.length == 1 ? result[0] : result;
293
282
  }
294
- console.debug(
295
- "missing eth call key:",
296
- "isApprovedForAll",
297
- owner,
298
- operator,
299
- key
300
- );
301
283
  }
302
284
  return await this.contract.getFunction(
303
285
  "isApprovedForAll(address,address)"
@@ -321,14 +303,11 @@ export class ERC721ContractView extends ContractView<ERC721> {
321
303
  context: ethCallContext,
322
304
  calldata,
323
305
  });
324
- console.debug("looking up eth call key:", key);
325
306
  const ret = preparedData.ethCallResults[key];
326
307
  if (ret) {
327
- console.debug("prepared eth call found:", key);
328
308
  const result = iface.decodeFunctionResult("name", ret).toArray();
329
309
  return result.length == 1 ? result[0] : result;
330
310
  }
331
- console.debug("missing eth call key:", "name", key);
332
311
  }
333
312
  return await this.contract.getFunction("name()")(overrides || {});
334
313
  } catch (e) {
@@ -353,14 +332,11 @@ export class ERC721ContractView extends ContractView<ERC721> {
353
332
  context: ethCallContext,
354
333
  calldata,
355
334
  });
356
- console.debug("looking up eth call key:", key);
357
335
  const ret = preparedData.ethCallResults[key];
358
336
  if (ret) {
359
- console.debug("prepared eth call found:", key);
360
337
  const result = iface.decodeFunctionResult("ownerOf", ret).toArray();
361
338
  return result.length == 1 ? result[0] : result;
362
339
  }
363
- console.debug("missing eth call key:", "ownerOf", tokenId, key);
364
340
  }
365
341
  return await this.contract.getFunction("ownerOf(uint256)")(
366
342
  tokenId,
@@ -390,21 +366,13 @@ export class ERC721ContractView extends ContractView<ERC721> {
390
366
  context: ethCallContext,
391
367
  calldata,
392
368
  });
393
- console.debug("looking up eth call key:", key);
394
369
  const ret = preparedData.ethCallResults[key];
395
370
  if (ret) {
396
- console.debug("prepared eth call found:", key);
397
371
  const result = iface
398
372
  .decodeFunctionResult("supportsInterface", ret)
399
373
  .toArray();
400
374
  return result.length == 1 ? result[0] : result;
401
375
  }
402
- console.debug(
403
- "missing eth call key:",
404
- "supportsInterface",
405
- interfaceId,
406
- key
407
- );
408
376
  }
409
377
  return await this.contract.getFunction("supportsInterface(bytes4)")(
410
378
  interfaceId,
@@ -431,14 +399,11 @@ export class ERC721ContractView extends ContractView<ERC721> {
431
399
  context: ethCallContext,
432
400
  calldata,
433
401
  });
434
- console.debug("looking up eth call key:", key);
435
402
  const ret = preparedData.ethCallResults[key];
436
403
  if (ret) {
437
- console.debug("prepared eth call found:", key);
438
404
  const result = iface.decodeFunctionResult("symbol", ret).toArray();
439
405
  return result.length == 1 ? result[0] : result;
440
406
  }
441
- console.debug("missing eth call key:", "symbol", key);
442
407
  }
443
408
  return await this.contract.getFunction("symbol()")(overrides || {});
444
409
  } catch (e) {
@@ -463,14 +428,11 @@ export class ERC721ContractView extends ContractView<ERC721> {
463
428
  context: ethCallContext,
464
429
  calldata,
465
430
  });
466
- console.debug("looking up eth call key:", key);
467
431
  const ret = preparedData.ethCallResults[key];
468
432
  if (ret) {
469
- console.debug("prepared eth call found:", key);
470
433
  const result = iface.decodeFunctionResult("tokenURI", ret).toArray();
471
434
  return result.length == 1 ? result[0] : result;
472
435
  }
473
- console.debug("missing eth call key:", "tokenURI", tokenId, key);
474
436
  }
475
437
  return await this.contract.getFunction("tokenURI(uint256)")(
476
438
  tokenId,
@@ -502,14 +464,11 @@ export class ERC721ContractView extends ContractView<ERC721> {
502
464
  context: ethCallContext,
503
465
  calldata,
504
466
  });
505
- console.debug("looking up eth call key:", key);
506
467
  const ret = preparedData.ethCallResults[key];
507
468
  if (ret) {
508
- console.debug("prepared eth call found:", key);
509
469
  const result = iface.decodeFunctionResult("approve", ret).toArray();
510
470
  return result.length == 1 ? result[0] : result;
511
471
  }
512
- console.debug("missing eth call key:", "approve", to, tokenId, key);
513
472
  }
514
473
  return await this.contract
515
474
  .getFunction("approve(address,uint256)")
@@ -541,23 +500,13 @@ export class ERC721ContractView extends ContractView<ERC721> {
541
500
  context: ethCallContext,
542
501
  calldata,
543
502
  });
544
- console.debug("looking up eth call key:", key);
545
503
  const ret = preparedData.ethCallResults[key];
546
504
  if (ret) {
547
- console.debug("prepared eth call found:", key);
548
505
  const result = iface
549
506
  .decodeFunctionResult("safeTransferFrom", ret)
550
507
  .toArray();
551
508
  return result.length == 1 ? result[0] : result;
552
509
  }
553
- console.debug(
554
- "missing eth call key:",
555
- "safeTransferFrom",
556
- from,
557
- to,
558
- tokenId,
559
- key
560
- );
561
510
  }
562
511
  return await this.contract
563
512
  .getFunction("safeTransferFrom(address,address,uint256)")
@@ -591,24 +540,13 @@ export class ERC721ContractView extends ContractView<ERC721> {
591
540
  context: ethCallContext,
592
541
  calldata,
593
542
  });
594
- console.debug("looking up eth call key:", key);
595
543
  const ret = preparedData.ethCallResults[key];
596
544
  if (ret) {
597
- console.debug("prepared eth call found:", key);
598
545
  const result = iface
599
546
  .decodeFunctionResult("safeTransferFrom", ret)
600
547
  .toArray();
601
548
  return result.length == 1 ? result[0] : result;
602
549
  }
603
- console.debug(
604
- "missing eth call key:",
605
- "safeTransferFrom",
606
- from,
607
- to,
608
- tokenId,
609
- data,
610
- key
611
- );
612
550
  }
613
551
  return await this.contract
614
552
  .getFunction("safeTransferFrom(address,address,uint256,bytes)")
@@ -638,22 +576,13 @@ export class ERC721ContractView extends ContractView<ERC721> {
638
576
  context: ethCallContext,
639
577
  calldata,
640
578
  });
641
- console.debug("looking up eth call key:", key);
642
579
  const ret = preparedData.ethCallResults[key];
643
580
  if (ret) {
644
- console.debug("prepared eth call found:", key);
645
581
  const result = iface
646
582
  .decodeFunctionResult("setApprovalForAll", ret)
647
583
  .toArray();
648
584
  return result.length == 1 ? result[0] : result;
649
585
  }
650
- console.debug(
651
- "missing eth call key:",
652
- "setApprovalForAll",
653
- operator,
654
- _approved,
655
- key
656
- );
657
586
  }
658
587
  return await this.contract
659
588
  .getFunction("setApprovalForAll(address,bool)")
@@ -685,23 +614,13 @@ export class ERC721ContractView extends ContractView<ERC721> {
685
614
  context: ethCallContext,
686
615
  calldata,
687
616
  });
688
- console.debug("looking up eth call key:", key);
689
617
  const ret = preparedData.ethCallResults[key];
690
618
  if (ret) {
691
- console.debug("prepared eth call found:", key);
692
619
  const result = iface
693
620
  .decodeFunctionResult("transferFrom", ret)
694
621
  .toArray();
695
622
  return result.length == 1 ? result[0] : result;
696
623
  }
697
- console.debug(
698
- "missing eth call key:",
699
- "transferFrom",
700
- from,
701
- to,
702
- tokenId,
703
- key
704
- );
705
624
  }
706
625
  return await this.contract
707
626
  .getFunction("transferFrom(address,address,uint256)")
@@ -127,14 +127,11 @@ export class WETH9ContractView extends ContractView<WETH9> {
127
127
  context: ethCallContext,
128
128
  calldata,
129
129
  });
130
- console.debug("looking up eth call key:", key);
131
130
  const ret = preparedData.ethCallResults[key];
132
131
  if (ret) {
133
- console.debug("prepared eth call found:", key);
134
132
  const result = iface.decodeFunctionResult("name", ret).toArray();
135
133
  return result.length == 1 ? result[0] : result;
136
134
  }
137
- console.debug("missing eth call key:", "name", key);
138
135
  }
139
136
  return await this.contract.getFunction("name()")(overrides || {});
140
137
  } catch (e) {
@@ -158,16 +155,13 @@ export class WETH9ContractView extends ContractView<WETH9> {
158
155
  context: ethCallContext,
159
156
  calldata,
160
157
  });
161
- console.debug("looking up eth call key:", key);
162
158
  const ret = preparedData.ethCallResults[key];
163
159
  if (ret) {
164
- console.debug("prepared eth call found:", key);
165
160
  const result = iface
166
161
  .decodeFunctionResult("totalSupply", ret)
167
162
  .toArray();
168
163
  return result.length == 1 ? result[0] : result;
169
164
  }
170
- console.debug("missing eth call key:", "totalSupply", key);
171
165
  }
172
166
  return await this.contract.getFunction("totalSupply()")(overrides || {});
173
167
  } catch (e) {
@@ -191,14 +185,11 @@ export class WETH9ContractView extends ContractView<WETH9> {
191
185
  context: ethCallContext,
192
186
  calldata,
193
187
  });
194
- console.debug("looking up eth call key:", key);
195
188
  const ret = preparedData.ethCallResults[key];
196
189
  if (ret) {
197
- console.debug("prepared eth call found:", key);
198
190
  const result = iface.decodeFunctionResult("decimals", ret).toArray();
199
191
  return result.length == 1 ? result[0] : result;
200
192
  }
201
- console.debug("missing eth call key:", "decimals", key);
202
193
  }
203
194
  return await this.contract.getFunction("decimals()")(overrides || {});
204
195
  } catch (e) {
@@ -223,14 +214,11 @@ export class WETH9ContractView extends ContractView<WETH9> {
223
214
  context: ethCallContext,
224
215
  calldata,
225
216
  });
226
- console.debug("looking up eth call key:", key);
227
217
  const ret = preparedData.ethCallResults[key];
228
218
  if (ret) {
229
- console.debug("prepared eth call found:", key);
230
219
  const result = iface.decodeFunctionResult("balanceOf", ret).toArray();
231
220
  return result.length == 1 ? result[0] : result;
232
221
  }
233
- console.debug("missing eth call key:", "balanceOf", arg0, key);
234
222
  }
235
223
  return await this.contract.getFunction("balanceOf(address)")(
236
224
  arg0,
@@ -257,14 +245,11 @@ export class WETH9ContractView extends ContractView<WETH9> {
257
245
  context: ethCallContext,
258
246
  calldata,
259
247
  });
260
- console.debug("looking up eth call key:", key);
261
248
  const ret = preparedData.ethCallResults[key];
262
249
  if (ret) {
263
- console.debug("prepared eth call found:", key);
264
250
  const result = iface.decodeFunctionResult("symbol", ret).toArray();
265
251
  return result.length == 1 ? result[0] : result;
266
252
  }
267
- console.debug("missing eth call key:", "symbol", key);
268
253
  }
269
254
  return await this.contract.getFunction("symbol()")(overrides || {});
270
255
  } catch (e) {
@@ -290,14 +275,11 @@ export class WETH9ContractView extends ContractView<WETH9> {
290
275
  context: ethCallContext,
291
276
  calldata,
292
277
  });
293
- console.debug("looking up eth call key:", key);
294
278
  const ret = preparedData.ethCallResults[key];
295
279
  if (ret) {
296
- console.debug("prepared eth call found:", key);
297
280
  const result = iface.decodeFunctionResult("allowance", ret).toArray();
298
281
  return result.length == 1 ? result[0] : result;
299
282
  }
300
- console.debug("missing eth call key:", "allowance", arg0, arg1, key);
301
283
  }
302
284
  return await this.contract.getFunction("allowance(address,address)")(
303
285
  arg0,
@@ -330,14 +312,11 @@ export class WETH9ContractView extends ContractView<WETH9> {
330
312
  context: ethCallContext,
331
313
  calldata,
332
314
  });
333
- console.debug("looking up eth call key:", key);
334
315
  const ret = preparedData.ethCallResults[key];
335
316
  if (ret) {
336
- console.debug("prepared eth call found:", key);
337
317
  const result = iface.decodeFunctionResult("approve", ret).toArray();
338
318
  return result.length == 1 ? result[0] : result;
339
319
  }
340
- console.debug("missing eth call key:", "approve", guy, wad, key);
341
320
  }
342
321
  return await this.contract
343
322
  .getFunction("approve(address,uint256)")
@@ -369,23 +348,13 @@ export class WETH9ContractView extends ContractView<WETH9> {
369
348
  context: ethCallContext,
370
349
  calldata,
371
350
  });
372
- console.debug("looking up eth call key:", key);
373
351
  const ret = preparedData.ethCallResults[key];
374
352
  if (ret) {
375
- console.debug("prepared eth call found:", key);
376
353
  const result = iface
377
354
  .decodeFunctionResult("transferFrom", ret)
378
355
  .toArray();
379
356
  return result.length == 1 ? result[0] : result;
380
357
  }
381
- console.debug(
382
- "missing eth call key:",
383
- "transferFrom",
384
- src,
385
- dst,
386
- wad,
387
- key
388
- );
389
358
  }
390
359
  return await this.contract
391
360
  .getFunction("transferFrom(address,address,uint256)")
@@ -411,16 +380,13 @@ export class WETH9ContractView extends ContractView<WETH9> {
411
380
  context: ethCallContext,
412
381
  calldata,
413
382
  });
414
- console.debug("looking up eth call key:", key);
415
383
  const ret = preparedData.ethCallResults[key];
416
384
  if (ret) {
417
- console.debug("prepared eth call found:", key);
418
385
  const result = iface
419
386
  .decodeFunctionResult("withdraw", ret)
420
387
  .toArray();
421
388
  return result.length == 1 ? result[0] : result;
422
389
  }
423
- console.debug("missing eth call key:", "withdraw", wad, key);
424
390
  }
425
391
  return await this.contract
426
392
  .getFunction("withdraw(uint256)")
@@ -447,16 +413,13 @@ export class WETH9ContractView extends ContractView<WETH9> {
447
413
  context: ethCallContext,
448
414
  calldata,
449
415
  });
450
- console.debug("looking up eth call key:", key);
451
416
  const ret = preparedData.ethCallResults[key];
452
417
  if (ret) {
453
- console.debug("prepared eth call found:", key);
454
418
  const result = iface
455
419
  .decodeFunctionResult("transfer", ret)
456
420
  .toArray();
457
421
  return result.length == 1 ? result[0] : result;
458
422
  }
459
- console.debug("missing eth call key:", "transfer", dst, wad, key);
460
423
  }
461
424
  return await this.contract
462
425
  .getFunction("transfer(address,uint256)")
@@ -481,14 +444,11 @@ export class WETH9ContractView extends ContractView<WETH9> {
481
444
  context: ethCallContext,
482
445
  calldata,
483
446
  });
484
- console.debug("looking up eth call key:", key);
485
447
  const ret = preparedData.ethCallResults[key];
486
448
  if (ret) {
487
- console.debug("prepared eth call found:", key);
488
449
  const result = iface.decodeFunctionResult("deposit", ret).toArray();
489
450
  return result.length == 1 ? result[0] : result;
490
451
  }
491
- console.debug("missing eth call key:", "deposit", key);
492
452
  }
493
453
  return await this.contract
494
454
  .getFunction("deposit()")
@@ -51,16 +51,11 @@ export function generateViewFunction(view: boolean, fn: FunctionDeclaration, inc
51
51
  context: ethCallContext,
52
52
  calldata
53
53
  })
54
- console.debug("looking up eth call key:", key)
55
54
  const ret = preparedData.ethCallResults[key]
56
55
  if (ret) {
57
- console.debug("prepared eth call found:", key)
58
56
  const result = iface.decodeFunctionResult("${fn.name}", ret).toArray()
59
57
  return result.length == 1? result[0]: result
60
58
  }
61
- console.debug("missing eth call key:", "${fn.name}", ${
62
- fn.inputs.length > 0 ? fn.inputs.map((input, index) => input.name || `arg${index}`).join(',') + ',' : ''
63
- }key)
64
59
  }
65
60
  return await ${func}${call}(${
66
61
  fn.inputs.length > 0 ? fn.inputs.map((input, index) => input.name || `arg${index}`).join(',') + ',' : ''
@@ -18,19 +18,5 @@ export default defineConfig({
18
18
  // },
19
19
  publicDir: '../abis',
20
20
  splitting: false,
21
- external: [
22
- 'protobufjs',
23
- '@aptos-labs/ts-sdk',
24
- 'ethers',
25
- 'bs58',
26
- 'bn.js',
27
- 'csv-parse',
28
- 'node-fetch',
29
- /^nice-grpc.*$/,
30
- /^prettier.*$/,
31
- /^@(solana|project-serum).*$/,
32
- /^@sentio\/(sdk|runtime|protos|bigdecimal|ethers).*$/,
33
- /^@typemove\/.*$/,
34
- /^@mysten\/(bcs|sui.js\/).*$/
35
- ]
21
+ external: [/^@sentio\/(sdk|runtime).*$/]
36
22
  })