@sentio/sdk 2.59.0-rc.23 → 2.59.0-rc.24
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 +3 -3
- package/lib/aptos/aptos-processor.d.ts.map +1 -1
- package/lib/aptos/aptos-processor.js +12 -6
- package/lib/aptos/aptos-processor.js.map +1 -1
- package/lib/aptos/builtin/0x1.d.ts +159 -159
- package/lib/aptos/builtin/0x1.d.ts.map +1 -1
- package/lib/aptos/builtin/0x1.js +316 -316
- package/lib/aptos/builtin/0x1.js.map +1 -1
- package/lib/aptos/builtin/0x3.d.ts +52 -52
- package/lib/aptos/builtin/0x3.d.ts.map +1 -1
- package/lib/aptos/builtin/0x3.js +102 -102
- package/lib/aptos/builtin/0x3.js.map +1 -1
- package/lib/aptos/builtin/0x4.d.ts +12 -12
- package/lib/aptos/builtin/0x4.d.ts.map +1 -1
- package/lib/aptos/builtin/0x4.js +22 -22
- package/lib/aptos/builtin/0x4.js.map +1 -1
- package/lib/aptos/codegen/codegen.js +10 -0
- package/lib/aptos/codegen/codegen.js.map +1 -1
- package/lib/aptos/index.d.ts +1 -0
- package/lib/aptos/index.d.ts.map +1 -1
- package/lib/aptos/index.js.map +1 -1
- package/lib/aptos/models.d.ts +5 -0
- package/lib/aptos/models.d.ts.map +1 -1
- package/lib/move/shared-network-codegen.d.ts.map +1 -1
- package/lib/move/shared-network-codegen.js +1 -0
- package/lib/move/shared-network-codegen.js.map +1 -1
- package/lib/sui/builtin/0x1.d.ts.map +1 -1
- package/lib/sui/builtin/0x1.js.map +1 -1
- package/lib/sui/builtin/0x2.d.ts.map +1 -1
- package/lib/sui/builtin/0x2.js.map +1 -1
- package/lib/sui/builtin/0x3.d.ts.map +1 -1
- package/lib/sui/builtin/0x3.js.map +1 -1
- package/lib/sui/models.d.ts +5 -0
- package/lib/sui/models.d.ts.map +1 -1
- package/package.json +3 -3
- package/src/aptos/aptos-processor.ts +12 -8
- package/src/aptos/builtin/0x1.ts +317 -316
- package/src/aptos/builtin/0x3.ts +103 -102
- package/src/aptos/builtin/0x4.ts +23 -22
- package/src/aptos/codegen/codegen.ts +13 -1
- package/src/aptos/index.ts +2 -0
- package/src/aptos/models.ts +7 -0
- package/src/move/shared-network-codegen.ts +1 -0
- package/src/sui/builtin/0x1.ts +1 -0
- package/src/sui/builtin/0x2.ts +1 -0
- package/src/sui/builtin/0x3.ts +1 -0
- package/src/sui/models.ts +7 -0
package/lib/sui/models.d.ts
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
import type { SuiEvent, MoveCallSuiTransaction, SuiMoveObject } from '@mysten/sui/client';
|
2
2
|
import { DecodedStruct } from '@typemove/move';
|
3
|
+
import { MoveFetchConfig } from '@sentio/protos';
|
3
4
|
export type TypedEventInstance<T> = DecodedStruct<SuiEvent, T>;
|
4
5
|
export type TypedSuiMoveObject<T> = DecodedStruct<SuiMoveObject, T>;
|
5
6
|
export type TypedFunctionPayload<T extends Array<any>> = MoveCallSuiTransaction & {
|
@@ -8,4 +9,8 @@ export type TypedFunctionPayload<T extends Array<any>> = MoveCallSuiTransaction
|
|
8
9
|
*/
|
9
10
|
arguments_decoded: T;
|
10
11
|
};
|
12
|
+
export type PartitionHandler<D> = (data: D) => string | Promise<string>;
|
13
|
+
export type HandlerOptions<D> = Partial<MoveFetchConfig> & {
|
14
|
+
partitionKey?: string | PartitionHandler<D>;
|
15
|
+
};
|
11
16
|
//# sourceMappingURL=models.d.ts.map
|
package/lib/sui/models.d.ts.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/sui/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;
|
1
|
+
{"version":3,"file":"models.d.ts","sourceRoot":"","sources":["../../src/sui/models.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,sBAAsB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AACzF,OAAO,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAA;AAC9C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAEhD,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,aAAa,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAA;AAC9D,MAAM,MAAM,kBAAkB,CAAC,CAAC,IAAI,aAAa,CAAC,aAAa,EAAE,CAAC,CAAC,CAAA;AAEnE,MAAM,MAAM,oBAAoB,CAAC,CAAC,SAAS,KAAK,CAAC,GAAG,CAAC,IAAI,sBAAsB,GAAG;IAChF;;OAEG;IACH,iBAAiB,EAAE,CAAC,CAAA;CACrB,CAAA;AAED,MAAM,MAAM,gBAAgB,CAAC,CAAC,IAAI,CAAC,IAAI,EAAE,CAAC,KAAK,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAA;AAEvE,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,OAAO,CAAC,eAAe,CAAC,GAAG;IACzD,YAAY,CAAC,EAAE,MAAM,GAAG,gBAAgB,CAAC,CAAC,CAAC,CAAA;CAC5C,CAAA"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@sentio/sdk",
|
3
|
-
"version": "2.59.0-rc.
|
3
|
+
"version": "2.59.0-rc.24",
|
4
4
|
"license": "Apache-2.0",
|
5
5
|
"type": "module",
|
6
6
|
"exports": {
|
@@ -88,8 +88,8 @@
|
|
88
88
|
"typechain": "^8.3.2",
|
89
89
|
"utility-types": "^3.11.0",
|
90
90
|
"yaml": "^2.3.4",
|
91
|
-
"@sentio/protos": "2.59.0-rc.
|
92
|
-
"@sentio/runtime": "^2.59.0-rc.
|
91
|
+
"@sentio/protos": "2.59.0-rc.24",
|
92
|
+
"@sentio/runtime": "^2.59.0-rc.24"
|
93
93
|
},
|
94
94
|
"peerDependencies": {
|
95
95
|
"@sentio/tsup": "^8.3.5-rc.1"
|
@@ -28,7 +28,7 @@ import {
|
|
28
28
|
import { ALL_ADDRESS, Labels, PromiseOrVoid } from '../core/index.js'
|
29
29
|
import { TypeDescriptor, matchType, NestedDecodedStruct } from '@typemove/move'
|
30
30
|
import { decodeResourceChange, ResourceChange } from '@typemove/aptos'
|
31
|
-
import { GeneralTransactionResponse } from './models.js'
|
31
|
+
import { GeneralTransactionResponse, HandlerOptions } from './models.js'
|
32
32
|
import { getHandlerName, proxyProcessor } from '../utils/metrics.js'
|
33
33
|
import { AptEvent } from './data.js'
|
34
34
|
|
@@ -79,11 +79,10 @@ export class AptosTransactionProcessor<T extends GeneralTransactionResponse, CT
|
|
79
79
|
protected onMoveEvent(
|
80
80
|
handler: (event: Event, ctx: AptosContext) => PromiseOrVoid,
|
81
81
|
filter: EventFilter | EventFilter[],
|
82
|
-
|
83
|
-
partitionHandler?: (evt: Event) => Promise<string | undefined>
|
82
|
+
handlerOptions?: HandlerOptions<Event>
|
84
83
|
): this {
|
85
84
|
let _filters: EventFilter[] = []
|
86
|
-
const _fetchConfig = MoveFetchConfig.fromPartial({ ...DEFAULT_FETCH_CONFIG, ...
|
85
|
+
const _fetchConfig = MoveFetchConfig.fromPartial({ ...DEFAULT_FETCH_CONFIG, ...handlerOptions })
|
87
86
|
|
88
87
|
if (Array.isArray(filter)) {
|
89
88
|
_filters = filter
|
@@ -120,8 +119,13 @@ export class AptosTransactionProcessor<T extends GeneralTransactionResponse, CT
|
|
120
119
|
filters: _filters,
|
121
120
|
fetchConfig: _fetchConfig,
|
122
121
|
partitionHandler: async (data: AptEvent): Promise<string | undefined> => {
|
123
|
-
const
|
124
|
-
|
122
|
+
const p = handlerOptions?.partitionKey
|
123
|
+
if (!p) return undefined
|
124
|
+
if (typeof p === 'function') {
|
125
|
+
const decoded = await data.decodeEvent(processor.coder)
|
126
|
+
return p(decoded || data.event)
|
127
|
+
}
|
128
|
+
return p
|
125
129
|
}
|
126
130
|
})
|
127
131
|
return this
|
@@ -226,8 +230,8 @@ export class AptosTransactionProcessor<T extends GeneralTransactionResponse, CT
|
|
226
230
|
return this
|
227
231
|
}
|
228
232
|
|
229
|
-
public onEvent(handler: (event: Event, ctx: AptosContext) => void,
|
230
|
-
this.onMoveEvent(handler, { type: '' },
|
233
|
+
public onEvent(handler: (event: Event, ctx: AptosContext) => void, handlerOptions?: HandlerOptions<Event>): this {
|
234
|
+
this.onMoveEvent(handler, { type: '' }, handlerOptions)
|
231
235
|
return this
|
232
236
|
}
|
233
237
|
|