@usherlabs/cex-broker 0.1.12 → 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.
@@ -290203,7 +290203,7 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
290203
290203
  }
290204
290204
  const metadata = call.metadata;
290205
290205
  const { action, cex: cex3, symbol } = call.request;
290206
- if (!action || !cex3 || !symbol) {
290206
+ if (!action || !cex3) {
290207
290207
  return callback({
290208
290208
  code: grpc.status.INVALID_ARGUMENT,
290209
290209
  message: "action, cex, symbol, and cex are required"
@@ -290256,6 +290256,12 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
290256
290256
  break;
290257
290257
  }
290258
290258
  case Action.FetchDepositAddresses: {
290259
+ if (!symbol) {
290260
+ return callback({
290261
+ code: grpc.status.INVALID_ARGUMENT,
290262
+ message: `ValidationError: Symbol requied`
290263
+ }, null);
290264
+ }
290259
290265
  const fetchDepositAddressesSchema = import_joi2.default.object({
290260
290266
  chain: import_joi2.default.string().required(),
290261
290267
  params: import_joi2.default.object().pattern(import_joi2.default.string(), import_joi2.default.string()).default({})
@@ -290299,6 +290305,12 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
290299
290305
  break;
290300
290306
  }
290301
290307
  case Action.Transfer: {
290308
+ if (!symbol) {
290309
+ return callback({
290310
+ code: grpc.status.INVALID_ARGUMENT,
290311
+ message: `ValidationError: Symbol requied`
290312
+ }, null);
290313
+ }
290302
290314
  const transferSchema = import_joi2.default.object({
290303
290315
  recipientAddress: import_joi2.default.string().required(),
290304
290316
  amount: import_joi2.default.number().positive().required(),
@@ -290450,7 +290462,7 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
290450
290462
  const balance = await broker.fetchFreeBalance({
290451
290463
  ...call.request.payload ?? {}
290452
290464
  });
290453
- const currencyBalance = balance[symbol];
290465
+ const currencyBalance = symbol ? balance[symbol] : balance;
290454
290466
  callback(null, {
290455
290467
  proof: broker.last_proof || "",
290456
290468
  result: JSON.stringify({
@@ -290484,6 +290496,12 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
290484
290496
  }
290485
290497
  break;
290486
290498
  case Action.FetchTicker:
290499
+ if (!symbol) {
290500
+ return callback({
290501
+ code: grpc.status.INVALID_ARGUMENT,
290502
+ message: `ValidationError: Symbol requied`
290503
+ }, null);
290504
+ }
290487
290505
  try {
290488
290506
  const ticker = await broker.fetchTicker(symbol);
290489
290507
  callback(null, {
package/dist/index.js CHANGED
@@ -285250,7 +285250,7 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
285250
285250
  }
285251
285251
  const metadata = call.metadata;
285252
285252
  const { action, cex: cex3, symbol } = call.request;
285253
- if (!action || !cex3 || !symbol) {
285253
+ if (!action || !cex3) {
285254
285254
  return callback({
285255
285255
  code: grpc.status.INVALID_ARGUMENT,
285256
285256
  message: "action, cex, symbol, and cex are required"
@@ -285303,6 +285303,12 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
285303
285303
  break;
285304
285304
  }
285305
285305
  case Action.FetchDepositAddresses: {
285306
+ if (!symbol) {
285307
+ return callback({
285308
+ code: grpc.status.INVALID_ARGUMENT,
285309
+ message: `ValidationError: Symbol requied`
285310
+ }, null);
285311
+ }
285306
285312
  const fetchDepositAddressesSchema = import_joi2.default.object({
285307
285313
  chain: import_joi2.default.string().required(),
285308
285314
  params: import_joi2.default.object().pattern(import_joi2.default.string(), import_joi2.default.string()).default({})
@@ -285346,6 +285352,12 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
285346
285352
  break;
285347
285353
  }
285348
285354
  case Action.Transfer: {
285355
+ if (!symbol) {
285356
+ return callback({
285357
+ code: grpc.status.INVALID_ARGUMENT,
285358
+ message: `ValidationError: Symbol requied`
285359
+ }, null);
285360
+ }
285349
285361
  const transferSchema = import_joi2.default.object({
285350
285362
  recipientAddress: import_joi2.default.string().required(),
285351
285363
  amount: import_joi2.default.number().positive().required(),
@@ -285497,7 +285509,7 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
285497
285509
  const balance = await broker.fetchFreeBalance({
285498
285510
  ...call.request.payload ?? {}
285499
285511
  });
285500
- const currencyBalance = balance[symbol];
285512
+ const currencyBalance = symbol ? balance[symbol] : balance;
285501
285513
  callback(null, {
285502
285514
  proof: broker.last_proof || "",
285503
285515
  result: JSON.stringify({
@@ -285531,6 +285543,12 @@ function getServer(policy, brokers, whitelistIps, useVerity, verityProverUrl) {
285531
285543
  }
285532
285544
  break;
285533
285545
  case Action.FetchTicker:
285546
+ if (!symbol) {
285547
+ return callback({
285548
+ code: grpc.status.INVALID_ARGUMENT,
285549
+ message: `ValidationError: Symbol requied`
285550
+ }, null);
285551
+ }
285534
285552
  try {
285535
285553
  const ticker = await broker.fetchTicker(symbol);
285536
285554
  callback(null, {
@@ -286146,4 +286164,4 @@ export {
286146
286164
  CEXBroker as default
286147
286165
  };
286148
286166
 
286149
- //# debugId=16AAAD0D4E9C3C9564756E2164756E21
286167
+ //# debugId=FC2F8C58BEBADF4364756E2164756E21