@sentio/sdk 2.44.3-rc.1 → 2.44.3-rc.10
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 +5 -4
- package/lib/aptos/aptos-processor.d.ts.map +1 -1
- package/lib/aptos/aptos-processor.js +13 -6
- package/lib/aptos/aptos-processor.js.map +1 -1
- package/lib/aptos/builtin/0x1.d.ts +25 -0
- package/lib/aptos/builtin/0x1.d.ts.map +1 -1
- package/lib/aptos/builtin/0x1.js +22 -1
- package/lib/aptos/builtin/0x1.js.map +1 -1
- package/lib/aptos/index.d.ts +2 -1
- package/lib/aptos/index.d.ts.map +1 -1
- package/lib/aptos/index.js.map +1 -1
- package/lib/core/event-logger.d.ts.map +1 -1
- package/lib/core/event-logger.js +2 -1
- package/lib/core/event-logger.js.map +1 -1
- package/lib/core/meter.d.ts.map +1 -1
- package/lib/core/meter.js +3 -1
- package/lib/core/meter.js.map +1 -1
- package/lib/eth/codegen/codegen.js +4 -5
- package/lib/eth/codegen/codegen.js.map +1 -1
- package/lib/eth/context.d.ts.map +1 -1
- package/lib/eth/context.js +9 -1
- package/lib/eth/context.js.map +1 -1
- package/lib/fuel/asset-processor.d.ts +1 -0
- package/lib/fuel/asset-processor.d.ts.map +1 -1
- package/lib/fuel/asset-processor.js +2 -1
- package/lib/fuel/asset-processor.js.map +1 -1
- package/lib/fuel/codegen/codegen.js +2 -2
- package/lib/fuel/codegen/codegen.js.map +1 -1
- package/lib/solana/builtin/types.d.ts +170 -170
- package/lib/solana/builtin/types.d.ts.map +1 -1
- package/lib/solana/builtin/types.js +1 -1
- package/lib/solana/builtin/types.js.map +1 -1
- package/lib/stark/codegen/codegen.js +2 -2
- package/lib/stark/codegen/codegen.js.map +1 -1
- package/lib/store/codegen.js +2 -2
- package/lib/store/codegen.js.map +1 -1
- package/lib/sui/builtin/0x1.d.ts +19 -0
- package/lib/sui/builtin/0x1.d.ts.map +1 -1
- package/lib/sui/builtin/0x1.js +28 -1
- package/lib/sui/builtin/0x1.js.map +1 -1
- package/lib/sui/builtin/0x3.js +1 -1
- package/lib/sui/builtin/0x3.js.map +1 -1
- package/lib/utils/price.d.ts.map +1 -1
- package/lib/utils/price.js +2 -1
- package/lib/utils/price.js.map +1 -1
- package/package.json +11 -15
- package/src/aptos/abis/0x1.json +73 -9
- package/src/aptos/aptos-processor.ts +21 -15
- package/src/aptos/builtin/0x1.ts +78 -1
- package/src/aptos/index.ts +2 -6
- package/src/core/event-logger.ts +2 -1
- package/src/core/meter.ts +3 -1
- package/src/eth/builtin/internal/eacaggregatorproxy-processor.ts +204 -204
- package/src/eth/builtin/internal/eacaggregatorproxy-test-utils.ts +12 -12
- package/src/eth/builtin/internal/erc1155-processor.ts +95 -95
- package/src/eth/builtin/internal/erc1155-test-utils.ts +8 -8
- package/src/eth/builtin/internal/erc20-processor.ts +140 -140
- package/src/eth/builtin/internal/erc20-test-utils.ts +6 -6
- package/src/eth/builtin/internal/erc20bytes-processor.ts +80 -80
- package/src/eth/builtin/internal/erc20bytes-test-utils.ts +4 -4
- package/src/eth/builtin/internal/erc721-processor.ts +133 -133
- package/src/eth/builtin/internal/erc721-test-utils.ts +6 -6
- package/src/eth/builtin/internal/factories/EACAggregatorProxy__factory.ts +1 -1
- package/src/eth/builtin/internal/factories/ERC1155__factory.ts +1 -1
- package/src/eth/builtin/internal/factories/ERC20Bytes__factory.ts +1 -1
- package/src/eth/builtin/internal/weth9-processor.ts +97 -97
- package/src/eth/builtin/internal/weth9-test-utils.ts +8 -8
- package/src/eth/codegen/codegen.ts +5 -5
- package/src/eth/context.ts +9 -1
- package/src/fuel/asset-processor.ts +3 -1
- package/src/fuel/codegen/codegen.ts +2 -2
- package/src/solana/builtin/types.ts +1 -1
- package/src/stark/codegen/codegen.ts +2 -2
- package/src/store/codegen.ts +2 -2
- package/src/sui/abis/0x1.json +391 -0
- package/src/sui/abis/0x3.json +20 -0
- package/src/sui/builtin/0x1.ts +44 -1
- package/src/sui/builtin/0x3.ts +1 -1
- package/src/utils/price.ts +2 -1
@@ -2,11 +2,9 @@ import { defaultMoveCoder, MoveCoder } from './index.js'
|
|
2
2
|
|
3
3
|
import {
|
4
4
|
Event,
|
5
|
-
WriteSetChangeWriteResource,
|
6
5
|
MoveResource,
|
7
6
|
UserTransactionResponse,
|
8
7
|
EntryFunctionPayloadResponse,
|
9
|
-
WriteSetChangeDeleteResource,
|
10
8
|
MultisigPayloadResponse
|
11
9
|
} from '@aptos-labs/ts-sdk'
|
12
10
|
|
@@ -33,6 +31,8 @@ import {
|
|
33
31
|
ResourceChangeHandler
|
34
32
|
} from '../move/index.js'
|
35
33
|
import { Labels, PromiseOrVoid } from '../core/index.js'
|
34
|
+
import { TypeDescriptor } from '@typemove/move'
|
35
|
+
import { decodeResourceChange, ResourceChange } from '@typemove/aptos'
|
36
36
|
|
37
37
|
const DEFAULT_FETCH_CONFIG: MoveFetchConfig = {
|
38
38
|
resourceChanges: false,
|
@@ -46,8 +46,6 @@ export const DEFAULT_RESOURCE_FETCH_CONFIG: MoveAccountFetchConfig = {
|
|
46
46
|
owned: true
|
47
47
|
}
|
48
48
|
|
49
|
-
export type ResourceChange = WriteSetChangeWriteResource | WriteSetChangeDeleteResource
|
50
|
-
|
51
49
|
type IndexConfigure = {
|
52
50
|
address: string
|
53
51
|
network: AptosNetwork
|
@@ -231,19 +229,21 @@ export class AptosBaseProcessor {
|
|
231
229
|
return this
|
232
230
|
}
|
233
231
|
|
234
|
-
public onResourceChange(
|
235
|
-
handler: (changes: ResourceChange[], ctx: AptosResourcesContext) => PromiseOrVoid,
|
236
|
-
|
232
|
+
public onResourceChange<T>(
|
233
|
+
handler: (changes: ResourceChange<T>[], ctx: AptosResourcesContext) => PromiseOrVoid,
|
234
|
+
typeDesc: TypeDescriptor<T> | string
|
237
235
|
): this {
|
236
|
+
if (typeof typeDesc === 'string') {
|
237
|
+
typeDesc = parseMoveType(typeDesc)
|
238
|
+
}
|
239
|
+
|
238
240
|
const processor = this
|
239
241
|
this.resourceHandlers.push({
|
240
242
|
handler: async function (data) {
|
241
243
|
if (!data.resources || !data.version) {
|
242
244
|
throw new ServerError(Status.INVALID_ARGUMENT, 'resource is null')
|
243
245
|
}
|
244
|
-
const resources = data.resources as ResourceChange[]
|
245
246
|
const timestamp = Number(data.timestampMicros)
|
246
|
-
|
247
247
|
const ctx = new AptosResourcesContext(
|
248
248
|
processor.config.network,
|
249
249
|
processor.config.address,
|
@@ -251,10 +251,11 @@ export class AptosBaseProcessor {
|
|
251
251
|
timestamp,
|
252
252
|
processor.config.baseLabels
|
253
253
|
)
|
254
|
+
const resources = await decodeResourceChange<T>(data.resources, ctx.coder)
|
254
255
|
await handler(resources, ctx)
|
255
256
|
return ctx.stopAndGetResult()
|
256
257
|
},
|
257
|
-
type
|
258
|
+
type: typeDesc.qname
|
258
259
|
})
|
259
260
|
return this
|
260
261
|
}
|
@@ -364,10 +365,14 @@ export class AptosResourcesProcessor {
|
|
364
365
|
)
|
365
366
|
}
|
366
367
|
|
367
|
-
public onResourceChange(
|
368
|
-
handler: (changes: ResourceChange[], ctx: AptosResourcesContext) => PromiseOrVoid,
|
369
|
-
|
368
|
+
public onResourceChange<T>(
|
369
|
+
handler: (changes: ResourceChange<T>[], ctx: AptosResourcesContext) => PromiseOrVoid,
|
370
|
+
typeDesc: TypeDescriptor<T> | string
|
370
371
|
): this {
|
372
|
+
if (typeof typeDesc === 'string') {
|
373
|
+
typeDesc = parseMoveType(typeDesc)
|
374
|
+
}
|
375
|
+
|
371
376
|
const processor = this
|
372
377
|
this.resourcesHandlers.push({
|
373
378
|
fetchConfig: DEFAULT_RESOURCE_FETCH_CONFIG,
|
@@ -377,7 +382,6 @@ export class AptosResourcesProcessor {
|
|
377
382
|
if (!data.resources || !data.version) {
|
378
383
|
throw new ServerError(Status.INVALID_ARGUMENT, 'resource is null')
|
379
384
|
}
|
380
|
-
const resources = data.resources as ResourceChange[]
|
381
385
|
const ctx = new AptosResourcesContext(
|
382
386
|
processor.config.network,
|
383
387
|
processor.config.address,
|
@@ -385,10 +389,12 @@ export class AptosResourcesProcessor {
|
|
385
389
|
timestamp,
|
386
390
|
processor.config.baseLabels
|
387
391
|
)
|
392
|
+
|
393
|
+
const resources = (await decodeResourceChange(data.resources, ctx.coder)) as ResourceChange<T>[]
|
388
394
|
await handler(resources, ctx)
|
389
395
|
return ctx.stopAndGetResult()
|
390
396
|
},
|
391
|
-
type:
|
397
|
+
type: typeDesc.qname
|
392
398
|
})
|
393
399
|
return this
|
394
400
|
}
|