diff --git a/examples/typescript/pnpm-lock.yaml b/examples/typescript/pnpm-lock.yaml index 0897f2bcf7..f89261792f 100644 --- a/examples/typescript/pnpm-lock.yaml +++ b/examples/typescript/pnpm-lock.yaml @@ -78,6 +78,9 @@ importers: '@scure/base': specifier: ^1.2.6 version: 1.2.6 + '@signinwithethereum/siwe': + specifier: ^4.1.0 + version: 4.1.0(ethers@6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(viem@2.43.5(bufferutil@4.0.9)(typescript@5.9.2)(utf-8-validate@5.0.10)(zod@3.25.76)) '@x402/core': specifier: workspace:~ version: link:../core @@ -87,9 +90,6 @@ importers: jose: specifier: ^5.9.6 version: 5.10.0 - siwe: - specifier: ^2.3.2 - version: 2.3.2(ethers@6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) tweetnacl: specifier: ^1.0.3 version: 1.0.3 @@ -6594,6 +6594,20 @@ packages: '@selderee/plugin-htmlparser2@0.11.0': resolution: {integrity: sha512-P33hHGdldxGabLFjPPpaTxVolMrzrcegejx+0GxjrIb9Zv48D8yAIA/QTDR2dFl7Uz7urX8aX6+5bCZslr+gWQ==} + '@signinwithethereum/siwe-parser@4.1.0': + resolution: {integrity: sha512-aS+bU5QpTQgMpC6HjQHuKJpltUrkyGUVNuhuBLARa39wF1B+m05/4bgnf2qrEcgQONfU36A2Nbn3ibmwhHkc2Q==} + + '@signinwithethereum/siwe@4.1.0': + resolution: {integrity: sha512-NT56M82i+A2uBU++F9PSBvEYPcjUV3BdClRVojWt3cbe7WizIVH1wi2qKJJR570RLHZvr8q1gUf0E90WymlMeA==} + peerDependencies: + ethers: ^5.7.0 || ^6.13.0 + viem: ^2.7.0 + peerDependenciesMeta: + ethers: + optional: true + viem: + optional: true + '@sindresorhus/is@4.6.0': resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} engines: {node: '>=10'} @@ -19253,6 +19267,18 @@ snapshots: domhandler: 5.0.3 selderee: 0.11.0 + '@signinwithethereum/siwe-parser@4.1.0': + dependencies: + '@noble/hashes': 1.8.0 + apg-js: 4.4.0 + + '@signinwithethereum/siwe@4.1.0(ethers@6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(viem@2.43.5(bufferutil@4.0.9)(typescript@5.9.2)(utf-8-validate@5.0.10)(zod@3.25.76))': + dependencies: + '@signinwithethereum/siwe-parser': 4.1.0 + optionalDependencies: + ethers: 6.15.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + viem: 2.43.5(bufferutil@4.0.9)(typescript@5.9.2)(utf-8-validate@5.0.10)(zod@3.25.76) + '@sindresorhus/is@4.6.0': {} '@smithy/is-array-buffer@2.2.0': diff --git a/typescript/.changeset/migrate-siwe-to-eif.md b/typescript/.changeset/migrate-siwe-to-eif.md new file mode 100644 index 0000000000..beb4bdc487 --- /dev/null +++ b/typescript/.changeset/migrate-siwe-to-eif.md @@ -0,0 +1,5 @@ +--- +'@x402/extensions': patch +--- + +Migrate SIWE dependency from `siwe` (Spruce) to `@signinwithethereum/siwe` (Ethereum Identity Foundation). The new package is the official successor, supports viem natively as a peer dependency, and maintains the same `SiweMessage` API. diff --git a/typescript/packages/extensions/package.json b/typescript/packages/extensions/package.json index 696ae43a1f..49521f1cd7 100644 --- a/typescript/packages/extensions/package.json +++ b/typescript/packages/extensions/package.json @@ -48,7 +48,7 @@ "@x402/core": "workspace:~", "ajv": "^8.17.1", "jose": "^5.9.6", - "siwe": "^2.3.2", + "@signinwithethereum/siwe": "^4.1.0", "tweetnacl": "^1.0.3", "viem": "^2.43.5", "zod": "^3.24.2" diff --git a/typescript/packages/extensions/src/sign-in-with-x/evm.ts b/typescript/packages/extensions/src/sign-in-with-x/evm.ts index 8dfae8bafc..3395ab6c62 100644 --- a/typescript/packages/extensions/src/sign-in-with-x/evm.ts +++ b/typescript/packages/extensions/src/sign-in-with-x/evm.ts @@ -6,7 +6,7 @@ */ import { verifyMessage } from "viem"; -import { SiweMessage } from "siwe"; +import { SiweMessage } from "@signinwithethereum/siwe"; import type { EVMMessageVerifier } from "./types"; import type { CompleteSIWxInfo } from "./client"; import type { SIWxSigner } from "./sign"; diff --git a/typescript/pnpm-lock.yaml b/typescript/pnpm-lock.yaml index c30c460f81..0260a66cf0 100644 --- a/typescript/pnpm-lock.yaml +++ b/typescript/pnpm-lock.yaml @@ -87,6 +87,9 @@ importers: '@scure/base': specifier: ^1.2.6 version: 1.2.6 + '@signinwithethereum/siwe': + specifier: ^4.1.0 + version: 4.1.0(ethers@6.16.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(viem@2.45.1(bufferutil@4.0.9)(typescript@5.9.2)(utf-8-validate@5.0.10)(zod@3.25.76)) '@x402/core': specifier: workspace:~ version: link:../core @@ -96,9 +99,6 @@ importers: jose: specifier: ^5.9.6 version: 5.10.0 - siwe: - specifier: ^2.3.2 - version: 2.3.2(ethers@6.16.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)) tweetnacl: specifier: ^1.0.3 version: 1.0.3 @@ -3159,6 +3159,20 @@ packages: '@scure/bip39@1.6.0': resolution: {integrity: sha512-+lF0BbLiJNwVlev4eKelw1WWLaiKXw7sSl8T6FvBlWkdX+94aGJ4o8XjUdlyhTCjd8c+B3KT3JfS8P0bLRNU6A==} + '@signinwithethereum/siwe-parser@4.1.0': + resolution: {integrity: sha512-aS+bU5QpTQgMpC6HjQHuKJpltUrkyGUVNuhuBLARa39wF1B+m05/4bgnf2qrEcgQONfU36A2Nbn3ibmwhHkc2Q==} + + '@signinwithethereum/siwe@4.1.0': + resolution: {integrity: sha512-NT56M82i+A2uBU++F9PSBvEYPcjUV3BdClRVojWt3cbe7WizIVH1wi2qKJJR570RLHZvr8q1gUf0E90WymlMeA==} + peerDependencies: + ethers: ^5.7.0 || ^6.13.0 + viem: ^2.7.0 + peerDependenciesMeta: + ethers: + optional: true + viem: + optional: true + '@sindresorhus/is@4.6.0': resolution: {integrity: sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==} engines: {node: '>=10'} @@ -4280,21 +4294,6 @@ packages: '@solana/web3.js@1.98.4': resolution: {integrity: sha512-vv9lfnvjUsRiq//+j5pBdXig0IQdtzA0BRZ3bXEP4KaIyF1CcaydWqgyzQgfZMNIsWNWmG+AUHwPy4AHOD6gpw==} - '@spruceid/siwe-parser@2.1.2': - resolution: {integrity: sha512-d/r3S1LwJyMaRAKQ0awmo9whfXeE88Qt00vRj91q5uv5ATtWIQEGJ67Yr5eSZw5zp1/fZCXZYuEckt8lSkereQ==} - - '@stablelib/binary@1.0.1': - resolution: {integrity: sha512-ClJWvmL6UBM/wjkvv/7m5VP3GMr9t0osr4yVgLZsLCOz4hGN9gIAFEqnJ0TsSMAN+n840nf2cHZnA5/KFqHC7Q==} - - '@stablelib/int@1.0.1': - resolution: {integrity: sha512-byr69X/sDtDiIjIV6m4roLVWnNNlRGzsvxw+agj8CIEazqWGOQp2dTYgQhtyVXV9wpO6WyXRQUzLV/JRNumT2w==} - - '@stablelib/random@1.0.2': - resolution: {integrity: sha512-rIsE83Xpb7clHPVRlBj8qNe5L8ISQOzjghYQm/dZ7VaM2KHYwMW5adjQjrzTZCchFnNCNhkwtnOBa9HTMJCI8w==} - - '@stablelib/wipe@1.0.1': - resolution: {integrity: sha512-WfqfX/eXGiAd3RJe4VU2snh/ZPwtSjLG4ynQ/vYzvghTh7dHFcI1wl+nrkWG6lGhukOxOsUHfv8dUXr58D0ayg==} - '@stellar/js-xdr@3.1.2': resolution: {integrity: sha512-VVolPL5goVEIsvuGqDc5uiKxV03lzfWdvYg1KikvwheDmTBO68CKDji3bAZ/kppZrx5iTA8z3Ld5yuytcvhvOQ==} @@ -7932,11 +7931,6 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} - siwe@2.3.2: - resolution: {integrity: sha512-aSf+6+Latyttbj5nMu6GF3doMfv2UYj83hhwZgUF20ky6fTS83uVhkQABdIVnEuS8y1bBdk7p6ltb9SmlhTTlA==} - peerDependencies: - ethers: ^5.6.8 || ^6.0.8 - slash@3.0.0: resolution: {integrity: sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==} engines: {node: '>=8'} @@ -8535,9 +8529,6 @@ packages: resolution: {integrity: sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==} hasBin: true - valid-url@1.0.9: - resolution: {integrity: sha512-QQDsV8OnSf5Uc30CKSwG9lnhMPe6exHtTXLRYX8uMwKENy640pU+2BgBL0LRbDh/eYRahNCS7aewCx0wf3NYVA==} - valtio@1.13.2: resolution: {integrity: sha512-Qik0o+DSy741TmkqmRfjq+0xpZBXi/Y6+fXZLn0xNF1z/waFMbE3rkivv5Zcf9RrMUp6zswf2J7sbh2KBlba5A==} engines: {node: '>=12.20.0'} @@ -8943,7 +8934,8 @@ snapshots: '@acemir/cssom@0.9.30': optional: true - '@adraffy/ens-normalize@1.10.1': {} + '@adraffy/ens-normalize@1.10.1': + optional: true '@adraffy/ens-normalize@1.11.0': {} @@ -10874,6 +10866,7 @@ snapshots: '@noble/curves@1.2.0': dependencies: '@noble/hashes': 1.3.2 + optional: true '@noble/curves@1.4.2': dependencies: @@ -10895,7 +10888,8 @@ snapshots: dependencies: '@noble/hashes': 1.8.0 - '@noble/hashes@1.3.2': {} + '@noble/hashes@1.3.2': + optional: true '@noble/hashes@1.4.0': {} @@ -11537,6 +11531,18 @@ snapshots: '@noble/hashes': 1.8.0 '@scure/base': 1.2.6 + '@signinwithethereum/siwe-parser@4.1.0': + dependencies: + '@noble/hashes': 1.8.0 + apg-js: 4.4.0 + + '@signinwithethereum/siwe@4.1.0(ethers@6.16.0(bufferutil@4.0.9)(utf-8-validate@5.0.10))(viem@2.45.1(bufferutil@4.0.9)(typescript@5.9.2)(utf-8-validate@5.0.10)(zod@3.25.76))': + dependencies: + '@signinwithethereum/siwe-parser': 4.1.0 + optionalDependencies: + ethers: 6.16.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) + viem: 2.45.1(bufferutil@4.0.9)(typescript@5.9.2)(utf-8-validate@5.0.10)(zod@3.25.76) + '@sindresorhus/is@4.6.0': {} '@socket.io/component-emitter@3.1.2': {} @@ -13246,26 +13252,6 @@ snapshots: - typescript - utf-8-validate - '@spruceid/siwe-parser@2.1.2': - dependencies: - '@noble/hashes': 1.8.0 - apg-js: 4.4.0 - uri-js: 4.4.1 - valid-url: 1.0.9 - - '@stablelib/binary@1.0.1': - dependencies: - '@stablelib/int': 1.0.1 - - '@stablelib/int@1.0.1': {} - - '@stablelib/random@1.0.2': - dependencies: - '@stablelib/binary': 1.0.1 - '@stablelib/wipe': 1.0.1 - - '@stablelib/wipe@1.0.1': {} - '@stellar/js-xdr@3.1.2': {} '@stellar/stellar-base@14.1.0': @@ -13552,6 +13538,7 @@ snapshots: '@types/node@22.7.5': dependencies: undici-types: 6.19.8 + optional: true '@types/qs@6.14.0': {} @@ -14791,7 +14778,8 @@ snapshots: acorn@8.15.0: {} - aes-js@4.0.0-beta.5: {} + aes-js@4.0.0-beta.5: + optional: true agent-base@7.1.4: {} @@ -16025,6 +16013,7 @@ snapshots: transitivePeerDependencies: - bufferutil - utf-8-validate + optional: true eventemitter2@6.4.9: {} @@ -18120,14 +18109,6 @@ snapshots: signal-exit@4.1.0: {} - siwe@2.3.2(ethers@6.16.0(bufferutil@4.0.9)(utf-8-validate@5.0.10)): - dependencies: - '@spruceid/siwe-parser': 2.1.2 - '@stablelib/random': 1.0.2 - ethers: 6.16.0(bufferutil@4.0.9)(utf-8-validate@5.0.10) - uri-js: 4.4.1 - valid-url: 1.0.9 - slash@3.0.0: {} snake-case@3.0.4: @@ -18464,7 +18445,8 @@ snapshots: tslib@1.14.1: {} - tslib@2.7.0: {} + tslib@2.7.0: + optional: true tslib@2.8.1: {} @@ -18608,7 +18590,8 @@ snapshots: uncrypto@0.1.3: {} - undici-types@6.19.8: {} + undici-types@6.19.8: + optional: true undici-types@6.21.0: {} @@ -18717,8 +18700,6 @@ snapshots: uuid@9.0.1: {} - valid-url@1.0.9: {} - valtio@1.13.2(@types/react@19.1.12)(react@19.2.1): dependencies: derive-valtio: 0.1.0(valtio@1.13.2(@types/react@19.1.12)(react@19.2.1))