@sentio/sdk 2.45.3 → 2.46.0-rc.2

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 (66) hide show
  1. package/lib/aptos/builtin/0x1.d.ts +65 -65
  2. package/lib/aptos/builtin/0x1.js +27 -27
  3. package/lib/aptos/builtin/0x3.d.ts +1 -1
  4. package/lib/aptos/builtin/0x4.d.ts +34 -34
  5. package/lib/eth/builtin/internal/factories/EACAggregatorProxy__factory.d.ts.map +1 -1
  6. package/lib/eth/builtin/internal/factories/EACAggregatorProxy__factory.js +3 -3
  7. package/lib/eth/builtin/internal/factories/EACAggregatorProxy__factory.js.map +1 -1
  8. package/lib/eth/builtin/internal/factories/ERC1155__factory.d.ts.map +1 -1
  9. package/lib/eth/builtin/internal/factories/ERC1155__factory.js +3 -3
  10. package/lib/eth/builtin/internal/factories/ERC1155__factory.js.map +1 -1
  11. package/lib/eth/builtin/internal/factories/ERC20Bytes__factory.d.ts.map +1 -1
  12. package/lib/eth/builtin/internal/factories/ERC20Bytes__factory.js +3 -3
  13. package/lib/eth/builtin/internal/factories/ERC20Bytes__factory.js.map +1 -1
  14. package/lib/eth/builtin/internal/factories/ERC20__factory.d.ts.map +1 -1
  15. package/lib/eth/builtin/internal/factories/ERC20__factory.js +3 -3
  16. package/lib/eth/builtin/internal/factories/ERC20__factory.js.map +1 -1
  17. package/lib/eth/builtin/internal/factories/ERC721__factory.d.ts.map +1 -1
  18. package/lib/eth/builtin/internal/factories/ERC721__factory.js +3 -3
  19. package/lib/eth/builtin/internal/factories/ERC721__factory.js.map +1 -1
  20. package/lib/eth/builtin/internal/factories/WETH9__factory.d.ts.map +1 -1
  21. package/lib/eth/builtin/internal/factories/WETH9__factory.js +3 -3
  22. package/lib/eth/builtin/internal/factories/WETH9__factory.js.map +1 -1
  23. package/lib/eth/codegen/ethers-sentio.d.ts.map +1 -1
  24. package/lib/eth/codegen/ethers-sentio.js +4 -1
  25. package/lib/eth/codegen/ethers-sentio.js.map +1 -1
  26. package/lib/eth/eth.d.ts +3 -1
  27. package/lib/eth/eth.d.ts.map +1 -1
  28. package/lib/eth/eth.js +7 -1
  29. package/lib/eth/eth.js.map +1 -1
  30. package/lib/sui/builtin/0x1.d.ts +172 -311
  31. package/lib/sui/builtin/0x1.d.ts.map +1 -1
  32. package/lib/sui/builtin/0x1.js +17 -17
  33. package/lib/sui/builtin/0x1.js.map +1 -1
  34. package/lib/sui/builtin/0x2.d.ts +673 -1589
  35. package/lib/sui/builtin/0x2.d.ts.map +1 -1
  36. package/lib/sui/builtin/0x2.js +106 -106
  37. package/lib/sui/builtin/0x2.js.map +1 -1
  38. package/lib/sui/builtin/0x3.d.ts +359 -831
  39. package/lib/sui/builtin/0x3.d.ts.map +1 -1
  40. package/lib/sui/builtin/0x3.js +20 -20
  41. package/lib/sui/builtin/0x3.js.map +1 -1
  42. package/lib/sui/index.d.ts +1 -1
  43. package/lib/sui/index.d.ts.map +1 -1
  44. package/lib/sui/index.js +1 -1
  45. package/lib/sui/index.js.map +1 -1
  46. package/lib/sui/sui-object-processor.d.ts +19 -4
  47. package/lib/sui/sui-object-processor.d.ts.map +1 -1
  48. package/lib/sui/sui-object-processor.js +38 -4
  49. package/lib/sui/sui-object-processor.js.map +1 -1
  50. package/package.json +6 -6
  51. package/src/aptos/builtin/0x1.ts +78 -78
  52. package/src/aptos/builtin/0x3.ts +1 -1
  53. package/src/aptos/builtin/0x4.ts +34 -34
  54. package/src/eth/builtin/internal/factories/EACAggregatorProxy__factory.ts +3 -2
  55. package/src/eth/builtin/internal/factories/ERC1155__factory.ts +3 -2
  56. package/src/eth/builtin/internal/factories/ERC20Bytes__factory.ts +3 -2
  57. package/src/eth/builtin/internal/factories/ERC20__factory.ts +3 -2
  58. package/src/eth/builtin/internal/factories/ERC721__factory.ts +3 -2
  59. package/src/eth/builtin/internal/factories/WETH9__factory.ts +3 -2
  60. package/src/eth/codegen/ethers-sentio.ts +4 -1
  61. package/src/eth/eth.ts +24 -1
  62. package/src/sui/builtin/0x1.ts +178 -317
  63. package/src/sui/builtin/0x2.ts +752 -1668
  64. package/src/sui/builtin/0x3.ts +374 -846
  65. package/src/sui/index.ts +3 -1
  66. package/src/sui/sui-object-processor.ts +61 -9
