@ledgerhq/coin-evm 5.4.0 → 5.4.1
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
CHANGED
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
# @ledgerhq/coin-evm
|
|
2
2
|
|
|
3
|
+
## 5.4.1
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#936](https://github.com/LedgerHQ/coin-modules/pull/936) [`30cc3a4`](https://github.com/LedgerHQ/coin-modules/commit/30cc3a47c0fecf9c1c4dbb46144786c95ab32bc1) Thanks [@francois-guerin-ledger](https://github.com/francois-guerin-ledger)! - Point the Arc EVM integration test at mainnet instead of testnet. The Arc testnet blockscout proxy now returns HTTP 301, and Arc mainnet is the production network going forward. The test still covers the same native-USDC-as-ERC20-precompile double-counting behavior, using real mainnet transactions.
|
|
8
|
+
|
|
3
9
|
## 5.4.0
|
|
4
10
|
|
|
5
11
|
### Minor Changes
|
package/package.json
CHANGED
|
@@ -6,29 +6,32 @@ import type { Operation } from '@ledgerhq/coin-module-framework/api/types'
|
|
|
6
6
|
import { createMockEvmContext } from '../fixtures/context.fixtures'
|
|
7
7
|
import { createApi } from './index'
|
|
8
8
|
|
|
9
|
-
// Arc
|
|
9
|
+
// Arc exposes its native unit (USDC) as an ERC20 at this fixed precompile
|
|
10
10
|
// address. The explorer indexes native transfers as BOTH a native tx AND a synthetic
|
|
11
11
|
// ERC20 Transfer event on this contract. We rely on the `nativeContracts` config
|
|
12
12
|
// to skip the ERC20 side so the wallet doesn't double-count.
|
|
13
13
|
const ARC_USDC_NATIVE_CONTRACT = '0x3600000000000000000000000000000000000000'
|
|
14
14
|
|
|
15
15
|
// Address with on-chain native USDC activity in both directions (IN and OUT).
|
|
16
|
-
const NATIVE_USDC_ADDRESS = '
|
|
16
|
+
const NATIVE_USDC_ADDRESS = '0x40ae34b075169df3a738571005be709d9376aa04'
|
|
17
17
|
|
|
18
|
-
describe('EVM Api (Arc
|
|
18
|
+
describe('EVM Api (Arc)', () => {
|
|
19
19
|
let module: ReturnType<typeof createApi>
|
|
20
20
|
let operations: Operation[]
|
|
21
21
|
|
|
22
22
|
const config: Partial<EvmConfigInfo> = {
|
|
23
|
-
node: {
|
|
23
|
+
node: {
|
|
24
|
+
type: 'external',
|
|
25
|
+
uri: 'https://arc.coin.ledger.com',
|
|
26
|
+
},
|
|
24
27
|
explorer: {
|
|
25
28
|
type: 'blockscout',
|
|
26
|
-
uri: 'https://proxyblockscout.api.live.ledger.com/
|
|
29
|
+
uri: 'https://proxyblockscout.api.live.ledger.com/5042/api',
|
|
27
30
|
},
|
|
28
31
|
nativeContracts: [ARC_USDC_NATIVE_CONTRACT],
|
|
29
32
|
}
|
|
30
33
|
beforeAll(async () => {
|
|
31
|
-
module = createApi('
|
|
34
|
+
module = createApi('arc')
|
|
32
35
|
|
|
33
36
|
const { items } = await module.listOperations(
|
|
34
37
|
createMockEvmContext(config),
|
|
@@ -65,22 +68,22 @@ describe('EVM Api (Arc Testnet)', () => {
|
|
|
65
68
|
})
|
|
66
69
|
|
|
67
70
|
it('exposes the expected metadata on a known native USDC IN transfer', () => {
|
|
68
|
-
// https://
|
|
69
|
-
//
|
|
70
|
-
const txHash = '
|
|
71
|
+
// https://arcscan.app/tx/0xb44d663b7ace5ddfecd432834ecaa5cd1221bf26b05566578cf674b977f037ca
|
|
72
|
+
// ~45.31835 USDC received from 0xe7ee2b3a… (18-decimal native units).
|
|
73
|
+
const txHash = '0xb44d663b7ace5ddfecd432834ecaa5cd1221bf26b05566578cf674b977f037ca'
|
|
71
74
|
|
|
72
75
|
const operation = operations.find((op) => op.tx.hash.toLowerCase() === txHash)
|
|
73
76
|
expect(operation).toMatchObject({
|
|
74
77
|
type: 'IN',
|
|
75
|
-
value:
|
|
78
|
+
value: 45318350000000000000n,
|
|
76
79
|
asset: { type: 'native' },
|
|
77
80
|
tx: expect.objectContaining({
|
|
78
81
|
hash: txHash,
|
|
79
|
-
block: expect.objectContaining({ height:
|
|
82
|
+
block: expect.objectContaining({ height: 21177512 }),
|
|
80
83
|
}),
|
|
81
84
|
})
|
|
82
85
|
expect(operation!.senders.map((s) => s.toLowerCase())).toEqual([
|
|
83
|
-
'
|
|
86
|
+
'0xe7ee2b3a199d7afb2df80089138dff0f619153e8',
|
|
84
87
|
])
|
|
85
88
|
expect(operation!.recipients.map((r) => r.toLowerCase())).toEqual([NATIVE_USDC_ADDRESS])
|
|
86
89
|
})
|