Skip to content

Commit 9dd76f9

Browse files
feat(statics): add pharos chain config
Ticket: WIN-5799 # Ticket: WIN-5799
1 parent 4cf7e72 commit 9dd76f9

File tree

6 files changed

+56
-0
lines changed

6 files changed

+56
-0
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ describe('V2 Keychains', function () {
7979
n.asset !== UnderlyingAsset.MANTRA &&
8080
n.asset !== UnderlyingAsset.MON &&
8181
n.asset !== UnderlyingAsset.WORLD &&
82+
n.asset !== UnderlyingAsset.PHRS &&
8283
n.asset !== UnderlyingAsset.STT &&
8384
n.asset !== UnderlyingAsset.SONEIUM &&
8485
n.asset !== UnderlyingAsset.VET &&

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

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,7 @@ interface EnvironmentTemplate {
8686
soneiumExplorerApiToken?: string;
8787
stxNodeUrl: string;
8888
vetNodeUrl: string;
89+
// The key here is coinName and it will be same for both mainnet and testnet (eg: 'phrs')
8990
evm?: {
9091
[key: string]: {
9192
baseUrl: string;
@@ -198,6 +199,11 @@ const mainnetBase: EnvironmentTemplate = {
198199
xdcExplorerBaseUrl: 'https://api.etherscan.io/v2',
199200
wemixExplorerBaseUrl: 'https://api.etherscan.io/v2',
200201
sgbExplorerBaseUrl: 'https://songbird-explorer.flare.network',
202+
evm: {
203+
phrs: {
204+
baseUrl: 'https://testnet.dplabs-internal.com', // TODO: WIN-5787 add mainnet url when its available
205+
},
206+
},
201207
icpNodeUrl: 'https://ic0.app',
202208
worldExplorerBaseUrl: 'https://worldscan.org/',
203209
somniaExplorerBaseUrl: 'https://shannon-explorer.somnia.network/', //TODO: WIN-5278: change it with mainnet explorer, when its available
@@ -275,6 +281,11 @@ const testnetBase: EnvironmentTemplate = {
275281
worldExplorerBaseUrl: 'https://sepolia.worldscan.org/',
276282
somniaExplorerBaseUrl: 'https://shannon-explorer.somnia.network/',
277283
soneiumExplorerBaseUrl: 'https://soneium-minato.blockscout.com',
284+
evm: {
285+
phrs: {
286+
baseUrl: 'https://testnet.dplabs-internal.com',
287+
},
288+
},
278289
stxNodeUrl: 'https://api.testnet.hiro.so',
279290
vetNodeUrl: 'https://rpc-testnet.vechain.energy',
280291
};

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
MON = 'mon',
6969
POLYGON = 'polygon',
7070
POLYX = 'polyx',
71+
PHRS = 'phrs',
7172
NEAR = 'near',
7273
OAS = 'oas',
7374
OFC = 'ofc',
@@ -469,6 +470,7 @@ export enum UnderlyingAsset {
469470
OPETH = 'opeth',
470471
OSMO = 'osmo',
471472
POLYGON = 'polygon',
473+
PHRS = 'phrs',
472474
RBTC = 'rbtc', // RSK main coin
473475
SEI = 'sei',
474476
SGB = 'sgb',

modules/statics/src/coins.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1293,6 +1293,26 @@ export const coins = CoinMap.fromCoins([
12931293
BaseUnit.ETH,
12941294
[...EVM_FEATURES, CoinFeature.SHARED_EVM_SIGNING]
12951295
),
1296+
account(
1297+
'bc2c6d82-69ee-4745-b213-6f83e90199db',
1298+
'phrs',
1299+
'Pharos',
1300+
Networks.main.phrs,
1301+
18,
1302+
UnderlyingAsset.PHRS,
1303+
BaseUnit.ETH,
1304+
[...EVM_FEATURES, CoinFeature.SHARED_EVM_SIGNING, CoinFeature.SHARED_EVM_SDK]
1305+
),
1306+
account(
1307+
'06b62cc0-1ab1-4473-8d14-c86f31e0b224',
1308+
'tphrs',
1309+
'Pharos Testnet',
1310+
Networks.test.phrs,
1311+
18,
1312+
UnderlyingAsset.PHRS,
1313+
BaseUnit.ETH,
1314+
[...EVM_FEATURES, CoinFeature.SHARED_EVM_SIGNING, CoinFeature.SHARED_EVM_SDK]
1315+
),
12961316
account(
12971317
'251b78df-90c5-4ff5-b07a-8cc23f27c5ff',
12981318
'soneium',

modules/statics/src/networks.ts

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1274,6 +1274,24 @@ class ApeChainTestnet extends Testnet implements EthereumNetwork {
12741274
nativeCoinOperationHashPrefix = '33111';
12751275
}
12761276

1277+
class Pharos extends Mainnet implements EthereumNetwork {
1278+
name = 'Pharos';
1279+
family = CoinFamily.PHRS;
1280+
explorerUrl = ''; // TODO: WIN-5787 Add mainnet url when available
1281+
accountExplorerUrl = ''; // TODO: WIN-5787 Add mainnet url when available
1282+
chainId = 688688; // TODO: WIN-5787 Add mainnet id when available
1283+
nativeCoinOperationHashPrefix = '688688';
1284+
}
1285+
1286+
class PharosTestnet extends Testnet implements EthereumNetwork {
1287+
name = 'PharosTestnet';
1288+
family = CoinFamily.PHRS;
1289+
explorerUrl = 'https://testnet.pharosscan.xyz/tx/';
1290+
accountExplorerUrl = 'https://testnet.pharosscan.xyz/address/';
1291+
chainId = 688688;
1292+
nativeCoinOperationHashPrefix = '688688';
1293+
}
1294+
12771295
class Xdc extends Mainnet implements EthereumNetwork {
12781296
name = 'XdcChain';
12791297
family = CoinFamily.XDC;
@@ -1557,6 +1575,7 @@ export const Networks = {
15571575
mantra: Object.freeze(new Mantra()),
15581576
polygon: Object.freeze(new Polygon()),
15591577
polyx: Object.freeze(new Polymesh()),
1578+
phrs: Object.freeze(new Pharos()),
15601579
oas: Object.freeze(new Oas()),
15611580
ofc: Object.freeze(new Ofc()),
15621581
optimism: Object.freeze(new Optimism()),
@@ -1639,6 +1658,7 @@ export const Networks = {
16391658
mantra: Object.freeze(new MantraTestnet()),
16401659
polygon: Object.freeze(new PolygonTestnet()),
16411660
polyx: Object.freeze(new PolymeshTestnet()),
1661+
phrs: Object.freeze(new PharosTestnet()),
16421662
oas: Object.freeze(new OasTestnet()),
16431663
ofc: Object.freeze(new OfcTestnet()),
16441664
optimism: Object.freeze(new OptimismTestnet()),

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

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,7 @@ export const expectedColdFeatures = {
8989
'vet',
9090
'wemix',
9191
'world',
92+
'phrs',
9293
'xdc',
9394
'zeta',
9495
'tada',
@@ -108,6 +109,7 @@ export const expectedColdFeatures = {
108109
'tflr',
109110
'tmon',
110111
'tworld',
112+
'tphrs',
111113
'thash',
112114
'thorchain:rune',
113115
'tia',

0 commit comments

Comments
 (0)