From dfa3a974d1148cca456a2ff1556f12fa1a249319 Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Mon, 19 Jan 2026 15:33:05 +0600 Subject: [PATCH 01/19] chore: update @clerk/clerk-expo and @clerk/types to latest versions --- package-lock.json | 1742 ++++++++++++++--- package.json | 4 +- .../clerk/hooks/use-auth-with-identifier.ts | 8 +- 3 files changed, 1498 insertions(+), 256 deletions(-) diff --git a/package-lock.json b/package-lock.json index fe93fde..97c890c 100644 --- a/package-lock.json +++ b/package-lock.json @@ -40,8 +40,8 @@ "tslib": "^2.8.1" }, "devDependencies": { - "@clerk/clerk-expo": "^2.19.6", - "@clerk/types": "^4.101.3", + "@clerk/clerk-expo": "^2.19.18", + "@clerk/types": "^4.101.11", "@eslint/compat": "^1.4.0", "@eslint/eslintrc": "^3.3.1", "@eslint/js": "^9.37.0", @@ -145,8 +145,7 @@ "version": "1.11.1", "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.1.tgz", "integrity": "sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@babel/code-frame": { "version": "7.10.4", @@ -2476,7 +2475,6 @@ "resolved": "https://registry.npmjs.org/@base-org/account/-/account-2.0.1.tgz", "integrity": "sha512-tySVNx+vd6XEynZL0uvB10uKiwnAfThr8AbKTwILVG86mPbLAhEOInQIk+uDnvpTvfdUhC1Bi5T/46JvFoLZQQ==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@noble/hashes": "1.4.0", "clsx": "1.2.1", @@ -2492,8 +2490,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@bcoe/v8-coverage": { "version": "0.2.3", @@ -2503,16 +2500,15 @@ "license": "MIT" }, "node_modules/@clerk/clerk-expo": { - "version": "2.19.6", - "resolved": "https://registry.npmjs.org/@clerk/clerk-expo/-/clerk-expo-2.19.6.tgz", - "integrity": "sha512-YqaQ0u0mHqUPlBomHhXgprlSrdm7g5kfCebOS3m4Vb5bRXwAksazkEntGUoiWztmHtN1B8BDdqLZmFWQgE78HA==", + "version": "2.19.18", + "resolved": "https://registry.npmjs.org/@clerk/clerk-expo/-/clerk-expo-2.19.18.tgz", + "integrity": "sha512-3okcPrOuY7NJ9eHAU/XSXuUiN28e4vuLTS5BbTo+Z4KvTsG4eUrhl3Rq2E7lnYfA8eN53byXVIvsGmzj6Tiz+w==", "dev": true, - "license": "MIT", "dependencies": { - "@clerk/clerk-js": "^5.111.0", - "@clerk/clerk-react": "^5.57.0", - "@clerk/shared": "^3.36.0", - "@clerk/types": "^4.101.3", + "@clerk/clerk-js": "^5.120.0", + "@clerk/clerk-react": "^5.59.4", + "@clerk/shared": "^3.43.0", + "@clerk/types": "^4.101.11", "base-64": "^1.0.0", "react-native-url-polyfill": "2.0.0", "tslib": "2.8.1" @@ -2528,8 +2524,8 @@ "expo-local-authentication": ">=13.5.0", "expo-secure-store": ">=12.4.0", "expo-web-browser": ">=12.5.0", - "react": "^18.0.0 || ^19.0.0 || ^19.0.0-0", - "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-0", + "react": "^18.0.0 || ^19.0.0", + "react-dom": "^18.0.0 || ^19.0.0", "react-native": ">=0.73" }, "peerDependenciesMeta": { @@ -2550,25 +2546,28 @@ } } }, - "node_modules/@clerk/clerk-js": { - "version": "5.111.0", - "resolved": "https://registry.npmjs.org/@clerk/clerk-js/-/clerk-js-5.111.0.tgz", - "integrity": "sha512-8a+Fc6f/KJArP2TENYQh/iMQtaovW0dBt7Yjhnr0EGZkMVOJnq/ZoKwEJcEXMBGsh66veugYtn6E6APCgINkUQ==", + "node_modules/@clerk/clerk-expo/node_modules/@clerk/clerk-js": { + "version": "5.120.0", + "resolved": "https://registry.npmjs.org/@clerk/clerk-js/-/clerk-js-5.120.0.tgz", + "integrity": "sha512-HWEHqdmGdM1MMWQic50BlecFgGR/HEy+IJaFTYifvBU4MIEuRAEQor5MniGHQGUKVPya9kqwMVphuz7r8R9CAg==", "dev": true, - "license": "MIT", "dependencies": { "@base-org/account": "2.0.1", - "@clerk/localizations": "^3.28.5", - "@clerk/shared": "^3.36.0", + "@clerk/localizations": "^3.35.0", + "@clerk/shared": "^3.43.0", "@coinbase/wallet-sdk": "4.3.0", "@emotion/cache": "11.11.0", "@emotion/react": "11.11.1", "@floating-ui/react": "0.27.12", "@floating-ui/react-dom": "^2.1.3", "@formkit/auto-animate": "^0.8.2", + "@solana/wallet-adapter-base": "0.9.27", + "@solana/wallet-adapter-react": "0.15.39", + "@solana/wallet-standard": "1.1.4", "@stripe/stripe-js": "5.6.0", "@swc/helpers": "^0.5.17", "@tanstack/query-core": "5.87.4", + "@wallet-standard/core": "1.1.1", "@zxcvbn-ts/core": "3.0.4", "@zxcvbn-ts/language-common": "3.0.4", "alien-signals": "2.0.6", @@ -2585,55 +2584,93 @@ "node": ">=18.17.0" }, "peerDependencies": { - "react": "^18.0.0 || ^19.0.0 || ^19.0.0-0", - "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-0" + "react": "^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0", + "react-dom": "^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0" } }, - "node_modules/@clerk/clerk-js/node_modules/regenerator-runtime": { - "version": "0.14.1", - "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", - "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "node_modules/@clerk/clerk-expo/node_modules/@clerk/clerk-react": { + "version": "5.59.4", + "resolved": "https://registry.npmjs.org/@clerk/clerk-react/-/clerk-react-5.59.4.tgz", + "integrity": "sha512-CNr9n7uJT4cRx+cc3fzWr4l4x47+3S5j32HPOP5oUGeIF8O0QHHaoIQ8BHc3lnr4zJJpZxAyrLfwYPv3krtYIw==", "dev": true, - "license": "MIT" + "dependencies": { + "@clerk/shared": "^3.43.0", + "tslib": "2.8.1" + }, + "engines": { + "node": ">=18.17.0" + }, + "peerDependencies": { + "react": "^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0", + "react-dom": "^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0" + } }, - "node_modules/@clerk/clerk-react": { - "version": "5.57.0", - "resolved": "https://registry.npmjs.org/@clerk/clerk-react/-/clerk-react-5.57.0.tgz", - "integrity": "sha512-GCBFF03HjEWvx58myjauJ7NrwTqhxHdetjWWxVM3YJGPOsAVXg4WuquL/hyn8KDuduCYSkRin4Hg6+QVP1NXAg==", + "node_modules/@clerk/clerk-expo/node_modules/@clerk/shared": { + "version": "3.43.0", + "resolved": "https://registry.npmjs.org/@clerk/shared/-/shared-3.43.0.tgz", + "integrity": "sha512-pj8jgV5TX7l0ClHMvDLG7Ensp1BwA63LNvOE2uLwRV4bx3j9s4oGHy5bZlLBoOxdvRPCMpQksHi/O0x1Y+obdw==", "dev": true, - "license": "MIT", + "hasInstallScript": true, "dependencies": { - "@clerk/shared": "^3.36.0", - "tslib": "2.8.1" + "csstype": "3.1.3", + "dequal": "2.0.3", + "glob-to-regexp": "0.4.1", + "js-cookie": "3.0.5", + "std-env": "^3.9.0", + "swr": "2.3.4" }, "engines": { "node": ">=18.17.0" }, "peerDependencies": { - "react": "^18.0.0 || ^19.0.0 || ^19.0.0-0", - "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-0" + "react": "^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0", + "react-dom": "^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0" + }, + "peerDependenciesMeta": { + "react": { + "optional": true + }, + "react-dom": { + "optional": true + } } }, + "node_modules/@clerk/clerk-expo/node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "dev": true + }, "node_modules/@clerk/localizations": { - "version": "3.28.5", - "resolved": "https://registry.npmjs.org/@clerk/localizations/-/localizations-3.28.5.tgz", - "integrity": "sha512-ZTw2yXL4lCN8rNe0RKa39iudcK8RHkQNB36lzgS4OS6ATaXJ1yHxy02bxIS3gokmTjN02TTHVZ6tL0H1baqnbw==", + "version": "3.35.0", + "resolved": "https://registry.npmjs.org/@clerk/localizations/-/localizations-3.35.0.tgz", + "integrity": "sha512-ylF6IB+Z8jjpIdzb0zBRYUKcG3nPKYN1YF2QKIaeNYW9mjzSFktoQTPsDO8qs9+dYFgGuNJd2ZRxzyATE0nTSA==", + "dev": true, + "dependencies": { + "@clerk/types": "^4.101.11" + }, + "engines": { + "node": ">=18.17.0" + } + }, + "node_modules/@clerk/types": { + "version": "4.101.11", + "resolved": "https://registry.npmjs.org/@clerk/types/-/types-4.101.11.tgz", + "integrity": "sha512-6m1FQSLFqb4L+ovMDxNIRSrw6I0ByVX5hs6slcevOaaD5UXNzSANWqVtKaU80AZwcm391lZqVS5fRisHt9tmXA==", "dev": true, - "license": "MIT", "dependencies": { - "@clerk/types": "^4.101.3" + "@clerk/shared": "^3.43.0" }, "engines": { "node": ">=18.17.0" } }, - "node_modules/@clerk/shared": { - "version": "3.36.0", - "resolved": "https://registry.npmjs.org/@clerk/shared/-/shared-3.36.0.tgz", - "integrity": "sha512-Yp4tL/x/iVft40DnxBjT/g/kQilZ+i9mYrqC1Lk6fUnfZV8t7E54GX19JtJSSONzjHsH6sCv3BmJaF1f7Eomkw==", + "node_modules/@clerk/types/node_modules/@clerk/shared": { + "version": "3.43.0", + "resolved": "https://registry.npmjs.org/@clerk/shared/-/shared-3.43.0.tgz", + "integrity": "sha512-pj8jgV5TX7l0ClHMvDLG7Ensp1BwA63LNvOE2uLwRV4bx3j9s4oGHy5bZlLBoOxdvRPCMpQksHi/O0x1Y+obdw==", "dev": true, "hasInstallScript": true, - "license": "MIT", "dependencies": { "csstype": "3.1.3", "dequal": "2.0.3", @@ -2646,8 +2683,8 @@ "node": ">=18.17.0" }, "peerDependencies": { - "react": "^18.0.0 || ^19.0.0 || ^19.0.0-0", - "react-dom": "^18.0.0 || ^19.0.0 || ^19.0.0-0" + "react": "^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0", + "react-dom": "^18.0.0 || ~19.0.3 || ~19.1.4 || ~19.2.3 || ~19.3.0-0" }, "peerDependenciesMeta": { "react": { @@ -2658,25 +2695,44 @@ } } }, - "node_modules/@clerk/types": { - "version": "4.101.3", - "resolved": "https://registry.npmjs.org/@clerk/types/-/types-4.101.3.tgz", - "integrity": "sha512-QkYSiR8EDjLhQ3K9aCZ323knzZQggzhi3qxSdFrtI/C8Osyytua3Bu4TOGGRgYSSD4VO3s8WUz3wQf4Qe0ps/g==", + "node_modules/@clerk/types/node_modules/react": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/react/-/react-19.2.3.tgz", + "integrity": "sha512-Ku/hhYbVjOQnXDZFv2+RibmLFGwFdeeKHFcOTlrt7xplBnya5OGn/hIRDsqDiSUcfORsDC7MPxwork8jBwsIWA==", "dev": true, - "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/@clerk/types/node_modules/react-dom": { + "version": "19.2.3", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.2.3.tgz", + "integrity": "sha512-yELu4WmLPw5Mr/lmeEpox5rw3RETacE++JgHqQzd2dg+YbJuat3jH4ingc+WPZhxaoFzdv9y33G+F7Nl5O0GBg==", + "dev": true, + "optional": true, + "peer": true, "dependencies": { - "@clerk/shared": "^3.36.0" + "scheduler": "^0.27.0" }, - "engines": { - "node": ">=18.17.0" + "peerDependencies": { + "react": "^19.2.3" } }, + "node_modules/@clerk/types/node_modules/scheduler": { + "version": "0.27.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.27.0.tgz", + "integrity": "sha512-eNv+WrVbKu1f3vbYJT/xtiF5syA5HPIMtf9IgY/nKg0sWqzAUEvqY/xm7OcZc/qafLx/iO9FgOmeSAp4v5ti/Q==", + "dev": true, + "optional": true, + "peer": true + }, "node_modules/@coinbase/wallet-sdk": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/@coinbase/wallet-sdk/-/wallet-sdk-4.3.0.tgz", "integrity": "sha512-T3+SNmiCw4HzDm4we9wCHCxlP0pqCiwKe4sOwPH3YAK2KSKjxPRydKu6UQJrdONFVLG7ujXvbd/6ZqmvJb8rkw==", "dev": true, - "license": "Apache-2.0", "dependencies": { "@noble/hashes": "^1.4.0", "clsx": "^1.2.1", @@ -2688,8 +2744,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@colors/colors": { "version": "1.6.0", @@ -2753,7 +2808,6 @@ "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.13.5.tgz", "integrity": "sha512-pxHCpT2ex+0q+HH91/zsdHkw/lXd468DIN2zvfvLtPKLLMo6gQj7oLObq8PhkrxOZb/gGCq03S3Z7PDhS8pduQ==", "dev": true, - "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.16.7", "@babel/runtime": "^7.18.3", @@ -2772,22 +2826,19 @@ "version": "0.9.0", "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@emotion/babel-plugin/node_modules/convert-source-map": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.9.0.tgz", "integrity": "sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@emotion/cache": { "version": "11.11.0", "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.11.0.tgz", "integrity": "sha512-P34z9ssTCBi3e9EI1ZsWpNHcfY1r09ZO0rZbRO2ob3ZQMnFI35jB536qoXbkdesr5EUhYi22anuEJuyxifaqAQ==", "dev": true, - "license": "MIT", "dependencies": { "@emotion/memoize": "^0.8.1", "@emotion/sheet": "^1.2.2", @@ -2800,22 +2851,19 @@ "version": "0.9.2", "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.2.tgz", "integrity": "sha512-MyqliTZGuOm3+5ZRSaaBGP3USLw6+EGykkwZns2EPC5g8jJ4z9OrdZY9apkl3+UP9+sdz76YYkwCKP5gh8iY3g==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@emotion/memoize": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.8.1.tgz", "integrity": "sha512-W2P2c/VRW1/1tLox0mVUalvnWXxavmv/Oum2aPsRcoDJuob75FC3Y8FbpfLwUegRcxINtGUMPq0tFCvYNTBXNA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@emotion/react": { "version": "11.11.1", "resolved": "https://registry.npmjs.org/@emotion/react/-/react-11.11.1.tgz", "integrity": "sha512-5mlW1DquU5HaxjLkfkGN1GA/fvVGdyHURRiX/0FHl2cfIfRxSOfmxEH5YS43edp0OldZrZ+dkBKbngxcNCdZvA==", "dev": true, - "license": "MIT", "dependencies": { "@babel/runtime": "^7.18.3", "@emotion/babel-plugin": "^11.11.0", @@ -2840,7 +2888,6 @@ "resolved": "https://registry.npmjs.org/@emotion/serialize/-/serialize-1.3.3.tgz", "integrity": "sha512-EISGqt7sSNWHGI76hC7x1CksiXPahbxEOrC5RjmFRJTqLyEK9/9hZvBbiYn70dw4wuwMKiEMCUlR6ZXTSWQqxA==", "dev": true, - "license": "MIT", "dependencies": { "@emotion/hash": "^0.9.2", "@emotion/memoize": "^0.9.0", @@ -2853,29 +2900,25 @@ "version": "0.9.0", "resolved": "https://registry.npmjs.org/@emotion/memoize/-/memoize-0.9.0.tgz", "integrity": "sha512-30FAj7/EoJ5mwVPOWhAyCX+FPfMDrVecJAM+Iw9NRoSl4BBAQeqj4cApHHUXOVvIPgLVDsCFoz/hGD+5QQD1GQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@emotion/sheet": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/@emotion/sheet/-/sheet-1.4.0.tgz", "integrity": "sha512-fTBW9/8r2w3dXWYM4HCB1Rdp8NLibOw2+XELH5m5+AkWiL/KqYX6dc0kKYlaYyKjrQ6ds33MCdMPEwgs2z1rqg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@emotion/unitless": { "version": "0.10.0", "resolved": "https://registry.npmjs.org/@emotion/unitless/-/unitless-0.10.0.tgz", "integrity": "sha512-dFoMUuQA20zvtVTuxZww6OHoJYgrzfKM1t52mVySDJnMSEa08ruEvdYQbhvyu6soU+NeLVd3yKfTfT0NeV6qGg==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@emotion/use-insertion-effect-with-fallbacks": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/@emotion/use-insertion-effect-with-fallbacks/-/use-insertion-effect-with-fallbacks-1.2.0.tgz", "integrity": "sha512-yJMtVdH59sxi/aVJBpk9FQq+OR8ll5GT8oWd57UpeaKEVGab41JWaCFA7FRLoMLloOZF/c/wsPoe+bfGmRKgDg==", "dev": true, - "license": "MIT", "peerDependencies": { "react": ">=16.8.0" } @@ -2884,15 +2927,13 @@ "version": "1.4.2", "resolved": "https://registry.npmjs.org/@emotion/utils/-/utils-1.4.2.tgz", "integrity": "sha512-3vLclRofFziIa3J2wDh9jjbkUz9qk5Vi3IZ/FSTKViB0k+ef0fPV7dYrUIugbgupYDx7v9ud/SjrtEP8Y4xLoA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@emotion/weak-memoize": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/@emotion/weak-memoize/-/weak-memoize-0.3.1.tgz", "integrity": "sha512-EsBwpc7hBUJWAsNPBmJy4hxWx12v6bshQsldrVmjxJoc3isbxhOrF2IcCpaXxfvq03NwkI7sbsOLXbYuqF/8Ww==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@epic-web/invariant": { "version": "1.0.0", @@ -4431,7 +4472,6 @@ "resolved": "https://registry.npmjs.org/@floating-ui/core/-/core-1.7.3.tgz", "integrity": "sha512-sGnvb5dmrJaKEZ+LDIpguvdX3bDlEllmv4/ClQ9awcmCZrlx5jQyyMWFM5kBI+EyNOCDDiKk8il0zeuX3Zlg/w==", "dev": true, - "license": "MIT", "dependencies": { "@floating-ui/utils": "^0.2.10" } @@ -4441,7 +4481,6 @@ "resolved": "https://registry.npmjs.org/@floating-ui/dom/-/dom-1.7.4.tgz", "integrity": "sha512-OOchDgh4F2CchOX94cRVqhvy7b3AFb+/rQXyswmzmGakRfkMgoWVjfnLWkRirfLEfuD4ysVW16eXzwt3jHIzKA==", "dev": true, - "license": "MIT", "dependencies": { "@floating-ui/core": "^1.7.3", "@floating-ui/utils": "^0.2.10" @@ -4452,7 +4491,6 @@ "resolved": "https://registry.npmjs.org/@floating-ui/react/-/react-0.27.12.tgz", "integrity": "sha512-kKlWNrpIQxF1B/a2MZvE0/uyKby4960yjO91W7nVyNKmmfNi62xU9HCjL1M1eWzx/LFj/VPSwJVbwQk9Pq/68A==", "dev": true, - "license": "MIT", "dependencies": { "@floating-ui/react-dom": "^2.1.3", "@floating-ui/utils": "^0.2.9", @@ -4468,7 +4506,6 @@ "resolved": "https://registry.npmjs.org/@floating-ui/react-dom/-/react-dom-2.1.6.tgz", "integrity": "sha512-4JX6rEatQEvlmgU80wZyq9RT96HZJa88q8hp0pBd+LrczeDI4o6uA2M+uvxngVHo4Ihr8uibXxH6+70zhAFrVw==", "dev": true, - "license": "MIT", "dependencies": { "@floating-ui/dom": "^1.7.4" }, @@ -4481,15 +4518,13 @@ "version": "0.2.10", "resolved": "https://registry.npmjs.org/@floating-ui/utils/-/utils-0.2.10.tgz", "integrity": "sha512-aGTxbpbg8/b5JfU1HXSrbH3wXZuLPJcNEcZQFMxLs3oSzgtVu6nFPkbbGGUvBcUjKV2YyB9Wxxabo+HEH9tcRQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@formkit/auto-animate": { "version": "0.8.4", "resolved": "https://registry.npmjs.org/@formkit/auto-animate/-/auto-animate-0.8.4.tgz", "integrity": "sha512-DHHC01EJ1p70Q0z/ZFRBIY8NDnmfKccQoyoM84Tgb6omLMat6jivCdf272Y8k3nf4Lzdin/Y4R9q8uFtU0GbnA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/@humanfs/core": { "version": "0.19.1", @@ -5928,7 +5963,6 @@ "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz", "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==", "dev": true, - "license": "MIT", "engines": { "node": "^14.21.3 || >=16" }, @@ -5941,7 +5975,6 @@ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.7.tgz", "integrity": "sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==", "dev": true, - "license": "MIT", "dependencies": { "@noble/hashes": "1.8.0" }, @@ -5957,7 +5990,6 @@ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", "dev": true, - "license": "MIT", "engines": { "node": "^14.21.3 || >=16" }, @@ -5970,7 +6002,6 @@ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.4.0.tgz", "integrity": "sha512-V1JJ1WTRUqHHrOSh597hURcMqVKVGL/ea3kv0gSnEdsEZ0/+VyPghM1lMNGc00z7CIQorSvbKpuJkxvuHbvdbg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 16" }, @@ -7228,6 +7259,19 @@ } } }, + "node_modules/@react-native-async-storage/async-storage": { + "version": "1.24.0", + "resolved": "https://registry.npmjs.org/@react-native-async-storage/async-storage/-/async-storage-1.24.0.tgz", + "integrity": "sha512-W4/vbwUOYOjco0x3toB8QCr7EjIP6nE9G7o8PMguvvjYT5Awg09lyV4enACRx4s++PPulBiBSjL0KTFx2u0Z/g==", + "dev": true, + "optional": true, + "dependencies": { + "merge-options": "^3.0.4" + }, + "peerDependencies": { + "react-native": "^0.0.0-0 || >=0.60 <1.0" + } + }, "node_modules/@react-native-community/cli-server-api": { "version": "20.0.2", "resolved": "https://registry.npmjs.org/@react-native-community/cli-server-api/-/cli-server-api-20.0.2.tgz", @@ -8517,7 +8561,6 @@ "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.6.tgz", "integrity": "sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg==", "dev": true, - "license": "MIT", "funding": { "url": "https://paulmillr.com/funding/" } @@ -8527,7 +8570,6 @@ "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.7.0.tgz", "integrity": "sha512-E4FFX/N3f4B80AKWp5dP6ow+flD1LQZo/w8UnLGYZO674jS6YnYeepycOOksv+vLPSpgN35wgKgy+ybfTb2SMw==", "dev": true, - "license": "MIT", "dependencies": { "@noble/curves": "~1.9.0", "@noble/hashes": "~1.8.0", @@ -8542,7 +8584,6 @@ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", "dev": true, - "license": "MIT", "engines": { "node": "^14.21.3 || >=16" }, @@ -8555,7 +8596,6 @@ "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.6.0.tgz", "integrity": "sha512-+lF0BbLiJNwVlev4eKelw1WWLaiKXw7sSl8T6FvBlWkdX+94aGJ4o8XjUdlyhTCjd8c+B3KT3JfS8P0bLRNU6A==", "dev": true, - "license": "MIT", "dependencies": { "@noble/hashes": "~1.8.0", "@scure/base": "~1.2.5" @@ -8569,7 +8609,6 @@ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", "dev": true, - "license": "MIT", "engines": { "node": "^14.21.3 || >=16" }, @@ -8687,101 +8726,656 @@ "node": ">=18" } }, - "node_modules/@standard-schema/spec": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz", - "integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==", - "license": "MIT" + "node_modules/@solana-mobile/mobile-wallet-adapter-protocol": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@solana-mobile/mobile-wallet-adapter-protocol/-/mobile-wallet-adapter-protocol-2.2.5.tgz", + "integrity": "sha512-kCI+0/umWm98M9g12ndpS56U6wBzq4XdhobCkDPF8qRDYX/iTU8CD+QMcalh7VgRT7GWEmySQvQdaugM0Chf0g==", + "dev": true, + "dependencies": { + "@solana/codecs-strings": "^4.0.0", + "@solana/wallet-standard": "^1.1.2", + "@solana/wallet-standard-util": "^1.1.1", + "@wallet-standard/core": "^1.0.3", + "js-base64": "^3.7.5" + }, + "peerDependencies": { + "react-native": ">0.69" + } }, - "node_modules/@standard-schema/utils": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/@standard-schema/utils/-/utils-0.3.0.tgz", - "integrity": "sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==", - "license": "MIT" + "node_modules/@solana-mobile/mobile-wallet-adapter-protocol-web3js": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@solana-mobile/mobile-wallet-adapter-protocol-web3js/-/mobile-wallet-adapter-protocol-web3js-2.2.5.tgz", + "integrity": "sha512-xfQl6Kee0ZXagUG5mpy+bMhQTNf2LAzF65m5SSgNJp47y/nP9GdXWi9blVH8IPP+QjF/+DnCtURaXS14bk3WJw==", + "dev": true, + "dependencies": { + "@solana-mobile/mobile-wallet-adapter-protocol": "^2.2.5", + "bs58": "^5.0.0", + "js-base64": "^3.7.5" + }, + "peerDependencies": { + "@solana/web3.js": "^1.58.0" + } }, - "node_modules/@stripe/stripe-js": { - "version": "5.6.0", - "resolved": "https://registry.npmjs.org/@stripe/stripe-js/-/stripe-js-5.6.0.tgz", - "integrity": "sha512-w8CEY73X/7tw2KKlL3iOk679V9bWseE4GzNz3zlaYxcTjmcmWOathRb0emgo/QQ3eoNzmq68+2Y2gxluAv3xGw==", + "node_modules/@solana-mobile/wallet-adapter-mobile": { + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@solana-mobile/wallet-adapter-mobile/-/wallet-adapter-mobile-2.2.5.tgz", + "integrity": "sha512-Zpzfwm3N4FfI63ZMs2qZChQ1j0z+p2prkZbSU51NyTnE+K9l9sDAl8RmRCOWnE29y+/AN10WuQZQoIAccHVOFg==", "dev": true, - "license": "MIT", + "dependencies": { + "@solana-mobile/mobile-wallet-adapter-protocol-web3js": "^2.2.5", + "@solana-mobile/wallet-standard-mobile": "^0.4.3", + "@solana/wallet-adapter-base": "^0.9.23", + "@solana/wallet-standard-features": "^1.2.0", + "js-base64": "^3.7.5" + }, + "optionalDependencies": { + "@react-native-async-storage/async-storage": "^1.17.7" + }, + "peerDependencies": { + "@solana/web3.js": "^1.58.0" + } + }, + "node_modules/@solana-mobile/wallet-standard-mobile": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/@solana-mobile/wallet-standard-mobile/-/wallet-standard-mobile-0.4.4.tgz", + "integrity": "sha512-LMvqkS5/aEH+EiDje9Dk351go6wO3POysgmobM4qm8RsG5s6rDAW3U0zA+5f2coGCTyRx8BKE1I/9nHlwtBuow==", + "dev": true, + "dependencies": { + "@solana-mobile/mobile-wallet-adapter-protocol": "^2.2.5", + "@solana/wallet-standard-chains": "^1.1.0", + "@solana/wallet-standard-features": "^1.2.0", + "@wallet-standard/base": "^1.0.1", + "@wallet-standard/features": "^1.0.3", + "bs58": "^5.0.0", + "js-base64": "^3.7.5", + "qrcode": "^1.5.4" + } + }, + "node_modules/@solana/buffer-layout": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/@solana/buffer-layout/-/buffer-layout-4.0.1.tgz", + "integrity": "sha512-E1ImOIAD1tBZFRdjeM4/pzTiTApC0AOBGwyAMS4fwIodCWArzJ3DWdoh8cKxeFM2fElkxBh2Aqts1BPC373rHA==", + "dev": true, + "peer": true, + "dependencies": { + "buffer": "~6.0.3" + }, "engines": { - "node": ">=12.16" + "node": ">=5.10" } }, - "node_modules/@stylistic/eslint-plugin": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-5.4.0.tgz", - "integrity": "sha512-UG8hdElzuBDzIbjG1QDwnYH0MQ73YLXDFHgZzB4Zh/YJfnw8XNsloVtytqzx0I2Qky9THSdpTmi8Vjn/pf/Lew==", + "node_modules/@solana/buffer-layout/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", "dev": true, - "license": "MIT", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true, "dependencies": { - "@eslint-community/eslint-utils": "^4.9.0", - "@typescript-eslint/types": "^8.44.0", - "eslint-visitor-keys": "^4.2.1", - "espree": "^10.4.0", - "estraverse": "^5.3.0", - "picomatch": "^4.0.3" + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/@solana/codecs-core": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-4.0.0.tgz", + "integrity": "sha512-28kNUsyIlhU3MO3/7ZLDqeJf2YAm32B4tnTjl5A9HrbBqsTZ+upT/RzxZGP1MMm7jnPuIKCMwmTpsyqyR6IUpw==", + "dev": true, + "dependencies": { + "@solana/errors": "4.0.0" }, "engines": { - "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + "node": ">=20.18.0" }, "peerDependencies": { - "eslint": ">=9.0.0" + "typescript": ">=5.3.3" } }, - "node_modules/@stylistic/eslint-plugin/node_modules/picomatch": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", - "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "node_modules/@solana/codecs-numbers": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-4.0.0.tgz", + "integrity": "sha512-z9zpjtcwzqT9rbkKVZpkWB5/0V7+6YRKs6BccHkGJlaDx8Pe/+XOvPi2rEdXPqrPd9QWb5Xp1iBfcgaDMyiOiA==", "dev": true, - "license": "MIT", + "dependencies": { + "@solana/codecs-core": "4.0.0", + "@solana/errors": "4.0.0" + }, "engines": { - "node": ">=12" + "node": ">=20.18.0" }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "peerDependencies": { + "typescript": ">=5.3.3" } }, - "node_modules/@svgr/babel-plugin-add-jsx-attribute": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-8.0.0.tgz", - "integrity": "sha512-b9MIk7yhdS1pMCZM8VeNfUlSKVRhsHZNMl5O9SfaX0l0t5wjdgu4IDzGB8bpnGBBOjGST3rRFVsaaEtI4W6f7g==", - "license": "MIT", - "engines": { - "node": ">=14" + "node_modules/@solana/codecs-strings": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@solana/codecs-strings/-/codecs-strings-4.0.0.tgz", + "integrity": "sha512-XvyD+sQ1zyA0amfxbpoFZsucLoe+yASQtDiLUGMDg5TZ82IHE3B7n82jE8d8cTAqi0HgqQiwU13snPhvg1O0Ow==", + "dev": true, + "dependencies": { + "@solana/codecs-core": "4.0.0", + "@solana/codecs-numbers": "4.0.0", + "@solana/errors": "4.0.0" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/gregberge" + "engines": { + "node": ">=20.18.0" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "fastestsmallesttextencoderdecoder": "^1.0.22", + "typescript": ">=5.3.3" } }, - "node_modules/@svgr/babel-plugin-remove-jsx-attribute": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-8.0.0.tgz", - "integrity": "sha512-BcCkm/STipKvbCl6b7QFrMh/vx00vIP63k2eM66MfHJzPr6O2U0jYEViXkHJWqXqQYjdeA9cuCl5KWmlwjDvbA==", - "license": "MIT", - "engines": { - "node": ">=14" + "node_modules/@solana/errors": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-4.0.0.tgz", + "integrity": "sha512-3YEtvcMvtcnTl4HahqLt0VnaGVf7vVWOnt6/uPky5e0qV6BlxDSbGkbBzttNjxLXHognV0AQi3pjvrtfUnZmbg==", + "dev": true, + "dependencies": { + "chalk": "5.6.2", + "commander": "14.0.1" }, - "funding": { - "type": "github", - "url": "https://github.com/sponsors/gregberge" + "bin": { + "errors": "bin/cli.mjs" + }, + "engines": { + "node": ">=20.18.0" }, "peerDependencies": { - "@babel/core": "^7.0.0-0" + "typescript": ">=5.3.3" } }, - "node_modules/@svgr/babel-plugin-remove-jsx-empty-expression": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-8.0.0.tgz", - "integrity": "sha512-5BcGCBfBxB5+XSDSWnhTThfI9jcO5f0Ai2V24gZpG+wXF14BzwxxdDb4g6trdOux0rhibGs385BeFMSmxtS3uA==", - "license": "MIT", + "node_modules/@solana/errors/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "dev": true, "engines": { - "node": ">=14" + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@solana/errors/node_modules/commander": { + "version": "14.0.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.1.tgz", + "integrity": "sha512-2JkV3gUZUVrbNA+1sjBOYLsMZ5cEEl8GTFP2a4AVz5hvasAMCQ1D2l2le/cX+pV4N6ZU17zjUahLpIXRrnWL8A==", + "dev": true, + "engines": { + "node": ">=20" + } + }, + "node_modules/@solana/wallet-adapter-base": { + "version": "0.9.27", + "resolved": "https://registry.npmjs.org/@solana/wallet-adapter-base/-/wallet-adapter-base-0.9.27.tgz", + "integrity": "sha512-kXjeNfNFVs/NE9GPmysBRKQ/nf+foSaq3kfVSeMcO/iVgigyRmB551OjU3WyAolLG/1jeEfKLqF9fKwMCRkUqg==", + "dev": true, + "dependencies": { + "@solana/wallet-standard-features": "^1.3.0", + "@wallet-standard/base": "^1.1.0", + "@wallet-standard/features": "^1.1.0", + "eventemitter3": "^5.0.1" + }, + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@solana/web3.js": "^1.98.0" + } + }, + "node_modules/@solana/wallet-adapter-base/node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true + }, + "node_modules/@solana/wallet-adapter-react": { + "version": "0.15.39", + "resolved": "https://registry.npmjs.org/@solana/wallet-adapter-react/-/wallet-adapter-react-0.15.39.tgz", + "integrity": "sha512-WXtlo88ith5m22qB+qiGw301/Zb9r5pYr4QdXWmlXnRNqwST5MGmJWhG+/RVrzc+OG7kSb3z1gkVNv+2X/Y0Gg==", + "dev": true, + "dependencies": { + "@solana-mobile/wallet-adapter-mobile": "^2.2.0", + "@solana/wallet-adapter-base": "^0.9.27", + "@solana/wallet-standard-wallet-adapter-react": "^1.1.4" + }, + "engines": { + "node": ">=20" + }, + "peerDependencies": { + "@solana/web3.js": "^1.98.0", + "react": "*" + } + }, + "node_modules/@solana/wallet-standard": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@solana/wallet-standard/-/wallet-standard-1.1.4.tgz", + "integrity": "sha512-NF+MI5tOxyvfTU4A+O5idh/gJFmjm52bMwsPpFGRSL79GECSN0XLmpVOO/jqTKJgac2uIeYDpQw/eMaQuWuUXw==", + "dev": true, + "dependencies": { + "@solana/wallet-standard-core": "^1.1.2", + "@solana/wallet-standard-wallet-adapter": "^1.1.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@solana/wallet-standard-chains": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@solana/wallet-standard-chains/-/wallet-standard-chains-1.1.1.tgz", + "integrity": "sha512-Us3TgL4eMVoVWhuC4UrePlYnpWN+lwteCBlhZDUhFZBJ5UMGh94mYPXno3Ho7+iHPYRtuCi/ePvPcYBqCGuBOw==", + "dev": true, + "dependencies": { + "@wallet-standard/base": "^1.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@solana/wallet-standard-core": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@solana/wallet-standard-core/-/wallet-standard-core-1.1.2.tgz", + "integrity": "sha512-FaSmnVsIHkHhYlH8XX0Y4TYS+ebM+scW7ZeDkdXo3GiKge61Z34MfBPinZSUMV08hCtzxxqH2ydeU9+q/KDrLA==", + "dev": true, + "dependencies": { + "@solana/wallet-standard-chains": "^1.1.1", + "@solana/wallet-standard-features": "^1.3.0", + "@solana/wallet-standard-util": "^1.1.2" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@solana/wallet-standard-features": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@solana/wallet-standard-features/-/wallet-standard-features-1.3.0.tgz", + "integrity": "sha512-ZhpZtD+4VArf6RPitsVExvgkF+nGghd1rzPjd97GmBximpnt1rsUxMOEyoIEuH3XBxPyNB6Us7ha7RHWQR+abg==", + "dev": true, + "dependencies": { + "@wallet-standard/base": "^1.1.0", + "@wallet-standard/features": "^1.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@solana/wallet-standard-util": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@solana/wallet-standard-util/-/wallet-standard-util-1.1.2.tgz", + "integrity": "sha512-rUXFNP4OY81Ddq7qOjQV4Kmkozx4wjYAxljvyrqPx8Ycz0FYChG/hQVWqvgpK3sPsEaO/7ABG1NOACsyAKWNOA==", + "dev": true, + "dependencies": { + "@noble/curves": "^1.8.0", + "@solana/wallet-standard-chains": "^1.1.1", + "@solana/wallet-standard-features": "^1.3.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@solana/wallet-standard-wallet-adapter": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@solana/wallet-standard-wallet-adapter/-/wallet-standard-wallet-adapter-1.1.4.tgz", + "integrity": "sha512-YSBrxwov4irg2hx9gcmM4VTew3ofNnkqsXQ42JwcS6ykF1P1ecVY8JCbrv75Nwe6UodnqeoZRbN7n/p3awtjNQ==", + "dev": true, + "dependencies": { + "@solana/wallet-standard-wallet-adapter-base": "^1.1.4", + "@solana/wallet-standard-wallet-adapter-react": "^1.1.4" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@solana/wallet-standard-wallet-adapter-react": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@solana/wallet-standard-wallet-adapter-react/-/wallet-standard-wallet-adapter-react-1.1.4.tgz", + "integrity": "sha512-xa4KVmPgB7bTiWo4U7lg0N6dVUtt2I2WhEnKlIv0jdihNvtyhOjCKMjucWet6KAVhir6I/mSWrJk1U9SvVvhCg==", + "dev": true, + "dependencies": { + "@solana/wallet-standard-wallet-adapter-base": "^1.1.4", + "@wallet-standard/app": "^1.1.0", + "@wallet-standard/base": "^1.1.0" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@solana/wallet-adapter-base": "*", + "react": "*" + } + }, + "node_modules/@solana/wallet-standard-wallet-adapter-react/node_modules/@solana/wallet-standard-wallet-adapter-base": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@solana/wallet-standard-wallet-adapter-base/-/wallet-standard-wallet-adapter-base-1.1.4.tgz", + "integrity": "sha512-Q2Rie9YaidyFA4UxcUIxUsvynW+/gE2noj/Wmk+IOwDwlVrJUAXCvFaCNsPDSyKoiYEKxkSnlG13OA1v08G4iw==", + "dev": true, + "dependencies": { + "@solana/wallet-adapter-base": "^0.9.23", + "@solana/wallet-standard-chains": "^1.1.1", + "@solana/wallet-standard-features": "^1.3.0", + "@solana/wallet-standard-util": "^1.1.2", + "@wallet-standard/app": "^1.1.0", + "@wallet-standard/base": "^1.1.0", + "@wallet-standard/features": "^1.1.0", + "@wallet-standard/wallet": "^1.1.0" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@solana/web3.js": "^1.98.0", + "bs58": "^6.0.0" + } + }, + "node_modules/@solana/wallet-standard-wallet-adapter-react/node_modules/base-x": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-5.0.1.tgz", + "integrity": "sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==", + "dev": true, + "peer": true + }, + "node_modules/@solana/wallet-standard-wallet-adapter-react/node_modules/bs58": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-6.0.0.tgz", + "integrity": "sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==", + "dev": true, + "peer": true, + "dependencies": { + "base-x": "^5.0.0" + } + }, + "node_modules/@solana/wallet-standard-wallet-adapter/node_modules/@solana/wallet-standard-wallet-adapter-base": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/@solana/wallet-standard-wallet-adapter-base/-/wallet-standard-wallet-adapter-base-1.1.4.tgz", + "integrity": "sha512-Q2Rie9YaidyFA4UxcUIxUsvynW+/gE2noj/Wmk+IOwDwlVrJUAXCvFaCNsPDSyKoiYEKxkSnlG13OA1v08G4iw==", + "dev": true, + "dependencies": { + "@solana/wallet-adapter-base": "^0.9.23", + "@solana/wallet-standard-chains": "^1.1.1", + "@solana/wallet-standard-features": "^1.3.0", + "@solana/wallet-standard-util": "^1.1.2", + "@wallet-standard/app": "^1.1.0", + "@wallet-standard/base": "^1.1.0", + "@wallet-standard/features": "^1.1.0", + "@wallet-standard/wallet": "^1.1.0" + }, + "engines": { + "node": ">=16" + }, + "peerDependencies": { + "@solana/web3.js": "^1.98.0", + "bs58": "^6.0.0" + } + }, + "node_modules/@solana/wallet-standard-wallet-adapter/node_modules/base-x": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-5.0.1.tgz", + "integrity": "sha512-M7uio8Zt++eg3jPj+rHMfCC+IuygQHHCOU+IYsVtik6FWjuYpVt/+MRKcgsAMHh8mMFAwnB+Bs+mTrFiXjMzKg==", + "dev": true, + "peer": true + }, + "node_modules/@solana/wallet-standard-wallet-adapter/node_modules/bs58": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-6.0.0.tgz", + "integrity": "sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==", + "dev": true, + "peer": true, + "dependencies": { + "base-x": "^5.0.0" + } + }, + "node_modules/@solana/web3.js": { + "version": "1.98.4", + "resolved": "https://registry.npmjs.org/@solana/web3.js/-/web3.js-1.98.4.tgz", + "integrity": "sha512-vv9lfnvjUsRiq//+j5pBdXig0IQdtzA0BRZ3bXEP4KaIyF1CcaydWqgyzQgfZMNIsWNWmG+AUHwPy4AHOD6gpw==", + "dev": true, + "peer": true, + "dependencies": { + "@babel/runtime": "^7.25.0", + "@noble/curves": "^1.4.2", + "@noble/hashes": "^1.4.0", + "@solana/buffer-layout": "^4.0.1", + "@solana/codecs-numbers": "^2.1.0", + "agentkeepalive": "^4.5.0", + "bn.js": "^5.2.1", + "borsh": "^0.7.0", + "bs58": "^4.0.1", + "buffer": "6.0.3", + "fast-stable-stringify": "^1.0.0", + "jayson": "^4.1.1", + "node-fetch": "^2.7.0", + "rpc-websockets": "^9.0.2", + "superstruct": "^2.0.2" + } + }, + "node_modules/@solana/web3.js/node_modules/@solana/codecs-core": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@solana/codecs-core/-/codecs-core-2.3.0.tgz", + "integrity": "sha512-oG+VZzN6YhBHIoSKgS5ESM9VIGzhWjEHEGNPSibiDTxFhsFWxNaz8LbMDPjBUE69r9wmdGLkrQ+wVPbnJcZPvw==", + "dev": true, + "peer": true, + "dependencies": { + "@solana/errors": "2.3.0" + }, + "engines": { + "node": ">=20.18.0" + }, + "peerDependencies": { + "typescript": ">=5.3.3" + } + }, + "node_modules/@solana/web3.js/node_modules/@solana/codecs-numbers": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@solana/codecs-numbers/-/codecs-numbers-2.3.0.tgz", + "integrity": "sha512-jFvvwKJKffvG7Iz9dmN51OGB7JBcy2CJ6Xf3NqD/VP90xak66m/Lg48T01u5IQ/hc15mChVHiBm+HHuOFDUrQg==", + "dev": true, + "peer": true, + "dependencies": { + "@solana/codecs-core": "2.3.0", + "@solana/errors": "2.3.0" + }, + "engines": { + "node": ">=20.18.0" + }, + "peerDependencies": { + "typescript": ">=5.3.3" + } + }, + "node_modules/@solana/web3.js/node_modules/@solana/errors": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@solana/errors/-/errors-2.3.0.tgz", + "integrity": "sha512-66RI9MAbwYV0UtP7kGcTBVLxJgUxoZGm8Fbc0ah+lGiAw17Gugco6+9GrJCV83VyF2mDWyYnYM9qdI3yjgpnaQ==", + "dev": true, + "peer": true, + "dependencies": { + "chalk": "^5.4.1", + "commander": "^14.0.0" + }, + "bin": { + "errors": "bin/cli.mjs" + }, + "engines": { + "node": ">=20.18.0" + }, + "peerDependencies": { + "typescript": ">=5.3.3" + } + }, + "node_modules/@solana/web3.js/node_modules/base-x": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.11.tgz", + "integrity": "sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==", + "dev": true, + "peer": true, + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/@solana/web3.js/node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, + "peer": true, + "dependencies": { + "base-x": "^3.0.2" + } + }, + "node_modules/@solana/web3.js/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true, + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/@solana/web3.js/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "dev": true, + "peer": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@solana/web3.js/node_modules/commander": { + "version": "14.0.2", + "resolved": "https://registry.npmjs.org/commander/-/commander-14.0.2.tgz", + "integrity": "sha512-TywoWNNRbhoD0BXs1P3ZEScW8W5iKrnbithIl0YH+uCmBd0QpPOA8yc82DS3BIE5Ma6FnBVUsJ7wVUDz4dvOWQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=20" + } + }, + "node_modules/@standard-schema/spec": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@standard-schema/spec/-/spec-1.0.0.tgz", + "integrity": "sha512-m2bOd0f2RT9k8QJx1JN85cZYyH1RqFBdlwtkSlf4tBDYLCiiZnv1fIIwacK6cqwXavOydf0NPToMQgpKq+dVlA==", + "license": "MIT" + }, + "node_modules/@standard-schema/utils": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/@standard-schema/utils/-/utils-0.3.0.tgz", + "integrity": "sha512-e7Mew686owMaPJVNNLs55PUvgz371nKgwsc4vxE49zsODpJEnxgxRo2y/OKrqueavXgZNMDVj3DdHFlaSAeU8g==", + "license": "MIT" + }, + "node_modules/@stripe/stripe-js": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/@stripe/stripe-js/-/stripe-js-5.6.0.tgz", + "integrity": "sha512-w8CEY73X/7tw2KKlL3iOk679V9bWseE4GzNz3zlaYxcTjmcmWOathRb0emgo/QQ3eoNzmq68+2Y2gxluAv3xGw==", + "dev": true, + "engines": { + "node": ">=12.16" + } + }, + "node_modules/@stylistic/eslint-plugin": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/@stylistic/eslint-plugin/-/eslint-plugin-5.4.0.tgz", + "integrity": "sha512-UG8hdElzuBDzIbjG1QDwnYH0MQ73YLXDFHgZzB4Zh/YJfnw8XNsloVtytqzx0I2Qky9THSdpTmi8Vjn/pf/Lew==", + "dev": true, + "license": "MIT", + "dependencies": { + "@eslint-community/eslint-utils": "^4.9.0", + "@typescript-eslint/types": "^8.44.0", + "eslint-visitor-keys": "^4.2.1", + "espree": "^10.4.0", + "estraverse": "^5.3.0", + "picomatch": "^4.0.3" + }, + "engines": { + "node": "^18.18.0 || ^20.9.0 || >=21.1.0" + }, + "peerDependencies": { + "eslint": ">=9.0.0" + } + }, + "node_modules/@stylistic/eslint-plugin/node_modules/picomatch": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-4.0.3.tgz", + "integrity": "sha512-5gTmgEY/sqK6gFXLIsQNH19lWb4ebPDLA4SdLP7dsWkIXHWlG66oPuVvXSGFPppYZz8ZDZq0dYYrbHfBCVUb1Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" + } + }, + "node_modules/@svgr/babel-plugin-add-jsx-attribute": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-add-jsx-attribute/-/babel-plugin-add-jsx-attribute-8.0.0.tgz", + "integrity": "sha512-b9MIk7yhdS1pMCZM8VeNfUlSKVRhsHZNMl5O9SfaX0l0t5wjdgu4IDzGB8bpnGBBOjGST3rRFVsaaEtI4W6f7g==", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-plugin-remove-jsx-attribute": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-attribute/-/babel-plugin-remove-jsx-attribute-8.0.0.tgz", + "integrity": "sha512-BcCkm/STipKvbCl6b7QFrMh/vx00vIP63k2eM66MfHJzPr6O2U0jYEViXkHJWqXqQYjdeA9cuCl5KWmlwjDvbA==", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/gregberge" + }, + "peerDependencies": { + "@babel/core": "^7.0.0-0" + } + }, + "node_modules/@svgr/babel-plugin-remove-jsx-empty-expression": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/@svgr/babel-plugin-remove-jsx-empty-expression/-/babel-plugin-remove-jsx-empty-expression-8.0.0.tgz", + "integrity": "sha512-5BcGCBfBxB5+XSDSWnhTThfI9jcO5f0Ai2V24gZpG+wXF14BzwxxdDb4g6trdOux0rhibGs385BeFMSmxtS3uA==", + "license": "MIT", + "engines": { + "node": ">=14" }, "funding": { "type": "github", @@ -9016,7 +9610,6 @@ "resolved": "https://registry.npmjs.org/@tanstack/query-core/-/query-core-5.87.4.tgz", "integrity": "sha512-uNsg6zMxraEPDVO2Bn+F3/ctHi+Zsk+MMpcN8h6P7ozqD088F6mFY5TfGM7zuyIrL7HKpDyu6QHfLWiDxh3cuw==", "dev": true, - "license": "MIT", "funding": { "type": "github", "url": "https://github.com/sponsors/tannerlinsley" @@ -9123,6 +9716,16 @@ "assertion-error": "^2.0.1" } }, + "node_modules/@types/connect": { + "version": "3.4.38", + "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", + "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/deep-eql": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/@types/deep-eql/-/deep-eql-4.0.2.tgz", @@ -9317,6 +9920,23 @@ "optional": true, "peer": true }, + "node_modules/@types/uuid": { + "version": "8.3.4", + "resolved": "https://registry.npmjs.org/@types/uuid/-/uuid-8.3.4.tgz", + "integrity": "sha512-c/I8ZRb51j+pYGAu5CrFMRxqZ2ke4y2grEBO5AUjgSkSk+qT2Ea+OdWElz/OiMf5MNpn2b17kuVBwZLQJXzihw==", + "dev": true, + "peer": true + }, + "node_modules/@types/ws": { + "version": "7.4.7", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-7.4.7.tgz", + "integrity": "sha512-JQbbmxZTZehdc2iszGKs5oC3NFnjeay7mtAWrdt7qNtAVK0g19muApzAy4bm9byz79xa2ZnO/BOBC2R8RC5Lww==", + "dev": true, + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/yargs": { "version": "17.0.33", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.33.tgz", @@ -10041,6 +10661,104 @@ "dev": true, "license": "MIT" }, + "node_modules/@wallet-standard/app": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@wallet-standard/app/-/app-1.1.0.tgz", + "integrity": "sha512-3CijvrO9utx598kjr45hTbbeeykQrQfKmSnxeWOgU25TOEpvcipD/bYDQWIqUv1Oc6KK4YStokSMu/FBNecGUQ==", + "dev": true, + "dependencies": { + "@wallet-standard/base": "^1.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@wallet-standard/base": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@wallet-standard/base/-/base-1.1.0.tgz", + "integrity": "sha512-DJDQhjKmSNVLKWItoKThJS+CsJQjR9AOBOirBVT1F9YpRyC9oYHE+ZnSf8y8bxUphtKqdQMPVQ2mHohYdRvDVQ==", + "dev": true, + "engines": { + "node": ">=16" + } + }, + "node_modules/@wallet-standard/core": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@wallet-standard/core/-/core-1.1.1.tgz", + "integrity": "sha512-5Xmjc6+Oe0hcPfVc5n8F77NVLwx1JVAoCVgQpLyv/43/bhtIif+Gx3WUrDlaSDoM8i2kA2xd6YoFbHCxs+e0zA==", + "dev": true, + "dependencies": { + "@wallet-standard/app": "^1.1.0", + "@wallet-standard/base": "^1.1.0", + "@wallet-standard/errors": "^0.1.1", + "@wallet-standard/features": "^1.1.0", + "@wallet-standard/wallet": "^1.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@wallet-standard/errors": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/@wallet-standard/errors/-/errors-0.1.1.tgz", + "integrity": "sha512-V8Ju1Wvol8i/VDyQOHhjhxmMVwmKiwyxUZBnHhtiPZJTWY0U/Shb2iEWyGngYEbAkp2sGTmEeNX1tVyGR7PqNw==", + "dev": true, + "dependencies": { + "chalk": "^5.4.1", + "commander": "^13.1.0" + }, + "bin": { + "errors": "bin/cli.mjs" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@wallet-standard/errors/node_modules/chalk": { + "version": "5.6.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-5.6.2.tgz", + "integrity": "sha512-7NzBL0rN6fMUW+f7A6Io4h40qQlG+xGmtMxfbnH/K7TAtt8JQWVQK+6g0UXKMeVJoyV5EkkNsErQ8pVD3bLHbA==", + "dev": true, + "engines": { + "node": "^12.17.0 || ^14.13 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/@wallet-standard/errors/node_modules/commander": { + "version": "13.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-13.1.0.tgz", + "integrity": "sha512-/rFeCpNJQbhSZjGVwO9RFV3xPqbnERS8MmIQzCtD/zl6gpJuV/bMLuN92oG3F7d8oDEHHRrujSXNUr8fpjntKw==", + "dev": true, + "engines": { + "node": ">=18" + } + }, + "node_modules/@wallet-standard/features": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@wallet-standard/features/-/features-1.1.0.tgz", + "integrity": "sha512-hiEivWNztx73s+7iLxsuD1sOJ28xtRix58W7Xnz4XzzA/pF0+aicnWgjOdA10doVDEDZdUuZCIIqG96SFNlDUg==", + "dev": true, + "dependencies": { + "@wallet-standard/base": "^1.1.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/@wallet-standard/wallet": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@wallet-standard/wallet/-/wallet-1.1.0.tgz", + "integrity": "sha512-Gt8TnSlDZpAl+RWOOAB/kuvC7RpcdWAlFbHNoi4gsXsfaWa1QCT6LBcfIYTPdOZC9OVZUDwqGuGAcqZejDmHjg==", + "dev": true, + "dependencies": { + "@wallet-standard/base": "^1.1.0" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@webassemblyjs/ast": { "version": "1.14.1", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.14.1.tgz", @@ -10322,7 +11040,6 @@ "resolved": "https://registry.npmjs.org/@zxcvbn-ts/core/-/core-3.0.4.tgz", "integrity": "sha512-aQeiT0F09FuJaAqNrxynlAwZ2mW/1MdXakKWNmGM1Qp/VaY6CnB/GfnMS2T8gB2231Esp1/maCWd8vTG4OuShw==", "dev": true, - "license": "MIT", "dependencies": { "fastest-levenshtein": "1.0.16" } @@ -10331,15 +11048,13 @@ "version": "3.0.4", "resolved": "https://registry.npmjs.org/@zxcvbn-ts/language-common/-/language-common-3.0.4.tgz", "integrity": "sha512-viSNNnRYtc7ULXzxrQIVUNwHAPSXRtoIwy/Tq4XQQdIknBzw4vz36lQLF6mvhMlTIlpjoN/Z1GFu/fwiAlUSsw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/abitype": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.2.0.tgz", - "integrity": "sha512-fD3ROjckUrWsybaSor2AdWxzA0e/DSyV2dA4aYd7bd8orHsoJjl09fOgKfUkTDfk0BsDGBf4NBgu/c7JoS2Npw==", + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.2.3.tgz", + "integrity": "sha512-Ofer5QUnuUdTFsBRwARMoWKOH1ND5ehwYhJ3OJ/BQO+StkwQjHw0XyVh4vDttzHB7QOFhPHa/o413PJ82gU/Tg==", "dev": true, - "license": "MIT", "funding": { "url": "https://github.com/sponsors/wevm" }, @@ -10445,6 +11160,19 @@ "node": ">= 14" } }, + "node_modules/agentkeepalive": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.6.0.tgz", + "integrity": "sha512-kja8j7PjmncONqaTsB8fQ+wE2mSU2DJ9D4XKoJ5PFWIdRMa6SLSN1ff4mOr4jCbfRSsxR4keIiySJU0N9T5hIQ==", + "dev": true, + "peer": true, + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, "node_modules/ajv": { "version": "8.17.1", "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.17.1.tgz", @@ -10497,8 +11225,7 @@ "version": "2.0.6", "resolved": "https://registry.npmjs.org/alien-signals/-/alien-signals-2.0.6.tgz", "integrity": "sha512-P3TxJSe31bUHBiblg59oU1PpaWPtmxF9GhJ/cB7OkgJ0qN/ifFSKUI25/v8ZhsT+lIG6ac8DpTOplXxORX6F3Q==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/anser": { "version": "1.4.10", @@ -11321,6 +12048,12 @@ "dev": true, "license": "MIT" }, + "node_modules/base-x": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.1.tgz", + "integrity": "sha512-uAZ8x6r6S3aUM9rbHGVOIsR15U/ZSc82b3ymnCPsT45Gk1DDvhDPdIgB5MrhirZWt+5K0EEPQH985kNqZgNPFw==", + "dev": true + }, "node_modules/base64-js": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", @@ -11448,6 +12181,13 @@ "optional": true, "peer": true }, + "node_modules/bn.js": { + "version": "5.2.2", + "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.2.tgz", + "integrity": "sha512-v2YAxEmKaBLahNwE1mjp4WON6huMNeuDvagFZW+ASCuA/ku0bXR9hSMw0XpiqMoA3+rmnyck/tPRSFQkoC9Cuw==", + "dev": true, + "peer": true + }, "node_modules/body-parser": { "version": "1.20.3", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.3.tgz", @@ -11496,6 +12236,38 @@ "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", "license": "ISC" }, + "node_modules/borsh": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/borsh/-/borsh-0.7.0.tgz", + "integrity": "sha512-CLCsZGIBCFnPtkNnieW/a8wmreDmfUtjU2m9yHrzPXIlNbqVs0AQrSatSG6vdNYUqdc83tkQi2eHfF98ubzQLA==", + "dev": true, + "peer": true, + "dependencies": { + "bn.js": "^5.2.0", + "bs58": "^4.0.0", + "text-encoding-utf-8": "^1.0.2" + } + }, + "node_modules/borsh/node_modules/base-x": { + "version": "3.0.11", + "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.11.tgz", + "integrity": "sha512-xz7wQ8xDhdyP7tQxwdteLYeFfS68tSMNCZ/Y37WJ4bhGfKPpqEIlmIyueQHqOyoPhE6xNUqjzRr8ra0eF9VRvA==", + "dev": true, + "peer": true, + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/borsh/node_modules/bs58": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", + "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", + "dev": true, + "peer": true, + "dependencies": { + "base-x": "^3.0.2" + } + }, "node_modules/bplist-creator": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/bplist-creator/-/bplist-creator-0.1.0.tgz", @@ -11554,7 +12326,6 @@ "integrity": "sha512-g6nHaobTiT0eMZ7jh16YpD2kcjAp+PInbiVq3M1x6KKaEIVhT4v9oURNIpZLOZ3LQbQ3XYfNhMAb/9hzNLIWrw==", "dev": true, "hasInstallScript": true, - "license": "MIT", "dependencies": { "lodash": ">=4.17.21" } @@ -11592,6 +12363,15 @@ "node": "^6 || ^7 || ^8 || ^9 || ^10 || ^11 || ^12 || >=13.7" } }, + "node_modules/bs58": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", + "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", + "dev": true, + "dependencies": { + "base-x": "^4.0.0" + } + }, "node_modules/bser": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/bser/-/bser-2.1.1.tgz", @@ -11644,6 +12424,20 @@ "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", "license": "MIT" }, + "node_modules/bufferutil": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.1.0.tgz", + "integrity": "sha512-ZMANVnAixE6AWWnPzlW2KpUrxhm9woycYvPOo67jWHyFowASTEd9s+QN1EIMsSDtwhIxN4sWE1jotpuDUIgyIw==", + "hasInstallScript": true, + "optional": true, + "peer": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, "node_modules/bunyamin": { "version": "1.6.3", "resolved": "https://registry.npmjs.org/bunyamin/-/bunyamin-1.6.3.tgz", @@ -12180,7 +12974,6 @@ "resolved": "https://registry.npmjs.org/clsx/-/clsx-1.2.1.tgz", "integrity": "sha512-EcR6r5a8bj6pu3ycsa/E/cKVGuTgZJZdsyUYHOksG/UHIiKfjxzRxYJpyVBwYaQeOvghal9fcc4PidlgzugAQg==", "dev": true, - "license": "MIT", "engines": { "node": ">=6" } @@ -12491,7 +13284,6 @@ "resolved": "https://registry.npmjs.org/copy-to-clipboard/-/copy-to-clipboard-3.3.3.tgz", "integrity": "sha512-2KV8NhB5JqC3ky0r9PMCAZKbUHSwtEo4CwCs0KXgruG43gX5PMqDEBbVU4OUzw2MuAWUfsuFmWvEKG5QRfSnJA==", "dev": true, - "license": "MIT", "dependencies": { "toggle-selection": "^1.0.6" } @@ -12502,7 +13294,6 @@ "integrity": "sha512-SJ4/EHwS36QMJd6h/Rg+GyR4A5xE0FSI3eZ+iBVpfqf1x0eTSg1smWLHrA+2jQThZSh97fmSgFSU8B61nxosxA==", "dev": true, "hasInstallScript": true, - "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/core-js" @@ -12615,8 +13406,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/crypto-random-string": { "version": "2.0.0", @@ -13057,6 +13847,19 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/delay": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/delay/-/delay-5.0.0.tgz", + "integrity": "sha512-ReEBKkIfe4ya47wlPYf/gu5ib6yUG0/Aez0JQZQz94kiWtRQvZIQbTiehsnwHvLSWJnQdhVeqYue7Id1dKr0qw==", + "dev": true, + "peer": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/delayed-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", @@ -13562,6 +14365,12 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/dijkstrajs": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/dijkstrajs/-/dijkstrajs-1.0.3.tgz", + "integrity": "sha512-qiSlmBq9+BCdCA/L46dw8Uy93mloxsPSbwnm5yrKn2vMPiy8KyAskTF6zuV/j5BMsmOGZDPs7KjU+mjb670kfA==", + "dev": true + }, "node_modules/dir-glob": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", @@ -14191,6 +15000,23 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/es6-promise": { + "version": "4.2.8", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", + "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", + "dev": true, + "peer": true + }, + "node_modules/es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha512-C+d6UdsYDk0lMebHNR4S2NybQMMngAOnOwYBQjTOiv0MkoJMP0Myw2mgpDLBcpfCmRLxyFqYhS/CfOENq4SJhQ==", + "dev": true, + "peer": true, + "dependencies": { + "es6-promise": "^4.0.3" + } + }, "node_modules/esbuild": { "version": "0.25.5", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.25.5.tgz", @@ -15612,6 +16438,16 @@ "node": ">= 0.8" } }, + "node_modules/eyes": { + "version": "0.1.8", + "resolved": "https://registry.npmjs.org/eyes/-/eyes-0.1.8.tgz", + "integrity": "sha512-GipyPsXO1anza0AOZdy69Im7hGFCNB7Y/NGjDlZGJ3GJJLtwNSb2vrzYrTYJRrRloVx7pl+bhUaTB8yiccPvFQ==", + "dev": true, + "peer": true, + "engines": { + "node": "> 0.1.90" + } + }, "node_modules/fast-check": { "version": "3.23.2", "resolved": "https://registry.npmjs.org/fast-check/-/fast-check-3.23.2.tgz", @@ -15701,6 +16537,13 @@ "dev": true, "license": "MIT" }, + "node_modules/fast-stable-stringify": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fast-stable-stringify/-/fast-stable-stringify-1.0.0.tgz", + "integrity": "sha512-wpYMUmFu5f00Sm0cj2pfivpmawLZ0NKdviQ4w9zJeR8JVtOpOxHmLaJuj0vxvGqMJQWyP/COUkF75/57OKyRag==", + "dev": true, + "peer": true + }, "node_modules/fast-uri": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/fast-uri/-/fast-uri-3.1.0.tgz", @@ -15723,11 +16566,17 @@ "resolved": "https://registry.npmjs.org/fastest-levenshtein/-/fastest-levenshtein-1.0.16.tgz", "integrity": "sha512-eRnCtTTtGZFpQCwhJiUOuxPQWRXVKYDn0b2PeHfXL6/Zi53SLAzAHfVhVWK2AryC/WH05kGfxhFIPvTF0SXQzg==", "dev": true, - "license": "MIT", "engines": { "node": ">= 4.9.1" } }, + "node_modules/fastestsmallesttextencoderdecoder": { + "version": "1.0.22", + "resolved": "https://registry.npmjs.org/fastestsmallesttextencoderdecoder/-/fastestsmallesttextencoderdecoder-1.0.22.tgz", + "integrity": "sha512-Pb8d48e+oIuY4MaM64Cd7OW1gt4nxCHs7/ddPPZ/Ic3sg8yVGM7O9wDvZ7us6ScaUupzM+pfBolwtYhN1IxBIw==", + "dev": true, + "peer": true + }, "node_modules/fastq": { "version": "1.19.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.19.1.tgz", @@ -16078,8 +16927,7 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/find-up": { "version": "5.0.0", @@ -16913,7 +17761,6 @@ "resolved": "https://registry.npmjs.org/hoist-non-react-statics/-/hoist-non-react-statics-3.3.2.tgz", "integrity": "sha512-/gGivxi8JPKWNm/W0jSmzcMPpfpPLc3dY/6GxhX2hQ9iGj3aDfklV4ET7NjKpSinLpJ5vafa9iiGIEZg10SfBw==", "dev": true, - "license": "BSD-3-Clause", "dependencies": { "react-is": "^16.7.0" } @@ -16922,8 +17769,7 @@ "version": "16.13.1", "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/homedir-polyfill": { "version": "1.0.3", @@ -17140,6 +17986,16 @@ "node": ">=10.17.0" } }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "dev": true, + "peer": true, + "dependencies": { + "ms": "^2.0.0" + } + }, "node_modules/husky": { "version": "9.1.7", "resolved": "https://registry.npmjs.org/husky/-/husky-9.1.7.tgz", @@ -17204,8 +18060,7 @@ "version": "6.2.1", "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-6.2.1.tgz", "integrity": "sha512-8Sb3veuYCyrZL+VBt9LJfZjLUPWVvqn8tG28VqYNFCo43KHcKuq+b4EiXGeuaLAQWL2YmyDgMp2aSpH9JHsEQg==", - "dev": true, - "license": "Apache-2.0" + "dev": true }, "node_modules/identity-obj-proxy": { "version": "3.0.0", @@ -17362,7 +18217,6 @@ "resolved": "https://registry.npmjs.org/input-otp/-/input-otp-1.4.2.tgz", "integrity": "sha512-l3jWwYNvrEa6NTCt7BECfCm48GvwuZzkoeG3gBL2w4CHeOXW3eKFmf9UNYkNfYc3mxMrthMnxjIE07MT0zLBQA==", "dev": true, - "license": "MIT", "peerDependencies": { "react": "^16.8 || ^17.0 || ^18.0 || ^19.0.0 || ^19.0.0-rc", "react-dom": "^16.8 || ^17.0 || ^18.0 || ^19.0.0 || ^19.0.0-rc" @@ -17760,7 +18614,6 @@ "dev": true, "license": "MIT", "optional": true, - "peer": true, "engines": { "node": ">=8" } @@ -18010,7 +18863,6 @@ "url": "https://github.com/sponsors/wevm" } ], - "license": "MIT", "peerDependencies": { "ws": "*" } @@ -18136,6 +18988,89 @@ "node": ">=10" } }, + "node_modules/jayson": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/jayson/-/jayson-4.3.0.tgz", + "integrity": "sha512-AauzHcUcqs8OBnCHOkJY280VaTiCm57AbuO7lqzcw7JapGj50BisE3xhksye4zlTSR1+1tAz67wLTl8tEH1obQ==", + "dev": true, + "peer": true, + "dependencies": { + "@types/connect": "^3.4.33", + "@types/node": "^12.12.54", + "@types/ws": "^7.4.4", + "commander": "^2.20.3", + "delay": "^5.0.0", + "es6-promisify": "^5.0.0", + "eyes": "^0.1.8", + "isomorphic-ws": "^4.0.1", + "json-stringify-safe": "^5.0.1", + "stream-json": "^1.9.1", + "uuid": "^8.3.2", + "ws": "^7.5.10" + }, + "bin": { + "jayson": "bin/jayson.js" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/jayson/node_modules/@types/node": { + "version": "12.20.55", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.20.55.tgz", + "integrity": "sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==", + "dev": true, + "peer": true + }, + "node_modules/jayson/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "peer": true + }, + "node_modules/jayson/node_modules/isomorphic-ws": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz", + "integrity": "sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w==", + "dev": true, + "peer": true, + "peerDependencies": { + "ws": "*" + } + }, + "node_modules/jayson/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "peer": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/jayson/node_modules/ws": { + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "dev": true, + "peer": true, + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/jest-circus": { "version": "30.2.0", "resolved": "https://registry.npmjs.org/jest-circus/-/jest-circus-30.2.0.tgz", @@ -19095,6 +20030,12 @@ "integrity": "sha512-dZ6Ra7u1G8c4Letq/B5EzAxj4tLFHL+cGtdpR+PVm4yzPDj+lCk+AbivWt1eOM+ikzkowtyV7qSqX6qr3t71Ww==", "license": "MIT" }, + "node_modules/js-base64": { + "version": "3.7.8", + "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.8.tgz", + "integrity": "sha512-hNngCeKxIUQiEUN3GPJOkz4wF/YvdUdbNL9hsBcMQTkKzboD7T/q3OYOuuPZLUE6dBxSGpwhk5mwuDud7JVAow==", + "dev": true + }, "node_modules/js-cookie": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.5.tgz", @@ -19213,6 +20154,13 @@ "dev": true, "license": "MIT" }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true, + "peer": true + }, "node_modules/json5": { "version": "2.2.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.3.tgz", @@ -20485,6 +21433,19 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/merge-options": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/merge-options/-/merge-options-3.0.4.tgz", + "integrity": "sha512-2Sug1+knBjkaMsMgf1ctR1Ujx+Ayku4EdJN4Z+C2+JzoeF7A3OZ9KM2GY0CpQS51NR61LTurMJrRKPhSs3ZRTQ==", + "dev": true, + "optional": true, + "dependencies": { + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/merge-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", @@ -22255,6 +23216,18 @@ "node": ">= 6.13.0" } }, + "node_modules/node-gyp-build": { + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.4.tgz", + "integrity": "sha512-LA4ZjwlnUblHVgq0oBF3Jl/6h/Nvs5fzBLwdEF4nuxnFdsfajde4WfxtJr3CaiH+F6ewcIB/q4jQ4UzPyid+CQ==", + "optional": true, + "peer": true, + "bin": { + "node-gyp-build": "bin.js", + "node-gyp-build-optional": "optional.js", + "node-gyp-build-test": "build-test.js" + } + }, "node_modules/node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -23026,7 +23999,6 @@ "url": "https://github.com/sponsors/wevm" } ], - "license": "MIT", "dependencies": { "@adraffy/ens-normalize": "^1.10.1", "@noble/curves": "^1.6.0", @@ -23050,7 +24022,6 @@ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", "dev": true, - "license": "MIT", "engines": { "node": "^14.21.3 || >=16" }, @@ -23062,8 +24033,7 @@ "version": "5.0.1", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/p-finally": { "version": "1.0.0", @@ -24243,7 +25213,6 @@ "resolved": "https://registry.npmjs.org/preact/-/preact-10.24.2.tgz", "integrity": "sha512-1cSoF0aCC8uaARATfrlz4VCBqE8LwZwRfLgkxJOQwAlQt6ayTmi0D9OF7nXid1POI5SZidFuG9CnlXbDfLqY/Q==", "dev": true, - "license": "MIT", "funding": { "type": "opencollective", "url": "https://opencollective.com/preact" @@ -24498,6 +25467,23 @@ "tweetnacl": "^1.0.3" } }, + "node_modules/qrcode": { + "version": "1.5.4", + "resolved": "https://registry.npmjs.org/qrcode/-/qrcode-1.5.4.tgz", + "integrity": "sha512-1ca71Zgiu6ORjHqFBDpnSMTR2ReToX4l1Au1VFLyVeBTFavzQnv5JxMFr3ukHVKpSrSA2MCk0lNJSykjUfz7Zg==", + "dev": true, + "dependencies": { + "dijkstrajs": "^1.0.1", + "pngjs": "^5.0.0", + "yargs": "^15.3.1" + }, + "bin": { + "qrcode": "bin/qrcode" + }, + "engines": { + "node": ">=10.13.0" + } + }, "node_modules/qrcode-terminal": { "version": "0.11.0", "resolved": "https://registry.npmjs.org/qrcode-terminal/-/qrcode-terminal-0.11.0.tgz", @@ -24511,11 +25497,175 @@ "resolved": "https://registry.npmjs.org/qrcode.react/-/qrcode.react-4.2.0.tgz", "integrity": "sha512-QpgqWi8rD9DsS9EP3z7BT+5lY5SFhsqGjpgW5DY/i3mK4M9DTBNz3ErMi8BWYEfI3L0d8GIbGmcdFAS1uIRGjA==", "dev": true, - "license": "ISC", "peerDependencies": { "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, + "node_modules/qrcode/node_modules/camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/qrcode/node_modules/cliui": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "dev": true, + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" + } + }, + "node_modules/qrcode/node_modules/decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha512-z2S+W9X73hAUUki+N+9Za2lBlun89zigOyGrsax+KUQ6wKW4ZoWpEYBkGhQjwAjjDCkWxhY0VKEhk8wzY7F5cA==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/qrcode/node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "node_modules/qrcode/node_modules/find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/qrcode/node_modules/p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/pngjs": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pngjs/-/pngjs-5.0.0.tgz", + "integrity": "sha512-40QW5YalBNfQo5yRYmiw7Yz6TKKVr3h6970B2YE+3fQpsWcrbj1PzJgxeJ19DRQjhMbKPIuMY8rFaXc8moolVw==", + "dev": true, + "engines": { + "node": ">=10.13.0" + } + }, + "node_modules/qrcode/node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/y18n": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", + "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", + "dev": true + }, + "node_modules/qrcode/node_modules/yargs": { + "version": "15.4.1", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "dev": true, + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/qrcode/node_modules/yargs-parser": { + "version": "18.1.3", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "dev": true, + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } + }, "node_modules/qs": { "version": "6.13.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.13.0.tgz", @@ -25560,6 +26710,12 @@ "node": ">=0.10.0" } }, + "node_modules/require-main-filename": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", + "dev": true + }, "node_modules/requireg": { "version": "0.2.2", "resolved": "https://registry.npmjs.org/requireg/-/requireg-0.2.2.tgz", @@ -25965,6 +27121,82 @@ "dev": true, "license": "MIT" }, + "node_modules/rpc-websockets": { + "version": "9.3.2", + "resolved": "https://registry.npmjs.org/rpc-websockets/-/rpc-websockets-9.3.2.tgz", + "integrity": "sha512-VuW2xJDnl1k8n8kjbdRSWawPRkwaVqUQNjE1TdeTawf0y0abGhtVJFTXCLfgpgGDBkO/Fj6kny8Dc/nvOW78MA==", + "dev": true, + "peer": true, + "dependencies": { + "@swc/helpers": "^0.5.11", + "@types/uuid": "^8.3.4", + "@types/ws": "^8.2.2", + "buffer": "^6.0.3", + "eventemitter3": "^5.0.1", + "uuid": "^8.3.2", + "ws": "^8.5.0" + }, + "funding": { + "type": "paypal", + "url": "https://paypal.me/kozjak" + }, + "optionalDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + } + }, + "node_modules/rpc-websockets/node_modules/@types/ws": { + "version": "8.18.1", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", + "integrity": "sha512-ThVF6DCVhA8kUGy+aazFQ4kXQ7E1Ty7A3ypFOe0IcJV8O/M511G99AW24irKrW56Wt44yG9+ij8FaqoBGkuBXg==", + "dev": true, + "peer": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/rpc-websockets/node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peer": true, + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/rpc-websockets/node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "dev": true, + "peer": true + }, + "node_modules/rpc-websockets/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "peer": true, + "bin": { + "uuid": "dist/bin/uuid" + } + }, "node_modules/rslog": { "version": "1.2.11", "resolved": "https://registry.npmjs.org/rslog/-/rslog-1.2.11.tgz", @@ -26325,6 +27557,12 @@ "integrity": "sha512-qepMx2JxAa5jjfzxG79yPPq+8BuFToHd1hm7kI+Z4zAq1ftQiP7HcxMhDDItrbtwVeLg/cY2JnKnrcFkmiswNA==", "license": "MIT" }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "dev": true + }, "node_modules/set-function-length": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", @@ -26838,7 +28076,6 @@ "integrity": "sha512-1TJmBx6aSWqZ4tx7aTpBDXK0/e2hhcNSTV8+CbFJtDjbb+I1mZ8lHit0Grw9GRT+6JbIrrDd8esncgBi8aBXGA==", "dev": true, "license": "BSD-3-Clause", - "optional": true, "peer": true }, "node_modules/stream-json": { @@ -26847,7 +28084,6 @@ "integrity": "sha512-uWkjJ+2Nt/LO9Z/JyKZbMusL8Dkh97uUBTv3AJQ74y07lVahLY4eEFsPsE97pxYBwr8nnjMAIch5eqI0gPShyw==", "dev": true, "license": "BSD-3-Clause", - "optional": true, "peer": true, "dependencies": { "stream-chain": "^2.2.5" @@ -27245,8 +28481,7 @@ "version": "4.2.0", "resolved": "https://registry.npmjs.org/stylis/-/stylis-4.2.0.tgz", "integrity": "sha512-Orov6g6BB1sDfYgzWfTHDOxamtX1bE/zo104Dh9e6fqJ3PooipYyfJ0pUmrZO2wAvO8YbEyeFrkV91XTsGMSrw==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/sucrase": { "version": "3.35.0", @@ -27285,6 +28520,16 @@ "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", "license": "MIT" }, + "node_modules/superstruct": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-2.0.2.tgz", + "integrity": "sha512-uV+TFRZdXsqXTL2pRvujROjdZQ4RAlBUS5BTh9IGm+jTqQntYThciG/qu57Gs69yjnVUSqdxF9YLmSnpupBW9A==", + "dev": true, + "peer": true, + "engines": { + "node": ">=14.0.0" + } + }, "node_modules/supports-color": { "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", @@ -27888,11 +29133,10 @@ } }, "node_modules/tabbable": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.3.0.tgz", - "integrity": "sha512-EIHvdY5bPLuWForiR/AN2Bxngzpuwn1is4asboytXtpTgsArc+WmSJKVLlhdh71u7jFcryDqB2A8lQvj78MkyQ==", - "dev": true, - "license": "MIT" + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/tabbable/-/tabbable-6.4.0.tgz", + "integrity": "sha512-05PUHKSNE8ou2dwIxTngl4EzcnsCDZGJ/iCLtDflR/SHB/ny14rXc+qU5P4mG9JkusiV7EivzY9Mhm55AzAvCg==", + "dev": true }, "node_modules/tapable": { "version": "2.3.0", @@ -28116,6 +29360,13 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/text-encoding-utf-8": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/text-encoding-utf-8/-/text-encoding-utf-8-1.0.2.tgz", + "integrity": "sha512-8bw4MY9WjdsD2aMtO0OzOCY3pXGYNx2d2FfHRVUKkiCPDWjKuOlhLVASS+pD7VkLTVjW268LYJHwsnPFlBpbAg==", + "dev": true, + "peer": true + }, "node_modules/text-hex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/text-hex/-/text-hex-1.0.0.tgz", @@ -28273,8 +29524,7 @@ "version": "1.0.6", "resolved": "https://registry.npmjs.org/toggle-selection/-/toggle-selection-1.0.6.tgz", "integrity": "sha512-BiZS+C1OS8g/q2RRbJmy59xpyghNBqrr6k5L/uKBGRsTfxmu3ffiRnd8mlGPUVayg8pvfi5urfnu8TU7DVOkLQ==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/toidentifier": { "version": "1.0.1", @@ -28913,6 +30163,20 @@ "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0" } }, + "node_modules/utf-8-validate": { + "version": "5.0.10", + "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", + "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", + "hasInstallScript": true, + "optional": true, + "peer": true, + "dependencies": { + "node-gyp-build": "^4.3.0" + }, + "engines": { + "node": ">=6.14.2" + } + }, "node_modules/utf8-byte-length": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/utf8-byte-length/-/utf8-byte-length-1.0.5.tgz", @@ -29007,9 +30271,9 @@ } }, "node_modules/viem": { - "version": "2.40.3", - "resolved": "https://registry.npmjs.org/viem/-/viem-2.40.3.tgz", - "integrity": "sha512-feYfEpbgjRkZYQpwcgxqkWzjxHI5LSDAjcGetHHwDRuX9BRQHUdV8ohrCosCYpdEhus/RknD3/bOd4qLYVPPuA==", + "version": "2.44.4", + "resolved": "https://registry.npmjs.org/viem/-/viem-2.44.4.tgz", + "integrity": "sha512-sJDLVl2EsS5Fo7GSWZME5CXEV7QRYkUJPeBw7ac+4XI3D4ydvMw/gjulTsT5pgqcpu70BploFnOAC6DLpan1Yg==", "dev": true, "funding": [ { @@ -29017,15 +30281,14 @@ "url": "https://github.com/sponsors/wevm" } ], - "license": "MIT", "dependencies": { "@noble/curves": "1.9.1", "@noble/hashes": "1.8.0", "@scure/bip32": "1.7.0", "@scure/bip39": "1.6.0", - "abitype": "1.1.0", + "abitype": "1.2.3", "isows": "1.0.7", - "ox": "0.9.6", + "ox": "0.11.3", "ws": "8.18.3" }, "peerDependencies": { @@ -29042,7 +30305,6 @@ "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.1.tgz", "integrity": "sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==", "dev": true, - "license": "MIT", "dependencies": { "@noble/hashes": "1.8.0" }, @@ -29058,7 +30320,6 @@ "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", "dev": true, - "license": "MIT", "engines": { "node": "^14.21.3 || >=16" }, @@ -29066,39 +30327,16 @@ "url": "https://paulmillr.com/funding/" } }, - "node_modules/viem/node_modules/abitype": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.1.0.tgz", - "integrity": "sha512-6Vh4HcRxNMLA0puzPjM5GBgT4aAcFGKZzSgAXvuZ27shJP6NEpielTuqbBmZILR5/xd0PizkBGy5hReKz9jl5A==", - "dev": true, - "license": "MIT", - "funding": { - "url": "https://github.com/sponsors/wevm" - }, - "peerDependencies": { - "typescript": ">=5.0.4", - "zod": "^3.22.0 || ^4.0.0" - }, - "peerDependenciesMeta": { - "typescript": { - "optional": true - }, - "zod": { - "optional": true - } - } - }, "node_modules/viem/node_modules/eventemitter3": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", - "dev": true, - "license": "MIT" + "dev": true }, "node_modules/viem/node_modules/ox": { - "version": "0.9.6", - "resolved": "https://registry.npmjs.org/ox/-/ox-0.9.6.tgz", - "integrity": "sha512-8SuCbHPvv2eZLYXrNmC0EC12rdzXQLdhnOMlHDW2wiCPLxBrOOJwX5L5E61by+UjTPOryqQiRSnjIKCI+GykKg==", + "version": "0.11.3", + "resolved": "https://registry.npmjs.org/ox/-/ox-0.11.3.tgz", + "integrity": "sha512-1bWYGk/xZel3xro3l8WGg6eq4YEKlaqvyMtVhfMFpbJzK2F6rj4EDRtqDCWVEJMkzcmEi9uW2QxsqELokOlarw==", "dev": true, "funding": [ { @@ -29106,7 +30344,6 @@ "url": "https://github.com/sponsors/wevm" } ], - "license": "MIT", "dependencies": { "@adraffy/ens-normalize": "^1.11.0", "@noble/ciphers": "^1.3.0", @@ -29114,7 +30351,7 @@ "@noble/hashes": "^1.8.0", "@scure/bip32": "^1.7.0", "@scure/bip39": "^1.6.0", - "abitype": "^1.0.9", + "abitype": "^1.2.3", "eventemitter3": "5.0.1" }, "peerDependencies": { @@ -29640,6 +30877,12 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/which-module": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.1.tgz", + "integrity": "sha512-iBdZ57RDvnOR9AGBhML2vFZf7h8vmBjhoaZqODJBFWHVtKkDmKuHai3cx5PgVMrX5YDNp27AofYbAwctSS+vhQ==", + "dev": true + }, "node_modules/which-typed-array": { "version": "1.1.19", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.19.tgz", @@ -30050,7 +31293,6 @@ "resolved": "https://registry.npmjs.org/zustand/-/zustand-5.0.3.tgz", "integrity": "sha512-14fwWQtU3pH4dE0dOpdMiWjddcH+QzKIgk1cl8epwSE7yag43k/AD/m4L6+K7DytAOr9gGBe3/EXj9g7cdostg==", "dev": true, - "license": "MIT", "engines": { "node": ">=12.20.0" }, diff --git a/package.json b/package.json index a6e6f14..6235752 100644 --- a/package.json +++ b/package.json @@ -42,8 +42,8 @@ "tslib": "^2.8.1" }, "devDependencies": { - "@clerk/clerk-expo": "^2.19.6", - "@clerk/types": "^4.101.3", + "@clerk/clerk-expo": "^2.19.18", + "@clerk/types": "^4.101.11", "@eslint/compat": "^1.4.0", "@eslint/eslintrc": "^3.3.1", "@eslint/js": "^9.37.0", diff --git a/src/lib/src/features/clerk/hooks/use-auth-with-identifier.ts b/src/lib/src/features/clerk/hooks/use-auth-with-identifier.ts index f3338fb..127ab3f 100644 --- a/src/lib/src/features/clerk/hooks/use-auth-with-identifier.ts +++ b/src/lib/src/features/clerk/hooks/use-auth-with-identifier.ts @@ -128,8 +128,8 @@ export function useAuthWithIdentifier< setIsLoading(true); return method === 'username' - ? handleUsernameAuth(params as StartAuthParams<'password'>, true) - : handleEmailPhoneAuth(params, true); + ? await handleUsernameAuth(params as StartAuthParams<'password'>, true) + : await handleEmailPhoneAuth(params, true); } catch (error) { return { error, signUp, isSuccess: false } as StartSignUpWithIdentifierReturn; } finally { @@ -142,8 +142,8 @@ export function useAuthWithIdentifier< setIsLoading(true); return method === 'username' - ? handleUsernameAuth(params as StartAuthParams<'password'>, false) - : handleEmailPhoneAuth(params, false); + ? await handleUsernameAuth(params as StartAuthParams<'password'>, false) + : await handleEmailPhoneAuth(params, false); } catch (error) { return { error, signIn, isSuccess: false } as StartSignInWithIdentifierReturn; } finally { From b2b1332f433c5a30634898af830c3451b52f3176 Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Tue, 20 Jan 2026 11:55:51 +0600 Subject: [PATCH 02/19] feat: add separated auth hooks and simplify types --- src/lib/src/features/clerk/hooks/index.ts | 3 + .../src/features/clerk/hooks/use-auth-flow.ts | 60 +++++++++++++++ .../src/features/clerk/hooks/use-sign-in.ts | 75 +++++++++++++++++++ .../src/features/clerk/hooks/use-sign-up.ts | 70 +++++++++++++++++ src/lib/src/features/clerk/types/shared.ts | 39 ++++++++++ src/lib/src/features/clerk/types/sign-in.ts | 17 +++++ src/lib/src/features/clerk/types/sign-up.ts | 17 +++++ 7 files changed, 281 insertions(+) create mode 100644 src/lib/src/features/clerk/hooks/use-auth-flow.ts create mode 100644 src/lib/src/features/clerk/hooks/use-sign-in.ts create mode 100644 src/lib/src/features/clerk/hooks/use-sign-up.ts create mode 100644 src/lib/src/features/clerk/types/shared.ts create mode 100644 src/lib/src/features/clerk/types/sign-in.ts create mode 100644 src/lib/src/features/clerk/types/sign-up.ts diff --git a/src/lib/src/features/clerk/hooks/index.ts b/src/lib/src/features/clerk/hooks/index.ts index 7daca1b..009b8c4 100644 --- a/src/lib/src/features/clerk/hooks/index.ts +++ b/src/lib/src/features/clerk/hooks/index.ts @@ -6,3 +6,6 @@ export * from './use-otp-verification'; export * from './use-auth-with-identifier'; export * from './use-add-identifier'; export * from './use-reset-password'; +export * from './use-sign-in'; +export * from './use-sign-up'; +export * from './use-auth-flow'; diff --git a/src/lib/src/features/clerk/hooks/use-auth-flow.ts b/src/lib/src/features/clerk/hooks/use-auth-flow.ts new file mode 100644 index 0000000..9b0390b --- /dev/null +++ b/src/lib/src/features/clerk/hooks/use-auth-flow.ts @@ -0,0 +1,60 @@ +import { isClerkAPIResponseError } from '@clerk/clerk-expo'; +import { ClerkApiError } from '../enums'; // Your existing enums +import { AuthIdentifierVerifyBy, IdentifierMethodFor, AuthResult } from '../types/shared'; +import { StartSignInParams } from '../types/sign-in'; +import { StartSignUpParams } from '../types/sign-up'; +import { useOtpVerification } from './use-otp-verification'; +import { useSignIn } from './use-sign-in'; +import { useSignUp } from './use-sign-up'; + +// Intersection of params for the auto-flow +type AuthFlowParams = StartSignUpParams & + StartSignInParams; + +export function useAuthFlow>( + method: TMethod, + verifyBy: TVerifyBy, +) { + // 1. Compose the atomic hooks + const signUpHook = useSignUp(method, verifyBy); + const signInHook = useSignIn(method, verifyBy); + const { verifyCode, isVerifying } = useOtpVerification(); + + const isLoading = signUpHook.isLoading || signInHook.isLoading; + + /** + * Attempts to Sign Up. If user exists, attempts to Sign In. + */ + const startAuth = async (params: AuthFlowParams): Promise & { isSignUp?: boolean }> => { + // 1. Try Sign Up + const signUpResult = await signUpHook.startSignUp(params); + + // 2. If Sign Up failed because user exists, Try Sign In + if (signUpResult.error && isClerkAPIResponseError(signUpResult.error)) { + const error = signUpResult.error.errors[0]; + + if (error?.code === ClerkApiError.FORM_IDENTIFIER_EXIST) { + // Fallback to Sign In + // Note: We pass the same params. SignIn will ignore extra SignUp fields (like firstName) + const signInResult = await signInHook.startSignIn(params as StartSignInParams); + + return { ...signInResult, isSignUp: false }; + } + } + + // 3. Return Sign Up result (success or other error) + return { ...signUpResult, isSignUp: true }; + }; + + // Expose everything needed for the UI + return { + startAuth, + // Expose atomic methods if specific control is needed + startSignUp: signUpHook.startSignUp, + startSignIn: signInHook.startSignIn, + // Verification + verifyCode: method !== 'username' ? verifyCode : undefined, + isVerifying: method !== 'username' ? isVerifying : undefined, + isLoading, + }; +} diff --git a/src/lib/src/features/clerk/hooks/use-sign-in.ts b/src/lib/src/features/clerk/hooks/use-sign-in.ts new file mode 100644 index 0000000..c409598 --- /dev/null +++ b/src/lib/src/features/clerk/hooks/use-sign-in.ts @@ -0,0 +1,75 @@ +import { SignInResource } from '@clerk/types'; +import { useState } from 'react'; +import { AuthIdentifierVerifyBy, AuthResult, IdentifierMethodFor } from '../types/shared'; +import { StartSignInParams, UseSignInReturn } from '../types/sign-in'; +import { useClerkResources } from './use-clerk-resources'; +import { useGetSessionToken } from './use-get-session-token'; +import { useOtpVerification } from './use-otp-verification'; + +export function useSignIn>( + method: TMethod, + verifyBy: TVerifyBy, +): UseSignInReturn { + const { signIn, setActive } = useClerkResources(); + const { sendOtpCode } = useOtpVerification(); + const { getSessionToken } = useGetSessionToken(); + const [isLoading, setIsLoading] = useState(false); + + // Helper to strategy string (e.g., 'email_code') + const strategy = method === 'emailAddress' ? 'email_code' : 'phone_code'; + + const startSignIn = async (params: StartSignInParams): Promise> => { + setIsLoading(true); + + try { + const { identifier, ...rest } = params as any; // Cast to access dynamic props safely + + // 1. Create the Sign In Attempt + let attempt; + + if (verifyBy === 'password') { + const { password, ...restParams } = rest; + attempt = await signIn?.create({ + identifier, + password, + ...restParams, + }); + } else { + // OTP Flow + attempt = await signIn?.create({ + identifier, + ...rest, + }); + } + + // 2. Handle OTP Sending if required + if (verifyBy === 'otp' && attempt?.status !== 'complete') { + // Some strategies might require selecting the factor first + await sendOtpCode(strategy); + } + + // 3. Handle Completion (Password flow usually completes immediately) + let sessionToken: string | undefined; + + if (attempt?.status === 'complete' && attempt.createdSessionId) { + await setActive?.({ session: attempt.createdSessionId }); + const tokenResult = await getSessionToken({ + tokenTemplate: params.tokenTemplate, + }); + sessionToken = tokenResult.sessionToken || undefined; + } + + return { + isSuccess: true, + resource: attempt, + sessionToken, + }; + } catch (error) { + return { isSuccess: false, error, resource: signIn }; + } finally { + setIsLoading(false); + } + }; + + return { startSignIn, isLoading, signIn }; +} diff --git a/src/lib/src/features/clerk/hooks/use-sign-up.ts b/src/lib/src/features/clerk/hooks/use-sign-up.ts new file mode 100644 index 0000000..8de479e --- /dev/null +++ b/src/lib/src/features/clerk/hooks/use-sign-up.ts @@ -0,0 +1,70 @@ +import { SignUpResource } from '@clerk/types'; +import { useState } from 'react'; +import { AuthIdentifierVerifyBy, AuthResult, IdentifierMethodFor } from '../types/shared'; +import { StartSignUpParams, UseSignUpReturn } from '../types/sign-up'; +import { useClerkResources } from './use-clerk-resources'; +import { useGetSessionToken } from './use-get-session-token'; + +export function useSignUp>( + method: TMethod, + verifyBy: TVerifyBy, +): UseSignUpReturn { + const { signUp, setActive } = useClerkResources(); + const { getSessionToken } = useGetSessionToken(); + const [isLoading, setIsLoading] = useState(false); + + const strategy = method === 'emailAddress' ? 'email_code' : 'phone_code'; + const identifierKey = method === 'username' ? 'username' : method; + + const startSignUp = async (params: StartSignUpParams): Promise> => { + setIsLoading(true); + + try { + const { identifier, ...rest } = params as any; + + // 1. Create Sign Up Attempt + let attempt; + + if (verifyBy === 'password') { + const { password, ...restParams } = rest; + attempt = await signUp?.create({ + [identifierKey]: identifier, + password, + ...restParams, + }); + } else { + // OTP Flow + attempt = await signUp?.create({ + [identifierKey]: identifier, + ...rest, + }); + + // Prepare verification (send code) + await signUp?.prepareVerification({ strategy: strategy }); + } + + // 2. Handle Completion (Password flow) + let sessionToken: string | undefined; + + if (attempt?.status === 'complete' && attempt.createdSessionId) { + await setActive?.({ session: attempt.createdSessionId }); + const tokenResult = await getSessionToken({ + tokenTemplate: (params as any).tokenTemplate, + }); + sessionToken = tokenResult.sessionToken || undefined; + } + + return { + isSuccess: true, + resource: attempt, + sessionToken, + }; + } catch (error) { + return { isSuccess: false, error, resource: signUp }; + } finally { + setIsLoading(false); + } + }; + + return { startSignUp, isLoading, signUp }; +} diff --git a/src/lib/src/features/clerk/types/shared.ts b/src/lib/src/features/clerk/types/shared.ts new file mode 100644 index 0000000..eb58f80 --- /dev/null +++ b/src/lib/src/features/clerk/types/shared.ts @@ -0,0 +1,39 @@ +import { ClerkAPIError } from '@clerk/types'; + +// --- Configuration Types --- + +export type AuthIdentifierMethod = 'emailAddress' | 'phoneNumber' | 'username'; +export type AuthIdentifierVerifyBy = 'otp' | 'password'; + +/** Maps verification method to the allowed identifier methods. */ +export type IdentifierMethodFor = VerifyBy extends 'otp' + ? Exclude + : AuthIdentifierMethod; + +// --- Return Types --- + +export type BaseSuccessReturn = { isSuccess: true; error?: never }; +export type BaseFailureReturn = { isSuccess: false; error: ClerkAPIError | unknown }; + +export type WithSessionToken = { sessionToken?: string }; + +export type AuthResult = (BaseSuccessReturn | BaseFailureReturn) & { + resource?: Resource; // The SignIn or SignUp object +} & WithSessionToken; + +// --- Param Helpers --- + +export type HookManagedFields = 'identifier' | 'password' | 'emailAddress' | 'phoneNumber' | 'username'; + +/** Base parameters required for password-based auth */ +export interface PasswordAuthParams { + identifier: string; + password: string; + tokenTemplate?: string; +} + +/** Base parameters required for OTP-based auth */ +export interface OtpAuthParams { + identifier: string; + tokenTemplate?: string; +} diff --git a/src/lib/src/features/clerk/types/sign-in.ts b/src/lib/src/features/clerk/types/sign-in.ts new file mode 100644 index 0000000..9b4d047 --- /dev/null +++ b/src/lib/src/features/clerk/types/sign-in.ts @@ -0,0 +1,17 @@ +import { SignInCreateParams, SignInResource } from '@clerk/types'; +import { AuthIdentifierVerifyBy, AuthResult, HookManagedFields, OtpAuthParams, PasswordAuthParams } from './shared'; + +/** + * Params for Sign In. + * Combines hook requirements (identifier/password) with native Clerk SignInCreateParams. + */ +export type StartSignInParams = VerifyBy extends 'otp' + ? OtpAuthParams & Omit + : PasswordAuthParams & Omit; + +/** Return type for the useSignIn hook */ +export interface UseSignInReturn { + startSignIn: (params: StartSignInParams) => Promise>; + isLoading: boolean; + signIn?: SignInResource; +} diff --git a/src/lib/src/features/clerk/types/sign-up.ts b/src/lib/src/features/clerk/types/sign-up.ts new file mode 100644 index 0000000..211d89c --- /dev/null +++ b/src/lib/src/features/clerk/types/sign-up.ts @@ -0,0 +1,17 @@ +import { SignUpCreateParams, SignUpResource } from '@clerk/types'; +import { AuthIdentifierVerifyBy, AuthResult, HookManagedFields, OtpAuthParams, PasswordAuthParams } from './shared'; + +/** + * Params for Sign Up. + * Combines hook requirements with native Clerk SignUpCreateParams (e.g. firstName, lastName). + */ +export type StartSignUpParams = VerifyBy extends 'otp' + ? OtpAuthParams & Omit + : PasswordAuthParams & Omit; + +/** Return type for the useSignUp hook */ +export interface UseSignUpReturn { + startSignUp: (params: StartSignUpParams) => Promise>; + isLoading: boolean; + signUp?: SignUpResource; +} From 88a554d479d1951fd9e878fc89b8fb90e87e9984 Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Tue, 20 Jan 2026 13:42:09 +0600 Subject: [PATCH 03/19] fix: remove username as auth method --- src/lib/src/features/clerk/hooks/use-auth-flow.ts | 4 ++-- src/lib/src/features/clerk/hooks/use-sign-in.ts | 4 ++-- src/lib/src/features/clerk/hooks/use-sign-up.ts | 15 +++++++-------- src/lib/src/features/clerk/types/shared.ts | 5 ----- 4 files changed, 11 insertions(+), 17 deletions(-) diff --git a/src/lib/src/features/clerk/hooks/use-auth-flow.ts b/src/lib/src/features/clerk/hooks/use-auth-flow.ts index 9b0390b..22370a3 100644 --- a/src/lib/src/features/clerk/hooks/use-auth-flow.ts +++ b/src/lib/src/features/clerk/hooks/use-auth-flow.ts @@ -1,6 +1,6 @@ import { isClerkAPIResponseError } from '@clerk/clerk-expo'; import { ClerkApiError } from '../enums'; // Your existing enums -import { AuthIdentifierVerifyBy, IdentifierMethodFor, AuthResult } from '../types/shared'; +import { AuthIdentifierVerifyBy, AuthIdentifierMethod, AuthResult } from '../types/shared'; import { StartSignInParams } from '../types/sign-in'; import { StartSignUpParams } from '../types/sign-up'; import { useOtpVerification } from './use-otp-verification'; @@ -11,7 +11,7 @@ import { useSignUp } from './use-sign-up'; type AuthFlowParams = StartSignUpParams & StartSignInParams; -export function useAuthFlow>( +export function useAuthFlow( method: TMethod, verifyBy: TVerifyBy, ) { diff --git a/src/lib/src/features/clerk/hooks/use-sign-in.ts b/src/lib/src/features/clerk/hooks/use-sign-in.ts index c409598..a3ebb00 100644 --- a/src/lib/src/features/clerk/hooks/use-sign-in.ts +++ b/src/lib/src/features/clerk/hooks/use-sign-in.ts @@ -1,12 +1,12 @@ import { SignInResource } from '@clerk/types'; import { useState } from 'react'; -import { AuthIdentifierVerifyBy, AuthResult, IdentifierMethodFor } from '../types/shared'; +import { AuthIdentifierVerifyBy, AuthResult, AuthIdentifierMethod } from '../types/shared'; import { StartSignInParams, UseSignInReturn } from '../types/sign-in'; import { useClerkResources } from './use-clerk-resources'; import { useGetSessionToken } from './use-get-session-token'; import { useOtpVerification } from './use-otp-verification'; -export function useSignIn>( +export function useSignIn( method: TMethod, verifyBy: TVerifyBy, ): UseSignInReturn { diff --git a/src/lib/src/features/clerk/hooks/use-sign-up.ts b/src/lib/src/features/clerk/hooks/use-sign-up.ts index 8de479e..492b78d 100644 --- a/src/lib/src/features/clerk/hooks/use-sign-up.ts +++ b/src/lib/src/features/clerk/hooks/use-sign-up.ts @@ -1,11 +1,11 @@ import { SignUpResource } from '@clerk/types'; import { useState } from 'react'; -import { AuthIdentifierVerifyBy, AuthResult, IdentifierMethodFor } from '../types/shared'; +import { AuthIdentifierVerifyBy, AuthResult, AuthIdentifierMethod } from '../types/shared'; import { StartSignUpParams, UseSignUpReturn } from '../types/sign-up'; import { useClerkResources } from './use-clerk-resources'; import { useGetSessionToken } from './use-get-session-token'; -export function useSignUp>( +export function useSignUp( method: TMethod, verifyBy: TVerifyBy, ): UseSignUpReturn { @@ -14,7 +14,6 @@ export function useSignUp): Promise> => { setIsLoading(true); @@ -28,21 +27,21 @@ export function useSignUp = VerifyBy extends 'otp' - ? Exclude - : AuthIdentifierMethod; - // --- Return Types --- export type BaseSuccessReturn = { isSuccess: true; error?: never }; From c18d87020d8da43889f2925e719819642f2bac9b Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Wed, 21 Jan 2026 12:10:28 +0600 Subject: [PATCH 04/19] feat: add JSDoc to updated sign-up and sign-in hooks --- apps/example/app/index.tsx | 14 +++++ src/lib/src/features/clerk/hooks/index.ts | 1 - .../src/features/clerk/hooks/use-auth-flow.ts | 60 ------------------- .../src/features/clerk/hooks/use-sign-in.ts | 15 ++++- .../src/features/clerk/hooks/use-sign-up.ts | 23 +++++-- src/lib/src/features/clerk/types/shared.ts | 4 +- src/lib/src/features/clerk/types/sign-in.ts | 30 +++++++++- src/lib/src/features/clerk/types/sign-up.ts | 35 ++++++++++- 8 files changed, 108 insertions(+), 74 deletions(-) delete mode 100644 src/lib/src/features/clerk/hooks/use-auth-flow.ts diff --git a/apps/example/app/index.tsx b/apps/example/app/index.tsx index c49d35e..4b549f5 100644 --- a/apps/example/app/index.tsx +++ b/apps/example/app/index.tsx @@ -1,3 +1,4 @@ +import { useSignIn, useAuthWithIdentifier } from '@ronas-it/react-native-common-modules/clerk'; import { useTranslation } from '@ronas-it/react-native-common-modules/i18n'; import { AppSafeAreaView } from '@ronas-it/react-native-common-modules/safe-area-view'; import { ReactElement, useContext } from 'react'; @@ -14,6 +15,19 @@ export default function RootScreen(): ReactElement { onLanguageChange?.(language === 'en' ? 'fr' : 'en'); }; + const { startSignIn, isLoading } = useSignIn('emailAddress', 'otp'); + const { startSignIn: startSignInOld } = useAuthWithIdentifier('emailAddress', 'otp'); + + const testSignIn = async (): Promise => { + const result = await startSignIn({ identifier: 'test@test.com' }); + // result. + }; + + const testSignInOld = async (): Promise => { + const result = await startSignInOld({ identifier: 'test@test.com' }); + // result. + }; + return ( diff --git a/src/lib/src/features/clerk/hooks/index.ts b/src/lib/src/features/clerk/hooks/index.ts index 009b8c4..a87d069 100644 --- a/src/lib/src/features/clerk/hooks/index.ts +++ b/src/lib/src/features/clerk/hooks/index.ts @@ -8,4 +8,3 @@ export * from './use-add-identifier'; export * from './use-reset-password'; export * from './use-sign-in'; export * from './use-sign-up'; -export * from './use-auth-flow'; diff --git a/src/lib/src/features/clerk/hooks/use-auth-flow.ts b/src/lib/src/features/clerk/hooks/use-auth-flow.ts deleted file mode 100644 index 22370a3..0000000 --- a/src/lib/src/features/clerk/hooks/use-auth-flow.ts +++ /dev/null @@ -1,60 +0,0 @@ -import { isClerkAPIResponseError } from '@clerk/clerk-expo'; -import { ClerkApiError } from '../enums'; // Your existing enums -import { AuthIdentifierVerifyBy, AuthIdentifierMethod, AuthResult } from '../types/shared'; -import { StartSignInParams } from '../types/sign-in'; -import { StartSignUpParams } from '../types/sign-up'; -import { useOtpVerification } from './use-otp-verification'; -import { useSignIn } from './use-sign-in'; -import { useSignUp } from './use-sign-up'; - -// Intersection of params for the auto-flow -type AuthFlowParams = StartSignUpParams & - StartSignInParams; - -export function useAuthFlow( - method: TMethod, - verifyBy: TVerifyBy, -) { - // 1. Compose the atomic hooks - const signUpHook = useSignUp(method, verifyBy); - const signInHook = useSignIn(method, verifyBy); - const { verifyCode, isVerifying } = useOtpVerification(); - - const isLoading = signUpHook.isLoading || signInHook.isLoading; - - /** - * Attempts to Sign Up. If user exists, attempts to Sign In. - */ - const startAuth = async (params: AuthFlowParams): Promise & { isSignUp?: boolean }> => { - // 1. Try Sign Up - const signUpResult = await signUpHook.startSignUp(params); - - // 2. If Sign Up failed because user exists, Try Sign In - if (signUpResult.error && isClerkAPIResponseError(signUpResult.error)) { - const error = signUpResult.error.errors[0]; - - if (error?.code === ClerkApiError.FORM_IDENTIFIER_EXIST) { - // Fallback to Sign In - // Note: We pass the same params. SignIn will ignore extra SignUp fields (like firstName) - const signInResult = await signInHook.startSignIn(params as StartSignInParams); - - return { ...signInResult, isSignUp: false }; - } - } - - // 3. Return Sign Up result (success or other error) - return { ...signUpResult, isSignUp: true }; - }; - - // Expose everything needed for the UI - return { - startAuth, - // Expose atomic methods if specific control is needed - startSignUp: signUpHook.startSignUp, - startSignIn: signInHook.startSignIn, - // Verification - verifyCode: method !== 'username' ? verifyCode : undefined, - isVerifying: method !== 'username' ? isVerifying : undefined, - isLoading, - }; -} diff --git a/src/lib/src/features/clerk/hooks/use-sign-in.ts b/src/lib/src/features/clerk/hooks/use-sign-in.ts index a3ebb00..ed5f050 100644 --- a/src/lib/src/features/clerk/hooks/use-sign-in.ts +++ b/src/lib/src/features/clerk/hooks/use-sign-in.ts @@ -6,6 +6,19 @@ import { useClerkResources } from './use-clerk-resources'; import { useGetSessionToken } from './use-get-session-token'; import { useOtpVerification } from './use-otp-verification'; +/** + * Hook that provides functionality to handle user sign-in processes using an identifier such as an email, phone number, or username. + * + * @template {AuthIdentifierVerifyBy} TVerifyBy - The verification method type + * @template {AuthIdentifierMethod} TMethod - The identifier method type + * @param {TMethod} method - Specifies the type of identifier used for authentication (e.g., 'emailAddress', 'phoneNumber', 'username') + * @param {TVerifyBy} verifyBy - Specifies the verification method ('otp' for one-time passwords or 'password') + * + * @returns {UseSignInReturn} Object containing: + * - `startSignIn` - Initiates authentication of an existing user using the specified identifier and verification method. + * - `isLoading` - Indicates whether the sign-in request is currently in progress. + * - `signIn` - The Clerk SignIn resource object, which contains the current state of the sign-in attempt. + */ export function useSignIn( method: TMethod, verifyBy: TVerifyBy, @@ -22,7 +35,7 @@ export function useSignIn} Object containing: + * - `startSignUp` - Initiates a new user registration using the specified identifier and verification method. + * - `isLoading` - Indicates whether the sign-up request is currently in progress. + * - `signUp` - The Clerk SignUp resource object, which contains the current state of the sign-up attempt. + */ export function useSignUp( method: TMethod, verifyBy: TVerifyBy, @@ -14,6 +27,7 @@ export function useSignUp): Promise> => { setIsLoading(true); @@ -27,22 +41,21 @@ export function useSignUp = (BaseSuccessReturn | BaseFailureReturn) & { // --- Param Helpers --- -export type HookManagedFields = 'identifier' | 'password' | 'emailAddress' | 'phoneNumber' | 'username'; +export type HookManagedFields = 'identifier' | 'password' | 'emailAddress' | 'phoneNumber'; /** Base parameters required for password-based auth */ export interface PasswordAuthParams { diff --git a/src/lib/src/features/clerk/types/sign-in.ts b/src/lib/src/features/clerk/types/sign-in.ts index 9b4d047..28a73a8 100644 --- a/src/lib/src/features/clerk/types/sign-in.ts +++ b/src/lib/src/features/clerk/types/sign-in.ts @@ -9,9 +9,35 @@ export type StartSignInParams = VerifyB ? OtpAuthParams & Omit : PasswordAuthParams & Omit; -/** Return type for the useSignIn hook */ +/** + * Return type for the useSignIn hook + */ export interface UseSignInReturn { - startSignIn: (params: StartSignInParams) => Promise>; + /** + * Initiates the sign-in flow using the provided parameters. + * + * Depending on the verification method: + * - **Password**: Creates a sign-in attempt with the identifier and password. + * If successful, activates the session immediately. + * - **OTP**: Creates a sign-in attempt with the identifier and initiates + * the verification flow (e.g., sends a one-time code). + * + * @param params - Parameters for authentication. + * - For `password` strategy: requires `identifier` and `password`. + * - For `otp` strategy: requires `identifier`. + * - May include native Clerk `SignInCreateParams` + * (e.g. `redirectUrl`, `tokenTemplate`). + * + * @returns A promise that resolves to the authentication result. + * - `isSuccess: true` if the attempt was created successfully. + * - `sessionToken` is present when the flow completes immediately. + * - `resource` contains the latest `SignInResource` state. + */ + startSignIn(params: StartSignInParams): Promise>; + + /** Indicates whether the sign-in operation is in progress */ isLoading: boolean; + + /** The current Clerk SignIn resource, if available */ signIn?: SignInResource; } diff --git a/src/lib/src/features/clerk/types/sign-up.ts b/src/lib/src/features/clerk/types/sign-up.ts index 211d89c..a3e5a89 100644 --- a/src/lib/src/features/clerk/types/sign-up.ts +++ b/src/lib/src/features/clerk/types/sign-up.ts @@ -3,15 +3,44 @@ import { AuthIdentifierVerifyBy, AuthResult, HookManagedFields, OtpAuthParams, P /** * Params for Sign Up. - * Combines hook requirements with native Clerk SignUpCreateParams (e.g. firstName, lastName). + * Combines hook requirements with native Clerk SignUpCreateParams + * (e.g. `firstName`, `lastName`, `unsafeMetadata`). */ export type StartSignUpParams = VerifyBy extends 'otp' ? OtpAuthParams & Omit : PasswordAuthParams & Omit; -/** Return type for the useSignUp hook */ +/** + * Return type for the useSignUp hook + */ export interface UseSignUpReturn { - startSignUp: (params: StartSignUpParams) => Promise>; + /** + * Initiates the sign-up flow using the provided parameters. + * + * Depending on the verification method: + * - **Password**: Creates a sign-up attempt with the identifier and password. + * If no additional verification is required, the session may be activated immediately. + * - **OTP**: Creates a sign-up attempt with the identifier and automatically + * triggers the verification step (e.g. sends a one-time code). + * + * @param params - Parameters for registration. + * - For `password` strategy: requires `identifier` and `password`. + * - For `otp` strategy: requires `identifier`. + * - May include native Clerk `SignUpCreateParams` + * (e.g. `firstName`, `lastName`, `unsafeMetadata`). + * - May include a `tokenTemplate` to customize the returned session token. + * + * @returns A promise that resolves to the registration result. + * - `isSuccess: true` if the sign-up attempt was created successfully. + * - `sessionToken` is present when the flow completes immediately. + * - `resource` contains the latest `SignUpResource` state + * (e.g. `missing_requirements`, `unverified`). + */ + startSignUp(params: StartSignUpParams): Promise>; + + /** Indicates whether the sign-up operation is in progress */ isLoading: boolean; + + /** The current Clerk SignUp resource, if available */ signUp?: SignUpResource; } From b9cdcfc5981e0474a3c0acbfa48396558c3dbba2 Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Wed, 21 Jan 2026 13:35:29 +0600 Subject: [PATCH 05/19] fix: revert unintentional changes --- apps/example/app/index.tsx | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/apps/example/app/index.tsx b/apps/example/app/index.tsx index 4b549f5..c49d35e 100644 --- a/apps/example/app/index.tsx +++ b/apps/example/app/index.tsx @@ -1,4 +1,3 @@ -import { useSignIn, useAuthWithIdentifier } from '@ronas-it/react-native-common-modules/clerk'; import { useTranslation } from '@ronas-it/react-native-common-modules/i18n'; import { AppSafeAreaView } from '@ronas-it/react-native-common-modules/safe-area-view'; import { ReactElement, useContext } from 'react'; @@ -15,19 +14,6 @@ export default function RootScreen(): ReactElement { onLanguageChange?.(language === 'en' ? 'fr' : 'en'); }; - const { startSignIn, isLoading } = useSignIn('emailAddress', 'otp'); - const { startSignIn: startSignInOld } = useAuthWithIdentifier('emailAddress', 'otp'); - - const testSignIn = async (): Promise => { - const result = await startSignIn({ identifier: 'test@test.com' }); - // result. - }; - - const testSignInOld = async (): Promise => { - const result = await startSignInOld({ identifier: 'test@test.com' }); - // result. - }; - return ( From 9a22787920d50af23617c7768cd3d2ea59907f71 Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Thu, 22 Jan 2026 11:08:49 +0600 Subject: [PATCH 06/19] feat: improve startSignUp params with clerk natives --- src/lib/src/features/clerk/hooks/index.ts | 2 - .../clerk/hooks/use-auth-with-identifier.ts | 3 +- .../src/features/clerk/hooks/use-sign-in.ts | 88 ------------------- .../src/features/clerk/hooks/use-sign-up.ts | 82 ----------------- src/lib/src/features/clerk/types/types.ts | 83 +++++++++++------ 5 files changed, 59 insertions(+), 199 deletions(-) delete mode 100644 src/lib/src/features/clerk/hooks/use-sign-in.ts delete mode 100644 src/lib/src/features/clerk/hooks/use-sign-up.ts diff --git a/src/lib/src/features/clerk/hooks/index.ts b/src/lib/src/features/clerk/hooks/index.ts index a87d069..7daca1b 100644 --- a/src/lib/src/features/clerk/hooks/index.ts +++ b/src/lib/src/features/clerk/hooks/index.ts @@ -6,5 +6,3 @@ export * from './use-otp-verification'; export * from './use-auth-with-identifier'; export * from './use-add-identifier'; export * from './use-reset-password'; -export * from './use-sign-in'; -export * from './use-sign-up'; diff --git a/src/lib/src/features/clerk/hooks/use-auth-with-identifier.ts b/src/lib/src/features/clerk/hooks/use-auth-with-identifier.ts index 127ab3f..d1eda5d 100644 --- a/src/lib/src/features/clerk/hooks/use-auth-with-identifier.ts +++ b/src/lib/src/features/clerk/hooks/use-auth-with-identifier.ts @@ -7,6 +7,7 @@ import { IdentifierMethodFor, StartAuthParams, StartSignInWithIdentifierReturn, + StartSignUpParams, StartSignUpWithIdentifierReturn, UseAuthWithIdentifierReturn, } from '../types'; @@ -154,7 +155,7 @@ export function useAuthWithIdentifier< const startAuthorization: UseAuthWithIdentifierReturn['startAuthorization'] = async (params) => { try { setIsLoading(true); - const result = await startSignUp(params); + const result = await startSignUp(params as StartSignUpParams); if (result?.error && isClerkAPIResponseError(result.error)) { const error = result.error.errors[0]; diff --git a/src/lib/src/features/clerk/hooks/use-sign-in.ts b/src/lib/src/features/clerk/hooks/use-sign-in.ts deleted file mode 100644 index ed5f050..0000000 --- a/src/lib/src/features/clerk/hooks/use-sign-in.ts +++ /dev/null @@ -1,88 +0,0 @@ -import { SignInResource } from '@clerk/types'; -import { useState } from 'react'; -import { AuthIdentifierVerifyBy, AuthResult, AuthIdentifierMethod } from '../types/shared'; -import { StartSignInParams, UseSignInReturn } from '../types/sign-in'; -import { useClerkResources } from './use-clerk-resources'; -import { useGetSessionToken } from './use-get-session-token'; -import { useOtpVerification } from './use-otp-verification'; - -/** - * Hook that provides functionality to handle user sign-in processes using an identifier such as an email, phone number, or username. - * - * @template {AuthIdentifierVerifyBy} TVerifyBy - The verification method type - * @template {AuthIdentifierMethod} TMethod - The identifier method type - * @param {TMethod} method - Specifies the type of identifier used for authentication (e.g., 'emailAddress', 'phoneNumber', 'username') - * @param {TVerifyBy} verifyBy - Specifies the verification method ('otp' for one-time passwords or 'password') - * - * @returns {UseSignInReturn} Object containing: - * - `startSignIn` - Initiates authentication of an existing user using the specified identifier and verification method. - * - `isLoading` - Indicates whether the sign-in request is currently in progress. - * - `signIn` - The Clerk SignIn resource object, which contains the current state of the sign-in attempt. - */ -export function useSignIn( - method: TMethod, - verifyBy: TVerifyBy, -): UseSignInReturn { - const { signIn, setActive } = useClerkResources(); - const { sendOtpCode } = useOtpVerification(); - const { getSessionToken } = useGetSessionToken(); - const [isLoading, setIsLoading] = useState(false); - - // Helper to strategy string (e.g., 'email_code') - const strategy = method === 'emailAddress' ? 'email_code' : 'phone_code'; - - const startSignIn = async (params: StartSignInParams): Promise> => { - setIsLoading(true); - - try { - const { identifier, ...rest } = params as any; - - // 1. Create the Sign In Attempt - let attempt; - - if (verifyBy === 'password') { - const { password, ...restParams } = rest; - attempt = await signIn?.create({ - identifier, - password, - ...restParams, - }); - } else { - // OTP Flow - attempt = await signIn?.create({ - identifier, - ...rest, - }); - } - - // 2. Handle OTP Sending if required - if (verifyBy === 'otp' && attempt?.status !== 'complete') { - // Some strategies might require selecting the factor first - await sendOtpCode(strategy); - } - - // 3. Handle Completion (Password flow usually completes immediately) - let sessionToken: string | undefined; - - if (attempt?.status === 'complete' && attempt.createdSessionId) { - await setActive?.({ session: attempt.createdSessionId }); - const tokenResult = await getSessionToken({ - tokenTemplate: params.tokenTemplate, - }); - sessionToken = tokenResult.sessionToken || undefined; - } - - return { - isSuccess: true, - resource: attempt, - sessionToken, - }; - } catch (error) { - return { isSuccess: false, error, resource: signIn }; - } finally { - setIsLoading(false); - } - }; - - return { startSignIn, isLoading, signIn }; -} diff --git a/src/lib/src/features/clerk/hooks/use-sign-up.ts b/src/lib/src/features/clerk/hooks/use-sign-up.ts deleted file mode 100644 index d995e1f..0000000 --- a/src/lib/src/features/clerk/hooks/use-sign-up.ts +++ /dev/null @@ -1,82 +0,0 @@ -import { SignUpResource } from '@clerk/types'; -import { useState } from 'react'; -import { AuthIdentifierVerifyBy, AuthResult, AuthIdentifierMethod } from '../types/shared'; -import { StartSignUpParams, UseSignUpReturn } from '../types/sign-up'; -import { useClerkResources } from './use-clerk-resources'; -import { useGetSessionToken } from './use-get-session-token'; - -/** - * Hook that provides functionality to handle user sign-up processes using an identifier such as an email or phone number. - * - * @template {AuthIdentifierVerifyBy} TVerifyBy - The verification method type - * @template {AuthIdentifierMethod} TMethod - The identifier method type - * @param {TMethod} method - Specifies the type of identifier used for authentication (e.g., 'emailAddress', 'phoneNumber') - * @param {TVerifyBy} verifyBy - Specifies the verification method ('otp' for one-time passwords or 'password') - * - * @returns {UseSignUpReturn} Object containing: - * - `startSignUp` - Initiates a new user registration using the specified identifier and verification method. - * - `isLoading` - Indicates whether the sign-up request is currently in progress. - * - `signUp` - The Clerk SignUp resource object, which contains the current state of the sign-up attempt. - */ -export function useSignUp( - method: TMethod, - verifyBy: TVerifyBy, -): UseSignUpReturn { - const { signUp, setActive } = useClerkResources(); - const { getSessionToken } = useGetSessionToken(); - const [isLoading, setIsLoading] = useState(false); - - const strategy = method === 'emailAddress' ? 'email_code' : 'phone_code'; - const identifierKey = method; - - const startSignUp = async (params: StartSignUpParams): Promise> => { - setIsLoading(true); - - try { - const { identifier, ...rest } = params as any; - - // 1. Create Sign Up Attempt - let attempt; - - if (verifyBy === 'password') { - const { password, ...restParams } = rest; - attempt = await signUp?.create({ - [identifierKey]: identifier, - password, - ...restParams, - }); - } else { - // OTP Flow - attempt = await signUp?.create({ - [identifierKey]: identifier, - ...rest, - }); - } - // Prepare verification (send code) - await signUp?.prepareVerification({ strategy: strategy as any }); - - // 2. Handle Completion (Password flow or if verification is skipped/optional) - let sessionToken: string | undefined; - - if (attempt?.status === 'complete' && attempt.createdSessionId) { - await setActive?.({ session: attempt.createdSessionId }); - const tokenResult = await getSessionToken({ - tokenTemplate: (params as any).tokenTemplate, - }); - sessionToken = tokenResult.sessionToken || undefined; - } - - return { - isSuccess: true, - resource: attempt, - sessionToken, - }; - } catch (error) { - return { isSuccess: false, error, resource: signUp }; - } finally { - setIsLoading(false); - } - }; - - return { startSignUp, isLoading, signUp }; -} diff --git a/src/lib/src/features/clerk/types/types.ts b/src/lib/src/features/clerk/types/types.ts index d54a4ee..0a26af4 100644 --- a/src/lib/src/features/clerk/types/types.ts +++ b/src/lib/src/features/clerk/types/types.ts @@ -6,10 +6,13 @@ import { SetActive, SignInResource, SignOut, + SignUpCreateParams, SignUpResource, UserResource, } from '@clerk/types'; +// #region --- BASE & UTILITY TYPES --- + type BaseSuccessReturn = { isSuccess: true; error?: never }; type BaseFailureReturn = { isSuccess?: false; error: ClerkAPIError | unknown }; @@ -44,6 +47,16 @@ export type OtpMethod = 'emailAddress' | 'phoneNumber'; /** Type for OTP strategies (email code or phone code) */ export type OtpStrategy = 'email_code' | 'phone_code'; +/** Type for extra params during SignUp process */ +export type SignUpParams = Pick< + SignUpCreateParams, + 'firstName' | 'lastName' | 'locale' | 'unsafeMetadata' | 'username' +>; + +// #endregion + +// #region --- CORE RESOURCES & SESSION --- + export type UseClerkResourcesReturn = WithClerkReturn & { /** A function that sets the active session */ setActive: SetActive; @@ -51,8 +64,6 @@ export type UseClerkResourcesReturn = WithClerkReturn & { signOut: SignOut; }; -// Get token types - /** * Retrieves the session token for the currently authenticated user. * @@ -72,7 +83,9 @@ export interface UseGetSessionTokenReturn { export type GetSessionTokenReturn = WithTokenSuccessReturn | WithTokenFailureReturn; -// Ticket types: +// #endregion + +// #region --- TICKET AUTHENTICATION --- export type StartAuthorizationWithTicketReturn = (WithTokenSuccessReturn | WithTokenFailureReturn) & WithSignInReturn; @@ -106,6 +119,10 @@ export interface UseAuthWithTicketReturn { isLoading: boolean; } +// #endregion + +// #region --- SSO FLOW --- + /** Parameters for SSO flow */ export interface StartSSOArgs { /** @@ -143,7 +160,9 @@ export interface UseAuthWithSSOReturn { isLoading: boolean; } -// OTP verification types: +// #endregion + +// #region --- OTP VERIFICATION --- /** Provides functionality for sending and verifying OTP (one-time password) codes using email or phone. */ export interface UseOtpVerificationReturn { @@ -152,8 +171,8 @@ export interface UseOtpVerificationReturn { * using the selected strategy. * * @param strategy - The delivery method for the OTP code. - * - `'email_code'` – send code via email - * - `'phone_code'` – send code via SMS + * - `'email_code'` – send code via email + * - `'phone_code'` – send code via SMS * * @returns A Promise that resolves once the OTP has been successfully sent, or rejects if sending fails. */ @@ -181,6 +200,10 @@ export interface UseOtpVerificationReturn { isVerifying: boolean; } +// #endregion + +// #region --- IDENTIFIER MANAGEMENT --- + /** * Return type for a hook that manages adding a new authentication identifier * (such as an email address or phone number) to the currently signed-in user's account. @@ -233,7 +256,9 @@ export interface UseAddIdentifierReturn { isVerifying: boolean; } -// Auth with identifier types: +// #endregion + +// #region --- AUTH WITH IDENTIFIER --- /** Type for authentication identifier methods */ export type AuthIdentifierMethod = 'emailAddress' | 'phoneNumber' | 'username'; @@ -310,6 +335,8 @@ export type StartAuthorizationWithIdentifierReturn = StartAuthParams & SignUpParams; + /** * Base return type for useAuthWithIdentifier hook. * @@ -325,14 +352,14 @@ interface BaseUseAuthWithIdentifierReturn) => Promise>; @@ -345,31 +372,31 @@ interface BaseUseAuthWithIdentifierReturn) => Promise>; + startSignUp: (params: StartSignUpParams) => Promise>; /** * Initiates a combined authorization flow (sign-up or sign-in) based on user existence. @@ -380,28 +407,28 @@ interface BaseUseAuthWithIdentifierReturn) => Promise>; @@ -450,7 +477,9 @@ export type UseAuthWithIdentifierReturn< Method extends AuthIdentifierMethod, > = ConditionalUseAuthWithIdentifierReturn; -//Reset password types: +// #endregion + +// #region --- PASSWORD RESET FLOW --- /** Return type for a hook that manages the password reset process. */ export interface UseResetPasswordReturn { @@ -495,3 +524,5 @@ export interface UseResetPasswordReturn { /** Indicates whether the code for password reset is currently being sent. `true` or `false` */ isCodeSending: boolean; } + +// #endregion From 73a89e239259944c40d55d64360b05baa7570029 Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Thu, 22 Jan 2026 11:14:57 +0600 Subject: [PATCH 07/19] chore: remove unused types --- apps/example/app/index.tsx | 8 ++++ src/lib/src/features/clerk/types/shared.ts | 34 --------------- src/lib/src/features/clerk/types/sign-in.ts | 43 ------------------- src/lib/src/features/clerk/types/sign-up.ts | 46 --------------------- 4 files changed, 8 insertions(+), 123 deletions(-) delete mode 100644 src/lib/src/features/clerk/types/shared.ts delete mode 100644 src/lib/src/features/clerk/types/sign-in.ts delete mode 100644 src/lib/src/features/clerk/types/sign-up.ts diff --git a/apps/example/app/index.tsx b/apps/example/app/index.tsx index c49d35e..bd0460b 100644 --- a/apps/example/app/index.tsx +++ b/apps/example/app/index.tsx @@ -1,3 +1,4 @@ +import { useAuthWithIdentifier } from '@ronas-it/react-native-common-modules/clerk'; import { useTranslation } from '@ronas-it/react-native-common-modules/i18n'; import { AppSafeAreaView } from '@ronas-it/react-native-common-modules/safe-area-view'; import { ReactElement, useContext } from 'react'; @@ -14,6 +15,13 @@ export default function RootScreen(): ReactElement { onLanguageChange?.(language === 'en' ? 'fr' : 'en'); }; + const { startAuthorization, startSignIn, startSignUp } = useAuthWithIdentifier('emailAddress', 'otp'); + + const handleAuth = (): void => { + startAuthorization({ identifier: 'fdf' }); + startSignUp({ identifier: '', firstName: 'Mikhail' }); + }; + return ( diff --git a/src/lib/src/features/clerk/types/shared.ts b/src/lib/src/features/clerk/types/shared.ts deleted file mode 100644 index 8794117..0000000 --- a/src/lib/src/features/clerk/types/shared.ts +++ /dev/null @@ -1,34 +0,0 @@ -import { ClerkAPIError } from '@clerk/types'; - -// --- Configuration Types --- - -export type AuthIdentifierMethod = 'emailAddress' | 'phoneNumber'; -export type AuthIdentifierVerifyBy = 'otp' | 'password'; - -// --- Return Types --- - -export type BaseSuccessReturn = { isSuccess: true; error?: never }; -export type BaseFailureReturn = { isSuccess: false; error: ClerkAPIError | unknown }; - -export type WithSessionToken = { sessionToken?: string }; - -export type AuthResult = (BaseSuccessReturn | BaseFailureReturn) & { - resource?: Resource; // The SignIn or SignUp object -} & WithSessionToken; - -// --- Param Helpers --- - -export type HookManagedFields = 'identifier' | 'password' | 'emailAddress' | 'phoneNumber'; - -/** Base parameters required for password-based auth */ -export interface PasswordAuthParams { - identifier: string; - password: string; - tokenTemplate?: string; -} - -/** Base parameters required for OTP-based auth */ -export interface OtpAuthParams { - identifier: string; - tokenTemplate?: string; -} diff --git a/src/lib/src/features/clerk/types/sign-in.ts b/src/lib/src/features/clerk/types/sign-in.ts deleted file mode 100644 index 28a73a8..0000000 --- a/src/lib/src/features/clerk/types/sign-in.ts +++ /dev/null @@ -1,43 +0,0 @@ -import { SignInCreateParams, SignInResource } from '@clerk/types'; -import { AuthIdentifierVerifyBy, AuthResult, HookManagedFields, OtpAuthParams, PasswordAuthParams } from './shared'; - -/** - * Params for Sign In. - * Combines hook requirements (identifier/password) with native Clerk SignInCreateParams. - */ -export type StartSignInParams = VerifyBy extends 'otp' - ? OtpAuthParams & Omit - : PasswordAuthParams & Omit; - -/** - * Return type for the useSignIn hook - */ -export interface UseSignInReturn { - /** - * Initiates the sign-in flow using the provided parameters. - * - * Depending on the verification method: - * - **Password**: Creates a sign-in attempt with the identifier and password. - * If successful, activates the session immediately. - * - **OTP**: Creates a sign-in attempt with the identifier and initiates - * the verification flow (e.g., sends a one-time code). - * - * @param params - Parameters for authentication. - * - For `password` strategy: requires `identifier` and `password`. - * - For `otp` strategy: requires `identifier`. - * - May include native Clerk `SignInCreateParams` - * (e.g. `redirectUrl`, `tokenTemplate`). - * - * @returns A promise that resolves to the authentication result. - * - `isSuccess: true` if the attempt was created successfully. - * - `sessionToken` is present when the flow completes immediately. - * - `resource` contains the latest `SignInResource` state. - */ - startSignIn(params: StartSignInParams): Promise>; - - /** Indicates whether the sign-in operation is in progress */ - isLoading: boolean; - - /** The current Clerk SignIn resource, if available */ - signIn?: SignInResource; -} diff --git a/src/lib/src/features/clerk/types/sign-up.ts b/src/lib/src/features/clerk/types/sign-up.ts deleted file mode 100644 index a3e5a89..0000000 --- a/src/lib/src/features/clerk/types/sign-up.ts +++ /dev/null @@ -1,46 +0,0 @@ -import { SignUpCreateParams, SignUpResource } from '@clerk/types'; -import { AuthIdentifierVerifyBy, AuthResult, HookManagedFields, OtpAuthParams, PasswordAuthParams } from './shared'; - -/** - * Params for Sign Up. - * Combines hook requirements with native Clerk SignUpCreateParams - * (e.g. `firstName`, `lastName`, `unsafeMetadata`). - */ -export type StartSignUpParams = VerifyBy extends 'otp' - ? OtpAuthParams & Omit - : PasswordAuthParams & Omit; - -/** - * Return type for the useSignUp hook - */ -export interface UseSignUpReturn { - /** - * Initiates the sign-up flow using the provided parameters. - * - * Depending on the verification method: - * - **Password**: Creates a sign-up attempt with the identifier and password. - * If no additional verification is required, the session may be activated immediately. - * - **OTP**: Creates a sign-up attempt with the identifier and automatically - * triggers the verification step (e.g. sends a one-time code). - * - * @param params - Parameters for registration. - * - For `password` strategy: requires `identifier` and `password`. - * - For `otp` strategy: requires `identifier`. - * - May include native Clerk `SignUpCreateParams` - * (e.g. `firstName`, `lastName`, `unsafeMetadata`). - * - May include a `tokenTemplate` to customize the returned session token. - * - * @returns A promise that resolves to the registration result. - * - `isSuccess: true` if the sign-up attempt was created successfully. - * - `sessionToken` is present when the flow completes immediately. - * - `resource` contains the latest `SignUpResource` state - * (e.g. `missing_requirements`, `unverified`). - */ - startSignUp(params: StartSignUpParams): Promise>; - - /** Indicates whether the sign-up operation is in progress */ - isLoading: boolean; - - /** The current Clerk SignUp resource, if available */ - signUp?: SignUpResource; -} From cb5deba757236b2937ad61606b9301db9bf3eb74 Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Thu, 22 Jan 2026 11:15:55 +0600 Subject: [PATCH 08/19] fix: minor fix --- apps/example/app/index.tsx | 8 -------- 1 file changed, 8 deletions(-) diff --git a/apps/example/app/index.tsx b/apps/example/app/index.tsx index bd0460b..c49d35e 100644 --- a/apps/example/app/index.tsx +++ b/apps/example/app/index.tsx @@ -1,4 +1,3 @@ -import { useAuthWithIdentifier } from '@ronas-it/react-native-common-modules/clerk'; import { useTranslation } from '@ronas-it/react-native-common-modules/i18n'; import { AppSafeAreaView } from '@ronas-it/react-native-common-modules/safe-area-view'; import { ReactElement, useContext } from 'react'; @@ -15,13 +14,6 @@ export default function RootScreen(): ReactElement { onLanguageChange?.(language === 'en' ? 'fr' : 'en'); }; - const { startAuthorization, startSignIn, startSignUp } = useAuthWithIdentifier('emailAddress', 'otp'); - - const handleAuth = (): void => { - startAuthorization({ identifier: 'fdf' }); - startSignUp({ identifier: '', firstName: 'Mikhail' }); - }; - return ( From ac95d941fb4a028030eb5e8496615454046f5702 Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Thu, 22 Jan 2026 11:22:11 +0600 Subject: [PATCH 09/19] chore: fix clerk examples --- src/lib/src/features/clerk/types/types.ts | 34 +++++++++++------------ 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/lib/src/features/clerk/types/types.ts b/src/lib/src/features/clerk/types/types.ts index 0a26af4..8f27a06 100644 --- a/src/lib/src/features/clerk/types/types.ts +++ b/src/lib/src/features/clerk/types/types.ts @@ -352,14 +352,14 @@ interface BaseUseAuthWithIdentifierReturn) => Promise>; @@ -372,28 +372,28 @@ interface BaseUseAuthWithIdentifierReturn) => Promise>; @@ -407,28 +407,28 @@ interface BaseUseAuthWithIdentifierReturn) => Promise>; From de4efe33d47e03486d56d4339fe47af06ab3089e Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Thu, 22 Jan 2026 14:09:19 +0600 Subject: [PATCH 10/19] feat: enhance authorization flow and loading state management in useAuthWithIdentifier --- .../clerk/hooks/use-auth-with-identifier.ts | 24 ++++++++++++++----- .../clerk/hooks/use-otp-verification.ts | 5 ++-- 2 files changed, 21 insertions(+), 8 deletions(-) diff --git a/src/lib/src/features/clerk/hooks/use-auth-with-identifier.ts b/src/lib/src/features/clerk/hooks/use-auth-with-identifier.ts index d1eda5d..b61fbb1 100644 --- a/src/lib/src/features/clerk/hooks/use-auth-with-identifier.ts +++ b/src/lib/src/features/clerk/hooks/use-auth-with-identifier.ts @@ -38,6 +38,8 @@ export function useAuthWithIdentifier< const { signUp, signIn, setActive } = useClerkResources(); const { sendOtpCode, verifyCode: verifyOtpCode, isVerifying } = useOtpVerification(); const { getSessionToken } = useGetSessionToken(); + + const [isAuthorizing, setIsAuthorizing] = useState(false); const [isLoading, setIsLoading] = useState(false); const strategy = method === 'emailAddress' ? 'email_code' : 'phone_code'; @@ -78,6 +80,7 @@ export function useAuthWithIdentifier< ): Promise | StartSignUpWithIdentifierReturn> => { const { identifier, password, tokenTemplate } = params; const authMethod = isSignUp ? signUp : signIn; + const authAttempt = await authMethod?.create({ username: identifier, password }); if (authAttempt?.status === 'complete' && 'createdSessionId' in authAttempt) { @@ -154,14 +157,17 @@ export function useAuthWithIdentifier< const startAuthorization: UseAuthWithIdentifierReturn['startAuthorization'] = async (params) => { try { - setIsLoading(true); + setIsAuthorizing(true); + const result = await startSignUp(params as StartSignUpParams); if (result?.error && isClerkAPIResponseError(result.error)) { const error = result.error.errors[0]; if (error?.code === ClerkApiError.FORM_IDENTIFIER_EXIST) { - return await startSignIn(params); + const signInResult = await startSignIn(params); + + return { ...signInResult, isSignUp: false }; } } @@ -169,12 +175,18 @@ export function useAuthWithIdentifier< } catch (error) { return { error, signIn, signUp, isSuccess: false } as StartSignInWithIdentifierReturn; } finally { - setIsLoading(false); + setIsAuthorizing(false); } }; const verifyCode = async ({ code, tokenTemplate }: { code: string; tokenTemplate?: string }) => { - return verifyOtpCode({ code, strategy, tokenTemplate }); + setIsLoading(true); + + try { + return await verifyOtpCode({ code, strategy, tokenTemplate }); + } finally { + setIsLoading(false); + } }; if (method === 'username') { @@ -182,14 +194,14 @@ export function useAuthWithIdentifier< startSignIn, startSignUp, startAuthorization, - isLoading, + isLoading: isAuthorizing || isLoading, } as UseAuthWithIdentifierReturn; } else { return { startSignIn, startSignUp, startAuthorization, - isLoading, + isLoading: isAuthorizing || isLoading, verifyCode, isVerifying, } as UseAuthWithIdentifierReturn; diff --git a/src/lib/src/features/clerk/hooks/use-otp-verification.ts b/src/lib/src/features/clerk/hooks/use-otp-verification.ts index 4b9a6a1..697c763 100644 --- a/src/lib/src/features/clerk/hooks/use-otp-verification.ts +++ b/src/lib/src/features/clerk/hooks/use-otp-verification.ts @@ -43,7 +43,7 @@ export function useOtpVerification(): UseOtpVerificationReturn { }; const sendOtpCode: UseOtpVerificationReturn['sendOtpCode'] = async (strategy) => { - const isSignIn = !!signIn?.id; + const isSignIn = !!signIn?.id && !!signIn.identifier; if (isSignIn) { await sendSignInOtpCode(strategy); @@ -55,7 +55,8 @@ export function useOtpVerification(): UseOtpVerificationReturn { const verifyCode: UseOtpVerificationReturn['verifyCode'] = async ({ code, strategy, tokenTemplate }) => { try { setIsVerifying(true); - const isSignIn = !!signIn?.id; + + const isSignIn = !!signIn?.id && !!signIn.identifier; if (isSignIn) { const completeSignIn = await signIn.attemptFirstFactor({ From 9f6fc76a55d2b849e6b11405071e4c50012ae088 Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Thu, 22 Jan 2026 16:49:33 +0600 Subject: [PATCH 11/19] feat: add useUpdatePassword hook and update types for password management --- src/lib/src/features/clerk/hooks/index.ts | 1 + .../clerk/hooks/use-update-password.ts | 26 +++++++++++++++++++ src/lib/src/features/clerk/types/types.ts | 17 +++++++++++- 3 files changed, 43 insertions(+), 1 deletion(-) create mode 100644 src/lib/src/features/clerk/hooks/use-update-password.ts diff --git a/src/lib/src/features/clerk/hooks/index.ts b/src/lib/src/features/clerk/hooks/index.ts index 7daca1b..a8fd09d 100644 --- a/src/lib/src/features/clerk/hooks/index.ts +++ b/src/lib/src/features/clerk/hooks/index.ts @@ -6,3 +6,4 @@ export * from './use-otp-verification'; export * from './use-auth-with-identifier'; export * from './use-add-identifier'; export * from './use-reset-password'; +export * from './use-update-password'; diff --git a/src/lib/src/features/clerk/hooks/use-update-password.ts b/src/lib/src/features/clerk/hooks/use-update-password.ts new file mode 100644 index 0000000..24e36ab --- /dev/null +++ b/src/lib/src/features/clerk/hooks/use-update-password.ts @@ -0,0 +1,26 @@ +import { useUser } from '@clerk/clerk-expo'; +import { useState } from 'react'; +import { useUpdatePasswordReturn } from '../types'; + +export const useChangePassword = (): useUpdatePasswordReturn => { + const { user } = useUser(); + const [isPasswordUpdating, setIsPasswordUpdating] = useState(false); + + const updatePassword: useUpdatePasswordReturn['updatePassword'] = async (params) => { + const { newPassword, currentPassword } = params; + + try { + setIsPasswordUpdating(true); + + await user?.updatePassword({ newPassword, currentPassword }); + + return { isSuccess: true }; + } catch (error) { + return { isSuccess: false, error }; + } finally { + setIsPasswordUpdating(false); + } + }; + + return { updatePassword, isPasswordUpdating }; +}; diff --git a/src/lib/src/features/clerk/types/types.ts b/src/lib/src/features/clerk/types/types.ts index 8f27a06..991695b 100644 --- a/src/lib/src/features/clerk/types/types.ts +++ b/src/lib/src/features/clerk/types/types.ts @@ -8,6 +8,7 @@ import { SignOut, SignUpCreateParams, SignUpResource, + UpdateUserPasswordParams, UserResource, } from '@clerk/types'; @@ -479,7 +480,7 @@ export type UseAuthWithIdentifierReturn< // #endregion -// #region --- PASSWORD RESET FLOW --- +// #region --- PASSWORD FLOW --- /** Return type for a hook that manages the password reset process. */ export interface UseResetPasswordReturn { @@ -525,4 +526,18 @@ export interface UseResetPasswordReturn { isCodeSending: boolean; } +export interface useUpdatePasswordReturn { + /** + * Initiates the password reset process for the given identifier. + * + * @returns A Promise resolving to a result object: + * - On success: `BaseSuccessReturn` with sign-in context via `WithSignInReturn`. + * - On failure: `BaseFailureReturn` with possible error information. + */ + updatePassword: (params: UpdateUserPasswordParams) => Promise; + + /** Indicates whether the code for password reset is currently being sent. `true` or `false` */ + isPasswordUpdating: boolean; +} + // #endregion From b0dbcd24c33c6f0404dadd51f225a8bce4ebf92c Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Mon, 26 Jan 2026 12:32:53 +0600 Subject: [PATCH 12/19] feat: add use-update-identifier hook and enhance use-add-identifier with identifier type parameter --- src/lib/src/features/clerk/hooks/index.ts | 1 + .../clerk/hooks/use-add-identifier.ts | 9 +- .../clerk/hooks/use-update-identifier.ts | 118 ++++++++++++++++++ src/lib/src/features/clerk/types/types.ts | 11 ++ 4 files changed, 136 insertions(+), 3 deletions(-) create mode 100644 src/lib/src/features/clerk/hooks/use-update-identifier.ts diff --git a/src/lib/src/features/clerk/hooks/index.ts b/src/lib/src/features/clerk/hooks/index.ts index 7daca1b..df461e6 100644 --- a/src/lib/src/features/clerk/hooks/index.ts +++ b/src/lib/src/features/clerk/hooks/index.ts @@ -6,3 +6,4 @@ export * from './use-otp-verification'; export * from './use-auth-with-identifier'; export * from './use-add-identifier'; export * from './use-reset-password'; +export * from './use-update-identifier'; diff --git a/src/lib/src/features/clerk/hooks/use-add-identifier.ts b/src/lib/src/features/clerk/hooks/use-add-identifier.ts index 3f8236a..1011041 100644 --- a/src/lib/src/features/clerk/hooks/use-add-identifier.ts +++ b/src/lib/src/features/clerk/hooks/use-add-identifier.ts @@ -2,26 +2,29 @@ import { isClerkAPIResponseError, useUser } from '@clerk/clerk-expo'; import { EmailAddressResource, PhoneNumberResource } from '@clerk/types'; import { useState } from 'react'; import { ClerkApiError } from '../enums'; -import { UseAddIdentifierReturn } from '../types'; +import { IdentifierType, UseAddIdentifierReturn } from '../types'; /** * Hook that provides functionality to add new email or phone number identifiers to a user's account and verify them using verification codes. * + * @param {IdentifierType} type - Specifies the type of identifier (e.g., 'phone', 'email') + * * @returns {UseAddIdentifierReturn} Object containing: * - `createIdentifier` - A function to add a new email or phone number identifier to the user's account and prepare it for verification * - `verifyCode` - A function to verify a code sent to the identifier, completing the verification process * - `isCreating` - A boolean indicating whether an identifier is currently being added * - `isVerifying` - A boolean indicating whether a verification code is currently being processed */ -export function useAddIdentifier(): UseAddIdentifierReturn { +export function useAddIdentifier(type: IdentifierType): UseAddIdentifierReturn { const { user } = useUser(); const [identifierResource, setIdentifierResource] = useState(); const [isCreating, setIsCreating] = useState(false); const [isVerifying, setIsVerifying] = useState(false); + const isEmail = type === 'email'; + const createIdentifier: UseAddIdentifierReturn['createIdentifier'] = async ({ identifier }) => { setIsCreating(true); - const isEmail = identifier?.includes('@'); try { isEmail diff --git a/src/lib/src/features/clerk/hooks/use-update-identifier.ts b/src/lib/src/features/clerk/hooks/use-update-identifier.ts new file mode 100644 index 0000000..d6e3490 --- /dev/null +++ b/src/lib/src/features/clerk/hooks/use-update-identifier.ts @@ -0,0 +1,118 @@ +import { useUser } from '@clerk/clerk-expo'; +import { EmailAddressResource, PhoneNumberResource } from '@clerk/types'; +import { useRef, useState } from 'react'; +import { IdentifierType, UseUpdateIdentifierReturn } from '../types'; +import { useAddIdentifier } from './use-add-identifier'; + +/** + * Hook that provides functionality to update an existing primary identifier + * (email address or phone number) for the current user. + * + * This hook is a higher-level abstraction built on top of `useAddIdentifier`. + * It reuses the identifier creation and verification flow, but extends it with + * additional logic that, upon successful verification, automatically: + * + * - Sets the newly verified identifier as the primary one + * - Removes the previously primary identifier (if different) + * + * The update process follows these stages: + * 1. `createIdentifier` — adds a new identifier and initiates its verification flow + * 2. `verifyCode` — verifies the received code and, if successful, updates the + * user's primary identifier + * + * All method signatures and return types are inherited from + * `useUpdateIdentifier`, ensuring full compatibility with `useAddIdentifier`. + * + * @param {IdentifierType} type - Specifies the type of identifier (e.g., 'phone', 'email') + * + * @returns {UseUpdateIdentifierReturn} Object containing: + * - `createIdentifier` — Adds a new email or phone identifier and prepares it for verification + * - `verifyCode` — Verifies the code sent to the identifier and, on success, + * updates the user's primary identifier + * - `isCreating` — Indicates whether an identifier is currently being added + * - `isVerifying` — Indicates whether a verification request is currently being processed + * - `isUpdating` — Indicates whether the primary identifier update is currently in progress + */ +export function useUpdateIdentifier(type: IdentifierType): UseUpdateIdentifierReturn { + const { user } = useUser(); + const isEmail = type === 'email'; + + const { + createIdentifier: addIdentifier, + verifyCode: verifyAddIdentifierCode, + isCreating, + isVerifying, + } = useAddIdentifier(type); + + const pendingIdentifier = useRef(null); + const [isUpdating, setIsUpdating] = useState(false); + + const getIdentifierResource = (): EmailAddressResource | PhoneNumberResource | undefined => { + if (!pendingIdentifier.current) return; + + return isEmail + ? user?.emailAddresses?.find((a) => a.emailAddress === pendingIdentifier.current) + : user?.phoneNumbers?.find((a) => a.phoneNumber === pendingIdentifier.current); + }; + + const swapPrimaryIdentifier = async () => { + const newResource = getIdentifierResource(); + + if (!newResource || newResource.verification?.status !== 'verified') { + throw new Error('Identifier not found or not verified'); + } + + const currentPrimaryId = isEmail ? user?.primaryEmailAddressId : user?.primaryPhoneNumberId; + + const resources = isEmail ? user?.emailAddresses : user?.phoneNumbers; + const oldPrimaryResource = resources?.find((r) => r.id === currentPrimaryId); + + if (isEmail) { + await user?.update({ primaryEmailAddressId: newResource.id }); + } else { + await user?.update({ primaryPhoneNumberId: newResource.id }); + } + + if (oldPrimaryResource && oldPrimaryResource.id !== newResource.id) { + await oldPrimaryResource.destroy(); + } + + await user?.reload(); + }; + + const createIdentifier: UseUpdateIdentifierReturn['createIdentifier'] = async ({ identifier }) => { + pendingIdentifier.current = identifier; + + return addIdentifier({ identifier }); + }; + + const verifyCode: UseUpdateIdentifierReturn['verifyCode'] = async ({ code }) => { + setIsUpdating(true); + + const result = await verifyAddIdentifierCode({ code }); + + if (!result.isSuccess) { + setIsUpdating(false); + + return result; + } + + try { + await swapPrimaryIdentifier(); + + return { isSuccess: true, user }; + } catch (error) { + return { isSuccess: false, error, user }; + } finally { + setIsUpdating(false); + } + }; + + return { + createIdentifier, + verifyCode, + isCreating, + isVerifying, + isUpdating, + } satisfies UseUpdateIdentifierReturn; +} diff --git a/src/lib/src/features/clerk/types/types.ts b/src/lib/src/features/clerk/types/types.ts index 8f27a06..54e9bfc 100644 --- a/src/lib/src/features/clerk/types/types.ts +++ b/src/lib/src/features/clerk/types/types.ts @@ -204,6 +204,8 @@ export interface UseOtpVerificationReturn { // #region --- IDENTIFIER MANAGEMENT --- +export type IdentifierType = 'email' | 'phone'; + /** * Return type for a hook that manages adding a new authentication identifier * (such as an email address or phone number) to the currently signed-in user's account. @@ -256,6 +258,15 @@ export interface UseAddIdentifierReturn { isVerifying: boolean; } +/** + * Return type for a hook that manages updating a new authentication identifier + * (such as an email address or phone number) to the currently signed-in user's account. + */ +export interface UseUpdateIdentifierReturn extends UseAddIdentifierReturn { + /** Indicates whether a update identifier request is currently being processed. `true` or `false` */ + isUpdating: boolean; +} + // #endregion // #region --- AUTH WITH IDENTIFIER --- From cd3d1f98ef07ab29444325dfcb3f671a420647c2 Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Mon, 26 Jan 2026 14:00:57 +0600 Subject: [PATCH 13/19] fix: force reload user model after adding new identifier --- src/lib/src/features/clerk/hooks/use-update-identifier.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/lib/src/features/clerk/hooks/use-update-identifier.ts b/src/lib/src/features/clerk/hooks/use-update-identifier.ts index d6e3490..5aaf253 100644 --- a/src/lib/src/features/clerk/hooks/use-update-identifier.ts +++ b/src/lib/src/features/clerk/hooks/use-update-identifier.ts @@ -91,6 +91,9 @@ export function useUpdateIdentifier(type: IdentifierType): UseUpdateIdentifierRe const result = await verifyAddIdentifierCode({ code }); + // Important to reload user model after adding new fields + await user?.reload(); + if (!result.isSuccess) { setIsUpdating(false); From 3ce12dbdc76731f05d96a6572380d776c267918a Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Wed, 28 Jan 2026 12:04:52 +0600 Subject: [PATCH 14/19] feat: enhance useAddIdentifier and useUpdateIdentifier hooks for better identifier management and verification flow --- .../clerk/hooks/use-add-identifier.ts | 44 +++++++------------ .../clerk/hooks/use-update-identifier.ts | 32 ++++---------- src/lib/src/features/clerk/types/types.ts | 24 +++++++++- 3 files changed, 49 insertions(+), 51 deletions(-) diff --git a/src/lib/src/features/clerk/hooks/use-add-identifier.ts b/src/lib/src/features/clerk/hooks/use-add-identifier.ts index 1011041..2901880 100644 --- a/src/lib/src/features/clerk/hooks/use-add-identifier.ts +++ b/src/lib/src/features/clerk/hooks/use-add-identifier.ts @@ -1,7 +1,6 @@ import { isClerkAPIResponseError, useUser } from '@clerk/clerk-expo'; import { EmailAddressResource, PhoneNumberResource } from '@clerk/types'; import { useState } from 'react'; -import { ClerkApiError } from '../enums'; import { IdentifierType, UseAddIdentifierReturn } from '../types'; /** @@ -27,31 +26,30 @@ export function useAddIdentifier(type: IdentifierType): UseAddIdentifierReturn { setIsCreating(true); try { - isEmail - ? await user?.createEmailAddress({ email: identifier }) - : await user?.createPhoneNumber({ phoneNumber: identifier }); - - await user?.reload(); + let resource = isEmail + ? user?.emailAddresses.find((a) => a.emailAddress === identifier) + : user?.phoneNumbers.find((a) => a.phoneNumber === identifier); + + // If the resource already exists, re-creating it will cause an error, + // so skip the creation step and go to the send verification code flow. + if (!resource) { + resource = isEmail + ? await user?.createEmailAddress({ email: identifier }) + : await user?.createPhoneNumber({ phoneNumber: identifier }); + + await user?.reload(); + } + await prepareVerification({ isEmail, identifier }); - await prepareVerification({ identifier, isEmail }); + setIdentifierResource(resource); return { isSuccess: true, user }; } catch (e) { if (isClerkAPIResponseError(e)) { - const error = e.errors[0]; - - if (error?.code === ClerkApiError.FORM_IDENTIFIER_EXIST && !getIdentifierVerified({ identifier, isEmail })) { - await prepareVerification({ identifier, isEmail }); - - await user?.reload(); - - return { isSuccess: true, user }; - } else { - return { error: e, user }; - } + return { error: e, user }; } - return { user, isSuccess: false }; + return { isSuccess: false, user }; } finally { setIsCreating(false); } @@ -85,13 +83,5 @@ export function useAddIdentifier(type: IdentifierType): UseAddIdentifierReturn { setIdentifierResource(isEmail ? emailResource : phoneResource); }; - const getIdentifierVerified = ({ identifier, isEmail }: { identifier: string; isEmail: boolean }): boolean => { - const identifierResource = isEmail - ? user?.emailAddresses?.find((a) => a.emailAddress === identifier) - : user?.phoneNumbers?.find((a) => a.phoneNumber === identifier); - - return identifierResource?.verification?.status === 'verified'; - }; - return { createIdentifier, verifyCode, isCreating, isVerifying }; } diff --git a/src/lib/src/features/clerk/hooks/use-update-identifier.ts b/src/lib/src/features/clerk/hooks/use-update-identifier.ts index 5aaf253..7f5dbfb 100644 --- a/src/lib/src/features/clerk/hooks/use-update-identifier.ts +++ b/src/lib/src/features/clerk/hooks/use-update-identifier.ts @@ -1,6 +1,6 @@ import { useUser } from '@clerk/clerk-expo'; import { EmailAddressResource, PhoneNumberResource } from '@clerk/types'; -import { useRef, useState } from 'react'; +import { useState } from 'react'; import { IdentifierType, UseUpdateIdentifierReturn } from '../types'; import { useAddIdentifier } from './use-add-identifier'; @@ -37,26 +37,18 @@ export function useUpdateIdentifier(type: IdentifierType): UseUpdateIdentifierRe const { user } = useUser(); const isEmail = type === 'email'; - const { - createIdentifier: addIdentifier, - verifyCode: verifyAddIdentifierCode, - isCreating, - isVerifying, - } = useAddIdentifier(type); + const { createIdentifier, verifyCode: verifyAddIdentifierCode, isCreating, isVerifying } = useAddIdentifier(type); - const pendingIdentifier = useRef(null); const [isUpdating, setIsUpdating] = useState(false); - const getIdentifierResource = (): EmailAddressResource | PhoneNumberResource | undefined => { - if (!pendingIdentifier.current) return; - + const getIdentifierResource = (identifier: string): EmailAddressResource | PhoneNumberResource | undefined => { return isEmail - ? user?.emailAddresses?.find((a) => a.emailAddress === pendingIdentifier.current) - : user?.phoneNumbers?.find((a) => a.phoneNumber === pendingIdentifier.current); + ? user?.emailAddresses?.find((a) => a.emailAddress === identifier) + : user?.phoneNumbers?.find((a) => a.phoneNumber === identifier); }; - const swapPrimaryIdentifier = async () => { - const newResource = getIdentifierResource(); + const swapPrimaryIdentifier = async (identifier: string) => { + const newResource = getIdentifierResource(identifier); if (!newResource || newResource.verification?.status !== 'verified') { throw new Error('Identifier not found or not verified'); @@ -80,13 +72,7 @@ export function useUpdateIdentifier(type: IdentifierType): UseUpdateIdentifierRe await user?.reload(); }; - const createIdentifier: UseUpdateIdentifierReturn['createIdentifier'] = async ({ identifier }) => { - pendingIdentifier.current = identifier; - - return addIdentifier({ identifier }); - }; - - const verifyCode: UseUpdateIdentifierReturn['verifyCode'] = async ({ code }) => { + const verifyCode: UseUpdateIdentifierReturn['verifyCode'] = async ({ code, identifier }) => { setIsUpdating(true); const result = await verifyAddIdentifierCode({ code }); @@ -101,7 +87,7 @@ export function useUpdateIdentifier(type: IdentifierType): UseUpdateIdentifierRe } try { - await swapPrimaryIdentifier(); + await swapPrimaryIdentifier(identifier); return { isSuccess: true, user }; } catch (error) { diff --git a/src/lib/src/features/clerk/types/types.ts b/src/lib/src/features/clerk/types/types.ts index e250e6c..3880304 100644 --- a/src/lib/src/features/clerk/types/types.ts +++ b/src/lib/src/features/clerk/types/types.ts @@ -263,7 +263,29 @@ export interface UseAddIdentifierReturn { * Return type for a hook that manages updating a new authentication identifier * (such as an email address or phone number) to the currently signed-in user's account. */ -export interface UseUpdateIdentifierReturn extends UseAddIdentifierReturn { +export interface UseUpdateIdentifierReturn extends Omit { + /** + * Verifies the code and select the provided identifier as primary. + * + * @param params - Parameters for verification. + * @param params.code - The one-time code sent to the identifier. + * @param params.identifier - The one-time code sent to the identifier. + * + * @returns A Promise resolving to a result object: + * - On success: `BaseSuccessReturn` with optional `user`. + * - On failure: `BaseFailureReturn` with optional `verifyAttempt` (email or phone resource) and `user`. + */ + verifyCode: (params: { code: string; identifier: string }) => Promise< + ( + | BaseSuccessReturn + | (BaseFailureReturn & { + verifyAttempt?: PhoneNumberResource | EmailAddressResource; + }) + ) & { + user?: UserResource | null; + } + >; + /** Indicates whether a update identifier request is currently being processed. `true` or `false` */ isUpdating: boolean; } From 04d46a14e1bc03d6908bc6cab353c7878e9bc625 Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Thu, 29 Jan 2026 19:45:16 +0600 Subject: [PATCH 15/19] docs: update documentation for use-update-identifier hook to clarify method signature inheritance from useAddIdentifier --- src/lib/src/features/clerk/hooks/use-update-identifier.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/src/features/clerk/hooks/use-update-identifier.ts b/src/lib/src/features/clerk/hooks/use-update-identifier.ts index 7f5dbfb..591bb49 100644 --- a/src/lib/src/features/clerk/hooks/use-update-identifier.ts +++ b/src/lib/src/features/clerk/hooks/use-update-identifier.ts @@ -20,8 +20,7 @@ import { useAddIdentifier } from './use-add-identifier'; * 2. `verifyCode` — verifies the received code and, if successful, updates the * user's primary identifier * - * All method signatures and return types are inherited from - * `useUpdateIdentifier`, ensuring full compatibility with `useAddIdentifier`. + * All basic method signatures and return types are inherited from `useAddIdentifier`, ensuring full compatibility * * @param {IdentifierType} type - Specifies the type of identifier (e.g., 'phone', 'email') * From 09226212b0fdbb5ad794cd0d4d2d886128c5b530 Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Mon, 2 Feb 2026 12:22:13 +0600 Subject: [PATCH 16/19] feat: enhance useResetPassword with verification functionality and improved type definitions --- .../clerk/hooks/use-reset-password.ts | 71 ++++++++++++++----- .../clerk/hooks/use-update-password.ts | 6 +- src/lib/src/features/clerk/types/types.ts | 27 +++++-- 3 files changed, 78 insertions(+), 26 deletions(-) diff --git a/src/lib/src/features/clerk/hooks/use-reset-password.ts b/src/lib/src/features/clerk/hooks/use-reset-password.ts index 6ee5c64..5f26440 100644 --- a/src/lib/src/features/clerk/hooks/use-reset-password.ts +++ b/src/lib/src/features/clerk/hooks/use-reset-password.ts @@ -1,7 +1,7 @@ +import { EmailCodeFactor, PhoneCodeFactor } from '@clerk/types'; import { useState } from 'react'; import { OtpMethod, UseResetPasswordReturn } from '../types'; import { useClerkResources } from './use-clerk-resources'; -import { useGetSessionToken } from './use-get-session-token'; /** * Hook that provides methods to handle password reset functionality through email or phone-based OTP. @@ -11,26 +11,46 @@ import { useGetSessionToken } from './use-get-session-token'; * * @returns {UseResetPasswordReturn} Object containing: * - `startResetPassword` - A function to initiate the password reset process by sending a verification code to the user's email or phone number - * - `resetPassword` - A function to reset the user's password by verifying the code and setting a new password + * - `resetPassword` - A function to reset the user's password and setting a new password + * - `verifyCode` - A function to verify a code sent to the identifier, completing the verification process * - `isCodeSending` - A boolean indicating if the verification code is being sent * - `isResetting` - A boolean indicating if the password is being reset + * - `isVerifying` - A boolean indicating whether a verification code is currently being processed */ export function useResetPassword({ method }: { method: OtpMethod }): UseResetPasswordReturn { - const strategy = method === 'emailAddress' ? 'reset_password_email_code' : 'reset_password_phone_code'; const { signIn, setActive } = useClerkResources(); - const { getSessionToken } = useGetSessionToken(); + const [isCodeSending, setIsCodeSending] = useState(false); + const [isVerifying, setIsVerifying] = useState(false); const [isResetting, setIsResetting] = useState(false); + const strategy = method === 'emailAddress' ? 'reset_password_email_code' : 'reset_password_phone_code'; + const startResetPassword: UseResetPasswordReturn['startResetPassword'] = async ({ identifier }) => { setIsCodeSending(true); try { - await signIn?.create({ - strategy, + const attempt = await signIn?.create({ identifier, }); + const factor = attempt?.supportedFirstFactors?.find((f) => f.strategy === strategy) as + | EmailCodeFactor + | PhoneCodeFactor + | undefined; + + if (!factor) { + throw new Error('Password reset unavailable for this method.'); + } + + const { emailAddressId, phoneNumberId } = factor as any; + + await signIn?.prepareFirstFactor({ + strategy, + emailAddressId, + phoneNumberId, + }); + return { isSuccess: true, signIn }; } catch (error) { return { isSuccess: false, signIn, error }; @@ -39,32 +59,49 @@ export function useResetPassword({ method }: { method: OtpMethod }): UseResetPas } }; - const resetPassword: UseResetPasswordReturn['resetPassword'] = async ({ code, password, tokenTemplate }) => { - setIsResetting(true); + const verifyCode: UseResetPasswordReturn['verifyCode'] = async ({ code }) => { + setIsVerifying(true); try { - const result = await signIn?.attemptFirstFactor({ + await signIn?.attemptFirstFactor({ strategy, code, + }); + + return { isSuccess: true, signIn }; + } catch (error) { + return { isSuccess: false, signIn, error }; + } finally { + setIsVerifying(false); + } + }; + + const resetPassword: UseResetPasswordReturn['resetPassword'] = async ({ password }) => { + setIsResetting(true); + + try { + const result = await signIn?.resetPassword({ password, }); if (result?.status === 'complete') { setActive({ session: result.createdSessionId }); - const { sessionToken } = await getSessionToken({ tokenTemplate }); - - if (sessionToken) { - return { isSuccess: true, signIn, sessionToken }; - } } + + return { isSuccess: true, signIn }; } catch (error) { return { isSuccess: false, signIn, error }; } finally { setIsResetting(false); } - - return { isSuccess: false, signIn }; }; - return { startResetPassword, resetPassword, isCodeSending, isResetting }; + return { + startResetPassword, + verifyCode, + resetPassword, + isCodeSending, + isVerifying, + isResetting, + }; } diff --git a/src/lib/src/features/clerk/hooks/use-update-password.ts b/src/lib/src/features/clerk/hooks/use-update-password.ts index 24e36ab..e8e8d17 100644 --- a/src/lib/src/features/clerk/hooks/use-update-password.ts +++ b/src/lib/src/features/clerk/hooks/use-update-password.ts @@ -1,12 +1,12 @@ import { useUser } from '@clerk/clerk-expo'; import { useState } from 'react'; -import { useUpdatePasswordReturn } from '../types'; +import { UseUpdatePasswordReturn } from '../types'; -export const useChangePassword = (): useUpdatePasswordReturn => { +export const useChangePassword = (): UseUpdatePasswordReturn => { const { user } = useUser(); const [isPasswordUpdating, setIsPasswordUpdating] = useState(false); - const updatePassword: useUpdatePasswordReturn['updatePassword'] = async (params) => { + const updatePassword: UseUpdatePasswordReturn['updatePassword'] = async (params) => { const { newPassword, currentPassword } = params; try { diff --git a/src/lib/src/features/clerk/types/types.ts b/src/lib/src/features/clerk/types/types.ts index 3880304..034643c 100644 --- a/src/lib/src/features/clerk/types/types.ts +++ b/src/lib/src/features/clerk/types/types.ts @@ -533,6 +533,22 @@ export interface UseResetPasswordReturn { identifier: string; }) => Promise<(BaseSuccessReturn | BaseFailureReturn) & WithSignInReturn>; + /** + * Verifies the code sent to the newly added identifier. + * + * @param params - Parameters for verification. + * @param params.code - The one-time code sent to the identifier. + * + * @returns A Promise resolving to a result object: + * - On success: `BaseSuccessReturn` with optional `user`. + * - On failure: `BaseFailureReturn` with optional `verifyAttempt` (email or phone resource) and `user`. + */ + verifyCode: (params: { code: string }) => Promise< + | BaseSuccessReturn + | (BaseFailureReturn & { + verifyAttempt?: PhoneNumberResource | EmailAddressResource; + }) + >; /** * Completes the password reset process using the provided verification code and new password. * @@ -546,20 +562,19 @@ export interface UseResetPasswordReturn { * - `sessionToken`: A session token if authentication is completed. * - `signIn` and/or `signUp`: Additional context, depending on flow state. */ - resetPassword: (params: { - code: string; - password: string; - tokenTemplate?: string; - }) => Promise; + resetPassword: (params: { password: string }) => Promise; /** Indicates whether the password reset operation is currently in progress. `true` or `false` */ isResetting: boolean; /** Indicates whether the code for password reset is currently being sent. `true` or `false` */ isCodeSending: boolean; + + /** Indicates whether a verification request is currently being processed via `verifyCode`. `true` or `false` */ + isVerifying: boolean; } -export interface useUpdatePasswordReturn { +export interface UseUpdatePasswordReturn { /** * Initiates the password reset process for the given identifier. * From d50bd6856caf96fd162f7898065fe63c379761c9 Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Mon, 2 Feb 2026 12:45:01 +0600 Subject: [PATCH 17/19] fix: minor fix --- .../clerk/hooks/use-reset-password.ts | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/src/lib/src/features/clerk/hooks/use-reset-password.ts b/src/lib/src/features/clerk/hooks/use-reset-password.ts index 5f26440..89e3217 100644 --- a/src/lib/src/features/clerk/hooks/use-reset-password.ts +++ b/src/lib/src/features/clerk/hooks/use-reset-password.ts @@ -34,22 +34,27 @@ export function useResetPassword({ method }: { method: OtpMethod }): UseResetPas identifier, }); - const factor = attempt?.supportedFirstFactors?.find((f) => f.strategy === strategy) as - | EmailCodeFactor - | PhoneCodeFactor - | undefined; + const codeFactor = attempt?.supportedFirstFactors?.find( + (factor): factor is EmailCodeFactor | PhoneCodeFactor => factor.strategy === strategy, + ); - if (!factor) { + if (!codeFactor) { throw new Error('Password reset unavailable for this method.'); } - const { emailAddressId, phoneNumberId } = factor as any; - - await signIn?.prepareFirstFactor({ - strategy, - emailAddressId, - phoneNumberId, - }); + if ('emailAddressId' in codeFactor) { + await signIn?.prepareFirstFactor({ + strategy: 'reset_password_email_code', + emailAddressId: codeFactor.emailAddressId, + }); + } else if ('phoneNumberId' in codeFactor) { + await signIn?.prepareFirstFactor({ + strategy: 'reset_password_phone_code', + phoneNumberId: codeFactor.phoneNumberId, + }); + } else { + throw new Error('No code factor found for strategy: ' + strategy); + } return { isSuccess: true, signIn }; } catch (error) { From 14cb5c225e040747ea9946bbe4ef3fc16f34c3b6 Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Mon, 2 Feb 2026 15:55:07 +0600 Subject: [PATCH 18/19] feat: extend useResetPassword to include tokenTemplate parameter and improve type safety for reset strategies --- .../clerk/hooks/use-reset-password.ts | 35 ++++++++++++++----- src/lib/src/features/clerk/types/types.ts | 8 +++-- 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/lib/src/features/clerk/hooks/use-reset-password.ts b/src/lib/src/features/clerk/hooks/use-reset-password.ts index 89e3217..e980732 100644 --- a/src/lib/src/features/clerk/hooks/use-reset-password.ts +++ b/src/lib/src/features/clerk/hooks/use-reset-password.ts @@ -1,7 +1,13 @@ -import { EmailCodeFactor, PhoneCodeFactor } from '@clerk/types'; +import { + EmailCodeFactor, + PhoneCodeFactor, + ResetPasswordEmailCodeStrategy, + ResetPasswordPhoneCodeStrategy, +} from '@clerk/types'; import { useState } from 'react'; import { OtpMethod, UseResetPasswordReturn } from '../types'; import { useClerkResources } from './use-clerk-resources'; +import { useGetSessionToken } from './use-get-session-token'; /** * Hook that provides methods to handle password reset functionality through email or phone-based OTP. @@ -19,6 +25,7 @@ import { useClerkResources } from './use-clerk-resources'; */ export function useResetPassword({ method }: { method: OtpMethod }): UseResetPasswordReturn { const { signIn, setActive } = useClerkResources(); + const { getSessionToken } = useGetSessionToken(); const [isCodeSending, setIsCodeSending] = useState(false); const [isVerifying, setIsVerifying] = useState(false); @@ -44,12 +51,12 @@ export function useResetPassword({ method }: { method: OtpMethod }): UseResetPas if ('emailAddressId' in codeFactor) { await signIn?.prepareFirstFactor({ - strategy: 'reset_password_email_code', + strategy: strategy as ResetPasswordEmailCodeStrategy, emailAddressId: codeFactor.emailAddressId, }); } else if ('phoneNumberId' in codeFactor) { await signIn?.prepareFirstFactor({ - strategy: 'reset_password_phone_code', + strategy: strategy as ResetPasswordPhoneCodeStrategy, phoneNumberId: codeFactor.phoneNumberId, }); } else { @@ -81,7 +88,7 @@ export function useResetPassword({ method }: { method: OtpMethod }): UseResetPas } }; - const resetPassword: UseResetPasswordReturn['resetPassword'] = async ({ password }) => { + const resetPassword: UseResetPasswordReturn['resetPassword'] = async ({ password, tokenTemplate }) => { setIsResetting(true); try { @@ -89,11 +96,23 @@ export function useResetPassword({ method }: { method: OtpMethod }): UseResetPas password, }); - if (result?.status === 'complete') { - setActive({ session: result.createdSessionId }); - } + await setActive({ session: result?.createdSessionId }); - return { isSuccess: true, signIn }; + const { sessionToken, error } = await getSessionToken({ tokenTemplate }); + + if (sessionToken) { + return { + isSuccess: true, + signIn, + sessionToken: sessionToken, + }; + } else { + return { + signIn, + error, + isSuccess: false, + }; + } } catch (error) { return { isSuccess: false, signIn, error }; } finally { diff --git a/src/lib/src/features/clerk/types/types.ts b/src/lib/src/features/clerk/types/types.ts index 034643c..80c105c 100644 --- a/src/lib/src/features/clerk/types/types.ts +++ b/src/lib/src/features/clerk/types/types.ts @@ -553,16 +553,18 @@ export interface UseResetPasswordReturn { * Completes the password reset process using the provided verification code and new password. * * @param params - Parameters required to reset the password. - * @param params.code - The verification code sent to the user. * @param params.password - The new password to be set. * @param params.tokenTemplate - (Optional) A token template name to use when creating the session token. * * @returns A Promise resolving to an `AuthorizationFinishedReturn`, which includes: * - `isSuccess`: Indicates whether the password reset was successful. * - `sessionToken`: A session token if authentication is completed. - * - `signIn` and/or `signUp`: Additional context, depending on flow state. */ - resetPassword: (params: { password: string }) => Promise; + resetPassword: (params: { password: string; tokenTemplate?: string }) => Promise< + StartSignInReturn & { + sessionToken?: string; + } + >; /** Indicates whether the password reset operation is currently in progress. `true` or `false` */ isResetting: boolean; From d022c2cf9ec4d18dc8288e15edfa091b8d22c01d Mon Sep 17 00:00:00 2001 From: Mikhail Leonov Date: Wed, 11 Feb 2026 13:27:56 +0600 Subject: [PATCH 19/19] fix: simplify useResetPassword by removing unnecessary code factor checks and streamlining the sign-in process --- .../clerk/hooks/use-reset-password.ts | 33 +++---------------- 1 file changed, 4 insertions(+), 29 deletions(-) diff --git a/src/lib/src/features/clerk/hooks/use-reset-password.ts b/src/lib/src/features/clerk/hooks/use-reset-password.ts index e980732..8ec6953 100644 --- a/src/lib/src/features/clerk/hooks/use-reset-password.ts +++ b/src/lib/src/features/clerk/hooks/use-reset-password.ts @@ -1,9 +1,5 @@ -import { - EmailCodeFactor, - PhoneCodeFactor, - ResetPasswordEmailCodeStrategy, - ResetPasswordPhoneCodeStrategy, -} from '@clerk/types'; + + import { useState } from 'react'; import { OtpMethod, UseResetPasswordReturn } from '../types'; import { useClerkResources } from './use-clerk-resources'; @@ -37,32 +33,11 @@ export function useResetPassword({ method }: { method: OtpMethod }): UseResetPas setIsCodeSending(true); try { - const attempt = await signIn?.create({ + await signIn?.create({ + strategy, identifier, }); - const codeFactor = attempt?.supportedFirstFactors?.find( - (factor): factor is EmailCodeFactor | PhoneCodeFactor => factor.strategy === strategy, - ); - - if (!codeFactor) { - throw new Error('Password reset unavailable for this method.'); - } - - if ('emailAddressId' in codeFactor) { - await signIn?.prepareFirstFactor({ - strategy: strategy as ResetPasswordEmailCodeStrategy, - emailAddressId: codeFactor.emailAddressId, - }); - } else if ('phoneNumberId' in codeFactor) { - await signIn?.prepareFirstFactor({ - strategy: strategy as ResetPasswordPhoneCodeStrategy, - phoneNumberId: codeFactor.phoneNumberId, - }); - } else { - throw new Error('No code factor found for strategy: ' + strategy); - } - return { isSuccess: true, signIn }; } catch (error) { return { isSuccess: false, signIn, error };