@0xpolygonid/js-sdk 1.14.0 → 1.14.1

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.
@@ -58301,7 +58301,7 @@ class PaymentHandler extends AbstractMessageHandler {
58301
58301
  if (!paymentRequest.from) {
58302
58302
  throw new Error(`failed request. empty 'from' field`);
58303
58303
  }
58304
- if (!paymentRequest.body?.payments?.length) {
58304
+ if (!paymentRequest.body.payments?.length) {
58305
58305
  throw new Error(`failed request. no 'payments' in body`);
58306
58306
  }
58307
58307
  if (!ctx.paymentHandler) {
@@ -58372,12 +58372,12 @@ class PaymentHandler extends AbstractMessageHandler {
58372
58372
  if (opts.paymentRequest.from !== payment.to) {
58373
58373
  throw new Error(`sender of the request is not a target of response - expected ${opts.paymentRequest.from}, given ${payment.to}`);
58374
58374
  }
58375
- if (!payment.body?.payments.length) {
58375
+ if (!payment.body.payments.length) {
58376
58376
  throw new Error(`failed request. empty 'payments' field in body`);
58377
58377
  }
58378
58378
  for (let i = 0; i < payment.body.payments.length; i++) {
58379
- const p = payment.body?.payments[i];
58380
- const paymentRequestData = opts.paymentRequest.body?.payments.find((r) => r.data.id === p.id);
58379
+ const p = payment.body.payments[i];
58380
+ const paymentRequestData = opts.paymentRequest.body.payments.find((r) => r.data.id === p.id);
58381
58381
  if (!paymentRequestData) {
58382
58382
  throw new Error(`can't find payment request for payment id ${p.id}`);
58383
58383
  }