Skip to content

Commit b6a27e0

Browse files
committed
feat(statics): add Sonic chain configs
Ticket: WIN-6194
1 parent 273fb56 commit b6a27e0

File tree

6 files changed

+52
-0
lines changed

6 files changed

+52
-0
lines changed

modules/bitgo/test/v2/unit/keychains.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ describe('V2 Keychains', function () {
8989
n.asset !== UnderlyingAsset.FETCHAI &&
9090
n.asset !== UnderlyingAsset.INITIA &&
9191
n.asset !== UnderlyingAsset.ASI &&
92+
n.asset !== UnderlyingAsset.SONIC &&
9293
coinFamilyValues.includes(n.name)
9394
);
9495

modules/sdk-core/src/bitgo/environments.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -209,6 +209,9 @@ const mainnetBase: EnvironmentTemplate = {
209209
hypeevm: {
210210
baseUrl: 'https://rpc.hyperliquid.xyz/evm',
211211
},
212+
sonic: {
213+
baseUrl: 'https://rpc.soniclabs.com',
214+
},
212215
},
213216
icpNodeUrl: 'https://ic0.app',
214217
worldExplorerBaseUrl: 'https://worldscan.org/',
@@ -297,6 +300,9 @@ const testnetBase: EnvironmentTemplate = {
297300
hypeevm: {
298301
baseUrl: 'https://rpc.hyperliquid-testnet.xyz/evm',
299302
},
303+
sonic: {
304+
baseUrl: 'https://rpc.blaze.soniclabs.com',
305+
},
300306
},
301307
stxNodeUrl: 'https://api.testnet.hiro.so',
302308
vetNodeUrl: 'https://rpc-testnet.vechain.energy',

modules/statics/src/base.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ export enum CoinFamily {
8080
SGB = 'sgb',
8181
SEI = 'sei',
8282
SOL = 'sol',
83+
SONIC = 'sonic',
8384
SONEIUM = 'soneium',
8485
STT = 'stt',
8586
SUI = 'sui',
@@ -490,6 +491,8 @@ export enum UnderlyingAsset {
490491
SEI = 'sei',
491492
SGB = 'sgb',
492493
SOL = 'sol',
494+
SONIC = 'sonic',
495+
TSONIC = 'tsonic',
493496
SUI = 'sui',
494497
STX = 'stx',
495498
TIA = 'tia', // Celestia

modules/statics/src/coins.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1359,6 +1359,26 @@ export const coins = CoinMap.fromCoins([
13591359
BaseUnit.ETH,
13601360
[...EVM_FEATURES, CoinFeature.SHARED_EVM_SIGNING, CoinFeature.SHARED_EVM_SDK]
13611361
),
1362+
account(
1363+
'23e7eca6-e862-4bc5-bf4f-65eeb8174171',
1364+
'sonic',
1365+
'Sonic',
1366+
Networks.main.sonic,
1367+
18,
1368+
UnderlyingAsset.SONIC,
1369+
BaseUnit.ETH,
1370+
[...EVM_FEATURES, CoinFeature.SHARED_EVM_SIGNING, CoinFeature.SHARED_EVM_SDK]
1371+
),
1372+
account(
1373+
'b150906d-f3e0-4e81-859d-c33d92c73afb',
1374+
'tsonic',
1375+
'Sonic Testnet',
1376+
Networks.test.sonic,
1377+
18,
1378+
UnderlyingAsset.TSONIC,
1379+
BaseUnit.ETH,
1380+
[...EVM_FEATURES, CoinFeature.SHARED_EVM_SIGNING, CoinFeature.SHARED_EVM_SDK]
1381+
),
13621382
account(
13631383
'251b78df-90c5-4ff5-b07a-8cc23f27c5ff',
13641384
'soneium',

modules/statics/src/networks.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1328,6 +1328,24 @@ class CreditcoinTestnet extends Testnet implements EthereumNetwork {
13281328
nativeCoinOperationHashPrefix = '102031';
13291329
}
13301330

1331+
class Sonic extends Mainnet implements EthereumNetwork {
1332+
name = 'Sonic';
1333+
family = CoinFamily.SONIC;
1334+
explorerUrl = 'https://sonicscan.org/tx/';
1335+
accountExplorerUrl = 'https://sonicscan.org/address/';
1336+
chainId = 146;
1337+
nativeCoinOperationHashPrefix = '146';
1338+
}
1339+
1340+
class SonicTestnet extends Testnet implements EthereumNetwork {
1341+
name = 'SonicTestnet';
1342+
family = CoinFamily.SONIC;
1343+
explorerUrl = 'https://testnet.sonicscan.org/tx/';
1344+
accountExplorerUrl = 'https://testnet.sonicscan.org/address/';
1345+
chainId = 57054;
1346+
nativeCoinOperationHashPrefix = '57054';
1347+
}
1348+
13311349
class Xdc extends Mainnet implements EthereumNetwork {
13321350
name = 'XdcChain';
13331351
family = CoinFamily.XDC;
@@ -1650,6 +1668,7 @@ export const Networks = {
16501668
sei: Object.freeze(new Sei()),
16511669
sgb: Object.freeze(new Songbird()),
16521670
sol: Object.freeze(new Sol()),
1671+
sonic: Object.freeze(new Sonic()),
16531672
sui: Object.freeze(new Sui()),
16541673
near: Object.freeze(new Near()),
16551674
stx: Object.freeze(new Stx()),
@@ -1740,6 +1759,7 @@ export const Networks = {
17401759
stx: Object.freeze(new StxTestnet()),
17411760
stt: Object.freeze(new SomniaTestnet()),
17421761
soneium: Object.freeze(new SoneiumTestnet()),
1762+
sonic: Object.freeze(new SonicTestnet()),
17431763
susd: Object.freeze(new SUSDTestnet()),
17441764
coreum: Object.freeze(new CoreumTestnet()),
17451765
tao: Object.freeze(new BittensorTestnet()),

modules/statics/test/unit/fixtures/expectedColdFeatures.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ export const expectedColdFeatures = {
8383
'sgb',
8484
'sei',
8585
'sol',
86+
'sonic',
8687
'stt',
8788
'sui',
8889
'tao',
@@ -141,6 +142,7 @@ export const expectedColdFeatures = {
141142
'toas',
142143
'ton',
143144
'tton',
145+
'tsonic',
144146
],
145147
neither: [
146148
'baseeth',

0 commit comments

Comments
 (0)