@usherlabs/cex-broker 0.1.19 → 0.1.20

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.
@@ -77347,6 +77347,9 @@ ResponseBody:
77347
77347
  async fetchTime(params = {}) {
77348
77348
  throw new NotSupported(this.id + " fetchTime() is not supported yet");
77349
77349
  }
77350
+ async fetchAccountId() {
77351
+ throw new NotSupported(this.id + " fetchAccountId () is not supported yet");
77352
+ }
77350
77353
  async fetchTradingLimits(symbols = undefined, params = {}) {
77351
77354
  throw new NotSupported(this.id + " fetchTradingLimits() is not supported yet");
77352
77355
  }
@@ -96174,6 +96177,10 @@ class binance extends binance_default {
96174
96177
  }
96175
96178
  return this.safeInteger(response, "serverTime");
96176
96179
  }
96180
+ async fetchAccountId(params = {}) {
96181
+ const response = await this.privateGetAccount(params);
96182
+ return this.safeString(response, "uid");
96183
+ }
96177
96184
  async fetchCurrencies(params = {}) {
96178
96185
  const fetchCurrenciesEnabled = this.safeBool(this.options, "fetchCurrencies");
96179
96186
  if (!fetchCurrenciesEnabled) {
@@ -137587,6 +137594,11 @@ class bybit extends bybit_default {
137587
137594
  const response = await this.publicGetV5MarketTime(params);
137588
137595
  return this.safeInteger(response, "time");
137589
137596
  }
137597
+ async fetchAccountId(params = {}) {
137598
+ const response = await this.privateGetV5UserQueryApi(params);
137599
+ const result = this.safeDict(response, "result", {});
137600
+ return this.safeString(result, "userID");
137601
+ }
137590
137602
  async fetchCurrencies(params = {}) {
137591
137603
  if (!this.checkRequiredCredentials(false)) {
137592
137604
  return;
@@ -204320,6 +204332,10 @@ class mexc extends mexc_default {
204320
204332
  }
204321
204333
  return;
204322
204334
  }
204335
+ async fetchAccountId(params = {}) {
204336
+ const response = await this.spotPrivateGetUid(params);
204337
+ return this.safeString(response, "uid");
204338
+ }
204323
204339
  async fetchCurrencies(params = {}) {
204324
204340
  if (!this.checkRequiredCredentials(false)) {
204325
204341
  return;
@@ -291314,7 +291330,7 @@ class xt2 extends xt {
291314
291330
  }
291315
291331
 
291316
291332
  // node_modules/@usherlabs/ccxt/js/ccxt.js
291317
- var version2 = "0.0.13";
291333
+ var version2 = "0.0.14";
291318
291334
  Exchange.ccxtVersion = version2;
291319
291335
  var exchanges = {
291320
291336
  alpaca,
@@ -292600,33 +292616,10 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
292600
292616
  }
292601
292617
  case Action.FetchAccountId: {
292602
292618
  try {
292603
- let accountId;
292604
- let uid;
292605
- const temp_broker = broker;
292606
- if (typeof temp_broker.privateGetV5UserQueryApi === "function") {
292607
- const query = await temp_broker.privateGetV5UserQueryApi();
292608
- if (!query?.id || !query?.userID) {
292609
- throw new Error("Invalid response structure from privateGetV5UserQueryApi");
292610
- }
292611
- accountId = query.id;
292612
- uid = query.userID;
292613
- } else if (typeof temp_broker.spotPrivateGetUid === "function") {
292614
- const query = await temp_broker.spotPrivateGetUid();
292615
- accountId = query.uid;
292616
- uid = query.uid;
292617
- } else if (typeof temp_broker.privateGetAccount === "function") {
292618
- const query = await temp_broker.privateGetAccount();
292619
- accountId = query.uid;
292620
- uid = query.uid;
292621
- } else {
292622
- return callback({
292623
- code: grpc.status.INTERNAL,
292624
- message: "Error: fetching account ID not supported for this broker"
292625
- }, null);
292626
- }
292619
+ let accountId = await broker.fetchAccountId();
292627
292620
  return callback(null, {
292628
292621
  proof: verityProof,
292629
- result: JSON.stringify({ accountId, uid })
292622
+ result: JSON.stringify({ accountId })
292630
292623
  });
292631
292624
  } catch (error) {
292632
292625
  log.error(`Error fetching account ID ${cex3}:`, error);
package/dist/index.js CHANGED
@@ -50820,6 +50820,9 @@ ResponseBody:
50820
50820
  async fetchTime(params = {}) {
50821
50821
  throw new NotSupported(this.id + " fetchTime() is not supported yet");
50822
50822
  }
50823
+ async fetchAccountId() {
50824
+ throw new NotSupported(this.id + " fetchAccountId () is not supported yet");
50825
+ }
50823
50826
  async fetchTradingLimits(symbols = undefined, params = {}) {
50824
50827
  throw new NotSupported(this.id + " fetchTradingLimits() is not supported yet");
50825
50828
  }
@@ -69647,6 +69650,10 @@ class binance extends binance_default {
69647
69650
  }
69648
69651
  return this.safeInteger(response, "serverTime");
69649
69652
  }
69653
+ async fetchAccountId(params = {}) {
69654
+ const response = await this.privateGetAccount(params);
69655
+ return this.safeString(response, "uid");
69656
+ }
69650
69657
  async fetchCurrencies(params = {}) {
69651
69658
  const fetchCurrenciesEnabled = this.safeBool(this.options, "fetchCurrencies");
69652
69659
  if (!fetchCurrenciesEnabled) {
@@ -111060,6 +111067,11 @@ class bybit extends bybit_default {
111060
111067
  const response = await this.publicGetV5MarketTime(params);
111061
111068
  return this.safeInteger(response, "time");
111062
111069
  }
111070
+ async fetchAccountId(params = {}) {
111071
+ const response = await this.privateGetV5UserQueryApi(params);
111072
+ const result = this.safeDict(response, "result", {});
111073
+ return this.safeString(result, "userID");
111074
+ }
111063
111075
  async fetchCurrencies(params = {}) {
111064
111076
  if (!this.checkRequiredCredentials(false)) {
111065
111077
  return;
@@ -177793,6 +177805,10 @@ class mexc extends mexc_default {
177793
177805
  }
177794
177806
  return;
177795
177807
  }
177808
+ async fetchAccountId(params = {}) {
177809
+ const response = await this.spotPrivateGetUid(params);
177810
+ return this.safeString(response, "uid");
177811
+ }
177796
177812
  async fetchCurrencies(params = {}) {
177797
177813
  if (!this.checkRequiredCredentials(false)) {
177798
177814
  return;
@@ -264787,7 +264803,7 @@ class xt2 extends xt {
264787
264803
  }
264788
264804
 
264789
264805
  // node_modules/@usherlabs/ccxt/js/ccxt.js
264790
- var version2 = "0.0.13";
264806
+ var version2 = "0.0.14";
264791
264807
  Exchange.ccxtVersion = version2;
264792
264808
  var exchanges = {
264793
264809
  alpaca,
@@ -266073,33 +266089,10 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
266073
266089
  }
266074
266090
  case Action.FetchAccountId: {
266075
266091
  try {
266076
- let accountId;
266077
- let uid;
266078
- const temp_broker = broker;
266079
- if (typeof temp_broker.privateGetV5UserQueryApi === "function") {
266080
- const query = await temp_broker.privateGetV5UserQueryApi();
266081
- if (!query?.id || !query?.userID) {
266082
- throw new Error("Invalid response structure from privateGetV5UserQueryApi");
266083
- }
266084
- accountId = query.id;
266085
- uid = query.userID;
266086
- } else if (typeof temp_broker.spotPrivateGetUid === "function") {
266087
- const query = await temp_broker.spotPrivateGetUid();
266088
- accountId = query.uid;
266089
- uid = query.uid;
266090
- } else if (typeof temp_broker.privateGetAccount === "function") {
266091
- const query = await temp_broker.privateGetAccount();
266092
- accountId = query.uid;
266093
- uid = query.uid;
266094
- } else {
266095
- return callback({
266096
- code: grpc.status.INTERNAL,
266097
- message: "Error: fetching account ID not supported for this broker"
266098
- }, null);
266099
- }
266092
+ let accountId = await broker.fetchAccountId();
266100
266093
  return callback(null, {
266101
266094
  proof: verityProof,
266102
- result: JSON.stringify({ accountId, uid })
266095
+ result: JSON.stringify({ accountId })
266103
266096
  });
266104
266097
  } catch (error) {
266105
266098
  log.error(`Error fetching account ID ${cex3}:`, error);
@@ -266924,4 +266917,4 @@ export {
266924
266917
  CEXBroker as default
266925
266918
  };
266926
266919
 
266927
- //# debugId=3851C5060DAE6B2364756E2164756E21
266920
+ //# debugId=BEFCD28097A9A4FF64756E2164756E21