aftermath-ts-sdk 1.3.23-perps.29 → 1.3.23-perps.31
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/dist/general/utils/caller.d.ts +1 -0
- package/dist/general/utils/caller.d.ts.map +1 -1
- package/dist/general/utils/caller.js +12 -10
- package/dist/general/utils/helpers.d.ts.map +1 -1
- package/dist/general/utils/helpers.js +3 -0
- package/dist/packages/perpetuals/perpetuals.d.ts +21 -21
- package/dist/packages/perpetuals/perpetuals.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetuals.js +21 -21
- package/dist/packages/perpetuals/perpetualsAccount.d.ts +12 -17
- package/dist/packages/perpetuals/perpetualsAccount.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetualsAccount.js +59 -41
- package/dist/packages/perpetuals/perpetualsMarket.d.ts +11 -11
- package/dist/packages/perpetuals/perpetualsMarket.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetualsMarket.js +12 -12
- package/dist/packages/perpetuals/perpetualsTypes.d.ts +184 -95
- package/dist/packages/perpetuals/perpetualsTypes.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetualsVault.d.ts +35 -22
- package/dist/packages/perpetuals/perpetualsVault.d.ts.map +1 -1
- package/dist/packages/perpetuals/perpetualsVault.js +59 -30
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AnyObjectType,
|
|
1
|
+
import { AnyObjectType, Balance, Byte, Event, ObjectDigest, ObjectId, ObjectVersion, PackageId, Percentage, SerializedTransaction, SuiAddress, Timestamp, TransactionDigest } from "../../general/types/generalTypes";
|
|
2
2
|
import { CoinDecimal, CoinSymbol, CoinType } from "../coin/coinTypes";
|
|
3
3
|
import { Transaction, TransactionObjectArgument } from "@mysten/sui/transactions";
|
|
4
4
|
/**
|
|
@@ -456,6 +456,14 @@ export interface PerpetualsAccountObject {
|
|
|
456
456
|
/** Per-market positions for this account. */
|
|
457
457
|
positions: PerpetualsPosition[];
|
|
458
458
|
}
|
|
459
|
+
export interface PerpetualsVaultMetatada {
|
|
460
|
+
name: string;
|
|
461
|
+
description: string;
|
|
462
|
+
curatorName: string | undefined;
|
|
463
|
+
curatorUrl: string | undefined;
|
|
464
|
+
curatorLogoUrl: string | undefined;
|
|
465
|
+
extraFields: Record<string, string>;
|
|
466
|
+
}
|
|
459
467
|
/**
|
|
460
468
|
* On-chain representation of a vault that manages user collateral and
|
|
461
469
|
* interacts with clearing houses on their behalf.
|
|
@@ -463,7 +471,7 @@ export interface PerpetualsAccountObject {
|
|
|
463
471
|
export interface PerpetualsVaultObject {
|
|
464
472
|
objectId: ObjectId;
|
|
465
473
|
version: bigint;
|
|
466
|
-
|
|
474
|
+
metadata: PerpetualsVaultMetatada;
|
|
467
475
|
lpSupply: Balance;
|
|
468
476
|
idleCollateral: Balance;
|
|
469
477
|
idleCollateralUsd: number;
|
|
@@ -474,7 +482,7 @@ export interface PerpetualsVaultObject {
|
|
|
474
482
|
withdrawQueue: PerpetualsVaultWithdrawRequest[];
|
|
475
483
|
parameters: {
|
|
476
484
|
lockPeriodMs: bigint;
|
|
477
|
-
|
|
485
|
+
performanceFeePercentage: number;
|
|
478
486
|
forceWithdrawDelayMs: bigint;
|
|
479
487
|
collateralPriceFeedStorageId: ObjectId;
|
|
480
488
|
collateralPriceFeedStorageSourceId: ObjectId;
|
|
@@ -498,6 +506,7 @@ export interface PerpetualsVaultObject {
|
|
|
498
506
|
lpCoinType: CoinType;
|
|
499
507
|
/** Decimals for the LP token minted by this vault. */
|
|
500
508
|
lpCoinDecimals: CoinDecimal;
|
|
509
|
+
monthlyAprPercentage: Percentage;
|
|
501
510
|
}
|
|
502
511
|
/**
|
|
503
512
|
* Represents a single pending vault withdrawal request.
|
|
@@ -505,9 +514,11 @@ export interface PerpetualsVaultObject {
|
|
|
505
514
|
export interface PerpetualsVaultWithdrawRequest {
|
|
506
515
|
userAddress: SuiAddress;
|
|
507
516
|
vaultId: SuiAddress;
|
|
508
|
-
|
|
517
|
+
lpAmountIn: Balance;
|
|
518
|
+
lpAmountInUsd: number;
|
|
509
519
|
requestTimestamp: Timestamp;
|
|
510
|
-
|
|
520
|
+
minCollateralAmountOut: Balance;
|
|
521
|
+
minCollateralAmountOutUsd: number;
|
|
511
522
|
}
|
|
512
523
|
/**
|
|
513
524
|
* Event emitted when a clearing house (market) is upgraded to a new version.
|
|
@@ -528,12 +539,10 @@ export declare const isUpdatedMarketVersion: (event: Event) => event is UpdatedM
|
|
|
528
539
|
/**
|
|
529
540
|
* Cursor-based response wrapping a list of collateral changes for an account.
|
|
530
541
|
*/
|
|
531
|
-
export
|
|
532
|
-
/** Collateral changes in chronological order
|
|
542
|
+
export type ApiPerpetualsAccountCollateralHistoryResponse = ApiPerpetualsHistoricalDataWithCursorResponse & {
|
|
543
|
+
/** Collateral changes in chronological order. */
|
|
533
544
|
collateralChanges: PerpetualsAccountCollateralChange[];
|
|
534
|
-
|
|
535
|
-
nextCursor: Timestamp | undefined;
|
|
536
|
-
}
|
|
545
|
+
};
|
|
537
546
|
/**
|
|
538
547
|
* Single collateral change record for an account.
|
|
539
548
|
*
|
|
@@ -570,31 +579,31 @@ export type PerpetualsAccountCollateralChange = {
|
|
|
570
579
|
};
|
|
571
580
|
};
|
|
572
581
|
/**
|
|
573
|
-
* Cursor-based response wrapping a list of
|
|
582
|
+
* Cursor-based response wrapping a list of orders for an account.
|
|
574
583
|
*/
|
|
575
|
-
export
|
|
576
|
-
/**
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
nextCursor: Timestamp | undefined;
|
|
580
|
-
}
|
|
584
|
+
export type ApiPerpetualsAccountOrderHistoryResponse = ApiPerpetualsHistoricalDataWithCursorResponse & {
|
|
585
|
+
/** Orders in chronological order. */
|
|
586
|
+
orders: PerpetualsAccountOrderHistoryData[];
|
|
587
|
+
};
|
|
581
588
|
/**
|
|
582
589
|
* Historical margin data point for an account, used in margin history views.
|
|
583
590
|
*/
|
|
584
|
-
export interface
|
|
591
|
+
export interface PerpetualsAccountMarginHistoryData {
|
|
585
592
|
/** Timestamp of this snapshot. */
|
|
586
593
|
timestamp: Timestamp;
|
|
587
|
-
/**
|
|
588
|
-
|
|
594
|
+
/** Total collateral allocated to positions, denominated in USD. */
|
|
595
|
+
allocatedCollateralUsd: number;
|
|
596
|
+
/** Total collateral within account, denominated in USD. */
|
|
597
|
+
totalCollateralUsd: number;
|
|
589
598
|
/** Unrealized funding PnL in USD at that time. */
|
|
590
|
-
|
|
599
|
+
unrealizedFundingsUsd: number;
|
|
591
600
|
/** Unrealized position PnL in USD at that time. */
|
|
592
601
|
unrealizedPnlUsd: number;
|
|
593
602
|
}
|
|
594
603
|
/**
|
|
595
604
|
* Individual trade affecting an account.
|
|
596
605
|
*/
|
|
597
|
-
export type
|
|
606
|
+
export type PerpetualsAccountOrderHistoryData = {
|
|
598
607
|
/** Timestamp of the trade. */
|
|
599
608
|
timestamp: Timestamp;
|
|
600
609
|
/** Sui transaction digest. */
|
|
@@ -605,10 +614,10 @@ export type PerpetualsAccountTrade = {
|
|
|
605
614
|
eventType: AnyObjectType;
|
|
606
615
|
/** Side of the trade relative to the account (Bid/Ask). */
|
|
607
616
|
side: PerpetualsOrderSide;
|
|
608
|
-
/**
|
|
609
|
-
|
|
610
|
-
/**
|
|
611
|
-
|
|
617
|
+
/** Filled size in base units. */
|
|
618
|
+
sizeFilled: number;
|
|
619
|
+
/** Order price (limit price) used for the trade. */
|
|
620
|
+
orderPrice: number;
|
|
612
621
|
};
|
|
613
622
|
/**
|
|
614
623
|
* Event emitted when collateral is deposited into an account.
|
|
@@ -722,7 +731,7 @@ export interface SetPositionInitialMarginRatioEvent extends Event {
|
|
|
722
731
|
/**
|
|
723
732
|
* Trade data used for market-level trade history.
|
|
724
733
|
*/
|
|
725
|
-
export interface
|
|
734
|
+
export interface PerpetualsMarketOrderHistoryData {
|
|
726
735
|
/** Timestamp of the trade. */
|
|
727
736
|
timestamp: Timestamp;
|
|
728
737
|
/** Transaction digest. */
|
|
@@ -735,14 +744,12 @@ export interface PerpetualsTradeHistoryData {
|
|
|
735
744
|
orderPrice: number;
|
|
736
745
|
}
|
|
737
746
|
/**
|
|
738
|
-
* Cursor-based wrapper for market-level
|
|
747
|
+
* Cursor-based wrapper for market-level order history.
|
|
739
748
|
*/
|
|
740
|
-
export
|
|
741
|
-
/**
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
nextCursor: Timestamp | undefined;
|
|
745
|
-
}
|
|
749
|
+
export type ApiPerpetualsMarketOrderHistoryResponse = ApiPerpetualsHistoricalDataWithCursorResponse & {
|
|
750
|
+
/** Orders in this page. */
|
|
751
|
+
orders: PerpetualsMarketOrderHistoryData[];
|
|
752
|
+
};
|
|
746
753
|
/**
|
|
747
754
|
* Event emitted when an order is filled or dropped by the orderbook
|
|
748
755
|
* (book-keeping receipt).
|
|
@@ -988,22 +995,63 @@ export interface ApiPerpetualsOwnedAccountCapsBody {
|
|
|
988
995
|
export interface ApiPerpetualsAccountCapsBody {
|
|
989
996
|
accountCapIds: ObjectId[];
|
|
990
997
|
}
|
|
991
|
-
|
|
998
|
+
/**
|
|
999
|
+
* Generic shape for Perpetuals API historical data requests that include
|
|
1000
|
+
* `beforeTimestampCursor` and `limit` pagination parameters.
|
|
1001
|
+
*/
|
|
1002
|
+
export interface ApiPerpetualsHistoricalDataWithCursorBody {
|
|
1003
|
+
/**
|
|
1004
|
+
* Cursor for pagination.
|
|
1005
|
+
*/
|
|
1006
|
+
beforeTimestampCursor?: Timestamp;
|
|
1007
|
+
/**
|
|
1008
|
+
* Limit for pagination.
|
|
1009
|
+
*/
|
|
1010
|
+
limit?: number;
|
|
1011
|
+
}
|
|
1012
|
+
/**
|
|
1013
|
+
* Generic shape for Perpetuals API historical data responses that include
|
|
1014
|
+
* `nextBeforeTimestampCursor` pagination parameter.
|
|
1015
|
+
*/
|
|
1016
|
+
export interface ApiPerpetualsHistoricalDataWithCursorResponse {
|
|
1017
|
+
/**
|
|
1018
|
+
* The next cursor position. If undefined, no more data is available.
|
|
1019
|
+
*/
|
|
1020
|
+
nextBeforeTimestampCursor: Timestamp | undefined;
|
|
1021
|
+
}
|
|
1022
|
+
export interface ApiPerpetualsAccountMarginHistoryBody {
|
|
992
1023
|
accountId: PerpetualsAccountId;
|
|
993
|
-
|
|
1024
|
+
fromTimestamp: Timestamp;
|
|
1025
|
+
toTimestamp: Timestamp;
|
|
1026
|
+
intervalMs: number;
|
|
1027
|
+
}
|
|
1028
|
+
/**
|
|
1029
|
+
* Request body for fetching account-level order history with a cursor.
|
|
1030
|
+
*/
|
|
1031
|
+
export type ApiPerpetualsMarketOrderHistoryBody = ApiPerpetualsHistoricalDataWithCursorBody & {
|
|
1032
|
+
marketId: PerpetualsMarketId;
|
|
994
1033
|
};
|
|
995
1034
|
/**
|
|
996
1035
|
* Request body for fetching account-level order history with a cursor.
|
|
997
1036
|
*/
|
|
998
|
-
export type ApiPerpetualsAccountOrderHistoryBody =
|
|
1037
|
+
export type ApiPerpetualsAccountOrderHistoryBody = ApiPerpetualsHistoricalDataWithCursorBody & {
|
|
999
1038
|
accountId: PerpetualsAccountId;
|
|
1039
|
+
authentication?: {
|
|
1040
|
+
walletAddress: SuiAddress;
|
|
1041
|
+
bytes: string;
|
|
1042
|
+
signature: string;
|
|
1043
|
+
};
|
|
1000
1044
|
};
|
|
1001
1045
|
/**
|
|
1002
1046
|
* Request body for fetching account collateral history with a cursor.
|
|
1003
1047
|
*/
|
|
1004
|
-
export type ApiPerpetualsAccountCollateralHistoryBody =
|
|
1048
|
+
export type ApiPerpetualsAccountCollateralHistoryBody = ApiPerpetualsHistoricalDataWithCursorBody & {
|
|
1005
1049
|
accountId: PerpetualsAccountId;
|
|
1006
|
-
|
|
1050
|
+
authentication?: {
|
|
1051
|
+
walletAddress: SuiAddress;
|
|
1052
|
+
bytes: string;
|
|
1053
|
+
signature: string;
|
|
1054
|
+
};
|
|
1007
1055
|
};
|
|
1008
1056
|
/**
|
|
1009
1057
|
* Request body for previewing a market order placement (before sending a tx).
|
|
@@ -1110,8 +1158,10 @@ export type ApiPerpetualsPreviewPlaceOrderResponse = {
|
|
|
1110
1158
|
export type ApiPerpetualsPreviewCancelOrdersResponse = {
|
|
1111
1159
|
error: string;
|
|
1112
1160
|
} | {
|
|
1113
|
-
|
|
1114
|
-
|
|
1161
|
+
marketIdsToData: Record<PerpetualsMarketId, {
|
|
1162
|
+
updatedPosition: PerpetualsPosition;
|
|
1163
|
+
collateralChange: number;
|
|
1164
|
+
}>;
|
|
1115
1165
|
};
|
|
1116
1166
|
/**
|
|
1117
1167
|
* Request body for computing an execution price for a hypothetical trade
|
|
@@ -1140,10 +1190,16 @@ export interface ApiPerpetualsExecutionPriceResponse {
|
|
|
1140
1190
|
sizePosted: number;
|
|
1141
1191
|
fills: PerpetualsFilledOrderData[];
|
|
1142
1192
|
}
|
|
1193
|
+
export interface ApiPerpetualsMarketCandleHistoryBody {
|
|
1194
|
+
marketId: PerpetualsMarketId;
|
|
1195
|
+
fromTimestamp: Timestamp;
|
|
1196
|
+
toTimestamp: Timestamp;
|
|
1197
|
+
intervalMs: number;
|
|
1198
|
+
}
|
|
1143
1199
|
/**
|
|
1144
1200
|
* Response type for historical market candle data.
|
|
1145
1201
|
*/
|
|
1146
|
-
export type
|
|
1202
|
+
export type ApiPerpetualsMarketCandleHistoryResponse = PerpetualsMarketCandleDataPoint[];
|
|
1147
1203
|
/**
|
|
1148
1204
|
* Request body for computing the maximum order size for an account in a
|
|
1149
1205
|
* given market.
|
|
@@ -1216,12 +1272,19 @@ export interface ApiPerpetualsCreateVaultCapBody {
|
|
|
1216
1272
|
* - As an existing `depositCoinArg` (coin object).
|
|
1217
1273
|
*/
|
|
1218
1274
|
export type ApiPerpetualsCreateVaultBody = {
|
|
1219
|
-
name: string;
|
|
1220
1275
|
walletAddress: SuiAddress;
|
|
1276
|
+
metadata: {
|
|
1277
|
+
name: string;
|
|
1278
|
+
description: string;
|
|
1279
|
+
curatorName?: string;
|
|
1280
|
+
curatorUrl?: string;
|
|
1281
|
+
curatorLogoUrl?: string;
|
|
1282
|
+
extraFields?: Record<string, string>;
|
|
1283
|
+
};
|
|
1221
1284
|
lpCoinType: CoinType;
|
|
1222
1285
|
collateralCoinType: CoinType;
|
|
1223
1286
|
lockPeriodMs: bigint;
|
|
1224
|
-
|
|
1287
|
+
performanceFeePercentage: Percentage;
|
|
1225
1288
|
forceWithdrawDelayMs: bigint;
|
|
1226
1289
|
txKind?: SerializedTransaction;
|
|
1227
1290
|
isSponsoredTx?: boolean;
|
|
@@ -1240,7 +1303,7 @@ export interface ApiPerpetualsCreateAccountBody {
|
|
|
1240
1303
|
txKind?: SerializedTransaction;
|
|
1241
1304
|
}
|
|
1242
1305
|
/**
|
|
1243
|
-
* Request body for depositing collateral into a perpetuals account
|
|
1306
|
+
* Request body for depositing collateral into a perpetuals account.
|
|
1244
1307
|
*
|
|
1245
1308
|
* The deposit can be provided by:
|
|
1246
1309
|
* - `depositAmount` (numeric amount), or
|
|
@@ -1248,6 +1311,7 @@ export interface ApiPerpetualsCreateAccountBody {
|
|
|
1248
1311
|
*/
|
|
1249
1312
|
export type ApiPerpetualsDepositCollateralBody = {
|
|
1250
1313
|
walletAddress: SuiAddress;
|
|
1314
|
+
accountId: PerpetualsAccountId;
|
|
1251
1315
|
collateralCoinType: CoinType;
|
|
1252
1316
|
txKind?: SerializedTransaction;
|
|
1253
1317
|
isSponsoredTx?: boolean;
|
|
@@ -1255,26 +1319,16 @@ export type ApiPerpetualsDepositCollateralBody = {
|
|
|
1255
1319
|
depositAmount: Balance;
|
|
1256
1320
|
} | {
|
|
1257
1321
|
depositCoinArg: TransactionObjectArgument;
|
|
1258
|
-
}) & ({
|
|
1259
|
-
accountId: PerpetualsAccountId;
|
|
1260
|
-
} | {
|
|
1261
|
-
vaultId: ObjectId;
|
|
1262
1322
|
});
|
|
1263
1323
|
/**
|
|
1264
|
-
* Request body for withdrawing collateral from an account
|
|
1324
|
+
* Request body for withdrawing collateral from an account.
|
|
1265
1325
|
*/
|
|
1266
1326
|
export type ApiPerpetualsWithdrawCollateralBody = {
|
|
1267
|
-
|
|
1268
|
-
collateralCoinType: CoinType;
|
|
1327
|
+
accountId: PerpetualsAccountId;
|
|
1269
1328
|
withdrawAmount: Balance;
|
|
1270
|
-
/** Optional destination wallet address; defaults to owner if omitted. */
|
|
1271
1329
|
recipientAddress?: SuiAddress;
|
|
1272
1330
|
txKind?: SerializedTransaction;
|
|
1273
|
-
}
|
|
1274
|
-
accountId: PerpetualsAccountId;
|
|
1275
|
-
} | {
|
|
1276
|
-
vaultId: ObjectId;
|
|
1277
|
-
});
|
|
1331
|
+
};
|
|
1278
1332
|
/**
|
|
1279
1333
|
* Response body for withdraw-collateral transactions.
|
|
1280
1334
|
*
|
|
@@ -1282,14 +1336,13 @@ export type ApiPerpetualsWithdrawCollateralBody = {
|
|
|
1282
1336
|
*/
|
|
1283
1337
|
export interface ApiPerpetualsWithdrawCollateralResponse {
|
|
1284
1338
|
txKind: SerializedTransaction;
|
|
1285
|
-
coinOutArg: TransactionObjectArgument;
|
|
1339
|
+
coinOutArg: TransactionObjectArgument | undefined;
|
|
1286
1340
|
}
|
|
1287
1341
|
/**
|
|
1288
1342
|
* Request body for transferring collateral between two perpetuals accounts.
|
|
1289
1343
|
*/
|
|
1290
1344
|
export interface ApiPerpetualsTransferCollateralBody {
|
|
1291
1345
|
walletAddress: SuiAddress;
|
|
1292
|
-
collateralCoinType: CoinType;
|
|
1293
1346
|
fromAccountId: PerpetualsAccountId;
|
|
1294
1347
|
toAccountId: PerpetualsAccountId;
|
|
1295
1348
|
transferAmount: Balance;
|
|
@@ -1541,24 +1594,24 @@ export interface ApiPerpetualsVaultProcessForceWithdrawRequestTxBody {
|
|
|
1541
1594
|
/**
|
|
1542
1595
|
* API body to process regular withdraw requests for a vault.
|
|
1543
1596
|
*/
|
|
1544
|
-
export interface
|
|
1597
|
+
export interface ApiPerpetualsVaultOwnerProcessWithdrawRequestsTxBody {
|
|
1545
1598
|
vaultId: ObjectId;
|
|
1546
1599
|
userAddresses: SuiAddress[];
|
|
1547
1600
|
txKind?: SerializedTransaction;
|
|
1548
1601
|
}
|
|
1549
1602
|
/**
|
|
1550
|
-
* API body to update slippage
|
|
1551
|
-
*
|
|
1603
|
+
* API body to update slippage parameter for pending vault withdraw
|
|
1604
|
+
* request for a specific vault.
|
|
1552
1605
|
*/
|
|
1553
|
-
export interface
|
|
1554
|
-
|
|
1555
|
-
|
|
1606
|
+
export interface ApiPerpetualsVaultUpdateWithdrawRequestSlippageTxBody {
|
|
1607
|
+
vaultId: ObjectId;
|
|
1608
|
+
minCollateralAmountOut: Balance;
|
|
1556
1609
|
txKind?: SerializedTransaction;
|
|
1557
1610
|
}
|
|
1558
1611
|
/**
|
|
1559
1612
|
* API body to update the force-withdrawal delay in a vault.
|
|
1560
1613
|
*/
|
|
1561
|
-
export interface
|
|
1614
|
+
export interface ApiPerpetualsVaultOwnerUpdateForceWithdrawDelayTxBody {
|
|
1562
1615
|
vaultId: ObjectId;
|
|
1563
1616
|
forceWithdrawDelayMs: bigint;
|
|
1564
1617
|
txKind?: SerializedTransaction;
|
|
@@ -1566,7 +1619,7 @@ export interface ApiPerpetualsVaultUpdateForceWithdrawDelayTxBody {
|
|
|
1566
1619
|
/**
|
|
1567
1620
|
* API body to update the lock period on a vault.
|
|
1568
1621
|
*/
|
|
1569
|
-
export interface
|
|
1622
|
+
export interface ApiPerpetualsVaultOwnerUpdateLockPeriodTxBody {
|
|
1570
1623
|
vaultId: ObjectId;
|
|
1571
1624
|
lockPeriodMs: bigint;
|
|
1572
1625
|
txKind?: SerializedTransaction;
|
|
@@ -1574,15 +1627,15 @@ export interface ApiPerpetualsVaultUpdateLockPeriodTxBody {
|
|
|
1574
1627
|
/**
|
|
1575
1628
|
* API body to update the owner's fee percentage on a vault.
|
|
1576
1629
|
*/
|
|
1577
|
-
export interface
|
|
1630
|
+
export interface ApiPerpetualsVaultOwnerUpdatePerformanceFeeTxBody {
|
|
1578
1631
|
vaultId: ObjectId;
|
|
1579
|
-
|
|
1632
|
+
performanceFeePercentage: number;
|
|
1580
1633
|
txKind?: SerializedTransaction;
|
|
1581
1634
|
}
|
|
1582
1635
|
/**
|
|
1583
1636
|
* API body for the vault owner withdrawing collected fees.
|
|
1584
1637
|
*/
|
|
1585
|
-
export interface
|
|
1638
|
+
export interface ApiPerpetualsVaultOwnerWithdrawPerformanceFeesTxBody {
|
|
1586
1639
|
vaultId: ObjectId;
|
|
1587
1640
|
withdrawAmount: Balance;
|
|
1588
1641
|
recipientAddress?: SuiAddress;
|
|
@@ -1591,7 +1644,7 @@ export interface ApiPerpetualsVaultWithdrawOwnerFeesTxBody {
|
|
|
1591
1644
|
/**
|
|
1592
1645
|
* Response for owner-fee withdrawal transactions.
|
|
1593
1646
|
*/
|
|
1594
|
-
export interface
|
|
1647
|
+
export interface ApiPerpetualsVaultOwnerWithdrawPerformanceFeesTxResponse {
|
|
1595
1648
|
txKind: SerializedTransaction;
|
|
1596
1649
|
coinOutArg: TransactionObjectArgument | undefined;
|
|
1597
1650
|
}
|
|
@@ -1615,9 +1668,28 @@ export interface ApiPerpetualsVaultCreateWithdrawRequestTxBody {
|
|
|
1615
1668
|
vaultId: ObjectId;
|
|
1616
1669
|
walletAddress: SuiAddress;
|
|
1617
1670
|
lpWithdrawAmount: Balance;
|
|
1618
|
-
|
|
1671
|
+
minCollateralAmountOut: Balance;
|
|
1619
1672
|
txKind?: SerializedTransaction;
|
|
1620
1673
|
}
|
|
1674
|
+
/**
|
|
1675
|
+
* API body for withdrawing collateral from a vault as owner.
|
|
1676
|
+
*/
|
|
1677
|
+
export interface ApiPerpetualsVaultOwnerWithdrawCollateralTxBody {
|
|
1678
|
+
vaultId: ObjectId;
|
|
1679
|
+
lpWithdrawAmount: Balance;
|
|
1680
|
+
minCollateralAmountOut: Balance;
|
|
1681
|
+
recipientAddress?: SuiAddress;
|
|
1682
|
+
txKind?: SerializedTransaction;
|
|
1683
|
+
}
|
|
1684
|
+
/**
|
|
1685
|
+
* Response body for vault owner withdraw-collateral transactions.
|
|
1686
|
+
*
|
|
1687
|
+
* The SDK typically uses `txKind` to reconstruct a transaction locally.
|
|
1688
|
+
*/
|
|
1689
|
+
export interface ApiPerpetualsVaultOwnerWithdrawCollateralTxResponse {
|
|
1690
|
+
txKind: SerializedTransaction;
|
|
1691
|
+
coinOutArg: TransactionObjectArgument | undefined;
|
|
1692
|
+
}
|
|
1621
1693
|
/**
|
|
1622
1694
|
* API body for canceling withdrawal requests across vaults for a wallet.
|
|
1623
1695
|
*/
|
|
@@ -1648,6 +1720,7 @@ export type ApiPerpetualsVaultDepositTxBody = {
|
|
|
1648
1720
|
*/
|
|
1649
1721
|
export interface ApiPerpetualsVaultPreviewCreateWithdrawRequestBody {
|
|
1650
1722
|
vaultId: ObjectId;
|
|
1723
|
+
walletAddress: SuiAddress;
|
|
1651
1724
|
lpWithdrawAmount: Balance;
|
|
1652
1725
|
}
|
|
1653
1726
|
/**
|
|
@@ -1659,6 +1732,22 @@ export type ApiPerpetualsVaultPreviewCreateWithdrawRequestResponse = {
|
|
|
1659
1732
|
collateralAmountOut: Balance;
|
|
1660
1733
|
collateralPrice: number;
|
|
1661
1734
|
};
|
|
1735
|
+
/**
|
|
1736
|
+
* Request body for previewing a vault owner collateral withdrawal.
|
|
1737
|
+
*/
|
|
1738
|
+
export interface ApiPerpetualsVaultPreviewOwnerWithdrawCollateralBody {
|
|
1739
|
+
vaultId: ObjectId;
|
|
1740
|
+
lpWithdrawAmount: Balance;
|
|
1741
|
+
}
|
|
1742
|
+
/**
|
|
1743
|
+
* Response body for vault owner collateral withdrawal preview.
|
|
1744
|
+
*/
|
|
1745
|
+
export type ApiPerpetualsVaultPreviewOwnerWithdrawCollateralResponse = {
|
|
1746
|
+
error: string;
|
|
1747
|
+
} | {
|
|
1748
|
+
collateralAmountOut: Balance;
|
|
1749
|
+
collateralPrice: number;
|
|
1750
|
+
};
|
|
1662
1751
|
/**
|
|
1663
1752
|
* Request body for previewing a vault deposit.
|
|
1664
1753
|
*/
|
|
@@ -1696,32 +1785,32 @@ export type ApiPerpetualsVaultPreviewProcessForceWithdrawRequestResponse = {
|
|
|
1696
1785
|
/**
|
|
1697
1786
|
* Request body for previewing normal withdraw requests processing for a vault.
|
|
1698
1787
|
*/
|
|
1699
|
-
export interface
|
|
1788
|
+
export interface ApiPerpetualsVaultPreviewOwnerProcessWithdrawRequestsBody {
|
|
1700
1789
|
vaultId: ObjectId;
|
|
1701
1790
|
userAddresses: SuiAddress[];
|
|
1702
1791
|
}
|
|
1703
1792
|
/**
|
|
1704
1793
|
* Response body for previewing normal withdraw requests processing.
|
|
1705
1794
|
*/
|
|
1706
|
-
export type
|
|
1795
|
+
export type ApiPerpetualsVaultPreviewOwnerProcessWithdrawRequestsResponse = {
|
|
1707
1796
|
error: string;
|
|
1708
1797
|
} | {
|
|
1709
1798
|
userPreviews: {
|
|
1710
1799
|
userAddress: SuiAddress;
|
|
1711
|
-
|
|
1800
|
+
collateralAmountOut: Balance;
|
|
1712
1801
|
}[];
|
|
1713
1802
|
collateralPrice: number;
|
|
1714
1803
|
};
|
|
1715
1804
|
/**
|
|
1716
|
-
* Request body for previewing maximum
|
|
1805
|
+
* Request body for previewing maximum performance fees withdrawable from a vault.
|
|
1717
1806
|
*/
|
|
1718
|
-
export interface
|
|
1807
|
+
export interface ApiPerpetualsVaultPreviewOwnerWithdrawPerformanceFeesBody {
|
|
1719
1808
|
vaultId: ObjectId;
|
|
1720
1809
|
}
|
|
1721
1810
|
/**
|
|
1722
|
-
* Response body for previewing vault
|
|
1811
|
+
* Response body for previewing vault performance fee withdrawal.
|
|
1723
1812
|
*/
|
|
1724
|
-
export type
|
|
1813
|
+
export type ApiPerpetualsVaultPreviewOwnerWithdrawPerformanceFeesResponse = {
|
|
1725
1814
|
error: string;
|
|
1726
1815
|
} | {
|
|
1727
1816
|
maxFeesToWithdraw: Balance;
|
|
@@ -1812,18 +1901,18 @@ export interface PerpetualsWsUpdatesOrderbookSubscriptionType {
|
|
|
1812
1901
|
};
|
|
1813
1902
|
}
|
|
1814
1903
|
/**
|
|
1815
|
-
* Websocket subscription payload for market
|
|
1904
|
+
* Websocket subscription payload for market orders stream.
|
|
1816
1905
|
*/
|
|
1817
|
-
export interface
|
|
1818
|
-
|
|
1906
|
+
export interface PerpetualsWsUpdatesMarketOrdersSubscriptionType {
|
|
1907
|
+
marketOrders: {
|
|
1819
1908
|
marketId: PerpetualsMarketId;
|
|
1820
1909
|
};
|
|
1821
1910
|
}
|
|
1822
1911
|
/**
|
|
1823
|
-
* Websocket subscription payload for user-specific
|
|
1912
|
+
* Websocket subscription payload for user-specific order updates.
|
|
1824
1913
|
*/
|
|
1825
|
-
export interface
|
|
1826
|
-
|
|
1914
|
+
export interface PerpetualsWsUpdatesUserOrdersSubscriptionType {
|
|
1915
|
+
userOrders: {
|
|
1827
1916
|
accountId: PerpetualsAccountId;
|
|
1828
1917
|
};
|
|
1829
1918
|
}
|
|
@@ -1838,7 +1927,7 @@ export interface PerpetualsWsUpdatesUserCollateralChangesSubscriptionType {
|
|
|
1838
1927
|
/**
|
|
1839
1928
|
* Union of all websocket subscription types for perpetuals updates.
|
|
1840
1929
|
*/
|
|
1841
|
-
export type PerpetualsWsUpdatesSubscriptionType = PerpetualsWsUpdatesMarketSubscriptionType | PerpetualsWsUpdatesUserSubscriptionType | PerpetualsWsUpdatesOracleSubscriptionType | PerpetualsWsUpdatesOrderbookSubscriptionType |
|
|
1930
|
+
export type PerpetualsWsUpdatesSubscriptionType = PerpetualsWsUpdatesMarketSubscriptionType | PerpetualsWsUpdatesUserSubscriptionType | PerpetualsWsUpdatesOracleSubscriptionType | PerpetualsWsUpdatesOrderbookSubscriptionType | PerpetualsWsUpdatesMarketOrdersSubscriptionType | PerpetualsWsUpdatesUserOrdersSubscriptionType | PerpetualsWsUpdatesUserCollateralChangesSubscriptionType;
|
|
1842
1931
|
/**
|
|
1843
1932
|
* Websocket payload for oracle price updates.
|
|
1844
1933
|
*/
|
|
@@ -1848,18 +1937,18 @@ export interface PerpetualsWsUpdatesOraclePayload {
|
|
|
1848
1937
|
collateralPrice: number;
|
|
1849
1938
|
}
|
|
1850
1939
|
/**
|
|
1851
|
-
* Websocket payload for market
|
|
1940
|
+
* Websocket payload for market orders stream.
|
|
1852
1941
|
*/
|
|
1853
|
-
export interface
|
|
1942
|
+
export interface PerpetualsWsUpdatesMarketOrdersPayload {
|
|
1854
1943
|
marketId: PerpetualsMarketId;
|
|
1855
|
-
|
|
1944
|
+
orders: PerpetualsMarketOrderHistoryData[];
|
|
1856
1945
|
}
|
|
1857
1946
|
/**
|
|
1858
|
-
* Websocket payload for user-specific
|
|
1947
|
+
* Websocket payload for user-specific orders stream.
|
|
1859
1948
|
*/
|
|
1860
|
-
export interface
|
|
1949
|
+
export interface PerpetualsWsUpdatesUserOrdersPayload {
|
|
1861
1950
|
accountId: PerpetualsAccountId;
|
|
1862
|
-
|
|
1951
|
+
orders: PerpetualsAccountOrderHistoryData[];
|
|
1863
1952
|
}
|
|
1864
1953
|
/**
|
|
1865
1954
|
* Websocket payload for user-specific collateral changes.
|
|
@@ -1904,9 +1993,9 @@ export type PerpetualsWsUpdatesResponseMessage = {
|
|
|
1904
1993
|
} | {
|
|
1905
1994
|
orderbook: PerpetualsWsUpdatesOrderbookPayload;
|
|
1906
1995
|
} | {
|
|
1907
|
-
|
|
1996
|
+
marketOrders: PerpetualsWsUpdatesMarketOrdersPayload;
|
|
1908
1997
|
} | {
|
|
1909
|
-
|
|
1998
|
+
userOrders: PerpetualsWsUpdatesUserOrdersPayload;
|
|
1910
1999
|
} | {
|
|
1911
2000
|
userCollateralChanges: PerpetualsWsUpdatesUserCollateralChangesPayload;
|
|
1912
2001
|
};
|