@defisaver/sdk 1.2.28 → 1.2.30
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/esm/src/actions/fluid/FluidDexOpenAction.d.ts +20 -0
- package/esm/src/actions/fluid/FluidDexOpenAction.js +45 -0
- package/esm/src/actions/fluid/FluidDexRegularBorrowAction.d.ts +17 -0
- package/esm/src/actions/fluid/FluidDexRegularBorrowAction.js +36 -0
- package/esm/src/actions/fluid/FluidDexRegularPaybackAction.d.ts +16 -0
- package/esm/src/actions/fluid/FluidDexRegularPaybackAction.js +34 -0
- package/esm/src/actions/fluid/FluidDexRegularSupplyAction.d.ts +16 -0
- package/esm/src/actions/fluid/FluidDexRegularSupplyAction.js +33 -0
- package/esm/src/actions/fluid/FluidDexRegularWithdrawAction.d.ts +17 -0
- package/esm/src/actions/fluid/FluidDexRegularWithdrawAction.js +37 -0
- package/esm/src/actions/fluid/FluidDexSmartCollSupplyAction.d.ts +16 -0
- package/esm/src/actions/fluid/FluidDexSmartCollSupplyAction.js +33 -0
- package/esm/src/actions/fluid/FluidDexSmartCollWithdrawAction.d.ts +17 -0
- package/esm/src/actions/fluid/FluidDexSmartCollWithdrawAction.js +37 -0
- package/esm/src/actions/fluid/FluidDexSmartDebtBorrowAction.d.ts +17 -0
- package/esm/src/actions/fluid/FluidDexSmartDebtBorrowAction.js +36 -0
- package/esm/src/actions/fluid/FluidDexSmartDebtPaybackAction.d.ts +16 -0
- package/esm/src/actions/fluid/FluidDexSmartDebtPaybackAction.js +34 -0
- package/esm/src/actions/fluid/index.d.ts +9 -0
- package/esm/src/actions/fluid/index.js +9 -0
- package/esm/src/actions/index.d.ts +2 -1
- package/esm/src/actions/index.js +2 -1
- package/esm/src/actions/pendle/PendleTokenRedeemAction.d.ts +24 -0
- package/esm/src/actions/pendle/PendleTokenRedeemAction.js +44 -0
- package/esm/src/actions/pendle/index.d.ts +1 -0
- package/esm/src/actions/pendle/index.js +1 -0
- package/esm/src/addresses.d.ts +24 -0
- package/esm/src/addresses.js +16 -3
- package/esm/src/index.d.ts +96 -0
- package/package.json +2 -2
- package/src/actions/fluid/FluidDexOpenAction.ts +61 -0
- package/src/actions/fluid/FluidDexRegularBorrowAction.ts +49 -0
- package/src/actions/fluid/FluidDexRegularPaybackAction.ts +46 -0
- package/src/actions/fluid/FluidDexRegularSupplyAction.ts +45 -0
- package/src/actions/fluid/FluidDexRegularWithdrawAction.ts +50 -0
- package/src/actions/fluid/FluidDexSmartCollSupplyAction.ts +45 -0
- package/src/actions/fluid/FluidDexSmartCollWithdrawAction.ts +50 -0
- package/src/actions/fluid/FluidDexSmartDebtBorrowAction.ts +49 -0
- package/src/actions/fluid/FluidDexSmartDebtPaybackAction.ts +46 -0
- package/src/actions/fluid/index.ts +11 -1
- package/src/actions/index.ts +2 -0
- package/src/actions/pendle/PendleTokenRedeemAction.ts +51 -0
- package/src/actions/pendle/index.ts +1 -0
- package/src/addresses.ts +17 -3
- package/umd/index.js +453 -72
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* FluidDexSmartCollSupplyAction - Supply collateral to the Fluid DEX with smart collateral (T2, T4).
|
|
7
|
+
*
|
|
8
|
+
* @category Fluid
|
|
9
|
+
*/
|
|
10
|
+
export class FluidDexSmartCollSupplyAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param vault The address of the Fluid DEX vault.
|
|
13
|
+
* @param from Address to pull the collateral from.
|
|
14
|
+
* @param nftId The NFT ID of the position.
|
|
15
|
+
* @param supplyVariableData Variable data for supply action
|
|
16
|
+
*/
|
|
17
|
+
constructor(
|
|
18
|
+
vault: EthAddress,
|
|
19
|
+
from: EthAddress,
|
|
20
|
+
nftId: uint256,
|
|
21
|
+
supplyVariableData: Array<any>,
|
|
22
|
+
) {
|
|
23
|
+
super(
|
|
24
|
+
'FluidDexSupply',
|
|
25
|
+
getAddr('FluidDexSupply'),
|
|
26
|
+
[
|
|
27
|
+
'address',
|
|
28
|
+
'address',
|
|
29
|
+
'uint256',
|
|
30
|
+
'uint256',
|
|
31
|
+
['uint256', 'uint256', 'uint256'],
|
|
32
|
+
],
|
|
33
|
+
[vault, from, nftId, '0', supplyVariableData],
|
|
34
|
+
);
|
|
35
|
+
this.mappableArgs = [
|
|
36
|
+
this.args[0],
|
|
37
|
+
this.args[1],
|
|
38
|
+
this.args[2],
|
|
39
|
+
this.args[3],
|
|
40
|
+
this.args[4][0],
|
|
41
|
+
this.args[4][1],
|
|
42
|
+
this.args[4][2],
|
|
43
|
+
];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* FluidDexSmartCollWithdrawAction - Withdraw assets from the Fluid DEX with smart collateral (T2, T4).
|
|
7
|
+
*
|
|
8
|
+
* @category Fluid
|
|
9
|
+
*/
|
|
10
|
+
export class FluidDexSmartCollWithdrawAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param vault The address of the Fluid DEX vault.
|
|
13
|
+
* @param to Address to send the withdrawn assets to.
|
|
14
|
+
* @param nftId The NFT ID of the position.
|
|
15
|
+
* @param withdrawVariableData Variable data for withdraw action.
|
|
16
|
+
* @param wrapWithdrawnEth Whether to wrap the withdrawn ETH into WETH if one of the withdrawn assets is ETH.
|
|
17
|
+
*/
|
|
18
|
+
constructor(
|
|
19
|
+
vault: EthAddress,
|
|
20
|
+
to: EthAddress,
|
|
21
|
+
nftId: uint256,
|
|
22
|
+
withdrawVariableData: Array<any>,
|
|
23
|
+
wrapWithdrawnEth: boolean,
|
|
24
|
+
) {
|
|
25
|
+
super(
|
|
26
|
+
'FluidDexWithdraw',
|
|
27
|
+
getAddr('FluidDexWithdraw'),
|
|
28
|
+
[
|
|
29
|
+
'address',
|
|
30
|
+
'address',
|
|
31
|
+
'uint256',
|
|
32
|
+
'uint256',
|
|
33
|
+
['uint256', 'uint256', 'uint256', 'uint256'],
|
|
34
|
+
'bool',
|
|
35
|
+
],
|
|
36
|
+
[vault, to, nftId, '0', withdrawVariableData, wrapWithdrawnEth],
|
|
37
|
+
);
|
|
38
|
+
this.mappableArgs = [
|
|
39
|
+
this.args[0],
|
|
40
|
+
this.args[1],
|
|
41
|
+
this.args[2],
|
|
42
|
+
this.args[3],
|
|
43
|
+
this.args[4][0],
|
|
44
|
+
this.args[4][1],
|
|
45
|
+
this.args[4][2],
|
|
46
|
+
this.args[4][3],
|
|
47
|
+
this.args[5],
|
|
48
|
+
];
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* FluidDexSmartDebtBorrowAction - Borrow assets from the Fluid DEX with smart debt (T3, T4).
|
|
7
|
+
*
|
|
8
|
+
* @category Fluid
|
|
9
|
+
*/
|
|
10
|
+
export class FluidDexSmartDebtBorrowAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param vault The address of the Fluid DEX vault.
|
|
13
|
+
* @param to Address to send the borrowed assets to.
|
|
14
|
+
* @param nftId The NFT ID of the position.
|
|
15
|
+
* @param borrowVariableData Variable data for borrow action.
|
|
16
|
+
* @param wrapBorrowedEth Whether to wrap the borrowed ETH into WETH if one of the borrowed assets is ETH.
|
|
17
|
+
*/
|
|
18
|
+
constructor(
|
|
19
|
+
vault: EthAddress,
|
|
20
|
+
to: EthAddress,
|
|
21
|
+
nftId: uint256,
|
|
22
|
+
borrowVariableData: Array<any>,
|
|
23
|
+
wrapBorrowedEth: boolean,
|
|
24
|
+
) {
|
|
25
|
+
super(
|
|
26
|
+
'FluidDexBorrow',
|
|
27
|
+
getAddr('FluidDexBorrow'),
|
|
28
|
+
[
|
|
29
|
+
'address',
|
|
30
|
+
'address',
|
|
31
|
+
'uint256',
|
|
32
|
+
'uint256',
|
|
33
|
+
['uint256', 'uint256', 'uint256'],
|
|
34
|
+
'bool',
|
|
35
|
+
],
|
|
36
|
+
[vault, to, nftId, '0', borrowVariableData, wrapBorrowedEth],
|
|
37
|
+
);
|
|
38
|
+
this.mappableArgs = [
|
|
39
|
+
this.args[0],
|
|
40
|
+
this.args[1],
|
|
41
|
+
this.args[2],
|
|
42
|
+
this.args[3],
|
|
43
|
+
this.args[4][0],
|
|
44
|
+
this.args[4][1],
|
|
45
|
+
this.args[4][2],
|
|
46
|
+
this.args[5],
|
|
47
|
+
];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* FluidDexSmartDebtPaybackAction - Payback debt on the Fluid DEX with smart debt (T3, T4).
|
|
7
|
+
*
|
|
8
|
+
* @category Fluid
|
|
9
|
+
*/
|
|
10
|
+
export class FluidDexSmartDebtPaybackAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param vault The address of the Fluid DEX vault.
|
|
13
|
+
* @param from Address to pull the debt tokens from.
|
|
14
|
+
* @param nftId The NFT ID of the position.
|
|
15
|
+
* @param paybackVariableData Variable data for payback action.
|
|
16
|
+
*/
|
|
17
|
+
constructor(
|
|
18
|
+
vault: EthAddress,
|
|
19
|
+
from: EthAddress,
|
|
20
|
+
nftId: uint256,
|
|
21
|
+
paybackVariableData: Array<any>,
|
|
22
|
+
) {
|
|
23
|
+
super(
|
|
24
|
+
'FluidDexPayback',
|
|
25
|
+
getAddr('FluidDexPayback'),
|
|
26
|
+
[
|
|
27
|
+
'address',
|
|
28
|
+
'address',
|
|
29
|
+
'uint256',
|
|
30
|
+
'uint256',
|
|
31
|
+
['uint256', 'uint256', 'uint256', 'uint256'],
|
|
32
|
+
],
|
|
33
|
+
[vault, from, nftId, '0', paybackVariableData],
|
|
34
|
+
);
|
|
35
|
+
this.mappableArgs = [
|
|
36
|
+
this.args[0],
|
|
37
|
+
this.args[1],
|
|
38
|
+
this.args[2],
|
|
39
|
+
this.args[3],
|
|
40
|
+
this.args[4][0],
|
|
41
|
+
this.args[4][1],
|
|
42
|
+
this.args[4][2],
|
|
43
|
+
this.args[4][3],
|
|
44
|
+
];
|
|
45
|
+
}
|
|
46
|
+
}
|
|
@@ -4,4 +4,14 @@ export * from './FluidVaultT1BorrowAction';
|
|
|
4
4
|
export * from './FluidVaultT1PaybackAction';
|
|
5
5
|
export * from './FluidVaultT1SupplyAction';
|
|
6
6
|
export * from './FluidVaultT1WithdrawAction';
|
|
7
|
-
export * from './FluidClaimAction';
|
|
7
|
+
export * from './FluidClaimAction';
|
|
8
|
+
|
|
9
|
+
export * from './FluidDexOpenAction';
|
|
10
|
+
export * from './FluidDexRegularBorrowAction';
|
|
11
|
+
export * from './FluidDexRegularSupplyAction';
|
|
12
|
+
export * from './FluidDexRegularPaybackAction';
|
|
13
|
+
export * from './FluidDexRegularWithdrawAction';
|
|
14
|
+
export * from './FluidDexSmartCollSupplyAction';
|
|
15
|
+
export * from './FluidDexSmartCollWithdrawAction';
|
|
16
|
+
export * from './FluidDexSmartDebtBorrowAction';
|
|
17
|
+
export * from './FluidDexSmartDebtPaybackAction';
|
package/src/actions/index.ts
CHANGED
|
@@ -36,6 +36,7 @@ import * as stkgho from './stkgho';
|
|
|
36
36
|
import * as renzo from './renzo';
|
|
37
37
|
import * as etherfi from './etherfi';
|
|
38
38
|
import * as fluid from './fluid';
|
|
39
|
+
import * as pendle from './pendle';
|
|
39
40
|
|
|
40
41
|
export {
|
|
41
42
|
aave,
|
|
@@ -76,4 +77,5 @@ export {
|
|
|
76
77
|
renzo,
|
|
77
78
|
etherfi,
|
|
78
79
|
fluid,
|
|
80
|
+
pendle,
|
|
79
81
|
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* PendleTokenRedeemAction - Redeem PT tokens for underlying tokens
|
|
7
|
+
*
|
|
8
|
+
* @category Pendle
|
|
9
|
+
*/
|
|
10
|
+
export class PendleTokenRedeemAction extends Action {
|
|
11
|
+
tokenForApproval: EthAddress;
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* @param market The address of the Pendle market
|
|
15
|
+
* @param underlyingToken The address of the underlying token
|
|
16
|
+
* @param ptToken The address of the PT token
|
|
17
|
+
* @param from The address from where the PT tokens will be pulled
|
|
18
|
+
* @param to The address of the recipient to receive the underlying tokens
|
|
19
|
+
* @param ptAmount The amount of PT tokens to redeem
|
|
20
|
+
* @param minAmountOut The minimum amount of underlying tokens to receive
|
|
21
|
+
*/
|
|
22
|
+
constructor(
|
|
23
|
+
market: EthAddress,
|
|
24
|
+
underlyingToken: EthAddress,
|
|
25
|
+
ptToken: EthAddress,
|
|
26
|
+
from: EthAddress,
|
|
27
|
+
to: EthAddress,
|
|
28
|
+
ptAmount: uint256,
|
|
29
|
+
minAmountOut: uint256,
|
|
30
|
+
) {
|
|
31
|
+
super(
|
|
32
|
+
'PendleTokenRedeem',
|
|
33
|
+
getAddr('PendleTokenRedeem'),
|
|
34
|
+
['address', 'address', 'address', 'address', 'uint256', 'uint256'],
|
|
35
|
+
[market, underlyingToken, from, to, ptAmount, minAmountOut],
|
|
36
|
+
);
|
|
37
|
+
this.mappableArgs = [
|
|
38
|
+
this.args[0],
|
|
39
|
+
this.args[1],
|
|
40
|
+
this.args[2],
|
|
41
|
+
this.args[3],
|
|
42
|
+
this.args[4],
|
|
43
|
+
this.args[5],
|
|
44
|
+
];
|
|
45
|
+
this.tokenForApproval = ptToken;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
async getAssetsToApprove() {
|
|
49
|
+
return [{ asset: this.tokenForApproval, owner: this.args[2] }];
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './PendleTokenRedeemAction';
|
package/src/addresses.ts
CHANGED
|
@@ -337,8 +337,14 @@ export const actionAddresses = {
|
|
|
337
337
|
FluidVaultT1Payback: '0xa7A4B84D38CD33F9901922687db24B8aE14f2455',
|
|
338
338
|
FluidVaultT1Withdraw: '0x5673b9ab4A035C5C7474C344664Be91DaFafa17E',
|
|
339
339
|
FluidVaultT1Supply: '0x0c6100209D8A0bb14CC7d18e45dA1bd1E7a3a187',
|
|
340
|
-
FluidView: '
|
|
340
|
+
FluidView: '0xc8df052bD7A8d76a34c09e758Dff3c6298C0115c',
|
|
341
341
|
FluidClaim: '0x0bC0aeF7702C204DEF308994C84D8fBce676dB47',
|
|
342
|
+
// fluid dex actions
|
|
343
|
+
FluidDexOpen: '0x071e1369E1c9030Aa1a089bDE2F72797a14FE3b3',
|
|
344
|
+
FluidDexSupply: '0xB3BE39850d8939Cceb4Fc49c415c428548FA9f9C',
|
|
345
|
+
FluidDexBorrow: '0x3fa8EF6DA8f5b2BaAee77493a3A3dA68a7Aa75f3',
|
|
346
|
+
FluidDexPayback: '0xD733BD32F4AAEe92a983E2021B85ca5d31236FA0',
|
|
347
|
+
FluidDexWithdraw: '0x14d5bb8E96fbf7C1f9A8E3EFD0eF5fe6832ff3cd',
|
|
342
348
|
},
|
|
343
349
|
[NETWORKS.optimism.chainId]: {
|
|
344
350
|
DFSSell: '0x9f234af5c10c136863a20865ba00b26951ab8269',
|
|
@@ -485,7 +491,12 @@ export const actionAddresses = {
|
|
|
485
491
|
FluidVaultT1Payback: '0x226c871E0a27B12065c9128b8e7440b054b59155',
|
|
486
492
|
FluidVaultT1Withdraw: '0xc13d93227d97197e5F1751d0a3e80c1080A5fa2B',
|
|
487
493
|
FluidVaultT1Supply: '0xBCF0Dc5bb2C4434AD07369207904F5900d391b0B',
|
|
488
|
-
FluidView: '
|
|
494
|
+
FluidView: '0xf9e6d5568887ac8eC6fA33B7eefD2A176A958e71',
|
|
495
|
+
FluidDexOpen: '0xA456f13d358B8B93bE6778be3244111E267C0AaC',
|
|
496
|
+
FluidDexSupply: '0x3E49c4f914E01e5612719a7B4965e4FAfb324762',
|
|
497
|
+
FluidDexBorrow: '0x8626b70CDf64e557fDdcFbcb783833Dc314d95F4',
|
|
498
|
+
FluidDexPayback: '0xA9B46Da016F22cf9F8841A30881bB88E2Ad5CA94',
|
|
499
|
+
FluidDexWithdraw: '0x076D5434793798b153298bF70b014f5E6145aB2E',
|
|
489
500
|
},
|
|
490
501
|
[NETWORKS.base.chainId]: {
|
|
491
502
|
// Basic
|
|
@@ -560,9 +571,12 @@ export const actionAddresses = {
|
|
|
560
571
|
FluidVaultT1Payback: '0xA65daAa4FB4Fe9feaDF25bf2C062c3Faa2b02e5D',
|
|
561
572
|
FluidVaultT1Withdraw: '0x26bE6a2EdE97aE826ed9DA8Fb79428037fe55cEB',
|
|
562
573
|
FluidVaultT1Supply: '0x028ACA45244d4897ff80ef65ed0b735Bb0D4B0A5',
|
|
563
|
-
FluidView: '
|
|
574
|
+
FluidView: '0x6cd4D6af4F292817eA2A2311F099dF26cd015028',
|
|
564
575
|
|
|
565
576
|
TokenizedVaultAdapter: '0x88cf6cfa51b6f771570f6df450edf1c886212d3e',
|
|
577
|
+
|
|
578
|
+
// pendle
|
|
579
|
+
PendleTokenRedeem: '0x94682544aCC5f4D82ECB1ab97998baa0e428EA0f',
|
|
566
580
|
},
|
|
567
581
|
};
|
|
568
582
|
|