Skip to content

Commit 5b77d02

Browse files
authored
Merge pull request #6674 from BitGo/WIN-6642-add-statics-and-configs
feat: add plasma config in sdk
2 parents a3ed188 + 873d57f commit 5b77d02

File tree

6 files changed

+63
-0
lines changed

6 files changed

+63
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ describe('V2 Keychains', function () {
8383
n.asset !== UnderlyingAsset.PHRS &&
8484
n.asset !== UnderlyingAsset.CTC &&
8585
n.asset !== UnderlyingAsset.HYPEEVM &&
86+
n.asset !== UnderlyingAsset.PLASMA &&
8687
n.asset !== UnderlyingAsset.STT &&
8788
n.asset !== UnderlyingAsset.SONEIUM &&
8889
n.asset !== UnderlyingAsset.VET &&

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -222,6 +222,9 @@ const mainnetBase: EnvironmentTemplate = {
222222
og: {
223223
baseUrl: '', //TODO- WIN-6519 when mainnet details available
224224
},
225+
xpl: {
226+
baseUrl: '', //TODO- WIN-6654 when mainnet details available
227+
},
225228
sonic: {
226229
baseUrl: 'https://rpc.soniclabs.com',
227230
},
@@ -339,6 +342,9 @@ const testnetBase: EnvironmentTemplate = {
339342
og: {
340343
baseUrl: 'https://chainscan-test.0g.ai/open/api',
341344
},
345+
xpl: {
346+
baseUrl: 'https://testnet-rpc.plasma.to',
347+
},
342348
sonic: {
343349
baseUrl: 'https://rpc.blaze.soniclabs.com',
344350
},

modules/statics/src/base.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ export enum CoinFamily {
6868
LTC = 'ltc',
6969
MANTRA = 'mantra',
7070
MON = 'mon',
71+
PLASMA = 'xpl', // Plasma Network
7172
POLYGON = 'polygon',
7273
POLYX = 'polyx',
7374
PHRS = 'phrs',
@@ -518,6 +519,7 @@ export enum UnderlyingAsset {
518519
OG = 'og',
519520
OPETH = 'opeth',
520521
OSMO = 'osmo',
522+
PLASMA = 'xpl', // Plasma Network
521523
POLYGON = 'polygon',
522524
PHRS = 'phrs',
523525
CTC = 'ctc',

modules/statics/src/coins.ts

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1590,6 +1590,38 @@ export const coins = CoinMap.fromCoins([
15901590
CoinFeature.EVM_COMPATIBLE_UI,
15911591
]
15921592
),
1593+
account(
1594+
'df01a650-3c8b-4182-a7cb-8ee7ad115c21',
1595+
'xpl',
1596+
'Plasma',
1597+
Networks.main.plasma,
1598+
18,
1599+
UnderlyingAsset.PLASMA,
1600+
BaseUnit.ETH,
1601+
[
1602+
...EVM_FEATURES,
1603+
CoinFeature.SHARED_EVM_SIGNING,
1604+
CoinFeature.SHARED_EVM_SDK,
1605+
CoinFeature.EVM_COMPATIBLE_IMS,
1606+
CoinFeature.EVM_COMPATIBLE_UI,
1607+
]
1608+
),
1609+
account(
1610+
'f99e8326-ea4f-4a84-8033-194d421daedb',
1611+
'txpl',
1612+
'Plasma Testnet',
1613+
Networks.test.plasma,
1614+
18,
1615+
UnderlyingAsset.PLASMA,
1616+
BaseUnit.ETH,
1617+
[
1618+
...EVM_FEATURES,
1619+
CoinFeature.SHARED_EVM_SIGNING,
1620+
CoinFeature.SHARED_EVM_SDK,
1621+
CoinFeature.EVM_COMPATIBLE_IMS,
1622+
CoinFeature.EVM_COMPATIBLE_UI,
1623+
]
1624+
),
15931625
account(
15941626
'd92cbc11-0135-4304-bc10-7cdf82543880',
15951627
'kaia',

modules/statics/src/networks.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1342,6 +1342,24 @@ class Creditcoin extends Mainnet implements EthereumNetwork {
13421342
nativeCoinOperationHashPrefix = '102030';
13431343
}
13441344

1345+
class Plasma extends Mainnet implements EthereumNetwork {
1346+
name = 'Plasma';
1347+
family = CoinFamily.PLASMA;
1348+
explorerUrl = ''; //TODO- WIN-6654 when mainnet details available
1349+
accountExplorerUrl = ''; //TODO- WIN-6654 when mainnet details available
1350+
chainId = 9999999999999; //TODO- WIN-6654 when mainnet details available ,this is a dummy value
1351+
nativeCoinOperationHashPrefix = ''; //TODO- WIN-6654 when mainnet details available
1352+
}
1353+
1354+
class PlasmaTestnet extends Testnet implements EthereumNetwork {
1355+
name = 'PlasmaTestnet';
1356+
family = CoinFamily.PLASMA;
1357+
explorerUrl = 'https://testnet.plasmascan.to/blockchain/transactions';
1358+
accountExplorerUrl = 'http://testnet.plasmaexplorer.io/address/';
1359+
chainId = 9746;
1360+
nativeCoinOperationHashPrefix = '9746';
1361+
}
1362+
13451363
class HypeEVMTestnet extends Testnet implements EthereumNetwork {
13461364
name = 'HyperliquidEVMTestnet';
13471365
family = CoinFamily.HYPEEVM;
@@ -1831,6 +1849,7 @@ export const Networks = {
18311849
wemix: Object.freeze(new Wemix()),
18321850
world: Object.freeze(new World()),
18331851
xdc: Object.freeze(new Xdc()),
1852+
plasma: Object.freeze(new Plasma()),
18341853
xrp: Object.freeze(new Xrp()),
18351854
xtz: Object.freeze(new Xtz()),
18361855
zCash: Object.freeze(new ZCash()),
@@ -1925,6 +1944,7 @@ export const Networks = {
19251944
wemix: Object.freeze(new WemixTestnet()),
19261945
world: Object.freeze(new WorldTestnet()),
19271946
xdc: Object.freeze(new XdcTestnet()),
1947+
plasma: Object.freeze(new PlasmaTestnet()),
19281948
xrp: Object.freeze(new XrpTestnet()),
19291949
xtz: Object.freeze(new XtzTestnet()),
19301950
zCash: Object.freeze(new ZCashTestnet()),

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,7 @@ export const expectedColdFeatures = {
101101
'ctc',
102102
'hypeevm',
103103
'lineaeth',
104+
'xpl',
104105
'xdc',
105106
'zeta',
106107
'tada',
@@ -151,6 +152,7 @@ export const expectedColdFeatures = {
151152
'ttia',
152153
'tvet',
153154
'txdc',
155+
'txpl',
154156
'twemix',
155157
'tzeta',
156158
'toas',

0 commit comments

Comments
 (0)