@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.
@@ -1,6 +1,6 @@
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";
@@ -11,145 +11,108 @@ export declare const PositionManagerError: {
11
11
  2: {
12
12
  message: string;
13
13
  };
14
- 3: {
14
+ 10: {
15
15
  message: string;
16
16
  };
17
- 4: {
17
+ 11: {
18
18
  message: string;
19
19
  };
20
- 5: {
20
+ 12: {
21
21
  message: string;
22
22
  };
23
- 6: {
23
+ 14: {
24
24
  message: string;
25
25
  };
26
- 7: {
26
+ 16: {
27
27
  message: string;
28
28
  };
29
- 8: {
29
+ 20: {
30
30
  message: string;
31
31
  };
32
- 9: {
32
+ 21: {
33
33
  message: string;
34
34
  };
35
- 10: {
35
+ 22: {
36
36
  message: string;
37
37
  };
38
- 11: {
38
+ 23: {
39
39
  message: string;
40
40
  };
41
- 12: {
41
+ 24: {
42
42
  message: string;
43
43
  };
44
- 13: {
44
+ 25: {
45
45
  message: string;
46
46
  };
47
- 14: {
47
+ 26: {
48
48
  message: string;
49
49
  };
50
- 15: {
50
+ 27: {
51
51
  message: string;
52
52
  };
53
- 16: {
53
+ 28: {
54
54
  message: string;
55
55
  };
56
- 17: {
56
+ 29: {
57
57
  message: string;
58
58
  };
59
- 18: {
59
+ 31: {
60
60
  message: string;
61
61
  };
62
- 19: {
62
+ 32: {
63
63
  message: string;
64
64
  };
65
- 20: {
65
+ 33: {
66
66
  message: string;
67
67
  };
68
- /**
69
- * The contract is operationally paused (distinct from a risk state).
70
- */
71
- 21: {
68
+ 40: {
72
69
  message: string;
73
70
  };
74
- /**
75
- * An accounting invariant broke — e.g. a negative pending fee, which
76
- * means a decreasing index or corrupted debt baseline (§11.2).
77
- */
78
- 22: {
71
+ 41: {
79
72
  message: string;
80
73
  };
81
- /**
82
- * `upgrade` called with no pending proposal.
83
- */
84
- 23: {
74
+ 42: {
85
75
  message: string;
86
76
  };
87
- /**
88
- * `upgrade` called before the proposal's timelock eta.
89
- */
90
- 24: {
77
+ 46: {
91
78
  message: string;
92
79
  };
93
- /**
94
- * `upgrade` called with a hash that differs from the proposal.
95
- */
96
- 25: {
80
+ 47: {
81
+ message: string;
82
+ };
83
+ 60: {
84
+ message: string;
85
+ };
86
+ 61: {
87
+ message: string;
88
+ };
89
+ 70: {
90
+ message: string;
91
+ };
92
+ 80: {
97
93
  message: string;
98
94
  };
99
95
  };
100
- /**
101
- * Which collection routed revenue through the split (§13).
102
- */
103
- export type FeeSource = {
104
- tag: "Closing";
105
- values: void;
106
- } | {
107
- tag: "Borrow";
108
- values: void;
109
- };
110
- /**
111
- * Why a position left the book.
112
- */
113
- export type CloseReason = {
114
- tag: "Trader";
115
- values: void;
116
- } | {
117
- tag: "Liquidation";
118
- values: void;
119
- } | {
120
- tag: "Deleverage";
121
- values: void;
122
- } | {
123
- tag: "Order";
124
- values: void;
125
- };
126
- /**
127
- * §5.1 global state: the five non-LP claim totals, the risk counters, and
128
- * the global borrow accrual. The receiver-funding liability total is fed
129
- * per-market by `checkpoint::checkpoint_market` (§8.3).
130
- */
131
96
  export interface Ledger {
97
+ action_escrow_total: i128;
132
98
  borrow_index: i128;
133
99
  borrow_index_remainder: i128;
134
- /**
135
- * `INDEX_PRECISION`-scaled bps/day rate for the current interval.
136
- */
137
100
  current_borrow_rate: i128;
138
- execution_budget_total: i128;
139
101
  last_global_checkpoint: u64;
140
- lp_blocked_side_count: u32;
141
102
  open_position_count: u64;
142
103
  pending_receiver_funding_total: i128;
143
104
  position_collateral_total: i128;
144
105
  protocol_claimable_total: i128;
145
- risk_keeper_reserve_total: i128;
106
+ restricted_market_side_count: u32;
107
+ state_version: u32;
146
108
  total_risk_units: i128;
109
+ unclaimed_payout_total: i128;
147
110
  }
148
- export type Key = {
111
+ export type StorageKey = {
149
112
  tag: "ConfigManager";
150
113
  values: void;
151
114
  } | {
152
- tag: "OracleRouter";
115
+ tag: "PriceFeed";
153
116
  values: void;
154
117
  } | {
155
118
  tag: "Vault";
@@ -157,9 +120,6 @@ export type Key = {
157
120
  } | {
158
121
  tag: "GlobalConfig";
159
122
  values: void;
160
- } | {
161
- tag: "Initialized";
162
- values: void;
163
123
  } | {
164
124
  tag: "Paused";
165
125
  values: void;
@@ -184,105 +144,114 @@ export type Key = {
184
144
  } | {
185
145
  tag: "MarketDisabled";
186
146
  values: readonly [string];
147
+ } | {
148
+ tag: "PendingAction";
149
+ values: readonly [u64];
150
+ } | {
151
+ tag: "NextActionId";
152
+ values: void;
153
+ } | {
154
+ tag: "UnclaimedPayout";
155
+ values: readonly [string];
156
+ } | {
157
+ tag: "Governor";
158
+ values: void;
159
+ } | {
160
+ tag: "PriceFeedDecimals";
161
+ values: void;
162
+ };
163
+ export type FeeSource = {
164
+ tag: "Opening";
165
+ values: void;
166
+ } | {
167
+ tag: "Closing";
168
+ values: void;
169
+ } | {
170
+ tag: "Borrow";
171
+ values: void;
172
+ };
173
+ export type CloseReason = {
174
+ tag: "VoluntaryClose";
175
+ values: void;
176
+ } | {
177
+ tag: "TakeProfit";
178
+ values: void;
179
+ } | {
180
+ tag: "StopLoss";
181
+ values: void;
182
+ } | {
183
+ tag: "Liquidation";
184
+ values: void;
185
+ } | {
186
+ tag: "Adl";
187
+ values: void;
187
188
  };
188
189
  /**
189
- * Authoritative per-market state: the side aggregates, the funding indices,
190
- * the funding EMA, and the market configuration.
191
- *
192
- * Soroban limits UDT field names to 30 characters, so where a doc glossary
193
- * term is longer the field drops the redundant qualifier and its doc
194
- * comment carries the full term (e.g. `receiver_backed_index_long` is the
195
- * doc's `receiver_backed_payer_index` for the long side).
190
+ * SEP-40 asset identifier. Markets are quoted as `Other(market symbol)`.
196
191
  */
192
+ export type Asset = {
193
+ tag: "Stellar";
194
+ values: readonly [string];
195
+ } | {
196
+ tag: "Other";
197
+ values: readonly [string];
198
+ };
199
+ export interface PriceData {
200
+ price: i128;
201
+ timestamp: u64;
202
+ }
203
+ export interface StampedPrice {
204
+ observed_at: u64;
205
+ price: i128;
206
+ }
197
207
  export interface Market {
198
208
  config: MarketConfig;
199
- /**
200
- * `INDEX_PRECISION`-scaled bps/day payer rate as of the last refresh.
201
- */
202
209
  current_payer_rate: i128;
203
210
  current_payer_side: PayerSide;
204
211
  last_funding_checkpoint: u64;
205
212
  long: MarketSide;
206
- /**
207
- * Cumulative payer fee per unit of dominant-side size that is LP
208
- * revenue on collection (§8.2).
209
- */
213
+ long_payer_remainders: RemainderGroup;
210
214
  lp_backed_index_long: i128;
211
215
  lp_backed_index_short: i128;
212
- lp_payer_remainder: i128;
213
- /**
214
- * Sub-stroop carry of the receiver-liability accrual (§8.3).
215
- */
216
- pending_remainder: i128;
217
- /**
218
- * Cumulative payer fee per unit of dominant-side size whose collection
219
- * restores cash backing an already-accrued receiver claim (§8.2).
220
- */
216
+ pending_receiver_funding: i128;
221
217
  receiver_backed_index_long: i128;
222
218
  receiver_backed_index_short: i128;
223
- /**
224
- * Cumulative funding credit per unit of light-side size (§8.2).
225
- */
226
219
  receiver_index_long: i128;
227
- receiver_index_remainder: i128;
228
220
  receiver_index_short: i128;
229
- receiver_payer_remainder: i128;
230
221
  short: MarketSide;
231
- /**
232
- * §8.1 signed EMA of the instantaneous skew: a fraction of one at
233
- * `INDEX_PRECISION` scale, positive when history says longs dominate.
234
- * Decays toward the current skew with the global half-life.
235
- */
222
+ short_payer_remainders: RemainderGroup;
236
223
  skew_ema: i128;
237
224
  }
225
+ export type Trigger = {
226
+ tag: "None";
227
+ values: void;
228
+ } | {
229
+ tag: "Attached";
230
+ values: readonly [TriggerInstruction];
231
+ };
238
232
  export interface LpConfig {
239
- lp_request_delay: u64;
233
+ lp_request_delay_seconds: u64;
240
234
  max_withdraw_utilization_bps: u32;
241
235
  min_deposit_nav_factor_bps: u32;
242
236
  }
243
- /**
244
- * Represents a single trader's open leveraged position.
245
- */
246
237
  export interface Position {
247
- /**
248
- * Asset units at `PRICE_PRECISION`.
249
- */
250
238
  base_exposure: i128;
251
- borrow_debt: i128;
252
- /**
253
- * Cash owned by an optional-order executor.
254
- */
255
- execution_budget: i128;
256
- funding_paid_to_lps_debt: i128;
257
- funding_paid_to_receivers_debt: i128;
258
- funding_received_debt: i128;
239
+ borrow_index_snapshot: i128;
259
240
  id: u64;
260
241
  is_long: boolean;
261
- last_increased_time: u64;
242
+ lp_payer_index_snapshot: i128;
262
243
  market: string;
244
+ opened_at: u64;
263
245
  owner: string;
264
- /**
265
- * Fixed gross capacity assigned when risk opens.
266
- */
246
+ pending_mutation_action_id: Option<u64>;
247
+ receiver_index_snapshot: i128;
248
+ receiver_payer_index_snapshot: i128;
267
249
  risk_units: i128;
268
- /**
269
- * USD notional at `PRICE_PRECISION`.
270
- */
271
250
  size: i128;
272
- /**
273
- * Trigger price for the optional stop-loss order; `0` = none.
274
- */
275
- stop_loss: i128;
276
- /**
277
- * Trader-owned collateral recorded in contract state (the doc's
278
- * "stored collateral"). Effective collateral — stored collateral after
279
- * pending fees and funding credits — is always derived, never stored.
280
- */
251
+ stop_loss: Trigger;
281
252
  stored_collateral: i128;
282
- /**
283
- * Trigger price for the optional take-profit order; `0` = none.
284
- */
285
- take_profit: i128;
253
+ stored_minimum_borrow_fee: i128;
254
+ take_profit: Trigger;
286
255
  }
287
256
  export interface LpRequest {
288
257
  amount: i128;
@@ -291,13 +260,12 @@ export interface LpRequest {
291
260
  kind: LpRequestKind;
292
261
  owner: string;
293
262
  request_time: u64;
263
+ /**
264
+ * The resolve reward fixed when the request was made.
265
+ */
266
+ reward: i128;
294
267
  status: LpRequestStatus;
295
268
  }
296
- /**
297
- * Which side currently pays funding (§8.1: the side the blended integral
298
- * skew points at — under the EMA this can be the *lighter* side for a
299
- * while after the book flips). `None` when the blend is exactly zero.
300
- */
301
269
  export type PayerSide = {
302
270
  tag: "None";
303
271
  values: void;
@@ -321,69 +289,67 @@ export type RiskState = {
321
289
  tag: "HardCap";
322
290
  values: void;
323
291
  };
292
+ export type ActionKind = {
293
+ tag: "MarketOpen";
294
+ values: void;
295
+ } | {
296
+ tag: "LimitOpen";
297
+ values: void;
298
+ } | {
299
+ tag: "Decrease";
300
+ values: void;
301
+ } | {
302
+ tag: "Close";
303
+ values: void;
304
+ };
324
305
  export interface MarketSide {
325
306
  base_exposure: i128;
307
+ hard_cap_payout_factor: i128;
308
+ hard_cap_reference_pnl: i128;
326
309
  risk_state: RiskState;
327
310
  risk_units: i128;
328
311
  size_open_interest: i128;
329
312
  stored_collateral_total: i128;
330
313
  }
331
- export interface RoundPrice {
332
- price: i128;
333
- symbol: string;
314
+ export interface OpenPayload {
315
+ acceptable_price: i128;
316
+ expires_at: u64;
317
+ is_long: boolean;
318
+ size: i128;
319
+ stop_loss: i128;
320
+ submitted_collateral: i128;
321
+ take_profit: i128;
334
322
  }
335
- export interface OracleRound {
336
- id: u64;
337
- previous_id: u64;
338
- previous_timestamp: u64;
339
- prices: Array<RoundPrice>;
340
- timestamp: u64;
323
+ export interface ClosePayload {
324
+ acceptable_price: i128;
325
+ position_id: u64;
341
326
  }
342
327
  export interface GlobalConfig {
343
328
  base_borrow_rate_bps_day: i128;
344
- /**
345
- * §8.1 half-life of the funding skew EMA, seconds (global: one memory
346
- * horizon for every market).
347
- */
329
+ borrow_lp_revenue_share_bps: u32;
330
+ config_timelock_seconds: u64;
331
+ fee_lp_revenue_share_bps: u32;
348
332
  funding_half_life_seconds: u64;
349
- hard_cap_factor_limit_bps: u32;
350
- lp_revenue_share_bps: u32;
333
+ global_hard_cap_limit_bps: u32;
334
+ hard_cap_relatch_band_bps: u32;
335
+ keeper_rewards: KeeperRewards;
351
336
  max_active_markets: u32;
352
- max_adl_reward: i128;
353
- max_insolvent_touch_reward: i128;
337
+ max_market_order_lifetime: u64;
338
+ max_order_lifetime_seconds: u64;
339
+ max_price_age_seconds: u64;
354
340
  max_variable_borrow_bps_day: i128;
341
+ min_borrow_fee_seconds: u64;
355
342
  min_collateral: i128;
356
343
  min_position_lifetime: u64;
357
344
  risk_capacity_limit_bps: u32;
358
- risk_keeper_revenue_share_bps: u32;
359
345
  }
360
346
  export interface MarketConfig {
361
347
  adl_pnl_factor_bps: u32;
362
- adl_reward_bps: u32;
363
- /**
364
- * §11.1 closing-fee tier when the close worsens skew.
365
- */
366
- close_fee_high_bps: u32;
367
- /**
368
- * §11.1 closing-fee tier when the close improves or preserves skew.
369
- */
370
- close_fee_low_bps: u32;
348
+ close_pnl_fee_bps: u32;
349
+ close_size_fee_bps: u32;
371
350
  hard_cap_pnl_factor_bps: u32;
372
- /**
373
- * Margin required to open or add risk (§12.3). Divides max leverage:
374
- * a position may not be created closer to liquidation than this.
375
- */
376
351
  initial_margin_bps: u32;
377
- /**
378
- * §8.1 weight of the instantaneous skew in the funding blend, in bps;
379
- * the rest is the half-life EMA. `BPS` reproduces pure instant skew.
380
- */
381
352
  instant_weight_bps: u32;
382
- liquidation_reward_bps: u32;
383
- /**
384
- * Margin below which the position is liquidatable (§12.3). Must not
385
- * exceed `initial_margin_bps`; the gap is the entry buffer.
386
- */
387
353
  maintenance_margin_bps: u32;
388
354
  market_risk_factor_bps: u32;
389
355
  max_funding_rate_bps_day: i128;
@@ -391,37 +357,88 @@ export interface MarketConfig {
391
357
  max_long_size_open_interest: i128;
392
358
  max_short_base_exposure: i128;
393
359
  max_short_size_open_interest: i128;
360
+ open_fee_bps: u32;
361
+ order_execution_delay_seconds: u64;
394
362
  recovery_pnl_factor_bps: u32;
395
363
  warning_pnl_factor_bps: u32;
396
364
  }
397
- /**
398
- * Global safety thresholds for price validation.
399
- */
400
- export interface OracleConfig {
401
- /**
402
- * How long a cached aggregated price remains valid after the router
403
- * fetch (in seconds). A cache hit also requires every source timestamp
404
- * used for the cached median to remain within `staleness_threshold`.
405
- * Must be > 0 and <= `staleness_threshold`.
406
- */
407
- cache_duration: u64;
408
- /**
409
- * Maximum allowed spread between oracle sources in basis points
410
- * (e.g., 100 = 1%). Bounded at `crate::constants::MAX_DEVIATION_BPS_CEILING`.
411
- */
412
- max_deviation_bps: i128;
413
- /**
414
- * Minimum number of source responses that must agree within
415
- * `max_deviation_bps` for OracleRouter to return a price. Floored at
416
- * `crate::constants::MIN_REQUIRED_SOURCES_FLOOR`, ceilinged at
417
- * `crate::constants::MAX_ORACLE_SOURCES`.
418
- */
419
- min_required_sources: u32;
420
- /**
421
- * Maximum age of an external SEP-40 price feed before it is rejected
422
- * as stale (in seconds).
423
- */
424
- staleness_threshold: u64;
365
+ export type ActionOutcome = {
366
+ tag: "Executed";
367
+ values: void;
368
+ } | {
369
+ tag: "Failed";
370
+ values: void;
371
+ } | {
372
+ tag: "Cancelled";
373
+ values: void;
374
+ } | {
375
+ tag: "Expired";
376
+ values: void;
377
+ } | {
378
+ tag: "Superseded";
379
+ values: void;
380
+ } | {
381
+ tag: "NotReady";
382
+ values: void;
383
+ } | {
384
+ tag: "Pending";
385
+ values: void;
386
+ } | {
387
+ tag: "RequiresLiquidation";
388
+ values: void;
389
+ };
390
+ export type ActionPayload = {
391
+ tag: "MarketOpen";
392
+ values: readonly [OpenPayload];
393
+ } | {
394
+ tag: "LimitOpen";
395
+ values: readonly [OpenPayload, TriggerCondition];
396
+ } | {
397
+ tag: "Decrease";
398
+ values: readonly [DecreasePayload];
399
+ } | {
400
+ tag: "Close";
401
+ values: readonly [ClosePayload];
402
+ };
403
+ export type FailureReason = {
404
+ tag: "PriceBoundExceeded";
405
+ values: void;
406
+ } | {
407
+ tag: "CapacityExceeded";
408
+ values: void;
409
+ } | {
410
+ tag: "ExposureCapExceeded";
411
+ values: void;
412
+ } | {
413
+ tag: "SideRestricted";
414
+ values: void;
415
+ } | {
416
+ tag: "InsufficientCollateral";
417
+ values: void;
418
+ } | {
419
+ tag: "UnpayableProfit";
420
+ values: void;
421
+ } | {
422
+ tag: "PositionGone";
423
+ values: void;
424
+ } | {
425
+ tag: "MarketPaused";
426
+ values: void;
427
+ } | {
428
+ tag: "SizeTooSmall";
429
+ values: void;
430
+ };
431
+ export interface KeeperRewards {
432
+ adl: i128;
433
+ close: i128;
434
+ decrease: i128;
435
+ expiry: i128;
436
+ limit_order: i128;
437
+ liquidation: i128;
438
+ lp_resolve: i128;
439
+ open: i128;
440
+ sl: i128;
441
+ tp: i128;
425
442
  }
426
443
  export type LpRequestKind = {
427
444
  tag: "Deposit";
@@ -430,24 +447,35 @@ export type LpRequestKind = {
430
447
  tag: "Withdrawal";
431
448
  values: void;
432
449
  };
433
- /**
434
- * Data required during a WASM migration. Single definition for all contracts.
435
- */
436
450
  export interface MigrationData {
437
451
  version: u32;
438
452
  }
439
- /**
440
- * Pending WASM upgrade — set by `propose_upgrade`, consumed by `upgrade`
441
- * (cleared atomically on a successful install), or cleared by `cancel_upgrade`.
442
- * Single shape across every protocol contract. Contracts store it at
443
- * the shared `pending_upgrade` Symbol key in their own instance storage (see
444
- * `crate::upgrade::pending_upgrade_key`). `upgrade` refuses to install
445
- * unless `pending.wasm_hash` matches the supplied hash and `now >= eta`.
446
- */
453
+ export interface PendingAction {
454
+ action_id: u64;
455
+ commit_observed_at: u64;
456
+ created_at: u64;
457
+ escrowed_collateral: i128;
458
+ execute_after: u64;
459
+ kind: ActionKind;
460
+ market_id: string;
461
+ owner: string;
462
+ payload: ActionPayload;
463
+ }
447
464
  export interface PendingUpgrade {
448
465
  eta: u64;
449
466
  wasm_hash: Buffer;
450
467
  }
468
+ export interface RemainderGroup {
469
+ distribution_remainder: i128;
470
+ lp_payer_remainder: i128;
471
+ receiver_liability_remainder: i128;
472
+ receiver_payer_remainder: i128;
473
+ }
474
+ export interface DecreasePayload {
475
+ acceptable_price: i128;
476
+ position_id: u64;
477
+ size_removed: i128;
478
+ }
451
479
  export type LpRequestStatus = {
452
480
  tag: "Pending";
453
481
  values: void;
@@ -457,15 +485,20 @@ export type LpRequestStatus = {
457
485
  } | {
458
486
  tag: "Failed";
459
487
  values: void;
460
- } | {
461
- tag: "Expired";
462
- values: void;
463
488
  };
489
+ export interface PendingFeesView {
490
+ borrow: i128;
491
+ funding_paid_to_lps: i128;
492
+ funding_paid_to_receivers: i128;
493
+ funding_received: i128;
494
+ }
495
+ export interface PendingPriceFeed {
496
+ effective_at: u64;
497
+ price_feed: string;
498
+ }
464
499
  export interface SettlementResult {
465
- /**
466
- * Shares minted for a deposit or assets paid for a withdrawal.
467
- */
468
500
  amount: i128;
501
+ reward: i128;
469
502
  status: SettlementStatus;
470
503
  }
471
504
  export type SettlementStatus = {
@@ -474,19 +507,49 @@ export type SettlementStatus = {
474
507
  } | {
475
508
  tag: "Failed";
476
509
  values: void;
510
+ } | {
511
+ tag: "NotReady";
512
+ values: void;
477
513
  };
514
+ export interface TriggerCondition {
515
+ trigger_above: boolean;
516
+ trigger_price: i128;
517
+ }
478
518
  export interface AccountingSnapshot {
479
519
  cash_lp_equity: i128;
480
520
  cash_shortfall: i128;
521
+ deleveraging_side_count: u32;
481
522
  free_lp_capital: i128;
482
- lp_blocked_side_count: u32;
523
+ min_equity_clear_of_adl: i128;
483
524
  non_lp_claims: i128;
484
525
  open_position_count: u64;
485
526
  physical_cash: i128;
486
527
  required_risk_backing: i128;
528
+ restricted_side_count: u32;
487
529
  total_risk_units: i128;
488
530
  vault_nav: i128;
489
531
  }
532
+ export interface TriggerInstruction {
533
+ acceptable_price: i128;
534
+ commit_observed_at: u64;
535
+ committed_at: u64;
536
+ execute_after: u64;
537
+ trigger_price: i128;
538
+ }
539
+ export interface PendingGlobalConfig {
540
+ config: GlobalConfig;
541
+ effective_at: u64;
542
+ }
543
+ export interface PendingMarketConfig {
544
+ config: MarketConfig;
545
+ effective_at: u64;
546
+ }
547
+ export interface EventHeader {
548
+ actor: string;
549
+ event_version: u32;
550
+ ledger_timestamp: u64;
551
+ market: string;
552
+ }
490
553
  export declare const UpgradeableError: {
491
554
  /**
492
555
  * When migration is attempted but not allowed due to upgrade state.
@@ -515,16 +578,6 @@ export declare const MerkleDistributorError: {
515
578
  message: string;
516
579
  };
517
580
  };
518
- /**
519
- * Storage keys for the data associated with `MerkleDistributor`
520
- */
521
- export type MerkleDistributorStorageKey = {
522
- tag: "Root";
523
- values: void;
524
- } | {
525
- tag: "Claimed";
526
- values: readonly [u32];
527
- };
528
581
  /**
529
582
  * Rounding direction for division operations
530
583
  */
@@ -552,37 +605,47 @@ export declare const SorobanFixedPointError: {
552
605
  message: string;
553
606
  };
554
607
  };
555
- export declare const CryptoError: {
608
+ export declare const PausableError: {
556
609
  /**
557
- * The merkle proof length is out of bounds.
610
+ * The operation failed because the contract is paused.
558
611
  */
559
- 1400: {
612
+ 1000: {
560
613
  message: string;
561
614
  };
562
615
  /**
563
- * The index of the leaf is out of bounds.
616
+ * The operation failed because the contract is not paused.
564
617
  */
565
- 1401: {
618
+ 1001: {
566
619
  message: string;
567
620
  };
621
+ };
622
+ /**
623
+ * Storage keys for the data associated with `MerkleDistributor`
624
+ */
625
+ export type MerkleDistributorStorageKey = {
626
+ tag: "Root";
627
+ values: void;
628
+ } | {
629
+ tag: "Claimed";
630
+ values: readonly [u32];
631
+ };
632
+ export declare const CryptoError: {
568
633
  /**
569
- * No data in hasher state.
634
+ * The merkle proof length is out of bounds.
570
635
  */
571
- 1402: {
636
+ 1400: {
572
637
  message: string;
573
638
  };
574
- };
575
- export declare const PausableError: {
576
639
  /**
577
- * The operation failed because the contract is paused.
640
+ * The index of the leaf is out of bounds.
578
641
  */
579
- 1000: {
642
+ 1401: {
580
643
  message: string;
581
644
  };
582
645
  /**
583
- * The operation failed because the contract is not paused.
646
+ * No data in hasher state.
584
647
  */
585
- 1001: {
648
+ 1402: {
586
649
  message: string;
587
650
  };
588
651
  };
@@ -621,13 +684,13 @@ export interface Client {
621
684
  operator: string;
622
685
  }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
623
686
  /**
624
- * Construct and simulate a set_tp_sl 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.
687
+ * Construct and simulate a governor 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.
625
688
  */
626
- set_tp_sl: ({ position_id, take_profit, stop_loss }: {
627
- position_id: u64;
628
- take_profit: i128;
629
- stop_loss: i128;
630
- }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
689
+ governor: (options?: MethodOptions) => Promise<AssembledTransaction<string>>;
690
+ /**
691
+ * Construct and simulate a is_paused 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.
692
+ */
693
+ is_paused: (options?: MethodOptions) => Promise<AssembledTransaction<boolean>>;
631
694
  /**
632
695
  * Construct and simulate a set_vault 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.
633
696
  */
@@ -641,6 +704,30 @@ export interface Client {
641
704
  get_market: ({ market }: {
642
705
  market: string;
643
706
  }, options?: MethodOptions) => Promise<AssembledTransaction<Market>>;
707
+ /**
708
+ * Construct and simulate a price_feed 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.
709
+ */
710
+ price_feed: (options?: MethodOptions) => Promise<AssembledTransaction<string>>;
711
+ /**
712
+ * Construct and simulate a execute_adl 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.
713
+ */
714
+ execute_adl: ({ keeper, position_id }: {
715
+ keeper: string;
716
+ position_id: u64;
717
+ }, options?: MethodOptions) => Promise<AssembledTransaction<ActionOutcome>>;
718
+ /**
719
+ * Construct and simulate a claim_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.
720
+ */
721
+ claim_payout: ({ owner }: {
722
+ owner: string;
723
+ }, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
724
+ /**
725
+ * Construct and simulate a create_close 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.
726
+ */
727
+ create_close: ({ position_id, acceptable_price }: {
728
+ position_id: u64;
729
+ acceptable_price: i128;
730
+ }, options?: MethodOptions) => Promise<AssembledTransaction<u64>>;
644
731
  /**
645
732
  * Construct and simulate a get_position 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.
646
733
  */
@@ -655,11 +742,12 @@ export interface Client {
655
742
  amount: i128;
656
743
  }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
657
744
  /**
658
- * Construct and simulate a bump_position 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.
745
+ * Construct and simulate a settle_close 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.
659
746
  */
660
- bump_position: ({ position_id }: {
661
- position_id: u64;
662
- }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
747
+ settle_close: ({ keeper, action_id }: {
748
+ keeper: string;
749
+ action_id: u64;
750
+ }, options?: MethodOptions) => Promise<AssembledTransaction<ActionOutcome>>;
663
751
  /**
664
752
  * Construct and simulate a enable_market 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.
665
753
  */
@@ -667,13 +755,6 @@ export interface Client {
667
755
  caller: string;
668
756
  market: string;
669
757
  }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
670
- /**
671
- * Construct and simulate a execute_order 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.
672
- */
673
- execute_order: ({ caller, position_id }: {
674
- caller: string;
675
- position_id: u64;
676
- }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
677
758
  /**
678
759
  * Construct and simulate a global_config 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.
679
760
  */
@@ -683,23 +764,24 @@ export interface Client {
683
764
  */
684
765
  non_lp_claims: (options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
685
766
  /**
686
- * Construct and simulate a open_position 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.
767
+ * Construct and simulate a set_stop_loss 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.
687
768
  */
688
- open_position: ({ owner, market_symbol, is_long, size, collateral, execution_budget, take_profit, stop_loss, acceptable_price }: {
689
- owner: string;
690
- market_symbol: string;
691
- is_long: boolean;
692
- size: i128;
693
- collateral: i128;
694
- execution_budget: i128;
695
- take_profit: i128;
696
- stop_loss: i128;
769
+ set_stop_loss: ({ position_id, trigger_price, acceptable_price }: {
770
+ position_id: u64;
771
+ trigger_price: i128;
697
772
  acceptable_price: i128;
698
- }, options?: MethodOptions) => Promise<AssembledTransaction<u64>>;
773
+ }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
699
774
  /**
700
775
  * Construct and simulate a active_markets 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.
701
776
  */
702
777
  active_markets: (options?: MethodOptions) => Promise<AssembledTransaction<Array<string>>>;
778
+ /**
779
+ * Construct and simulate a add_collateral 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.
780
+ */
781
+ add_collateral: ({ position_id, amount }: {
782
+ position_id: u64;
783
+ amount: i128;
784
+ }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
703
785
  /**
704
786
  * Construct and simulate a cancel_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.
705
787
  */
@@ -728,6 +810,20 @@ export interface Client {
728
810
  caller: string;
729
811
  market_symbol: string;
730
812
  }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
813
+ /**
814
+ * Construct and simulate a clear_stop_loss 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.
815
+ */
816
+ clear_stop_loss: ({ position_id }: {
817
+ position_id: u64;
818
+ }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
819
+ /**
820
+ * Construct and simulate a create_decrease 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.
821
+ */
822
+ create_decrease: ({ position_id, size_removed, acceptable_price }: {
823
+ position_id: u64;
824
+ size_removed: i128;
825
+ acceptable_price: i128;
826
+ }, options?: MethodOptions) => Promise<AssembledTransaction<u64>>;
731
827
  /**
732
828
  * 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.
733
829
  */
@@ -736,37 +832,90 @@ export interface Client {
736
832
  wasm_hash: Buffer;
737
833
  }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
738
834
  /**
739
- * Construct and simulate a decrease_position 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.
835
+ * Construct and simulate a set_take_profit 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.
740
836
  */
741
- decrease_position: ({ position_id, size_removed, collateral_withdrawn, acceptable_price }: {
837
+ set_take_profit: ({ position_id, trigger_price, acceptable_price }: {
742
838
  position_id: u64;
743
- size_removed: i128;
744
- collateral_withdrawn: i128;
839
+ trigger_price: i128;
745
840
  acceptable_price: i128;
746
841
  }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
747
842
  /**
748
- * Construct and simulate a increase_position 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.
843
+ * Construct and simulate a settle_decrease 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.
844
+ */
845
+ settle_decrease: ({ keeper, action_id }: {
846
+ keeper: string;
847
+ action_id: u64;
848
+ }, options?: MethodOptions) => Promise<AssembledTransaction<ActionOutcome>>;
849
+ /**
850
+ * Construct and simulate a unclaimed_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.
851
+ */
852
+ unclaimed_payout: ({ owner }: {
853
+ owner: string;
854
+ }, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
855
+ /**
856
+ * Construct and simulate a cancel_limit_open 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.
749
857
  */
750
- increase_position: ({ position_id, size_added, collateral_added, acceptable_price }: {
858
+ cancel_limit_open: ({ action_id }: {
859
+ action_id: u64;
860
+ }, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
861
+ /**
862
+ * Construct and simulate a clear_take_profit 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.
863
+ */
864
+ clear_take_profit: ({ position_id }: {
751
865
  position_id: u64;
752
- size_added: i128;
753
- collateral_added: i128;
754
- acceptable_price: i128;
755
866
  }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
756
867
  /**
757
- * Construct and simulate a set_global_config 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.
868
+ * Construct and simulate a create_limit_open 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.
758
869
  */
759
- set_global_config: ({ caller, config }: {
870
+ create_limit_open: ({ owner, market, request, trigger_price }: {
871
+ owner: string;
872
+ market: string;
873
+ request: OpenPayload;
874
+ trigger_price: i128;
875
+ }, options?: MethodOptions) => Promise<AssembledTransaction<u64>>;
876
+ /**
877
+ * Construct and simulate a deregister_market 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.
878
+ */
879
+ deregister_market: ({ caller, actor, market_symbol }: {
760
880
  caller: string;
761
- config: GlobalConfig;
881
+ actor: string;
882
+ market_symbol: string;
762
883
  }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
763
884
  /**
764
- * Construct and simulate a set_market_config 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.
885
+ * Construct and simulate a execute_stop_loss 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.
886
+ */
887
+ execute_stop_loss: ({ keeper, position_id }: {
888
+ keeper: string;
889
+ position_id: u64;
890
+ }, options?: MethodOptions) => Promise<AssembledTransaction<ActionOutcome>>;
891
+ /**
892
+ * Construct and simulate a settle_limit_open 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.
765
893
  */
766
- set_market_config: ({ caller, market_symbol, config }: {
894
+ settle_limit_open: ({ keeper, action_id }: {
895
+ keeper: string;
896
+ action_id: u64;
897
+ }, options?: MethodOptions) => Promise<AssembledTransaction<ActionOutcome>>;
898
+ /**
899
+ * Construct and simulate a create_market_open 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.
900
+ */
901
+ create_market_open: ({ owner, market, request }: {
902
+ owner: string;
903
+ market: string;
904
+ request: OpenPayload;
905
+ }, options?: MethodOptions) => Promise<AssembledTransaction<u64>>;
906
+ /**
907
+ * Construct and simulate a get_pending_action 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.
908
+ */
909
+ get_pending_action: ({ action_id }: {
910
+ action_id: u64;
911
+ }, options?: MethodOptions) => Promise<AssembledTransaction<PendingAction>>;
912
+ /**
913
+ * Construct and simulate a install_price_feed 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.
914
+ */
915
+ install_price_feed: ({ caller, actor, price_feed }: {
767
916
  caller: string;
768
- market_symbol: string;
769
- config: MarketConfig;
917
+ actor: string;
918
+ price_feed: string;
770
919
  }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
771
920
  /**
772
921
  * Construct and simulate a is_market_disabled 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.
@@ -777,30 +926,42 @@ export interface Client {
777
926
  /**
778
927
  * Construct and simulate a liquidate_position 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.
779
928
  */
780
- liquidate_position: ({ caller, position_id }: {
781
- caller: string;
929
+ liquidate_position: ({ keeper, position_id }: {
930
+ keeper: string;
782
931
  position_id: u64;
783
932
  }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
933
+ /**
934
+ * Construct and simulate a settle_market_open 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.
935
+ */
936
+ settle_market_open: ({ keeper, action_id }: {
937
+ keeper: string;
938
+ action_id: u64;
939
+ }, options?: MethodOptions) => Promise<AssembledTransaction<ActionOutcome>>;
784
940
  /**
785
941
  * Construct and simulate a accounting_snapshot 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.
786
942
  */
787
- accounting_snapshot: ({ round, physical }: {
788
- round: OracleRound;
943
+ accounting_snapshot: ({ physical }: {
789
944
  physical: i128;
790
945
  }, options?: MethodOptions) => Promise<AssembledTransaction<AccountingSnapshot>>;
791
946
  /**
792
- * Construct and simulate a deleverage_position 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.
947
+ * Construct and simulate a clean_expired_entry 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.
793
948
  */
794
- deleverage_position: ({ caller, position_id }: {
795
- caller: string;
796
- position_id: u64;
949
+ clean_expired_entry: ({ keeper, action_id }: {
950
+ keeper: string;
951
+ action_id: u64;
797
952
  }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
953
+ /**
954
+ * Construct and simulate a execute_take_profit 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.
955
+ */
956
+ execute_take_profit: ({ keeper, position_id }: {
957
+ keeper: string;
958
+ position_id: u64;
959
+ }, options?: MethodOptions) => Promise<AssembledTransaction<ActionOutcome>>;
798
960
  /**
799
961
  * Construct and simulate a prepare_lp_snapshot 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.
800
962
  */
801
- prepare_lp_snapshot: ({ caller, round, physical }: {
963
+ prepare_lp_snapshot: ({ caller, physical }: {
802
964
  caller: string;
803
- round: OracleRound;
804
965
  physical: i128;
805
966
  }, options?: MethodOptions) => Promise<AssembledTransaction<AccountingSnapshot>>;
806
967
  /**
@@ -811,46 +972,31 @@ export interface Client {
811
972
  physical: i128;
812
973
  }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
813
974
  /**
814
- * Construct and simulate a can_create_lp_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.
975
+ * Construct and simulate a install_global_config 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.
815
976
  */
816
- can_create_lp_request: ({ caller, physical }: {
977
+ install_global_config: ({ caller, actor, config }: {
817
978
  caller: string;
818
- physical: i128;
819
- }, options?: MethodOptions) => Promise<AssembledTransaction<boolean>>;
820
- /**
821
- * Construct and simulate a fund_execution_budget 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.
822
- */
823
- fund_execution_budget: ({ position_id, amount }: {
824
- position_id: u64;
825
- amount: i128;
979
+ actor: string;
980
+ config: GlobalConfig;
826
981
  }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
827
982
  /**
828
- * Construct and simulate a protocol_claimable_total 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.
829
- */
830
- protocol_claimable_total: (options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
831
- /**
832
- * Construct and simulate a risk_keeper_reserve_total 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.
983
+ * Construct and simulate a install_market_config 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.
833
984
  */
834
- risk_keeper_reserve_total: (options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
835
- /**
836
- * Construct and simulate a withdraw_execution_budget 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.
837
- */
838
- withdraw_execution_budget: ({ position_id, amount }: {
839
- position_id: u64;
840
- amount: i128;
985
+ install_market_config: ({ caller, actor, market_symbol, config }: {
986
+ caller: string;
987
+ actor: string;
988
+ market_symbol: string;
989
+ config: MarketConfig;
841
990
  }, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
842
- /**
843
- * Construct and simulate a pending_receiver_funding_total 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.
844
- */
845
- pending_receiver_funding_total: (options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
846
991
  }
847
992
  export declare class Client extends ContractClient {
848
993
  readonly options: ContractClientOptions;
849
994
  static deploy<T = Client>(
850
995
  /** Constructor/Initialization Args for the contract's `__constructor` method */
851
- { config_manager, oracle_router, config }: {
996
+ { config_manager, governor, price_feed, config }: {
852
997
  config_manager: string;
853
- oracle_router: string;
998
+ governor: string;
999
+ price_feed: string;
854
1000
  config: GlobalConfig;
855
1001
  },
856
1002
  /** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
@@ -868,38 +1014,51 @@ export declare class Client extends ContractClient {
868
1014
  migrate: (json: string) => AssembledTransaction<null>;
869
1015
  unpause: (json: string) => AssembledTransaction<null>;
870
1016
  upgrade: (json: string) => AssembledTransaction<null>;
871
- set_tp_sl: (json: string) => AssembledTransaction<null>;
1017
+ governor: (json: string) => AssembledTransaction<string>;
1018
+ is_paused: (json: string) => AssembledTransaction<boolean>;
872
1019
  set_vault: (json: string) => AssembledTransaction<null>;
873
1020
  get_market: (json: string) => AssembledTransaction<Market>;
1021
+ price_feed: (json: string) => AssembledTransaction<string>;
1022
+ execute_adl: (json: string) => AssembledTransaction<ActionOutcome>;
1023
+ claim_payout: (json: string) => AssembledTransaction<bigint>;
1024
+ create_close: (json: string) => AssembledTransaction<bigint>;
874
1025
  get_position: (json: string) => AssembledTransaction<Position>;
875
1026
  recapitalize: (json: string) => AssembledTransaction<null>;
876
- bump_position: (json: string) => AssembledTransaction<null>;
1027
+ settle_close: (json: string) => AssembledTransaction<ActionOutcome>;
877
1028
  enable_market: (json: string) => AssembledTransaction<null>;
878
- execute_order: (json: string) => AssembledTransaction<null>;
879
1029
  global_config: (json: string) => AssembledTransaction<GlobalConfig>;
880
1030
  non_lp_claims: (json: string) => AssembledTransaction<bigint>;
881
- open_position: (json: string) => AssembledTransaction<bigint>;
1031
+ set_stop_loss: (json: string) => AssembledTransaction<null>;
882
1032
  active_markets: (json: string) => AssembledTransaction<string[]>;
1033
+ add_collateral: (json: string) => AssembledTransaction<null>;
883
1034
  cancel_upgrade: (json: string) => AssembledTransaction<null>;
884
1035
  claim_protocol: (json: string) => AssembledTransaction<null>;
885
1036
  disable_market: (json: string) => AssembledTransaction<null>;
886
1037
  update_indices: (json: string) => AssembledTransaction<null>;
1038
+ clear_stop_loss: (json: string) => AssembledTransaction<null>;
1039
+ create_decrease: (json: string) => AssembledTransaction<bigint>;
887
1040
  propose_upgrade: (json: string) => AssembledTransaction<null>;
888
- decrease_position: (json: string) => AssembledTransaction<null>;
889
- increase_position: (json: string) => AssembledTransaction<null>;
890
- set_global_config: (json: string) => AssembledTransaction<null>;
891
- set_market_config: (json: string) => AssembledTransaction<null>;
1041
+ set_take_profit: (json: string) => AssembledTransaction<null>;
1042
+ settle_decrease: (json: string) => AssembledTransaction<ActionOutcome>;
1043
+ unclaimed_payout: (json: string) => AssembledTransaction<bigint>;
1044
+ cancel_limit_open: (json: string) => AssembledTransaction<bigint>;
1045
+ clear_take_profit: (json: string) => AssembledTransaction<null>;
1046
+ create_limit_open: (json: string) => AssembledTransaction<bigint>;
1047
+ deregister_market: (json: string) => AssembledTransaction<null>;
1048
+ execute_stop_loss: (json: string) => AssembledTransaction<ActionOutcome>;
1049
+ settle_limit_open: (json: string) => AssembledTransaction<ActionOutcome>;
1050
+ create_market_open: (json: string) => AssembledTransaction<bigint>;
1051
+ get_pending_action: (json: string) => AssembledTransaction<PendingAction>;
1052
+ install_price_feed: (json: string) => AssembledTransaction<null>;
892
1053
  is_market_disabled: (json: string) => AssembledTransaction<boolean>;
893
1054
  liquidate_position: (json: string) => AssembledTransaction<null>;
1055
+ settle_market_open: (json: string) => AssembledTransaction<ActionOutcome>;
894
1056
  accounting_snapshot: (json: string) => AssembledTransaction<AccountingSnapshot>;
895
- deleverage_position: (json: string) => AssembledTransaction<null>;
1057
+ clean_expired_entry: (json: string) => AssembledTransaction<null>;
1058
+ execute_take_profit: (json: string) => AssembledTransaction<ActionOutcome>;
896
1059
  prepare_lp_snapshot: (json: string) => AssembledTransaction<AccountingSnapshot>;
897
1060
  refresh_borrow_rate: (json: string) => AssembledTransaction<null>;
898
- can_create_lp_request: (json: string) => AssembledTransaction<boolean>;
899
- fund_execution_budget: (json: string) => AssembledTransaction<null>;
900
- protocol_claimable_total: (json: string) => AssembledTransaction<bigint>;
901
- risk_keeper_reserve_total: (json: string) => AssembledTransaction<bigint>;
902
- withdraw_execution_budget: (json: string) => AssembledTransaction<null>;
903
- pending_receiver_funding_total: (json: string) => AssembledTransaction<bigint>;
1061
+ install_global_config: (json: string) => AssembledTransaction<null>;
1062
+ install_market_config: (json: string) => AssembledTransaction<null>;
904
1063
  };
905
1064
  }