-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconfig.js
90 lines (81 loc) · 2.61 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// BIP 44 Path levels for BTC and ETH, OLT uses all hardened path on every level
// m / purpose' / coin_type' / account' / change / address_index
const masterkey = "m/";
const bip44purpose = "44'/";
const keyPathSuffix = "'";
const oltCoinType = "403'/0'/0'/";
const bitCoinType = "0'/0'/0/";
const ethCoinType = "60'/0'/0/";
const oneledgerKeyPath = masterkey + bip44purpose + oltCoinType;
const bitcoinKeyPath = masterkey + bip44purpose + bitCoinType;
const ethereumKeyPath = masterkey + bip44purpose + ethCoinType;
// TODO : when needs the support of BitCoin External and Internal change for the keyPath, uncomment below part
// with btc external and internal change
// const oltCoinType = "403'/";
// const bitCoinType = "0'/";
// const ethCoinType = "60'/";
//
// const oltAccount = "0'/";
// const btcAccount = "0'/";
// const ethAccount = "0'/";
//
// const oltChange = "0'/";
// External chain is used for addresses that are meant to be visible outside of the wallet (e.g. for receiving payments)
// const btcChangeExternal = "0/"; // only expose external ones
// Internal chain is used for addresses which are not meant to be visible outside of the wallet and is used for return transaction change.
// const btcChangeInternal = "1/";
// const ethChange = "0/";
//
//
// const oneledgerKeyPath = masterkey + bip44purpose + oltCoinType + oltAccount + oltChange;
// const externalBitcoinKeyPath = masterkey + bip44purpose + bitCoinType + btcAccount + btcChangeExternal;
// const internalBitcoinKeyPath = masterkey + bip44purpose + bitCoinType + btcAccount + btcChangeInternal;
// const ethereumKeyPath = masterkey + bip44purpose + ethCoinType + ethAccount + ethChange;
const derivedKeyType = {
OLT: "OLT",
BTCP2PK: "BTCP2PK",
BTCP2PKH: "BTCP2PKH",
ETH: "ETH"
};
const signatureKeyType = {
OLT: "OLT",
BTC: "BTC",
ETH: "ETH"
};
const bitcoinNetworkType = {
BITCOIN: "BITCOIN",
TESTNET: "TESTNET",
REGTEST: "REGTEST"
};
const oltAddrPrefix = "0lt";
const ethAddrPrefix = "0x";
const ethChainList = {
mainnet: "mainnet",
rinkeby: "rinkeby",
ropsten: "ropsten",
kovan: "kovan",
goerli: "goerli"
};
const ethHardforkList = {
petersburg: "petersburg",
constantinople: "constantinople",
byzantium: "byzantium"
};
const ethDefaultTxConfig = {
chain: ethChainList.mainnet,
hardfork: ethHardforkList.petersburg
};
module.exports = {
oneledgerKeyPath,
bitcoinKeyPath,
ethereumKeyPath,
keyPathSuffix,
derivedKeyType,
signatureKeyType,
bitcoinNetworkType,
oltAddrPrefix,
ethAddrPrefix,
ethChainList,
ethHardforkList,
ethDefaultTxConfig
};