@defisaver/positions-sdk 0.0.17 → 0.0.18
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/aaveV3/index.d.ts +1 -1
- package/cjs/aaveV3/index.js +2 -3
- package/cjs/compoundV3/index.d.ts +1 -1
- package/cjs/compoundV3/index.js +2 -3
- package/cjs/config/contracts.d.ts +184 -72
- package/cjs/config/contracts.js +16 -0
- package/cjs/markets/curveUsd/index.d.ts +2 -0
- package/cjs/markets/curveUsd/index.js +14 -1
- package/cjs/morphoAaveV3/index.d.ts +1 -1
- package/cjs/morphoAaveV3/index.js +2 -3
- package/cjs/types/contracts/generated/CrvUSDsfrxETHAmm.d.ts +139 -0
- package/cjs/types/contracts/generated/CrvUSDsfrxETHAmm.js +5 -0
- package/cjs/types/contracts/generated/CrvUSDsfrxETHController.d.ts +205 -0
- package/cjs/types/contracts/generated/CrvUSDsfrxETHController.js +5 -0
- package/cjs/types/contracts/generated/index.d.ts +2 -0
- package/cjs/types/curveUsd.d.ts +2 -1
- package/cjs/types/curveUsd.js +1 -0
- package/esm/aaveV3/index.d.ts +1 -1
- package/esm/aaveV3/index.js +2 -3
- package/esm/compoundV3/index.d.ts +1 -1
- package/esm/compoundV3/index.js +2 -3
- package/esm/config/contracts.d.ts +184 -72
- package/esm/config/contracts.js +16 -0
- package/esm/markets/curveUsd/index.d.ts +2 -0
- package/esm/markets/curveUsd/index.js +12 -0
- package/esm/morphoAaveV3/index.d.ts +1 -1
- package/esm/morphoAaveV3/index.js +2 -3
- package/esm/types/contracts/generated/CrvUSDsfrxETHAmm.d.ts +139 -0
- package/esm/types/contracts/generated/CrvUSDsfrxETHAmm.js +4 -0
- package/esm/types/contracts/generated/CrvUSDsfrxETHController.d.ts +205 -0
- package/esm/types/contracts/generated/CrvUSDsfrxETHController.js +4 -0
- package/esm/types/contracts/generated/index.d.ts +2 -0
- package/esm/types/curveUsd.d.ts +2 -1
- package/esm/types/curveUsd.js +1 -0
- package/package.json +1 -1
- package/src/aaveV3/index.ts +2 -4
- package/src/compoundV3/index.ts +1 -4
- package/src/morphoAaveV3/index.ts +1 -4
- package/src/types/contracts/generated/CrvUSDsfrxETHAmm.ts +286 -0
- package/src/types/contracts/generated/CrvUSDsfrxETHController.ts +403 -0
- package/src/types/contracts/generated/index.ts +2 -0
|
@@ -56,6 +56,8 @@ export type { CrvUSDFactory } from "./CrvUSDFactory";
|
|
|
56
56
|
export type { CrvUSDView } from "./CrvUSDView";
|
|
57
57
|
export type { CrvUSDWBTCAmm } from "./CrvUSDWBTCAmm";
|
|
58
58
|
export type { CrvUSDWBTCController } from "./CrvUSDWBTCController";
|
|
59
|
+
export type { CrvUSDsfrxETHAmm } from "./CrvUSDsfrxETHAmm";
|
|
60
|
+
export type { CrvUSDsfrxETHController } from "./CrvUSDsfrxETHController";
|
|
59
61
|
export type { CrvUSDtBTCAmm } from "./CrvUSDtBTCAmm";
|
|
60
62
|
export type { CrvUSDtBTCController } from "./CrvUSDtBTCController";
|
|
61
63
|
export type { CrvUSDwstETHAmm } from "./CrvUSDwstETHAmm";
|
package/esm/types/curveUsd.d.ts
CHANGED
package/esm/types/curveUsd.js
CHANGED
|
@@ -4,6 +4,7 @@ export var CrvUSDVersions;
|
|
|
4
4
|
CrvUSDVersions["WBTC"] = "WBTC";
|
|
5
5
|
CrvUSDVersions["ETH"] = "ETH";
|
|
6
6
|
CrvUSDVersions["tBTC"] = "tBTC";
|
|
7
|
+
CrvUSDVersions["sfrxETH"] = "sfrxETH";
|
|
7
8
|
})(CrvUSDVersions || (CrvUSDVersions = {}));
|
|
8
9
|
export var CrvUSDStatus;
|
|
9
10
|
(function (CrvUSDStatus) {
|
package/package.json
CHANGED
package/src/aaveV3/index.ts
CHANGED
|
@@ -398,7 +398,7 @@ export const getAaveV3AccountBalances = async (web3: Web3, network: NetworkNumbe
|
|
|
398
398
|
return balances;
|
|
399
399
|
};
|
|
400
400
|
|
|
401
|
-
export const getAaveV3AccountData = async (web3: Web3, network: NetworkNumber, address: EthAddress, extractedState: any
|
|
401
|
+
export const getAaveV3AccountData = async (web3: Web3, network: NetworkNumber, address: EthAddress, extractedState: any): Promise<AaveV3PositionData> => {
|
|
402
402
|
const {
|
|
403
403
|
selectedMarket: market, assetsData,
|
|
404
404
|
} = extractedState;
|
|
@@ -509,13 +509,11 @@ export const getAaveV3AccountData = async (web3: Web3, network: NetworkNumber, a
|
|
|
509
509
|
};
|
|
510
510
|
});
|
|
511
511
|
|
|
512
|
-
const aggregateFunction = customGetAggregatedDataFunction || aaveAnyGetAggregatedPositionData;
|
|
513
|
-
|
|
514
512
|
payload.eModeCategory = +multicallRes[0][0];
|
|
515
513
|
payload = {
|
|
516
514
|
...payload,
|
|
517
515
|
usedAssets,
|
|
518
|
-
...
|
|
516
|
+
...aaveAnyGetAggregatedPositionData({
|
|
519
517
|
...extractedState, usedAssets, eModeCategory: payload.eModeCategory,
|
|
520
518
|
}),
|
|
521
519
|
};
|
package/src/compoundV3/index.ts
CHANGED
|
@@ -170,7 +170,6 @@ export const getCompoundV3AccountData = async (
|
|
|
170
170
|
selectedMarket: CompoundMarketData,
|
|
171
171
|
assetsData: CompoundV3AssetsData,
|
|
172
172
|
}),
|
|
173
|
-
customGetAggregatedDataFunction?: Function,
|
|
174
173
|
): Promise<CompoundV3PositionData> => {
|
|
175
174
|
if (!address) throw new Error('No address provided');
|
|
176
175
|
const {
|
|
@@ -245,12 +244,10 @@ export const getCompoundV3AccountData = async (
|
|
|
245
244
|
};
|
|
246
245
|
});
|
|
247
246
|
|
|
248
|
-
const aggregateFunction = customGetAggregatedDataFunction || getCompoundV3AggregatedData;
|
|
249
|
-
|
|
250
247
|
payload = {
|
|
251
248
|
...payload,
|
|
252
249
|
usedAssets,
|
|
253
|
-
...
|
|
250
|
+
...getCompoundV3AggregatedData({
|
|
254
251
|
usedAssets, assetsData, network, selectedMarket,
|
|
255
252
|
}),
|
|
256
253
|
isAllowed: data[1][0],
|
|
@@ -447,7 +447,6 @@ export const getMorphoAaveV3AccountData = async (
|
|
|
447
447
|
assetsData: MorphoAaveV3AssetsData,
|
|
448
448
|
delegator: string,
|
|
449
449
|
selectedMarket: MorphoAaveV3MarketInfo,
|
|
450
|
-
customGetAggregatedDataFunction?: Function,
|
|
451
450
|
): Promise<MorphoAaveV3PositionData> => {
|
|
452
451
|
if (!address) {
|
|
453
452
|
throw new Error('No address provided.');
|
|
@@ -591,11 +590,9 @@ export const getMorphoAaveV3AccountData = async (
|
|
|
591
590
|
}
|
|
592
591
|
});
|
|
593
592
|
|
|
594
|
-
const aggregateFunction = customGetAggregatedDataFunction || aaveAnyGetAggregatedPositionData;
|
|
595
|
-
|
|
596
593
|
payload = {
|
|
597
594
|
...payload,
|
|
598
|
-
...
|
|
595
|
+
...aaveAnyGetAggregatedPositionData({
|
|
599
596
|
usedAssets: payload.usedAssets, assetsData, eModeCategory, selectedMarket,
|
|
600
597
|
}),
|
|
601
598
|
};
|
|
@@ -0,0 +1,286 @@
|
|
|
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 TokenExchange = ContractEventLog<{
|
|
25
|
+
buyer: string;
|
|
26
|
+
sold_id: string;
|
|
27
|
+
tokens_sold: string;
|
|
28
|
+
bought_id: string;
|
|
29
|
+
tokens_bought: string;
|
|
30
|
+
0: string;
|
|
31
|
+
1: string;
|
|
32
|
+
2: string;
|
|
33
|
+
3: string;
|
|
34
|
+
4: string;
|
|
35
|
+
}>;
|
|
36
|
+
export type Deposit = ContractEventLog<{
|
|
37
|
+
provider: string;
|
|
38
|
+
amount: string;
|
|
39
|
+
n1: string;
|
|
40
|
+
n2: string;
|
|
41
|
+
0: string;
|
|
42
|
+
1: string;
|
|
43
|
+
2: string;
|
|
44
|
+
3: string;
|
|
45
|
+
}>;
|
|
46
|
+
export type Withdraw = ContractEventLog<{
|
|
47
|
+
provider: string;
|
|
48
|
+
amount_borrowed: string;
|
|
49
|
+
amount_collateral: string;
|
|
50
|
+
0: string;
|
|
51
|
+
1: string;
|
|
52
|
+
2: string;
|
|
53
|
+
}>;
|
|
54
|
+
export type SetRate = ContractEventLog<{
|
|
55
|
+
rate: string;
|
|
56
|
+
rate_mul: string;
|
|
57
|
+
time: string;
|
|
58
|
+
0: string;
|
|
59
|
+
1: string;
|
|
60
|
+
2: string;
|
|
61
|
+
}>;
|
|
62
|
+
export type SetFee = ContractEventLog<{
|
|
63
|
+
fee: string;
|
|
64
|
+
0: string;
|
|
65
|
+
}>;
|
|
66
|
+
export type SetAdminFee = ContractEventLog<{
|
|
67
|
+
fee: string;
|
|
68
|
+
0: string;
|
|
69
|
+
}>;
|
|
70
|
+
|
|
71
|
+
export interface CrvUSDsfrxETHAmm extends BaseContract {
|
|
72
|
+
constructor(
|
|
73
|
+
jsonInterface: any[],
|
|
74
|
+
address?: string,
|
|
75
|
+
options?: ContractOptions
|
|
76
|
+
): CrvUSDsfrxETHAmm;
|
|
77
|
+
clone(): CrvUSDsfrxETHAmm;
|
|
78
|
+
methods: {
|
|
79
|
+
set_admin(_admin: string): NonPayableTransactionObject<void>;
|
|
80
|
+
|
|
81
|
+
coins(i: number | string | BN): NonPayableTransactionObject<string>;
|
|
82
|
+
|
|
83
|
+
price_oracle(): NonPayableTransactionObject<string>;
|
|
84
|
+
|
|
85
|
+
dynamic_fee(): NonPayableTransactionObject<string>;
|
|
86
|
+
|
|
87
|
+
get_rate_mul(): NonPayableTransactionObject<string>;
|
|
88
|
+
|
|
89
|
+
get_base_price(): NonPayableTransactionObject<string>;
|
|
90
|
+
|
|
91
|
+
p_current_up(n: number | string | BN): NonPayableTransactionObject<string>;
|
|
92
|
+
|
|
93
|
+
p_current_down(
|
|
94
|
+
n: number | string | BN
|
|
95
|
+
): NonPayableTransactionObject<string>;
|
|
96
|
+
|
|
97
|
+
p_oracle_up(n: number | string | BN): NonPayableTransactionObject<string>;
|
|
98
|
+
|
|
99
|
+
p_oracle_down(n: number | string | BN): NonPayableTransactionObject<string>;
|
|
100
|
+
|
|
101
|
+
get_p(): NonPayableTransactionObject<string>;
|
|
102
|
+
|
|
103
|
+
read_user_tick_numbers(
|
|
104
|
+
user: string
|
|
105
|
+
): NonPayableTransactionObject<[string, string]>;
|
|
106
|
+
|
|
107
|
+
can_skip_bands(
|
|
108
|
+
n_end: number | string | BN
|
|
109
|
+
): NonPayableTransactionObject<boolean>;
|
|
110
|
+
|
|
111
|
+
active_band_with_skip(): NonPayableTransactionObject<string>;
|
|
112
|
+
|
|
113
|
+
has_liquidity(user: string): NonPayableTransactionObject<boolean>;
|
|
114
|
+
|
|
115
|
+
deposit_range(
|
|
116
|
+
user: string,
|
|
117
|
+
amount: number | string | BN,
|
|
118
|
+
n1: number | string | BN,
|
|
119
|
+
n2: number | string | BN
|
|
120
|
+
): NonPayableTransactionObject<void>;
|
|
121
|
+
|
|
122
|
+
withdraw(
|
|
123
|
+
user: string,
|
|
124
|
+
frac: number | string | BN
|
|
125
|
+
): NonPayableTransactionObject<[string, string]>;
|
|
126
|
+
|
|
127
|
+
get_dy(
|
|
128
|
+
i: number | string | BN,
|
|
129
|
+
j: number | string | BN,
|
|
130
|
+
in_amount: number | string | BN
|
|
131
|
+
): NonPayableTransactionObject<string>;
|
|
132
|
+
|
|
133
|
+
get_dxdy(
|
|
134
|
+
i: number | string | BN,
|
|
135
|
+
j: number | string | BN,
|
|
136
|
+
in_amount: number | string | BN
|
|
137
|
+
): NonPayableTransactionObject<[string, string]>;
|
|
138
|
+
|
|
139
|
+
get_dx(
|
|
140
|
+
i: number | string | BN,
|
|
141
|
+
j: number | string | BN,
|
|
142
|
+
out_amount: number | string | BN
|
|
143
|
+
): NonPayableTransactionObject<string>;
|
|
144
|
+
|
|
145
|
+
get_dydx(
|
|
146
|
+
i: number | string | BN,
|
|
147
|
+
j: number | string | BN,
|
|
148
|
+
out_amount: number | string | BN
|
|
149
|
+
): NonPayableTransactionObject<[string, string]>;
|
|
150
|
+
|
|
151
|
+
"exchange(uint256,uint256,uint256,uint256)"(
|
|
152
|
+
i: number | string | BN,
|
|
153
|
+
j: number | string | BN,
|
|
154
|
+
in_amount: number | string | BN,
|
|
155
|
+
min_amount: number | string | BN
|
|
156
|
+
): NonPayableTransactionObject<[string, string]>;
|
|
157
|
+
|
|
158
|
+
"exchange(uint256,uint256,uint256,uint256,address)"(
|
|
159
|
+
i: number | string | BN,
|
|
160
|
+
j: number | string | BN,
|
|
161
|
+
in_amount: number | string | BN,
|
|
162
|
+
min_amount: number | string | BN,
|
|
163
|
+
_for: string
|
|
164
|
+
): NonPayableTransactionObject<[string, string]>;
|
|
165
|
+
|
|
166
|
+
"exchange_dy(uint256,uint256,uint256,uint256)"(
|
|
167
|
+
i: number | string | BN,
|
|
168
|
+
j: number | string | BN,
|
|
169
|
+
out_amount: number | string | BN,
|
|
170
|
+
max_amount: number | string | BN
|
|
171
|
+
): NonPayableTransactionObject<[string, string]>;
|
|
172
|
+
|
|
173
|
+
"exchange_dy(uint256,uint256,uint256,uint256,address)"(
|
|
174
|
+
i: number | string | BN,
|
|
175
|
+
j: number | string | BN,
|
|
176
|
+
out_amount: number | string | BN,
|
|
177
|
+
max_amount: number | string | BN,
|
|
178
|
+
_for: string
|
|
179
|
+
): NonPayableTransactionObject<[string, string]>;
|
|
180
|
+
|
|
181
|
+
get_y_up(user: string): NonPayableTransactionObject<string>;
|
|
182
|
+
|
|
183
|
+
get_x_down(user: string): NonPayableTransactionObject<string>;
|
|
184
|
+
|
|
185
|
+
get_sum_xy(user: string): NonPayableTransactionObject<[string, string]>;
|
|
186
|
+
|
|
187
|
+
get_xy(user: string): NonPayableTransactionObject<[string[], string[]]>;
|
|
188
|
+
|
|
189
|
+
get_amount_for_price(
|
|
190
|
+
p: number | string | BN
|
|
191
|
+
): NonPayableTransactionObject<[string, boolean]>;
|
|
192
|
+
|
|
193
|
+
set_rate(rate: number | string | BN): NonPayableTransactionObject<string>;
|
|
194
|
+
|
|
195
|
+
set_fee(fee: number | string | BN): NonPayableTransactionObject<void>;
|
|
196
|
+
|
|
197
|
+
set_admin_fee(fee: number | string | BN): NonPayableTransactionObject<void>;
|
|
198
|
+
|
|
199
|
+
reset_admin_fees(): NonPayableTransactionObject<void>;
|
|
200
|
+
|
|
201
|
+
set_callback(
|
|
202
|
+
liquidity_mining_callback: string
|
|
203
|
+
): NonPayableTransactionObject<void>;
|
|
204
|
+
|
|
205
|
+
admin(): NonPayableTransactionObject<string>;
|
|
206
|
+
|
|
207
|
+
A(): NonPayableTransactionObject<string>;
|
|
208
|
+
|
|
209
|
+
fee(): NonPayableTransactionObject<string>;
|
|
210
|
+
|
|
211
|
+
admin_fee(): NonPayableTransactionObject<string>;
|
|
212
|
+
|
|
213
|
+
rate(): NonPayableTransactionObject<string>;
|
|
214
|
+
|
|
215
|
+
active_band(): NonPayableTransactionObject<string>;
|
|
216
|
+
|
|
217
|
+
min_band(): NonPayableTransactionObject<string>;
|
|
218
|
+
|
|
219
|
+
max_band(): NonPayableTransactionObject<string>;
|
|
220
|
+
|
|
221
|
+
admin_fees_x(): NonPayableTransactionObject<string>;
|
|
222
|
+
|
|
223
|
+
admin_fees_y(): NonPayableTransactionObject<string>;
|
|
224
|
+
|
|
225
|
+
price_oracle_contract(): NonPayableTransactionObject<string>;
|
|
226
|
+
|
|
227
|
+
bands_x(arg0: number | string | BN): NonPayableTransactionObject<string>;
|
|
228
|
+
|
|
229
|
+
bands_y(arg0: number | string | BN): NonPayableTransactionObject<string>;
|
|
230
|
+
|
|
231
|
+
liquidity_mining_callback(): NonPayableTransactionObject<string>;
|
|
232
|
+
};
|
|
233
|
+
events: {
|
|
234
|
+
TokenExchange(cb?: Callback<TokenExchange>): EventEmitter;
|
|
235
|
+
TokenExchange(
|
|
236
|
+
options?: EventOptions,
|
|
237
|
+
cb?: Callback<TokenExchange>
|
|
238
|
+
): EventEmitter;
|
|
239
|
+
|
|
240
|
+
Deposit(cb?: Callback<Deposit>): EventEmitter;
|
|
241
|
+
Deposit(options?: EventOptions, cb?: Callback<Deposit>): EventEmitter;
|
|
242
|
+
|
|
243
|
+
Withdraw(cb?: Callback<Withdraw>): EventEmitter;
|
|
244
|
+
Withdraw(options?: EventOptions, cb?: Callback<Withdraw>): EventEmitter;
|
|
245
|
+
|
|
246
|
+
SetRate(cb?: Callback<SetRate>): EventEmitter;
|
|
247
|
+
SetRate(options?: EventOptions, cb?: Callback<SetRate>): EventEmitter;
|
|
248
|
+
|
|
249
|
+
SetFee(cb?: Callback<SetFee>): EventEmitter;
|
|
250
|
+
SetFee(options?: EventOptions, cb?: Callback<SetFee>): EventEmitter;
|
|
251
|
+
|
|
252
|
+
SetAdminFee(cb?: Callback<SetAdminFee>): EventEmitter;
|
|
253
|
+
SetAdminFee(
|
|
254
|
+
options?: EventOptions,
|
|
255
|
+
cb?: Callback<SetAdminFee>
|
|
256
|
+
): EventEmitter;
|
|
257
|
+
|
|
258
|
+
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
259
|
+
};
|
|
260
|
+
|
|
261
|
+
once(event: "TokenExchange", cb: Callback<TokenExchange>): void;
|
|
262
|
+
once(
|
|
263
|
+
event: "TokenExchange",
|
|
264
|
+
options: EventOptions,
|
|
265
|
+
cb: Callback<TokenExchange>
|
|
266
|
+
): void;
|
|
267
|
+
|
|
268
|
+
once(event: "Deposit", cb: Callback<Deposit>): void;
|
|
269
|
+
once(event: "Deposit", options: EventOptions, cb: Callback<Deposit>): void;
|
|
270
|
+
|
|
271
|
+
once(event: "Withdraw", cb: Callback<Withdraw>): void;
|
|
272
|
+
once(event: "Withdraw", options: EventOptions, cb: Callback<Withdraw>): void;
|
|
273
|
+
|
|
274
|
+
once(event: "SetRate", cb: Callback<SetRate>): void;
|
|
275
|
+
once(event: "SetRate", options: EventOptions, cb: Callback<SetRate>): void;
|
|
276
|
+
|
|
277
|
+
once(event: "SetFee", cb: Callback<SetFee>): void;
|
|
278
|
+
once(event: "SetFee", options: EventOptions, cb: Callback<SetFee>): void;
|
|
279
|
+
|
|
280
|
+
once(event: "SetAdminFee", cb: Callback<SetAdminFee>): void;
|
|
281
|
+
once(
|
|
282
|
+
event: "SetAdminFee",
|
|
283
|
+
options: EventOptions,
|
|
284
|
+
cb: Callback<SetAdminFee>
|
|
285
|
+
): void;
|
|
286
|
+
}
|