@shapeshiftoss/unchained-client 9.8.2 → 9.8.3
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/dist/cosmos/parser/index.js +6 -6
- package/dist/cosmos/parser/utils.js +9 -9
- package/dist/evm/ethereum/parser/abi/foxyStaking.js +161 -161
- package/dist/evm/ethereum/parser/abi/shapeShiftRouter.js +119 -119
- package/dist/evm/ethereum/parser/abi/thor.js +28 -28
- package/dist/evm/ethereum/parser/abi/uniV2.js +55 -55
- package/dist/evm/ethereum/parser/abi/uniV2StakingRewards.js +95 -95
- package/dist/evm/ethereum/parser/abi/weth.js +66 -66
- package/dist/evm/ethereum/parser/abi/yearnVault.js +95 -95
- package/dist/evm/ethereum/parser/cowswap.js +3 -3
- package/dist/evm/ethereum/parser/foxy.js +3 -3
- package/dist/evm/ethereum/parser/index.js +1 -1
- package/dist/evm/ethereum/parser/thor.js +2 -2
- package/dist/evm/ethereum/parser/uniV2.js +12 -12
- package/dist/evm/ethereum/parser/weth.js +9 -9
- package/dist/evm/ethereum/parser/yearn.js +4 -4
- package/dist/evm/parser/abi/erc20.js +69 -69
- package/dist/evm/parser/erc20.js +4 -4
- package/dist/evm/parser/index.js +4 -4
- package/dist/evm/parser/zrx.js +3 -3
- package/dist/utils.js +2 -2
- package/dist/utxo/parser/index.js +1 -1
- package/dist/websocket.js +4 -4
- package/package.json +1 -1
|
@@ -13,12 +13,12 @@ class Parser {
|
|
|
13
13
|
return {
|
|
14
14
|
trade: {
|
|
15
15
|
dexName: types_1.Dex.CowSwap,
|
|
16
|
-
type: types_1.TradeType.Trade
|
|
16
|
+
type: types_1.TradeType.Trade,
|
|
17
17
|
},
|
|
18
18
|
data: {
|
|
19
19
|
method: undefined,
|
|
20
|
-
parser: 'cowswap'
|
|
21
|
-
}
|
|
20
|
+
parser: 'cowswap',
|
|
21
|
+
},
|
|
22
22
|
};
|
|
23
23
|
}
|
|
24
24
|
}
|
|
@@ -15,7 +15,7 @@ class Parser {
|
|
|
15
15
|
stakeSigHash: this.abiInterface.getSighash('stake(uint256,address)'),
|
|
16
16
|
unstakeSigHash: this.abiInterface.getSighash('unstake'),
|
|
17
17
|
instantUnstakeSigHash: this.abiInterface.getSighash('instantUnstake'),
|
|
18
|
-
claimWithdrawSigHash: this.abiInterface.getSighash('claimWithdraw')
|
|
18
|
+
claimWithdrawSigHash: this.abiInterface.getSighash('claimWithdraw'),
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
21
|
async parse(tx) {
|
|
@@ -33,8 +33,8 @@ class Parser {
|
|
|
33
33
|
return {
|
|
34
34
|
data: {
|
|
35
35
|
method: decoded.name,
|
|
36
|
-
parser: 'foxy'
|
|
37
|
-
}
|
|
36
|
+
parser: 'foxy',
|
|
37
|
+
},
|
|
38
38
|
};
|
|
39
39
|
}
|
|
40
40
|
}
|
|
@@ -46,7 +46,7 @@ class TransactionParser extends parser_1.BaseTransactionParser {
|
|
|
46
46
|
new uniV2.Parser({ chainId: this.chainId, provider: this.provider }),
|
|
47
47
|
new thor.Parser({ chainId: this.chainId, rpcUrl: args.rpcUrl }),
|
|
48
48
|
new zrx.Parser(),
|
|
49
|
-
new cowswap.Parser()
|
|
49
|
+
new cowswap.Parser(),
|
|
50
50
|
]);
|
|
51
51
|
}
|
|
52
52
|
}
|
|
@@ -15,7 +15,7 @@ class Parser {
|
|
|
15
15
|
this.abiInterface = new ethers_1.ethers.utils.Interface(thor_1.default);
|
|
16
16
|
this.supportedFunctions = {
|
|
17
17
|
depositSigHash: this.abiInterface.getSighash('deposit'),
|
|
18
|
-
transferOutSigHash: this.abiInterface.getSighash('transferOut')
|
|
18
|
+
transferOutSigHash: this.abiInterface.getSighash('transferOut'),
|
|
19
19
|
};
|
|
20
20
|
// TODO: Router contract can change, use /inbound_addresses endpoint to determine current router contract.
|
|
21
21
|
// We will also need to know all past router contract addresses if we intend on using receive address as the means for detection
|
|
@@ -44,7 +44,7 @@ class Parser {
|
|
|
44
44
|
return;
|
|
45
45
|
const data = {
|
|
46
46
|
method: decoded.name,
|
|
47
|
-
parser: 'thor'
|
|
47
|
+
parser: 'thor',
|
|
48
48
|
};
|
|
49
49
|
const [type] = decoded.args.memo.split(':');
|
|
50
50
|
if (SWAP_TYPES.includes(type) || type === 'OUT') {
|
|
@@ -18,11 +18,11 @@ class Parser {
|
|
|
18
18
|
this.stakingRewardsInterface = new ethers_1.ethers.utils.Interface(uniV2StakingRewards_1.default);
|
|
19
19
|
this.supportedFunctions = {
|
|
20
20
|
addLiquidityEthSigHash: this.abiInterface.getSighash('addLiquidityETH'),
|
|
21
|
-
removeLiquidityEthSigHash: this.abiInterface.getSighash('removeLiquidityETH')
|
|
21
|
+
removeLiquidityEthSigHash: this.abiInterface.getSighash('removeLiquidityETH'),
|
|
22
22
|
};
|
|
23
23
|
this.supportedStakingRewardsFunctions = {
|
|
24
24
|
stakeSigHash: this.stakingRewardsInterface.getSighash('stake'),
|
|
25
|
-
exitSigHash: this.stakingRewardsInterface.getSighash('exit')
|
|
25
|
+
exitSigHash: this.stakingRewardsInterface.getSighash('exit'),
|
|
26
26
|
};
|
|
27
27
|
this.chainId = args.chainId;
|
|
28
28
|
this.provider = args.provider;
|
|
@@ -62,7 +62,7 @@ class Parser {
|
|
|
62
62
|
const assetId = (0, caip_1.toAssetId)({
|
|
63
63
|
...(0, caip_1.fromChainId)(this.chainId),
|
|
64
64
|
assetNamespace: 'erc20',
|
|
65
|
-
assetReference: tokenAddress
|
|
65
|
+
assetReference: tokenAddress,
|
|
66
66
|
});
|
|
67
67
|
return [
|
|
68
68
|
{
|
|
@@ -72,8 +72,8 @@ class Parser {
|
|
|
72
72
|
assetId,
|
|
73
73
|
totalValue: value,
|
|
74
74
|
components: [{ value }],
|
|
75
|
-
token: { contract: tokenAddress, decimals, name, symbol }
|
|
76
|
-
}
|
|
75
|
+
token: { contract: tokenAddress, decimals, name, symbol },
|
|
76
|
+
},
|
|
77
77
|
];
|
|
78
78
|
}
|
|
79
79
|
case this.supportedFunctions.removeLiquidityEthSigHash: {
|
|
@@ -85,7 +85,7 @@ class Parser {
|
|
|
85
85
|
const assetId = (0, caip_1.toAssetId)({
|
|
86
86
|
...(0, caip_1.fromChainId)(this.chainId),
|
|
87
87
|
assetNamespace: 'erc20',
|
|
88
|
-
assetReference: lpTokenAddress
|
|
88
|
+
assetReference: lpTokenAddress,
|
|
89
89
|
});
|
|
90
90
|
return [
|
|
91
91
|
{
|
|
@@ -95,8 +95,8 @@ class Parser {
|
|
|
95
95
|
assetId,
|
|
96
96
|
totalValue: value,
|
|
97
97
|
components: [{ value }],
|
|
98
|
-
token: { contract: lpTokenAddress, decimals, name, symbol }
|
|
99
|
-
}
|
|
98
|
+
token: { contract: lpTokenAddress, decimals, name, symbol },
|
|
99
|
+
},
|
|
100
100
|
];
|
|
101
101
|
}
|
|
102
102
|
default:
|
|
@@ -110,8 +110,8 @@ class Parser {
|
|
|
110
110
|
transfers,
|
|
111
111
|
data: {
|
|
112
112
|
parser: 'uniV2',
|
|
113
|
-
method: decoded.name
|
|
114
|
-
}
|
|
113
|
+
method: decoded.name,
|
|
114
|
+
},
|
|
115
115
|
};
|
|
116
116
|
}
|
|
117
117
|
async parseStakingRewards(tx) {
|
|
@@ -127,8 +127,8 @@ class Parser {
|
|
|
127
127
|
return {
|
|
128
128
|
data: {
|
|
129
129
|
parser: 'uniV2',
|
|
130
|
-
method: decoded.name
|
|
131
|
-
}
|
|
130
|
+
method: decoded.name,
|
|
131
|
+
},
|
|
132
132
|
};
|
|
133
133
|
}
|
|
134
134
|
async parse(tx) {
|
|
@@ -15,7 +15,7 @@ class Parser {
|
|
|
15
15
|
this.abiInterface = new ethers_1.ethers.utils.Interface(weth_1.default);
|
|
16
16
|
this.supportedFunctions = {
|
|
17
17
|
depositSigHash: this.abiInterface.getSighash('deposit'),
|
|
18
|
-
withdrawalSigHash: this.abiInterface.getSighash('withdraw')
|
|
18
|
+
withdrawalSigHash: this.abiInterface.getSighash('withdraw'),
|
|
19
19
|
};
|
|
20
20
|
this.chainId = args.chainId;
|
|
21
21
|
this.provider = args.provider;
|
|
@@ -45,13 +45,13 @@ class Parser {
|
|
|
45
45
|
const assetId = (0, caip_1.toAssetId)({
|
|
46
46
|
...(0, caip_1.fromChainId)(this.chainId),
|
|
47
47
|
assetNamespace: 'erc20',
|
|
48
|
-
assetReference: this.wethContract
|
|
48
|
+
assetReference: this.wethContract,
|
|
49
49
|
});
|
|
50
50
|
const token = {
|
|
51
51
|
contract: this.wethContract,
|
|
52
52
|
decimals: 18,
|
|
53
53
|
name: 'Wrapped Ether',
|
|
54
|
-
symbol: 'WETH'
|
|
54
|
+
symbol: 'WETH',
|
|
55
55
|
};
|
|
56
56
|
const transfers = (() => {
|
|
57
57
|
switch (txSigHash) {
|
|
@@ -64,8 +64,8 @@ class Parser {
|
|
|
64
64
|
assetId,
|
|
65
65
|
totalValue: tx.value,
|
|
66
66
|
components: [{ value: tx.value }],
|
|
67
|
-
token
|
|
68
|
-
}
|
|
67
|
+
token,
|
|
68
|
+
},
|
|
69
69
|
];
|
|
70
70
|
}
|
|
71
71
|
case this.supportedFunctions.withdrawalSigHash:
|
|
@@ -77,8 +77,8 @@ class Parser {
|
|
|
77
77
|
assetId,
|
|
78
78
|
totalValue: decoded.args.wad.toString(),
|
|
79
79
|
components: [{ value: decoded.args.wad.toString() }],
|
|
80
|
-
token
|
|
81
|
-
}
|
|
80
|
+
token,
|
|
81
|
+
},
|
|
82
82
|
];
|
|
83
83
|
default:
|
|
84
84
|
return;
|
|
@@ -91,8 +91,8 @@ class Parser {
|
|
|
91
91
|
transfers,
|
|
92
92
|
data: {
|
|
93
93
|
parser: 'weth',
|
|
94
|
-
method: decoded.name
|
|
95
|
-
}
|
|
94
|
+
method: decoded.name,
|
|
95
|
+
},
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
}
|
|
@@ -19,10 +19,10 @@ class Parser {
|
|
|
19
19
|
depositSigHash: this.yearnInterface.getSighash('deposit()'),
|
|
20
20
|
depositAmountSigHash: this.yearnInterface.getSighash('deposit(uint256)'),
|
|
21
21
|
depositAmountAndRecipientSigHash: this.yearnInterface.getSighash('deposit(uint256,address)'),
|
|
22
|
-
withdrawSigHash: this.yearnInterface.getSighash('withdraw(uint256,address)')
|
|
22
|
+
withdrawSigHash: this.yearnInterface.getSighash('withdraw(uint256,address)'),
|
|
23
23
|
};
|
|
24
24
|
this.supportedShapeShiftFunctions = {
|
|
25
|
-
depositSigHash: this.shapeShiftInterface.getSighash('deposit(address,address,uint256,uint256)')
|
|
25
|
+
depositSigHash: this.shapeShiftInterface.getSighash('deposit(address,address,uint256,uint256)'),
|
|
26
26
|
};
|
|
27
27
|
this.provider = args.provider;
|
|
28
28
|
// The only Yearn-supported chain we currently support is mainnet
|
|
@@ -69,8 +69,8 @@ class Parser {
|
|
|
69
69
|
return {
|
|
70
70
|
data: {
|
|
71
71
|
method: decoded.name,
|
|
72
|
-
parser: 'yearn'
|
|
73
|
-
}
|
|
72
|
+
parser: 'yearn',
|
|
73
|
+
},
|
|
74
74
|
};
|
|
75
75
|
}
|
|
76
76
|
getAbiInterface(txSigHash) {
|
|
@@ -6,16 +6,16 @@ const erc20 = [
|
|
|
6
6
|
{
|
|
7
7
|
internalType: 'string',
|
|
8
8
|
name: 'name_',
|
|
9
|
-
type: 'string'
|
|
9
|
+
type: 'string',
|
|
10
10
|
},
|
|
11
11
|
{
|
|
12
12
|
internalType: 'string',
|
|
13
13
|
name: 'symbol_',
|
|
14
|
-
type: 'string'
|
|
15
|
-
}
|
|
14
|
+
type: 'string',
|
|
15
|
+
},
|
|
16
16
|
],
|
|
17
17
|
stateMutability: 'nonpayable',
|
|
18
|
-
type: 'constructor'
|
|
18
|
+
type: 'constructor',
|
|
19
19
|
},
|
|
20
20
|
{
|
|
21
21
|
anonymous: false,
|
|
@@ -24,23 +24,23 @@ const erc20 = [
|
|
|
24
24
|
indexed: true,
|
|
25
25
|
internalType: 'address',
|
|
26
26
|
name: 'owner',
|
|
27
|
-
type: 'address'
|
|
27
|
+
type: 'address',
|
|
28
28
|
},
|
|
29
29
|
{
|
|
30
30
|
indexed: true,
|
|
31
31
|
internalType: 'address',
|
|
32
32
|
name: 'spender',
|
|
33
|
-
type: 'address'
|
|
33
|
+
type: 'address',
|
|
34
34
|
},
|
|
35
35
|
{
|
|
36
36
|
indexed: false,
|
|
37
37
|
internalType: 'uint256',
|
|
38
38
|
name: 'value',
|
|
39
|
-
type: 'uint256'
|
|
40
|
-
}
|
|
39
|
+
type: 'uint256',
|
|
40
|
+
},
|
|
41
41
|
],
|
|
42
42
|
name: 'Approval',
|
|
43
|
-
type: 'event'
|
|
43
|
+
type: 'event',
|
|
44
44
|
},
|
|
45
45
|
{
|
|
46
46
|
anonymous: false,
|
|
@@ -49,90 +49,90 @@ const erc20 = [
|
|
|
49
49
|
indexed: true,
|
|
50
50
|
internalType: 'address',
|
|
51
51
|
name: 'from',
|
|
52
|
-
type: 'address'
|
|
52
|
+
type: 'address',
|
|
53
53
|
},
|
|
54
54
|
{
|
|
55
55
|
indexed: true,
|
|
56
56
|
internalType: 'address',
|
|
57
57
|
name: 'to',
|
|
58
|
-
type: 'address'
|
|
58
|
+
type: 'address',
|
|
59
59
|
},
|
|
60
60
|
{
|
|
61
61
|
indexed: false,
|
|
62
62
|
internalType: 'uint256',
|
|
63
63
|
name: 'value',
|
|
64
|
-
type: 'uint256'
|
|
65
|
-
}
|
|
64
|
+
type: 'uint256',
|
|
65
|
+
},
|
|
66
66
|
],
|
|
67
67
|
name: 'Transfer',
|
|
68
|
-
type: 'event'
|
|
68
|
+
type: 'event',
|
|
69
69
|
},
|
|
70
70
|
{
|
|
71
71
|
inputs: [
|
|
72
72
|
{
|
|
73
73
|
internalType: 'address',
|
|
74
74
|
name: 'owner',
|
|
75
|
-
type: 'address'
|
|
75
|
+
type: 'address',
|
|
76
76
|
},
|
|
77
77
|
{
|
|
78
78
|
internalType: 'address',
|
|
79
79
|
name: 'spender',
|
|
80
|
-
type: 'address'
|
|
81
|
-
}
|
|
80
|
+
type: 'address',
|
|
81
|
+
},
|
|
82
82
|
],
|
|
83
83
|
name: 'allowance',
|
|
84
84
|
outputs: [
|
|
85
85
|
{
|
|
86
86
|
internalType: 'uint256',
|
|
87
87
|
name: '',
|
|
88
|
-
type: 'uint256'
|
|
89
|
-
}
|
|
88
|
+
type: 'uint256',
|
|
89
|
+
},
|
|
90
90
|
],
|
|
91
91
|
stateMutability: 'view',
|
|
92
|
-
type: 'function'
|
|
92
|
+
type: 'function',
|
|
93
93
|
},
|
|
94
94
|
{
|
|
95
95
|
inputs: [
|
|
96
96
|
{
|
|
97
97
|
internalType: 'address',
|
|
98
98
|
name: 'spender',
|
|
99
|
-
type: 'address'
|
|
99
|
+
type: 'address',
|
|
100
100
|
},
|
|
101
101
|
{
|
|
102
102
|
internalType: 'uint256',
|
|
103
103
|
name: 'amount',
|
|
104
|
-
type: 'uint256'
|
|
105
|
-
}
|
|
104
|
+
type: 'uint256',
|
|
105
|
+
},
|
|
106
106
|
],
|
|
107
107
|
name: 'approve',
|
|
108
108
|
outputs: [
|
|
109
109
|
{
|
|
110
110
|
internalType: 'bool',
|
|
111
111
|
name: '',
|
|
112
|
-
type: 'bool'
|
|
113
|
-
}
|
|
112
|
+
type: 'bool',
|
|
113
|
+
},
|
|
114
114
|
],
|
|
115
115
|
stateMutability: 'nonpayable',
|
|
116
|
-
type: 'function'
|
|
116
|
+
type: 'function',
|
|
117
117
|
},
|
|
118
118
|
{
|
|
119
119
|
inputs: [
|
|
120
120
|
{
|
|
121
121
|
internalType: 'address',
|
|
122
122
|
name: 'account',
|
|
123
|
-
type: 'address'
|
|
124
|
-
}
|
|
123
|
+
type: 'address',
|
|
124
|
+
},
|
|
125
125
|
],
|
|
126
126
|
name: 'balanceOf',
|
|
127
127
|
outputs: [
|
|
128
128
|
{
|
|
129
129
|
internalType: 'uint256',
|
|
130
130
|
name: '',
|
|
131
|
-
type: 'uint256'
|
|
132
|
-
}
|
|
131
|
+
type: 'uint256',
|
|
132
|
+
},
|
|
133
133
|
],
|
|
134
134
|
stateMutability: 'view',
|
|
135
|
-
type: 'function'
|
|
135
|
+
type: 'function',
|
|
136
136
|
},
|
|
137
137
|
{
|
|
138
138
|
inputs: [],
|
|
@@ -141,59 +141,59 @@ const erc20 = [
|
|
|
141
141
|
{
|
|
142
142
|
internalType: 'uint8',
|
|
143
143
|
name: '',
|
|
144
|
-
type: 'uint8'
|
|
145
|
-
}
|
|
144
|
+
type: 'uint8',
|
|
145
|
+
},
|
|
146
146
|
],
|
|
147
147
|
stateMutability: 'view',
|
|
148
|
-
type: 'function'
|
|
148
|
+
type: 'function',
|
|
149
149
|
},
|
|
150
150
|
{
|
|
151
151
|
inputs: [
|
|
152
152
|
{
|
|
153
153
|
internalType: 'address',
|
|
154
154
|
name: 'spender',
|
|
155
|
-
type: 'address'
|
|
155
|
+
type: 'address',
|
|
156
156
|
},
|
|
157
157
|
{
|
|
158
158
|
internalType: 'uint256',
|
|
159
159
|
name: 'subtractedValue',
|
|
160
|
-
type: 'uint256'
|
|
161
|
-
}
|
|
160
|
+
type: 'uint256',
|
|
161
|
+
},
|
|
162
162
|
],
|
|
163
163
|
name: 'decreaseAllowance',
|
|
164
164
|
outputs: [
|
|
165
165
|
{
|
|
166
166
|
internalType: 'bool',
|
|
167
167
|
name: '',
|
|
168
|
-
type: 'bool'
|
|
169
|
-
}
|
|
168
|
+
type: 'bool',
|
|
169
|
+
},
|
|
170
170
|
],
|
|
171
171
|
stateMutability: 'nonpayable',
|
|
172
|
-
type: 'function'
|
|
172
|
+
type: 'function',
|
|
173
173
|
},
|
|
174
174
|
{
|
|
175
175
|
inputs: [
|
|
176
176
|
{
|
|
177
177
|
internalType: 'address',
|
|
178
178
|
name: 'spender',
|
|
179
|
-
type: 'address'
|
|
179
|
+
type: 'address',
|
|
180
180
|
},
|
|
181
181
|
{
|
|
182
182
|
internalType: 'uint256',
|
|
183
183
|
name: 'addedValue',
|
|
184
|
-
type: 'uint256'
|
|
185
|
-
}
|
|
184
|
+
type: 'uint256',
|
|
185
|
+
},
|
|
186
186
|
],
|
|
187
187
|
name: 'increaseAllowance',
|
|
188
188
|
outputs: [
|
|
189
189
|
{
|
|
190
190
|
internalType: 'bool',
|
|
191
191
|
name: '',
|
|
192
|
-
type: 'bool'
|
|
193
|
-
}
|
|
192
|
+
type: 'bool',
|
|
193
|
+
},
|
|
194
194
|
],
|
|
195
195
|
stateMutability: 'nonpayable',
|
|
196
|
-
type: 'function'
|
|
196
|
+
type: 'function',
|
|
197
197
|
},
|
|
198
198
|
{
|
|
199
199
|
inputs: [],
|
|
@@ -202,11 +202,11 @@ const erc20 = [
|
|
|
202
202
|
{
|
|
203
203
|
internalType: 'string',
|
|
204
204
|
name: '',
|
|
205
|
-
type: 'string'
|
|
206
|
-
}
|
|
205
|
+
type: 'string',
|
|
206
|
+
},
|
|
207
207
|
],
|
|
208
208
|
stateMutability: 'view',
|
|
209
|
-
type: 'function'
|
|
209
|
+
type: 'function',
|
|
210
210
|
},
|
|
211
211
|
{
|
|
212
212
|
inputs: [],
|
|
@@ -215,11 +215,11 @@ const erc20 = [
|
|
|
215
215
|
{
|
|
216
216
|
internalType: 'string',
|
|
217
217
|
name: '',
|
|
218
|
-
type: 'string'
|
|
219
|
-
}
|
|
218
|
+
type: 'string',
|
|
219
|
+
},
|
|
220
220
|
],
|
|
221
221
|
stateMutability: 'view',
|
|
222
|
-
type: 'function'
|
|
222
|
+
type: 'function',
|
|
223
223
|
},
|
|
224
224
|
{
|
|
225
225
|
inputs: [],
|
|
@@ -228,64 +228,64 @@ const erc20 = [
|
|
|
228
228
|
{
|
|
229
229
|
internalType: 'uint256',
|
|
230
230
|
name: '',
|
|
231
|
-
type: 'uint256'
|
|
232
|
-
}
|
|
231
|
+
type: 'uint256',
|
|
232
|
+
},
|
|
233
233
|
],
|
|
234
234
|
stateMutability: 'view',
|
|
235
|
-
type: 'function'
|
|
235
|
+
type: 'function',
|
|
236
236
|
},
|
|
237
237
|
{
|
|
238
238
|
inputs: [
|
|
239
239
|
{
|
|
240
240
|
internalType: 'address',
|
|
241
241
|
name: 'recipient',
|
|
242
|
-
type: 'address'
|
|
242
|
+
type: 'address',
|
|
243
243
|
},
|
|
244
244
|
{
|
|
245
245
|
internalType: 'uint256',
|
|
246
246
|
name: 'amount',
|
|
247
|
-
type: 'uint256'
|
|
248
|
-
}
|
|
247
|
+
type: 'uint256',
|
|
248
|
+
},
|
|
249
249
|
],
|
|
250
250
|
name: 'transfer',
|
|
251
251
|
outputs: [
|
|
252
252
|
{
|
|
253
253
|
internalType: 'bool',
|
|
254
254
|
name: '',
|
|
255
|
-
type: 'bool'
|
|
256
|
-
}
|
|
255
|
+
type: 'bool',
|
|
256
|
+
},
|
|
257
257
|
],
|
|
258
258
|
stateMutability: 'nonpayable',
|
|
259
|
-
type: 'function'
|
|
259
|
+
type: 'function',
|
|
260
260
|
},
|
|
261
261
|
{
|
|
262
262
|
inputs: [
|
|
263
263
|
{
|
|
264
264
|
internalType: 'address',
|
|
265
265
|
name: 'sender',
|
|
266
|
-
type: 'address'
|
|
266
|
+
type: 'address',
|
|
267
267
|
},
|
|
268
268
|
{
|
|
269
269
|
internalType: 'address',
|
|
270
270
|
name: 'recipient',
|
|
271
|
-
type: 'address'
|
|
271
|
+
type: 'address',
|
|
272
272
|
},
|
|
273
273
|
{
|
|
274
274
|
internalType: 'uint256',
|
|
275
275
|
name: 'amount',
|
|
276
|
-
type: 'uint256'
|
|
277
|
-
}
|
|
276
|
+
type: 'uint256',
|
|
277
|
+
},
|
|
278
278
|
],
|
|
279
279
|
name: 'transferFrom',
|
|
280
280
|
outputs: [
|
|
281
281
|
{
|
|
282
282
|
internalType: 'bool',
|
|
283
283
|
name: '',
|
|
284
|
-
type: 'bool'
|
|
285
|
-
}
|
|
284
|
+
type: 'bool',
|
|
285
|
+
},
|
|
286
286
|
],
|
|
287
287
|
stateMutability: 'nonpayable',
|
|
288
|
-
type: 'function'
|
|
289
|
-
}
|
|
288
|
+
type: 'function',
|
|
289
|
+
},
|
|
290
290
|
];
|
|
291
291
|
exports.default = erc20;
|
package/dist/evm/parser/erc20.js
CHANGED
|
@@ -13,7 +13,7 @@ class Parser {
|
|
|
13
13
|
constructor(args) {
|
|
14
14
|
this.abiInterface = new ethers_1.ethers.utils.Interface(erc20_1.default);
|
|
15
15
|
this.supportedFunctions = {
|
|
16
|
-
approveSigHash: this.abiInterface.getSighash('approve')
|
|
16
|
+
approveSigHash: this.abiInterface.getSighash('approve'),
|
|
17
17
|
};
|
|
18
18
|
this.provider = args.provider;
|
|
19
19
|
this.chainId = args.chainId;
|
|
@@ -33,11 +33,11 @@ class Parser {
|
|
|
33
33
|
assetId: (0, caip_1.toAssetId)({
|
|
34
34
|
...(0, caip_1.fromChainId)(this.chainId),
|
|
35
35
|
assetNamespace: 'erc20',
|
|
36
|
-
assetReference: tx.to
|
|
36
|
+
assetReference: tx.to,
|
|
37
37
|
}),
|
|
38
38
|
method: decoded.name,
|
|
39
|
-
parser: types_1.TxParser.ERC20
|
|
40
|
-
}
|
|
39
|
+
parser: types_1.TxParser.ERC20,
|
|
40
|
+
},
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
}
|
package/dist/evm/parser/index.js
CHANGED
|
@@ -69,7 +69,7 @@ class BaseTransactionParser {
|
|
|
69
69
|
trade: contractParserResult === null || contractParserResult === void 0 ? void 0 : contractParserResult.trade,
|
|
70
70
|
transfers: (_a = contractParserResult === null || contractParserResult === void 0 ? void 0 : contractParserResult.transfers) !== null && _a !== void 0 ? _a : [],
|
|
71
71
|
txid: tx.txid,
|
|
72
|
-
data: contractParserResult === null || contractParserResult === void 0 ? void 0 : contractParserResult.data
|
|
72
|
+
data: contractParserResult === null || contractParserResult === void 0 ? void 0 : contractParserResult.data,
|
|
73
73
|
};
|
|
74
74
|
return this.getParsedTxWithTransfers(tx, parsedTx, address);
|
|
75
75
|
}
|
|
@@ -115,18 +115,18 @@ class BaseTransactionParser {
|
|
|
115
115
|
contract: transfer.contract,
|
|
116
116
|
decimals: transfer.decimals,
|
|
117
117
|
name: transfer.name,
|
|
118
|
-
symbol: transfer.symbol
|
|
118
|
+
symbol: transfer.symbol,
|
|
119
119
|
};
|
|
120
120
|
const transferArgs = [
|
|
121
121
|
(0, caip_1.toAssetId)({
|
|
122
122
|
chainId: this.chainId,
|
|
123
123
|
assetNamespace: 'erc20',
|
|
124
|
-
assetReference: transfer.contract
|
|
124
|
+
assetReference: transfer.contract,
|
|
125
125
|
}),
|
|
126
126
|
transfer.from,
|
|
127
127
|
transfer.to,
|
|
128
128
|
transfer.value,
|
|
129
|
-
token
|
|
129
|
+
token,
|
|
130
130
|
];
|
|
131
131
|
// token send amount
|
|
132
132
|
if (address === transfer.from) {
|
package/dist/evm/parser/zrx.js
CHANGED
package/dist/utils.js
CHANGED
|
@@ -18,7 +18,7 @@ class BaseTransactionParser {
|
|
|
18
18
|
confirmations: tx.confirmations,
|
|
19
19
|
status: tx.confirmations > 0 ? types_1.TxStatus.Confirmed : types_1.TxStatus.Pending,
|
|
20
20
|
transfers: [],
|
|
21
|
-
txid: tx.txid
|
|
21
|
+
txid: tx.txid,
|
|
22
22
|
};
|
|
23
23
|
tx.vin.forEach((vin) => {
|
|
24
24
|
var _a, _b, _c, _d, _e, _f, _g;
|