@sentio/sdk 2.13.0-rc.1 → 2.13.0-rc.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.
Files changed (77) hide show
  1. package/lib/aptos/aptos-chain-adapter.d.ts +11 -0
  2. package/lib/aptos/aptos-chain-adapter.js +56 -0
  3. package/lib/aptos/aptos-chain-adapter.js.map +1 -0
  4. package/lib/aptos/aptos-processor.d.ts +2 -2
  5. package/lib/aptos/aptos-processor.js +4 -7
  6. package/lib/aptos/aptos-processor.js.map +1 -1
  7. package/lib/aptos/builtin/0x1.d.ts +62 -62
  8. package/lib/aptos/builtin/0x1.js.map +1 -1
  9. package/lib/aptos/builtin/0x3.d.ts +21 -21
  10. package/lib/aptos/builtin/0x3.js.map +1 -1
  11. package/lib/aptos/codegen/codegen.js +4 -45
  12. package/lib/aptos/codegen/codegen.js.map +1 -1
  13. package/lib/aptos/move-coder.d.ts +3 -3
  14. package/lib/aptos/move-coder.js +8 -6
  15. package/lib/aptos/move-coder.js.map +1 -1
  16. package/lib/move/abstract-codegen.d.ts +3 -4
  17. package/lib/move/abstract-codegen.js +11 -7
  18. package/lib/move/abstract-codegen.js.map +1 -1
  19. package/lib/move/abstract-move-coder.d.ts +5 -2
  20. package/lib/move/abstract-move-coder.js +7 -1
  21. package/lib/move/abstract-move-coder.js.map +1 -1
  22. package/lib/move/chain-adapter.d.ts +9 -0
  23. package/lib/move/chain-adapter.js +3 -0
  24. package/lib/move/chain-adapter.js.map +1 -0
  25. package/lib/move/index.d.ts +1 -0
  26. package/lib/move/index.js +1 -0
  27. package/lib/move/index.js.map +1 -1
  28. package/lib/sui/builtin/0x1.d.ts +6 -6
  29. package/lib/sui/builtin/0x1.js.map +1 -1
  30. package/lib/sui/builtin/0x2.d.ts +19 -19
  31. package/lib/sui/builtin/0x2.js.map +1 -1
  32. package/lib/sui/builtin/0x3.d.ts +9 -9
  33. package/lib/sui/builtin/0x3.js.map +1 -1
  34. package/lib/sui/codegen/codegen.js +4 -34
  35. package/lib/sui/codegen/codegen.js.map +1 -1
  36. package/lib/sui/context.d.ts +2 -1
  37. package/lib/sui/context.js +3 -1
  38. package/lib/sui/context.js.map +1 -1
  39. package/lib/sui/move-coder.d.ts +4 -3
  40. package/lib/sui/move-coder.js +8 -6
  41. package/lib/sui/move-coder.js.map +1 -1
  42. package/lib/sui/sui-chain-adapter.d.ts +11 -0
  43. package/lib/sui/sui-chain-adapter.js +43 -0
  44. package/lib/sui/sui-chain-adapter.js.map +1 -0
  45. package/lib/sui/sui-processor.js +13 -10
  46. package/lib/sui/sui-processor.js.map +1 -1
  47. package/lib/sui/utils.d.ts +0 -2
  48. package/lib/sui/utils.js +0 -6
  49. package/lib/sui/utils.js.map +1 -1
  50. package/lib/testing/sui-facet.d.ts +2 -2
  51. package/lib/testing/sui-facet.js +16 -26
  52. package/lib/testing/sui-facet.js.map +1 -1
  53. package/package.json +4 -4
  54. package/src/aptos/aptos-chain-adapter.ts +65 -0
  55. package/src/aptos/aptos-processor.ts +6 -10
  56. package/src/aptos/builtin/0x1.ts +62 -62
  57. package/src/aptos/builtin/0x3.ts +21 -21
  58. package/src/aptos/codegen/codegen.ts +5 -54
  59. package/src/aptos/move-coder.ts +11 -10
  60. package/src/move/abstract-codegen.ts +13 -14
  61. package/src/move/abstract-move-coder.ts +10 -3
  62. package/src/move/chain-adapter.ts +14 -0
  63. package/src/move/index.ts +1 -0
  64. package/src/sui/builtin/0x1.ts +6 -6
  65. package/src/sui/builtin/0x2.ts +19 -19
  66. package/src/sui/builtin/0x3.ts +9 -9
  67. package/src/sui/codegen/codegen.ts +5 -40
  68. package/src/sui/context.ts +4 -1
  69. package/src/sui/move-coder.ts +12 -9
  70. package/src/sui/sui-chain-adapter.ts +50 -0
  71. package/src/sui/sui-processor.ts +23 -18
  72. package/src/sui/utils.ts +0 -8
  73. package/src/testing/sui-facet.ts +15 -30
  74. package/lib/aptos/utils.d.ts +0 -2
  75. package/lib/aptos/utils.js +0 -10
  76. package/lib/aptos/utils.js.map +0 -1
  77. package/src/aptos/utils.ts +0 -11
