@defisaver/sdk 1.0.50 → 1.0.52
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/Recipe.js +1 -1
- package/esm/src/actions/aaveV3/AaveV3DelegateCredit.d.ts +19 -0
- package/esm/src/actions/aaveV3/AaveV3DelegateCredit.js +47 -0
- package/esm/src/actions/aaveV3/index.d.ts +1 -0
- package/esm/src/actions/aaveV3/index.js +1 -0
- package/esm/src/actions/basic/ApproveTokenAction.d.ts +16 -0
- package/esm/src/actions/basic/ApproveTokenAction.js +37 -0
- package/esm/src/actions/basic/index.d.ts +1 -0
- package/esm/src/actions/basic/index.js +1 -0
- package/esm/src/actions/compoundV3/CompoundV3SupplyAction.js +1 -1
- package/esm/src/actions/curveusd/CurveUsdAdjustAction.d.ts +21 -0
- package/esm/src/actions/curveusd/CurveUsdAdjustAction.js +40 -0
- package/esm/src/actions/curveusd/index.d.ts +1 -0
- package/esm/src/actions/curveusd/index.js +1 -0
- package/esm/src/actions/spark/SparkDelegateCredit.d.ts +19 -0
- package/esm/src/actions/spark/SparkDelegateCredit.js +47 -0
- package/esm/src/actions/spark/index.d.ts +1 -0
- package/esm/src/actions/spark/index.js +1 -0
- package/esm/src/addresses.d.ts +16 -0
- package/esm/src/addresses.js +4 -0
- package/esm/src/index.d.ts +64 -0
- package/package.json +2 -2
- package/src/Recipe.ts +2 -2
- package/src/actions/aaveV3/AaveV3DelegateCredit.ts +56 -0
- package/src/actions/aaveV3/index.ts +2 -1
- package/src/actions/basic/ApproveTokenAction.ts +34 -0
- package/src/actions/basic/index.ts +1 -0
- package/src/actions/compoundV3/CompoundV3SupplyAction.ts +2 -2
- package/src/actions/curveusd/CurveUsdAdjustAction.ts +45 -0
- package/src/actions/curveusd/index.ts +1 -1
- package/src/actions/spark/SparkDelegateCredit.ts +56 -0
- package/src/actions/spark/index.ts +2 -1
- package/src/addresses.ts +4 -0
- package/umd/index.js +601 -400
package/esm/src/index.d.ts
CHANGED
|
@@ -83,6 +83,7 @@ declare const actionAddressesAllChains: {
|
|
|
83
83
|
SparkSupply: string;
|
|
84
84
|
SparkSwapBorrowRateMode: string;
|
|
85
85
|
SparkWithdraw: string;
|
|
86
|
+
SparkDelegateCredit: string;
|
|
86
87
|
CompBorrow: string;
|
|
87
88
|
CompClaim: string;
|
|
88
89
|
CompPayback: string;
|
|
@@ -173,12 +174,15 @@ declare const actionAddressesAllChains: {
|
|
|
173
174
|
CurveUsdCreate: string;
|
|
174
175
|
CurveUsdPayback: string;
|
|
175
176
|
CurveUsdSupply: string;
|
|
177
|
+
CurveUsdAdjust: string;
|
|
176
178
|
CurveUsdWithdraw: string;
|
|
177
179
|
CurveUsdLevCreate: string;
|
|
178
180
|
CurveUsdRepay: string;
|
|
179
181
|
CurveUsdSwapper: string;
|
|
180
182
|
CurveUsdSelfLiquidate: string;
|
|
181
183
|
CurveUsdSelfLiquidateWithColl: string;
|
|
184
|
+
ApproveToken?: undefined;
|
|
185
|
+
AaveV3DelegateCredit?: undefined;
|
|
182
186
|
AaveV3RatioTrigger?: undefined;
|
|
183
187
|
GasFeeTakerL2?: undefined;
|
|
184
188
|
AaveV3RatioCheck?: undefined;
|
|
@@ -188,6 +192,7 @@ declare const actionAddressesAllChains: {
|
|
|
188
192
|
UnwrapEth: string;
|
|
189
193
|
SendToken: string;
|
|
190
194
|
PullToken: string;
|
|
195
|
+
ApproveToken: string;
|
|
191
196
|
SendTokenAndUnwrap: string;
|
|
192
197
|
ToggleSub: string;
|
|
193
198
|
TokenBalance: string;
|
|
@@ -201,6 +206,7 @@ declare const actionAddressesAllChains: {
|
|
|
201
206
|
AaveV3SwapBorrowRateMode: string;
|
|
202
207
|
AaveV3Withdraw: string;
|
|
203
208
|
AaveV3ClaimRewards: string;
|
|
209
|
+
AaveV3DelegateCredit: string;
|
|
204
210
|
FLAaveV3NoFee: string;
|
|
205
211
|
FLAaveV3: string;
|
|
206
212
|
FLBalancer: string;
|
|
@@ -266,6 +272,7 @@ declare const actionAddressesAllChains: {
|
|
|
266
272
|
SparkSupply?: undefined;
|
|
267
273
|
SparkSwapBorrowRateMode?: undefined;
|
|
268
274
|
SparkWithdraw?: undefined;
|
|
275
|
+
SparkDelegateCredit?: undefined;
|
|
269
276
|
CompBorrow?: undefined;
|
|
270
277
|
CompClaim?: undefined;
|
|
271
278
|
CompPayback?: undefined;
|
|
@@ -347,6 +354,7 @@ declare const actionAddressesAllChains: {
|
|
|
347
354
|
CurveUsdCreate?: undefined;
|
|
348
355
|
CurveUsdPayback?: undefined;
|
|
349
356
|
CurveUsdSupply?: undefined;
|
|
357
|
+
CurveUsdAdjust?: undefined;
|
|
350
358
|
CurveUsdWithdraw?: undefined;
|
|
351
359
|
CurveUsdLevCreate?: undefined;
|
|
352
360
|
CurveUsdRepay?: undefined;
|
|
@@ -436,6 +444,7 @@ declare const actionAddressesAllChains: {
|
|
|
436
444
|
SparkSupply?: undefined;
|
|
437
445
|
SparkSwapBorrowRateMode?: undefined;
|
|
438
446
|
SparkWithdraw?: undefined;
|
|
447
|
+
SparkDelegateCredit?: undefined;
|
|
439
448
|
CompBorrow?: undefined;
|
|
440
449
|
CompClaim?: undefined;
|
|
441
450
|
CompPayback?: undefined;
|
|
@@ -517,12 +526,15 @@ declare const actionAddressesAllChains: {
|
|
|
517
526
|
CurveUsdCreate?: undefined;
|
|
518
527
|
CurveUsdPayback?: undefined;
|
|
519
528
|
CurveUsdSupply?: undefined;
|
|
529
|
+
CurveUsdAdjust?: undefined;
|
|
520
530
|
CurveUsdWithdraw?: undefined;
|
|
521
531
|
CurveUsdLevCreate?: undefined;
|
|
522
532
|
CurveUsdRepay?: undefined;
|
|
523
533
|
CurveUsdSwapper?: undefined;
|
|
524
534
|
CurveUsdSelfLiquidate?: undefined;
|
|
525
535
|
CurveUsdSelfLiquidateWithColl?: undefined;
|
|
536
|
+
ApproveToken?: undefined;
|
|
537
|
+
AaveV3DelegateCredit?: undefined;
|
|
526
538
|
AaveV3RatioTrigger?: undefined;
|
|
527
539
|
} | {
|
|
528
540
|
DFSSell: string;
|
|
@@ -606,6 +618,7 @@ declare const actionAddressesAllChains: {
|
|
|
606
618
|
SparkSupply?: undefined;
|
|
607
619
|
SparkSwapBorrowRateMode?: undefined;
|
|
608
620
|
SparkWithdraw?: undefined;
|
|
621
|
+
SparkDelegateCredit?: undefined;
|
|
609
622
|
CompBorrow?: undefined;
|
|
610
623
|
CompClaim?: undefined;
|
|
611
624
|
CompPayback?: undefined;
|
|
@@ -686,12 +699,15 @@ declare const actionAddressesAllChains: {
|
|
|
686
699
|
CurveUsdCreate?: undefined;
|
|
687
700
|
CurveUsdPayback?: undefined;
|
|
688
701
|
CurveUsdSupply?: undefined;
|
|
702
|
+
CurveUsdAdjust?: undefined;
|
|
689
703
|
CurveUsdWithdraw?: undefined;
|
|
690
704
|
CurveUsdLevCreate?: undefined;
|
|
691
705
|
CurveUsdRepay?: undefined;
|
|
692
706
|
CurveUsdSwapper?: undefined;
|
|
693
707
|
CurveUsdSelfLiquidate?: undefined;
|
|
694
708
|
CurveUsdSelfLiquidateWithColl?: undefined;
|
|
709
|
+
ApproveToken?: undefined;
|
|
710
|
+
AaveV3DelegateCredit?: undefined;
|
|
695
711
|
AaveV3RatioTrigger?: undefined;
|
|
696
712
|
GasFeeTakerL2?: undefined;
|
|
697
713
|
AaveV3RatioCheck?: undefined;
|
|
@@ -769,6 +785,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
769
785
|
SparkSupply: string;
|
|
770
786
|
SparkSwapBorrowRateMode: string;
|
|
771
787
|
SparkWithdraw: string;
|
|
788
|
+
SparkDelegateCredit: string;
|
|
772
789
|
CompBorrow: string;
|
|
773
790
|
CompClaim: string;
|
|
774
791
|
CompPayback: string;
|
|
@@ -859,12 +876,15 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
859
876
|
CurveUsdCreate: string;
|
|
860
877
|
CurveUsdPayback: string;
|
|
861
878
|
CurveUsdSupply: string;
|
|
879
|
+
CurveUsdAdjust: string;
|
|
862
880
|
CurveUsdWithdraw: string;
|
|
863
881
|
CurveUsdLevCreate: string;
|
|
864
882
|
CurveUsdRepay: string;
|
|
865
883
|
CurveUsdSwapper: string;
|
|
866
884
|
CurveUsdSelfLiquidate: string;
|
|
867
885
|
CurveUsdSelfLiquidateWithColl: string;
|
|
886
|
+
ApproveToken?: undefined;
|
|
887
|
+
AaveV3DelegateCredit?: undefined;
|
|
868
888
|
AaveV3RatioTrigger?: undefined;
|
|
869
889
|
GasFeeTakerL2?: undefined;
|
|
870
890
|
AaveV3RatioCheck?: undefined;
|
|
@@ -874,6 +894,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
874
894
|
UnwrapEth: string;
|
|
875
895
|
SendToken: string;
|
|
876
896
|
PullToken: string;
|
|
897
|
+
ApproveToken: string;
|
|
877
898
|
SendTokenAndUnwrap: string;
|
|
878
899
|
ToggleSub: string;
|
|
879
900
|
TokenBalance: string;
|
|
@@ -887,6 +908,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
887
908
|
AaveV3SwapBorrowRateMode: string;
|
|
888
909
|
AaveV3Withdraw: string;
|
|
889
910
|
AaveV3ClaimRewards: string;
|
|
911
|
+
AaveV3DelegateCredit: string;
|
|
890
912
|
FLAaveV3NoFee: string;
|
|
891
913
|
FLAaveV3: string;
|
|
892
914
|
FLBalancer: string;
|
|
@@ -952,6 +974,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
952
974
|
SparkSupply?: undefined;
|
|
953
975
|
SparkSwapBorrowRateMode?: undefined;
|
|
954
976
|
SparkWithdraw?: undefined;
|
|
977
|
+
SparkDelegateCredit?: undefined;
|
|
955
978
|
CompBorrow?: undefined;
|
|
956
979
|
CompClaim?: undefined;
|
|
957
980
|
CompPayback?: undefined;
|
|
@@ -1033,6 +1056,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1033
1056
|
CurveUsdCreate?: undefined;
|
|
1034
1057
|
CurveUsdPayback?: undefined;
|
|
1035
1058
|
CurveUsdSupply?: undefined;
|
|
1059
|
+
CurveUsdAdjust?: undefined;
|
|
1036
1060
|
CurveUsdWithdraw?: undefined;
|
|
1037
1061
|
CurveUsdLevCreate?: undefined;
|
|
1038
1062
|
CurveUsdRepay?: undefined;
|
|
@@ -1122,6 +1146,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1122
1146
|
SparkSupply?: undefined;
|
|
1123
1147
|
SparkSwapBorrowRateMode?: undefined;
|
|
1124
1148
|
SparkWithdraw?: undefined;
|
|
1149
|
+
SparkDelegateCredit?: undefined;
|
|
1125
1150
|
CompBorrow?: undefined;
|
|
1126
1151
|
CompClaim?: undefined;
|
|
1127
1152
|
CompPayback?: undefined;
|
|
@@ -1203,12 +1228,15 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1203
1228
|
CurveUsdCreate?: undefined;
|
|
1204
1229
|
CurveUsdPayback?: undefined;
|
|
1205
1230
|
CurveUsdSupply?: undefined;
|
|
1231
|
+
CurveUsdAdjust?: undefined;
|
|
1206
1232
|
CurveUsdWithdraw?: undefined;
|
|
1207
1233
|
CurveUsdLevCreate?: undefined;
|
|
1208
1234
|
CurveUsdRepay?: undefined;
|
|
1209
1235
|
CurveUsdSwapper?: undefined;
|
|
1210
1236
|
CurveUsdSelfLiquidate?: undefined;
|
|
1211
1237
|
CurveUsdSelfLiquidateWithColl?: undefined;
|
|
1238
|
+
ApproveToken?: undefined;
|
|
1239
|
+
AaveV3DelegateCredit?: undefined;
|
|
1212
1240
|
AaveV3RatioTrigger?: undefined;
|
|
1213
1241
|
} | {
|
|
1214
1242
|
DFSSell: string;
|
|
@@ -1292,6 +1320,7 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1292
1320
|
SparkSupply?: undefined;
|
|
1293
1321
|
SparkSwapBorrowRateMode?: undefined;
|
|
1294
1322
|
SparkWithdraw?: undefined;
|
|
1323
|
+
SparkDelegateCredit?: undefined;
|
|
1295
1324
|
CompBorrow?: undefined;
|
|
1296
1325
|
CompClaim?: undefined;
|
|
1297
1326
|
CompPayback?: undefined;
|
|
@@ -1372,12 +1401,15 @@ declare const actionAddresses: (chainId?: null) => {
|
|
|
1372
1401
|
CurveUsdCreate?: undefined;
|
|
1373
1402
|
CurveUsdPayback?: undefined;
|
|
1374
1403
|
CurveUsdSupply?: undefined;
|
|
1404
|
+
CurveUsdAdjust?: undefined;
|
|
1375
1405
|
CurveUsdWithdraw?: undefined;
|
|
1376
1406
|
CurveUsdLevCreate?: undefined;
|
|
1377
1407
|
CurveUsdRepay?: undefined;
|
|
1378
1408
|
CurveUsdSwapper?: undefined;
|
|
1379
1409
|
CurveUsdSelfLiquidate?: undefined;
|
|
1380
1410
|
CurveUsdSelfLiquidateWithColl?: undefined;
|
|
1411
|
+
ApproveToken?: undefined;
|
|
1412
|
+
AaveV3DelegateCredit?: undefined;
|
|
1381
1413
|
AaveV3RatioTrigger?: undefined;
|
|
1382
1414
|
GasFeeTakerL2?: undefined;
|
|
1383
1415
|
AaveV3RatioCheck?: undefined;
|
|
@@ -1598,6 +1630,7 @@ declare const _default: {
|
|
|
1598
1630
|
SparkSupply: string;
|
|
1599
1631
|
SparkSwapBorrowRateMode: string;
|
|
1600
1632
|
SparkWithdraw: string;
|
|
1633
|
+
SparkDelegateCredit: string;
|
|
1601
1634
|
CompBorrow: string;
|
|
1602
1635
|
CompClaim: string;
|
|
1603
1636
|
CompPayback: string;
|
|
@@ -1688,12 +1721,15 @@ declare const _default: {
|
|
|
1688
1721
|
CurveUsdCreate: string;
|
|
1689
1722
|
CurveUsdPayback: string;
|
|
1690
1723
|
CurveUsdSupply: string;
|
|
1724
|
+
CurveUsdAdjust: string;
|
|
1691
1725
|
CurveUsdWithdraw: string;
|
|
1692
1726
|
CurveUsdLevCreate: string;
|
|
1693
1727
|
CurveUsdRepay: string;
|
|
1694
1728
|
CurveUsdSwapper: string;
|
|
1695
1729
|
CurveUsdSelfLiquidate: string;
|
|
1696
1730
|
CurveUsdSelfLiquidateWithColl: string;
|
|
1731
|
+
ApproveToken?: undefined;
|
|
1732
|
+
AaveV3DelegateCredit?: undefined;
|
|
1697
1733
|
AaveV3RatioTrigger?: undefined;
|
|
1698
1734
|
GasFeeTakerL2?: undefined;
|
|
1699
1735
|
AaveV3RatioCheck?: undefined;
|
|
@@ -1703,6 +1739,7 @@ declare const _default: {
|
|
|
1703
1739
|
UnwrapEth: string;
|
|
1704
1740
|
SendToken: string;
|
|
1705
1741
|
PullToken: string;
|
|
1742
|
+
ApproveToken: string;
|
|
1706
1743
|
SendTokenAndUnwrap: string;
|
|
1707
1744
|
ToggleSub: string;
|
|
1708
1745
|
TokenBalance: string;
|
|
@@ -1716,6 +1753,7 @@ declare const _default: {
|
|
|
1716
1753
|
AaveV3SwapBorrowRateMode: string;
|
|
1717
1754
|
AaveV3Withdraw: string;
|
|
1718
1755
|
AaveV3ClaimRewards: string;
|
|
1756
|
+
AaveV3DelegateCredit: string;
|
|
1719
1757
|
FLAaveV3NoFee: string;
|
|
1720
1758
|
FLAaveV3: string;
|
|
1721
1759
|
FLBalancer: string;
|
|
@@ -1781,6 +1819,7 @@ declare const _default: {
|
|
|
1781
1819
|
SparkSupply?: undefined;
|
|
1782
1820
|
SparkSwapBorrowRateMode?: undefined;
|
|
1783
1821
|
SparkWithdraw?: undefined;
|
|
1822
|
+
SparkDelegateCredit?: undefined;
|
|
1784
1823
|
CompBorrow?: undefined;
|
|
1785
1824
|
CompClaim?: undefined;
|
|
1786
1825
|
CompPayback?: undefined;
|
|
@@ -1862,6 +1901,7 @@ declare const _default: {
|
|
|
1862
1901
|
CurveUsdCreate?: undefined;
|
|
1863
1902
|
CurveUsdPayback?: undefined;
|
|
1864
1903
|
CurveUsdSupply?: undefined;
|
|
1904
|
+
CurveUsdAdjust?: undefined;
|
|
1865
1905
|
CurveUsdWithdraw?: undefined;
|
|
1866
1906
|
CurveUsdLevCreate?: undefined;
|
|
1867
1907
|
CurveUsdRepay?: undefined;
|
|
@@ -1951,6 +1991,7 @@ declare const _default: {
|
|
|
1951
1991
|
SparkSupply?: undefined;
|
|
1952
1992
|
SparkSwapBorrowRateMode?: undefined;
|
|
1953
1993
|
SparkWithdraw?: undefined;
|
|
1994
|
+
SparkDelegateCredit?: undefined;
|
|
1954
1995
|
CompBorrow?: undefined;
|
|
1955
1996
|
CompClaim?: undefined;
|
|
1956
1997
|
CompPayback?: undefined;
|
|
@@ -2032,12 +2073,15 @@ declare const _default: {
|
|
|
2032
2073
|
CurveUsdCreate?: undefined;
|
|
2033
2074
|
CurveUsdPayback?: undefined;
|
|
2034
2075
|
CurveUsdSupply?: undefined;
|
|
2076
|
+
CurveUsdAdjust?: undefined;
|
|
2035
2077
|
CurveUsdWithdraw?: undefined;
|
|
2036
2078
|
CurveUsdLevCreate?: undefined;
|
|
2037
2079
|
CurveUsdRepay?: undefined;
|
|
2038
2080
|
CurveUsdSwapper?: undefined;
|
|
2039
2081
|
CurveUsdSelfLiquidate?: undefined;
|
|
2040
2082
|
CurveUsdSelfLiquidateWithColl?: undefined;
|
|
2083
|
+
ApproveToken?: undefined;
|
|
2084
|
+
AaveV3DelegateCredit?: undefined;
|
|
2041
2085
|
AaveV3RatioTrigger?: undefined;
|
|
2042
2086
|
} | {
|
|
2043
2087
|
DFSSell: string;
|
|
@@ -2121,6 +2165,7 @@ declare const _default: {
|
|
|
2121
2165
|
SparkSupply?: undefined;
|
|
2122
2166
|
SparkSwapBorrowRateMode?: undefined;
|
|
2123
2167
|
SparkWithdraw?: undefined;
|
|
2168
|
+
SparkDelegateCredit?: undefined;
|
|
2124
2169
|
CompBorrow?: undefined;
|
|
2125
2170
|
CompClaim?: undefined;
|
|
2126
2171
|
CompPayback?: undefined;
|
|
@@ -2201,12 +2246,15 @@ declare const _default: {
|
|
|
2201
2246
|
CurveUsdCreate?: undefined;
|
|
2202
2247
|
CurveUsdPayback?: undefined;
|
|
2203
2248
|
CurveUsdSupply?: undefined;
|
|
2249
|
+
CurveUsdAdjust?: undefined;
|
|
2204
2250
|
CurveUsdWithdraw?: undefined;
|
|
2205
2251
|
CurveUsdLevCreate?: undefined;
|
|
2206
2252
|
CurveUsdRepay?: undefined;
|
|
2207
2253
|
CurveUsdSwapper?: undefined;
|
|
2208
2254
|
CurveUsdSelfLiquidate?: undefined;
|
|
2209
2255
|
CurveUsdSelfLiquidateWithColl?: undefined;
|
|
2256
|
+
ApproveToken?: undefined;
|
|
2257
|
+
AaveV3DelegateCredit?: undefined;
|
|
2210
2258
|
AaveV3RatioTrigger?: undefined;
|
|
2211
2259
|
GasFeeTakerL2?: undefined;
|
|
2212
2260
|
AaveV3RatioCheck?: undefined;
|
|
@@ -2284,6 +2332,7 @@ declare const _default: {
|
|
|
2284
2332
|
SparkSupply: string;
|
|
2285
2333
|
SparkSwapBorrowRateMode: string;
|
|
2286
2334
|
SparkWithdraw: string;
|
|
2335
|
+
SparkDelegateCredit: string;
|
|
2287
2336
|
CompBorrow: string;
|
|
2288
2337
|
CompClaim: string;
|
|
2289
2338
|
CompPayback: string;
|
|
@@ -2374,12 +2423,15 @@ declare const _default: {
|
|
|
2374
2423
|
CurveUsdCreate: string;
|
|
2375
2424
|
CurveUsdPayback: string;
|
|
2376
2425
|
CurveUsdSupply: string;
|
|
2426
|
+
CurveUsdAdjust: string;
|
|
2377
2427
|
CurveUsdWithdraw: string;
|
|
2378
2428
|
CurveUsdLevCreate: string;
|
|
2379
2429
|
CurveUsdRepay: string;
|
|
2380
2430
|
CurveUsdSwapper: string;
|
|
2381
2431
|
CurveUsdSelfLiquidate: string;
|
|
2382
2432
|
CurveUsdSelfLiquidateWithColl: string;
|
|
2433
|
+
ApproveToken?: undefined;
|
|
2434
|
+
AaveV3DelegateCredit?: undefined;
|
|
2383
2435
|
AaveV3RatioTrigger?: undefined;
|
|
2384
2436
|
GasFeeTakerL2?: undefined;
|
|
2385
2437
|
AaveV3RatioCheck?: undefined;
|
|
@@ -2389,6 +2441,7 @@ declare const _default: {
|
|
|
2389
2441
|
UnwrapEth: string;
|
|
2390
2442
|
SendToken: string;
|
|
2391
2443
|
PullToken: string;
|
|
2444
|
+
ApproveToken: string;
|
|
2392
2445
|
SendTokenAndUnwrap: string;
|
|
2393
2446
|
ToggleSub: string;
|
|
2394
2447
|
TokenBalance: string;
|
|
@@ -2402,6 +2455,7 @@ declare const _default: {
|
|
|
2402
2455
|
AaveV3SwapBorrowRateMode: string;
|
|
2403
2456
|
AaveV3Withdraw: string;
|
|
2404
2457
|
AaveV3ClaimRewards: string;
|
|
2458
|
+
AaveV3DelegateCredit: string;
|
|
2405
2459
|
FLAaveV3NoFee: string;
|
|
2406
2460
|
FLAaveV3: string;
|
|
2407
2461
|
FLBalancer: string;
|
|
@@ -2467,6 +2521,7 @@ declare const _default: {
|
|
|
2467
2521
|
SparkSupply?: undefined;
|
|
2468
2522
|
SparkSwapBorrowRateMode?: undefined;
|
|
2469
2523
|
SparkWithdraw?: undefined;
|
|
2524
|
+
SparkDelegateCredit?: undefined;
|
|
2470
2525
|
CompBorrow?: undefined;
|
|
2471
2526
|
CompClaim?: undefined;
|
|
2472
2527
|
CompPayback?: undefined;
|
|
@@ -2548,6 +2603,7 @@ declare const _default: {
|
|
|
2548
2603
|
CurveUsdCreate?: undefined;
|
|
2549
2604
|
CurveUsdPayback?: undefined;
|
|
2550
2605
|
CurveUsdSupply?: undefined;
|
|
2606
|
+
CurveUsdAdjust?: undefined;
|
|
2551
2607
|
CurveUsdWithdraw?: undefined;
|
|
2552
2608
|
CurveUsdLevCreate?: undefined;
|
|
2553
2609
|
CurveUsdRepay?: undefined;
|
|
@@ -2637,6 +2693,7 @@ declare const _default: {
|
|
|
2637
2693
|
SparkSupply?: undefined;
|
|
2638
2694
|
SparkSwapBorrowRateMode?: undefined;
|
|
2639
2695
|
SparkWithdraw?: undefined;
|
|
2696
|
+
SparkDelegateCredit?: undefined;
|
|
2640
2697
|
CompBorrow?: undefined;
|
|
2641
2698
|
CompClaim?: undefined;
|
|
2642
2699
|
CompPayback?: undefined;
|
|
@@ -2718,12 +2775,15 @@ declare const _default: {
|
|
|
2718
2775
|
CurveUsdCreate?: undefined;
|
|
2719
2776
|
CurveUsdPayback?: undefined;
|
|
2720
2777
|
CurveUsdSupply?: undefined;
|
|
2778
|
+
CurveUsdAdjust?: undefined;
|
|
2721
2779
|
CurveUsdWithdraw?: undefined;
|
|
2722
2780
|
CurveUsdLevCreate?: undefined;
|
|
2723
2781
|
CurveUsdRepay?: undefined;
|
|
2724
2782
|
CurveUsdSwapper?: undefined;
|
|
2725
2783
|
CurveUsdSelfLiquidate?: undefined;
|
|
2726
2784
|
CurveUsdSelfLiquidateWithColl?: undefined;
|
|
2785
|
+
ApproveToken?: undefined;
|
|
2786
|
+
AaveV3DelegateCredit?: undefined;
|
|
2727
2787
|
AaveV3RatioTrigger?: undefined;
|
|
2728
2788
|
} | {
|
|
2729
2789
|
DFSSell: string;
|
|
@@ -2807,6 +2867,7 @@ declare const _default: {
|
|
|
2807
2867
|
SparkSupply?: undefined;
|
|
2808
2868
|
SparkSwapBorrowRateMode?: undefined;
|
|
2809
2869
|
SparkWithdraw?: undefined;
|
|
2870
|
+
SparkDelegateCredit?: undefined;
|
|
2810
2871
|
CompBorrow?: undefined;
|
|
2811
2872
|
CompClaim?: undefined;
|
|
2812
2873
|
CompPayback?: undefined;
|
|
@@ -2887,12 +2948,15 @@ declare const _default: {
|
|
|
2887
2948
|
CurveUsdCreate?: undefined;
|
|
2888
2949
|
CurveUsdPayback?: undefined;
|
|
2889
2950
|
CurveUsdSupply?: undefined;
|
|
2951
|
+
CurveUsdAdjust?: undefined;
|
|
2890
2952
|
CurveUsdWithdraw?: undefined;
|
|
2891
2953
|
CurveUsdLevCreate?: undefined;
|
|
2892
2954
|
CurveUsdRepay?: undefined;
|
|
2893
2955
|
CurveUsdSwapper?: undefined;
|
|
2894
2956
|
CurveUsdSelfLiquidate?: undefined;
|
|
2895
2957
|
CurveUsdSelfLiquidateWithColl?: undefined;
|
|
2958
|
+
ApproveToken?: undefined;
|
|
2959
|
+
AaveV3DelegateCredit?: undefined;
|
|
2896
2960
|
AaveV3RatioTrigger?: undefined;
|
|
2897
2961
|
GasFeeTakerL2?: undefined;
|
|
2898
2962
|
AaveV3RatioCheck?: undefined;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@defisaver/sdk",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.52",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./umd/index.js",
|
|
6
6
|
"module": "./esm/src/index.js",
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"license": "ISC",
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@defisaver/eslint-config": "^1.0.0",
|
|
23
|
-
"@defisaver/tokens": "^1.
|
|
23
|
+
"@defisaver/tokens": "^1.5.0",
|
|
24
24
|
"@ethersproject/address": "^5.0.10",
|
|
25
25
|
"@ethersproject/solidity": "^5.0.9",
|
|
26
26
|
"@types/web3-eth-abi": "^1.2.2",
|
package/src/Recipe.ts
CHANGED
|
@@ -90,7 +90,7 @@ export class Recipe {
|
|
|
90
90
|
* Approval is done from owner to DsProxy
|
|
91
91
|
*/
|
|
92
92
|
async getAssetsToApprove() : Promise<Array<{ owner: string, asset: string, specialApproveLabel?: string } | { owner: string, nft: EthAddress, tokenId: string, specialApproveLabel?: string }>> {
|
|
93
|
-
const uniqueAssetOwnerPairs : Array<{ owner: string, asset: string, specialApproveLabel?: string,
|
|
93
|
+
const uniqueAssetOwnerPairs : Array<{ owner: string, asset: string, specialApproveLabel?: string, tokenId?: string } | { owner: string, nft: EthAddress, tokenId: string, specialApproveLabel?: string, [key: string]:any }> = [];
|
|
94
94
|
const assetOwnerPairs = await Promise.all(this.actions.map(a => a.getAssetsToApprove()));
|
|
95
95
|
for (const pairsPerAction of assetOwnerPairs) {
|
|
96
96
|
for (const pair of pairsPerAction) {
|
|
@@ -109,7 +109,7 @@ export class Recipe {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
|
-
return uniqueAssetOwnerPairs.filter(({
|
|
112
|
+
return uniqueAssetOwnerPairs.filter(({ asset }) => !utils.compare(asset, getAssetInfo('ETH').address));
|
|
113
113
|
}
|
|
114
114
|
|
|
115
115
|
/**
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ActionWithL2 } from '../../ActionWithL2';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import {
|
|
4
|
+
EthAddress, uint8, uint16, uint256,
|
|
5
|
+
} from '../../types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* AaveV3DelegateCredit - Delegate credit
|
|
9
|
+
*
|
|
10
|
+
* @category AaveV3
|
|
11
|
+
*/
|
|
12
|
+
export class AaveV3DelegateCredit extends ActionWithL2 {
|
|
13
|
+
/**
|
|
14
|
+
* @param useOnDefaultMarket If this is true it defaults to the hardcoded market in contract
|
|
15
|
+
* @param market Address provider for specific market
|
|
16
|
+
* @param amount Amount of tokens to be payed back
|
|
17
|
+
* @param rateMode Type of borrow debt [Stable: 1, Variable: 2]
|
|
18
|
+
* @param assetId The id of the token to be borrowed
|
|
19
|
+
* @param delegatee The id of the underlying asset to be repaid
|
|
20
|
+
*/
|
|
21
|
+
constructor(useOnDefaultMarket: boolean, market:EthAddress, amount:uint256, rateMode:uint8, assetId:uint16, delegatee:EthAddress) {
|
|
22
|
+
super('AaveV3DelegateCredit', getAddr('AaveV3DelegateCredit'),
|
|
23
|
+
['uint256', 'address', 'uint16', 'uint8', 'bool', 'address'],
|
|
24
|
+
[amount, delegatee, assetId, rateMode, useOnDefaultMarket, market],
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
this.mappableArgs = [
|
|
28
|
+
this.args[0],
|
|
29
|
+
this.args[1],
|
|
30
|
+
this.args[2],
|
|
31
|
+
this.args[3],
|
|
32
|
+
this.args[4],
|
|
33
|
+
this.args[5],
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
encodeInputs() {
|
|
38
|
+
// executeActionDirectL2
|
|
39
|
+
let encodedInput = '0x2895f3aa';
|
|
40
|
+
// amount
|
|
41
|
+
encodedInput = encodedInput.concat(this.numberToBytes32(this.args[0]));
|
|
42
|
+
// delegatee
|
|
43
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[1]));
|
|
44
|
+
// assetId
|
|
45
|
+
encodedInput = encodedInput.concat(this.numberToBytes2(this.args[2]));
|
|
46
|
+
// rateMode
|
|
47
|
+
encodedInput = encodedInput.concat(this.numberToBytes1(this.args[3]));
|
|
48
|
+
// useDefaultMarket
|
|
49
|
+
encodedInput = encodedInput.concat(this.boolToBytes1(this.args[4]));
|
|
50
|
+
if (!this.args[4]) {
|
|
51
|
+
// market
|
|
52
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[5]));
|
|
53
|
+
}
|
|
54
|
+
return encodedInput;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -6,4 +6,5 @@ export * from './AaveV3SetEModeAction';
|
|
|
6
6
|
export * from './AaveV3ATokenPaybackAction';
|
|
7
7
|
export * from './AaveV3CollateralSwitchAction';
|
|
8
8
|
export * from './AaveV3ClaimRewardsAction';
|
|
9
|
-
export * from './AaveV3SwapBorrowRateModeAction';
|
|
9
|
+
export * from './AaveV3SwapBorrowRateModeAction';
|
|
10
|
+
export * from './AaveV3DelegateCredit';
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { requireAddress } from '../../utils/general';
|
|
2
|
+
import { Action } from '../../Action';
|
|
3
|
+
import { getAddr } from '../../addresses';
|
|
4
|
+
import { EthAddress, uint256 } from '../../types';
|
|
5
|
+
|
|
6
|
+
/**
|
|
7
|
+
* Approve a spender to pull tokens from DSProxy
|
|
8
|
+
*
|
|
9
|
+
* @category BasicActions
|
|
10
|
+
*/
|
|
11
|
+
export class ApproveTokenAction extends Action {
|
|
12
|
+
/**
|
|
13
|
+
* @param token Token address
|
|
14
|
+
* @param spender Address getting allowance to pull tokens from proxy
|
|
15
|
+
* @param amount Allowance amount
|
|
16
|
+
*/
|
|
17
|
+
constructor(token:EthAddress, spender:EthAddress, amount:uint256) {
|
|
18
|
+
requireAddress(spender);
|
|
19
|
+
super(
|
|
20
|
+
'ApproveToken',
|
|
21
|
+
getAddr('ApproveToken'),
|
|
22
|
+
[
|
|
23
|
+
'address',
|
|
24
|
+
'address',
|
|
25
|
+
'uint',
|
|
26
|
+
],
|
|
27
|
+
[token, spender, amount],
|
|
28
|
+
);
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async getAssetsToApprove() {
|
|
32
|
+
return [];
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -34,7 +34,7 @@ export class CompoundV3SupplyAction extends Action {
|
|
|
34
34
|
async getAssetsToApprove() {
|
|
35
35
|
const asset = getAssetInfoByAddress(this.tokenForApproval);
|
|
36
36
|
|
|
37
|
-
if (asset.symbol !== 'ETH') return [{ asset: this.tokenForApproval, owner: this.args[
|
|
37
|
+
if (asset.symbol !== 'ETH') return [{ asset: this.tokenForApproval, owner: this.args[3] }];
|
|
38
38
|
return [];
|
|
39
39
|
}
|
|
40
|
-
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { Action } from '../../Action';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import { EthAddress, uint256 } from '../../types';
|
|
4
|
+
import { controllerToAssetMap } from '../../utils/curveusd-utils';
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* CurveUsdAdjustAction - Action that supplies collateral to a curveusd position and borrows more crvUSD
|
|
9
|
+
*
|
|
10
|
+
* @category CurveUsd
|
|
11
|
+
*/
|
|
12
|
+
export class CurveUsdAdjustAction extends Action {
|
|
13
|
+
/**
|
|
14
|
+
* address controllerAddress - Address of the curveusd market controller
|
|
15
|
+
* address from - Address from which to pull collateral asset, will default to proxy
|
|
16
|
+
* address to - Address which will receive borrowed crvUSD
|
|
17
|
+
* uint256 supplyAmount - Amount of collateral asset to supply (can be zero, can be max.uint)
|
|
18
|
+
* uint256 borrowAmount - Amount of debt asset to borrow (must be non-zero)
|
|
19
|
+
*/
|
|
20
|
+
constructor(
|
|
21
|
+
controllerAddress: EthAddress,
|
|
22
|
+
from: EthAddress,
|
|
23
|
+
to: EthAddress,
|
|
24
|
+
supplyAmount: uint256,
|
|
25
|
+
borrowAmount: uint256,
|
|
26
|
+
) {
|
|
27
|
+
super(
|
|
28
|
+
'CurveUsdAdjust',
|
|
29
|
+
getAddr('CurveUsdAdjust'),
|
|
30
|
+
['address', 'address', 'address', 'uint256', 'uint256'],
|
|
31
|
+
[controllerAddress, from, to, supplyAmount, borrowAmount],
|
|
32
|
+
);
|
|
33
|
+
|
|
34
|
+
this.mappableArgs = [
|
|
35
|
+
...this.args,
|
|
36
|
+
];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
async getAssetsToApprove() {
|
|
40
|
+
return [{
|
|
41
|
+
owner: this.args[1],
|
|
42
|
+
asset: controllerToAssetMap[this.args[0] as keyof typeof controllerToAssetMap],
|
|
43
|
+
}];
|
|
44
|
+
}
|
|
45
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { ActionWithL2 } from '../../ActionWithL2';
|
|
2
|
+
import { getAddr } from '../../addresses';
|
|
3
|
+
import {
|
|
4
|
+
EthAddress, uint8, uint16, uint256,
|
|
5
|
+
} from '../../types';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* SparkDelegateCredit - Delegate credit
|
|
9
|
+
*
|
|
10
|
+
* @category Spark
|
|
11
|
+
*/
|
|
12
|
+
export class SparkDelegateCredit extends ActionWithL2 {
|
|
13
|
+
/**
|
|
14
|
+
* @param useOnDefaultMarket If this is true it defaults to the hardcoded market in contract
|
|
15
|
+
* @param market Address provider for specific market
|
|
16
|
+
* @param amount Amount of tokens to be payed back
|
|
17
|
+
* @param rateMode Type of borrow debt [Stable: 1, Variable: 2]
|
|
18
|
+
* @param assetId The id of the token to be borrowed
|
|
19
|
+
* @param delegatee The id of the underlying asset to be repaid
|
|
20
|
+
*/
|
|
21
|
+
constructor(useOnDefaultMarket: boolean, market:EthAddress, amount:uint256, rateMode:uint8, assetId:uint16, delegatee:EthAddress) {
|
|
22
|
+
super('SparkDelegateCredit', getAddr('SparkDelegateCredit'),
|
|
23
|
+
['uint256', 'address', 'uint16', 'uint8', 'bool', 'address'],
|
|
24
|
+
[amount, delegatee, assetId, rateMode, useOnDefaultMarket, market],
|
|
25
|
+
);
|
|
26
|
+
|
|
27
|
+
this.mappableArgs = [
|
|
28
|
+
this.args[0],
|
|
29
|
+
this.args[1],
|
|
30
|
+
this.args[2],
|
|
31
|
+
this.args[3],
|
|
32
|
+
this.args[4],
|
|
33
|
+
this.args[5],
|
|
34
|
+
];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
encodeInputs() {
|
|
38
|
+
// executeActionDirectL2
|
|
39
|
+
let encodedInput = '0x2895f3aa';
|
|
40
|
+
// amount
|
|
41
|
+
encodedInput = encodedInput.concat(this.numberToBytes32(this.args[0]));
|
|
42
|
+
// delegatee
|
|
43
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[1]));
|
|
44
|
+
// assetId
|
|
45
|
+
encodedInput = encodedInput.concat(this.numberToBytes2(this.args[2]));
|
|
46
|
+
// rateMode
|
|
47
|
+
encodedInput = encodedInput.concat(this.numberToBytes1(this.args[3]));
|
|
48
|
+
// useDefaultMarket
|
|
49
|
+
encodedInput = encodedInput.concat(this.boolToBytes1(this.args[4]));
|
|
50
|
+
if (!this.args[4]) {
|
|
51
|
+
// market
|
|
52
|
+
encodedInput = encodedInput.concat(this.addressToBytes20(this.args[5]));
|
|
53
|
+
}
|
|
54
|
+
return encodedInput;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
@@ -6,4 +6,5 @@ export * from './SparkSetEModeAction';
|
|
|
6
6
|
export * from './SparkSpTokenPaybackAction';
|
|
7
7
|
export * from './SparkCollateralSwitchAction';
|
|
8
8
|
export * from './SparkClaimRewardsAction';
|
|
9
|
-
export * from './SparkSwapBorrowRateModeAction';
|
|
9
|
+
export * from './SparkSwapBorrowRateModeAction';
|
|
10
|
+
export * from './SparkDelegateCredit';
|