@myx-trade/sdk 0.1.4 → 0.1.7

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.mts CHANGED
@@ -522,6 +522,8 @@ interface MarketDetailResponse {
522
522
  feedId: string;
523
523
  activeTime: number;
524
524
  capType: MarketCapType;
525
+ baseReserveRatio: string;
526
+ quoteReserveRatio: string;
525
527
  }
526
528
 
527
529
  declare class Address {
@@ -538,6 +540,7 @@ declare class Address {
538
540
  interface GetHistoryOrdersParams {
539
541
  limit?: number;
540
542
  chainId?: number;
543
+ poolId?: string;
541
544
  }
542
545
  declare enum OrderTypeEnum {
543
546
  Market = 0,
@@ -592,6 +595,9 @@ interface HistoryOrderItem {
592
595
  tradingFee: string;
593
596
  fundingFee: string;
594
597
  realizedPnl: string;
598
+ baseSymbol: string;
599
+ quoteSymbol: string;
600
+ leverage: number;
595
601
  }
596
602
  /**
597
603
  * Get history orders
@@ -614,6 +620,9 @@ interface PositionHistoryItem {
614
620
  openTime: number;
615
621
  closeTime: number;
616
622
  realizedPnl: string;
623
+ baseSymbol: string;
624
+ quoteSymbol: string;
625
+ leverage: number;
617
626
  }
618
627
  declare const getPositionHistory: ({ accessToken, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<PositionHistoryItem[]>>;
619
628
  /**
@@ -632,6 +641,9 @@ interface TradeFlowItem {
632
641
  afterCollateralAmount: string;
633
642
  txHash: string;
634
643
  txTime: number;
644
+ baseSymbol: string;
645
+ quoteSymbol: string;
646
+ leverage: number;
635
647
  }
636
648
  declare const getTradeFlow: ({ accessToken, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<TradeFlowItem[]>>;
637
649
 
package/dist/index.d.ts CHANGED
@@ -522,6 +522,8 @@ interface MarketDetailResponse {
522
522
  feedId: string;
523
523
  activeTime: number;
524
524
  capType: MarketCapType;
525
+ baseReserveRatio: string;
526
+ quoteReserveRatio: string;
525
527
  }
526
528
 
527
529
  declare class Address {
@@ -538,6 +540,7 @@ declare class Address {
538
540
  interface GetHistoryOrdersParams {
539
541
  limit?: number;
540
542
  chainId?: number;
543
+ poolId?: string;
541
544
  }
542
545
  declare enum OrderTypeEnum {
543
546
  Market = 0,
@@ -592,6 +595,9 @@ interface HistoryOrderItem {
592
595
  tradingFee: string;
593
596
  fundingFee: string;
594
597
  realizedPnl: string;
598
+ baseSymbol: string;
599
+ quoteSymbol: string;
600
+ leverage: number;
595
601
  }
596
602
  /**
597
603
  * Get history orders
@@ -614,6 +620,9 @@ interface PositionHistoryItem {
614
620
  openTime: number;
615
621
  closeTime: number;
616
622
  realizedPnl: string;
623
+ baseSymbol: string;
624
+ quoteSymbol: string;
625
+ leverage: number;
617
626
  }
618
627
  declare const getPositionHistory: ({ accessToken, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<PositionHistoryItem[]>>;
619
628
  /**
@@ -632,6 +641,9 @@ interface TradeFlowItem {
632
641
  afterCollateralAmount: string;
633
642
  txHash: string;
634
643
  txTime: number;
644
+ baseSymbol: string;
645
+ quoteSymbol: string;
646
+ leverage: number;
635
647
  }
636
648
  declare const getTradeFlow: ({ accessToken, ...params }: GetHistoryOrdersParams & AccessTokenRequest) => Promise<ApiResponse<TradeFlowItem[]>>;
637
649
 
package/dist/index.js CHANGED
@@ -62,7 +62,7 @@ __export(index_exports, {
62
62
  bigintAmountSlipperCalculator: () => bigintAmountSlipperCalculator,
63
63
  bigintTradingGasPriceWithRatio: () => bigintTradingGasPriceWithRatio,
64
64
  bigintTradingGasToRatioCalculator: () => bigintTradingGasToRatioCalculator,
65
- formatUnits: () => import_ethers24.formatUnits,
65
+ formatUnits: () => import_ethers23.formatUnits,
66
66
  getAllTickers: () => getAllTickers,
67
67
  getAllowanceApproved: () => getAllowanceApproved,
68
68
  getBalanceOf: () => getBalanceOf,
@@ -86,7 +86,7 @@ __export(index_exports, {
86
86
  getTokenInfo: () => getTokenInfo,
87
87
  getTradeFlow: () => getTradeFlow,
88
88
  market: () => market_exports,
89
- parseUnits: () => import_ethers24.parseUnits,
89
+ parseUnits: () => import_ethers23.parseUnits,
90
90
  pool: () => pool_exports,
91
91
  quote: () => quote_exports,
92
92
  removeFavorite: () => removeFavorite,
@@ -1827,7 +1827,7 @@ var RotationProvider = class extends import_providers.BaseProvider {
1827
1827
  // package.json
1828
1828
  var package_default = {
1829
1829
  name: "@myx-trade/sdk",
1830
- version: "0.1.4",
1830
+ version: "0.1.7",
1831
1831
  private: false,
1832
1832
  publishConfig: {
1833
1833
  access: "public"
@@ -1860,7 +1860,8 @@ var package_default = {
1860
1860
  publish: "node scripts/publish.js patch",
1861
1861
  "publish:patch": "node scripts/publish.js patch",
1862
1862
  "publish:minor": "node scripts/publish.js minor",
1863
- "publish:major": "node scripts/publish.js major"
1863
+ "publish:major": "node scripts/publish.js major",
1864
+ "publish:no-bump": "npm run build && npm publish --access public"
1864
1865
  },
1865
1866
  keywords: [
1866
1867
  "trading",
@@ -9614,6 +9615,7 @@ var import_wretch = __toESM(require("wretch"));
9614
9615
  var client = (0, import_wretch.default)();
9615
9616
  var buildQueryOptions = (url, params) => {
9616
9617
  if (params) {
9618
+ params = JSON.parse(JSON.stringify(params));
9617
9619
  if (url.includes("?")) {
9618
9620
  return url + "&" + new URLSearchParams(params).toString();
9619
9621
  }
@@ -10871,7 +10873,6 @@ __export(pool_exports, {
10871
10873
  });
10872
10874
 
10873
10875
  // src/lp/pool/get.ts
10874
- var import_ethers21 = require("ethers");
10875
10876
  var getMarketInfo = (chainId2) => {
10876
10877
  const marketId2 = Market[chainId2].marketId;
10877
10878
  return marketId2;
@@ -10891,7 +10892,7 @@ var getMarketPoolId = async ({
10891
10892
  const contract = await getPoolManagerContract(chainId2);
10892
10893
  const data = [marketId2, baseToken];
10893
10894
  const request = await contract.getMarketPool(marketId2, baseToken);
10894
- return request.poolId === import_ethers21.ZeroAddress || !request.poolId ? void 0 : request.poolId;
10895
+ return request.poolId === "0x0000000000000000000000000000000000000000000000000000000000000000" || !request.poolId ? void 0 : request.poolId;
10895
10896
  } catch (error) {
10896
10897
  console.error(error);
10897
10898
  throw typeof error === "string" ? error : await getErrorTextFormError(error);
@@ -11061,7 +11062,7 @@ var cancelTpSl = async (params) => {
11061
11062
  };
11062
11063
 
11063
11064
  // src/common/tokenInfo.ts
11064
- var import_ethers22 = require("ethers");
11065
+ var import_ethers21 = require("ethers");
11065
11066
  async function checkImageExists(url) {
11066
11067
  try {
11067
11068
  const res = await fetch(url, { method: "HEAD" });
@@ -11081,14 +11082,14 @@ var getTokenInfo = async (chainId2, tokenAddress, account) => {
11081
11082
  token.decimals(),
11082
11083
  token.totalSupply()
11083
11084
  ]);
11084
- const normalized = import_ethers22.ethers.getAddress(tokenAddress);
11085
+ const normalized = import_ethers21.ethers.getAddress(tokenAddress);
11085
11086
  const iconUrl = `https://raw.githubusercontent.com/trustwallet/assets/master/blockchains/${chainId2}/assets/${normalized}/logo.png`;
11086
11087
  const fallbackIcon = "";
11087
11088
  const icon = await checkImageExists(iconUrl) ? iconUrl : fallbackIcon;
11088
11089
  let balance;
11089
11090
  if (account) {
11090
11091
  const rawBalance = await token.balanceOf(account);
11091
- balance = Number(import_ethers22.ethers.formatUnits(rawBalance, decimals));
11092
+ balance = Number(import_ethers21.ethers.formatUnits(rawBalance, decimals));
11092
11093
  }
11093
11094
  return {
11094
11095
  address: tokenAddress,
@@ -11096,7 +11097,7 @@ var getTokenInfo = async (chainId2, tokenAddress, account) => {
11096
11097
  symbol,
11097
11098
  decimals,
11098
11099
  icon,
11099
- totalSupply: Number(import_ethers22.ethers.formatUnits(totalSupply, decimals)),
11100
+ totalSupply: Number(import_ethers21.ethers.formatUnits(totalSupply, decimals)),
11100
11101
  ...account ? { balance } : {}
11101
11102
  };
11102
11103
  } catch (e) {
@@ -11143,7 +11144,7 @@ var getOracleFee = async (chainId2, marketId2) => {
11143
11144
  };
11144
11145
 
11145
11146
  // src/lp/pool/reprime.ts
11146
- var import_ethers23 = require("ethers");
11147
+ var import_ethers22 = require("ethers");
11147
11148
  var reprime = async (chainId2, poolId) => {
11148
11149
  try {
11149
11150
  await checkParams({ chainId: chainId2 });
@@ -11157,14 +11158,14 @@ var reprime = async (chainId2, poolId) => {
11157
11158
  if (!_amount) {
11158
11159
  throw new Error("Invalid Market");
11159
11160
  }
11160
- console.log(Number((0, import_ethers23.formatUnits)(_amount, pool.quoteDecimals)));
11161
+ console.log(Number((0, import_ethers22.formatUnits)(_amount, pool.quoteDecimals)));
11161
11162
  await checkParams({
11162
11163
  tokenAddress: pool.quoteToken,
11163
11164
  contractAddress: address_default[chainId2].ORACLE_RESERVE,
11164
11165
  decimals: pool.quoteDecimals,
11165
11166
  account,
11166
11167
  chainId: chainId2,
11167
- amount: Number((0, import_ethers23.formatUnits)(_amount, pool.quoteDecimals))
11168
+ amount: Number((0, import_ethers22.formatUnits)(_amount, pool.quoteDecimals))
11168
11169
  });
11169
11170
  const chainInfo = CHAIN_INFO[chainId2];
11170
11171
  const contract = await getPoolManagerContract(chainId2);
@@ -11214,7 +11215,7 @@ var TriggerType = /* @__PURE__ */ ((TriggerType3) => {
11214
11215
  })(TriggerType || {});
11215
11216
 
11216
11217
  // src/lp/index.ts
11217
- var import_ethers24 = require("ethers");
11218
+ var import_ethers23 = require("ethers");
11218
11219
 
11219
11220
  // src/manager/subscription/websocket/socket.ts
11220
11221
  var import_mitt = __toESM(require("mitt"));
@@ -11424,7 +11425,7 @@ var MyxWebSocketClient = class {
11424
11425
  */
11425
11426
  connect() {
11426
11427
  return new Promise((resolve, reject) => {
11427
- if (this.ws?.readyState === WebSocket.OPEN) {
11428
+ if (this.ws?.readyState === WebSocket.OPEN || this.ws?.readyState === WebSocket.CONNECTING) {
11428
11429
  resolve();
11429
11430
  return;
11430
11431
  }
@@ -11578,10 +11579,10 @@ var MyxWebSocketClient = class {
11578
11579
  "WebSocket is not connected"
11579
11580
  );
11580
11581
  }
11581
- if (this.ws.readyState !== WebSocket.OPEN) {
11582
+ if (this.ws.readyState !== WebSocket.OPEN && this.ws.readyState !== WebSocket.CONNECTING) {
11582
11583
  this.reconnect();
11583
11584
  }
11584
- this.ws?.send(message);
11585
+ this.ws.send(message);
11585
11586
  }
11586
11587
  /**
11587
11588
  * disconnect
@@ -11598,7 +11599,9 @@ var MyxWebSocketClient = class {
11598
11599
  */
11599
11600
  reconnect() {
11600
11601
  if (this.ws) {
11601
- this.ws.reconnect();
11602
+ if (this.ws.readyState !== WebSocket.CONNECTING) {
11603
+ this.ws.reconnect();
11604
+ }
11602
11605
  } else {
11603
11606
  this.connect().catch((err) => {
11604
11607
  this.logger.error(err);
@@ -12217,7 +12220,7 @@ var getContractAddressByChainId = (chainId2) => {
12217
12220
  };
12218
12221
 
12219
12222
  // src/manager/position/index.ts
12220
- var import_ethers25 = require("ethers");
12223
+ var import_ethers24 = require("ethers");
12221
12224
  var Position = class {
12222
12225
  constructor(configManager, logger, utils) {
12223
12226
  this.configManager = configManager;
@@ -12402,7 +12405,7 @@ var Position = class {
12402
12405
  }
12403
12406
  const updateParams = {
12404
12407
  poolId,
12405
- referencePrice: import_ethers25.ethers.parseUnits(priceData?.price ?? "0", 30),
12408
+ referencePrice: import_ethers24.ethers.parseUnits(priceData?.price ?? "0", 30),
12406
12409
  oracleUpdateData: priceData?.vaa ?? "0",
12407
12410
  publishTime: priceData.publishTime
12408
12411
  };
@@ -12424,12 +12427,12 @@ var Position = class {
12424
12427
  if (needsApproval) {
12425
12428
  this.logger.debug("adjust collateral approve-->", {
12426
12429
  quoteToken,
12427
- amount: import_ethers25.ethers.MaxUint256.toString(),
12430
+ amount: import_ethers24.ethers.MaxUint256.toString(),
12428
12431
  spenderAddress: contractAddress.POSITION_MANAGER
12429
12432
  });
12430
12433
  const approvalResult = await this.utils.approveAuthorization({
12431
12434
  quoteAddress: quoteToken,
12432
- amount: import_ethers25.ethers.MaxUint256.toString(),
12435
+ amount: import_ethers24.ethers.MaxUint256.toString(),
12433
12436
  spenderAddress: contractAddress.POSITION_MANAGER
12434
12437
  });
12435
12438
  if (approvalResult.code !== 0) {
@@ -12991,7 +12994,8 @@ var Order = class {
12991
12994
  slPrice: params.slPrice,
12992
12995
  executionFeeToken: params.executionFeeToken,
12993
12996
  useOrderCollateral: true,
12994
- useAccountBalance: false
12997
+ useAccountBalance: false,
12998
+ paymentType: 0
12995
12999
  }
12996
13000
  };
12997
13001
  console.log(data);
@@ -13052,7 +13056,7 @@ var Order = class {
13052
13056
  };
13053
13057
 
13054
13058
  // src/manager/utils/index.ts
13055
- var import_ethers26 = require("ethers");
13059
+ var import_ethers25 = require("ethers");
13056
13060
 
13057
13061
  // src/abi/Emiter.json
13058
13062
  var Emiter_default = [
@@ -16734,7 +16738,7 @@ var Utils = class {
16734
16738
  if (!receipt || !receipt.logs) {
16735
16739
  return null;
16736
16740
  }
16737
- const emiterInterface = new import_ethers26.ethers.Interface(Emiter_default);
16741
+ const emiterInterface = new import_ethers25.ethers.Interface(Emiter_default);
16738
16742
  const orderPlacedEvent = Emiter_default.find(
16739
16743
  (item) => item.type === "event" && item.name === "OrderPlaced"
16740
16744
  );
@@ -16742,7 +16746,7 @@ var Utils = class {
16742
16746
  this.logger.error("OrderPlaced event not found in Emiter ABI");
16743
16747
  return null;
16744
16748
  }
16745
- const eventTopic = import_ethers26.ethers.id(
16749
+ const eventTopic = import_ethers25.ethers.id(
16746
16750
  "OrderPlaced(address,address,bytes32,uint256,uint256,uint8,uint8,uint8,uint8,uint256,uint256,uint256,uint8,bool,uint16,address,uint256,uint16)"
16747
16751
  );
16748
16752
  this.logger.info("Looking for OrderPlaced events with topic:", eventTopic);
@@ -16786,7 +16790,7 @@ var Utils = class {
16786
16790
  const config = this.configManager.getConfig();
16787
16791
  const owner = await config.signer.getAddress();
16788
16792
  const spender = spenderAddress ?? getContractAddressByChainId(config.chainId).ORDER_MANAGER;
16789
- const tokenContract = new import_ethers26.ethers.Contract(
16793
+ const tokenContract = new import_ethers25.ethers.Contract(
16790
16794
  quoteAddress,
16791
16795
  erc20Abi,
16792
16796
  config.signer
@@ -16808,8 +16812,8 @@ var Utils = class {
16808
16812
  spenderAddress
16809
16813
  );
16810
16814
  const currentAllowance = currentAllowanceRes.data;
16811
- const allowanceBigInt = import_ethers26.ethers.getBigInt(currentAllowance);
16812
- const requiredBigInt = import_ethers26.ethers.getBigInt(requiredAmount);
16815
+ const allowanceBigInt = import_ethers25.ethers.getBigInt(currentAllowance);
16816
+ const requiredBigInt = import_ethers25.ethers.getBigInt(requiredAmount);
16813
16817
  const needsApproval = allowanceBigInt < requiredBigInt;
16814
16818
  return needsApproval;
16815
16819
  } catch (error) {
@@ -16827,12 +16831,12 @@ var Utils = class {
16827
16831
  "function approve(address spender, uint256 amount) external returns (bool)"
16828
16832
  ];
16829
16833
  const config = this.configManager.getConfig();
16830
- const usdcContract = new import_ethers26.ethers.Contract(
16834
+ const usdcContract = new import_ethers25.ethers.Contract(
16831
16835
  quoteAddress,
16832
16836
  erc20Abi,
16833
16837
  config.signer
16834
16838
  );
16835
- const approveAmount = amount ?? import_ethers26.ethers.MaxUint256;
16839
+ const approveAmount = amount ?? import_ethers25.ethers.MaxUint256;
16836
16840
  const spender = spenderAddress ?? getContractAddressByChainId(config.chainId).ORDER_MANAGER;
16837
16841
  const tx = await usdcContract.approve(spender, approveAmount);
16838
16842
  await tx.wait();
@@ -16854,7 +16858,7 @@ var Utils = class {
16854
16858
  const orderManagerAddress = getContractAddressByChainId(
16855
16859
  config.chainId
16856
16860
  ).ORDER_MANAGER;
16857
- const orderManagerContract = new import_ethers26.ethers.Contract(
16861
+ const orderManagerContract = new import_ethers25.ethers.Contract(
16858
16862
  orderManagerAddress,
16859
16863
  OrderManager_default,
16860
16864
  config.signer
@@ -16934,7 +16938,7 @@ var Utils = class {
16934
16938
  };
16935
16939
 
16936
16940
  // src/manager/account/index.ts
16937
- var import_ethers27 = require("ethers");
16941
+ var import_ethers26 = require("ethers");
16938
16942
 
16939
16943
  // src/abi/Account.json
16940
16944
  var Account_default = [
@@ -17573,7 +17577,7 @@ var Account = class {
17573
17577
  async getTradableAmount({ poolId }) {
17574
17578
  const config = this.configManager.getConfig();
17575
17579
  const contractAddress = getContractAddressByChainId(config.chainId);
17576
- const accountContract = new import_ethers27.ethers.Contract(
17580
+ const accountContract = new import_ethers26.ethers.Contract(
17577
17581
  contractAddress.Account,
17578
17582
  Account_default,
17579
17583
  config.signer
@@ -17598,7 +17602,7 @@ var Account = class {
17598
17602
  };
17599
17603
 
17600
17604
  // src/manager/index.ts
17601
- var import_ethers28 = require("ethers");
17605
+ var import_ethers27 = require("ethers");
17602
17606
  var MyxClient = class {
17603
17607
  /**
17604
17608
  * 获取配置管理器(用于访问 accessToken 相关方法)
@@ -17619,7 +17623,7 @@ var MyxClient = class {
17619
17623
  this.subscription = new SubScription(this.configManager, this.logger);
17620
17624
  const lp = MxSDK.getInstance();
17621
17625
  if (options.walletClient?.transport) {
17622
- const provider = new import_ethers28.BrowserProvider(options.walletClient?.transport);
17626
+ const provider = new import_ethers27.BrowserProvider(options.walletClient?.transport);
17623
17627
  if (provider) {
17624
17628
  lp.setProvider(provider);
17625
17629
  }
package/dist/index.mjs CHANGED
@@ -1741,7 +1741,7 @@ var RotationProvider = class extends BaseProvider {
1741
1741
  // package.json
1742
1742
  var package_default = {
1743
1743
  name: "@myx-trade/sdk",
1744
- version: "0.1.4",
1744
+ version: "0.1.7",
1745
1745
  private: false,
1746
1746
  publishConfig: {
1747
1747
  access: "public"
@@ -1774,7 +1774,8 @@ var package_default = {
1774
1774
  publish: "node scripts/publish.js patch",
1775
1775
  "publish:patch": "node scripts/publish.js patch",
1776
1776
  "publish:minor": "node scripts/publish.js minor",
1777
- "publish:major": "node scripts/publish.js major"
1777
+ "publish:major": "node scripts/publish.js major",
1778
+ "publish:no-bump": "npm run build && npm publish --access public"
1778
1779
  },
1779
1780
  keywords: [
1780
1781
  "trading",
@@ -9528,6 +9529,7 @@ import wretch from "wretch";
9528
9529
  var client = wretch();
9529
9530
  var buildQueryOptions = (url, params) => {
9530
9531
  if (params) {
9532
+ params = JSON.parse(JSON.stringify(params));
9531
9533
  if (url.includes("?")) {
9532
9534
  return url + "&" + new URLSearchParams(params).toString();
9533
9535
  }
@@ -10785,7 +10787,6 @@ __export(pool_exports, {
10785
10787
  });
10786
10788
 
10787
10789
  // src/lp/pool/get.ts
10788
- import { ZeroAddress as ZeroAddress3 } from "ethers";
10789
10790
  var getMarketInfo = (chainId2) => {
10790
10791
  const marketId2 = Market[chainId2].marketId;
10791
10792
  return marketId2;
@@ -10805,7 +10806,7 @@ var getMarketPoolId = async ({
10805
10806
  const contract = await getPoolManagerContract(chainId2);
10806
10807
  const data = [marketId2, baseToken];
10807
10808
  const request = await contract.getMarketPool(marketId2, baseToken);
10808
- return request.poolId === ZeroAddress3 || !request.poolId ? void 0 : request.poolId;
10809
+ return request.poolId === "0x0000000000000000000000000000000000000000000000000000000000000000" || !request.poolId ? void 0 : request.poolId;
10809
10810
  } catch (error) {
10810
10811
  console.error(error);
10811
10812
  throw typeof error === "string" ? error : await getErrorTextFormError(error);
@@ -11338,7 +11339,7 @@ var MyxWebSocketClient = class {
11338
11339
  */
11339
11340
  connect() {
11340
11341
  return new Promise((resolve, reject) => {
11341
- if (this.ws?.readyState === WebSocket.OPEN) {
11342
+ if (this.ws?.readyState === WebSocket.OPEN || this.ws?.readyState === WebSocket.CONNECTING) {
11342
11343
  resolve();
11343
11344
  return;
11344
11345
  }
@@ -11492,10 +11493,10 @@ var MyxWebSocketClient = class {
11492
11493
  "WebSocket is not connected"
11493
11494
  );
11494
11495
  }
11495
- if (this.ws.readyState !== WebSocket.OPEN) {
11496
+ if (this.ws.readyState !== WebSocket.OPEN && this.ws.readyState !== WebSocket.CONNECTING) {
11496
11497
  this.reconnect();
11497
11498
  }
11498
- this.ws?.send(message);
11499
+ this.ws.send(message);
11499
11500
  }
11500
11501
  /**
11501
11502
  * disconnect
@@ -11512,7 +11513,9 @@ var MyxWebSocketClient = class {
11512
11513
  */
11513
11514
  reconnect() {
11514
11515
  if (this.ws) {
11515
- this.ws.reconnect();
11516
+ if (this.ws.readyState !== WebSocket.CONNECTING) {
11517
+ this.ws.reconnect();
11518
+ }
11516
11519
  } else {
11517
11520
  this.connect().catch((err) => {
11518
11521
  this.logger.error(err);
@@ -12905,7 +12908,8 @@ var Order = class {
12905
12908
  slPrice: params.slPrice,
12906
12909
  executionFeeToken: params.executionFeeToken,
12907
12910
  useOrderCollateral: true,
12908
- useAccountBalance: false
12911
+ useAccountBalance: false,
12912
+ paymentType: 0
12909
12913
  }
12910
12914
  };
12911
12915
  console.log(data);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@myx-trade/sdk",
3
- "version": "0.1.4",
3
+ "version": "0.1.7",
4
4
  "private": false,
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -33,7 +33,8 @@
33
33
  "publish": "node scripts/publish.js patch",
34
34
  "publish:patch": "node scripts/publish.js patch",
35
35
  "publish:minor": "node scripts/publish.js minor",
36
- "publish:major": "node scripts/publish.js major"
36
+ "publish:major": "node scripts/publish.js major",
37
+ "publish:no-bump": "npm run build && npm publish --access public"
37
38
  },
38
39
  "keywords": [
39
40
  "trading",