@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.d.cts CHANGED
@@ -365,6 +365,7 @@ declare const X402_DOMAIN: {
365
365
  name: string;
366
366
  version: string;
367
367
  chainId: string;
368
+ revision: string;
368
369
  };
369
370
  /** SNIP-12 typed data structure for x402 payment */
370
371
  declare const X402_TYPES: {
package/dist/index.d.ts CHANGED
@@ -365,6 +365,7 @@ declare const X402_DOMAIN: {
365
365
  name: string;
366
366
  version: string;
367
367
  chainId: string;
368
+ revision: string;
368
369
  };
369
370
  /** SNIP-12 typed data structure for x402 payment */
370
371
  declare const X402_TYPES: {
package/dist/index.js CHANGED
@@ -551,13 +551,17 @@ var DEFAULT_PAYMENT_HEADER = "X-PAYMENT";
551
551
  var X402_DOMAIN = {
552
552
  name: "x402-starknet",
553
553
  version: "1",
554
- chainId: "SN_MAIN"
554
+ chainId: "SN_MAIN",
555
+ // SNIP-12 revision 1 (StarknetDomain). Without it starknet.js refuses to
556
+ // hash the typed data, so no account could sign a payment.
557
+ revision: "1"
555
558
  };
556
559
  var X402_TYPES = {
557
560
  StarknetDomain: [
558
561
  { name: "name", type: "shortstring" },
559
562
  { name: "version", type: "shortstring" },
560
- { name: "chainId", type: "shortstring" }
563
+ { name: "chainId", type: "shortstring" },
564
+ { name: "revision", type: "shortstring" }
561
565
  ],
562
566
  Payment: [
563
567
  { name: "from_address", type: "ContractAddress" },
@@ -589,7 +593,7 @@ function buildX402TypedData(message) {
589
593
  return {
590
594
  types: X402_TYPES,
591
595
  primaryType: "Payment",
592
- domain: X402_DOMAIN,
596
+ domain: { ...X402_DOMAIN },
593
597
  message: {
594
598
  ...resolved,
595
599
  amount: { low: resolved.amount, high: "0" }