@sentio/sdk 2.36.0-rc.13 → 2.36.0-rc.15
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/builtin/0x1.js +1 -1
- package/lib/aptos/builtin/0x1.js.map +1 -1
- package/lib/aptos/builtin/0x3.js +1 -1
- package/lib/aptos/builtin/0x3.js.map +1 -1
- package/lib/aptos/builtin/0x4.js +1 -1
- package/lib/aptos/builtin/0x4.js.map +1 -1
- package/lib/core/big-decimal.d.ts +6 -0
- package/lib/core/big-decimal.d.ts.map +1 -1
- package/lib/core/big-decimal.js +7 -0
- package/lib/core/big-decimal.js.map +1 -1
- package/lib/core/normalization.d.ts.map +1 -1
- package/lib/core/normalization.js +4 -0
- package/lib/core/normalization.js.map +1 -1
- package/lib/fuel/base-processor.d.ts +1 -1
- package/lib/fuel/base-processor.d.ts.map +1 -1
- package/lib/fuel/base-processor.js.map +1 -1
- package/lib/fuel/codegen/codegen.js +5 -5
- package/lib/fuel/codegen/codegen.js.map +1 -1
- package/lib/fuel/context.d.ts +2 -2
- package/lib/fuel/context.d.ts.map +1 -1
- package/lib/fuel/context.js.map +1 -1
- package/lib/fuel/fuel-processor.d.ts +2 -2
- package/lib/fuel/fuel-processor.d.ts.map +1 -1
- package/lib/fuel/fuel-processor.js +4 -2
- package/lib/fuel/fuel-processor.js.map +1 -1
- package/lib/fuel/transaction.d.ts +2 -1
- package/lib/fuel/transaction.d.ts.map +1 -1
- package/lib/fuel/transaction.js +18 -7
- package/lib/fuel/transaction.js.map +1 -1
- package/lib/fuel/types.d.ts +3 -2
- package/lib/fuel/types.d.ts.map +1 -1
- package/lib/sui/builtin/0x1.js +1 -1
- package/lib/sui/builtin/0x1.js.map +1 -1
- package/lib/sui/builtin/0x2.js +1 -1
- package/lib/sui/builtin/0x2.js.map +1 -1
- package/lib/sui/builtin/0x3.js +1 -1
- package/lib/sui/builtin/0x3.js.map +1 -1
- package/package.json +19 -19
- package/src/aptos/builtin/0x1.ts +1 -1
- package/src/aptos/builtin/0x3.ts +1 -1
- package/src/aptos/builtin/0x4.ts +1 -1
- package/src/core/big-decimal.ts +17 -0
- package/src/core/normalization.ts +4 -0
- package/src/fuel/base-processor.ts +1 -1
- package/src/fuel/codegen/codegen.ts +5 -5
- package/src/fuel/context.ts +1 -1
- package/src/fuel/fuel-processor.ts +9 -4
- package/src/fuel/transaction.ts +22 -9
- package/src/fuel/types.ts +3 -2
- package/src/sui/builtin/0x1.ts +1 -1
- package/src/sui/builtin/0x2.ts +1 -1
- package/src/sui/builtin/0x3.ts +1 -1
package/src/fuel/transaction.ts
CHANGED
@@ -1,9 +1,10 @@
|
|
1
1
|
import { AbiMap, assembleTransactionSummary, processGqlReceipt, Provider, TransactionSummary } from '@fuel-ts/account'
|
2
|
-
import { ReceiptType, TransactionCoder } from '@fuel-ts/transactions'
|
2
|
+
import { Input, InputType, ReceiptType, TransactionCoder } from '@fuel-ts/transactions'
|
3
3
|
import { bn } from '@fuel-ts/math'
|
4
4
|
import { arrayify } from '@fuel-ts/utils'
|
5
|
-
import {
|
5
|
+
import { BigNumberCoder, Interface } from '@fuel-ts/abi-coder'
|
6
6
|
import { FuelLog } from './types.js'
|
7
|
+
import { BaseAssetId } from '@fuel-ts/address/configs'
|
7
8
|
|
8
9
|
export type FuelFetchConfig = {
|
9
10
|
includeFailed?: boolean
|
@@ -15,7 +16,17 @@ export const DEFAULT_FUEL_FETCH_CONFIG: FuelFetchConfig = {
|
|
15
16
|
|
16
17
|
export type FuelTransaction = TransactionSummary & {
|
17
18
|
blockNumber?: string
|
18
|
-
logs?: FuelLog[]
|
19
|
+
logs?: FuelLog<any>[]
|
20
|
+
sender?: string
|
21
|
+
}
|
22
|
+
|
23
|
+
function findSenderFromInputs(inputs: Input[] | undefined): string | undefined {
|
24
|
+
for (const input of inputs || []) {
|
25
|
+
if (input.type == InputType.Coin && input.assetId == BaseAssetId) {
|
26
|
+
return input.owner
|
27
|
+
}
|
28
|
+
}
|
29
|
+
return undefined
|
19
30
|
}
|
20
31
|
|
21
32
|
export function decodeFuelTransaction(gqlTransaction: any, provider: Provider): FuelTransaction {
|
@@ -40,7 +51,8 @@ export function decodeFuelTransaction(gqlTransaction: any, provider: Provider):
|
|
40
51
|
maxInputs,
|
41
52
|
gasCosts
|
42
53
|
}),
|
43
|
-
blockNumber
|
54
|
+
blockNumber,
|
55
|
+
sender: findSenderFromInputs(decodedTransaction.inputs)
|
44
56
|
}
|
45
57
|
}
|
46
58
|
|
@@ -61,8 +73,8 @@ export function decodeFuelTransactionWithAbi(gqlTransaction: any, abiMap: AbiMap
|
|
61
73
|
|
62
74
|
const abi = Object.values(abiMap)[0]
|
63
75
|
|
64
|
-
const logs
|
65
|
-
|
76
|
+
const logs = [] as FuelLog<any>[]
|
77
|
+
;(receipts as any[]).forEach((receipt, idx) => {
|
66
78
|
if (receipt.type === ReceiptType.LogData || receipt.type === ReceiptType.Log) {
|
67
79
|
const interfaceToUse = new Interface(abi)
|
68
80
|
|
@@ -70,9 +82,9 @@ export function decodeFuelTransactionWithAbi(gqlTransaction: any, abiMap: AbiMap
|
|
70
82
|
|
71
83
|
const logId = receipt.val1.toNumber()
|
72
84
|
const [decodedLog] = interfaceToUse.decodeLog(data, logId)
|
73
|
-
logs.push({ logId, decodedLog })
|
85
|
+
logs.push({ logId, data: decodedLog, receiptIndex: idx })
|
74
86
|
}
|
75
|
-
}
|
87
|
+
})
|
76
88
|
|
77
89
|
return {
|
78
90
|
...assembleTransactionSummary({
|
@@ -88,6 +100,7 @@ export function decodeFuelTransactionWithAbi(gqlTransaction: any, abiMap: AbiMap
|
|
88
100
|
gasCosts
|
89
101
|
}),
|
90
102
|
blockNumber,
|
91
|
-
logs
|
103
|
+
logs,
|
104
|
+
sender: findSenderFromInputs(decodedTransaction.inputs)
|
92
105
|
}
|
93
106
|
}
|
package/src/fuel/types.ts
CHANGED
package/src/sui/builtin/0x1.ts
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
/* tslint:disable */
|
3
3
|
/* eslint-disable */
|
4
4
|
|
5
|
-
/* Generated
|
5
|
+
/* Generated types for 0x1, original address 0x1 */
|
6
6
|
|
7
7
|
import { TypeDescriptor, ANY_TYPE } from "@typemove/move";
|
8
8
|
import { MoveCoder, TypedEventInstance } from "@typemove/sui";
|
package/src/sui/builtin/0x2.ts
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
/* tslint:disable */
|
3
3
|
/* eslint-disable */
|
4
4
|
|
5
|
-
/* Generated
|
5
|
+
/* Generated types for 0x2, original address 0x2 */
|
6
6
|
|
7
7
|
import { TypeDescriptor, ANY_TYPE } from "@typemove/move";
|
8
8
|
import { MoveCoder, TypedEventInstance } from "@typemove/sui";
|
package/src/sui/builtin/0x3.ts
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
/* tslint:disable */
|
3
3
|
/* eslint-disable */
|
4
4
|
|
5
|
-
/* Generated
|
5
|
+
/* Generated types for 0x3, original address 0x3 */
|
6
6
|
|
7
7
|
import { TypeDescriptor, ANY_TYPE } from "@typemove/move";
|
8
8
|
import { MoveCoder, TypedEventInstance } from "@typemove/sui";
|