@sentio/sdk 2.44.2 → 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 +48 -0
- package/lib/aptos/builtin/0x1.d.ts.map +1 -1
- package/lib/aptos/builtin/0x1.js +45 -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/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.d.ts +59 -0
- package/lib/sui/builtin/0x3.d.ts.map +1 -1
- package/lib/sui/builtin/0x3.js +58 -1
- package/lib/sui/builtin/0x3.js.map +1 -1
- package/lib/sui/context.d.ts +1 -1
- package/lib/sui/context.d.ts.map +1 -1
- package/lib/sui/ext/move-dex.d.ts +1 -1
- package/lib/sui/ext/move-dex.d.ts.map +1 -1
- package/lib/sui/models.d.ts +1 -1
- package/lib/sui/models.d.ts.map +1 -1
- package/lib/sui/network.d.ts +1 -1
- package/lib/sui/network.d.ts.map +1 -1
- package/lib/sui/network.js +1 -1
- package/lib/sui/network.js.map +1 -1
- package/lib/sui/sui-object-processor-template.d.ts +1 -1
- package/lib/sui/sui-object-processor-template.d.ts.map +1 -1
- package/lib/sui/sui-object-processor.d.ts +1 -1
- package/lib/sui/sui-object-processor.d.ts.map +1 -1
- package/lib/sui/sui-processor.d.ts +1 -1
- package/lib/sui/sui-processor.d.ts.map +1 -1
- package/lib/sui/utils.d.ts +1 -1
- package/lib/sui/utils.d.ts.map +1 -1
- package/lib/testing/sui-facet.d.ts +1 -1
- package/lib/testing/sui-facet.d.ts.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 +638 -20
- package/src/aptos/abis/0x3.json +60 -0
- package/src/aptos/abis/0x4.json +139 -2
- package/src/aptos/aptos-processor.ts +21 -15
- package/src/aptos/builtin/0x1.ts +141 -1
- package/src/aptos/builtin/0x3.ts +1 -1
- package/src/aptos/builtin/0x4.ts +1 -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 +975 -85
- package/src/sui/abis/0x3.json +920 -41
- package/src/sui/builtin/0x1.ts +44 -1
- package/src/sui/builtin/0x3.ts +154 -1
- package/src/sui/codegen/codegen.ts +1 -1
- package/src/sui/context.ts +1 -1
- package/src/sui/ext/coin.ts +1 -1
- package/src/sui/ext/move-dex.ts +1 -1
- package/src/sui/models.ts +1 -1
- package/src/sui/network.ts +1 -1
- package/src/sui/sui-object-processor-template.ts +1 -1
- package/src/sui/sui-object-processor.ts +1 -1
- package/src/sui/sui-processor.ts +1 -1
- package/src/sui/utils.ts +1 -1
- package/src/testing/sui-facet.ts +1 -1
- package/src/utils/price.ts +2 -1
@@ -23,12 +23,12 @@ const mockField = {
|
|
23
23
|
|
24
24
|
export function mockApprovalLog(
|
25
25
|
contractAddress: string,
|
26
|
-
event: ApprovalEventObject
|
26
|
+
event: ApprovalEventObject,
|
27
27
|
): LogParams {
|
28
28
|
const contract = getWETH9Contract(EthChainId.ETHEREUM, contractAddress);
|
29
29
|
const encodedLog = contract.rawContract.interface.encodeEventLog(
|
30
30
|
"Approval(address,address,uint256)",
|
31
|
-
[event.src, event.guy, event.wad]
|
31
|
+
[event.src, event.guy, event.wad],
|
32
32
|
);
|
33
33
|
return {
|
34
34
|
...mockField,
|
@@ -41,12 +41,12 @@ export function mockApprovalLog(
|
|
41
41
|
|
42
42
|
export function mockTransferLog(
|
43
43
|
contractAddress: string,
|
44
|
-
event: TransferEventObject
|
44
|
+
event: TransferEventObject,
|
45
45
|
): LogParams {
|
46
46
|
const contract = getWETH9Contract(EthChainId.ETHEREUM, contractAddress);
|
47
47
|
const encodedLog = contract.rawContract.interface.encodeEventLog(
|
48
48
|
"Transfer(address,address,uint256)",
|
49
|
-
[event.src, event.dst, event.wad]
|
49
|
+
[event.src, event.dst, event.wad],
|
50
50
|
);
|
51
51
|
return {
|
52
52
|
...mockField,
|
@@ -59,12 +59,12 @@ export function mockTransferLog(
|
|
59
59
|
|
60
60
|
export function mockDepositLog(
|
61
61
|
contractAddress: string,
|
62
|
-
event: DepositEventObject
|
62
|
+
event: DepositEventObject,
|
63
63
|
): LogParams {
|
64
64
|
const contract = getWETH9Contract(EthChainId.ETHEREUM, contractAddress);
|
65
65
|
const encodedLog = contract.rawContract.interface.encodeEventLog(
|
66
66
|
"Deposit(address,uint256)",
|
67
|
-
[event.dst, event.wad]
|
67
|
+
[event.dst, event.wad],
|
68
68
|
);
|
69
69
|
return {
|
70
70
|
...mockField,
|
@@ -77,12 +77,12 @@ export function mockDepositLog(
|
|
77
77
|
|
78
78
|
export function mockWithdrawalLog(
|
79
79
|
contractAddress: string,
|
80
|
-
event: WithdrawalEventObject
|
80
|
+
event: WithdrawalEventObject,
|
81
81
|
): LogParams {
|
82
82
|
const contract = getWETH9Contract(EthChainId.ETHEREUM, contractAddress);
|
83
83
|
const encodedLog = contract.rawContract.interface.encodeEventLog(
|
84
84
|
"Withdrawal(address,uint256)",
|
85
|
-
[event.src, event.wad]
|
85
|
+
[event.src, event.wad],
|
86
86
|
);
|
87
87
|
return {
|
88
88
|
...mockField,
|
@@ -2,10 +2,10 @@ import { loadFileDescriptions, processOutput, skipEmptyAbis } from 'typechain/di
|
|
2
2
|
import * as fs from 'fs'
|
3
3
|
import { DEFAULT_FLAGS, Services } from 'typechain'
|
4
4
|
import EthersSentio, { SentioEthersConfig } from './ethers-sentio.js'
|
5
|
-
|
6
|
-
import
|
5
|
+
|
6
|
+
import synchronizedPrettier from '@prettier/sync'
|
7
7
|
import path from 'path'
|
8
|
-
import
|
8
|
+
import { mkdirpSync } from 'mkdirp'
|
9
9
|
import { YamlContractConfig } from '../../core/yaml-contract-config.js'
|
10
10
|
import chalk from 'chalk'
|
11
11
|
|
@@ -58,8 +58,8 @@ async function codegenInternal(
|
|
58
58
|
fs,
|
59
59
|
// @ts-ignore for test
|
60
60
|
// prettier: { format: (s) => s },
|
61
|
-
prettier:
|
62
|
-
mkdirp:
|
61
|
+
prettier: synchronizedPrettier,
|
62
|
+
mkdirp: mkdirpSync
|
63
63
|
}
|
64
64
|
let filesGenerated = 0
|
65
65
|
|
package/src/eth/context.ts
CHANGED
@@ -6,6 +6,7 @@ import { Trace } from './eth.js'
|
|
6
6
|
import { Labels, normalizeLabels } from '../core/index.js'
|
7
7
|
import { BaseContext } from '../core/base-context.js'
|
8
8
|
import { EthChainId } from '@sentio/chain'
|
9
|
+
import { processMetrics } from '@sentio/runtime'
|
9
10
|
|
10
11
|
export abstract class EthContext extends BaseContext {
|
11
12
|
readonly chainId: EthChainId
|
@@ -204,7 +205,14 @@ export class ContractView<TContract extends BaseContract> {
|
|
204
205
|
protected contract: TContract
|
205
206
|
|
206
207
|
constructor(contract: TContract) {
|
207
|
-
this.contract = contract
|
208
|
+
this.contract = new Proxy(contract, {
|
209
|
+
get: (target, prop, receiver) => {
|
210
|
+
if (prop == 'getFunction') {
|
211
|
+
processMetrics.process_ethcall_count.add(1)
|
212
|
+
}
|
213
|
+
return Reflect.get(target, prop, receiver)
|
214
|
+
}
|
215
|
+
})
|
208
216
|
}
|
209
217
|
|
210
218
|
get rawContract() {
|
@@ -61,7 +61,8 @@ export class FuelAssetProcessor implements FuelBaseProcessor<FuelAssetProcessorC
|
|
61
61
|
if (input.type == InputType.Coin) {
|
62
62
|
transfer.from.push({
|
63
63
|
address: input.owner,
|
64
|
-
assetId: input.assetId
|
64
|
+
assetId: input.assetId,
|
65
|
+
amount: BigInt(input.amount.toString(10))
|
65
66
|
})
|
66
67
|
}
|
67
68
|
}
|
@@ -116,6 +117,7 @@ export type FuelTransfer = {
|
|
116
117
|
from: {
|
117
118
|
assetId: string
|
118
119
|
address: string
|
120
|
+
amount: bigint
|
119
121
|
}[]
|
120
122
|
to: {
|
121
123
|
address: string
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import fs, { readFileSync, writeFileSync } from 'fs'
|
2
2
|
import chalk from 'chalk'
|
3
3
|
import { AbiTypeGen, IFile, IFunction, ProgramTypeEnum } from '@fuel-ts/abi-typegen'
|
4
|
-
import
|
4
|
+
import { mkdirpSync } from 'mkdirp'
|
5
5
|
import path from 'path'
|
6
6
|
import { upperFirst } from './utils.js'
|
7
7
|
import { versions as builtinVersions } from '@fuel-ts/versions'
|
@@ -65,7 +65,7 @@ async function codegenInternal(abisDir: string, outDir: string): Promise<number>
|
|
65
65
|
versions: { FUELS: builtinVersions.FUELS }
|
66
66
|
})
|
67
67
|
|
68
|
-
|
68
|
+
mkdirpSync(outDir)
|
69
69
|
let count = 0
|
70
70
|
abiTypeGen.files.forEach((file) => {
|
71
71
|
if (!file.path.endsWith('.hex.ts')) {
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import fs, { readFileSync, writeFileSync } from 'fs'
|
2
2
|
import chalk from 'chalk'
|
3
3
|
import path from 'path'
|
4
|
-
import
|
4
|
+
import { mkdirpSync } from 'mkdirp'
|
5
5
|
import { events } from 'starknet'
|
6
6
|
import { StarknetChainId } from '@sentio/chain'
|
7
7
|
import { Abi } from '@sentio/abi-wan-kanabi'
|
@@ -65,7 +65,7 @@ async function codegenInternal(abisDir: string, outDir: string): Promise<number>
|
|
65
65
|
tABIContents.push(`export const ABI_${name} = ${JSON.stringify(abi.abi, null, 2)} as const;`)
|
66
66
|
}
|
67
67
|
|
68
|
-
|
68
|
+
mkdirpSync(outDir)
|
69
69
|
writeFileSync(path.join(outDir, 'tabi.ts'), tABIContents.join('\n'))
|
70
70
|
fileCount++
|
71
71
|
for (const { name, address, chain, abi: jsonAbi } of Object.values(abis)) {
|
package/src/store/codegen.ts
CHANGED
@@ -13,7 +13,7 @@ import {
|
|
13
13
|
} from 'graphql'
|
14
14
|
import * as fs from 'node:fs'
|
15
15
|
import path from 'path'
|
16
|
-
import
|
16
|
+
import { mkdirpSync } from 'mkdirp'
|
17
17
|
import { schemaFromFile } from './schema.js'
|
18
18
|
import chalk from 'chalk'
|
19
19
|
|
@@ -239,7 +239,7 @@ DatabaseSchema.register({
|
|
239
239
|
}
|
240
240
|
})
|
241
241
|
`
|
242
|
-
|
242
|
+
mkdirpSync(path.dirname(target))
|
243
243
|
|
244
244
|
fs.writeFileSync(target, contents)
|
245
245
|
}
|