@dhedge/v2-sdk 1.2.0 → 1.4.0
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/config.d.ts +5 -0
- package/dist/entities/pool.d.ts +72 -5
- package/dist/entities/utils.d.ts +6 -0
- package/dist/services/claim-balancer/claim.service.d.ts +1 -5
- package/dist/services/uniswap/V3Liquidity.d.ts +9 -0
- package/dist/services/uniswap/V3Trade.d.ts +4 -0
- package/dist/services/uniswap/types.d.ts +3 -0
- package/dist/test/constants.d.ts +3 -2
- package/dist/test/txOptions.d.ts +1 -0
- package/dist/types.d.ts +19 -10
- package/dist/v2-sdk.cjs.development.js +4172 -1593
- package/dist/v2-sdk.cjs.development.js.map +1 -1
- package/dist/v2-sdk.cjs.production.min.js +1 -1
- package/dist/v2-sdk.cjs.production.min.js.map +1 -1
- package/dist/v2-sdk.esm.js +4175 -1596
- package/dist/v2-sdk.esm.js.map +1 -1
- package/package.json +4 -1
- package/src/abi/IArrakisV1RouterStaking.json +107 -0
- package/src/abi/IERC20.json +15 -1
- package/src/abi/ILiquidityGaugeV4.json +153 -0
- package/src/abi/INonfungiblePositionManager.json +1221 -0
- package/src/abi/ISynthetix.json +139 -0
- package/src/abi/IUniswapV3Quoter.json +195 -0
- package/src/abi/IUniswapV3Router.json +221 -0
- package/src/config.ts +40 -9
- package/src/entities/dhedge.ts +4 -2
- package/src/entities/pool.ts +316 -30
- package/src/entities/utils.ts +12 -0
- package/src/services/claim-balancer/claim.service.ts +14 -76
- package/src/services/uniswap/V3Liquidity.ts +134 -0
- package/src/services/uniswap/V3Trade.ts +47 -0
- package/src/services/uniswap/types.ts +16 -0
- package/src/test/aave.test.ts +53 -25
- package/src/test/arrakis.test.ts +89 -0
- package/src/test/constants.ts +10 -2
- package/src/test/oneInch.test.ts +13 -20
- package/src/test/synthetix.test.ts +34 -0
- package/src/test/txOptions.ts +15 -0
- package/src/test/uniswap.test.ts +125 -0
- package/src/test/wallet.ts +4 -0
- package/src/types.ts +19 -10
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dhedge/v2-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"description": "🛠 An SDK for building applications on top of dHEDGE V2",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -39,10 +39,13 @@
|
|
|
39
39
|
"@ethersproject/bignumber": "^5.5.0",
|
|
40
40
|
"@ethersproject/providers": "5.0.12",
|
|
41
41
|
"@sushiswap/sdk": "5.0.0-canary.7",
|
|
42
|
+
"@uniswap/sdk-core": "^3.0.1",
|
|
43
|
+
"@uniswap/v3-sdk": "^3.8.2",
|
|
42
44
|
"axios": "^0.21.4",
|
|
43
45
|
"bignumber.js": "^9.0.2",
|
|
44
46
|
"dotenv": "^10.0.0",
|
|
45
47
|
"ethers": "^5.4.1",
|
|
48
|
+
"jsbi": "^3.1.4",
|
|
46
49
|
"lodash": "^4.17.21",
|
|
47
50
|
"web3-utils": "^1.7.0"
|
|
48
51
|
},
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
{
|
|
2
|
+
"abi": [
|
|
3
|
+
{
|
|
4
|
+
"inputs": [
|
|
5
|
+
{
|
|
6
|
+
"internalType": "address",
|
|
7
|
+
"name": "gauge",
|
|
8
|
+
"type": "address"
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
"internalType": "uint256",
|
|
12
|
+
"name": "amount0Max",
|
|
13
|
+
"type": "uint256"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"internalType": "uint256",
|
|
17
|
+
"name": "amount1Max",
|
|
18
|
+
"type": "uint256"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"internalType": "uint256",
|
|
22
|
+
"name": "amount0Min",
|
|
23
|
+
"type": "uint256"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"internalType": "uint256",
|
|
27
|
+
"name": "amount1Min",
|
|
28
|
+
"type": "uint256"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"internalType": "address",
|
|
32
|
+
"name": "receiver",
|
|
33
|
+
"type": "address"
|
|
34
|
+
}
|
|
35
|
+
],
|
|
36
|
+
"name": "addLiquidityAndStake",
|
|
37
|
+
"outputs": [
|
|
38
|
+
{
|
|
39
|
+
"internalType": "uint256",
|
|
40
|
+
"name": "amount0",
|
|
41
|
+
"type": "uint256"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
"internalType": "uint256",
|
|
45
|
+
"name": "amount1",
|
|
46
|
+
"type": "uint256"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"internalType": "uint256",
|
|
50
|
+
"name": "mintAmount",
|
|
51
|
+
"type": "uint256"
|
|
52
|
+
}
|
|
53
|
+
],
|
|
54
|
+
"stateMutability": "nonpayable",
|
|
55
|
+
"type": "function"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"inputs": [
|
|
59
|
+
{
|
|
60
|
+
"internalType": "address",
|
|
61
|
+
"name": "gauge",
|
|
62
|
+
"type": "address"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"internalType": "uint256",
|
|
66
|
+
"name": "burnAmount",
|
|
67
|
+
"type": "uint256"
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
"internalType": "uint256",
|
|
71
|
+
"name": "amount0Min",
|
|
72
|
+
"type": "uint256"
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
"internalType": "uint256",
|
|
76
|
+
"name": "amount1Min",
|
|
77
|
+
"type": "uint256"
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
"internalType": "address",
|
|
81
|
+
"name": "receiver",
|
|
82
|
+
"type": "address"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"name": "removeLiquidityAndUnstake",
|
|
86
|
+
"outputs": [
|
|
87
|
+
{
|
|
88
|
+
"internalType": "uint256",
|
|
89
|
+
"name": "amount0",
|
|
90
|
+
"type": "uint256"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"internalType": "uint256",
|
|
94
|
+
"name": "amount1",
|
|
95
|
+
"type": "uint256"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"internalType": "uint128",
|
|
99
|
+
"name": "liquidityBurned",
|
|
100
|
+
"type": "uint128"
|
|
101
|
+
}
|
|
102
|
+
],
|
|
103
|
+
"stateMutability": "nonpayable",
|
|
104
|
+
"type": "function"
|
|
105
|
+
}
|
|
106
|
+
]
|
|
107
|
+
}
|
package/src/abi/IERC20.json
CHANGED
|
@@ -246,7 +246,21 @@
|
|
|
246
246
|
"payable": false,
|
|
247
247
|
"stateMutability": "nonpayable",
|
|
248
248
|
"type": "function"
|
|
249
|
-
}
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
"constant": true,
|
|
252
|
+
"inputs": [],
|
|
253
|
+
"name": "decimals",
|
|
254
|
+
"outputs": [
|
|
255
|
+
{
|
|
256
|
+
"name": "",
|
|
257
|
+
"type": "uint8"
|
|
258
|
+
}
|
|
259
|
+
],
|
|
260
|
+
"payable": false,
|
|
261
|
+
"stateMutability": "view",
|
|
262
|
+
"type": "function"
|
|
263
|
+
}
|
|
250
264
|
]
|
|
251
265
|
}
|
|
252
266
|
|
|
@@ -0,0 +1,153 @@
|
|
|
1
|
+
{ "abi": [
|
|
2
|
+
{
|
|
3
|
+
"inputs": [
|
|
4
|
+
{
|
|
5
|
+
"internalType": "address",
|
|
6
|
+
"name": "user",
|
|
7
|
+
"type": "address"
|
|
8
|
+
}
|
|
9
|
+
],
|
|
10
|
+
"name": "claim_rewards",
|
|
11
|
+
"outputs": [],
|
|
12
|
+
"stateMutability": "nonpayable",
|
|
13
|
+
"type": "function"
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
"inputs": [
|
|
17
|
+
{
|
|
18
|
+
"internalType": "address",
|
|
19
|
+
"name": "user",
|
|
20
|
+
"type": "address"
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
"internalType": "address",
|
|
24
|
+
"name": "receiver",
|
|
25
|
+
"type": "address"
|
|
26
|
+
}
|
|
27
|
+
],
|
|
28
|
+
"name": "claim_rewards",
|
|
29
|
+
"outputs": [],
|
|
30
|
+
"stateMutability": "nonpayable",
|
|
31
|
+
"type": "function"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
"inputs": [],
|
|
35
|
+
"name": "claim_rewards",
|
|
36
|
+
"outputs": [],
|
|
37
|
+
"stateMutability": "nonpayable",
|
|
38
|
+
"type": "function"
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
"inputs": [
|
|
42
|
+
{
|
|
43
|
+
"internalType": "address",
|
|
44
|
+
"name": "user",
|
|
45
|
+
"type": "address"
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
"internalType": "address",
|
|
49
|
+
"name": "rewardToken",
|
|
50
|
+
"type": "address"
|
|
51
|
+
}
|
|
52
|
+
],
|
|
53
|
+
"name": "claimable_reward",
|
|
54
|
+
"outputs": [
|
|
55
|
+
{
|
|
56
|
+
"internalType": "uint256",
|
|
57
|
+
"name": "",
|
|
58
|
+
"type": "uint256"
|
|
59
|
+
}
|
|
60
|
+
],
|
|
61
|
+
"stateMutability": "view",
|
|
62
|
+
"type": "function"
|
|
63
|
+
},
|
|
64
|
+
{
|
|
65
|
+
"inputs": [],
|
|
66
|
+
"name": "reward_count",
|
|
67
|
+
"outputs": [
|
|
68
|
+
{
|
|
69
|
+
"internalType": "uint256",
|
|
70
|
+
"name": "",
|
|
71
|
+
"type": "uint256"
|
|
72
|
+
}
|
|
73
|
+
],
|
|
74
|
+
"stateMutability": "view",
|
|
75
|
+
"type": "function"
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
"inputs": [
|
|
79
|
+
{
|
|
80
|
+
"internalType": "address",
|
|
81
|
+
"name": "token",
|
|
82
|
+
"type": "address"
|
|
83
|
+
}
|
|
84
|
+
],
|
|
85
|
+
"name": "reward_data",
|
|
86
|
+
"outputs": [
|
|
87
|
+
{
|
|
88
|
+
"internalType": "address",
|
|
89
|
+
"name": "",
|
|
90
|
+
"type": "address"
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
"internalType": "address",
|
|
94
|
+
"name": "",
|
|
95
|
+
"type": "address"
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
"internalType": "uint256",
|
|
99
|
+
"name": "",
|
|
100
|
+
"type": "uint256"
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
"internalType": "uint256",
|
|
104
|
+
"name": "",
|
|
105
|
+
"type": "uint256"
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
"internalType": "uint256",
|
|
109
|
+
"name": "",
|
|
110
|
+
"type": "uint256"
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
"internalType": "uint256",
|
|
114
|
+
"name": "",
|
|
115
|
+
"type": "uint256"
|
|
116
|
+
}
|
|
117
|
+
],
|
|
118
|
+
"stateMutability": "view",
|
|
119
|
+
"type": "function"
|
|
120
|
+
},
|
|
121
|
+
{
|
|
122
|
+
"inputs": [
|
|
123
|
+
{
|
|
124
|
+
"internalType": "uint256",
|
|
125
|
+
"name": "index",
|
|
126
|
+
"type": "uint256"
|
|
127
|
+
}
|
|
128
|
+
],
|
|
129
|
+
"name": "reward_tokens",
|
|
130
|
+
"outputs": [
|
|
131
|
+
{
|
|
132
|
+
"internalType": "address",
|
|
133
|
+
"name": "",
|
|
134
|
+
"type": "address"
|
|
135
|
+
}
|
|
136
|
+
],
|
|
137
|
+
"stateMutability": "view",
|
|
138
|
+
"type": "function"
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
"inputs": [],
|
|
142
|
+
"name": "staking_token",
|
|
143
|
+
"outputs": [
|
|
144
|
+
{
|
|
145
|
+
"internalType": "address",
|
|
146
|
+
"name": "",
|
|
147
|
+
"type": "address"
|
|
148
|
+
}
|
|
149
|
+
],
|
|
150
|
+
"stateMutability": "view",
|
|
151
|
+
"type": "function"
|
|
152
|
+
}
|
|
153
|
+
]}
|