@defisaver/sdk 1.3.29 → 1.3.30-aave-v4-delegate-dev
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/aavev4/AaveV4DelegateBorrowAction.d.ts +16 -0
- package/esm/src/actions/aavev4/AaveV4DelegateBorrowAction.js +24 -0
- package/esm/src/actions/aavev4/AaveV4DelegateSetUsingAsCollateralAction.d.ts +15 -0
- package/esm/src/actions/aavev4/AaveV4DelegateSetUsingAsCollateralAction.js +22 -0
- package/esm/src/actions/aavev4/AaveV4DelegateWithdrawAction.d.ts +16 -0
- package/esm/src/actions/aavev4/AaveV4DelegateWithdrawAction.js +24 -0
- package/esm/src/actions/aavev4/AaveV4SetUserManagersAction.d.ts +14 -0
- package/esm/src/actions/aavev4/AaveV4SetUserManagersAction.js +16 -0
- package/esm/src/actions/aavev4/index.d.ts +4 -0
- package/esm/src/actions/aavev4/index.js +4 -0
- package/esm/src/actions/checkers/SparkRatioCheckAction.d.ts +4 -2
- package/esm/src/actions/checkers/SparkRatioCheckAction.js +6 -2
- package/esm/src/actions/checkers/SparkTargetRatioCheck.d.ts +2 -1
- package/esm/src/actions/checkers/SparkTargetRatioCheck.js +4 -2
- package/esm/src/addresses.d.ts +24 -0
- package/esm/src/addresses.js +6 -2
- package/esm/src/index.d.ts +96 -0
- package/package.json +1 -1
- package/src/actions/aavev4/AaveV4DelegateBorrowAction.ts +36 -0
- package/src/actions/aavev4/AaveV4DelegateSetUsingAsCollateralAction.ts +33 -0
- package/src/actions/aavev4/AaveV4DelegateWithdrawAction.ts +36 -0
- package/src/actions/aavev4/AaveV4SetUserManagersAction.ts +26 -0
- package/src/actions/aavev4/index.ts +5 -1
- package/src/actions/checkers/SparkRatioCheckAction.ts +18 -4
- package/src/actions/checkers/SparkTargetRatioCheck.ts +14 -3
- package/src/addresses.ts +6 -2
- package/umd/index.js +242 -104
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* AaveV4DelegateWithdrawAction - Approves a spender to withdraw from the specified reserve on behalf of the wallet.
|
|
7
|
+
*
|
|
8
|
+
* @category AaveV4DelegateWithdraw
|
|
9
|
+
*/
|
|
10
|
+
export class AaveV4DelegateWithdrawAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param spoke Address of the spoke.
|
|
13
|
+
* @param reserveId Reserve id.
|
|
14
|
+
* @param spender Address that will receive the withdraw allowance.
|
|
15
|
+
* @param amount Amount of withdraw allowance.
|
|
16
|
+
*/
|
|
17
|
+
constructor(
|
|
18
|
+
spoke: EthAddress,
|
|
19
|
+
reserveId: uint256,
|
|
20
|
+
spender: EthAddress,
|
|
21
|
+
amount: uint256,
|
|
22
|
+
) {
|
|
23
|
+
super(
|
|
24
|
+
'AaveV4DelegateWithdraw',
|
|
25
|
+
getAddr('AaveV4DelegateWithdraw'),
|
|
26
|
+
['address', 'uint256', 'address', 'uint256'],
|
|
27
|
+
[spoke, reserveId, spender, amount],
|
|
28
|
+
);
|
|
29
|
+
this.mappableArgs = [
|
|
30
|
+
this.args[0],
|
|
31
|
+
this.args[1],
|
|
32
|
+
this.args[2],
|
|
33
|
+
this.args[3],
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress } from '../../types';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* AaveV4SetUserManagersAction - Sets position managers for the user's wallet.
|
|
7
|
+
*
|
|
8
|
+
* @category AaveV4
|
|
9
|
+
*/
|
|
10
|
+
export class AaveV4SetUserManagersAction extends Action {
|
|
11
|
+
/**
|
|
12
|
+
* @param spoke Address of the spoke.
|
|
13
|
+
* @param updates The array of position manager updates.
|
|
14
|
+
*/
|
|
15
|
+
constructor(
|
|
16
|
+
spoke: EthAddress,
|
|
17
|
+
updates: Array<[EthAddress, boolean]>,
|
|
18
|
+
) {
|
|
19
|
+
super(
|
|
20
|
+
'AaveV4SetUserManagers',
|
|
21
|
+
getAddr('AaveV4SetUserManagers'),
|
|
22
|
+
['address', 'tuple(address,bool)[]'],
|
|
23
|
+
[spoke, updates],
|
|
24
|
+
);
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -8,4 +8,8 @@ export * from './AaveV4RefreshPremiumAction';
|
|
|
8
8
|
export * from './AaveV4DelegateBorrowWithSigAction';
|
|
9
9
|
export * from './AaveV4DelegateWithdrawWithSigAction';
|
|
10
10
|
export * from './AaveV4SetUserManagersWithSigAction';
|
|
11
|
-
export * from './AaveV4DelegateSetUsingAsCollateralWithSigAction';
|
|
11
|
+
export * from './AaveV4DelegateSetUsingAsCollateralWithSigAction';
|
|
12
|
+
export * from './AaveV4DelegateBorrowAction';
|
|
13
|
+
export * from './AaveV4DelegateWithdrawAction';
|
|
14
|
+
export * from './AaveV4DelegateSetUsingAsCollateralAction';
|
|
15
|
+
export * from './AaveV4SetUserManagersAction';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Action } from '../../Action';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
|
-
import { uint8, uint256 } from '../../types';
|
|
3
|
+
import { uint8, uint256, EthAddress } from '../../types';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* SparkRatioCheckAction - Checks spark ratio for users proxy position and reverts if faulty
|
|
@@ -11,13 +11,27 @@ export class SparkRatioCheckAction extends Action {
|
|
|
11
11
|
/**
|
|
12
12
|
* @param ratioState If it should lower/higher
|
|
13
13
|
* @param targetRatio The ratio user want to be at
|
|
14
|
+
* @param market Address provider for specific market. This param was added later
|
|
15
|
+
* @param user Address of the user (EOA/SW). This param was added later
|
|
14
16
|
*/
|
|
15
|
-
constructor(
|
|
16
|
-
|
|
17
|
+
constructor(
|
|
18
|
+
ratioState: uint8,
|
|
19
|
+
targetRatio: uint256,
|
|
20
|
+
market: EthAddress = getAddr('Empty'),
|
|
21
|
+
user: EthAddress = getAddr('Empty'),
|
|
22
|
+
) {
|
|
23
|
+
super(
|
|
24
|
+
'SparkRatioCheck',
|
|
25
|
+
getAddr('Empty'),
|
|
26
|
+
['uint8', 'uint256', 'address', 'address'],
|
|
27
|
+
[ratioState, targetRatio, market, user],
|
|
28
|
+
);
|
|
17
29
|
|
|
18
30
|
this.mappableArgs = [
|
|
19
31
|
this.args[0],
|
|
20
32
|
this.args[1],
|
|
33
|
+
this.args[2],
|
|
34
|
+
this.args[3],
|
|
21
35
|
];
|
|
22
36
|
}
|
|
23
|
-
}
|
|
37
|
+
}
|
|
@@ -11,13 +11,24 @@ export class SparkTargetRatioCheck extends Action {
|
|
|
11
11
|
/**
|
|
12
12
|
* @param targetRatio The ratio user want to be at
|
|
13
13
|
* @param market Address of the market
|
|
14
|
+
* @param user Address of the user (EOA/SW). This param was added later
|
|
14
15
|
*/
|
|
15
|
-
constructor(
|
|
16
|
-
|
|
16
|
+
constructor(
|
|
17
|
+
targetRatio: uint256,
|
|
18
|
+
market: EthAddress,
|
|
19
|
+
user: EthAddress = getAddr('Empty'),
|
|
20
|
+
) {
|
|
21
|
+
super(
|
|
22
|
+
'SparkTargetRatioCheck',
|
|
23
|
+
getAddr('Empty'),
|
|
24
|
+
['uint256', 'address', 'address'],
|
|
25
|
+
[targetRatio, market, user],
|
|
26
|
+
);
|
|
17
27
|
|
|
18
28
|
this.mappableArgs = [
|
|
19
29
|
this.args[0],
|
|
20
30
|
this.args[1],
|
|
31
|
+
this.args[2],
|
|
21
32
|
];
|
|
22
33
|
}
|
|
23
|
-
}
|
|
34
|
+
}
|
package/src/addresses.ts
CHANGED
|
@@ -208,8 +208,8 @@ export const actionAddresses = {
|
|
|
208
208
|
LiquityV2Adjust: '0x3BbC88f3b75cB898395C9b5AE8D9c2a26744993b',
|
|
209
209
|
LiquityV2AdjustInterestRate:
|
|
210
210
|
'0x685f0237D8b85B2018278E975a481b0650dE0b54',
|
|
211
|
-
LiquityV2SPDeposit: '
|
|
212
|
-
LiquityV2SPWithdraw: '
|
|
211
|
+
LiquityV2SPDeposit: '0x256e97E7f7B42Cf7De5258C59A2935AdEdDdfC63',
|
|
212
|
+
LiquityV2SPWithdraw: '0x7ab4A43DE2628EA53c88E27755325d090f28D9c9',
|
|
213
213
|
LiquityV2SPClaimColl: '0x3f783de20C3095bcB999AEA999aF4DF184b6630f',
|
|
214
214
|
LiquityV2AdjustZombieTrove:
|
|
215
215
|
'0x45F5CEe8f89AdBCe4f5B20f38a49402b152ba99e',
|
|
@@ -404,6 +404,10 @@ export const actionAddresses = {
|
|
|
404
404
|
AaveV4DelegateWithdrawWithSig: '0x81864dBd69c46B19463eC7BEC6cE0B271126531a',
|
|
405
405
|
AaveV4DelegateBorrowWithSig: '0x9D68b41BB9f9e9Ac1E1ee49d3566CAd4624886BA',
|
|
406
406
|
AaveV4DelegateSetUsingAsCollateralWithSig: '0xF3D7C7e8F5154c669EAA0dE996cdE0575D7d3A00',
|
|
407
|
+
AaveV4DelegateBorrow: '0x4284B4e09c46Ee2b4E703dB8e5A2F892d12638e1',
|
|
408
|
+
AaveV4DelegateWithdraw: '0x5e7c404d46971E7BD3a95570A80Bc37F38bf9E29',
|
|
409
|
+
AaveV4DelegateSetUsingAsCollateral: '0xa97f8E483C147f27aE7370DeaC4E6585A37884A2',
|
|
410
|
+
AaveV4SetUserManagers: '0x61e5d59bD82FFC61B916d2F2114eF671b17d0662',
|
|
407
411
|
},
|
|
408
412
|
[NETWORKS.optimism.chainId]: {
|
|
409
413
|
DFSSell: '0x9f234af5c10c136863a20865ba00b26951ab8269',
|