Skip to content

Commit

Permalink
Add Support for XinFin (XDC) Network. (#4250)
Browse files Browse the repository at this point in the history
* Add Support for XinFin ( XDC ) Network.

* Update assets.ts

* Update generateDefaultValues.spec.ts
  • Loading branch information
BlocksScanIO authored Feb 22, 2022
1 parent 4001780 commit 1ff2fef
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 2 deletions.
55 changes: 55 additions & 0 deletions src/database/data/networks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import {
DEFAULT_VOLTA,
DEFAULT_WEB,
DEFAULT_XDAI,
DEFAULT_XDC,
LEDGER_ETC,
LEDGER_ETH,
MAINNET_RSK,
Expand Down Expand Up @@ -1113,6 +1114,60 @@ export const NETWORKS_CONFIG: NetworkConfig = {
initial: 1
}
},
XDC: {
id: 'XDC',
name: 'XDC Network',
unit: 'XDC' as TTicker,
chainId: 50,
isCustom: false,
color: '#385686',
blockExplorer: makeExplorer({
name: 'BlocksScan Explorer',
origin: 'https://xdc.blocksscan.io'
}),
tokens: [],
contracts: [],
dPaths: {
[WalletId.TREZOR]: DEFAULT_ETH,
[WalletId.LEDGER_NANO_S]: DEFAULT_XDC,
[WalletId.TREZOR_NEW]: DEFAULT_ETH,
[WalletId.LEDGER_NANO_S_NEW]: DEFAULT_XDC,
[WalletId.GRIDPLUS]: DEFAULT_ETH,
default: DEFAULT_XDC
},
gasPriceSettings: {
min: 1,
max: 60,
initial: 10
}
},
XDCApothem: {
id: 'XDC',
name: 'XDC Apothem Network',
unit: 'XDC' as TTicker,
chainId: 51,
isCustom: false,
color: '#385686',
blockExplorer: makeExplorer({
name: 'Apothem BlocksScan Explorer',
origin: 'https://apothem.blocksscan.io'
}),
tokens: [],
contracts: [],
dPaths: {
[WalletId.TREZOR]: DEFAULT_ETH,
[WalletId.LEDGER_NANO_S]: DEFAULT_XDC,
[WalletId.TREZOR_NEW]: DEFAULT_ETH,
[WalletId.LEDGER_NANO_S_NEW]: DEFAULT_XDC,
[WalletId.GRIDPLUS]: DEFAULT_ETH,
default: DEFAULT_XDC
},
gasPriceSettings: {
min: 1,
max: 60,
initial: 10
}
},
HECO: {
id: 'HECO',
name: 'Huobi Eco Chain',
Expand Down
16 changes: 16 additions & 0 deletions src/database/data/nodes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -442,5 +442,21 @@ export const NODES_CONFIG: { [key in NetworkId]: StaticNodeConfig[] } = {
service: 'Hecochain.com',
url: 'https://http-mainnet.hecochain.com/'
}
],
XDC: [
{
name: NetworkUtils.makeNodeName('XDC', 'blocksscan.io'),
type: NodeType.RPC,
service: 'BlocksScan.io',
url: 'https://mycryptorpc.blocksscan.io'
}
],
XDCApothem: [
{
name: NetworkUtils.makeNodeName('XDCApothem', 'Apothem.blocksscan.io'),
type: NodeType.RPC,
service: 'Apothem.BlocksScan.io',
url: 'https://mycryptoarpc.blocksscan.io'
}
]
};
2 changes: 1 addition & 1 deletion src/database/generateDefaultValues.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ describe('Schema', () => {

it('adds Nodes to each Network', () => {
const nodes = toArray(defaultData[LSKeys.NETWORKS]).flatMap((n) => n.nodes);
expect(nodes).toHaveLength(55);
expect(nodes).toHaveLength(57);

This comment has been minimized.

Copy link
@GitesParti343

GitesParti343 Apr 3, 2022

57

});
});

Expand Down
4 changes: 3 additions & 1 deletion src/types/networkId.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,6 @@ export type NetworkId =
| 'AvalancheTestnet'
| 'EVRICE'
| 'Fantom'
| 'HECO';
| 'HECO'
| 'XDC'
| 'XDCApothem';

2 comments on commit 1ff2fef

@GitesParti343
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1ff2fef
🍥

@vonzy85
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1ff2fef
🍥

Please sign in to comment.