@defisaver/sdk 1.1.1 → 1.1.2-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/llamalend/LlamaLendBoostAction.d.ts +8 -0
- package/esm/src/actions/llamalend/LlamaLendBoostAction.js +18 -0
- package/esm/src/actions/llamalend/LlamaLendCreateAction.d.ts +2 -2
- package/esm/src/actions/llamalend/LlamaLendCreateAction.js +2 -3
- package/esm/src/actions/llamalend/LlamaLendGetDebtAction.d.ts +8 -0
- package/esm/src/actions/llamalend/LlamaLendGetDebtAction.js +13 -0
- package/esm/src/actions/llamalend/LlamaLendLevCreateAction.d.ts +12 -0
- package/esm/src/actions/llamalend/LlamaLendLevCreateAction.js +41 -0
- package/esm/src/actions/llamalend/LlamaLendPaybackAction.d.ts +2 -10
- package/esm/src/actions/llamalend/LlamaLendPaybackAction.js +2 -11
- package/esm/src/actions/llamalend/LlamaLendRepayAction.d.ts +8 -0
- package/esm/src/actions/llamalend/LlamaLendRepayAction.js +20 -0
- package/esm/src/actions/llamalend/LlamaLendSelfLiquidateAction.d.ts +2 -2
- package/esm/src/actions/llamalend/LlamaLendSelfLiquidateAction.js +2 -3
- package/esm/src/actions/llamalend/LlamaLendSelfLiquidateWithCollAction.d.ts +8 -0
- package/esm/src/actions/llamalend/LlamaLendSelfLiquidateWithCollAction.js +25 -0
- package/esm/src/actions/llamalend/LlamaLendSupplyAction.d.ts +2 -2
- package/esm/src/actions/llamalend/LlamaLendSupplyAction.js +2 -3
- package/esm/src/actions/llamalend/index.d.ts +5 -0
- package/esm/src/actions/llamalend/index.js +5 -0
- package/esm/src/addresses.d.ts +26 -6
- package/esm/src/addresses.js +17 -0
- package/esm/src/index.d.ts +104 -24
- package/esm/src/utils/index.d.ts +1 -2
- package/esm/src/utils/index.js +1 -2
- package/package.json +1 -1
- package/src/actions/llamalend/LlamaLendBoostAction.ts +26 -0
- package/src/actions/llamalend/LlamaLendCreateAction.ts +3 -2
- package/src/actions/llamalend/LlamaLendGetDebtAction.ts +21 -0
- package/src/actions/llamalend/LlamaLendLevCreateAction.ts +39 -0
- package/src/actions/llamalend/LlamaLendPaybackAction.ts +2 -10
- package/src/actions/llamalend/LlamaLendRepayAction.ts +28 -0
- package/src/actions/llamalend/LlamaLendSelfLiquidateAction.ts +3 -2
- package/src/actions/llamalend/LlamaLendSelfLiquidateWithCollAction.ts +33 -0
- package/src/actions/llamalend/LlamaLendSupplyAction.ts +2 -2
- package/src/actions/llamalend/index.ts +6 -1
- package/src/addresses.ts +18 -0
- package/src/utils/index.ts +0 -2
- package/umd/index.js +227 -118
- package/esm/src/utils/llamalend-utils.d.ts +0 -10
- package/esm/src/utils/llamalend-utils.js +0 -10
- package/src/utils/llamalend-utils.ts +0 -11
package/esm/src/index.d.ts
CHANGED
|
@@ -211,6 +211,11 @@ declare const actionAddressesAllChains: {
|
|
|
211
211
|
LlamaLendWithdraw: string;
|
|
212
212
|
LlamaLendPayback: string;
|
|
213
213
|
LlamaLendSelfLiquidate: string;
|
|
214
|
+
LlamaLendGetDebt: string;
|
|
215
|
+
LlamaLendBoost: string;
|
|
216
|
+
LlamaLendRepay: string;
|
|
217
|
+
LlamaLendLevCreate: string;
|
|
218
|
+
LlamaLendSelfLiquidateWithColl: string;
|
|
214
219
|
MerklClaim: string;
|
|
215
220
|
AaveV3DelegateCredit?: undefined;
|
|
216
221
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -420,6 +425,11 @@ declare const actionAddressesAllChains: {
|
|
|
420
425
|
LlamaLendWithdraw?: undefined;
|
|
421
426
|
LlamaLendPayback?: undefined;
|
|
422
427
|
LlamaLendSelfLiquidate?: undefined;
|
|
428
|
+
LlamaLendGetDebt?: undefined;
|
|
429
|
+
LlamaLendBoost?: undefined;
|
|
430
|
+
LlamaLendRepay?: undefined;
|
|
431
|
+
LlamaLendLevCreate?: undefined;
|
|
432
|
+
LlamaLendSelfLiquidateWithColl?: undefined;
|
|
423
433
|
MerklClaim?: undefined;
|
|
424
434
|
} | {
|
|
425
435
|
DFSSell: string;
|
|
@@ -463,6 +473,17 @@ declare const actionAddressesAllChains: {
|
|
|
463
473
|
UniSupplyV3: string;
|
|
464
474
|
UniWithdrawV3: string;
|
|
465
475
|
UniCreatePoolV3: string;
|
|
476
|
+
LlamaLendCreate: string;
|
|
477
|
+
LlamaLendSupply: string;
|
|
478
|
+
LlamaLendBorrow: string;
|
|
479
|
+
LlamaLendWithdraw: string;
|
|
480
|
+
LlamaLendPayback: string;
|
|
481
|
+
LlamaLendSelfLiquidate: string;
|
|
482
|
+
LlamaLendGetDebt: string;
|
|
483
|
+
LlamaLendBoost: string;
|
|
484
|
+
LlamaLendRepay: string;
|
|
485
|
+
LlamaLendLevCreate: string;
|
|
486
|
+
LlamaLendSelfLiquidateWithColl: string;
|
|
466
487
|
AutomationV2Unsub?: undefined;
|
|
467
488
|
UpdateSub?: undefined;
|
|
468
489
|
TransferNFT?: undefined;
|
|
@@ -617,12 +638,6 @@ declare const actionAddressesAllChains: {
|
|
|
617
638
|
MorphoBluePayback?: undefined;
|
|
618
639
|
MorphoBlueSetAuth?: undefined;
|
|
619
640
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
620
|
-
LlamaLendCreate?: undefined;
|
|
621
|
-
LlamaLendSupply?: undefined;
|
|
622
|
-
LlamaLendBorrow?: undefined;
|
|
623
|
-
LlamaLendWithdraw?: undefined;
|
|
624
|
-
LlamaLendPayback?: undefined;
|
|
625
|
-
LlamaLendSelfLiquidate?: undefined;
|
|
626
641
|
MerklClaim?: undefined;
|
|
627
642
|
AaveV3DelegateCredit?: undefined;
|
|
628
643
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -826,6 +841,11 @@ declare const actionAddressesAllChains: {
|
|
|
826
841
|
LlamaLendWithdraw?: undefined;
|
|
827
842
|
LlamaLendPayback?: undefined;
|
|
828
843
|
LlamaLendSelfLiquidate?: undefined;
|
|
844
|
+
LlamaLendGetDebt?: undefined;
|
|
845
|
+
LlamaLendBoost?: undefined;
|
|
846
|
+
LlamaLendRepay?: undefined;
|
|
847
|
+
LlamaLendLevCreate?: undefined;
|
|
848
|
+
LlamaLendSelfLiquidateWithColl?: undefined;
|
|
829
849
|
MerklClaim?: undefined;
|
|
830
850
|
AaveV3DelegateCredit?: undefined;
|
|
831
851
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -1033,6 +1053,11 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1033
1053
|
LlamaLendWithdraw: string;
|
|
1034
1054
|
LlamaLendPayback: string;
|
|
1035
1055
|
LlamaLendSelfLiquidate: string;
|
|
1056
|
+
LlamaLendGetDebt: string;
|
|
1057
|
+
LlamaLendBoost: string;
|
|
1058
|
+
LlamaLendRepay: string;
|
|
1059
|
+
LlamaLendLevCreate: string;
|
|
1060
|
+
LlamaLendSelfLiquidateWithColl: string;
|
|
1036
1061
|
MerklClaim: string;
|
|
1037
1062
|
AaveV3DelegateCredit?: undefined;
|
|
1038
1063
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -1242,6 +1267,11 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1242
1267
|
LlamaLendWithdraw?: undefined;
|
|
1243
1268
|
LlamaLendPayback?: undefined;
|
|
1244
1269
|
LlamaLendSelfLiquidate?: undefined;
|
|
1270
|
+
LlamaLendGetDebt?: undefined;
|
|
1271
|
+
LlamaLendBoost?: undefined;
|
|
1272
|
+
LlamaLendRepay?: undefined;
|
|
1273
|
+
LlamaLendLevCreate?: undefined;
|
|
1274
|
+
LlamaLendSelfLiquidateWithColl?: undefined;
|
|
1245
1275
|
MerklClaim?: undefined;
|
|
1246
1276
|
} | {
|
|
1247
1277
|
DFSSell: string;
|
|
@@ -1285,6 +1315,17 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1285
1315
|
UniSupplyV3: string;
|
|
1286
1316
|
UniWithdrawV3: string;
|
|
1287
1317
|
UniCreatePoolV3: string;
|
|
1318
|
+
LlamaLendCreate: string;
|
|
1319
|
+
LlamaLendSupply: string;
|
|
1320
|
+
LlamaLendBorrow: string;
|
|
1321
|
+
LlamaLendWithdraw: string;
|
|
1322
|
+
LlamaLendPayback: string;
|
|
1323
|
+
LlamaLendSelfLiquidate: string;
|
|
1324
|
+
LlamaLendGetDebt: string;
|
|
1325
|
+
LlamaLendBoost: string;
|
|
1326
|
+
LlamaLendRepay: string;
|
|
1327
|
+
LlamaLendLevCreate: string;
|
|
1328
|
+
LlamaLendSelfLiquidateWithColl: string;
|
|
1288
1329
|
AutomationV2Unsub?: undefined;
|
|
1289
1330
|
UpdateSub?: undefined;
|
|
1290
1331
|
TransferNFT?: undefined;
|
|
@@ -1439,12 +1480,6 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1439
1480
|
MorphoBluePayback?: undefined;
|
|
1440
1481
|
MorphoBlueSetAuth?: undefined;
|
|
1441
1482
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
1442
|
-
LlamaLendCreate?: undefined;
|
|
1443
|
-
LlamaLendSupply?: undefined;
|
|
1444
|
-
LlamaLendBorrow?: undefined;
|
|
1445
|
-
LlamaLendWithdraw?: undefined;
|
|
1446
|
-
LlamaLendPayback?: undefined;
|
|
1447
|
-
LlamaLendSelfLiquidate?: undefined;
|
|
1448
1483
|
MerklClaim?: undefined;
|
|
1449
1484
|
AaveV3DelegateCredit?: undefined;
|
|
1450
1485
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -1648,6 +1683,11 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1648
1683
|
LlamaLendWithdraw?: undefined;
|
|
1649
1684
|
LlamaLendPayback?: undefined;
|
|
1650
1685
|
LlamaLendSelfLiquidate?: undefined;
|
|
1686
|
+
LlamaLendGetDebt?: undefined;
|
|
1687
|
+
LlamaLendBoost?: undefined;
|
|
1688
|
+
LlamaLendRepay?: undefined;
|
|
1689
|
+
LlamaLendLevCreate?: undefined;
|
|
1690
|
+
LlamaLendSelfLiquidateWithColl?: undefined;
|
|
1651
1691
|
MerklClaim?: undefined;
|
|
1652
1692
|
AaveV3DelegateCredit?: undefined;
|
|
1653
1693
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -1998,6 +2038,11 @@ declare const _default: {
|
|
|
1998
2038
|
LlamaLendWithdraw: string;
|
|
1999
2039
|
LlamaLendPayback: string;
|
|
2000
2040
|
LlamaLendSelfLiquidate: string;
|
|
2041
|
+
LlamaLendGetDebt: string;
|
|
2042
|
+
LlamaLendBoost: string;
|
|
2043
|
+
LlamaLendRepay: string;
|
|
2044
|
+
LlamaLendLevCreate: string;
|
|
2045
|
+
LlamaLendSelfLiquidateWithColl: string;
|
|
2001
2046
|
MerklClaim: string;
|
|
2002
2047
|
AaveV3DelegateCredit?: undefined;
|
|
2003
2048
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -2207,6 +2252,11 @@ declare const _default: {
|
|
|
2207
2252
|
LlamaLendWithdraw?: undefined;
|
|
2208
2253
|
LlamaLendPayback?: undefined;
|
|
2209
2254
|
LlamaLendSelfLiquidate?: undefined;
|
|
2255
|
+
LlamaLendGetDebt?: undefined;
|
|
2256
|
+
LlamaLendBoost?: undefined;
|
|
2257
|
+
LlamaLendRepay?: undefined;
|
|
2258
|
+
LlamaLendLevCreate?: undefined;
|
|
2259
|
+
LlamaLendSelfLiquidateWithColl?: undefined;
|
|
2210
2260
|
MerklClaim?: undefined;
|
|
2211
2261
|
} | {
|
|
2212
2262
|
DFSSell: string;
|
|
@@ -2250,6 +2300,17 @@ declare const _default: {
|
|
|
2250
2300
|
UniSupplyV3: string;
|
|
2251
2301
|
UniWithdrawV3: string;
|
|
2252
2302
|
UniCreatePoolV3: string;
|
|
2303
|
+
LlamaLendCreate: string;
|
|
2304
|
+
LlamaLendSupply: string;
|
|
2305
|
+
LlamaLendBorrow: string;
|
|
2306
|
+
LlamaLendWithdraw: string;
|
|
2307
|
+
LlamaLendPayback: string;
|
|
2308
|
+
LlamaLendSelfLiquidate: string;
|
|
2309
|
+
LlamaLendGetDebt: string;
|
|
2310
|
+
LlamaLendBoost: string;
|
|
2311
|
+
LlamaLendRepay: string;
|
|
2312
|
+
LlamaLendLevCreate: string;
|
|
2313
|
+
LlamaLendSelfLiquidateWithColl: string;
|
|
2253
2314
|
AutomationV2Unsub?: undefined;
|
|
2254
2315
|
UpdateSub?: undefined;
|
|
2255
2316
|
TransferNFT?: undefined;
|
|
@@ -2404,12 +2465,6 @@ declare const _default: {
|
|
|
2404
2465
|
MorphoBluePayback?: undefined;
|
|
2405
2466
|
MorphoBlueSetAuth?: undefined;
|
|
2406
2467
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
2407
|
-
LlamaLendCreate?: undefined;
|
|
2408
|
-
LlamaLendSupply?: undefined;
|
|
2409
|
-
LlamaLendBorrow?: undefined;
|
|
2410
|
-
LlamaLendWithdraw?: undefined;
|
|
2411
|
-
LlamaLendPayback?: undefined;
|
|
2412
|
-
LlamaLendSelfLiquidate?: undefined;
|
|
2413
2468
|
MerklClaim?: undefined;
|
|
2414
2469
|
AaveV3DelegateCredit?: undefined;
|
|
2415
2470
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -2613,6 +2668,11 @@ declare const _default: {
|
|
|
2613
2668
|
LlamaLendWithdraw?: undefined;
|
|
2614
2669
|
LlamaLendPayback?: undefined;
|
|
2615
2670
|
LlamaLendSelfLiquidate?: undefined;
|
|
2671
|
+
LlamaLendGetDebt?: undefined;
|
|
2672
|
+
LlamaLendBoost?: undefined;
|
|
2673
|
+
LlamaLendRepay?: undefined;
|
|
2674
|
+
LlamaLendLevCreate?: undefined;
|
|
2675
|
+
LlamaLendSelfLiquidateWithColl?: undefined;
|
|
2616
2676
|
MerklClaim?: undefined;
|
|
2617
2677
|
AaveV3DelegateCredit?: undefined;
|
|
2618
2678
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -2820,6 +2880,11 @@ declare const _default: {
|
|
|
2820
2880
|
LlamaLendWithdraw: string;
|
|
2821
2881
|
LlamaLendPayback: string;
|
|
2822
2882
|
LlamaLendSelfLiquidate: string;
|
|
2883
|
+
LlamaLendGetDebt: string;
|
|
2884
|
+
LlamaLendBoost: string;
|
|
2885
|
+
LlamaLendRepay: string;
|
|
2886
|
+
LlamaLendLevCreate: string;
|
|
2887
|
+
LlamaLendSelfLiquidateWithColl: string;
|
|
2823
2888
|
MerklClaim: string;
|
|
2824
2889
|
AaveV3DelegateCredit?: undefined;
|
|
2825
2890
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -3029,6 +3094,11 @@ declare const _default: {
|
|
|
3029
3094
|
LlamaLendWithdraw?: undefined;
|
|
3030
3095
|
LlamaLendPayback?: undefined;
|
|
3031
3096
|
LlamaLendSelfLiquidate?: undefined;
|
|
3097
|
+
LlamaLendGetDebt?: undefined;
|
|
3098
|
+
LlamaLendBoost?: undefined;
|
|
3099
|
+
LlamaLendRepay?: undefined;
|
|
3100
|
+
LlamaLendLevCreate?: undefined;
|
|
3101
|
+
LlamaLendSelfLiquidateWithColl?: undefined;
|
|
3032
3102
|
MerklClaim?: undefined;
|
|
3033
3103
|
} | {
|
|
3034
3104
|
DFSSell: string;
|
|
@@ -3072,6 +3142,17 @@ declare const _default: {
|
|
|
3072
3142
|
UniSupplyV3: string;
|
|
3073
3143
|
UniWithdrawV3: string;
|
|
3074
3144
|
UniCreatePoolV3: string;
|
|
3145
|
+
LlamaLendCreate: string;
|
|
3146
|
+
LlamaLendSupply: string;
|
|
3147
|
+
LlamaLendBorrow: string;
|
|
3148
|
+
LlamaLendWithdraw: string;
|
|
3149
|
+
LlamaLendPayback: string;
|
|
3150
|
+
LlamaLendSelfLiquidate: string;
|
|
3151
|
+
LlamaLendGetDebt: string;
|
|
3152
|
+
LlamaLendBoost: string;
|
|
3153
|
+
LlamaLendRepay: string;
|
|
3154
|
+
LlamaLendLevCreate: string;
|
|
3155
|
+
LlamaLendSelfLiquidateWithColl: string;
|
|
3075
3156
|
AutomationV2Unsub?: undefined;
|
|
3076
3157
|
UpdateSub?: undefined;
|
|
3077
3158
|
TransferNFT?: undefined;
|
|
@@ -3226,12 +3307,6 @@ declare const _default: {
|
|
|
3226
3307
|
MorphoBluePayback?: undefined;
|
|
3227
3308
|
MorphoBlueSetAuth?: undefined;
|
|
3228
3309
|
MorphoBlueSetAuthWithSig?: undefined;
|
|
3229
|
-
LlamaLendCreate?: undefined;
|
|
3230
|
-
LlamaLendSupply?: undefined;
|
|
3231
|
-
LlamaLendBorrow?: undefined;
|
|
3232
|
-
LlamaLendWithdraw?: undefined;
|
|
3233
|
-
LlamaLendPayback?: undefined;
|
|
3234
|
-
LlamaLendSelfLiquidate?: undefined;
|
|
3235
3310
|
MerklClaim?: undefined;
|
|
3236
3311
|
AaveV3DelegateCredit?: undefined;
|
|
3237
3312
|
AaveV3RatioTrigger?: undefined;
|
|
@@ -3435,6 +3510,11 @@ declare const _default: {
|
|
|
3435
3510
|
LlamaLendWithdraw?: undefined;
|
|
3436
3511
|
LlamaLendPayback?: undefined;
|
|
3437
3512
|
LlamaLendSelfLiquidate?: undefined;
|
|
3513
|
+
LlamaLendGetDebt?: undefined;
|
|
3514
|
+
LlamaLendBoost?: undefined;
|
|
3515
|
+
LlamaLendRepay?: undefined;
|
|
3516
|
+
LlamaLendLevCreate?: undefined;
|
|
3517
|
+
LlamaLendSelfLiquidateWithColl?: undefined;
|
|
3438
3518
|
MerklClaim?: undefined;
|
|
3439
3519
|
AaveV3DelegateCredit?: undefined;
|
|
3440
3520
|
AaveV3RatioTrigger?: undefined;
|
package/esm/src/utils/index.d.ts
CHANGED
|
@@ -6,5 +6,4 @@ import mstableAssetPairs from './mstableAssetPairs';
|
|
|
6
6
|
import * as curveUtils from './curve-utils';
|
|
7
7
|
import * as curveusdUtils from './curveusd-utils';
|
|
8
8
|
import * as basicUtils from './basic-utils';
|
|
9
|
-
|
|
10
|
-
export { zeroExExchange, uniswapLP, uniswapV3LP, mstableAssetPairs, convexUtils, curveUtils, curveusdUtils, basicUtils, llamaLenUtils, };
|
|
9
|
+
export { zeroExExchange, uniswapLP, uniswapV3LP, mstableAssetPairs, convexUtils, curveUtils, curveusdUtils, basicUtils, };
|
package/esm/src/utils/index.js
CHANGED
|
@@ -6,5 +6,4 @@ import mstableAssetPairs from './mstableAssetPairs';
|
|
|
6
6
|
import * as curveUtils from './curve-utils';
|
|
7
7
|
import * as curveusdUtils from './curveusd-utils';
|
|
8
8
|
import * as basicUtils from './basic-utils';
|
|
9
|
-
|
|
10
|
-
export { zeroExExchange, uniswapLP, uniswapV3LP, mstableAssetPairs, convexUtils, curveUtils, curveusdUtils, basicUtils, llamaLenUtils, };
|
|
9
|
+
export { zeroExExchange, uniswapLP, uniswapV3LP, mstableAssetPairs, convexUtils, curveUtils, curveusdUtils, basicUtils, };
|
package/package.json
CHANGED
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256, uint32 } from '../../types';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @category LlamaLend
|
|
8
|
+
*/
|
|
9
|
+
export class LlamaLendBoostAction extends Action {
|
|
10
|
+
constructor(controller: EthAddress, controllerId: uint256, exchangeOrder: Array<any>, gasUsed: uint32) {
|
|
11
|
+
super(
|
|
12
|
+
'LlamaLendBoost',
|
|
13
|
+
getAddr('LlamaLendBoost'),
|
|
14
|
+
[
|
|
15
|
+
'address',
|
|
16
|
+
'uint256',
|
|
17
|
+
['address', 'address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'address', 'bytes', ['address', 'address', 'address', 'uint256', 'uint256', 'bytes']],
|
|
18
|
+
'uint32',
|
|
19
|
+
],
|
|
20
|
+
[controller, controllerId, exchangeOrder, gasUsed],
|
|
21
|
+
);
|
|
22
|
+
this.mappableArgs = [
|
|
23
|
+
this.args[0],
|
|
24
|
+
];
|
|
25
|
+
}
|
|
26
|
+
}
|
|
@@ -2,7 +2,7 @@ import { Action } from '../../Action';
|
|
|
2
2
|
import { requireAddress } from '../../utils/general';
|
|
3
3
|
import { getAddr } from '../../addresses';
|
|
4
4
|
import { EthAddress, uint256 } from '../../types';
|
|
5
|
-
import {
|
|
5
|
+
import { CONFIG } from '../../config';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* LlamaLendCreateAction - Action that creates a llamalend position on behalf of proxy
|
|
@@ -26,6 +26,7 @@ export class LlamaLendCreateAction extends Action {
|
|
|
26
26
|
collateralAmount: uint256,
|
|
27
27
|
debtAmount: uint256,
|
|
28
28
|
nBands: uint256,
|
|
29
|
+
debtAsset: EthAddress,
|
|
29
30
|
) {
|
|
30
31
|
requireAddress(to);
|
|
31
32
|
super(
|
|
@@ -43,7 +44,7 @@ export class LlamaLendCreateAction extends Action {
|
|
|
43
44
|
async getAssetsToApprove() {
|
|
44
45
|
return [{
|
|
45
46
|
owner: this.args[1],
|
|
46
|
-
asset:
|
|
47
|
+
asset: this.args[6],
|
|
47
48
|
}];
|
|
48
49
|
}
|
|
49
50
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress } from '../../types';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @category LlamaLend
|
|
8
|
+
*/
|
|
9
|
+
export class LlamaLendGetDebtAction extends Action {
|
|
10
|
+
constructor(controllerAddr:EthAddress, debtor:EthAddress) {
|
|
11
|
+
super(
|
|
12
|
+
'LlamaLendGetDebt',
|
|
13
|
+
getAddr('LlamaLendGetDebt'),
|
|
14
|
+
[
|
|
15
|
+
'address',
|
|
16
|
+
'address',
|
|
17
|
+
],
|
|
18
|
+
[controllerAddr, debtor],
|
|
19
|
+
);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256, uint32 } from '../../types';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @category LlamaLend
|
|
8
|
+
*/
|
|
9
|
+
export class LlamaLendLevCreateAction extends Action {
|
|
10
|
+
constructor(controller: EthAddress, controllerId: uint256, from: EthAddress, collAmount: uint256, nBands: uint256, exchangeOrder: Array<any>, gasUsed: uint32) {
|
|
11
|
+
super(
|
|
12
|
+
'LlamaLendLevCreate',
|
|
13
|
+
getAddr('LlamaLendLevCreate'),
|
|
14
|
+
[
|
|
15
|
+
'address',
|
|
16
|
+
'uint256',
|
|
17
|
+
'address',
|
|
18
|
+
'uint256',
|
|
19
|
+
'uint256',
|
|
20
|
+
['address', 'address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'address', 'bytes', ['address', 'address', 'address', 'uint256', 'uint256', 'bytes']],
|
|
21
|
+
'uint32',
|
|
22
|
+
],
|
|
23
|
+
[controller, controllerId, from, collAmount, nBands, exchangeOrder, gasUsed],
|
|
24
|
+
);
|
|
25
|
+
this.mappableArgs = [
|
|
26
|
+
this.args[0],
|
|
27
|
+
this.args[1],
|
|
28
|
+
this.args[2],
|
|
29
|
+
this.args[3],
|
|
30
|
+
];
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
async getAssetsToApprove() {
|
|
34
|
+
return [{
|
|
35
|
+
owner: this.args[1],
|
|
36
|
+
asset: this.args[5][1],
|
|
37
|
+
}];
|
|
38
|
+
}
|
|
39
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Action } from '../../Action';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
3
|
import { EthAddress, uint256, int256 } from '../../types';
|
|
4
|
-
import { controllerToDebtAssetMap } from '../../utils/llamalend-utils';
|
|
5
4
|
|
|
6
5
|
/**
|
|
7
6
|
* LlamaLendPaybackAction - Action that pays back debt asset to a llamalend position
|
|
@@ -9,14 +8,6 @@ import { controllerToDebtAssetMap } from '../../utils/llamalend-utils';
|
|
|
9
8
|
* @category LlamaLend
|
|
10
9
|
*/
|
|
11
10
|
export class LlamaLendPaybackAction extends Action {
|
|
12
|
-
/**
|
|
13
|
-
* address controllerAddress - Address of the llamalend market controller
|
|
14
|
-
* address from - Address from which to pull debt asset, will default to proxy
|
|
15
|
-
* address onBehalfOf - Address for which we are paying back debt, will default to proxy
|
|
16
|
-
* address to - Address that will receive the debt asset and collateral asset if close, will default to proxy
|
|
17
|
-
* uint256 debtAmount - Amount of debt asset to payback
|
|
18
|
-
* int256 maxActiveBand - Don't allow active band to be higher than this (to prevent front-running the repay)
|
|
19
|
-
*/
|
|
20
11
|
/// @dev debtAmount must be non-zero
|
|
21
12
|
/// @dev if debtAmount >= debt will repay whole debt and close the position, transfering collateral
|
|
22
13
|
constructor(
|
|
@@ -26,6 +17,7 @@ export class LlamaLendPaybackAction extends Action {
|
|
|
26
17
|
to: EthAddress,
|
|
27
18
|
debtAmount: uint256,
|
|
28
19
|
maxActiveBand: int256,
|
|
20
|
+
debtAsset: EthAddress,
|
|
29
21
|
) {
|
|
30
22
|
super(
|
|
31
23
|
'LlamaLendPayback',
|
|
@@ -42,7 +34,7 @@ export class LlamaLendPaybackAction extends Action {
|
|
|
42
34
|
async getAssetsToApprove() {
|
|
43
35
|
return [{
|
|
44
36
|
owner: this.args[1],
|
|
45
|
-
asset:
|
|
37
|
+
asset: this.args[6],
|
|
46
38
|
}];
|
|
47
39
|
}
|
|
48
40
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256, uint32 } from '../../types';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @category LlamaLend
|
|
8
|
+
*/
|
|
9
|
+
export class LlamaLendRepayAction extends Action {
|
|
10
|
+
constructor(controller: EthAddress, controllerId: uint256, exchangeOrder: Array<any>, to: EthAddress, gasUsed: uint32) {
|
|
11
|
+
super(
|
|
12
|
+
'LlamaLendRepay',
|
|
13
|
+
getAddr('LlamaLendRepay'),
|
|
14
|
+
[
|
|
15
|
+
'address',
|
|
16
|
+
'uint256',
|
|
17
|
+
['address', 'address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'address', 'bytes', ['address', 'address', 'address', 'uint256', 'uint256', 'bytes']],
|
|
18
|
+
'address',
|
|
19
|
+
'uint32',
|
|
20
|
+
],
|
|
21
|
+
[controller, controllerId, exchangeOrder, to, gasUsed],
|
|
22
|
+
);
|
|
23
|
+
this.mappableArgs = [
|
|
24
|
+
this.args[0],
|
|
25
|
+
this.args[2],
|
|
26
|
+
];
|
|
27
|
+
}
|
|
28
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Action } from '../../Action';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
|
+
import { CONFIG } from '../../config';
|
|
3
4
|
import { EthAddress, uint256 } from '../../types';
|
|
4
|
-
import { controllerToDebtAssetMap } from '../../utils/llamalend-utils';
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
*
|
|
@@ -19,6 +19,7 @@ export class LlamaLendSelfLiquidateAction extends Action {
|
|
|
19
19
|
minDebtAssetExpected: uint256,
|
|
20
20
|
from: EthAddress,
|
|
21
21
|
to: EthAddress,
|
|
22
|
+
debtAsset: EthAddress,
|
|
22
23
|
) {
|
|
23
24
|
super(
|
|
24
25
|
'LlamaLendSelfLiquidate',
|
|
@@ -35,7 +36,7 @@ export class LlamaLendSelfLiquidateAction extends Action {
|
|
|
35
36
|
async getAssetsToApprove() {
|
|
36
37
|
return [{
|
|
37
38
|
owner: this.args[2],
|
|
38
|
-
asset:
|
|
39
|
+
asset: this.args[4],
|
|
39
40
|
}];
|
|
40
41
|
}
|
|
41
42
|
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256, uint32 } from '../../types';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* @category LlamaLend
|
|
8
|
+
*/
|
|
9
|
+
export class LlamaLendSelfLiquidateWithCollAction extends Action {
|
|
10
|
+
constructor(controller: EthAddress, controllerId: uint256, percentage: uint256, minCrvUsdExpected: uint256, exchangeOrder: Array<any>, to: EthAddress, sellAllCollateral: boolean, gasUsed: uint32) {
|
|
11
|
+
super(
|
|
12
|
+
'LlamaLendSelfLiquidateWithColl',
|
|
13
|
+
getAddr('LlamaLendSelfLiquidateWithColl'),
|
|
14
|
+
[
|
|
15
|
+
'address',
|
|
16
|
+
'uint256',
|
|
17
|
+
'uint256',
|
|
18
|
+
'uint256',
|
|
19
|
+
['address', 'address', 'uint256', 'uint256', 'uint256', 'uint256', 'address', 'address', 'bytes', ['address', 'address', 'address', 'uint256', 'uint256', 'bytes']],
|
|
20
|
+
'address',
|
|
21
|
+
'bool',
|
|
22
|
+
'uint32',
|
|
23
|
+
],
|
|
24
|
+
[controller, controllerId, percentage, minCrvUsdExpected, exchangeOrder, to, sellAllCollateral, gasUsed],
|
|
25
|
+
);
|
|
26
|
+
this.mappableArgs = [
|
|
27
|
+
this.args[0],
|
|
28
|
+
this.args[1],
|
|
29
|
+
this.args[2],
|
|
30
|
+
this.args[4],
|
|
31
|
+
];
|
|
32
|
+
}
|
|
33
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Action } from '../../Action';
|
|
2
2
|
import { getAddr } from '../../addresses';
|
|
3
3
|
import { EthAddress, uint256 } from '../../types';
|
|
4
|
-
import { controllerToCollateralAssetMap } from '../../utils/llamalend-utils';
|
|
5
4
|
|
|
6
5
|
|
|
7
6
|
/**
|
|
@@ -22,6 +21,7 @@ export class LlamaLendSupplyAction extends Action {
|
|
|
22
21
|
from: EthAddress,
|
|
23
22
|
onBehalfOf: EthAddress,
|
|
24
23
|
collateralAmount: uint256,
|
|
24
|
+
collAsset: EthAddress,
|
|
25
25
|
) {
|
|
26
26
|
super(
|
|
27
27
|
'LlamaLendSupply',
|
|
@@ -38,7 +38,7 @@ export class LlamaLendSupplyAction extends Action {
|
|
|
38
38
|
async getAssetsToApprove() {
|
|
39
39
|
return [{
|
|
40
40
|
owner: this.args[1],
|
|
41
|
-
asset:
|
|
41
|
+
asset: this.args[4],
|
|
42
42
|
}];
|
|
43
43
|
}
|
|
44
44
|
}
|
|
@@ -3,4 +3,9 @@ export * from './LlamaLendWithdrawAction';
|
|
|
3
3
|
export * from './LlamaLendSupplyAction';
|
|
4
4
|
export * from './LlamaLendCreateAction';
|
|
5
5
|
export * from './LlamaLendPaybackAction';
|
|
6
|
-
export * from './LlamaLendSelfLiquidateAction';
|
|
6
|
+
export * from './LlamaLendSelfLiquidateAction';
|
|
7
|
+
export * from './LlamaLendGetDebtAction';
|
|
8
|
+
export * from './LlamaLendLevCreateAction';
|
|
9
|
+
export * from './LlamaLendBoostAction';
|
|
10
|
+
export * from './LlamaLendRepayAction';
|
|
11
|
+
export * from './LlamaLendSelfLiquidateWithCollAction';
|
package/src/addresses.ts
CHANGED
|
@@ -268,6 +268,11 @@ export const actionAddresses = {
|
|
|
268
268
|
LlamaLendWithdraw: '0x2593Da3c4110C531541424e9e847cd7905894C52',
|
|
269
269
|
LlamaLendPayback: '0x5b506b7a0117dbcd086632575da599bb603eb602',
|
|
270
270
|
LlamaLendSelfLiquidate: '0xe4944e0e46177300fa4c351ef72b95b9655e8394',
|
|
271
|
+
LlamaLendGetDebt: '0x5625ea9fcd930d5f131b0261ec4dcaf279fea4ed',
|
|
272
|
+
LlamaLendBoost: '0xa21c1ce7318c6d38a10de44c2cd5d80514437d85',
|
|
273
|
+
LlamaLendRepay: '0x57693f72E628A3F7323D31De35Bd158493Aa9CC0',
|
|
274
|
+
LlamaLendLevCreate: '0x534b704a62385cfe5EEB8d9605419743d4fe105E',
|
|
275
|
+
LlamaLendSelfLiquidateWithColl: '0xc20460aabdb89e55c2d29067e031d170f2fb10e5',
|
|
271
276
|
|
|
272
277
|
MerklClaim: '0xE88036F3F0D7e216D63726356cA2bC334e305fe5',
|
|
273
278
|
},
|
|
@@ -373,6 +378,19 @@ export const actionAddresses = {
|
|
|
373
378
|
UniSupplyV3: '0x55675C6041A33EE9BDd796Edaa0f098AC7F3534f',
|
|
374
379
|
UniWithdrawV3: '0xa004c22eFd0CD87847DE83Ce9ab92af5382c2efe',
|
|
375
380
|
UniCreatePoolV3: '0x334Ab3C12a4c0315566fd9308880Dad71F838Dc5',
|
|
381
|
+
|
|
382
|
+
// llamalend
|
|
383
|
+
LlamaLendCreate: '0xaf14226ad0d782c71d3acf94ad02d6a39c89ec79',
|
|
384
|
+
LlamaLendSupply: '0x8f0814709d6d8b7c4b3021f7cb80e08476bc6959',
|
|
385
|
+
LlamaLendBorrow: '0x4948135f8b3a8f3b51fbd1050f5d0f755accb8e7',
|
|
386
|
+
LlamaLendWithdraw: '0xd7a80e7a2296d75cd1eebc2f0de0cebd14fbe117',
|
|
387
|
+
LlamaLendPayback: '0x21e05ffb9cf729630b5a9c2f01ff3b41f38be48c',
|
|
388
|
+
LlamaLendSelfLiquidate: '0xc9fd91f932d903023e887e4e4af0a298e10529a8',
|
|
389
|
+
LlamaLendGetDebt: '0x81c01f08b8fc4487501c88404ed17ebc17764f9c',
|
|
390
|
+
LlamaLendBoost: '0xc52a3af27696f8cf999463f3455e23440a376f8d',
|
|
391
|
+
LlamaLendRepay: '0x320fdfa922ee33c1cc8a042ada855c9dfe9bed06',
|
|
392
|
+
LlamaLendLevCreate: '0xe5cbdcbe494246c21851eea0642ff0791f95cc86',
|
|
393
|
+
LlamaLendSelfLiquidateWithColl: '0x4faef2cd1680ea00f9398a0525c536b2466a887b',
|
|
376
394
|
},
|
|
377
395
|
[NETWORKS.base.chainId]: {
|
|
378
396
|
// Basic
|
package/src/utils/index.ts
CHANGED
|
@@ -6,7 +6,6 @@ import mstableAssetPairs from './mstableAssetPairs';
|
|
|
6
6
|
import * as curveUtils from './curve-utils';
|
|
7
7
|
import * as curveusdUtils from './curveusd-utils';
|
|
8
8
|
import * as basicUtils from './basic-utils';
|
|
9
|
-
import * as llamaLenUtils from './llamalend-utils';
|
|
10
9
|
|
|
11
10
|
export {
|
|
12
11
|
zeroExExchange,
|
|
@@ -17,5 +16,4 @@ export {
|
|
|
17
16
|
curveUtils,
|
|
18
17
|
curveusdUtils,
|
|
19
18
|
basicUtils,
|
|
20
|
-
llamaLenUtils,
|
|
21
19
|
};
|