-
Notifications
You must be signed in to change notification settings - Fork 54
Expand file tree
/
Copy pathrskInfo.ts
More file actions
142 lines (131 loc) · 3.6 KB
/
Copy pathrskInfo.ts
File metadata and controls
142 lines (131 loc) · 3.6 KB
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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
import { EdgeCurrencyInfo, EdgeTokenMap } from 'edge-core-js/types'
import { makeOuterPlugin } from '../../common/innerPlugin'
import { createEvmTokenId, makeMetaTokens } from '../../common/tokenHelpers'
import type { EthereumTools } from '../EthereumTools'
import {
asEthereumInfoPayload,
EthereumFees,
EthereumInfoPayload,
EthereumNetworkInfo
} from '../ethereumTypes'
import {
evmCustomFeeTemplate,
evmCustomTokenTemplate,
evmMemoOptions,
makeEvmDefaultSettings
} from './ethereumCommonInfo'
const builtinTokens: EdgeTokenMap = {
'2acc95758f8b5f583470ba265eb685a8f45fc9d5': {
currencyCode: 'RIF',
displayName: 'RIF Token',
denominations: [{ name: 'RIF', multiplier: '1000000000000000000' }],
networkLocation: {
contractAddress: '0x2acc95758f8b5f583470ba265eb685a8f45fc9d5'
}
},
'3a15461d8ae0f0fb5fa2629e9da7d66a794a6e37': {
currencyCode: 'USDRIF',
displayName: 'RIF US Dollar',
denominations: [{ name: 'USDRIF', multiplier: '1000000000000000000' }],
networkLocation: {
contractAddress: '0x3a15461d8ae0f0fb5fa2629e9da7d66a794a6e37'
}
},
e700691da7b9851f2f35f8b8182c69c53ccad9db: {
currencyCode: 'DOC',
displayName: 'Dollar On Chain',
denominations: [{ name: 'DOC', multiplier: '1000000000000000000' }],
networkLocation: {
contractAddress: '0xe700691da7b9851f2f35f8b8182c69c53ccad9db'
}
}
}
const networkFees: EthereumFees = {
default: {
baseFee: undefined,
baseFeeMultiplier: undefined,
gasLimit: {
regularTransaction: '21000',
tokenTransaction: '200000',
minGasLimit: '21000'
},
gasPrice: {
lowFee: '59240000',
standardFeeLow: '59240000', // TODO: check this values
standardFeeHigh: '59240000',
standardFeeLowAmount: '59240000',
standardFeeHighAmount: '59240000',
highFee: '59240000',
minGasPrice: '59240000'
},
minPriorityFee: undefined
}
}
const networkInfo: EthereumNetworkInfo = {
addressQueryLookbackBlocks: 4, // ~2 minutes
networkAdapterConfigs: [
{
type: 'rpc',
servers: [
'https://public-node.rsk.co',
'https://lb.drpc.org/ogrpc?network=rootstock&dkey={{drpcApiKey}}'
]
},
{
type: 'evmscan',
gastrackerSupport: false,
servers: ['https://blockscout.com/rsk/mainnet']
}
],
uriNetworks: ['rsk', 'rbtc'],
ercTokenStandard: 'RRC20',
chainParams: {
chainId: 30,
name: 'Rootstock Mainnet'
},
hdPathCoinType: 137,
pluginMnemonicKeyName: 'rskMnemonic',
pluginRegularKeyName: 'rskKey',
evmGasStationUrl: null,
networkFees
}
const currencyInfo: EdgeCurrencyInfo = {
canReplaceByFee: true,
currencyCode: 'RBTC',
customFeeTemplate: evmCustomFeeTemplate,
customTokenTemplate: evmCustomTokenTemplate,
assetDisplayName: 'Rootstock',
chainDisplayName: 'Rootstock',
memoOptions: evmMemoOptions,
pluginId: 'rsk',
walletType: 'wallet:rsk',
// Explorers:
addressExplorer: 'https://explorer.rsk.co/address/%s',
transactionExplorer: 'https://explorer.rsk.co/tx/%s',
denominations: [
{
name: 'RBTC',
multiplier: '1000000000000000000',
symbol: 'RBTC'
}
],
usesChangeServer: true,
// Deprecated:
defaultSettings: makeEvmDefaultSettings(networkInfo),
displayName: 'Rootstock',
metaTokens: makeMetaTokens(builtinTokens)
}
export const rsk = makeOuterPlugin<
EthereumNetworkInfo,
EthereumTools,
EthereumInfoPayload
>({
builtinTokens,
currencyInfo,
asInfoPayload: asEthereumInfoPayload,
createTokenId: createEvmTokenId,
networkInfo,
async getInnerPlugin() {
return await import('../EthereumTools')
}
})