@chipi-stack/core 0.6.0 → 0.6.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.
package/dist/index.cjs CHANGED
@@ -553,13 +553,17 @@ var DEFAULT_PAYMENT_HEADER = "X-PAYMENT";
553
553
  var X402_DOMAIN = {
554
554
  name: "x402-starknet",
555
555
  version: "1",
556
- chainId: "SN_MAIN"
556
+ chainId: "SN_MAIN",
557
+ // SNIP-12 revision 1 (StarknetDomain). Without it starknet.js refuses to
558
+ // hash the typed data, so no account could sign a payment.
559
+ revision: "1"
557
560
  };
558
561
  var X402_TYPES = {
559
562
  StarknetDomain: [
560
563
  { name: "name", type: "shortstring" },
561
564
  { name: "version", type: "shortstring" },
562
- { name: "chainId", type: "shortstring" }
565
+ { name: "chainId", type: "shortstring" },
566
+ { name: "revision", type: "shortstring" }
563
567
  ],
564
568
  Payment: [
565
569
  { name: "from_address", type: "ContractAddress" },
@@ -591,7 +595,7 @@ function buildX402TypedData(message) {
591
595
  return {
592
596
  types: X402_TYPES,
593
597
  primaryType: "Payment",
594
- domain: X402_DOMAIN,
598
+ domain: { ...X402_DOMAIN },
595
599
  message: {
596
600
  ...resolved,
597
601
  amount: { low: resolved.amount, high: "0" }