Add first-pass ARC network support#4162
Conversation
There was a problem hiding this comment.
Pull request overview
Adds first-pass ARC testnet support by treating ARC as an EVM-compatible chain across crypto-wallet-core, bitcore-client, and the bitcore-node test configuration.
Changes:
- Adds ARC chain metadata (EVM chain list membership, default testnet network, chain ID, native units, derivation path) and wires ARC into existing ETH/EVM providers for derivation/validation/transactions.
- Extends
bitcore-clientwallet logic to recognize ARC as an EVM chain and adds a focused unit test. - Adds/updates tests in
crypto-wallet-corefor ARC derivation, validation, chainId, native tx creation, ERC20 tx creation, and units.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| packages/crypto-wallet-core/test/validation.test.ts | Adds ARC address + URI validation tests. |
| packages/crypto-wallet-core/test/transactions.test.ts | Adds ARC tx/chainId/units tests and imports Constants. |
| packages/crypto-wallet-core/test/address.test.ts | Adds ARC derivation path + address derivation test. |
| packages/crypto-wallet-core/src/validation/index.ts | Registers ARC validation via ETH validation logic. |
| packages/crypto-wallet-core/src/transactions/index.ts | Registers ARC native + ARC ERC20 tx providers. |
| packages/crypto-wallet-core/src/derivation/paths.ts | Adds ARC derivation path base (EVM-style). |
| packages/crypto-wallet-core/src/derivation/index.ts | Registers ARC deriver using ETH deriver. |
| packages/crypto-wallet-core/src/constants/units.ts | Adds ARC native units (18-decimal base units). |
| packages/crypto-wallet-core/src/constants/chains.ts | Adds ARC to EVM chains + ARC testnet chain ID + default testnet network. |
| packages/bitcore-client/test/unit/wallet.arc.test.ts | Adds unit test asserting ARC is treated as EVM chain. |
| packages/bitcore-client/src/wallet.ts | Adds ARC to EVM chain libs and isEvmChain() list. |
| bitcore-test.config.json | Adds ARC testnet external provider configuration (Moralis module + RPC host). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| OP_sepolia: 11155420, | ||
| OP_goerli: 28528, | ||
| // ARC testnets | ||
| ARC_testnet: 5042002, | ||
| // Regtests |
There was a problem hiding this comment.
We may want to set ARC_mainnet to an invalid placeholder string
| const arcValidation = new EthValidation(); | ||
| arcValidation.regex = /arc/i; | ||
|
|
kajoseph
left a comment
There was a problem hiding this comment.
In addition to some of the feedback from copilot above...
| toSatoshis: 1e18, | ||
| full: { | ||
| maxDecimals: 8, | ||
| minDecimals: 8 |
There was a problem hiding this comment.
I think these should be 6 since USDC shouldn't go beyond 6 decimals
| OP_sepolia: 11155420, | ||
| OP_goerli: 28528, | ||
| // ARC testnets | ||
| ARC_testnet: 5042002, | ||
| // Regtests |
There was a problem hiding this comment.
We may want to set ARC_mainnet to an invalid placeholder string
Summary
Adds first-pass ARC testnet support as an EVM-compatible chain.
bitcore-test.config.jsonvia./moralisNotes / Follow-ups
ARC native USDC and the ARC ERC-20 USDC interface represent the same underlying balance with different units:
0x3600000000000000000000000000000000000000: 6 decimalsFollow-up work is needed for:
/currenciesmetadata for native ARC and ARC USDCValidation
Automated:
packages/crypto-wallet-core:npm run testpackages/bitcore-client:npm run compilepackages/bitcore-client:./node_modules/.bin/mocha -r tsx --exit 'test/unit/wallet.arc.test.ts'Manual smoke:
./moraliswallet-createwallet-derivewallet-balancewallet-send0x686cd1fa60743fc35a61ead24e2f37a9444907eab1dfa3658208668a6c6e5ed1