@defisaver/sdk 0.1.19 → 0.1.22
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 +2 -2
- package/src/actions/curve/CurveStethPoolDepositAction.js +40 -0
- package/src/actions/curve/CurveStethPoolWithdrawAction.js +40 -0
- package/src/actions/curve/index.js +6 -0
- package/src/actions/maker/MakerClaimAction.js +26 -0
- package/src/actions/maker/index.js +2 -0
- package/src/addresses.js +9 -5
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defisaver/sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.22",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"repository": "https://github.com/DecenterApps/defisaver-sdk",
|
|
14
14
|
"license": "ISC",
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@defisaver/tokens": "^1.4.
|
|
16
|
+
"@defisaver/tokens": "^1.4.7",
|
|
17
17
|
"@ethersproject/address": "^5.0.10",
|
|
18
18
|
"@ethersproject/solidity": "^5.0.9",
|
|
19
19
|
"axios": "^0.21.1",
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const Action = require('../../Action');
|
|
2
|
+
const { requireAddress } = require('../../utils/general');
|
|
3
|
+
const { getAddr } = require('../../addresses.js');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* CurveStethPoolDepositAction - Deposits tokens into curve steth pool
|
|
7
|
+
*/
|
|
8
|
+
class CurveStethPoolDepositAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param from {address}
|
|
11
|
+
* @param to {address}
|
|
12
|
+
* @param amounts {uint256[2]}
|
|
13
|
+
* @param minMintAmount {uint256}
|
|
14
|
+
*/
|
|
15
|
+
constructor(
|
|
16
|
+
from,
|
|
17
|
+
to,
|
|
18
|
+
amounts,
|
|
19
|
+
minMintAmount,
|
|
20
|
+
) {
|
|
21
|
+
requireAddress(to);
|
|
22
|
+
|
|
23
|
+
super(
|
|
24
|
+
'CurveStethPoolDeposit',
|
|
25
|
+
getAddr('CurveStethPoolDeposit'),
|
|
26
|
+
[['address', 'address', 'uint256[2]', 'uint256']],
|
|
27
|
+
[[...arguments]],
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
this.mappableArgs = [
|
|
31
|
+
this.args[0][0],
|
|
32
|
+
this.args[0][1],
|
|
33
|
+
this.args[0][2][0],
|
|
34
|
+
this.args[0][2][1],
|
|
35
|
+
this.args[0][3],
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = CurveStethPoolDepositAction;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
const Action = require('../../Action');
|
|
2
|
+
const { requireAddress } = require('../../utils/general');
|
|
3
|
+
const { getAddr } = require('../../addresses.js');
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* CurveStethPoolWithdrawAction - Withdraws tokens from curve steth pool
|
|
7
|
+
*/
|
|
8
|
+
class CurveStethPoolWithdrawAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param from {address}
|
|
11
|
+
* @param to {address}
|
|
12
|
+
* @param amounts {uint256[2]}
|
|
13
|
+
* @param maxBurnAmount {uint256}
|
|
14
|
+
*/
|
|
15
|
+
constructor(
|
|
16
|
+
from,
|
|
17
|
+
to,
|
|
18
|
+
amounts,
|
|
19
|
+
maxBurnAmount,
|
|
20
|
+
) {
|
|
21
|
+
requireAddress(to);
|
|
22
|
+
|
|
23
|
+
super(
|
|
24
|
+
'CurveStethPoolWithdraw',
|
|
25
|
+
getAddr('CurveStethPoolWithdraw'),
|
|
26
|
+
[['address', 'address', 'uint256[2]', 'uint256']],
|
|
27
|
+
[[...arguments]],
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
this.mappableArgs = [
|
|
31
|
+
this.args[0][0],
|
|
32
|
+
this.args[0][1],
|
|
33
|
+
this.args[0][2][0],
|
|
34
|
+
this.args[0][2][1],
|
|
35
|
+
this.args[0][3],
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
module.exports = CurveStethPoolWithdrawAction;
|
|
@@ -7,6 +7,9 @@ const CurveGaugeWithdrawAction = require('./CurveGaugeWithdrawAction');
|
|
|
7
7
|
const CurveMintCrvAction = require('./CurveMintCrvAction');
|
|
8
8
|
const CurveClaimFeesAction = require('./CurveClaimFeesAction');
|
|
9
9
|
|
|
10
|
+
const CurveStethPoolDepositAction = require('./CurveStethPoolDepositAction');
|
|
11
|
+
const CurveStethPoolWithdrawAction = require('./CurveStethPoolWithdrawAction');
|
|
12
|
+
|
|
10
13
|
module.exports = {
|
|
11
14
|
CurveSwapAction,
|
|
12
15
|
CurveDepositAction,
|
|
@@ -16,4 +19,7 @@ module.exports = {
|
|
|
16
19
|
CurveGaugeWithdrawAction,
|
|
17
20
|
CurveMintCrvAction,
|
|
18
21
|
CurveClaimFeesAction,
|
|
22
|
+
|
|
23
|
+
CurveStethPoolDepositAction,
|
|
24
|
+
CurveStethPoolWithdrawAction,
|
|
19
25
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
const Action = require("../../Action");
|
|
2
|
+
const { tokenFromJoin, getAssetInfo } = require("@defisaver/tokens");
|
|
3
|
+
|
|
4
|
+
const { getAddr } = require('../../addresses.js');
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* MakerClaimAction - Claim bonus tokens in CropJoin types
|
|
8
|
+
*/
|
|
9
|
+
class MakerClaimAction extends Action {
|
|
10
|
+
/**
|
|
11
|
+
* @param vaultId {VaultId}
|
|
12
|
+
* @param joinAddr {EthAddress}
|
|
13
|
+
* @param to {EthAddress} Tokens will be sent to this address
|
|
14
|
+
*/
|
|
15
|
+
constructor(vaultId, joinAddr, to) {
|
|
16
|
+
super('McdClaim', getAddr('McdClaim'), [['uint256','address','address']], [[vaultId, joinAddr, to]]);
|
|
17
|
+
|
|
18
|
+
this.mappableArgs = [
|
|
19
|
+
this.args[0][0],
|
|
20
|
+
this.args[0][1],
|
|
21
|
+
this.args[0][2],
|
|
22
|
+
];
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
module.exports = MakerClaimAction;
|
|
@@ -5,6 +5,7 @@ const MakerPaybackAction = require('./MakerPaybackAction');
|
|
|
5
5
|
const MakerWithdrawAction = require('./MakerWithdrawAction');
|
|
6
6
|
const MakerGiveAction = require('./MakerGiveAction');
|
|
7
7
|
const MakerMergeAction = require('./MakerMergeAction');
|
|
8
|
+
const MakerClaimAction = require('./MakerClaimAction');
|
|
8
9
|
|
|
9
10
|
module.exports = {
|
|
10
11
|
MakerOpenVaultAction,
|
|
@@ -14,4 +15,5 @@ module.exports = {
|
|
|
14
15
|
MakerWithdrawAction,
|
|
15
16
|
MakerGiveAction,
|
|
16
17
|
MakerMergeAction,
|
|
18
|
+
MakerClaimAction,
|
|
17
19
|
};
|
package/src/addresses.js
CHANGED
|
@@ -20,13 +20,14 @@ const actionAddresses = {
|
|
|
20
20
|
'DFSBuy': '0x939dCad6A3D1fEACccB60Af90876D904468CbF66',
|
|
21
21
|
|
|
22
22
|
// maker
|
|
23
|
-
'McdGenerate': '
|
|
23
|
+
'McdGenerate': '0x2bF4586636329Ae930cFe085a1e57BAb4a8f741b',
|
|
24
24
|
'McdGive': '0xD2dc5DA4172a3901C9f26c7cd29eFE656Fc20332',
|
|
25
25
|
'McdMerge': '0x66c7f4C7e59b6e780142aaD5c9f427FA5F8dfFc6',
|
|
26
|
-
'McdOpen': '
|
|
27
|
-
'McdPayback': '
|
|
28
|
-
'McdSupply': '
|
|
29
|
-
'McdWithdraw': '
|
|
26
|
+
'McdOpen': '0x72AFC60B90c976397C37B5c64DDc067Ea521D388',
|
|
27
|
+
'McdPayback': '0xb7C2c78846493Bed18fa07B51fcc5EAFAc9d629C',
|
|
28
|
+
'McdSupply': '0x91c3167aC51F92c2f720C6A8418FDF46060698A1',
|
|
29
|
+
'McdWithdraw': '0x3c232F0ae183C3e2eb421e8e317318Dfe85a7b10',
|
|
30
|
+
'McdClaim': '0xd78783b50227A84d43604843065494e2666182Ab',
|
|
30
31
|
|
|
31
32
|
// reflexer
|
|
32
33
|
'ReflexerSupply': '0x24C537A93A9ab75b5A593BA0B2dc03200345A844',
|
|
@@ -124,6 +125,9 @@ const actionAddresses = {
|
|
|
124
125
|
'MStableWithdrawNew': '0x6468215Bf4811244Ab78599e1df9206716A35aB7',
|
|
125
126
|
|
|
126
127
|
'MStableClaim': '0x28279A806aDeDedFD33e39C7375dc0c0ee943847',
|
|
128
|
+
|
|
129
|
+
'CurveStethPoolDeposit': '0x0f042a5CC97C4cd8D8136c28F966839f195D08B9',
|
|
130
|
+
'CurveStethPoolWithdraw': '0x2F4ad71Bd8045d0633B304BD2d94ef349eB09105',
|
|
127
131
|
};
|
|
128
132
|
|
|
129
133
|
const otherAddresses = {
|