@defisaver/positions-sdk 0.0.16 → 0.0.17
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/compoundV3/index.d.ts +1 -1
- package/cjs/compoundV3/index.js +3 -2
- package/cjs/config/contracts.d.ts +72 -184
- package/cjs/config/contracts.js +0 -16
- package/cjs/helpers/compoundHelpers/index.js +2 -2
- package/cjs/markets/curveUsd/index.d.ts +0 -2
- package/cjs/markets/curveUsd/index.js +1 -14
- package/cjs/types/compound.d.ts +1 -0
- package/cjs/types/contracts/generated/index.d.ts +0 -2
- package/cjs/types/curveUsd.d.ts +1 -2
- package/cjs/types/curveUsd.js +0 -1
- package/esm/compoundV3/index.d.ts +1 -1
- package/esm/compoundV3/index.js +3 -2
- package/esm/config/contracts.d.ts +72 -184
- package/esm/config/contracts.js +0 -16
- package/esm/helpers/compoundHelpers/index.js +2 -2
- package/esm/markets/curveUsd/index.d.ts +0 -2
- package/esm/markets/curveUsd/index.js +0 -12
- package/esm/types/compound.d.ts +1 -0
- package/esm/types/contracts/generated/index.d.ts +0 -2
- package/esm/types/curveUsd.d.ts +1 -2
- package/esm/types/curveUsd.js +0 -1
- package/package.json +40 -40
- package/src/aaveV2/index.ts +220 -220
- package/src/aaveV3/index.ts +556 -556
- package/src/assets/index.ts +60 -60
- package/src/chickenBonds/index.ts +123 -123
- package/src/compoundV2/index.ts +206 -206
- package/src/compoundV3/index.ts +273 -269
- package/src/config/contracts.js +651 -651
- package/src/constants/index.ts +3 -3
- package/src/contracts.ts +100 -100
- package/src/curveUsd/index.ts +228 -228
- package/src/exchange/index.ts +17 -17
- package/src/helpers/aaveHelpers/index.ts +134 -134
- package/src/helpers/chickenBondsHelpers/index.ts +23 -23
- package/src/helpers/compoundHelpers/index.ts +181 -181
- package/src/helpers/curveUsdHelpers/index.ts +32 -32
- package/src/helpers/index.ts +5 -5
- package/src/helpers/makerHelpers/index.ts +94 -94
- package/src/helpers/sparkHelpers/index.ts +106 -106
- package/src/index.ts +40 -40
- package/src/liquity/index.ts +103 -103
- package/src/maker/index.ts +101 -101
- package/src/markets/aave/index.ts +80 -80
- package/src/markets/aave/marketAssets.ts +32 -32
- package/src/markets/compound/index.ts +85 -85
- package/src/markets/compound/marketsAssets.ts +35 -35
- package/src/markets/curveUsd/index.ts +69 -69
- package/src/markets/index.ts +3 -3
- package/src/markets/spark/index.ts +29 -29
- package/src/markets/spark/marketAssets.ts +9 -9
- package/src/moneymarket/moneymarketCommonService.ts +75 -75
- package/src/morpho/markets.ts +39 -39
- package/src/morphoAaveV2/index.ts +254 -254
- package/src/morphoAaveV3/index.ts +617 -617
- package/src/multicall/index.ts +22 -22
- package/src/services/dsrService.ts +15 -15
- package/src/services/priceService.ts +21 -21
- package/src/services/utils.ts +34 -34
- package/src/spark/index.ts +413 -413
- package/src/staking/staking.ts +167 -167
- package/src/types/aave.ts +256 -256
- package/src/types/chickenBonds.ts +45 -45
- package/src/types/common.ts +83 -83
- package/src/types/compound.ts +122 -121
- package/src/types/contracts/generated/index.ts +0 -2
- package/src/types/curveUsd.ts +112 -112
- package/src/types/index.ts +6 -6
- package/src/types/liquity.ts +29 -29
- package/src/types/maker.ts +50 -50
- package/src/types/spark.ts +106 -106
- package/cjs/types/contracts/generated/CrvUSDsfrxETHAmm.d.ts +0 -139
- package/cjs/types/contracts/generated/CrvUSDsfrxETHAmm.js +0 -5
- package/cjs/types/contracts/generated/CrvUSDsfrxETHController.d.ts +0 -205
- package/cjs/types/contracts/generated/CrvUSDsfrxETHController.js +0 -5
- package/esm/types/contracts/generated/CrvUSDsfrxETHAmm.d.ts +0 -139
- package/esm/types/contracts/generated/CrvUSDsfrxETHAmm.js +0 -4
- package/esm/types/contracts/generated/CrvUSDsfrxETHController.d.ts +0 -205
- package/esm/types/contracts/generated/CrvUSDsfrxETHController.js +0 -4
- package/src/types/contracts/generated/CrvUSDsfrxETHAmm.ts +0 -286
- package/src/types/contracts/generated/CrvUSDsfrxETHController.ts +0 -403
- package/yarn-error.log +0 -64
|
@@ -1,205 +0,0 @@
|
|
|
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, PayableTransactionObject, NonPayableTransactionObject, BlockType, ContractEventLog, BaseContract } from "./types";
|
|
7
|
-
export interface EventOptions {
|
|
8
|
-
filter?: object;
|
|
9
|
-
fromBlock?: BlockType;
|
|
10
|
-
topics?: string[];
|
|
11
|
-
}
|
|
12
|
-
export type UserState = ContractEventLog<{
|
|
13
|
-
user: string;
|
|
14
|
-
collateral: string;
|
|
15
|
-
debt: string;
|
|
16
|
-
n1: string;
|
|
17
|
-
n2: string;
|
|
18
|
-
liquidation_discount: string;
|
|
19
|
-
0: string;
|
|
20
|
-
1: string;
|
|
21
|
-
2: string;
|
|
22
|
-
3: string;
|
|
23
|
-
4: string;
|
|
24
|
-
5: string;
|
|
25
|
-
}>;
|
|
26
|
-
export type Borrow = ContractEventLog<{
|
|
27
|
-
user: string;
|
|
28
|
-
collateral_increase: string;
|
|
29
|
-
loan_increase: string;
|
|
30
|
-
0: string;
|
|
31
|
-
1: string;
|
|
32
|
-
2: string;
|
|
33
|
-
}>;
|
|
34
|
-
export type Repay = ContractEventLog<{
|
|
35
|
-
user: string;
|
|
36
|
-
collateral_decrease: string;
|
|
37
|
-
loan_decrease: string;
|
|
38
|
-
0: string;
|
|
39
|
-
1: string;
|
|
40
|
-
2: string;
|
|
41
|
-
}>;
|
|
42
|
-
export type RemoveCollateral = ContractEventLog<{
|
|
43
|
-
user: string;
|
|
44
|
-
collateral_decrease: string;
|
|
45
|
-
0: string;
|
|
46
|
-
1: string;
|
|
47
|
-
}>;
|
|
48
|
-
export type Liquidate = ContractEventLog<{
|
|
49
|
-
liquidator: string;
|
|
50
|
-
user: string;
|
|
51
|
-
collateral_received: string;
|
|
52
|
-
stablecoin_received: string;
|
|
53
|
-
debt: string;
|
|
54
|
-
0: string;
|
|
55
|
-
1: string;
|
|
56
|
-
2: string;
|
|
57
|
-
3: string;
|
|
58
|
-
4: string;
|
|
59
|
-
}>;
|
|
60
|
-
export type SetMonetaryPolicy = ContractEventLog<{
|
|
61
|
-
monetary_policy: string;
|
|
62
|
-
0: string;
|
|
63
|
-
}>;
|
|
64
|
-
export type SetBorrowingDiscounts = ContractEventLog<{
|
|
65
|
-
loan_discount: string;
|
|
66
|
-
liquidation_discount: string;
|
|
67
|
-
0: string;
|
|
68
|
-
1: string;
|
|
69
|
-
}>;
|
|
70
|
-
export type CollectFees = ContractEventLog<{
|
|
71
|
-
amount: string;
|
|
72
|
-
new_supply: string;
|
|
73
|
-
0: string;
|
|
74
|
-
1: string;
|
|
75
|
-
}>;
|
|
76
|
-
export interface CrvUSDsfrxETHController extends BaseContract {
|
|
77
|
-
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): CrvUSDsfrxETHController;
|
|
78
|
-
clone(): CrvUSDsfrxETHController;
|
|
79
|
-
methods: {
|
|
80
|
-
factory(): NonPayableTransactionObject<string>;
|
|
81
|
-
amm(): NonPayableTransactionObject<string>;
|
|
82
|
-
collateral_token(): NonPayableTransactionObject<string>;
|
|
83
|
-
debt(user: string): NonPayableTransactionObject<string>;
|
|
84
|
-
loan_exists(user: string): NonPayableTransactionObject<boolean>;
|
|
85
|
-
total_debt(): NonPayableTransactionObject<string>;
|
|
86
|
-
"max_borrowable(uint256,uint256)"(collateral: number | string | BN, N: number | string | BN): NonPayableTransactionObject<string>;
|
|
87
|
-
"max_borrowable(uint256,uint256,uint256)"(collateral: number | string | BN, N: number | string | BN, current_debt: number | string | BN): NonPayableTransactionObject<string>;
|
|
88
|
-
min_collateral(debt: number | string | BN, N: number | string | BN): NonPayableTransactionObject<string>;
|
|
89
|
-
calculate_debt_n1(collateral: number | string | BN, debt: number | string | BN, N: number | string | BN): NonPayableTransactionObject<string>;
|
|
90
|
-
create_loan(collateral: number | string | BN, debt: number | string | BN, N: number | string | BN): PayableTransactionObject<void>;
|
|
91
|
-
create_loan_extended(collateral: number | string | BN, debt: number | string | BN, N: number | string | BN, callbacker: string, callback_args: number | string | BN[]): PayableTransactionObject<void>;
|
|
92
|
-
"add_collateral(uint256)"(collateral: number | string | BN): PayableTransactionObject<void>;
|
|
93
|
-
"add_collateral(uint256,address)"(collateral: number | string | BN, _for: string): PayableTransactionObject<void>;
|
|
94
|
-
"remove_collateral(uint256)"(collateral: number | string | BN): NonPayableTransactionObject<void>;
|
|
95
|
-
"remove_collateral(uint256,bool)"(collateral: number | string | BN, use_eth: boolean): NonPayableTransactionObject<void>;
|
|
96
|
-
borrow_more(collateral: number | string | BN, debt: number | string | BN): PayableTransactionObject<void>;
|
|
97
|
-
"repay(uint256)"(_d_debt: number | string | BN): NonPayableTransactionObject<void>;
|
|
98
|
-
"repay(uint256,address)"(_d_debt: number | string | BN, _for: string): NonPayableTransactionObject<void>;
|
|
99
|
-
"repay(uint256,address,int256)"(_d_debt: number | string | BN, _for: string, max_active_band: number | string | BN): NonPayableTransactionObject<void>;
|
|
100
|
-
"repay(uint256,address,int256,bool)"(_d_debt: number | string | BN, _for: string, max_active_band: number | string | BN, use_eth: boolean): NonPayableTransactionObject<void>;
|
|
101
|
-
repay_extended(callbacker: string, callback_args: number | string | BN[]): NonPayableTransactionObject<void>;
|
|
102
|
-
"health_calculator(address,int256,int256,bool)"(user: string, d_collateral: number | string | BN, d_debt: number | string | BN, full: boolean): NonPayableTransactionObject<string>;
|
|
103
|
-
"health_calculator(address,int256,int256,bool,uint256)"(user: string, d_collateral: number | string | BN, d_debt: number | string | BN, full: boolean, N: number | string | BN): NonPayableTransactionObject<string>;
|
|
104
|
-
"liquidate(address,uint256)"(user: string, min_x: number | string | BN): NonPayableTransactionObject<void>;
|
|
105
|
-
"liquidate(address,uint256,bool)"(user: string, min_x: number | string | BN, use_eth: boolean): NonPayableTransactionObject<void>;
|
|
106
|
-
liquidate_extended(user: string, min_x: number | string | BN, frac: number | string | BN, use_eth: boolean, callbacker: string, callback_args: number | string | BN[]): NonPayableTransactionObject<void>;
|
|
107
|
-
"tokens_to_liquidate(address)"(user: string): NonPayableTransactionObject<string>;
|
|
108
|
-
"tokens_to_liquidate(address,uint256)"(user: string, frac: number | string | BN): NonPayableTransactionObject<string>;
|
|
109
|
-
"health(address)"(user: string): NonPayableTransactionObject<string>;
|
|
110
|
-
"health(address,bool)"(user: string, full: boolean): NonPayableTransactionObject<string>;
|
|
111
|
-
"users_to_liquidate()"(): NonPayableTransactionObject<[
|
|
112
|
-
string,
|
|
113
|
-
string,
|
|
114
|
-
string,
|
|
115
|
-
string,
|
|
116
|
-
string
|
|
117
|
-
] & {
|
|
118
|
-
user: string;
|
|
119
|
-
x: string;
|
|
120
|
-
y: string;
|
|
121
|
-
debt: string;
|
|
122
|
-
health: string;
|
|
123
|
-
}[]>;
|
|
124
|
-
"users_to_liquidate(uint256)"(_from: number | string | BN): NonPayableTransactionObject<[
|
|
125
|
-
string,
|
|
126
|
-
string,
|
|
127
|
-
string,
|
|
128
|
-
string,
|
|
129
|
-
string
|
|
130
|
-
] & {
|
|
131
|
-
user: string;
|
|
132
|
-
x: string;
|
|
133
|
-
y: string;
|
|
134
|
-
debt: string;
|
|
135
|
-
health: string;
|
|
136
|
-
}[]>;
|
|
137
|
-
"users_to_liquidate(uint256,uint256)"(_from: number | string | BN, _limit: number | string | BN): NonPayableTransactionObject<[
|
|
138
|
-
string,
|
|
139
|
-
string,
|
|
140
|
-
string,
|
|
141
|
-
string,
|
|
142
|
-
string
|
|
143
|
-
] & {
|
|
144
|
-
user: string;
|
|
145
|
-
x: string;
|
|
146
|
-
y: string;
|
|
147
|
-
debt: string;
|
|
148
|
-
health: string;
|
|
149
|
-
}[]>;
|
|
150
|
-
amm_price(): NonPayableTransactionObject<string>;
|
|
151
|
-
user_prices(user: string): NonPayableTransactionObject<[string, string]>;
|
|
152
|
-
user_state(user: string): NonPayableTransactionObject<[string, string, string, string]>;
|
|
153
|
-
set_amm_fee(fee: number | string | BN): NonPayableTransactionObject<void>;
|
|
154
|
-
set_amm_admin_fee(fee: number | string | BN): NonPayableTransactionObject<void>;
|
|
155
|
-
set_monetary_policy(monetary_policy: string): NonPayableTransactionObject<void>;
|
|
156
|
-
set_borrowing_discounts(loan_discount: number | string | BN, liquidation_discount: number | string | BN): NonPayableTransactionObject<void>;
|
|
157
|
-
set_callback(cb: string): NonPayableTransactionObject<void>;
|
|
158
|
-
admin_fees(): NonPayableTransactionObject<string>;
|
|
159
|
-
collect_fees(): NonPayableTransactionObject<string>;
|
|
160
|
-
liquidation_discounts(arg0: string): NonPayableTransactionObject<string>;
|
|
161
|
-
loans(arg0: number | string | BN): NonPayableTransactionObject<string>;
|
|
162
|
-
loan_ix(arg0: string): NonPayableTransactionObject<string>;
|
|
163
|
-
n_loans(): NonPayableTransactionObject<string>;
|
|
164
|
-
minted(): NonPayableTransactionObject<string>;
|
|
165
|
-
redeemed(): NonPayableTransactionObject<string>;
|
|
166
|
-
monetary_policy(): NonPayableTransactionObject<string>;
|
|
167
|
-
liquidation_discount(): NonPayableTransactionObject<string>;
|
|
168
|
-
loan_discount(): NonPayableTransactionObject<string>;
|
|
169
|
-
};
|
|
170
|
-
events: {
|
|
171
|
-
UserState(cb?: Callback<UserState>): EventEmitter;
|
|
172
|
-
UserState(options?: EventOptions, cb?: Callback<UserState>): EventEmitter;
|
|
173
|
-
Borrow(cb?: Callback<Borrow>): EventEmitter;
|
|
174
|
-
Borrow(options?: EventOptions, cb?: Callback<Borrow>): EventEmitter;
|
|
175
|
-
Repay(cb?: Callback<Repay>): EventEmitter;
|
|
176
|
-
Repay(options?: EventOptions, cb?: Callback<Repay>): EventEmitter;
|
|
177
|
-
RemoveCollateral(cb?: Callback<RemoveCollateral>): EventEmitter;
|
|
178
|
-
RemoveCollateral(options?: EventOptions, cb?: Callback<RemoveCollateral>): EventEmitter;
|
|
179
|
-
Liquidate(cb?: Callback<Liquidate>): EventEmitter;
|
|
180
|
-
Liquidate(options?: EventOptions, cb?: Callback<Liquidate>): EventEmitter;
|
|
181
|
-
SetMonetaryPolicy(cb?: Callback<SetMonetaryPolicy>): EventEmitter;
|
|
182
|
-
SetMonetaryPolicy(options?: EventOptions, cb?: Callback<SetMonetaryPolicy>): EventEmitter;
|
|
183
|
-
SetBorrowingDiscounts(cb?: Callback<SetBorrowingDiscounts>): EventEmitter;
|
|
184
|
-
SetBorrowingDiscounts(options?: EventOptions, cb?: Callback<SetBorrowingDiscounts>): EventEmitter;
|
|
185
|
-
CollectFees(cb?: Callback<CollectFees>): EventEmitter;
|
|
186
|
-
CollectFees(options?: EventOptions, cb?: Callback<CollectFees>): EventEmitter;
|
|
187
|
-
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
188
|
-
};
|
|
189
|
-
once(event: "UserState", cb: Callback<UserState>): void;
|
|
190
|
-
once(event: "UserState", options: EventOptions, cb: Callback<UserState>): void;
|
|
191
|
-
once(event: "Borrow", cb: Callback<Borrow>): void;
|
|
192
|
-
once(event: "Borrow", options: EventOptions, cb: Callback<Borrow>): void;
|
|
193
|
-
once(event: "Repay", cb: Callback<Repay>): void;
|
|
194
|
-
once(event: "Repay", options: EventOptions, cb: Callback<Repay>): void;
|
|
195
|
-
once(event: "RemoveCollateral", cb: Callback<RemoveCollateral>): void;
|
|
196
|
-
once(event: "RemoveCollateral", options: EventOptions, cb: Callback<RemoveCollateral>): void;
|
|
197
|
-
once(event: "Liquidate", cb: Callback<Liquidate>): void;
|
|
198
|
-
once(event: "Liquidate", options: EventOptions, cb: Callback<Liquidate>): void;
|
|
199
|
-
once(event: "SetMonetaryPolicy", cb: Callback<SetMonetaryPolicy>): void;
|
|
200
|
-
once(event: "SetMonetaryPolicy", options: EventOptions, cb: Callback<SetMonetaryPolicy>): void;
|
|
201
|
-
once(event: "SetBorrowingDiscounts", cb: Callback<SetBorrowingDiscounts>): void;
|
|
202
|
-
once(event: "SetBorrowingDiscounts", options: EventOptions, cb: Callback<SetBorrowingDiscounts>): void;
|
|
203
|
-
once(event: "CollectFees", cb: Callback<CollectFees>): void;
|
|
204
|
-
once(event: "CollectFees", options: EventOptions, cb: Callback<CollectFees>): void;
|
|
205
|
-
}
|
|
@@ -1,139 +0,0 @@
|
|
|
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 TokenExchange = ContractEventLog<{
|
|
13
|
-
buyer: string;
|
|
14
|
-
sold_id: string;
|
|
15
|
-
tokens_sold: string;
|
|
16
|
-
bought_id: string;
|
|
17
|
-
tokens_bought: string;
|
|
18
|
-
0: string;
|
|
19
|
-
1: string;
|
|
20
|
-
2: string;
|
|
21
|
-
3: string;
|
|
22
|
-
4: string;
|
|
23
|
-
}>;
|
|
24
|
-
export type Deposit = ContractEventLog<{
|
|
25
|
-
provider: string;
|
|
26
|
-
amount: string;
|
|
27
|
-
n1: string;
|
|
28
|
-
n2: string;
|
|
29
|
-
0: string;
|
|
30
|
-
1: string;
|
|
31
|
-
2: string;
|
|
32
|
-
3: string;
|
|
33
|
-
}>;
|
|
34
|
-
export type Withdraw = ContractEventLog<{
|
|
35
|
-
provider: string;
|
|
36
|
-
amount_borrowed: string;
|
|
37
|
-
amount_collateral: string;
|
|
38
|
-
0: string;
|
|
39
|
-
1: string;
|
|
40
|
-
2: string;
|
|
41
|
-
}>;
|
|
42
|
-
export type SetRate = ContractEventLog<{
|
|
43
|
-
rate: string;
|
|
44
|
-
rate_mul: string;
|
|
45
|
-
time: string;
|
|
46
|
-
0: string;
|
|
47
|
-
1: string;
|
|
48
|
-
2: string;
|
|
49
|
-
}>;
|
|
50
|
-
export type SetFee = ContractEventLog<{
|
|
51
|
-
fee: string;
|
|
52
|
-
0: string;
|
|
53
|
-
}>;
|
|
54
|
-
export type SetAdminFee = ContractEventLog<{
|
|
55
|
-
fee: string;
|
|
56
|
-
0: string;
|
|
57
|
-
}>;
|
|
58
|
-
export interface CrvUSDsfrxETHAmm extends BaseContract {
|
|
59
|
-
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): CrvUSDsfrxETHAmm;
|
|
60
|
-
clone(): CrvUSDsfrxETHAmm;
|
|
61
|
-
methods: {
|
|
62
|
-
set_admin(_admin: string): NonPayableTransactionObject<void>;
|
|
63
|
-
coins(i: number | string | BN): NonPayableTransactionObject<string>;
|
|
64
|
-
price_oracle(): NonPayableTransactionObject<string>;
|
|
65
|
-
dynamic_fee(): NonPayableTransactionObject<string>;
|
|
66
|
-
get_rate_mul(): NonPayableTransactionObject<string>;
|
|
67
|
-
get_base_price(): NonPayableTransactionObject<string>;
|
|
68
|
-
p_current_up(n: number | string | BN): NonPayableTransactionObject<string>;
|
|
69
|
-
p_current_down(n: number | string | BN): NonPayableTransactionObject<string>;
|
|
70
|
-
p_oracle_up(n: number | string | BN): NonPayableTransactionObject<string>;
|
|
71
|
-
p_oracle_down(n: number | string | BN): NonPayableTransactionObject<string>;
|
|
72
|
-
get_p(): NonPayableTransactionObject<string>;
|
|
73
|
-
read_user_tick_numbers(user: string): NonPayableTransactionObject<[string, string]>;
|
|
74
|
-
can_skip_bands(n_end: number | string | BN): NonPayableTransactionObject<boolean>;
|
|
75
|
-
active_band_with_skip(): NonPayableTransactionObject<string>;
|
|
76
|
-
has_liquidity(user: string): NonPayableTransactionObject<boolean>;
|
|
77
|
-
deposit_range(user: string, amount: number | string | BN, n1: number | string | BN, n2: number | string | BN): NonPayableTransactionObject<void>;
|
|
78
|
-
withdraw(user: string, frac: number | string | BN): NonPayableTransactionObject<[string, string]>;
|
|
79
|
-
get_dy(i: number | string | BN, j: number | string | BN, in_amount: number | string | BN): NonPayableTransactionObject<string>;
|
|
80
|
-
get_dxdy(i: number | string | BN, j: number | string | BN, in_amount: number | string | BN): NonPayableTransactionObject<[string, string]>;
|
|
81
|
-
get_dx(i: number | string | BN, j: number | string | BN, out_amount: number | string | BN): NonPayableTransactionObject<string>;
|
|
82
|
-
get_dydx(i: number | string | BN, j: number | string | BN, out_amount: number | string | BN): NonPayableTransactionObject<[string, string]>;
|
|
83
|
-
"exchange(uint256,uint256,uint256,uint256)"(i: number | string | BN, j: number | string | BN, in_amount: number | string | BN, min_amount: number | string | BN): NonPayableTransactionObject<[string, string]>;
|
|
84
|
-
"exchange(uint256,uint256,uint256,uint256,address)"(i: number | string | BN, j: number | string | BN, in_amount: number | string | BN, min_amount: number | string | BN, _for: string): NonPayableTransactionObject<[string, string]>;
|
|
85
|
-
"exchange_dy(uint256,uint256,uint256,uint256)"(i: number | string | BN, j: number | string | BN, out_amount: number | string | BN, max_amount: number | string | BN): NonPayableTransactionObject<[string, string]>;
|
|
86
|
-
"exchange_dy(uint256,uint256,uint256,uint256,address)"(i: number | string | BN, j: number | string | BN, out_amount: number | string | BN, max_amount: number | string | BN, _for: string): NonPayableTransactionObject<[string, string]>;
|
|
87
|
-
get_y_up(user: string): NonPayableTransactionObject<string>;
|
|
88
|
-
get_x_down(user: string): NonPayableTransactionObject<string>;
|
|
89
|
-
get_sum_xy(user: string): NonPayableTransactionObject<[string, string]>;
|
|
90
|
-
get_xy(user: string): NonPayableTransactionObject<[string[], string[]]>;
|
|
91
|
-
get_amount_for_price(p: number | string | BN): NonPayableTransactionObject<[string, boolean]>;
|
|
92
|
-
set_rate(rate: number | string | BN): NonPayableTransactionObject<string>;
|
|
93
|
-
set_fee(fee: number | string | BN): NonPayableTransactionObject<void>;
|
|
94
|
-
set_admin_fee(fee: number | string | BN): NonPayableTransactionObject<void>;
|
|
95
|
-
reset_admin_fees(): NonPayableTransactionObject<void>;
|
|
96
|
-
set_callback(liquidity_mining_callback: string): NonPayableTransactionObject<void>;
|
|
97
|
-
admin(): NonPayableTransactionObject<string>;
|
|
98
|
-
A(): NonPayableTransactionObject<string>;
|
|
99
|
-
fee(): NonPayableTransactionObject<string>;
|
|
100
|
-
admin_fee(): NonPayableTransactionObject<string>;
|
|
101
|
-
rate(): NonPayableTransactionObject<string>;
|
|
102
|
-
active_band(): NonPayableTransactionObject<string>;
|
|
103
|
-
min_band(): NonPayableTransactionObject<string>;
|
|
104
|
-
max_band(): NonPayableTransactionObject<string>;
|
|
105
|
-
admin_fees_x(): NonPayableTransactionObject<string>;
|
|
106
|
-
admin_fees_y(): NonPayableTransactionObject<string>;
|
|
107
|
-
price_oracle_contract(): NonPayableTransactionObject<string>;
|
|
108
|
-
bands_x(arg0: number | string | BN): NonPayableTransactionObject<string>;
|
|
109
|
-
bands_y(arg0: number | string | BN): NonPayableTransactionObject<string>;
|
|
110
|
-
liquidity_mining_callback(): NonPayableTransactionObject<string>;
|
|
111
|
-
};
|
|
112
|
-
events: {
|
|
113
|
-
TokenExchange(cb?: Callback<TokenExchange>): EventEmitter;
|
|
114
|
-
TokenExchange(options?: EventOptions, cb?: Callback<TokenExchange>): EventEmitter;
|
|
115
|
-
Deposit(cb?: Callback<Deposit>): EventEmitter;
|
|
116
|
-
Deposit(options?: EventOptions, cb?: Callback<Deposit>): EventEmitter;
|
|
117
|
-
Withdraw(cb?: Callback<Withdraw>): EventEmitter;
|
|
118
|
-
Withdraw(options?: EventOptions, cb?: Callback<Withdraw>): EventEmitter;
|
|
119
|
-
SetRate(cb?: Callback<SetRate>): EventEmitter;
|
|
120
|
-
SetRate(options?: EventOptions, cb?: Callback<SetRate>): EventEmitter;
|
|
121
|
-
SetFee(cb?: Callback<SetFee>): EventEmitter;
|
|
122
|
-
SetFee(options?: EventOptions, cb?: Callback<SetFee>): EventEmitter;
|
|
123
|
-
SetAdminFee(cb?: Callback<SetAdminFee>): EventEmitter;
|
|
124
|
-
SetAdminFee(options?: EventOptions, cb?: Callback<SetAdminFee>): EventEmitter;
|
|
125
|
-
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
126
|
-
};
|
|
127
|
-
once(event: "TokenExchange", cb: Callback<TokenExchange>): void;
|
|
128
|
-
once(event: "TokenExchange", options: EventOptions, cb: Callback<TokenExchange>): void;
|
|
129
|
-
once(event: "Deposit", cb: Callback<Deposit>): void;
|
|
130
|
-
once(event: "Deposit", options: EventOptions, cb: Callback<Deposit>): void;
|
|
131
|
-
once(event: "Withdraw", cb: Callback<Withdraw>): void;
|
|
132
|
-
once(event: "Withdraw", options: EventOptions, cb: Callback<Withdraw>): void;
|
|
133
|
-
once(event: "SetRate", cb: Callback<SetRate>): void;
|
|
134
|
-
once(event: "SetRate", options: EventOptions, cb: Callback<SetRate>): void;
|
|
135
|
-
once(event: "SetFee", cb: Callback<SetFee>): void;
|
|
136
|
-
once(event: "SetFee", options: EventOptions, cb: Callback<SetFee>): void;
|
|
137
|
-
once(event: "SetAdminFee", cb: Callback<SetAdminFee>): void;
|
|
138
|
-
once(event: "SetAdminFee", options: EventOptions, cb: Callback<SetAdminFee>): void;
|
|
139
|
-
}
|
|
@@ -1,205 +0,0 @@
|
|
|
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, PayableTransactionObject, NonPayableTransactionObject, BlockType, ContractEventLog, BaseContract } from "./types";
|
|
7
|
-
export interface EventOptions {
|
|
8
|
-
filter?: object;
|
|
9
|
-
fromBlock?: BlockType;
|
|
10
|
-
topics?: string[];
|
|
11
|
-
}
|
|
12
|
-
export type UserState = ContractEventLog<{
|
|
13
|
-
user: string;
|
|
14
|
-
collateral: string;
|
|
15
|
-
debt: string;
|
|
16
|
-
n1: string;
|
|
17
|
-
n2: string;
|
|
18
|
-
liquidation_discount: string;
|
|
19
|
-
0: string;
|
|
20
|
-
1: string;
|
|
21
|
-
2: string;
|
|
22
|
-
3: string;
|
|
23
|
-
4: string;
|
|
24
|
-
5: string;
|
|
25
|
-
}>;
|
|
26
|
-
export type Borrow = ContractEventLog<{
|
|
27
|
-
user: string;
|
|
28
|
-
collateral_increase: string;
|
|
29
|
-
loan_increase: string;
|
|
30
|
-
0: string;
|
|
31
|
-
1: string;
|
|
32
|
-
2: string;
|
|
33
|
-
}>;
|
|
34
|
-
export type Repay = ContractEventLog<{
|
|
35
|
-
user: string;
|
|
36
|
-
collateral_decrease: string;
|
|
37
|
-
loan_decrease: string;
|
|
38
|
-
0: string;
|
|
39
|
-
1: string;
|
|
40
|
-
2: string;
|
|
41
|
-
}>;
|
|
42
|
-
export type RemoveCollateral = ContractEventLog<{
|
|
43
|
-
user: string;
|
|
44
|
-
collateral_decrease: string;
|
|
45
|
-
0: string;
|
|
46
|
-
1: string;
|
|
47
|
-
}>;
|
|
48
|
-
export type Liquidate = ContractEventLog<{
|
|
49
|
-
liquidator: string;
|
|
50
|
-
user: string;
|
|
51
|
-
collateral_received: string;
|
|
52
|
-
stablecoin_received: string;
|
|
53
|
-
debt: string;
|
|
54
|
-
0: string;
|
|
55
|
-
1: string;
|
|
56
|
-
2: string;
|
|
57
|
-
3: string;
|
|
58
|
-
4: string;
|
|
59
|
-
}>;
|
|
60
|
-
export type SetMonetaryPolicy = ContractEventLog<{
|
|
61
|
-
monetary_policy: string;
|
|
62
|
-
0: string;
|
|
63
|
-
}>;
|
|
64
|
-
export type SetBorrowingDiscounts = ContractEventLog<{
|
|
65
|
-
loan_discount: string;
|
|
66
|
-
liquidation_discount: string;
|
|
67
|
-
0: string;
|
|
68
|
-
1: string;
|
|
69
|
-
}>;
|
|
70
|
-
export type CollectFees = ContractEventLog<{
|
|
71
|
-
amount: string;
|
|
72
|
-
new_supply: string;
|
|
73
|
-
0: string;
|
|
74
|
-
1: string;
|
|
75
|
-
}>;
|
|
76
|
-
export interface CrvUSDsfrxETHController extends BaseContract {
|
|
77
|
-
constructor(jsonInterface: any[], address?: string, options?: ContractOptions): CrvUSDsfrxETHController;
|
|
78
|
-
clone(): CrvUSDsfrxETHController;
|
|
79
|
-
methods: {
|
|
80
|
-
factory(): NonPayableTransactionObject<string>;
|
|
81
|
-
amm(): NonPayableTransactionObject<string>;
|
|
82
|
-
collateral_token(): NonPayableTransactionObject<string>;
|
|
83
|
-
debt(user: string): NonPayableTransactionObject<string>;
|
|
84
|
-
loan_exists(user: string): NonPayableTransactionObject<boolean>;
|
|
85
|
-
total_debt(): NonPayableTransactionObject<string>;
|
|
86
|
-
"max_borrowable(uint256,uint256)"(collateral: number | string | BN, N: number | string | BN): NonPayableTransactionObject<string>;
|
|
87
|
-
"max_borrowable(uint256,uint256,uint256)"(collateral: number | string | BN, N: number | string | BN, current_debt: number | string | BN): NonPayableTransactionObject<string>;
|
|
88
|
-
min_collateral(debt: number | string | BN, N: number | string | BN): NonPayableTransactionObject<string>;
|
|
89
|
-
calculate_debt_n1(collateral: number | string | BN, debt: number | string | BN, N: number | string | BN): NonPayableTransactionObject<string>;
|
|
90
|
-
create_loan(collateral: number | string | BN, debt: number | string | BN, N: number | string | BN): PayableTransactionObject<void>;
|
|
91
|
-
create_loan_extended(collateral: number | string | BN, debt: number | string | BN, N: number | string | BN, callbacker: string, callback_args: number | string | BN[]): PayableTransactionObject<void>;
|
|
92
|
-
"add_collateral(uint256)"(collateral: number | string | BN): PayableTransactionObject<void>;
|
|
93
|
-
"add_collateral(uint256,address)"(collateral: number | string | BN, _for: string): PayableTransactionObject<void>;
|
|
94
|
-
"remove_collateral(uint256)"(collateral: number | string | BN): NonPayableTransactionObject<void>;
|
|
95
|
-
"remove_collateral(uint256,bool)"(collateral: number | string | BN, use_eth: boolean): NonPayableTransactionObject<void>;
|
|
96
|
-
borrow_more(collateral: number | string | BN, debt: number | string | BN): PayableTransactionObject<void>;
|
|
97
|
-
"repay(uint256)"(_d_debt: number | string | BN): NonPayableTransactionObject<void>;
|
|
98
|
-
"repay(uint256,address)"(_d_debt: number | string | BN, _for: string): NonPayableTransactionObject<void>;
|
|
99
|
-
"repay(uint256,address,int256)"(_d_debt: number | string | BN, _for: string, max_active_band: number | string | BN): NonPayableTransactionObject<void>;
|
|
100
|
-
"repay(uint256,address,int256,bool)"(_d_debt: number | string | BN, _for: string, max_active_band: number | string | BN, use_eth: boolean): NonPayableTransactionObject<void>;
|
|
101
|
-
repay_extended(callbacker: string, callback_args: number | string | BN[]): NonPayableTransactionObject<void>;
|
|
102
|
-
"health_calculator(address,int256,int256,bool)"(user: string, d_collateral: number | string | BN, d_debt: number | string | BN, full: boolean): NonPayableTransactionObject<string>;
|
|
103
|
-
"health_calculator(address,int256,int256,bool,uint256)"(user: string, d_collateral: number | string | BN, d_debt: number | string | BN, full: boolean, N: number | string | BN): NonPayableTransactionObject<string>;
|
|
104
|
-
"liquidate(address,uint256)"(user: string, min_x: number | string | BN): NonPayableTransactionObject<void>;
|
|
105
|
-
"liquidate(address,uint256,bool)"(user: string, min_x: number | string | BN, use_eth: boolean): NonPayableTransactionObject<void>;
|
|
106
|
-
liquidate_extended(user: string, min_x: number | string | BN, frac: number | string | BN, use_eth: boolean, callbacker: string, callback_args: number | string | BN[]): NonPayableTransactionObject<void>;
|
|
107
|
-
"tokens_to_liquidate(address)"(user: string): NonPayableTransactionObject<string>;
|
|
108
|
-
"tokens_to_liquidate(address,uint256)"(user: string, frac: number | string | BN): NonPayableTransactionObject<string>;
|
|
109
|
-
"health(address)"(user: string): NonPayableTransactionObject<string>;
|
|
110
|
-
"health(address,bool)"(user: string, full: boolean): NonPayableTransactionObject<string>;
|
|
111
|
-
"users_to_liquidate()"(): NonPayableTransactionObject<[
|
|
112
|
-
string,
|
|
113
|
-
string,
|
|
114
|
-
string,
|
|
115
|
-
string,
|
|
116
|
-
string
|
|
117
|
-
] & {
|
|
118
|
-
user: string;
|
|
119
|
-
x: string;
|
|
120
|
-
y: string;
|
|
121
|
-
debt: string;
|
|
122
|
-
health: string;
|
|
123
|
-
}[]>;
|
|
124
|
-
"users_to_liquidate(uint256)"(_from: number | string | BN): NonPayableTransactionObject<[
|
|
125
|
-
string,
|
|
126
|
-
string,
|
|
127
|
-
string,
|
|
128
|
-
string,
|
|
129
|
-
string
|
|
130
|
-
] & {
|
|
131
|
-
user: string;
|
|
132
|
-
x: string;
|
|
133
|
-
y: string;
|
|
134
|
-
debt: string;
|
|
135
|
-
health: string;
|
|
136
|
-
}[]>;
|
|
137
|
-
"users_to_liquidate(uint256,uint256)"(_from: number | string | BN, _limit: number | string | BN): NonPayableTransactionObject<[
|
|
138
|
-
string,
|
|
139
|
-
string,
|
|
140
|
-
string,
|
|
141
|
-
string,
|
|
142
|
-
string
|
|
143
|
-
] & {
|
|
144
|
-
user: string;
|
|
145
|
-
x: string;
|
|
146
|
-
y: string;
|
|
147
|
-
debt: string;
|
|
148
|
-
health: string;
|
|
149
|
-
}[]>;
|
|
150
|
-
amm_price(): NonPayableTransactionObject<string>;
|
|
151
|
-
user_prices(user: string): NonPayableTransactionObject<[string, string]>;
|
|
152
|
-
user_state(user: string): NonPayableTransactionObject<[string, string, string, string]>;
|
|
153
|
-
set_amm_fee(fee: number | string | BN): NonPayableTransactionObject<void>;
|
|
154
|
-
set_amm_admin_fee(fee: number | string | BN): NonPayableTransactionObject<void>;
|
|
155
|
-
set_monetary_policy(monetary_policy: string): NonPayableTransactionObject<void>;
|
|
156
|
-
set_borrowing_discounts(loan_discount: number | string | BN, liquidation_discount: number | string | BN): NonPayableTransactionObject<void>;
|
|
157
|
-
set_callback(cb: string): NonPayableTransactionObject<void>;
|
|
158
|
-
admin_fees(): NonPayableTransactionObject<string>;
|
|
159
|
-
collect_fees(): NonPayableTransactionObject<string>;
|
|
160
|
-
liquidation_discounts(arg0: string): NonPayableTransactionObject<string>;
|
|
161
|
-
loans(arg0: number | string | BN): NonPayableTransactionObject<string>;
|
|
162
|
-
loan_ix(arg0: string): NonPayableTransactionObject<string>;
|
|
163
|
-
n_loans(): NonPayableTransactionObject<string>;
|
|
164
|
-
minted(): NonPayableTransactionObject<string>;
|
|
165
|
-
redeemed(): NonPayableTransactionObject<string>;
|
|
166
|
-
monetary_policy(): NonPayableTransactionObject<string>;
|
|
167
|
-
liquidation_discount(): NonPayableTransactionObject<string>;
|
|
168
|
-
loan_discount(): NonPayableTransactionObject<string>;
|
|
169
|
-
};
|
|
170
|
-
events: {
|
|
171
|
-
UserState(cb?: Callback<UserState>): EventEmitter;
|
|
172
|
-
UserState(options?: EventOptions, cb?: Callback<UserState>): EventEmitter;
|
|
173
|
-
Borrow(cb?: Callback<Borrow>): EventEmitter;
|
|
174
|
-
Borrow(options?: EventOptions, cb?: Callback<Borrow>): EventEmitter;
|
|
175
|
-
Repay(cb?: Callback<Repay>): EventEmitter;
|
|
176
|
-
Repay(options?: EventOptions, cb?: Callback<Repay>): EventEmitter;
|
|
177
|
-
RemoveCollateral(cb?: Callback<RemoveCollateral>): EventEmitter;
|
|
178
|
-
RemoveCollateral(options?: EventOptions, cb?: Callback<RemoveCollateral>): EventEmitter;
|
|
179
|
-
Liquidate(cb?: Callback<Liquidate>): EventEmitter;
|
|
180
|
-
Liquidate(options?: EventOptions, cb?: Callback<Liquidate>): EventEmitter;
|
|
181
|
-
SetMonetaryPolicy(cb?: Callback<SetMonetaryPolicy>): EventEmitter;
|
|
182
|
-
SetMonetaryPolicy(options?: EventOptions, cb?: Callback<SetMonetaryPolicy>): EventEmitter;
|
|
183
|
-
SetBorrowingDiscounts(cb?: Callback<SetBorrowingDiscounts>): EventEmitter;
|
|
184
|
-
SetBorrowingDiscounts(options?: EventOptions, cb?: Callback<SetBorrowingDiscounts>): EventEmitter;
|
|
185
|
-
CollectFees(cb?: Callback<CollectFees>): EventEmitter;
|
|
186
|
-
CollectFees(options?: EventOptions, cb?: Callback<CollectFees>): EventEmitter;
|
|
187
|
-
allEvents(options?: EventOptions, cb?: Callback<EventLog>): EventEmitter;
|
|
188
|
-
};
|
|
189
|
-
once(event: "UserState", cb: Callback<UserState>): void;
|
|
190
|
-
once(event: "UserState", options: EventOptions, cb: Callback<UserState>): void;
|
|
191
|
-
once(event: "Borrow", cb: Callback<Borrow>): void;
|
|
192
|
-
once(event: "Borrow", options: EventOptions, cb: Callback<Borrow>): void;
|
|
193
|
-
once(event: "Repay", cb: Callback<Repay>): void;
|
|
194
|
-
once(event: "Repay", options: EventOptions, cb: Callback<Repay>): void;
|
|
195
|
-
once(event: "RemoveCollateral", cb: Callback<RemoveCollateral>): void;
|
|
196
|
-
once(event: "RemoveCollateral", options: EventOptions, cb: Callback<RemoveCollateral>): void;
|
|
197
|
-
once(event: "Liquidate", cb: Callback<Liquidate>): void;
|
|
198
|
-
once(event: "Liquidate", options: EventOptions, cb: Callback<Liquidate>): void;
|
|
199
|
-
once(event: "SetMonetaryPolicy", cb: Callback<SetMonetaryPolicy>): void;
|
|
200
|
-
once(event: "SetMonetaryPolicy", options: EventOptions, cb: Callback<SetMonetaryPolicy>): void;
|
|
201
|
-
once(event: "SetBorrowingDiscounts", cb: Callback<SetBorrowingDiscounts>): void;
|
|
202
|
-
once(event: "SetBorrowingDiscounts", options: EventOptions, cb: Callback<SetBorrowingDiscounts>): void;
|
|
203
|
-
once(event: "CollectFees", cb: Callback<CollectFees>): void;
|
|
204
|
-
once(event: "CollectFees", options: EventOptions, cb: Callback<CollectFees>): void;
|
|
205
|
-
}
|