Skip to content

Commit 464b508

Browse files
committed
feat: add Stable EVM chain support
Add Stable L2 EVM chain to BitGoJS: - Add STABLE to CoinFamily and UnderlyingAsset enums - Add Stable network configs (mainnet chainId: 988, testnet: 2201) - Add stable/tstable coin entries with EVM features - Add OFC entries (ofcstable/ofctstable) for off-chain trading - Add explorer environment URLs (stablescan.xyz) - Update test fixtures Ticket: WIN-8747 CECHO-114
1 parent ba9875b commit 464b508

6 files changed

Lines changed: 75 additions & 0 deletions

File tree

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -242,6 +242,9 @@ const mainnetBase: EnvironmentTemplate = {
242242
sonic: {
243243
baseUrl: 'https://api.etherscan.io/v2',
244244
},
245+
stable: {
246+
baseUrl: 'https://stablescan.xyz/api',
247+
},
245248
seievm: {
246249
baseUrl: 'https://api.etherscan.io/v2',
247250
},
@@ -430,6 +433,9 @@ const testnetBase: EnvironmentTemplate = {
430433
sonic: {
431434
baseUrl: 'https://api.etherscan.io/v2',
432435
},
436+
stable: {
437+
baseUrl: 'https://testnet.stablescan.xyz/api',
438+
},
433439
seievm: {
434440
baseUrl: 'https://api.etherscan.io/v2',
435441
},

modules/statics/src/allCoinsAndTokens.ts

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,6 +1770,42 @@ export const allCoinsAndTokens = [
17701770
CoinFeature.EVM_NON_BITGO_RECOVERY,
17711771
]
17721772
),
1773+
account(
1774+
'599ab8d6-ebda-460e-8527-677157f86021',
1775+
'stable',
1776+
'Stable',
1777+
Networks.main.stable,
1778+
18,
1779+
UnderlyingAsset.STABLE,
1780+
BaseUnit.ETH,
1781+
[
1782+
...EVM_FEATURES,
1783+
CoinFeature.SHARED_EVM_SIGNING,
1784+
CoinFeature.SHARED_EVM_SDK,
1785+
CoinFeature.EVM_COMPATIBLE_IMS,
1786+
CoinFeature.EVM_COMPATIBLE_UI,
1787+
CoinFeature.EVM_COMPATIBLE_WP,
1788+
CoinFeature.SUPPORTS_ERC20,
1789+
]
1790+
),
1791+
account(
1792+
'fd6b7af0-aff3-45fb-9a71-2d7100a1cd89',
1793+
'tstable',
1794+
'Testnet Stable',
1795+
Networks.test.stable,
1796+
18,
1797+
UnderlyingAsset.STABLE,
1798+
BaseUnit.ETH,
1799+
[
1800+
...EVM_FEATURES,
1801+
CoinFeature.SHARED_EVM_SIGNING,
1802+
CoinFeature.SHARED_EVM_SDK,
1803+
CoinFeature.EVM_COMPATIBLE_IMS,
1804+
CoinFeature.EVM_COMPATIBLE_UI,
1805+
CoinFeature.EVM_COMPATIBLE_WP,
1806+
CoinFeature.SUPPORTS_ERC20,
1807+
]
1808+
),
17731809
account(
17741810
'df01a650-3c8b-4182-a7cb-8ee7ad115c21',
17751811
'xpl',

modules/statics/src/base.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ export enum CoinFamily {
103103
SOL = 'sol',
104104
SONIC = 'sonic',
105105
SONEIUM = 'soneium',
106+
STABLE = 'stable',
106107
STT = 'stt',
107108
SUI = 'sui',
108109
STX = 'stx',
@@ -633,6 +634,7 @@ export enum UnderlyingAsset {
633634
SGB = 'sgb',
634635
SOL = 'sol',
635636
SONIC = 'sonic',
637+
STABLE = 'stable',
636638
SUI = 'sui',
637639
STX = 'stx',
638640
TIA = 'tia', // Celestia

modules/statics/src/coins/ofcCoins.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -185,6 +185,15 @@ export const ofcCoins = [
185185
UnderlyingAsset.SONIC,
186186
CoinKind.CRYPTO
187187
),
188+
ofc('13151b0b-3734-452d-8ad9-21af03a08bfe', 'ofcstable', 'Stable', 18, UnderlyingAsset.STABLE, CoinKind.CRYPTO),
189+
tofc(
190+
'39a4dd77-b824-47b9-baff-b45398012511',
191+
'ofctstable',
192+
'Stable Testnet',
193+
18,
194+
UnderlyingAsset.STABLE,
195+
CoinKind.CRYPTO
196+
),
188197
ofc(
189198
'ec31b18d-f034-4e84-837e-2c7d2908bbae',
190199
'ofchypeevm',

modules/statics/src/networks.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1809,6 +1809,24 @@ class SonicTestnet extends Testnet implements EthereumNetwork {
18091809
walletImplementationAddress = '0x944fef03af368414f29dc31a72061b8d64f568d2';
18101810
}
18111811

1812+
class Stable extends Mainnet implements EthereumNetwork {
1813+
name = 'Stable';
1814+
family = CoinFamily.STABLE;
1815+
explorerUrl = 'https://stablescan.xyz/tx/';
1816+
accountExplorerUrl = 'https://stablescan.xyz/address/';
1817+
chainId = 988;
1818+
nativeCoinOperationHashPrefix = '988';
1819+
}
1820+
1821+
class StableTestnet extends Testnet implements EthereumNetwork {
1822+
name = 'Testnet Stable';
1823+
family = CoinFamily.STABLE;
1824+
explorerUrl = 'https://testnet.stablescan.xyz/tx/';
1825+
accountExplorerUrl = 'https://testnet.stablescan.xyz/address/';
1826+
chainId = 2201;
1827+
nativeCoinOperationHashPrefix = '2201';
1828+
}
1829+
18121830
class Kaia extends Mainnet implements EthereumNetwork {
18131831
name = 'Kaia';
18141832
family = CoinFamily.KAIA;
@@ -2483,6 +2501,7 @@ export const Networks = {
24832501
sgb: Object.freeze(new Songbird()),
24842502
sol: Object.freeze(new Sol()),
24852503
sonic: Object.freeze(new Sonic()),
2504+
stable: Object.freeze(new Stable()),
24862505
sui: Object.freeze(new Sui()),
24872506
near: Object.freeze(new Near()),
24882507
stx: Object.freeze(new Stx()),
@@ -2603,6 +2622,7 @@ export const Networks = {
26032622
stt: Object.freeze(new SomniaTestnet()),
26042623
soneium: Object.freeze(new SoneiumTestnet()),
26052624
sonic: Object.freeze(new SonicTestnet()),
2625+
stable: Object.freeze(new StableTestnet()),
26062626
kaia: Object.freeze(new KaiaTestnet()),
26072627
susd: Object.freeze(new SUSDTestnet()),
26082628
coreum: Object.freeze(new CoreumTestnet()),

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ export const expectedColdFeatures = {
124124
'sol',
125125
'sonic',
126126
'somi',
127+
'stable',
127128
'sui',
128129
'tao',
129130
'tempo',
@@ -211,6 +212,7 @@ export const expectedColdFeatures = {
211212
'tseievm',
212213
'tton',
213214
'tsonic',
215+
'tstable',
214216
],
215217
neither: [
216218
'ethw',

0 commit comments

Comments
 (0)