@win-trader/bindings 0.0.4 → 0.3.0
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/cex-feed/dist/index.d.ts +662 -0
- package/cex-feed/dist/index.js +173 -0
- package/config-manager/dist/index.d.ts +267 -213
- package/config-manager/dist/index.js +67 -49
- package/market-governor/dist/index.d.ts +660 -0
- package/market-governor/dist/index.js +178 -0
- package/mock-oracle/dist/index.d.ts +84 -0
- package/mock-oracle/dist/index.js +37 -0
- package/mock-token/dist/index.d.ts +680 -667
- package/mock-token/dist/index.js +257 -252
- package/package.json +9 -22
- package/position-manager/dist/index.d.ts +520 -361
- package/position-manager/dist/index.js +172 -132
- package/request-router/dist/index.d.ts +275 -208
- package/request-router/dist/index.js +74 -56
- package/vault/dist/index.d.ts +914 -856
- package/vault/dist/index.js +310 -295
- package/oracle/dist/index.d.ts +0 -555
- package/oracle/dist/index.js +0 -150
- package/oracle-router/dist/index.d.ts +0 -673
- package/oracle-router/dist/index.js +0 -208
|
@@ -1,148 +1,101 @@
|
|
|
1
1
|
import { Buffer } from "buffer";
|
|
2
2
|
import { AssembledTransaction, Client as ContractClient, ClientOptions as ContractClientOptions, MethodOptions } from "@stellar/stellar-sdk/contract";
|
|
3
|
-
import type { u32, u64, i128 } from "@stellar/stellar-sdk/contract";
|
|
3
|
+
import type { u32, u64, i128, Option } from "@stellar/stellar-sdk/contract";
|
|
4
4
|
export * from "@stellar/stellar-sdk";
|
|
5
5
|
export * as contract from "@stellar/stellar-sdk/contract";
|
|
6
6
|
export * as rpc from "@stellar/stellar-sdk/rpc";
|
|
7
7
|
export declare const RequestRouterError: {
|
|
8
|
-
|
|
8
|
+
400: {
|
|
9
9
|
message: string;
|
|
10
10
|
};
|
|
11
|
-
|
|
11
|
+
410: {
|
|
12
12
|
message: string;
|
|
13
13
|
};
|
|
14
|
-
|
|
14
|
+
420: {
|
|
15
15
|
message: string;
|
|
16
16
|
};
|
|
17
|
-
|
|
17
|
+
430: {
|
|
18
18
|
message: string;
|
|
19
19
|
};
|
|
20
|
-
|
|
20
|
+
440: {
|
|
21
21
|
message: string;
|
|
22
22
|
};
|
|
23
|
-
|
|
23
|
+
441: {
|
|
24
24
|
message: string;
|
|
25
25
|
};
|
|
26
|
-
|
|
26
|
+
442: {
|
|
27
27
|
message: string;
|
|
28
28
|
};
|
|
29
|
-
|
|
30
|
-
* `upgrade` called with no pending proposal.
|
|
31
|
-
*/
|
|
32
|
-
8: {
|
|
33
|
-
message: string;
|
|
34
|
-
};
|
|
35
|
-
/**
|
|
36
|
-
* `upgrade` called before the proposal's timelock eta.
|
|
37
|
-
*/
|
|
38
|
-
9: {
|
|
39
|
-
message: string;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* `upgrade` called with a hash that differs from the proposal.
|
|
43
|
-
*/
|
|
44
|
-
10: {
|
|
29
|
+
450: {
|
|
45
30
|
message: string;
|
|
46
31
|
};
|
|
47
32
|
};
|
|
48
33
|
/**
|
|
49
|
-
*
|
|
50
|
-
* the funding EMA, and the market configuration.
|
|
51
|
-
*
|
|
52
|
-
* Soroban limits UDT field names to 30 characters, so where a doc glossary
|
|
53
|
-
* term is longer the field drops the redundant qualifier and its doc
|
|
54
|
-
* comment carries the full term (e.g. `receiver_backed_index_long` is the
|
|
55
|
-
* doc's `receiver_backed_payer_index` for the long side).
|
|
34
|
+
* SEP-40 asset identifier. Markets are quoted as `Other(market symbol)`.
|
|
56
35
|
*/
|
|
36
|
+
export type Asset = {
|
|
37
|
+
tag: "Stellar";
|
|
38
|
+
values: readonly [string];
|
|
39
|
+
} | {
|
|
40
|
+
tag: "Other";
|
|
41
|
+
values: readonly [string];
|
|
42
|
+
};
|
|
43
|
+
export interface PriceData {
|
|
44
|
+
price: i128;
|
|
45
|
+
timestamp: u64;
|
|
46
|
+
}
|
|
47
|
+
export interface StampedPrice {
|
|
48
|
+
observed_at: u64;
|
|
49
|
+
price: i128;
|
|
50
|
+
}
|
|
57
51
|
export interface Market {
|
|
58
52
|
config: MarketConfig;
|
|
59
|
-
/**
|
|
60
|
-
* `INDEX_PRECISION`-scaled bps/day payer rate as of the last refresh.
|
|
61
|
-
*/
|
|
62
53
|
current_payer_rate: i128;
|
|
63
54
|
current_payer_side: PayerSide;
|
|
64
55
|
last_funding_checkpoint: u64;
|
|
65
56
|
long: MarketSide;
|
|
66
|
-
|
|
67
|
-
* Cumulative payer fee per unit of dominant-side size that is LP
|
|
68
|
-
* revenue on collection (§8.2).
|
|
69
|
-
*/
|
|
57
|
+
long_payer_remainders: RemainderGroup;
|
|
70
58
|
lp_backed_index_long: i128;
|
|
71
59
|
lp_backed_index_short: i128;
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Sub-stroop carry of the receiver-liability accrual (§8.3).
|
|
75
|
-
*/
|
|
76
|
-
pending_remainder: i128;
|
|
77
|
-
/**
|
|
78
|
-
* Cumulative payer fee per unit of dominant-side size whose collection
|
|
79
|
-
* restores cash backing an already-accrued receiver claim (§8.2).
|
|
80
|
-
*/
|
|
60
|
+
pending_receiver_funding: i128;
|
|
81
61
|
receiver_backed_index_long: i128;
|
|
82
62
|
receiver_backed_index_short: i128;
|
|
83
|
-
/**
|
|
84
|
-
* Cumulative funding credit per unit of light-side size (§8.2).
|
|
85
|
-
*/
|
|
86
63
|
receiver_index_long: i128;
|
|
87
|
-
receiver_index_remainder: i128;
|
|
88
64
|
receiver_index_short: i128;
|
|
89
|
-
receiver_payer_remainder: i128;
|
|
90
65
|
short: MarketSide;
|
|
91
|
-
|
|
92
|
-
* §8.1 signed EMA of the instantaneous skew: a fraction of one at
|
|
93
|
-
* `INDEX_PRECISION` scale, positive when history says longs dominate.
|
|
94
|
-
* Decays toward the current skew with the global half-life.
|
|
95
|
-
*/
|
|
66
|
+
short_payer_remainders: RemainderGroup;
|
|
96
67
|
skew_ema: i128;
|
|
97
68
|
}
|
|
69
|
+
export type Trigger = {
|
|
70
|
+
tag: "None";
|
|
71
|
+
values: void;
|
|
72
|
+
} | {
|
|
73
|
+
tag: "Attached";
|
|
74
|
+
values: readonly [TriggerInstruction];
|
|
75
|
+
};
|
|
98
76
|
export interface LpConfig {
|
|
99
|
-
|
|
77
|
+
lp_request_delay_seconds: u64;
|
|
100
78
|
max_withdraw_utilization_bps: u32;
|
|
101
79
|
min_deposit_nav_factor_bps: u32;
|
|
102
80
|
}
|
|
103
|
-
/**
|
|
104
|
-
* Represents a single trader's open leveraged position.
|
|
105
|
-
*/
|
|
106
81
|
export interface Position {
|
|
107
|
-
/**
|
|
108
|
-
* Asset units at `PRICE_PRECISION`.
|
|
109
|
-
*/
|
|
110
82
|
base_exposure: i128;
|
|
111
|
-
|
|
112
|
-
/**
|
|
113
|
-
* Cash owned by an optional-order executor.
|
|
114
|
-
*/
|
|
115
|
-
execution_budget: i128;
|
|
116
|
-
funding_paid_to_lps_debt: i128;
|
|
117
|
-
funding_paid_to_receivers_debt: i128;
|
|
118
|
-
funding_received_debt: i128;
|
|
83
|
+
borrow_index_snapshot: i128;
|
|
119
84
|
id: u64;
|
|
120
85
|
is_long: boolean;
|
|
121
|
-
|
|
86
|
+
lp_payer_index_snapshot: i128;
|
|
122
87
|
market: string;
|
|
88
|
+
opened_at: u64;
|
|
123
89
|
owner: string;
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
90
|
+
pending_mutation_action_id: Option<u64>;
|
|
91
|
+
receiver_index_snapshot: i128;
|
|
92
|
+
receiver_payer_index_snapshot: i128;
|
|
127
93
|
risk_units: i128;
|
|
128
|
-
/**
|
|
129
|
-
* USD notional at `PRICE_PRECISION`.
|
|
130
|
-
*/
|
|
131
94
|
size: i128;
|
|
132
|
-
|
|
133
|
-
* Trigger price for the optional stop-loss order; `0` = none.
|
|
134
|
-
*/
|
|
135
|
-
stop_loss: i128;
|
|
136
|
-
/**
|
|
137
|
-
* Trader-owned collateral recorded in contract state (the doc's
|
|
138
|
-
* "stored collateral"). Effective collateral — stored collateral after
|
|
139
|
-
* pending fees and funding credits — is always derived, never stored.
|
|
140
|
-
*/
|
|
95
|
+
stop_loss: Trigger;
|
|
141
96
|
stored_collateral: i128;
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
*/
|
|
145
|
-
take_profit: i128;
|
|
97
|
+
stored_minimum_borrow_fee: i128;
|
|
98
|
+
take_profit: Trigger;
|
|
146
99
|
}
|
|
147
100
|
export interface LpRequest {
|
|
148
101
|
amount: i128;
|
|
@@ -151,13 +104,12 @@ export interface LpRequest {
|
|
|
151
104
|
kind: LpRequestKind;
|
|
152
105
|
owner: string;
|
|
153
106
|
request_time: u64;
|
|
107
|
+
/**
|
|
108
|
+
* The resolve reward fixed when the request was made.
|
|
109
|
+
*/
|
|
110
|
+
reward: i128;
|
|
154
111
|
status: LpRequestStatus;
|
|
155
112
|
}
|
|
156
|
-
/**
|
|
157
|
-
* Which side currently pays funding (§8.1: the side the blended integral
|
|
158
|
-
* skew points at — under the EMA this can be the *lighter* side for a
|
|
159
|
-
* while after the book flips). `None` when the blend is exactly zero.
|
|
160
|
-
*/
|
|
161
113
|
export type PayerSide = {
|
|
162
114
|
tag: "None";
|
|
163
115
|
values: void;
|
|
@@ -181,69 +133,67 @@ export type RiskState = {
|
|
|
181
133
|
tag: "HardCap";
|
|
182
134
|
values: void;
|
|
183
135
|
};
|
|
136
|
+
export type ActionKind = {
|
|
137
|
+
tag: "MarketOpen";
|
|
138
|
+
values: void;
|
|
139
|
+
} | {
|
|
140
|
+
tag: "LimitOpen";
|
|
141
|
+
values: void;
|
|
142
|
+
} | {
|
|
143
|
+
tag: "Decrease";
|
|
144
|
+
values: void;
|
|
145
|
+
} | {
|
|
146
|
+
tag: "Close";
|
|
147
|
+
values: void;
|
|
148
|
+
};
|
|
184
149
|
export interface MarketSide {
|
|
185
150
|
base_exposure: i128;
|
|
151
|
+
hard_cap_payout_factor: i128;
|
|
152
|
+
hard_cap_reference_pnl: i128;
|
|
186
153
|
risk_state: RiskState;
|
|
187
154
|
risk_units: i128;
|
|
188
155
|
size_open_interest: i128;
|
|
189
156
|
stored_collateral_total: i128;
|
|
190
157
|
}
|
|
191
|
-
export interface
|
|
192
|
-
|
|
193
|
-
|
|
158
|
+
export interface OpenPayload {
|
|
159
|
+
acceptable_price: i128;
|
|
160
|
+
expires_at: u64;
|
|
161
|
+
is_long: boolean;
|
|
162
|
+
size: i128;
|
|
163
|
+
stop_loss: i128;
|
|
164
|
+
submitted_collateral: i128;
|
|
165
|
+
take_profit: i128;
|
|
194
166
|
}
|
|
195
|
-
export interface
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
previous_timestamp: u64;
|
|
199
|
-
prices: Array<RoundPrice>;
|
|
200
|
-
timestamp: u64;
|
|
167
|
+
export interface ClosePayload {
|
|
168
|
+
acceptable_price: i128;
|
|
169
|
+
position_id: u64;
|
|
201
170
|
}
|
|
202
171
|
export interface GlobalConfig {
|
|
203
172
|
base_borrow_rate_bps_day: i128;
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
*/
|
|
173
|
+
borrow_lp_revenue_share_bps: u32;
|
|
174
|
+
config_timelock_seconds: u64;
|
|
175
|
+
fee_lp_revenue_share_bps: u32;
|
|
208
176
|
funding_half_life_seconds: u64;
|
|
209
|
-
|
|
210
|
-
|
|
177
|
+
global_hard_cap_limit_bps: u32;
|
|
178
|
+
hard_cap_relatch_band_bps: u32;
|
|
179
|
+
keeper_rewards: KeeperRewards;
|
|
211
180
|
max_active_markets: u32;
|
|
212
|
-
|
|
213
|
-
|
|
181
|
+
max_market_order_lifetime: u64;
|
|
182
|
+
max_order_lifetime_seconds: u64;
|
|
183
|
+
max_price_age_seconds: u64;
|
|
214
184
|
max_variable_borrow_bps_day: i128;
|
|
185
|
+
min_borrow_fee_seconds: u64;
|
|
215
186
|
min_collateral: i128;
|
|
216
187
|
min_position_lifetime: u64;
|
|
217
188
|
risk_capacity_limit_bps: u32;
|
|
218
|
-
risk_keeper_revenue_share_bps: u32;
|
|
219
189
|
}
|
|
220
190
|
export interface MarketConfig {
|
|
221
191
|
adl_pnl_factor_bps: u32;
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
* §11.1 closing-fee tier when the close worsens skew.
|
|
225
|
-
*/
|
|
226
|
-
close_fee_high_bps: u32;
|
|
227
|
-
/**
|
|
228
|
-
* §11.1 closing-fee tier when the close improves or preserves skew.
|
|
229
|
-
*/
|
|
230
|
-
close_fee_low_bps: u32;
|
|
192
|
+
close_pnl_fee_bps: u32;
|
|
193
|
+
close_size_fee_bps: u32;
|
|
231
194
|
hard_cap_pnl_factor_bps: u32;
|
|
232
|
-
/**
|
|
233
|
-
* Margin required to open or add risk (§12.3). Divides max leverage:
|
|
234
|
-
* a position may not be created closer to liquidation than this.
|
|
235
|
-
*/
|
|
236
195
|
initial_margin_bps: u32;
|
|
237
|
-
/**
|
|
238
|
-
* §8.1 weight of the instantaneous skew in the funding blend, in bps;
|
|
239
|
-
* the rest is the half-life EMA. `BPS` reproduces pure instant skew.
|
|
240
|
-
*/
|
|
241
196
|
instant_weight_bps: u32;
|
|
242
|
-
liquidation_reward_bps: u32;
|
|
243
|
-
/**
|
|
244
|
-
* Margin below which the position is liquidatable (§12.3). Must not
|
|
245
|
-
* exceed `initial_margin_bps`; the gap is the entry buffer.
|
|
246
|
-
*/
|
|
247
197
|
maintenance_margin_bps: u32;
|
|
248
198
|
market_risk_factor_bps: u32;
|
|
249
199
|
max_funding_rate_bps_day: i128;
|
|
@@ -251,37 +201,88 @@ export interface MarketConfig {
|
|
|
251
201
|
max_long_size_open_interest: i128;
|
|
252
202
|
max_short_base_exposure: i128;
|
|
253
203
|
max_short_size_open_interest: i128;
|
|
204
|
+
open_fee_bps: u32;
|
|
205
|
+
order_execution_delay_seconds: u64;
|
|
254
206
|
recovery_pnl_factor_bps: u32;
|
|
255
207
|
warning_pnl_factor_bps: u32;
|
|
256
208
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
209
|
+
export type ActionOutcome = {
|
|
210
|
+
tag: "Executed";
|
|
211
|
+
values: void;
|
|
212
|
+
} | {
|
|
213
|
+
tag: "Failed";
|
|
214
|
+
values: void;
|
|
215
|
+
} | {
|
|
216
|
+
tag: "Cancelled";
|
|
217
|
+
values: void;
|
|
218
|
+
} | {
|
|
219
|
+
tag: "Expired";
|
|
220
|
+
values: void;
|
|
221
|
+
} | {
|
|
222
|
+
tag: "Superseded";
|
|
223
|
+
values: void;
|
|
224
|
+
} | {
|
|
225
|
+
tag: "NotReady";
|
|
226
|
+
values: void;
|
|
227
|
+
} | {
|
|
228
|
+
tag: "Pending";
|
|
229
|
+
values: void;
|
|
230
|
+
} | {
|
|
231
|
+
tag: "RequiresLiquidation";
|
|
232
|
+
values: void;
|
|
233
|
+
};
|
|
234
|
+
export type ActionPayload = {
|
|
235
|
+
tag: "MarketOpen";
|
|
236
|
+
values: readonly [OpenPayload];
|
|
237
|
+
} | {
|
|
238
|
+
tag: "LimitOpen";
|
|
239
|
+
values: readonly [OpenPayload, TriggerCondition];
|
|
240
|
+
} | {
|
|
241
|
+
tag: "Decrease";
|
|
242
|
+
values: readonly [DecreasePayload];
|
|
243
|
+
} | {
|
|
244
|
+
tag: "Close";
|
|
245
|
+
values: readonly [ClosePayload];
|
|
246
|
+
};
|
|
247
|
+
export type FailureReason = {
|
|
248
|
+
tag: "PriceBoundExceeded";
|
|
249
|
+
values: void;
|
|
250
|
+
} | {
|
|
251
|
+
tag: "CapacityExceeded";
|
|
252
|
+
values: void;
|
|
253
|
+
} | {
|
|
254
|
+
tag: "ExposureCapExceeded";
|
|
255
|
+
values: void;
|
|
256
|
+
} | {
|
|
257
|
+
tag: "SideRestricted";
|
|
258
|
+
values: void;
|
|
259
|
+
} | {
|
|
260
|
+
tag: "InsufficientCollateral";
|
|
261
|
+
values: void;
|
|
262
|
+
} | {
|
|
263
|
+
tag: "UnpayableProfit";
|
|
264
|
+
values: void;
|
|
265
|
+
} | {
|
|
266
|
+
tag: "PositionGone";
|
|
267
|
+
values: void;
|
|
268
|
+
} | {
|
|
269
|
+
tag: "MarketPaused";
|
|
270
|
+
values: void;
|
|
271
|
+
} | {
|
|
272
|
+
tag: "SizeTooSmall";
|
|
273
|
+
values: void;
|
|
274
|
+
};
|
|
275
|
+
export interface KeeperRewards {
|
|
276
|
+
adl: i128;
|
|
277
|
+
close: i128;
|
|
278
|
+
decrease: i128;
|
|
279
|
+
expiry: i128;
|
|
280
|
+
limit_order: i128;
|
|
281
|
+
liquidation: i128;
|
|
282
|
+
lp_resolve: i128;
|
|
283
|
+
open: i128;
|
|
284
|
+
sl: i128;
|
|
285
|
+
tp: i128;
|
|
285
286
|
}
|
|
286
287
|
export type LpRequestKind = {
|
|
287
288
|
tag: "Deposit";
|
|
@@ -290,24 +291,35 @@ export type LpRequestKind = {
|
|
|
290
291
|
tag: "Withdrawal";
|
|
291
292
|
values: void;
|
|
292
293
|
};
|
|
293
|
-
/**
|
|
294
|
-
* Data required during a WASM migration. Single definition for all contracts.
|
|
295
|
-
*/
|
|
296
294
|
export interface MigrationData {
|
|
297
295
|
version: u32;
|
|
298
296
|
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
297
|
+
export interface PendingAction {
|
|
298
|
+
action_id: u64;
|
|
299
|
+
commit_observed_at: u64;
|
|
300
|
+
created_at: u64;
|
|
301
|
+
escrowed_collateral: i128;
|
|
302
|
+
execute_after: u64;
|
|
303
|
+
kind: ActionKind;
|
|
304
|
+
market_id: string;
|
|
305
|
+
owner: string;
|
|
306
|
+
payload: ActionPayload;
|
|
307
|
+
}
|
|
307
308
|
export interface PendingUpgrade {
|
|
308
309
|
eta: u64;
|
|
309
310
|
wasm_hash: Buffer;
|
|
310
311
|
}
|
|
312
|
+
export interface RemainderGroup {
|
|
313
|
+
distribution_remainder: i128;
|
|
314
|
+
lp_payer_remainder: i128;
|
|
315
|
+
receiver_liability_remainder: i128;
|
|
316
|
+
receiver_payer_remainder: i128;
|
|
317
|
+
}
|
|
318
|
+
export interface DecreasePayload {
|
|
319
|
+
acceptable_price: i128;
|
|
320
|
+
position_id: u64;
|
|
321
|
+
size_removed: i128;
|
|
322
|
+
}
|
|
311
323
|
export type LpRequestStatus = {
|
|
312
324
|
tag: "Pending";
|
|
313
325
|
values: void;
|
|
@@ -317,15 +329,20 @@ export type LpRequestStatus = {
|
|
|
317
329
|
} | {
|
|
318
330
|
tag: "Failed";
|
|
319
331
|
values: void;
|
|
320
|
-
} | {
|
|
321
|
-
tag: "Expired";
|
|
322
|
-
values: void;
|
|
323
332
|
};
|
|
333
|
+
export interface PendingFeesView {
|
|
334
|
+
borrow: i128;
|
|
335
|
+
funding_paid_to_lps: i128;
|
|
336
|
+
funding_paid_to_receivers: i128;
|
|
337
|
+
funding_received: i128;
|
|
338
|
+
}
|
|
339
|
+
export interface PendingPriceFeed {
|
|
340
|
+
effective_at: u64;
|
|
341
|
+
price_feed: string;
|
|
342
|
+
}
|
|
324
343
|
export interface SettlementResult {
|
|
325
|
-
/**
|
|
326
|
-
* Shares minted for a deposit or assets paid for a withdrawal.
|
|
327
|
-
*/
|
|
328
344
|
amount: i128;
|
|
345
|
+
reward: i128;
|
|
329
346
|
status: SettlementStatus;
|
|
330
347
|
}
|
|
331
348
|
export type SettlementStatus = {
|
|
@@ -334,19 +351,49 @@ export type SettlementStatus = {
|
|
|
334
351
|
} | {
|
|
335
352
|
tag: "Failed";
|
|
336
353
|
values: void;
|
|
354
|
+
} | {
|
|
355
|
+
tag: "NotReady";
|
|
356
|
+
values: void;
|
|
337
357
|
};
|
|
358
|
+
export interface TriggerCondition {
|
|
359
|
+
trigger_above: boolean;
|
|
360
|
+
trigger_price: i128;
|
|
361
|
+
}
|
|
338
362
|
export interface AccountingSnapshot {
|
|
339
363
|
cash_lp_equity: i128;
|
|
340
364
|
cash_shortfall: i128;
|
|
365
|
+
deleveraging_side_count: u32;
|
|
341
366
|
free_lp_capital: i128;
|
|
342
|
-
|
|
367
|
+
min_equity_clear_of_adl: i128;
|
|
343
368
|
non_lp_claims: i128;
|
|
344
369
|
open_position_count: u64;
|
|
345
370
|
physical_cash: i128;
|
|
346
371
|
required_risk_backing: i128;
|
|
372
|
+
restricted_side_count: u32;
|
|
347
373
|
total_risk_units: i128;
|
|
348
374
|
vault_nav: i128;
|
|
349
375
|
}
|
|
376
|
+
export interface TriggerInstruction {
|
|
377
|
+
acceptable_price: i128;
|
|
378
|
+
commit_observed_at: u64;
|
|
379
|
+
committed_at: u64;
|
|
380
|
+
execute_after: u64;
|
|
381
|
+
trigger_price: i128;
|
|
382
|
+
}
|
|
383
|
+
export interface PendingGlobalConfig {
|
|
384
|
+
config: GlobalConfig;
|
|
385
|
+
effective_at: u64;
|
|
386
|
+
}
|
|
387
|
+
export interface PendingMarketConfig {
|
|
388
|
+
config: MarketConfig;
|
|
389
|
+
effective_at: u64;
|
|
390
|
+
}
|
|
391
|
+
export interface EventHeader {
|
|
392
|
+
actor: string;
|
|
393
|
+
event_version: u32;
|
|
394
|
+
ledger_timestamp: u64;
|
|
395
|
+
market: string;
|
|
396
|
+
}
|
|
350
397
|
export declare const UpgradeableError: {
|
|
351
398
|
/**
|
|
352
399
|
* When migration is attempted but not allowed due to upgrade state.
|
|
@@ -375,16 +422,6 @@ export declare const MerkleDistributorError: {
|
|
|
375
422
|
message: string;
|
|
376
423
|
};
|
|
377
424
|
};
|
|
378
|
-
/**
|
|
379
|
-
* Storage keys for the data associated with `MerkleDistributor`
|
|
380
|
-
*/
|
|
381
|
-
export type MerkleDistributorStorageKey = {
|
|
382
|
-
tag: "Root";
|
|
383
|
-
values: void;
|
|
384
|
-
} | {
|
|
385
|
-
tag: "Claimed";
|
|
386
|
-
values: readonly [u32];
|
|
387
|
-
};
|
|
388
425
|
/**
|
|
389
426
|
* Rounding direction for division operations
|
|
390
427
|
*/
|
|
@@ -412,37 +449,47 @@ export declare const SorobanFixedPointError: {
|
|
|
412
449
|
message: string;
|
|
413
450
|
};
|
|
414
451
|
};
|
|
415
|
-
export declare const
|
|
452
|
+
export declare const PausableError: {
|
|
416
453
|
/**
|
|
417
|
-
* The
|
|
454
|
+
* The operation failed because the contract is paused.
|
|
418
455
|
*/
|
|
419
|
-
|
|
456
|
+
1000: {
|
|
420
457
|
message: string;
|
|
421
458
|
};
|
|
422
459
|
/**
|
|
423
|
-
* The
|
|
460
|
+
* The operation failed because the contract is not paused.
|
|
424
461
|
*/
|
|
425
|
-
|
|
462
|
+
1001: {
|
|
426
463
|
message: string;
|
|
427
464
|
};
|
|
465
|
+
};
|
|
466
|
+
/**
|
|
467
|
+
* Storage keys for the data associated with `MerkleDistributor`
|
|
468
|
+
*/
|
|
469
|
+
export type MerkleDistributorStorageKey = {
|
|
470
|
+
tag: "Root";
|
|
471
|
+
values: void;
|
|
472
|
+
} | {
|
|
473
|
+
tag: "Claimed";
|
|
474
|
+
values: readonly [u32];
|
|
475
|
+
};
|
|
476
|
+
export declare const CryptoError: {
|
|
428
477
|
/**
|
|
429
|
-
*
|
|
478
|
+
* The merkle proof length is out of bounds.
|
|
430
479
|
*/
|
|
431
|
-
|
|
480
|
+
1400: {
|
|
432
481
|
message: string;
|
|
433
482
|
};
|
|
434
|
-
};
|
|
435
|
-
export declare const PausableError: {
|
|
436
483
|
/**
|
|
437
|
-
* The
|
|
484
|
+
* The index of the leaf is out of bounds.
|
|
438
485
|
*/
|
|
439
|
-
|
|
486
|
+
1401: {
|
|
440
487
|
message: string;
|
|
441
488
|
};
|
|
442
489
|
/**
|
|
443
|
-
*
|
|
490
|
+
* No data in hasher state.
|
|
444
491
|
*/
|
|
445
|
-
|
|
492
|
+
1402: {
|
|
446
493
|
message: string;
|
|
447
494
|
};
|
|
448
495
|
};
|
|
@@ -468,6 +515,12 @@ export interface Client {
|
|
|
468
515
|
new_wasm_hash: Buffer;
|
|
469
516
|
operator: string;
|
|
470
517
|
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
518
|
+
/**
|
|
519
|
+
* Construct and simulate a skip_head transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
520
|
+
*/
|
|
521
|
+
skip_head: ({ caller }: {
|
|
522
|
+
caller: string;
|
|
523
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
471
524
|
/**
|
|
472
525
|
* Construct and simulate a get_request transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
473
526
|
*/
|
|
@@ -486,6 +539,12 @@ export interface Client {
|
|
|
486
539
|
cancel_upgrade: ({ caller }: {
|
|
487
540
|
caller: string;
|
|
488
541
|
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
542
|
+
/**
|
|
543
|
+
* Construct and simulate a claim_lp_payout transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
544
|
+
*/
|
|
545
|
+
claim_lp_payout: ({ owner }: {
|
|
546
|
+
owner: string;
|
|
547
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
489
548
|
/**
|
|
490
549
|
* Construct and simulate a propose_upgrade transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
491
550
|
*/
|
|
@@ -507,6 +566,12 @@ export interface Client {
|
|
|
507
566
|
owner: string;
|
|
508
567
|
shares: i128;
|
|
509
568
|
}, options?: MethodOptions) => Promise<AssembledTransaction<u64>>;
|
|
569
|
+
/**
|
|
570
|
+
* Construct and simulate a lp_payout_claimable transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
571
|
+
*/
|
|
572
|
+
lp_payout_claimable: ({ owner }: {
|
|
573
|
+
owner: string;
|
|
574
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
510
575
|
/**
|
|
511
576
|
* Construct and simulate a next_request_to_resolve transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
|
|
512
577
|
*/
|
|
@@ -516,10 +581,9 @@ export declare class Client extends ContractClient {
|
|
|
516
581
|
readonly options: ContractClientOptions;
|
|
517
582
|
static deploy<T = Client>(
|
|
518
583
|
/** Constructor/Initialization Args for the contract's `__constructor` method */
|
|
519
|
-
{ asset_address, vault_address,
|
|
584
|
+
{ asset_address, vault_address, config_manager_address }: {
|
|
520
585
|
asset_address: string;
|
|
521
586
|
vault_address: string;
|
|
522
|
-
oracle_router: string;
|
|
523
587
|
config_manager_address: string;
|
|
524
588
|
},
|
|
525
589
|
/** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
|
|
@@ -535,12 +599,15 @@ export declare class Client extends ContractClient {
|
|
|
535
599
|
readonly fromJSON: {
|
|
536
600
|
migrate: (json: string) => AssembledTransaction<null>;
|
|
537
601
|
upgrade: (json: string) => AssembledTransaction<null>;
|
|
602
|
+
skip_head: (json: string) => AssembledTransaction<null>;
|
|
538
603
|
get_request: (json: string) => AssembledTransaction<LpRequest>;
|
|
539
604
|
resolve_next: (json: string) => AssembledTransaction<SettlementResult>;
|
|
540
605
|
cancel_upgrade: (json: string) => AssembledTransaction<null>;
|
|
606
|
+
claim_lp_payout: (json: string) => AssembledTransaction<bigint>;
|
|
541
607
|
propose_upgrade: (json: string) => AssembledTransaction<null>;
|
|
542
608
|
request_deposit: (json: string) => AssembledTransaction<bigint>;
|
|
543
609
|
request_withdrawal: (json: string) => AssembledTransaction<bigint>;
|
|
610
|
+
lp_payout_claimable: (json: string) => AssembledTransaction<bigint>;
|
|
544
611
|
next_request_to_resolve: (json: string) => AssembledTransaction<bigint>;
|
|
545
612
|
};
|
|
546
613
|
}
|