@curvefi/llamalend-api 2.0.0 → 2.0.1
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/lib/lendMarkets/LendMarketTemplate.js +8 -0
- package/lib/lendMarkets/interfaces/v1/loanV1.d.ts +8 -0
- package/lib/lendMarkets/interfaces/v2/loanV2.d.ts +8 -0
- package/lib/lendMarkets/modules/common/loanBase.d.ts +8 -0
- package/lib/lendMarkets/modules/common/loanBase.js +8 -0
- package/package.json +1 -1
- package/src/lendMarkets/LendMarketTemplate.ts +9 -1
- package/src/lendMarkets/interfaces/v1/loanV1.ts +8 -0
- package/src/lendMarkets/interfaces/v2/loanV2.ts +8 -0
- package/src/lendMarkets/modules/common/loanBase.ts +9 -1
|
@@ -159,14 +159,22 @@ export class LendMarketTemplate {
|
|
|
159
159
|
partialSelfLiquidateApprove: loan.partialSelfLiquidateApprove.bind(loan),
|
|
160
160
|
partialSelfLiquidate: loan.partialSelfLiquidate.bind(loan),
|
|
161
161
|
estimateGas: {
|
|
162
|
+
createLoanApprove: loan.estimateGas.createLoanApprove,
|
|
162
163
|
createLoan: loan.createLoanEstimateGas.bind(loan),
|
|
164
|
+
borrowMoreApprove: loan.estimateGas.borrowMoreApprove,
|
|
163
165
|
borrowMore: loan.borrowMoreEstimateGas.bind(loan),
|
|
166
|
+
addCollateralApprove: loan.estimateGas.addCollateralApprove,
|
|
164
167
|
addCollateral: loan.addCollateralEstimateGas.bind(loan),
|
|
165
168
|
removeCollateral: loan.removeCollateralEstimateGas.bind(loan),
|
|
169
|
+
repayApprove: loan.estimateGas.repayApprove,
|
|
166
170
|
repay: loan.repayEstimateGas.bind(loan),
|
|
171
|
+
fullRepayApprove: loan.estimateGas.fullRepayApprove,
|
|
167
172
|
fullRepay: loan.fullRepayEstimateGas.bind(loan),
|
|
173
|
+
liquidateApprove: loan.estimateGas.liquidateApprove,
|
|
168
174
|
liquidate: loan.liquidateEstimateGas.bind(loan),
|
|
175
|
+
selfLiquidateApprove: loan.estimateGas.selfLiquidateApprove,
|
|
169
176
|
selfLiquidate: loan.selfLiquidateEstimateGas.bind(loan),
|
|
177
|
+
partialSelfLiquidateApprove: loan.estimateGas.partialSelfLiquidateApprove,
|
|
170
178
|
partialSelfLiquidate: loan.partialSelfLiquidateEstimateGas.bind(loan),
|
|
171
179
|
},
|
|
172
180
|
};
|
|
@@ -60,14 +60,22 @@ export interface ILoanV1 {
|
|
|
60
60
|
partialSelfLiquidateApprove: (partialFrac: IPartialFrac) => Promise<string[]>;
|
|
61
61
|
partialSelfLiquidate: (partialFrac: IPartialFrac, slippage?: number) => Promise<string>;
|
|
62
62
|
estimateGas: {
|
|
63
|
+
createLoanApprove: (collateral: TAmount) => Promise<TGas>;
|
|
63
64
|
createLoan: (collateral: TAmount, debt: TAmount, range: number) => Promise<TGas>;
|
|
65
|
+
borrowMoreApprove: (collateral: TAmount) => Promise<TGas>;
|
|
64
66
|
borrowMore: (collateral: TAmount, debt: TAmount) => Promise<TGas>;
|
|
67
|
+
addCollateralApprove: (collateral: TAmount) => Promise<TGas>;
|
|
65
68
|
addCollateral: (collateral: TAmount, address?: string) => Promise<TGas>;
|
|
66
69
|
removeCollateral: (collateral: TAmount) => Promise<TGas>;
|
|
70
|
+
repayApprove: (debt: TAmount) => Promise<TGas>;
|
|
67
71
|
repay: (debt: TAmount, address?: string) => Promise<TGas>;
|
|
72
|
+
fullRepayApprove: (address?: string) => Promise<TGas>;
|
|
68
73
|
fullRepay: (address?: string) => Promise<TGas>;
|
|
74
|
+
liquidateApprove: (address?: string) => Promise<TGas>;
|
|
69
75
|
liquidate: (address: string, slippage?: number) => Promise<TGas>;
|
|
76
|
+
selfLiquidateApprove: () => Promise<TGas>;
|
|
70
77
|
selfLiquidate: (slippage?: number) => Promise<TGas>;
|
|
78
|
+
partialSelfLiquidateApprove: (partialFrac: IPartialFrac) => Promise<TGas>;
|
|
71
79
|
partialSelfLiquidate: (partialFrac: IPartialFrac, slippage?: number) => Promise<TGas>;
|
|
72
80
|
};
|
|
73
81
|
}
|
|
@@ -60,14 +60,22 @@ export interface ILoanV2 {
|
|
|
60
60
|
partialSelfLiquidateApprove: (partialFrac: IPartialFrac) => Promise<string[]>;
|
|
61
61
|
partialSelfLiquidate: (partialFrac: IPartialFrac, slippage?: number) => Promise<string>;
|
|
62
62
|
estimateGas: {
|
|
63
|
+
createLoanApprove: (collateral: TAmount) => Promise<TGas>;
|
|
63
64
|
createLoan: (collateral: TAmount, debt: TAmount, range: number) => Promise<TGas>;
|
|
65
|
+
borrowMoreApprove: (collateral: TAmount) => Promise<TGas>;
|
|
64
66
|
borrowMore: (collateral: TAmount, debt: TAmount) => Promise<TGas>;
|
|
67
|
+
addCollateralApprove: (collateral: TAmount) => Promise<TGas>;
|
|
65
68
|
addCollateral: (collateral: TAmount, address?: string) => Promise<TGas>;
|
|
66
69
|
removeCollateral: (collateral: TAmount) => Promise<TGas>;
|
|
70
|
+
repayApprove: (debt: TAmount) => Promise<TGas>;
|
|
67
71
|
repay: (debt: TAmount, address?: string) => Promise<TGas>;
|
|
72
|
+
fullRepayApprove: (address?: string) => Promise<TGas>;
|
|
68
73
|
fullRepay: (address?: string) => Promise<TGas>;
|
|
74
|
+
liquidateApprove: (address?: string) => Promise<TGas>;
|
|
69
75
|
liquidate: (address: string, slippage?: number) => Promise<TGas>;
|
|
76
|
+
selfLiquidateApprove: () => Promise<TGas>;
|
|
70
77
|
selfLiquidate: (slippage?: number) => Promise<TGas>;
|
|
78
|
+
partialSelfLiquidateApprove: (partialFrac: IPartialFrac) => Promise<TGas>;
|
|
71
79
|
partialSelfLiquidate: (partialFrac: IPartialFrac, slippage?: number) => Promise<TGas>;
|
|
72
80
|
};
|
|
73
81
|
}
|
|
@@ -102,14 +102,22 @@ export declare class LoanBaseModule {
|
|
|
102
102
|
partialSelfLiquidateEstimateGas(partialFrac: IPartialFrac, slippage?: number): Promise<TGas>;
|
|
103
103
|
partialSelfLiquidate(partialFrac: IPartialFrac, slippage?: number): Promise<string>;
|
|
104
104
|
estimateGas: {
|
|
105
|
+
createLoanApprove: (collateral: number | string) => Promise<TGas>;
|
|
105
106
|
createLoan: (collateral: number | string, debt: number | string, range: number) => Promise<TGas>;
|
|
107
|
+
borrowMoreApprove: (collateral: number | string) => Promise<TGas>;
|
|
106
108
|
borrowMore: (collateral: number | string, debt: number | string) => Promise<TGas>;
|
|
109
|
+
addCollateralApprove: (collateral: number | string) => Promise<TGas>;
|
|
107
110
|
addCollateral: (collateral: number | string, address?: string) => Promise<TGas>;
|
|
108
111
|
removeCollateral: (collateral: number | string) => Promise<TGas>;
|
|
112
|
+
repayApprove: (debt: number | string) => Promise<TGas>;
|
|
109
113
|
repay: (debt: number | string, address?: string) => Promise<TGas>;
|
|
114
|
+
fullRepayApprove: (address?: string) => Promise<TGas>;
|
|
110
115
|
fullRepay: (address?: string) => Promise<TGas>;
|
|
116
|
+
liquidateApprove: (address?: string) => Promise<TGas>;
|
|
111
117
|
liquidate: (address: string, slippage?: number) => Promise<TGas>;
|
|
118
|
+
selfLiquidateApprove: () => Promise<TGas>;
|
|
112
119
|
selfLiquidate: (slippage?: number) => Promise<TGas>;
|
|
120
|
+
partialSelfLiquidateApprove: (partialFrac: IPartialFrac) => Promise<TGas>;
|
|
113
121
|
partialSelfLiquidate: (partialFrac: IPartialFrac, slippage?: number) => Promise<TGas>;
|
|
114
122
|
};
|
|
115
123
|
}
|
|
@@ -30,14 +30,22 @@ export class LoanBaseModule {
|
|
|
30
30
|
maxAge: 5 * 60 * 1000, // 5m
|
|
31
31
|
});
|
|
32
32
|
this.estimateGas = {
|
|
33
|
+
createLoanApprove: this.createLoanApproveEstimateGas.bind(this),
|
|
33
34
|
createLoan: this.createLoanEstimateGas.bind(this),
|
|
35
|
+
borrowMoreApprove: this.borrowMoreApproveEstimateGas.bind(this),
|
|
34
36
|
borrowMore: this.borrowMoreEstimateGas.bind(this),
|
|
37
|
+
addCollateralApprove: this.addCollateralApproveEstimateGas.bind(this),
|
|
35
38
|
addCollateral: this.addCollateralEstimateGas.bind(this),
|
|
36
39
|
removeCollateral: this.removeCollateralEstimateGas.bind(this),
|
|
40
|
+
repayApprove: this.repayApproveEstimateGas.bind(this),
|
|
37
41
|
repay: this.repayEstimateGas.bind(this),
|
|
42
|
+
fullRepayApprove: this.fullRepayApproveEstimateGas.bind(this),
|
|
38
43
|
fullRepay: this.fullRepayEstimateGas.bind(this),
|
|
44
|
+
liquidateApprove: this.liquidateApproveEstimateGas.bind(this),
|
|
39
45
|
liquidate: this.liquidateEstimateGas.bind(this),
|
|
46
|
+
selfLiquidateApprove: this.selfLiquidateApproveEstimateGas.bind(this),
|
|
40
47
|
selfLiquidate: this.selfLiquidateEstimateGas.bind(this),
|
|
48
|
+
partialSelfLiquidateApprove: this.partialSelfLiquidateApproveEstimateGas.bind(this),
|
|
41
49
|
partialSelfLiquidate: this.partialSelfLiquidateEstimateGas.bind(this),
|
|
42
50
|
};
|
|
43
51
|
this.market = market;
|
package/package.json
CHANGED
|
@@ -267,14 +267,22 @@ export class LendMarketTemplate {
|
|
|
267
267
|
partialSelfLiquidate: loan.partialSelfLiquidate.bind(loan),
|
|
268
268
|
|
|
269
269
|
estimateGas: {
|
|
270
|
+
createLoanApprove: loan.estimateGas.createLoanApprove,
|
|
270
271
|
createLoan: loan.createLoanEstimateGas.bind(loan),
|
|
272
|
+
borrowMoreApprove: loan.estimateGas.borrowMoreApprove,
|
|
271
273
|
borrowMore: loan.borrowMoreEstimateGas.bind(loan),
|
|
274
|
+
addCollateralApprove: loan.estimateGas.addCollateralApprove,
|
|
272
275
|
addCollateral: loan.addCollateralEstimateGas.bind(loan),
|
|
273
276
|
removeCollateral: loan.removeCollateralEstimateGas.bind(loan),
|
|
277
|
+
repayApprove: loan.estimateGas.repayApprove,
|
|
274
278
|
repay: loan.repayEstimateGas.bind(loan),
|
|
279
|
+
fullRepayApprove: loan.estimateGas.fullRepayApprove,
|
|
275
280
|
fullRepay: loan.fullRepayEstimateGas.bind(loan),
|
|
281
|
+
liquidateApprove: loan.estimateGas.liquidateApprove,
|
|
276
282
|
liquidate: loan.liquidateEstimateGas.bind(loan),
|
|
283
|
+
selfLiquidateApprove: loan.estimateGas.selfLiquidateApprove,
|
|
277
284
|
selfLiquidate: loan.selfLiquidateEstimateGas.bind(loan),
|
|
285
|
+
partialSelfLiquidateApprove: loan.estimateGas.partialSelfLiquidateApprove,
|
|
278
286
|
partialSelfLiquidate: loan.partialSelfLiquidateEstimateGas.bind(loan),
|
|
279
287
|
},
|
|
280
288
|
}
|
|
@@ -432,4 +440,4 @@ export class LendMarketTemplate {
|
|
|
432
440
|
public getLlamalend(): Llamalend {
|
|
433
441
|
return this.llamalend;
|
|
434
442
|
}
|
|
435
|
-
}
|
|
443
|
+
}
|
|
@@ -64,14 +64,22 @@ export interface ILoanV1 {
|
|
|
64
64
|
partialSelfLiquidate: (partialFrac: IPartialFrac, slippage?: number) => Promise<string>;
|
|
65
65
|
|
|
66
66
|
estimateGas: {
|
|
67
|
+
createLoanApprove: (collateral: TAmount) => Promise<TGas>;
|
|
67
68
|
createLoan: (collateral: TAmount, debt: TAmount, range: number) => Promise<TGas>;
|
|
69
|
+
borrowMoreApprove: (collateral: TAmount) => Promise<TGas>;
|
|
68
70
|
borrowMore: (collateral: TAmount, debt: TAmount) => Promise<TGas>;
|
|
71
|
+
addCollateralApprove: (collateral: TAmount) => Promise<TGas>;
|
|
69
72
|
addCollateral: (collateral: TAmount, address?: string) => Promise<TGas>;
|
|
70
73
|
removeCollateral: (collateral: TAmount) => Promise<TGas>;
|
|
74
|
+
repayApprove: (debt: TAmount) => Promise<TGas>;
|
|
71
75
|
repay: (debt: TAmount, address?: string) => Promise<TGas>;
|
|
76
|
+
fullRepayApprove: (address?: string) => Promise<TGas>;
|
|
72
77
|
fullRepay: (address?: string) => Promise<TGas>;
|
|
78
|
+
liquidateApprove: (address?: string) => Promise<TGas>;
|
|
73
79
|
liquidate: (address: string, slippage?: number) => Promise<TGas>;
|
|
80
|
+
selfLiquidateApprove: () => Promise<TGas>;
|
|
74
81
|
selfLiquidate: (slippage?: number) => Promise<TGas>;
|
|
82
|
+
partialSelfLiquidateApprove: (partialFrac: IPartialFrac) => Promise<TGas>;
|
|
75
83
|
partialSelfLiquidate: (partialFrac: IPartialFrac, slippage?: number) => Promise<TGas>;
|
|
76
84
|
};
|
|
77
85
|
}
|
|
@@ -64,14 +64,22 @@ export interface ILoanV2 {
|
|
|
64
64
|
partialSelfLiquidate: (partialFrac: IPartialFrac, slippage?: number) => Promise<string>;
|
|
65
65
|
|
|
66
66
|
estimateGas: {
|
|
67
|
+
createLoanApprove: (collateral: TAmount) => Promise<TGas>;
|
|
67
68
|
createLoan: (collateral: TAmount, debt: TAmount, range: number) => Promise<TGas>;
|
|
69
|
+
borrowMoreApprove: (collateral: TAmount) => Promise<TGas>;
|
|
68
70
|
borrowMore: (collateral: TAmount, debt: TAmount) => Promise<TGas>;
|
|
71
|
+
addCollateralApprove: (collateral: TAmount) => Promise<TGas>;
|
|
69
72
|
addCollateral: (collateral: TAmount, address?: string) => Promise<TGas>;
|
|
70
73
|
removeCollateral: (collateral: TAmount) => Promise<TGas>;
|
|
74
|
+
repayApprove: (debt: TAmount) => Promise<TGas>;
|
|
71
75
|
repay: (debt: TAmount, address?: string) => Promise<TGas>;
|
|
76
|
+
fullRepayApprove: (address?: string) => Promise<TGas>;
|
|
72
77
|
fullRepay: (address?: string) => Promise<TGas>;
|
|
78
|
+
liquidateApprove: (address?: string) => Promise<TGas>;
|
|
73
79
|
liquidate: (address: string, slippage?: number) => Promise<TGas>;
|
|
80
|
+
selfLiquidateApprove: () => Promise<TGas>;
|
|
74
81
|
selfLiquidate: (slippage?: number) => Promise<TGas>;
|
|
82
|
+
partialSelfLiquidateApprove: (partialFrac: IPartialFrac) => Promise<TGas>;
|
|
75
83
|
partialSelfLiquidate: (partialFrac: IPartialFrac, slippage?: number) => Promise<TGas>;
|
|
76
84
|
};
|
|
77
85
|
}
|
|
@@ -759,15 +759,23 @@ export class LoanBaseModule {
|
|
|
759
759
|
}
|
|
760
760
|
|
|
761
761
|
public estimateGas = {
|
|
762
|
+
createLoanApprove: this.createLoanApproveEstimateGas.bind(this),
|
|
762
763
|
createLoan: this.createLoanEstimateGas.bind(this),
|
|
764
|
+
borrowMoreApprove: this.borrowMoreApproveEstimateGas.bind(this),
|
|
763
765
|
borrowMore: this.borrowMoreEstimateGas.bind(this),
|
|
766
|
+
addCollateralApprove: this.addCollateralApproveEstimateGas.bind(this),
|
|
764
767
|
addCollateral: this.addCollateralEstimateGas.bind(this),
|
|
765
768
|
removeCollateral: this.removeCollateralEstimateGas.bind(this),
|
|
769
|
+
repayApprove: this.repayApproveEstimateGas.bind(this),
|
|
766
770
|
repay: this.repayEstimateGas.bind(this),
|
|
771
|
+
fullRepayApprove: this.fullRepayApproveEstimateGas.bind(this),
|
|
767
772
|
fullRepay: this.fullRepayEstimateGas.bind(this),
|
|
773
|
+
liquidateApprove: this.liquidateApproveEstimateGas.bind(this),
|
|
768
774
|
liquidate: this.liquidateEstimateGas.bind(this),
|
|
775
|
+
selfLiquidateApprove: this.selfLiquidateApproveEstimateGas.bind(this),
|
|
769
776
|
selfLiquidate: this.selfLiquidateEstimateGas.bind(this),
|
|
777
|
+
partialSelfLiquidateApprove: this.partialSelfLiquidateApproveEstimateGas.bind(this),
|
|
770
778
|
partialSelfLiquidate: this.partialSelfLiquidateEstimateGas.bind(this),
|
|
771
779
|
};
|
|
772
780
|
|
|
773
|
-
}
|
|
781
|
+
}
|