@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.
@@ -79209,7 +79209,7 @@ var PolygonIdSdk = (function (exports) {
79209
79209
  if (!paymentRequest.from) {
79210
79210
  throw new Error(`failed request. empty 'from' field`);
79211
79211
  }
79212
- if (!paymentRequest.body?.payments?.length) {
79212
+ if (!paymentRequest.body.payments?.length) {
79213
79213
  throw new Error(`failed request. no 'payments' in body`);
79214
79214
  }
79215
79215
  if (!ctx.paymentHandler) {
@@ -79280,12 +79280,12 @@ var PolygonIdSdk = (function (exports) {
79280
79280
  if (opts.paymentRequest.from !== payment.to) {
79281
79281
  throw new Error(`sender of the request is not a target of response - expected ${opts.paymentRequest.from}, given ${payment.to}`);
79282
79282
  }
79283
- if (!payment.body?.payments.length) {
79283
+ if (!payment.body.payments.length) {
79284
79284
  throw new Error(`failed request. empty 'payments' field in body`);
79285
79285
  }
79286
79286
  for (let i = 0; i < payment.body.payments.length; i++) {
79287
- const p = payment.body?.payments[i];
79288
- const paymentRequestData = opts.paymentRequest.body?.payments.find((r) => r.data.id === p.id);
79287
+ const p = payment.body.payments[i];
79288
+ const paymentRequestData = opts.paymentRequest.body.payments.find((r) => r.data.id === p.id);
79289
79289
  if (!paymentRequestData) {
79290
79290
  throw new Error(`can't find payment request for payment id ${p.id}`);
79291
79291
  }