@defisaver/sdk 1.3.27-midnight-dev → 1.3.27

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.
Files changed (55) hide show
  1. package/esm/src/Action.js +5 -23
  2. package/esm/src/actions/aaveV3/AaveV3DelegateCredit.d.ts +1 -1
  3. package/esm/src/actions/aaveV3/AaveV3DelegateCredit.js +1 -1
  4. package/esm/src/actions/etherfi/EtherFiStakeFromLidoAction.d.ts +20 -0
  5. package/esm/src/actions/etherfi/EtherFiStakeFromLidoAction.js +41 -0
  6. package/esm/src/actions/etherfi/index.d.ts +1 -0
  7. package/esm/src/actions/etherfi/index.js +1 -0
  8. package/esm/src/actions/flashloan/AaveV3FlashLoanAction.d.ts +1 -1
  9. package/esm/src/actions/flashloan/AaveV3FlashLoanAction.js +1 -1
  10. package/esm/src/actions/flashloan/AaveV3FlashLoanCarryDebtAction.d.ts +2 -4
  11. package/esm/src/actions/flashloan/AaveV3FlashLoanCarryDebtAction.js +6 -12
  12. package/esm/src/actions/flashloan/AaveV3FlashLoanNoFeeAction.d.ts +1 -1
  13. package/esm/src/actions/flashloan/AaveV3FlashLoanNoFeeAction.js +1 -1
  14. package/esm/src/actions/index.d.ts +1 -2
  15. package/esm/src/actions/index.js +1 -2
  16. package/esm/src/actions/uniswap/UniswapClaimAction.d.ts +16 -0
  17. package/esm/src/actions/uniswap/UniswapClaimAction.js +23 -0
  18. package/esm/src/actions/uniswap/index.d.ts +1 -0
  19. package/esm/src/actions/uniswap/index.js +1 -0
  20. package/esm/src/addresses.d.ts +20 -44
  21. package/esm/src/addresses.js +14 -10
  22. package/esm/src/index.d.ts +80 -176
  23. package/package.json +1 -1
  24. package/src/Action.ts +5 -21
  25. package/src/actions/aaveV3/AaveV3DelegateCredit.ts +1 -1
  26. package/src/actions/etherfi/EtherFiStakeFromLidoAction.ts +38 -0
  27. package/src/actions/etherfi/index.ts +2 -1
  28. package/src/actions/flashloan/AaveV3FlashLoanAction.ts +1 -1
  29. package/src/actions/flashloan/AaveV3FlashLoanCarryDebtAction.ts +7 -13
  30. package/src/actions/flashloan/AaveV3FlashLoanNoFeeAction.ts +1 -1
  31. package/src/actions/index.ts +0 -2
  32. package/src/actions/uniswap/UniswapClaimAction.ts +31 -0
  33. package/src/actions/uniswap/index.ts +2 -1
  34. package/src/addresses.ts +14 -11
  35. package/test/actions/etherFi/EtherFiStakeFromLidoAction.js +40 -0
  36. package/test/actions/uniswap/UniswapClaimAction.js +31 -0
  37. package/umd/index.js +781 -900
  38. package/esm/src/actions/midnight/MidnightBorrowFromOrdersAction.d.ts +0 -18
  39. package/esm/src/actions/midnight/MidnightBorrowFromOrdersAction.js +0 -28
  40. package/esm/src/actions/midnight/MidnightPaybackDirectAction.d.ts +0 -16
  41. package/esm/src/actions/midnight/MidnightPaybackDirectAction.js +0 -24
  42. package/esm/src/actions/midnight/MidnightPaybackFromOrdersAction.d.ts +0 -18
  43. package/esm/src/actions/midnight/MidnightPaybackFromOrdersAction.js +0 -28
  44. package/esm/src/actions/midnight/MidnightSupplyCollateralAction.d.ts +0 -17
  45. package/esm/src/actions/midnight/MidnightSupplyCollateralAction.js +0 -26
  46. package/esm/src/actions/midnight/MidnightWithdrawCollateralAction.d.ts +0 -17
  47. package/esm/src/actions/midnight/MidnightWithdrawCollateralAction.js +0 -26
  48. package/esm/src/actions/midnight/index.d.ts +0 -5
  49. package/esm/src/actions/midnight/index.js +0 -5
  50. package/src/actions/midnight/MidnightBorrowFromOrdersAction.ts +0 -44
  51. package/src/actions/midnight/MidnightPaybackDirectAction.ts +0 -36
  52. package/src/actions/midnight/MidnightPaybackFromOrdersAction.ts +0 -44
  53. package/src/actions/midnight/MidnightSupplyCollateralAction.ts +0 -39
  54. package/src/actions/midnight/MidnightWithdrawCollateralAction.ts +0 -39
  55. package/src/actions/midnight/index.ts +0 -5
