@defisaver/sdk 1.0.23 → 1.0.25
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/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/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 +6 -0
- package/esm/src/actions/curveusd/index.js +6 -0
- package/esm/src/actions/index.d.ts +2 -1
- package/esm/src/actions/index.js +2 -1
- package/esm/src/addresses.d.ts +15 -0
- package/esm/src/addresses.js +6 -0
- package/esm/src/index.d.ts +60 -0
- package/esm/src/types.d.ts +2 -1
- package/esm/src/utils/curveusd-utils.d.ts +15 -0
- package/esm/src/utils/curveusd-utils.js +10 -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/CurveUsdPaybackAction.ts +48 -0
- package/src/actions/curveusd/CurveUsdRepayAction.ts +27 -0
- package/src/actions/curveusd/CurveUsdSupplyAction.ts +44 -0
- package/src/actions/curveusd/CurveUsdWithdrawAction.ts +34 -0
- package/src/actions/curveusd/index.ts +7 -0
- package/src/actions/index.ts +2 -0
- package/src/addresses.ts +7 -0
- package/src/types.ts +2 -1
- package/src/utils/curveusd-utils.ts +13 -0
- package/src/utils/index.ts +2 -0
- package/umd/index.js +333 -40
- 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,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, int256 } from '../../types';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @category CurveUsd
|
|
6
|
+
*/
|
|
7
|
+
export declare class CurveUsdRepayAction extends Action {
|
|
8
|
+
constructor(controllerAddress: EthAddress, collAmount: uint256, to: EthAddress, swapData: int256[]);
|
|
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, swapData) {
|
|
9
|
+
super('CurveUsdRepay', getAddr('CurveUsdRepay'), ['address', 'uint256', 'address', 'uint256[]'], [controllerAddress, collAmount, to, swapData]);
|
|
10
|
+
this.mappableArgs = [
|
|
11
|
+
...this.args,
|
|
12
|
+
];
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -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
|
@@ -141,6 +141,11 @@ export declare const actionAddresses: {
|
|
|
141
141
|
CompV3Supply: string;
|
|
142
142
|
CompV3Transfer: string;
|
|
143
143
|
CompV3Withdraw: string;
|
|
144
|
+
CurveUsdBorrow: string;
|
|
145
|
+
CurveUsdCreate: string;
|
|
146
|
+
CurveUsdPayback: string;
|
|
147
|
+
CurveUsdSupply: string;
|
|
148
|
+
CurveUsdWithdraw: string;
|
|
144
149
|
AaveV3RatioTrigger?: undefined;
|
|
145
150
|
GasFeeTakerL2?: undefined;
|
|
146
151
|
AaveV3RatioCheck?: undefined;
|
|
@@ -288,6 +293,11 @@ export declare const actionAddresses: {
|
|
|
288
293
|
CompV3Supply?: undefined;
|
|
289
294
|
CompV3Transfer?: undefined;
|
|
290
295
|
CompV3Withdraw?: undefined;
|
|
296
|
+
CurveUsdBorrow?: undefined;
|
|
297
|
+
CurveUsdCreate?: undefined;
|
|
298
|
+
CurveUsdPayback?: undefined;
|
|
299
|
+
CurveUsdSupply?: undefined;
|
|
300
|
+
CurveUsdWithdraw?: undefined;
|
|
291
301
|
} | {
|
|
292
302
|
DFSSell: string;
|
|
293
303
|
WrapEth: string;
|
|
@@ -431,6 +441,11 @@ export declare const actionAddresses: {
|
|
|
431
441
|
CompV3Supply?: undefined;
|
|
432
442
|
CompV3Transfer?: undefined;
|
|
433
443
|
CompV3Withdraw?: undefined;
|
|
444
|
+
CurveUsdBorrow?: undefined;
|
|
445
|
+
CurveUsdCreate?: undefined;
|
|
446
|
+
CurveUsdPayback?: undefined;
|
|
447
|
+
CurveUsdSupply?: undefined;
|
|
448
|
+
CurveUsdWithdraw?: undefined;
|
|
434
449
|
AaveV3RatioTrigger?: undefined;
|
|
435
450
|
};
|
|
436
451
|
};
|
package/esm/src/addresses.js
CHANGED
|
@@ -168,6 +168,12 @@ export const actionAddresses = {
|
|
|
168
168
|
CompV3Supply: '0xaF36Eca43bb26468078B8163fe5Bc1fCFc292095',
|
|
169
169
|
CompV3Transfer: '0xeD7450e9C17146476137b77198DFfB17857906c4',
|
|
170
170
|
CompV3Withdraw: '0x0b0F21EDE32DE4243D9145a899E97FC2366Aec46',
|
|
171
|
+
// crvUSD
|
|
172
|
+
CurveUsdBorrow: '0x1BA4D23c1af6a57257bA54DDb9Dbc009941924a6',
|
|
173
|
+
CurveUsdCreate: '0x8Be91C3a8095B7086ea950f4E4AeF16eDe47Df25',
|
|
174
|
+
CurveUsdPayback: '0x9BD581efD76DeC4FA4a71B9e583094874fE1d9Ab',
|
|
175
|
+
CurveUsdSupply: '0x3eA5d08F8f7d6bA52DAa88c47E349125437e0eEA',
|
|
176
|
+
CurveUsdWithdraw: '0xa05Afb6C7f8b7B76B890c0839A4ceC17667Cde29',
|
|
171
177
|
},
|
|
172
178
|
[NETWORKS.optimism.chainId]: {
|
|
173
179
|
DFSSell: '0xC6c601fcAa870efd26C624F8c65fbc54cBe533b1',
|
package/esm/src/index.d.ts
CHANGED
|
@@ -152,6 +152,11 @@ declare const actionAddressesAllChains: {
|
|
|
152
152
|
CompV3Supply: string;
|
|
153
153
|
CompV3Transfer: string;
|
|
154
154
|
CompV3Withdraw: string;
|
|
155
|
+
CurveUsdBorrow: string;
|
|
156
|
+
CurveUsdCreate: string;
|
|
157
|
+
CurveUsdPayback: string;
|
|
158
|
+
CurveUsdSupply: string;
|
|
159
|
+
CurveUsdWithdraw: string;
|
|
155
160
|
AaveV3RatioTrigger?: undefined;
|
|
156
161
|
GasFeeTakerL2?: undefined;
|
|
157
162
|
AaveV3RatioCheck?: undefined;
|
|
@@ -299,6 +304,11 @@ declare const actionAddressesAllChains: {
|
|
|
299
304
|
CompV3Supply?: undefined;
|
|
300
305
|
CompV3Transfer?: undefined;
|
|
301
306
|
CompV3Withdraw?: undefined;
|
|
307
|
+
CurveUsdBorrow?: undefined;
|
|
308
|
+
CurveUsdCreate?: undefined;
|
|
309
|
+
CurveUsdPayback?: undefined;
|
|
310
|
+
CurveUsdSupply?: undefined;
|
|
311
|
+
CurveUsdWithdraw?: undefined;
|
|
302
312
|
} | {
|
|
303
313
|
DFSSell: string;
|
|
304
314
|
WrapEth: string;
|
|
@@ -442,6 +452,11 @@ declare const actionAddressesAllChains: {
|
|
|
442
452
|
CompV3Supply?: undefined;
|
|
443
453
|
CompV3Transfer?: undefined;
|
|
444
454
|
CompV3Withdraw?: undefined;
|
|
455
|
+
CurveUsdBorrow?: undefined;
|
|
456
|
+
CurveUsdCreate?: undefined;
|
|
457
|
+
CurveUsdPayback?: undefined;
|
|
458
|
+
CurveUsdSupply?: undefined;
|
|
459
|
+
CurveUsdWithdraw?: undefined;
|
|
445
460
|
AaveV3RatioTrigger?: undefined;
|
|
446
461
|
};
|
|
447
462
|
};
|
|
@@ -586,6 +601,11 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
586
601
|
CompV3Supply: string;
|
|
587
602
|
CompV3Transfer: string;
|
|
588
603
|
CompV3Withdraw: string;
|
|
604
|
+
CurveUsdBorrow: string;
|
|
605
|
+
CurveUsdCreate: string;
|
|
606
|
+
CurveUsdPayback: string;
|
|
607
|
+
CurveUsdSupply: string;
|
|
608
|
+
CurveUsdWithdraw: string;
|
|
589
609
|
AaveV3RatioTrigger?: undefined;
|
|
590
610
|
GasFeeTakerL2?: undefined;
|
|
591
611
|
AaveV3RatioCheck?: undefined;
|
|
@@ -733,6 +753,11 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
733
753
|
CompV3Supply?: undefined;
|
|
734
754
|
CompV3Transfer?: undefined;
|
|
735
755
|
CompV3Withdraw?: undefined;
|
|
756
|
+
CurveUsdBorrow?: undefined;
|
|
757
|
+
CurveUsdCreate?: undefined;
|
|
758
|
+
CurveUsdPayback?: undefined;
|
|
759
|
+
CurveUsdSupply?: undefined;
|
|
760
|
+
CurveUsdWithdraw?: undefined;
|
|
736
761
|
} | {
|
|
737
762
|
DFSSell: string;
|
|
738
763
|
WrapEth: string;
|
|
@@ -876,6 +901,11 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
876
901
|
CompV3Supply?: undefined;
|
|
877
902
|
CompV3Transfer?: undefined;
|
|
878
903
|
CompV3Withdraw?: undefined;
|
|
904
|
+
CurveUsdBorrow?: undefined;
|
|
905
|
+
CurveUsdCreate?: undefined;
|
|
906
|
+
CurveUsdPayback?: undefined;
|
|
907
|
+
CurveUsdSupply?: undefined;
|
|
908
|
+
CurveUsdWithdraw?: undefined;
|
|
879
909
|
AaveV3RatioTrigger?: undefined;
|
|
880
910
|
};
|
|
881
911
|
declare const otherAddressesAllChains: {
|
|
@@ -1117,6 +1147,11 @@ declare const _default: {
|
|
|
1117
1147
|
CompV3Supply: string;
|
|
1118
1148
|
CompV3Transfer: string;
|
|
1119
1149
|
CompV3Withdraw: string;
|
|
1150
|
+
CurveUsdBorrow: string;
|
|
1151
|
+
CurveUsdCreate: string;
|
|
1152
|
+
CurveUsdPayback: string;
|
|
1153
|
+
CurveUsdSupply: string;
|
|
1154
|
+
CurveUsdWithdraw: string;
|
|
1120
1155
|
AaveV3RatioTrigger?: undefined;
|
|
1121
1156
|
GasFeeTakerL2?: undefined;
|
|
1122
1157
|
AaveV3RatioCheck?: undefined;
|
|
@@ -1264,6 +1299,11 @@ declare const _default: {
|
|
|
1264
1299
|
CompV3Supply?: undefined;
|
|
1265
1300
|
CompV3Transfer?: undefined;
|
|
1266
1301
|
CompV3Withdraw?: undefined;
|
|
1302
|
+
CurveUsdBorrow?: undefined;
|
|
1303
|
+
CurveUsdCreate?: undefined;
|
|
1304
|
+
CurveUsdPayback?: undefined;
|
|
1305
|
+
CurveUsdSupply?: undefined;
|
|
1306
|
+
CurveUsdWithdraw?: undefined;
|
|
1267
1307
|
} | {
|
|
1268
1308
|
DFSSell: string;
|
|
1269
1309
|
WrapEth: string;
|
|
@@ -1407,6 +1447,11 @@ declare const _default: {
|
|
|
1407
1447
|
CompV3Supply?: undefined;
|
|
1408
1448
|
CompV3Transfer?: undefined;
|
|
1409
1449
|
CompV3Withdraw?: undefined;
|
|
1450
|
+
CurveUsdBorrow?: undefined;
|
|
1451
|
+
CurveUsdCreate?: undefined;
|
|
1452
|
+
CurveUsdPayback?: undefined;
|
|
1453
|
+
CurveUsdSupply?: undefined;
|
|
1454
|
+
CurveUsdWithdraw?: undefined;
|
|
1410
1455
|
AaveV3RatioTrigger?: undefined;
|
|
1411
1456
|
};
|
|
1412
1457
|
actionAddressesAllChains: {
|
|
@@ -1551,6 +1596,11 @@ declare const _default: {
|
|
|
1551
1596
|
CompV3Supply: string;
|
|
1552
1597
|
CompV3Transfer: string;
|
|
1553
1598
|
CompV3Withdraw: string;
|
|
1599
|
+
CurveUsdBorrow: string;
|
|
1600
|
+
CurveUsdCreate: string;
|
|
1601
|
+
CurveUsdPayback: string;
|
|
1602
|
+
CurveUsdSupply: string;
|
|
1603
|
+
CurveUsdWithdraw: string;
|
|
1554
1604
|
AaveV3RatioTrigger?: undefined;
|
|
1555
1605
|
GasFeeTakerL2?: undefined;
|
|
1556
1606
|
AaveV3RatioCheck?: undefined;
|
|
@@ -1698,6 +1748,11 @@ declare const _default: {
|
|
|
1698
1748
|
CompV3Supply?: undefined;
|
|
1699
1749
|
CompV3Transfer?: undefined;
|
|
1700
1750
|
CompV3Withdraw?: undefined;
|
|
1751
|
+
CurveUsdBorrow?: undefined;
|
|
1752
|
+
CurveUsdCreate?: undefined;
|
|
1753
|
+
CurveUsdPayback?: undefined;
|
|
1754
|
+
CurveUsdSupply?: undefined;
|
|
1755
|
+
CurveUsdWithdraw?: undefined;
|
|
1701
1756
|
} | {
|
|
1702
1757
|
DFSSell: string;
|
|
1703
1758
|
WrapEth: string;
|
|
@@ -1841,6 +1896,11 @@ declare const _default: {
|
|
|
1841
1896
|
CompV3Supply?: undefined;
|
|
1842
1897
|
CompV3Transfer?: undefined;
|
|
1843
1898
|
CompV3Withdraw?: undefined;
|
|
1899
|
+
CurveUsdBorrow?: undefined;
|
|
1900
|
+
CurveUsdCreate?: undefined;
|
|
1901
|
+
CurveUsdPayback?: undefined;
|
|
1902
|
+
CurveUsdSupply?: undefined;
|
|
1903
|
+
CurveUsdWithdraw?: undefined;
|
|
1844
1904
|
AaveV3RatioTrigger?: undefined;
|
|
1845
1905
|
};
|
|
1846
1906
|
};
|
package/esm/src/types.d.ts
CHANGED
|
@@ -39,5 +39,6 @@ type uint64 = string;
|
|
|
39
39
|
type uint24 = string;
|
|
40
40
|
type uint16 = string;
|
|
41
41
|
type uint8 = string;
|
|
42
|
+
type int256 = string;
|
|
42
43
|
type int24 = string;
|
|
43
|
-
export { AccessList, AccessListItem, AccessLists, Config, Network, Networks, EthAddress, bytes32, bytes, uint256, uint160, uint128, uint80, uint64, uint24, uint16, uint8, int24, };
|
|
44
|
+
export { AccessList, AccessListItem, AccessLists, Config, Network, Networks, EthAddress, bytes32, bytes, uint256, uint160, uint128, uint80, uint64, uint24, uint16, uint8, int256, int24, };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare const curveusdMarkets: {
|
|
2
|
+
sfrxETH: {
|
|
3
|
+
controllerAddress: string;
|
|
4
|
+
debtAvailableBlock: number;
|
|
5
|
+
};
|
|
6
|
+
wstETH: {
|
|
7
|
+
controllerAddress: string;
|
|
8
|
+
debtAvailableBlock: number;
|
|
9
|
+
};
|
|
10
|
+
};
|
|
11
|
+
export declare const controllerToAssetMap: {
|
|
12
|
+
'0x8472a9a7632b173c8cf3a86d3afec50c35548e76': string;
|
|
13
|
+
'0x100dAa78fC509Db39Ef7D04DE0c1ABD299f4C6CE': string;
|
|
14
|
+
};
|
|
15
|
+
export declare const controllerFactoryAddress = "0xC9332fdCB1C491Dcc683bAe86Fe3cb70360738BC";
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// @dev debtAvailableBlock is only used in v3-contracts repo
|
|
2
|
+
export const curveusdMarkets = {
|
|
3
|
+
sfrxETH: { controllerAddress: '0x8472a9a7632b173c8cf3a86d3afec50c35548e76', debtAvailableBlock: 17425859 },
|
|
4
|
+
wstETH: { controllerAddress: '0x100dAa78fC509Db39Ef7D04DE0c1ABD299f4C6CE', debtAvailableBlock: 17487165 },
|
|
5
|
+
};
|
|
6
|
+
export const controllerToAssetMap = {
|
|
7
|
+
'0x8472a9a7632b173c8cf3a86d3afec50c35548e76': '0xac3E018457B222d93114458476f3E3416Abbe38F',
|
|
8
|
+
'0x100dAa78fC509Db39Ef7D04DE0c1ABD299f4C6CE': '0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0',
|
|
9
|
+
};
|
|
10
|
+
export const controllerFactoryAddress = '0xC9332fdCB1C491Dcc683bAe86Fe3cb70360738BC';
|
package/esm/src/utils/index.d.ts
CHANGED
|
@@ -4,4 +4,5 @@ import * as uniswapV3LP from './uniswapV3LP';
|
|
|
4
4
|
import * as convexUtils from './convex-utils';
|
|
5
5
|
import mstableAssetPairs from './mstableAssetPairs';
|
|
6
6
|
import * as curveUtils from './curve-utils';
|
|
7
|
-
|
|
7
|
+
import * as curveusdUtils from './curveusd-utils';
|
|
8
|
+
export { zeroExExchange, uniswapLP, uniswapV3LP, mstableAssetPairs, convexUtils, curveUtils, curveusdUtils, };
|
package/esm/src/utils/index.js
CHANGED
|
@@ -4,4 +4,5 @@ import * as uniswapV3LP from './uniswapV3LP';
|
|
|
4
4
|
import * as convexUtils from './convex-utils';
|
|
5
5
|
import mstableAssetPairs from './mstableAssetPairs';
|
|
6
6
|
import * as curveUtils from './curve-utils';
|
|
7
|
-
|
|
7
|
+
import * as curveusdUtils from './curveusd-utils';
|
|
8
|
+
export { zeroExExchange, uniswapLP, uniswapV3LP, mstableAssetPairs, convexUtils, curveUtils, curveusdUtils, };
|
package/package.json
CHANGED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* CurveUsdBorrowAction - Action that borrows crvUSD from proxy curveusd position
|
|
7
|
+
*
|
|
8
|
+
* @category CurveUsd
|
|
9
|
+
*/
|
|
10
|
+
export class CurveUsdBorrowAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* address controllerAddress - Address of the curveusd market controller
|
|
13
|
+
* address to - Address that will receive the borrowed crvUSD, will default to proxy
|
|
14
|
+
* uint256 debtAmount - Amount of crvUSD to borrow
|
|
15
|
+
*/
|
|
16
|
+
/// @dev debtAmount must be non-zero
|
|
17
|
+
/// @dev if debtAmount == uintMax will borrow as much as the collateral will support
|
|
18
|
+
constructor(
|
|
19
|
+
controllerAddress: EthAddress,
|
|
20
|
+
to: EthAddress,
|
|
21
|
+
debtAmount: uint256,
|
|
22
|
+
) {
|
|
23
|
+
super(
|
|
24
|
+
'CurveUsdBorrow',
|
|
25
|
+
getAddr('CurveUsdBorrow'),
|
|
26
|
+
['address', 'address', 'uint256'],
|
|
27
|
+
[controllerAddress, to, debtAmount],
|
|
28
|
+
);
|
|
29
|
+
|
|
30
|
+
this.mappableArgs = [
|
|
31
|
+
...this.args,
|
|
32
|
+
];
|
|
33
|
+
}
|
|
34
|
+
}
|