@defisaver/positions-sdk 0.0.51 → 0.0.53
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/cjs/config/contracts.d.ts +62 -1
- package/cjs/config/contracts.js +10 -4
- package/cjs/curveUsd/index.js +4 -3
- package/cjs/llamaLend/index.js +4 -3
- package/cjs/markets/llamaLend/index.d.ts +2 -0
- package/cjs/markets/llamaLend/index.js +22 -7
- package/cjs/types/contracts/generated/LlamaLendCrvUSDCRVController.d.ts +209 -0
- package/cjs/types/contracts/generated/{LlamaLendCrvUSDCRVDController.d.ts → LlamaLendTBTCCrvUSDController.d.ts} +3 -3
- package/cjs/types/contracts/generated/LlamaLendTBTCCrvUSDController.js +5 -0
- package/cjs/types/contracts/generated/index.d.ts +2 -1
- package/cjs/types/llamaLend.d.ts +2 -1
- package/cjs/types/llamaLend.js +1 -0
- package/esm/config/contracts.d.ts +62 -1
- package/esm/config/contracts.js +10 -4
- package/esm/curveUsd/index.js +4 -3
- package/esm/llamaLend/index.js +4 -3
- package/esm/markets/llamaLend/index.d.ts +2 -0
- package/esm/markets/llamaLend/index.js +20 -6
- package/esm/types/contracts/generated/LlamaLendCrvUSDCRVController.d.ts +209 -0
- package/esm/types/contracts/generated/{LlamaLendCrvUSDCRVDController.d.ts → LlamaLendTBTCCrvUSDController.d.ts} +3 -3
- package/esm/types/contracts/generated/LlamaLendTBTCCrvUSDController.js +4 -0
- package/esm/types/contracts/generated/index.d.ts +2 -1
- package/esm/types/llamaLend.d.ts +2 -1
- package/esm/types/llamaLend.js +1 -0
- package/package.json +1 -1
- package/src/config/contracts.js +10 -4
- package/src/curveUsd/index.ts +4 -3
- package/src/llamaLend/index.ts +4 -3
- package/src/markets/llamaLend/index.ts +20 -6
- package/src/types/contracts/generated/LlamaLendCrvUSDCRVController.ts +416 -0
- package/src/types/contracts/generated/{LlamaLendCrvUSDCRVDController.ts → LlamaLendTBTCCrvUSDController.ts} +3 -3
- package/src/types/contracts/generated/index.ts +2 -1
- package/src/types/llamaLend.ts +1 -0
- package/yarn-error.log +64 -0
- /package/cjs/types/contracts/generated/{LlamaLendCrvUSDCRVDController.js → LlamaLendCrvUSDCRVController.js} +0 -0
- /package/esm/types/contracts/generated/{LlamaLendCrvUSDCRVDController.js → LlamaLendCrvUSDCRVController.js} +0 -0
package/src/curveUsd/index.ts
CHANGED
|
@@ -111,12 +111,13 @@ export const getCurveUsdGlobalData = async (web3: Web3, network: NetworkNumber,
|
|
|
111
111
|
};
|
|
112
112
|
};
|
|
113
113
|
|
|
114
|
-
const getStatusForUser = (bandRange: string[], activeBand: string, crvUSDSupplied: string, collSupplied: string) => {
|
|
114
|
+
const getStatusForUser = (bandRange: string[], activeBand: string, crvUSDSupplied: string, collSupplied: string, healthPercent: string) => {
|
|
115
115
|
// if bands are equal, that can only be [0,0] which means user doesn't have loan (min number of bands is 4)
|
|
116
116
|
if (new Dec(bandRange[0]).eq(bandRange[1])) return CrvUSDStatus.Nonexistant;
|
|
117
117
|
// if user doesn't have crvUSD as collateral, then his position is not in soft liquidation
|
|
118
118
|
if (new Dec(crvUSDSupplied).lte(0)) {
|
|
119
|
-
|
|
119
|
+
const isHealthRisky = new Dec(healthPercent).lt(10);
|
|
120
|
+
if (new Dec(bandRange[0]).minus(activeBand).lte(3) || isHealthRisky) return CrvUSDStatus.Risk; // if user band is less than 3 bands away from active band, his position is at risk
|
|
120
121
|
return CrvUSDStatus.Safe;
|
|
121
122
|
}
|
|
122
123
|
if (new Dec(bandRange[0]).lte(activeBand) && new Dec(bandRange[1]).gte(activeBand)) return CrvUSDStatus.SoftLiquidating; // user has crvUSD as coll so he is in soft liquidation
|
|
@@ -196,7 +197,7 @@ export const getCurveUsdUserData = async (web3: Web3, network: NetworkNumber, ad
|
|
|
196
197
|
|
|
197
198
|
const _userBands = data.loanExists ? (await getAndFormatBands(web3, network, selectedMarket, data.bandRange[0], data.bandRange[1])) : [];
|
|
198
199
|
|
|
199
|
-
const status = data.loanExists ? getStatusForUser(data.bandRange, activeBand, crvUSDSupplied, collSupplied) : CrvUSDStatus.Nonexistant;
|
|
200
|
+
const status = data.loanExists ? getStatusForUser(data.bandRange, activeBand, crvUSDSupplied, collSupplied, healthPercent) : CrvUSDStatus.Nonexistant;
|
|
200
201
|
|
|
201
202
|
const userBands = _userBands.map((band, index) => ({
|
|
202
203
|
...band,
|
package/src/llamaLend/index.ts
CHANGED
|
@@ -146,12 +146,13 @@ export const getLlamaLendGlobalData = async (web3: Web3, network: NetworkNumber,
|
|
|
146
146
|
};
|
|
147
147
|
};
|
|
148
148
|
|
|
149
|
-
const getStatusForUser = (bandRange: string[], activeBand: string, debtSupplied: string, collSupplied: string) => {
|
|
149
|
+
const getStatusForUser = (bandRange: string[], activeBand: string, debtSupplied: string, collSupplied: string, healthPercent: string) => {
|
|
150
150
|
// if bands are equal, that can only be [0,0] which means user doesn't have loan (min number of bands is 4)
|
|
151
151
|
if (new Dec(bandRange[0]).eq(bandRange[1])) return LlamaLendStatus.Nonexistant;
|
|
152
152
|
// if user doesn't have debtAsset as collateral, then his position is not in soft liquidation
|
|
153
153
|
if (new Dec(debtSupplied).lte(0)) {
|
|
154
|
-
|
|
154
|
+
const isHealthRisky = new Dec(healthPercent).lt(10);
|
|
155
|
+
if (new Dec(bandRange[0]).minus(activeBand).lte(3) || isHealthRisky) return LlamaLendStatus.Risk; // if user band is less than 3 bands away from active band, his position is at risk
|
|
155
156
|
return LlamaLendStatus.Safe;
|
|
156
157
|
}
|
|
157
158
|
if (new Dec(bandRange[0]).lte(activeBand) && new Dec(bandRange[1]).gte(activeBand)) return LlamaLendStatus.SoftLiquidating; // user has debtAsset as coll so he is in soft liquidation
|
|
@@ -245,7 +246,7 @@ export const getLlamaLendUserData = async (web3: Web3, network: NetworkNumber, a
|
|
|
245
246
|
|
|
246
247
|
const _userBands = data.loanExists ? (await getAndFormatBands(web3, network, selectedMarket, data.bandRange[0], data.bandRange[1])) : [];
|
|
247
248
|
|
|
248
|
-
const status = data.loanExists ? getStatusForUser(data.bandRange, marketData.activeBand, debtSupplied, collSupplied) : LlamaLendStatus.Nonexistant;
|
|
249
|
+
const status = data.loanExists ? getStatusForUser(data.bandRange, marketData.activeBand, debtSupplied, collSupplied, healthPercent) : LlamaLendStatus.Nonexistant;
|
|
249
250
|
|
|
250
251
|
const userBands = _userBands.map((band, index) => ({
|
|
251
252
|
...band,
|
|
@@ -9,8 +9,8 @@ export const LLAMALEND_WSTETH_CRVUSD_MARKET = (networkId: NetworkNumber): LlamaL
|
|
|
9
9
|
value: LlamaLendVersions.LlamaLendwstETHcrvUSD,
|
|
10
10
|
collAsset: 'wstETH',
|
|
11
11
|
baseAsset: 'crvUSD',
|
|
12
|
-
controllerAddress: '
|
|
13
|
-
vaultAddress: '
|
|
12
|
+
controllerAddress: getConfigContractAddress('LlamaLendWstETHCrvUSDController', networkId),
|
|
13
|
+
vaultAddress: '0x8cf1DE26729cfB7137AF1A6B2a665e099EC319b5',
|
|
14
14
|
url: 'wstethcrvusd',
|
|
15
15
|
});
|
|
16
16
|
export const LLAMALEND_CRVUSD_CRV_MARKET = (networkId: NetworkNumber): LlamaLendMarketData => ({
|
|
@@ -20,8 +20,8 @@ export const LLAMALEND_CRVUSD_CRV_MARKET = (networkId: NetworkNumber): LlamaLend
|
|
|
20
20
|
value: LlamaLendVersions.LlamaLendcrvUSDCRV,
|
|
21
21
|
collAsset: 'crvUSD',
|
|
22
22
|
baseAsset: 'CRV',
|
|
23
|
-
controllerAddress: '
|
|
24
|
-
vaultAddress: '
|
|
23
|
+
controllerAddress: getConfigContractAddress('LlamaLendCrvUSDCRVController', networkId),
|
|
24
|
+
vaultAddress: '0x4D2f44B0369f3C20c3d670D2C26b048985598450',
|
|
25
25
|
url: 'crvusdcrv',
|
|
26
26
|
});
|
|
27
27
|
export const LLAMALEND_CRV_CRVUSD_MARKET = (networkId: NetworkNumber): LlamaLendMarketData => ({
|
|
@@ -31,15 +31,28 @@ export const LLAMALEND_CRV_CRVUSD_MARKET = (networkId: NetworkNumber): LlamaLend
|
|
|
31
31
|
value: LlamaLendVersions.LlamaLendCRVcrvUSD,
|
|
32
32
|
collAsset: 'CRV',
|
|
33
33
|
baseAsset: 'crvUSD',
|
|
34
|
-
controllerAddress: '
|
|
35
|
-
vaultAddress: '
|
|
34
|
+
controllerAddress: getConfigContractAddress('LlamaLendCRVCrvUSDController', networkId),
|
|
35
|
+
vaultAddress: '0xCeA18a8752bb7e7817F9AE7565328FE415C0f2cA',
|
|
36
36
|
url: 'crvcrvusd',
|
|
37
37
|
});
|
|
38
38
|
|
|
39
|
+
export const LLAMALEND_TBTC_CRVUSD_MARKET = (networkId: NetworkNumber): LlamaLendMarketData => ({
|
|
40
|
+
chainIds: [1],
|
|
41
|
+
label: 'LlamaLend - TBTC/crvUSD',
|
|
42
|
+
shortLabel: 'TBTC/crvUSD',
|
|
43
|
+
value: LlamaLendVersions.LlamaLendTBTCcrvUSD,
|
|
44
|
+
collAsset: 'tBTC',
|
|
45
|
+
baseAsset: 'crvUSD',
|
|
46
|
+
controllerAddress: getConfigContractAddress('LlamaLendTBTCCrvUSDController', networkId),
|
|
47
|
+
vaultAddress: '0xb2b23C87a4B6d1b03Ba603F7C3EB9A81fDC0AAC9',
|
|
48
|
+
url: 'tbtccrvusd',
|
|
49
|
+
});
|
|
50
|
+
|
|
39
51
|
export const LlamaLendMarkets = (networkId: NetworkNumber) => ({
|
|
40
52
|
[LlamaLendVersions.LlamaLendwstETHcrvUSD]: LLAMALEND_WSTETH_CRVUSD_MARKET(networkId),
|
|
41
53
|
[LlamaLendVersions.LlamaLendcrvUSDCRV]: LLAMALEND_CRVUSD_CRV_MARKET(networkId),
|
|
42
54
|
[LlamaLendVersions.LlamaLendCRVcrvUSD]: LLAMALEND_CRV_CRVUSD_MARKET(networkId),
|
|
55
|
+
[LlamaLendVersions.LlamaLendTBTCcrvUSD]: LLAMALEND_TBTC_CRVUSD_MARKET(networkId),
|
|
43
56
|
}) as const;
|
|
44
57
|
|
|
45
58
|
|
|
@@ -47,5 +60,6 @@ export const LLAMALEND_ALL_VERSIONS = [
|
|
|
47
60
|
LlamaLendVersions.LlamaLendwstETHcrvUSD,
|
|
48
61
|
LlamaLendVersions.LlamaLendcrvUSDCRV,
|
|
49
62
|
LlamaLendVersions.LlamaLendCRVcrvUSD,
|
|
63
|
+
LlamaLendVersions.LlamaLendTBTCcrvUSD,
|
|
50
64
|
];
|
|
51
65
|
export const getLlamaLendMarketData = (market: LlamaLendVersions, network: NetworkNumber = 1) => LlamaLendMarkets(network)[market];
|
|
@@ -0,0 +1,416 @@
|
|
|
1
|
+
/* Autogenerated file. Do not edit manually. */
|
|
2
|
+
/* tslint:disable */
|
|
3
|
+
/* eslint-disable */
|
|
4
|
+
|
|
5
|
+
import type BN from "bn.js";
|
|
6
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
7
|
+
import type { EventLog } from "web3-core";
|
|
8
|
+
import type { EventEmitter } from "events";
|
|
9
|
+
import type {
|
|
10
|
+
Callback,
|
|
11
|
+
PayableTransactionObject,
|
|
12
|
+
NonPayableTransactionObject,
|
|
13
|
+
BlockType,
|
|
14
|
+
ContractEventLog,
|
|
15
|
+
BaseContract,
|
|
16
|
+
} from "./types";
|
|
17
|
+
|
|
18
|
+
export interface EventOptions {
|
|
19
|
+
filter?: object;
|
|
20
|
+
fromBlock?: BlockType;
|
|
21
|
+
topics?: string[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type UserState = ContractEventLog<{
|
|
25
|
+
user: string;
|
|
26
|
+
collateral: string;
|
|
27
|
+
debt: string;
|
|
28
|
+
n1: string;
|
|
29
|
+
n2: string;
|
|
30
|
+
liquidation_discount: string;
|
|
31
|
+
0: string;
|
|
32
|
+
1: string;
|
|
33
|
+
2: string;
|
|
34
|
+
3: string;
|
|
35
|
+
4: string;
|
|
36
|
+
5: string;
|
|
37
|
+
}>;
|
|
38
|
+
export type Borrow = ContractEventLog<{
|
|
39
|
+
user: string;
|
|
40
|
+
collateral_increase: string;
|
|
41
|
+
loan_increase: string;
|
|
42
|
+
0: string;
|
|
43
|
+
1: string;
|
|
44
|
+
2: string;
|
|
45
|
+
}>;
|
|
46
|
+
export type Repay = ContractEventLog<{
|
|
47
|
+
user: string;
|
|
48
|
+
collateral_decrease: string;
|
|
49
|
+
loan_decrease: string;
|
|
50
|
+
0: string;
|
|
51
|
+
1: string;
|
|
52
|
+
2: string;
|
|
53
|
+
}>;
|
|
54
|
+
export type RemoveCollateral = ContractEventLog<{
|
|
55
|
+
user: string;
|
|
56
|
+
collateral_decrease: string;
|
|
57
|
+
0: string;
|
|
58
|
+
1: string;
|
|
59
|
+
}>;
|
|
60
|
+
export type Liquidate = ContractEventLog<{
|
|
61
|
+
liquidator: string;
|
|
62
|
+
user: string;
|
|
63
|
+
collateral_received: string;
|
|
64
|
+
stablecoin_received: string;
|
|
65
|
+
debt: string;
|
|
66
|
+
0: string;
|
|
67
|
+
1: string;
|
|
68
|
+
2: string;
|
|
69
|
+
3: string;
|
|
70
|
+
4: string;
|
|
71
|
+
}>;
|
|
72
|
+
export type SetMonetaryPolicy = ContractEventLog<{
|
|
73
|
+
monetary_policy: string;
|
|
74
|
+
0: string;
|
|
75
|
+
}>;
|
|
76
|
+
export type SetBorrowingDiscounts = ContractEventLog<{
|
|
77
|
+
loan_discount: string;
|
|
78
|
+
liquidation_discount: string;
|
|
79
|
+
0: string;
|
|
80
|
+
1: string;
|
|
81
|
+
}>;
|
|
82
|
+
export type CollectFees = ContractEventLog<{
|
|
83
|
+
amount: string;
|
|
84
|
+
new_supply: string;
|
|
85
|
+
0: string;
|
|
86
|
+
1: string;
|
|
87
|
+
}>;
|
|
88
|
+
|
|
89
|
+
export interface LlamaLendCrvUSDCRVController extends BaseContract {
|
|
90
|
+
constructor(
|
|
91
|
+
jsonInterface: any[],
|
|
92
|
+
address?: string,
|
|
93
|
+
options?: ContractOptions
|
|
94
|
+
): LlamaLendCrvUSDCRVController;
|
|
95
|
+
clone(): LlamaLendCrvUSDCRVController;
|
|
96
|
+
methods: {
|
|
97
|
+
factory(): NonPayableTransactionObject<string>;
|
|
98
|
+
|
|
99
|
+
amm(): NonPayableTransactionObject<string>;
|
|
100
|
+
|
|
101
|
+
collateral_token(): NonPayableTransactionObject<string>;
|
|
102
|
+
|
|
103
|
+
borrowed_token(): NonPayableTransactionObject<string>;
|
|
104
|
+
|
|
105
|
+
save_rate(): NonPayableTransactionObject<void>;
|
|
106
|
+
|
|
107
|
+
debt(user: string): NonPayableTransactionObject<string>;
|
|
108
|
+
|
|
109
|
+
loan_exists(user: string): NonPayableTransactionObject<boolean>;
|
|
110
|
+
|
|
111
|
+
total_debt(): NonPayableTransactionObject<string>;
|
|
112
|
+
|
|
113
|
+
"max_borrowable(uint256,uint256)"(
|
|
114
|
+
collateral: number | string | BN,
|
|
115
|
+
N: number | string | BN
|
|
116
|
+
): NonPayableTransactionObject<string>;
|
|
117
|
+
|
|
118
|
+
"max_borrowable(uint256,uint256,uint256)"(
|
|
119
|
+
collateral: number | string | BN,
|
|
120
|
+
N: number | string | BN,
|
|
121
|
+
current_debt: number | string | BN
|
|
122
|
+
): NonPayableTransactionObject<string>;
|
|
123
|
+
|
|
124
|
+
min_collateral(
|
|
125
|
+
debt: number | string | BN,
|
|
126
|
+
N: number | string | BN
|
|
127
|
+
): NonPayableTransactionObject<string>;
|
|
128
|
+
|
|
129
|
+
calculate_debt_n1(
|
|
130
|
+
collateral: number | string | BN,
|
|
131
|
+
debt: number | string | BN,
|
|
132
|
+
N: number | string | BN
|
|
133
|
+
): NonPayableTransactionObject<string>;
|
|
134
|
+
|
|
135
|
+
create_loan(
|
|
136
|
+
collateral: number | string | BN,
|
|
137
|
+
debt: number | string | BN,
|
|
138
|
+
N: number | string | BN
|
|
139
|
+
): NonPayableTransactionObject<void>;
|
|
140
|
+
|
|
141
|
+
create_loan_extended(
|
|
142
|
+
collateral: number | string | BN,
|
|
143
|
+
debt: number | string | BN,
|
|
144
|
+
N: number | string | BN,
|
|
145
|
+
callbacker: string,
|
|
146
|
+
callback_args: number | string | BN[]
|
|
147
|
+
): NonPayableTransactionObject<void>;
|
|
148
|
+
|
|
149
|
+
"add_collateral(uint256)"(
|
|
150
|
+
collateral: number | string | BN
|
|
151
|
+
): NonPayableTransactionObject<void>;
|
|
152
|
+
|
|
153
|
+
"add_collateral(uint256,address)"(
|
|
154
|
+
collateral: number | string | BN,
|
|
155
|
+
_for: string
|
|
156
|
+
): NonPayableTransactionObject<void>;
|
|
157
|
+
|
|
158
|
+
"remove_collateral(uint256)"(
|
|
159
|
+
collateral: number | string | BN
|
|
160
|
+
): NonPayableTransactionObject<void>;
|
|
161
|
+
|
|
162
|
+
"remove_collateral(uint256,bool)"(
|
|
163
|
+
collateral: number | string | BN,
|
|
164
|
+
use_eth: boolean
|
|
165
|
+
): NonPayableTransactionObject<void>;
|
|
166
|
+
|
|
167
|
+
borrow_more(
|
|
168
|
+
collateral: number | string | BN,
|
|
169
|
+
debt: number | string | BN
|
|
170
|
+
): NonPayableTransactionObject<void>;
|
|
171
|
+
|
|
172
|
+
borrow_more_extended(
|
|
173
|
+
collateral: number | string | BN,
|
|
174
|
+
debt: number | string | BN,
|
|
175
|
+
callbacker: string,
|
|
176
|
+
callback_args: number | string | BN[]
|
|
177
|
+
): NonPayableTransactionObject<void>;
|
|
178
|
+
|
|
179
|
+
"repay(uint256)"(
|
|
180
|
+
_d_debt: number | string | BN
|
|
181
|
+
): NonPayableTransactionObject<void>;
|
|
182
|
+
|
|
183
|
+
"repay(uint256,address)"(
|
|
184
|
+
_d_debt: number | string | BN,
|
|
185
|
+
_for: string
|
|
186
|
+
): NonPayableTransactionObject<void>;
|
|
187
|
+
|
|
188
|
+
"repay(uint256,address,int256)"(
|
|
189
|
+
_d_debt: number | string | BN,
|
|
190
|
+
_for: string,
|
|
191
|
+
max_active_band: number | string | BN
|
|
192
|
+
): NonPayableTransactionObject<void>;
|
|
193
|
+
|
|
194
|
+
"repay(uint256,address,int256,bool)"(
|
|
195
|
+
_d_debt: number | string | BN,
|
|
196
|
+
_for: string,
|
|
197
|
+
max_active_band: number | string | BN,
|
|
198
|
+
use_eth: boolean
|
|
199
|
+
): NonPayableTransactionObject<void>;
|
|
200
|
+
|
|
201
|
+
repay_extended(
|
|
202
|
+
callbacker: string,
|
|
203
|
+
callback_args: number | string | BN[]
|
|
204
|
+
): NonPayableTransactionObject<void>;
|
|
205
|
+
|
|
206
|
+
"health_calculator(address,int256,int256,bool)"(
|
|
207
|
+
user: string,
|
|
208
|
+
d_collateral: number | string | BN,
|
|
209
|
+
d_debt: number | string | BN,
|
|
210
|
+
full: boolean
|
|
211
|
+
): NonPayableTransactionObject<string>;
|
|
212
|
+
|
|
213
|
+
"health_calculator(address,int256,int256,bool,uint256)"(
|
|
214
|
+
user: string,
|
|
215
|
+
d_collateral: number | string | BN,
|
|
216
|
+
d_debt: number | string | BN,
|
|
217
|
+
full: boolean,
|
|
218
|
+
N: number | string | BN
|
|
219
|
+
): NonPayableTransactionObject<string>;
|
|
220
|
+
|
|
221
|
+
"liquidate(address,uint256)"(
|
|
222
|
+
user: string,
|
|
223
|
+
min_x: number | string | BN
|
|
224
|
+
): NonPayableTransactionObject<void>;
|
|
225
|
+
|
|
226
|
+
"liquidate(address,uint256,bool)"(
|
|
227
|
+
user: string,
|
|
228
|
+
min_x: number | string | BN,
|
|
229
|
+
use_eth: boolean
|
|
230
|
+
): NonPayableTransactionObject<void>;
|
|
231
|
+
|
|
232
|
+
liquidate_extended(
|
|
233
|
+
user: string,
|
|
234
|
+
min_x: number | string | BN,
|
|
235
|
+
frac: number | string | BN,
|
|
236
|
+
use_eth: boolean,
|
|
237
|
+
callbacker: string,
|
|
238
|
+
callback_args: number | string | BN[]
|
|
239
|
+
): NonPayableTransactionObject<void>;
|
|
240
|
+
|
|
241
|
+
"tokens_to_liquidate(address)"(
|
|
242
|
+
user: string
|
|
243
|
+
): NonPayableTransactionObject<string>;
|
|
244
|
+
|
|
245
|
+
"tokens_to_liquidate(address,uint256)"(
|
|
246
|
+
user: string,
|
|
247
|
+
frac: number | string | BN
|
|
248
|
+
): NonPayableTransactionObject<string>;
|
|
249
|
+
|
|
250
|
+
"health(address)"(user: string): NonPayableTransactionObject<string>;
|
|
251
|
+
|
|
252
|
+
"health(address,bool)"(
|
|
253
|
+
user: string,
|
|
254
|
+
full: boolean
|
|
255
|
+
): NonPayableTransactionObject<string>;
|
|
256
|
+
|
|
257
|
+
"users_to_liquidate()"(): NonPayableTransactionObject<
|
|
258
|
+
[string, string, string, string, string] &
|
|
259
|
+
{ user: string; x: string; y: string; debt: string; health: string }[]
|
|
260
|
+
>;
|
|
261
|
+
|
|
262
|
+
"users_to_liquidate(uint256)"(
|
|
263
|
+
_from: number | string | BN
|
|
264
|
+
): NonPayableTransactionObject<
|
|
265
|
+
[string, string, string, string, string] &
|
|
266
|
+
{ user: string; x: string; y: string; debt: string; health: string }[]
|
|
267
|
+
>;
|
|
268
|
+
|
|
269
|
+
"users_to_liquidate(uint256,uint256)"(
|
|
270
|
+
_from: number | string | BN,
|
|
271
|
+
_limit: number | string | BN
|
|
272
|
+
): NonPayableTransactionObject<
|
|
273
|
+
[string, string, string, string, string] &
|
|
274
|
+
{ user: string; x: string; y: string; debt: string; health: string }[]
|
|
275
|
+
>;
|
|
276
|
+
|
|
277
|
+
amm_price(): NonPayableTransactionObject<string>;
|
|
278
|
+
|
|
279
|
+
user_prices(user: string): NonPayableTransactionObject<[string, string]>;
|
|
280
|
+
|
|
281
|
+
user_state(
|
|
282
|
+
user: string
|
|
283
|
+
): NonPayableTransactionObject<[string, string, string, string]>;
|
|
284
|
+
|
|
285
|
+
set_amm_fee(fee: number | string | BN): NonPayableTransactionObject<void>;
|
|
286
|
+
|
|
287
|
+
set_amm_admin_fee(
|
|
288
|
+
fee: number | string | BN
|
|
289
|
+
): NonPayableTransactionObject<void>;
|
|
290
|
+
|
|
291
|
+
set_monetary_policy(
|
|
292
|
+
monetary_policy: string
|
|
293
|
+
): NonPayableTransactionObject<void>;
|
|
294
|
+
|
|
295
|
+
set_borrowing_discounts(
|
|
296
|
+
loan_discount: number | string | BN,
|
|
297
|
+
liquidation_discount: number | string | BN
|
|
298
|
+
): NonPayableTransactionObject<void>;
|
|
299
|
+
|
|
300
|
+
set_callback(cb: string): NonPayableTransactionObject<void>;
|
|
301
|
+
|
|
302
|
+
admin_fees(): NonPayableTransactionObject<string>;
|
|
303
|
+
|
|
304
|
+
collect_fees(): NonPayableTransactionObject<string>;
|
|
305
|
+
|
|
306
|
+
check_lock(): NonPayableTransactionObject<boolean>;
|
|
307
|
+
|
|
308
|
+
liquidation_discounts(arg0: string): NonPayableTransactionObject<string>;
|
|
309
|
+
|
|
310
|
+
loans(arg0: number | string | BN): NonPayableTransactionObject<string>;
|
|
311
|
+
|
|
312
|
+
loan_ix(arg0: string): NonPayableTransactionObject<string>;
|
|
313
|
+
|
|
314
|
+
n_loans(): NonPayableTransactionObject<string>;
|
|
315
|
+
|
|
316
|
+
minted(): NonPayableTransactionObject<string>;
|
|
317
|
+
|
|
318
|
+
redeemed(): NonPayableTransactionObject<string>;
|
|
319
|
+
|
|
320
|
+
monetary_policy(): NonPayableTransactionObject<string>;
|
|
321
|
+
|
|
322
|
+
liquidation_discount(): NonPayableTransactionObject<string>;
|
|
323
|
+
|
|
324
|
+
loan_discount(): NonPayableTransactionObject<string>;
|
|
325
|
+
};
|
|
326
|
+
events: {
|
|
327
|
+
UserState(cb?: Callback<UserState>): EventEmitter;
|
|
328
|
+
UserState(options?: EventOptions, cb?: Callback<UserState>): EventEmitter;
|
|
329
|
+
|
|
330
|
+
Borrow(cb?: Callback<Borrow>): EventEmitter;
|
|
331
|
+
Borrow(options?: EventOptions, cb?: Callback<Borrow>): EventEmitter;
|
|
332
|
+
|
|
333
|
+
Repay(cb?: Callback<Repay>): EventEmitter;
|
|
334
|
+
Repay(options?: EventOptions, cb?: Callback<Repay>): EventEmitter;
|
|
335
|
+
|
|
336
|
+
RemoveCollateral(cb?: Callback<RemoveCollateral>): EventEmitter;
|
|
337
|
+
RemoveCollateral(
|
|
338
|
+
options?: EventOptions,
|
|
339
|
+
cb?: Callback<RemoveCollateral>
|
|
340
|
+
): EventEmitter;
|
|
341
|
+
|
|
342
|
+
Liquidate(cb?: Callback<Liquidate>): EventEmitter;
|
|
343
|
+
Liquidate(options?: EventOptions, cb?: Callback<Liquidate>): EventEmitter;
|
|
344
|
+
|
|
345
|
+
SetMonetaryPolicy(cb?: Callback<SetMonetaryPolicy>): EventEmitter;
|
|
346
|
+
SetMonetaryPolicy(
|
|
347
|
+
options?: EventOptions,
|
|
348
|
+
cb?: Callback<SetMonetaryPolicy>
|
|
349
|
+
): EventEmitter;
|
|
350
|
+
|
|
351
|
+
SetBorrowingDiscounts(cb?: Callback<SetBorrowingDiscounts>): EventEmitter;
|
|
352
|
+
SetBorrowingDiscounts(
|
|
353
|
+
options?: EventOptions,
|
|
354
|
+
cb?: Callback<SetBorrowingDiscounts>
|
|
355
|
+
): EventEmitter;
|
|
356
|
+
|
|
357
|
+
CollectFees(cb?: Callback<CollectFees>): EventEmitter;
|
|
358
|
+
CollectFees(
|
|
359
|
+
options?: EventOptions,
|
|
360
|
+
cb?: Callback<CollectFees>
|
|
361
|
+
): EventEmitter;
|
|
362
|
+
|
|
363
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
364
|
+
};
|
|
365
|
+
|
|
366
|
+
once(event: "UserState", cb: Callback<UserState>): void;
|
|
367
|
+
once(
|
|
368
|
+
event: "UserState",
|
|
369
|
+
options: EventOptions,
|
|
370
|
+
cb: Callback<UserState>
|
|
371
|
+
): void;
|
|
372
|
+
|
|
373
|
+
once(event: "Borrow", cb: Callback<Borrow>): void;
|
|
374
|
+
once(event: "Borrow", options: EventOptions, cb: Callback<Borrow>): void;
|
|
375
|
+
|
|
376
|
+
once(event: "Repay", cb: Callback<Repay>): void;
|
|
377
|
+
once(event: "Repay", options: EventOptions, cb: Callback<Repay>): void;
|
|
378
|
+
|
|
379
|
+
once(event: "RemoveCollateral", cb: Callback<RemoveCollateral>): void;
|
|
380
|
+
once(
|
|
381
|
+
event: "RemoveCollateral",
|
|
382
|
+
options: EventOptions,
|
|
383
|
+
cb: Callback<RemoveCollateral>
|
|
384
|
+
): void;
|
|
385
|
+
|
|
386
|
+
once(event: "Liquidate", cb: Callback<Liquidate>): void;
|
|
387
|
+
once(
|
|
388
|
+
event: "Liquidate",
|
|
389
|
+
options: EventOptions,
|
|
390
|
+
cb: Callback<Liquidate>
|
|
391
|
+
): void;
|
|
392
|
+
|
|
393
|
+
once(event: "SetMonetaryPolicy", cb: Callback<SetMonetaryPolicy>): void;
|
|
394
|
+
once(
|
|
395
|
+
event: "SetMonetaryPolicy",
|
|
396
|
+
options: EventOptions,
|
|
397
|
+
cb: Callback<SetMonetaryPolicy>
|
|
398
|
+
): void;
|
|
399
|
+
|
|
400
|
+
once(
|
|
401
|
+
event: "SetBorrowingDiscounts",
|
|
402
|
+
cb: Callback<SetBorrowingDiscounts>
|
|
403
|
+
): void;
|
|
404
|
+
once(
|
|
405
|
+
event: "SetBorrowingDiscounts",
|
|
406
|
+
options: EventOptions,
|
|
407
|
+
cb: Callback<SetBorrowingDiscounts>
|
|
408
|
+
): void;
|
|
409
|
+
|
|
410
|
+
once(event: "CollectFees", cb: Callback<CollectFees>): void;
|
|
411
|
+
once(
|
|
412
|
+
event: "CollectFees",
|
|
413
|
+
options: EventOptions,
|
|
414
|
+
cb: Callback<CollectFees>
|
|
415
|
+
): void;
|
|
416
|
+
}
|
|
@@ -86,13 +86,13 @@ export type CollectFees = ContractEventLog<{
|
|
|
86
86
|
1: string;
|
|
87
87
|
}>;
|
|
88
88
|
|
|
89
|
-
export interface
|
|
89
|
+
export interface LlamaLendTBTCCrvUSDController extends BaseContract {
|
|
90
90
|
constructor(
|
|
91
91
|
jsonInterface: any[],
|
|
92
92
|
address?: string,
|
|
93
93
|
options?: ContractOptions
|
|
94
|
-
):
|
|
95
|
-
clone():
|
|
94
|
+
): LlamaLendTBTCCrvUSDController;
|
|
95
|
+
clone(): LlamaLendTBTCCrvUSDController;
|
|
96
96
|
methods: {
|
|
97
97
|
factory(): NonPayableTransactionObject<string>;
|
|
98
98
|
|
|
@@ -34,7 +34,8 @@ export type { Lido } from "./Lido";
|
|
|
34
34
|
export type { LiquityActivePool } from "./LiquityActivePool";
|
|
35
35
|
export type { LiquityView } from "./LiquityView";
|
|
36
36
|
export type { LlamaLendCRVCrvUSDController } from "./LlamaLendCRVCrvUSDController";
|
|
37
|
-
export type {
|
|
37
|
+
export type { LlamaLendCrvUSDCRVController } from "./LlamaLendCrvUSDCRVController";
|
|
38
|
+
export type { LlamaLendTBTCCrvUSDController } from "./LlamaLendTBTCCrvUSDController";
|
|
38
39
|
export type { LlamaLendView } from "./LlamaLendView";
|
|
39
40
|
export type { LlamaLendWstETHCrvUSDController } from "./LlamaLendWstETHCrvUSDController";
|
|
40
41
|
export type { McdDog } from "./McdDog";
|
package/src/types/llamaLend.ts
CHANGED
|
@@ -6,6 +6,7 @@ export enum LlamaLendVersions {
|
|
|
6
6
|
'LlamaLendwstETHcrvUSD' = 'llamaLendwstETHcrvUSD',
|
|
7
7
|
'LlamaLendCRVcrvUSD' = 'llamaLendCRVcrvUSD',
|
|
8
8
|
'LlamaLendcrvUSDCRV' = 'llamaLendcrvUSDCRV',
|
|
9
|
+
'LlamaLendTBTCcrvUSD' = 'llamaLendTBTCcrvUSD',
|
|
9
10
|
}
|
|
10
11
|
|
|
11
12
|
export enum LlamaLendStatus {
|
package/yarn-error.log
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
Arguments:
|
|
2
|
+
/Users/stefan/.nvm/versions/node/v14.19.0/bin/node /usr/local/Cellar/yarn/1.22.19/libexec/bin/yarn.js
|
|
3
|
+
|
|
4
|
+
PATH:
|
|
5
|
+
/Users/stefan/.nvm/versions/node/v14.19.0/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Applications/VMware Fusion.app/Contents/Public:/usr/local/go/bin:/Users/stefan/WebstormProjects/defisaver-positions-sdk/node_modules/.bin:/usr/local/go
|
|
6
|
+
|
|
7
|
+
Yarn version:
|
|
8
|
+
1.22.19
|
|
9
|
+
|
|
10
|
+
Node version:
|
|
11
|
+
14.19.0
|
|
12
|
+
|
|
13
|
+
Platform:
|
|
14
|
+
darwin x64
|
|
15
|
+
|
|
16
|
+
Trace:
|
|
17
|
+
Error: incorrect data check
|
|
18
|
+
at Zlib.zlibOnError [as onerror] (zlib.js:187:17)
|
|
19
|
+
|
|
20
|
+
npm manifest:
|
|
21
|
+
{
|
|
22
|
+
"name": "defisaver-positions-sdk",
|
|
23
|
+
"version": "0.0.1",
|
|
24
|
+
"description": "",
|
|
25
|
+
"main": "./cjs/index.js",
|
|
26
|
+
"module": "./esm/src/index.js",
|
|
27
|
+
"types": "./esm/src/index.d.ts",
|
|
28
|
+
"scripts": {
|
|
29
|
+
"build:esm": "rm -rf esm && tsc -p tsconfig.json",
|
|
30
|
+
"build:cjs": "rm -rf cjs && tsc -p tsconfig.cjs.json",
|
|
31
|
+
"build": "npm run build:cjs && npm run build:esm",
|
|
32
|
+
"dev": "tsc -p tsconfig.cjs.json --watch",
|
|
33
|
+
"lint": "eslint src/ --fix",
|
|
34
|
+
"generate-contracts": "node scripts/generateContracts.js",
|
|
35
|
+
"test": "mocha tests/*",
|
|
36
|
+
"build-test": "npm run build && mocha tests/*"
|
|
37
|
+
},
|
|
38
|
+
"keywords": [],
|
|
39
|
+
"author": "",
|
|
40
|
+
"license": "ISC",
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@defisaver/tokens": "^1.4.56",
|
|
43
|
+
"decimal.js": "^10.4.3"
|
|
44
|
+
},
|
|
45
|
+
"devDependencies": {
|
|
46
|
+
"@defisaver/eslint-config": "^1.0.1",
|
|
47
|
+
"chai": "^4.3.8",
|
|
48
|
+
"dotenv": "^16.3.1",
|
|
49
|
+
"eslint": "^8.49.0",
|
|
50
|
+
"mocha": "^10.2.0",
|
|
51
|
+
"typechain": "^8.3.1",
|
|
52
|
+
"typechain-target-web3-v1-3mihai3": "^6.0.2",
|
|
53
|
+
"typescript": "^5.2.2"
|
|
54
|
+
},
|
|
55
|
+
"peerDependencies": {
|
|
56
|
+
"web3": "^1.10.2"
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
yarn manifest:
|
|
61
|
+
No manifest
|
|
62
|
+
|
|
63
|
+
Lockfile:
|
|
64
|
+
No lockfile
|
|
File without changes
|
|
File without changes
|