@exodus/ethereum-lib 3.3.26 → 3.3.28
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +3 -2
- package/src/abi/eth-staking-accounting.js +398 -0
- package/src/abi/eth-staking-pool.js +306 -0
- package/src/abi/index.js +4 -0
- package/src/account-state/index.js +11 -2
- package/src/account-state/parse-legacy-balances.js +32 -0
- package/src/balances/ethereum-balance.js +20 -0
- package/src/balances/index.js +1 -0
- package/src/balances/polygon-balance.js +14 -3
- package/src/constants.js +2 -2
- package/src/create-contract/index.js +4 -0
- package/src/fee-data/cronos.js +4 -4
- package/src/selectors/get-can-accelerate-tx-factory.js +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-lib",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.28",
|
|
4
4
|
"description": "Ethereum Library",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"@exodus/assets": "^8.0.84",
|
|
19
19
|
"@exodus/aurora-meta": "^1.0.3",
|
|
20
20
|
"@exodus/avalanchec-meta": "^1.0.4",
|
|
21
|
+
"@exodus/basemainnet-meta": "^1.0.2",
|
|
21
22
|
"@exodus/basic-utils": "^0.7.0",
|
|
22
23
|
"@exodus/bip32": "^1.0.0",
|
|
23
24
|
"@exodus/bsc-meta": "^1.0.14",
|
|
@@ -43,5 +44,5 @@
|
|
|
43
44
|
"ms": "^2.1.1",
|
|
44
45
|
"reselect": "~3.0.1"
|
|
45
46
|
},
|
|
46
|
-
"gitHead": "
|
|
47
|
+
"gitHead": "c5e6d4fb8566d79ecb82f249381e198a8d8bfb96"
|
|
47
48
|
}
|
|
@@ -0,0 +1,398 @@
|
|
|
1
|
+
// Everstake wallet-sdk for ETH
|
|
2
|
+
// https://github.com/everstake/wallet-sdk/blob/037b081755ece3c9a5be162748cec5ea1125acdf/ethereum.js#L3-L7
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
{
|
|
6
|
+
inputs: [{ internalType: 'string', name: 'field', type: 'string' }],
|
|
7
|
+
name: 'InvalidParam',
|
|
8
|
+
type: 'error',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
inputs: [{ internalType: 'string', name: 'field', type: 'string' }],
|
|
12
|
+
name: 'InvalidValue',
|
|
13
|
+
type: 'error',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
inputs: [{ internalType: 'string', name: 'field', type: 'string' }],
|
|
17
|
+
name: 'ZeroValue',
|
|
18
|
+
type: 'error',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
anonymous: false,
|
|
22
|
+
inputs: [{ indexed: false, internalType: 'uint256', name: 'round', type: 'uint256' }],
|
|
23
|
+
name: 'ActivateRound',
|
|
24
|
+
type: 'event',
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
anonymous: false,
|
|
28
|
+
inputs: [
|
|
29
|
+
{ indexed: false, internalType: 'address', name: 'staker', type: 'address' },
|
|
30
|
+
{ indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
31
|
+
],
|
|
32
|
+
name: 'AddWithdrawRequest',
|
|
33
|
+
type: 'event',
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
anonymous: false,
|
|
37
|
+
inputs: [{ indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' }],
|
|
38
|
+
name: 'Autocompound',
|
|
39
|
+
type: 'event',
|
|
40
|
+
},
|
|
41
|
+
{
|
|
42
|
+
anonymous: false,
|
|
43
|
+
inputs: [{ indexed: false, internalType: 'int256', name: '', type: 'int256' }],
|
|
44
|
+
name: 'ChangeExpectValidatorsToStop',
|
|
45
|
+
type: 'event',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
anonymous: false,
|
|
49
|
+
inputs: [{ indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' }],
|
|
50
|
+
name: 'ClaimPoolFee',
|
|
51
|
+
type: 'event',
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
anonymous: false,
|
|
55
|
+
inputs: [
|
|
56
|
+
{ indexed: false, internalType: 'address', name: 'staker', type: 'address' },
|
|
57
|
+
{ indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
58
|
+
],
|
|
59
|
+
name: 'ClaimWithdrawRequest',
|
|
60
|
+
type: 'event',
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
anonymous: false,
|
|
64
|
+
inputs: [
|
|
65
|
+
{ indexed: false, internalType: 'address', name: 'staker', type: 'address' },
|
|
66
|
+
{ indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
67
|
+
],
|
|
68
|
+
name: 'DepositPending',
|
|
69
|
+
type: 'event',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
anonymous: false,
|
|
73
|
+
inputs: [{ indexed: false, internalType: 'uint256', name: 'newFee', type: 'uint256' }],
|
|
74
|
+
name: 'FeeUpdated',
|
|
75
|
+
type: 'event',
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
anonymous: false,
|
|
79
|
+
inputs: [
|
|
80
|
+
{ indexed: false, internalType: 'address', name: 'oldGovernor', type: 'address' },
|
|
81
|
+
{ indexed: false, internalType: 'address', name: 'newGovernor', type: 'address' },
|
|
82
|
+
],
|
|
83
|
+
name: 'GovernorChanged',
|
|
84
|
+
type: 'event',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
anonymous: false,
|
|
88
|
+
inputs: [{ indexed: false, internalType: 'uint8', name: 'version', type: 'uint8' }],
|
|
89
|
+
name: 'Initialized',
|
|
90
|
+
type: 'event',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
anonymous: false,
|
|
94
|
+
inputs: [
|
|
95
|
+
{ indexed: false, internalType: 'address', name: 'staker', type: 'address' },
|
|
96
|
+
{ indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
97
|
+
],
|
|
98
|
+
name: 'InterchangeDeposit',
|
|
99
|
+
type: 'event',
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
anonymous: false,
|
|
103
|
+
inputs: [
|
|
104
|
+
{ indexed: false, internalType: 'address', name: 'staker', type: 'address' },
|
|
105
|
+
{ indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
106
|
+
],
|
|
107
|
+
name: 'InterchangeWithdraw',
|
|
108
|
+
type: 'event',
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
anonymous: false,
|
|
112
|
+
inputs: [
|
|
113
|
+
{ indexed: true, internalType: 'address', name: 'previousOwner', type: 'address' },
|
|
114
|
+
{ indexed: true, internalType: 'address', name: 'newOwner', type: 'address' },
|
|
115
|
+
],
|
|
116
|
+
name: 'OwnershipTransferred',
|
|
117
|
+
type: 'event',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
anonymous: false,
|
|
121
|
+
inputs: [{ indexed: true, internalType: 'address', name: 'superAdmin', type: 'address' }],
|
|
122
|
+
name: 'SetSuperAdmin',
|
|
123
|
+
type: 'event',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
anonymous: false,
|
|
127
|
+
inputs: [
|
|
128
|
+
{ indexed: false, internalType: 'uint256', name: 'rewarderBalance', type: 'uint256' },
|
|
129
|
+
{ indexed: false, internalType: 'uint256', name: 'reward', type: 'uint256' },
|
|
130
|
+
{ indexed: false, internalType: 'uint256', name: 'fee', type: 'uint256' },
|
|
131
|
+
],
|
|
132
|
+
name: 'Update',
|
|
133
|
+
type: 'event',
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
inputs: [],
|
|
137
|
+
name: 'BEACON_AMOUNT',
|
|
138
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
139
|
+
stateMutability: 'view',
|
|
140
|
+
type: 'function',
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
inputs: [],
|
|
144
|
+
name: 'FEE_DENOMINATOR',
|
|
145
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
146
|
+
stateMutability: 'view',
|
|
147
|
+
type: 'function',
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
inputs: [],
|
|
151
|
+
name: 'governor',
|
|
152
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
153
|
+
stateMutability: 'view',
|
|
154
|
+
type: 'function',
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
inputs: [],
|
|
158
|
+
name: 'owner',
|
|
159
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
160
|
+
stateMutability: 'view',
|
|
161
|
+
type: 'function',
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
inputs: [],
|
|
165
|
+
name: 'renounceOwnership',
|
|
166
|
+
outputs: [],
|
|
167
|
+
stateMutability: 'nonpayable',
|
|
168
|
+
type: 'function',
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
inputs: [{ internalType: 'address', name: 'value', type: 'address' }],
|
|
172
|
+
name: 'setSuperAdmin',
|
|
173
|
+
outputs: [],
|
|
174
|
+
stateMutability: 'nonpayable',
|
|
175
|
+
type: 'function',
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
inputs: [],
|
|
179
|
+
name: 'superAdmin',
|
|
180
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
181
|
+
stateMutability: 'view',
|
|
182
|
+
type: 'function',
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
inputs: [{ internalType: 'address', name: 'newOwner', type: 'address' }],
|
|
186
|
+
name: 'transferOwnership',
|
|
187
|
+
outputs: [],
|
|
188
|
+
stateMutability: 'nonpayable',
|
|
189
|
+
type: 'function',
|
|
190
|
+
},
|
|
191
|
+
{
|
|
192
|
+
inputs: [
|
|
193
|
+
{ internalType: 'uint256', name: 'poolFee', type: 'uint256' },
|
|
194
|
+
{ internalType: 'address', name: 'rewardsTreasury', type: 'address' },
|
|
195
|
+
{ internalType: 'address', name: 'withdrawTreasury', type: 'address' },
|
|
196
|
+
{ internalType: 'address', name: 'accountingGovernor', type: 'address' },
|
|
197
|
+
],
|
|
198
|
+
name: 'initialize',
|
|
199
|
+
outputs: [],
|
|
200
|
+
stateMutability: 'nonpayable',
|
|
201
|
+
type: 'function',
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
inputs: [
|
|
205
|
+
{ internalType: 'address', name: 'account', type: 'address' },
|
|
206
|
+
{ internalType: 'uint256', name: 'depositToPendingValue', type: 'uint256' },
|
|
207
|
+
],
|
|
208
|
+
name: 'deposit',
|
|
209
|
+
outputs: [
|
|
210
|
+
{ internalType: 'uint256', name: 'interchangedAmount', type: 'uint256' },
|
|
211
|
+
{ internalType: 'uint256', name: 'activatedSlots', type: 'uint256' },
|
|
212
|
+
],
|
|
213
|
+
stateMutability: 'nonpayable',
|
|
214
|
+
type: 'function',
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
inputs: [],
|
|
218
|
+
name: 'balance',
|
|
219
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
220
|
+
stateMutability: 'view',
|
|
221
|
+
type: 'function',
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
inputs: [],
|
|
225
|
+
name: 'pendingDepositedBalance',
|
|
226
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
227
|
+
stateMutability: 'view',
|
|
228
|
+
type: 'function',
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
inputs: [],
|
|
232
|
+
name: 'pendingBalance',
|
|
233
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
234
|
+
stateMutability: 'view',
|
|
235
|
+
type: 'function',
|
|
236
|
+
},
|
|
237
|
+
{
|
|
238
|
+
inputs: [{ internalType: 'address', name: 'account', type: 'address' }],
|
|
239
|
+
name: 'autocompoundBalanceOf',
|
|
240
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
241
|
+
stateMutability: 'view',
|
|
242
|
+
type: 'function',
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
inputs: [{ internalType: 'address', name: 'account', type: 'address' }],
|
|
246
|
+
name: 'depositedBalanceOf',
|
|
247
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
248
|
+
stateMutability: 'view',
|
|
249
|
+
type: 'function',
|
|
250
|
+
},
|
|
251
|
+
{
|
|
252
|
+
inputs: [{ internalType: 'address', name: 'account', type: 'address' }],
|
|
253
|
+
name: 'pendingDepositedBalanceOf',
|
|
254
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
255
|
+
stateMutability: 'view',
|
|
256
|
+
type: 'function',
|
|
257
|
+
},
|
|
258
|
+
{
|
|
259
|
+
inputs: [{ internalType: 'address', name: 'account', type: 'address' }],
|
|
260
|
+
name: 'pendingBalanceOf',
|
|
261
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
262
|
+
stateMutability: 'view',
|
|
263
|
+
type: 'function',
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
inputs: [
|
|
267
|
+
{ internalType: 'address', name: 'account', type: 'address' },
|
|
268
|
+
{ internalType: 'uint256', name: 'amount', type: 'uint256' },
|
|
269
|
+
],
|
|
270
|
+
name: 'withdrawPending',
|
|
271
|
+
outputs: [],
|
|
272
|
+
stateMutability: 'nonpayable',
|
|
273
|
+
type: 'function',
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
inputs: [
|
|
277
|
+
{ internalType: 'address', name: 'staker', type: 'address' },
|
|
278
|
+
{ internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
279
|
+
],
|
|
280
|
+
name: 'withdraw',
|
|
281
|
+
outputs: [{ internalType: 'uint256', name: 'withdrawFromPendingAmount', type: 'uint256' }],
|
|
282
|
+
stateMutability: 'nonpayable',
|
|
283
|
+
type: 'function',
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
inputs: [],
|
|
287
|
+
name: 'claimPoolFee',
|
|
288
|
+
outputs: [],
|
|
289
|
+
stateMutability: 'nonpayable',
|
|
290
|
+
type: 'function',
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
inputs: [],
|
|
294
|
+
name: 'getPoolFee',
|
|
295
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
296
|
+
stateMutability: 'view',
|
|
297
|
+
type: 'function',
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
inputs: [],
|
|
301
|
+
name: 'feeBalance',
|
|
302
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
303
|
+
stateMutability: 'view',
|
|
304
|
+
type: 'function',
|
|
305
|
+
},
|
|
306
|
+
{
|
|
307
|
+
inputs: [],
|
|
308
|
+
name: 'update',
|
|
309
|
+
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
|
|
310
|
+
stateMutability: 'nonpayable',
|
|
311
|
+
type: 'function',
|
|
312
|
+
},
|
|
313
|
+
{
|
|
314
|
+
inputs: [{ internalType: 'uint256', name: 'feeValue', type: 'uint256' }],
|
|
315
|
+
name: 'setFee',
|
|
316
|
+
outputs: [],
|
|
317
|
+
stateMutability: 'nonpayable',
|
|
318
|
+
type: 'function',
|
|
319
|
+
},
|
|
320
|
+
{
|
|
321
|
+
inputs: [],
|
|
322
|
+
name: 'autocompound',
|
|
323
|
+
outputs: [],
|
|
324
|
+
stateMutability: 'nonpayable',
|
|
325
|
+
type: 'function',
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
inputs: [],
|
|
329
|
+
name: 'pendingRestakedRewards',
|
|
330
|
+
outputs: [{ internalType: 'uint256', name: 'amount', type: 'uint256' }],
|
|
331
|
+
stateMutability: 'view',
|
|
332
|
+
type: 'function',
|
|
333
|
+
},
|
|
334
|
+
{
|
|
335
|
+
inputs: [{ internalType: 'address', name: 'account', type: 'address' }],
|
|
336
|
+
name: 'pendingRestakedRewardOf',
|
|
337
|
+
outputs: [{ internalType: 'uint256', name: 'amount', type: 'uint256' }],
|
|
338
|
+
stateMutability: 'view',
|
|
339
|
+
type: 'function',
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
inputs: [],
|
|
343
|
+
name: 'withdrawRequestQueueParams',
|
|
344
|
+
outputs: [
|
|
345
|
+
{ internalType: 'uint256', name: '', type: 'uint256' },
|
|
346
|
+
{ internalType: 'uint256', name: '', type: 'uint256' },
|
|
347
|
+
{ internalType: 'uint256', name: '', type: 'uint256' },
|
|
348
|
+
{ internalType: 'uint256', name: '', type: 'uint256' },
|
|
349
|
+
],
|
|
350
|
+
stateMutability: 'view',
|
|
351
|
+
type: 'function',
|
|
352
|
+
},
|
|
353
|
+
{
|
|
354
|
+
inputs: [{ internalType: 'address', name: 'staker', type: 'address' }],
|
|
355
|
+
name: 'withdrawRequest',
|
|
356
|
+
outputs: [
|
|
357
|
+
{ internalType: 'uint256', name: '', type: 'uint256' },
|
|
358
|
+
{ internalType: 'uint256', name: '', type: 'uint256' },
|
|
359
|
+
],
|
|
360
|
+
stateMutability: 'view',
|
|
361
|
+
type: 'function',
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
inputs: [],
|
|
365
|
+
name: 'claimWithdrawRequest',
|
|
366
|
+
outputs: [],
|
|
367
|
+
stateMutability: 'nonpayable',
|
|
368
|
+
type: 'function',
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
inputs: [],
|
|
372
|
+
name: 'readyforAutocompoundRewardsAmount',
|
|
373
|
+
outputs: [{ internalType: 'uint256', name: 'unclaimedReward', type: 'uint256' }],
|
|
374
|
+
stateMutability: 'view',
|
|
375
|
+
type: 'function',
|
|
376
|
+
},
|
|
377
|
+
{
|
|
378
|
+
inputs: [],
|
|
379
|
+
name: 'closeValidatorsStat',
|
|
380
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
381
|
+
stateMutability: 'view',
|
|
382
|
+
type: 'function',
|
|
383
|
+
},
|
|
384
|
+
{
|
|
385
|
+
inputs: [{ internalType: 'uint256', name: 'stakeAmount', type: 'uint256' }],
|
|
386
|
+
name: 'setMinRestakeAmount',
|
|
387
|
+
outputs: [],
|
|
388
|
+
stateMutability: 'nonpayable',
|
|
389
|
+
type: 'function',
|
|
390
|
+
},
|
|
391
|
+
{
|
|
392
|
+
inputs: [{ internalType: 'uint256', name: 'activatedValidatorNum', type: 'uint256' }],
|
|
393
|
+
name: 'activateValidators',
|
|
394
|
+
outputs: [],
|
|
395
|
+
stateMutability: 'nonpayable',
|
|
396
|
+
type: 'function',
|
|
397
|
+
},
|
|
398
|
+
]
|
|
@@ -0,0 +1,306 @@
|
|
|
1
|
+
// ETH staking wallet-sdk:
|
|
2
|
+
// https://github.com/everstake/wallet-sdk/blob/037b081755ece3c9a5be162748cec5ea1125acdf/ethereum.js#L3-L7
|
|
3
|
+
|
|
4
|
+
export default [
|
|
5
|
+
{
|
|
6
|
+
inputs: [{ internalType: 'string', name: 'field', type: 'string' }],
|
|
7
|
+
name: 'InvalidAmount',
|
|
8
|
+
type: 'error',
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
inputs: [{ internalType: 'string', name: 'field', type: 'string' }],
|
|
12
|
+
name: 'InvalidParam',
|
|
13
|
+
type: 'error',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
inputs: [{ internalType: 'string', name: 'field', type: 'string' }],
|
|
17
|
+
name: 'InvalidValue',
|
|
18
|
+
type: 'error',
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
inputs: [{ internalType: 'string', name: 'field', type: 'string' }],
|
|
22
|
+
name: 'Paused',
|
|
23
|
+
type: 'error',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
inputs: [{ internalType: 'string', name: 'field', type: 'string' }],
|
|
27
|
+
name: 'ZeroValue',
|
|
28
|
+
type: 'error',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
anonymous: false,
|
|
32
|
+
inputs: [
|
|
33
|
+
{ indexed: false, internalType: 'address', name: 'oldGovernor', type: 'address' },
|
|
34
|
+
{ indexed: false, internalType: 'address', name: 'newGovernor', type: 'address' },
|
|
35
|
+
],
|
|
36
|
+
name: 'GovernorChanged',
|
|
37
|
+
type: 'event',
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
anonymous: false,
|
|
41
|
+
inputs: [{ indexed: false, internalType: 'uint8', name: 'version', type: 'uint8' }],
|
|
42
|
+
name: 'Initialized',
|
|
43
|
+
type: 'event',
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
anonymous: false,
|
|
47
|
+
inputs: [
|
|
48
|
+
{ indexed: true, internalType: 'address', name: 'previousOwner', type: 'address' },
|
|
49
|
+
{ indexed: true, internalType: 'address', name: 'newOwner', type: 'address' },
|
|
50
|
+
],
|
|
51
|
+
name: 'OwnershipTransferred',
|
|
52
|
+
type: 'event',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
anonymous: false,
|
|
56
|
+
inputs: [{ indexed: false, internalType: 'bool', name: '', type: 'bool' }],
|
|
57
|
+
name: 'PauseStaking',
|
|
58
|
+
type: 'event',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
anonymous: false,
|
|
62
|
+
inputs: [{ indexed: false, internalType: 'bool', name: '', type: 'bool' }],
|
|
63
|
+
name: 'PauseWithdraw',
|
|
64
|
+
type: 'event',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
anonymous: false,
|
|
68
|
+
inputs: [{ indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' }],
|
|
69
|
+
name: 'SetMinStakeAmount',
|
|
70
|
+
type: 'event',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
anonymous: false,
|
|
74
|
+
inputs: [{ indexed: true, internalType: 'address', name: 'superAdmin', type: 'address' }],
|
|
75
|
+
name: 'SetSuperAdmin',
|
|
76
|
+
type: 'event',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
anonymous: false,
|
|
80
|
+
inputs: [
|
|
81
|
+
{ indexed: false, internalType: 'address', name: 'staker', type: 'address' },
|
|
82
|
+
{ indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
83
|
+
{ indexed: false, internalType: 'uint256', name: 'source', type: 'uint256' },
|
|
84
|
+
],
|
|
85
|
+
name: 'StakeAdded',
|
|
86
|
+
type: 'event',
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
anonymous: false,
|
|
90
|
+
inputs: [
|
|
91
|
+
{ indexed: false, internalType: 'address', name: 'staker', type: 'address' },
|
|
92
|
+
{ indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
93
|
+
],
|
|
94
|
+
name: 'StakeCanceled',
|
|
95
|
+
type: 'event',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
anonymous: false,
|
|
99
|
+
inputs: [{ indexed: false, internalType: 'bytes', name: 'validator', type: 'bytes' }],
|
|
100
|
+
name: 'StakeDeposited',
|
|
101
|
+
type: 'event',
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
anonymous: false,
|
|
105
|
+
inputs: [
|
|
106
|
+
{ indexed: false, internalType: 'address', name: 'staker', type: 'address' },
|
|
107
|
+
{ indexed: false, internalType: 'uint256', name: 'value', type: 'uint256' },
|
|
108
|
+
],
|
|
109
|
+
name: 'Unstake',
|
|
110
|
+
type: 'event',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
inputs: [],
|
|
114
|
+
name: 'BEACON_AMOUNT',
|
|
115
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
116
|
+
stateMutability: 'view',
|
|
117
|
+
type: 'function',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
inputs: [],
|
|
121
|
+
name: 'governor',
|
|
122
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
123
|
+
stateMutability: 'view',
|
|
124
|
+
type: 'function',
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
inputs: [],
|
|
128
|
+
name: 'owner',
|
|
129
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
130
|
+
stateMutability: 'view',
|
|
131
|
+
type: 'function',
|
|
132
|
+
},
|
|
133
|
+
{
|
|
134
|
+
inputs: [],
|
|
135
|
+
name: 'renounceOwnership',
|
|
136
|
+
outputs: [],
|
|
137
|
+
stateMutability: 'nonpayable',
|
|
138
|
+
type: 'function',
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
inputs: [{ internalType: 'address', name: 'value', type: 'address' }],
|
|
142
|
+
name: 'setSuperAdmin',
|
|
143
|
+
outputs: [],
|
|
144
|
+
stateMutability: 'nonpayable',
|
|
145
|
+
type: 'function',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
inputs: [],
|
|
149
|
+
name: 'superAdmin',
|
|
150
|
+
outputs: [{ internalType: 'address', name: '', type: 'address' }],
|
|
151
|
+
stateMutability: 'view',
|
|
152
|
+
type: 'function',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
inputs: [{ internalType: 'address', name: 'newOwner', type: 'address' }],
|
|
156
|
+
name: 'transferOwnership',
|
|
157
|
+
outputs: [],
|
|
158
|
+
stateMutability: 'nonpayable',
|
|
159
|
+
type: 'function',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
inputs: [
|
|
163
|
+
{ internalType: 'address', name: 'depositContract', type: 'address' },
|
|
164
|
+
{ internalType: 'address', name: 'accountingContract', type: 'address' },
|
|
165
|
+
{ internalType: 'address', name: 'withdrawTreasury', type: 'address' },
|
|
166
|
+
{ internalType: 'address', name: 'rewardsTreasury', type: 'address' },
|
|
167
|
+
{ internalType: 'address', name: 'poolGovernor', type: 'address' },
|
|
168
|
+
],
|
|
169
|
+
name: 'initialize',
|
|
170
|
+
outputs: [],
|
|
171
|
+
stateMutability: 'nonpayable',
|
|
172
|
+
type: 'function',
|
|
173
|
+
},
|
|
174
|
+
{
|
|
175
|
+
inputs: [{ internalType: 'uint64', name: 'source', type: 'uint64' }],
|
|
176
|
+
name: 'stake',
|
|
177
|
+
outputs: [],
|
|
178
|
+
stateMutability: 'payable',
|
|
179
|
+
type: 'function',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
inputs: [{ internalType: 'uint256', name: 'amount', type: 'uint256' }],
|
|
183
|
+
name: 'unstakePending',
|
|
184
|
+
outputs: [],
|
|
185
|
+
stateMutability: 'nonpayable',
|
|
186
|
+
type: 'function',
|
|
187
|
+
},
|
|
188
|
+
{
|
|
189
|
+
inputs: [{ internalType: 'uint256', name: 'value', type: 'uint256' }],
|
|
190
|
+
name: 'unstake',
|
|
191
|
+
outputs: [],
|
|
192
|
+
stateMutability: 'nonpayable',
|
|
193
|
+
type: 'function',
|
|
194
|
+
},
|
|
195
|
+
{ inputs: [], name: 'restake', outputs: [], stateMutability: 'payable', type: 'function' },
|
|
196
|
+
{
|
|
197
|
+
inputs: [
|
|
198
|
+
{
|
|
199
|
+
components: [
|
|
200
|
+
{ internalType: 'bytes', name: 'pubkey', type: 'bytes' },
|
|
201
|
+
{ internalType: 'bytes', name: 'signature', type: 'bytes' },
|
|
202
|
+
{ internalType: 'bytes32', name: 'deposit_data_root', type: 'bytes32' },
|
|
203
|
+
],
|
|
204
|
+
internalType: 'struct ValidatorList.DepositData[]',
|
|
205
|
+
name: 'pendingValidators',
|
|
206
|
+
type: 'tuple[]',
|
|
207
|
+
},
|
|
208
|
+
],
|
|
209
|
+
name: 'setPendingValidators',
|
|
210
|
+
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
|
|
211
|
+
stateMutability: 'nonpayable',
|
|
212
|
+
type: 'function',
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
inputs: [],
|
|
216
|
+
name: 'getPendingValidatorCount',
|
|
217
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
218
|
+
stateMutability: 'view',
|
|
219
|
+
type: 'function',
|
|
220
|
+
},
|
|
221
|
+
{
|
|
222
|
+
inputs: [{ internalType: 'uint256', name: 'index', type: 'uint256' }],
|
|
223
|
+
name: 'getPendingValidator',
|
|
224
|
+
outputs: [{ internalType: 'bytes', name: '', type: 'bytes' }],
|
|
225
|
+
stateMutability: 'view',
|
|
226
|
+
type: 'function',
|
|
227
|
+
},
|
|
228
|
+
{
|
|
229
|
+
inputs: [],
|
|
230
|
+
name: 'getValidatorCount',
|
|
231
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
232
|
+
stateMutability: 'view',
|
|
233
|
+
type: 'function',
|
|
234
|
+
},
|
|
235
|
+
{
|
|
236
|
+
inputs: [{ internalType: 'uint256', name: 'index', type: 'uint256' }],
|
|
237
|
+
name: 'getValidator',
|
|
238
|
+
outputs: [
|
|
239
|
+
{ internalType: 'bytes', name: '', type: 'bytes' },
|
|
240
|
+
{ internalType: 'enum ValidatorList.ValidatorStatus', name: '', type: 'uint8' },
|
|
241
|
+
],
|
|
242
|
+
stateMutability: 'view',
|
|
243
|
+
type: 'function',
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
inputs: [
|
|
247
|
+
{ internalType: 'uint256', name: 'index', type: 'uint256' },
|
|
248
|
+
{
|
|
249
|
+
components: [
|
|
250
|
+
{ internalType: 'bytes', name: 'pubkey', type: 'bytes' },
|
|
251
|
+
{ internalType: 'bytes', name: 'signature', type: 'bytes' },
|
|
252
|
+
{ internalType: 'bytes32', name: 'deposit_data_root', type: 'bytes32' },
|
|
253
|
+
],
|
|
254
|
+
internalType: 'struct ValidatorList.DepositData',
|
|
255
|
+
name: 'pendingValidator',
|
|
256
|
+
type: 'tuple',
|
|
257
|
+
},
|
|
258
|
+
],
|
|
259
|
+
name: 'replacePendingValidator',
|
|
260
|
+
outputs: [{ internalType: 'bool', name: '', type: 'bool' }],
|
|
261
|
+
stateMutability: 'nonpayable',
|
|
262
|
+
type: 'function',
|
|
263
|
+
},
|
|
264
|
+
{
|
|
265
|
+
inputs: [{ internalType: 'uint256', name: 'num', type: 'uint256' }],
|
|
266
|
+
name: 'markValidatorsAsExited',
|
|
267
|
+
outputs: [],
|
|
268
|
+
stateMutability: 'nonpayable',
|
|
269
|
+
type: 'function',
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
inputs: [{ internalType: 'bool', name: 'pause', type: 'bool' }],
|
|
273
|
+
name: 'pauseStaking',
|
|
274
|
+
outputs: [],
|
|
275
|
+
stateMutability: 'nonpayable',
|
|
276
|
+
type: 'function',
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
inputs: [{ internalType: 'bool', name: 'pause', type: 'bool' }],
|
|
280
|
+
name: 'pauseWithdraw',
|
|
281
|
+
outputs: [],
|
|
282
|
+
stateMutability: 'nonpayable',
|
|
283
|
+
type: 'function',
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
inputs: [{ internalType: 'address', name: 'newGovernor', type: 'address' }],
|
|
287
|
+
name: 'setGovernor',
|
|
288
|
+
outputs: [],
|
|
289
|
+
stateMutability: 'nonpayable',
|
|
290
|
+
type: 'function',
|
|
291
|
+
},
|
|
292
|
+
{
|
|
293
|
+
inputs: [],
|
|
294
|
+
name: 'minStakeAmount',
|
|
295
|
+
outputs: [{ internalType: 'uint256', name: '', type: 'uint256' }],
|
|
296
|
+
stateMutability: 'view',
|
|
297
|
+
type: 'function',
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
inputs: [{ internalType: 'uint256', name: 'stakeAmount', type: 'uint256' }],
|
|
301
|
+
name: 'setMinStakeAmount',
|
|
302
|
+
outputs: [],
|
|
303
|
+
stateMutability: 'nonpayable',
|
|
304
|
+
type: 'function',
|
|
305
|
+
},
|
|
306
|
+
]
|
package/src/abi/index.js
CHANGED
|
@@ -4,6 +4,8 @@ import dai from './dai'
|
|
|
4
4
|
import erc20 from './ierc20-extended'
|
|
5
5
|
import erc20BytesParams from './ierc20-bytes-params'
|
|
6
6
|
import erc721 from './erc721'
|
|
7
|
+
import ethStakingAccounting from './eth-staking-accounting'
|
|
8
|
+
import ethStakingPool from './eth-staking-pool'
|
|
7
9
|
import gnt from './gnt'
|
|
8
10
|
import kyberv2 from './kyberv2.js'
|
|
9
11
|
import loomv2Swap from './loomv2-swap'
|
|
@@ -24,6 +26,8 @@ export default {
|
|
|
24
26
|
erc20,
|
|
25
27
|
erc20BytesParams,
|
|
26
28
|
erc721,
|
|
29
|
+
ethStakingAccounting,
|
|
30
|
+
ethStakingPool,
|
|
27
31
|
gnt,
|
|
28
32
|
kyberv2,
|
|
29
33
|
loomv2Swap,
|
|
@@ -1,12 +1,21 @@
|
|
|
1
1
|
import { AccountState } from '@exodus/models'
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
import { parseLegacyBalances } from './parse-legacy-balances'
|
|
4
|
+
|
|
5
|
+
// `assets` are only needed for chains that may need legacy parsing support
|
|
6
|
+
export default function createEthereumLikeAccountState(asset, assets = {}) {
|
|
4
7
|
return class EthereumLikeAccountState extends AccountState {
|
|
5
8
|
static defaults = {
|
|
6
|
-
|
|
9
|
+
startblock: 0,
|
|
7
10
|
clarityCursor: '',
|
|
8
11
|
balance: asset.currency.ZERO,
|
|
9
12
|
tokenBalances: {},
|
|
10
13
|
}
|
|
14
|
+
|
|
15
|
+
// legacy -- this should have no effect on Ethereum-like assets that do not have legacy account state
|
|
16
|
+
static _tokens = Object.values(assets)
|
|
17
|
+
static _postParse(data) {
|
|
18
|
+
return { ...data, tokenBalances: parseLegacyBalances(data.tokenBalances, assets) }
|
|
19
|
+
}
|
|
11
20
|
}
|
|
12
21
|
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { isNumberUnit } from '@exodus/currency'
|
|
2
|
+
import { isNumber, isString } from 'lodash'
|
|
3
|
+
|
|
4
|
+
function parseBalance({ asset, balance }) {
|
|
5
|
+
const currency = asset.currency
|
|
6
|
+
if (isNumberUnit(balance)) {
|
|
7
|
+
if (balance.unitType.equals(currency)) {
|
|
8
|
+
return balance
|
|
9
|
+
} else {
|
|
10
|
+
throw new Error(
|
|
11
|
+
`Balance '${balance.toDefaultString()}' is not of currency ${currency.toString()}`
|
|
12
|
+
)
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
if (isString(balance)) {
|
|
16
|
+
return currency.parse(balance)
|
|
17
|
+
}
|
|
18
|
+
if (isNumber(balance)) {
|
|
19
|
+
return currency.defaultUnit(balance)
|
|
20
|
+
}
|
|
21
|
+
throw new Error(`Cannot parse balance '${balance}' of currency ${currency}`)
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const parseLegacyBalances = (tokenBalances, assets) =>
|
|
25
|
+
Object.fromEntries(
|
|
26
|
+
Object.entries(tokenBalances || {})
|
|
27
|
+
.filter(([assetName]) => assets[assetName])
|
|
28
|
+
.map(([assetName, balance]) => [
|
|
29
|
+
assetName,
|
|
30
|
+
parseBalance({ asset: assets[assetName], balance }),
|
|
31
|
+
])
|
|
32
|
+
)
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { get } from 'lodash'
|
|
2
|
+
|
|
3
|
+
export const getEthereumBalances = ({ asset, liquidBalance, accountState }) => {
|
|
4
|
+
// asset = ethereum or ethereumgoerli
|
|
5
|
+
const delegatedBalance = get(
|
|
6
|
+
accountState,
|
|
7
|
+
['staking', asset.name, 'delegatedBalance'],
|
|
8
|
+
asset.currency.ZERO
|
|
9
|
+
)
|
|
10
|
+
const undelegatedBalance = get(
|
|
11
|
+
accountState,
|
|
12
|
+
['staking', asset.name, 'unclaimedUndelegatedBalance'],
|
|
13
|
+
asset.currency.ZERO
|
|
14
|
+
)
|
|
15
|
+
const totalBalance = liquidBalance.add(delegatedBalance).add(undelegatedBalance)
|
|
16
|
+
return {
|
|
17
|
+
balance: totalBalance,
|
|
18
|
+
liquidBalance,
|
|
19
|
+
}
|
|
20
|
+
}
|
package/src/balances/index.js
CHANGED
|
@@ -1,9 +1,20 @@
|
|
|
1
1
|
import { get } from 'lodash'
|
|
2
|
+
import assets from '@exodus/ethereum-meta'
|
|
3
|
+
|
|
4
|
+
const polygon = assets.find(({ name: tokenName }) => tokenName === 'polygon')
|
|
2
5
|
|
|
3
6
|
export const getPolygonBalances = ({ liquidBalance, accountState }) => {
|
|
4
|
-
const delegatedBalance = get(
|
|
5
|
-
|
|
6
|
-
|
|
7
|
+
const delegatedBalance = get(
|
|
8
|
+
accountState,
|
|
9
|
+
'staking.polygon.delegatedBalance',
|
|
10
|
+
polygon.currency.ZERO
|
|
11
|
+
)
|
|
12
|
+
const undelegatedBalance = get(
|
|
13
|
+
accountState,
|
|
14
|
+
'staking.polygon.unclaimedUndelegatedBalance',
|
|
15
|
+
polygon.currency.ZERO
|
|
16
|
+
)
|
|
17
|
+
const totalBalance = liquidBalance.add(delegatedBalance).add(undelegatedBalance)
|
|
7
18
|
return {
|
|
8
19
|
balance: totalBalance,
|
|
9
20
|
liquidBalance,
|
package/src/constants.js
CHANGED
|
@@ -100,9 +100,9 @@ const CHAIN_DATA = {
|
|
|
100
100
|
},
|
|
101
101
|
cronos: {
|
|
102
102
|
chainId: 25,
|
|
103
|
-
serverUrl: 'https://cronos
|
|
103
|
+
serverUrl: 'https://cronos.a.exodus.io',
|
|
104
104
|
confirmationsNumber: 6,
|
|
105
|
-
monitorType: '
|
|
105
|
+
monitorType: 'no-history',
|
|
106
106
|
tokenType: 'CRC20',
|
|
107
107
|
},
|
|
108
108
|
}
|
|
@@ -24,6 +24,10 @@ export default function createContract(address, contractName) {
|
|
|
24
24
|
return new SolidityContract(ABI.maticStakingManager, address, true)
|
|
25
25
|
case 'polygon':
|
|
26
26
|
return new SolidityContract(ABI.matic, address, true)
|
|
27
|
+
case 'ethStakingAccounting':
|
|
28
|
+
return new SolidityContract(ABI.ethStakingAccounting, address, true)
|
|
29
|
+
case 'ethStakingPool':
|
|
30
|
+
return new SolidityContract(ABI.ethStakingPool, address, true)
|
|
27
31
|
case 'fantomSfc':
|
|
28
32
|
return new SolidityContract(ABI.fantomSfc, address, true)
|
|
29
33
|
case 'ensResolver':
|
package/src/fee-data/cronos.js
CHANGED
|
@@ -3,10 +3,10 @@ import { asset } from '@exodus/cronos-meta'
|
|
|
3
3
|
|
|
4
4
|
export default new FeeData({
|
|
5
5
|
config: {
|
|
6
|
-
gasPrice: '
|
|
7
|
-
max: '
|
|
8
|
-
min: '
|
|
9
|
-
fuelThreshold: '
|
|
6
|
+
gasPrice: '5100 Gwei',
|
|
7
|
+
max: '5700 Gwei',
|
|
8
|
+
min: '4700 Gwei',
|
|
9
|
+
fuelThreshold: '4800 Gwei',
|
|
10
10
|
gasPriceEconomicalRate: 0.8,
|
|
11
11
|
gasPriceMinimumRate: 0.6,
|
|
12
12
|
enableFeeDelegation: false,
|
|
@@ -85,8 +85,8 @@ const calculateTxGasPrice = (tx) => tx.feeAmount.div(tx.data.gasLimit)
|
|
|
85
85
|
|
|
86
86
|
export const calculateBumpedGasPrice = ({ baseAsset, tx, currentGasPrice, eip1559Enabled }) => {
|
|
87
87
|
const usedGasPrice = calculateTxGasPrice(tx)
|
|
88
|
-
|
|
89
|
-
bumpedGasPrice =
|
|
88
|
+
const gasPrice = currentGasPrice.gt(usedGasPrice) ? currentGasPrice : usedGasPrice
|
|
89
|
+
const bumpedGasPrice = gasPrice.mul(BUMP_RATE)
|
|
90
90
|
|
|
91
91
|
return eip1559Enabled && tx.data?.tipGasPrice
|
|
92
92
|
? {
|