@@ -0,0 +1,11 @@
1
+ import { ChainAdapter, TypeDescriptor } from '../move/index.js';
2
+ import { MoveModuleBytecode } from './move-types.js';
3
+ import { AptosNetwork } from './network.js';
4
+ import { InternalMoveModule, InternalMoveStruct } from '../move/internal-models.js';
5
+ export declare class AptosChainAdapter extends ChainAdapter<AptosNetwork, MoveModuleBytecode[]> {
6
+ static INSTANCE: AptosChainAdapter;
7
+ fetchModules(account: string, network: AptosNetwork): Promise<MoveModuleBytecode[]>;
8
+ toInternalModules(modules: MoveModuleBytecode[]): InternalMoveModule[];
9
+ getMeaningfulFunctionParams(params: TypeDescriptor[]): TypeDescriptor[];
10
+ getEventStructs(module: InternalMoveModule): Map<string, InternalMoveStruct>;
11
+ }
@@ -0,0 +1,56 @@
1
+ import { ChainAdapter, moduleQname, SPLITTER } from '../move/index.js';
2
+ import { toInternalModule } from './move-types.js';
3
+ import { AptosNetwork } from './network.js';
4
+ import { AptosClient } from 'aptos-sdk';
5
+ class AptosChainAdapter extends ChainAdapter {
6
+ static INSTANCE = new AptosChainAdapter();
7
+ async fetchModules(account, network) {
8
+ const client = getRpcClient(network);
9
+ return await client.getAccountModules(account);
10
+ }
11
+ toInternalModules(modules) {
12
+ return modules.flatMap((m) => (m.abi ? [toInternalModule(m)] : []));
13
+ }
14
+ getMeaningfulFunctionParams(params) {
15
+ if (params.length === 0) {
16
+ return params;
17
+ }
18
+ if (params[0].qname === 'signer' && params[0].reference) {
19
+ params = params.slice(1);
20
+ }
21
+ return params;
22
+ }
23
+ getEventStructs(module) {
24
+ const qname = moduleQname(module);
25
+ const structMap = new Map();
26
+ const eventMap = new Map();
27
+ for (const struct of module.structs) {
28
+ structMap.set(qname + SPLITTER + struct.name, struct);
29
+ }
30
+ for (const struct of module.structs) {
31
+ for (const field of struct.fields) {
32
+ const t = field.type;
33
+ if (t.qname === '0x1::event::EventHandle') {
34
+ const event = t.typeArgs[0].qname;
35
+ const eventStruct = structMap.get(event);
36
+ if (eventStruct) {
37
+ eventMap.set(event, eventStruct);
38
+ }
39
+ }
40
+ }
41
+ }
42
+ return eventMap;
43
+ }
44
+ }
45
+ export { AptosChainAdapter };
46
+ function getRpcClient(network) {
47
+ return new AptosClient(getRpcEndpoint(network));
48
+ }
49
+ function getRpcEndpoint(network) {
50
+ switch (network) {
51
+ case AptosNetwork.TEST_NET:
52
+ return 'https://testnet.aptoslabs.com/';
53
+ }
54
+ return 'https://mainnet.aptoslabs.com/';
55
+ }
56
+ //# sourceMappingURL=aptos-chain-adapter.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"aptos-chain-adapter.js","sourceRoot":"","sources":["../../src/aptos/aptos-chain-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,QAAQ,EAAkB,MAAM,kBAAkB,CAAA;AACtF,OAAO,EAAsB,gBAAgB,EAAE,MAAM,iBAAiB,CAAA;AACtE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAA;AAE3C,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAA;AAEvC,MAAa,iBAAkB,SAAQ,YAAgD;IACrF,MAAM,CAAC,QAAQ,GAAG,IAAI,iBAAiB,EAAE,CAAA;IAEzC,KAAK,CAAC,YAAY,CAAC,OAAe,EAAE,OAAqB;QACvD,MAAM,MAAM,GAAG,YAAY,CAAC,OAAO,CAAC,CAAA;QACpC,OAAO,MAAM,MAAM,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAA;IAChD,CAAC;IAED,iBAAiB,CAAC,OAA6B;QAC7C,OAAO,OAAO,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,gBAAgB,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAA;IACrE,CAAC;IAED,2BAA2B,CAAC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AAC,CAAC,CAAA;AACjD,CAAC;AAED,SAAS,cAAc,CAAC,OAAqB;IAC3C,QAAQ,OAAO,EAAE;QACf,KAAK,YAAY,CAAC,QAAQ;YACxB,OAAO,gCAAgC,CAAA;KAC1C;IACD,OAAO,gCAAgC,CAAA;AACzC,CAAC","sourcesContent":["import { ChainAdapter, moduleQname, SPLITTER, TypeDescriptor } from '../move/index.js'\nimport { MoveModuleBytecode, toInternalModule } from './move-types.js'\nimport { AptosNetwork } from './network.js'\nimport { InternalMoveModule, InternalMoveStruct } from '../move/internal-models.js'\nimport { AptosClient } from 'aptos-sdk'\n\nexport class AptosChainAdapter extends ChainAdapter<AptosNetwork, MoveModuleBytecode[]> {\n static INSTANCE = new AptosChainAdapter()\n\n async fetchModules(account: string, network: AptosNetwork): Promise<MoveModuleBytecode[]> {\n const client = getRpcClient(network)\n return await client.getAccountModules(account)\n }\n\n toInternalModules(modules: MoveModuleBytecode[]): InternalMoveModule[] {\n return modules.flatMap((m) => (m.abi ? [toInternalModule(m)] : []))\n }\n\n getMeaningfulFunctionParams(params: TypeDescriptor[]): TypeDescriptor[] {\n if (params.length === 0) {\n return params\n }\n if (params[0].qname === 'signer' && params[0].reference) {\n params = params.slice(1)\n }\n return params\n }\n\n getEventStructs(module: InternalMoveModule) {\n const qname = moduleQname(module)\n const structMap = new Map<string, InternalMoveStruct>()\n const eventMap = new Map<string, InternalMoveStruct>()\n\n for (const struct of module.structs) {\n structMap.set(qname + SPLITTER + struct.name, struct)\n }\n\n for (const struct of module.structs) {\n for (const field of struct.fields) {\n const t = field.type\n if (t.qname === '0x1::event::EventHandle') {\n const event = t.typeArgs[0].qname\n const eventStruct = structMap.get(event)\n if (eventStruct) {\n eventMap.set(event, eventStruct)\n }\n }\n }\n }\n\n return eventMap\n }\n}\n\nfunction getRpcClient(network: AptosNetwork): AptosClient {\n return new AptosClient(getRpcEndpoint(network))\n}\n\nfunction getRpcEndpoint(network: AptosNetwork): string {\n switch (network) {\n case AptosNetwork.TEST_NET:\n return 'https://testnet.aptoslabs.com/'\n }\n return 'https://mainnet.aptoslabs.com/'\n}\n"]}
@@ -26,8 +26,8 @@ export declare class AptosBaseProcessor {
26
26
  eventHandlers: EventHandler<Data_AptEvent>[];
27
27
  callHandlers: CallHandler<Data_AptCall>[];
28
28
  constructor(moduleName: string, options: AptosBindOptions);
29
- onTransaction(handler: (transaction: Transaction_UserTransaction, ctx: AptosContext) => void, includedFailed?: boolean, fetchConfig?: MoveFetchConfig): this;
30
- onMoveEvent(handler: (event: EventInstance, ctx: AptosContext) => void, filter: EventFilter | EventFilter[], fetchConfig?: MoveFetchConfig): this;
29
+ onTransaction(handler: (transaction: Transaction_UserTransaction, ctx: AptosContext) => void, includedFailed?: boolean, fetchConfig?: Partial<MoveFetchConfig>): this;
30
+ onMoveEvent(handler: (event: EventInstance, ctx: AptosContext) => void, filter: EventFilter | EventFilter[], fetchConfig?: Partial<MoveFetchConfig>): this;
31
31
  onEntryFunctionCall(handler: (call: TransactionPayload_EntryFunctionPayload, ctx: AptosContext) => void, filter: FunctionNameAndCallFilter | FunctionNameAndCallFilter[], fetchConfig?: Partial<MoveFetchConfig>): this;
32
32
  getChainId(): string;
33
33
  loadTypes(registry: MoveCoder): void;
@@ -30,7 +30,7 @@ export class AptosBaseProcessor {
30
30
  // return undefined
31
31
  // }
32
32
  onTransaction(handler, includedFailed = false, fetchConfig) {
33
- const _fetchConfig = fetchConfig || MoveFetchConfig.fromPartial({});
33
+ const _fetchConfig = MoveFetchConfig.fromPartial(fetchConfig || {});
34
34
  // const address = this.config.address
35
35
  // const moduleName = this.moduleName
36
36
  const processor = this;
@@ -51,17 +51,16 @@ export class AptosBaseProcessor {
51
51
  }
52
52
  onMoveEvent(handler, filter, fetchConfig) {
53
53
  let _filters = [];
54
- const _fetchConfig = fetchConfig || MoveFetchConfig.fromPartial({});
54
+ const _fetchConfig = MoveFetchConfig.fromPartial(fetchConfig || {});
55
55
  if (Array.isArray(filter)) {
56
56
  _filters = filter;
57
57
  }
58
58
  else {
59
59
  _filters.push(filter);
60
60
  }
61
- const address = this.config.address;
62
61
  // const moduleName = this.moduleName
63
62
  const processor = this;
64
- const allEventType = new Set(_filters.map((f) => address + '::' + f.type));
63
+ const allEventType = new Set(_filters.map((f) => processor.config.address + '::' + f.type));
65
64
  this.eventHandlers.push({
66
65
  handler: async function (data) {
67
66
  if (!data.transaction) {
@@ -71,10 +70,8 @@ export class AptosBaseProcessor {
71
70
  if (!txn.events.length) {
72
71
  throw new ServerError(Status.INVALID_ARGUMENT, 'no event in the transactions');
73
72
  }
74
- const events = txn.events;
75
- txn.events = [];
76
73
  const processResults = [];
77
- for (const [idx, evt] of events.entries()) {
74
+ for (const [idx, evt] of txn.events.entries()) {
78
75
  const typeQname = parseMoveType(evt.type).qname;
79
76
  if (!allEventType.has(typeQname)) {
80
77
  continue;
@@ -1 +1 @@
1
- {"version":3,"file":"aptos-processor.js","sourceRoot":"","sources":["../../src/aptos/aptos-processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAa,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAoB,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAElE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACvE,OAAO,EACL,eAAe,GAMhB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAqE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AASnH,MAAM,gBAAgB;IACpB,IAAI,CAAS;IACb,eAAe,CAAiB;IAChC,qBAAqB,CAAiB;IACtC,OAAO,CAAwD;CAChE;AAED,MAAa,mBAAoB,SAAQ,gBAAoC;IAC3E,MAAM,CAAC,QAAQ,GAAG,IAAI,mBAAmB,EAAE,CAAA;;SADhC,mB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C,SAA2B,EAAE,GAAG,CAAC,CAAA;gBACpD,OAAO,GAAG,CAAC,gBAAgB,EAAE,CAAA;YAC/B,CAAC;YACD,qBAAqB,EAAE,YAAY;YACnC,eAAe,EAAE,eAAe;YAChC,IAAI,EAAE,IAAI;SACX,CAAC,CAAA;QACF,OAAO,IAAI,CAAA;IACb,CAAC;IAEM,cAAc,CACnB,OAAwE,EACxE,qBAAqB,GAAG,EAAE,EAC1B,6BAA6B,GAAG,GAAG,EACnC,IAAa;QAEb,OAAO,IAAI,CAAC,UAAU,CACpB,OAAO,EACP;YACE,cAAc,EAAE,qBAAqB;YACrC,gBAAgB,EAAE,6BAA6B;SAChD,EACD,SAAS,EACT,IAAI,CACL,CAAA;IACH,CAAC;IAEM,iBAAiB,CACtB,OAAwE,EACxE,eAAe,GAAG,MAAM,EACxB,uBAAuB,GAAG,MAAM,EAChC,UAAmB;QAEnB,OAAO,IAAI,CAAC,UAAU,CACpB,OAAO,EACP,SAAS,EACT,EAAE,cAAc,EAAE,eAAe,EAAE,gBAAgB,EAAE,uBAAuB,EAAE,EAC9E,UAAU,CACX,CAAA;IACH,CAAC;CACF;AAED,SAAS,SAAS,CAAC,OAAyB;IAC1C,IAAI,YAAY,GAAG,EAAE,CAAA;IACrB,IAAI,OAAO,CAAC,YAAY,KAAK,SAAS,EAAE;QACtC,IAAI,OAAO,OAAO,CAAC,YAAY,KAAK,QAAQ,EAAE;YAC5C,YAAY,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,CAAA;SAC5C;aAAM;YACL,YAAY,GAAG,OAAO,CAAC,YAAY,CAAA;SACpC;KACF;IAED,OAAO;QACL,YAAY,EAAE,YAAY;QAC1B,OAAO,EAAE,OAAO,CAAC,OAAO;QACxB,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,YAAY,CAAC,QAAQ;KAClD,CAAA;AACH,CAAC","sourcesContent":["import { MoveResource, Transaction_UserTransaction, TransactionPayload_EntryFunctionPayload } from './move-types.js'\n\nimport { MOVE_CODER, MoveCoder } from './move-coder.js'\nimport { AptosBindOptions, AptosNetwork, getChainId } from './network.js'\nimport { AptosContext, AptosResourcesContext } from './context.js'\nimport { EventInstance } from './models.js'\nimport { ListStateStorage, mergeProcessResults } from '@sentio/runtime'\nimport {\n MoveFetchConfig,\n Data_AptResource,\n HandleInterval,\n ProcessResult,\n Data_AptEvent,\n Data_AptCall,\n} from '@sentio/protos'\nimport { ServerError, Status } from 'nice-grpc'\nimport { CallHandler, EventFilter, EventHandler, FunctionNameAndCallFilter, parseMoveType } from '../move/index.js'\n\ntype IndexConfigure = {\n address: string\n network: AptosNetwork\n startVersion: bigint\n // endSeqNumber?: Long\n}\n\nclass ResourceHandlder {\n type?: string\n versionInterval?: HandleInterval\n timeIntervalInMinutes?: HandleInterval\n handler: (resource: Data_AptResource) => Promise<ProcessResult>\n}\n\nexport class AptosProcessorState extends ListStateStorage<AptosBaseProcessor> {\n static INSTANCE = new AptosProcessorState()\n}\n\nexport class AptosBaseProcessor {\n readonly moduleName: string\n config: IndexConfigure\n eventHandlers: EventHandler<Data_AptEvent>[] = []\n callHandlers: CallHandler<Data_AptCall>[] = []\n\n constructor(moduleName: string, options: AptosBindOptions) {\n this.moduleName = moduleName\n this.config = configure(options)\n AptosProcessorState.INSTANCE.addValue(this)\n this.loadTypes(MOVE_CODER)\n }\n\n // getABI(): MoveModule | undefined {\n // return undefined\n // }\n\n public onTransaction(\n handler: (transaction: Transaction_UserTransaction, ctx: AptosContext) => void,\n includedFailed = false,\n fetchConfig?: MoveFetchConfig\n ): this {\n const _fetchConfig = fetchConfig || MoveFetchConfig.fromPartial({})\n\n // const address = this.config.address\n // const moduleName = this.moduleName\n const processor = this\n this.callHandlers.push({\n handler: async function (data) {\n if (!data.transaction) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'call is null')\n }\n const call = data.transaction as Transaction_UserTransaction\n const ctx = new AptosContext(\n processor.moduleName,\n processor.config.network,\n processor.config.address,\n BigInt(data.transaction.version),\n call,\n 0\n )\n await handler(call, ctx)\n return ctx.getProcessResult()\n },\n filters: [{ function: '', includeFailed: includedFailed }],\n fetchConfig: _fetchConfig,\n })\n return this\n }\n\n public onMoveEvent(\n handler: (event: EventInstance, ctx: AptosContext) => void,\n filter: EventFilter | EventFilter[],\n fetchConfig?: MoveFetchConfig\n ): this {\n let _filters: EventFilter[] = []\n const _fetchConfig = fetchConfig || MoveFetchConfig.fromPartial({})\n\n if (Array.isArray(filter)) {\n _filters = filter\n } else {\n _filters.push(filter)\n }\n\n const address = this.config.address\n // const moduleName = this.moduleName\n\n const processor = this\n const allEventType = new Set(_filters.map((f) => address + '::' + f.type))\n\n this.eventHandlers.push({\n handler: async function (data) {\n if (!data.transaction) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'event is null')\n }\n const txn = data.transaction as Transaction_UserTransaction\n if (!txn.events.length) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'no event in the transactions')\n }\n\n const events = txn.events\n txn.events = []\n const processResults = []\n\n for (const [idx, evt] of events.entries()) {\n const typeQname = parseMoveType(evt.type).qname\n if (!allEventType.has(typeQname)) {\n continue\n }\n\n const ctx = new AptosContext(\n processor.moduleName,\n processor.config.network,\n processor.config.address,\n BigInt(txn.version),\n txn,\n idx\n )\n const eventInstance = evt as EventInstance\n const decoded = MOVE_CODER.decodeEvent<any>(eventInstance)\n await handler(decoded || eventInstance, ctx)\n processResults.push(ctx.getProcessResult())\n }\n\n return mergeProcessResults(processResults)\n },\n filters: _filters,\n fetchConfig: _fetchConfig,\n })\n return this\n }\n\n public onEntryFunctionCall(\n handler: (call: TransactionPayload_EntryFunctionPayload, ctx: AptosContext) => void,\n filter: FunctionNameAndCallFilter | FunctionNameAndCallFilter[],\n fetchConfig?: Partial<MoveFetchConfig>\n ): this {\n let _filters: FunctionNameAndCallFilter[] = []\n const _fetchConfig = MoveFetchConfig.fromPartial(fetchConfig || {})\n\n if (Array.isArray(filter)) {\n _filters = filter\n } else {\n _filters.push(filter)\n }\n\n // const address = this.config.address\n // const moduleName = this.moduleName\n const processor = this\n\n this.callHandlers.push({\n handler: async function (data) {\n if (!data.transaction) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'call is null')\n }\n const tx = data.transaction as Transaction_UserTransaction\n\n const ctx = new AptosContext(\n processor.moduleName,\n processor.config.network,\n processor.config.address,\n BigInt(tx.version),\n tx,\n 0\n )\n if (tx) {\n const payload = tx.payload as TransactionPayload_EntryFunctionPayload\n const decoded = MOVE_CODER.decodeFunctionPayload(payload)\n await handler(decoded, ctx)\n }\n return ctx.getProcessResult()\n },\n filters: _filters,\n fetchConfig: _fetchConfig,\n })\n return this\n }\n\n getChainId(): string {\n return getChainId(this.config.network)\n }\n\n loadTypes(registry: MoveCoder) {\n if (registry.contains(this.config.address, this.moduleName)) {\n return\n }\n this.loadTypesInternal(registry)\n }\n\n protected loadTypesInternal(registry: MoveCoder) {\n // should be override by subclass\n console.log('')\n }\n}\n\nexport class AptosAccountProcessorState extends ListStateStorage<AptosResourcesProcessor> {\n static INSTANCE = new AptosAccountProcessorState()\n}\n\nexport class AptosResourcesProcessor {\n config: IndexConfigure\n\n resourcesHandlers: ResourceHandlder[] = []\n\n static bind(options: AptosBindOptions): AptosResourcesProcessor {\n return new AptosResourcesProcessor(options)\n }\n\n protected constructor(options: AptosBindOptions) {\n this.config = configure(options)\n AptosAccountProcessorState.INSTANCE.addValue(this)\n }\n\n getChainId(): string {\n return getChainId(this.config.network)\n }\n\n private onInterval(\n handler: (resources: MoveResource[], ctx: AptosResourcesContext) => void,\n timeInterval: HandleInterval | undefined,\n versionInterval: HandleInterval | undefined,\n type: string | undefined\n ): this {\n const processor = this\n this.resourcesHandlers.push({\n handler: async function (data) {\n if (data.timestampMicros > Number.MAX_SAFE_INTEGER) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'timestamp is too large')\n }\n const timestamp = Number(data.timestampMicros)\n\n const ctx = new AptosResourcesContext(\n processor.config.network,\n processor.config.address,\n data.version,\n timestamp\n )\n await handler(data.resources as MoveResource[], ctx)\n return ctx.getProcessResult()\n },\n timeIntervalInMinutes: timeInterval,\n versionInterval: versionInterval,\n type: type,\n })\n return this\n }\n\n public onTimeInterval(\n handler: (resources: MoveResource[], ctx: AptosResourcesContext) => void,\n timeIntervalInMinutes = 60,\n backfillTimeIntervalInMinutes = 240,\n type?: string\n ): this {\n return this.onInterval(\n handler,\n {\n recentInterval: timeIntervalInMinutes,\n backfillInterval: backfillTimeIntervalInMinutes,\n },\n undefined,\n type\n )\n }\n\n public onVersionInterval(\n handler: (resources: MoveResource[], ctx: AptosResourcesContext) => void,\n versionInterval = 100000,\n backfillVersionInterval = 400000,\n typePrefix?: string\n ): this {\n return this.onInterval(\n handler,\n undefined,\n { recentInterval: versionInterval, backfillInterval: backfillVersionInterval },\n typePrefix\n )\n }\n}\n\nfunction configure(options: AptosBindOptions): IndexConfigure {\n let startVersion = 0n\n if (options.startVersion !== undefined) {\n if (typeof options.startVersion === 'number') {\n startVersion = BigInt(options.startVersion)\n } else {\n startVersion = options.startVersion\n }\n }\n\n return {\n startVersion: startVersion,\n address: options.address,\n network: options.network || AptosNetwork.MAIN_NET,\n }\n}\n"]}
1
+ {"version":3,"file":"aptos-processor.js","sourceRoot":"","sources":["../../src/aptos/aptos-processor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,UAAU,EAAa,MAAM,iBAAiB,CAAA;AACvD,OAAO,EAAoB,YAAY,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzE,OAAO,EAAE,YAAY,EAAE,qBAAqB,EAAE,MAAM,cAAc,CAAA;AAElE,OAAO,EAAE,gBAAgB,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAA;AACvE,OAAO,EACL,eAAe,GAMhB,MAAM,gBAAgB,CAAA;AACvB,OAAO,EAAE,WAAW,EAAE,MAAM,EAAE,MAAM,WAAW,CAAA;AAC/C,OAAO,EAAqE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AASnH,MAAM,gBAAgB;I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cesContent":["import { MoveResource, Transaction_UserTransaction, TransactionPayload_EntryFunctionPayload } from './move-types.js'\n\nimport { MOVE_CODER, MoveCoder } from './move-coder.js'\nimport { AptosBindOptions, AptosNetwork, getChainId } from './network.js'\nimport { AptosContext, AptosResourcesContext } from './context.js'\nimport { EventInstance } from './models.js'\nimport { ListStateStorage, mergeProcessResults } from '@sentio/runtime'\nimport {\n MoveFetchConfig,\n Data_AptResource,\n HandleInterval,\n ProcessResult,\n Data_AptEvent,\n Data_AptCall,\n} from '@sentio/protos'\nimport { ServerError, Status } from 'nice-grpc'\nimport { CallHandler, EventFilter, EventHandler, FunctionNameAndCallFilter, parseMoveType } from '../move/index.js'\n\ntype IndexConfigure = {\n address: string\n network: AptosNetwork\n startVersion: bigint\n // endSeqNumber?: Long\n}\n\nclass ResourceHandlder {\n type?: string\n versionInterval?: HandleInterval\n timeIntervalInMinutes?: HandleInterval\n handler: (resource: Data_AptResource) => Promise<ProcessResult>\n}\n\nexport class AptosProcessorState extends ListStateStorage<AptosBaseProcessor> {\n static INSTANCE = new AptosProcessorState()\n}\n\nexport class AptosBaseProcessor {\n readonly moduleName: string\n config: IndexConfigure\n eventHandlers: EventHandler<Data_AptEvent>[] = []\n callHandlers: CallHandler<Data_AptCall>[] = []\n\n constructor(moduleName: string, options: AptosBindOptions) {\n this.moduleName = moduleName\n this.config = configure(options)\n AptosProcessorState.INSTANCE.addValue(this)\n this.loadTypes(MOVE_CODER)\n }\n\n // getABI(): MoveModule | undefined {\n // return undefined\n // }\n\n public onTransaction(\n handler: (transaction: Transaction_UserTransaction, ctx: AptosContext) => void,\n includedFailed = false,\n fetchConfig?: Partial<MoveFetchConfig>\n ): this {\n const _fetchConfig = MoveFetchConfig.fromPartial(fetchConfig || {})\n\n // const address = this.config.address\n // const moduleName = this.moduleName\n const processor = this\n this.callHandlers.push({\n handler: async function (data) {\n if (!data.transaction) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'call is null')\n }\n const call = data.transaction as Transaction_UserTransaction\n const ctx = new AptosContext(\n processor.moduleName,\n processor.config.network,\n processor.config.address,\n BigInt(data.transaction.version),\n call,\n 0\n )\n await handler(call, ctx)\n return ctx.getProcessResult()\n },\n filters: [{ function: '', includeFailed: includedFailed }],\n fetchConfig: _fetchConfig,\n })\n return this\n }\n\n public onMoveEvent(\n handler: (event: EventInstance, ctx: AptosContext) => void,\n filter: EventFilter | EventFilter[],\n fetchConfig?: Partial<MoveFetchConfig>\n ): this {\n let _filters: EventFilter[] = []\n const _fetchConfig = MoveFetchConfig.fromPartial(fetchConfig || {})\n\n if (Array.isArray(filter)) {\n _filters = filter\n } else {\n _filters.push(filter)\n }\n\n // const moduleName = this.moduleName\n\n const processor = this\n const allEventType = new Set(_filters.map((f) => processor.config.address + '::' + f.type))\n\n this.eventHandlers.push({\n handler: async function (data) {\n if (!data.transaction) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'event is null')\n }\n const txn = data.transaction as Transaction_UserTransaction\n if (!txn.events.length) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'no event in the transactions')\n }\n\n const processResults = []\n for (const [idx, evt] of txn.events.entries()) {\n const typeQname = parseMoveType(evt.type).qname\n if (!allEventType.has(typeQname)) {\n continue\n }\n\n const ctx = new AptosContext(\n processor.moduleName,\n processor.config.network,\n processor.config.address,\n BigInt(txn.version),\n txn,\n idx\n )\n const eventInstance = evt as EventInstance\n const decoded = MOVE_CODER.decodeEvent<any>(eventInstance)\n await handler(decoded || eventInstance, ctx)\n processResults.push(ctx.getProcessResult())\n }\n\n return mergeProcessResults(processResults)\n },\n filters: _filters,\n fetchConfig: _fetchConfig,\n })\n return this\n }\n\n public onEntryFunctionCall(\n handler: (call: TransactionPayload_EntryFunctionPayload, ctx: AptosContext) => void,\n filter: FunctionNameAndCallFilter | FunctionNameAndCallFilter[],\n fetchConfig?: Partial<MoveFetchConfig>\n ): this {\n let _filters: FunctionNameAndCallFilter[] = []\n const _fetchConfig = MoveFetchConfig.fromPartial(fetchConfig || {})\n\n if (Array.isArray(filter)) {\n _filters = filter\n } else {\n _filters.push(filter)\n }\n\n // const address = this.config.address\n // const moduleName = this.moduleName\n const processor = this\n\n this.callHandlers.push({\n handler: async function (data) {\n if (!data.transaction) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'call is null')\n }\n const tx = data.transaction as Transaction_UserTransaction\n\n const ctx = new AptosContext(\n processor.moduleName,\n processor.config.network,\n processor.config.address,\n BigInt(tx.version),\n tx,\n 0\n )\n if (tx) {\n const payload = tx.payload as TransactionPayload_EntryFunctionPayload\n const decoded = MOVE_CODER.decodeFunctionPayload(payload)\n await handler(decoded, ctx)\n }\n return ctx.getProcessResult()\n },\n filters: _filters,\n fetchConfig: _fetchConfig,\n })\n return this\n }\n\n getChainId(): string {\n return getChainId(this.config.network)\n }\n\n loadTypes(registry: MoveCoder) {\n if (registry.contains(this.config.address, this.moduleName)) {\n return\n }\n this.loadTypesInternal(registry)\n }\n\n protected loadTypesInternal(registry: MoveCoder) {\n // should be override by subclass\n console.log('')\n }\n}\n\nexport class AptosAccountProcessorState extends ListStateStorage<AptosResourcesProcessor> {\n static INSTANCE = new AptosAccountProcessorState()\n}\n\nexport class AptosResourcesProcessor {\n config: IndexConfigure\n\n resourcesHandlers: ResourceHandlder[] = []\n\n static bind(options: AptosBindOptions): AptosResourcesProcessor {\n return new AptosResourcesProcessor(options)\n }\n\n protected constructor(options: AptosBindOptions) {\n this.config = configure(options)\n AptosAccountProcessorState.INSTANCE.addValue(this)\n }\n\n getChainId(): string {\n return getChainId(this.config.network)\n }\n\n private onInterval(\n handler: (resources: MoveResource[], ctx: AptosResourcesContext) => void,\n timeInterval: HandleInterval | undefined,\n versionInterval: HandleInterval | undefined,\n type: string | undefined\n ): this {\n const processor = this\n this.resourcesHandlers.push({\n handler: async function (data) {\n if (data.timestampMicros > Number.MAX_SAFE_INTEGER) {\n throw new ServerError(Status.INVALID_ARGUMENT, 'timestamp is too large')\n }\n const timestamp = Number(data.timestampMicros)\n\n const ctx = new AptosResourcesContext(\n processor.config.network,\n processor.config.address,\n data.version,\n timestamp\n )\n await handler(data.resources as MoveResource[], ctx)\n return ctx.getProcessResult()\n },\n timeIntervalInMinutes: timeInterval,\n versionInterval: versionInterval,\n type: type,\n })\n return this\n }\n\n public onTimeInterval(\n handler: (resources: MoveResource[], ctx: AptosResourcesContext) => void,\n timeIntervalInMinutes = 60,\n backfillTimeIntervalInMinutes = 240,\n type?: string\n ): this {\n return this.onInterval(\n handler,\n {\n recentInterval: timeIntervalInMinutes,\n backfillInterval: backfillTimeIntervalInMinutes,\n },\n undefined,\n type\n )\n }\n\n public onVersionInterval(\n handler: (resources: MoveResource[], ctx: AptosResourcesContext) => void,\n versionInterval = 100000,\n backfillVersionInterval = 400000,\n typePrefix?: string\n ): this {\n return this.onInterval(\n handler,\n undefined,\n { recentInterval: versionInterval, backfillInterval: backfillVersionInterval },\n typePrefix\n )\n }\n}\n\nfunction configure(options: AptosBindOptions): IndexConfigure {\n let startVersion = 0n\n if (options.startVersion !== undefined) {\n if (typeof options.startVersion === 'number') {\n startVersion = BigInt(options.startVersion)\n } else {\n startVersion = options.startVersion\n }\n }\n\n return {\n startVersion: startVersion,\n address: options.address,\n network: options.network || AptosNetwork.MAIN_NET,\n }\n}\n"]}
@@ -72,8 +72,8 @@ export declare class coin extends AptosBaseProcessor {
72
72
  onEntryTransfer(func: (call: coin.TransferPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): coin;
73
73
  onEntryUnfreezeCoinStore(func: (call: coin.UnfreezeCoinStorePayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): coin;
74
74
  onEntryUpgradeSupply(func: (call: coin.UpgradeSupplyPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): coin;
75
- onEventDepositEvent(func: (event: coin.DepositEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): coin;
76
- onEventWithdrawEvent(func: (event: coin.WithdrawEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): coin;
75
+ onEventDepositEvent(func: (event: coin.DepositEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): coin;
76
+ onEventWithdrawEvent(func: (event: coin.WithdrawEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): coin;
77
77
  }
78
78
  export declare namespace coin {
79
79
  class AggregatableCoin<T0> {
@@ -164,8 +164,8 @@ export declare class block extends AptosBaseProcessor {
164
164
  constructor(options: AptosBindOptions);
165
165
  static DEFAULT_OPTIONS: AptosBindOptions;
166
166
  static bind(options?: Partial<AptosBindOptions>): block;
167
- onEventNewBlockEvent(func: (event: block.NewBlockEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): block;
168
- onEventUpdateEpochIntervalEvent(func: (event: block.UpdateEpochIntervalEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): block;
167
+ onEventNewBlockEvent(func: (event: block.NewBlockEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): block;
168
+ onEventUpdateEpochIntervalEvent(func: (event: block.UpdateEpochIntervalEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): block;
169
169
  }
170
170
  export declare namespace block {
171
171
  class BlockResource {
@@ -226,18 +226,18 @@ export declare class stake extends AptosBaseProcessor {
226
226
  onEntryUnlock(func: (call: stake.UnlockPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): stake;
227
227
  onEntryUpdateNetworkAndFullnodeAddresses(func: (call: stake.UpdateNetworkAndFullnodeAddressesPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): stake;
228
228
  onEntryWithdraw(func: (call: stake.WithdrawPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): stake;
229
- onEventRegisterValidatorCandidateEvent(func: (event: stake.RegisterValidatorCandidateEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): stake;
230
- onEventSetOperatorEvent(func: (event: stake.SetOperatorEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): stake;
231
- onEventAddStakeEvent(func: (event: stake.AddStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): stake;
232
- onEventReactivateStakeEvent(func: (event: stake.ReactivateStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): stake;
233
- onEventRotateConsensusKeyEvent(func: (event: stake.RotateConsensusKeyEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): stake;
234
- onEventUpdateNetworkAndFullnodeAddressesEvent(func: (event: stake.UpdateNetworkAndFullnodeAddressesEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): stake;
235
- onEventIncreaseLockupEvent(func: (event: stake.IncreaseLockupEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): stake;
236
- onEventJoinValidatorSetEvent(func: (event: stake.JoinValidatorSetEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): stake;
237
- onEventDistributeRewardsEvent(func: (event: stake.DistributeRewardsEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): stake;
238
- onEventUnlockStakeEvent(func: (event: stake.UnlockStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): stake;
239
- onEventWithdrawStakeEvent(func: (event: stake.WithdrawStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): stake;
240
- onEventLeaveValidatorSetEvent(func: (event: stake.LeaveValidatorSetEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): stake;
229
+ onEventRegisterValidatorCandidateEvent(func: (event: stake.RegisterValidatorCandidateEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): stake;
230
+ onEventSetOperatorEvent(func: (event: stake.SetOperatorEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): stake;
231
+ onEventAddStakeEvent(func: (event: stake.AddStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): stake;
232
+ onEventReactivateStakeEvent(func: (event: stake.ReactivateStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): stake;
233
+ onEventRotateConsensusKeyEvent(func: (event: stake.RotateConsensusKeyEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): stake;
234
+ onEventUpdateNetworkAndFullnodeAddressesEvent(func: (event: stake.UpdateNetworkAndFullnodeAddressesEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): stake;
235
+ onEventIncreaseLockupEvent(func: (event: stake.IncreaseLockupEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): stake;
236
+ onEventJoinValidatorSetEvent(func: (event: stake.JoinValidatorSetEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): stake;
237
+ onEventDistributeRewardsEvent(func: (event: stake.DistributeRewardsEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): stake;
238
+ onEventUnlockStakeEvent(func: (event: stake.UnlockStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): stake;
239
+ onEventWithdrawStakeEvent(func: (event: stake.WithdrawStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): stake;
240
+ onEventLeaveValidatorSetEvent(func: (event: stake.LeaveValidatorSetEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): stake;
241
241
  }
242
242
  export declare namespace stake {
243
243
  class AddStakeEvent {
@@ -489,7 +489,7 @@ export declare class object_ extends AptosBaseProcessor {
489
489
  static DEFAULT_OPTIONS: AptosBindOptions;
490
490
  static bind(options?: Partial<AptosBindOptions>): object_;
491
491
  onEntryTransferCall(func: (call: object_.TransferCallPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): object_;
492
- onEventTransferEvent(func: (event: object_.TransferEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): object_;
492
+ onEventTransferEvent(func: (event: object_.TransferEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): object_;
493
493
  }
494
494
  export declare namespace object_ {
495
495
  class ConstructorRef {
@@ -562,10 +562,10 @@ export declare class voting extends AptosBaseProcessor {
562
562
  constructor(options: AptosBindOptions);
563
563
  static DEFAULT_OPTIONS: AptosBindOptions;
564
564
  static bind(options?: Partial<AptosBindOptions>): voting;
565
- onEventCreateProposalEvent(func: (event: voting.CreateProposalEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): voting;
566
- onEventRegisterForumEvent(func: (event: voting.RegisterForumEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): voting;
567
- onEventResolveProposal(func: (event: voting.ResolveProposalInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): voting;
568
- onEventVoteEvent(func: (event: voting.VoteEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): voting;
565
+ onEventCreateProposalEvent(func: (event: voting.CreateProposalEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): voting;
566
+ onEventRegisterForumEvent(func: (event: voting.RegisterForumEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): voting;
567
+ onEventResolveProposal(func: (event: voting.ResolveProposalInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): voting;
568
+ onEventVoteEvent(func: (event: voting.VoteEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): voting;
569
569
  }
570
570
  export declare namespace voting {
571
571
  class CreateProposalEvent {
@@ -651,8 +651,8 @@ export declare class account extends AptosBaseProcessor {
651
651
  onEntryRevokeSignerCapability(func: (call: account.RevokeSignerCapabilityPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): account;
652
652
  onEntryRotateAuthenticationKey(func: (call: account.RotateAuthenticationKeyPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): account;
653
653
  onEntryRotateAuthenticationKeyWithRotationCapability(func: (call: account.RotateAuthenticationKeyWithRotationCapabilityPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): account;
654
- onEventCoinRegisterEvent(func: (event: account.CoinRegisterEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): account;
655
- onEventKeyRotationEvent(func: (event: account.KeyRotationEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): account;
654
+ onEventCoinRegisterEvent(func: (event: account.CoinRegisterEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): account;
655
+ onEventKeyRotationEvent(func: (event: account.KeyRotationEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): account;
656
656
  }
657
657
  export declare namespace account {
658
658
  class Account {
@@ -860,16 +860,16 @@ export declare class vesting extends AptosBaseProcessor {
860
860
  onEntryUpdateVoter(func: (call: vesting.UpdateVoterPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): vesting;
861
861
  onEntryVest(func: (call: vesting.VestPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): vesting;
862
862
  onEntryVestMany(func: (call: vesting.VestManyPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): vesting;
863
- onEventCreateVestingContractEvent(func: (event: vesting.CreateVestingContractEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): vesting;
864
- onEventUpdateOperatorEvent(func: (event: vesting.UpdateOperatorEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): vesting;
865
- onEventUpdateVoterEvent(func: (event: vesting.UpdateVoterEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): vesting;
866
- onEventResetLockupEvent(func: (event: vesting.ResetLockupEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): vesting;
867
- onEventSetBeneficiaryEvent(func: (event: vesting.SetBeneficiaryEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): vesting;
868
- onEventUnlockRewardsEvent(func: (event: vesting.UnlockRewardsEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): vesting;
869
- onEventVestEvent(func: (event: vesting.VestEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): vesting;
870
- onEventDistributeEvent(func: (event: vesting.DistributeEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): vesting;
871
- onEventTerminateEvent(func: (event: vesting.TerminateEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): vesting;
872
- onEventAdminWithdrawEvent(func: (event: vesting.AdminWithdrawEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): vesting;
863
+ onEventCreateVestingContractEvent(func: (event: vesting.CreateVestingContractEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): vesting;
864
+ onEventUpdateOperatorEvent(func: (event: vesting.UpdateOperatorEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): vesting;
865
+ onEventUpdateVoterEvent(func: (event: vesting.UpdateVoterEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): vesting;
866
+ onEventResetLockupEvent(func: (event: vesting.ResetLockupEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): vesting;
867
+ onEventSetBeneficiaryEvent(func: (event: vesting.SetBeneficiaryEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): vesting;
868
+ onEventUnlockRewardsEvent(func: (event: vesting.UnlockRewardsEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): vesting;
869
+ onEventVestEvent(func: (event: vesting.VestEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): vesting;
870
+ onEventDistributeEvent(func: (event: vesting.DistributeEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): vesting;
871
+ onEventTerminateEvent(func: (event: vesting.TerminateEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): vesting;
872
+ onEventAdminWithdrawEvent(func: (event: vesting.AdminWithdrawEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): vesting;
873
873
  }
874
874
  export declare namespace vesting {
875
875
  class AdminStore {
@@ -1414,7 +1414,7 @@ export declare class aptos_account extends AptosBaseProcessor {
1414
1414
  onEntrySetAllowDirectCoinTransfers(func: (call: aptos_account.SetAllowDirectCoinTransfersPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): aptos_account;
1415
1415
  onEntryTransfer(func: (call: aptos_account.TransferPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): aptos_account;
1416
1416
  onEntryTransferCoins(func: (call: aptos_account.TransferCoinsPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): aptos_account;
1417
- onEventDirectCoinTransferConfigUpdatedEvent(func: (event: aptos_account.DirectCoinTransferConfigUpdatedEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): aptos_account;
1417
+ onEventDirectCoinTransferConfigUpdatedEvent(func: (event: aptos_account.DirectCoinTransferConfigUpdatedEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): aptos_account;
1418
1418
  }
1419
1419
  export declare namespace aptos_account {
1420
1420
  class DirectCoinTransferConfigUpdatedEvent {
@@ -1563,11 +1563,11 @@ export declare class delegation_pool extends AptosBaseProcessor {
1563
1563
  onEntrySynchronizeDelegationPool(func: (call: delegation_pool.SynchronizeDelegationPoolPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): delegation_pool;
1564
1564
  onEntryUnlock(func: (call: delegation_pool.UnlockPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): delegation_pool;
1565
1565
  onEntryWithdraw(func: (call: delegation_pool.WithdrawPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): delegation_pool;
1566
- onEventAddStakeEvent(func: (event: delegation_pool.AddStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): delegation_pool;
1567
- onEventReactivateStakeEvent(func: (event: delegation_pool.ReactivateStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): delegation_pool;
1568
- onEventUnlockStakeEvent(func: (event: delegation_pool.UnlockStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): delegation_pool;
1569
- onEventWithdrawStakeEvent(func: (event: delegation_pool.WithdrawStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): delegation_pool;
1570
- onEventDistributeCommissionEvent(func: (event: delegation_pool.DistributeCommissionEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): delegation_pool;
1566
+ onEventAddStakeEvent(func: (event: delegation_pool.AddStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): delegation_pool;
1567
+ onEventReactivateStakeEvent(func: (event: delegation_pool.ReactivateStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): delegation_pool;
1568
+ onEventUnlockStakeEvent(func: (event: delegation_pool.UnlockStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): delegation_pool;
1569
+ onEventWithdrawStakeEvent(func: (event: delegation_pool.WithdrawStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): delegation_pool;
1570
+ onEventDistributeCommissionEvent(func: (event: delegation_pool.DistributeCommissionEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): delegation_pool;
1571
1571
  }
1572
1572
  export declare namespace delegation_pool {
1573
1573
  class AddStakeEvent {
@@ -1682,7 +1682,7 @@ export declare class reconfiguration extends AptosBaseProcessor {
1682
1682
  constructor(options: AptosBindOptions);
1683
1683
  static DEFAULT_OPTIONS: AptosBindOptions;
1684
1684
  static bind(options?: Partial<AptosBindOptions>): reconfiguration;
1685
- onEventNewEpochEvent(func: (event: reconfiguration.NewEpochEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): reconfiguration;
1685
+ onEventNewEpochEvent(func: (event: reconfiguration.NewEpochEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): reconfiguration;
1686
1686
  }
1687
1687
  export declare namespace reconfiguration {
1688
1688
  class Configuration {
@@ -1724,9 +1724,9 @@ export declare class aptos_governance extends AptosBaseProcessor {
1724
1724
  onEntryCreateProposal(func: (call: aptos_governance.CreateProposalPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): aptos_governance;
1725
1725
  onEntryCreateProposalV2(func: (call: aptos_governance.CreateProposalV2Payload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): aptos_governance;
1726
1726
  onEntryVote(func: (call: aptos_governance.VotePayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): aptos_governance;
1727
- onEventCreateProposalEvent(func: (event: aptos_governance.CreateProposalEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): aptos_governance;
1728
- onEventUpdateConfigEvent(func: (event: aptos_governance.UpdateConfigEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): aptos_governance;
1729
- onEventVoteEvent(func: (event: aptos_governance.VoteEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): aptos_governance;
1727
+ onEventCreateProposalEvent(func: (event: aptos_governance.CreateProposalEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): aptos_governance;
1728
+ onEventUpdateConfigEvent(func: (event: aptos_governance.UpdateConfigEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): aptos_governance;
1729
+ onEventVoteEvent(func: (event: aptos_governance.VoteEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): aptos_governance;
1730
1730
  }
1731
1731
  export declare namespace aptos_governance {
1732
1732
  class ApprovedExecutionHashes {
@@ -1834,15 +1834,15 @@ export declare class multisig_account extends AptosBaseProcessor {
1834
1834
  onEntryUpdateMetadata(func: (call: multisig_account.UpdateMetadataPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): multisig_account;
1835
1835
  onEntryUpdateSignaturesRequired(func: (call: multisig_account.UpdateSignaturesRequiredPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): multisig_account;
1836
1836
  onEntryVoteTransanction(func: (call: multisig_account.VoteTransanctionPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): multisig_account;
1837
- onEventAddOwnersEvent(func: (event: multisig_account.AddOwnersEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): multisig_account;
1838
- onEventRemoveOwnersEvent(func: (event: multisig_account.RemoveOwnersEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): multisig_account;
1839
- onEventUpdateSignaturesRequiredEvent(func: (event: multisig_account.UpdateSignaturesRequiredEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): multisig_account;
1840
- onEventCreateTransactionEvent(func: (event: multisig_account.CreateTransactionEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): multisig_account;
1841
- onEventVoteEvent(func: (event: multisig_account.VoteEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): multisig_account;
1842
- onEventExecuteRejectedTransactionEvent(func: (event: multisig_account.ExecuteRejectedTransactionEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): multisig_account;
1843
- onEventTransactionExecutionSucceededEvent(func: (event: multisig_account.TransactionExecutionSucceededEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): multisig_account;
1844
- onEventTransactionExecutionFailedEvent(func: (event: multisig_account.TransactionExecutionFailedEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): multisig_account;
1845
- onEventMetadataUpdatedEvent(func: (event: multisig_account.MetadataUpdatedEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): multisig_account;
1837
+ onEventAddOwnersEvent(func: (event: multisig_account.AddOwnersEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): multisig_account;
1838
+ onEventRemoveOwnersEvent(func: (event: multisig_account.RemoveOwnersEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): multisig_account;
1839
+ onEventUpdateSignaturesRequiredEvent(func: (event: multisig_account.UpdateSignaturesRequiredEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): multisig_account;
1840
+ onEventCreateTransactionEvent(func: (event: multisig_account.CreateTransactionEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): multisig_account;
1841
+ onEventVoteEvent(func: (event: multisig_account.VoteEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): multisig_account;
1842
+ onEventExecuteRejectedTransactionEvent(func: (event: multisig_account.ExecuteRejectedTransactionEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): multisig_account;
1843
+ onEventTransactionExecutionSucceededEvent(func: (event: multisig_account.TransactionExecutionSucceededEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): multisig_account;
1844
+ onEventTransactionExecutionFailedEvent(func: (event: multisig_account.TransactionExecutionFailedEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): multisig_account;
1845
+ onEventMetadataUpdatedEvent(func: (event: multisig_account.MetadataUpdatedEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): multisig_account;
1846
1846
  }
1847
1847
  export declare namespace multisig_account {
1848
1848
  class AddOwnersEvent {
@@ -2102,16 +2102,16 @@ export declare class staking_contract extends AptosBaseProcessor {
2102
2102
  onEntryUnlockStake(func: (call: staking_contract.UnlockStakePayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): staking_contract;
2103
2103
  onEntryUpdateCommision(func: (call: staking_contract.UpdateCommisionPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): staking_contract;
2104
2104
  onEntryUpdateVoter(func: (call: staking_contract.UpdateVoterPayload, ctx: AptosContext) => void, filter?: CallFilter, fetchConfig?: Partial<MoveFetchConfig>): staking_contract;
2105
- onEventUpdateCommissionEvent(func: (event: staking_contract.UpdateCommissionEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): staking_contract;
2106
- onEventCreateStakingContractEvent(func: (event: staking_contract.CreateStakingContractEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): staking_contract;
2107
- onEventUpdateVoterEvent(func: (event: staking_contract.UpdateVoterEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): staking_contract;
2108
- onEventResetLockupEvent(func: (event: staking_contract.ResetLockupEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): staking_contract;
2109
- onEventAddStakeEvent(func: (event: staking_contract.AddStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): staking_contract;
2110
- onEventRequestCommissionEvent(func: (event: staking_contract.RequestCommissionEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): staking_contract;
2111
- onEventUnlockStakeEvent(func: (event: staking_contract.UnlockStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): staking_contract;
2112
- onEventSwitchOperatorEvent(func: (event: staking_contract.SwitchOperatorEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): staking_contract;
2113
- onEventAddDistributionEvent(func: (event: staking_contract.AddDistributionEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): staking_contract;
2114
- onEventDistributeEvent(func: (event: staking_contract.DistributeEventInstance, ctx: AptosContext) => void, fetchConfig?: MoveFetchConfig): staking_contract;
2105
+ onEventUpdateCommissionEvent(func: (event: staking_contract.UpdateCommissionEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): staking_contract;
2106
+ onEventCreateStakingContractEvent(func: (event: staking_contract.CreateStakingContractEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): staking_contract;
2107
+ onEventUpdateVoterEvent(func: (event: staking_contract.UpdateVoterEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): staking_contract;
2108
+ onEventResetLockupEvent(func: (event: staking_contract.ResetLockupEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): staking_contract;
2109
+ onEventAddStakeEvent(func: (event: staking_contract.AddStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): staking_contract;
2110
+ onEventRequestCommissionEvent(func: (event: staking_contract.RequestCommissionEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): staking_contract;
2111
+ onEventUnlockStakeEvent(func: (event: staking_contract.UnlockStakeEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): staking_contract;
2112
+ onEventSwitchOperatorEvent(func: (event: staking_contract.SwitchOperatorEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): staking_contract;
2113
+ onEventAddDistributionEvent(func: (event: staking_contract.AddDistributionEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): staking_contract;
2114
+ onEventDistributeEvent(func: (event: staking_contract.DistributeEventInstance, ctx: AptosContext) => void, fetchConfig?: Partial<MoveFetchConfig>): staking_contract;
2115
2115
  }
2116
2116
  export declare namespace staking_contract {
2117
2117
  class AddDistributionEvent {