facinet 2.0.1 → 2.0.3

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.
package/dist/browser.js CHANGED
@@ -22657,6 +22657,15 @@ var Facinet = class _Facinet {
22657
22657
  if (this.wallet) {
22658
22658
  signature = await this.wallet.signTypedData(domain, types, value);
22659
22659
  } else if (typeof window !== "undefined" && window.ethereum) {
22660
+ const messageForBrowser = {
22661
+ from: payerAddress,
22662
+ to: params.recipient,
22663
+ value: amount.toString(),
22664
+ // Convert BigInt to string for JSON
22665
+ validAfter: validAfter.toString(),
22666
+ validBefore: validBefore.toString(),
22667
+ nonce
22668
+ };
22660
22669
  signature = await window.ethereum.request({
22661
22670
  method: "eth_signTypedData_v4",
22662
22671
  params: [
@@ -22665,7 +22674,7 @@ var Facinet = class _Facinet {
22665
22674
  domain,
22666
22675
  types,
22667
22676
  primaryType: "TransferWithAuthorization",
22668
- message: value
22677
+ message: messageForBrowser
22669
22678
  })
22670
22679
  ]
22671
22680
  });
@@ -22687,9 +22696,7 @@ var Facinet = class _Facinet {
22687
22696
  `${this.config.apiUrl}/api/x402/settle-custom`,
22688
22697
  {
22689
22698
  facilitatorId: facilitator.id,
22690
- paymentPayload: {
22691
- payload: paymentPayload
22692
- }
22699
+ paymentPayload
22693
22700
  }
22694
22701
  );
22695
22702
  if (!response.data.success) {