@sentio/sdk 2.13.0-rc.1 → 2.13.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.
- package/lib/aptos/aptos-processor.d.ts +2 -2
- package/lib/aptos/aptos-processor.js +4 -7
- package/lib/aptos/aptos-processor.js.map +1 -1
- package/lib/aptos/builtin/0x1.d.ts +62 -62
- package/lib/aptos/builtin/0x1.js.map +1 -1
- package/lib/aptos/builtin/0x3.d.ts +21 -21
- package/lib/aptos/builtin/0x3.js.map +1 -1
- package/lib/move/abstract-codegen.js +1 -1
- package/lib/move/abstract-codegen.js.map +1 -1
- package/lib/sui/builtin/0x1.d.ts +6 -6
- package/lib/sui/builtin/0x1.js.map +1 -1
- package/lib/sui/builtin/0x2.d.ts +19 -19
- package/lib/sui/builtin/0x2.js.map +1 -1
- package/lib/sui/builtin/0x3.d.ts +9 -9
- package/lib/sui/builtin/0x3.js.map +1 -1
- package/lib/sui/context.d.ts +2 -1
- package/lib/sui/context.js +3 -1
- package/lib/sui/context.js.map +1 -1
- package/lib/sui/sui-processor.js +13 -10
- package/lib/sui/sui-processor.js.map +1 -1
- package/lib/testing/sui-facet.d.ts +2 -2
- package/lib/testing/sui-facet.js +16 -26
- package/lib/testing/sui-facet.js.map +1 -1
- package/package.json +4 -4
- package/src/aptos/aptos-processor.ts +6 -10
- package/src/aptos/builtin/0x1.ts +62 -62
- package/src/aptos/builtin/0x3.ts +21 -21
- package/src/move/abstract-codegen.ts +1 -1
- package/src/sui/builtin/0x1.ts +6 -6
- package/src/sui/builtin/0x2.ts +19 -19
- package/src/sui/builtin/0x3.ts +9 -9
- package/src/sui/context.ts +4 -1
- package/src/sui/sui-processor.ts +23 -18
- package/src/testing/sui-facet.ts +15 -30
@@ -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 ||
|
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 ||
|
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,mBAAmB;AAIhC,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E,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;IACpB,IAA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{ 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 {
|