diff --git a/package-lock.json b/package-lock.json index 35a74f3a..ae557378 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1969,14 +1969,23 @@ "license": "BSD-3-Clause" }, "node_modules/@lit/reactive-element": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.0.4.tgz", - "integrity": "sha512-GFn91inaUa2oHLak8awSIigYz0cU0Payr1rcFsrkf5OJ5eSPxElyZfKh0f2p9FsTiZWXQdWGJeXZICEfXXYSXQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@lit/reactive-element/-/reactive-element-2.1.0.tgz", + "integrity": "sha512-L2qyoZSQClcBmq0qajBVbhYEcG6iK0XfLn66ifLe/RfC0/ihpc+pl0Wdn8bJ8o+hj38cG0fGXRgSS20MuXn7qA==", "license": "BSD-3-Clause", "dependencies": { "@lit-labs/ssr-dom-shim": "^1.2.0" } }, + "node_modules/@msgpack/msgpack": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/@msgpack/msgpack/-/msgpack-3.1.2.tgz", + "integrity": "sha512-JEW4DEtBzfe8HvUYecLU9e6+XJnKDlUAIve8FvPzF3Kzs6Xo/KuZkZJsDH0wJXl/qEZbeeE7edxDNY3kMs39hQ==", + "license": "ISC", + "engines": { + "node": ">= 18" + } + }, "node_modules/@next/env": { "version": "14.2.16", "resolved": "https://registry.npmjs.org/@next/env/-/env-14.2.16.tgz", @@ -2141,9 +2150,9 @@ } }, "node_modules/@noble/ciphers": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.2.1.tgz", - "integrity": "sha512-rONPWMC7PeExE077uLE4oqWrZ1IvAfz3oH9LibVAcVCopJiA9R62uavnbEzdkVmJYI6M6Zgkbeb07+tWjlq2XA==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/@noble/ciphers/-/ciphers-1.3.0.tgz", + "integrity": "sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==", "license": "MIT", "engines": { "node": "^14.21.3 || >=16" @@ -2180,9 +2189,9 @@ } }, "node_modules/@noble/hashes": { - "version": "1.7.1", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.7.1.tgz", - "integrity": "sha512-B8XBPsn4vT/KJAGqDzbwztd+6Yte3P4V7iafm24bxgDe/mlRuK6xmWPuCNrKt2vDafZ8MfJLlchDG/vYafQEjQ==", + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.8.0.tgz", + "integrity": "sha512-jCs9ldd7NwzpgXDIf6P3+NrHh9/sD6CQdxHyjQI+h/6rDNo88ypBxxz45UDuZHz9r3tNz7N/VInSVoVdtXEI4A==", "license": "MIT", "engines": { "node": "^14.21.3 || >=16" @@ -3530,46 +3539,48 @@ "license": "MIT" }, "node_modules/@reown/appkit": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/@reown/appkit/-/appkit-1.6.8.tgz", - "integrity": "sha512-GA7VZ+TZ7POVjfjWNyeffLoTIjX+iEvmRdKo9TEEvPBZ77996eiQFnhaaQHCNg1Wf9Ba/lptxVJT07gSZknh5A==", + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@reown/appkit/-/appkit-1.7.11.tgz", + "integrity": "sha512-CeEWIkD6xqSh1cmTJ9ulODC3DZmtvlnf2Jh2F5+ggoR8w3tamAuj3AW9p1PFuxgp24Umv3o2z27Ilt3h+7YEmQ==", + "hasInstallScript": true, "license": "Apache-2.0", "dependencies": { - "@reown/appkit-common": "1.6.8", - "@reown/appkit-core": "1.6.8", - "@reown/appkit-polyfills": "1.6.8", - "@reown/appkit-scaffold-ui": "1.6.8", - "@reown/appkit-ui": "1.6.8", - "@reown/appkit-utils": "1.6.8", - "@reown/appkit-wallet": "1.6.8", - "@walletconnect/types": "2.18.0", - "@walletconnect/universal-provider": "2.18.0", - "@walletconnect/utils": "2.18.0", + "@reown/appkit-common": "1.7.11", + "@reown/appkit-controllers": "1.7.11", + "@reown/appkit-pay": "1.7.11", + "@reown/appkit-polyfills": "1.7.11", + "@reown/appkit-scaffold-ui": "1.7.11", + "@reown/appkit-ui": "1.7.11", + "@reown/appkit-utils": "1.7.11", + "@reown/appkit-wallet": "1.7.11", + "@walletconnect/types": "2.21.3", + "@walletconnect/universal-provider": "2.21.3", "bs58": "6.0.0", + "semver": "7.7.2", "valtio": "1.13.2", - "viem": ">=2.23.0" + "viem": ">=2.31.3" } }, "node_modules/@reown/appkit-adapter-ethers5": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/@reown/appkit-adapter-ethers5/-/appkit-adapter-ethers5-1.6.8.tgz", - "integrity": "sha512-c9URdpm1UwO/YyBG1mJi05uRvghjGx0tYu+kBl2JzhDkvwDloBg6SxghTeRwzZBtBG1toEewWpT3U+1tt/36xg==", + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@reown/appkit-adapter-ethers5/-/appkit-adapter-ethers5-1.7.11.tgz", + "integrity": "sha512-DEOOR9gSCA180peSpYCk55/EFTZAcbLuaYsLnAQ6APhuO7lyvj88XYgTJT2K63Ulu0yam7Y6fvf5GzDrPmIQiw==", "license": "Apache-2.0", "dependencies": { - "@reown/appkit": "1.6.8", - "@reown/appkit-common": "1.6.8", - "@reown/appkit-core": "1.6.8", - "@reown/appkit-polyfills": "1.6.8", - "@reown/appkit-scaffold-ui": "1.6.8", - "@reown/appkit-ui": "1.6.8", - "@reown/appkit-utils": "1.6.8", - "@reown/appkit-wallet": "1.6.8", - "@walletconnect/universal-provider": "2.18.0", - "@walletconnect/utils": "2.18.0", + "@reown/appkit": "1.7.11", + "@reown/appkit-common": "1.7.11", + "@reown/appkit-controllers": "1.7.11", + "@reown/appkit-polyfills": "1.7.11", + "@reown/appkit-scaffold-ui": "1.7.11", + "@reown/appkit-utils": "1.7.11", + "@reown/appkit-wallet": "1.7.11", + "@walletconnect/universal-provider": "2.21.3", "valtio": "1.13.2" }, "optionalDependencies": { - "@coinbase/wallet-sdk": "4.3.0" + "@coinbase/wallet-sdk": "4.3.0", + "@safe-global/safe-apps-provider": "0.18.6", + "@safe-global/safe-apps-sdk": "9.1.0" }, "peerDependencies": { "@ethersproject/sha2": "5.7.0", @@ -3577,89 +3588,107 @@ } }, "node_modules/@reown/appkit-common": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/@reown/appkit-common/-/appkit-common-1.6.8.tgz", - "integrity": "sha512-i3J2qLC/51yhOBLAor8ToXDcD5LNiew12leWLBsnigl/N5OqhXNMxPHepC+01MYCDGDn2pOnU1ub+ES/OS6UrA==", + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@reown/appkit-common/-/appkit-common-1.7.11.tgz", + "integrity": "sha512-GLrufhNpLMwHnqK5zIf8LAtJQ1uHB8azYtG7KwFSf9L7zYe+2PkB3tTnr0oCvSLJRplcjMq6Vr0ZVlOzVgs9qw==", "license": "Apache-2.0", "dependencies": { "big.js": "6.2.2", - "dayjs": "1.11.10", - "viem": ">=2.23.0" + "dayjs": "1.11.13", + "viem": ">=2.31.3" } }, - "node_modules/@reown/appkit-core": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/@reown/appkit-core/-/appkit-core-1.6.8.tgz", - "integrity": "sha512-biFB+wiAjx0kaqqX6wNEbK1v6yVYSWdOrCk3HqjVctJwuBNBX6ZLRf6Lm7a1pUiVRVjDc88hT828WL5MhZ6zgw==", + "node_modules/@reown/appkit-controllers": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@reown/appkit-controllers/-/appkit-controllers-1.7.11.tgz", + "integrity": "sha512-D2sVqxsaqjbNIbior0L/m5vzqhp8kc+BQ09PO2l2/8X/JsoAME+DxFKOcbfKMwC2aSNkOnIdVTH/ivbknriQOA==", "license": "Apache-2.0", "dependencies": { - "@reown/appkit-common": "1.6.8", - "@reown/appkit-wallet": "1.6.8", - "@walletconnect/universal-provider": "2.18.0", + "@reown/appkit-common": "1.7.11", + "@reown/appkit-wallet": "1.7.11", + "@walletconnect/universal-provider": "2.21.3", "valtio": "1.13.2", - "viem": ">=2.23" + "viem": ">=2.31.3" + } + }, + "node_modules/@reown/appkit-pay": { + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@reown/appkit-pay/-/appkit-pay-1.7.11.tgz", + "integrity": "sha512-dunlSguhHJ5jO30pQSouWbzrihU77EMofohzK7vqfAX+tcbtTq9IyoSKXXsJdd+9AILTjG/tnfbFA3uJlyeJXQ==", + "license": "Apache-2.0", + "dependencies": { + "@reown/appkit-common": "1.7.11", + "@reown/appkit-controllers": "1.7.11", + "@reown/appkit-ui": "1.7.11", + "@reown/appkit-utils": "1.7.11", + "lit": "3.3.0", + "valtio": "1.13.2" } }, "node_modules/@reown/appkit-polyfills": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/@reown/appkit-polyfills/-/appkit-polyfills-1.6.8.tgz", - "integrity": "sha512-Iw1IEloHDlv2StRFnqZhA1/Q8DLs4OUtDBAp0AoAgDfz2EkCdUzFiC464I5xOnmSqUwyGm3dQGObBdq7aesPkA==", + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@reown/appkit-polyfills/-/appkit-polyfills-1.7.11.tgz", + "integrity": "sha512-gZ+6MZUN1PVAouyipltdaRtLMDl8tZ5kGePKn93eGG+bD6OJXFQ02co3OUSL3YtZQWiYlD51EFwCD3woyl69zg==", "license": "Apache-2.0", "dependencies": { "buffer": "6.0.3" } }, "node_modules/@reown/appkit-scaffold-ui": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/@reown/appkit-scaffold-ui/-/appkit-scaffold-ui-1.6.8.tgz", - "integrity": "sha512-5uDOmlrnBIsPZCZ1/PyIVqkxQ+n39bLtTePrWteRoIaAtGRd1TiYCpPB+HO0SdLhXn66B4YzoQMCEIrIpzFqDg==", + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@reown/appkit-scaffold-ui/-/appkit-scaffold-ui-1.7.11.tgz", + "integrity": "sha512-UMIwlUIWdNUEUzinoAdlu2q1uzvfdb/7Dhc6bTJGGK6FqlO5QPqQMOoR64j8d9OGQdSZhe6yNHOHQvMtqUnQEw==", "license": "Apache-2.0", "dependencies": { - "@reown/appkit-common": "1.6.8", - "@reown/appkit-core": "1.6.8", - "@reown/appkit-ui": "1.6.8", - "@reown/appkit-utils": "1.6.8", - "@reown/appkit-wallet": "1.6.8", - "lit": "3.1.0" + "@reown/appkit-common": "1.7.11", + "@reown/appkit-controllers": "1.7.11", + "@reown/appkit-ui": "1.7.11", + "@reown/appkit-utils": "1.7.11", + "@reown/appkit-wallet": "1.7.11", + "lit": "3.3.0" } }, "node_modules/@reown/appkit-ui": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/@reown/appkit-ui/-/appkit-ui-1.6.8.tgz", - "integrity": "sha512-UB3AaCiLRKkEI73i6LoX3rxbEUPELw/1Twdi5UlSm+IwwacGp0IAmkcRq0d9OwgTJymN6dEslUlNrH+PTpFblg==", + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@reown/appkit-ui/-/appkit-ui-1.7.11.tgz", + "integrity": "sha512-gTJ4JiYlwnGSWv0hhfClY6lk9+Ru8EZLssItz1scR5H41gNjgXEJ2/mDm1Ejpf42A9Cehgqbv8E8vqUcautY5A==", "license": "Apache-2.0", "dependencies": { - "lit": "3.1.0", + "@reown/appkit-common": "1.7.11", + "@reown/appkit-controllers": "1.7.11", + "@reown/appkit-wallet": "1.7.11", + "lit": "3.3.0", "qrcode": "1.5.3" } }, "node_modules/@reown/appkit-utils": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/@reown/appkit-utils/-/appkit-utils-1.6.8.tgz", - "integrity": "sha512-n/RLOy3a9SRcRGg3YT9p2BDdbBPBB50/mQiZ9pB19+hlO+FSikOinPSLoAtn2v4LEKCZWTTb14f3jMoa+n+djQ==", + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@reown/appkit-utils/-/appkit-utils-1.7.11.tgz", + "integrity": "sha512-hdOc1OJKH1nk6X56diAX9oDrbbo6obkTSkYA5k6JpMMJjZcOhLthXKF89PF8hjGlVDgUhL/p9UPTTTc8O5XTTg==", "license": "Apache-2.0", "dependencies": { - "@reown/appkit-common": "1.6.8", - "@reown/appkit-core": "1.6.8", - "@reown/appkit-polyfills": "1.6.8", - "@reown/appkit-wallet": "1.6.8", + "@reown/appkit-common": "1.7.11", + "@reown/appkit-controllers": "1.7.11", + "@reown/appkit-polyfills": "1.7.11", + "@reown/appkit-wallet": "1.7.11", + "@wallet-standard/wallet": "1.1.0", "@walletconnect/logger": "2.1.2", - "@walletconnect/universal-provider": "2.18.0", + "@walletconnect/universal-provider": "2.21.3", "valtio": "1.13.2", - "viem": ">=2.23.0" + "viem": ">=2.31.3" }, "peerDependencies": { "valtio": "1.13.2" } }, "node_modules/@reown/appkit-wallet": { - "version": "1.6.8", - "resolved": "https://registry.npmjs.org/@reown/appkit-wallet/-/appkit-wallet-1.6.8.tgz", - "integrity": "sha512-lYjdz8dTTIigrIyfbu2Lh1jc/YvXaZYM+vwZ8Lc9PD5e1GKZBOH8mU68EMXkoqqvLIsG1Y5aMYuBgzcGaRGuvA==", + "version": "1.7.11", + "resolved": "https://registry.npmjs.org/@reown/appkit-wallet/-/appkit-wallet-1.7.11.tgz", + "integrity": "sha512-IEdIPip8rBeU295uFv+LvJ1LdgfAK8gRwqBedvC7PuuPFPZe2HanlHT84UrPZjUpy3Xysch5x+UQeUlm+w6UZw==", "license": "Apache-2.0", "dependencies": { - "@reown/appkit-common": "1.6.8", - "@reown/appkit-polyfills": "1.6.8", + "@reown/appkit-common": "1.7.11", + "@reown/appkit-polyfills": "1.7.11", "@walletconnect/logger": "2.1.2", "zod": "3.22.4" } @@ -3673,36 +3702,68 @@ "url": "https://github.com/sponsors/colinhacks" } }, + "node_modules/@safe-global/safe-apps-provider": { + "version": "0.18.6", + "resolved": "https://registry.npmjs.org/@safe-global/safe-apps-provider/-/safe-apps-provider-0.18.6.tgz", + "integrity": "sha512-4LhMmjPWlIO8TTDC2AwLk44XKXaK6hfBTWyljDm0HQ6TWlOEijVWNrt2s3OCVMSxlXAcEzYfqyu1daHZooTC2Q==", + "license": "MIT", + "optional": true, + "dependencies": { + "@safe-global/safe-apps-sdk": "^9.1.0", + "events": "^3.3.0" + } + }, + "node_modules/@safe-global/safe-apps-sdk": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/@safe-global/safe-apps-sdk/-/safe-apps-sdk-9.1.0.tgz", + "integrity": "sha512-N5p/ulfnnA2Pi2M3YeWjULeWbjo7ei22JwU/IXnhoHzKq3pYCN6ynL9mJBOlvDVv892EgLPCWCOwQk/uBT2v0Q==", + "license": "MIT", + "optional": true, + "dependencies": { + "@safe-global/safe-gateway-typescript-sdk": "^3.5.3", + "viem": "^2.1.1" + } + }, + "node_modules/@safe-global/safe-gateway-typescript-sdk": { + "version": "3.23.1", + "resolved": "https://registry.npmjs.org/@safe-global/safe-gateway-typescript-sdk/-/safe-gateway-typescript-sdk-3.23.1.tgz", + "integrity": "sha512-6ORQfwtEJYpalCeVO21L4XXGSdbEMfyp2hEv6cP82afKXSwvse6d3sdelgaPWUxHIsFRkWvHDdzh8IyyKHZKxw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=16" + } + }, "node_modules/@scure/base": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.4.tgz", - "integrity": "sha512-5Yy9czTO47mqz+/J8GM6GIId4umdCk1wc1q8rKERQulIoc8VP9pzDcghv10Tl2E7R96ZUx/PhND3ESYUQX8NuQ==", + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.6.tgz", + "integrity": "sha512-g/nm5FgUa//MCj1gV09zTJTaM6KBAHqLN907YVQqf7zC49+DcO4B1so4ZX07Ef10Twr6nuqYEH9GEggFXA4Fmg==", "license": "MIT", "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/@scure/bip32": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.6.2.tgz", - "integrity": "sha512-t96EPDMbtGgtb7onKKqxRLfE5g05k7uHnHRM2xdE6BP/ZmxaLtPek4J4KfVn/90IQNrU1IOAqMgiDtUdtbe3nw==", + "version": "1.7.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.7.0.tgz", + "integrity": "sha512-E4FFX/N3f4B80AKWp5dP6ow+flD1LQZo/w8UnLGYZO674jS6YnYeepycOOksv+vLPSpgN35wgKgy+ybfTb2SMw==", "license": "MIT", "dependencies": { - "@noble/curves": "~1.8.1", - "@noble/hashes": "~1.7.1", - "@scure/base": "~1.2.2" + "@noble/curves": "~1.9.0", + "@noble/hashes": "~1.8.0", + "@scure/base": "~1.2.5" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/@scure/bip32/node_modules/@noble/curves": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.1.tgz", - "integrity": "sha512-warwspo+UYUPep0Q+vtdVB4Ugn8GGQj8iyB3gnRWsztmUHTI3S1nhdiWNsPUGL0vud7JlRRk1XEu7Lq1KGTnMQ==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.2.tgz", + "integrity": "sha512-HxngEd2XUcg9xi20JkwlLCtYwfoFw4JGkuZpT+WlsPD4gB/cxkvTD8fSsoAnphGZhFdZYKeQIPCuFlWPm1uE0g==", "license": "MIT", "dependencies": { - "@noble/hashes": "1.7.1" + "@noble/hashes": "1.8.0" }, "engines": { "node": "^14.21.3 || >=16" @@ -3712,13 +3773,13 @@ } }, "node_modules/@scure/bip39": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.5.4.tgz", - "integrity": "sha512-TFM4ni0vKvCfBpohoh+/lY05i9gRbSwXWngAsF4CABQxoaOHijxuaZ2R6cStDQ5CHtHO9aGJTr4ksVJASRRyMA==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.6.0.tgz", + "integrity": "sha512-+lF0BbLiJNwVlev4eKelw1WWLaiKXw7sSl8T6FvBlWkdX+94aGJ4o8XjUdlyhTCjd8c+B3KT3JfS8P0bLRNU6A==", "license": "MIT", "dependencies": { - "@noble/hashes": "~1.7.1", - "@scure/base": "~1.2.4" + "@noble/hashes": "~1.8.0", + "@scure/base": "~1.2.5" }, "funding": { "url": "https://paulmillr.com/funding/" @@ -3890,10 +3951,31 @@ "dev": true, "license": "MIT" }, + "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==", + "license": "Apache-2.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==", + "license": "Apache-2.0", + "dependencies": { + "@wallet-standard/base": "^1.1.0" + }, + "engines": { + "node": ">=16" + } + }, "node_modules/@walletconnect/core": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-2.18.0.tgz", - "integrity": "sha512-i/olu/IwYtBiWYqyfNUMxq4b6QS5dv+ZVVGmLT2buRwdH6MGETN0Bx3/z6rXJzd1sNd+QL07fxhSFxCekL57tA==", + "version": "2.21.3", + "resolved": "https://registry.npmjs.org/@walletconnect/core/-/core-2.21.3.tgz", + "integrity": "sha512-kMjo5bI6VOsFe/DmxgeTMxCdAIfSzUzG8kCDrpxUXrTnMgaU4H2JBW+tGn7KP/YY1x49+lErZsN5JiQsE5n6Rw==", "license": "Apache-2.0", "dependencies": { "@walletconnect/heartbeat": "1.2.2", @@ -3907,17 +3989,36 @@ "@walletconnect/relay-auth": "1.1.0", "@walletconnect/safe-json": "1.0.2", "@walletconnect/time": "1.0.2", - "@walletconnect/types": "2.18.0", - "@walletconnect/utils": "2.18.0", + "@walletconnect/types": "2.21.3", + "@walletconnect/utils": "2.21.3", "@walletconnect/window-getters": "1.0.1", + "es-toolkit": "1.39.3", "events": "3.3.0", - "lodash.isequal": "4.5.0", - "uint8arrays": "3.1.0" + "uint8arrays": "3.1.1" }, "engines": { "node": ">=18" } }, + "node_modules/@walletconnect/core/node_modules/@walletconnect/keyvaluestorage": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@walletconnect/keyvaluestorage/-/keyvaluestorage-1.1.1.tgz", + "integrity": "sha512-V7ZQq2+mSxAq7MrRqDxanTzu2RcElfK1PfNYiaVnJgJ7Q7G7hTVwF8voIBx92qsRyGHZihrwNPHuZd1aKkd0rA==", + "license": "MIT", + "dependencies": { + "@walletconnect/safe-json": "^1.0.1", + "idb-keyval": "^6.2.1", + "unstorage": "^1.9.0" + }, + "peerDependencies": { + "@react-native-async-storage/async-storage": "1.x" + }, + "peerDependenciesMeta": { + "@react-native-async-storage/async-storage": { + "optional": true + } + } + }, "node_modules/@walletconnect/environment": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@walletconnect/environment/-/environment-1.0.1.tgz", @@ -4004,25 +4105,6 @@ "ws": "^7.5.1" } }, - "node_modules/@walletconnect/keyvaluestorage": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@walletconnect/keyvaluestorage/-/keyvaluestorage-1.1.1.tgz", - "integrity": "sha512-V7ZQq2+mSxAq7MrRqDxanTzu2RcElfK1PfNYiaVnJgJ7Q7G7hTVwF8voIBx92qsRyGHZihrwNPHuZd1aKkd0rA==", - "license": "MIT", - "dependencies": { - "@walletconnect/safe-json": "^1.0.1", - "idb-keyval": "^6.2.1", - "unstorage": "^1.9.0" - }, - "peerDependencies": { - "@react-native-async-storage/async-storage": "1.x" - }, - "peerDependenciesMeta": { - "@react-native-async-storage/async-storage": { - "optional": true - } - } - }, "node_modules/@walletconnect/logger": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/@walletconnect/logger/-/logger-2.1.2.tgz", @@ -4077,19 +4159,19 @@ } }, "node_modules/@walletconnect/sign-client": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/@walletconnect/sign-client/-/sign-client-2.18.0.tgz", - "integrity": "sha512-oUjlRIsbHxMSRif2WvMRdvm6tMsQjMj07rl7YVcKVvZ1gF1/9GcbJPjzL/U87fv8qAQkVhIlbEg2vHaVYf6J/g==", + "version": "2.21.3", + "resolved": "https://registry.npmjs.org/@walletconnect/sign-client/-/sign-client-2.21.3.tgz", + "integrity": "sha512-Z6sTCBrset7u5CNjPWlqQuWxmLL2WlGLZYKoB7g/Nvg8wLWo0VaaNeTtNsuopLfJeqdV9/4nV/qHE4xXs2nMIQ==", "license": "Apache-2.0", "dependencies": { - "@walletconnect/core": "2.18.0", + "@walletconnect/core": "2.21.3", "@walletconnect/events": "1.0.1", "@walletconnect/heartbeat": "1.2.2", "@walletconnect/jsonrpc-utils": "1.0.8", "@walletconnect/logger": "2.1.2", "@walletconnect/time": "1.0.2", - "@walletconnect/types": "2.18.0", - "@walletconnect/utils": "2.18.0", + "@walletconnect/types": "2.21.3", + "@walletconnect/utils": "2.21.3", "events": "3.3.0" } }, @@ -4103,9 +4185,9 @@ } }, "node_modules/@walletconnect/types": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-2.18.0.tgz", - "integrity": "sha512-g0jU+6LUuw3E/EPAQfHNK2xK/95IpRfz68tdNAFckLmefZU6kzoE1mIM1SrPJq8rT9kUPp6/APMQE+ReH2OdBA==", + "version": "2.21.3", + "resolved": "https://registry.npmjs.org/@walletconnect/types/-/types-2.21.3.tgz", + "integrity": "sha512-4fDchSb6q/YIuUokaIvp+/tpWtmiL+dOWuKUCq0+w81R0unsQzn4Zc57Xh+TkNAlBGSJmZ44ZQPevN4vaTnjwg==", "license": "Apache-2.0", "dependencies": { "@walletconnect/events": "1.0.1", @@ -4116,10 +4198,29 @@ "events": "3.3.0" } }, + "node_modules/@walletconnect/types/node_modules/@walletconnect/keyvaluestorage": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@walletconnect/keyvaluestorage/-/keyvaluestorage-1.1.1.tgz", + "integrity": "sha512-V7ZQq2+mSxAq7MrRqDxanTzu2RcElfK1PfNYiaVnJgJ7Q7G7hTVwF8voIBx92qsRyGHZihrwNPHuZd1aKkd0rA==", + "license": "MIT", + "dependencies": { + "@walletconnect/safe-json": "^1.0.1", + "idb-keyval": "^6.2.1", + "unstorage": "^1.9.0" + }, + "peerDependencies": { + "@react-native-async-storage/async-storage": "1.x" + }, + "peerDependenciesMeta": { + "@react-native-async-storage/async-storage": { + "optional": true + } + } + }, "node_modules/@walletconnect/universal-provider": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/@walletconnect/universal-provider/-/universal-provider-2.18.0.tgz", - "integrity": "sha512-zF/e1NAipLqYjNNgM+XZTchh94efaxciBmgcDOaLznS97R7S/1bYj5okQCAEDKx9RALhEKqZKoyo9jwn4p3BVA==", + "version": "2.21.3", + "resolved": "https://registry.npmjs.org/@walletconnect/universal-provider/-/universal-provider-2.21.3.tgz", + "integrity": "sha512-Tlkfbtp5oNvSb9yEUl3Fxs0A1y8kLbGJOq7F3zyjVu2EvG96cMqqmlYlPRsi55VDn3scmw8zr2zN+BMsMAuDPw==", "license": "Apache-2.0", "dependencies": { "@walletconnect/events": "1.0.1", @@ -4129,45 +4230,67 @@ "@walletconnect/jsonrpc-utils": "1.0.8", "@walletconnect/keyvaluestorage": "1.1.1", "@walletconnect/logger": "2.1.2", - "@walletconnect/sign-client": "2.18.0", - "@walletconnect/types": "2.18.0", - "@walletconnect/utils": "2.18.0", - "events": "3.3.0", - "lodash": "4.17.21" + "@walletconnect/sign-client": "2.21.3", + "@walletconnect/types": "2.21.3", + "@walletconnect/utils": "2.21.3", + "es-toolkit": "1.39.3", + "events": "3.3.0" + } + }, + "node_modules/@walletconnect/universal-provider/node_modules/@walletconnect/keyvaluestorage": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@walletconnect/keyvaluestorage/-/keyvaluestorage-1.1.1.tgz", + "integrity": "sha512-V7ZQq2+mSxAq7MrRqDxanTzu2RcElfK1PfNYiaVnJgJ7Q7G7hTVwF8voIBx92qsRyGHZihrwNPHuZd1aKkd0rA==", + "license": "MIT", + "dependencies": { + "@walletconnect/safe-json": "^1.0.1", + "idb-keyval": "^6.2.1", + "unstorage": "^1.9.0" + }, + "peerDependencies": { + "@react-native-async-storage/async-storage": "1.x" + }, + "peerDependenciesMeta": { + "@react-native-async-storage/async-storage": { + "optional": true + } } }, "node_modules/@walletconnect/utils": { - "version": "2.18.0", - "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.18.0.tgz", - "integrity": "sha512-6AUXIcjSxTHGRsTtmUP/oqudtwRILrQqrJsH3jS5T28FFDzZt7+On6fR4mXzi64k4nNYeWg1wMCGLEdtxmGbZQ==", + "version": "2.21.3", + "resolved": "https://registry.npmjs.org/@walletconnect/utils/-/utils-2.21.3.tgz", + "integrity": "sha512-LHxYX69vG7aPCQB9YT1F8ibwAfRNYwqCEBMplrmquAX+l4lMHTpXvsFF/a5NWFT23DKzbWZ4VTfQTDZ//XJKpg==", "license": "Apache-2.0", "dependencies": { - "@ethersproject/transactions": "5.7.0", - "@noble/ciphers": "1.2.1", - "@noble/curves": "1.8.1", - "@noble/hashes": "1.7.1", + "@msgpack/msgpack": "3.1.2", + "@noble/ciphers": "1.3.0", + "@noble/curves": "1.9.2", + "@noble/hashes": "1.8.0", + "@scure/base": "1.2.6", "@walletconnect/jsonrpc-utils": "1.0.8", "@walletconnect/keyvaluestorage": "1.1.1", "@walletconnect/relay-api": "1.0.11", "@walletconnect/relay-auth": "1.1.0", "@walletconnect/safe-json": "1.0.2", "@walletconnect/time": "1.0.2", - "@walletconnect/types": "2.18.0", + "@walletconnect/types": "2.21.3", "@walletconnect/window-getters": "1.0.1", "@walletconnect/window-metadata": "1.0.1", + "blakejs": "1.2.1", + "bs58": "6.0.0", "detect-browser": "5.3.0", - "elliptic": "6.6.1", "query-string": "7.1.3", - "uint8arrays": "3.1.0" + "uint8arrays": "3.1.1", + "viem": "2.31.0" } }, "node_modules/@walletconnect/utils/node_modules/@noble/curves": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.1.tgz", - "integrity": "sha512-warwspo+UYUPep0Q+vtdVB4Ugn8GGQj8iyB3gnRWsztmUHTI3S1nhdiWNsPUGL0vud7JlRRk1XEu7Lq1KGTnMQ==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.2.tgz", + "integrity": "sha512-HxngEd2XUcg9xi20JkwlLCtYwfoFw4JGkuZpT+WlsPD4gB/cxkvTD8fSsoAnphGZhFdZYKeQIPCuFlWPm1uE0g==", "license": "MIT", "dependencies": { - "@noble/hashes": "1.7.1" + "@noble/hashes": "1.8.0" }, "engines": { "node": "^14.21.3 || >=16" @@ -4176,6 +4299,121 @@ "url": "https://paulmillr.com/funding/" } }, + "node_modules/@walletconnect/utils/node_modules/@walletconnect/keyvaluestorage": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@walletconnect/keyvaluestorage/-/keyvaluestorage-1.1.1.tgz", + "integrity": "sha512-V7ZQq2+mSxAq7MrRqDxanTzu2RcElfK1PfNYiaVnJgJ7Q7G7hTVwF8voIBx92qsRyGHZihrwNPHuZd1aKkd0rA==", + "license": "MIT", + "dependencies": { + "@walletconnect/safe-json": "^1.0.1", + "idb-keyval": "^6.2.1", + "unstorage": "^1.9.0" + }, + "peerDependencies": { + "@react-native-async-storage/async-storage": "1.x" + }, + "peerDependenciesMeta": { + "@react-native-async-storage/async-storage": { + "optional": true + } + } + }, + "node_modules/@walletconnect/utils/node_modules/ox": { + "version": "0.7.1", + "resolved": "https://registry.npmjs.org/ox/-/ox-0.7.1.tgz", + "integrity": "sha512-+k9fY9PRNuAMHRFIUbiK9Nt5seYHHzSQs9Bj+iMETcGtlpS7SmBzcGSVUQO3+nqGLEiNK4598pHNFlVRaZbRsg==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wevm" + } + ], + "license": "MIT", + "dependencies": { + "@adraffy/ens-normalize": "^1.10.1", + "@noble/ciphers": "^1.3.0", + "@noble/curves": "^1.6.0", + "@noble/hashes": "^1.5.0", + "@scure/bip32": "^1.5.0", + "@scure/bip39": "^1.4.0", + "abitype": "^1.0.6", + "eventemitter3": "5.0.1" + }, + "peerDependencies": { + "typescript": ">=5.4.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@walletconnect/utils/node_modules/viem": { + "version": "2.31.0", + "resolved": "https://registry.npmjs.org/viem/-/viem-2.31.0.tgz", + "integrity": "sha512-U7OMQ6yqK+bRbEIarf2vqxL7unSEQvNxvML/1zG7suAmKuJmipqdVTVJGKBCJiYsm/EremyO2FS4dHIPpGv+eA==", + "funding": [ + { + "type": "github", + "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.0.8", + "isows": "1.0.7", + "ox": "0.7.1", + "ws": "8.18.2" + }, + "peerDependencies": { + "typescript": ">=5.0.4" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/@walletconnect/utils/node_modules/viem/node_modules/@noble/curves": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.1.tgz", + "integrity": "sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.8.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/@walletconnect/utils/node_modules/ws": { + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.2.tgz", + "integrity": "sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/@walletconnect/window-getters": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@walletconnect/window-getters/-/window-getters-1.0.1.tgz", @@ -4405,6 +4643,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/blakejs": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", + "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==", + "license": "MIT" + }, "node_modules/bn.js": { "version": "5.2.1", "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", @@ -4826,9 +5070,9 @@ } }, "node_modules/crossws": { - "version": "0.3.4", - "resolved": "https://registry.npmjs.org/crossws/-/crossws-0.3.4.tgz", - "integrity": "sha512-uj0O1ETYX1Bh6uSgktfPvwDiPYGQ3aI4qVsaC/LWpkIzGj1nUYm5FK3K+t11oOlpN01lGbprFCH4wBlKdJjVgw==", + "version": "0.3.5", + "resolved": "https://registry.npmjs.org/crossws/-/crossws-0.3.5.tgz", + "integrity": "sha512-ojKiDvcmByhwa8YYqbQI/hg7MEU0NC03+pSdEq4ZUnZR9xXpwk7E43SMNGkn+JxJGPFtNvQ48+vV2p+P1ml5PA==", "license": "MIT", "dependencies": { "uncrypto": "^0.1.3" @@ -4878,9 +5122,9 @@ } }, "node_modules/dayjs": { - "version": "1.11.10", - "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.10.tgz", - "integrity": "sha512-vjAczensTgRcqDERK0SR2XMwsF/tSvnvlv6VcF2GIhg6Sx4yOIt/irsr1RDJsKiIyBzJDpCoXiWWq28MqH2cnQ==", + "version": "1.11.13", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", + "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==", "license": "MIT" }, "node_modules/debug": { @@ -4952,9 +5196,9 @@ } }, "node_modules/destr": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.3.tgz", - "integrity": "sha512-2N3BOUU4gYMpTP24s5rF5iP7BDr7uNTCs4ozw3kf/eKfvWSIu93GEBi5m427YoyJoeOzQ5smuu4nNAPGb8idSQ==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/destr/-/destr-2.0.5.tgz", + "integrity": "sha512-ugFTXCtDZunbzasqBxrK93Ik/DRYsO6S/fedkWEMKqt04xZ4csmnmwGDBAb07QWNaGMAmnTIemsYZCksjATwsA==", "license": "MIT" }, "node_modules/detect-browser": { @@ -5184,27 +5428,6 @@ "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==", "license": "MIT" }, - "node_modules/elliptic": { - "version": "6.6.1", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz", - "integrity": "sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==", - "license": "MIT", - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.1.tgz", - "integrity": "sha512-k8TVBiPkPJT9uHLdOKfFpqcfprwBFOAAXXozRubr7R7PfIuKvQlzcI4M0pALeqXN09vdaMbUdUj+pass+uULAg==", - "license": "MIT" - }, "node_modules/emoji-regex": { "version": "10.4.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-10.4.0.tgz", @@ -5219,9 +5442,9 @@ "license": "MIT" }, "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "version": "1.4.5", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.5.tgz", + "integrity": "sha512-ooEGc6HP26xXq/N+GCGOT0JKCLDGrq2bQUZrQ7gyrJiZANJ/8YDTxTpQBXGMn+WbIQXNVpyWymm7KYVICQnyOg==", "license": "MIT", "dependencies": { "once": "^1.4.0" @@ -5240,6 +5463,16 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/es-toolkit": { + "version": "1.39.3", + "resolved": "https://registry.npmjs.org/es-toolkit/-/es-toolkit-1.39.3.tgz", + "integrity": "sha512-Qb/TCFCldgOy8lZ5uC7nLGdqJwSabkQiYQShmw4jyiPk1pZzaYWTwaYKYP7EgLccWYgZocMrtItrwh683voaww==", + "license": "MIT", + "workspaces": [ + "docs", + "benchmarks" + ] + }, "node_modules/esbuild": { "version": "0.19.12", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.12.tgz", @@ -5625,20 +5858,19 @@ "license": "ISC" }, "node_modules/h3": { - "version": "1.15.0", - "resolved": "https://registry.npmjs.org/h3/-/h3-1.15.0.tgz", - "integrity": "sha512-OsjX4JW8J4XGgCgEcad20pepFQWnuKH+OwkCJjogF3C+9AZ1iYdtB4hX6vAb5DskBiu5ljEXqApINjR8CqoCMQ==", + "version": "1.15.3", + "resolved": "https://registry.npmjs.org/h3/-/h3-1.15.3.tgz", + "integrity": "sha512-z6GknHqyX0h9aQaTx22VZDf6QyZn+0Nh+Ym8O/u0SGSkyF5cuTJYKlc8MkzW3Nzf9LE1ivcpmYC3FUGpywhuUQ==", "license": "MIT", "dependencies": { "cookie-es": "^1.2.2", - "crossws": "^0.3.3", + "crossws": "^0.3.4", "defu": "^6.1.4", - "destr": "^2.0.3", + "destr": "^2.0.5", "iron-webcrypto": "^1.2.1", "node-mock-http": "^1.0.0", - "ohash": "^1.1.4", "radix3": "^1.1.2", - "ufo": "^1.5.4", + "ufo": "^1.6.1", "uncrypto": "^0.1.3" } }, @@ -5702,9 +5934,9 @@ } }, "node_modules/idb-keyval": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-6.2.1.tgz", - "integrity": "sha512-8Sb3veuYCyrZL+VBt9LJfZjLUPWVvqn8tG28VqYNFCo43KHcKuq+b4EiXGeuaLAQWL2YmyDgMp2aSpH9JHsEQg==", + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/idb-keyval/-/idb-keyval-6.2.2.tgz", + "integrity": "sha512-yjD9nARJ/jb1g+CvD0tlhUHOrJ9Sy0P8T9MF3YaLlHnSRpwPfpTX0XIvpmw3gAJUmEu3FiICLBDPXVwyEvrleg==", "license": "Apache-2.0" }, "node_modules/ieee754": { @@ -5868,9 +6100,9 @@ "license": "ISC" }, "node_modules/isows": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.6.tgz", - "integrity": "sha512-lPHCayd40oW98/I0uvgaHKWCSvkzY27LjWLbtzOm64yQ+G3Q5npjjbdppU65iZXkK1Zt+kH9pfegli0AYfwYYw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.7.tgz", + "integrity": "sha512-I1fSfDCZL5P0v33sVqeTDSpcstAg/N+wF5HS033mogOVIp4B+oHC7oOCsA3axAbBSGTJ8QubbNmnIRN/h8U7hg==", "funding": [ { "type": "github", @@ -5989,31 +6221,31 @@ } }, "node_modules/lit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/lit/-/lit-3.1.0.tgz", - "integrity": "sha512-rzo/hmUqX8zmOdamDAeydfjsGXbbdtAFqMhmocnh2j9aDYqbu0fjXygjCa0T99Od9VQ/2itwaGrjZz/ZELVl7w==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lit/-/lit-3.3.0.tgz", + "integrity": "sha512-DGVsqsOIHBww2DqnuZzW7QsuCdahp50ojuDaBPC7jUDRpYoH0z7kHBBYZewRzer75FwtrkmkKk7iOAwSaWdBmw==", "license": "BSD-3-Clause", "dependencies": { - "@lit/reactive-element": "^2.0.0", - "lit-element": "^4.0.0", - "lit-html": "^3.1.0" + "@lit/reactive-element": "^2.1.0", + "lit-element": "^4.2.0", + "lit-html": "^3.3.0" } }, "node_modules/lit-element": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.1.1.tgz", - "integrity": "sha512-HO9Tkkh34QkTeUmEdNYhMT8hzLid7YlMlATSi1q4q17HE5d9mrrEHJ/o8O2D0cMi182zK1F3v7x0PWFjrhXFew==", + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lit-element/-/lit-element-4.2.0.tgz", + "integrity": "sha512-MGrXJVAI5x+Bfth/pU9Kst1iWID6GHDLEzFEnyULB/sFiRLgkd8NPK/PeeXxktA3T6EIIaq8U3KcbTU5XFcP2Q==", "license": "BSD-3-Clause", "dependencies": { "@lit-labs/ssr-dom-shim": "^1.2.0", - "@lit/reactive-element": "^2.0.4", - "lit-html": "^3.2.0" + "@lit/reactive-element": "^2.1.0", + "lit-html": "^3.3.0" } }, "node_modules/lit-html": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.2.1.tgz", - "integrity": "sha512-qI/3lziaPMSKsrwlxH/xMgikhQ0EGOX2ICU73Bi/YHFvz2j/yMCIrw4+puF2IpQ4+upd3EWbvnHM9+PnJn48YA==", + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/lit-html/-/lit-html-3.3.0.tgz", + "integrity": "sha512-RHoswrFAxY2d8Cf2mm4OZ1DgzCoBKUKSPvA1fhtSELxUERq2aQQ2h05pO9j81gS1o7RIRJ+CePLogfyahwmynw==", "license": "BSD-3-Clause", "dependencies": { "@types/trusted-types": "^2.0.2" @@ -6031,12 +6263,6 @@ "node": ">=8" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "license": "MIT" - }, "node_modules/lodash.defaults": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.defaults/-/lodash.defaults-4.2.0.tgz", @@ -6049,13 +6275,6 @@ "integrity": "sha512-chi4NHZlZqZD18a0imDHnZPrDeBbTtVN7GXMwuGdRH9qotxAjYs3aVLKc7zNOG9eddR5Ksd8rvFEBc9SsggPpg==", "license": "MIT" }, - "node_modules/lodash.isequal": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", - "deprecated": "This package is deprecated. Use require('node:util').isDeepStrictEqual instead.", - "license": "MIT" - }, "node_modules/log-update": { "version": "6.1.0", "resolved": "https://registry.npmjs.org/log-update/-/log-update-6.1.0.tgz", @@ -6414,9 +6633,9 @@ "license": "MIT" }, "node_modules/node-mock-http": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/node-mock-http/-/node-mock-http-1.0.0.tgz", - "integrity": "sha512-0uGYQ1WQL1M5kKvGRXWQ3uZCHtLTO8hln3oBjIusM75WoesZ909uQJs/Hb946i2SS+Gsrhkaa6iAO17jRIv6DQ==", + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/node-mock-http/-/node-mock-http-1.0.1.tgz", + "integrity": "sha512-0gJJgENizp4ghds/Ywu2FCmcRsgBTmRQzYPZm61wy+Em2sBarSka0OhQS5huLBg6od1zkNpnWMCZloQDFVvOMQ==", "license": "MIT" }, "node_modules/normalize-path": { @@ -6493,12 +6712,6 @@ "ufo": "^1.5.4" } }, - "node_modules/ohash": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/ohash/-/ohash-1.1.4.tgz", - "integrity": "sha512-FlDryZAahJmEF3VR3w1KogSEdWX3WhA5GPakFx4J81kEAiHyLMpdLLElS8n8dfNadMgAne/MywcvmogzscVt4g==", - "license": "MIT" - }, "node_modules/on-exit-leak-free": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/on-exit-leak-free/-/on-exit-leak-free-0.2.0.tgz", @@ -6531,9 +6744,9 @@ } }, "node_modules/ox": { - "version": "0.6.7", - "resolved": "https://registry.npmjs.org/ox/-/ox-0.6.7.tgz", - "integrity": "sha512-17Gk/eFsFRAZ80p5eKqv89a57uXjd3NgIf1CaXojATPBuujVc/fQSVhBeAU9JCRB+k7J50WQAyWTxK19T9GgbA==", + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/ox/-/ox-0.8.1.tgz", + "integrity": "sha512-e+z5epnzV+Zuz91YYujecW8cF01mzmrUtWotJ0oEPym/G82uccs7q0WDHTYL3eiONbTUEvcZrptAKLgTBD3u2A==", "funding": [ { "type": "github", @@ -6542,12 +6755,13 @@ ], "license": "MIT", "dependencies": { - "@adraffy/ens-normalize": "^1.10.1", - "@noble/curves": "^1.6.0", - "@noble/hashes": "^1.5.0", - "@scure/bip32": "^1.5.0", - "@scure/bip39": "^1.4.0", - "abitype": "^1.0.6", + "@adraffy/ens-normalize": "^1.11.0", + "@noble/ciphers": "^1.3.0", + "@noble/curves": "^1.9.1", + "@noble/hashes": "^1.8.0", + "@scure/bip32": "^1.7.0", + "@scure/bip39": "^1.6.0", + "abitype": "^1.0.8", "eventemitter3": "5.0.1" }, "peerDependencies": { @@ -6559,6 +6773,21 @@ } } }, + "node_modules/ox/node_modules/@noble/curves": { + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.2.tgz", + "integrity": "sha512-HxngEd2XUcg9xi20JkwlLCtYwfoFw4JGkuZpT+WlsPD4gB/cxkvTD8fSsoAnphGZhFdZYKeQIPCuFlWPm1uE0g==", + "license": "MIT", + "dependencies": { + "@noble/hashes": "1.8.0" + }, + "engines": { + "node": "^14.21.3 || >=16" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", @@ -7537,6 +7766,18 @@ "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==", "license": "MIT" }, + "node_modules/semver": { + "version": "7.7.2", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.2.tgz", + "integrity": "sha512-RF0Fw+rO5AMf9MAyaRXI4AV0Ulj5lMHqVxxdSgiVbixSCXoEmmX/jk0CuJw4+3SqroYO9VoUh+HcuJivvtJemA==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/set-blocking": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", @@ -8040,15 +8281,15 @@ } }, "node_modules/ufo": { - "version": "1.5.4", - "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.5.4.tgz", - "integrity": "sha512-UsUk3byDzKd04EyoZ7U4DOlxQaD14JUKQl6/P7wiX4FNvUfm3XL246n9W5AmqwW5RSFJ27NAuM0iLscAOYUiGQ==", + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/ufo/-/ufo-1.6.1.tgz", + "integrity": "sha512-9a4/uxlTWJ4+a5i0ooc1rU7C7YOw3wT+UGqdeNNHWnOF9qcMBgLRS+4IYUqbczewFx4mLEig6gawh7X6mFlEkA==", "license": "MIT" }, "node_modules/uint8arrays": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.0.tgz", - "integrity": "sha512-ei5rfKtoRO8OyOIor2Rz5fhzjThwIHJZ3uyDPnDHTXbP0aMQ1RN/6AI5B5d9dBxJOU+BvOAk7ZQ1xphsX8Lrog==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/uint8arrays/-/uint8arrays-3.1.1.tgz", + "integrity": "sha512-+QJa8QRnbdXVpHYjLoTpJIdCTiw9Ir62nocClWuXIq2JIh4Uta0cQsTSpFL678p2CN8B+XSApwcU+pQEqVpKWg==", "license": "MIT", "dependencies": { "multiformats": "^9.4.2" @@ -8077,39 +8318,39 @@ "license": "MIT" }, "node_modules/unstorage": { - "version": "1.14.4", - "resolved": "https://registry.npmjs.org/unstorage/-/unstorage-1.14.4.tgz", - "integrity": "sha512-1SYeamwuYeQJtJ/USE1x4l17LkmQBzg7deBJ+U9qOBoHo15d1cDxG4jM31zKRgF7pG0kirZy4wVMX6WL6Zoscg==", + "version": "1.16.0", + "resolved": "https://registry.npmjs.org/unstorage/-/unstorage-1.16.0.tgz", + "integrity": "sha512-WQ37/H5A7LcRPWfYOrDa1Ys02xAbpPJq6q5GkO88FBXVSQzHd7+BjEwfRqyaSWCv9MbsJy058GWjjPjcJ16GGA==", "license": "MIT", "dependencies": { "anymatch": "^3.1.3", - "chokidar": "^3.6.0", - "destr": "^2.0.3", - "h3": "^1.13.0", + "chokidar": "^4.0.3", + "destr": "^2.0.5", + "h3": "^1.15.2", "lru-cache": "^10.4.3", - "node-fetch-native": "^1.6.4", + "node-fetch-native": "^1.6.6", "ofetch": "^1.4.1", - "ufo": "^1.5.4" + "ufo": "^1.6.1" }, "peerDependencies": { "@azure/app-configuration": "^1.8.0", "@azure/cosmos": "^4.2.0", "@azure/data-tables": "^13.3.0", - "@azure/identity": "^4.5.0", + "@azure/identity": "^4.6.0", "@azure/keyvault-secrets": "^4.9.0", "@azure/storage-blob": "^12.26.0", - "@capacitor/preferences": "^6.0.3", - "@deno/kv": ">=0.8.4", + "@capacitor/preferences": "^6.0.3 || ^7.0.0", + "@deno/kv": ">=0.9.0", "@netlify/blobs": "^6.5.0 || ^7.0.0 || ^8.1.0", "@planetscale/database": "^1.19.0", "@upstash/redis": "^1.34.3", - "@vercel/blob": ">=0.27.0", + "@vercel/blob": ">=0.27.1", "@vercel/kv": "^1.0.1", "aws4fetch": "^1.0.20", "db0": ">=0.2.1", "idb-keyval": "^6.2.1", "ioredis": "^5.4.2", - "uploadthing": "^7.4.1" + "uploadthing": "^7.4.4" }, "peerDependenciesMeta": { "@azure/app-configuration": { @@ -8168,6 +8409,34 @@ } } }, + "node_modules/unstorage/node_modules/chokidar": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-4.0.3.tgz", + "integrity": "sha512-Qgzu8kfBvo+cA4962jnP1KkS6Dop5NS6g7R5LFYJr4b8Ub94PPQXUksCw9PvXoeXPRRddRNC5C1JQUR2SMGtnA==", + "license": "MIT", + "dependencies": { + "readdirp": "^4.0.1" + }, + "engines": { + "node": ">= 14.16.0" + }, + "funding": { + "url": "https://paulmillr.com/funding/" + } + }, + "node_modules/unstorage/node_modules/readdirp": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-4.1.2.tgz", + "integrity": "sha512-GDhwkLfywWL2s6vEjyhri+eXmfH6j1L7JE27WhqLeYzoh/A3DBaYGEj2H/HFZCn/kMfim73FXxEJTw06WtxQwg==", + "license": "MIT", + "engines": { + "node": ">= 14.18.0" + }, + "funding": { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + }, "node_modules/use-callback-ref": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/use-callback-ref/-/use-callback-ref-1.3.3.tgz", @@ -8283,9 +8552,9 @@ } }, "node_modules/viem": { - "version": "2.23.1", - "resolved": "https://registry.npmjs.org/viem/-/viem-2.23.1.tgz", - "integrity": "sha512-c5AyJCTA5LeNI/KCu++vkbqbh7irYjUSHxLIAHPKJ6IEcBNMt8+7sPG7gjMXpqVWnqPMzaW9CA2n+yUsKWttDA==", + "version": "2.31.4", + "resolved": "https://registry.npmjs.org/viem/-/viem-2.31.4.tgz", + "integrity": "sha512-0UZ/asvzl6p44CIBRDbwEcn3HXIQQurBZcMo5qmLhQ8s27Ockk+RYohgTLlpLvkYs8/t4UUEREAbHLuek1kXcw==", "funding": [ { "type": "github", @@ -8294,14 +8563,14 @@ ], "license": "MIT", "dependencies": { - "@noble/curves": "1.8.1", - "@noble/hashes": "1.7.1", - "@scure/bip32": "1.6.2", - "@scure/bip39": "1.5.4", + "@noble/curves": "1.9.2", + "@noble/hashes": "1.8.0", + "@scure/bip32": "1.7.0", + "@scure/bip39": "1.6.0", "abitype": "1.0.8", - "isows": "1.0.6", - "ox": "0.6.7", - "ws": "8.18.0" + "isows": "1.0.7", + "ox": "0.8.1", + "ws": "8.18.2" }, "peerDependencies": { "typescript": ">=5.0.4" @@ -8313,12 +8582,12 @@ } }, "node_modules/viem/node_modules/@noble/curves": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.1.tgz", - "integrity": "sha512-warwspo+UYUPep0Q+vtdVB4Ugn8GGQj8iyB3gnRWsztmUHTI3S1nhdiWNsPUGL0vud7JlRRk1XEu7Lq1KGTnMQ==", + "version": "1.9.2", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.9.2.tgz", + "integrity": "sha512-HxngEd2XUcg9xi20JkwlLCtYwfoFw4JGkuZpT+WlsPD4gB/cxkvTD8fSsoAnphGZhFdZYKeQIPCuFlWPm1uE0g==", "license": "MIT", "dependencies": { - "@noble/hashes": "1.7.1" + "@noble/hashes": "1.8.0" }, "engines": { "node": "^14.21.3 || >=16" @@ -8328,9 +8597,9 @@ } }, "node_modules/viem/node_modules/ws": { - "version": "8.18.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", - "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "version": "8.18.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.2.tgz", + "integrity": "sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==", "license": "MIT", "engines": { "node": ">=10.0.0" diff --git a/src/app/invoices/[ID]/page.tsx b/src/app/invoices/[ID]/page.tsx index f468f199..107080b4 100644 --- a/src/app/invoices/[ID]/page.tsx +++ b/src/app/invoices/[ID]/page.tsx @@ -48,7 +48,7 @@ export default async function PaymentPage({
{/* Payment Section */} - + {/* Invoice Preview */} diff --git a/src/components/app-kit.tsx b/src/components/app-kit.tsx index 5a323256..171d378c 100644 --- a/src/components/app-kit.tsx +++ b/src/components/app-kit.tsx @@ -28,6 +28,7 @@ createAppKit({ adapters: [new Ethers5Adapter()], metadata, networks: [sepolia, base, mainnet, arbitrum, optimism, polygon], + themeMode: "light", projectId, features: { analytics: false, diff --git a/src/components/crypto-to-fiat.tsx b/src/components/crypto-to-fiat.tsx index b8c4164a..58507207 100644 --- a/src/components/crypto-to-fiat.tsx +++ b/src/components/crypto-to-fiat.tsx @@ -1,4 +1,3 @@ -import { Card, CardContent, CardHeader } from "@/components/ui/card"; import type { User } from "@/server/db/schema"; import { AlertTriangle } from "lucide-react"; import { ComplianceForm } from "./compliance-form"; @@ -6,29 +5,25 @@ import { ComplianceForm } from "./compliance-form"; export function CryptoToFiat({ user }: { user: User }) { return (
- - - - - {!user.isCompliant && ( -
- -
-

- Compliance Required -

-

- To send Crypto-to-fiat payments, you need to complete KYC - verification and sign the compliance agreement. -

-
+
+ {!user.isCompliant && ( +
+ +
+

+ Compliance Required +

+

+ To send Crypto-to-fiat payments, you need to complete KYC + verification and sign the compliance agreement. +

- )} -
-
- - + )} +
+ +
+
); } diff --git a/src/components/invoice-creator.tsx b/src/components/invoice-creator.tsx index d54b9748..62d85ba7 100644 --- a/src/components/invoice-creator.tsx +++ b/src/components/invoice-creator.tsx @@ -44,6 +44,14 @@ export function InvoiceCreator({ description: "You can safely close this page now", }); }, + onError: (error) => { + toast.error("Failed to create invoice", { + description: + error instanceof Error + ? error.message + : "An unexpected error occurred", + }); + }, }) : api.invoice.create.useMutation({ onSuccess: async () => { @@ -51,6 +59,14 @@ export function InvoiceCreator({ await utils.invoice.getAll.invalidate(); router.push("/dashboard"); }, + onError: (error) => { + toast.error("Failed to create invoice", { + description: + error instanceof Error + ? error.message + : "An unexpected error occurred", + }); + }, }); const form = useForm({ @@ -72,9 +88,9 @@ export function InvoiceCreator({ }, }); - const onSubmit = (data: InvoiceFormValues) => { + const onSubmit = async (data: InvoiceFormValues) => { try { - createInvoice(data); + await createInvoice(data); } catch (error) { toast.error("Failed to create invoice", { description: diff --git a/src/components/payment-section.tsx b/src/components/payment-section.tsx index 492e66ed..1eafd99f 100644 --- a/src/components/payment-section.tsx +++ b/src/components/payment-section.tsx @@ -17,6 +17,7 @@ import { useAppKitAccount, useAppKitNetwork, useAppKitProvider, + useDisconnect, } from "@reown/appkit/react"; import { ethers } from "ethers"; import { AlertCircle, CheckCircle, Clock, Loader2, Wallet } from "lucide-react"; @@ -40,7 +41,7 @@ type InvoiceStatus = | "overdue"; interface PaymentSectionProps { - invoice: NonNullable; + serverInvoice: NonNullable; } const getCurrencyChain = (currency: string) => { @@ -101,8 +102,9 @@ const getRouteType = (route: PaymentRouteType, invoiceChain: string | null) => { }; }; -export function PaymentSection({ invoice }: PaymentSectionProps) { +export function PaymentSection({ serverInvoice }: PaymentSectionProps) { const { open } = useAppKit(); + const { disconnect } = useDisconnect(); const { isConnected, address } = useAppKitAccount(); const { walletProvider } = useAppKitProvider("eip155"); const { chainId, switchNetwork } = useAppKitNetwork(); @@ -111,9 +113,29 @@ export function PaymentSection({ invoice }: PaymentSectionProps) { null, ); + const [invoice, setInvoice] = useState(serverInvoice); + const [paymentStatus, setPaymentStatus] = useState( - invoice.status as InvoiceStatus, + serverInvoice.status as InvoiceStatus, ); + + // Only Poll when Invoice is not paid + const [polling, setPolling] = useState(paymentStatus !== "paid"); + + // Poll the invoice status every 3 seconds until it's paid + api.invoice.getById.useQuery(serverInvoice.id, { + refetchInterval: polling ? 3000 : false, + onSuccess: (data) => { + setInvoice(data); + if (data.status !== "pending") { + setPaymentStatus(data.status); + } + if (data.status === "paid") { + setPolling(false); + } + }, + }); + const [paymentProgress, setPaymentProgress] = useState("idle"); const [currentStep, setCurrentStep] = useState(1); const [isAppKitReady, setIsAppKitReady] = useState(false); @@ -197,6 +219,12 @@ export function PaymentSection({ invoice }: PaymentSectionProps) { } }; + const handleDisconnect = () => { + if (isAppKitReady) { + disconnect(); + } + }; + const handleCrosschainPayments = async (paymentData: any, signer: any) => { const paymentIntent = JSON.parse(paymentData.paymentIntent); const supportsEIP2612 = paymentData.metadata.supportsEIP2612; @@ -515,10 +543,10 @@ export function PaymentSection({ invoice }: PaymentSectionProps) {
diff --git a/src/components/user-menu.tsx b/src/components/user-menu.tsx index 135bbc94..f11459ad 100644 --- a/src/components/user-menu.tsx +++ b/src/components/user-menu.tsx @@ -9,13 +9,14 @@ import { DropdownMenuSeparator, DropdownMenuTrigger, } from "@/components/ui/dropdown-menu"; +import { truncateEmail } from "@/lib/utils"; import type { User } from "@/server/db/schema"; import { api } from "@/trpc/react"; -import { LogOut } from "lucide-react"; +import { CopyIcon, LogOut } from "lucide-react"; import { useRouter } from "next/navigation"; interface UserMenuProps { - user: Pick; + user: Pick; } export function UserMenu({ user }: UserMenuProps) { @@ -48,6 +49,23 @@ export function UserMenu({ user }: UserMenuProps) {

+ +
+

+ {truncateEmail(user.email ?? "")} +

+ +
+
logout.mutate()} diff --git a/src/lib/utils.ts b/src/lib/utils.ts index 6cc5c060..55741a08 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -18,6 +18,14 @@ export function filterDefinedValues>( ) as Partial; } + +export function truncateEmail(email: string, maxLength = 20): string { + if (email.length <= maxLength) return email; + const [user, domain] = email.split("@"); + const keep = maxLength - domain.length - 4; + return `${user.slice(0, keep)}...@${domain}`; +} + export const getCanCancelPayment = (status: string) => { return status === "pending" || status === "active"; }; diff --git a/src/server/routers/invoice.ts b/src/server/routers/invoice.ts index 9bc3ec94..4b1c5e0d 100644 --- a/src/server/routers/invoice.ts +++ b/src/server/routers/invoice.ts @@ -22,6 +22,14 @@ const createInvoiceHelper = async ( 0, ); + // Throw error if totalAmount is less than or equal to 0 + if (totalAmount <= 0) { + throw new TRPCError({ + code: "BAD_REQUEST", + message: "Total amount must be greater than 0", + }); + } + // FIXME: This logic can be removed after we implement it inside the Request Network API. // We set the payee address to an address controlled by the Request Network Foundation, // even in the case of crypto-to-fiat, because it's required by the protocol. @@ -150,7 +158,8 @@ export const invoiceRouter = router({ }); throw new TRPCError({ code: "INTERNAL_SERVER_ERROR", - message: "Failed to create invoice", + message: + error instanceof Error ? error.message : "Failed to create invoice", }); } }), @@ -203,7 +212,8 @@ export const invoiceRouter = router({ ); throw new TRPCError({ code: "INTERNAL_SERVER_ERROR", - message: "Failed to create invoice", + message: + error instanceof Error ? error.message : "Failed to create invoice", }); } }),