@defisaver/positions-sdk 0.0.198 → 0.0.199-dev-2
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/.mocharc.json +4 -4
- package/.nvmrc +1 -1
- package/README.md +69 -69
- package/cjs/config/contracts.d.ts +126 -4
- package/cjs/config/contracts.js +14 -0
- package/cjs/contracts.d.ts +1 -0
- package/cjs/contracts.js +2 -1
- package/cjs/helpers/index.d.ts +1 -0
- package/cjs/helpers/index.js +2 -1
- package/cjs/helpers/liquityV2Helpers/index.d.ts +12 -0
- package/cjs/helpers/liquityV2Helpers/index.js +63 -0
- package/cjs/helpers/morphoBlueHelpers/index.js +66 -66
- package/cjs/index.d.ts +2 -1
- package/cjs/index.js +3 -1
- package/cjs/liquityV2/index.d.ts +18 -0
- package/cjs/liquityV2/index.js +184 -0
- package/cjs/markets/aave/marketAssets.js +2 -4
- package/cjs/markets/index.d.ts +1 -0
- package/cjs/markets/index.js +3 -1
- package/cjs/markets/liquityV2/index.d.ts +10 -0
- package/cjs/markets/liquityV2/index.js +47 -0
- package/cjs/moneymarket/moneymarketCommonService.js +1 -1
- package/cjs/types/contracts/generated/LiquityV2CollSurplusPool.d.ts +64 -0
- package/cjs/types/contracts/generated/LiquityV2CollSurplusPool.js +5 -0
- package/cjs/types/contracts/generated/LiquityV2TroveNFT.d.ts +73 -0
- package/cjs/types/contracts/generated/LiquityV2TroveNFT.js +5 -0
- package/cjs/types/contracts/generated/LiquityV2View.d.ts +244 -0
- package/cjs/types/contracts/generated/LiquityV2View.js +5 -0
- package/cjs/types/contracts/generated/index.d.ts +3 -0
- package/cjs/types/index.d.ts +1 -0
- package/cjs/types/index.js +1 -0
- package/cjs/types/liquityV2.d.ts +111 -0
- package/cjs/types/liquityV2.js +24 -0
- package/esm/config/contracts.d.ts +126 -4
- package/esm/config/contracts.js +14 -0
- package/esm/contracts.d.ts +1 -0
- package/esm/contracts.js +1 -0
- package/esm/helpers/index.d.ts +1 -0
- package/esm/helpers/index.js +1 -0
- package/esm/helpers/liquityV2Helpers/index.d.ts +12 -0
- package/esm/helpers/liquityV2Helpers/index.js +55 -0
- package/esm/helpers/morphoBlueHelpers/index.js +66 -66
- package/esm/index.d.ts +2 -1
- package/esm/index.js +2 -1
- package/esm/liquityV2/index.d.ts +18 -0
- package/esm/liquityV2/index.js +173 -0
- package/esm/markets/aave/marketAssets.js +2 -4
- package/esm/markets/index.d.ts +1 -0
- package/esm/markets/index.js +1 -0
- package/esm/markets/liquityV2/index.d.ts +10 -0
- package/esm/markets/liquityV2/index.js +40 -0
- package/esm/moneymarket/moneymarketCommonService.js +1 -1
- package/esm/types/contracts/generated/LiquityV2CollSurplusPool.d.ts +64 -0
- package/esm/types/contracts/generated/LiquityV2CollSurplusPool.js +4 -0
- package/esm/types/contracts/generated/LiquityV2TroveNFT.d.ts +73 -0
- package/esm/types/contracts/generated/LiquityV2TroveNFT.js +4 -0
- package/esm/types/contracts/generated/LiquityV2View.d.ts +244 -0
- package/esm/types/contracts/generated/LiquityV2View.js +4 -0
- package/esm/types/contracts/generated/index.d.ts +3 -0
- package/esm/types/index.d.ts +1 -0
- package/esm/types/index.js +1 -0
- package/esm/types/liquityV2.d.ts +111 -0
- package/esm/types/liquityV2.js +21 -0
- package/package.json +49 -49
- package/src/aaveV2/index.ts +227 -227
- package/src/aaveV3/index.ts +625 -625
- package/src/assets/index.ts +60 -60
- package/src/chickenBonds/index.ts +123 -123
- package/src/compoundV2/index.ts +220 -220
- package/src/compoundV3/index.ts +291 -291
- package/src/config/contracts.js +1109 -1095
- package/src/constants/index.ts +6 -6
- package/src/contracts.ts +133 -132
- package/src/curveUsd/index.ts +229 -229
- package/src/eulerV2/index.ts +303 -303
- package/src/exchange/index.ts +17 -17
- package/src/helpers/aaveHelpers/index.ts +198 -198
- package/src/helpers/chickenBondsHelpers/index.ts +23 -23
- package/src/helpers/compoundHelpers/index.ts +246 -246
- package/src/helpers/curveUsdHelpers/index.ts +40 -40
- package/src/helpers/eulerHelpers/index.ts +232 -232
- package/src/helpers/index.ts +10 -9
- package/src/helpers/liquityV2Helpers/index.ts +80 -0
- package/src/helpers/llamaLendHelpers/index.ts +53 -53
- package/src/helpers/makerHelpers/index.ts +94 -94
- package/src/helpers/morphoBlueHelpers/index.ts +365 -365
- package/src/helpers/sparkHelpers/index.ts +150 -150
- package/src/index.ts +50 -48
- package/src/liquity/index.ts +116 -116
- package/src/liquityV2/index.ts +220 -0
- package/src/llamaLend/index.ts +275 -275
- package/src/maker/index.ts +117 -117
- package/src/markets/aave/index.ts +152 -152
- package/src/markets/aave/marketAssets.ts +44 -46
- package/src/markets/compound/index.ts +213 -213
- package/src/markets/compound/marketsAssets.ts +82 -82
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/euler/index.ts +26 -26
- package/src/markets/index.ts +24 -24
- package/src/markets/liquityV2/index.ts +44 -0
- package/src/markets/llamaLend/contractAddresses.ts +141 -141
- package/src/markets/llamaLend/index.ts +235 -235
- package/src/markets/morphoBlue/index.ts +895 -895
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +10 -10
- package/src/moneymarket/moneymarketCommonService.ts +80 -80
- package/src/morphoAaveV2/index.ts +256 -256
- package/src/morphoAaveV3/index.ts +631 -631
- package/src/morphoBlue/index.ts +204 -204
- package/src/multicall/index.ts +22 -22
- package/src/services/dsrService.ts +15 -15
- package/src/services/priceService.ts +62 -62
- package/src/services/utils.ts +56 -56
- package/src/setup.ts +8 -8
- package/src/spark/index.ts +461 -461
- package/src/staking/staking.ts +220 -220
- package/src/types/aave.ts +271 -271
- package/src/types/chickenBonds.ts +45 -45
- package/src/types/common.ts +84 -84
- package/src/types/compound.ts +131 -131
- package/src/types/contracts/generated/LiquityV2CollSurplusPool.ts +130 -0
- package/src/types/contracts/generated/LiquityV2TroveNFT.ts +150 -0
- package/src/types/contracts/generated/LiquityV2View.ts +315 -0
- package/src/types/contracts/generated/index.ts +3 -0
- package/src/types/curveUsd.ts +118 -118
- package/src/types/euler.ts +171 -171
- package/src/types/index.ts +10 -9
- package/src/types/liquity.ts +30 -30
- package/src/types/liquityV2.ts +119 -0
- package/src/types/llamaLend.ts +155 -155
- package/src/types/maker.ts +50 -50
- package/src/types/morphoBlue.ts +192 -192
- package/src/types/spark.ts +131 -131
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
4
|
+
import type { EventLog } from "web3-core";
|
|
5
|
+
import type { EventEmitter } from "events";
|
|
6
|
+
import type { Callback, NonPayableTransactionObject, BlockType, ContractEventLog, BaseContract } from "./types";
|
|
7
|
+
export interface EventOptions {
|
|
8
|
+
filter?: object;
|
|
9
|
+
fromBlock?: BlockType;
|
|
10
|
+
topics?: string[];
|
|
11
|
+
}
|
|
12
|
+
export type Approval = ContractEventLog<{
|
|
13
|
+
owner: string;
|
|
14
|
+
approved: string;
|
|
15
|
+
tokenId: string;
|
|
16
|
+
0: string;
|
|
17
|
+
1: string;
|
|
18
|
+
2: string;
|
|
19
|
+
}>;
|
|
20
|
+
export type ApprovalForAll = ContractEventLog<{
|
|
21
|
+
owner: string;
|
|
22
|
+
operator: string;
|
|
23
|
+
approved: boolean;
|
|
24
|
+
0: string;
|
|
25
|
+
1: string;
|
|
26
|
+
2: boolean;
|
|
27
|
+
}>;
|
|
28
|
+
export type Transfer = ContractEventLog<{
|
|
29
|
+
from: string;
|
|
30
|
+
to: string;
|
|
31
|
+
tokenId: string;
|
|
32
|
+
0: string;
|
|
33
|
+
1: string;
|
|
34
|
+
2: string;
|
|
35
|
+
}>;
|
|
36
|
+
export interface LiquityV2TroveNFT extends BaseContract {
|
|
37
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): LiquityV2TroveNFT;
|
|
38
|
+
clone(): LiquityV2TroveNFT;
|
|
39
|
+
methods: {
|
|
40
|
+
approve(to: string, tokenId: number | string | BN): NonPayableTransactionObject<void>;
|
|
41
|
+
balanceOf(owner: string): NonPayableTransactionObject<string>;
|
|
42
|
+
burn(_troveId: number | string | BN): NonPayableTransactionObject<void>;
|
|
43
|
+
getApproved(tokenId: number | string | BN): NonPayableTransactionObject<string>;
|
|
44
|
+
isApprovedForAll(owner: string, operator: string): NonPayableTransactionObject<boolean>;
|
|
45
|
+
metadataNFT(): NonPayableTransactionObject<string>;
|
|
46
|
+
mint(_owner: string, _troveId: number | string | BN): NonPayableTransactionObject<void>;
|
|
47
|
+
name(): NonPayableTransactionObject<string>;
|
|
48
|
+
ownerOf(tokenId: number | string | BN): NonPayableTransactionObject<string>;
|
|
49
|
+
"safeTransferFrom(address,address,uint256)"(from: string, to: string, tokenId: number | string | BN): NonPayableTransactionObject<void>;
|
|
50
|
+
"safeTransferFrom(address,address,uint256,bytes)"(from: string, to: string, tokenId: number | string | BN, data: string | number[]): NonPayableTransactionObject<void>;
|
|
51
|
+
setApprovalForAll(operator: string, approved: boolean): NonPayableTransactionObject<void>;
|
|
52
|
+
supportsInterface(interfaceId: string | number[]): NonPayableTransactionObject<boolean>;
|
|
53
|
+
symbol(): NonPayableTransactionObject<string>;
|
|
54
|
+
tokenURI(_tokenId: number | string | BN): NonPayableTransactionObject<string>;
|
|
55
|
+
transferFrom(from: string, to: string, tokenId: number | string | BN): NonPayableTransactionObject<void>;
|
|
56
|
+
troveManager(): NonPayableTransactionObject<string>;
|
|
57
|
+
};
|
|
58
|
+
events: {
|
|
59
|
+
Approval(cb?: Callback<Approval>): EventEmitter;
|
|
60
|
+
Approval(options?: EventOptions, cb?: Callback<Approval>): EventEmitter;
|
|
61
|
+
ApprovalForAll(cb?: Callback<ApprovalForAll>): EventEmitter;
|
|
62
|
+
ApprovalForAll(options?: EventOptions, cb?: Callback<ApprovalForAll>): EventEmitter;
|
|
63
|
+
Transfer(cb?: Callback<Transfer>): EventEmitter;
|
|
64
|
+
Transfer(options?: EventOptions, cb?: Callback<Transfer>): EventEmitter;
|
|
65
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
66
|
+
};
|
|
67
|
+
once(event: "Approval", cb: Callback<Approval>): void;
|
|
68
|
+
once(event: "Approval", options: EventOptions, cb: Callback<Approval>): void;
|
|
69
|
+
once(event: "ApprovalForAll", cb: Callback<ApprovalForAll>): void;
|
|
70
|
+
once(event: "ApprovalForAll", options: EventOptions, cb: Callback<ApprovalForAll>): void;
|
|
71
|
+
once(event: "Transfer", cb: Callback<Transfer>): void;
|
|
72
|
+
once(event: "Transfer", options: EventOptions, cb: Callback<Transfer>): void;
|
|
73
|
+
}
|
|
@@ -0,0 +1,244 @@
|
|
|
1
|
+
/// <reference types="node" />
|
|
2
|
+
import type BN from "bn.js";
|
|
3
|
+
import type { ContractOptions } from "web3-eth-contract";
|
|
4
|
+
import type { EventLog } from "web3-core";
|
|
5
|
+
import type { EventEmitter } from "events";
|
|
6
|
+
import type { Callback, NonPayableTransactionObject, BlockType, BaseContract } from "./types";
|
|
7
|
+
export interface EventOptions {
|
|
8
|
+
filter?: object;
|
|
9
|
+
fromBlock?: BlockType;
|
|
10
|
+
topics?: string[];
|
|
11
|
+
}
|
|
12
|
+
export declare namespace LiquityV2View {
|
|
13
|
+
type MarketDataStruct = [
|
|
14
|
+
string,
|
|
15
|
+
number | string | BN,
|
|
16
|
+
number | string | BN,
|
|
17
|
+
number | string | BN,
|
|
18
|
+
number | string | BN,
|
|
19
|
+
number | string | BN,
|
|
20
|
+
number | string | BN,
|
|
21
|
+
number | string | BN,
|
|
22
|
+
string,
|
|
23
|
+
string,
|
|
24
|
+
string,
|
|
25
|
+
string,
|
|
26
|
+
string,
|
|
27
|
+
string,
|
|
28
|
+
string,
|
|
29
|
+
string,
|
|
30
|
+
string,
|
|
31
|
+
string,
|
|
32
|
+
number | string | BN,
|
|
33
|
+
boolean
|
|
34
|
+
] | {
|
|
35
|
+
market: string;
|
|
36
|
+
CCR: number | string | BN;
|
|
37
|
+
MCR: number | string | BN;
|
|
38
|
+
SCR: number | string | BN;
|
|
39
|
+
LIQUIDATION_PENALTY_SP: number | string | BN;
|
|
40
|
+
LIQUIDATION_PENALTY_REDISTRIBUTION: number | string | BN;
|
|
41
|
+
entireSystemColl: number | string | BN;
|
|
42
|
+
entireSystemDebt: number | string | BN;
|
|
43
|
+
collToken: string;
|
|
44
|
+
troveNFT: string;
|
|
45
|
+
borrowerOperations: string;
|
|
46
|
+
troveManager: string;
|
|
47
|
+
stabilityPool: string;
|
|
48
|
+
sortedTroves: string;
|
|
49
|
+
collSurplusPool: string;
|
|
50
|
+
activePool: string;
|
|
51
|
+
hintHelpers: string;
|
|
52
|
+
priceFeed: string;
|
|
53
|
+
collPrice: number | string | BN;
|
|
54
|
+
isShutDown: boolean;
|
|
55
|
+
};
|
|
56
|
+
type MarketDataStructOutputArray = [
|
|
57
|
+
string,
|
|
58
|
+
string,
|
|
59
|
+
string,
|
|
60
|
+
string,
|
|
61
|
+
string,
|
|
62
|
+
string,
|
|
63
|
+
string,
|
|
64
|
+
string,
|
|
65
|
+
string,
|
|
66
|
+
string,
|
|
67
|
+
string,
|
|
68
|
+
string,
|
|
69
|
+
string,
|
|
70
|
+
string,
|
|
71
|
+
string,
|
|
72
|
+
string,
|
|
73
|
+
string,
|
|
74
|
+
string,
|
|
75
|
+
string,
|
|
76
|
+
boolean
|
|
77
|
+
];
|
|
78
|
+
type MarketDataStructOutputStruct = {
|
|
79
|
+
market: string;
|
|
80
|
+
CCR: string;
|
|
81
|
+
MCR: string;
|
|
82
|
+
SCR: string;
|
|
83
|
+
LIQUIDATION_PENALTY_SP: string;
|
|
84
|
+
LIQUIDATION_PENALTY_REDISTRIBUTION: string;
|
|
85
|
+
entireSystemColl: string;
|
|
86
|
+
entireSystemDebt: string;
|
|
87
|
+
collToken: string;
|
|
88
|
+
troveNFT: string;
|
|
89
|
+
borrowerOperations: string;
|
|
90
|
+
troveManager: string;
|
|
91
|
+
stabilityPool: string;
|
|
92
|
+
sortedTroves: string;
|
|
93
|
+
collSurplusPool: string;
|
|
94
|
+
activePool: string;
|
|
95
|
+
hintHelpers: string;
|
|
96
|
+
priceFeed: string;
|
|
97
|
+
collPrice: string;
|
|
98
|
+
isShutDown: boolean;
|
|
99
|
+
};
|
|
100
|
+
type MarketDataStructOutput = MarketDataStructOutputArray & MarketDataStructOutputStruct;
|
|
101
|
+
type TroveDataStruct = [
|
|
102
|
+
number | string | BN,
|
|
103
|
+
string,
|
|
104
|
+
string,
|
|
105
|
+
number | string | BN,
|
|
106
|
+
number | string | BN,
|
|
107
|
+
number | string | BN,
|
|
108
|
+
number | string | BN,
|
|
109
|
+
number | string | BN,
|
|
110
|
+
number | string | BN,
|
|
111
|
+
string,
|
|
112
|
+
number | string | BN
|
|
113
|
+
] | {
|
|
114
|
+
troveId: number | string | BN;
|
|
115
|
+
owner: string;
|
|
116
|
+
collToken: string;
|
|
117
|
+
status: number | string | BN;
|
|
118
|
+
collAmount: number | string | BN;
|
|
119
|
+
debtAmount: number | string | BN;
|
|
120
|
+
collPrice: number | string | BN;
|
|
121
|
+
TCRatio: number | string | BN;
|
|
122
|
+
annualInterestRate: number | string | BN;
|
|
123
|
+
interestBatchManager: string;
|
|
124
|
+
batchDebtShares: number | string | BN;
|
|
125
|
+
};
|
|
126
|
+
type TroveDataStructOutputArray = [
|
|
127
|
+
string,
|
|
128
|
+
string,
|
|
129
|
+
string,
|
|
130
|
+
string,
|
|
131
|
+
string,
|
|
132
|
+
string,
|
|
133
|
+
string,
|
|
134
|
+
string,
|
|
135
|
+
string,
|
|
136
|
+
string,
|
|
137
|
+
string
|
|
138
|
+
];
|
|
139
|
+
type TroveDataStructOutputStruct = {
|
|
140
|
+
troveId: string;
|
|
141
|
+
owner: string;
|
|
142
|
+
collToken: string;
|
|
143
|
+
status: string;
|
|
144
|
+
collAmount: string;
|
|
145
|
+
debtAmount: string;
|
|
146
|
+
collPrice: string;
|
|
147
|
+
TCRatio: string;
|
|
148
|
+
annualInterestRate: string;
|
|
149
|
+
interestBatchManager: string;
|
|
150
|
+
batchDebtShares: string;
|
|
151
|
+
};
|
|
152
|
+
type TroveDataStructOutput = TroveDataStructOutputArray & TroveDataStructOutputStruct;
|
|
153
|
+
type ExistingTroveStruct = [number | string | BN, boolean] | {
|
|
154
|
+
troveId: number | string | BN;
|
|
155
|
+
ownedByUser: boolean;
|
|
156
|
+
};
|
|
157
|
+
type ExistingTroveStructOutputArray = [string, boolean];
|
|
158
|
+
type ExistingTroveStructOutputStruct = {
|
|
159
|
+
troveId: string;
|
|
160
|
+
ownedByUser: boolean;
|
|
161
|
+
};
|
|
162
|
+
type ExistingTroveStructOutput = ExistingTroveStructOutputArray & ExistingTroveStructOutputStruct;
|
|
163
|
+
}
|
|
164
|
+
export interface LiquityV2View extends BaseContract {
|
|
165
|
+
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): LiquityV2View;
|
|
166
|
+
clone(): LiquityV2View;
|
|
167
|
+
methods: {
|
|
168
|
+
findInsertPosition(_market: string, _interestRate: number | string | BN, _prevId: number | string | BN, _nextId: number | string | BN): NonPayableTransactionObject<[
|
|
169
|
+
string,
|
|
170
|
+
string
|
|
171
|
+
] & {
|
|
172
|
+
prevId: string;
|
|
173
|
+
nextId: string;
|
|
174
|
+
}>;
|
|
175
|
+
getApproxHint(_market: string, _collIndex: number | string | BN, _interestRate: number | string | BN, _numTrials: number | string | BN, _inputRandomSeed: number | string | BN): NonPayableTransactionObject<[
|
|
176
|
+
string,
|
|
177
|
+
string,
|
|
178
|
+
string
|
|
179
|
+
] & {
|
|
180
|
+
hintId: string;
|
|
181
|
+
diff: string;
|
|
182
|
+
latestRandomSeed: string;
|
|
183
|
+
}>;
|
|
184
|
+
getDebtInFront(_market: string, _troveId: number | string | BN, _acc: number | string | BN, _iterations: number | string | BN): NonPayableTransactionObject<[
|
|
185
|
+
string,
|
|
186
|
+
string
|
|
187
|
+
] & {
|
|
188
|
+
next: string;
|
|
189
|
+
debt: string;
|
|
190
|
+
}>;
|
|
191
|
+
getDebtInFrontByInterestRate(_market: string, _troveId: number | string | BN, _acc: number | string | BN, _iterations: number | string | BN, _targetIR: number | string | BN): NonPayableTransactionObject<[
|
|
192
|
+
string,
|
|
193
|
+
string
|
|
194
|
+
] & {
|
|
195
|
+
next: string;
|
|
196
|
+
debt: string;
|
|
197
|
+
}>;
|
|
198
|
+
getDebtInFrontByTroveNum(_market: string, _numTroves: number | string | BN): NonPayableTransactionObject<string>;
|
|
199
|
+
getDepositorInfo(_market: string, _depositor: string): NonPayableTransactionObject<[
|
|
200
|
+
string,
|
|
201
|
+
string,
|
|
202
|
+
string
|
|
203
|
+
] & {
|
|
204
|
+
compoundedBOLD: string;
|
|
205
|
+
collGain: string;
|
|
206
|
+
boldGain: string;
|
|
207
|
+
}>;
|
|
208
|
+
getInsertPosition(_market: string, _collIndex: number | string | BN, _interestRate: number | string | BN, _numTrials: number | string | BN, _inputRandomSeed: number | string | BN): NonPayableTransactionObject<[
|
|
209
|
+
string,
|
|
210
|
+
string
|
|
211
|
+
] & {
|
|
212
|
+
prevId: string;
|
|
213
|
+
nextId: string;
|
|
214
|
+
}>;
|
|
215
|
+
getMarketData(_market: string): NonPayableTransactionObject<LiquityV2View.MarketDataStructOutput>;
|
|
216
|
+
getNumOfTrovesInFrontOfTrove(_market: string, _troveId: number | string | BN, _iterations: number | string | BN): NonPayableTransactionObject<[
|
|
217
|
+
string,
|
|
218
|
+
string
|
|
219
|
+
] & {
|
|
220
|
+
next: string;
|
|
221
|
+
numTroves: string;
|
|
222
|
+
}>;
|
|
223
|
+
getTroveInfo(_market: string, _troveId: number | string | BN): NonPayableTransactionObject<LiquityV2View.TroveDataStructOutput>;
|
|
224
|
+
getTrovePosition(_market: string, _collIndex: number | string | BN, _troveId: number | string | BN, _numTrials: number | string | BN, _inputRandomSeed: number | string | BN): NonPayableTransactionObject<[
|
|
225
|
+
string,
|
|
226
|
+
string
|
|
227
|
+
] & {
|
|
228
|
+
prevId: string;
|
|
229
|
+
nextId: string;
|
|
230
|
+
}>;
|
|
231
|
+
getUserTroves(_user: string, _market: string, _startIndex: number | string | BN, _endIndex: number | string | BN): NonPayableTransactionObject<[
|
|
232
|
+
LiquityV2View.ExistingTroveStructOutput[],
|
|
233
|
+
string
|
|
234
|
+
] & {
|
|
235
|
+
troves: LiquityV2View.ExistingTroveStructOutput[];
|
|
236
|
+
nextFreeTroveIndex: string;
|
|
237
|
+
}>;
|
|
238
|
+
isShutDown(_market: string): NonPayableTransactionObject<boolean>;
|
|
239
|
+
predictAdjustTroveUpfrontFee(_market: string, _collIndex: number | string | BN, _troveId: number | string | BN, _debtIncrease: number | string | BN): NonPayableTransactionObject<string>;
|
|
240
|
+
};
|
|
241
|
+
events: {
|
|
242
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
243
|
+
};
|
|
244
|
+
}
|
|
@@ -36,6 +36,9 @@ export type { IVariableDebtToken } from "./IVariableDebtToken";
|
|
|
36
36
|
export type { LendingPoolAddressesProvider } from "./LendingPoolAddressesProvider";
|
|
37
37
|
export type { Lido } from "./Lido";
|
|
38
38
|
export type { LiquityActivePool } from "./LiquityActivePool";
|
|
39
|
+
export type { LiquityV2CollSurplusPool } from "./LiquityV2CollSurplusPool";
|
|
40
|
+
export type { LiquityV2TroveNFT } from "./LiquityV2TroveNFT";
|
|
41
|
+
export type { LiquityV2View } from "./LiquityV2View";
|
|
39
42
|
export type { LiquityView } from "./LiquityView";
|
|
40
43
|
export type { LlamaLendControllerAbi } from "./LlamaLendControllerAbi";
|
|
41
44
|
export type { LlamaLendView } from "./LlamaLendView";
|
package/cjs/types/index.d.ts
CHANGED
package/cjs/types/index.js
CHANGED
|
@@ -19,6 +19,7 @@ __exportStar(require("./compound"), exports);
|
|
|
19
19
|
__exportStar(require("./spark"), exports);
|
|
20
20
|
__exportStar(require("./curveUsd"), exports);
|
|
21
21
|
__exportStar(require("./liquity"), exports);
|
|
22
|
+
__exportStar(require("./liquityV2"), exports);
|
|
22
23
|
__exportStar(require("./maker"), exports);
|
|
23
24
|
__exportStar(require("./chickenBonds"), exports);
|
|
24
25
|
__exportStar(require("./morphoBlue"), exports);
|
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { EthAddress, NetworkNumber } from './common';
|
|
2
|
+
export declare enum LiquityV2Versions {
|
|
3
|
+
LiquityV2Eth = "liquityv2eth",
|
|
4
|
+
LiquityV2WstEth = "liquityv2wsteth",
|
|
5
|
+
LiquityV2REth = "liquityv2reth"
|
|
6
|
+
}
|
|
7
|
+
export declare enum LIQUITY_V2_TROVE_STATUS_ENUM {
|
|
8
|
+
nonExistent = 0,
|
|
9
|
+
active = 1,
|
|
10
|
+
closedByOwner = 2,
|
|
11
|
+
closedByLiquidation = 3,
|
|
12
|
+
zombie = 4
|
|
13
|
+
}
|
|
14
|
+
export declare const LIQUITY_V2_STATUS_MAPPING: {
|
|
15
|
+
nonExistent: string;
|
|
16
|
+
active: string;
|
|
17
|
+
closedByOwner: string;
|
|
18
|
+
closedByLiquidation: string;
|
|
19
|
+
zombie: string;
|
|
20
|
+
};
|
|
21
|
+
export interface LiquityV2MarketInfo {
|
|
22
|
+
chainIds: NetworkNumber[];
|
|
23
|
+
label: string;
|
|
24
|
+
shortLabel: string;
|
|
25
|
+
url: string;
|
|
26
|
+
value: LiquityV2Versions;
|
|
27
|
+
debtToken: string;
|
|
28
|
+
collateralToken: string;
|
|
29
|
+
marketAddress: string;
|
|
30
|
+
protocolName: string;
|
|
31
|
+
}
|
|
32
|
+
export interface LiquityV2AssetData {
|
|
33
|
+
symbol: string;
|
|
34
|
+
address: string;
|
|
35
|
+
price: string;
|
|
36
|
+
incentiveSupplyApy?: string;
|
|
37
|
+
incentiveSupplyToken?: string;
|
|
38
|
+
totalSupply: string;
|
|
39
|
+
totalBorrow: string;
|
|
40
|
+
canBeSupplied: boolean;
|
|
41
|
+
canBeBorrowed: boolean;
|
|
42
|
+
leftToBorrowGlobal: string;
|
|
43
|
+
leftToWithdrawGlobal: string;
|
|
44
|
+
}
|
|
45
|
+
export type LiquityV2AssetsData = {
|
|
46
|
+
[key: string]: LiquityV2AssetData;
|
|
47
|
+
};
|
|
48
|
+
export interface InnerLiquityV2MarketData {
|
|
49
|
+
minCollRatio: string;
|
|
50
|
+
totalCollRatio: string;
|
|
51
|
+
criticalCollRatio: string;
|
|
52
|
+
isUnderCollateralized: boolean;
|
|
53
|
+
hintHelperAddress: EthAddress;
|
|
54
|
+
troveNFTAddress: EthAddress;
|
|
55
|
+
borrowerOperationsAddress: EthAddress;
|
|
56
|
+
troveManagerAddress: EthAddress;
|
|
57
|
+
stabilityPoolAddress: EthAddress;
|
|
58
|
+
collSurplusPoolAddress: EthAddress;
|
|
59
|
+
activePoolAddress: EthAddress;
|
|
60
|
+
}
|
|
61
|
+
export interface LiquityV2MarketData {
|
|
62
|
+
assetsData: LiquityV2AssetsData;
|
|
63
|
+
marketData: InnerLiquityV2MarketData;
|
|
64
|
+
}
|
|
65
|
+
export interface LiquityV2UsedAsset {
|
|
66
|
+
symbol: string;
|
|
67
|
+
collateral?: boolean;
|
|
68
|
+
supplied: string;
|
|
69
|
+
suppliedUsd: string;
|
|
70
|
+
borrowed: string;
|
|
71
|
+
borrowedUsd: string;
|
|
72
|
+
isSupplied: boolean;
|
|
73
|
+
isBorrowed: boolean;
|
|
74
|
+
}
|
|
75
|
+
export type LiquityV2UsedAssets = {
|
|
76
|
+
[key: string]: LiquityV2UsedAsset;
|
|
77
|
+
};
|
|
78
|
+
export interface LiquityV2AggregatedTroveData {
|
|
79
|
+
suppliedUsd: string;
|
|
80
|
+
borrowedUsd: string;
|
|
81
|
+
borrowLimitUsd: string;
|
|
82
|
+
leftToBorrowUsd: string;
|
|
83
|
+
netApy: string;
|
|
84
|
+
incentiveUsd: string;
|
|
85
|
+
totalInterestUsd: string;
|
|
86
|
+
leveragedType: string;
|
|
87
|
+
leveragedAsset: string;
|
|
88
|
+
liquidationPrice: string;
|
|
89
|
+
ratio: string;
|
|
90
|
+
collRatio: string;
|
|
91
|
+
}
|
|
92
|
+
export interface LiquityV2TroveData {
|
|
93
|
+
usedAssets: LiquityV2UsedAssets;
|
|
94
|
+
troveId: string;
|
|
95
|
+
ratio: string;
|
|
96
|
+
collRatio: string;
|
|
97
|
+
interestRate: string;
|
|
98
|
+
leftToBorrowUsd: string;
|
|
99
|
+
borrowLimitUsd: string;
|
|
100
|
+
suppliedUsd: string;
|
|
101
|
+
borrowedUsd: string;
|
|
102
|
+
netApy: string;
|
|
103
|
+
incentiveUsd: string;
|
|
104
|
+
totalInterestUsd: string;
|
|
105
|
+
interestBatchManager: EthAddress;
|
|
106
|
+
troveStatus: string;
|
|
107
|
+
leveragedType: string;
|
|
108
|
+
leveragedAsset: string;
|
|
109
|
+
liquidationPrice: string;
|
|
110
|
+
debtInFront: string;
|
|
111
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LIQUITY_V2_STATUS_MAPPING = exports.LIQUITY_V2_TROVE_STATUS_ENUM = exports.LiquityV2Versions = void 0;
|
|
4
|
+
var LiquityV2Versions;
|
|
5
|
+
(function (LiquityV2Versions) {
|
|
6
|
+
LiquityV2Versions["LiquityV2Eth"] = "liquityv2eth";
|
|
7
|
+
LiquityV2Versions["LiquityV2WstEth"] = "liquityv2wsteth";
|
|
8
|
+
LiquityV2Versions["LiquityV2REth"] = "liquityv2reth";
|
|
9
|
+
})(LiquityV2Versions || (exports.LiquityV2Versions = LiquityV2Versions = {}));
|
|
10
|
+
var LIQUITY_V2_TROVE_STATUS_ENUM;
|
|
11
|
+
(function (LIQUITY_V2_TROVE_STATUS_ENUM) {
|
|
12
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["nonExistent"] = 0] = "nonExistent";
|
|
13
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["active"] = 1] = "active";
|
|
14
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["closedByOwner"] = 2] = "closedByOwner";
|
|
15
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["closedByLiquidation"] = 3] = "closedByLiquidation";
|
|
16
|
+
LIQUITY_V2_TROVE_STATUS_ENUM[LIQUITY_V2_TROVE_STATUS_ENUM["zombie"] = 4] = "zombie";
|
|
17
|
+
})(LIQUITY_V2_TROVE_STATUS_ENUM || (exports.LIQUITY_V2_TROVE_STATUS_ENUM = LIQUITY_V2_TROVE_STATUS_ENUM = {}));
|
|
18
|
+
exports.LIQUITY_V2_STATUS_MAPPING = {
|
|
19
|
+
nonExistent: 'Non existent',
|
|
20
|
+
active: 'Active',
|
|
21
|
+
closedByOwner: 'Closed',
|
|
22
|
+
closedByLiquidation: 'Liquidated',
|
|
23
|
+
zombie: 'Zombie',
|
|
24
|
+
};
|
|
@@ -7405,8 +7405,130 @@ export namespace LlamaLendControllerAbi {
|
|
|
7405
7405
|
let networks_80: {};
|
|
7406
7406
|
export { networks_80 as networks };
|
|
7407
7407
|
}
|
|
7408
|
+
export namespace LiquityV2View {
|
|
7409
|
+
let abi_81: {
|
|
7410
|
+
inputs: {
|
|
7411
|
+
internalType: string;
|
|
7412
|
+
name: string;
|
|
7413
|
+
type: string;
|
|
7414
|
+
}[];
|
|
7415
|
+
name: string;
|
|
7416
|
+
outputs: ({
|
|
7417
|
+
components: {
|
|
7418
|
+
internalType: string;
|
|
7419
|
+
name: string;
|
|
7420
|
+
type: string;
|
|
7421
|
+
}[];
|
|
7422
|
+
internalType: string;
|
|
7423
|
+
name: string;
|
|
7424
|
+
type: string;
|
|
7425
|
+
} | {
|
|
7426
|
+
internalType: string;
|
|
7427
|
+
name: string;
|
|
7428
|
+
type: string;
|
|
7429
|
+
components?: undefined;
|
|
7430
|
+
})[];
|
|
7431
|
+
stateMutability: string;
|
|
7432
|
+
type: string;
|
|
7433
|
+
}[];
|
|
7434
|
+
export { abi_81 as abi };
|
|
7435
|
+
let networks_81: {
|
|
7436
|
+
"1": {
|
|
7437
|
+
address: string;
|
|
7438
|
+
};
|
|
7439
|
+
};
|
|
7440
|
+
export { networks_81 as networks };
|
|
7441
|
+
}
|
|
7442
|
+
export namespace LiquityV2CollSurplusPool {
|
|
7443
|
+
let abi_82: ({
|
|
7444
|
+
inputs: {
|
|
7445
|
+
internalType: string;
|
|
7446
|
+
name: string;
|
|
7447
|
+
type: string;
|
|
7448
|
+
}[];
|
|
7449
|
+
stateMutability: string;
|
|
7450
|
+
type: string;
|
|
7451
|
+
anonymous?: undefined;
|
|
7452
|
+
name?: undefined;
|
|
7453
|
+
outputs?: undefined;
|
|
7454
|
+
} | {
|
|
7455
|
+
anonymous: boolean;
|
|
7456
|
+
inputs: {
|
|
7457
|
+
indexed: boolean;
|
|
7458
|
+
internalType: string;
|
|
7459
|
+
name: string;
|
|
7460
|
+
type: string;
|
|
7461
|
+
}[];
|
|
7462
|
+
name: string;
|
|
7463
|
+
type: string;
|
|
7464
|
+
stateMutability?: undefined;
|
|
7465
|
+
outputs?: undefined;
|
|
7466
|
+
} | {
|
|
7467
|
+
inputs: {
|
|
7468
|
+
internalType: string;
|
|
7469
|
+
name: string;
|
|
7470
|
+
type: string;
|
|
7471
|
+
}[];
|
|
7472
|
+
name: string;
|
|
7473
|
+
outputs: {
|
|
7474
|
+
internalType: string;
|
|
7475
|
+
name: string;
|
|
7476
|
+
type: string;
|
|
7477
|
+
}[];
|
|
7478
|
+
stateMutability: string;
|
|
7479
|
+
type: string;
|
|
7480
|
+
anonymous?: undefined;
|
|
7481
|
+
})[];
|
|
7482
|
+
export { abi_82 as abi };
|
|
7483
|
+
let networks_82: {};
|
|
7484
|
+
export { networks_82 as networks };
|
|
7485
|
+
}
|
|
7486
|
+
export namespace LiquityV2TroveNFT {
|
|
7487
|
+
let abi_83: ({
|
|
7488
|
+
inputs: {
|
|
7489
|
+
internalType: string;
|
|
7490
|
+
name: string;
|
|
7491
|
+
type: string;
|
|
7492
|
+
}[];
|
|
7493
|
+
stateMutability: string;
|
|
7494
|
+
type: string;
|
|
7495
|
+
anonymous?: undefined;
|
|
7496
|
+
name?: undefined;
|
|
7497
|
+
outputs?: undefined;
|
|
7498
|
+
} | {
|
|
7499
|
+
anonymous: boolean;
|
|
7500
|
+
inputs: {
|
|
7501
|
+
indexed: boolean;
|
|
7502
|
+
internalType: string;
|
|
7503
|
+
name: string;
|
|
7504
|
+
type: string;
|
|
7505
|
+
}[];
|
|
7506
|
+
name: string;
|
|
7507
|
+
type: string;
|
|
7508
|
+
stateMutability?: undefined;
|
|
7509
|
+
outputs?: undefined;
|
|
7510
|
+
} | {
|
|
7511
|
+
inputs: {
|
|
7512
|
+
internalType: string;
|
|
7513
|
+
name: string;
|
|
7514
|
+
type: string;
|
|
7515
|
+
}[];
|
|
7516
|
+
name: string;
|
|
7517
|
+
outputs: {
|
|
7518
|
+
internalType: string;
|
|
7519
|
+
name: string;
|
|
7520
|
+
type: string;
|
|
7521
|
+
}[];
|
|
7522
|
+
stateMutability: string;
|
|
7523
|
+
type: string;
|
|
7524
|
+
anonymous?: undefined;
|
|
7525
|
+
})[];
|
|
7526
|
+
export { abi_83 as abi };
|
|
7527
|
+
let networks_83: {};
|
|
7528
|
+
export { networks_83 as networks };
|
|
7529
|
+
}
|
|
7408
7530
|
export namespace EulerV2View {
|
|
7409
|
-
let
|
|
7531
|
+
let abi_84: ({
|
|
7410
7532
|
inputs: {
|
|
7411
7533
|
internalType: string;
|
|
7412
7534
|
name: string;
|
|
@@ -7469,11 +7591,11 @@ export namespace EulerV2View {
|
|
|
7469
7591
|
stateMutability: string;
|
|
7470
7592
|
type: string;
|
|
7471
7593
|
})[];
|
|
7472
|
-
export {
|
|
7473
|
-
let
|
|
7594
|
+
export { abi_84 as abi };
|
|
7595
|
+
let networks_84: {
|
|
7474
7596
|
"1": {
|
|
7475
7597
|
address: string;
|
|
7476
7598
|
};
|
|
7477
7599
|
};
|
|
7478
|
-
export {
|
|
7600
|
+
export { networks_84 as networks };
|
|
7479
7601
|
}
|