facinet 2.0.3 → 2.0.4

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
@@ -22660,23 +22660,21 @@ var Facinet = class _Facinet {
22660
22660
  const messageForBrowser = {
22661
22661
  from: payerAddress,
22662
22662
  to: params.recipient,
22663
- value: amount.toString(),
22664
- // Convert BigInt to string for JSON
22665
- validAfter: validAfter.toString(),
22666
- validBefore: validBefore.toString(),
22663
+ value: "0x" + amount.toString(16),
22664
+ // BigInt to hex string
22665
+ validAfter,
22666
+ validBefore,
22667
22667
  nonce
22668
22668
  };
22669
+ const jsonMessage = JSON.stringify({
22670
+ domain,
22671
+ types,
22672
+ primaryType: "TransferWithAuthorization",
22673
+ message: messageForBrowser
22674
+ });
22669
22675
  signature = await window.ethereum.request({
22670
22676
  method: "eth_signTypedData_v4",
22671
- params: [
22672
- payerAddress,
22673
- JSON.stringify({
22674
- domain,
22675
- types,
22676
- primaryType: "TransferWithAuthorization",
22677
- message: messageForBrowser
22678
- })
22679
- ]
22677
+ params: [payerAddress, jsonMessage]
22680
22678
  });
22681
22679
  } else {
22682
22680
  throw new Error("No signing method available");