@ledgerhq/coin-evm 16.2.4 → 16.4.0
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/CHANGELOG.md +24 -0
- package/lib/adapters/blockscoutV2.d.ts +40 -0
- package/lib/adapters/blockscoutV2.d.ts.map +1 -0
- package/lib/adapters/blockscoutV2.js +177 -0
- package/lib/adapters/blockscoutV2.js.map +1 -0
- package/lib/adapters/index.d.ts +1 -0
- package/lib/adapters/index.d.ts.map +1 -1
- package/lib/adapters/index.js +1 -0
- package/lib/adapters/index.js.map +1 -1
- package/lib/chains.d.ts +1 -1
- package/lib/chains.js +1 -1
- package/lib/chains.js.map +1 -1
- package/lib/config.d.ts +1499 -0
- package/lib/config.d.ts.map +1 -1
- package/lib/config.js +968 -1
- package/lib/config.js.map +1 -1
- package/lib/logic/internalTransactionsFetcher.d.ts.map +1 -1
- package/lib/logic/internalTransactionsFetcher.js +13 -2
- package/lib/logic/internalTransactionsFetcher.js.map +1 -1
- package/lib/network/blockscoutV2.d.ts +35 -0
- package/lib/network/blockscoutV2.d.ts.map +1 -0
- package/lib/network/blockscoutV2.js +311 -0
- package/lib/network/blockscoutV2.js.map +1 -0
- package/lib/network/explorer/etherscan.d.ts.map +1 -1
- package/lib/network/explorer/etherscan.js +11 -28
- package/lib/network/explorer/etherscan.js.map +1 -1
- package/lib/network/explorer/index.d.ts.map +1 -1
- package/lib/network/explorer/index.js +5 -0
- package/lib/network/explorer/index.js.map +1 -1
- package/lib/network/explorer/types.d.ts +6 -0
- package/lib/network/explorer/types.d.ts.map +1 -1
- package/lib/network/explorer/types.js +8 -1
- package/lib/network/explorer/types.js.map +1 -1
- package/lib/network/rewards.d.ts +11 -0
- package/lib/network/rewards.d.ts.map +1 -0
- package/lib/network/rewards.js +32 -0
- package/lib/network/rewards.js.map +1 -0
- package/lib/types/blockscoutV2.d.ts +80 -0
- package/lib/types/blockscoutV2.d.ts.map +1 -0
- package/lib/types/blockscoutV2.js +5 -0
- package/lib/types/blockscoutV2.js.map +1 -0
- package/lib/types/index.d.ts +1 -0
- package/lib/types/index.d.ts.map +1 -1
- package/lib/types/index.js +1 -0
- package/lib/types/index.js.map +1 -1
- package/lib-es/adapters/blockscoutV2.d.ts +40 -0
- package/lib-es/adapters/blockscoutV2.d.ts.map +1 -0
- package/lib-es/adapters/blockscoutV2.js +168 -0
- package/lib-es/adapters/blockscoutV2.js.map +1 -0
- package/lib-es/adapters/index.d.ts +1 -0
- package/lib-es/adapters/index.d.ts.map +1 -1
- package/lib-es/adapters/index.js +1 -0
- package/lib-es/adapters/index.js.map +1 -1
- package/lib-es/chains.d.ts +1 -1
- package/lib-es/chains.js +1 -1
- package/lib-es/chains.js.map +1 -1
- package/lib-es/config.d.ts +1499 -0
- package/lib-es/config.d.ts.map +1 -1
- package/lib-es/config.js +967 -0
- package/lib-es/config.js.map +1 -1
- package/lib-es/logic/internalTransactionsFetcher.d.ts.map +1 -1
- package/lib-es/logic/internalTransactionsFetcher.js +14 -3
- package/lib-es/logic/internalTransactionsFetcher.js.map +1 -1
- package/lib-es/network/blockscoutV2.d.ts +35 -0
- package/lib-es/network/blockscoutV2.d.ts.map +1 -0
- package/lib-es/network/blockscoutV2.js +271 -0
- package/lib-es/network/blockscoutV2.js.map +1 -0
- package/lib-es/network/explorer/etherscan.d.ts.map +1 -1
- package/lib-es/network/explorer/etherscan.js +2 -19
- package/lib-es/network/explorer/etherscan.js.map +1 -1
- package/lib-es/network/explorer/index.d.ts.map +1 -1
- package/lib-es/network/explorer/index.js +5 -0
- package/lib-es/network/explorer/index.js.map +1 -1
- package/lib-es/network/explorer/types.d.ts +6 -0
- package/lib-es/network/explorer/types.d.ts.map +1 -1
- package/lib-es/network/explorer/types.js +6 -0
- package/lib-es/network/explorer/types.js.map +1 -1
- package/lib-es/network/rewards.d.ts +11 -0
- package/lib-es/network/rewards.d.ts.map +1 -0
- package/lib-es/network/rewards.js +29 -0
- package/lib-es/network/rewards.js.map +1 -0
- package/lib-es/types/blockscoutV2.d.ts +80 -0
- package/lib-es/types/blockscoutV2.d.ts.map +1 -0
- package/lib-es/types/blockscoutV2.js +4 -0
- package/lib-es/types/blockscoutV2.js.map +1 -0
- package/lib-es/types/index.d.ts +1 -0
- package/lib-es/types/index.d.ts.map +1 -1
- package/lib-es/types/index.js +1 -0
- package/lib-es/types/index.js.map +1 -1
- package/package.json +1 -1
- package/src/adapters/blockscoutV2.test.ts +296 -0
- package/src/adapters/blockscoutV2.ts +244 -0
- package/src/adapters/index.ts +1 -0
- package/src/api/tests/index.alpen_testnet.integ.test.ts +73 -0
- package/src/api/tests/index.integ.test.ts +4 -2
- package/src/api/tests/index.scroll.integ.test.ts +168 -0
- package/src/api/tests/index.shape.integ.test.ts +34 -0
- package/src/chains.ts +1 -1
- package/src/config.ts +993 -0
- package/src/logic/internalTransactionsFetcher.ts +20 -3
- package/src/logic/tests/internalTransactionsFetcher.test.ts +51 -0
- package/src/network/blockscoutV2.ts +460 -0
- package/src/network/explorer/etherscan.ts +2 -29
- package/src/network/explorer/index.ts +5 -0
- package/src/network/explorer/types.ts +9 -0
- package/src/network/rewards.ts +47 -0
- package/src/network/tests/blockscoutV2.test.ts +565 -0
- package/src/network/tests/explorer/index.test.ts +21 -0
- package/src/types/blockscoutV2.ts +85 -0
- package/src/types/index.ts +1 -0
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: © 2026 LEDGER SAS
|
|
2
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
3
|
+
|
|
4
|
+
// Blockscout v2 REST API (`/api/v2`) response types. Only the fields the adapters read are declared.
|
|
5
|
+
|
|
6
|
+
export type BlockscoutV2Address = {
|
|
7
|
+
hash: string
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Item of `GET /addresses/{address}/transactions` */
|
|
11
|
+
export type BlockscoutV2Transaction = {
|
|
12
|
+
hash: string
|
|
13
|
+
/** `null` while the transaction is pending */
|
|
14
|
+
block_number: number | null
|
|
15
|
+
/** Index of the transaction in its block */
|
|
16
|
+
position: number | null
|
|
17
|
+
timestamp: string | null
|
|
18
|
+
nonce: number
|
|
19
|
+
from: BlockscoutV2Address
|
|
20
|
+
/** `null` for a contract creation */
|
|
21
|
+
to: BlockscoutV2Address | null
|
|
22
|
+
created_contract: BlockscoutV2Address | null
|
|
23
|
+
value: string
|
|
24
|
+
/** Fee actually paid (`actual`) once mined, including the L1 data fee of rollups */
|
|
25
|
+
fee: { type: 'actual' | 'maximum'; value: string }
|
|
26
|
+
gas_used: string | null
|
|
27
|
+
gas_price: string | null
|
|
28
|
+
gas_limit: string
|
|
29
|
+
/** `null` while the transaction is pending */
|
|
30
|
+
status: 'ok' | 'error' | null
|
|
31
|
+
raw_input: string | null
|
|
32
|
+
/** Decoded method name, or the method id when it cannot be decoded */
|
|
33
|
+
method: string | null
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Item of `GET /addresses/{address}/token-transfers` */
|
|
37
|
+
export type BlockscoutV2TokenTransfer = {
|
|
38
|
+
transaction_hash: string
|
|
39
|
+
block_hash: string
|
|
40
|
+
block_number: number
|
|
41
|
+
log_index: number
|
|
42
|
+
timestamp: string | null
|
|
43
|
+
from: BlockscoutV2Address
|
|
44
|
+
to: BlockscoutV2Address
|
|
45
|
+
token: {
|
|
46
|
+
address_hash: string
|
|
47
|
+
name: string | null
|
|
48
|
+
symbol: string | null
|
|
49
|
+
decimals: string | null
|
|
50
|
+
/** e.g. `ERC-20`, `ERC-721`, `ERC-1155` */
|
|
51
|
+
type: string
|
|
52
|
+
}
|
|
53
|
+
/** Same as `token.type`. Absent before Blockscout v10 (e.g. v9.0.2 on Alpen Testnet). */
|
|
54
|
+
token_type?: string | undefined
|
|
55
|
+
total: {
|
|
56
|
+
/** Amount, for ERC-20 and ERC-1155 */
|
|
57
|
+
value?: string | null
|
|
58
|
+
/** Token id, for ERC-721 and ERC-1155 */
|
|
59
|
+
token_id?: string | null
|
|
60
|
+
} | null
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/** Item of `GET /addresses/{address}/internal-transactions` */
|
|
64
|
+
export type BlockscoutV2InternalTransaction = {
|
|
65
|
+
transaction_hash: string
|
|
66
|
+
block_number: number
|
|
67
|
+
/** Index of the internal transaction in its transaction */
|
|
68
|
+
index: number
|
|
69
|
+
timestamp: string | null
|
|
70
|
+
from: BlockscoutV2Address
|
|
71
|
+
to: BlockscoutV2Address | null
|
|
72
|
+
created_contract: BlockscoutV2Address | null
|
|
73
|
+
value: string
|
|
74
|
+
/** Call type, e.g. `call`, `delegatecall`, `staticcall`, `create` */
|
|
75
|
+
type: string
|
|
76
|
+
success: boolean
|
|
77
|
+
error: string | null
|
|
78
|
+
gas_limit: string | null
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** Keyset-paginated list: `next_page_params` are the query params of the next (older) page */
|
|
82
|
+
export type BlockscoutV2Page<T> = {
|
|
83
|
+
items: T[]
|
|
84
|
+
next_page_params: Record<string, string | number | null> | null
|
|
85
|
+
}
|
package/src/types/index.ts
CHANGED