@defisaver/sdk 1.0.34 → 1.0.36
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/curveusd/CurveUsdBorrowAction.d.ts +15 -0
- package/esm/src/actions/curveusd/CurveUsdBorrowAction.js +22 -0
- package/esm/src/actions/curveusd/CurveUsdCreateAction.d.ts +22 -0
- package/esm/src/actions/curveusd/CurveUsdCreateAction.js +44 -0
- package/esm/src/actions/curveusd/CurveUsdLevCreateAction.d.ts +9 -0
- package/esm/src/actions/curveusd/CurveUsdLevCreateAction.js +16 -0
- package/esm/src/actions/curveusd/CurveUsdPaybackAction.d.ts +22 -0
- package/esm/src/actions/curveusd/CurveUsdPaybackAction.js +43 -0
- package/esm/src/actions/curveusd/CurveUsdRepayAction.d.ts +9 -0
- package/esm/src/actions/curveusd/CurveUsdRepayAction.js +14 -0
- package/esm/src/actions/curveusd/CurveUsdSelfLiquidateAction.d.ts +19 -0
- package/esm/src/actions/curveusd/CurveUsdSelfLiquidateAction.js +38 -0
- package/esm/src/actions/curveusd/CurveUsdSelfLiquidateWithCollAction.d.ts +9 -0
- package/esm/src/actions/curveusd/CurveUsdSelfLiquidateWithCollAction.js +16 -0
- package/esm/src/actions/curveusd/CurveUsdSupplyAction.d.ts +20 -0
- package/esm/src/actions/curveusd/CurveUsdSupplyAction.js +40 -0
- package/esm/src/actions/curveusd/CurveUsdWithdrawAction.d.ts +15 -0
- package/esm/src/actions/curveusd/CurveUsdWithdrawAction.js +22 -0
- package/esm/src/actions/curveusd/index.d.ts +9 -0
- package/esm/src/actions/curveusd/index.js +9 -0
- package/esm/src/actions/flashloan/FLAction.js +1 -1
- package/esm/src/actions/flashloan/GhoFlashLoanAction.d.ts +15 -0
- package/esm/src/actions/flashloan/GhoFlashLoanAction.js +17 -0
- package/esm/src/actions/flashloan/GhoFlashLoanPaybackAction.d.ts +13 -0
- package/esm/src/actions/flashloan/GhoFlashLoanPaybackAction.js +15 -0
- package/esm/src/actions/flashloan/index.d.ts +2 -0
- package/esm/src/actions/flashloan/index.js +2 -0
- package/esm/src/actions/index.d.ts +2 -1
- package/esm/src/actions/index.js +2 -1
- package/esm/src/addresses.d.ts +35 -0
- package/esm/src/addresses.js +13 -0
- package/esm/src/index.d.ts +140 -0
- package/esm/src/types.d.ts +3 -1
- package/esm/src/utils/curveusd-utils.d.ts +20 -0
- package/esm/src/utils/curveusd-utils.js +12 -0
- package/esm/src/utils/index.d.ts +2 -1
- package/esm/src/utils/index.js +2 -1
- package/package.json +1 -1
- package/src/actions/curveusd/CurveUsdBorrowAction.ts +34 -0
- package/src/actions/curveusd/CurveUsdCreateAction.ts +49 -0
- package/src/actions/curveusd/CurveUsdLevCreateAction.ts +40 -0
- package/src/actions/curveusd/CurveUsdPaybackAction.ts +48 -0
- package/src/actions/curveusd/CurveUsdRepayAction.ts +36 -0
- package/src/actions/curveusd/CurveUsdSelfLiquidateAction.ts +41 -0
- package/src/actions/curveusd/CurveUsdSelfLiquidateWithCollAction.ts +40 -0
- package/src/actions/curveusd/CurveUsdSupplyAction.ts +44 -0
- package/src/actions/curveusd/CurveUsdWithdrawAction.ts +34 -0
- package/src/actions/curveusd/index.ts +10 -0
- package/src/actions/flashloan/FLAction.ts +1 -1
- package/src/actions/flashloan/GhoFlashLoanAction.ts +24 -0
- package/src/actions/flashloan/GhoFlashLoanPaybackAction.ts +17 -0
- package/src/actions/flashloan/index.ts +2 -0
- package/src/actions/index.ts +2 -0
- package/src/addresses.ts +14 -0
- package/src/types.ts +3 -1
- package/src/utils/curveusd-utils.ts +15 -0
- package/src/utils/index.ts +2 -0
- package/umd/index.js +776 -305
- package/yarn-error.log +3976 -0
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* CurveUsdBorrowAction - Action that borrows crvUSD from proxy curveusd position
|
|
5
|
+
*
|
|
6
|
+
* @category CurveUsd
|
|
7
|
+
*/
|
|
8
|
+
export declare class CurveUsdBorrowAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* address controllerAddress - Address of the curveusd market controller
|
|
11
|
+
* address to - Address that will receive the borrowed crvUSD, will default to proxy
|
|
12
|
+
* uint256 debtAmount - Amount of crvUSD to borrow
|
|
13
|
+
*/
|
|
14
|
+
constructor(controllerAddress: EthAddress, to: EthAddress, debtAmount: uint256);
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* CurveUsdBorrowAction - Action that borrows crvUSD from proxy curveusd position
|
|
5
|
+
*
|
|
6
|
+
* @category CurveUsd
|
|
7
|
+
*/
|
|
8
|
+
export class CurveUsdBorrowAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* address controllerAddress - Address of the curveusd market controller
|
|
11
|
+
* address to - Address that will receive the borrowed crvUSD, will default to proxy
|
|
12
|
+
* uint256 debtAmount - Amount of crvUSD to borrow
|
|
13
|
+
*/
|
|
14
|
+
/// @dev debtAmount must be non-zero
|
|
15
|
+
/// @dev if debtAmount == uintMax will borrow as much as the collateral will support
|
|
16
|
+
constructor(controllerAddress, to, debtAmount) {
|
|
17
|
+
super('CurveUsdBorrow', getAddr('CurveUsdBorrow'), ['address', 'address', 'uint256'], [controllerAddress, to, debtAmount]);
|
|
18
|
+
this.mappableArgs = [
|
|
19
|
+
...this.args,
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* CurveUsdCreateAction - Action that creates a curveusd position on behalf of proxy
|
|
5
|
+
*
|
|
6
|
+
* @category CurveUsd
|
|
7
|
+
*/
|
|
8
|
+
export declare class CurveUsdCreateAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* address controllerAddress - Address of the curveusd market controller
|
|
11
|
+
* address from - Address from which to pull collateral asset, will default to proxy
|
|
12
|
+
* address to - Address that will receive the borrowed crvUSD, will default to proxy
|
|
13
|
+
* uint256 collateralAmount - Amount of collateral asset to supply
|
|
14
|
+
* uint256 debtAmount - Amount of crvUSD to borrow
|
|
15
|
+
* uint256 nBands - Number of bands in which the collateral will be supplied
|
|
16
|
+
*/
|
|
17
|
+
constructor(controllerAddress: EthAddress, from: EthAddress, to: EthAddress, collateralAmount: uint256, debtAmount: uint256, nBands: uint256);
|
|
18
|
+
getAssetsToApprove(): Promise<{
|
|
19
|
+
owner: any;
|
|
20
|
+
asset: string;
|
|
21
|
+
}[]>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,44 @@
|
|
|
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 { requireAddress } from '../../utils/general';
|
|
12
|
+
import { getAddr } from '../../addresses';
|
|
13
|
+
import { controllerToAssetMap } from '../../utils/curveusd-utils';
|
|
14
|
+
/**
|
|
15
|
+
* CurveUsdCreateAction - Action that creates a curveusd position on behalf of proxy
|
|
16
|
+
*
|
|
17
|
+
* @category CurveUsd
|
|
18
|
+
*/
|
|
19
|
+
export class CurveUsdCreateAction extends Action {
|
|
20
|
+
/**
|
|
21
|
+
* address controllerAddress - Address of the curveusd market controller
|
|
22
|
+
* address from - Address from which to pull collateral asset, will default to proxy
|
|
23
|
+
* address to - Address that will receive the borrowed crvUSD, will default to proxy
|
|
24
|
+
* uint256 collateralAmount - Amount of collateral asset to supply
|
|
25
|
+
* uint256 debtAmount - Amount of crvUSD to borrow
|
|
26
|
+
* uint256 nBands - Number of bands in which the collateral will be supplied
|
|
27
|
+
*/
|
|
28
|
+
/// @dev both collateralAmount and debtAmount must be non-zero and can be maxUint
|
|
29
|
+
constructor(controllerAddress, from, to, collateralAmount, debtAmount, nBands) {
|
|
30
|
+
requireAddress(to);
|
|
31
|
+
super('CurveUsdCreate', getAddr('CurveUsdCreate'), ['address', 'address', 'address', 'uint256', 'uint256', 'uint256'], [controllerAddress, from, to, collateralAmount, debtAmount, nBands]);
|
|
32
|
+
this.mappableArgs = [
|
|
33
|
+
...this.args,
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
getAssetsToApprove() {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
return [{
|
|
39
|
+
owner: this.args[1],
|
|
40
|
+
asset: controllerToAssetMap[this.args[0]],
|
|
41
|
+
}];
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256, uint32, bytes } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @category CurveUsd
|
|
6
|
+
*/
|
|
7
|
+
export declare class CurveUsdLevCreateAction extends Action {
|
|
8
|
+
constructor(controllerAddress: EthAddress, collateralAmount: uint256, debtAmount: uint256, minAmount: uint256, nBands: uint256, from: EthAddress, additionData: bytes, gasUsed: uint32, dfsFeeDivider: uint32, useSteth: Boolean);
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { requireAddress } from '../../utils/general';
|
|
3
|
+
import { getAddr } from '../../addresses';
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @category CurveUsd
|
|
7
|
+
*/
|
|
8
|
+
export class CurveUsdLevCreateAction extends Action {
|
|
9
|
+
constructor(controllerAddress, collateralAmount, debtAmount, minAmount, nBands, from, additionData, gasUsed, dfsFeeDivider, useSteth) {
|
|
10
|
+
requireAddress(from);
|
|
11
|
+
super('CurveUsdLevCreate', getAddr('CurveUsdLevCreate'), ['address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'bytes', 'uint32', 'uint32', 'bool'], [controllerAddress, collateralAmount, debtAmount, minAmount, nBands, from, additionData, gasUsed, dfsFeeDivider, useSteth]);
|
|
12
|
+
this.mappableArgs = [
|
|
13
|
+
...this.args,
|
|
14
|
+
];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256, int256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* CurveUsdPaybackAction - Action that pays back crvUSD to a curveusd position
|
|
5
|
+
*
|
|
6
|
+
* @category CurveUsd
|
|
7
|
+
*/
|
|
8
|
+
export declare class CurveUsdPaybackAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* address controllerAddress - Address of the curveusd market controller
|
|
11
|
+
* address from - Address from which to pull crvUSD, will default to proxy
|
|
12
|
+
* address onBehalfOf - Address for which we are paying back debt, will default to proxy
|
|
13
|
+
* address to - Address that will receive the crvUSD and collateral asset if close, will default to proxy
|
|
14
|
+
* uint256 debtAmount - Amount of crvUSD to payback
|
|
15
|
+
* int256 maxActiveBand - Don't allow active band to be higher than this (to prevent front-running the repay)
|
|
16
|
+
*/
|
|
17
|
+
constructor(controllerAddress: EthAddress, from: EthAddress, onBehalfOf: EthAddress, to: EthAddress, debtAmount: uint256, maxActiveBand: int256);
|
|
18
|
+
getAssetsToApprove(): Promise<{
|
|
19
|
+
owner: any;
|
|
20
|
+
asset: string;
|
|
21
|
+
}[]>;
|
|
22
|
+
}
|
|
@@ -0,0 +1,43 @@
|
|
|
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
|
+
* CurveUsdPaybackAction - Action that pays back crvUSD to a curveusd position
|
|
15
|
+
*
|
|
16
|
+
* @category CurveUsd
|
|
17
|
+
*/
|
|
18
|
+
export class CurveUsdPaybackAction extends Action {
|
|
19
|
+
/**
|
|
20
|
+
* address controllerAddress - Address of the curveusd market controller
|
|
21
|
+
* address from - Address from which to pull crvUSD, will default to proxy
|
|
22
|
+
* address onBehalfOf - Address for which we are paying back debt, will default to proxy
|
|
23
|
+
* address to - Address that will receive the crvUSD and collateral asset if close, will default to proxy
|
|
24
|
+
* uint256 debtAmount - Amount of crvUSD to payback
|
|
25
|
+
* int256 maxActiveBand - Don't allow active band to be higher than this (to prevent front-running the repay)
|
|
26
|
+
*/
|
|
27
|
+
/// @dev debtAmount must be non-zero
|
|
28
|
+
/// @dev if debtAmount >= debt will repay whole debt and close the position, transfering collateral
|
|
29
|
+
constructor(controllerAddress, from, onBehalfOf, to, debtAmount, maxActiveBand) {
|
|
30
|
+
super('CurveUsdPayback', getAddr('CurveUsdPayback'), ['address', 'address', 'address', 'address', 'uint256', 'int256'], [controllerAddress, from, onBehalfOf, to, debtAmount, maxActiveBand]);
|
|
31
|
+
this.mappableArgs = [
|
|
32
|
+
...this.args,
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
getAssetsToApprove() {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
return [{
|
|
38
|
+
owner: this.args[1],
|
|
39
|
+
asset: getAssetInfo('crvUSD').address,
|
|
40
|
+
}];
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256, uint32, bytes } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @category CurveUsd
|
|
6
|
+
*/
|
|
7
|
+
export declare class CurveUsdRepayAction extends Action {
|
|
8
|
+
constructor(controllerAddress: EthAddress, collAmount: uint256, to: EthAddress, minAmount: uint256, additionData: bytes, gasUsed: uint32, dfsFeeDivider: uint32, useSteth: Boolean);
|
|
9
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @category CurveUsd
|
|
6
|
+
*/
|
|
7
|
+
export class CurveUsdRepayAction extends Action {
|
|
8
|
+
constructor(controllerAddress, collAmount, to, minAmount, additionData, gasUsed, dfsFeeDivider, useSteth) {
|
|
9
|
+
super('CurveUsdRepay', getAddr('CurveUsdRepay'), ['address', 'uint256', 'address', 'uint256', 'bytes', 'uint32', 'uint32', 'bool'], [controllerAddress, collAmount, to, minAmount, additionData, gasUsed, dfsFeeDivider, useSteth]);
|
|
10
|
+
this.mappableArgs = [
|
|
11
|
+
...this.args,
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @category CurveUsd
|
|
6
|
+
*/
|
|
7
|
+
export declare class CurveUsdSelfLiquidateAction extends Action {
|
|
8
|
+
/**
|
|
9
|
+
@param controllerAddress Address of the curveusd market controller
|
|
10
|
+
@param minCrvUsdExpected Minimum amount of crvUsd as collateral for the user to have
|
|
11
|
+
@param from Address from which to pull crvUSD if needed
|
|
12
|
+
@param to Address that will receive the crvUSD and collateral asset
|
|
13
|
+
*/
|
|
14
|
+
constructor(controllerAddress: EthAddress, minCrvUsdExpected: uint256, from: EthAddress, to: EthAddress);
|
|
15
|
+
getAssetsToApprove(): Promise<{
|
|
16
|
+
owner: any;
|
|
17
|
+
asset: string;
|
|
18
|
+
}[]>;
|
|
19
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
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
|
+
*
|
|
15
|
+
* @category CurveUsd
|
|
16
|
+
*/
|
|
17
|
+
export class CurveUsdSelfLiquidateAction extends Action {
|
|
18
|
+
/**
|
|
19
|
+
@param controllerAddress Address of the curveusd market controller
|
|
20
|
+
@param minCrvUsdExpected Minimum amount of crvUsd as collateral for the user to have
|
|
21
|
+
@param from Address from which to pull crvUSD if needed
|
|
22
|
+
@param to Address that will receive the crvUSD and collateral asset
|
|
23
|
+
*/
|
|
24
|
+
constructor(controllerAddress, minCrvUsdExpected, from, to) {
|
|
25
|
+
super('CurveUsdSelfLiquidate', getAddr('CurveUsdSelfLiquidate'), ['address', 'uint256', 'address', 'address'], [controllerAddress, minCrvUsdExpected, from, to]);
|
|
26
|
+
this.mappableArgs = [
|
|
27
|
+
...this.args,
|
|
28
|
+
];
|
|
29
|
+
}
|
|
30
|
+
getAssetsToApprove() {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
return [{
|
|
33
|
+
owner: this.args[1],
|
|
34
|
+
asset: getAssetInfo('crvUSD').address,
|
|
35
|
+
}];
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256, uint32, bytes } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @category CurveUsd
|
|
6
|
+
*/
|
|
7
|
+
export declare class CurveUsdSelfLiquidateWithCollAction extends Action {
|
|
8
|
+
constructor(controllerAddress: EthAddress, percentage: uint256, minCrvUsdExpected: uint256, swapAmount: uint256, minAmount: uint256, to: EthAddress, additionData: bytes, gasUsed: uint32, dfsFeeDivider: uint32, useSteth: Boolean);
|
|
9
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { requireAddress } from '../../utils/general';
|
|
3
|
+
import { getAddr } from '../../addresses';
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* @category CurveUsd
|
|
7
|
+
*/
|
|
8
|
+
export class CurveUsdSelfLiquidateWithCollAction extends Action {
|
|
9
|
+
constructor(controllerAddress, percentage, minCrvUsdExpected, swapAmount, minAmount, to, additionData, gasUsed, dfsFeeDivider, useSteth) {
|
|
10
|
+
requireAddress(to);
|
|
11
|
+
super('CurveUsdSelfLiquidateWithColl', getAddr('CurveUsdSelfLiquidateWithColl'), ['address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'bytes', 'uint32', 'uint32', 'bool'], [controllerAddress, percentage, minCrvUsdExpected, swapAmount, minAmount, to, additionData, gasUsed, dfsFeeDivider, useSteth]);
|
|
12
|
+
this.mappableArgs = [
|
|
13
|
+
...this.args,
|
|
14
|
+
];
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* CurveUsdSupplyAction - Action that supplies collateral to a curveusd position
|
|
5
|
+
*
|
|
6
|
+
* @category CurveUsd
|
|
7
|
+
*/
|
|
8
|
+
export declare class CurveUsdSupplyAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* address controllerAddress - Address of the curveusd market controller
|
|
11
|
+
* address from - Address from which to pull collateral asset, will default to proxy
|
|
12
|
+
* address onBehalfOf - Address for which we are supplying, will default to proxy
|
|
13
|
+
* uint256 collateralAmount - Amount of collateral asset to supply
|
|
14
|
+
*/
|
|
15
|
+
constructor(controllerAddress: EthAddress, from: EthAddress, onBehalfOf: EthAddress, collateralAmount: uint256);
|
|
16
|
+
getAssetsToApprove(): Promise<{
|
|
17
|
+
owner: any;
|
|
18
|
+
asset: string;
|
|
19
|
+
}[]>;
|
|
20
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
import { controllerToAssetMap } from '../../utils/curveusd-utils';
|
|
13
|
+
/**
|
|
14
|
+
* CurveUsdSupplyAction - Action that supplies collateral to a curveusd position
|
|
15
|
+
*
|
|
16
|
+
* @category CurveUsd
|
|
17
|
+
*/
|
|
18
|
+
export class CurveUsdSupplyAction extends Action {
|
|
19
|
+
/**
|
|
20
|
+
* address controllerAddress - Address of the curveusd market controller
|
|
21
|
+
* address from - Address from which to pull collateral asset, will default to proxy
|
|
22
|
+
* address onBehalfOf - Address for which we are supplying, will default to proxy
|
|
23
|
+
* uint256 collateralAmount - Amount of collateral asset to supply
|
|
24
|
+
*/
|
|
25
|
+
/// @dev collateralAmount must be non-zero, can be maxUint
|
|
26
|
+
constructor(controllerAddress, from, onBehalfOf, collateralAmount) {
|
|
27
|
+
super('CurveUsdSupply', getAddr('CurveUsdSupply'), ['address', 'address', 'address', 'uint256'], [controllerAddress, from, onBehalfOf, collateralAmount]);
|
|
28
|
+
this.mappableArgs = [
|
|
29
|
+
...this.args,
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
getAssetsToApprove() {
|
|
33
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
34
|
+
return [{
|
|
35
|
+
owner: this.args[1],
|
|
36
|
+
asset: controllerToAssetMap[this.args[0]],
|
|
37
|
+
}];
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* CurveUsdWithdrawAction - Action that withdraws collateral from proxy curveusd position
|
|
5
|
+
*
|
|
6
|
+
* @category CurveUsd
|
|
7
|
+
*/
|
|
8
|
+
export declare class CurveUsdWithdrawAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* address controllerAddress - Address of the curveusd market controller
|
|
11
|
+
* address to - Address that will receive the withdrawn collateral, will default to proxy
|
|
12
|
+
* uint256 collateralAmount - Amount of collateral to withdraw
|
|
13
|
+
*/
|
|
14
|
+
constructor(controllerAddress: EthAddress, to: EthAddress, collateralAmount: uint256);
|
|
15
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* CurveUsdWithdrawAction - Action that withdraws collateral from proxy curveusd position
|
|
5
|
+
*
|
|
6
|
+
* @category CurveUsd
|
|
7
|
+
*/
|
|
8
|
+
export class CurveUsdWithdrawAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* address controllerAddress - Address of the curveusd market controller
|
|
11
|
+
* address to - Address that will receive the withdrawn collateral, will default to proxy
|
|
12
|
+
* uint256 collateralAmount - Amount of collateral to withdraw
|
|
13
|
+
*/
|
|
14
|
+
/// @dev collateralAmount must be non-zero
|
|
15
|
+
/// @dev if collateralAmount == uintMax will withdraw as much as the debt will allow
|
|
16
|
+
constructor(controllerAddress, to, collateralAmount) {
|
|
17
|
+
super('CurveUsdWithdraw', getAddr('CurveUsdWithdraw'), ['address', 'address', 'uint256'], [controllerAddress, to, collateralAmount]);
|
|
18
|
+
this.mappableArgs = [
|
|
19
|
+
...this.args,
|
|
20
|
+
];
|
|
21
|
+
}
|
|
22
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './CurveUsdCreateAction';
|
|
2
|
+
export * from './CurveUsdSupplyAction';
|
|
3
|
+
export * from './CurveUsdWithdrawAction';
|
|
4
|
+
export * from './CurveUsdBorrowAction';
|
|
5
|
+
export * from './CurveUsdPaybackAction';
|
|
6
|
+
export * from './CurveUsdRepayAction';
|
|
7
|
+
export * from './CurveUsdSelfLiquidateAction';
|
|
8
|
+
export * from './CurveUsdLevCreateAction';
|
|
9
|
+
export * from './CurveUsdSelfLiquidateWithCollAction';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export * from './CurveUsdCreateAction';
|
|
2
|
+
export * from './CurveUsdSupplyAction';
|
|
3
|
+
export * from './CurveUsdWithdrawAction';
|
|
4
|
+
export * from './CurveUsdBorrowAction';
|
|
5
|
+
export * from './CurveUsdPaybackAction';
|
|
6
|
+
export * from './CurveUsdRepayAction';
|
|
7
|
+
export * from './CurveUsdSelfLiquidateAction';
|
|
8
|
+
export * from './CurveUsdLevCreateAction';
|
|
9
|
+
export * from './CurveUsdSelfLiquidateWithCollAction';
|
|
@@ -41,7 +41,7 @@ _FLAction_instances = new WeakSet(), _FLAction_handleArgs = function _FLAction_h
|
|
|
41
41
|
if (specificFLAction.constructor.name === 'MakerFlashLoanAction') {
|
|
42
42
|
argsToReturn[5] = [4];
|
|
43
43
|
}
|
|
44
|
-
if (specificFLAction.constructor.name === '
|
|
44
|
+
if (specificFLAction.constructor.name === 'AaveV3FlashLoanAction') {
|
|
45
45
|
argsToReturn[5] = [5];
|
|
46
46
|
}
|
|
47
47
|
return argsToReturn;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { EthAddress, uint256, bytes } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Gets a GHO flashloan from GHO Flash Minter
|
|
5
|
+
*
|
|
6
|
+
* @category Flashloans
|
|
7
|
+
*/
|
|
8
|
+
export declare class GhoFlashLoanAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param amount
|
|
11
|
+
* @param flParamGetterAddr
|
|
12
|
+
* @param flParamGetterData
|
|
13
|
+
*/
|
|
14
|
+
constructor(amount: uint256, flParamGetterAddr?: EthAddress, flParamGetterData?: bytes);
|
|
15
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* Gets a GHO flashloan from GHO Flash Minter
|
|
5
|
+
*
|
|
6
|
+
* @category Flashloans
|
|
7
|
+
*/
|
|
8
|
+
export class GhoFlashLoanAction extends Action {
|
|
9
|
+
/**
|
|
10
|
+
* @param amount
|
|
11
|
+
* @param flParamGetterAddr
|
|
12
|
+
* @param flParamGetterData
|
|
13
|
+
*/
|
|
14
|
+
constructor(amount, flParamGetterAddr = getAddr('Empty'), flParamGetterData = []) {
|
|
15
|
+
super('FLGho', getAddr('FLGho'), ['address[]', 'uint256[]', 'uint256[]', 'address', 'address', 'bytes', 'bytes'], [[], [amount], [], getAddr('Empty'), flParamGetterAddr, flParamGetterData, []]);
|
|
16
|
+
}
|
|
17
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SendTokenAction } from '../basic';
|
|
2
|
+
import { uint256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
* Pays back a flashloan from GHO
|
|
5
|
+
*
|
|
6
|
+
* @category Flashloans
|
|
7
|
+
*/
|
|
8
|
+
export declare class GhoFlashLoanPaybackAction extends SendTokenAction {
|
|
9
|
+
/**
|
|
10
|
+
* @param loanAmount
|
|
11
|
+
*/
|
|
12
|
+
constructor(loanAmount: uint256);
|
|
13
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { SendTokenAction } from '../basic';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
/**
|
|
4
|
+
* Pays back a flashloan from GHO
|
|
5
|
+
*
|
|
6
|
+
* @category Flashloans
|
|
7
|
+
*/
|
|
8
|
+
export class GhoFlashLoanPaybackAction extends SendTokenAction {
|
|
9
|
+
/**
|
|
10
|
+
* @param loanAmount
|
|
11
|
+
*/
|
|
12
|
+
constructor(loanAmount) {
|
|
13
|
+
super(getAddr('GHO'), getAddr('FLGho'), loanAmount);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -23,4 +23,5 @@ import * as chickenBonds from './chickenBonds';
|
|
|
23
23
|
import * as compoundV3 from './compoundV3';
|
|
24
24
|
import * as morpho from './morpho';
|
|
25
25
|
import * as bprotocol from './bprotocol';
|
|
26
|
-
|
|
26
|
+
import * as curveusd from './curveusd';
|
|
27
|
+
export { aave, maker, compound, basic, flashloan, uniswap, reflexer, dydx, uniswapV3, checkers, liquity, yearn, lido, insta, balancer, curve, guni, mstable, rari, aaveV3, convex, chickenBonds, compoundV3, morpho, bprotocol, curveusd, };
|
package/esm/src/actions/index.js
CHANGED
|
@@ -23,4 +23,5 @@ import * as chickenBonds from './chickenBonds';
|
|
|
23
23
|
import * as compoundV3 from './compoundV3';
|
|
24
24
|
import * as morpho from './morpho';
|
|
25
25
|
import * as bprotocol from './bprotocol';
|
|
26
|
-
|
|
26
|
+
import * as curveusd from './curveusd';
|
|
27
|
+
export { aave, maker, compound, basic, flashloan, uniswap, reflexer, dydx, uniswapV3, checkers, liquity, yearn, lido, insta, balancer, curve, guni, mstable, rari, aaveV3, convex, chickenBonds, compoundV3, morpho, bprotocol, curveusd, };
|
package/esm/src/addresses.d.ts
CHANGED
|
@@ -74,6 +74,7 @@ export declare const actionAddresses: {
|
|
|
74
74
|
FLBalancer: string;
|
|
75
75
|
FLAction: string;
|
|
76
76
|
FLUniV3: string;
|
|
77
|
+
FLGho: string;
|
|
77
78
|
UniSupply: string;
|
|
78
79
|
UniWithdraw: string;
|
|
79
80
|
UniCollectV3: string;
|
|
@@ -143,6 +144,16 @@ export declare const actionAddresses: {
|
|
|
143
144
|
CompV3Supply: string;
|
|
144
145
|
CompV3Transfer: string;
|
|
145
146
|
CompV3Withdraw: string;
|
|
147
|
+
CurveUsdBorrow: string;
|
|
148
|
+
CurveUsdCreate: string;
|
|
149
|
+
CurveUsdPayback: string;
|
|
150
|
+
CurveUsdSupply: string;
|
|
151
|
+
CurveUsdWithdraw: string;
|
|
152
|
+
CurveUsdLevCreate: string;
|
|
153
|
+
CurveUsdRepay: string;
|
|
154
|
+
CurveUsdSwapper: string;
|
|
155
|
+
CurveUsdSelfLiquidate: string;
|
|
156
|
+
CurveUsdSelfLiquidateWithColl: string;
|
|
146
157
|
AaveV3RatioTrigger?: undefined;
|
|
147
158
|
GasFeeTakerL2?: undefined;
|
|
148
159
|
AaveV3RatioCheck?: undefined;
|
|
@@ -228,6 +239,7 @@ export declare const actionAddresses: {
|
|
|
228
239
|
FLDyDx?: undefined;
|
|
229
240
|
FLMaker?: undefined;
|
|
230
241
|
FLUniV3?: undefined;
|
|
242
|
+
FLGho?: undefined;
|
|
231
243
|
UniSupply?: undefined;
|
|
232
244
|
UniWithdraw?: undefined;
|
|
233
245
|
DyDxWithdraw?: undefined;
|
|
@@ -292,6 +304,16 @@ export declare const actionAddresses: {
|
|
|
292
304
|
CompV3Supply?: undefined;
|
|
293
305
|
CompV3Transfer?: undefined;
|
|
294
306
|
CompV3Withdraw?: undefined;
|
|
307
|
+
CurveUsdBorrow?: undefined;
|
|
308
|
+
CurveUsdCreate?: undefined;
|
|
309
|
+
CurveUsdPayback?: undefined;
|
|
310
|
+
CurveUsdSupply?: undefined;
|
|
311
|
+
CurveUsdWithdraw?: undefined;
|
|
312
|
+
CurveUsdLevCreate?: undefined;
|
|
313
|
+
CurveUsdRepay?: undefined;
|
|
314
|
+
CurveUsdSwapper?: undefined;
|
|
315
|
+
CurveUsdSelfLiquidate?: undefined;
|
|
316
|
+
CurveUsdSelfLiquidateWithColl?: undefined;
|
|
295
317
|
} | {
|
|
296
318
|
DFSSell: string;
|
|
297
319
|
WrapEth: string;
|
|
@@ -373,6 +395,7 @@ export declare const actionAddresses: {
|
|
|
373
395
|
FLDyDx?: undefined;
|
|
374
396
|
FLMaker?: undefined;
|
|
375
397
|
FLUniV3?: undefined;
|
|
398
|
+
FLGho?: undefined;
|
|
376
399
|
UniSupply?: undefined;
|
|
377
400
|
UniWithdraw?: undefined;
|
|
378
401
|
DyDxWithdraw?: undefined;
|
|
@@ -437,6 +460,16 @@ export declare const actionAddresses: {
|
|
|
437
460
|
CompV3Supply?: undefined;
|
|
438
461
|
CompV3Transfer?: undefined;
|
|
439
462
|
CompV3Withdraw?: undefined;
|
|
463
|
+
CurveUsdBorrow?: undefined;
|
|
464
|
+
CurveUsdCreate?: undefined;
|
|
465
|
+
CurveUsdPayback?: undefined;
|
|
466
|
+
CurveUsdSupply?: undefined;
|
|
467
|
+
CurveUsdWithdraw?: undefined;
|
|
468
|
+
CurveUsdLevCreate?: undefined;
|
|
469
|
+
CurveUsdRepay?: undefined;
|
|
470
|
+
CurveUsdSwapper?: undefined;
|
|
471
|
+
CurveUsdSelfLiquidate?: undefined;
|
|
472
|
+
CurveUsdSelfLiquidateWithColl?: undefined;
|
|
440
473
|
AaveV3RatioTrigger?: undefined;
|
|
441
474
|
};
|
|
442
475
|
};
|
|
@@ -455,6 +488,7 @@ export declare const otherAddresses: {
|
|
|
455
488
|
CrvToken: string;
|
|
456
489
|
CvxToken: string;
|
|
457
490
|
DAI: string;
|
|
491
|
+
GHO: string;
|
|
458
492
|
LUSD: string;
|
|
459
493
|
BLUSD: string;
|
|
460
494
|
Empty: string;
|
|
@@ -479,6 +513,7 @@ export declare const otherAddresses: {
|
|
|
479
513
|
CrvToken?: undefined;
|
|
480
514
|
CvxToken?: undefined;
|
|
481
515
|
DAI?: undefined;
|
|
516
|
+
GHO?: undefined;
|
|
482
517
|
LUSD?: undefined;
|
|
483
518
|
BLUSD?: undefined;
|
|
484
519
|
};
|