@defisaver/sdk 1.2.15-dev-allocator-2 → 1.2.16-dev-liquity-v2-1
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/basic/SendTokensAction.d.ts +1 -1
- package/esm/src/actions/basic/SendTokensAction.js +1 -1
- package/esm/src/actions/basic/SendTokensAndUnwrapAction.d.ts +15 -0
- package/esm/src/actions/basic/SendTokensAndUnwrapAction.js +31 -0
- package/esm/src/actions/basic/index.d.ts +1 -0
- package/esm/src/actions/basic/index.js +1 -0
- package/esm/src/actions/checkers/LiquityV2RatioCheckAction.d.ts +16 -0
- package/esm/src/actions/checkers/LiquityV2RatioCheckAction.js +24 -0
- package/esm/src/actions/checkers/index.d.ts +1 -0
- package/esm/src/actions/checkers/index.js +1 -0
- package/esm/src/actions/index.d.ts +2 -1
- package/esm/src/actions/index.js +2 -1
- package/esm/src/actions/liquityV2/LiquityV2AdjustAction.d.ts +21 -0
- package/esm/src/actions/liquityV2/LiquityV2AdjustAction.js +54 -0
- package/esm/src/actions/liquityV2/LiquityV2AdjustInterestRateAction.d.ts +18 -0
- package/esm/src/actions/liquityV2/LiquityV2AdjustInterestRateAction.js +42 -0
- package/esm/src/actions/liquityV2/LiquityV2AdjustZombieTroveAction.d.ts +23 -0
- package/esm/src/actions/liquityV2/LiquityV2AdjustZombieTroveAction.js +62 -0
- package/esm/src/actions/liquityV2/LiquityV2BorrowAction.d.ts +17 -0
- package/esm/src/actions/liquityV2/LiquityV2BorrowAction.js +38 -0
- package/esm/src/actions/liquityV2/LiquityV2ClaimAction.d.ts +14 -0
- package/esm/src/actions/liquityV2/LiquityV2ClaimAction.js +26 -0
- package/esm/src/actions/liquityV2/LiquityV2CloseAction.d.ts +20 -0
- package/esm/src/actions/liquityV2/LiquityV2CloseAction.js +49 -0
- package/esm/src/actions/liquityV2/LiquityV2OpenAction.d.ts +29 -0
- package/esm/src/actions/liquityV2/LiquityV2OpenAction.js +86 -0
- package/esm/src/actions/liquityV2/LiquityV2PaybackAction.d.ts +20 -0
- package/esm/src/actions/liquityV2/LiquityV2PaybackAction.js +49 -0
- package/esm/src/actions/liquityV2/LiquityV2SPClaimCollAction.d.ts +14 -0
- package/esm/src/actions/liquityV2/LiquityV2SPClaimCollAction.js +26 -0
- package/esm/src/actions/liquityV2/LiquityV2SPDepositAction.d.ts +22 -0
- package/esm/src/actions/liquityV2/LiquityV2SPDepositAction.js +57 -0
- package/esm/src/actions/liquityV2/LiquityV2SPWithdrawAction.d.ts +17 -0
- package/esm/src/actions/liquityV2/LiquityV2SPWithdrawAction.js +38 -0
- package/esm/src/actions/liquityV2/LiquityV2SupplyAction.d.ts +22 -0
- package/esm/src/actions/liquityV2/LiquityV2SupplyAction.js +50 -0
- package/esm/src/actions/liquityV2/LiquityV2WithdrawAction.d.ts +16 -0
- package/esm/src/actions/liquityV2/LiquityV2WithdrawAction.js +34 -0
- package/esm/src/actions/liquityV2/index.d.ts +13 -0
- package/esm/src/actions/liquityV2/index.js +13 -0
- package/esm/src/actions/morpho-blue/MorphoBlueReallocateLiquidityAction.js +1 -1
- package/esm/src/addresses.d.ts +54 -2
- package/esm/src/addresses.js +16 -0
- package/esm/src/index.d.ts +216 -8
- package/esm/src/triggers/ClosePriceTrigger.d.ts +10 -0
- package/esm/src/triggers/ClosePriceTrigger.js +12 -0
- package/esm/src/triggers/LiquityRatioTrigger.js +1 -1
- package/esm/src/triggers/LiquityV2RatioTrigger.d.ts +8 -0
- package/esm/src/triggers/LiquityV2RatioTrigger.js +10 -0
- package/esm/src/triggers/index.d.ts +2 -0
- package/esm/src/triggers/index.js +2 -0
- package/package.json +2 -2
- package/src/actions/basic/SendTokensAction.ts +1 -1
- package/src/actions/basic/SendTokensAndUnwrapAction.ts +38 -0
- package/src/actions/basic/index.ts +2 -1
- package/src/actions/checkers/LiquityV2RatioCheckAction.ts +32 -0
- package/src/actions/checkers/index.ts +2 -1
- package/src/actions/index.ts +2 -0
- package/src/actions/liquityV2/LiquityV2AdjustAction.ts +73 -0
- package/src/actions/liquityV2/LiquityV2AdjustInterestRateAction.ts +57 -0
- package/src/actions/liquityV2/LiquityV2AdjustZombieTroveAction.ts +82 -0
- package/src/actions/liquityV2/LiquityV2BorrowAction.ts +52 -0
- package/src/actions/liquityV2/LiquityV2ClaimAction.ts +37 -0
- package/src/actions/liquityV2/LiquityV2CloseAction.ts +53 -0
- package/src/actions/liquityV2/LiquityV2OpenAction.ts +101 -0
- package/src/actions/liquityV2/LiquityV2PaybackAction.ts +52 -0
- package/src/actions/liquityV2/LiquityV2SPClaimCollAction.ts +37 -0
- package/src/actions/liquityV2/LiquityV2SPDepositAction.ts +62 -0
- package/src/actions/liquityV2/LiquityV2SPWithdrawAction.ts +52 -0
- package/src/actions/liquityV2/LiquityV2SupplyAction.ts +57 -0
- package/src/actions/liquityV2/LiquityV2WithdrawAction.ts +47 -0
- package/src/actions/liquityV2/index.ts +13 -0
- package/src/actions/morpho-blue/MorphoBlueReallocateLiquidityAction.ts +1 -1
- package/src/addresses.ts +18 -0
- package/src/triggers/ClosePriceTrigger.ts +19 -0
- package/src/triggers/LiquityRatioTrigger.ts +1 -1
- package/src/triggers/LiquityV2RatioTrigger.ts +17 -0
- package/src/triggers/index.ts +2 -0
- package/test/actions/basic/SendTokensAndUnwrapAction.js +73 -0
- package/umd/index.js +1261 -571
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { getAssetInfo } from '@defisaver/tokens';
|
|
11
|
+
import { Action } from '../../Action';
|
|
12
|
+
import { getAddr } from '../../addresses';
|
|
13
|
+
/**
|
|
14
|
+
* LiquityV2OpenAction - Opens up a trove
|
|
15
|
+
*
|
|
16
|
+
* @category LiquityV2
|
|
17
|
+
*/
|
|
18
|
+
export class LiquityV2OpenAction extends Action {
|
|
19
|
+
/**
|
|
20
|
+
* @param market liquity address registry for the market
|
|
21
|
+
* @param from address from which to take the collateralToken and WETH gas compensation
|
|
22
|
+
* @param to address to which to send the borrowed BOLD
|
|
23
|
+
* @param collToken address of the collateral token
|
|
24
|
+
* @param interestBatchManager address of the interest batch manager, or address(0) if this trove will not be part of a batch
|
|
25
|
+
* @param ownerIndex owner index of the trove
|
|
26
|
+
* @param collAmount collateral amount
|
|
27
|
+
* @param boldAmount borrowed BOLD amount
|
|
28
|
+
* @param upperHint upper hint for the trove insertion
|
|
29
|
+
* @param lowerHint lower hint for the trove insertion
|
|
30
|
+
* @param annualInterestRate annual interest rate for the trove or 0 if trove will be part of a batch
|
|
31
|
+
* @param maxUpfrontFee maximum upfront fee user is willing to pay
|
|
32
|
+
*/
|
|
33
|
+
constructor(market, from, to, collToken, interestBatchManager, ownerIndex, collAmount, boldAmount, upperHint, lowerHint, annualInterestRate, maxUpfrontFee) {
|
|
34
|
+
super('LiquityV2Open', getAddr('LiquityV2Open'), [
|
|
35
|
+
'address',
|
|
36
|
+
'address',
|
|
37
|
+
'address',
|
|
38
|
+
'address',
|
|
39
|
+
'uint256',
|
|
40
|
+
'uint256',
|
|
41
|
+
'uint256',
|
|
42
|
+
'uint256',
|
|
43
|
+
'uint256',
|
|
44
|
+
'uint256',
|
|
45
|
+
'uint256',
|
|
46
|
+
], [
|
|
47
|
+
market,
|
|
48
|
+
from,
|
|
49
|
+
to,
|
|
50
|
+
interestBatchManager,
|
|
51
|
+
ownerIndex,
|
|
52
|
+
collAmount,
|
|
53
|
+
boldAmount,
|
|
54
|
+
upperHint,
|
|
55
|
+
lowerHint,
|
|
56
|
+
annualInterestRate,
|
|
57
|
+
maxUpfrontFee,
|
|
58
|
+
]);
|
|
59
|
+
this.mappableArgs = [
|
|
60
|
+
this.args[0],
|
|
61
|
+
this.args[1],
|
|
62
|
+
this.args[2],
|
|
63
|
+
this.args[3],
|
|
64
|
+
this.args[4],
|
|
65
|
+
this.args[5],
|
|
66
|
+
this.args[6],
|
|
67
|
+
this.args[7],
|
|
68
|
+
this.args[8],
|
|
69
|
+
this.args[9],
|
|
70
|
+
this.args[10],
|
|
71
|
+
];
|
|
72
|
+
this.tokenForApproval = collToken;
|
|
73
|
+
}
|
|
74
|
+
getAssetsToApprove() {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
const wethToken = getAssetInfo('WETH').address;
|
|
77
|
+
if (this.tokenForApproval.toLocaleLowerCase() === wethToken.toLocaleLowerCase()) {
|
|
78
|
+
return [{ asset: wethToken, owner: this.args[1] }];
|
|
79
|
+
}
|
|
80
|
+
return [
|
|
81
|
+
{ asset: wethToken, owner: this.args[1] },
|
|
82
|
+
{ asset: this.tokenForApproval, owner: this.args[1] },
|
|
83
|
+
];
|
|
84
|
+
});
|
|
85
|
+
}
|
|
86
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2PaybackAction - Pays back BOLD to a trove
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityV2PaybackAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param from address from which to take the BOLD for payback
|
|
12
|
+
* @param troveId id of the trove to pay back to
|
|
13
|
+
* @param amount BOLD amount to pay back
|
|
14
|
+
*/
|
|
15
|
+
constructor(market: EthAddress, from: EthAddress, troveId: uint256, amount: uint256);
|
|
16
|
+
getAssetsToApprove(): Promise<{
|
|
17
|
+
asset: string;
|
|
18
|
+
owner: any;
|
|
19
|
+
}[]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { getAssetInfo } from '@defisaver/tokens';
|
|
11
|
+
import { Action } from '../../Action';
|
|
12
|
+
import { getAddr } from '../../addresses';
|
|
13
|
+
/**
|
|
14
|
+
* LiquityV2PaybackAction - Pays back BOLD to a trove
|
|
15
|
+
*
|
|
16
|
+
* @category LiquityV2
|
|
17
|
+
*/
|
|
18
|
+
export class LiquityV2PaybackAction extends Action {
|
|
19
|
+
/**
|
|
20
|
+
* @param market liquity address registry for the market
|
|
21
|
+
* @param from address from which to take the BOLD for payback
|
|
22
|
+
* @param troveId id of the trove to pay back to
|
|
23
|
+
* @param amount BOLD amount to pay back
|
|
24
|
+
*/
|
|
25
|
+
constructor(market, from, troveId, amount) {
|
|
26
|
+
super('LiquityV2Payback', getAddr('LiquityV2Payback'), [
|
|
27
|
+
'address',
|
|
28
|
+
'address',
|
|
29
|
+
'uint256',
|
|
30
|
+
'uint256',
|
|
31
|
+
], [
|
|
32
|
+
market,
|
|
33
|
+
from,
|
|
34
|
+
troveId,
|
|
35
|
+
amount,
|
|
36
|
+
]);
|
|
37
|
+
this.mappableArgs = [
|
|
38
|
+
this.args[0],
|
|
39
|
+
this.args[1],
|
|
40
|
+
this.args[2],
|
|
41
|
+
this.args[3],
|
|
42
|
+
];
|
|
43
|
+
}
|
|
44
|
+
getAssetsToApprove() {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
return [{ asset: getAssetInfo('BOLD').address, owner: this.args[1] }];
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2SPClaimCollAction - Claims remaining collateral gains for a user with no deposit
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityV2SPClaimCollAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param to address to which to send the claimed collateral gains
|
|
12
|
+
*/
|
|
13
|
+
constructor(market: EthAddress, to: EthAddress);
|
|
14
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2SPClaimCollAction - Claims remaining collateral gains for a user with no deposit
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export class LiquityV2SPClaimCollAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param to address to which to send the claimed collateral gains
|
|
12
|
+
*/
|
|
13
|
+
constructor(market, to) {
|
|
14
|
+
super('LiquityV2SPClaimColl', getAddr('LiquityV2SPClaimColl'), [
|
|
15
|
+
'address',
|
|
16
|
+
'address',
|
|
17
|
+
], [
|
|
18
|
+
market,
|
|
19
|
+
to,
|
|
20
|
+
]);
|
|
21
|
+
this.mappableArgs = [
|
|
22
|
+
this.args[0],
|
|
23
|
+
this.args[1],
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2SPDepositAction - Deposits into the Stability Pool (SP) and optionally claims gains
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityV2SPDepositAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param from address from which to take the deposited BOLD
|
|
12
|
+
* @param boldGainTo address to send any claimed BOLD gains
|
|
13
|
+
* @param collGainTo address to send any claimed collateral gains
|
|
14
|
+
* @param amount BOLD amount to deposit into the Stability Pool
|
|
15
|
+
* @param doClaim whether to claim BOLD and collateral gains before depositing
|
|
16
|
+
*/
|
|
17
|
+
constructor(market: EthAddress, from: EthAddress, boldGainTo: EthAddress, collGainTo: EthAddress, amount: uint256, doClaim: boolean);
|
|
18
|
+
getAssetsToApprove(): Promise<{
|
|
19
|
+
asset: string;
|
|
20
|
+
owner: any;
|
|
21
|
+
}[]>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { getAssetInfo } from '@defisaver/tokens';
|
|
11
|
+
import { Action } from '../../Action';
|
|
12
|
+
import { getAddr } from '../../addresses';
|
|
13
|
+
/**
|
|
14
|
+
* LiquityV2SPDepositAction - Deposits into the Stability Pool (SP) and optionally claims gains
|
|
15
|
+
*
|
|
16
|
+
* @category LiquityV2
|
|
17
|
+
*/
|
|
18
|
+
export class LiquityV2SPDepositAction extends Action {
|
|
19
|
+
/**
|
|
20
|
+
* @param market liquity address registry for the market
|
|
21
|
+
* @param from address from which to take the deposited BOLD
|
|
22
|
+
* @param boldGainTo address to send any claimed BOLD gains
|
|
23
|
+
* @param collGainTo address to send any claimed collateral gains
|
|
24
|
+
* @param amount BOLD amount to deposit into the Stability Pool
|
|
25
|
+
* @param doClaim whether to claim BOLD and collateral gains before depositing
|
|
26
|
+
*/
|
|
27
|
+
constructor(market, from, boldGainTo, collGainTo, amount, doClaim) {
|
|
28
|
+
super('LiquityV2SPDeposit', getAddr('LiquityV2SPDeposit'), [
|
|
29
|
+
'address',
|
|
30
|
+
'address',
|
|
31
|
+
'address',
|
|
32
|
+
'address',
|
|
33
|
+
'uint256',
|
|
34
|
+
'bool',
|
|
35
|
+
], [
|
|
36
|
+
market,
|
|
37
|
+
from,
|
|
38
|
+
boldGainTo,
|
|
39
|
+
collGainTo,
|
|
40
|
+
amount,
|
|
41
|
+
doClaim,
|
|
42
|
+
]);
|
|
43
|
+
this.mappableArgs = [
|
|
44
|
+
this.args[0],
|
|
45
|
+
this.args[1],
|
|
46
|
+
this.args[2],
|
|
47
|
+
this.args[3],
|
|
48
|
+
this.args[4],
|
|
49
|
+
this.args[5],
|
|
50
|
+
];
|
|
51
|
+
}
|
|
52
|
+
getAssetsToApprove() {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
return [{ asset: getAssetInfo('BOLD').address, owner: this.args[1] }];
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2SPWithdrawAction - Withdraws from the Stability Pool (SP) and optionally claims gains
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityV2SPWithdrawAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param boldTo address to send any withdrawn BOLD
|
|
12
|
+
* @param collGainTo address to send any claimed collateral gains
|
|
13
|
+
* @param amount BOLD amount to withdraw from the Stability Pool
|
|
14
|
+
* @param doClaim whether to claim BOLD and collateral gains before withdrawing
|
|
15
|
+
*/
|
|
16
|
+
constructor(market: EthAddress, boldTo: EthAddress, collGainTo: EthAddress, amount: uint256, doClaim: boolean);
|
|
17
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2SPWithdrawAction - Withdraws from the Stability Pool (SP) and optionally claims gains
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export class LiquityV2SPWithdrawAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param boldTo address to send any withdrawn BOLD
|
|
12
|
+
* @param collGainTo address to send any claimed collateral gains
|
|
13
|
+
* @param amount BOLD amount to withdraw from the Stability Pool
|
|
14
|
+
* @param doClaim whether to claim BOLD and collateral gains before withdrawing
|
|
15
|
+
*/
|
|
16
|
+
constructor(market, boldTo, collGainTo, amount, doClaim) {
|
|
17
|
+
super('LiquityV2SPWithdraw', getAddr('LiquityV2SPWithdraw'), [
|
|
18
|
+
'address',
|
|
19
|
+
'address',
|
|
20
|
+
'address',
|
|
21
|
+
'uint256',
|
|
22
|
+
'bool',
|
|
23
|
+
], [
|
|
24
|
+
market,
|
|
25
|
+
boldTo,
|
|
26
|
+
collGainTo,
|
|
27
|
+
amount,
|
|
28
|
+
doClaim,
|
|
29
|
+
]);
|
|
30
|
+
this.mappableArgs = [
|
|
31
|
+
this.args[0],
|
|
32
|
+
this.args[1],
|
|
33
|
+
this.args[2],
|
|
34
|
+
this.args[3],
|
|
35
|
+
this.args[4],
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2SupplyAction - Supplies collateral to a trove
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityV2SupplyAction extends Action {
|
|
9
|
+
tokenForApproval: EthAddress;
|
|
10
|
+
/**
|
|
11
|
+
* @param market liquity address registry for the market
|
|
12
|
+
* @param from address from which to take the collateral
|
|
13
|
+
* @param collToken address of the collateral token
|
|
14
|
+
* @param troveId id of the trove to supply collateral to
|
|
15
|
+
* @param amount collateral amount to supply
|
|
16
|
+
*/
|
|
17
|
+
constructor(market: EthAddress, from: EthAddress, collToken: EthAddress, troveId: uint256, amount: uint256);
|
|
18
|
+
getAssetsToApprove(): Promise<{
|
|
19
|
+
asset: string;
|
|
20
|
+
owner: any;
|
|
21
|
+
}[]>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
2
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
3
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
4
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
5
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
6
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
7
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
import { Action } from '../../Action';
|
|
11
|
+
import { getAddr } from '../../addresses';
|
|
12
|
+
/**
|
|
13
|
+
* LiquityV2SupplyAction - Supplies collateral to a trove
|
|
14
|
+
*
|
|
15
|
+
* @category LiquityV2
|
|
16
|
+
*/
|
|
17
|
+
export class LiquityV2SupplyAction extends Action {
|
|
18
|
+
/**
|
|
19
|
+
* @param market liquity address registry for the market
|
|
20
|
+
* @param from address from which to take the collateral
|
|
21
|
+
* @param collToken address of the collateral token
|
|
22
|
+
* @param troveId id of the trove to supply collateral to
|
|
23
|
+
* @param amount collateral amount to supply
|
|
24
|
+
*/
|
|
25
|
+
constructor(market, from, collToken, troveId, amount) {
|
|
26
|
+
super('LiquityV2Supply', getAddr('LiquityV2Supply'), [
|
|
27
|
+
'address',
|
|
28
|
+
'address',
|
|
29
|
+
'uint256',
|
|
30
|
+
'uint256',
|
|
31
|
+
], [
|
|
32
|
+
market,
|
|
33
|
+
from,
|
|
34
|
+
troveId,
|
|
35
|
+
amount,
|
|
36
|
+
]);
|
|
37
|
+
this.mappableArgs = [
|
|
38
|
+
this.args[0],
|
|
39
|
+
this.args[1],
|
|
40
|
+
this.args[2],
|
|
41
|
+
this.args[3],
|
|
42
|
+
];
|
|
43
|
+
this.tokenForApproval = collToken;
|
|
44
|
+
}
|
|
45
|
+
getAssetsToApprove() {
|
|
46
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
47
|
+
return [{ asset: this.tokenForApproval, owner: this.args[1] }];
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2WithdrawAction - Withdraws collateral from a trove
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export declare class LiquityV2WithdrawAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param to address to which to send the withdrawn collateral
|
|
12
|
+
* @param troveId id of the trove to withdraw from
|
|
13
|
+
* @param amount collateral amount to withdraw
|
|
14
|
+
*/
|
|
15
|
+
constructor(market: EthAddress, to: EthAddress, troveId: uint256, amount: uint256);
|
|
16
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* LiquityV2WithdrawAction - Withdraws collateral from a trove
|
|
5
|
+
*
|
|
6
|
+
* @category LiquityV2
|
|
7
|
+
*/
|
|
8
|
+
export class LiquityV2WithdrawAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param market liquity address registry for the market
|
|
11
|
+
* @param to address to which to send the withdrawn collateral
|
|
12
|
+
* @param troveId id of the trove to withdraw from
|
|
13
|
+
* @param amount collateral amount to withdraw
|
|
14
|
+
*/
|
|
15
|
+
constructor(market, to, troveId, amount) {
|
|
16
|
+
super('LiquityV2Withdraw', getAddr('LiquityV2Withdraw'), [
|
|
17
|
+
'address',
|
|
18
|
+
'address',
|
|
19
|
+
'uint256',
|
|
20
|
+
'uint256',
|
|
21
|
+
], [
|
|
22
|
+
market,
|
|
23
|
+
to,
|
|
24
|
+
troveId,
|
|
25
|
+
amount,
|
|
26
|
+
]);
|
|
27
|
+
this.mappableArgs = [
|
|
28
|
+
this.args[0],
|
|
29
|
+
this.args[1],
|
|
30
|
+
this.args[2],
|
|
31
|
+
this.args[3],
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './LiquityV2OpenAction';
|
|
2
|
+
export * from './LiquityV2CloseAction';
|
|
3
|
+
export * from './LiquityV2BorrowAction';
|
|
4
|
+
export * from './LiquityV2PaybackAction';
|
|
5
|
+
export * from './LiquityV2SupplyAction';
|
|
6
|
+
export * from './LiquityV2WithdrawAction';
|
|
7
|
+
export * from './LiquityV2SPDepositAction';
|
|
8
|
+
export * from './LiquityV2SPWithdrawAction';
|
|
9
|
+
export * from './LiquityV2SPClaimCollAction';
|
|
10
|
+
export * from './LiquityV2AdjustAction';
|
|
11
|
+
export * from './LiquityV2ClaimAction';
|
|
12
|
+
export * from './LiquityV2AdjustInterestRateAction';
|
|
13
|
+
export * from './LiquityV2AdjustZombieTroveAction';
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './LiquityV2OpenAction';
|
|
2
|
+
export * from './LiquityV2CloseAction';
|
|
3
|
+
export * from './LiquityV2BorrowAction';
|
|
4
|
+
export * from './LiquityV2PaybackAction';
|
|
5
|
+
export * from './LiquityV2SupplyAction';
|
|
6
|
+
export * from './LiquityV2WithdrawAction';
|
|
7
|
+
export * from './LiquityV2SPDepositAction';
|
|
8
|
+
export * from './LiquityV2SPWithdrawAction';
|
|
9
|
+
export * from './LiquityV2SPClaimCollAction';
|
|
10
|
+
export * from './LiquityV2AdjustAction';
|
|
11
|
+
export * from './LiquityV2ClaimAction';
|
|
12
|
+
export * from './LiquityV2AdjustInterestRateAction';
|
|
13
|
+
export * from './LiquityV2AdjustZombieTroveAction';
|
|
@@ -25,7 +25,7 @@ export class MorphoBlueReallocateLiquidityAction extends Action {
|
|
|
25
25
|
* @param withdrawals - Array of withdrawals for each vault
|
|
26
26
|
*/
|
|
27
27
|
constructor(loanToken, collateralToken, oracle, irm, lltv, vaults, withdrawals) {
|
|
28
|
-
super('MorphoBlueReallocateLiquidity', getAddr('
|
|
28
|
+
super('MorphoBlueReallocateLiquidity', getAddr('MorphoBlueReallocateLiquidity'), [
|
|
29
29
|
['address', 'address', 'address', 'address', 'uint256'],
|
|
30
30
|
'address[]',
|
|
31
31
|
'tuple(tuple(address,address,address,address,uint256),uint256)[][]', // withdrawals
|
package/esm/src/addresses.d.ts
CHANGED
|
@@ -137,6 +137,19 @@ export declare const actionAddresses: {
|
|
|
137
137
|
LiquityClaim: string;
|
|
138
138
|
LiquityRedeem: string;
|
|
139
139
|
LiquityAdjust: string;
|
|
140
|
+
LiquityV2Open: string;
|
|
141
|
+
LiquityV2Close: string;
|
|
142
|
+
LiquityV2Supply: string;
|
|
143
|
+
LiquityV2Withdraw: string;
|
|
144
|
+
LiquityV2Borrow: string;
|
|
145
|
+
LiquityV2Payback: string;
|
|
146
|
+
LiquityV2Claim: string;
|
|
147
|
+
LiquityV2Adjust: string;
|
|
148
|
+
LiquityV2AdjustInterestRate: string;
|
|
149
|
+
LiquityV2SPDeposit: string;
|
|
150
|
+
LiquityV2SPWithdraw: string;
|
|
151
|
+
LiquityV2SPClaimColl: string;
|
|
152
|
+
LiquityV2AdjustZombieTrove: string;
|
|
140
153
|
BprotocolLiquitySPDeposit: string;
|
|
141
154
|
BprotocolLiquitySPWithdraw: string;
|
|
142
155
|
LidoStake: string;
|
|
@@ -385,6 +398,19 @@ export declare const actionAddresses: {
|
|
|
385
398
|
LiquityClaim?: undefined;
|
|
386
399
|
LiquityRedeem?: undefined;
|
|
387
400
|
LiquityAdjust?: undefined;
|
|
401
|
+
LiquityV2Open?: undefined;
|
|
402
|
+
LiquityV2Close?: undefined;
|
|
403
|
+
LiquityV2Supply?: undefined;
|
|
404
|
+
LiquityV2Withdraw?: undefined;
|
|
405
|
+
LiquityV2Borrow?: undefined;
|
|
406
|
+
LiquityV2Payback?: undefined;
|
|
407
|
+
LiquityV2Claim?: undefined;
|
|
408
|
+
LiquityV2Adjust?: undefined;
|
|
409
|
+
LiquityV2AdjustInterestRate?: undefined;
|
|
410
|
+
LiquityV2SPDeposit?: undefined;
|
|
411
|
+
LiquityV2SPWithdraw?: undefined;
|
|
412
|
+
LiquityV2SPClaimColl?: undefined;
|
|
413
|
+
LiquityV2AdjustZombieTrove?: undefined;
|
|
388
414
|
BprotocolLiquitySPDeposit?: undefined;
|
|
389
415
|
BprotocolLiquitySPWithdraw?: undefined;
|
|
390
416
|
LidoStake?: undefined;
|
|
@@ -631,6 +657,19 @@ export declare const actionAddresses: {
|
|
|
631
657
|
LiquityClaim?: undefined;
|
|
632
658
|
LiquityRedeem?: undefined;
|
|
633
659
|
LiquityAdjust?: undefined;
|
|
660
|
+
LiquityV2Open?: undefined;
|
|
661
|
+
LiquityV2Close?: undefined;
|
|
662
|
+
LiquityV2Supply?: undefined;
|
|
663
|
+
LiquityV2Withdraw?: undefined;
|
|
664
|
+
LiquityV2Borrow?: undefined;
|
|
665
|
+
LiquityV2Payback?: undefined;
|
|
666
|
+
LiquityV2Claim?: undefined;
|
|
667
|
+
LiquityV2Adjust?: undefined;
|
|
668
|
+
LiquityV2AdjustInterestRate?: undefined;
|
|
669
|
+
LiquityV2SPDeposit?: undefined;
|
|
670
|
+
LiquityV2SPWithdraw?: undefined;
|
|
671
|
+
LiquityV2SPClaimColl?: undefined;
|
|
672
|
+
LiquityV2AdjustZombieTrove?: undefined;
|
|
634
673
|
BprotocolLiquitySPDeposit?: undefined;
|
|
635
674
|
BprotocolLiquitySPWithdraw?: undefined;
|
|
636
675
|
LidoStake?: undefined;
|
|
@@ -728,6 +767,7 @@ export declare const actionAddresses: {
|
|
|
728
767
|
CreateSub: string;
|
|
729
768
|
UpdateSub: string;
|
|
730
769
|
MerklClaim: string;
|
|
770
|
+
GasFeeTakerL2: string;
|
|
731
771
|
FLAaveV3: string;
|
|
732
772
|
FLBalancer: string;
|
|
733
773
|
FLUniV3: string;
|
|
@@ -760,6 +800,7 @@ export declare const actionAddresses: {
|
|
|
760
800
|
MorphoBlueSetAuth: string;
|
|
761
801
|
MorphoBlueSetAuthWithSig: string;
|
|
762
802
|
MorphoBlueView: string;
|
|
803
|
+
MorphoBlueReallocateLiquidity: string;
|
|
763
804
|
AutomationV2Unsub?: undefined;
|
|
764
805
|
SendTokenAndUnwrap?: undefined;
|
|
765
806
|
TransferNFT?: undefined;
|
|
@@ -865,6 +906,19 @@ export declare const actionAddresses: {
|
|
|
865
906
|
LiquityClaim?: undefined;
|
|
866
907
|
LiquityRedeem?: undefined;
|
|
867
908
|
LiquityAdjust?: undefined;
|
|
909
|
+
LiquityV2Open?: undefined;
|
|
910
|
+
LiquityV2Close?: undefined;
|
|
911
|
+
LiquityV2Supply?: undefined;
|
|
912
|
+
LiquityV2Withdraw?: undefined;
|
|
913
|
+
LiquityV2Borrow?: undefined;
|
|
914
|
+
LiquityV2Payback?: undefined;
|
|
915
|
+
LiquityV2Claim?: undefined;
|
|
916
|
+
LiquityV2Adjust?: undefined;
|
|
917
|
+
LiquityV2AdjustInterestRate?: undefined;
|
|
918
|
+
LiquityV2SPDeposit?: undefined;
|
|
919
|
+
LiquityV2SPWithdraw?: undefined;
|
|
920
|
+
LiquityV2SPClaimColl?: undefined;
|
|
921
|
+
LiquityV2AdjustZombieTrove?: undefined;
|
|
868
922
|
BprotocolLiquitySPDeposit?: undefined;
|
|
869
923
|
BprotocolLiquitySPWithdraw?: undefined;
|
|
870
924
|
LidoStake?: undefined;
|
|
@@ -922,7 +976,6 @@ export declare const actionAddresses: {
|
|
|
922
976
|
CurveUsdLevCreateTransient?: undefined;
|
|
923
977
|
CurveUsdRepayTransient?: undefined;
|
|
924
978
|
MorphoTokenWrap?: undefined;
|
|
925
|
-
MorphoBlueReallocateLiquidity?: undefined;
|
|
926
979
|
LlamaLendCreate?: undefined;
|
|
927
980
|
LlamaLendSupply?: undefined;
|
|
928
981
|
LlamaLendBorrow?: undefined;
|
|
@@ -946,7 +999,6 @@ export declare const actionAddresses: {
|
|
|
946
999
|
EtherFiUnwrap?: undefined;
|
|
947
1000
|
AaveV3DelegateCredit?: undefined;
|
|
948
1001
|
AaveV3RatioTrigger?: undefined;
|
|
949
|
-
GasFeeTakerL2?: undefined;
|
|
950
1002
|
AaveV3RatioCheck?: undefined;
|
|
951
1003
|
};
|
|
952
1004
|
};
|
package/esm/src/addresses.js
CHANGED
|
@@ -156,6 +156,20 @@ export const actionAddresses = {
|
|
|
156
156
|
LiquityClaim: '0x526735aDcBe5c9059275c5ED2E0574b4a24b875e',
|
|
157
157
|
LiquityRedeem: '0x20B78854658011394C931EF2BF3cEEA2Fe62E7f0',
|
|
158
158
|
LiquityAdjust: '0x0A398f6B97677192A5d5e7Ea8A937383FFf9304c',
|
|
159
|
+
// liquity v2
|
|
160
|
+
LiquityV2Open: '0x270A0C7eBd1C0a98FdA613782b51419300AB6322',
|
|
161
|
+
LiquityV2Close: '0xC6C627c63389D8bB7913b55CD62fa451703AD1E1',
|
|
162
|
+
LiquityV2Supply: '0x6e31Dd331571209043c8CF997f86b4291F648537',
|
|
163
|
+
LiquityV2Withdraw: '0x561013c605A17f5dC5b738C8a3fF9c5F33DbC3d8',
|
|
164
|
+
LiquityV2Borrow: '0x26C39FE05466dBA72A98d095d019dC5e067F6b28',
|
|
165
|
+
LiquityV2Payback: '0x3B1D0bD618fF8F8c51B11CD676c3384CB2A36C64',
|
|
166
|
+
LiquityV2Claim: '0xb3d3dFf3d68539F6a1bb51e56B7dC8d515aE8978',
|
|
167
|
+
LiquityV2Adjust: '0x57d6228b5EfC44174701704629A0F3EEa2c25E7f',
|
|
168
|
+
LiquityV2AdjustInterestRate: '0x3EFf4EEC06bd75941025fb751407A5de5F456bC6',
|
|
169
|
+
LiquityV2SPDeposit: '0x1e533364fE613AaD64B8D46F7A096Ae0c722239D',
|
|
170
|
+
LiquityV2SPWithdraw: '0xb080DC160415Ffe1a4b80d75b0Be92EE38a0b426',
|
|
171
|
+
LiquityV2SPClaimColl: '0xD50B0295C69e3F77BE7d99e7BdeAc442F37b373b',
|
|
172
|
+
LiquityV2AdjustZombieTrove: '0x457d4969d73FfCb656AF9002703EB4B33504dEFF',
|
|
159
173
|
// b.protocol
|
|
160
174
|
BprotocolLiquitySPDeposit: '0x5A0436c7559e37da8cD24B0f66C155a0a2fd6309',
|
|
161
175
|
BprotocolLiquitySPWithdraw: '0x20Ece7CB4463bB1DbA4C4fA800E321A05dfB028B',
|
|
@@ -400,6 +414,7 @@ export const actionAddresses = {
|
|
|
400
414
|
CreateSub: '0xeE739937085A716477BCB5b01b0f74e1BE046645',
|
|
401
415
|
UpdateSub: '0x1601c6ABCDE6e6d8Ad96628AFe20d47908127Aea',
|
|
402
416
|
MerklClaim: '0xa2c6cd875c52bf5c27516fae3b6ba9241790908a',
|
|
417
|
+
GasFeeTakerL2: '0xAEe02caf404332c40Fd7FF8d5c25F91f7c1641d0',
|
|
403
418
|
// Flashloan
|
|
404
419
|
FLAaveV3: '0x79Eb9cEe432Cd3e7b09A9eFdB21A733A6d7b4c3A',
|
|
405
420
|
FLBalancer: '0x862E533198C9656B75bB6A5dDF0953F7ED5E8507',
|
|
@@ -436,6 +451,7 @@ export const actionAddresses = {
|
|
|
436
451
|
MorphoBlueSetAuth: '0xb565630c6ddd1fae169c453667f5aa52ef4e2e39',
|
|
437
452
|
MorphoBlueSetAuthWithSig: '0x80be65342f6172a6cd0b6a2653e8a887e3f46cab',
|
|
438
453
|
MorphoBlueView: '0xdbcacf59c5063da8b15481f88e7d70e13c92f2a1',
|
|
454
|
+
MorphoBlueReallocateLiquidity: '0x5Ea7F30E40F6A25BE2aD23A6FC1C31A6c95F3dc8',
|
|
439
455
|
},
|
|
440
456
|
};
|
|
441
457
|
export const otherAddresses = {
|