@nightlylabs/dex-sdk 0.0.75 → 0.0.76

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/index.d.cts CHANGED
@@ -547,6 +547,11 @@ interface PlacePerpMarketOrder {
547
547
  orderId: string;
548
548
  fills: WsFill[];
549
549
  }
550
+ interface ReferralUpdate {
551
+ userId: string;
552
+ referralDiscount: string;
553
+ referralKickback: string;
554
+ }
550
555
  interface RemoveApiKey {
551
556
  userId: string;
552
557
  apiKey: string;
@@ -797,6 +802,9 @@ type WsMessage = {
797
802
  } | {
798
803
  type: "UserTransferReceived";
799
804
  content: UserTransfer;
805
+ } | {
806
+ type: "ReferralUpdate";
807
+ content: ReferralUpdate;
800
808
  };
801
809
 
802
810
  type Address = `0x${string}`;
@@ -809,6 +817,117 @@ declare enum Status {
809
817
  declare enum Network {
810
818
  Devnet = "Devnet"
811
819
  }
820
+ interface ChangePerpOrderPriceParams {
821
+ userId: string;
822
+ market: string;
823
+ orderId: string;
824
+ newPrice: string;
825
+ postOnly: boolean;
826
+ }
827
+ interface PlacePerpOrderParams {
828
+ userId: string;
829
+ orderData: PerpOrderData;
830
+ }
831
+ interface CancelAllPerpOrdersParams {
832
+ userId: string;
833
+ }
834
+ interface CancelPerpOrdersParams {
835
+ userId: string;
836
+ markets: string[];
837
+ orderIds: string[][];
838
+ }
839
+ interface AddApiKeyParams {
840
+ apiKey: Address;
841
+ userId: string;
842
+ expiration: string;
843
+ }
844
+ interface RemoveApiKeyParams {
845
+ apiKey: Address;
846
+ userId: string;
847
+ }
848
+ interface CreateUserParams {
849
+ sender: Address;
850
+ name: string;
851
+ referralId: string;
852
+ }
853
+ interface SetAliasNameParams {
854
+ userId: string;
855
+ alias: string;
856
+ }
857
+ interface SetAutolendParams {
858
+ userId: string;
859
+ enabled: boolean;
860
+ }
861
+ interface DepositToVaultParams {
862
+ userId: string;
863
+ vaultId: string;
864
+ amount: string;
865
+ }
866
+ interface DepositTokenParams {
867
+ userId: string;
868
+ amount: string;
869
+ tokenAddress: Address;
870
+ }
871
+ interface WithdrawFromVaultParams {
872
+ userId: string;
873
+ vaultId: string;
874
+ amount: string;
875
+ max: boolean;
876
+ }
877
+ interface RedeemTokenParams {
878
+ userId: string;
879
+ token: Address;
880
+ amount: string;
881
+ max: boolean;
882
+ }
883
+ interface LendTokenParams {
884
+ userId: string;
885
+ token: Address;
886
+ amount: string;
887
+ max: boolean;
888
+ }
889
+ interface ClaimReferralFeesParams {
890
+ userId: string;
891
+ referrals: string[];
892
+ }
893
+ interface TransferToUserParams {
894
+ userId: string;
895
+ tokenAddress: Address;
896
+ amount: string;
897
+ borrow: boolean;
898
+ recipient: string;
899
+ }
900
+ interface IGetChartCandlesInRange {
901
+ marketName: string;
902
+ interval: ChartInterval;
903
+ timestampStartMs?: number;
904
+ timestampEndMs?: number;
905
+ cursor?: PaginationCursor;
906
+ }
907
+ interface PlaceMultiplePerpOrdersParams {
908
+ userId: string;
909
+ perpOrders: PerpOrderData[];
910
+ }
911
+ interface PerpOrderData {
912
+ market: string;
913
+ isBid: boolean;
914
+ price: string;
915
+ size: string;
916
+ postOnly?: boolean;
917
+ reduceOnly?: boolean;
918
+ }
919
+ type WsOracleUpdates = Extract<WsMessage, {
920
+ type: 'OracleUpdates';
921
+ }>;
922
+ type WsUserUpdates = Extract<WsMessage, {
923
+ type: 'BalanceChange' | 'Deposit' | 'Withdraw' | 'WithdrawLend' | 'Lend' | 'Borrow' | 'RepayBorrow' | 'PlacePerpLimitOrder' | 'PlacePerpMarketOrder' | 'CanceledPerpOrders' | 'OrderFills' | 'SetAutoLend' | 'SetAlias' | 'AddApiKey' | 'RemoveApiKey' | 'ClaimReferralFee' | 'UpdateUserFeeTier' | 'UserTransferSent' | 'UserTransferReceived' | 'ReferralUpdate';
924
+ }>;
925
+ type WsPerpMarketUpdates = Extract<WsMessage, {
926
+ type: 'OrderbookUpdate' | 'TradesUpdate';
927
+ }>;
928
+ type WsBorrowLendUpdate = Extract<WsMessage, {
929
+ type: 'BorrowLendUpdate';
930
+ }>;
812
931
 
813
932
  /**
814
933
  * Manages sequence numbers for Aptos blockchain transactions.
@@ -903,19 +1022,18 @@ declare class Client {
903
1022
  _subscriptions: Map<string, (data: WsMessage) => void>;
904
1023
  _sequenceNumberManager: AccountSequenceNumber;
905
1024
  timeout: number;
906
- static init(connection: Aptos, apiKey?: Account, url?: string, enableWs?: boolean, chainId?: number): Promise<Client>;
907
- constructor(connection: Aptos, url: string, ws?: WebSocket, apiKey?: Account, chainId?: number);
908
- static initWebSocket(url: string, timeout?: number): Promise<WebSocket>;
909
- sendWsMessage(message: WsCommand): Promise<WsMessage>;
910
- static create(connection: Aptos, apiKey?: Account, url?: string, enableWs?: boolean): Promise<Client>;
1025
+ static init(connection: Aptos, enableWs?: boolean, url?: string, apiKey?: Account, chainId?: number): Promise<Client>;
1026
+ constructor(connection: Aptos, enableWs: boolean, url?: string, apiKey?: Account, chainId?: number);
1027
+ static create(connection: Aptos, enableWs?: boolean, url?: string, apiKey?: Account): Promise<Client>;
911
1028
  setApiKey(apiKey: Account): Promise<void>;
912
1029
  getApiKeySequenceNumber(): Promise<bigint | null>;
913
1030
  fetchApiKeySequenceNumber(): Promise<number>;
914
- createUser(params: CreateUserParams): Promise<{
915
- tx: MultiAgentTransaction;
916
- signature: AccountAuthenticator;
917
- apiKey: _aptos_labs_ts_sdk.Ed25519Account;
918
- }>;
1031
+ connectWebSocket(): Promise<void>;
1032
+ private _setupWebSocketHandlers;
1033
+ static initWebSocket(url: string, timeout?: number): Promise<WebSocket>;
1034
+ disconnectWebSocket(): Promise<void>;
1035
+ isWebSocketConnected(): boolean;
1036
+ sendWsMessage(message: WsCommand): Promise<WsMessage>;
919
1037
  subscribeIndexPricesUpdates(callback: (data: WsOracleUpdates) => void): Promise<() => Promise<void>>;
920
1038
  unsubscribeIndexPricesUpdates(): Promise<void>;
921
1039
  subscribeBorrowLendingUpdates(callback: (data: WsBorrowLendUpdate) => void): Promise<() => Promise<void>>;
@@ -924,27 +1042,34 @@ declare class Client {
924
1042
  unsubscribeUserUpdates(userId: string): Promise<void>;
925
1043
  subscribePerpMarketUpdates(market: string, callback: (data: WsPerpMarketUpdates) => void): Promise<() => Promise<void>>;
926
1044
  unsubscribePerpMarketUpdates(market: string): Promise<void>;
1045
+ createUser(params: CreateUserParams): Promise<{
1046
+ tx: MultiAgentTransaction;
1047
+ signature: AccountAuthenticator;
1048
+ apiKey: _aptos_labs_ts_sdk.Ed25519Account;
1049
+ }>;
927
1050
  addApiKey(params: AddApiKeyParams): Promise<_aptos_labs_ts_sdk.TransactionPayloadEntryFunction>;
1051
+ depositTokenPayload(params: DepositTokenParams): Promise<_aptos_labs_ts_sdk.TransactionPayloadEntryFunction>;
1052
+ submitSponsoredTransaction: (tx: SimpleTransaction, signature: AccountAuthenticator) => Promise<SubmitSponsoredTransactionResponse>;
1053
+ createAndSubmitTransaction(aptosPayload: any): Promise<SubmitSponsoredTransactionResponse>;
928
1054
  removeApiKey(params: RemoveApiKeyParams): Promise<SubmitSponsoredTransactionResponse>;
929
1055
  setAliasName(params: SetAliasNameParams): Promise<SubmitSponsoredTransactionResponse>;
930
- placePerpLimitOrder(params: PlacePerpLimitOrderParams): Promise<SubmitSponsoredTransactionResponse>;
931
- placePerpMarketOrder(params: PlacePerpMarketOrderParams): Promise<SubmitSponsoredTransactionResponse>;
1056
+ placePerpLimitOrder(params: PlacePerpOrderParams): Promise<SubmitSponsoredTransactionResponse>;
1057
+ placePerpMarketOrder(params: PlacePerpOrderParams): Promise<SubmitSponsoredTransactionResponse>;
932
1058
  changePerpOrderPrice(params: ChangePerpOrderPriceParams): Promise<SubmitSponsoredTransactionResponse>;
933
1059
  cancelPerpOrders(params: CancelPerpOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
934
1060
  cancelAllPerpOrders(params: CancelAllPerpOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
935
1061
  setAutolend(params: SetAutolendParams): Promise<SubmitSponsoredTransactionResponse>;
936
- depositTokenPayload(params: DepositTokenParams): Promise<_aptos_labs_ts_sdk.TransactionPayloadEntryFunction>;
937
1062
  depositToVault(params: DepositToVaultParams): Promise<SubmitSponsoredTransactionResponse>;
938
1063
  withdrawFromVault(params: WithdrawFromVaultParams): Promise<SubmitSponsoredTransactionResponse>;
939
1064
  redeemToken(params: RedeemTokenParams): Promise<SubmitSponsoredTransactionResponse>;
940
1065
  lendToken(params: LendTokenParams): Promise<SubmitSponsoredTransactionResponse>;
941
1066
  claimReferralFees(params: ClaimReferralFeesParams): Promise<SubmitSponsoredTransactionResponse>;
942
1067
  transferToUser(params: TransferToUserParams): Promise<SubmitSponsoredTransactionResponse>;
1068
+ placeMultiplePerpOrders(params: PlaceMultiplePerpOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
943
1069
  sendGetJson: (endpoint: string, message?: {
944
1070
  [key: string]: any;
945
1071
  }) => Promise<any>;
946
1072
  sendPostJson: (message: object, endpoint: string) => Promise<any>;
947
- submitSponsoredTransaction: (tx: SimpleTransaction, signature: AccountAuthenticator) => Promise<SubmitSponsoredTransactionResponse>;
948
1073
  getConfig: () => Promise<ExchangeConfig>;
949
1074
  getTokensConfig: () => Promise<GetTokensConfigResponse>;
950
1075
  getPerpetualMarketsConfig: () => Promise<GetPerpetualMarketsConfigResponse>;
@@ -968,118 +1093,6 @@ declare class Client {
968
1093
  getUserAggregatedReferralStats: (request: GetUserAggregatedReferralStatsRequest) => Promise<GetUserAggregatedReferralStatsResponse>;
969
1094
  getTime: () => Promise<string>;
970
1095
  }
971
- interface ChangePerpOrderPriceParams {
972
- userId: string;
973
- market: string;
974
- orderId: string;
975
- newPrice: string;
976
- postOnly: boolean;
977
- }
978
- interface PlacePerpLimitOrderParams {
979
- userId: string;
980
- market: string;
981
- isBid: boolean;
982
- price: string;
983
- size: string;
984
- postOnly: boolean;
985
- reduceOnly: boolean;
986
- }
987
- interface PlacePerpMarketOrderParams {
988
- userId: string;
989
- market: string;
990
- isBid: boolean;
991
- maxPrice: string;
992
- size: string;
993
- reduceOnly: boolean;
994
- }
995
- interface CancelAllPerpOrdersParams {
996
- userId: string;
997
- }
998
- interface CancelPerpOrdersParams {
999
- userId: string;
1000
- markets: string[];
1001
- orderIds: string[][];
1002
- }
1003
- interface AddApiKeyParams {
1004
- apiKey: Address;
1005
- userId: string;
1006
- expiration: string;
1007
- }
1008
- interface RemoveApiKeyParams {
1009
- apiKey: Address;
1010
- userId: string;
1011
- }
1012
- interface CreateUserParams {
1013
- sender: Address;
1014
- name: string;
1015
- referralId: string;
1016
- }
1017
- interface SetAliasNameParams {
1018
- userId: string;
1019
- alias: string;
1020
- }
1021
- interface SetAutolendParams {
1022
- userId: string;
1023
- enabled: boolean;
1024
- }
1025
- interface DepositToVaultParams {
1026
- userId: string;
1027
- vaultId: string;
1028
- amount: string;
1029
- }
1030
- interface DepositTokenParams {
1031
- userId: string;
1032
- amount: string;
1033
- tokenAddress: Address;
1034
- }
1035
- interface WithdrawFromVaultParams {
1036
- userId: string;
1037
- vaultId: string;
1038
- amount: string;
1039
- max: boolean;
1040
- }
1041
- interface RedeemTokenParams {
1042
- userId: string;
1043
- token: Address;
1044
- amount: string;
1045
- max: boolean;
1046
- }
1047
- interface LendTokenParams {
1048
- userId: string;
1049
- token: Address;
1050
- amount: string;
1051
- max: boolean;
1052
- }
1053
- interface ClaimReferralFeesParams {
1054
- userId: string;
1055
- referrals: string[];
1056
- }
1057
- interface TransferToUserParams {
1058
- userId: string;
1059
- tokenAddress: Address;
1060
- amount: string;
1061
- borrow: boolean;
1062
- recipient: string;
1063
- }
1064
- interface IGetChartCandlesInRange {
1065
- marketName: string;
1066
- interval: ChartInterval;
1067
- timestampStartMs?: number;
1068
- timestampEndMs?: number;
1069
- cursor?: PaginationCursor;
1070
- }
1071
- type WsOracleUpdates = Extract<WsMessage, {
1072
- type: 'OracleUpdates';
1073
- }>;
1074
- type WsUserUpdates = Extract<WsMessage, {
1075
- type: 'BalanceChange' | 'Deposit' | 'Withdraw' | 'WithdrawLend' | 'Lend' | 'Borrow' | 'RepayBorrow' | 'PlacePerpLimitOrder' | 'PlacePerpMarketOrder' | 'CanceledPerpOrders' | 'OrderFills' | 'SetAutoLend' | 'SetAlias' | 'AddApiKey' | 'RemoveApiKey' | 'ClaimReferralFee' | 'UpdateUserFeeTier' | 'UserTransferSent' | 'UserTransferReceived';
1076
- }>;
1077
- type WsPerpMarketUpdates = Extract<WsMessage, {
1078
- type: 'OrderbookUpdate' | 'TradesUpdate';
1079
- }>;
1080
- type WsBorrowLendUpdate = Extract<WsMessage, {
1081
- type: 'BorrowLendUpdate';
1082
- }>;
1083
1096
 
1084
1097
  declare function parseEntryFunctionAbi(args: {
1085
1098
  moduleAbi: MoveModule;
@@ -1094,8 +1107,8 @@ declare const ExchangeProxies: {
1094
1107
  declare const GLOBAL_DENOMINATOR = 100000000;
1095
1108
 
1096
1109
  declare class TestFaucet extends Client {
1097
- constructor(connection: Aptos, url: string, ws?: WebSocket, apiKey?: Account);
1098
- static create(connection: Aptos, apiKey?: Account, url?: string, enableWs?: boolean): Promise<TestFaucet>;
1110
+ constructor(connection: Aptos, enableWs: boolean, url?: string, apiKey?: Account);
1111
+ static create(connection: Aptos, enableWs?: boolean, url?: string, apiKey?: Account): Promise<TestFaucet>;
1099
1112
  initFaucetPayload(): _thalalabs_surf.EntryPayload;
1100
1113
  initFaucet(): Promise<SubmitSponsoredTransactionResponse>;
1101
1114
  mintTokenPayload(receiver: Address, token: string, amount: number): _thalalabs_surf.EntryPayload;
@@ -1110,4 +1123,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
1110
1123
  declare const getTopicFromCommand: (data: WsCommand) => string;
1111
1124
  declare const getTopicFromMessage: (data: WsMessage) => string;
1112
1125
 
1113
- export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type ClaimReferralFee, type ClaimReferralFeesParams, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTradeStats, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, Network, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, PerpetualMarketStatus, type PlacePerpLimitOrder, type PlacePerpLimitOrderParams, type PlacePerpMarketOrder, type PlacePerpMarketOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type RemoveApiKey, type RemoveApiKeyParams, type RepayBorrow, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, type TransferToUserParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultInvestment, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsBorrowLendUpdate, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
1126
+ export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLendUpdate, type BorrowLending, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, type ChartCandle, ChartInterval, type ClaimReferralFee, type ClaimReferralFeesParams, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type FeeTier, type Fees, type FundingCheckpoint, type FundingPayment, type FundingRate, GLOBAL_DENOMINATOR, type GetBorrowLendingDataResponse, type GetChartCandlesInRangeRequest, type GetChartCandlesInRangeResponse, type GetPerpMarketsDataRequest, type GetPerpMarketsDataResponse, type GetPerpOrderBookDataRequest, type GetPerpOrderBookDataResponse, type GetPerpRecentTradesRequest, type GetPerpRecentTradesResponse, type GetPerpUserFillsRequest, type GetPerpUserFillsResponse, type GetPerpUserOrdersRequest, type GetPerpUserOrdersResponse, type GetPerpetualMarketsConfigResponse, type GetPriceIndexesResponse, type GetTokensConfigResponse, type GetUserAggregatedReferralStatsRequest, type GetUserAggregatedReferralStatsResponse, type GetUserAggregatedStatsRequest, type GetUserAggregatedStatsResponse, type GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, type GetUserReferralStatsHistoryRequest, type GetUserReferralStatsHistoryResponse, type GetUserTradeStatsHistoryRequest, type GetUserTradeStatsHistoryResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, type HistoricalReferralStats, type HistoricalTradeStats, type HistoricalWithdraw, type IGetChartCandlesInRange, type Lend, type LendTokenParams, type MarginStep, Network, type OracleUpdate, type OracleUpdates, type Order, type OrderFills, OrderSide, OrderStatus, OrderType, type OrderbookUpdate, type PaginationCursor, type PerpFill, type PerpMarketData, type PerpOrder, type PerpOrderBookData, type PerpOrderData, type PerpPosition, type PerpTrade, type PerpetualMarketConfigEntry, PerpetualMarketStatus, type PlaceMultiplePerpOrdersParams, type PlacePerpLimitOrder, type PlacePerpMarketOrder, type PlacePerpOrderParams, type PriceIndex, type RedeemTokenParams, type Referral, type ReferralUpdate, type RemoveApiKey, type RemoveApiKeyParams, type RepayBorrow, type SetAlias, type SetAliasNameParams, type SetAutoLend, type SetAutolendParams, Status, type StatusResponse, type SubmitSponsoredTransactionRequest, type SubmitSponsoredTransactionResponse, TestFaucet, type TimeResponse, type TokenConfigEntry, type Topic, type Trade, TradeRole, type TradesUpdate, type TransferToUserParams, type UpdateUserFeeTier, type User, type UserAggregatedReferralStats, type UserAggregatedStats, type UserPortfolioValue, UserStatus, type UserTransfer, type UtilizationCurve, type Vault, type VaultInvestment, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsBorrowLendUpdate, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };