Skip to content

Commit 1ff2fef

Browse files
authored
Add Support for XinFin (XDC) Network. (#4250)
* Add Support for XinFin ( XDC ) Network. * Update assets.ts * Update generateDefaultValues.spec.ts
1 parent 4001780 commit 1ff2fef

File tree

4 files changed

+75
-2
lines changed

4 files changed

+75
-2
lines changed

src/database/data/networks.ts

+55
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import {
2828
DEFAULT_VOLTA,
2929
DEFAULT_WEB,
3030
DEFAULT_XDAI,
31+
DEFAULT_XDC,
3132
LEDGER_ETC,
3233
LEDGER_ETH,
3334
MAINNET_RSK,
@@ -1113,6 +1114,60 @@ export const NETWORKS_CONFIG: NetworkConfig = {
11131114
initial: 1
11141115
}
11151116
},
1117+
XDC: {
1118+
id: 'XDC',
1119+
name: 'XDC Network',
1120+
unit: 'XDC' as TTicker,
1121+
chainId: 50,
1122+
isCustom: false,
1123+
color: '#385686',
1124+
blockExplorer: makeExplorer({
1125+
name: 'BlocksScan Explorer',
1126+
origin: 'https://xdc.blocksscan.io'
1127+
}),
1128+
tokens: [],
1129+
contracts: [],
1130+
dPaths: {
1131+
[WalletId.TREZOR]: DEFAULT_ETH,
1132+
[WalletId.LEDGER_NANO_S]: DEFAULT_XDC,
1133+
[WalletId.TREZOR_NEW]: DEFAULT_ETH,
1134+
[WalletId.LEDGER_NANO_S_NEW]: DEFAULT_XDC,
1135+
[WalletId.GRIDPLUS]: DEFAULT_ETH,
1136+
default: DEFAULT_XDC
1137+
},
1138+
gasPriceSettings: {
1139+
min: 1,
1140+
max: 60,
1141+
initial: 10
1142+
}
1143+
},
1144+
XDCApothem: {
1145+
id: 'XDC',
1146+
name: 'XDC Apothem Network',
1147+
unit: 'XDC' as TTicker,
1148+
chainId: 51,
1149+
isCustom: false,
1150+
color: '#385686',
1151+
blockExplorer: makeExplorer({
1152+
name: 'Apothem BlocksScan Explorer',
1153+
origin: 'https://apothem.blocksscan.io'
1154+
}),
1155+
tokens: [],
1156+
contracts: [],
1157+
dPaths: {
1158+
[WalletId.TREZOR]: DEFAULT_ETH,
1159+
[WalletId.LEDGER_NANO_S]: DEFAULT_XDC,
1160+
[WalletId.TREZOR_NEW]: DEFAULT_ETH,
1161+
[WalletId.LEDGER_NANO_S_NEW]: DEFAULT_XDC,
1162+
[WalletId.GRIDPLUS]: DEFAULT_ETH,
1163+
default: DEFAULT_XDC
1164+
},
1165+
gasPriceSettings: {
1166+
min: 1,
1167+
max: 60,
1168+
initial: 10
1169+
}
1170+
},
11161171
HECO: {
11171172
id: 'HECO',
11181173
name: 'Huobi Eco Chain',

src/database/data/nodes.ts

+16
Original file line numberDiff line numberDiff line change
@@ -442,5 +442,21 @@ export const NODES_CONFIG: { [key in NetworkId]: StaticNodeConfig[] } = {
442442
service: 'Hecochain.com',
443443
url: 'https://http-mainnet.hecochain.com/'
444444
}
445+
],
446+
XDC: [
447+
{
448+
name: NetworkUtils.makeNodeName('XDC', 'blocksscan.io'),
449+
type: NodeType.RPC,
450+
service: 'BlocksScan.io',
451+
url: 'https://mycryptorpc.blocksscan.io'
452+
}
453+
],
454+
XDCApothem: [
455+
{
456+
name: NetworkUtils.makeNodeName('XDCApothem', 'Apothem.blocksscan.io'),
457+
type: NodeType.RPC,
458+
service: 'Apothem.BlocksScan.io',
459+
url: 'https://mycryptoarpc.blocksscan.io'
460+
}
445461
]
446462
};

src/database/generateDefaultValues.spec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ describe('Schema', () => {
4949

5050
it('adds Nodes to each Network', () => {
5151
const nodes = toArray(defaultData[LSKeys.NETWORKS]).flatMap((n) => n.nodes);
52-
expect(nodes).toHaveLength(55);
52+
expect(nodes).toHaveLength(57);
5353
});
5454
});
5555

src/types/networkId.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,6 @@ export type NetworkId =
3737
| 'AvalancheTestnet'
3838
| 'EVRICE'
3939
| 'Fantom'
40-
| 'HECO';
40+
| 'HECO'
41+
| 'XDC'
42+
| 'XDCApothem';

0 commit comments

Comments
 (0)