@usherlabs/cex-broker 0.1.18 → 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.
@@ -73684,6 +73684,7 @@ var urlToMethodMap = {
73684
73684
  "https://contract.mexc.com/api/v1/contract/funding_rate/": "fetchFundingInterval",
73685
73685
  "https://contract.mexc.com/api/v1/private/position/list/history_positions": "fetchPositionsHistory",
73686
73686
  "https://api.mexc.com/api/v3/capital/withdraw": "withdraw",
73687
+ "https://api.mexc.com/api/v3/uid": "fetchAccountId",
73687
73688
  "https://contract.mexc.com/api/v1/private/position/change_leverage": "setMarginMode"
73688
73689
  },
73689
73690
  onetrading: {
@@ -74451,6 +74452,7 @@ var urlToMethodMap = {
74451
74452
  "https://testnet.binancefuture.com/sapi/v1/lending/union/account": "fetchBalance",
74452
74453
  "https://testnet.binancefuture.com/sapi/v1/asset/get-funding-asset": "fetchBalance",
74453
74454
  "https://api.binance.com/sapi/v1/margin/isolated/account": "fetchBalance",
74455
+ "https://api.binance.com/api/v5/user/query-api": "fetchAccountId",
74454
74456
  "https://papi.binance.com/papi/v1/balance": "fetchBalance",
74455
74457
  "https://api.binance.com/api/v3/myTrades": "fetchOrderTrades",
74456
74458
  "https://testnet.binancefuture.com/fapi/v1/userTrades": "fetchMyTrades",
@@ -74877,7 +74879,9 @@ var urlToMethodMap = {
74877
74879
  "https://api-testnet.bybit.com/v5/spot-margin-trade/interest-rate-history": "fetchBorrowRateHistory",
74878
74880
  "https://api-testnet.bybit.com/v5/market/open-interest": "fetchOpenInterest",
74879
74881
  "https://api-testnet.bybit.com/v5/asset/deposit/query-address": "fetchDepositAddressesByNetwork",
74880
- "https://api.bybit.com/v5/asset/deposit/query-address": "fetchDepositAddressesByNetwork"
74882
+ "https://api.bybit.com/v5/asset/deposit/query-address": "fetchDepositAddressesByNetwork",
74883
+ "https://api.bybit.com/v5/user/query-api": "fetchAccountId",
74884
+ "https://api-testnet.bybit.com/v5/user/query-api": "fetchAccountId"
74881
74885
  },
74882
74886
  cryptomus: {
74883
74887
  "https://api.cryptomus.com/v2/user-api/exchange/account/tariffs": "fetchTradingFees",
@@ -77343,6 +77347,9 @@ ResponseBody:
77343
77347
  async fetchTime(params = {}) {
77344
77348
  throw new NotSupported(this.id + " fetchTime() is not supported yet");
77345
77349
  }
77350
+ async fetchAccountId() {
77351
+ throw new NotSupported(this.id + " fetchAccountId () is not supported yet");
77352
+ }
77346
77353
  async fetchTradingLimits(symbols = undefined, params = {}) {
77347
77354
  throw new NotSupported(this.id + " fetchTradingLimits() is not supported yet");
77348
77355
  }
@@ -96170,6 +96177,10 @@ class binance extends binance_default {
96170
96177
  }
96171
96178
  return this.safeInteger(response, "serverTime");
96172
96179
  }
96180
+ async fetchAccountId(params = {}) {
96181
+ const response = await this.privateGetAccount(params);
96182
+ return this.safeString(response, "uid");
96183
+ }
96173
96184
  async fetchCurrencies(params = {}) {
96174
96185
  const fetchCurrenciesEnabled = this.safeBool(this.options, "fetchCurrencies");
96175
96186
  if (!fetchCurrenciesEnabled) {
@@ -137583,6 +137594,11 @@ class bybit extends bybit_default {
137583
137594
  const response = await this.publicGetV5MarketTime(params);
137584
137595
  return this.safeInteger(response, "time");
137585
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
+ }
137586
137602
  async fetchCurrencies(params = {}) {
137587
137603
  if (!this.checkRequiredCredentials(false)) {
137588
137604
  return;
@@ -203694,6 +203710,7 @@ class mexc extends mexc_default {
203694
203710
  account: 10,
203695
203711
  myTrades: 10,
203696
203712
  tradeFee: 10,
203713
+ uid: 1,
203697
203714
  "sub-account/list": 1,
203698
203715
  "sub-account/apiKey": 1,
203699
203716
  "capital/config/getall": 10,
@@ -204315,6 +204332,10 @@ class mexc extends mexc_default {
204315
204332
  }
204316
204333
  return;
204317
204334
  }
204335
+ async fetchAccountId(params = {}) {
204336
+ const response = await this.spotPrivateGetUid(params);
204337
+ return this.safeString(response, "uid");
204338
+ }
204318
204339
  async fetchCurrencies(params = {}) {
204319
204340
  if (!this.checkRequiredCredentials(false)) {
204320
204341
  return;
@@ -291309,7 +291330,7 @@ class xt2 extends xt {
291309
291330
  }
291310
291331
 
291311
291332
  // node_modules/@usherlabs/ccxt/js/ccxt.js
291312
- var version2 = "0.0.12";
291333
+ var version2 = "0.0.14";
291313
291334
  Exchange.ccxtVersion = version2;
291314
291335
  var exchanges = {
291315
291336
  alpaca,
@@ -292083,7 +292104,8 @@ var CCXT_METHODS_WITH_VERITY = [
292083
292104
  "withdraw",
292084
292105
  "fetchFundingHistory",
292085
292106
  "fetchWithdrawals",
292086
- "fetchWithdrawal"
292107
+ "fetchWithdrawal",
292108
+ "fetchAccountId"
292087
292109
  ];
292088
292110
 
292089
292111
  // src/helpers/index.ts
@@ -292339,7 +292361,8 @@ var Action = {
292339
292361
  FetchDepositAddresses: 7,
292340
292362
  FetchTicker: 8,
292341
292363
  FetchCurrency: 9,
292342
- Call: 10
292364
+ Call: 10,
292365
+ FetchAccountId: 11
292343
292366
  };
292344
292367
 
292345
292368
  // src/proto/cex_broker/SubscriptionType.ts
@@ -292471,7 +292494,8 @@ var descriptor = {
292471
292494
  FetchDepositAddresses: 7,
292472
292495
  FetchTicker: 8,
292473
292496
  FetchCurrency: 9,
292474
- Call: 10
292497
+ Call: 10,
292498
+ FetchAccountId: 11
292475
292499
  }
292476
292500
  }
292477
292501
  }
@@ -292590,6 +292614,22 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
292590
292614
  }
292591
292615
  break;
292592
292616
  }
292617
+ case Action.FetchAccountId: {
292618
+ try {
292619
+ let accountId = await broker.fetchAccountId();
292620
+ return callback(null, {
292621
+ proof: verityProof,
292622
+ result: JSON.stringify({ accountId })
292623
+ });
292624
+ } catch (error) {
292625
+ log.error(`Error fetching account ID ${cex3}:`, error);
292626
+ callback({
292627
+ code: grpc.status.INTERNAL,
292628
+ message: `Error fetching account ID from ${cex3}`
292629
+ }, null);
292630
+ }
292631
+ break;
292632
+ }
292593
292633
  case Action.Call: {
292594
292634
  const callSchema = import_joi2.default.object({
292595
292635
  functionName: import_joi2.default.string().pattern(/^[A-Za-z][A-Za-z0-9]*$/).required(),
package/dist/index.js CHANGED
@@ -47157,6 +47157,7 @@ var urlToMethodMap = {
47157
47157
  "https://contract.mexc.com/api/v1/contract/funding_rate/": "fetchFundingInterval",
47158
47158
  "https://contract.mexc.com/api/v1/private/position/list/history_positions": "fetchPositionsHistory",
47159
47159
  "https://api.mexc.com/api/v3/capital/withdraw": "withdraw",
47160
+ "https://api.mexc.com/api/v3/uid": "fetchAccountId",
47160
47161
  "https://contract.mexc.com/api/v1/private/position/change_leverage": "setMarginMode"
47161
47162
  },
47162
47163
  onetrading: {
@@ -47924,6 +47925,7 @@ var urlToMethodMap = {
47924
47925
  "https://testnet.binancefuture.com/sapi/v1/lending/union/account": "fetchBalance",
47925
47926
  "https://testnet.binancefuture.com/sapi/v1/asset/get-funding-asset": "fetchBalance",
47926
47927
  "https://api.binance.com/sapi/v1/margin/isolated/account": "fetchBalance",
47928
+ "https://api.binance.com/api/v5/user/query-api": "fetchAccountId",
47927
47929
  "https://papi.binance.com/papi/v1/balance": "fetchBalance",
47928
47930
  "https://api.binance.com/api/v3/myTrades": "fetchOrderTrades",
47929
47931
  "https://testnet.binancefuture.com/fapi/v1/userTrades": "fetchMyTrades",
@@ -48350,7 +48352,9 @@ var urlToMethodMap = {
48350
48352
  "https://api-testnet.bybit.com/v5/spot-margin-trade/interest-rate-history": "fetchBorrowRateHistory",
48351
48353
  "https://api-testnet.bybit.com/v5/market/open-interest": "fetchOpenInterest",
48352
48354
  "https://api-testnet.bybit.com/v5/asset/deposit/query-address": "fetchDepositAddressesByNetwork",
48353
- "https://api.bybit.com/v5/asset/deposit/query-address": "fetchDepositAddressesByNetwork"
48355
+ "https://api.bybit.com/v5/asset/deposit/query-address": "fetchDepositAddressesByNetwork",
48356
+ "https://api.bybit.com/v5/user/query-api": "fetchAccountId",
48357
+ "https://api-testnet.bybit.com/v5/user/query-api": "fetchAccountId"
48354
48358
  },
48355
48359
  cryptomus: {
48356
48360
  "https://api.cryptomus.com/v2/user-api/exchange/account/tariffs": "fetchTradingFees",
@@ -50816,6 +50820,9 @@ ResponseBody:
50816
50820
  async fetchTime(params = {}) {
50817
50821
  throw new NotSupported(this.id + " fetchTime() is not supported yet");
50818
50822
  }
50823
+ async fetchAccountId() {
50824
+ throw new NotSupported(this.id + " fetchAccountId () is not supported yet");
50825
+ }
50819
50826
  async fetchTradingLimits(symbols = undefined, params = {}) {
50820
50827
  throw new NotSupported(this.id + " fetchTradingLimits() is not supported yet");
50821
50828
  }
@@ -69643,6 +69650,10 @@ class binance extends binance_default {
69643
69650
  }
69644
69651
  return this.safeInteger(response, "serverTime");
69645
69652
  }
69653
+ async fetchAccountId(params = {}) {
69654
+ const response = await this.privateGetAccount(params);
69655
+ return this.safeString(response, "uid");
69656
+ }
69646
69657
  async fetchCurrencies(params = {}) {
69647
69658
  const fetchCurrenciesEnabled = this.safeBool(this.options, "fetchCurrencies");
69648
69659
  if (!fetchCurrenciesEnabled) {
@@ -111056,6 +111067,11 @@ class bybit extends bybit_default {
111056
111067
  const response = await this.publicGetV5MarketTime(params);
111057
111068
  return this.safeInteger(response, "time");
111058
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
+ }
111059
111075
  async fetchCurrencies(params = {}) {
111060
111076
  if (!this.checkRequiredCredentials(false)) {
111061
111077
  return;
@@ -177167,6 +177183,7 @@ class mexc extends mexc_default {
177167
177183
  account: 10,
177168
177184
  myTrades: 10,
177169
177185
  tradeFee: 10,
177186
+ uid: 1,
177170
177187
  "sub-account/list": 1,
177171
177188
  "sub-account/apiKey": 1,
177172
177189
  "capital/config/getall": 10,
@@ -177788,6 +177805,10 @@ class mexc extends mexc_default {
177788
177805
  }
177789
177806
  return;
177790
177807
  }
177808
+ async fetchAccountId(params = {}) {
177809
+ const response = await this.spotPrivateGetUid(params);
177810
+ return this.safeString(response, "uid");
177811
+ }
177791
177812
  async fetchCurrencies(params = {}) {
177792
177813
  if (!this.checkRequiredCredentials(false)) {
177793
177814
  return;
@@ -264782,7 +264803,7 @@ class xt2 extends xt {
264782
264803
  }
264783
264804
 
264784
264805
  // node_modules/@usherlabs/ccxt/js/ccxt.js
264785
- var version2 = "0.0.12";
264806
+ var version2 = "0.0.14";
264786
264807
  Exchange.ccxtVersion = version2;
264787
264808
  var exchanges = {
264788
264809
  alpaca,
@@ -265556,7 +265577,8 @@ var CCXT_METHODS_WITH_VERITY = [
265556
265577
  "withdraw",
265557
265578
  "fetchFundingHistory",
265558
265579
  "fetchWithdrawals",
265559
- "fetchWithdrawal"
265580
+ "fetchWithdrawal",
265581
+ "fetchAccountId"
265560
265582
  ];
265561
265583
 
265562
265584
  // src/helpers/index.ts
@@ -265812,7 +265834,8 @@ var Action = {
265812
265834
  FetchDepositAddresses: 7,
265813
265835
  FetchTicker: 8,
265814
265836
  FetchCurrency: 9,
265815
- Call: 10
265837
+ Call: 10,
265838
+ FetchAccountId: 11
265816
265839
  };
265817
265840
 
265818
265841
  // src/proto/cex_broker/SubscriptionType.ts
@@ -265944,7 +265967,8 @@ var descriptor = {
265944
265967
  FetchDepositAddresses: 7,
265945
265968
  FetchTicker: 8,
265946
265969
  FetchCurrency: 9,
265947
- Call: 10
265970
+ Call: 10,
265971
+ FetchAccountId: 11
265948
265972
  }
265949
265973
  }
265950
265974
  }
@@ -266063,6 +266087,22 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
266063
266087
  }
266064
266088
  break;
266065
266089
  }
266090
+ case Action.FetchAccountId: {
266091
+ try {
266092
+ let accountId = await broker.fetchAccountId();
266093
+ return callback(null, {
266094
+ proof: verityProof,
266095
+ result: JSON.stringify({ accountId })
266096
+ });
266097
+ } catch (error) {
266098
+ log.error(`Error fetching account ID ${cex3}:`, error);
266099
+ callback({
266100
+ code: grpc.status.INTERNAL,
266101
+ message: `Error fetching account ID from ${cex3}`
266102
+ }, null);
266103
+ }
266104
+ break;
266105
+ }
266066
266106
  case Action.Call: {
266067
266107
  const callSchema = import_joi2.default.object({
266068
266108
  functionName: import_joi2.default.string().pattern(/^[A-Za-z][A-Za-z0-9]*$/).required(),
@@ -266877,4 +266917,4 @@ export {
266877
266917
  CEXBroker as default
266878
266918
  };
266879
266919
 
266880
- //# debugId=1B9C01A9C184A6CB64756E2164756E21
266920
+ //# debugId=BEFCD28097A9A4FF64756E2164756E21