@usherlabs/cex-broker 0.1.11 → 0.1.13

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.
@@ -290020,6 +290020,7 @@ function createBroker(cex3, metadata, useVerity, verityProverUrl) {
290020
290020
  exchange.setSandboxMode(true);
290021
290021
  }
290022
290022
  exchange.options.recvWindow = 60000;
290023
+ exchange.redact_exclusion = "key";
290023
290024
  return exchange;
290024
290025
  }
290025
290026
  function selectBroker(brokers, metadata) {
@@ -290202,7 +290203,7 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
290202
290203
  }
290203
290204
  const metadata = call.metadata;
290204
290205
  const { action, cex: cex3, symbol } = call.request;
290205
- if (!action || !cex3 || !symbol) {
290206
+ if (!action || !cex3) {
290206
290207
  return callback({
290207
290208
  code: grpc.status.INVALID_ARGUMENT,
290208
290209
  message: "action, cex, symbol, and cex are required"
@@ -290255,6 +290256,12 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
290255
290256
  break;
290256
290257
  }
290257
290258
  case Action.FetchDepositAddresses: {
290259
+ if (!symbol) {
290260
+ return callback({
290261
+ code: grpc.status.INVALID_ARGUMENT,
290262
+ message: `ValidationError: Symbol requied`
290263
+ }, null);
290264
+ }
290258
290265
  const fetchDepositAddressesSchema = import_joi2.default.object({
290259
290266
  chain: import_joi2.default.string().required(),
290260
290267
  params: import_joi2.default.object().pattern(import_joi2.default.string(), import_joi2.default.string()).default({})
@@ -290298,6 +290305,12 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
290298
290305
  break;
290299
290306
  }
290300
290307
  case Action.Transfer: {
290308
+ if (!symbol) {
290309
+ return callback({
290310
+ code: grpc.status.INVALID_ARGUMENT,
290311
+ message: `ValidationError: Symbol requied`
290312
+ }, null);
290313
+ }
290301
290314
  const transferSchema = import_joi2.default.object({
290302
290315
  recipientAddress: import_joi2.default.string().required(),
290303
290316
  amount: import_joi2.default.number().positive().required(),
@@ -290449,7 +290462,7 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
290449
290462
  const balance = await broker.fetchFreeBalance({
290450
290463
  ...call.request.payload ?? {}
290451
290464
  });
290452
- const currencyBalance = balance[symbol];
290465
+ const currencyBalance = symbol ? balance[symbol] : balance;
290453
290466
  callback(null, {
290454
290467
  proof: broker.last_proof || "",
290455
290468
  result: JSON.stringify({
@@ -290483,6 +290496,12 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
290483
290496
  }
290484
290497
  break;
290485
290498
  case Action.FetchTicker:
290499
+ if (!symbol) {
290500
+ return callback({
290501
+ code: grpc.status.INVALID_ARGUMENT,
290502
+ message: `ValidationError: Symbol requied`
290503
+ }, null);
290504
+ }
290486
290505
  try {
290487
290506
  const ticker = await broker.fetchTicker(symbol);
290488
290507
  callback(null, {
@@ -290926,6 +290945,7 @@ class CEXBroker {
290926
290945
  recvWindow: 60000
290927
290946
  }
290928
290947
  });
290948
+ exchange.redact_exclusion = "key";
290929
290949
  secondaryBrokers[+index2] = exchange;
290930
290950
  } else {
290931
290951
  log.warn(`⚠️ Incomplete secondary credentials for broker "${broker}" at index ${index2}`);
@@ -290991,7 +291011,7 @@ class CEXBroker {
290991
291011
  for (const index2 of Object.keys(creds2.secondaryKeys)) {
290992
291012
  const sec = creds2.secondaryKeys[+index2];
290993
291013
  if (!!sec?.apiKey && !!sec?.apiSecret) {
290994
- secondaryBroker[+index2] = new ExchangeClass({
291014
+ const exchange = new ExchangeClass({
290995
291015
  apiKey: sec.apiKey,
290996
291016
  secret: sec.apiSecret,
290997
291017
  enableRateLimit: true,
@@ -291004,6 +291024,8 @@ class CEXBroker {
291004
291024
  recvWindow: 60000
291005
291025
  }
291006
291026
  });
291027
+ exchange.redact_exclusion = "key";
291028
+ secondaryBroker[+index2] = exchange;
291007
291029
  } else {
291008
291030
  log.warn(`⚠️ Incomplete secondary credentials for broker "${broker}" at index ${index2}`);
291009
291031
  }
@@ -291026,6 +291048,7 @@ class CEXBroker {
291026
291048
  recvWindow: 60000
291027
291049
  }
291028
291050
  });
291051
+ client.redact_exclusion = "key";
291029
291052
  this.brokers[broker] = {
291030
291053
  primary: client,
291031
291054
  secondaryBrokers: secondaryBroker
package/dist/index.js CHANGED
@@ -285067,6 +285067,7 @@ function createBroker(cex3, metadata, useVerity, verityProverUrl) {
285067
285067
  exchange.setSandboxMode(true);
285068
285068
  }
285069
285069
  exchange.options.recvWindow = 60000;
285070
+ exchange.redact_exclusion = "key";
285070
285071
  return exchange;
285071
285072
  }
285072
285073
  function selectBroker(brokers, metadata) {
@@ -285249,7 +285250,7 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
285249
285250
  }
285250
285251
  const metadata = call.metadata;
285251
285252
  const { action, cex: cex3, symbol } = call.request;
285252
- if (!action || !cex3 || !symbol) {
285253
+ if (!action || !cex3) {
285253
285254
  return callback({
285254
285255
  code: grpc.status.INVALID_ARGUMENT,
285255
285256
  message: "action, cex, symbol, and cex are required"
@@ -285302,6 +285303,12 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
285302
285303
  break;
285303
285304
  }
285304
285305
  case Action.FetchDepositAddresses: {
285306
+ if (!symbol) {
285307
+ return callback({
285308
+ code: grpc.status.INVALID_ARGUMENT,
285309
+ message: `ValidationError: Symbol requied`
285310
+ }, null);
285311
+ }
285305
285312
  const fetchDepositAddressesSchema = import_joi2.default.object({
285306
285313
  chain: import_joi2.default.string().required(),
285307
285314
  params: import_joi2.default.object().pattern(import_joi2.default.string(), import_joi2.default.string()).default({})
@@ -285345,6 +285352,12 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
285345
285352
  break;
285346
285353
  }
285347
285354
  case Action.Transfer: {
285355
+ if (!symbol) {
285356
+ return callback({
285357
+ code: grpc.status.INVALID_ARGUMENT,
285358
+ message: `ValidationError: Symbol requied`
285359
+ }, null);
285360
+ }
285348
285361
  const transferSchema = import_joi2.default.object({
285349
285362
  recipientAddress: import_joi2.default.string().required(),
285350
285363
  amount: import_joi2.default.number().positive().required(),
@@ -285496,7 +285509,7 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
285496
285509
  const balance = await broker.fetchFreeBalance({
285497
285510
  ...call.request.payload ?? {}
285498
285511
  });
285499
- const currencyBalance = balance[symbol];
285512
+ const currencyBalance = symbol ? balance[symbol] : balance;
285500
285513
  callback(null, {
285501
285514
  proof: broker.last_proof || "",
285502
285515
  result: JSON.stringify({
@@ -285530,6 +285543,12 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
285530
285543
  }
285531
285544
  break;
285532
285545
  case Action.FetchTicker:
285546
+ if (!symbol) {
285547
+ return callback({
285548
+ code: grpc.status.INVALID_ARGUMENT,
285549
+ message: `ValidationError: Symbol requied`
285550
+ }, null);
285551
+ }
285533
285552
  try {
285534
285553
  const ticker = await broker.fetchTicker(symbol);
285535
285554
  callback(null, {
@@ -285973,6 +285992,7 @@ class CEXBroker {
285973
285992
  recvWindow: 60000
285974
285993
  }
285975
285994
  });
285995
+ exchange.redact_exclusion = "key";
285976
285996
  secondaryBrokers[+index2] = exchange;
285977
285997
  } else {
285978
285998
  log.warn(`\u26A0\uFE0F Incomplete secondary credentials for broker "${broker}" at index ${index2}`);
@@ -286038,7 +286058,7 @@ class CEXBroker {
286038
286058
  for (const index2 of Object.keys(creds2.secondaryKeys)) {
286039
286059
  const sec = creds2.secondaryKeys[+index2];
286040
286060
  if (!!sec?.apiKey && !!sec?.apiSecret) {
286041
- secondaryBroker[+index2] = new ExchangeClass({
286061
+ const exchange = new ExchangeClass({
286042
286062
  apiKey: sec.apiKey,
286043
286063
  secret: sec.apiSecret,
286044
286064
  enableRateLimit: true,
@@ -286051,6 +286071,8 @@ class CEXBroker {
286051
286071
  recvWindow: 60000
286052
286072
  }
286053
286073
  });
286074
+ exchange.redact_exclusion = "key";
286075
+ secondaryBroker[+index2] = exchange;
286054
286076
  } else {
286055
286077
  log.warn(`\u26A0\uFE0F Incomplete secondary credentials for broker "${broker}" at index ${index2}`);
286056
286078
  }
@@ -286073,6 +286095,7 @@ class CEXBroker {
286073
286095
  recvWindow: 60000
286074
286096
  }
286075
286097
  });
286098
+ client.redact_exclusion = "key";
286076
286099
  this.brokers[broker] = {
286077
286100
  primary: client,
286078
286101
  secondaryBrokers: secondaryBroker
@@ -286141,4 +286164,4 @@ export {
286141
286164
  CEXBroker as default
286142
286165
  };
286143
286166
 
286144
- //# debugId=DEA73F64725EF87564756E2164756E21
286167
+ //# debugId=FC2F8C58BEBADF4364756E2164756E21