@@ -1,18 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { EthAddress, bytes32, uint256 } from '../../types';
3
- /**
4
- * MidnightBorrowFromOrdersAction - Borrow from one or more Midnight offers.
5
- *
6
- * @category MidnightBorrowFromOrders
7
- */
8
- export declare class MidnightBorrowFromOrdersAction extends Action {
9
- /**
10
- * @param marketId Market id.
11
- * @param onBehalf Address to borrow tokens on behalf of. Defaults to the user's wallet if not provided.
12
- * @param to Address to send the borrowed tokens to.
13
- * @param amount Amount of tokens to borrow.
14
- * @param maxUnits Maximum number of units to take from the orders (slippage protection).
15
- * @param offerFills Array of offer fills to borrow from.
16
- */
17
- constructor(marketId: bytes32, onBehalf: EthAddress, to: EthAddress, amount: uint256, maxUnits: uint256, offerFills: Array<any>);
18
- }
@@ -1,28 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- const offerFillsParamType = 'tuple(tuple(tuple(uint256,address,address,tuple(address,uint256,uint256,address)[],uint256,uint256,address,address),bool,address,uint256,uint256,uint256,bytes32,address,bytes,address,address,bool,uint128,uint128,uint256),bytes,uint256)[]';
4
- /**
5
- * MidnightBorrowFromOrdersAction - Borrow from one or more Midnight offers.
6
- *
7
- * @category MidnightBorrowFromOrders
8
- */
9
- export class MidnightBorrowFromOrdersAction extends Action {
10
- /**
11
- * @param marketId Market id.
12
- * @param onBehalf Address to borrow tokens on behalf of. Defaults to the user's wallet if not provided.
13
- * @param to Address to send the borrowed tokens to.
14
- * @param amount Amount of tokens to borrow.
15
- * @param maxUnits Maximum number of units to take from the orders (slippage protection).
16
- * @param offerFills Array of offer fills to borrow from.
17
- */
18
- constructor(marketId, onBehalf, to, amount, maxUnits, offerFills) {
19
- super('MidnightBorrowFromOrders', getAddr('MidnightBorrowFromOrders'), ['bytes32', 'address', 'address', 'uint256', 'uint256', offerFillsParamType], [marketId, onBehalf, to, amount, maxUnits, offerFills]);
20
- this.mappableArgs = [
21
- this.args[0],
22
- this.args[1],
23
- this.args[2],
24
- this.args[3],
25
- this.args[4],
26
- ];
27
- }
28
- }
@@ -1,16 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { EthAddress, bytes32, uint256 } from '../../types';
3
- /**
4
- * MidnightPaybackDirectAction - Payback a debt directly to the Midnight protocol.
5
- *
6
- * @category MidnightPaybackDirect
7
- */
8
- export declare class MidnightPaybackDirectAction extends Action {
9
- /**
10
- * @param marketId Market id.
11
- * @param onBehalf Address to payback tokens on behalf of.
12
- * @param from Address from which to pull the payback tokens.
13
- * @param amount Amount of tokens to payback. Send type(uint).max to payback whole amount.
14
- */
15
- constructor(marketId: bytes32, onBehalf: EthAddress, from: EthAddress, amount: uint256);
16
- }
@@ -1,24 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- /**
4
- * MidnightPaybackDirectAction - Payback a debt directly to the Midnight protocol.
5
- *
6
- * @category MidnightPaybackDirect
7
- */
8
- export class MidnightPaybackDirectAction extends Action {
9
- /**
10
- * @param marketId Market id.
11
- * @param onBehalf Address to payback tokens on behalf of.
12
- * @param from Address from which to pull the payback tokens.
13
- * @param amount Amount of tokens to payback. Send type(uint).max to payback whole amount.
14
- */
15
- constructor(marketId, onBehalf, from, amount) {
16
- super('MidnightPaybackDirect', getAddr('MidnightPaybackDirect'), ['bytes32', 'address', 'address', 'uint256'], [marketId, onBehalf, from, amount]);
17
- this.mappableArgs = [
18
- this.args[0],
19
- this.args[1],
20
- this.args[2],
21
- this.args[3],
22
- ];
23
- }
24
- }
@@ -1,18 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { EthAddress, bytes32, uint256 } from '../../types';
3
- /**
4
- * MidnightPaybackFromOrdersAction - Pay back debt through one or more Midnight offers.
5
- *
6
- * @category MidnightPaybackFromOrders
7
- */
8
- export declare class MidnightPaybackFromOrdersAction extends Action {
9
- /**
10
- * @param marketId Market id.
11
- * @param onBehalf Address whose debt is repaid. Defaults to the user's wallet if not provided.
12
- * @param from Address from which to pull the payback tokens.
13
- * @param amount Amount of tokens to spend. Send type(uint).max to pay back the whole debt.
14
- * @param minUnits Minimum number of debt units to repay (slippage protection).
15
- * @param offerFills Array of offer fills to pay back from.
16
- */
17
- constructor(marketId: bytes32, onBehalf: EthAddress, from: EthAddress, amount: uint256, minUnits: uint256, offerFills: Array<any>);
18
- }
@@ -1,28 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- const offerFillsParamType = 'tuple(tuple(tuple(uint256,address,address,tuple(address,uint256,uint256,address)[],uint256,uint256,address,address),bool,address,uint256,uint256,uint256,bytes32,address,bytes,address,address,bool,uint128,uint128,uint256),bytes,uint256)[]';
4
- /**
5
- * MidnightPaybackFromOrdersAction - Pay back debt through one or more Midnight offers.
6
- *
7
- * @category MidnightPaybackFromOrders
8
- */
9
- export class MidnightPaybackFromOrdersAction extends Action {
10
- /**
11
- * @param marketId Market id.
12
- * @param onBehalf Address whose debt is repaid. Defaults to the user's wallet if not provided.
13
- * @param from Address from which to pull the payback tokens.
14
- * @param amount Amount of tokens to spend. Send type(uint).max to pay back the whole debt.
15
- * @param minUnits Minimum number of debt units to repay (slippage protection).
16
- * @param offerFills Array of offer fills to pay back from.
17
- */
18
- constructor(marketId, onBehalf, from, amount, minUnits, offerFills) {
19
- super('MidnightPaybackFromOrders', getAddr('MidnightPaybackFromOrders'), ['bytes32', 'address', 'address', 'uint256', 'uint256', offerFillsParamType], [marketId, onBehalf, from, amount, minUnits, offerFills]);
20
- this.mappableArgs = [
21
- this.args[0],
22
- this.args[1],
23
- this.args[2],
24
- this.args[3],
25
- this.args[4],
26
- ];
27
- }
28
- }
@@ -1,17 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { EthAddress, bytes32, uint256 } from '../../types';
3
- /**
4
- * MidnightSupplyCollateralAction
5
- *
6
- * @category MidnightSupplyCollateral
7
- */
8
- export declare class MidnightSupplyCollateralAction extends Action {
9
- /**
10
- * @param marketId Market id.
11
- * @param onBehalf Address to supply tokens on behalf of.
12
- * @param from Address from which to pull collateral asset.
13
- * @param amount Amount of tokens to supply.
14
- * @param collateralIndex Collateral index (0-based).
15
- */
16
- constructor(marketId: bytes32, onBehalf: EthAddress, from: EthAddress, amount: uint256, collateralIndex: uint256);
17
- }
@@ -1,26 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- /**
4
- * MidnightSupplyCollateralAction
5
- *
6
- * @category MidnightSupplyCollateral
7
- */
8
- export class MidnightSupplyCollateralAction extends Action {
9
- /**
10
- * @param marketId Market id.
11
- * @param onBehalf Address to supply tokens on behalf of.
12
- * @param from Address from which to pull collateral asset.
13
- * @param amount Amount of tokens to supply.
14
- * @param collateralIndex Collateral index (0-based).
15
- */
16
- constructor(marketId, onBehalf, from, amount, collateralIndex) {
17
- super('MidnightSupplyCollateral', getAddr('MidnightSupplyCollateral'), ['bytes32', 'address', 'address', 'uint256', 'uint256'], [marketId, onBehalf, from, amount, collateralIndex]);
18
- this.mappableArgs = [
19
- this.args[0],
20
- this.args[1],
21
- this.args[2],
22
- this.args[3],
23
- this.args[4],
24
- ];
25
- }
26
- }
@@ -1,17 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { EthAddress, bytes32, uint256 } from '../../types';
3
- /**
4
- * MidnightWithdrawCollateralAction
5
- *
6
- * @category MidnightWithdrawCollateral
7
- */
8
- export declare class MidnightWithdrawCollateralAction extends Action {
9
- /**
10
- * @param marketId Market id.
11
- * @param onBehalf Address to withdraw tokens on behalf of.
12
- * @param to Address that will receive the withdrawn tokens.
13
- * @param amount Amount of tokens to withdraw. Send type(uint).max to withdraw whole amount.
14
- * @param collateralIndex Collateral index (0-based).
15
- */
16
- constructor(marketId: bytes32, onBehalf: EthAddress, to: EthAddress, amount: uint256, collateralIndex: uint256);
17
- }
@@ -1,26 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- /**
4
- * MidnightWithdrawCollateralAction
5
- *
6
- * @category MidnightWithdrawCollateral
7
- */
8
- export class MidnightWithdrawCollateralAction extends Action {
9
- /**
10
- * @param marketId Market id.
11
- * @param onBehalf Address to withdraw tokens on behalf of.
12
- * @param to Address that will receive the withdrawn tokens.
13
- * @param amount Amount of tokens to withdraw. Send type(uint).max to withdraw whole amount.
14
- * @param collateralIndex Collateral index (0-based).
15
- */
16
- constructor(marketId, onBehalf, to, amount, collateralIndex) {
17
- super('MidnightWithdrawCollateral', getAddr('MidnightWithdrawCollateral'), ['bytes32', 'address', 'address', 'uint256', 'uint256'], [marketId, onBehalf, to, amount, collateralIndex]);
18
- this.mappableArgs = [
19
- this.args[0],
20
- this.args[1],
21
- this.args[2],
22
- this.args[3],
23
- this.args[4],
24
- ];
25
- }
26
- }
@@ -1,5 +0,0 @@
1
- export * from './MidnightSupplyCollateralAction';
2
- export * from './MidnightWithdrawCollateralAction';
3
- export * from './MidnightPaybackDirectAction';
4
- export * from './MidnightBorrowFromOrdersAction';
5
- export * from './MidnightPaybackFromOrdersAction';
@@ -1,5 +0,0 @@
1
- export * from './MidnightSupplyCollateralAction';
2
- export * from './MidnightWithdrawCollateralAction';
3
- export * from './MidnightPaybackDirectAction';
4
- export * from './MidnightBorrowFromOrdersAction';
5
- export * from './MidnightPaybackFromOrdersAction';
@@ -1,44 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- import { EthAddress, bytes32, uint256 } from '../../types';
4
-
5
- const offerFillsParamType = 'tuple(tuple(tuple(uint256,address,address,tuple(address,uint256,uint256,address)[],uint256,uint256,address,address),bool,address,uint256,uint256,uint256,bytes32,address,bytes,address,address,bool,uint128,uint128,uint256),bytes,uint256)[]';
6
-
7
- /**
8
- * MidnightBorrowFromOrdersAction - Borrow from one or more Midnight offers.
9
- *
10
- * @category MidnightBorrowFromOrders
11
- */
12
- export class MidnightBorrowFromOrdersAction extends Action {
13
- /**
14
- * @param marketId Market id.
15
- * @param onBehalf Address to borrow tokens on behalf of. Defaults to the user's wallet if not provided.
16
- * @param to Address to send the borrowed tokens to.
17
- * @param amount Amount of tokens to borrow.
18
- * @param maxUnits Maximum number of units to take from the orders (slippage protection).
19
- * @param offerFills Array of offer fills to borrow from.
20
- */
21
- constructor(
22
- marketId: bytes32,
23
- onBehalf: EthAddress,
24
- to: EthAddress,
25
- amount: uint256,
26
- maxUnits: uint256,
27
- offerFills: Array<any>,
28
- ) {
29
- super(
30
- 'MidnightBorrowFromOrders',
31
- getAddr('MidnightBorrowFromOrders'),
32
- ['bytes32', 'address', 'address', 'uint256', 'uint256', offerFillsParamType],
33
- [marketId, onBehalf, to, amount, maxUnits, offerFills],
34
- );
35
-
36
- this.mappableArgs = [
37
- this.args[0],
38
- this.args[1],
39
- this.args[2],
40
- this.args[3],
41
- this.args[4],
42
- ];
43
- }
44
- }
@@ -1,36 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- import { EthAddress, bytes32, uint256 } from '../../types';
4
-
5
- /**
6
- * MidnightPaybackDirectAction - Payback a debt directly to the Midnight protocol.
7
- *
8
- * @category MidnightPaybackDirect
9
- */
10
- export class MidnightPaybackDirectAction extends Action {
11
- /**
12
- * @param marketId Market id.
13
- * @param onBehalf Address to payback tokens on behalf of.
14
- * @param from Address from which to pull the payback tokens.
15
- * @param amount Amount of tokens to payback. Send type(uint).max to payback whole amount.
16
- */
17
- constructor(
18
- marketId: bytes32,
19
- onBehalf: EthAddress,
20
- from: EthAddress,
21
- amount: uint256,
22
- ) {
23
- super(
24
- 'MidnightPaybackDirect',
25
- getAddr('MidnightPaybackDirect'),
26
- ['bytes32', 'address', 'address', 'uint256'],
27
- [marketId, onBehalf, from, amount],
28
- );
29
- this.mappableArgs = [
30
- this.args[0],
31
- this.args[1],
32
- this.args[2],
33
- this.args[3],
34
- ];
35
- }
36
- }
@@ -1,44 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- import { EthAddress, bytes32, uint256 } from '../../types';
4
-
5
- const offerFillsParamType = 'tuple(tuple(tuple(uint256,address,address,tuple(address,uint256,uint256,address)[],uint256,uint256,address,address),bool,address,uint256,uint256,uint256,bytes32,address,bytes,address,address,bool,uint128,uint128,uint256),bytes,uint256)[]';
6
-
7
- /**
8
- * MidnightPaybackFromOrdersAction - Pay back debt through one or more Midnight offers.
9
- *
10
- * @category MidnightPaybackFromOrders
11
- */
12
- export class MidnightPaybackFromOrdersAction extends Action {
13
- /**
14
- * @param marketId Market id.
15
- * @param onBehalf Address whose debt is repaid. Defaults to the user's wallet if not provided.
16
- * @param from Address from which to pull the payback tokens.
17
- * @param amount Amount of tokens to spend. Send type(uint).max to pay back the whole debt.
18
- * @param minUnits Minimum number of debt units to repay (slippage protection).
19
- * @param offerFills Array of offer fills to pay back from.
20
- */
21
- constructor(
22
- marketId: bytes32,
23
- onBehalf: EthAddress,
24
- from: EthAddress,
25
- amount: uint256,
26
- minUnits: uint256,
27
- offerFills: Array<any>,
28
- ) {
29
- super(
30
- 'MidnightPaybackFromOrders',
31
- getAddr('MidnightPaybackFromOrders'),
32
- ['bytes32', 'address', 'address', 'uint256', 'uint256', offerFillsParamType],
33
- [marketId, onBehalf, from, amount, minUnits, offerFills],
34
- );
35
-
36
- this.mappableArgs = [
37
- this.args[0],
38
- this.args[1],
39
- this.args[2],
40
- this.args[3],
41
- this.args[4],
42
- ];
43
- }
44
- }
@@ -1,39 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- import { EthAddress, bytes32, uint256 } from '../../types';
4
-
5
- /**
6
- * MidnightSupplyCollateralAction
7
- *
8
- * @category MidnightSupplyCollateral
9
- */
10
- export class MidnightSupplyCollateralAction extends Action {
11
- /**
12
- * @param marketId Market id.
13
- * @param onBehalf Address to supply tokens on behalf of.
14
- * @param from Address from which to pull collateral asset.
15
- * @param amount Amount of tokens to supply.
16
- * @param collateralIndex Collateral index (0-based).
17
- */
18
- constructor(
19
- marketId: bytes32,
20
- onBehalf: EthAddress,
21
- from: EthAddress,
22
- amount: uint256,
23
- collateralIndex: uint256,
24
- ) {
25
- super(
26
- 'MidnightSupplyCollateral',
27
- getAddr('MidnightSupplyCollateral'),
28
- ['bytes32', 'address', 'address', 'uint256', 'uint256'],
29
- [marketId, onBehalf, from, amount, collateralIndex],
30
- );
31
- this.mappableArgs = [
32
- this.args[0],
33
- this.args[1],
34
- this.args[2],
35
- this.args[3],
36
- this.args[4],
37
- ];
38
- }
39
- }
@@ -1,39 +0,0 @@
1
- import { Action } from '../../Action';
2
- import { getAddr } from '../../addresses';
3
- import { EthAddress, bytes32, uint256 } from '../../types';
4
-
5
- /**
6
- * MidnightWithdrawCollateralAction
7
- *
8
- * @category MidnightWithdrawCollateral
9
- */
10
- export class MidnightWithdrawCollateralAction extends Action {
11
- /**
12
- * @param marketId Market id.
13
- * @param onBehalf Address to withdraw tokens on behalf of.
14
- * @param to Address that will receive the withdrawn tokens.
15
- * @param amount Amount of tokens to withdraw. Send type(uint).max to withdraw whole amount.
16
- * @param collateralIndex Collateral index (0-based).
17
- */
18
- constructor(
19
- marketId: bytes32,
20
- onBehalf: EthAddress,
21
- to: EthAddress,
22
- amount: uint256,
23
- collateralIndex: uint256,
24
- ) {
25
- super(
26
- 'MidnightWithdrawCollateral',
27
- getAddr('MidnightWithdrawCollateral'),
28
- ['bytes32', 'address', 'address', 'uint256', 'uint256'],
29
- [marketId, onBehalf, to, amount, collateralIndex],
30
- );
31
- this.mappableArgs = [
32
- this.args[0],
33
- this.args[1],
34
- this.args[2],
35
- this.args[3],
36
- this.args[4],
37
- ];
38
- }
39
- }
@@ -1,5 +0,0 @@
1
- export * from './MidnightSupplyCollateralAction';
2
- export * from './MidnightWithdrawCollateralAction';
3
- export * from './MidnightPaybackDirectAction';
4
- export * from './MidnightBorrowFromOrdersAction';
5
- export * from './MidnightPaybackFromOrdersAction';