@exodus/ethereum-api 6.2.25 → 6.2.27
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@exodus/ethereum-api",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.27",
|
|
4
4
|
"description": "Ethereum Api",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"files": [
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@exodus/asset-lib": "^3.7.1",
|
|
18
18
|
"@exodus/crypto": "^1.0.0-rc.0",
|
|
19
|
-
"@exodus/ethereum-lib": "^3.3.
|
|
19
|
+
"@exodus/ethereum-lib": "^3.3.17",
|
|
20
20
|
"@exodus/ethereumjs-util": "^7.1.0-exodus.6",
|
|
21
21
|
"@exodus/fetch": "^1.2.1",
|
|
22
22
|
"@exodus/simple-retry": "^0.0.6",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@exodus/models": "^8.10.4"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "4da8ee1935146f4c7a1936ba206eceba80273449"
|
|
39
39
|
}
|
package/src/staking/index.js
CHANGED
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { MaticStaking } from './matic-staking'
|
|
2
|
+
|
|
3
|
+
// function selector for buyVoucher(uint256 _amount, uint256 _minSharesToMint)
|
|
4
|
+
const DELEGATE = '0x6ab15071'
|
|
5
|
+
// function selector for sellVoucher_new(uint256 claimAmount, uint256 maximumSharesToBurn)
|
|
6
|
+
const UNDELEGATE = '0xc83ec04d'
|
|
7
|
+
// function selector for withdrawRewards()
|
|
8
|
+
const CLAIM_REWARD = '0xc7b8981c'
|
|
9
|
+
// function selector for unstakeClaimTokens_new(uint256 unbondNonce)
|
|
10
|
+
const CLAIM_UNDELEGATE_BALANCE = '0xe97fddc2'
|
|
11
|
+
|
|
12
|
+
const STAKING_MANAGER_CONTRACT = new MaticStaking().stakingManagerContract.address
|
|
13
|
+
|
|
14
|
+
export const isPolygonTx = ({ coinName }) => coinName === 'polygon'
|
|
15
|
+
export const isPolygonDelegate = (tx) =>
|
|
16
|
+
isPolygonTx(tx) && tx.to === STAKING_MANAGER_CONTRACT && tx.data && tx.data.methodId === DELEGATE
|
|
17
|
+
export const isPolygonUndelegate = (tx) =>
|
|
18
|
+
isPolygonTx(tx) &&
|
|
19
|
+
tx.from[0] === STAKING_MANAGER_CONTRACT &&
|
|
20
|
+
tx.data &&
|
|
21
|
+
tx.data.methodId === UNDELEGATE
|
|
22
|
+
export const isPolygonReward = (tx) =>
|
|
23
|
+
isPolygonTx(tx) &&
|
|
24
|
+
tx.from[0] === STAKING_MANAGER_CONTRACT &&
|
|
25
|
+
tx.data &&
|
|
26
|
+
tx.data.methodId === CLAIM_REWARD
|
|
27
|
+
export const isPolygonClaimUndelegate = (tx) =>
|
|
28
|
+
isPolygonTx(tx) &&
|
|
29
|
+
tx.from[0] === STAKING_MANAGER_CONTRACT &&
|
|
30
|
+
tx.data &&
|
|
31
|
+
tx.data.methodId === CLAIM_UNDELEGATE_BALANCE
|
|
@@ -106,13 +106,16 @@ export default function getLogItemsFromServerTx({
|
|
|
106
106
|
receivingTransferPresent,
|
|
107
107
|
})
|
|
108
108
|
|
|
109
|
+
const METHOD_ID_LENGTH = 10
|
|
110
|
+
const methodId = serverTx.data && { methodId: serverTx.data.substring(0, METHOD_ID_LENGTH) }
|
|
111
|
+
|
|
109
112
|
logItemsForServerTxEntries.push([
|
|
110
113
|
tokenName,
|
|
111
114
|
{
|
|
112
115
|
...logItemCommonProperties,
|
|
113
116
|
coinAmount,
|
|
114
117
|
coinName: tokenName,
|
|
115
|
-
data: { nonce, gasLimit },
|
|
118
|
+
data: { nonce, gasLimit, ...methodId },
|
|
116
119
|
...(isConsideredSent
|
|
117
120
|
? { from: [], to: tokenTransferToAddress, feeAmount, feeCoinName: asset.feeAsset.name }
|
|
118
121
|
: { from: tokenFromAddresses }),
|