From fdd06f56c55f9d639fcae4fa3275856736cc0860 Mon Sep 17 00:00:00 2001 From: Sachin Roy Date: Mon, 18 May 2026 17:45:51 +0000 Subject: [PATCH] fix(statics): correct Avalanche C-Chain entries in LEGACY_CHAIN_ID_MAP Chain IDs 43114 and 43113 were mapped to 'avax' and 'tavax' respectively, but the registered coin names are 'avaxc' and 'tavaxc'. Any call to CoinMap.fromChainId() for these chain IDs would throw CoinNotDefinedError. Adds a unit test asserting that coinNameFromChainId(43114) returns 'avaxc' and coinNameFromChainId(43113) returns 'tavaxc', and that coins.get() succeeds for both. Ticket: CGD-726 Co-Authored-By: Claude Opus 4.7 Session-Id: 6ec5a14f-c3aa-46ed-8177-39e4fc4263cd Task-Id: 1d9f9835-f70a-4605-9a03-d95971816e49 --- modules/statics/src/map.ts | 4 ++-- modules/statics/test/unit/coins.ts | 12 ++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/modules/statics/src/map.ts b/modules/statics/src/map.ts index 71e653f1b4..31314c9b22 100644 --- a/modules/statics/src/map.ts +++ b/modules/statics/src/map.ts @@ -113,8 +113,8 @@ export class CoinMap { 11142220: 'tcelo', 2222: 'kava', 2221: 'tkava', - 43114: 'avax', - 43113: 'tavax', + 43114: 'avaxc', + 43113: 'tavaxc', 100: 'gno', 130: 'unieth', 1301: 'tunieth', diff --git a/modules/statics/test/unit/coins.ts b/modules/statics/test/unit/coins.ts index c39bc3538e..57bb1bcb71 100644 --- a/modules/statics/test/unit/coins.ts +++ b/modules/statics/test/unit/coins.ts @@ -857,6 +857,18 @@ describe('CoinMap', function () { should(ethCoinName).not.be.undefined(); ethCoinName!.should.equal('eth'); }); + + it('should map Avalanche C-Chain chain IDs to registered coin names', () => { + const avaxcName = coins.coinNameFromChainId(43114); + should(avaxcName).not.be.undefined(); + avaxcName!.should.equal('avaxc'); + should(() => coins.get(avaxcName!)).not.throw(); + + const tavaxcName = coins.coinNameFromChainId(43113); + should(tavaxcName).not.be.undefined(); + tavaxcName!.should.equal('tavaxc'); + should(() => coins.get(tavaxcName!)).not.throw(); + }); }); });