@win-trader/bindings 0.0.2 → 0.0.4
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/config-manager/dist/index.d.ts +226 -300
- package/config-manager/dist/index.js +28 -142
- package/mock-token/dist/index.d.ts +1 -1
- package/mock-token/dist/index.js +1 -1
- package/oracle/dist/index.d.ts +222 -88
- package/oracle/dist/index.js +19 -9
- package/oracle-router/dist/index.d.ts +278 -92
- package/oracle-router/dist/index.js +36 -14
- package/package.json +13 -11
- package/position-manager/dist/index.d.ts +441 -245
- package/position-manager/dist/index.js +122 -124
- package/request-router/dist/index.d.ts +546 -0
- package/request-router/dist/index.js +154 -0
- package/vault/dist/index.d.ts +296 -367
- package/vault/dist/index.js +72 -128
package/vault/dist/index.d.ts
CHANGED
|
@@ -29,61 +29,29 @@ export declare const VaultError: {
|
|
|
29
29
|
8: {
|
|
30
30
|
message: string;
|
|
31
31
|
};
|
|
32
|
-
/**
|
|
33
|
-
* Reservation would exceed total vault assets.
|
|
34
|
-
*/
|
|
35
32
|
9: {
|
|
36
33
|
message: string;
|
|
37
34
|
};
|
|
38
35
|
/**
|
|
39
|
-
*
|
|
36
|
+
* `upgrade` called with no pending proposal.
|
|
40
37
|
*/
|
|
41
38
|
10: {
|
|
42
39
|
message: string;
|
|
43
40
|
};
|
|
44
41
|
/**
|
|
45
|
-
* `
|
|
46
|
-
* the supplied `amount` — PM and Vault disagree on what actually moved.
|
|
47
|
-
*/
|
|
48
|
-
12: {
|
|
49
|
-
message: string;
|
|
50
|
-
};
|
|
51
|
-
/**
|
|
52
|
-
* `deposit`/`mint` only accept self-deposits: receiver, from, and operator
|
|
53
|
-
* must all match.
|
|
54
|
-
*/
|
|
55
|
-
13: {
|
|
56
|
-
message: string;
|
|
57
|
-
};
|
|
58
|
-
/**
|
|
59
|
-
* `upgrade` rejected — no `propose_upgrade` was made before commit.
|
|
60
|
-
*/
|
|
61
|
-
14: {
|
|
62
|
-
message: string;
|
|
63
|
-
};
|
|
64
|
-
/**
|
|
65
|
-
* `upgrade` rejected — timelock has not elapsed yet.
|
|
42
|
+
* `upgrade` called before the proposal's timelock eta.
|
|
66
43
|
*/
|
|
67
|
-
|
|
44
|
+
11: {
|
|
68
45
|
message: string;
|
|
69
46
|
};
|
|
70
47
|
/**
|
|
71
|
-
* `upgrade`
|
|
72
|
-
* `PendingUpgrade.wasm_hash`.
|
|
48
|
+
* `upgrade` called with a hash that differs from the proposal.
|
|
73
49
|
*/
|
|
74
|
-
|
|
75
|
-
message: string;
|
|
76
|
-
};
|
|
77
|
-
/**
|
|
78
|
-
* `withdraw`/`redeem` rejected — positions are open and the PM-synced
|
|
79
|
-
* `NetGlobalTraderPnl` is older than `PNL_SYNC_MAX_AGE_SECS`, so
|
|
80
|
-
* `free_liquidity` cannot be trusted to cover open trader profits.
|
|
81
|
-
*/
|
|
82
|
-
17: {
|
|
50
|
+
12: {
|
|
83
51
|
message: string;
|
|
84
52
|
};
|
|
85
53
|
};
|
|
86
|
-
export type
|
|
54
|
+
export type Key = {
|
|
87
55
|
tag: "Initialized";
|
|
88
56
|
values: void;
|
|
89
57
|
} | {
|
|
@@ -93,26 +61,17 @@ export type VaultDataKey = {
|
|
|
93
61
|
tag: "PositionManager";
|
|
94
62
|
values: void;
|
|
95
63
|
} | {
|
|
96
|
-
tag: "
|
|
64
|
+
tag: "RequestRouter";
|
|
97
65
|
values: void;
|
|
98
66
|
} | {
|
|
99
|
-
tag: "
|
|
67
|
+
tag: "LpConfig";
|
|
100
68
|
values: void;
|
|
101
69
|
} | {
|
|
102
|
-
tag: "
|
|
103
|
-
values: void;
|
|
104
|
-
} | {
|
|
105
|
-
tag: "LastPnlSyncTime";
|
|
106
|
-
values: void;
|
|
107
|
-
} | {
|
|
108
|
-
tag: "IsPaused";
|
|
70
|
+
tag: "Paused";
|
|
109
71
|
values: void;
|
|
110
72
|
} | {
|
|
111
73
|
tag: "Version";
|
|
112
74
|
values: void;
|
|
113
|
-
} | {
|
|
114
|
-
tag: "LockupExpiresAt";
|
|
115
|
-
values: readonly [string];
|
|
116
75
|
};
|
|
117
76
|
export interface OwnerTokensKey {
|
|
118
77
|
index: u32;
|
|
@@ -1187,105 +1146,235 @@ export interface AllowanceData {
|
|
|
1187
1146
|
live_until_ledger: u32;
|
|
1188
1147
|
}
|
|
1189
1148
|
/**
|
|
1190
|
-
*
|
|
1149
|
+
* Authoritative per-market state: the side aggregates, the funding indices,
|
|
1150
|
+
* the funding EMA, and the market configuration.
|
|
1151
|
+
*
|
|
1152
|
+
* Soroban limits UDT field names to 30 characters, so where a doc glossary
|
|
1153
|
+
* term is longer the field drops the redundant qualifier and its doc
|
|
1154
|
+
* comment carries the full term (e.g. `receiver_backed_index_long` is the
|
|
1155
|
+
* doc's `receiver_backed_payer_index` for the long side).
|
|
1191
1156
|
*/
|
|
1192
|
-
export interface
|
|
1157
|
+
export interface Market {
|
|
1158
|
+
config: MarketConfig;
|
|
1193
1159
|
/**
|
|
1194
|
-
*
|
|
1160
|
+
* `INDEX_PRECISION`-scaled bps/day payer rate as of the last refresh.
|
|
1195
1161
|
*/
|
|
1196
|
-
|
|
1162
|
+
current_payer_rate: i128;
|
|
1163
|
+
current_payer_side: PayerSide;
|
|
1164
|
+
last_funding_checkpoint: u64;
|
|
1165
|
+
long: MarketSide;
|
|
1197
1166
|
/**
|
|
1198
|
-
*
|
|
1167
|
+
* Cumulative payer fee per unit of dominant-side size that is LP
|
|
1168
|
+
* revenue on collection (§8.2).
|
|
1199
1169
|
*/
|
|
1200
|
-
|
|
1170
|
+
lp_backed_index_long: i128;
|
|
1171
|
+
lp_backed_index_short: i128;
|
|
1172
|
+
lp_payer_remainder: i128;
|
|
1201
1173
|
/**
|
|
1202
|
-
*
|
|
1174
|
+
* Sub-stroop carry of the receiver-liability accrual (§8.3).
|
|
1203
1175
|
*/
|
|
1204
|
-
|
|
1176
|
+
pending_remainder: i128;
|
|
1205
1177
|
/**
|
|
1206
|
-
*
|
|
1178
|
+
* Cumulative payer fee per unit of dominant-side size whose collection
|
|
1179
|
+
* restores cash backing an already-accrued receiver claim (§8.2).
|
|
1207
1180
|
*/
|
|
1208
|
-
|
|
1181
|
+
receiver_backed_index_long: i128;
|
|
1182
|
+
receiver_backed_index_short: i128;
|
|
1209
1183
|
/**
|
|
1210
|
-
*
|
|
1184
|
+
* Cumulative funding credit per unit of light-side size (§8.2).
|
|
1211
1185
|
*/
|
|
1212
|
-
|
|
1186
|
+
receiver_index_long: i128;
|
|
1187
|
+
receiver_index_remainder: i128;
|
|
1188
|
+
receiver_index_short: i128;
|
|
1189
|
+
receiver_payer_remainder: i128;
|
|
1190
|
+
short: MarketSide;
|
|
1191
|
+
/**
|
|
1192
|
+
* §8.1 signed EMA of the instantaneous skew: a fraction of one at
|
|
1193
|
+
* `INDEX_PRECISION` scale, positive when history says longs dominate.
|
|
1194
|
+
* Decays toward the current skew with the global half-life.
|
|
1195
|
+
*/
|
|
1196
|
+
skew_ema: i128;
|
|
1197
|
+
}
|
|
1198
|
+
export interface LpConfig {
|
|
1199
|
+
lp_request_delay: u64;
|
|
1200
|
+
max_withdraw_utilization_bps: u32;
|
|
1201
|
+
min_deposit_nav_factor_bps: u32;
|
|
1202
|
+
}
|
|
1203
|
+
/**
|
|
1204
|
+
* Represents a single trader's open leveraged position.
|
|
1205
|
+
*/
|
|
1206
|
+
export interface Position {
|
|
1213
1207
|
/**
|
|
1214
|
-
*
|
|
1208
|
+
* Asset units at `PRICE_PRECISION`.
|
|
1215
1209
|
*/
|
|
1216
|
-
|
|
1210
|
+
base_exposure: i128;
|
|
1211
|
+
borrow_debt: i128;
|
|
1217
1212
|
/**
|
|
1218
|
-
*
|
|
1213
|
+
* Cash owned by an optional-order executor.
|
|
1219
1214
|
*/
|
|
1215
|
+
execution_budget: i128;
|
|
1216
|
+
funding_paid_to_lps_debt: i128;
|
|
1217
|
+
funding_paid_to_receivers_debt: i128;
|
|
1218
|
+
funding_received_debt: i128;
|
|
1219
|
+
id: u64;
|
|
1220
|
+
is_long: boolean;
|
|
1220
1221
|
last_increased_time: u64;
|
|
1222
|
+
market: string;
|
|
1223
|
+
owner: string;
|
|
1224
|
+
/**
|
|
1225
|
+
* Fixed gross capacity assigned when risk opens.
|
|
1226
|
+
*/
|
|
1227
|
+
risk_units: i128;
|
|
1221
1228
|
/**
|
|
1222
|
-
*
|
|
1229
|
+
* USD notional at `PRICE_PRECISION`.
|
|
1223
1230
|
*/
|
|
1224
1231
|
size: i128;
|
|
1225
1232
|
/**
|
|
1226
|
-
*
|
|
1233
|
+
* Trigger price for the optional stop-loss order; `0` = none.
|
|
1227
1234
|
*/
|
|
1228
1235
|
stop_loss: i128;
|
|
1229
1236
|
/**
|
|
1230
|
-
*
|
|
1237
|
+
* Trader-owned collateral recorded in contract state (the doc's
|
|
1238
|
+
* "stored collateral"). Effective collateral — stored collateral after
|
|
1239
|
+
* pending fees and funding credits — is always derived, never stored.
|
|
1240
|
+
*/
|
|
1241
|
+
stored_collateral: i128;
|
|
1242
|
+
/**
|
|
1243
|
+
* Trigger price for the optional take-profit order; `0` = none.
|
|
1231
1244
|
*/
|
|
1232
1245
|
take_profit: i128;
|
|
1233
1246
|
}
|
|
1247
|
+
export interface LpRequest {
|
|
1248
|
+
amount: i128;
|
|
1249
|
+
execute_after: u64;
|
|
1250
|
+
id: u64;
|
|
1251
|
+
kind: LpRequestKind;
|
|
1252
|
+
owner: string;
|
|
1253
|
+
request_time: u64;
|
|
1254
|
+
status: LpRequestStatus;
|
|
1255
|
+
}
|
|
1234
1256
|
/**
|
|
1235
|
-
*
|
|
1257
|
+
* Which side currently pays funding (§8.1: the side the blended integral
|
|
1258
|
+
* skew points at — under the EMA this can be the *lighter* side for a
|
|
1259
|
+
* while after the book flips). `None` when the blend is exactly zero.
|
|
1236
1260
|
*/
|
|
1237
|
-
export
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1261
|
+
export type PayerSide = {
|
|
1262
|
+
tag: "None";
|
|
1263
|
+
values: void;
|
|
1264
|
+
} | {
|
|
1265
|
+
tag: "Long";
|
|
1266
|
+
values: void;
|
|
1267
|
+
} | {
|
|
1268
|
+
tag: "Short";
|
|
1269
|
+
values: void;
|
|
1270
|
+
};
|
|
1271
|
+
export type RiskState = {
|
|
1272
|
+
tag: "Normal";
|
|
1273
|
+
values: void;
|
|
1274
|
+
} | {
|
|
1275
|
+
tag: "Warning";
|
|
1276
|
+
values: void;
|
|
1277
|
+
} | {
|
|
1278
|
+
tag: "Adl";
|
|
1279
|
+
values: void;
|
|
1280
|
+
} | {
|
|
1281
|
+
tag: "HardCap";
|
|
1282
|
+
values: void;
|
|
1283
|
+
};
|
|
1284
|
+
export interface MarketSide {
|
|
1285
|
+
base_exposure: i128;
|
|
1286
|
+
risk_state: RiskState;
|
|
1287
|
+
risk_units: i128;
|
|
1288
|
+
size_open_interest: i128;
|
|
1289
|
+
stored_collateral_total: i128;
|
|
1290
|
+
}
|
|
1291
|
+
export interface RoundPrice {
|
|
1292
|
+
price: i128;
|
|
1293
|
+
symbol: string;
|
|
1294
|
+
}
|
|
1295
|
+
export interface OracleRound {
|
|
1296
|
+
id: u64;
|
|
1297
|
+
previous_id: u64;
|
|
1298
|
+
previous_timestamp: u64;
|
|
1299
|
+
prices: Array<RoundPrice>;
|
|
1300
|
+
timestamp: u64;
|
|
1301
|
+
}
|
|
1302
|
+
export interface GlobalConfig {
|
|
1303
|
+
base_borrow_rate_bps_day: i128;
|
|
1242
1304
|
/**
|
|
1243
|
-
*
|
|
1305
|
+
* §8.1 half-life of the funding skew EMA, seconds (global: one memory
|
|
1306
|
+
* horizon for every market).
|
|
1244
1307
|
*/
|
|
1245
|
-
|
|
1308
|
+
funding_half_life_seconds: u64;
|
|
1309
|
+
hard_cap_factor_limit_bps: u32;
|
|
1310
|
+
lp_revenue_share_bps: u32;
|
|
1311
|
+
max_active_markets: u32;
|
|
1312
|
+
max_adl_reward: i128;
|
|
1313
|
+
max_insolvent_touch_reward: i128;
|
|
1314
|
+
max_variable_borrow_bps_day: i128;
|
|
1315
|
+
min_collateral: i128;
|
|
1316
|
+
min_position_lifetime: u64;
|
|
1317
|
+
risk_capacity_limit_bps: u32;
|
|
1318
|
+
risk_keeper_revenue_share_bps: u32;
|
|
1319
|
+
}
|
|
1320
|
+
export interface MarketConfig {
|
|
1321
|
+
adl_pnl_factor_bps: u32;
|
|
1322
|
+
adl_reward_bps: u32;
|
|
1246
1323
|
/**
|
|
1247
|
-
*
|
|
1324
|
+
* §11.1 closing-fee tier when the close worsens skew.
|
|
1248
1325
|
*/
|
|
1249
|
-
|
|
1326
|
+
close_fee_high_bps: u32;
|
|
1250
1327
|
/**
|
|
1251
|
-
*
|
|
1328
|
+
* §11.1 closing-fee tier when the close improves or preserves skew.
|
|
1252
1329
|
*/
|
|
1253
|
-
|
|
1330
|
+
close_fee_low_bps: u32;
|
|
1331
|
+
hard_cap_pnl_factor_bps: u32;
|
|
1254
1332
|
/**
|
|
1255
|
-
*
|
|
1333
|
+
* Margin required to open or add risk (§12.3). Divides max leverage:
|
|
1334
|
+
* a position may not be created closer to liquidation than this.
|
|
1256
1335
|
*/
|
|
1257
|
-
|
|
1336
|
+
initial_margin_bps: u32;
|
|
1258
1337
|
/**
|
|
1259
|
-
*
|
|
1338
|
+
* §8.1 weight of the instantaneous skew in the funding blend, in bps;
|
|
1339
|
+
* the rest is the half-life EMA. `BPS` reproduces pure instant skew.
|
|
1260
1340
|
*/
|
|
1261
|
-
|
|
1341
|
+
instant_weight_bps: u32;
|
|
1342
|
+
liquidation_reward_bps: u32;
|
|
1262
1343
|
/**
|
|
1263
|
-
*
|
|
1344
|
+
* Margin below which the position is liquidatable (§12.3). Must not
|
|
1345
|
+
* exceed `initial_margin_bps`; the gap is the entry buffer.
|
|
1264
1346
|
*/
|
|
1265
|
-
|
|
1347
|
+
maintenance_margin_bps: u32;
|
|
1348
|
+
market_risk_factor_bps: u32;
|
|
1349
|
+
max_funding_rate_bps_day: i128;
|
|
1350
|
+
max_long_base_exposure: i128;
|
|
1351
|
+
max_long_size_open_interest: i128;
|
|
1352
|
+
max_short_base_exposure: i128;
|
|
1353
|
+
max_short_size_open_interest: i128;
|
|
1354
|
+
recovery_pnl_factor_bps: u32;
|
|
1355
|
+
warning_pnl_factor_bps: u32;
|
|
1266
1356
|
}
|
|
1267
1357
|
/**
|
|
1268
1358
|
* Global safety thresholds for price validation.
|
|
1269
1359
|
*/
|
|
1270
1360
|
export interface OracleConfig {
|
|
1271
1361
|
/**
|
|
1272
|
-
* How long a cached aggregated price remains valid
|
|
1273
|
-
*
|
|
1274
|
-
*
|
|
1275
|
-
*
|
|
1276
|
-
* source price and serve stale data).
|
|
1362
|
+
* How long a cached aggregated price remains valid after the router
|
|
1363
|
+
* fetch (in seconds). A cache hit also requires every source timestamp
|
|
1364
|
+
* used for the cached median to remain within `staleness_threshold`.
|
|
1365
|
+
* Must be > 0 and <= `staleness_threshold`.
|
|
1277
1366
|
*/
|
|
1278
1367
|
cache_duration: u64;
|
|
1279
1368
|
/**
|
|
1280
1369
|
* Maximum allowed spread between oracle sources in basis points
|
|
1281
|
-
* (e.g., 100 = 1%). Bounded at `
|
|
1370
|
+
* (e.g., 100 = 1%). Bounded at `crate::constants::MAX_DEVIATION_BPS_CEILING`.
|
|
1282
1371
|
*/
|
|
1283
1372
|
max_deviation_bps: i128;
|
|
1284
1373
|
/**
|
|
1285
1374
|
* Minimum number of source responses that must agree within
|
|
1286
1375
|
* `max_deviation_bps` for OracleRouter to return a price. Floored at
|
|
1287
|
-
* `
|
|
1288
|
-
* `
|
|
1376
|
+
* `crate::constants::MIN_REQUIRED_SOURCES_FLOOR`, ceilinged at
|
|
1377
|
+
* `crate::constants::MAX_ORACLE_SOURCES`.
|
|
1289
1378
|
*/
|
|
1290
1379
|
min_required_sources: u32;
|
|
1291
1380
|
/**
|
|
@@ -1294,6 +1383,13 @@ export interface OracleConfig {
|
|
|
1294
1383
|
*/
|
|
1295
1384
|
staleness_threshold: u64;
|
|
1296
1385
|
}
|
|
1386
|
+
export type LpRequestKind = {
|
|
1387
|
+
tag: "Deposit";
|
|
1388
|
+
values: void;
|
|
1389
|
+
} | {
|
|
1390
|
+
tag: "Withdrawal";
|
|
1391
|
+
values: void;
|
|
1392
|
+
};
|
|
1297
1393
|
/**
|
|
1298
1394
|
* Data required during a WASM migration. Single definition for all contracts.
|
|
1299
1395
|
*/
|
|
@@ -1303,15 +1399,54 @@ export interface MigrationData {
|
|
|
1303
1399
|
/**
|
|
1304
1400
|
* Pending WASM upgrade — set by `propose_upgrade`, consumed by `upgrade`
|
|
1305
1401
|
* (cleared atomically on a successful install), or cleared by `cancel_upgrade`.
|
|
1306
|
-
* Single shape across every protocol contract
|
|
1402
|
+
* Single shape across every protocol contract. Contracts store it at
|
|
1307
1403
|
* the shared `pending_upgrade` Symbol key in their own instance storage (see
|
|
1308
|
-
* `
|
|
1404
|
+
* `crate::upgrade::pending_upgrade_key`). `upgrade` refuses to install
|
|
1309
1405
|
* unless `pending.wasm_hash` matches the supplied hash and `now >= eta`.
|
|
1310
1406
|
*/
|
|
1311
1407
|
export interface PendingUpgrade {
|
|
1312
1408
|
eta: u64;
|
|
1313
1409
|
wasm_hash: Buffer;
|
|
1314
1410
|
}
|
|
1411
|
+
export type LpRequestStatus = {
|
|
1412
|
+
tag: "Pending";
|
|
1413
|
+
values: void;
|
|
1414
|
+
} | {
|
|
1415
|
+
tag: "Settled";
|
|
1416
|
+
values: void;
|
|
1417
|
+
} | {
|
|
1418
|
+
tag: "Failed";
|
|
1419
|
+
values: void;
|
|
1420
|
+
} | {
|
|
1421
|
+
tag: "Expired";
|
|
1422
|
+
values: void;
|
|
1423
|
+
};
|
|
1424
|
+
export interface SettlementResult {
|
|
1425
|
+
/**
|
|
1426
|
+
* Shares minted for a deposit or assets paid for a withdrawal.
|
|
1427
|
+
*/
|
|
1428
|
+
amount: i128;
|
|
1429
|
+
status: SettlementStatus;
|
|
1430
|
+
}
|
|
1431
|
+
export type SettlementStatus = {
|
|
1432
|
+
tag: "Settled";
|
|
1433
|
+
values: void;
|
|
1434
|
+
} | {
|
|
1435
|
+
tag: "Failed";
|
|
1436
|
+
values: void;
|
|
1437
|
+
};
|
|
1438
|
+
export interface AccountingSnapshot {
|
|
1439
|
+
cash_lp_equity: i128;
|
|
1440
|
+
cash_shortfall: i128;
|
|
1441
|
+
free_lp_capital: i128;
|
|
1442
|
+
lp_blocked_side_count: u32;
|
|
1443
|
+
non_lp_claims: i128;
|
|
1444
|
+
open_position_count: u64;
|
|
1445
|
+
physical_cash: i128;
|
|
1446
|
+
required_risk_backing: i128;
|
|
1447
|
+
total_risk_units: i128;
|
|
1448
|
+
vault_nav: i128;
|
|
1449
|
+
}
|
|
1315
1450
|
export declare const UpgradeableError: {
|
|
1316
1451
|
/**
|
|
1317
1452
|
* When migration is attempted but not allowed due to upgrade state.
|
|
@@ -1418,58 +1553,7 @@ export type PausableStorageKey = {
|
|
|
1418
1553
|
tag: "Paused";
|
|
1419
1554
|
values: void;
|
|
1420
1555
|
};
|
|
1421
|
-
/**
|
|
1422
|
-
* Execution-bounty and open-fee parameters charged to traders.
|
|
1423
|
-
* `open_fee_bps` and `liquidation_bounty_bps` are in basis points;
|
|
1424
|
-
* `tp_sl_execution_fee` is a flat USDC amount at PRECISION scale.
|
|
1425
|
-
*/
|
|
1426
|
-
export interface FeeConfig {
|
|
1427
|
-
liquidation_bounty_bps: u32;
|
|
1428
|
-
open_fee_bps: u32;
|
|
1429
|
-
tp_sl_execution_fee: i128;
|
|
1430
|
-
}
|
|
1431
|
-
/**
|
|
1432
|
-
* Defines how protocol revenue is split between parties.
|
|
1433
|
-
* All values are in basis points (bps). Must sum to 10_000.
|
|
1434
|
-
*/
|
|
1435
|
-
export interface FeeSplits {
|
|
1436
|
-
dev_bps: u32;
|
|
1437
|
-
lp_bps: u32;
|
|
1438
|
-
staker_bps: u32;
|
|
1439
|
-
}
|
|
1440
|
-
/**
|
|
1441
|
-
* Global protocol risk and timing parameters.
|
|
1442
|
-
*/
|
|
1443
|
-
export interface ProtocolLimits {
|
|
1444
|
-
adl_pnl_bps: u32;
|
|
1445
|
-
adl_utilization_bps: u32;
|
|
1446
|
-
cooldown_duration: u64;
|
|
1447
|
-
funding_cut_bps: u32;
|
|
1448
|
-
liquidation_threshold_bps: u32;
|
|
1449
|
-
max_utilization_ratio: i128;
|
|
1450
|
-
min_collateral: i128;
|
|
1451
|
-
min_position_lifetime: u64;
|
|
1452
|
-
}
|
|
1453
|
-
/**
|
|
1454
|
-
* Borrow rate kink curve and funding rate parameters (all in basis points).
|
|
1455
|
-
*/
|
|
1456
|
-
export interface BorrowRateConfig {
|
|
1457
|
-
base_borrow_rate_bps: i128;
|
|
1458
|
-
base_funding_rate_bps: i128;
|
|
1459
|
-
optimal_utilization_bps: i128;
|
|
1460
|
-
slope1_bps: i128;
|
|
1461
|
-
slope2_bps: i128;
|
|
1462
|
-
}
|
|
1463
1556
|
export interface Client {
|
|
1464
|
-
/**
|
|
1465
|
-
* Construct and simulate a mint 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.
|
|
1466
|
-
*/
|
|
1467
|
-
mint: ({ shares, receiver, from, operator }: {
|
|
1468
|
-
shares: i128;
|
|
1469
|
-
receiver: string;
|
|
1470
|
-
from: string;
|
|
1471
|
-
operator: string;
|
|
1472
|
-
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1473
1557
|
/**
|
|
1474
1558
|
* Construct and simulate a name 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.
|
|
1475
1559
|
* Returns the name for this token.
|
|
@@ -1485,15 +1569,6 @@ export interface Client {
|
|
|
1485
1569
|
pause: ({ caller }: {
|
|
1486
1570
|
caller: string;
|
|
1487
1571
|
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1488
|
-
/**
|
|
1489
|
-
* Construct and simulate a redeem 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.
|
|
1490
|
-
*/
|
|
1491
|
-
redeem: ({ shares, receiver, owner, operator }: {
|
|
1492
|
-
shares: i128;
|
|
1493
|
-
receiver: string;
|
|
1494
|
-
owner: string;
|
|
1495
|
-
operator: string;
|
|
1496
|
-
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1497
1572
|
/**
|
|
1498
1573
|
* Construct and simulate a symbol 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.
|
|
1499
1574
|
* Returns the symbol for this token.
|
|
@@ -1548,20 +1623,11 @@ export interface Client {
|
|
|
1548
1623
|
balance: ({ account }: {
|
|
1549
1624
|
account: string;
|
|
1550
1625
|
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1551
|
-
/**
|
|
1552
|
-
* Construct and simulate a deposit 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.
|
|
1553
|
-
*/
|
|
1554
|
-
deposit: ({ assets, receiver, from, operator }: {
|
|
1555
|
-
assets: i128;
|
|
1556
|
-
receiver: string;
|
|
1557
|
-
from: string;
|
|
1558
|
-
operator: string;
|
|
1559
|
-
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1560
1626
|
/**
|
|
1561
1627
|
* Construct and simulate a migrate 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.
|
|
1562
1628
|
*/
|
|
1563
|
-
migrate: ({
|
|
1564
|
-
|
|
1629
|
+
migrate: ({ data, operator }: {
|
|
1630
|
+
data: MigrationData;
|
|
1565
1631
|
operator: string;
|
|
1566
1632
|
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1567
1633
|
/**
|
|
@@ -1581,34 +1647,14 @@ export interface Client {
|
|
|
1581
1647
|
* Construct and simulate a decimals 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.
|
|
1582
1648
|
*/
|
|
1583
1649
|
decimals: (options?: MethodOptions) => Promise<AssembledTransaction<u32>>;
|
|
1584
|
-
/**
|
|
1585
|
-
* Construct and simulate a max_mint 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.
|
|
1586
|
-
*/
|
|
1587
|
-
max_mint: ({ receiver }: {
|
|
1588
|
-
receiver: string;
|
|
1589
|
-
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1590
1650
|
/**
|
|
1591
1651
|
* Construct and simulate a transfer 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.
|
|
1592
|
-
* Override to propagate the sender's remaining lockup onto a recipient
|
|
1593
|
-
* who held no shares before the transfer. Without this, an LP could
|
|
1594
|
-
* circumvent the cooldown by transferring LP shares to a fresh address
|
|
1595
|
-
* that then withdraws. Recipients with an existing balance keep their
|
|
1596
|
-
* own expiry — see `propagate_lockup_on_transfer`.
|
|
1597
1652
|
*/
|
|
1598
1653
|
transfer: ({ from, to, amount }: {
|
|
1599
1654
|
from: string;
|
|
1600
1655
|
to: string;
|
|
1601
1656
|
amount: i128;
|
|
1602
1657
|
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1603
|
-
/**
|
|
1604
|
-
* Construct and simulate a withdraw 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.
|
|
1605
|
-
*/
|
|
1606
|
-
withdraw: ({ assets, receiver, owner, operator }: {
|
|
1607
|
-
assets: i128;
|
|
1608
|
-
receiver: string;
|
|
1609
|
-
owner: string;
|
|
1610
|
-
operator: string;
|
|
1611
|
-
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1612
1658
|
/**
|
|
1613
1659
|
* Construct and simulate a allowance 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.
|
|
1614
1660
|
* Returns the amount of tokens a `spender` is allowed to spend on behalf
|
|
@@ -1624,74 +1670,10 @@ export interface Client {
|
|
|
1624
1670
|
owner: string;
|
|
1625
1671
|
spender: string;
|
|
1626
1672
|
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1627
|
-
/**
|
|
1628
|
-
* Construct and simulate a claim_fees 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.
|
|
1629
|
-
*/
|
|
1630
|
-
claim_fees: ({ caller, recipient }: {
|
|
1631
|
-
caller: string;
|
|
1632
|
-
recipient: string;
|
|
1633
|
-
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1634
|
-
/**
|
|
1635
|
-
* Construct and simulate a max_redeem 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.
|
|
1636
|
-
*/
|
|
1637
|
-
max_redeem: ({ owner }: {
|
|
1638
|
-
owner: string;
|
|
1639
|
-
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1640
|
-
/**
|
|
1641
|
-
* Construct and simulate a pay_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.
|
|
1642
|
-
* Pay `amount` from the vault to `trader` to settle a profitable close.
|
|
1643
|
-
* Loss settlement does NOT route through here — see ADR-0001.
|
|
1644
|
-
*/
|
|
1645
|
-
pay_profit: ({ caller, trader, amount }: {
|
|
1646
|
-
caller: string;
|
|
1647
|
-
trader: string;
|
|
1648
|
-
amount: i128;
|
|
1649
|
-
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1650
|
-
/**
|
|
1651
|
-
* Construct and simulate a accrue_fees 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.
|
|
1652
|
-
* Books PM-pushed revenue into `unclaimed_fees`, clamped so
|
|
1653
|
-
* `unclaimed_fees + reserved_usdc` never exceeds `total_assets` — fee
|
|
1654
|
-
* claims can only ever be tagged against capital the vault holds. A
|
|
1655
|
-
* clamped accrual emits `FeeAccrualClamped` for monitoring instead of
|
|
1656
|
-
* reverting: this runs inside PM's close/liquidation paths, which must
|
|
1657
|
-
* never fail on fee bookkeeping.
|
|
1658
|
-
*
|
|
1659
|
-
* Emits `TotalAssetsUpdate` alongside `AccrueFees`. PM's `recv_revenue`
|
|
1660
|
-
* pushes fee USDC into the vault via a raw token transfer immediately
|
|
1661
|
-
* before this call, and no other vault entrypoint witnesses that
|
|
1662
|
-
* transfer — without the snapshot, off-chain indexers would lose the
|
|
1663
|
-
* LP slice (`fee - non_lp_slice`) on every accrual.
|
|
1664
|
-
*/
|
|
1665
|
-
accrue_fees: ({ caller, amount }: {
|
|
1666
|
-
caller: string;
|
|
1667
|
-
amount: i128;
|
|
1668
|
-
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1669
|
-
/**
|
|
1670
|
-
* Construct and simulate a max_deposit 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.
|
|
1671
|
-
*/
|
|
1672
|
-
max_deposit: ({ receiver }: {
|
|
1673
|
-
receiver: string;
|
|
1674
|
-
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1675
1673
|
/**
|
|
1676
1674
|
* Construct and simulate a query_asset 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.
|
|
1677
1675
|
*/
|
|
1678
1676
|
query_asset: (options?: MethodOptions) => Promise<AssembledTransaction<string>>;
|
|
1679
|
-
/**
|
|
1680
|
-
* Construct and simulate a max_withdraw 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.
|
|
1681
|
-
*/
|
|
1682
|
-
max_withdraw: ({ owner }: {
|
|
1683
|
-
owner: string;
|
|
1684
|
-
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1685
|
-
/**
|
|
1686
|
-
* Construct and simulate a preview_mint 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.
|
|
1687
|
-
*/
|
|
1688
|
-
preview_mint: ({ shares }: {
|
|
1689
|
-
shares: i128;
|
|
1690
|
-
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1691
|
-
/**
|
|
1692
|
-
* Construct and simulate a total_assets 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.
|
|
1693
|
-
*/
|
|
1694
|
-
total_assets: (options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1695
1677
|
/**
|
|
1696
1678
|
* Construct and simulate a total_supply 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.
|
|
1697
1679
|
* Returns the total amount of tokens in circulation.
|
|
@@ -1702,20 +1684,22 @@ export interface Client {
|
|
|
1702
1684
|
*/
|
|
1703
1685
|
total_supply: (options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1704
1686
|
/**
|
|
1705
|
-
* Construct and simulate a
|
|
1687
|
+
* Construct and simulate a get_lp_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.
|
|
1706
1688
|
*/
|
|
1707
|
-
|
|
1708
|
-
caller: string;
|
|
1709
|
-
recipient: string;
|
|
1710
|
-
amount: i128;
|
|
1711
|
-
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1689
|
+
get_lp_config: (options?: MethodOptions) => Promise<AssembledTransaction<LpConfig>>;
|
|
1712
1690
|
/**
|
|
1713
|
-
* Construct and simulate a
|
|
1691
|
+
* Construct and simulate a physical_cash 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.
|
|
1714
1692
|
*/
|
|
1715
|
-
|
|
1693
|
+
physical_cash: (options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1694
|
+
/**
|
|
1695
|
+
* Construct and simulate a set_lp_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.
|
|
1696
|
+
*/
|
|
1697
|
+
set_lp_config: ({ caller, config }: {
|
|
1698
|
+
caller: string;
|
|
1699
|
+
config: LpConfig;
|
|
1700
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1716
1701
|
/**
|
|
1717
1702
|
* Construct and simulate a transfer_from 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.
|
|
1718
|
-
* Same lockup-propagation guarantee for the allowance-based path.
|
|
1719
1703
|
*/
|
|
1720
1704
|
transfer_from: ({ spender, from, to, amount }: {
|
|
1721
1705
|
spender: string;
|
|
@@ -1725,46 +1709,30 @@ export interface Client {
|
|
|
1725
1709
|
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1726
1710
|
/**
|
|
1727
1711
|
* 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.
|
|
1728
|
-
* PAUSER veto of a pending upgrade.
|
|
1729
1712
|
*/
|
|
1730
1713
|
cancel_upgrade: ({ caller }: {
|
|
1731
1714
|
caller: string;
|
|
1732
1715
|
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1733
1716
|
/**
|
|
1734
|
-
* Construct and simulate a
|
|
1735
|
-
*/
|
|
1736
|
-
free_liquidity: (options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1737
|
-
/**
|
|
1738
|
-
* Construct and simulate a preview_redeem 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.
|
|
1717
|
+
* Construct and simulate a settle_deposit 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.
|
|
1739
1718
|
*/
|
|
1740
|
-
|
|
1741
|
-
|
|
1742
|
-
|
|
1743
|
-
|
|
1744
|
-
|
|
1745
|
-
|
|
1746
|
-
* so tests can reconcile counter movement against token-side transfers
|
|
1747
|
-
* without inferring via subtraction.
|
|
1748
|
-
*/
|
|
1749
|
-
unclaimed_fees: (options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1719
|
+
settle_deposit: ({ caller, owner, assets, round }: {
|
|
1720
|
+
caller: string;
|
|
1721
|
+
owner: string;
|
|
1722
|
+
assets: i128;
|
|
1723
|
+
round: OracleRound;
|
|
1724
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<SettlementResult>>;
|
|
1750
1725
|
/**
|
|
1751
|
-
* Construct and simulate a
|
|
1726
|
+
* Construct and simulate a transfer_claim 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.
|
|
1752
1727
|
*/
|
|
1753
|
-
|
|
1728
|
+
transfer_claim: ({ caller, recipient, amount, claims_after }: {
|
|
1754
1729
|
caller: string;
|
|
1755
|
-
|
|
1730
|
+
recipient: string;
|
|
1731
|
+
amount: i128;
|
|
1732
|
+
claims_after: i128;
|
|
1756
1733
|
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1757
|
-
/**
|
|
1758
|
-
* Construct and simulate a preview_deposit 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.
|
|
1759
|
-
*/
|
|
1760
|
-
preview_deposit: ({ assets }: {
|
|
1761
|
-
assets: i128;
|
|
1762
|
-
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1763
1734
|
/**
|
|
1764
1735
|
* 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.
|
|
1765
|
-
* Propose a WASM upgrade. UPGRADER role only. Records `{wasm_hash, eta}`
|
|
1766
|
-
* where `eta = now + timelock` so `upgrade` can refuse to install a
|
|
1767
|
-
* different hash or fire before `eta`.
|
|
1768
1736
|
*/
|
|
1769
1737
|
propose_upgrade: ({ caller, wasm_hash }: {
|
|
1770
1738
|
caller: string;
|
|
@@ -1775,83 +1743,61 @@ export interface Client {
|
|
|
1775
1743
|
*/
|
|
1776
1744
|
bump_vault_state: (options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1777
1745
|
/**
|
|
1778
|
-
* Construct and simulate a
|
|
1746
|
+
* Construct and simulate a settle_withdrawal 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.
|
|
1779
1747
|
*/
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
/**
|
|
1784
|
-
* Construct and simulate a convert_to_assets 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.
|
|
1785
|
-
*/
|
|
1786
|
-
convert_to_assets: ({ shares }: {
|
|
1748
|
+
settle_withdrawal: ({ caller, owner, shares, round }: {
|
|
1749
|
+
caller: string;
|
|
1750
|
+
owner: string;
|
|
1787
1751
|
shares: i128;
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
* Construct and simulate a convert_to_shares 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.
|
|
1791
|
-
*/
|
|
1792
|
-
convert_to_shares: ({ assets }: {
|
|
1793
|
-
assets: i128;
|
|
1794
|
-
}, options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1795
|
-
/**
|
|
1796
|
-
* Construct and simulate a lockup_expires_at 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.
|
|
1797
|
-
* Returns the unix timestamp at which `user` may next withdraw/redeem.
|
|
1798
|
-
* Returns 0 if `user` has never deposited (no lockup recorded).
|
|
1799
|
-
*/
|
|
1800
|
-
lockup_expires_at: ({ user }: {
|
|
1801
|
-
user: string;
|
|
1802
|
-
}, options?: MethodOptions) => Promise<AssembledTransaction<u64>>;
|
|
1752
|
+
round: OracleRound;
|
|
1753
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<SettlementResult>>;
|
|
1803
1754
|
/**
|
|
1804
|
-
* Construct and simulate a
|
|
1755
|
+
* Construct and simulate a receive_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.
|
|
1805
1756
|
*/
|
|
1806
|
-
|
|
1757
|
+
receive_collateral: ({ caller, from, amount }: {
|
|
1807
1758
|
caller: string;
|
|
1759
|
+
from: string;
|
|
1808
1760
|
amount: i128;
|
|
1809
1761
|
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1810
1762
|
/**
|
|
1811
|
-
* Construct and simulate a
|
|
1763
|
+
* Construct and simulate a set_request_router 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.
|
|
1812
1764
|
*/
|
|
1813
|
-
|
|
1765
|
+
set_request_router: ({ caller, request_router }: {
|
|
1814
1766
|
caller: string;
|
|
1815
|
-
|
|
1767
|
+
request_router: string;
|
|
1816
1768
|
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1817
1769
|
/**
|
|
1818
|
-
* Construct and simulate a
|
|
1819
|
-
* Net unrealized PnL across all open trader positions, as last synced by
|
|
1820
|
-
* PM via `update_net_pnl`. Realized PnL is intentionally NOT included —
|
|
1821
|
-
* it has already moved physically through `pay_profit` /
|
|
1822
|
-
* `record_absorbed_collateral` and is reflected directly in `total_assets`.
|
|
1770
|
+
* Construct and simulate a total_share_supply 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.
|
|
1823
1771
|
*/
|
|
1824
|
-
|
|
1772
|
+
total_share_supply: (options?: MethodOptions) => Promise<AssembledTransaction<i128>>;
|
|
1825
1773
|
/**
|
|
1826
|
-
* Construct and simulate a
|
|
1827
|
-
* Total assets minus only the fee buffer — PnL is excluded so consumers
|
|
1828
|
-
* (PM's utilization gate) are not subject to mark-price feedback into
|
|
1829
|
-
* the utilization denominator. LP-facing flows still use `free_liquidity`.
|
|
1774
|
+
* 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.
|
|
1830
1775
|
*/
|
|
1831
|
-
|
|
1776
|
+
accounting_snapshot: ({ round }: {
|
|
1777
|
+
round: OracleRound;
|
|
1778
|
+
}, options?: MethodOptions) => Promise<AssembledTransaction<AccountingSnapshot>>;
|
|
1832
1779
|
/**
|
|
1833
|
-
* Construct and simulate a
|
|
1834
|
-
* Notify the vault that PositionManager has just transferred `amount`
|
|
1835
|
-
* USDC of seized/loss-settlement collateral directly into the vault's
|
|
1836
|
-
* wallet. This call does NOT move tokens, but it DOES verify the
|
|
1837
|
-
* on-chain delta — `post - pre` must equal `amount`, otherwise PM and
|
|
1838
|
-
* Vault have diverged and we panic. See ADR-0001.
|
|
1780
|
+
* 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.
|
|
1839
1781
|
*/
|
|
1840
|
-
|
|
1782
|
+
can_create_lp_request: (options?: MethodOptions) => Promise<AssembledTransaction<boolean>>;
|
|
1783
|
+
/**
|
|
1784
|
+
* Construct and simulate a transfer_safety_claim 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.
|
|
1785
|
+
*/
|
|
1786
|
+
transfer_safety_claim: ({ caller, recipient, amount }: {
|
|
1841
1787
|
caller: string;
|
|
1842
|
-
|
|
1788
|
+
recipient: string;
|
|
1843
1789
|
amount: i128;
|
|
1844
|
-
pre_balance: i128;
|
|
1845
1790
|
}, options?: MethodOptions) => Promise<AssembledTransaction<null>>;
|
|
1846
1791
|
}
|
|
1847
1792
|
export declare class Client extends ContractClient {
|
|
1848
1793
|
readonly options: ContractClientOptions;
|
|
1849
1794
|
static deploy<T = Client>(
|
|
1850
1795
|
/** Constructor/Initialization Args for the contract's `__constructor` method */
|
|
1851
|
-
{
|
|
1852
|
-
|
|
1796
|
+
{ asset_address, config_manager, position_manager, lp_config }: {
|
|
1797
|
+
asset_address: string;
|
|
1853
1798
|
config_manager: string;
|
|
1854
1799
|
position_manager: string;
|
|
1800
|
+
lp_config: LpConfig;
|
|
1855
1801
|
},
|
|
1856
1802
|
/** Options for initializing a Client as well as for calling a method, with extras specific to deploying. */
|
|
1857
1803
|
options: MethodOptions & Omit<ContractClientOptions, "contractId"> & {
|
|
@@ -1864,51 +1810,34 @@ export declare class Client extends ContractClient {
|
|
|
1864
1810
|
}): Promise<AssembledTransaction<T>>;
|
|
1865
1811
|
constructor(options: ContractClientOptions);
|
|
1866
1812
|
readonly fromJSON: {
|
|
1867
|
-
mint: (json: string) => AssembledTransaction<bigint>;
|
|
1868
1813
|
name: (json: string) => AssembledTransaction<string>;
|
|
1869
1814
|
pause: (json: string) => AssembledTransaction<null>;
|
|
1870
|
-
redeem: (json: string) => AssembledTransaction<bigint>;
|
|
1871
1815
|
symbol: (json: string) => AssembledTransaction<string>;
|
|
1872
1816
|
approve: (json: string) => AssembledTransaction<null>;
|
|
1873
1817
|
balance: (json: string) => AssembledTransaction<bigint>;
|
|
1874
|
-
deposit: (json: string) => AssembledTransaction<bigint>;
|
|
1875
1818
|
migrate: (json: string) => AssembledTransaction<null>;
|
|
1876
1819
|
unpause: (json: string) => AssembledTransaction<null>;
|
|
1877
1820
|
upgrade: (json: string) => AssembledTransaction<null>;
|
|
1878
1821
|
decimals: (json: string) => AssembledTransaction<number>;
|
|
1879
|
-
max_mint: (json: string) => AssembledTransaction<bigint>;
|
|
1880
1822
|
transfer: (json: string) => AssembledTransaction<null>;
|
|
1881
|
-
withdraw: (json: string) => AssembledTransaction<bigint>;
|
|
1882
1823
|
allowance: (json: string) => AssembledTransaction<bigint>;
|
|
1883
|
-
claim_fees: (json: string) => AssembledTransaction<null>;
|
|
1884
|
-
max_redeem: (json: string) => AssembledTransaction<bigint>;
|
|
1885
|
-
pay_profit: (json: string) => AssembledTransaction<null>;
|
|
1886
|
-
accrue_fees: (json: string) => AssembledTransaction<null>;
|
|
1887
|
-
max_deposit: (json: string) => AssembledTransaction<bigint>;
|
|
1888
1824
|
query_asset: (json: string) => AssembledTransaction<string>;
|
|
1889
|
-
max_withdraw: (json: string) => AssembledTransaction<bigint>;
|
|
1890
|
-
preview_mint: (json: string) => AssembledTransaction<bigint>;
|
|
1891
|
-
total_assets: (json: string) => AssembledTransaction<bigint>;
|
|
1892
1825
|
total_supply: (json: string) => AssembledTransaction<bigint>;
|
|
1893
|
-
|
|
1894
|
-
|
|
1826
|
+
get_lp_config: (json: string) => AssembledTransaction<LpConfig>;
|
|
1827
|
+
physical_cash: (json: string) => AssembledTransaction<bigint>;
|
|
1828
|
+
set_lp_config: (json: string) => AssembledTransaction<null>;
|
|
1895
1829
|
transfer_from: (json: string) => AssembledTransaction<null>;
|
|
1896
1830
|
cancel_upgrade: (json: string) => AssembledTransaction<null>;
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
unclaimed_fees: (json: string) => AssembledTransaction<bigint>;
|
|
1900
|
-
update_net_pnl: (json: string) => AssembledTransaction<null>;
|
|
1901
|
-
preview_deposit: (json: string) => AssembledTransaction<bigint>;
|
|
1831
|
+
settle_deposit: (json: string) => AssembledTransaction<SettlementResult>;
|
|
1832
|
+
transfer_claim: (json: string) => AssembledTransaction<null>;
|
|
1902
1833
|
propose_upgrade: (json: string) => AssembledTransaction<null>;
|
|
1903
1834
|
bump_vault_state: (json: string) => AssembledTransaction<null>;
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
total_assets_excl_pnl: (json: string) => AssembledTransaction<bigint>;
|
|
1912
|
-
record_absorbed_collateral: (json: string) => AssembledTransaction<null>;
|
|
1835
|
+
settle_withdrawal: (json: string) => AssembledTransaction<SettlementResult>;
|
|
1836
|
+
receive_collateral: (json: string) => AssembledTransaction<null>;
|
|
1837
|
+
set_request_router: (json: string) => AssembledTransaction<null>;
|
|
1838
|
+
total_share_supply: (json: string) => AssembledTransaction<bigint>;
|
|
1839
|
+
accounting_snapshot: (json: string) => AssembledTransaction<AccountingSnapshot>;
|
|
1840
|
+
can_create_lp_request: (json: string) => AssembledTransaction<boolean>;
|
|
1841
|
+
transfer_safety_claim: (json: string) => AssembledTransaction<null>;
|
|
1913
1842
|
};
|
|
1914
1843
|
}
|