@nightlylabs/dex-sdk 0.0.31 → 0.0.33
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.cjs +2 -14
- package/dist/index.d.cts +17 -16
- package/dist/index.d.ts +17 -16
- package/dist/index.js +2 -14
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1145,26 +1145,14 @@ var Client = class _Client {
|
|
|
1145
1145
|
return await this.submitSponsoredTransaction(tx, signature);
|
|
1146
1146
|
}
|
|
1147
1147
|
async placePerpLimitOrder(params) {
|
|
1148
|
-
const payload = (0, import_surf.createEntryPayload)(placePerpLimitOrder_default, {
|
|
1149
|
-
function: "place_perp_limit_order",
|
|
1150
|
-
functionArguments: [
|
|
1151
|
-
params.userId,
|
|
1152
|
-
params.market,
|
|
1153
|
-
params.isBid,
|
|
1154
|
-
params.price,
|
|
1155
|
-
params.size,
|
|
1156
|
-
params.postOnly
|
|
1157
|
-
],
|
|
1158
|
-
typeArguments: []
|
|
1159
|
-
});
|
|
1160
1148
|
const sequenceNumber = await this.getApiKeySequenceNumber();
|
|
1161
1149
|
const aptosPayload = await (0, import_ts_sdk2.generateTransactionPayload)({
|
|
1162
1150
|
aptosConfig: this._aptos.config,
|
|
1163
1151
|
abi: parseEntryFunctionAbi({
|
|
1164
1152
|
moduleAbi: placePerpLimitOrder_default,
|
|
1165
|
-
functionName:
|
|
1153
|
+
functionName: placePerpLimitOrder_default.name,
|
|
1166
1154
|
moduleAddress: placePerpLimitOrder_default.address,
|
|
1167
|
-
moduleName:
|
|
1155
|
+
moduleName: placePerpLimitOrder_default.name
|
|
1168
1156
|
}),
|
|
1169
1157
|
function: `${placePerpLimitOrder_default.address}::${placePerpLimitOrder_default.name}::place_perp_limit_order`,
|
|
1170
1158
|
typeArguments: [],
|
package/dist/index.d.cts
CHANGED
|
@@ -222,20 +222,15 @@ interface GetUserDepositsRequest {
|
|
|
222
222
|
userId: string;
|
|
223
223
|
paginationCursor?: PaginationCursor;
|
|
224
224
|
}
|
|
225
|
-
interface
|
|
225
|
+
interface HistoricalDeposit {
|
|
226
226
|
user_id: string;
|
|
227
227
|
token_address: string;
|
|
228
228
|
hash: string;
|
|
229
229
|
amount: string;
|
|
230
230
|
timestamp: string;
|
|
231
231
|
}
|
|
232
|
-
interface Deposit {
|
|
233
|
-
userId: string;
|
|
234
|
-
tokenAddress: string;
|
|
235
|
-
amount: string;
|
|
236
|
-
}
|
|
237
232
|
interface GetUserDepositsResponse {
|
|
238
|
-
deposits:
|
|
233
|
+
deposits: HistoricalDeposit[];
|
|
239
234
|
pagination_cursor?: PaginationCursor;
|
|
240
235
|
}
|
|
241
236
|
interface GetUserFundingHistoryRequest {
|
|
@@ -323,20 +318,15 @@ interface GetUserWithdrawalsRequest {
|
|
|
323
318
|
userId: string;
|
|
324
319
|
paginationCursor?: PaginationCursor;
|
|
325
320
|
}
|
|
326
|
-
interface
|
|
321
|
+
interface HistoricalWithdraw {
|
|
327
322
|
user_id: string;
|
|
328
323
|
token_address: string;
|
|
329
324
|
hash: string;
|
|
330
325
|
amount: string;
|
|
331
326
|
timestamp: string;
|
|
332
327
|
}
|
|
333
|
-
interface Withdraw {
|
|
334
|
-
userId: string;
|
|
335
|
-
tokenAddress: string;
|
|
336
|
-
amount: string;
|
|
337
|
-
}
|
|
338
328
|
interface GetUserWithdrawalsResponse {
|
|
339
|
-
deposits:
|
|
329
|
+
deposits: HistoricalWithdraw[];
|
|
340
330
|
pagination_cursor?: PaginationCursor;
|
|
341
331
|
}
|
|
342
332
|
interface GetUsersByAddressRequest {
|
|
@@ -381,7 +371,7 @@ interface OracleUpdates {
|
|
|
381
371
|
}
|
|
382
372
|
interface OrderbookUpdate {
|
|
383
373
|
market: string;
|
|
384
|
-
|
|
374
|
+
bidsUpdates: Record<string, string>;
|
|
385
375
|
asksUpdates: Record<string, string>;
|
|
386
376
|
}
|
|
387
377
|
interface Trade {
|
|
@@ -396,6 +386,17 @@ interface TradesUpdate {
|
|
|
396
386
|
updates: Trade[];
|
|
397
387
|
}
|
|
398
388
|
interface BalanceChange {
|
|
389
|
+
userId: string;
|
|
390
|
+
tokenAddress: string;
|
|
391
|
+
changeAmount: string;
|
|
392
|
+
currentBalance: string;
|
|
393
|
+
}
|
|
394
|
+
interface Deposit {
|
|
395
|
+
userId: string;
|
|
396
|
+
tokenAddress: string;
|
|
397
|
+
amount: string;
|
|
398
|
+
}
|
|
399
|
+
interface Withdraw {
|
|
399
400
|
userId: string;
|
|
400
401
|
tokenAddress: string;
|
|
401
402
|
amount: string;
|
|
@@ -904,4 +905,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
904
905
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
905
906
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
906
907
|
|
|
907
|
-
export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLending, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChartCandle, ChartInterval, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type Fees, type FundingCheckpoint, 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 GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalFunding, 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 User, UserStatus, type UtilizationCurve, type VaultInvestment, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
|
908
|
+
export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLending, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChartCandle, ChartInterval, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type Fees, type FundingCheckpoint, 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 GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, 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 User, UserStatus, type UtilizationCurve, type VaultInvestment, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
package/dist/index.d.ts
CHANGED
|
@@ -222,20 +222,15 @@ interface GetUserDepositsRequest {
|
|
|
222
222
|
userId: string;
|
|
223
223
|
paginationCursor?: PaginationCursor;
|
|
224
224
|
}
|
|
225
|
-
interface
|
|
225
|
+
interface HistoricalDeposit {
|
|
226
226
|
user_id: string;
|
|
227
227
|
token_address: string;
|
|
228
228
|
hash: string;
|
|
229
229
|
amount: string;
|
|
230
230
|
timestamp: string;
|
|
231
231
|
}
|
|
232
|
-
interface Deposit {
|
|
233
|
-
userId: string;
|
|
234
|
-
tokenAddress: string;
|
|
235
|
-
amount: string;
|
|
236
|
-
}
|
|
237
232
|
interface GetUserDepositsResponse {
|
|
238
|
-
deposits:
|
|
233
|
+
deposits: HistoricalDeposit[];
|
|
239
234
|
pagination_cursor?: PaginationCursor;
|
|
240
235
|
}
|
|
241
236
|
interface GetUserFundingHistoryRequest {
|
|
@@ -323,20 +318,15 @@ interface GetUserWithdrawalsRequest {
|
|
|
323
318
|
userId: string;
|
|
324
319
|
paginationCursor?: PaginationCursor;
|
|
325
320
|
}
|
|
326
|
-
interface
|
|
321
|
+
interface HistoricalWithdraw {
|
|
327
322
|
user_id: string;
|
|
328
323
|
token_address: string;
|
|
329
324
|
hash: string;
|
|
330
325
|
amount: string;
|
|
331
326
|
timestamp: string;
|
|
332
327
|
}
|
|
333
|
-
interface Withdraw {
|
|
334
|
-
userId: string;
|
|
335
|
-
tokenAddress: string;
|
|
336
|
-
amount: string;
|
|
337
|
-
}
|
|
338
328
|
interface GetUserWithdrawalsResponse {
|
|
339
|
-
deposits:
|
|
329
|
+
deposits: HistoricalWithdraw[];
|
|
340
330
|
pagination_cursor?: PaginationCursor;
|
|
341
331
|
}
|
|
342
332
|
interface GetUsersByAddressRequest {
|
|
@@ -381,7 +371,7 @@ interface OracleUpdates {
|
|
|
381
371
|
}
|
|
382
372
|
interface OrderbookUpdate {
|
|
383
373
|
market: string;
|
|
384
|
-
|
|
374
|
+
bidsUpdates: Record<string, string>;
|
|
385
375
|
asksUpdates: Record<string, string>;
|
|
386
376
|
}
|
|
387
377
|
interface Trade {
|
|
@@ -396,6 +386,17 @@ interface TradesUpdate {
|
|
|
396
386
|
updates: Trade[];
|
|
397
387
|
}
|
|
398
388
|
interface BalanceChange {
|
|
389
|
+
userId: string;
|
|
390
|
+
tokenAddress: string;
|
|
391
|
+
changeAmount: string;
|
|
392
|
+
currentBalance: string;
|
|
393
|
+
}
|
|
394
|
+
interface Deposit {
|
|
395
|
+
userId: string;
|
|
396
|
+
tokenAddress: string;
|
|
397
|
+
amount: string;
|
|
398
|
+
}
|
|
399
|
+
interface Withdraw {
|
|
399
400
|
userId: string;
|
|
400
401
|
tokenAddress: string;
|
|
401
402
|
amount: string;
|
|
@@ -904,4 +905,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
904
905
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
905
906
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
906
907
|
|
|
907
|
-
export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLending, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChartCandle, ChartInterval, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type Fees, type FundingCheckpoint, 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 GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalFunding, 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 User, UserStatus, type UtilizationCurve, type VaultInvestment, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
|
908
|
+
export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLending, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChartCandle, ChartInterval, Client, type Content, type CreateUserParams, type Deposit, type DepositToVaultParams, type DepositTokenParams, EndpointsV1, type ErrorResponse, type ExchangeConfig, ExchangeProxies, type Fees, type FundingCheckpoint, 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 GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserWithdrawalsRequest, type GetUserWithdrawalsResponse, type GetUsersByAddressRequest, type GetUsersByAddressResponse, type HistoricalDeposit, type HistoricalFunding, 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 User, UserStatus, type UtilizationCurve, type VaultInvestment, type Withdraw, type WithdrawFromVaultParams, type WithdrawLend, type WsCommand, type WsFill, type WsMessage, type WsOracleUpdates, type WsPerpMarketUpdates, type WsUserUpdates, generateApiKey, getRandomId, getTopicFromCommand, getTopicFromMessage, nowInMiliseconds, parseEntryFunctionAbi, sleep, toSystemValue };
|
package/dist/index.js
CHANGED
|
@@ -1094,26 +1094,14 @@ var Client = class _Client {
|
|
|
1094
1094
|
return await this.submitSponsoredTransaction(tx, signature);
|
|
1095
1095
|
}
|
|
1096
1096
|
async placePerpLimitOrder(params) {
|
|
1097
|
-
const payload = createEntryPayload(placePerpLimitOrder_default, {
|
|
1098
|
-
function: "place_perp_limit_order",
|
|
1099
|
-
functionArguments: [
|
|
1100
|
-
params.userId,
|
|
1101
|
-
params.market,
|
|
1102
|
-
params.isBid,
|
|
1103
|
-
params.price,
|
|
1104
|
-
params.size,
|
|
1105
|
-
params.postOnly
|
|
1106
|
-
],
|
|
1107
|
-
typeArguments: []
|
|
1108
|
-
});
|
|
1109
1097
|
const sequenceNumber = await this.getApiKeySequenceNumber();
|
|
1110
1098
|
const aptosPayload = await generateTransactionPayload({
|
|
1111
1099
|
aptosConfig: this._aptos.config,
|
|
1112
1100
|
abi: parseEntryFunctionAbi({
|
|
1113
1101
|
moduleAbi: placePerpLimitOrder_default,
|
|
1114
|
-
functionName:
|
|
1102
|
+
functionName: placePerpLimitOrder_default.name,
|
|
1115
1103
|
moduleAddress: placePerpLimitOrder_default.address,
|
|
1116
|
-
moduleName:
|
|
1104
|
+
moduleName: placePerpLimitOrder_default.name
|
|
1117
1105
|
}),
|
|
1118
1106
|
function: `${placePerpLimitOrder_default.address}::${placePerpLimitOrder_default.name}::place_perp_limit_order`,
|
|
1119
1107
|
typeArguments: [],
|