@@ -2,6 +2,7 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
  // @ts-nocheck
5
+ import { newContract, newInterface } from "@sentio/sdk/eth";
5
6
 
6
7
  import { Contract, Signer, Provider, Interface } from "ethers";
7
8
  import type { ERC1155, ERC1155Interface } from "../ERC1155.js";
@@ -324,12 +325,12 @@ const _abi = [
324
325
  export class ERC1155__factory {
325
326
  static readonly abi = _abi;
326
327
  static createInterface(): ERC1155Interface {
327
- return new Interface(_abi) as ERC1155Interface;
328
+ return newInterface(_abi) as ERC1155Interface;
328
329
  }
329
330
  static connect(
330
331
  address: string,
331
332
  signerOrProvider: Signer | Provider,
332
333
  ): ERC1155 {
333
- return new Contract(address, _abi, signerOrProvider) as ERC1155;
334
+ return newContract(address, _abi, signerOrProvider) as ERC1155;
334
335
  }
335
336
  }
@@ -2,6 +2,7 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
  // @ts-nocheck
5
+ import { newContract, newInterface } from "@sentio/sdk/eth";
5
6
 
6
7
  import { Contract, Signer, Provider, Interface } from "ethers";
7
8
  import type { ERC20Bytes, ERC20BytesInterface } from "../ERC20Bytes.js";
@@ -246,12 +247,12 @@ const _abi = [
246
247
  export class ERC20Bytes__factory {
247
248
  static readonly abi = _abi;
248
249
  static createInterface(): ERC20BytesInterface {
249
- return new Interface(_abi) as ERC20BytesInterface;
250
+ return newInterface(_abi) as ERC20BytesInterface;
250
251
  }
251
252
  static connect(
252
253
  address: string,
253
254
  signerOrProvider: Signer | Provider,
254
255
  ): ERC20Bytes {
255
- return new Contract(address, _abi, signerOrProvider) as ERC20Bytes;
256
+ return newContract(address, _abi, signerOrProvider) as ERC20Bytes;
256
257
  }
257
258
  }
@@ -2,6 +2,7 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
  // @ts-nocheck
5
+ import { newContract, newInterface } from "@sentio/sdk/eth";
5
6
 
6
7
  import { Contract, Signer, Provider, Interface } from "ethers";
7
8
  import type { ERC20, ERC20Interface } from "../ERC20.js";
@@ -396,9 +397,9 @@ const _abi = [
396
397
  export class ERC20__factory {
397
398
  static readonly abi = _abi;
398
399
  static createInterface(): ERC20Interface {
399
- return new Interface(_abi) as ERC20Interface;
400
+ return newInterface(_abi) as ERC20Interface;
400
401
  }
401
402
  static connect(address: string, signerOrProvider: Signer | Provider): ERC20 {
402
- return new Contract(address, _abi, signerOrProvider) as ERC20;
403
+ return newContract(address, _abi, signerOrProvider) as ERC20;
403
404
  }
404
405
  }
@@ -2,6 +2,7 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
  // @ts-nocheck
5
+ import { newContract, newInterface } from "@sentio/sdk/eth";
5
6
 
6
7
  import { Contract, Signer, Provider, Interface } from "ethers";
7
8
  import type { ERC721, ERC721Interface } from "../ERC721.js";
@@ -356,9 +357,9 @@ const _abi = [
356
357
  export class ERC721__factory {
357
358
  static readonly abi = _abi;
358
359
  static createInterface(): ERC721Interface {
359
- return new Interface(_abi) as ERC721Interface;
360
+ return newInterface(_abi) as ERC721Interface;
360
361
  }
361
362
  static connect(address: string, signerOrProvider: Signer | Provider): ERC721 {
362
- return new Contract(address, _abi, signerOrProvider) as ERC721;
363
+ return newContract(address, _abi, signerOrProvider) as ERC721;
363
364
  }
364
365
  }
@@ -2,6 +2,7 @@
2
2
  /* tslint:disable */
3
3
  /* eslint-disable */
4
4
  // @ts-nocheck
5
+ import { newContract, newInterface } from "@sentio/sdk/eth";
5
6
 
6
7
  import { Contract, Signer, Provider, Interface } from "ethers";
7
8
  import type { WETH9, WETH9Interface } from "../WETH9.js";
@@ -289,9 +290,9 @@ const _abi = [
289
290
  export class WETH9__factory {
290
291
  static readonly abi = _abi;
291
292
  static createInterface(): WETH9Interface {
292
- return new Interface(_abi) as WETH9Interface;
293
+ return newInterface(_abi) as WETH9Interface;
293
294
  }
294
295
  static connect(address: string, signerOrProvider: Signer | Provider): WETH9 {
295
- return new Contract(address, _abi, signerOrProvider) as WETH9;
296
+ return newContract(address, _abi, signerOrProvider) as WETH9;
296
297
  }
297
298
  }
@@ -73,7 +73,10 @@ export default class EthersSentio extends Ethers.default {
73
73
  const files = super.afterRun()
74
74
  for (const [idx, file] of files.entries()) {
75
75
  if (file.path.endsWith('__factory.ts')) {
76
- file.contents = '// @ts-nocheck\n' + file.contents
76
+ file.contents =
77
+ `// @ts-nocheck
78
+ import { newContract, newInterface } from '@sentio/sdk/eth'
79
+ ` + file.contents.replaceAll('new Contract', 'newContract').replaceAll('new Interface', 'newInterface') // those to reduce processor bundle code size
77
80
  } else if (file.path.endsWith(join('factories', 'index.ts'))) {
78
81
  file.contents = file.contents.replaceAll("__factory'", "__factory.js'")
79
82
  } else if (file.path.endsWith('_processor.ts')) {
package/src/eth/eth.ts CHANGED
@@ -11,7 +11,18 @@ import {
11
11
  object,
12
12
  formatData
13
13
  } from 'ethers/providers'
14
- import { CallExceptionError, LogDescription, Result, DeferredTopicFilter, BlockParams, Interface } from 'ethers'
14
+ import {
15
+ CallExceptionError,
16
+ LogDescription,
17
+ Result,
18
+ DeferredTopicFilter,
19
+ BlockParams,
20
+ Interface,
21
+ Contract,
22
+ Addressable,
23
+ InterfaceAbi,
24
+ ContractRunner
25
+ } from 'ethers'
15
26
  import { ContractContext } from './context.js'
16
27
  import { getAddress } from 'ethers/address'
17
28
  import { getBigInt, getNumber, hexlify } from 'ethers/utils'
@@ -285,3 +296,15 @@ export function encodeCallData(
285
296
  throw transformEtherError(e, undefined, stack)
286
297
  }
287
298
  }
299
+
300
+ export function newContract(
301
+ target: string | Addressable,
302
+ abi: Interface | InterfaceAbi,
303
+ runner?: ContractRunner | null | undefined
304
+ ) {
305
+ return new Contract(target, abi, runner)
306
+ }
307
+
308
+ export function newInterface(fragments: InterfaceAbi) {
309
+ return new Interface(fragments)
310
+ }