@nightlylabs/dex-sdk 0.0.52 → 0.0.53
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 +79 -16
- package/dist/index.d.cts +9 -1
- package/dist/index.d.ts +9 -1
- package/dist/index.js +79 -16
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -266,8 +266,35 @@ var ABI8 = {
|
|
|
266
266
|
};
|
|
267
267
|
var placePerpLimitOrder_default = ABI8;
|
|
268
268
|
|
|
269
|
-
// generated_types/
|
|
269
|
+
// generated_types/changePerpOrderPrice.ts
|
|
270
270
|
var ABI9 = {
|
|
271
|
+
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
272
|
+
"name": "change_perp_order_price",
|
|
273
|
+
"friends": [],
|
|
274
|
+
"exposed_functions": [
|
|
275
|
+
{
|
|
276
|
+
"name": "change_perp_order_price",
|
|
277
|
+
"visibility": "public",
|
|
278
|
+
"is_entry": true,
|
|
279
|
+
"is_view": false,
|
|
280
|
+
"generic_type_params": [],
|
|
281
|
+
"params": [
|
|
282
|
+
"&signer",
|
|
283
|
+
"u64",
|
|
284
|
+
"vector<u8>",
|
|
285
|
+
"u64",
|
|
286
|
+
"u64",
|
|
287
|
+
"bool"
|
|
288
|
+
],
|
|
289
|
+
"return": []
|
|
290
|
+
}
|
|
291
|
+
],
|
|
292
|
+
"structs": []
|
|
293
|
+
};
|
|
294
|
+
var changePerpOrderPrice_default = ABI9;
|
|
295
|
+
|
|
296
|
+
// generated_types/placePerpMarketOrder.ts
|
|
297
|
+
var ABI10 = {
|
|
271
298
|
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
272
299
|
"name": "place_perp_market_order",
|
|
273
300
|
"friends": [],
|
|
@@ -292,10 +319,10 @@ var ABI9 = {
|
|
|
292
319
|
],
|
|
293
320
|
"structs": []
|
|
294
321
|
};
|
|
295
|
-
var placePerpMarketOrder_default =
|
|
322
|
+
var placePerpMarketOrder_default = ABI10;
|
|
296
323
|
|
|
297
324
|
// generated_types/redeemToken.ts
|
|
298
|
-
var
|
|
325
|
+
var ABI11 = {
|
|
299
326
|
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
300
327
|
"name": "redeem_token",
|
|
301
328
|
"friends": [],
|
|
@@ -318,10 +345,10 @@ var ABI10 = {
|
|
|
318
345
|
],
|
|
319
346
|
"structs": []
|
|
320
347
|
};
|
|
321
|
-
var redeemToken_default =
|
|
348
|
+
var redeemToken_default = ABI11;
|
|
322
349
|
|
|
323
350
|
// generated_types/removeApiKey.ts
|
|
324
|
-
var
|
|
351
|
+
var ABI12 = {
|
|
325
352
|
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
326
353
|
"name": "remove_api_key",
|
|
327
354
|
"friends": [],
|
|
@@ -342,10 +369,10 @@ var ABI11 = {
|
|
|
342
369
|
],
|
|
343
370
|
"structs": []
|
|
344
371
|
};
|
|
345
|
-
var removeApiKey_default =
|
|
372
|
+
var removeApiKey_default = ABI12;
|
|
346
373
|
|
|
347
374
|
// generated_types/setAliasName.ts
|
|
348
|
-
var
|
|
375
|
+
var ABI13 = {
|
|
349
376
|
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
350
377
|
"name": "set_alias_name",
|
|
351
378
|
"friends": [],
|
|
@@ -366,10 +393,10 @@ var ABI12 = {
|
|
|
366
393
|
],
|
|
367
394
|
"structs": []
|
|
368
395
|
};
|
|
369
|
-
var setAliasName_default =
|
|
396
|
+
var setAliasName_default = ABI13;
|
|
370
397
|
|
|
371
398
|
// generated_types/setAutolend.ts
|
|
372
|
-
var
|
|
399
|
+
var ABI14 = {
|
|
373
400
|
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
374
401
|
"name": "set_autolend",
|
|
375
402
|
"friends": [],
|
|
@@ -390,7 +417,7 @@ var ABI13 = {
|
|
|
390
417
|
],
|
|
391
418
|
"structs": []
|
|
392
419
|
};
|
|
393
|
-
var setAutolend_default =
|
|
420
|
+
var setAutolend_default = ABI14;
|
|
394
421
|
|
|
395
422
|
// generated_types/typeshareTypes.ts
|
|
396
423
|
var PerpetualMarketStatus = /* @__PURE__ */ ((PerpetualMarketStatus2) => {
|
|
@@ -472,7 +499,7 @@ var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
|
472
499
|
})(UserStatus || {});
|
|
473
500
|
|
|
474
501
|
// generated_types/withdrawFromVault.ts
|
|
475
|
-
var
|
|
502
|
+
var ABI15 = {
|
|
476
503
|
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
477
504
|
"name": "withdraw_from_vault",
|
|
478
505
|
"friends": [],
|
|
@@ -495,7 +522,7 @@ var ABI14 = {
|
|
|
495
522
|
],
|
|
496
523
|
"structs": []
|
|
497
524
|
};
|
|
498
|
-
var withdrawFromVault_default =
|
|
525
|
+
var withdrawFromVault_default = ABI15;
|
|
499
526
|
|
|
500
527
|
// src/utils.ts
|
|
501
528
|
var import_ts_sdk = require("@aptos-labs/ts-sdk");
|
|
@@ -1275,6 +1302,42 @@ var Client = class _Client {
|
|
|
1275
1302
|
});
|
|
1276
1303
|
return await this.submitSponsoredTransaction(tx, signature);
|
|
1277
1304
|
}
|
|
1305
|
+
async changePerpOrderPrice(params) {
|
|
1306
|
+
const sequenceNumber = await this.getApiKeySequenceNumber();
|
|
1307
|
+
const aptosPayload = await (0, import_ts_sdk2.generateTransactionPayload)({
|
|
1308
|
+
aptosConfig: this._aptos.config,
|
|
1309
|
+
abi: parseEntryFunctionAbi({
|
|
1310
|
+
moduleAbi: changePerpOrderPrice_default,
|
|
1311
|
+
functionName: changePerpOrderPrice_default.name,
|
|
1312
|
+
moduleAddress: changePerpOrderPrice_default.address,
|
|
1313
|
+
moduleName: changePerpOrderPrice_default.name
|
|
1314
|
+
}),
|
|
1315
|
+
function: `${changePerpOrderPrice_default.address}::${changePerpOrderPrice_default.name}::change_perp_order_price`,
|
|
1316
|
+
typeArguments: [],
|
|
1317
|
+
functionArguments: [
|
|
1318
|
+
params.userId,
|
|
1319
|
+
params.market,
|
|
1320
|
+
params.orderId,
|
|
1321
|
+
params.newPrice,
|
|
1322
|
+
params.postOnly
|
|
1323
|
+
]
|
|
1324
|
+
});
|
|
1325
|
+
const rawTx = new import_ts_sdk2.RawTransaction(
|
|
1326
|
+
import_ts_sdk2.AccountAddress.from(this._apiKey.accountAddress),
|
|
1327
|
+
BigInt(sequenceNumber),
|
|
1328
|
+
aptosPayload,
|
|
1329
|
+
BigInt(1e4),
|
|
1330
|
+
BigInt(100),
|
|
1331
|
+
BigInt(Date.now() + 10 * 1e3),
|
|
1332
|
+
new import_ts_sdk2.ChainId(this._chainId)
|
|
1333
|
+
);
|
|
1334
|
+
const tx = new import_ts_sdk2.SimpleTransaction(rawTx, import_ts_sdk2.AccountAddress.ZERO);
|
|
1335
|
+
const signature = this._aptos.sign({
|
|
1336
|
+
signer: this._apiKey,
|
|
1337
|
+
transaction: tx
|
|
1338
|
+
});
|
|
1339
|
+
return await this.submitSponsoredTransaction(tx, signature);
|
|
1340
|
+
}
|
|
1278
1341
|
async cancelPerpOrders(params) {
|
|
1279
1342
|
const sequenceNumber = await this.getApiKeySequenceNumber();
|
|
1280
1343
|
const aptosPayload = await (0, import_ts_sdk2.generateTransactionPayload)({
|
|
@@ -1559,7 +1622,7 @@ function parseEntryFunctionAbi(args) {
|
|
|
1559
1622
|
var import_surf2 = require("@thalalabs/surf");
|
|
1560
1623
|
|
|
1561
1624
|
// generated_types/faucetEntrypoints.ts
|
|
1562
|
-
var
|
|
1625
|
+
var ABI16 = {
|
|
1563
1626
|
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
1564
1627
|
"name": "faucet_entrypoints",
|
|
1565
1628
|
"friends": [],
|
|
@@ -1591,10 +1654,10 @@ var ABI15 = {
|
|
|
1591
1654
|
],
|
|
1592
1655
|
"structs": []
|
|
1593
1656
|
};
|
|
1594
|
-
var faucetEntrypoints_default =
|
|
1657
|
+
var faucetEntrypoints_default = ABI16;
|
|
1595
1658
|
|
|
1596
1659
|
// generated_types/testFaucet.ts
|
|
1597
|
-
var
|
|
1660
|
+
var ABI17 = {
|
|
1598
1661
|
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
1599
1662
|
"name": "test_faucet",
|
|
1600
1663
|
"friends": [],
|
|
@@ -1828,7 +1891,7 @@ var ABI16 = {
|
|
|
1828
1891
|
}
|
|
1829
1892
|
]
|
|
1830
1893
|
};
|
|
1831
|
-
var testFaucet_default =
|
|
1894
|
+
var testFaucet_default = ABI17;
|
|
1832
1895
|
|
|
1833
1896
|
// src/testFaucet.ts
|
|
1834
1897
|
var TestFaucet = class _TestFaucet extends client_default {
|
package/dist/index.d.cts
CHANGED
|
@@ -800,6 +800,7 @@ declare class Client {
|
|
|
800
800
|
setAliasName(params: SetAliasNameParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
801
801
|
placePerpLimitOrder(params: PlacePerpLimitOrderParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
802
802
|
placePerpMarketOrder(params: PlacePerpMarketOrderParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
803
|
+
changePerpOrderPrice(params: ChangePerpOrderPriceParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
803
804
|
cancelPerpOrders(params: CancelPerpOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
804
805
|
cancelAllPerpOrders(params: CancelAllPerpOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
805
806
|
setAutolend(params: SetAutolendParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
@@ -832,6 +833,13 @@ declare class Client {
|
|
|
832
833
|
getUserPortfolioValueHistory: (request: GetUserPortfolioValueRequest) => Promise<GetUserPortfolioValueResponse>;
|
|
833
834
|
getTime: () => Promise<string>;
|
|
834
835
|
}
|
|
836
|
+
interface ChangePerpOrderPriceParams {
|
|
837
|
+
userId: string;
|
|
838
|
+
market: string;
|
|
839
|
+
orderId: string;
|
|
840
|
+
newPrice: string;
|
|
841
|
+
postOnly: boolean;
|
|
842
|
+
}
|
|
835
843
|
interface PlacePerpLimitOrderParams {
|
|
836
844
|
userId: string;
|
|
837
845
|
market: string;
|
|
@@ -953,4 +961,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
953
961
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
954
962
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
955
963
|
|
|
956
|
-
export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, 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 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 GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, 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, type UserPortfolioValue, UserStatus, type UtilizationCurve, type Vault, 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 };
|
|
964
|
+
export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLending, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, 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 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 GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, 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, type UserPortfolioValue, UserStatus, type UtilizationCurve, type Vault, 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
|
@@ -800,6 +800,7 @@ declare class Client {
|
|
|
800
800
|
setAliasName(params: SetAliasNameParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
801
801
|
placePerpLimitOrder(params: PlacePerpLimitOrderParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
802
802
|
placePerpMarketOrder(params: PlacePerpMarketOrderParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
803
|
+
changePerpOrderPrice(params: ChangePerpOrderPriceParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
803
804
|
cancelPerpOrders(params: CancelPerpOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
804
805
|
cancelAllPerpOrders(params: CancelAllPerpOrdersParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
805
806
|
setAutolend(params: SetAutolendParams): Promise<SubmitSponsoredTransactionResponse>;
|
|
@@ -832,6 +833,13 @@ declare class Client {
|
|
|
832
833
|
getUserPortfolioValueHistory: (request: GetUserPortfolioValueRequest) => Promise<GetUserPortfolioValueResponse>;
|
|
833
834
|
getTime: () => Promise<string>;
|
|
834
835
|
}
|
|
836
|
+
interface ChangePerpOrderPriceParams {
|
|
837
|
+
userId: string;
|
|
838
|
+
market: string;
|
|
839
|
+
orderId: string;
|
|
840
|
+
newPrice: string;
|
|
841
|
+
postOnly: boolean;
|
|
842
|
+
}
|
|
835
843
|
interface PlacePerpLimitOrderParams {
|
|
836
844
|
userId: string;
|
|
837
845
|
market: string;
|
|
@@ -953,4 +961,4 @@ declare const generateApiKey: () => _aptos_labs_ts_sdk.Ed25519Account;
|
|
|
953
961
|
declare const getTopicFromCommand: (data: WsCommand) => string;
|
|
954
962
|
declare const getTopicFromMessage: (data: WsMessage) => string;
|
|
955
963
|
|
|
956
|
-
export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, 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 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 GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, 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, type UserPortfolioValue, UserStatus, type UtilizationCurve, type Vault, 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 };
|
|
964
|
+
export { type AddApiKey, type AddApiKeyParams, type Address, AdminEndpoints, type ApiStatus, type BalanceChange, BaseEndpoints, type Borrow, type BorrowLending, type CancelAllPerpOrdersParams, type CancelPerpOrdersParams, type CanceledPerpOrders, type ChangePerpOrderPriceParams, 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 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 GetUserDataRequest, type GetUserDataResponse, type GetUserDepositsRequest, type GetUserDepositsResponse, type GetUserFundingHistoryRequest, type GetUserFundingHistoryResponse, type GetUserPortfolioValueRequest, type GetUserPortfolioValueResponse, 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, type UserPortfolioValue, UserStatus, type UtilizationCurve, type Vault, 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
|
@@ -215,8 +215,35 @@ var ABI8 = {
|
|
|
215
215
|
};
|
|
216
216
|
var placePerpLimitOrder_default = ABI8;
|
|
217
217
|
|
|
218
|
-
// generated_types/
|
|
218
|
+
// generated_types/changePerpOrderPrice.ts
|
|
219
219
|
var ABI9 = {
|
|
220
|
+
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
221
|
+
"name": "change_perp_order_price",
|
|
222
|
+
"friends": [],
|
|
223
|
+
"exposed_functions": [
|
|
224
|
+
{
|
|
225
|
+
"name": "change_perp_order_price",
|
|
226
|
+
"visibility": "public",
|
|
227
|
+
"is_entry": true,
|
|
228
|
+
"is_view": false,
|
|
229
|
+
"generic_type_params": [],
|
|
230
|
+
"params": [
|
|
231
|
+
"&signer",
|
|
232
|
+
"u64",
|
|
233
|
+
"vector<u8>",
|
|
234
|
+
"u64",
|
|
235
|
+
"u64",
|
|
236
|
+
"bool"
|
|
237
|
+
],
|
|
238
|
+
"return": []
|
|
239
|
+
}
|
|
240
|
+
],
|
|
241
|
+
"structs": []
|
|
242
|
+
};
|
|
243
|
+
var changePerpOrderPrice_default = ABI9;
|
|
244
|
+
|
|
245
|
+
// generated_types/placePerpMarketOrder.ts
|
|
246
|
+
var ABI10 = {
|
|
220
247
|
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
221
248
|
"name": "place_perp_market_order",
|
|
222
249
|
"friends": [],
|
|
@@ -241,10 +268,10 @@ var ABI9 = {
|
|
|
241
268
|
],
|
|
242
269
|
"structs": []
|
|
243
270
|
};
|
|
244
|
-
var placePerpMarketOrder_default =
|
|
271
|
+
var placePerpMarketOrder_default = ABI10;
|
|
245
272
|
|
|
246
273
|
// generated_types/redeemToken.ts
|
|
247
|
-
var
|
|
274
|
+
var ABI11 = {
|
|
248
275
|
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
249
276
|
"name": "redeem_token",
|
|
250
277
|
"friends": [],
|
|
@@ -267,10 +294,10 @@ var ABI10 = {
|
|
|
267
294
|
],
|
|
268
295
|
"structs": []
|
|
269
296
|
};
|
|
270
|
-
var redeemToken_default =
|
|
297
|
+
var redeemToken_default = ABI11;
|
|
271
298
|
|
|
272
299
|
// generated_types/removeApiKey.ts
|
|
273
|
-
var
|
|
300
|
+
var ABI12 = {
|
|
274
301
|
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
275
302
|
"name": "remove_api_key",
|
|
276
303
|
"friends": [],
|
|
@@ -291,10 +318,10 @@ var ABI11 = {
|
|
|
291
318
|
],
|
|
292
319
|
"structs": []
|
|
293
320
|
};
|
|
294
|
-
var removeApiKey_default =
|
|
321
|
+
var removeApiKey_default = ABI12;
|
|
295
322
|
|
|
296
323
|
// generated_types/setAliasName.ts
|
|
297
|
-
var
|
|
324
|
+
var ABI13 = {
|
|
298
325
|
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
299
326
|
"name": "set_alias_name",
|
|
300
327
|
"friends": [],
|
|
@@ -315,10 +342,10 @@ var ABI12 = {
|
|
|
315
342
|
],
|
|
316
343
|
"structs": []
|
|
317
344
|
};
|
|
318
|
-
var setAliasName_default =
|
|
345
|
+
var setAliasName_default = ABI13;
|
|
319
346
|
|
|
320
347
|
// generated_types/setAutolend.ts
|
|
321
|
-
var
|
|
348
|
+
var ABI14 = {
|
|
322
349
|
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
323
350
|
"name": "set_autolend",
|
|
324
351
|
"friends": [],
|
|
@@ -339,7 +366,7 @@ var ABI13 = {
|
|
|
339
366
|
],
|
|
340
367
|
"structs": []
|
|
341
368
|
};
|
|
342
|
-
var setAutolend_default =
|
|
369
|
+
var setAutolend_default = ABI14;
|
|
343
370
|
|
|
344
371
|
// generated_types/typeshareTypes.ts
|
|
345
372
|
var PerpetualMarketStatus = /* @__PURE__ */ ((PerpetualMarketStatus2) => {
|
|
@@ -421,7 +448,7 @@ var UserStatus = /* @__PURE__ */ ((UserStatus2) => {
|
|
|
421
448
|
})(UserStatus || {});
|
|
422
449
|
|
|
423
450
|
// generated_types/withdrawFromVault.ts
|
|
424
|
-
var
|
|
451
|
+
var ABI15 = {
|
|
425
452
|
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
426
453
|
"name": "withdraw_from_vault",
|
|
427
454
|
"friends": [],
|
|
@@ -444,7 +471,7 @@ var ABI14 = {
|
|
|
444
471
|
],
|
|
445
472
|
"structs": []
|
|
446
473
|
};
|
|
447
|
-
var withdrawFromVault_default =
|
|
474
|
+
var withdrawFromVault_default = ABI15;
|
|
448
475
|
|
|
449
476
|
// src/utils.ts
|
|
450
477
|
import { Account } from "@aptos-labs/ts-sdk";
|
|
@@ -1224,6 +1251,42 @@ var Client = class _Client {
|
|
|
1224
1251
|
});
|
|
1225
1252
|
return await this.submitSponsoredTransaction(tx, signature);
|
|
1226
1253
|
}
|
|
1254
|
+
async changePerpOrderPrice(params) {
|
|
1255
|
+
const sequenceNumber = await this.getApiKeySequenceNumber();
|
|
1256
|
+
const aptosPayload = await generateTransactionPayload({
|
|
1257
|
+
aptosConfig: this._aptos.config,
|
|
1258
|
+
abi: parseEntryFunctionAbi({
|
|
1259
|
+
moduleAbi: changePerpOrderPrice_default,
|
|
1260
|
+
functionName: changePerpOrderPrice_default.name,
|
|
1261
|
+
moduleAddress: changePerpOrderPrice_default.address,
|
|
1262
|
+
moduleName: changePerpOrderPrice_default.name
|
|
1263
|
+
}),
|
|
1264
|
+
function: `${changePerpOrderPrice_default.address}::${changePerpOrderPrice_default.name}::change_perp_order_price`,
|
|
1265
|
+
typeArguments: [],
|
|
1266
|
+
functionArguments: [
|
|
1267
|
+
params.userId,
|
|
1268
|
+
params.market,
|
|
1269
|
+
params.orderId,
|
|
1270
|
+
params.newPrice,
|
|
1271
|
+
params.postOnly
|
|
1272
|
+
]
|
|
1273
|
+
});
|
|
1274
|
+
const rawTx = new RawTransaction(
|
|
1275
|
+
AccountAddress.from(this._apiKey.accountAddress),
|
|
1276
|
+
BigInt(sequenceNumber),
|
|
1277
|
+
aptosPayload,
|
|
1278
|
+
BigInt(1e4),
|
|
1279
|
+
BigInt(100),
|
|
1280
|
+
BigInt(Date.now() + 10 * 1e3),
|
|
1281
|
+
new ChainId(this._chainId)
|
|
1282
|
+
);
|
|
1283
|
+
const tx = new SimpleTransaction(rawTx, AccountAddress.ZERO);
|
|
1284
|
+
const signature = this._aptos.sign({
|
|
1285
|
+
signer: this._apiKey,
|
|
1286
|
+
transaction: tx
|
|
1287
|
+
});
|
|
1288
|
+
return await this.submitSponsoredTransaction(tx, signature);
|
|
1289
|
+
}
|
|
1227
1290
|
async cancelPerpOrders(params) {
|
|
1228
1291
|
const sequenceNumber = await this.getApiKeySequenceNumber();
|
|
1229
1292
|
const aptosPayload = await generateTransactionPayload({
|
|
@@ -1508,7 +1571,7 @@ function parseEntryFunctionAbi(args) {
|
|
|
1508
1571
|
import { createEntryPayload as createEntryPayload2 } from "@thalalabs/surf";
|
|
1509
1572
|
|
|
1510
1573
|
// generated_types/faucetEntrypoints.ts
|
|
1511
|
-
var
|
|
1574
|
+
var ABI16 = {
|
|
1512
1575
|
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
1513
1576
|
"name": "faucet_entrypoints",
|
|
1514
1577
|
"friends": [],
|
|
@@ -1540,10 +1603,10 @@ var ABI15 = {
|
|
|
1540
1603
|
],
|
|
1541
1604
|
"structs": []
|
|
1542
1605
|
};
|
|
1543
|
-
var faucetEntrypoints_default =
|
|
1606
|
+
var faucetEntrypoints_default = ABI16;
|
|
1544
1607
|
|
|
1545
1608
|
// generated_types/testFaucet.ts
|
|
1546
|
-
var
|
|
1609
|
+
var ABI17 = {
|
|
1547
1610
|
"address": "0x34b01b765ed25a0629f96b508c290c94f0bb382870734e63622d703085c531a7",
|
|
1548
1611
|
"name": "test_faucet",
|
|
1549
1612
|
"friends": [],
|
|
@@ -1777,7 +1840,7 @@ var ABI16 = {
|
|
|
1777
1840
|
}
|
|
1778
1841
|
]
|
|
1779
1842
|
};
|
|
1780
|
-
var testFaucet_default =
|
|
1843
|
+
var testFaucet_default = ABI17;
|
|
1781
1844
|
|
|
1782
1845
|
// src/testFaucet.ts
|
|
1783
1846
|
var TestFaucet = class _TestFaucet extends client_default {
|