@0xtorch/evm 0.0.110 → 0.0.111
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/_cjs/explorer/blockscout/create.js +10 -5
- package/_cjs/explorer/blockscout/create.js.map +1 -1
- package/_cjs/explorer/blockscout/getTokenTransferEventsByAddress.js +44 -6
- package/_cjs/explorer/blockscout/getTokenTransferEventsByAddress.js.map +1 -1
- package/_cjs/explorer/blockscout/getTransactionsByAddress.js +4 -0
- package/_cjs/explorer/blockscout/getTransactionsByAddress.js.map +1 -1
- package/_cjs/explorer/etherscan/client.js +2 -1
- package/_cjs/explorer/etherscan/client.js.map +1 -1
- package/_cjs/explorer/etherscan/create.js +10 -5
- package/_cjs/explorer/etherscan/create.js.map +1 -1
- package/_cjs/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.js +28 -6
- package/_cjs/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.js.map +1 -1
- package/_cjs/explorer/etherscan/getListOfNormalTransactionsByAddress.js +4 -0
- package/_cjs/explorer/etherscan/getListOfNormalTransactionsByAddress.js.map +1 -1
- package/_cjs/explorer/moralis/create.js +16 -1
- package/_cjs/explorer/moralis/create.js.map +1 -1
- package/_cjs/explorer/moralis/getWalletTransactionHistory.js +2 -0
- package/_cjs/explorer/moralis/getWalletTransactionHistory.js.map +1 -1
- package/_cjs/logic/getAddressIndexData.js +2 -1
- package/_cjs/logic/getAddressIndexData.js.map +1 -1
- package/_cjs/logic/getTransactionDetail/index.js +10 -5
- package/_cjs/logic/getTransactionDetail/index.js.map +1 -1
- package/_cjs/types/transactionIndex.js +7 -1
- package/_cjs/types/transactionIndex.js.map +1 -1
- package/_esm/explorer/blockscout/create.js +10 -5
- package/_esm/explorer/blockscout/create.js.map +1 -1
- package/_esm/explorer/blockscout/getTokenTransferEventsByAddress.js +45 -7
- package/_esm/explorer/blockscout/getTokenTransferEventsByAddress.js.map +1 -1
- package/_esm/explorer/blockscout/getTransactionsByAddress.js +5 -1
- package/_esm/explorer/blockscout/getTransactionsByAddress.js.map +1 -1
- package/_esm/explorer/etherscan/client.js +2 -1
- package/_esm/explorer/etherscan/client.js.map +1 -1
- package/_esm/explorer/etherscan/create.js +10 -5
- package/_esm/explorer/etherscan/create.js.map +1 -1
- package/_esm/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.js +29 -7
- package/_esm/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.js.map +1 -1
- package/_esm/explorer/etherscan/getListOfNormalTransactionsByAddress.js +5 -1
- package/_esm/explorer/etherscan/getListOfNormalTransactionsByAddress.js.map +1 -1
- package/_esm/explorer/moralis/create.js +16 -1
- package/_esm/explorer/moralis/create.js.map +1 -1
- package/_esm/explorer/moralis/getWalletTransactionHistory.js +2 -0
- package/_esm/explorer/moralis/getWalletTransactionHistory.js.map +1 -1
- package/_esm/logic/getAddressIndexData.js +2 -1
- package/_esm/logic/getAddressIndexData.js.map +1 -1
- package/_esm/logic/getTransactionDetail/index.js +10 -5
- package/_esm/logic/getTransactionDetail/index.js.map +1 -1
- package/_esm/types/transactionIndex.js +7 -1
- package/_esm/types/transactionIndex.js.map +1 -1
- package/_types/explorer/blockscout/create.d.ts.map +1 -1
- package/_types/explorer/blockscout/getTokenTransferEventsByAddress.d.ts +5 -1
- package/_types/explorer/blockscout/getTokenTransferEventsByAddress.d.ts.map +1 -1
- package/_types/explorer/blockscout/getTransactionsByAddress.d.ts.map +1 -1
- package/_types/explorer/etherscan/client.d.ts.map +1 -1
- package/_types/explorer/etherscan/create.d.ts.map +1 -1
- package/_types/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.d.ts +5 -1
- package/_types/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.d.ts.map +1 -1
- package/_types/explorer/etherscan/getListOfNormalTransactionsByAddress.d.ts.map +1 -1
- package/_types/explorer/moralis/create.d.ts.map +1 -1
- package/_types/explorer/moralis/getWalletTransactionHistory.d.ts +2 -0
- package/_types/explorer/moralis/getWalletTransactionHistory.d.ts.map +1 -1
- package/_types/explorer/types.d.ts +5 -2
- package/_types/explorer/types.d.ts.map +1 -1
- package/_types/logic/getAddressIndexData.d.ts +4 -2
- package/_types/logic/getAddressIndexData.d.ts.map +1 -1
- package/_types/logic/getTransactionDetail/index.d.ts +3 -1
- package/_types/logic/getTransactionDetail/index.d.ts.map +1 -1
- package/_types/types/transactionIndex.d.ts +9 -2
- package/_types/types/transactionIndex.d.ts.map +1 -1
- package/explorer/blockscout/create.ts +20 -12
- package/explorer/blockscout/getTokenTransferEventsByAddress.ts +52 -10
- package/explorer/blockscout/getTransactionsByAddress.ts +5 -1
- package/explorer/etherscan/client.ts +6 -1
- package/explorer/etherscan/create.ts +21 -13
- package/explorer/etherscan/getListOfErc20TokenTransferEventsByAddress.ts +34 -10
- package/explorer/etherscan/getListOfNormalTransactionsByAddress.ts +5 -1
- package/explorer/moralis/create.ts +19 -2
- package/explorer/moralis/getWalletTransactionHistory.ts +2 -0
- package/explorer/types.ts +5 -2
- package/logic/getAddressIndexData.ts +26 -20
- package/logic/getTransactionDetail/index.ts +13 -4
- package/package.json +1 -1
- package/types/transactionIndex.ts +11 -5
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { Chain } from '../chain'
|
|
2
|
+
import type { Erc20Transfer } from '../types'
|
|
2
3
|
import type { LowerHex } from '../types/hex'
|
|
3
4
|
import type { InternalTransaction } from '../types/internalTransaction'
|
|
4
5
|
import type { TransactionIndex } from '../types/transactionIndex'
|
|
@@ -11,8 +12,9 @@ type GetAddressIndexDataParameters = {
|
|
|
11
12
|
}
|
|
12
13
|
|
|
13
14
|
type GetAddressIndexDataReturnTypes = {
|
|
14
|
-
|
|
15
|
-
|
|
15
|
+
transactionIndexes: readonly TransactionIndex[]
|
|
16
|
+
internalTransactions: readonly InternalTransaction[]
|
|
17
|
+
erc20Transfers: readonly Erc20Transfer[]
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export const getAddressIndexData = async ({
|
|
@@ -21,24 +23,27 @@ export const getAddressIndexData = async ({
|
|
|
21
23
|
fromBlock,
|
|
22
24
|
toBlock,
|
|
23
25
|
}: GetAddressIndexDataParameters): Promise<GetAddressIndexDataReturnTypes> => {
|
|
24
|
-
const [
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
26
|
+
const [
|
|
27
|
+
transactionIndexes,
|
|
28
|
+
{ indexes: transferIndexes, erc20Transfers },
|
|
29
|
+
internalTransactions,
|
|
30
|
+
] = await Promise.all([
|
|
31
|
+
chain.explorer.getAddressTransactionIndexes({
|
|
32
|
+
address,
|
|
33
|
+
fromBlock,
|
|
34
|
+
toBlock,
|
|
35
|
+
}),
|
|
36
|
+
chain.explorer.getAddressTokenTransferIndexes({
|
|
37
|
+
address,
|
|
38
|
+
fromBlock,
|
|
39
|
+
toBlock,
|
|
40
|
+
}),
|
|
41
|
+
chain.explorer.getAddressInternalTransactions({
|
|
42
|
+
address,
|
|
43
|
+
fromBlock,
|
|
44
|
+
toBlock,
|
|
45
|
+
}),
|
|
46
|
+
])
|
|
42
47
|
|
|
43
48
|
const indexes = new Map<LowerHex, TransactionIndex>()
|
|
44
49
|
for (const index of transactionIndexes) {
|
|
@@ -64,5 +69,6 @@ export const getAddressIndexData = async ({
|
|
|
64
69
|
return {
|
|
65
70
|
transactionIndexes: [...indexes.values()],
|
|
66
71
|
internalTransactions,
|
|
72
|
+
erc20Transfers,
|
|
67
73
|
}
|
|
68
74
|
}
|
|
@@ -13,6 +13,8 @@ type GetTransactionDetailParameters = {
|
|
|
13
13
|
timestamp?: number
|
|
14
14
|
internalTransactions?: readonly InternalTransaction[]
|
|
15
15
|
timeout?: number
|
|
16
|
+
input?: LowerHex
|
|
17
|
+
value?: bigint
|
|
16
18
|
}
|
|
17
19
|
|
|
18
20
|
export const getTransactionDetail = async ({
|
|
@@ -21,12 +23,19 @@ export const getTransactionDetail = async ({
|
|
|
21
23
|
timestamp: optionalTimestamp,
|
|
22
24
|
internalTransactions = [],
|
|
23
25
|
timeout,
|
|
26
|
+
input,
|
|
27
|
+
value,
|
|
24
28
|
}: GetTransactionDetailParameters): Promise<TransactionDetail> => {
|
|
25
29
|
const [transaction, receipt] = await Promise.all([
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
+
input === undefined || value === undefined
|
|
31
|
+
? chain.client.call({
|
|
32
|
+
clientCall: (client) => client.getTransaction({ hash }),
|
|
33
|
+
timeout,
|
|
34
|
+
})
|
|
35
|
+
: {
|
|
36
|
+
input,
|
|
37
|
+
value,
|
|
38
|
+
},
|
|
30
39
|
chain.client.call({
|
|
31
40
|
clientCall: (client) => client.getTransactionReceipt({ hash }),
|
|
32
41
|
timeout,
|
package/package.json
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { z } from 'zod'
|
|
2
|
+
import { bigintTextSchema, lowerHexSchema } from './primitive'
|
|
2
3
|
import { transactionDetailSchema } from './transactionDetail'
|
|
3
4
|
|
|
4
|
-
const transactionIndexSchema = transactionDetailSchema
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
5
|
+
const transactionIndexSchema = transactionDetailSchema
|
|
6
|
+
.pick({
|
|
7
|
+
hash: true,
|
|
8
|
+
blockNumber: true,
|
|
9
|
+
timestamp: true,
|
|
10
|
+
})
|
|
11
|
+
.extend({
|
|
12
|
+
input: lowerHexSchema.optional(),
|
|
13
|
+
value: bigintTextSchema.optional(),
|
|
14
|
+
})
|
|
9
15
|
|
|
10
16
|
export type TransactionIndex = z.infer<typeof transactionIndexSchema>
|