mirror of
https://github.com/status-im/MyCrypto.git
synced 2025-02-18 05:56:54 +00:00
RSK Mainnet configuration (#1994)
* RSK mainnet configuration * Changes to fix errors on push * Reverts unnecessary props
This commit is contained in:
parent
ecb9aca739
commit
9d4769342f
8
common/config/contracts/rsk_testnet.json
Normal file
8
common/config/contracts/rsk_testnet.json
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[
|
||||||
|
{
|
||||||
|
"name": "Bridge",
|
||||||
|
"address": "0x0000000000000000000000000000000001000006",
|
||||||
|
"abi":
|
||||||
|
"[{ \"name\": \"getFederationAddress\", \"type\": \"function\", \"constant\": true, \"inputs\": [], \"outputs\": [{ \"name\": \"\", \"type\": \"string\" }] }]"
|
||||||
|
}
|
||||||
|
]
|
@ -83,6 +83,11 @@ export const RSK_TESTNET: DPath = {
|
|||||||
value: "m/44'/37310'/0'/0"
|
value: "m/44'/37310'/0'/0"
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export const RSK_MAINNET: DPath = {
|
||||||
|
label: 'Mainnet (RSK)',
|
||||||
|
value: "m/44'/137'/0'/0"
|
||||||
|
};
|
||||||
|
|
||||||
export const GO_DEFAULT: DPath = {
|
export const GO_DEFAULT: DPath = {
|
||||||
label: 'Default (GO)',
|
label: 'Default (GO)',
|
||||||
value: "m/44'/6060'/0'/0"
|
value: "m/44'/6060'/0'/0"
|
||||||
@ -114,6 +119,7 @@ export const DPaths: DPath[] = [
|
|||||||
ETSC_DEFAULT,
|
ETSC_DEFAULT,
|
||||||
EGEM_DEFAULT,
|
EGEM_DEFAULT,
|
||||||
CLO_DEFAULT,
|
CLO_DEFAULT,
|
||||||
|
RSK_MAINNET,
|
||||||
RSK_TESTNET,
|
RSK_TESTNET,
|
||||||
GO_DEFAULT,
|
GO_DEFAULT,
|
||||||
EOSC_DEFAULT,
|
EOSC_DEFAULT,
|
||||||
|
@ -1 +1 @@
|
|||||||
[]
|
[]
|
1
common/config/tokens/rsk_testnet.json
Normal file
1
common/config/tokens/rsk_testnet.json
Normal file
@ -0,0 +1 @@
|
|||||||
|
[]
|
@ -21,6 +21,7 @@ import {
|
|||||||
ETSC_DEFAULT,
|
ETSC_DEFAULT,
|
||||||
EGEM_DEFAULT,
|
EGEM_DEFAULT,
|
||||||
CLO_DEFAULT,
|
CLO_DEFAULT,
|
||||||
|
RSK_MAINNET,
|
||||||
RSK_TESTNET,
|
RSK_TESTNET,
|
||||||
GO_DEFAULT,
|
GO_DEFAULT,
|
||||||
EOSC_DEFAULT,
|
EOSC_DEFAULT,
|
||||||
@ -369,6 +370,32 @@ export const STATIC_NETWORKS_INITIAL_STATE: StaticNetworksState = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
RSK: {
|
||||||
|
id: 'RSK',
|
||||||
|
name: 'RSK',
|
||||||
|
unit: 'SBTC',
|
||||||
|
chainId: 30,
|
||||||
|
color: '#58A052',
|
||||||
|
isCustom: false,
|
||||||
|
blockExplorer: makeExplorer({
|
||||||
|
name: 'RSK Explorer',
|
||||||
|
origin: 'https://explorer.rsk.co'
|
||||||
|
}),
|
||||||
|
tokens: require('config/tokens/rsk.json'),
|
||||||
|
contracts: require('config/contracts/rsk.json'),
|
||||||
|
isTestnet: false,
|
||||||
|
dPathFormats: {
|
||||||
|
[SecureWalletName.TREZOR]: RSK_MAINNET,
|
||||||
|
[SecureWalletName.LEDGER_NANO_S]: RSK_MAINNET,
|
||||||
|
[InsecureWalletName.MNEMONIC_PHRASE]: RSK_MAINNET
|
||||||
|
},
|
||||||
|
gasPriceSettings: {
|
||||||
|
min: 0.183,
|
||||||
|
max: 1.5,
|
||||||
|
initial: 0.183
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
RSK_TESTNET: {
|
RSK_TESTNET: {
|
||||||
id: 'RSK_TESTNET',
|
id: 'RSK_TESTNET',
|
||||||
name: 'RSK',
|
name: 'RSK',
|
||||||
@ -380,8 +407,8 @@ export const STATIC_NETWORKS_INITIAL_STATE: StaticNetworksState = {
|
|||||||
name: 'RSK Testnet Explorer',
|
name: 'RSK Testnet Explorer',
|
||||||
origin: 'https://explorer.testnet.rsk.co'
|
origin: 'https://explorer.testnet.rsk.co'
|
||||||
}),
|
}),
|
||||||
tokens: require('config/tokens/rsk.json'),
|
tokens: require('config/tokens/rsk_testnet.json'),
|
||||||
contracts: require('config/contracts/rsk.json'),
|
contracts: require('config/contracts/rsk_testnet.json'),
|
||||||
isTestnet: true,
|
isTestnet: true,
|
||||||
dPathFormats: {
|
dPathFormats: {
|
||||||
[SecureWalletName.TREZOR]: RSK_TESTNET,
|
[SecureWalletName.TREZOR]: RSK_TESTNET,
|
||||||
|
@ -168,6 +168,15 @@ export const NODE_CONFIGS: { [key in StaticNetworkIds]: RawNodeConfig[] } = {
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
|
||||||
|
RSK: [
|
||||||
|
{
|
||||||
|
name: makeNodeName('RSK', 'rsk_mainnet'),
|
||||||
|
type: 'rpc',
|
||||||
|
service: 'mycrypto.rsk.co',
|
||||||
|
url: 'https://mycrypto.rsk.co/'
|
||||||
|
}
|
||||||
|
],
|
||||||
|
|
||||||
RSK_TESTNET: [
|
RSK_TESTNET: [
|
||||||
{
|
{
|
||||||
name: makeNodeName('RSK_TESTNET', 'rsk_testnet'),
|
name: makeNodeName('RSK_TESTNET', 'rsk_testnet'),
|
||||||
|
1
shared/types/network.d.ts
vendored
1
shared/types/network.d.ts
vendored
@ -13,6 +13,7 @@ type StaticNetworkIds =
|
|||||||
| 'ETSC'
|
| 'ETSC'
|
||||||
| 'EGEM'
|
| 'EGEM'
|
||||||
| 'CLO'
|
| 'CLO'
|
||||||
|
| 'RSK'
|
||||||
| 'RSK_TESTNET'
|
| 'RSK_TESTNET'
|
||||||
| 'GO'
|
| 'GO'
|
||||||
| 'EOSC'
|
| 'EOSC'
|
||||||
|
@ -16,6 +16,7 @@ configuredStore.getState();
|
|||||||
const VALID_BTC_ADDRESS = '1MEWT2SGbqtz6mPCgFcnea8XmWV5Z4Wc6';
|
const VALID_BTC_ADDRESS = '1MEWT2SGbqtz6mPCgFcnea8XmWV5Z4Wc6';
|
||||||
const VALID_ETH_ADDRESS = '0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8';
|
const VALID_ETH_ADDRESS = '0x7cB57B5A97eAbe94205C07890BE4c1aD31E486A8';
|
||||||
const VALID_RSK_TESTNET_ADDRESS = '0x5aAeb6053F3e94c9b9A09F33669435E7EF1BEaEd';
|
const VALID_RSK_TESTNET_ADDRESS = '0x5aAeb6053F3e94c9b9A09F33669435E7EF1BEaEd';
|
||||||
|
const VALID_RSK_MAINNET_ADDRESS = '0x5aaEB6053f3e94c9b9a09f33669435E7ef1bEAeD';
|
||||||
const VALID_ETH_PRIVATE_KEY = '3f4fd89ea4970cc77bfd2d07a95786575ea62e183857afe6301578e1a3c5c782';
|
const VALID_ETH_PRIVATE_KEY = '3f4fd89ea4970cc77bfd2d07a95786575ea62e183857afe6301578e1a3c5c782';
|
||||||
const INVALID_ETH_PRIVATE_KEY = '3f4fd89ea4970cc77bfd2d07a95786575ea62e183857afe6301578e1a3c5ZZZZ';
|
const INVALID_ETH_PRIVATE_KEY = '3f4fd89ea4970cc77bfd2d07a95786575ea62e183857afe6301578e1a3c5ZZZZ';
|
||||||
const VALID_ETH_PRIVATE_BUFFER = Buffer.from(VALID_ETH_PRIVATE_KEY, 'hex');
|
const VALID_ETH_PRIVATE_BUFFER = Buffer.from(VALID_ETH_PRIVATE_KEY, 'hex');
|
||||||
@ -50,6 +51,12 @@ describe('Validator', () => {
|
|||||||
it('should validate correct RSK address in RSK mainnet network as false', () => {
|
it('should validate correct RSK address in RSK mainnet network as false', () => {
|
||||||
expect(isValidAddress(VALID_RSK_TESTNET_ADDRESS, RSK_MAINNET_CHAIN_ID)).toBeFalsy();
|
expect(isValidAddress(VALID_RSK_TESTNET_ADDRESS, RSK_MAINNET_CHAIN_ID)).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
it('should validate correct RSK address in RSK mainnet network as true', () => {
|
||||||
|
expect(isValidAddress(VALID_RSK_MAINNET_ADDRESS, RSK_MAINNET_CHAIN_ID)).toBeTruthy();
|
||||||
|
});
|
||||||
|
it('should validate correct RSK mainnet address in RSK testnet network as false', () => {
|
||||||
|
expect(isValidAddress(VALID_RSK_MAINNET_ADDRESS, RSK_TESTNET_CHAIN_ID)).toBeFalsy();
|
||||||
|
});
|
||||||
it('should validate an incorrect DPath as false', () => {
|
it('should validate an incorrect DPath as false', () => {
|
||||||
expect(isValidPath('m/44/60/0/0')).toBeFalsy();
|
expect(isValidPath('m/44/60/0/0')).toBeFalsy();
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user