From 2e02a661f2d8842cd11adba290b1f9751972b7b3 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 17 Sep 2025 14:49:25 +0000 Subject: [PATCH 01/36] Bump next in the npm_and_yarn group across 1 directory Bumps the npm_and_yarn group with 1 update in the / directory: [next](https://github.com/vercel/next.js). Updates `next` from 15.4.2 to 15.4.7 - [Release notes](https://github.com/vercel/next.js/releases) - [Changelog](https://github.com/vercel/next.js/blob/canary/release.js) - [Commits](https://github.com/vercel/next.js/compare/v15.4.2...v15.4.7) --- updated-dependencies: - dependency-name: next dependency-version: 15.4.7 dependency-type: direct:production dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] --- extras/docs/package.json | 2 +- extras/web/package.json | 2 +- pnpm-lock.yaml | 354 ++++++++++++++++++--------------------- 3 files changed, 166 insertions(+), 192 deletions(-) diff --git a/extras/docs/package.json b/extras/docs/package.json index 6c2fe2de2d..d88f6aab18 100644 --- a/extras/docs/package.json +++ b/extras/docs/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@repo/ui": "workspace:*", - "next": "^15.3.3", + "next": "^15.4.7", "react": "^19.1.0", "react-dom": "^19.1.0" }, diff --git a/extras/web/package.json b/extras/web/package.json index d908edc2d6..8a0ffdf213 100644 --- a/extras/web/package.json +++ b/extras/web/package.json @@ -13,7 +13,7 @@ }, "dependencies": { "@repo/ui": "workspace:*", - "next": "^15.3.3", + "next": "^15.4.7", "react": "^19.1.0", "react-dom": "^19.1.0" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 555a669efe..494683100a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -33,8 +33,8 @@ importers: specifier: workspace:* version: link:../../repo/ui next: - specifier: ^15.3.3 - version: 15.4.2(react-dom@19.1.0(react@19.1.0))(react@19.1.0) + specifier: ^15.4.7 + version: 15.4.7(react-dom@19.1.0(react@19.1.0))(react@19.1.0) react: specifier: ^19.1.0 version: 19.1.0 @@ -67,8 +67,8 @@ importers: specifier: workspace:* version: link:../../repo/ui next: - specifier: ^15.3.3 - version: 15.4.2(react-dom@19.1.0(react@19.1.0))(react@19.1.0) + specifier: ^15.4.7 + version: 15.4.7(react-dom@19.1.0(react@19.1.0))(react@19.1.0) react: specifier: ^19.1.0 version: 19.1.0 @@ -586,8 +586,8 @@ packages: resolution: {integrity: sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==} engines: {node: '>=12'} - '@emnapi/runtime@1.4.5': - resolution: {integrity: sha512-++LApOtY0pEEz1zrd9vy1/zXVaVJJ/EbAF3u0fXIzPJEDtnITsBGbbK0EkM72amhl/R5b+5xx0Y/QhcVOpuulg==} + '@emnapi/runtime@1.5.0': + resolution: {integrity: sha512-97/BJ3iXHww3djw6hYIfErCZFee7qCtrneuLa20UXFCOTCfBM2cvQHjWJ2EG0s0MtdNwInarqCTz35i4wWXHsQ==} '@esbuild/aix-ppc64@0.25.8': resolution: {integrity: sha512-urAvrUedIqEiFR3FYSLTWQgLu5tb+m0qZw0NBEasUeo6wuqatkMDaRT+1uABiGXEu5vqgPd7FGE1BhsAIy9QVA==} @@ -803,124 +803,128 @@ packages: resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} engines: {node: '>=18.18'} - '@img/sharp-darwin-arm64@0.34.3': - resolution: {integrity: sha512-ryFMfvxxpQRsgZJqBd4wsttYQbCxsJksrv9Lw/v798JcQ8+w84mBWuXwl+TT0WJ/WrYOLaYpwQXi3sA9nTIaIg==} + '@img/colour@1.0.0': + resolution: {integrity: sha512-A5P/LfWGFSl6nsckYtjw9da+19jB8hkJ6ACTGcDfEJ0aE+l2n2El7dsVM7UVHZQ9s2lmYMWlrS21YLy2IR1LUw==} + engines: {node: '>=18'} + + '@img/sharp-darwin-arm64@0.34.4': + resolution: {integrity: sha512-sitdlPzDVyvmINUdJle3TNHl+AG9QcwiAMsXmccqsCOMZNIdW2/7S26w0LyU8euiLVzFBL3dXPwVCq/ODnf2vA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [darwin] - '@img/sharp-darwin-x64@0.34.3': - resolution: {integrity: sha512-yHpJYynROAj12TA6qil58hmPmAwxKKC7reUqtGLzsOHfP7/rniNGTL8tjWX6L3CTV4+5P4ypcS7Pp+7OB+8ihA==} + '@img/sharp-darwin-x64@0.34.4': + resolution: {integrity: sha512-rZheupWIoa3+SOdF/IcUe1ah4ZDpKBGWcsPX6MT0lYniH9micvIU7HQkYTfrx5Xi8u+YqwLtxC/3vl8TQN6rMg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [darwin] - '@img/sharp-libvips-darwin-arm64@1.2.0': - resolution: {integrity: sha512-sBZmpwmxqwlqG9ueWFXtockhsxefaV6O84BMOrhtg/YqbTaRdqDE7hxraVE3y6gVM4eExmfzW4a8el9ArLeEiQ==} + '@img/sharp-libvips-darwin-arm64@1.2.3': + resolution: {integrity: sha512-QzWAKo7kpHxbuHqUC28DZ9pIKpSi2ts2OJnoIGI26+HMgq92ZZ4vk8iJd4XsxN+tYfNJxzH6W62X5eTcsBymHw==} cpu: [arm64] os: [darwin] - '@img/sharp-libvips-darwin-x64@1.2.0': - resolution: {integrity: sha512-M64XVuL94OgiNHa5/m2YvEQI5q2cl9d/wk0qFTDVXcYzi43lxuiFTftMR1tOnFQovVXNZJ5TURSDK2pNe9Yzqg==} + '@img/sharp-libvips-darwin-x64@1.2.3': + resolution: {integrity: sha512-Ju+g2xn1E2AKO6YBhxjj+ACcsPQRHT0bhpglxcEf+3uyPY+/gL8veniKoo96335ZaPo03bdDXMv0t+BBFAbmRA==} cpu: [x64] os: [darwin] - '@img/sharp-libvips-linux-arm64@1.2.0': - resolution: {integrity: sha512-RXwd0CgG+uPRX5YYrkzKyalt2OJYRiJQ8ED/fi1tq9WQW2jsQIn0tqrlR5l5dr/rjqq6AHAxURhj2DVjyQWSOA==} + '@img/sharp-libvips-linux-arm64@1.2.3': + resolution: {integrity: sha512-I4RxkXU90cpufazhGPyVujYwfIm9Nk1QDEmiIsaPwdnm013F7RIceaCc87kAH+oUB1ezqEvC6ga4m7MSlqsJvQ==} cpu: [arm64] os: [linux] - '@img/sharp-libvips-linux-arm@1.2.0': - resolution: {integrity: sha512-mWd2uWvDtL/nvIzThLq3fr2nnGfyr/XMXlq8ZJ9WMR6PXijHlC3ksp0IpuhK6bougvQrchUAfzRLnbsen0Cqvw==} + '@img/sharp-libvips-linux-arm@1.2.3': + resolution: {integrity: sha512-x1uE93lyP6wEwGvgAIV0gP6zmaL/a0tGzJs/BIDDG0zeBhMnuUPm7ptxGhUbcGs4okDJrk4nxgrmxpib9g6HpA==} cpu: [arm] os: [linux] - '@img/sharp-libvips-linux-ppc64@1.2.0': - resolution: {integrity: sha512-Xod/7KaDDHkYu2phxxfeEPXfVXFKx70EAFZ0qyUdOjCcxbjqyJOEUpDe6RIyaunGxT34Anf9ue/wuWOqBW2WcQ==} + '@img/sharp-libvips-linux-ppc64@1.2.3': + resolution: {integrity: sha512-Y2T7IsQvJLMCBM+pmPbM3bKT/yYJvVtLJGfCs4Sp95SjvnFIjynbjzsa7dY1fRJX45FTSfDksbTp6AGWudiyCg==} cpu: [ppc64] os: [linux] - '@img/sharp-libvips-linux-s390x@1.2.0': - resolution: {integrity: sha512-eMKfzDxLGT8mnmPJTNMcjfO33fLiTDsrMlUVcp6b96ETbnJmd4uvZxVJSKPQfS+odwfVaGifhsB07J1LynFehw==} + '@img/sharp-libvips-linux-s390x@1.2.3': + resolution: {integrity: sha512-RgWrs/gVU7f+K7P+KeHFaBAJlNkD1nIZuVXdQv6S+fNA6syCcoboNjsV2Pou7zNlVdNQoQUpQTk8SWDHUA3y/w==} cpu: [s390x] os: [linux] - '@img/sharp-libvips-linux-x64@1.2.0': - resolution: {integrity: sha512-ZW3FPWIc7K1sH9E3nxIGB3y3dZkpJlMnkk7z5tu1nSkBoCgw2nSRTFHI5pB/3CQaJM0pdzMF3paf9ckKMSE9Tg==} + '@img/sharp-libvips-linux-x64@1.2.3': + resolution: {integrity: sha512-3JU7LmR85K6bBiRzSUc/Ff9JBVIFVvq6bomKE0e63UXGeRw2HPVEjoJke1Yx+iU4rL7/7kUjES4dZ/81Qjhyxg==} cpu: [x64] os: [linux] - '@img/sharp-libvips-linuxmusl-arm64@1.2.0': - resolution: {integrity: sha512-UG+LqQJbf5VJ8NWJ5Z3tdIe/HXjuIdo4JeVNADXBFuG7z9zjoegpzzGIyV5zQKi4zaJjnAd2+g2nna8TZvuW9Q==} + '@img/sharp-libvips-linuxmusl-arm64@1.2.3': + resolution: {integrity: sha512-F9q83RZ8yaCwENw1GieztSfj5msz7GGykG/BA+MOUefvER69K/ubgFHNeSyUu64amHIYKGDs4sRCMzXVj8sEyw==} cpu: [arm64] os: [linux] - '@img/sharp-libvips-linuxmusl-x64@1.2.0': - resolution: {integrity: sha512-SRYOLR7CXPgNze8akZwjoGBoN1ThNZoqpOgfnOxmWsklTGVfJiGJoC/Lod7aNMGA1jSsKWM1+HRX43OP6p9+6Q==} + '@img/sharp-libvips-linuxmusl-x64@1.2.3': + resolution: {integrity: sha512-U5PUY5jbc45ANM6tSJpsgqmBF/VsL6LnxJmIf11kB7J5DctHgqm0SkuXzVWtIY90GnJxKnC/JT251TDnk1fu/g==} cpu: [x64] os: [linux] - '@img/sharp-linux-arm64@0.34.3': - resolution: {integrity: sha512-QdrKe3EvQrqwkDrtuTIjI0bu6YEJHTgEeqdzI3uWJOH6G1O8Nl1iEeVYRGdj1h5I21CqxSvQp1Yv7xeU3ZewbA==} + '@img/sharp-linux-arm64@0.34.4': + resolution: {integrity: sha512-YXU1F/mN/Wu786tl72CyJjP/Ngl8mGHN1hST4BGl+hiW5jhCnV2uRVTNOcaYPs73NeT/H8Upm3y9582JVuZHrQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] - '@img/sharp-linux-arm@0.34.3': - resolution: {integrity: sha512-oBK9l+h6KBN0i3dC8rYntLiVfW8D8wH+NPNT3O/WBHeW0OQWCjfWksLUaPidsrDKpJgXp3G3/hkmhptAW0I3+A==} + '@img/sharp-linux-arm@0.34.4': + resolution: {integrity: sha512-Xyam4mlqM0KkTHYVSuc6wXRmM7LGN0P12li03jAnZ3EJWZqj83+hi8Y9UxZUbxsgsK1qOEwg7O0Bc0LjqQVtxA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm] os: [linux] - '@img/sharp-linux-ppc64@0.34.3': - resolution: {integrity: sha512-GLtbLQMCNC5nxuImPR2+RgrviwKwVql28FWZIW1zWruy6zLgA5/x2ZXk3mxj58X/tszVF69KK0Is83V8YgWhLA==} + '@img/sharp-linux-ppc64@0.34.4': + resolution: {integrity: sha512-F4PDtF4Cy8L8hXA2p3TO6s4aDt93v+LKmpcYFLAVdkkD3hSxZzee0rh6/+94FpAynsuMpLX5h+LRsSG3rIciUQ==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [ppc64] os: [linux] - '@img/sharp-linux-s390x@0.34.3': - resolution: {integrity: sha512-3gahT+A6c4cdc2edhsLHmIOXMb17ltffJlxR0aC2VPZfwKoTGZec6u5GrFgdR7ciJSsHT27BD3TIuGcuRT0KmQ==} + '@img/sharp-linux-s390x@0.34.4': + resolution: {integrity: sha512-qVrZKE9Bsnzy+myf7lFKvng6bQzhNUAYcVORq2P7bDlvmF6u2sCmK2KyEQEBdYk+u3T01pVsPrkj943T1aJAsw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [s390x] os: [linux] - '@img/sharp-linux-x64@0.34.3': - resolution: {integrity: sha512-8kYso8d806ypnSq3/Ly0QEw90V5ZoHh10yH0HnrzOCr6DKAPI6QVHvwleqMkVQ0m+fc7EH8ah0BB0QPuWY6zJQ==} + '@img/sharp-linux-x64@0.34.4': + resolution: {integrity: sha512-ZfGtcp2xS51iG79c6Vhw9CWqQC8l2Ot8dygxoDoIQPTat/Ov3qAa8qpxSrtAEAJW+UjTXc4yxCjNfxm4h6Xm2A==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] - '@img/sharp-linuxmusl-arm64@0.34.3': - resolution: {integrity: sha512-vAjbHDlr4izEiXM1OTggpCcPg9tn4YriK5vAjowJsHwdBIdx0fYRsURkxLG2RLm9gyBq66gwtWI8Gx0/ov+JKQ==} + '@img/sharp-linuxmusl-arm64@0.34.4': + resolution: {integrity: sha512-8hDVvW9eu4yHWnjaOOR8kHVrew1iIX+MUgwxSuH2XyYeNRtLUe4VNioSqbNkB7ZYQJj9rUTT4PyRscyk2PXFKA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [linux] - '@img/sharp-linuxmusl-x64@0.34.3': - resolution: {integrity: sha512-gCWUn9547K5bwvOn9l5XGAEjVTTRji4aPTqLzGXHvIr6bIDZKNTA34seMPgM0WmSf+RYBH411VavCejp3PkOeQ==} + '@img/sharp-linuxmusl-x64@0.34.4': + resolution: {integrity: sha512-lU0aA5L8QTlfKjpDCEFOZsTYGn3AEiO6db8W5aQDxj0nQkVrZWmN3ZP9sYKWJdtq3PWPhUNlqehWyXpYDcI9Sg==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [linux] - '@img/sharp-wasm32@0.34.3': - resolution: {integrity: sha512-+CyRcpagHMGteySaWos8IbnXcHgfDn7pO2fiC2slJxvNq9gDipYBN42/RagzctVRKgxATmfqOSulgZv5e1RdMg==} + '@img/sharp-wasm32@0.34.4': + resolution: {integrity: sha512-33QL6ZO/qpRyG7woB/HUALz28WnTMI2W1jgX3Nu2bypqLIKx/QKMILLJzJjI+SIbvXdG9fUnmrxR7vbi1sTBeA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [wasm32] - '@img/sharp-win32-arm64@0.34.3': - resolution: {integrity: sha512-MjnHPnbqMXNC2UgeLJtX4XqoVHHlZNd+nPt1kRPmj63wURegwBhZlApELdtxM2OIZDRv/DFtLcNhVbd1z8GYXQ==} + '@img/sharp-win32-arm64@0.34.4': + resolution: {integrity: sha512-2Q250do/5WXTwxW3zjsEuMSv5sUU4Tq9VThWKlU2EYLm4MB7ZeMwF+SFJutldYODXF6jzc6YEOC+VfX0SZQPqA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [arm64] os: [win32] - '@img/sharp-win32-ia32@0.34.3': - resolution: {integrity: sha512-xuCdhH44WxuXgOM714hn4amodJMZl3OEvf0GVTm0BEyMeA2to+8HEdRPShH0SLYptJY1uBw+SCFP9WVQi1Q/cw==} + '@img/sharp-win32-ia32@0.34.4': + resolution: {integrity: sha512-3ZeLue5V82dT92CNL6rsal6I2weKw1cYu+rGKm8fOCCtJTR2gYeUfY3FqUnIJsMUPIH68oS5jmZ0NiJ508YpEw==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [ia32] os: [win32] - '@img/sharp-win32-x64@0.34.3': - resolution: {integrity: sha512-OWwz05d++TxzLEv4VnsTz5CmZ6mI6S05sfQGEMrNrQcOEERbX46332IvE7pO/EUiw7jUrrS40z/M7kPyjfl04g==} + '@img/sharp-win32-x64@0.34.4': + resolution: {integrity: sha512-xIyj4wpYs8J18sVN3mSQjwrw7fKUqRw+Z5rnHNCy5fYTxigBz81u5mOMPmFumwjcn8+ld1ppptMBCLic1nz6ig==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} cpu: [x64] os: [win32] @@ -963,56 +967,56 @@ packages: '@manypkg/get-packages@1.1.3': resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} - '@next/env@15.4.2': - resolution: {integrity: sha512-kd7MvW3pAP7tmk1NaiX4yG15xb2l4gNhteKQxt3f+NGR22qwPymn9RBuv26QKfIKmfo6z2NpgU8W2RT0s0jlvg==} + '@next/env@15.4.7': + resolution: {integrity: sha512-PrBIpO8oljZGTOe9HH0miix1w5MUiGJ/q83Jge03mHEE0E3pyqzAy2+l5G6aJDbXoobmxPJTVhbCuwlLtjSHwg==} '@next/eslint-plugin-next@15.4.2': resolution: {integrity: sha512-k0rjdWjXBY6tAOty1ckrMETE6Mx66d85NsgcAIdDp7/cXOsTJ93ywmbg3uUcpxX5TUHFEcCWI5mb8nPhwCe9jg==} - '@next/swc-darwin-arm64@15.4.2': - resolution: {integrity: sha512-ovqjR8NjCBdBf1U+R/Gvn0RazTtXS9n6wqs84iFaCS1NHbw9ksVE4dfmsYcLoyUVd9BWE0bjkphOWrrz8uz/uw==} + '@next/swc-darwin-arm64@15.4.7': + resolution: {integrity: sha512-2Dkb+VUTp9kHHkSqtws4fDl2Oxms29HcZBwFIda1X7Ztudzy7M6XF9HDS2dq85TmdN47VpuhjE+i6wgnIboVzQ==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] - '@next/swc-darwin-x64@15.4.2': - resolution: {integrity: sha512-I8d4W7tPqbdbHRI4z1iBfaoJIBrEG4fnWKIe+Rj1vIucNZ5cEinfwkBt3RcDF00bFRZRDpvKuDjgMFD3OyRBnw==} + '@next/swc-darwin-x64@15.4.7': + resolution: {integrity: sha512-qaMnEozKdWezlmh1OGDVFueFv2z9lWTcLvt7e39QA3YOvZHNpN2rLs/IQLwZaUiw2jSvxW07LxMCWtOqsWFNQg==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] - '@next/swc-linux-arm64-gnu@15.4.2': - resolution: {integrity: sha512-lvhz02dU3Ec5thzfQ2RCUeOFADjNkS/px1W7MBt7HMhf0/amMfT8Z/aXOwEA+cVWN7HSDRSUc8hHILoHmvajsg==} + '@next/swc-linux-arm64-gnu@15.4.7': + resolution: {integrity: sha512-ny7lODPE7a15Qms8LZiN9wjNWIeI+iAZOFDOnv2pcHStncUr7cr9lD5XF81mdhrBXLUP9yT9RzlmSWKIazWoDw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@next/swc-linux-arm64-musl@15.4.2': - resolution: {integrity: sha512-v+5PPfL8UP+KKHS3Mox7QMoeFdMlaV0zeNMIF7eLC4qTiVSO0RPNnK0nkBZSD5BEkkf//c+vI9s/iHxddCZchA==} + '@next/swc-linux-arm64-musl@15.4.7': + resolution: {integrity: sha512-4SaCjlFR/2hGJqZLLWycccy1t+wBrE/vyJWnYaZJhUVHccpGLG5q0C+Xkw4iRzUIkE+/dr90MJRUym3s1+vO8A==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@next/swc-linux-x64-gnu@15.4.2': - resolution: {integrity: sha512-PHLYOC9W2cu6I/JEKo77+LW4uPNvyEQiSkVRUQPsOIsf01PRr8PtPhwtz3XNnC9At8CrzPkzqQ9/kYDg4R4Inw==} + '@next/swc-linux-x64-gnu@15.4.7': + resolution: {integrity: sha512-2uNXjxvONyRidg00VwvlTYDwC9EgCGNzPAPYbttIATZRxmOZ3hllk/YYESzHZb65eyZfBR5g9xgCZjRAl9YYGg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@next/swc-linux-x64-musl@15.4.2': - resolution: {integrity: sha512-lpmUF9FfLFns4JbTu+5aJGA8aR9dXaA12eoNe9CJbVkGib0FDiPa4kBGTwy0xDxKNGlv3bLDViyx1U+qafmuJQ==} + '@next/swc-linux-x64-musl@15.4.7': + resolution: {integrity: sha512-ceNbPjsFgLscYNGKSu4I6LYaadq2B8tcK116nVuInpHHdAWLWSwVK6CHNvCi0wVS9+TTArIFKJGsEyVD1H+4Kg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@next/swc-win32-arm64-msvc@15.4.2': - resolution: {integrity: sha512-aMjogoGnRepas0LQ/PBPsvvUzj+IoXw2IoDSEShEtrsu2toBiaxEWzOQuPZ8nie8+1iF7TA63S7rlp3YWAjNEg==} + '@next/swc-win32-arm64-msvc@15.4.7': + resolution: {integrity: sha512-pZyxmY1iHlZJ04LUL7Css8bNvsYAMYOY9JRwFA3HZgpaNKsJSowD09Vg2R9734GxAcLJc2KDQHSCR91uD6/AAw==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] - '@next/swc-win32-x64-msvc@15.4.2': - resolution: {integrity: sha512-FxwauyexSFu78wEqR/+NB9MnqXVj6SxJKwcVs2CRjeSX/jBagDCgtR2W36PZUYm0WPgY1pQ3C1+nn7zSnwROuw==} + '@next/swc-win32-x64-msvc@15.4.7': + resolution: {integrity: sha512-HjuwPJ7BeRzgl3KrjKqD2iDng0eQIpIReyhpF5r4yeAHFwWRuAhfW92rWv/r3qeQHEwHsLRzFDvMqRjyM5DI6A==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -1532,8 +1536,8 @@ packages: camel-case@3.0.0: resolution: {integrity: sha512-+MbKztAYHXPr1jNTSKQF52VpcFjwY5RkR7fxksV8Doo4KAYc5Fl4UJRgthBbTmEx8C54DqahhbLJkDwjI3PI/w==} - caniuse-lite@1.0.30001727: - resolution: {integrity: sha512-pB68nIHmbN6L/4C6MH1DokyR3bYqFwjaSs/sWDHGj4CTcFtQUQMuJftVwWkXq7mNWOybD3KhUv3oWHoGxgP14Q==} + caniuse-lite@1.0.30001743: + resolution: {integrity: sha512-e6Ojr7RV14Un7dz6ASD0aZDmQPT/A+eZU+nuTNfjqmRrmkmQlnTNWH0SKmqagx9PeW87UVqapSurtAXifmtdmw==} cbor2@1.12.0: resolution: {integrity: sha512-3Cco8XQhi27DogSp9Ri6LYNZLi/TBY/JVnDe+mj06NkBjW/ZYOtekaEU4wZ4xcRMNrFkDv8KNtOAqHyDfz3lYg==} @@ -1613,13 +1617,6 @@ packages: color-name@1.1.4: resolution: {integrity: sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==} - color-string@1.9.1: - resolution: {integrity: sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==} - - color@4.2.3: - resolution: {integrity: sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==} - engines: {node: '>=12.5.0'} - commander@10.0.1: resolution: {integrity: sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==} engines: {node: '>=14'} @@ -1711,8 +1708,8 @@ packages: resolution: {integrity: sha512-reYkTUJAZb9gUuZ2RvVCNhVHdg62RHnJ7WJl8ftMi4diZ6NWlciOzQN88pUhSELEwflJht4oQDv0F0BMlwaYtA==} engines: {node: '>=8'} - detect-libc@2.0.4: - resolution: {integrity: sha512-3UDv+G9CsCKO1WKMGw9fwq/SWJYbI0c5Y7LU1AXYoDdbhE2AHQ6N6Nb34sG8Fj7T5APy8qXDCKuuIHd1BR0tVA==} + detect-libc@2.1.0: + resolution: {integrity: sha512-vEtk+OcP7VBRtQZ1EJ3bdgzSfBjgnEalLTp5zjJrS+2Z1w2KZly4SBdac/WDU3hhsNAZ9E8SC96ME4Ey8MZ7cg==} engines: {node: '>=8'} diff@4.0.2: @@ -2209,9 +2206,6 @@ packages: resolution: {integrity: sha512-DDfANUiiG2wC1qawP66qlTugJeL5HyzMpfr8lLK+jMQirGzNod0B12cFB/9q838Ru27sBwfw78/rdoU7RERz6A==} engines: {node: '>= 0.4'} - is-arrayish@0.3.2: - resolution: {integrity: sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==} - is-async-function@2.1.1: resolution: {integrity: sha512-9dgM/cZBnNvjzaMYHVoxxfPj2QXt22Ev7SuuPrs+xav0ukGB0S6d4ydZdEiM48kLx5kDV+QBPrpVnFyefL8kkQ==} engines: {node: '>= 0.4'} @@ -2636,8 +2630,8 @@ packages: resolution: {integrity: sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==} engines: {node: '>= 0.4.0'} - next@15.4.2: - resolution: {integrity: sha512-oH1rmFso+84NIkocfuxaGKcXIjMUTmnzV2x0m8qsYtB4gD6iflLMESXt5XJ8cFgWMBei4v88rNr/j+peNg72XA==} + next@15.4.7: + resolution: {integrity: sha512-OcqRugwF7n7mC8OSYjvsZhhG1AYSvulor1EIUsIkbbEbf1qoE5EbH36Swj8WhF4cHqmDgkiam3z1c1W0J1Wifg==} engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0} hasBin: true peerDependencies: @@ -3065,8 +3059,8 @@ packages: resolution: {integrity: sha512-RJRdvCo6IAnPdsvP/7m6bsQqNnn1FCBX5ZNtFL98MmFF/4xAIJTIg1YbHW5DC2W5SKZanrC6i4HsJqlajw/dZw==} engines: {node: '>= 0.4'} - sharp@0.34.3: - resolution: {integrity: sha512-eX2IQ6nFohW4DbvHIOLRB3MHFpYqaqvXd3Tp5e/T/dSH83fxaNJQRvDMhASmkNTsNTVF2/OOopzRCt7xokgPfg==} + sharp@0.34.4: + resolution: {integrity: sha512-FUH39xp3SBPnxWvd5iib1X8XY7J0K0X7d93sie9CJg2PO8/7gmg89Nve6OjItK53/MlAushNNxteBYfM6DEuoA==} engines: {node: ^18.17.0 || ^20.3.0 || >=21.0.0} shebang-command@2.0.0: @@ -3107,9 +3101,6 @@ packages: resolution: {integrity: sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==} engines: {node: '>=14'} - simple-swizzle@0.2.2: - resolution: {integrity: sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==} - simple-update-notifier@2.0.0: resolution: {integrity: sha512-a2B9Y0KlNXl9u/vsW6sTIu9vGEpfKu2wRV6l1H3XEas/0gUIzGzBoP/IouTcUQbm9JWZLH3COxyn03TYlFax6w==} engines: {node: '>=10'} @@ -3813,7 +3804,7 @@ snapshots: dependencies: '@jridgewell/trace-mapping': 0.3.9 - '@emnapi/runtime@1.4.5': + '@emnapi/runtime@1.5.0': dependencies: tslib: 2.8.1 optional: true @@ -3953,90 +3944,93 @@ snapshots: '@humanwhocodes/retry@0.4.3': {} - '@img/sharp-darwin-arm64@0.34.3': + '@img/colour@1.0.0': + optional: true + + '@img/sharp-darwin-arm64@0.34.4': optionalDependencies: - '@img/sharp-libvips-darwin-arm64': 1.2.0 + '@img/sharp-libvips-darwin-arm64': 1.2.3 optional: true - '@img/sharp-darwin-x64@0.34.3': + '@img/sharp-darwin-x64@0.34.4': optionalDependencies: - '@img/sharp-libvips-darwin-x64': 1.2.0 + '@img/sharp-libvips-darwin-x64': 1.2.3 optional: true - '@img/sharp-libvips-darwin-arm64@1.2.0': + '@img/sharp-libvips-darwin-arm64@1.2.3': optional: true - '@img/sharp-libvips-darwin-x64@1.2.0': + '@img/sharp-libvips-darwin-x64@1.2.3': optional: true - '@img/sharp-libvips-linux-arm64@1.2.0': + '@img/sharp-libvips-linux-arm64@1.2.3': optional: true - '@img/sharp-libvips-linux-arm@1.2.0': + '@img/sharp-libvips-linux-arm@1.2.3': optional: true - '@img/sharp-libvips-linux-ppc64@1.2.0': + '@img/sharp-libvips-linux-ppc64@1.2.3': optional: true - '@img/sharp-libvips-linux-s390x@1.2.0': + '@img/sharp-libvips-linux-s390x@1.2.3': optional: true - '@img/sharp-libvips-linux-x64@1.2.0': + '@img/sharp-libvips-linux-x64@1.2.3': optional: true - '@img/sharp-libvips-linuxmusl-arm64@1.2.0': + '@img/sharp-libvips-linuxmusl-arm64@1.2.3': optional: true - '@img/sharp-libvips-linuxmusl-x64@1.2.0': + '@img/sharp-libvips-linuxmusl-x64@1.2.3': optional: true - '@img/sharp-linux-arm64@0.34.3': + '@img/sharp-linux-arm64@0.34.4': optionalDependencies: - '@img/sharp-libvips-linux-arm64': 1.2.0 + '@img/sharp-libvips-linux-arm64': 1.2.3 optional: true - '@img/sharp-linux-arm@0.34.3': + '@img/sharp-linux-arm@0.34.4': optionalDependencies: - '@img/sharp-libvips-linux-arm': 1.2.0 + '@img/sharp-libvips-linux-arm': 1.2.3 optional: true - '@img/sharp-linux-ppc64@0.34.3': + '@img/sharp-linux-ppc64@0.34.4': optionalDependencies: - '@img/sharp-libvips-linux-ppc64': 1.2.0 + '@img/sharp-libvips-linux-ppc64': 1.2.3 optional: true - '@img/sharp-linux-s390x@0.34.3': + '@img/sharp-linux-s390x@0.34.4': optionalDependencies: - '@img/sharp-libvips-linux-s390x': 1.2.0 + '@img/sharp-libvips-linux-s390x': 1.2.3 optional: true - '@img/sharp-linux-x64@0.34.3': + '@img/sharp-linux-x64@0.34.4': optionalDependencies: - '@img/sharp-libvips-linux-x64': 1.2.0 + '@img/sharp-libvips-linux-x64': 1.2.3 optional: true - '@img/sharp-linuxmusl-arm64@0.34.3': + '@img/sharp-linuxmusl-arm64@0.34.4': optionalDependencies: - '@img/sharp-libvips-linuxmusl-arm64': 1.2.0 + '@img/sharp-libvips-linuxmusl-arm64': 1.2.3 optional: true - '@img/sharp-linuxmusl-x64@0.34.3': + '@img/sharp-linuxmusl-x64@0.34.4': optionalDependencies: - '@img/sharp-libvips-linuxmusl-x64': 1.2.0 + '@img/sharp-libvips-linuxmusl-x64': 1.2.3 optional: true - '@img/sharp-wasm32@0.34.3': + '@img/sharp-wasm32@0.34.4': dependencies: - '@emnapi/runtime': 1.4.5 + '@emnapi/runtime': 1.5.0 optional: true - '@img/sharp-win32-arm64@0.34.3': + '@img/sharp-win32-arm64@0.34.4': optional: true - '@img/sharp-win32-ia32@0.34.3': + '@img/sharp-win32-ia32@0.34.4': optional: true - '@img/sharp-win32-x64@0.34.3': + '@img/sharp-win32-x64@0.34.4': optional: true '@isaacs/balanced-match@4.0.1': {} @@ -4091,34 +4085,34 @@ snapshots: globby: 11.1.0 read-yaml-file: 1.1.0 - '@next/env@15.4.2': {} + '@next/env@15.4.7': {} '@next/eslint-plugin-next@15.4.2': dependencies: fast-glob: 3.3.1 - '@next/swc-darwin-arm64@15.4.2': + '@next/swc-darwin-arm64@15.4.7': optional: true - '@next/swc-darwin-x64@15.4.2': + '@next/swc-darwin-x64@15.4.7': optional: true - '@next/swc-linux-arm64-gnu@15.4.2': + '@next/swc-linux-arm64-gnu@15.4.7': optional: true - '@next/swc-linux-arm64-musl@15.4.2': + '@next/swc-linux-arm64-musl@15.4.7': optional: true - '@next/swc-linux-x64-gnu@15.4.2': + '@next/swc-linux-x64-gnu@15.4.7': optional: true - '@next/swc-linux-x64-musl@15.4.2': + '@next/swc-linux-x64-musl@15.4.7': optional: true - '@next/swc-win32-arm64-msvc@15.4.2': + '@next/swc-win32-arm64-msvc@15.4.7': optional: true - '@next/swc-win32-x64-msvc@15.4.2': + '@next/swc-win32-x64-msvc@15.4.7': optional: true '@noble/ciphers@1.3.0': {} @@ -4698,7 +4692,7 @@ snapshots: no-case: 2.3.2 upper-case: 1.1.3 - caniuse-lite@1.0.30001727: {} + caniuse-lite@1.0.30001743: {} cbor2@1.12.0: {} @@ -4797,18 +4791,6 @@ snapshots: color-name@1.1.4: {} - color-string@1.9.1: - dependencies: - color-name: 1.1.4 - simple-swizzle: 0.2.2 - optional: true - - color@4.2.3: - dependencies: - color-convert: 2.0.1 - color-string: 1.9.1 - optional: true - commander@10.0.1: {} concat-map@0.0.1: {} @@ -4913,7 +4895,7 @@ snapshots: detect-indent@6.1.0: {} - detect-libc@2.0.4: + detect-libc@2.1.0: optional: true diff@4.0.2: {} @@ -5595,9 +5577,6 @@ snapshots: call-bound: 1.0.4 get-intrinsic: 1.3.0 - is-arrayish@0.3.2: - optional: true - is-async-function@2.1.1: dependencies: async-function: 1.0.0 @@ -5983,25 +5962,25 @@ snapshots: netmask@2.0.2: {} - next@15.4.2(react-dom@19.1.0(react@19.1.0))(react@19.1.0): + next@15.4.7(react-dom@19.1.0(react@19.1.0))(react@19.1.0): dependencies: - '@next/env': 15.4.2 + '@next/env': 15.4.7 '@swc/helpers': 0.5.15 - caniuse-lite: 1.0.30001727 + caniuse-lite: 1.0.30001743 postcss: 8.4.31 react: 19.1.0 react-dom: 19.1.0(react@19.1.0) styled-jsx: 5.1.6(react@19.1.0) optionalDependencies: - '@next/swc-darwin-arm64': 15.4.2 - '@next/swc-darwin-x64': 15.4.2 - '@next/swc-linux-arm64-gnu': 15.4.2 - '@next/swc-linux-arm64-musl': 15.4.2 - '@next/swc-linux-x64-gnu': 15.4.2 - '@next/swc-linux-x64-musl': 15.4.2 - '@next/swc-win32-arm64-msvc': 15.4.2 - '@next/swc-win32-x64-msvc': 15.4.2 - sharp: 0.34.3 + '@next/swc-darwin-arm64': 15.4.7 + '@next/swc-darwin-x64': 15.4.7 + '@next/swc-linux-arm64-gnu': 15.4.7 + '@next/swc-linux-arm64-musl': 15.4.7 + '@next/swc-linux-x64-gnu': 15.4.7 + '@next/swc-linux-x64-musl': 15.4.7 + '@next/swc-win32-arm64-msvc': 15.4.7 + '@next/swc-win32-x64-msvc': 15.4.7 + sharp: 0.34.4 transitivePeerDependencies: - '@babel/core' - babel-plugin-macros @@ -6516,34 +6495,34 @@ snapshots: es-errors: 1.3.0 es-object-atoms: 1.1.1 - sharp@0.34.3: + sharp@0.34.4: dependencies: - color: 4.2.3 - detect-libc: 2.0.4 + '@img/colour': 1.0.0 + detect-libc: 2.1.0 semver: 7.7.2 optionalDependencies: - '@img/sharp-darwin-arm64': 0.34.3 - '@img/sharp-darwin-x64': 0.34.3 - '@img/sharp-libvips-darwin-arm64': 1.2.0 - '@img/sharp-libvips-darwin-x64': 1.2.0 - '@img/sharp-libvips-linux-arm': 1.2.0 - '@img/sharp-libvips-linux-arm64': 1.2.0 - '@img/sharp-libvips-linux-ppc64': 1.2.0 - '@img/sharp-libvips-linux-s390x': 1.2.0 - '@img/sharp-libvips-linux-x64': 1.2.0 - '@img/sharp-libvips-linuxmusl-arm64': 1.2.0 - '@img/sharp-libvips-linuxmusl-x64': 1.2.0 - '@img/sharp-linux-arm': 0.34.3 - '@img/sharp-linux-arm64': 0.34.3 - '@img/sharp-linux-ppc64': 0.34.3 - '@img/sharp-linux-s390x': 0.34.3 - '@img/sharp-linux-x64': 0.34.3 - '@img/sharp-linuxmusl-arm64': 0.34.3 - '@img/sharp-linuxmusl-x64': 0.34.3 - '@img/sharp-wasm32': 0.34.3 - '@img/sharp-win32-arm64': 0.34.3 - '@img/sharp-win32-ia32': 0.34.3 - '@img/sharp-win32-x64': 0.34.3 + '@img/sharp-darwin-arm64': 0.34.4 + '@img/sharp-darwin-x64': 0.34.4 + '@img/sharp-libvips-darwin-arm64': 1.2.3 + '@img/sharp-libvips-darwin-x64': 1.2.3 + '@img/sharp-libvips-linux-arm': 1.2.3 + '@img/sharp-libvips-linux-arm64': 1.2.3 + '@img/sharp-libvips-linux-ppc64': 1.2.3 + '@img/sharp-libvips-linux-s390x': 1.2.3 + '@img/sharp-libvips-linux-x64': 1.2.3 + '@img/sharp-libvips-linuxmusl-arm64': 1.2.3 + '@img/sharp-libvips-linuxmusl-x64': 1.2.3 + '@img/sharp-linux-arm': 0.34.4 + '@img/sharp-linux-arm64': 0.34.4 + '@img/sharp-linux-ppc64': 0.34.4 + '@img/sharp-linux-s390x': 0.34.4 + '@img/sharp-linux-x64': 0.34.4 + '@img/sharp-linuxmusl-arm64': 0.34.4 + '@img/sharp-linuxmusl-x64': 0.34.4 + '@img/sharp-wasm32': 0.34.4 + '@img/sharp-win32-arm64': 0.34.4 + '@img/sharp-win32-ia32': 0.34.4 + '@img/sharp-win32-x64': 0.34.4 optional: true shebang-command@2.0.0: @@ -6588,11 +6567,6 @@ snapshots: signal-exit@4.1.0: {} - simple-swizzle@0.2.2: - dependencies: - is-arrayish: 0.3.2 - optional: true - simple-update-notifier@2.0.0: dependencies: semver: 7.7.2 From ceb95d4dabe7488255fe86fbb995f75541d4b36c Mon Sep 17 00:00:00 2001 From: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> Date: Sun, 28 Sep 2025 01:56:17 +0700 Subject: [PATCH 02/36] Update issue templates --- .github/ISSUE_TEMPLATE/bug_report.md | 38 +++++++++++++++++++++++ .github/ISSUE_TEMPLATE/custom.md | 10 ++++++ .github/ISSUE_TEMPLATE/feature_request.md | 20 ++++++++++++ 3 files changed, 68 insertions(+) create mode 100644 .github/ISSUE_TEMPLATE/bug_report.md create mode 100644 .github/ISSUE_TEMPLATE/custom.md create mode 100644 .github/ISSUE_TEMPLATE/feature_request.md diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000000..dd84ea7824 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,38 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Desktop (please complete the following information):** + - OS: [e.g. iOS] + - Browser [e.g. chrome, safari] + - Version [e.g. 22] + +**Smartphone (please complete the following information):** + - Device: [e.g. iPhone6] + - OS: [e.g. iOS8.1] + - Browser [e.g. stock browser, safari] + - Version [e.g. 22] + +**Additional context** +Add any other context about the problem here. diff --git a/.github/ISSUE_TEMPLATE/custom.md b/.github/ISSUE_TEMPLATE/custom.md new file mode 100644 index 0000000000..48d5f81fa4 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/custom.md @@ -0,0 +1,10 @@ +--- +name: Custom issue template +about: Describe this issue template's purpose here. +title: '' +labels: '' +assignees: '' + +--- + + diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md new file mode 100644 index 0000000000..bbcbbe7d61 --- /dev/null +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -0,0 +1,20 @@ +--- +name: Feature request +about: Suggest an idea for this project +title: '' +labels: '' +assignees: '' + +--- + +**Is your feature request related to a problem? Please describe.** +A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] + +**Describe the solution you'd like** +A clear and concise description of what you want to happen. + +**Describe alternatives you've considered** +A clear and concise description of any alternative solutions or features you've considered. + +**Additional context** +Add any other context or screenshots about the feature request here. From 1869b3baf439da0de1678be65434d56224b8b0be Mon Sep 17 00:00:00 2001 From: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> Date: Tue, 7 Oct 2025 20:56:49 +0700 Subject: [PATCH 03/36] Potential fix for code scanning alert no. 84: Insecure randomness Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> --- packages/wallet/dapp-client/src/DappTransport.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/packages/wallet/dapp-client/src/DappTransport.ts b/packages/wallet/dapp-client/src/DappTransport.ts index 072fa056f4..2dc898f746 100644 --- a/packages/wallet/dapp-client/src/DappTransport.ts +++ b/packages/wallet/dapp-client/src/DappTransport.ts @@ -513,6 +513,10 @@ export class DappTransport { } private generateId(): string { - return `${Date.now().toString(36)}-${Math.random().toString(36).substring(2, 9)}` + // Use crypto.getRandomValues for cryptographically secure randomness + const array = new Uint32Array(1); + window.crypto.getRandomValues(array); + const randStr = array[0].toString(36); + return `${Date.now().toString(36)}-${randStr}`; } } From d9fee1911012e066f39ded7079765f59cbdb2247 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Sat, 11 Oct 2025 00:07:52 +0000 Subject: [PATCH 04/36] Bump the npm_and_yarn group across 3 directories with 1 update Bumps the npm_and_yarn group with 1 update in the / directory: [happy-dom](https://github.com/capricorn86/happy-dom). Bumps the npm_and_yarn group with 1 update in the /packages/wallet/dapp-client directory: [happy-dom](https://github.com/capricorn86/happy-dom). Bumps the npm_and_yarn group with 1 update in the /packages/wallet/wdk directory: [happy-dom](https://github.com/capricorn86/happy-dom). Updates `happy-dom` from 17.6.3 to 20.0.0 - [Release notes](https://github.com/capricorn86/happy-dom/releases) - [Commits](https://github.com/capricorn86/happy-dom/compare/v17.6.3...v20.0.0) Updates `happy-dom` from 17.6.3 to 20.0.0 - [Release notes](https://github.com/capricorn86/happy-dom/releases) - [Commits](https://github.com/capricorn86/happy-dom/compare/v17.6.3...v20.0.0) Updates `happy-dom` from 17.6.3 to 20.0.0 - [Release notes](https://github.com/capricorn86/happy-dom/releases) - [Commits](https://github.com/capricorn86/happy-dom/compare/v17.6.3...v20.0.0) --- updated-dependencies: - dependency-name: happy-dom dependency-version: 20.0.0 dependency-type: direct:development dependency-group: npm_and_yarn - dependency-name: happy-dom dependency-version: 20.0.0 dependency-type: direct:development dependency-group: npm_and_yarn - dependency-name: happy-dom dependency-version: 20.0.0 dependency-type: direct:development dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] --- packages/wallet/dapp-client/package.json | 2 +- packages/wallet/wdk/package.json | 2 +- pnpm-lock.yaml | 67 +++++++++++++----------- 3 files changed, 39 insertions(+), 32 deletions(-) diff --git a/packages/wallet/dapp-client/package.json b/packages/wallet/dapp-client/package.json index c48f42aea8..8f22720508 100644 --- a/packages/wallet/dapp-client/package.json +++ b/packages/wallet/dapp-client/package.json @@ -25,7 +25,7 @@ "@vitest/coverage-v8": "^3.2.4", "dotenv": "^16.5.0", "fake-indexeddb": "^6.0.1", - "happy-dom": "^17.2.2", + "happy-dom": "^20.0.0", "typescript": "^5.8.3", "vitest": "^3.2.1" }, diff --git a/packages/wallet/wdk/package.json b/packages/wallet/wdk/package.json index 5b786b0fea..a50117564b 100644 --- a/packages/wallet/wdk/package.json +++ b/packages/wallet/wdk/package.json @@ -27,7 +27,7 @@ "@vitest/coverage-v8": "^3.2.4", "dotenv": "^16.5.0", "fake-indexeddb": "^6.0.1", - "happy-dom": "^17.2.2", + "happy-dom": "^20.0.0", "typescript": "^5.8.3", "vitest": "^3.2.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 494683100a..7907c4d8be 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -136,7 +136,7 @@ importers: version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@17.6.3) + version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.0) packages/services/identity-instrument: dependencies: @@ -161,7 +161,7 @@ importers: version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@17.6.3) + version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.0) packages/services/indexer: devDependencies: @@ -252,7 +252,7 @@ importers: version: 22.16.5 '@vitest/coverage-v8': specifier: ^3.2.4 - version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@17.6.3)) + version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.0)) dotenv: specifier: ^16.5.0 version: 16.6.1 @@ -264,7 +264,7 @@ importers: version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@17.6.3) + version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.0) packages/wallet/dapp-client: dependencies: @@ -289,7 +289,7 @@ importers: version: 22.16.5 '@vitest/coverage-v8': specifier: ^3.2.4 - version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@17.6.3)) + version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.0)) dotenv: specifier: ^16.5.0 version: 16.6.1 @@ -297,14 +297,14 @@ importers: specifier: ^6.0.1 version: 6.0.1 happy-dom: - specifier: ^17.2.2 - version: 17.6.3 + specifier: ^20.0.0 + version: 20.0.0 typescript: specifier: ^5.8.3 version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@17.6.3) + version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.0) packages/wallet/primitives: dependencies: @@ -317,13 +317,13 @@ importers: version: link:../../../repo/typescript-config '@vitest/coverage-v8': specifier: ^3.2.4 - version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@17.6.3)) + version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.0)) typescript: specifier: ^5.8.3 version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@17.6.3) + version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.0) packages/wallet/primitives-cli: dependencies: @@ -400,7 +400,7 @@ importers: version: 22.16.5 '@vitest/coverage-v8': specifier: ^3.2.4 - version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@17.6.3)) + version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.0)) dotenv: specifier: ^16.5.0 version: 16.6.1 @@ -408,14 +408,14 @@ importers: specifier: ^6.0.1 version: 6.0.1 happy-dom: - specifier: ^17.2.2 - version: 17.6.3 + specifier: ^20.0.0 + version: 20.0.0 typescript: specifier: ^5.8.3 version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@17.6.3) + version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.0) repo/eslint-config: devDependencies: @@ -1213,6 +1213,9 @@ packages: '@types/node@12.20.55': resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} + '@types/node@20.19.20': + resolution: {integrity: sha512-2Q7WS25j4pS1cS8yw3d6buNCVJukOTeQ39bAnwR6sOJbaxvyCGebzTMypDFN82CxBLnl+lSWVdCCWbRY6y9yZQ==} + '@types/node@20.19.9': resolution: {integrity: sha512-cuVNgarYWZqxRJDQHEB58GEONhOK79QVR/qYx4S7kcUObQvUwvFnYxJuuHUKm2aieN9X3yZB4LZsuYNU1Qphsw==} @@ -1240,6 +1243,9 @@ packages: '@types/tinycolor2@1.4.6': resolution: {integrity: sha512-iEN8J0BoMnsWBqjVbWH/c0G0Hh7O21lpR2/+PrvAVgWdzL7eexIFm4JN/Wn10PTcmNdtS6U67r499mlWMXOxNw==} + '@types/whatwg-mimetype@3.0.2': + resolution: {integrity: sha512-c2AKvDT8ToxLIOUlN51gTiHXflsfIFisS4pO7pDPoKouJCESkhZnEy623gwP9laCy5lnLDAw1vAzu2vM2YLOrA==} + '@types/yargs-parser@21.0.3': resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} @@ -2086,8 +2092,8 @@ packages: engines: {node: '>=0.4.7'} hasBin: true - happy-dom@17.6.3: - resolution: {integrity: sha512-UVIHeVhxmxedbWPCfgS55Jg2rDfwf2BCKeylcPSqazLz5w3Kri7Q4xdBJubsr/+VUzFLh0VjIvh13RaDA2/Xug==} + happy-dom@20.0.0: + resolution: {integrity: sha512-GkWnwIFxVGCf2raNrxImLo397RdGhLapj5cT3R2PT7FwL62Ze1DROhzmYW7+J3p9105DYMVenEejEbnq5wA37w==} engines: {node: '>=20.0.0'} has-bigints@1.1.0: @@ -3535,10 +3541,6 @@ packages: wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} - webidl-conversions@7.0.0: - resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} - engines: {node: '>=12'} - whatwg-mimetype@3.0.0: resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} engines: {node: '>=12'} @@ -4275,7 +4277,7 @@ snapshots: '@types/glob@7.2.0': dependencies: '@types/minimatch': 6.0.0 - '@types/node': 20.19.9 + '@types/node': 22.16.5 '@types/inquirer@6.5.0': dependencies: @@ -4290,6 +4292,10 @@ snapshots: '@types/node@12.20.55': {} + '@types/node@20.19.20': + dependencies: + undici-types: 6.21.0 + '@types/node@20.19.9': dependencies: undici-types: 6.21.0 @@ -4320,10 +4326,12 @@ snapshots: '@types/through@0.0.33': dependencies: - '@types/node': 20.19.9 + '@types/node': 22.16.5 '@types/tinycolor2@1.4.6': {} + '@types/whatwg-mimetype@3.0.2': {} + '@types/yargs-parser@21.0.3': {} '@types/yargs@17.0.33': @@ -4423,7 +4431,7 @@ snapshots: '@typescript-eslint/types': 8.38.0 eslint-visitor-keys: 4.2.1 - '@vitest/coverage-v8@3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@17.6.3))': + '@vitest/coverage-v8@3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.0))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 1.0.2 @@ -4438,7 +4446,7 @@ snapshots: std-env: 3.9.0 test-exclude: 7.0.1 tinyrainbow: 2.0.0 - vitest: 3.2.4(@types/node@22.16.5)(happy-dom@17.6.3) + vitest: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.0) transitivePeerDependencies: - supports-color @@ -5440,9 +5448,10 @@ snapshots: optionalDependencies: uglify-js: 3.19.3 - happy-dom@17.6.3: + happy-dom@20.0.0: dependencies: - webidl-conversions: 7.0.0 + '@types/node': 20.19.20 + '@types/whatwg-mimetype': 3.0.2 whatwg-mimetype: 3.0.0 has-bigints@1.1.0: {} @@ -6967,7 +6976,7 @@ snapshots: '@types/node': 22.16.5 fsevents: 2.3.3 - vitest@3.2.4(@types/node@22.16.5)(happy-dom@17.6.3): + vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.0): dependencies: '@types/chai': 5.2.2 '@vitest/expect': 3.2.4 @@ -6994,7 +7003,7 @@ snapshots: why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.16.5 - happy-dom: 17.6.3 + happy-dom: 20.0.0 transitivePeerDependencies: - jiti - less @@ -7013,8 +7022,6 @@ snapshots: dependencies: defaults: 1.0.4 - webidl-conversions@7.0.0: {} - whatwg-mimetype@3.0.0: {} which-boxed-primitive@1.1.1: From 0f335ff07e250786031528b06b11793267dd5010 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 17 Oct 2025 03:23:17 +0700 Subject: [PATCH 05/36] Bump happy-dom in the npm_and_yarn group across 1 directory (#69) Bumps the npm_and_yarn group with 1 update in the / directory: [happy-dom](https://github.com/capricorn86/happy-dom). Updates `happy-dom` from 20.0.0 to 20.0.2 - [Release notes](https://github.com/capricorn86/happy-dom/releases) - [Commits](https://github.com/capricorn86/happy-dom/compare/v20.0.0...v20.0.2) --- updated-dependencies: - dependency-name: happy-dom dependency-version: 20.0.2 dependency-type: direct:development dependency-group: npm_and_yarn ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- packages/wallet/dapp-client/package.json | 2 +- packages/wallet/wdk/package.json | 2 +- pnpm-lock.yaml | 50 ++++++++++++------------ 3 files changed, 27 insertions(+), 27 deletions(-) diff --git a/packages/wallet/dapp-client/package.json b/packages/wallet/dapp-client/package.json index 8f22720508..b10524e429 100644 --- a/packages/wallet/dapp-client/package.json +++ b/packages/wallet/dapp-client/package.json @@ -25,7 +25,7 @@ "@vitest/coverage-v8": "^3.2.4", "dotenv": "^16.5.0", "fake-indexeddb": "^6.0.1", - "happy-dom": "^20.0.0", + "happy-dom": "^20.0.2", "typescript": "^5.8.3", "vitest": "^3.2.1" }, diff --git a/packages/wallet/wdk/package.json b/packages/wallet/wdk/package.json index a50117564b..05e0a91710 100644 --- a/packages/wallet/wdk/package.json +++ b/packages/wallet/wdk/package.json @@ -27,7 +27,7 @@ "@vitest/coverage-v8": "^3.2.4", "dotenv": "^16.5.0", "fake-indexeddb": "^6.0.1", - "happy-dom": "^20.0.0", + "happy-dom": "^20.0.2", "typescript": "^5.8.3", "vitest": "^3.2.1" }, diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 7907c4d8be..450d5be82a 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -136,7 +136,7 @@ importers: version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.0) + version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.2) packages/services/identity-instrument: dependencies: @@ -161,7 +161,7 @@ importers: version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.0) + version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.2) packages/services/indexer: devDependencies: @@ -252,7 +252,7 @@ importers: version: 22.16.5 '@vitest/coverage-v8': specifier: ^3.2.4 - version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.0)) + version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.2)) dotenv: specifier: ^16.5.0 version: 16.6.1 @@ -264,7 +264,7 @@ importers: version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.0) + version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.2) packages/wallet/dapp-client: dependencies: @@ -289,7 +289,7 @@ importers: version: 22.16.5 '@vitest/coverage-v8': specifier: ^3.2.4 - version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.0)) + version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.2)) dotenv: specifier: ^16.5.0 version: 16.6.1 @@ -297,14 +297,14 @@ importers: specifier: ^6.0.1 version: 6.0.1 happy-dom: - specifier: ^20.0.0 - version: 20.0.0 + specifier: ^20.0.2 + version: 20.0.2 typescript: specifier: ^5.8.3 version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.0) + version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.2) packages/wallet/primitives: dependencies: @@ -317,13 +317,13 @@ importers: version: link:../../../repo/typescript-config '@vitest/coverage-v8': specifier: ^3.2.4 - version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.0)) + version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.2)) typescript: specifier: ^5.8.3 version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.0) + version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.2) packages/wallet/primitives-cli: dependencies: @@ -400,7 +400,7 @@ importers: version: 22.16.5 '@vitest/coverage-v8': specifier: ^3.2.4 - version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.0)) + version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.2)) dotenv: specifier: ^16.5.0 version: 16.6.1 @@ -408,14 +408,14 @@ importers: specifier: ^6.0.1 version: 6.0.1 happy-dom: - specifier: ^20.0.0 - version: 20.0.0 + specifier: ^20.0.2 + version: 20.0.2 typescript: specifier: ^5.8.3 version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.0) + version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.2) repo/eslint-config: devDependencies: @@ -1213,8 +1213,8 @@ packages: '@types/node@12.20.55': resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} - '@types/node@20.19.20': - resolution: {integrity: sha512-2Q7WS25j4pS1cS8yw3d6buNCVJukOTeQ39bAnwR6sOJbaxvyCGebzTMypDFN82CxBLnl+lSWVdCCWbRY6y9yZQ==} + '@types/node@20.19.21': + resolution: {integrity: sha512-CsGG2P3I5y48RPMfprQGfy4JPRZ6csfC3ltBZSRItG3ngggmNY/qs2uZKp4p9VbrpqNNSMzUZNFZKzgOGnd/VA==} '@types/node@20.19.9': resolution: {integrity: sha512-cuVNgarYWZqxRJDQHEB58GEONhOK79QVR/qYx4S7kcUObQvUwvFnYxJuuHUKm2aieN9X3yZB4LZsuYNU1Qphsw==} @@ -2092,8 +2092,8 @@ packages: engines: {node: '>=0.4.7'} hasBin: true - happy-dom@20.0.0: - resolution: {integrity: sha512-GkWnwIFxVGCf2raNrxImLo397RdGhLapj5cT3R2PT7FwL62Ze1DROhzmYW7+J3p9105DYMVenEejEbnq5wA37w==} + happy-dom@20.0.2: + resolution: {integrity: sha512-pYOyu624+6HDbY+qkjILpQGnpvZOusItCk+rvF5/V+6NkcgTKnbOldpIy22tBnxoaLtlM9nXgoqAcW29/B7CIw==} engines: {node: '>=20.0.0'} has-bigints@1.1.0: @@ -4292,7 +4292,7 @@ snapshots: '@types/node@12.20.55': {} - '@types/node@20.19.20': + '@types/node@20.19.21': dependencies: undici-types: 6.21.0 @@ -4431,7 +4431,7 @@ snapshots: '@typescript-eslint/types': 8.38.0 eslint-visitor-keys: 4.2.1 - '@vitest/coverage-v8@3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.0))': + '@vitest/coverage-v8@3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.2))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 1.0.2 @@ -4446,7 +4446,7 @@ snapshots: std-env: 3.9.0 test-exclude: 7.0.1 tinyrainbow: 2.0.0 - vitest: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.0) + vitest: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.2) transitivePeerDependencies: - supports-color @@ -5448,9 +5448,9 @@ snapshots: optionalDependencies: uglify-js: 3.19.3 - happy-dom@20.0.0: + happy-dom@20.0.2: dependencies: - '@types/node': 20.19.20 + '@types/node': 20.19.21 '@types/whatwg-mimetype': 3.0.2 whatwg-mimetype: 3.0.0 @@ -6976,7 +6976,7 @@ snapshots: '@types/node': 22.16.5 fsevents: 2.3.3 - vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.0): + vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.2): dependencies: '@types/chai': 5.2.2 '@vitest/expect': 3.2.4 @@ -7003,7 +7003,7 @@ snapshots: why-is-node-running: 2.3.0 optionalDependencies: '@types/node': 22.16.5 - happy-dom: 20.0.0 + happy-dom: 20.0.2 transitivePeerDependencies: - jiti - less From 8f663e9f31752a42d5732ca2b8cb43ba7df77ff8 Mon Sep 17 00:00:00 2001 From: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> Date: Thu, 16 Oct 2025 20:31:39 +0000 Subject: [PATCH 06/36] Create SECURITY.md for security policy (#70) * Create SECURITY.md for security policy Add a security policy document outlining supported versions and vulnerability reporting. Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> * Update SECURITY.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> * Update SECURITY.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> --------- Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> --- SECURITY.md | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 SECURITY.md diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000000..9578d289d2 --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,18 @@ +# Security Policy + +## Supported Versions + +Use this section to tell people about which versions of your project are +currently being supported with security updates. + +| Version | Supported | +| ------- | ------------------ | +| 3.x.x | :white_check_mark: | +| 2.x.x | :x: | +| < 2.0.0 | :x: | + +## Reporting a Vulnerability + +We take all security vulnerabilities seriously. To report a security vulnerability, please send an email with the details to `security@sequence.xyz`. + +You can expect a response from our team within 48 hours to acknowledge receipt of your report. If the vulnerability is accepted, we will work with you to coordinate a release and public disclosure. We appreciate your efforts to responsibly disclose your findings. From d332645806c8e2ab6c7f728ff489ab8c3e90cebd Mon Sep 17 00:00:00 2001 From: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> Date: Fri, 17 Oct 2025 05:10:42 +0700 Subject: [PATCH 07/36] Update SECURITY.md Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: AU_gdev_19 <64915515+Dargon789@users.noreply.github.com> --- SECURITY.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SECURITY.md b/SECURITY.md index 9578d289d2..6036e354a3 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -13,6 +13,6 @@ currently being supported with security updates. ## Reporting a Vulnerability -We take all security vulnerabilities seriously. To report a security vulnerability, please send an email with the details to `security@sequence.xyz`. +We take all security vulnerabilities seriously. To report a security vulnerability, please send an email with the details to [security@sequence.xyz](mailto:security@sequence.xyz). You can expect a response from our team within 48 hours to acknowledge receipt of your report. If the vulnerability is accepted, we will work with you to coordinate a release and public disclosure. We appreciate your efforts to responsibly disclose your findings. From 6fde7c5442d58576167654dc015751fda1054ad0 Mon Sep 17 00:00:00 2001 From: Dargon789 <64915515+Dargon789@users.noreply.github.com> Date: Fri, 14 Nov 2025 16:03:27 +0700 Subject: [PATCH 08/36] Update SECURITY.md Co-authored-by: sourcery-ai[bot] <58596630+sourcery-ai[bot]@users.noreply.github.com> Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> --- SECURITY.md | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/SECURITY.md b/SECURITY.md index 6036e354a3..7f1c49926a 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -2,8 +2,7 @@ ## Supported Versions -Use this section to tell people about which versions of your project are -currently being supported with security updates. +The following table lists which versions of this project currently receive security updates. | Version | Supported | | ------- | ------------------ | From ccb30b372385d09569a9ddd74522597d07a06d90 Mon Sep 17 00:00:00 2001 From: Dargon789 <64915515+Dargon789@users.noreply.github.com> Date: Fri, 14 Nov 2025 16:08:56 +0700 Subject: [PATCH 09/36] Update packages/wallet/dapp-client/src/DappTransport.ts Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com> Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> --- packages/wallet/dapp-client/src/DappTransport.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/wallet/dapp-client/src/DappTransport.ts b/packages/wallet/dapp-client/src/DappTransport.ts index 2dc898f746..a01494695b 100644 --- a/packages/wallet/dapp-client/src/DappTransport.ts +++ b/packages/wallet/dapp-client/src/DappTransport.ts @@ -514,9 +514,9 @@ export class DappTransport { private generateId(): string { // Use crypto.getRandomValues for cryptographically secure randomness - const array = new Uint32Array(1); + const array = new Uint32Array(2); window.crypto.getRandomValues(array); - const randStr = array[0].toString(36); + const randStr = (array[0].toString(36) + array[1].toString(36)).slice(0, 9); return `${Date.now().toString(36)}-${randStr}`; } } From 3487525d06c5da7be774f47e0daa76dfd023e94c Mon Sep 17 00:00:00 2001 From: Dargon789 <64915515+Dargon789@users.noreply.github.com> Date: Mon, 17 Nov 2025 18:35:09 +0700 Subject: [PATCH 10/36] Create FUNDING.json (#90) Enhancements: Include FUNDING.json to display GitHub sponsorship options in the repository Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> --- FUNDING.json | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 FUNDING.json diff --git a/FUNDING.json b/FUNDING.json new file mode 100644 index 0000000000..cb7bbaf783 --- /dev/null +++ b/FUNDING.json @@ -0,0 +1,10 @@ +{ + "drips": { + "ethereum": { + "ownedBy": "0x9a72807e1BC8A5e1E178f51E26239d58F511EB3D" + } + }, + "opRetro": { + "projectId": "0x62408999652f3bfa1be746d256bf5a4eb4719b993d40f07d2d60aaebee015018" + } +} From 4fb3c51cb122a91e6193282c5e7303046c1a7fee Mon Sep 17 00:00:00 2001 From: Dargon789 <64915515+Dargon789@users.noreply.github.com> Date: Mon, 17 Nov 2025 18:52:27 +0700 Subject: [PATCH 11/36] Create config.yml (#91) Add initial CircleCI configuration to enable automated builds using a custom Docker executor and a defined workflow. Build: Add .circleci/config.yml with version 2.1 specification and custom Docker executor. CI: Define web3-defi-game-project job with checkout step. Set up my-custom-workflow to run the job. Signed-off-by: Dargon789 <64915515+Dargon789@users.noreply.github.com> --- .circleci/config.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .circleci/config.yml diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000000..68b7dfb9fb --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,24 @@ +# Use the latest 2.1 version of CircleCI pipeline process engine. +# See: https://circleci.com/docs/configuration-reference + +version: 2.1 +executors: + my-custom-executor: + docker: + - image: cimg/base:stable + auth: + # ensure you have first added these secrets + # visit app.circleci.com/settings/project/github/Dargon789/hardhat-project/environment-variables + username: $DOCKER_HUB_USER + password: $DOCKER_HUB_PASSWORD +jobs: + web3-defi-game-project-: + + executor: my-custom-executor + steps: + - checkout + +workflows: + my-custom-workflow: + jobs: + - web3-defi-game-project- From 762371fdd508c3c87f25aa044407db9c2135ea45 Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Tue, 16 Sep 2025 15:26:43 +1200 Subject: [PATCH 12/36] Support multiple identity signers in sessions configuration --- .../core/src/signers/session-manager.ts | 16 +- .../core/src/signers/session/implicit.ts | 12 +- .../core/src/signers/session/session.ts | 8 + packages/wallet/core/test/constants.ts | 5 +- .../wallet/core/test/session-manager.test.ts | 186 +++++++++++++++++- .../primitives-cli/src/subcommands/server.ts | 3 +- .../primitives-cli/src/subcommands/session.ts | 2 + .../wallet/primitives/src/session-config.ts | 136 +++++++++---- .../primitives/src/session-signature.ts | 28 ++- .../primitives/test/session-config.test.ts | 41 ++-- .../primitives/test/session-signature.test.ts | 7 + packages/wallet/wdk/src/sequence/sessions.ts | 35 +++- 12 files changed, 385 insertions(+), 94 deletions(-) diff --git a/packages/wallet/core/src/signers/session-manager.ts b/packages/wallet/core/src/signers/session-manager.ts index 3cd40ef00d..12917553bc 100644 --- a/packages/wallet/core/src/signers/session-manager.ts +++ b/packages/wallet/core/src/signers/session-manager.ts @@ -17,6 +17,7 @@ import { isExplicitSessionSigner, SessionSigner, SessionSignerInvalidReason, + isImplicitSessionSigner, UsageLimit, } from './session/index.js' @@ -132,9 +133,9 @@ export class SessionManager implements SapientSigner { async findSignersForCalls(wallet: Address.Address, chainId: number, calls: Payload.Call[]): Promise { // Only use signers that match the topology const topology = await this.topology - const identitySigner = SessionConfig.getIdentitySigner(topology) - if (!identitySigner) { - throw new Error('Identity signer not found') + const identitySigners = SessionConfig.getIdentitySigners(topology) + if (identitySigners.length === 0) { + throw new Error('Identity signers not found') } const validImplicitSigners = this._implicitSigners.filter((signer) => signer.isValid(topology, chainId).isValid) const validExplicitSigners = this._explicitSigners.filter((signer) => signer.isValid(topology, chainId).isValid) @@ -294,6 +295,7 @@ export class SessionManager implements SapientSigner { // Encode the signature const explicitSigners: Address.Address[] = [] const implicitSigners: Address.Address[] = [] + let identitySigner: Address.Address | undefined await Promise.all( signers.map(async (signer) => { const address = await signer.address @@ -301,9 +303,14 @@ export class SessionManager implements SapientSigner { if (!explicitSigners.find((a) => Address.isEqual(a, address))) { explicitSigners.push(address) } - } else { + } else if (isImplicitSessionSigner(signer)) { if (!implicitSigners.find((a) => Address.isEqual(a, address))) { implicitSigners.push(address) + if (!identitySigner) { + identitySigner = signer.identitySigner + } else if (!Address.isEqual(identitySigner, signer.identitySigner)) { + throw new Error('Multiple implicit signers with different identity signers') + } } } }), @@ -314,6 +321,7 @@ export class SessionManager implements SapientSigner { await this.topology, explicitSigners, implicitSigners, + identitySigner, ) return { diff --git a/packages/wallet/core/src/signers/session/implicit.ts b/packages/wallet/core/src/signers/session/implicit.ts index 973da2b09e..4e74c3a0f0 100644 --- a/packages/wallet/core/src/signers/session/implicit.ts +++ b/packages/wallet/core/src/signers/session/implicit.ts @@ -8,11 +8,11 @@ import { } from '@0xsequence/wallet-primitives' import { AbiFunction, Address, Bytes, Hex, Provider, Secp256k1, Signature } from 'ox' import { MemoryPkStore, PkStore } from '../pk/index.js' -import { SessionSigner, SessionSignerValidity } from './session.js' +import { ImplicitSessionSigner, SessionSignerValidity } from './session.js' export type AttestationParams = Omit -export class Implicit implements SessionSigner { +export class Implicit implements ImplicitSessionSigner { private readonly _privateKey: PkStore private readonly _identitySignature: SequenceSignature.RSY public readonly address: Address.Address @@ -43,13 +43,11 @@ export class Implicit implements SessionSigner { } isValid(sessionTopology: SessionConfig.SessionsTopology, _chainId: number): SessionSignerValidity { - const implicitSigner = SessionConfig.getIdentitySigner(sessionTopology) - if (!implicitSigner) { + const implicitSigners = SessionConfig.getIdentitySigners(sessionTopology) + const thisIdentitySigner = this.identitySigner + if (!implicitSigners.some((s) => Address.isEqual(s, thisIdentitySigner))) { return { isValid: false, invalidReason: 'Identity signer not found' } } - if (!Address.isEqual(implicitSigner, this.identitySigner)) { - return { isValid: false, invalidReason: 'Identity signer mismatch' } - } const blacklist = SessionConfig.getImplicitBlacklist(sessionTopology) if (blacklist?.some((b) => Address.isEqual(b, this.address))) { return { isValid: false, invalidReason: 'Blacklisted' } diff --git a/packages/wallet/core/src/signers/session/session.ts b/packages/wallet/core/src/signers/session/session.ts index 8cf44257fe..4bcc5bb771 100644 --- a/packages/wallet/core/src/signers/session/session.ts +++ b/packages/wallet/core/src/signers/session/session.ts @@ -57,6 +57,14 @@ export interface ExplicitSessionSigner extends SessionSigner { ) => Promise } +export interface ImplicitSessionSigner extends SessionSigner { + identitySigner: Address.Address +} + export function isExplicitSessionSigner(signer: SessionSigner): signer is ExplicitSessionSigner { return 'prepareIncrements' in signer } + +export function isImplicitSessionSigner(signer: SessionSigner): signer is ImplicitSessionSigner { + return 'identitySigner' in signer +} diff --git a/packages/wallet/core/test/constants.ts b/packages/wallet/core/test/constants.ts index ddbeb5ade4..0622a2db97 100644 --- a/packages/wallet/core/test/constants.ts +++ b/packages/wallet/core/test/constants.ts @@ -4,7 +4,10 @@ import { Abi, AbiEvent, Address } from 'ox' const envFile = process.env.CI ? '.env.test' : '.env.test.local' dotenvConfig({ path: envFile }) -export const EMITTER_ADDRESS: Address.Address = '0xb7bE532959236170064cf099e1a3395aEf228F44' +// Requires https://example.com redirectUrl +export const EMITTER_ADDRESS1: Address.Address = '0xad90eB52BC180Bd9f66f50981E196f3E996278D3' +// Requires https://another-example.com redirectUrl +export const EMITTER_ADDRESS2: Address.Address = '0x4cb8d282365C7bee8C0d3Bf1B3ca5828e0Db553F' export const EMITTER_FUNCTIONS = Abi.from(['function explicitEmit()', 'function implicitEmit()']) export const EMITTER_EVENT_TOPICS = [ AbiEvent.encode(AbiEvent.from('event Explicit(address sender)')).topics[0], diff --git a/packages/wallet/core/test/session-manager.test.ts b/packages/wallet/core/test/session-manager.test.ts index 098d7e9c66..330e941b7e 100644 --- a/packages/wallet/core/test/session-manager.test.ts +++ b/packages/wallet/core/test/session-manager.test.ts @@ -4,7 +4,14 @@ import { describe, expect, it } from 'vitest' import { Attestation, GenericTree, Payload, Permission, SessionConfig } from '../../primitives/src/index.js' import { Envelope, Signers, State, Utils, Wallet } from '../src/index.js' -import { EMITTER_FUNCTIONS, EMITTER_ADDRESS, EMITTER_EVENT_TOPICS, LOCAL_RPC_URL, USDC_ADDRESS } from './constants' +import { + EMITTER_FUNCTIONS, + EMITTER_ADDRESS1, + EMITTER_ADDRESS2, + EMITTER_EVENT_TOPICS, + LOCAL_RPC_URL, + USDC_ADDRESS, +} from './constants' import { Extensions } from '@0xsequence/wallet-primitives' const { PermissionBuilder, ERC20PermissionBuilder } = Utils @@ -50,6 +57,27 @@ for (const extension of ALL_EXTENSIONS) { const stateProvider = new State.Local.Provider() + const createImplicitSigner = async (redirectUrl: string, signingKey?: Hex.Hex) => { + const implicitPrivateKey = Secp256k1.randomPrivateKey() + const implicitAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: implicitPrivateKey })) + const attestation: Attestation.Attestation = { + approvedSigner: implicitAddress, + identityType: new Uint8Array(4), + issuerHash: new Uint8Array(32), + audienceHash: new Uint8Array(32), + applicationData: new Uint8Array(), + authData: { + redirectUrl, + issuedAt: BigInt(Math.floor(Date.now() / 1000)), + }, + } + const identitySignature = Secp256k1.sign({ + payload: Attestation.hash(attestation), + privateKey: signingKey ?? identityPrivateKey, + }) + return new Signers.Session.Implicit(implicitPrivateKey, attestation, identitySignature, implicitAddress) + } + it( 'should load from state', async () => { @@ -121,7 +149,7 @@ for (const extension of ALL_EXTENSIONS) { const actualImageHash = await sessionManager.imageHash expect(actualImageHash).toBe(imageHash) expect(SessionConfig.isCompleteSessionsTopology(actualTopology)).toBe(true) - expect(SessionConfig.getIdentitySigner(actualTopology)).toBe(identityAddress) + expect(SessionConfig.getIdentitySigners(actualTopology)).toStrictEqual([identityAddress]) expect(SessionConfig.getImplicitBlacklist(actualTopology)).toStrictEqual([randomBlacklistAddress]) const actualPermissions = SessionConfig.getSessionPermissions(actualTopology, randomSigner) expect(actualPermissions).toStrictEqual({ @@ -184,7 +212,7 @@ for (const extension of ALL_EXTENSIONS) { // Create a test transaction const call: Payload.Call = { - to: EMITTER_ADDRESS, + to: EMITTER_ADDRESS1, value: 0n, data: AbiFunction.encodeData(EMITTER_FUNCTIONS[1]), // Implicit emit gasLimit: 0n, @@ -215,6 +243,144 @@ for (const extension of ALL_EXTENSIONS) { timeout, ) + it( + 'should create and sign with a multiple implicit sessions', + async () => { + const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL)) + + const implicitSigner1 = await createImplicitSigner('https://example.com') + const implicitSigner2 = await createImplicitSigner('https://another-example.com') + const topology = SessionConfig.emptySessionsTopology(identityAddress) + await stateProvider.saveTree(SessionConfig.sessionsTopologyToConfigurationTree(topology)) + const imageHash = GenericTree.hash(SessionConfig.sessionsTopologyToConfigurationTree(topology)) + const wallet = await Wallet.fromConfiguration( + { + threshold: 1n, + checkpoint: 0n, + topology: { type: 'sapient-signer', address: extension.sessions, weight: 1n, imageHash }, + }, + { + stateProvider, + }, + ) + const sessionManager = new Signers.SessionManager(wallet, { + provider, + sessionManagerAddress: extension.sessions, + }) + .withImplicitSigner(implicitSigner1) + .withImplicitSigner(implicitSigner2) + + // Create a test transaction + const payload: Payload.Parented = { + type: 'call', + nonce: 0n, + space: 0n, + calls: [ + { + to: EMITTER_ADDRESS1, + value: 0n, + data: AbiFunction.encodeData(EMITTER_FUNCTIONS[1]), // Implicit emit + gasLimit: 0n, + delegateCall: false, + onlyFallback: false, + behaviorOnError: 'revert', + }, + { + to: EMITTER_ADDRESS2, + value: 0n, + data: AbiFunction.encodeData(EMITTER_FUNCTIONS[1]), // Implicit emit + gasLimit: 0n, + delegateCall: false, + onlyFallback: false, + behaviorOnError: 'revert', + }, + ], + parentWallets: [wallet.address], + } + + // Sign the transaction + const chainId = Number(await provider.request({ method: 'eth_chainId' })) + const signature = await sessionManager.signSapient(wallet.address, chainId, payload, imageHash) + + expect(signature.type).toBe('sapient') + expect(signature.address).toBe(sessionManager.address) + expect(signature.data).toBeDefined() + + // Check if the signature is valid + const isValid = await sessionManager.isValidSapientSignature(wallet.address, chainId, payload, signature) + expect(isValid).toBe(true) + }, + timeout, + ) + + it( + 'should fail to sign with a multiple implicit sessions with different identity signers', + async () => { + const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL)) + + const identityPrivateKey2 = Secp256k1.randomPrivateKey() + const identityAddress2 = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: identityPrivateKey2 })) + + const implicitSigner1 = await createImplicitSigner('https://example.com', identityPrivateKey) + const implicitSigner2 = await createImplicitSigner('https://another-example.com', identityPrivateKey2) + let topology = SessionConfig.emptySessionsTopology(identityAddress) + topology = SessionConfig.addIdentitySigner(topology, identityAddress2) + await stateProvider.saveTree(SessionConfig.sessionsTopologyToConfigurationTree(topology)) + const imageHash = GenericTree.hash(SessionConfig.sessionsTopologyToConfigurationTree(topology)) + const wallet = await Wallet.fromConfiguration( + { + threshold: 1n, + checkpoint: 0n, + topology: { type: 'sapient-signer', address: extension.sessions, weight: 1n, imageHash }, + }, + { + stateProvider, + }, + ) + const sessionManager = new Signers.SessionManager(wallet, { + provider, + sessionManagerAddress: extension.sessions, + }) + .withImplicitSigner(implicitSigner1) + .withImplicitSigner(implicitSigner2) + + // Create a test transaction + const payload: Payload.Parented = { + type: 'call', + nonce: 0n, + space: 0n, + calls: [ + { + to: EMITTER_ADDRESS1, + value: 0n, + data: AbiFunction.encodeData(EMITTER_FUNCTIONS[1]), // Implicit emit + gasLimit: 0n, + delegateCall: false, + onlyFallback: false, + behaviorOnError: 'revert', + }, + { + to: EMITTER_ADDRESS2, + value: 0n, + data: AbiFunction.encodeData(EMITTER_FUNCTIONS[1]), // Implicit emit + gasLimit: 0n, + delegateCall: false, + onlyFallback: false, + behaviorOnError: 'revert', + }, + ], + parentWallets: [wallet.address], + } + + // Sign the transaction + const chainId = Number(await provider.request({ method: 'eth_chainId' })) + await expect(sessionManager.signSapient(wallet.address, chainId, payload, imageHash)).rejects.toThrow( + 'Multiple implicit signers with different identity signers', + ) + }, + timeout, + ) + const shouldCreateAndSignWithExplicitSession = async (useChainId: boolean) => { const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL)) const chainId = Number(await provider.request({ method: 'eth_chainId' })) @@ -225,7 +391,7 @@ for (const extension of ALL_EXTENSIONS) { chainId: useChainId ? chainId : 0, valueLimit: 1000000000000000000n, // 1 ETH deadline: BigInt(Math.floor(Date.now() / 1000) + 3600), // 1 hour from now - permissions: [PermissionBuilder.for(EMITTER_ADDRESS).allowAll().build()], + permissions: [PermissionBuilder.for(EMITTER_ADDRESS1).allowAll().build()], } const explicitSigner = new Signers.Session.Explicit(explicitPrivateKey, explicitPermissions) // Create the topology and wallet @@ -253,7 +419,7 @@ for (const extension of ALL_EXTENSIONS) { // Create a test transaction within permissions const call: Payload.Call = { - to: EMITTER_ADDRESS, + to: EMITTER_ADDRESS1, value: 0n, data: AbiFunction.encodeData(EMITTER_FUNCTIONS[0]), // Explicit emit gasLimit: 0n, @@ -480,7 +646,7 @@ for (const extension of ALL_EXTENSIONS) { }) const call: Payload.Call = { - to: EMITTER_ADDRESS, + to: EMITTER_ADDRESS1, value: 0n, data: AbiFunction.encodeData(EMITTER_FUNCTIONS[1]), // Implicit emit gasLimit: 0n, @@ -508,7 +674,7 @@ for (const extension of ALL_EXTENSIONS) { chainId, valueLimit: 1000000000000000000n, // 1 ETH deadline: BigInt(Math.floor(Date.now() / 1000) + 3600), // 1 hour from now - permissions: [PermissionBuilder.for(EMITTER_ADDRESS).allowAll().build()], + permissions: [PermissionBuilder.for(EMITTER_ADDRESS1).allowAll().build()], } const explicitSigner = new Signers.Session.Explicit(explicitPrivateKey, sessionPermission) // Test manually building the session topology @@ -548,7 +714,7 @@ for (const extension of ALL_EXTENSIONS) { }) const call: Payload.Call = { - to: EMITTER_ADDRESS, + to: EMITTER_ADDRESS1, value: 0n, data: AbiFunction.encodeData(EMITTER_FUNCTIONS[0]), // Explicit emit gasLimit: 0n, @@ -576,7 +742,7 @@ for (const extension of ALL_EXTENSIONS) { chainId, valueLimit: 0n, deadline: BigInt(Math.floor(Date.now() / 1000) + 3600), // 1 hour from now - permissions: [PermissionBuilder.for(EMITTER_ADDRESS).forFunction(EMITTER_FUNCTIONS[0]).onlyOnce().build()], + permissions: [PermissionBuilder.for(EMITTER_ADDRESS1).forFunction(EMITTER_FUNCTIONS[0]).onlyOnce().build()], } const explicitSigner = new Signers.Session.Explicit(explicitPrivateKey, sessionPermission) // Test manually building the session topology @@ -616,7 +782,7 @@ for (const extension of ALL_EXTENSIONS) { }) const call: Payload.Call = { - to: EMITTER_ADDRESS, + to: EMITTER_ADDRESS1, value: 0n, data: AbiFunction.encodeData(EMITTER_FUNCTIONS[0]), // Explicit emit gasLimit: 0n, diff --git a/packages/wallet/primitives-cli/src/subcommands/server.ts b/packages/wallet/primitives-cli/src/subcommands/server.ts index 790aeee005..bef0e8fa21 100644 --- a/packages/wallet/primitives-cli/src/subcommands/server.ts +++ b/packages/wallet/primitives-cli/src/subcommands/server.ts @@ -137,12 +137,13 @@ const rpcMethods: Record Promise> = { return result }, async session_encodeCallSignatures(params) { - const { sessionTopology, callSignatures, explicitSigners, implicitSigners } = params + const { sessionTopology, callSignatures, explicitSigners, implicitSigners, identitySigner } = params const result = await session.doEncodeSessionCallSignatures( JSON.stringify(sessionTopology), callSignatures.map(JSON.stringify), explicitSigners, implicitSigners, + identitySigner, ) return result }, diff --git a/packages/wallet/primitives-cli/src/subcommands/session.ts b/packages/wallet/primitives-cli/src/subcommands/session.ts index 3d343d1abe..4217c84186 100644 --- a/packages/wallet/primitives-cli/src/subcommands/session.ts +++ b/packages/wallet/primitives-cli/src/subcommands/session.ts @@ -21,6 +21,7 @@ export async function doEncodeSessionCallSignatures( callSignaturesInput: string[], explicitSigners: string[] = [], implicitSigners: string[] = [], + identitySigner?: string, ): Promise { const sessionTopology = SessionConfig.sessionsTopologyFromJson(sessionTopologyInput) const callSignatures = callSignaturesInput.map((s) => SessionSignature.sessionCallSignatureFromJson(s)) @@ -29,6 +30,7 @@ export async function doEncodeSessionCallSignatures( sessionTopology, explicitSigners as `0x${string}`[], implicitSigners as `0x${string}`[], + identitySigner as `0x${string}` | undefined, ) return Hex.from(encoded) } diff --git a/packages/wallet/primitives/src/session-config.ts b/packages/wallet/primitives/src/session-config.ts index d65563c048..c8583916c2 100644 --- a/packages/wallet/primitives/src/session-config.ts +++ b/packages/wallet/primitives/src/session-config.ts @@ -65,7 +65,8 @@ export function isSessionsTopology(topology: any): topology is SessionsTopology /** * Checks if the topology is complete. - * A complete topology has exactly one identity signer and one blacklist. + * A complete topology has at least one identity signer and one blacklist. + * When performing encoding, exactly one identity signer is required. Others must be hashed into nodes. * @param topology The topology to check * @returns True if the topology is complete */ @@ -76,7 +77,7 @@ export function isCompleteSessionsTopology(topology: any): topology is SessionsT } // Check the topology contains exactly one identity signer and one blacklist const { identitySignerCount, blacklistCount } = checkIsCompleteSessionsBranch(topology) - return identitySignerCount === 1 && blacklistCount === 1 + return identitySignerCount >= 1 && blacklistCount === 1 } function checkIsCompleteSessionsBranch(topology: SessionsTopology): { @@ -102,28 +103,22 @@ function checkIsCompleteSessionsBranch(topology: SessionsTopology): { } /** - * Gets the identity signer from the topology. + * Gets the identity signers from the topology. * @param topology The topology to get the identity signer from - * @returns The identity signer or null if it's not present + * @returns The identity signers */ -export function getIdentitySigner(topology: SessionsTopology): Address.Address | null { +export function getIdentitySigners(topology: SessionsTopology): Address.Address[] { if (isIdentitySignerLeaf(topology)) { - // Got it - return topology.identitySigner + // Got one + return [topology.identitySigner] } if (isSessionsBranch(topology)) { // Check branches - const results = topology.map(getIdentitySigner).filter((t) => t !== null) - if (results.length > 1) { - throw new Error('Multiple identity signers') - } - if (results.length === 1) { - return results[0]! - } + return topology.map(getIdentitySigners).flat() } - return null + return [] } /** @@ -164,7 +159,10 @@ export function getImplicitBlacklistLeaf(topology: SessionsTopology): ImplicitBl return null } -export function getSessionPermissions(topology: SessionsTopology, address: Address.Address): SessionPermissions | null { +export function getSessionPermissions( + topology: SessionsTopology, + address: Address.Address, +): SessionPermissionsLeaf | null { if (isSessionPermissions(topology)) { if (Address.isEqual(topology.signer, address)) { return topology @@ -416,28 +414,39 @@ function sessionsTopologyFromParsed(parsed: any): SessionsTopology { // Operations -/** - * Removes all explicit sessions (permissions leaf nodes) that match the given signer from the topology. - * Returns the updated topology or null if it becomes empty (for nesting). - * If the signer is not found, the topology is returned unchanged. - */ -export function removeExplicitSession( - topology: SessionsTopology, - signerAddress: `0x${string}`, -): SessionsTopology | null { - if (isSessionPermissions(topology)) { - if (Address.isEqual(topology.signer, signerAddress)) { +function removeLeaf(topology: SessionsTopology, leaf: SessionLeaf | SessionNode): SessionsTopology | null { + if (isSessionsLeaf(topology) && isSessionsLeaf(leaf)) { + if (topology.type === leaf.type) { + if (isSessionPermissions(topology) && isSessionPermissions(leaf)) { + if (Address.isEqual(topology.signer, leaf.signer)) { + return null + } + } else if (isImplicitBlacklist(topology) && isImplicitBlacklist(leaf)) { + // Remove blacklist items in leaf from topology + const newBlacklist = topology.blacklist.filter((b) => !leaf.blacklist.includes(b)) + if (newBlacklist.length === 0) { + return null + } + return { type: 'implicit-blacklist', blacklist: newBlacklist } + } else if (isIdentitySignerLeaf(topology) && isIdentitySignerLeaf(leaf)) { + // Remove identity signer from topology + if (Address.isEqual(topology.identitySigner, leaf.identitySigner)) { + return null + } + } + } + } else if (isSessionsNode(topology) && isSessionsNode(leaf)) { + if (Hex.isEqual(topology, leaf)) { + // Match, remove the node return null } - // Return the leaf unchanged - return topology } // If it's a branch, recurse on each child: if (isSessionsBranch(topology)) { const newChildren: SessionsTopology[] = [] for (const child of topology) { - const updatedChild = removeExplicitSession(child, signerAddress) + const updatedChild = removeLeaf(child, leaf) if (updatedChild != null) { newChildren.push(updatedChild) } @@ -461,6 +470,29 @@ export function removeExplicitSession( return topology } +/** + * Removes all explicit sessions (permissions leaf nodes) that match the given signer from the topology. + * Returns the updated topology or null if it becomes empty (for nesting). + * If the signer is not found, the topology is returned unchanged. + */ +export function removeExplicitSession( + topology: SessionsTopology, + signerAddress: `0x${string}`, +): SessionsTopology | null { + const explicitLeaf = getSessionPermissions(topology, signerAddress) + if (!explicitLeaf) { + // Not found, return unchanged + return topology + } + const removed = removeLeaf(topology, explicitLeaf) + if (!removed) { + // Empty, return null + return null + } + // Balance it + return balanceSessionsTopology(removed) +} + export function addExplicitSession( topology: SessionsTopology, sessionPermissions: SessionPermissions, @@ -474,6 +506,33 @@ export function addExplicitSession( return balanceSessionsTopology(merged) } +export function removeIdentitySigner( + topology: SessionsTopology, + identitySigner: Address.Address, +): SessionsTopology | null { + const identityLeaf: IdentitySignerLeaf = { + type: 'identity-signer', + identitySigner, + } + // Remove the old identity signer and balance + const removed = removeLeaf(topology, identityLeaf) + if (!removed) { + // Empty, return null + return null + } + return balanceSessionsTopology(removed) +} + +export function addIdentitySigner(topology: SessionsTopology, identitySigner: Address.Address): SessionsTopology { + // Find the session in the topology + if (getIdentitySigners(topology).some((s) => Address.isEqual(s, identitySigner))) { + throw new Error('Identity signer already exists') + } + // Merge and balance + const merged = mergeSessionsTopologies(topology, { type: 'identity-signer', identitySigner }) + return balanceSessionsTopology(merged) +} + /** * Merges two topologies into a new branch of [a, b]. */ @@ -521,17 +580,9 @@ function buildBalancedSessionsTopology(items: (SessionLeaf | SessionNode)[]): Se /** * Balances the topology by flattening and rebuilding as a balanced binary tree. - * This does not make a binary tree as the blacklist and identity signer are included at the top level. */ export function balanceSessionsTopology(topology: SessionsTopology): SessionsTopology { - const flattened = flattenSessionsTopology(topology) - const blacklist = flattened.find((l) => isImplicitBlacklist(l)) - const identitySigner = flattened.find((l) => isIdentitySignerLeaf(l)) - const leaves = flattened.filter((l) => isSessionPermissions(l)) - if (!blacklist || !identitySigner) { - throw new Error('No blacklist or identity signer') - } - return buildBalancedSessionsTopology([blacklist, identitySigner, ...leaves]) + return buildBalancedSessionsTopology(flattenSessionsTopology(topology)) } /** @@ -596,6 +647,7 @@ export function minimiseSessionsTopology( topology: SessionsTopology, explicitSigners: Address.Address[] = [], implicitSigners: Address.Address[] = [], + identitySigner?: Address.Address, ): SessionsTopology { if (isSessionsBranch(topology)) { const branches = topology.map((b) => minimiseSessionsTopology(b, explicitSigners, implicitSigners)) @@ -621,7 +673,11 @@ export function minimiseSessionsTopology( return topology } if (isIdentitySignerLeaf(topology)) { - // Never roll up the identity signer + if (identitySigner && !Address.isEqual(topology.identitySigner, identitySigner)) { + // Not the identity signer we're looking for, so roll it up + return GenericTree.hash(encodeLeafToGeneric(topology)) + } + // Return this identity signer leaf return topology } if (isSessionsNode(topology)) { diff --git a/packages/wallet/primitives/src/session-signature.ts b/packages/wallet/primitives/src/session-signature.ts index 8b9306d7fc..84ea3123bd 100644 --- a/packages/wallet/primitives/src/session-signature.ts +++ b/packages/wallet/primitives/src/session-signature.ts @@ -3,6 +3,7 @@ import { Attestation, encode, encodeForJson, fromParsed, toJson } from './attest import { MAX_PERMISSIONS_COUNT } from './permission.js' import { encodeSessionsTopology, + getIdentitySigners, isCompleteSessionsTopology, minimiseSessionsTopology, SessionsTopology, @@ -103,11 +104,21 @@ function rsyFromRsvStr(sigStr: string): RSY { // Usage +/** + * Encodes a list of session call signatures into a bytes array for contract validation. + * @param callSignatures The list of session call signatures to encode. + * @param topology The complete session topology. + * @param explicitSigners The list of explicit signers to encode. Others will be hashed into nodes. + * @param implicitSigners The list of implicit signers to encode. Others will be hashed into nodes. + * @param identitySigner The identity signer to encode. Others will be hashed into nodes. + * @returns The encoded session call signatures. + */ export function encodeSessionCallSignatures( callSignatures: SessionCallSignature[], topology: SessionsTopology, explicitSigners: Address.Address[] = [], implicitSigners: Address.Address[] = [], + identitySigner?: Address.Address, ): Bytes.Bytes { const parts: Bytes.Bytes[] = [] @@ -117,8 +128,23 @@ export function encodeSessionCallSignatures( throw new Error('Incomplete topology') } + if (implicitSigners.length > 0 && !identitySigner) { + console.warn('Encodings using implicit signers without identity signer may encode incorrectly') + } + + // Check the topology contains exactly one identity signer + const identitySigners = getIdentitySigners(topology) + if (identitySigner) { + if (!identitySigners.some((s) => Address.isEqual(s, identitySigner!))) { + throw new Error('Identity signer not found') + } + } else { + // Grab the first one + identitySigner = identitySigners[0]! + } + // Optimise the configuration tree by rolling unused signers into nodes. - topology = minimiseSessionsTopology(topology, explicitSigners, implicitSigners) + topology = minimiseSessionsTopology(topology, explicitSigners, implicitSigners, identitySigner) // Session topology const encodedTopology = encodeSessionsTopology(topology) diff --git a/packages/wallet/primitives/test/session-config.test.ts b/packages/wallet/primitives/test/session-config.test.ts index 7d092c15c0..d7bce1ec73 100644 --- a/packages/wallet/primitives/test/session-config.test.ts +++ b/packages/wallet/primitives/test/session-config.test.ts @@ -11,12 +11,11 @@ import { IdentitySignerLeaf, SessionPermissionsLeaf, SessionNode, - SessionLeaf, SessionBranch, SessionsTopology, isSessionsTopology, isCompleteSessionsTopology, - getIdentitySigner, + getIdentitySigners, getImplicitBlacklist, getImplicitBlacklistLeaf, getSessionPermissions, @@ -152,9 +151,9 @@ describe('Session Config', () => { expect(isCompleteSessionsTopology(duplicateBlacklist)).toBe(false) }) - it('should return false for topology with multiple identity signers', () => { + it('should return true for topology with multiple identity signers', () => { const duplicateIdentity = [sampleBlacklistLeaf, sampleIdentitySignerLeaf, sampleIdentitySignerLeaf] - expect(isCompleteSessionsTopology(duplicateIdentity)).toBe(false) + expect(isCompleteSessionsTopology(duplicateIdentity)).toBe(true) }) it('should return false for invalid topology', () => { @@ -165,29 +164,29 @@ describe('Session Config', () => { }) describe('Topology Queries', () => { - describe('getIdentitySigner', () => { + describe('getIdentitySigners', () => { it('should return identity signer from identity signer leaf', () => { - const result = getIdentitySigner(sampleIdentitySignerLeaf) - expect(result).toBe(testAddress1) + const result = getIdentitySigners(sampleIdentitySignerLeaf) + expect(result).toEqual([testAddress1]) }) it('should return identity signer from branch', () => { - const result = getIdentitySigner(sampleCompleteTopology) - expect(result).toBe(testAddress1) + const result = getIdentitySigners(sampleCompleteTopology) + expect(result).toEqual([testAddress1]) }) - it('should return null when no identity signer present', () => { - const result = getIdentitySigner(sampleSessionPermissionsLeaf) - expect(result).toBe(null) + it('should return empty array when no identity signer present', () => { + const result = getIdentitySigners(sampleSessionPermissionsLeaf) + expect(result).toEqual([]) }) - it('should throw for multiple identity signers', () => { + it('should return multiple identity signers', () => { const multipleIdentity = [ sampleIdentitySignerLeaf, sampleIdentitySignerLeaf, sampleBlacklistLeaf, ] as SessionBranch - expect(() => getIdentitySigner(multipleIdentity)).toThrow('Multiple identity signers') + expect(getIdentitySigners(multipleIdentity)).toEqual([testAddress1, testAddress1]) }) }) @@ -619,9 +618,9 @@ describe('Session Config', () => { expect(isSessionsTopology(result)).toBe(true) const blacklist = getImplicitBlacklist(result) - const identitySigner = getIdentitySigner(result) + const identitySigners = getIdentitySigners(result) expect(blacklist).toBeTruthy() - expect(identitySigner).toBeTruthy() + expect(identitySigners).toBeTruthy() }) it('should throw when missing blacklist or identity signer', () => { @@ -796,8 +795,8 @@ describe('Session Config', () => { expect(isCompleteSessionsTopology(result)).toBe(true) - const identitySigner = getIdentitySigner(result) - expect(identitySigner).toBe(testAddress1) + const identitySigners = getIdentitySigners(result) + expect(identitySigners).toEqual([testAddress1]) const blacklist = getImplicitBlacklist(result) expect(blacklist).toEqual([]) @@ -837,8 +836,8 @@ describe('Session Config', () => { expect(isSessionsTopology(nestedTopology)).toBe(true) expect(isCompleteSessionsTopology(nestedTopology)).toBe(true) - const identitySigner = getIdentitySigner(nestedTopology) - expect(identitySigner).toBe(testAddress1) + const identitySigners = getIdentitySigners(nestedTopology) + expect(identitySigners).toEqual([testAddress1]) const blacklist = getImplicitBlacklist(nestedTopology) expect(blacklist).toContain(testAddress2) @@ -902,7 +901,7 @@ describe('Session Config', () => { expect(isCompleteSessionsTopology(deserialized)).toBe(true) // Verify data integrity - expect(getIdentitySigner(deserialized)).toBe(testAddress1) + expect(getIdentitySigners(deserialized)).toEqual([testAddress1]) expect(getImplicitBlacklist(deserialized)).toContain(testAddress3) expect(getSessionPermissions(deserialized, testAddress2)).toBeTruthy() }) diff --git a/packages/wallet/primitives/test/session-signature.test.ts b/packages/wallet/primitives/test/session-signature.test.ts index 887ca6b047..0e1eff066c 100644 --- a/packages/wallet/primitives/test/session-signature.test.ts +++ b/packages/wallet/primitives/test/session-signature.test.ts @@ -398,6 +398,13 @@ describe('Session Signature', () => { 'Invalid call signature', ) }) + + it('should throw for identity signer not found', () => { + const callSignatures = [sampleExplicitSignature] + expect(() => encodeSessionCallSignatures(callSignatures, completeTopology, [], [], testAddress2)).toThrow( + 'Identity signer not found', + ) + }) }) }) diff --git a/packages/wallet/wdk/src/sequence/sessions.ts b/packages/wallet/wdk/src/sequence/sessions.ts index c47bf47cb1..a46d5e44ac 100644 --- a/packages/wallet/wdk/src/sequence/sessions.ts +++ b/packages/wallet/wdk/src/sequence/sessions.ts @@ -14,6 +14,8 @@ import { AuthCodePkceHandler } from './handlers/authcode-pkce.js' import { IdentityHandler, identityTypeToHex } from './handlers/identity.js' import { ManagerOptionsDefaults, Shared } from './manager.js' import { Actions } from './types/signature-request.js' +import { Kinds } from './types/index.js' +import { Handler } from './handlers/index.js' export type AuthorizeImplicitSessionArgs = { target: string @@ -227,17 +229,32 @@ export class Sessions implements SessionsInterface { args: AuthorizeImplicitSessionArgs, ): Promise { const topology = await this.getTopology(walletAddress) - const identitySignerAddress = SessionConfig.getIdentitySigner(topology) - if (!identitySignerAddress) { - throw new Error('No identity signer address found') + const identitySigners = SessionConfig.getIdentitySigners(topology) + if (!identitySigners) { + throw new Error('No identity signers found') } - const identityKind = await this.shared.modules.signers.kindOf(walletAddress, identitySignerAddress) - if (!identityKind) { - throw new Error('No identity handler kind found') + let handler: Handler | undefined + let identitySignerAddress: Address.Address | undefined + for (const identitySigner of identitySigners) { + const identityKind = await this.shared.modules.signers.kindOf(walletAddress, identitySigner) + if (!identityKind) { + console.warn('No identity handler kind found for', identitySigner) + continue + } + if (identityKind === Kinds.LoginPasskey) { + console.warn('Implicit sessions do not support passkeys', identitySigner) + continue + } + const iHandler = this.shared.handlers.get(identityKind) + if (iHandler) { + handler = iHandler + identitySignerAddress = identitySigner + break + } } - const handler = this.shared.handlers.get(identityKind) - if (!handler) { - throw new Error('No identity handler found') + + if (!handler || !identitySignerAddress) { + throw new Error('No identity handler or address found') } // Create the attestation to sign From fc3266433bc31b25ab3f302ad1723cb042d02061 Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Tue, 16 Sep 2025 16:00:56 +1200 Subject: [PATCH 13/36] Device signers can approve implicit sessions --- packages/wallet/primitives/src/config.ts | 10 +++ packages/wallet/wdk/src/sequence/sessions.ts | 83 ++++++++++++++++++-- packages/wallet/wdk/src/sequence/wallets.ts | 14 +++- 3 files changed, 99 insertions(+), 8 deletions(-) diff --git a/packages/wallet/primitives/src/config.ts b/packages/wallet/primitives/src/config.ts index c193ce3588..d662d39a01 100644 --- a/packages/wallet/primitives/src/config.ts +++ b/packages/wallet/primitives/src/config.ts @@ -281,6 +281,16 @@ export function flatLeavesToTopology(leaves: Leaf[]): Topology { ] } +export function topologyToFlatLeaves(topology: Topology): Leaf[] { + if (isNode(topology)) { + return [...topologyToFlatLeaves(topology[0]), ...topologyToFlatLeaves(topology[1])] + } + if (isNestedLeaf(topology)) { + return [...topologyToFlatLeaves(topology.tree)] + } + return [topology] +} + export function configToJson(config: Config): string { return JSON.stringify({ threshold: config.threshold.toString(), diff --git a/packages/wallet/wdk/src/sequence/sessions.ts b/packages/wallet/wdk/src/sequence/sessions.ts index a46d5e44ac..203eaf598c 100644 --- a/packages/wallet/wdk/src/sequence/sessions.ts +++ b/packages/wallet/wdk/src/sequence/sessions.ts @@ -2,7 +2,6 @@ import { Signers as CoreSigners, Envelope } from '@0xsequence/wallet-core' import { Attestation, Config, - Constants, GenericTree, Payload, Signature as SequenceSignature, @@ -14,7 +13,7 @@ import { AuthCodePkceHandler } from './handlers/authcode-pkce.js' import { IdentityHandler, identityTypeToHex } from './handlers/identity.js' import { ManagerOptionsDefaults, Shared } from './manager.js' import { Actions } from './types/signature-request.js' -import { Kinds } from './types/index.js' +import { Kinds, Module } from './types/index.js' import { Handler } from './handlers/index.js' export type AuthorizeImplicitSessionArgs = { @@ -188,17 +187,24 @@ export class Sessions implements SessionsInterface { constructor(private readonly shared: Shared) {} async getTopology(walletAddress: Address.Address, fixMissing = false): Promise { - const { loginTopology, modules } = await this.shared.modules.wallets.getConfigurationParts(walletAddress) + const { loginTopology, devicesTopology, modules } = + await this.shared.modules.wallets.getConfigurationParts(walletAddress) const managerModule = modules.find((m) => Address.isEqual(m.sapientLeaf.address, this.shared.sequence.extensions.sessions), ) if (!managerModule) { if (fixMissing) { // Create the default session manager leaf - if (!Config.isSignerLeaf(loginTopology) && !Config.isSapientSignerLeaf(loginTopology)) { - throw new Error('Login topology is not a signer leaf') + const authorizedSigners = [...Config.topologyToFlatLeaves([devicesTopology, loginTopology])].filter( + Config.isSignerLeaf, + ) + if (authorizedSigners.length === 0) { + throw new Error('No signer leaves found') + } + let sessionsTopology = SessionConfig.emptySessionsTopology(authorizedSigners[0]!.address) + for (let i = 1; i < authorizedSigners.length; i++) { + sessionsTopology = SessionConfig.addIdentitySigner(sessionsTopology, authorizedSigners[i]!.address) } - const sessionsTopology = SessionConfig.emptySessionsTopology(loginTopology.address) const sessionsConfigTree = SessionConfig.sessionsTopologyToConfigurationTree(sessionsTopology) this.shared.sequence.stateProvider.saveTree(sessionsConfigTree) const imageHash = GenericTree.hash(sessionsConfigTree) @@ -223,6 +229,71 @@ export class Sessions implements SessionsInterface { return SessionConfig.configurationTreeToSessionsTopology(tree) } + private async updateSessionModule( + modules: Module[], + transformer: (topology: SessionConfig.SessionsTopology) => SessionConfig.SessionsTopology, + ) { + const ext = this.shared.sequence.extensions.sessions + const idx = modules.findIndex((m) => Address.isEqual(m.sapientLeaf.address, ext)) + if (idx === -1) { + return + } + + const sessionModule = modules[idx] + if (!sessionModule) { + throw new Error('session-module-not-found') + } + + const genericTree = await this.shared.sequence.stateProvider.getTree(sessionModule.sapientLeaf.imageHash) + if (!genericTree) { + throw new Error('session-module-tree-not-found') + } + + const topology = SessionConfig.configurationTreeToSessionsTopology(genericTree) + const nextTopology = transformer(topology) + const nextTree = SessionConfig.sessionsTopologyToConfigurationTree(nextTopology) + await this.shared.sequence.stateProvider.saveTree(nextTree) + if (!modules[idx]) { + throw new Error('session-module-not-found-(unreachable)') + } + + modules[idx].sapientLeaf.imageHash = GenericTree.hash(nextTree) + } + + hasSessionModule(modules: Module[]): boolean { + return modules.some((m) => Address.isEqual(m.sapientLeaf.address, this.shared.sequence.extensions.sessions)) + } + + async addIdentitySignerToModules(modules: Module[], address: Address.Address) { + if (!this.hasSessionModule(modules)) { + throw new Error('session-module-not-enabled') + } + + await this.updateSessionModule(modules, (topology) => { + const existingSigners = SessionConfig.getIdentitySigners(topology) + if (existingSigners?.some((s) => Address.isEqual(s, address))) { + return topology + } + + return SessionConfig.addIdentitySigner(topology, address) + }) + } + + async removeIdentitySignerFromModules(modules: Module[], address: Address.Address) { + if (!this.hasSessionModule(modules)) { + throw new Error('session-module-not-enabled') + } + + await this.updateSessionModule(modules, (topology) => { + const newTopology = SessionConfig.removeIdentitySigner(topology, address) + if (!newTopology) { + // Can't remove the last identity signer + throw new Error('Cannot remove the last identity signer') + } + return newTopology + }) + } + async prepareAuthorizeImplicitSession( walletAddress: Address.Address, sessionAddress: Address.Address, diff --git a/packages/wallet/wdk/src/sequence/wallets.ts b/packages/wallet/wdk/src/sequence/wallets.ts index 1e8ac963a4..9592c68875 100644 --- a/packages/wallet/wdk/src/sequence/wallets.ts +++ b/packages/wallet/wdk/src/sequence/wallets.ts @@ -817,8 +817,9 @@ export class Wallets implements WalletsInterface { let modules: Module[] = [] if (!args.noSessionManager) { - // Calculate image hash with the identity signer - const sessionsTopology = SessionConfig.emptySessionsTopology(loginSignerAddress) + // Calculate image hash with the identity and device signer + let sessionsTopology = SessionConfig.emptySessionsTopology(loginSignerAddress) + sessionsTopology = SessionConfig.addIdentitySigner(sessionsTopology, device.address) // Store this tree in the state provider const sessionsConfigTree = SessionConfig.sessionsTopologyToConfigurationTree(sessionsTopology) this.shared.sequence.stateProvider.saveTree(sessionsConfigTree) @@ -1008,6 +1009,10 @@ export class Wallets implements WalletsInterface { await this.shared.modules.recovery.addRecoverySignerToModules(modules, device.address) } + if (this.shared.modules.sessions.hasSessionModule(modules)) { + await this.shared.modules.sessions.addIdentitySignerToModules(modules, device.address) + } + const walletEntryToUpdate: Wallet = { ...(existingWallet as Wallet), address: args.wallet, @@ -1376,6 +1381,11 @@ export class Wallets implements WalletsInterface { await this.shared.modules.recovery.removeRecoverySignerFromModules(modules, deviceToRemove) } + // Remove the device from the session module's topology as well. + if (this.shared.modules.sessions.hasSessionModule(modules)) { + await this.shared.modules.sessions.removeIdentitySignerFromModules(modules, deviceToRemove) + } + // Request the configuration update. const requestId = await this.requestConfigurationUpdate( wallet, From 21074894ee512c4bb65f1f86b5ae67eda8ee1ed0 Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Tue, 16 Sep 2025 20:56:30 +1200 Subject: [PATCH 14/36] Remove invalid test --- packages/wallet/primitives/test/session-config.test.ts | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/wallet/primitives/test/session-config.test.ts b/packages/wallet/primitives/test/session-config.test.ts index d7bce1ec73..caba743b1b 100644 --- a/packages/wallet/primitives/test/session-config.test.ts +++ b/packages/wallet/primitives/test/session-config.test.ts @@ -622,10 +622,6 @@ describe('Session Config', () => { expect(blacklist).toBeTruthy() expect(identitySigners).toBeTruthy() }) - - it('should throw when missing blacklist or identity signer', () => { - expect(() => balanceSessionsTopology(sampleSessionPermissionsLeaf)).toThrow('No blacklist or identity signer') - }) }) describe('cleanSessionsTopology', () => { From abf4a18ba61ed1be9b3361f932dc30d745e82f39 Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Wed, 17 Sep 2025 14:42:17 +1200 Subject: [PATCH 15/36] Fix recursion --- packages/wallet/primitives/src/session-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/wallet/primitives/src/session-config.ts b/packages/wallet/primitives/src/session-config.ts index c8583916c2..0e11c8d190 100644 --- a/packages/wallet/primitives/src/session-config.ts +++ b/packages/wallet/primitives/src/session-config.ts @@ -650,7 +650,7 @@ export function minimiseSessionsTopology( identitySigner?: Address.Address, ): SessionsTopology { if (isSessionsBranch(topology)) { - const branches = topology.map((b) => minimiseSessionsTopology(b, explicitSigners, implicitSigners)) + const branches = topology.map((b) => minimiseSessionsTopology(b, explicitSigners, implicitSigners, identitySigner)) // If all branches are nodes, the branch can be a node too if (branches.every((b) => isSessionsNode(b))) { return Hash.keccak256(Bytes.concat(...branches.map((b) => Hex.toBytes(b))), { as: 'Hex' }) From d387a8e788674bf2e182dc12b11d39169fe3ada9 Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Wed, 17 Sep 2025 14:50:01 +1200 Subject: [PATCH 16/36] Fix comment --- packages/wallet/primitives/src/session-config.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/wallet/primitives/src/session-config.ts b/packages/wallet/primitives/src/session-config.ts index 0e11c8d190..fb6dd21feb 100644 --- a/packages/wallet/primitives/src/session-config.ts +++ b/packages/wallet/primitives/src/session-config.ts @@ -75,7 +75,7 @@ export function isCompleteSessionsTopology(topology: any): topology is SessionsT if (!isSessionsTopology(topology)) { return false } - // Check the topology contains exactly one identity signer and one blacklist + // Check the topology contains at least one identity signer and exactly one blacklist const { identitySignerCount, blacklistCount } = checkIsCompleteSessionsBranch(topology) return identitySignerCount >= 1 && blacklistCount === 1 } From d84f173ad7e4e76c713f0706211c1003ac3f34af Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Wed, 17 Sep 2025 14:58:30 +1200 Subject: [PATCH 17/36] Improve test stability by reducing race conditions --- .../wallet/core/test/session-manager.test.ts | 97 ++++++++++++++++--- 1 file changed, 84 insertions(+), 13 deletions(-) diff --git a/packages/wallet/core/test/session-manager.test.ts b/packages/wallet/core/test/session-manager.test.ts index 330e941b7e..cf1915036e 100644 --- a/packages/wallet/core/test/session-manager.test.ts +++ b/packages/wallet/core/test/session-manager.test.ts @@ -52,12 +52,7 @@ for (const extension of ALL_EXTENSIONS) { describe(`SessionManager (${extension.name})`, () => { const timeout = 30000 - const identityPrivateKey = Secp256k1.randomPrivateKey() - const identityAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: identityPrivateKey })) - - const stateProvider = new State.Local.Provider() - - const createImplicitSigner = async (redirectUrl: string, signingKey?: Hex.Hex) => { + const createImplicitSigner = async (redirectUrl: string, signingKey: Hex.Hex) => { const implicitPrivateKey = Secp256k1.randomPrivateKey() const implicitAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: implicitPrivateKey })) const attestation: Attestation.Attestation = { @@ -73,7 +68,7 @@ for (const extension of ALL_EXTENSIONS) { } const identitySignature = Secp256k1.sign({ payload: Attestation.hash(attestation), - privateKey: signingKey ?? identityPrivateKey, + privateKey: signingKey, }) return new Signers.Session.Implicit(implicitPrivateKey, attestation, identitySignature, implicitAddress) } @@ -84,6 +79,11 @@ for (const extension of ALL_EXTENSIONS) { const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL)) const chainId = Number(await provider.request({ method: 'eth_chainId' })) + // Create unique identity and state provider for this test + const identityPrivateKey = Secp256k1.randomPrivateKey() + const identityAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: identityPrivateKey })) + const stateProvider = new State.Local.Provider() + let topology = SessionConfig.emptySessionsTopology(identityAddress) // Add random signer to the topology const sessionPermission: Signers.Session.ExplicitParams = { @@ -166,6 +166,11 @@ for (const extension of ALL_EXTENSIONS) { async () => { const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL)) + // Create unique identity and state provider for this test + const identityPrivateKey = Secp256k1.randomPrivateKey() + const identityAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: identityPrivateKey })) + const stateProvider = new State.Local.Provider() + // Create implicit signer const implicitPrivateKey = Secp256k1.randomPrivateKey() const implicitAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: implicitPrivateKey })) @@ -199,7 +204,11 @@ for (const extension of ALL_EXTENSIONS) { { threshold: 1n, checkpoint: 0n, - topology: { type: 'sapient-signer', address: extension.sessions, weight: 1n, imageHash }, + topology: [ + { type: 'sapient-signer', address: extension.sessions, weight: 1n, imageHash }, + // Include a random node leaf (bytes32) to prevent image hash collision + Hex.random(32), + ], }, { stateProvider, @@ -248,8 +257,13 @@ for (const extension of ALL_EXTENSIONS) { async () => { const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL)) - const implicitSigner1 = await createImplicitSigner('https://example.com') - const implicitSigner2 = await createImplicitSigner('https://another-example.com') + // Create unique identity and state provider for this test + const identityPrivateKey = Secp256k1.randomPrivateKey() + const identityAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: identityPrivateKey })) + const stateProvider = new State.Local.Provider() + + const implicitSigner1 = await createImplicitSigner('https://example.com', identityPrivateKey) + const implicitSigner2 = await createImplicitSigner('https://another-example.com', identityPrivateKey) const topology = SessionConfig.emptySessionsTopology(identityAddress) await stateProvider.saveTree(SessionConfig.sessionsTopologyToConfigurationTree(topology)) const imageHash = GenericTree.hash(SessionConfig.sessionsTopologyToConfigurationTree(topology)) @@ -257,7 +271,11 @@ for (const extension of ALL_EXTENSIONS) { { threshold: 1n, checkpoint: 0n, - topology: { type: 'sapient-signer', address: extension.sessions, weight: 1n, imageHash }, + topology: [ + { type: 'sapient-signer', address: extension.sessions, weight: 1n, imageHash }, + // Include a random node leaf (bytes32) to prevent image hash collision + Hex.random(32), + ], }, { stateProvider, @@ -318,6 +336,11 @@ for (const extension of ALL_EXTENSIONS) { async () => { const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL)) + // Create unique identity and state provider for this test + const identityPrivateKey = Secp256k1.randomPrivateKey() + const identityAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: identityPrivateKey })) + const stateProvider = new State.Local.Provider() + const identityPrivateKey2 = Secp256k1.randomPrivateKey() const identityAddress2 = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: identityPrivateKey2 })) @@ -331,7 +354,11 @@ for (const extension of ALL_EXTENSIONS) { { threshold: 1n, checkpoint: 0n, - topology: { type: 'sapient-signer', address: extension.sessions, weight: 1n, imageHash }, + topology: [ + { type: 'sapient-signer', address: extension.sessions, weight: 1n, imageHash }, + // Include a random node leaf (bytes32) to prevent image hash collision + Hex.random(32), + ], }, { stateProvider, @@ -385,6 +412,11 @@ for (const extension of ALL_EXTENSIONS) { const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL)) const chainId = Number(await provider.request({ method: 'eth_chainId' })) + // Create unique identity and state provider for this test + const identityPrivateKey = Secp256k1.randomPrivateKey() + const identityAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: identityPrivateKey })) + const stateProvider = new State.Local.Provider() + // Create explicit signer const explicitPrivateKey = Secp256k1.randomPrivateKey() const explicitPermissions: Signers.Session.ExplicitParams = { @@ -405,7 +437,11 @@ for (const extension of ALL_EXTENSIONS) { { threshold: 1n, checkpoint: 0n, - topology: { type: 'sapient-signer', address: extension.sessions, weight: 1n, imageHash }, + topology: [ + { type: 'sapient-signer', address: extension.sessions, weight: 1n, imageHash }, + // Include a random node leaf (bytes32) to prevent image hash collision + Hex.random(32), + ], }, { stateProvider, @@ -596,6 +632,11 @@ for (const extension of ALL_EXTENSIONS) { const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL)) const chainId = Number(await provider.request({ method: 'eth_chainId' })) + // Create unique identity and state provider for this test + const identityPrivateKey = Secp256k1.randomPrivateKey() + const identityAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: identityPrivateKey })) + const stateProvider = new State.Local.Provider() + // Create an implicit signer const implicitPrivateKey = Secp256k1.randomPrivateKey() const implicitAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: implicitPrivateKey })) @@ -668,6 +709,11 @@ for (const extension of ALL_EXTENSIONS) { const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL)) const chainId = Number(await provider.request({ method: 'eth_chainId' })) + // Create unique identity and state provider for this test + const identityPrivateKey = Secp256k1.randomPrivateKey() + const identityAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: identityPrivateKey })) + const stateProvider = new State.Local.Provider() + // Create explicit signer const explicitPrivateKey = Secp256k1.randomPrivateKey() const sessionPermission: Signers.Session.ExplicitParams = { @@ -736,6 +782,11 @@ for (const extension of ALL_EXTENSIONS) { const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL)) const chainId = Number(await provider.request({ method: 'eth_chainId' })) + // Create unique identity and state provider for this test + const identityPrivateKey = Secp256k1.randomPrivateKey() + const identityAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: identityPrivateKey })) + const stateProvider = new State.Local.Provider() + // Create explicit signer const explicitPrivateKey = Secp256k1.randomPrivateKey() const sessionPermission: Signers.Session.ExplicitParams = { @@ -823,6 +874,11 @@ for (const extension of ALL_EXTENSIONS) { const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL)) const chainId = Number(await provider.request({ method: 'eth_chainId' })) + // Create unique identity and state provider for this test + const identityPrivateKey = Secp256k1.randomPrivateKey() + const identityAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: identityPrivateKey })) + const stateProvider = new State.Local.Provider() + // Create explicit signer const explicitPrivateKey = Secp256k1.randomPrivateKey() const explicitAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: explicitPrivateKey })) @@ -921,6 +977,11 @@ for (const extension of ALL_EXTENSIONS) { const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL)) const chainId = Number(await provider.request({ method: 'eth_chainId' })) + // Create unique identity and state provider for this test + const identityPrivateKey = Secp256k1.randomPrivateKey() + const identityAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: identityPrivateKey })) + const stateProvider = new State.Local.Provider() + // Create explicit signer const explicitPrivateKey = Secp256k1.randomPrivateKey() const explicitAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: explicitPrivateKey })) @@ -1026,6 +1087,11 @@ for (const extension of ALL_EXTENSIONS) { const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL)) const chainId = Number(await provider.request({ method: 'eth_chainId' })) + // Create unique identity and state provider for this test + const identityPrivateKey = Secp256k1.randomPrivateKey() + const identityAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: identityPrivateKey })) + const stateProvider = new State.Local.Provider() + // Create explicit signer const explicitPrivateKey = Secp256k1.randomPrivateKey() const explicitAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: explicitPrivateKey })) @@ -1145,6 +1211,11 @@ for (const extension of ALL_EXTENSIONS) { const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL)) const chainId = Number(await provider.request({ method: 'eth_chainId' })) + // Create unique identity and state provider for this test + const identityPrivateKey = Secp256k1.randomPrivateKey() + const identityAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: identityPrivateKey })) + const stateProvider = new State.Local.Provider() + // Create explicit signer const explicitPrivateKey = Secp256k1.randomPrivateKey() const explicitAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: explicitPrivateKey })) From 5323e8df3f511d46a7e89f2ccb640f1f2da3c650 Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Thu, 18 Sep 2025 14:41:15 +1200 Subject: [PATCH 18/36] Do not set passkey signer as identity signer --- .../wallet/primitives/src/session-config.ts | 15 ++++++---- .../primitives/test/session-config.test.ts | 15 ++++++++++ packages/wallet/wdk/src/sequence/sessions.ts | 30 +++++++++++++++++++ packages/wallet/wdk/src/sequence/wallets.ts | 29 ++++-------------- 4 files changed, 59 insertions(+), 30 deletions(-) diff --git a/packages/wallet/primitives/src/session-config.ts b/packages/wallet/primitives/src/session-config.ts index fb6dd21feb..8d61113a4f 100644 --- a/packages/wallet/primitives/src/session-config.ts +++ b/packages/wallet/primitives/src/session-config.ts @@ -723,15 +723,18 @@ export function removeFromImplicitBlacklist(topology: SessionsTopology, address: /** * Generate an empty sessions topology with the given identity signer. No session permission and an empty blacklist */ -export function emptySessionsTopology(identitySigner: Address.Address): SessionsTopology { - return [ +export function emptySessionsTopology( + identitySigner: Address.Address | [Address.Address, ...Address.Address[]], +): SessionsTopology { + if (!Array.isArray(identitySigner)) { + return emptySessionsTopology([identitySigner]) + } + const flattenedTopology: SessionLeaf[] = [ { type: 'implicit-blacklist', blacklist: [], }, - { - type: 'identity-signer', - identitySigner, - }, + ...identitySigner.map((signer): IdentitySignerLeaf => ({ type: 'identity-signer', identitySigner: signer })), ] + return buildBalancedSessionsTopology(flattenedTopology) } diff --git a/packages/wallet/primitives/test/session-config.test.ts b/packages/wallet/primitives/test/session-config.test.ts index caba743b1b..15e178f8cf 100644 --- a/packages/wallet/primitives/test/session-config.test.ts +++ b/packages/wallet/primitives/test/session-config.test.ts @@ -800,6 +800,21 @@ describe('Session Config', () => { const explicitSigners = getExplicitSigners(result) expect(explicitSigners).toEqual([]) }) + + it('should create empty topology with multiple identity signers', () => { + const result = emptySessionsTopology([testAddress1, testAddress2]) + + expect(isCompleteSessionsTopology(result)).toBe(true) + + const identitySigners = getIdentitySigners(result) + expect(identitySigners).toEqual([testAddress1, testAddress2]) + + const blacklist = getImplicitBlacklist(result) + expect(blacklist).toEqual([]) + + const explicitSigners = getExplicitSigners(result) + expect(explicitSigners).toEqual([]) + }) }) }) diff --git a/packages/wallet/wdk/src/sequence/sessions.ts b/packages/wallet/wdk/src/sequence/sessions.ts index 203eaf598c..8a6bc2d8a0 100644 --- a/packages/wallet/wdk/src/sequence/sessions.ts +++ b/packages/wallet/wdk/src/sequence/sessions.ts @@ -264,6 +264,36 @@ export class Sessions implements SessionsInterface { return modules.some((m) => Address.isEqual(m.sapientLeaf.address, this.shared.sequence.extensions.sessions)) } + async initSessionModule(modules: Module[], identitySigners: Address.Address[], guardTopology?: Config.NestedLeaf) { + if (this.hasSessionModule(modules)) { + throw new Error('session-module-already-initialized') + } + + if (identitySigners.length === 0) { + throw new Error('No identity signers provided') + } + + // Calculate image hash with the identity signers + const sessionsTopology = SessionConfig.emptySessionsTopology( + identitySigners as [Address.Address, ...Address.Address[]], + ) + // Store this tree in the state provider + const sessionsConfigTree = SessionConfig.sessionsTopologyToConfigurationTree(sessionsTopology) + this.shared.sequence.stateProvider.saveTree(sessionsConfigTree) + // Prepare the configuration leaf + const sessionsImageHash = GenericTree.hash(sessionsConfigTree) + const signer = { + ...ManagerOptionsDefaults.defaultSessionsTopology, + address: this.shared.sequence.extensions.sessions, + imageHash: sessionsImageHash, + } + modules.push({ + sapientLeaf: signer, + weight: 255n, + guardLeaf: guardTopology, + }) + } + async addIdentitySignerToModules(modules: Module[], address: Address.Address) { if (!this.hasSessionModule(modules)) { throw new Error('session-module-not-enabled') diff --git a/packages/wallet/wdk/src/sequence/wallets.ts b/packages/wallet/wdk/src/sequence/wallets.ts index 9592c68875..a859ca797e 100644 --- a/packages/wallet/wdk/src/sequence/wallets.ts +++ b/packages/wallet/wdk/src/sequence/wallets.ts @@ -817,31 +817,12 @@ export class Wallets implements WalletsInterface { let modules: Module[] = [] if (!args.noSessionManager) { - // Calculate image hash with the identity and device signer - let sessionsTopology = SessionConfig.emptySessionsTopology(loginSignerAddress) - sessionsTopology = SessionConfig.addIdentitySigner(sessionsTopology, device.address) - // Store this tree in the state provider - const sessionsConfigTree = SessionConfig.sessionsTopologyToConfigurationTree(sessionsTopology) - this.shared.sequence.stateProvider.saveTree(sessionsConfigTree) - // Prepare the configuration leaf - const sessionsImageHash = GenericTree.hash(sessionsConfigTree) - const signer = { - ...ManagerOptionsDefaults.defaultSessionsTopology, - address: this.shared.sequence.extensions.sessions, - imageHash: sessionsImageHash, - } - if (sessionsGuardTopology) { - modules.push({ - sapientLeaf: signer, - weight: 255n, - guardLeaf: sessionsGuardTopology, - }) - } else { - modules.push({ - sapientLeaf: signer, - weight: 255n, - }) + const identitySigners = [device.address] + if (!Signers.isSapientSigner(loginSigner.signer)) { + // Add non sapient login signer to the identity signers + identitySigners.unshift(loginSignerAddress) } + await this.shared.modules.sessions.initSessionModule(modules, identitySigners, sessionsGuardTopology) } if (!args.noRecovery) { From b2d1897ad668928466b8384970af80c9177d99b3 Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Mon, 22 Sep 2025 09:40:39 +1200 Subject: [PATCH 19/36] Use length checks --- packages/wallet/wdk/src/sequence/sessions.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/wallet/wdk/src/sequence/sessions.ts b/packages/wallet/wdk/src/sequence/sessions.ts index 8a6bc2d8a0..a115005598 100644 --- a/packages/wallet/wdk/src/sequence/sessions.ts +++ b/packages/wallet/wdk/src/sequence/sessions.ts @@ -331,7 +331,7 @@ export class Sessions implements SessionsInterface { ): Promise { const topology = await this.getTopology(walletAddress) const identitySigners = SessionConfig.getIdentitySigners(topology) - if (!identitySigners) { + if (identitySigners.length === 0) { throw new Error('No identity signers found') } let handler: Handler | undefined From 1b7417477692321e599887700b54275600ed9f66 Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Mon, 22 Sep 2025 09:41:09 +1200 Subject: [PATCH 20/36] Throw on missing identity signer --- packages/wallet/primitives/src/session-signature.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/wallet/primitives/src/session-signature.ts b/packages/wallet/primitives/src/session-signature.ts index 84ea3123bd..bdde4b8572 100644 --- a/packages/wallet/primitives/src/session-signature.ts +++ b/packages/wallet/primitives/src/session-signature.ts @@ -129,7 +129,7 @@ export function encodeSessionCallSignatures( } if (implicitSigners.length > 0 && !identitySigner) { - console.warn('Encodings using implicit signers without identity signer may encode incorrectly') + throw new Error('Implicit signers without identity signer') } // Check the topology contains exactly one identity signer From 1a8f595f0cfcd1b76056eb8c89277d247079d2c5 Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Mon, 22 Sep 2025 09:59:15 +1200 Subject: [PATCH 21/36] Encoding requires identity signer to encode --- .../core/src/signers/session-manager.ts | 13 +++++- .../primitives-cli/src/subcommands/server.ts | 2 +- .../primitives-cli/src/subcommands/session.ts | 20 ++++++++- .../primitives/src/session-signature.ts | 17 ++------ .../primitives/test/session-signature.test.ts | 42 +++++++++---------- 5 files changed, 55 insertions(+), 39 deletions(-) diff --git a/packages/wallet/core/src/signers/session-manager.ts b/packages/wallet/core/src/signers/session-manager.ts index 12917553bc..99d189131e 100644 --- a/packages/wallet/core/src/signers/session-manager.ts +++ b/packages/wallet/core/src/signers/session-manager.ts @@ -292,7 +292,7 @@ export class SessionManager implements SapientSigner { } } - // Encode the signature + // Prepare encoding params const explicitSigners: Address.Address[] = [] const implicitSigners: Address.Address[] = [] let identitySigner: Address.Address | undefined @@ -315,13 +315,22 @@ export class SessionManager implements SapientSigner { } }), ) + if (!identitySigner) { + // Explicit signers only. Use any identity signer + const identitySigners = SessionConfig.getIdentitySigners(await this.topology) + if (identitySigners.length === 0) { + throw new Error('No identity signers found') + } + identitySigner = identitySigners[0]! + } + // Perform encoding const encodedSignature = SessionSignature.encodeSessionCallSignatures( signatures, await this.topology, + identitySigner, explicitSigners, implicitSigners, - identitySigner, ) return { diff --git a/packages/wallet/primitives-cli/src/subcommands/server.ts b/packages/wallet/primitives-cli/src/subcommands/server.ts index bef0e8fa21..29c5e1118b 100644 --- a/packages/wallet/primitives-cli/src/subcommands/server.ts +++ b/packages/wallet/primitives-cli/src/subcommands/server.ts @@ -141,9 +141,9 @@ const rpcMethods: Record Promise> = { const result = await session.doEncodeSessionCallSignatures( JSON.stringify(sessionTopology), callSignatures.map(JSON.stringify), + identitySigner, explicitSigners, implicitSigners, - identitySigner, ) return result }, diff --git a/packages/wallet/primitives-cli/src/subcommands/session.ts b/packages/wallet/primitives-cli/src/subcommands/session.ts index 4217c84186..28453121c3 100644 --- a/packages/wallet/primitives-cli/src/subcommands/session.ts +++ b/packages/wallet/primitives-cli/src/subcommands/session.ts @@ -19,18 +19,26 @@ export async function doEncodeTopology(sessionTopologyInput: string): Promise { const sessionTopology = SessionConfig.sessionsTopologyFromJson(sessionTopologyInput) const callSignatures = callSignaturesInput.map((s) => SessionSignature.sessionCallSignatureFromJson(s)) + // Use first identity signer if not provided + if (!identitySigner) { + const identitySigners = SessionConfig.getIdentitySigners(sessionTopology) + if (identitySigners.length === 0) { + throw new Error('No identity signers found') + } + identitySigner = identitySigners[0]! + } const encoded = SessionSignature.encodeSessionCallSignatures( callSignatures, sessionTopology, + identitySigner as `0x${string}`, explicitSigners as `0x${string}`[], implicitSigners as `0x${string}`[], - identitySigner as `0x${string}` | undefined, ) return Hex.from(encoded) } @@ -92,6 +100,13 @@ const sessionCommand: CommandModule = { description: 'The call signatures', demandOption: true, }) + .option('identity-signer', { + type: 'string', + description: 'The identity signer', + demandOption: false, + default: undefined, + alias: 'id', + }) .option('explicit-signers', { type: 'string', array: true, @@ -114,6 +129,7 @@ const sessionCommand: CommandModule = { await doEncodeSessionCallSignatures( args.sessionTopology, args.callSignatures, + args.identitySigner, args.explicitSigners, args.implicitSigners, ), diff --git a/packages/wallet/primitives/src/session-signature.ts b/packages/wallet/primitives/src/session-signature.ts index bdde4b8572..6f92fa5be1 100644 --- a/packages/wallet/primitives/src/session-signature.ts +++ b/packages/wallet/primitives/src/session-signature.ts @@ -116,9 +116,9 @@ function rsyFromRsvStr(sigStr: string): RSY { export function encodeSessionCallSignatures( callSignatures: SessionCallSignature[], topology: SessionsTopology, + identitySigner: Address.Address, explicitSigners: Address.Address[] = [], implicitSigners: Address.Address[] = [], - identitySigner?: Address.Address, ): Bytes.Bytes { const parts: Bytes.Bytes[] = [] @@ -128,19 +128,10 @@ export function encodeSessionCallSignatures( throw new Error('Incomplete topology') } - if (implicitSigners.length > 0 && !identitySigner) { - throw new Error('Implicit signers without identity signer') - } - - // Check the topology contains exactly one identity signer + // Check the topology contains the identity signer const identitySigners = getIdentitySigners(topology) - if (identitySigner) { - if (!identitySigners.some((s) => Address.isEqual(s, identitySigner!))) { - throw new Error('Identity signer not found') - } - } else { - // Grab the first one - identitySigner = identitySigners[0]! + if (!identitySigners.some((s) => Address.isEqual(s, identitySigner))) { + throw new Error('Identity signer not found') } // Optimise the configuration tree by rolling unused signers into nodes. diff --git a/packages/wallet/primitives/test/session-signature.test.ts b/packages/wallet/primitives/test/session-signature.test.ts index 0e1eff066c..a9b193d79c 100644 --- a/packages/wallet/primitives/test/session-signature.test.ts +++ b/packages/wallet/primitives/test/session-signature.test.ts @@ -280,7 +280,7 @@ describe('Session Signature', () => { describe('encodeSessionCallSignatures', () => { it('should encode single explicit session call signature', () => { const callSignatures = [sampleExplicitSignature] - const result = encodeSessionCallSignatures(callSignatures, completeTopology) + const result = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) expect(result.length).toBeGreaterThan(0) @@ -289,7 +289,7 @@ describe('Session Signature', () => { // Skip implicit signature tests that cause encoding issues it.skip('should encode single implicit session call signature', () => { const callSignatures = [sampleImplicitSignature] - const result = encodeSessionCallSignatures(callSignatures, completeTopology) + const result = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) expect(result.length).toBeGreaterThan(0) @@ -297,7 +297,7 @@ describe('Session Signature', () => { it.skip('should encode multiple mixed session call signatures', () => { const callSignatures = [sampleImplicitSignature, sampleExplicitSignature] - const result = encodeSessionCallSignatures(callSignatures, completeTopology) + const result = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) expect(result.length).toBeGreaterThan(0) @@ -311,7 +311,7 @@ describe('Session Signature', () => { sessionSignature: sampleRSY2, // Different session signature }, ] - const result = encodeSessionCallSignatures(callSignatures, completeTopology) + const result = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) expect(result.length).toBeGreaterThan(0) @@ -347,7 +347,7 @@ describe('Session Signature', () => { // Missing identity signer, but has 2 elements for valid SessionBranch ] - expect(() => encodeSessionCallSignatures([sampleExplicitSignature], incompleteTopology)).toThrow( + expect(() => encodeSessionCallSignatures([sampleExplicitSignature], incompleteTopology, testAddress1)).toThrow( 'Incomplete topology', ) }) @@ -358,7 +358,7 @@ describe('Session Signature', () => { sessionSignature: sampleRSY, } - expect(() => encodeSessionCallSignatures([largeIndexSignature], completeTopology)).toThrow( + expect(() => encodeSessionCallSignatures([largeIndexSignature], completeTopology, testAddress1)).toThrow( 'Permission index is too large', ) }) @@ -372,13 +372,13 @@ describe('Session Signature', () => { sessionSignature: sampleRSY, })) - const result = encodeSessionCallSignatures(callSignatures, completeTopology) + const result = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) }) it('should handle explicit signers parameter', () => { const callSignatures = [sampleExplicitSignature] - const result = encodeSessionCallSignatures(callSignatures, completeTopology, [testAddress1]) + const result = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) expect(result.length).toBeGreaterThan(0) @@ -386,7 +386,7 @@ describe('Session Signature', () => { it('should handle implicit signers parameter', () => { const callSignatures = [sampleExplicitSignature] - const result = encodeSessionCallSignatures(callSignatures, completeTopology, [], [testAddress2]) + const result = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1, [], [testAddress2]) expect(result).toBeInstanceOf(Uint8Array) expect(result.length).toBeGreaterThan(0) @@ -394,16 +394,16 @@ describe('Session Signature', () => { it('should throw for invalid call signature type', () => { const invalidSignature = {} as any - expect(() => encodeSessionCallSignatures([invalidSignature], completeTopology)).toThrow( + expect(() => encodeSessionCallSignatures([invalidSignature], completeTopology, testAddress1)).toThrow( 'Invalid call signature', ) }) it('should throw for identity signer not found', () => { const callSignatures = [sampleExplicitSignature] - expect(() => encodeSessionCallSignatures(callSignatures, completeTopology, [], [], testAddress2)).toThrow( - 'Identity signer not found', - ) + expect(() => + encodeSessionCallSignatures(callSignatures, completeTopology, testAddress2, [], [testAddress2]), + ).toThrow('Identity signer not found') }) }) }) @@ -532,7 +532,7 @@ describe('Session Signature', () => { describe('Edge Cases and Error Handling', () => { it('should handle empty call signatures array', () => { - const result = encodeSessionCallSignatures([], completeTopology) + const result = encodeSessionCallSignatures([], completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) expect(result.length).toBeGreaterThan(0) // Should still contain topology }) @@ -543,7 +543,7 @@ describe('Session Signature', () => { sessionSignature: sampleRSY, } - const result = encodeSessionCallSignatures([maxIndexSignature], completeTopology) + const result = encodeSessionCallSignatures([maxIndexSignature], completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) }) @@ -553,7 +553,7 @@ describe('Session Signature', () => { sessionSignature: sampleRSY, } - const result = encodeSessionCallSignatures([zeroIndexSignature], completeTopology) + const result = encodeSessionCallSignatures([zeroIndexSignature], completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) }) @@ -602,7 +602,7 @@ describe('Session Signature', () => { sessionSignature: sampleRSY2, } - const result = encodeSessionCallSignatures([minimalImplicitSignature], completeTopology) + const result = encodeSessionCallSignatures([minimalImplicitSignature], completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) }) @@ -646,7 +646,7 @@ describe('Session Signature', () => { // This test may not actually trigger the error since creating a 3-byte overflow is complex // We'll test that the function works with a large but valid topology - const result = encodeSessionCallSignatures(callSignatures, largeTopology) + const result = encodeSessionCallSignatures(callSignatures, largeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) }) @@ -669,7 +669,7 @@ describe('Session Signature', () => { const callSignatures: ExplicitSessionCallSignature[] = [invalidExplicitSignature] expect(() => { - encodeSessionCallSignatures(callSignatures, completeTopology) + encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) }).toThrow() // Should throw due to permission index validation }) }) @@ -685,7 +685,7 @@ describe('Session Signature', () => { ] // Encode - const encoded = encodeSessionCallSignatures(callSignatures, completeTopology, [testAddress1]) + const encoded = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) expect(encoded).toBeInstanceOf(Uint8Array) // Test encoding for each signature @@ -733,7 +733,7 @@ describe('Session Signature', () => { }, ] - const result = encodeSessionCallSignatures(callSignatures, completeTopology) + const result = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) expect(result.length).toBeGreaterThan(0) }) From 11e3629bb843f05c94a6269f3915dda9c8007fb5 Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Mon, 22 Sep 2025 10:04:13 +1200 Subject: [PATCH 22/36] Fix test --- packages/wallet/core/test/session-manager.test.ts | 9 +++++++-- .../wallet/core/test/signers-session-implicit.test.ts | 4 ++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/wallet/core/test/session-manager.test.ts b/packages/wallet/core/test/session-manager.test.ts index cf1915036e..bde3b12994 100644 --- a/packages/wallet/core/test/session-manager.test.ts +++ b/packages/wallet/core/test/session-manager.test.ts @@ -504,13 +504,18 @@ for (const extension of ALL_EXTENSIONS) { const provider = Provider.from(RpcTransport.fromHttp(LOCAL_RPC_URL)) const chainId = 0 + // Create unique identity and state provider for this test + const identityPrivateKey = Secp256k1.randomPrivateKey() + const identityAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: identityPrivateKey })) + const stateProvider = new State.Local.Provider() + // Create explicit signer const explicitPrivateKey = Secp256k1.randomPrivateKey() const explicitPermissions: Signers.Session.ExplicitParams = { chainId, valueLimit: 1000000000000000000n, // 1 ETH deadline: BigInt(Math.floor(Date.now() / 1000) - 3600), // 1 hour ago - permissions: [PermissionBuilder.for(EMITTER_ADDRESS).allowAll().build()], + permissions: [PermissionBuilder.for(EMITTER_ADDRESS1).allowAll().build()], } const explicitSigner = new Signers.Session.Explicit(explicitPrivateKey, explicitPermissions) // Create the topology and wallet @@ -539,7 +544,7 @@ for (const extension of ALL_EXTENSIONS) { // Create a test transaction within permissions const call: Payload.Call = { - to: EMITTER_ADDRESS, + to: EMITTER_ADDRESS1, value: 0n, data: AbiFunction.encodeData(EMITTER_FUNCTIONS[0]), // Explicit emit gasLimit: 0n, diff --git a/packages/wallet/core/test/signers-session-implicit.test.ts b/packages/wallet/core/test/signers-session-implicit.test.ts index 7d6b0db994..ed66a50afc 100644 --- a/packages/wallet/core/test/signers-session-implicit.test.ts +++ b/packages/wallet/core/test/signers-session-implicit.test.ts @@ -103,7 +103,7 @@ describe('Implicit Session', () => { const result = implicitSigner.isValid(topology, 1) expect(result.isValid).toBe(false) - expect(result.invalidReason).toBe('Identity signer mismatch') + expect(result.invalidReason).toBe('Identity signer not found') }) it('should return true regardless of chainId', () => { @@ -223,7 +223,7 @@ describe('Implicit Session', () => { const result = implicitSigner.isValid(topology, 1) expect(result.isValid).toBe(false) - expect(result.invalidReason).toBe('Identity signer mismatch') + expect(result.invalidReason).toBe('Identity signer not found') }) it('should return false when attestation is issued in the future', () => { From 86abf3f9c58418a2dccb6ddb5048744398318607 Mon Sep 17 00:00:00 2001 From: Gabi <56271768+VGabriel45@users.noreply.github.com> Date: Tue, 23 Sep 2025 18:13:54 +0300 Subject: [PATCH 23/36] Refactor/types namings tsdoc redundant code (#880) * refactor types, namings, ts doc * fix session response payload * change parameter name * change parameter name * change type in tests * improve types and dapp client methods * fix session test to use new types * refactor * refactor implicit sessions array in chain session manager * remove unused types * remove unused types and add ConnectionError * update pnpm lock * move reusable session types to wallet-core * Update some imports and update some response type names --------- Co-authored-by: Tolgahan Arikan --- packages/services/api/src/api.gen.ts | 3779 ++++++++++------- .../relayer/src/rpc-relayer/relayer.gen.ts | 1365 +++--- packages/wallet/core/src/index.ts | 6 + .../wallet/core/src/utils/session/types.ts | 33 + .../wallet/core/test/session-manager.test.ts | 17 +- .../dapp-client/src/ChainSessionManager.ts | 127 +- packages/wallet/dapp-client/src/DappClient.ts | 161 +- packages/wallet/dapp-client/src/index.ts | 18 +- .../wallet/dapp-client/src/types/index.ts | 85 +- .../wallet/dapp-client/src/utils/storage.ts | 11 +- packages/wallet/primitives/src/permission.ts | 4 +- packages/wallet/wdk/src/sequence/sessions.ts | 180 +- .../wallet/wdk/src/sequence/types/sessions.ts | 6 + packages/wallet/wdk/test/sessions.test.ts | 39 +- pnpm-lock.yaml | 1540 +++---- 15 files changed, 3980 insertions(+), 3391 deletions(-) create mode 100644 packages/wallet/core/src/utils/session/types.ts create mode 100644 packages/wallet/wdk/src/sequence/types/sessions.ts diff --git a/packages/services/api/src/api.gen.ts b/packages/services/api/src/api.gen.ts index a42d143d6d..967fad8fe2 100644 --- a/packages/services/api/src/api.gen.ts +++ b/packages/services/api/src/api.gen.ts @@ -5,75 +5,74 @@ // // webrpc-gen -schema=api.ridl -target=typescript -client -out=./clients/api.gen.ts -export const WebrpcHeader = "Webrpc" +export const WebrpcHeader = 'Webrpc' -export const WebrpcHeaderValue = "webrpc@v0.25.3;gen-typescript@v0.17.0;sequence-api@v0.4.0" +export const WebrpcHeaderValue = 'webrpc@v0.25.3;gen-typescript@v0.17.0;sequence-api@v0.4.0' // WebRPC description and code-gen version -export const WebRPCVersion = "v1" +export const WebRPCVersion = 'v1' // Schema version of your RIDL schema -export const WebRPCSchemaVersion = "v0.4.0" +export const WebRPCSchemaVersion = 'v0.4.0' // Schema hash generated from your RIDL schema -export const WebRPCSchemaHash = "d43a5aac616814072c69e63f2f81fe65ea10a7e0" +export const WebRPCSchemaHash = 'd43a5aac616814072c69e63f2f81fe65ea10a7e0' type WebrpcGenVersions = { - webrpcGenVersion: string; - codeGenName: string; - codeGenVersion: string; - schemaName: string; - schemaVersion: string; -}; + webrpcGenVersion: string + codeGenName: string + codeGenVersion: string + schemaName: string + schemaVersion: string +} export function VersionFromHeader(headers: Headers): WebrpcGenVersions { - const headerValue = headers.get(WebrpcHeader); + const headerValue = headers.get(WebrpcHeader) if (!headerValue) { return { - webrpcGenVersion: "", - codeGenName: "", - codeGenVersion: "", - schemaName: "", - schemaVersion: "", - }; + webrpcGenVersion: '', + codeGenName: '', + codeGenVersion: '', + schemaName: '', + schemaVersion: '', + } } - return parseWebrpcGenVersions(headerValue); + return parseWebrpcGenVersions(headerValue) } function parseWebrpcGenVersions(header: string): WebrpcGenVersions { - const versions = header.split(";"); + const versions = header.split(';') if (versions.length < 3) { return { - webrpcGenVersion: "", - codeGenName: "", - codeGenVersion: "", - schemaName: "", - schemaVersion: "", - }; + webrpcGenVersion: '', + codeGenName: '', + codeGenVersion: '', + schemaName: '', + schemaVersion: '', + } } - const [_, webrpcGenVersion] = versions[0]!.split("@"); - const [codeGenName, codeGenVersion] = versions[1]!.split("@"); - const [schemaName, schemaVersion] = versions[2]!.split("@"); + const [_, webrpcGenVersion] = versions[0]!.split('@') + const [codeGenName, codeGenVersion] = versions[1]!.split('@') + const [schemaName, schemaVersion] = versions[2]!.split('@') return { - webrpcGenVersion: webrpcGenVersion ?? "", - codeGenName: codeGenName ?? "", - codeGenVersion: codeGenVersion ?? "", - schemaName: schemaName ?? "", - schemaVersion: schemaVersion ?? "", - }; + webrpcGenVersion: webrpcGenVersion ?? '', + codeGenName: codeGenName ?? '', + codeGenVersion: codeGenVersion ?? '', + schemaName: schemaName ?? '', + schemaVersion: schemaVersion ?? '', + } } // // Types // - export enum SortOrder { DESC = 'DESC', - ASC = 'ASC' + ASC = 'ASC', } export enum SardinePaymentType { @@ -82,57 +81,57 @@ export enum SardinePaymentType { credit = 'credit', us_debit = 'us_debit', international_debit = 'international_debit', - international_credit = 'international_credit' + international_credit = 'international_credit', } export enum SardineQuoteType { buy = 'buy', - sell = 'sell' + sell = 'sell', } export enum GetLifiSwapRouteDirection { to = 'to', - from = 'from' + from = 'from', } export enum TokenType { ERC20 = 'ERC20', ERC721 = 'ERC721', - ERC1155 = 'ERC1155' + ERC1155 = 'ERC1155', } export enum TransakBuySell { UNKNOWN = 'UNKNOWN', BUY = 'BUY', - SELL = 'SELL' + SELL = 'SELL', } export enum TradeType { EXACT_INPUT = 'EXACT_INPUT', - EXACT_OUTPUT = 'EXACT_OUTPUT' + EXACT_OUTPUT = 'EXACT_OUTPUT', } export enum CheckoutOptionCrypto { none = 'none', partially = 'partially', - all = 'all' + all = 'all', } export enum CheckoutOptionNFTCheckoutProvider { unknown = 'unknown', sardine = 'sardine', - transak = 'transak' + transak = 'transak', } export enum CheckoutOptionOnRampProvider { unknown = 'unknown', sardine = 'sardine', - transak = 'transak' + transak = 'transak', } export enum CheckoutOptionSwapProvider { unknown = 'unknown', - lifi = 'lifi' + lifi = 'lifi', } export interface Version { @@ -150,7 +149,7 @@ export interface RuntimeStatus { branch: string commitHash: string checks: RuntimeChecks - numTxnsRelayed: {[key: string]: NumTxnsRelayed} + numTxnsRelayed: { [key: string]: NumTxnsRelayed } } export interface NumTxnsRelayed { @@ -160,8 +159,7 @@ export interface NumTxnsRelayed { period: number } -export interface RuntimeChecks { -} +export interface RuntimeChecks {} export interface SequenceContext { factory: string @@ -960,14 +958,14 @@ export interface IntentQuote { quoteProvider: string quoteProviderRequestId: string quoteProviderFeeUsd: string - feeQuotes: {[key: string]: string} + feeQuotes: { [key: string]: string } } export interface API { /** - * + * * Runtime - * + * */ ping(headers?: object, signal?: AbortSignal): Promise version(headers?: object, signal?: AbortSignal): Promise @@ -975,70 +973,133 @@ export interface API { clock(headers?: object, signal?: AbortSignal): Promise getSequenceContext(headers?: object, signal?: AbortSignal): Promise /** - * + * * Auth - * + * * TODO: rename 'ewtString' arg to 'ethauthProof' */ getAuthToken(args: GetAuthTokenArgs, headers?: object, signal?: AbortSignal): Promise getAuthToken2(args: GetAuthToken2Args, headers?: object, signal?: AbortSignal): Promise - sendPasswordlessLink(args: SendPasswordlessLinkArgs, headers?: object, signal?: AbortSignal): Promise - registerPublicKey(args: RegisterPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise + sendPasswordlessLink( + args: SendPasswordlessLinkArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + registerPublicKey( + args: RegisterPublicKeyArgs, + headers?: object, + signal?: AbortSignal, + ): Promise getPublicKey(args: GetPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Contacts / Friends - * + * */ friendList(args: FriendListArgs, headers?: object, signal?: AbortSignal): Promise - getFriendByAddress(args: GetFriendByAddressArgs, headers?: object, signal?: AbortSignal): Promise + getFriendByAddress( + args: GetFriendByAddressArgs, + headers?: object, + signal?: AbortSignal, + ): Promise searchFriends(args: SearchFriendsArgs, headers?: object, signal?: AbortSignal): Promise addFriend(args: AddFriendArgs, headers?: object, signal?: AbortSignal): Promise - updateFriendNickname(args: UpdateFriendNicknameArgs, headers?: object, signal?: AbortSignal): Promise + updateFriendNickname( + args: UpdateFriendNicknameArgs, + headers?: object, + signal?: AbortSignal, + ): Promise removeFriend(args: RemoveFriendArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Chain-Utils - * + * */ contractCall(args: ContractCallArgs, headers?: object, signal?: AbortSignal): Promise - decodeContractCall(args: DecodeContractCallArgs, headers?: object, signal?: AbortSignal): Promise - lookupContractCallSelectors(args: LookupContractCallSelectorsArgs, headers?: object, signal?: AbortSignal): Promise + decodeContractCall( + args: DecodeContractCallArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + lookupContractCallSelectors( + args: LookupContractCallSelectorsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** - * + * * User Storage - * + * */ userStorageFetch(args: UserStorageFetchArgs, headers?: object, signal?: AbortSignal): Promise userStorageSave(args: UserStorageSaveArgs, headers?: object, signal?: AbortSignal): Promise - userStorageDelete(args: UserStorageDeleteArgs, headers?: object, signal?: AbortSignal): Promise - userStorageFetchAll(args: UserStorageFetchAllArgs, headers?: object, signal?: AbortSignal): Promise + userStorageDelete( + args: UserStorageDeleteArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + userStorageFetchAll( + args: UserStorageFetchAllArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** - * + * * Wallet utils - * + * */ getMoonpayLink(args: GetMoonpayLinkArgs, headers?: object, signal?: AbortSignal): Promise /** * - IsUsingGoogleMail(domain: string) => (yes: bool) */ - resolveENSAddress(args: ResolveENSAddressArgs, headers?: object, signal?: AbortSignal): Promise + resolveENSAddress( + args: ResolveENSAddressArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** * TODO: we can add walletContext optional in the future when we need it * NOTE: chainId can be either a number or canonical name */ isValidSignature(args: IsValidSignatureArgs, headers?: object, signal?: AbortSignal): Promise - isValidMessageSignature(args: IsValidMessageSignatureArgs, headers?: object, signal?: AbortSignal): Promise - isValidTypedDataSignature(args: IsValidTypedDataSignatureArgs, headers?: object, signal?: AbortSignal): Promise - isValidETHAuthProof(args: IsValidETHAuthProofArgs, headers?: object, signal?: AbortSignal): Promise + isValidMessageSignature( + args: IsValidMessageSignatureArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + isValidTypedDataSignature( + args: IsValidTypedDataSignatureArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + isValidETHAuthProof( + args: IsValidETHAuthProofArgs, + headers?: object, + signal?: AbortSignal, + ): Promise getOnRampURL(args: GetOnRampURLArgs, headers?: object, signal?: AbortSignal): Promise sardineGetClientToken(headers?: object, signal?: AbortSignal): Promise - sardineGetNFTCheckoutToken(args: SardineGetNFTCheckoutTokenArgs, headers?: object, signal?: AbortSignal): Promise - sardineGetNFTCheckoutOrderStatus(args: SardineGetNFTCheckoutOrderStatusArgs, headers?: object, signal?: AbortSignal): Promise + sardineGetNFTCheckoutToken( + args: SardineGetNFTCheckoutTokenArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + sardineGetNFTCheckoutOrderStatus( + args: SardineGetNFTCheckoutOrderStatusArgs, + headers?: object, + signal?: AbortSignal, + ): Promise sardineGetSupportedRegions(headers?: object, signal?: AbortSignal): Promise - sardineGetSupportedFiatCurrencies(headers?: object, signal?: AbortSignal): Promise + sardineGetSupportedFiatCurrencies( + headers?: object, + signal?: AbortSignal, + ): Promise sardineGetSupportedTokens(headers?: object, signal?: AbortSignal): Promise - sardineGetSupportedTokenForSwap(args: SardineGetSupportedTokenForSwapArgs, headers?: object, signal?: AbortSignal): Promise + sardineGetSupportedTokenForSwap( + args: SardineGetSupportedTokenForSwapArgs, + headers?: object, + signal?: AbortSignal, + ): Promise sardineGetEnabledTokens(headers?: object, signal?: AbortSignal): Promise sardineGetQuote(args: SardineGetQuoteArgs, headers?: object, signal?: AbortSignal): Promise /** @@ -1048,172 +1109,302 @@ export interface API { /** * Deprecated. Use SardineGetNFTCheckoutToken() instead. */ - getSardineNFTCheckoutToken(args: GetSardineNFTCheckoutTokenArgs, headers?: object, signal?: AbortSignal): Promise + getSardineNFTCheckoutToken( + args: GetSardineNFTCheckoutTokenArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** * Deprecated. Use SardineGetNFTCheckoutOrderStatus() instead. */ - getSardineNFTCheckoutOrderStatus(args: GetSardineNFTCheckoutOrderStatusArgs, headers?: object, signal?: AbortSignal): Promise + getSardineNFTCheckoutOrderStatus( + args: GetSardineNFTCheckoutOrderStatusArgs, + headers?: object, + signal?: AbortSignal, + ): Promise transakGetCountries(headers?: object, signal?: AbortSignal): Promise transakGetCryptoCurrencies(headers?: object, signal?: AbortSignal): Promise transakGetFiatCurrencies(headers?: object, signal?: AbortSignal): Promise transakGetPrice(args: TransakGetPriceArgs, headers?: object, signal?: AbortSignal): Promise - transakGetSupportedNFTCheckoutChains(headers?: object, signal?: AbortSignal): Promise + transakGetSupportedNFTCheckoutChains( + headers?: object, + signal?: AbortSignal, + ): Promise /** - * + * * Price Feed - * + * */ getCoinPrices(args: GetCoinPricesArgs, headers?: object, signal?: AbortSignal): Promise - getCollectiblePrices(args: GetCollectiblePricesArgs, headers?: object, signal?: AbortSignal): Promise + getCollectiblePrices( + args: GetCollectiblePricesArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** - * + * * Price Feed utils - * + * */ getExchangeRate(args: GetExchangeRateArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Util / misc - * + * */ memoryStore(args: MemoryStoreArgs, headers?: object, signal?: AbortSignal): Promise memoryLoad(args: MemoryLoadArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Legacy - * + * */ getInviteInfo(headers?: object, signal?: AbortSignal): Promise /** * NOTE: we're still using this from SW-API to Sequence-API to claim invite code */ - isValidAccessCode(args: IsValidAccessCodeArgs, headers?: object, signal?: AbortSignal): Promise - internalClaimAccessCode(args: InternalClaimAccessCodeArgs, headers?: object, signal?: AbortSignal): Promise + isValidAccessCode( + args: IsValidAccessCodeArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + internalClaimAccessCode( + args: InternalClaimAccessCodeArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** * Utils */ - blockNumberAtTime(args: BlockNumberAtTimeArgs, headers?: object, signal?: AbortSignal): Promise + blockNumberAtTime( + args: BlockNumberAtTimeArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** - * + * * Paper * TODO: deprecate in the future - * + * */ - paperSessionSecret(args: PaperSessionSecretArgs, headers?: object, signal?: AbortSignal): Promise - paperSessionSecret2(args: PaperSessionSecret2Args, headers?: object, signal?: AbortSignal): Promise + paperSessionSecret( + args: PaperSessionSecretArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + paperSessionSecret2( + args: PaperSessionSecret2Args, + headers?: object, + signal?: AbortSignal, + ): Promise /** - * + * * Linked wallets (v0 -- simple support) - * + * */ linkWallet(args: LinkWalletArgs, headers?: object, signal?: AbortSignal): Promise getLinkedWallets(args: GetLinkedWalletsArgs, headers?: object, signal?: AbortSignal): Promise - removeLinkedWallet(args: RemoveLinkedWalletArgs, headers?: object, signal?: AbortSignal): Promise + removeLinkedWallet( + args: RemoveLinkedWalletArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** * NOTE: these methods are deprecated, please do not use them. We may resurface them in the future, but just wanted * to be clear, they are not necessary for our linked wallets. */ - generateWaaSVerificationURL(args: GenerateWaaSVerificationURLArgs, headers?: object, signal?: AbortSignal): Promise - validateWaaSVerificationNonce(args: ValidateWaaSVerificationNonceArgs, headers?: object, signal?: AbortSignal): Promise + generateWaaSVerificationURL( + args: GenerateWaaSVerificationURLArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + validateWaaSVerificationNonce( + args: ValidateWaaSVerificationNonceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** - * - * + * + * * WaaS child wallet adoption - * + * */ - listAdoptedWallets(args: ListAdoptedWalletsArgs, headers?: object, signal?: AbortSignal): Promise + listAdoptedWallets( + args: ListAdoptedWalletsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise getLifiChains(headers?: object, signal?: AbortSignal): Promise getLifiTokens(args: GetLifiTokensArgs, headers?: object, signal?: AbortSignal): Promise /** * All parameters except `params` are deprecated. * Use only the `params` object to pass values. */ - getLifiSwapRoutes(args: GetLifiSwapRoutesArgs, headers?: object, signal?: AbortSignal): Promise + getLifiSwapRoutes( + args: GetLifiSwapRoutesArgs, + headers?: object, + signal?: AbortSignal, + ): Promise getLifiSwapQuote(args: GetLifiSwapQuoteArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Chain abstraction - * + * */ - getIntentCallsPayloads(args: GetIntentCallsPayloadsArgs, headers?: object, signal?: AbortSignal): Promise - commitIntentConfig(args: CommitIntentConfigArgs, headers?: object, signal?: AbortSignal): Promise + getIntentCallsPayloads( + args: GetIntentCallsPayloadsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + commitIntentConfig( + args: CommitIntentConfigArgs, + headers?: object, + signal?: AbortSignal, + ): Promise getIntentConfig(args: GetIntentConfigArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Inventory, payments and management - * + * */ listCurrencyGroups(headers?: object, signal?: AbortSignal): Promise - addOffchainInventory(args: AddOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise - getOffchainInventory(args: GetOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise - listOffchainInventories(args: ListOffchainInventoriesArgs, headers?: object, signal?: AbortSignal): Promise - updateOffchainInventory(args: UpdateOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise - deleteOffchainInventory(args: DeleteOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise - requestOffchainPayment(args: RequestOffchainPaymentArgs, headers?: object, signal?: AbortSignal): Promise - listOffchainPayments(args: ListOffchainPaymentsArgs, headers?: object, signal?: AbortSignal): Promise + addOffchainInventory( + args: AddOffchainInventoryArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + getOffchainInventory( + args: GetOffchainInventoryArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + listOffchainInventories( + args: ListOffchainInventoriesArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + updateOffchainInventory( + args: UpdateOffchainInventoryArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + deleteOffchainInventory( + args: DeleteOffchainInventoryArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + requestOffchainPayment( + args: RequestOffchainPaymentArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + listOffchainPayments( + args: ListOffchainPaymentsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** - * + * * Packs - * + * */ savePack(args: SavePackArgs, headers?: object, signal?: AbortSignal): Promise getPack(args: GetPackArgs, headers?: object, signal?: AbortSignal): Promise getPackIds(args: GetPackIdsArgs, headers?: object, signal?: AbortSignal): Promise deletePack(args: DeletePackArgs, headers?: object, signal?: AbortSignal): Promise - updatePackContent(args: UpdatePackContentArgs, headers?: object, signal?: AbortSignal): Promise + updatePackContent( + args: UpdatePackContentArgs, + headers?: object, + signal?: AbortSignal, + ): Promise getRevealTxData(args: GetRevealTxDataArgs, headers?: object, signal?: AbortSignal): Promise - checkoutOptionsPrimary(args: CheckoutOptionsPrimaryArgs, headers?: object, signal?: AbortSignal): Promise - checkoutOptionsSecondary(args: CheckoutOptionsSecondaryArgs, headers?: object, signal?: AbortSignal): Promise - checkoutOptionsGetTransakContractID(args: CheckoutOptionsGetTransakContractIDArgs, headers?: object, signal?: AbortSignal): Promise - fortePayCreateIntent(args: FortePayCreateIntentArgs, headers?: object, signal?: AbortSignal): Promise - fortePayGetPaymentStatuses(args: FortePayGetPaymentStatusesArgs, headers?: object, signal?: AbortSignal): Promise + checkoutOptionsPrimary( + args: CheckoutOptionsPrimaryArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + checkoutOptionsSecondary( + args: CheckoutOptionsSecondaryArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + checkoutOptionsGetTransakContractID( + args: CheckoutOptionsGetTransakContractIDArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + fortePayCreateIntent( + args: FortePayCreateIntentArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + fortePayGetPaymentStatuses( + args: FortePayGetPaymentStatusesArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** - * + * * CCTP - * + * */ getCCTPTransfer(args: GetCCTPTransferArgs, headers?: object, signal?: AbortSignal): Promise - queueCCTPTransfer(args: QueueCCTPTransferArgs, headers?: object, signal?: AbortSignal): Promise + queueCCTPTransfer( + args: QueueCCTPTransferArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** - * + * * Intent Machine Worker - * + * */ - queueIntentConfigExecution(args: QueueIntentConfigExecutionArgs, headers?: object, signal?: AbortSignal): Promise - getIntentConfigExecutionStatus(args: GetIntentConfigExecutionStatusArgs, headers?: object, signal?: AbortSignal): Promise - listIntentConfigs(args: ListIntentConfigsArgs, headers?: object, signal?: AbortSignal): Promise - queueMetaTxnReceipt(args: QueueMetaTxnReceiptArgs, headers?: object, signal?: AbortSignal): Promise -} - -export interface PingArgs { -} + queueIntentConfigExecution( + args: QueueIntentConfigExecutionArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + getIntentConfigExecutionStatus( + args: GetIntentConfigExecutionStatusArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + listIntentConfigs( + args: ListIntentConfigsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + queueMetaTxnReceipt( + args: QueueMetaTxnReceiptArgs, + headers?: object, + signal?: AbortSignal, + ): Promise +} + +export interface PingArgs {} export interface PingReturn { - status: boolean -} -export interface VersionArgs { + status: boolean } +export interface VersionArgs {} export interface VersionReturn { - version: Version -} -export interface RuntimeStatusArgs { + version: Version } +export interface RuntimeStatusArgs {} export interface RuntimeStatusReturn { - status: RuntimeStatus -} -export interface ClockArgs { + status: RuntimeStatus } +export interface ClockArgs {} export interface ClockReturn { - serverTime: string -} -export interface GetSequenceContextArgs { + serverTime: string } +export interface GetSequenceContextArgs {} export interface GetSequenceContextReturn { - data: SequenceContext + data: SequenceContext } export interface GetAuthTokenArgs { ewtString: string @@ -1224,7 +1415,7 @@ export interface GetAuthTokenReturn { status: boolean jwtToken: string address: string - user?: User + user?: User } export interface GetAuthToken2Args { ewtString: string @@ -1235,7 +1426,7 @@ export interface GetAuthToken2Return { status: boolean jwtToken: string address: string - user?: User + user?: User } export interface SendPasswordlessLinkArgs { email: string @@ -1244,21 +1435,21 @@ export interface SendPasswordlessLinkArgs { } export interface SendPasswordlessLinkReturn { - status: boolean + status: boolean } export interface RegisterPublicKeyArgs { publicKey: PublicKey } export interface RegisterPublicKeyReturn { - status: boolean + status: boolean } export interface GetPublicKeyArgs { id: string } export interface GetPublicKeyReturn { - publicKey: PublicKey + publicKey: PublicKey } export interface FriendListArgs { nickname?: string @@ -1267,7 +1458,7 @@ export interface FriendListArgs { export interface FriendListReturn { page: Page - friends: Array + friends: Array } export interface GetFriendByAddressArgs { friendAddress: string @@ -1275,7 +1466,7 @@ export interface GetFriendByAddressArgs { export interface GetFriendByAddressReturn { status: boolean - friend: Friend + friend: Friend } export interface SearchFriendsArgs { filterUsername: string @@ -1283,7 +1474,7 @@ export interface SearchFriendsArgs { } export interface SearchFriendsReturn { - friends: Array + friends: Array } export interface AddFriendArgs { friendAddress: string @@ -1292,7 +1483,7 @@ export interface AddFriendArgs { export interface AddFriendReturn { status: boolean - friend?: Friend + friend?: Friend } export interface UpdateFriendNicknameArgs { friendAddress: string @@ -1301,14 +1492,14 @@ export interface UpdateFriendNicknameArgs { export interface UpdateFriendNicknameReturn { status: boolean - friend?: Friend + friend?: Friend } export interface RemoveFriendArgs { friendAddress: string } export interface RemoveFriendReturn { - status: boolean + status: boolean } export interface ContractCallArgs { chainID: string @@ -1319,28 +1510,28 @@ export interface ContractCallArgs { } export interface ContractCallReturn { - returns: Array + returns: Array } export interface DecodeContractCallArgs { callData: string } export interface DecodeContractCallReturn { - call: ContractCall + call: ContractCall } export interface LookupContractCallSelectorsArgs { selectors: Array } export interface LookupContractCallSelectorsReturn { - signatures: Array> + signatures: Array> } export interface UserStorageFetchArgs { key: string } export interface UserStorageFetchReturn { - object: any + object: any } export interface UserStorageSaveArgs { key: string @@ -1348,28 +1539,28 @@ export interface UserStorageSaveArgs { } export interface UserStorageSaveReturn { - ok: boolean + ok: boolean } export interface UserStorageDeleteArgs { key: string } export interface UserStorageDeleteReturn { - ok: boolean + ok: boolean } export interface UserStorageFetchAllArgs { keys?: Array } export interface UserStorageFetchAllReturn { - objects: {[key: string]: any} + objects: { [key: string]: any } } export interface GetMoonpayLinkArgs { url: string } export interface GetMoonpayLinkReturn { - signedUrl: string + signedUrl: string } export interface ResolveENSAddressArgs { ens: string @@ -1377,7 +1568,7 @@ export interface ResolveENSAddressArgs { export interface ResolveENSAddressReturn { address: string - ok: boolean + ok: boolean } export interface IsValidSignatureArgs { chainId: string @@ -1387,7 +1578,7 @@ export interface IsValidSignatureArgs { } export interface IsValidSignatureReturn { - isValid: boolean + isValid: boolean } export interface IsValidMessageSignatureArgs { chainId: string @@ -1397,7 +1588,7 @@ export interface IsValidMessageSignatureArgs { } export interface IsValidMessageSignatureReturn { - isValid: boolean + isValid: boolean } export interface IsValidTypedDataSignatureArgs { chainId: string @@ -1407,7 +1598,7 @@ export interface IsValidTypedDataSignatureArgs { } export interface IsValidTypedDataSignatureReturn { - isValid: boolean + isValid: boolean } export interface IsValidETHAuthProofArgs { chainId: string @@ -1416,52 +1607,48 @@ export interface IsValidETHAuthProofArgs { } export interface IsValidETHAuthProofReturn { - isValid: boolean + isValid: boolean } export interface GetOnRampURLArgs { chainId: string } export interface GetOnRampURLReturn { - url: string -} -export interface SardineGetClientTokenArgs { + url: string } +export interface SardineGetClientTokenArgs {} export interface SardineGetClientTokenReturn { - token: string + token: string } export interface SardineGetNFTCheckoutTokenArgs { params: SardineNFTCheckoutParams } export interface SardineGetNFTCheckoutTokenReturn { - resp: SardineNFTCheckout + resp: SardineNFTCheckout } export interface SardineGetNFTCheckoutOrderStatusArgs { orderId: string } export interface SardineGetNFTCheckoutOrderStatusReturn { - resp: SardineOrder -} -export interface SardineGetSupportedRegionsArgs { + resp: SardineOrder } +export interface SardineGetSupportedRegionsArgs {} export interface SardineGetSupportedRegionsReturn { - regions: Array -} -export interface SardineGetSupportedFiatCurrenciesArgs { + regions: Array } +export interface SardineGetSupportedFiatCurrenciesArgs {} export interface SardineGetSupportedFiatCurrenciesReturn { - tokens: Array -} -export interface SardineGetSupportedTokensArgs { + tokens: Array } +export interface SardineGetSupportedTokensArgs {} export interface SardineGetSupportedTokensReturn { - tokens: Array + tokens: Array } export interface SardineGetSupportedTokenForSwapArgs { network: string @@ -1469,92 +1656,86 @@ export interface SardineGetSupportedTokenForSwapArgs { } export interface SardineGetSupportedTokenForSwapReturn { - token: SardineSupportedTokenForSwap -} -export interface SardineGetEnabledTokensArgs { + token: SardineSupportedTokenForSwap } +export interface SardineGetEnabledTokensArgs {} export interface SardineGetEnabledTokensReturn { - tokens: Array + tokens: Array } export interface SardineGetQuoteArgs { params: SardineGetQuoteParams } export interface SardineGetQuoteReturn { - quote: SardineQuote -} -export interface GetSardineClientTokenArgs { + quote: SardineQuote } +export interface GetSardineClientTokenArgs {} export interface GetSardineClientTokenReturn { - token: string + token: string } export interface GetSardineNFTCheckoutTokenArgs { params: SardineNFTCheckoutParams } export interface GetSardineNFTCheckoutTokenReturn { - resp: SardineNFTCheckout + resp: SardineNFTCheckout } export interface GetSardineNFTCheckoutOrderStatusArgs { orderId: string } export interface GetSardineNFTCheckoutOrderStatusReturn { - resp: SardineOrder -} -export interface TransakGetCountriesArgs { + resp: SardineOrder } +export interface TransakGetCountriesArgs {} export interface TransakGetCountriesReturn { - regions: Array -} -export interface TransakGetCryptoCurrenciesArgs { + regions: Array } +export interface TransakGetCryptoCurrenciesArgs {} export interface TransakGetCryptoCurrenciesReturn { - currencies: Array -} -export interface TransakGetFiatCurrenciesArgs { + currencies: Array } +export interface TransakGetFiatCurrenciesArgs {} export interface TransakGetFiatCurrenciesReturn { - currencies: Array + currencies: Array } export interface TransakGetPriceArgs { params: TransakGetPriceParams } export interface TransakGetPriceReturn { - price: TransakPrice -} -export interface TransakGetSupportedNFTCheckoutChainsArgs { + price: TransakPrice } +export interface TransakGetSupportedNFTCheckoutChainsArgs {} export interface TransakGetSupportedNFTCheckoutChainsReturn { - chains: Array + chains: Array } export interface GetCoinPricesArgs { tokens: Array } export interface GetCoinPricesReturn { - tokenPrices: Array + tokenPrices: Array } export interface GetCollectiblePricesArgs { tokens: Array } export interface GetCollectiblePricesReturn { - tokenPrices: Array + tokenPrices: Array } export interface GetExchangeRateArgs { toCurrency: string } export interface GetExchangeRateReturn { - exchangeRate: ExchangeRate + exchangeRate: ExchangeRate } export interface MemoryStoreArgs { key: string @@ -1562,27 +1743,26 @@ export interface MemoryStoreArgs { } export interface MemoryStoreReturn { - ok: boolean + ok: boolean } export interface MemoryLoadArgs { key: string } export interface MemoryLoadReturn { - value: string -} -export interface GetInviteInfoArgs { + value: string } +export interface GetInviteInfoArgs {} export interface GetInviteInfoReturn { - inviteInfo: InviteInfo + inviteInfo: InviteInfo } export interface IsValidAccessCodeArgs { accessCode: string } export interface IsValidAccessCodeReturn { - status: boolean + status: boolean } export interface InternalClaimAccessCodeArgs { address: string @@ -1590,7 +1770,7 @@ export interface InternalClaimAccessCodeArgs { } export interface InternalClaimAccessCodeReturn { - status: boolean + status: boolean } export interface BlockNumberAtTimeArgs { chainId: number @@ -1598,7 +1778,7 @@ export interface BlockNumberAtTimeArgs { } export interface BlockNumberAtTimeReturn { - blocks: Array + blocks: Array } export interface PaperSessionSecretArgs { chainName: string @@ -1608,7 +1788,7 @@ export interface PaperSessionSecretArgs { } export interface PaperSessionSecretReturn { - secret: string + secret: string } export interface PaperSessionSecret2Args { chainName: string @@ -1618,7 +1798,7 @@ export interface PaperSessionSecret2Args { } export interface PaperSessionSecret2Return { - secret: string + secret: string } export interface LinkWalletArgs { parentWalletAddress: string @@ -1632,7 +1812,7 @@ export interface LinkWalletArgs { } export interface LinkWalletReturn { - status: boolean + status: boolean } export interface GetLinkedWalletsArgs { parentWalletAddress: string @@ -1642,7 +1822,7 @@ export interface GetLinkedWalletsArgs { } export interface GetLinkedWalletsReturn { - linkedWallets: Array + linkedWallets: Array } export interface RemoveLinkedWalletArgs { parentWalletAddress: string @@ -1653,7 +1833,7 @@ export interface RemoveLinkedWalletArgs { } export interface RemoveLinkedWalletReturn { - status: boolean + status: boolean } export interface GenerateWaaSVerificationURLArgs { walletAddress: string @@ -1661,7 +1841,7 @@ export interface GenerateWaaSVerificationURLArgs { export interface GenerateWaaSVerificationURLReturn { nonce: string - verificationURL: string + verificationURL: string } export interface ValidateWaaSVerificationNonceArgs { nonce: string @@ -1671,7 +1851,7 @@ export interface ValidateWaaSVerificationNonceArgs { } export interface ValidateWaaSVerificationNonceReturn { - walletAddress: string + walletAddress: string } export interface ListAdoptedWalletsArgs { page?: Page @@ -1679,20 +1859,19 @@ export interface ListAdoptedWalletsArgs { export interface ListAdoptedWalletsReturn { page: Page - wallets: Array -} -export interface GetLifiChainsArgs { + wallets: Array } +export interface GetLifiChainsArgs {} export interface GetLifiChainsReturn { - chains: Array + chains: Array } export interface GetLifiTokensArgs { chainIds: Array } export interface GetLifiTokensReturn { - tokens: Array + tokens: Array } export interface GetLifiSwapRoutesArgs { params: GetLifiSwapRouteParams @@ -1703,14 +1882,14 @@ export interface GetLifiSwapRoutesArgs { } export interface GetLifiSwapRoutesReturn { - routes: Array + routes: Array } export interface GetLifiSwapQuoteArgs { params: GetLifiSwapQuoteParams } export interface GetLifiSwapQuoteReturn { - quote: LifiSwapQuote + quote: LifiSwapQuote } export interface GetIntentCallsPayloadsArgs { userAddress: string @@ -1737,9 +1916,9 @@ export interface GetIntentCallsPayloadsReturn { metaTxns: Array trailsFee: TrailsFee quote: IntentQuote - feeQuotes: {[key: string]: string} + feeQuotes: { [key: string]: string } originIntentAddress: string - destinationIntentAddress: string + destinationIntentAddress: string } export interface CommitIntentConfigArgs { originIntentAddress: string @@ -1751,54 +1930,52 @@ export interface CommitIntentConfigArgs { } export interface CommitIntentConfigReturn { - config: IntentConfig + config: IntentConfig } export interface GetIntentConfigArgs { intentAddress: string } export interface GetIntentConfigReturn { - config: IntentConfig -} -export interface ListCurrencyGroupsArgs { + config: IntentConfig } +export interface ListCurrencyGroupsArgs {} export interface ListCurrencyGroupsReturn { - currencyGroups: Array + currencyGroups: Array } export interface AddOffchainInventoryArgs { inventory: OffchainInventory } export interface AddOffchainInventoryReturn { - inventoryId: number + inventoryId: number } export interface GetOffchainInventoryArgs { inventoryId: number } export interface GetOffchainInventoryReturn { - inventory: OffchainInventory + inventory: OffchainInventory } export interface ListOffchainInventoriesArgs { projectId: number } export interface ListOffchainInventoriesReturn { - inventory: Array + inventory: Array } export interface UpdateOffchainInventoryArgs { inventory: OffchainInventory } -export interface UpdateOffchainInventoryReturn { -} +export interface UpdateOffchainInventoryReturn {} export interface DeleteOffchainInventoryArgs { inventoryId: number } export interface DeleteOffchainInventoryReturn { - ok: boolean + ok: boolean } export interface RequestOffchainPaymentArgs { inventoryId: number @@ -1808,7 +1985,7 @@ export interface RequestOffchainPaymentArgs { } export interface RequestOffchainPaymentReturn { - payment: PaymentResponse + payment: PaymentResponse } export interface ListOffchainPaymentsArgs { inventoryId: number @@ -1817,14 +1994,14 @@ export interface ListOffchainPaymentsArgs { export interface ListOffchainPaymentsReturn { page: Page - payments: Array + payments: Array } export interface SavePackArgs { pack: Pack } export interface SavePackReturn { - merkleRoot: string + merkleRoot: string } export interface GetPackArgs { contractAddress: string @@ -1833,7 +2010,7 @@ export interface GetPackArgs { } export interface GetPackReturn { - pack: Pack + pack: Pack } export interface GetPackIdsArgs { contractAddress: string @@ -1841,7 +2018,7 @@ export interface GetPackIdsArgs { } export interface GetPackIdsReturn { - packIds: Array + packIds: Array } export interface DeletePackArgs { contractAddress: string @@ -1850,14 +2027,14 @@ export interface DeletePackArgs { } export interface DeletePackReturn { - status: boolean + status: boolean } export interface UpdatePackContentArgs { pack: Pack } export interface UpdatePackContentReturn { - merkleRoot: string + merkleRoot: string } export interface GetRevealTxDataArgs { contractAddress: string @@ -1867,7 +2044,7 @@ export interface GetRevealTxDataArgs { } export interface GetRevealTxDataReturn { - txData: string + txData: string } export interface CheckoutOptionsPrimaryArgs { chainId: number @@ -1878,7 +2055,7 @@ export interface CheckoutOptionsPrimaryArgs { } export interface CheckoutOptionsPrimaryReturn { - options: CheckoutOptions + options: CheckoutOptions } export interface CheckoutOptionsSecondaryArgs { chainId: number @@ -1887,7 +2064,7 @@ export interface CheckoutOptionsSecondaryArgs { } export interface CheckoutOptionsSecondaryReturn { - options: CheckoutOptions + options: CheckoutOptions } export interface CheckoutOptionsGetTransakContractIDArgs { chainId: number @@ -1895,28 +2072,28 @@ export interface CheckoutOptionsGetTransakContractIDArgs { } export interface CheckoutOptionsGetTransakContractIDReturn { - contractId: string + contractId: string } export interface FortePayCreateIntentArgs { intent: FortePayCreateIntent } export interface FortePayCreateIntentReturn { - resp: FortePayIntent + resp: FortePayIntent } export interface FortePayGetPaymentStatusesArgs { paymentIntentIds: Array } export interface FortePayGetPaymentStatusesReturn { - statuses: Array + statuses: Array } export interface GetCCTPTransferArgs { id: string } export interface GetCCTPTransferReturn { - transfer: CCTPTransfer + transfer: CCTPTransfer } export interface QueueCCTPTransferArgs { sourceTxHash?: string @@ -1926,21 +2103,21 @@ export interface QueueCCTPTransferArgs { } export interface QueueCCTPTransferReturn { - transfer: CCTPTransfer + transfer: CCTPTransfer } export interface QueueIntentConfigExecutionArgs { intentConfigId: number } export interface QueueIntentConfigExecutionReturn { - status: boolean + status: boolean } export interface GetIntentConfigExecutionStatusArgs { intentConfigId: number } export interface GetIntentConfigExecutionStatusReturn { - executionStatus: string + executionStatus: string } export interface ListIntentConfigsArgs { page?: Page @@ -1949,18 +2126,16 @@ export interface ListIntentConfigsArgs { export interface ListIntentConfigsReturn { page: Page - intentConfigs: Array + intentConfigs: Array } export interface QueueMetaTxnReceiptArgs { metaTxID: string } export interface QueueMetaTxnReceiptReturn { - status: boolean + status: boolean } - - // // Client // @@ -1977,1420 +2152,1743 @@ export class API implements API { private url(name: string): string { return this.hostname + this.path + name } - + ping = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('Ping'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('Ping'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + version = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('Version'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - version: (_data.version), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('Version'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + version: _data.version, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + runtimeStatus = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('RuntimeStatus'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('RuntimeStatus'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + clock = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('Clock'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - serverTime: (_data.serverTime), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('Clock'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + serverTime: _data.serverTime, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getSequenceContext = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetSequenceContext'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - data: (_data.data), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetSequenceContext'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + data: _data.data, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getAuthToken = (args: GetAuthTokenArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetAuthToken'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - jwtToken: (_data.jwtToken), - address: (_data.address), - user: (_data.user), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetAuthToken'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + jwtToken: _data.jwtToken, + address: _data.address, + user: _data.user, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getAuthToken2 = (args: GetAuthToken2Args, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetAuthToken2'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - jwtToken: (_data.jwtToken), - address: (_data.address), - user: (_data.user), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - sendPasswordlessLink = (args: SendPasswordlessLinkArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SendPasswordlessLink'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - registerPublicKey = (args: RegisterPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('RegisterPublicKey'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetAuthToken2'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + jwtToken: _data.jwtToken, + address: _data.address, + user: _data.user, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + sendPasswordlessLink = ( + args: SendPasswordlessLinkArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('SendPasswordlessLink'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + registerPublicKey = ( + args: RegisterPublicKeyArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('RegisterPublicKey'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getPublicKey = (args: GetPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetPublicKey'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - publicKey: (_data.publicKey), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetPublicKey'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + publicKey: _data.publicKey, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + friendList = (args: FriendListArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('FriendList'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - page: (_data.page), - friends: >(_data.friends), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getFriendByAddress = (args: GetFriendByAddressArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetFriendByAddress'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - friend: (_data.friend), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('FriendList'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + page: _data.page, + friends: >_data.friends, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getFriendByAddress = ( + args: GetFriendByAddressArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetFriendByAddress'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + friend: _data.friend, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + searchFriends = (args: SearchFriendsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SearchFriends'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - friends: >(_data.friends), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('SearchFriends'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + friends: >_data.friends, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + addFriend = (args: AddFriendArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('AddFriend'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - friend: (_data.friend), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - updateFriendNickname = (args: UpdateFriendNicknameArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('UpdateFriendNickname'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - friend: (_data.friend), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('AddFriend'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + friend: _data.friend, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + updateFriendNickname = ( + args: UpdateFriendNicknameArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('UpdateFriendNickname'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + friend: _data.friend, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + removeFriend = (args: RemoveFriendArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('RemoveFriend'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('RemoveFriend'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + contractCall = (args: ContractCallArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('ContractCall'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - returns: >(_data.returns), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - decodeContractCall = (args: DecodeContractCallArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('DecodeContractCall'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - call: (_data.call), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - lookupContractCallSelectors = (args: LookupContractCallSelectorsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('LookupContractCallSelectors'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - signatures: >>(_data.signatures), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - userStorageFetch = (args: UserStorageFetchArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('UserStorageFetch'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - object: (_data.object), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - userStorageSave = (args: UserStorageSaveArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('UserStorageSave'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - ok: (_data.ok), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - userStorageDelete = (args: UserStorageDeleteArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('UserStorageDelete'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - ok: (_data.ok), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - userStorageFetchAll = (args: UserStorageFetchAllArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('UserStorageFetchAll'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - objects: <{[key: string]: any}>(_data.objects), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getMoonpayLink = (args: GetMoonpayLinkArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetMoonpayLink'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - signedUrl: (_data.signedUrl), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - resolveENSAddress = (args: ResolveENSAddressArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('ResolveENSAddress'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - address: (_data.address), - ok: (_data.ok), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - isValidSignature = (args: IsValidSignatureArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('IsValidSignature'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - isValid: (_data.isValid), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - isValidMessageSignature = (args: IsValidMessageSignatureArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('IsValidMessageSignature'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - isValid: (_data.isValid), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - isValidTypedDataSignature = (args: IsValidTypedDataSignatureArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('IsValidTypedDataSignature'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - isValid: (_data.isValid), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - isValidETHAuthProof = (args: IsValidETHAuthProofArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('IsValidETHAuthProof'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - isValid: (_data.isValid), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('ContractCall'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + returns: >_data.returns, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + decodeContractCall = ( + args: DecodeContractCallArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('DecodeContractCall'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + call: _data.call, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + lookupContractCallSelectors = ( + args: LookupContractCallSelectorsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('LookupContractCallSelectors'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + signatures: >>_data.signatures, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + userStorageFetch = ( + args: UserStorageFetchArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('UserStorageFetch'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + object: _data.object, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + userStorageSave = ( + args: UserStorageSaveArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('UserStorageSave'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + ok: _data.ok, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + userStorageDelete = ( + args: UserStorageDeleteArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('UserStorageDelete'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + ok: _data.ok, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + userStorageFetchAll = ( + args: UserStorageFetchAllArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('UserStorageFetchAll'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + objects: <{ [key: string]: any }>_data.objects, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getMoonpayLink = ( + args: GetMoonpayLinkArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetMoonpayLink'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + signedUrl: _data.signedUrl, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + resolveENSAddress = ( + args: ResolveENSAddressArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('ResolveENSAddress'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + address: _data.address, + ok: _data.ok, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + isValidSignature = ( + args: IsValidSignatureArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('IsValidSignature'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + isValid: _data.isValid, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + isValidMessageSignature = ( + args: IsValidMessageSignatureArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('IsValidMessageSignature'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + isValid: _data.isValid, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + isValidTypedDataSignature = ( + args: IsValidTypedDataSignatureArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('IsValidTypedDataSignature'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + isValid: _data.isValid, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + isValidETHAuthProof = ( + args: IsValidETHAuthProofArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('IsValidETHAuthProof'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + isValid: _data.isValid, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getOnRampURL = (args: GetOnRampURLArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetOnRampURL'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - url: (_data.url), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetOnRampURL'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + url: _data.url, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + sardineGetClientToken = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SardineGetClientToken'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - token: (_data.token), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - sardineGetNFTCheckoutToken = (args: SardineGetNFTCheckoutTokenArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SardineGetNFTCheckoutToken'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - resp: (_data.resp), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - sardineGetNFTCheckoutOrderStatus = (args: SardineGetNFTCheckoutOrderStatusArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SardineGetNFTCheckoutOrderStatus'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - resp: (_data.resp), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('SardineGetClientToken'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + token: _data.token, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + sardineGetNFTCheckoutToken = ( + args: SardineGetNFTCheckoutTokenArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('SardineGetNFTCheckoutToken'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + resp: _data.resp, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + sardineGetNFTCheckoutOrderStatus = ( + args: SardineGetNFTCheckoutOrderStatusArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('SardineGetNFTCheckoutOrderStatus'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + resp: _data.resp, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + sardineGetSupportedRegions = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SardineGetSupportedRegions'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - regions: >(_data.regions), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - sardineGetSupportedFiatCurrencies = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SardineGetSupportedFiatCurrencies'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - tokens: >(_data.tokens), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('SardineGetSupportedRegions'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + regions: >_data.regions, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + sardineGetSupportedFiatCurrencies = ( + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('SardineGetSupportedFiatCurrencies'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + tokens: >_data.tokens, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + sardineGetSupportedTokens = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SardineGetSupportedTokens'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - tokens: >(_data.tokens), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - sardineGetSupportedTokenForSwap = (args: SardineGetSupportedTokenForSwapArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SardineGetSupportedTokenForSwap'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - token: (_data.token), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('SardineGetSupportedTokens'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + tokens: >_data.tokens, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + sardineGetSupportedTokenForSwap = ( + args: SardineGetSupportedTokenForSwapArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('SardineGetSupportedTokenForSwap'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + token: _data.token, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + sardineGetEnabledTokens = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SardineGetEnabledTokens'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - tokens: >(_data.tokens), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - sardineGetQuote = (args: SardineGetQuoteArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SardineGetQuote'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - quote: (_data.quote), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('SardineGetEnabledTokens'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + tokens: >_data.tokens, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + sardineGetQuote = ( + args: SardineGetQuoteArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('SardineGetQuote'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + quote: _data.quote, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getSardineClientToken = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetSardineClientToken'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - token: (_data.token), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getSardineNFTCheckoutToken = (args: GetSardineNFTCheckoutTokenArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetSardineNFTCheckoutToken'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - resp: (_data.resp), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getSardineNFTCheckoutOrderStatus = (args: GetSardineNFTCheckoutOrderStatusArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetSardineNFTCheckoutOrderStatus'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - resp: (_data.resp), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetSardineClientToken'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + token: _data.token, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getSardineNFTCheckoutToken = ( + args: GetSardineNFTCheckoutTokenArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetSardineNFTCheckoutToken'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + resp: _data.resp, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getSardineNFTCheckoutOrderStatus = ( + args: GetSardineNFTCheckoutOrderStatusArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetSardineNFTCheckoutOrderStatus'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + resp: _data.resp, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + transakGetCountries = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('TransakGetCountries'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - regions: >(_data.regions), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('TransakGetCountries'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + regions: >_data.regions, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + transakGetCryptoCurrencies = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('TransakGetCryptoCurrencies'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - currencies: >(_data.currencies), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('TransakGetCryptoCurrencies'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + currencies: >_data.currencies, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + transakGetFiatCurrencies = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('TransakGetFiatCurrencies'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - currencies: >(_data.currencies), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - transakGetPrice = (args: TransakGetPriceArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('TransakGetPrice'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - price: (_data.price), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - transakGetSupportedNFTCheckoutChains = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('TransakGetSupportedNFTCheckoutChains'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - chains: >(_data.chains), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('TransakGetFiatCurrencies'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + currencies: >_data.currencies, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + transakGetPrice = ( + args: TransakGetPriceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('TransakGetPrice'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + price: _data.price, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + transakGetSupportedNFTCheckoutChains = ( + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('TransakGetSupportedNFTCheckoutChains'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + chains: >_data.chains, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getCoinPrices = (args: GetCoinPricesArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetCoinPrices'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - tokenPrices: >(_data.tokenPrices), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getCollectiblePrices = (args: GetCollectiblePricesArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetCollectiblePrices'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - tokenPrices: >(_data.tokenPrices), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getExchangeRate = (args: GetExchangeRateArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetExchangeRate'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - exchangeRate: (_data.exchangeRate), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetCoinPrices'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + tokenPrices: >_data.tokenPrices, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getCollectiblePrices = ( + args: GetCollectiblePricesArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetCollectiblePrices'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + tokenPrices: >_data.tokenPrices, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getExchangeRate = ( + args: GetExchangeRateArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetExchangeRate'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + exchangeRate: _data.exchangeRate, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + memoryStore = (args: MemoryStoreArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('MemoryStore'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - ok: (_data.ok), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('MemoryStore'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + ok: _data.ok, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + memoryLoad = (args: MemoryLoadArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('MemoryLoad'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - value: (_data.value), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('MemoryLoad'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + value: _data.value, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getInviteInfo = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetInviteInfo'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - inviteInfo: (_data.inviteInfo), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - isValidAccessCode = (args: IsValidAccessCodeArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('IsValidAccessCode'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - internalClaimAccessCode = (args: InternalClaimAccessCodeArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('InternalClaimAccessCode'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - blockNumberAtTime = (args: BlockNumberAtTimeArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('BlockNumberAtTime'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - blocks: >(_data.blocks), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - paperSessionSecret = (args: PaperSessionSecretArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('PaperSessionSecret'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - secret: (_data.secret), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - paperSessionSecret2 = (args: PaperSessionSecret2Args, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('PaperSessionSecret2'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - secret: (_data.secret), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetInviteInfo'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + inviteInfo: _data.inviteInfo, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + isValidAccessCode = ( + args: IsValidAccessCodeArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('IsValidAccessCode'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + internalClaimAccessCode = ( + args: InternalClaimAccessCodeArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('InternalClaimAccessCode'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + blockNumberAtTime = ( + args: BlockNumberAtTimeArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('BlockNumberAtTime'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + blocks: >_data.blocks, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + paperSessionSecret = ( + args: PaperSessionSecretArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('PaperSessionSecret'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + secret: _data.secret, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + paperSessionSecret2 = ( + args: PaperSessionSecret2Args, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('PaperSessionSecret2'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + secret: _data.secret, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + linkWallet = (args: LinkWalletArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('LinkWallet'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getLinkedWallets = (args: GetLinkedWalletsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetLinkedWallets'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - linkedWallets: >(_data.linkedWallets), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - removeLinkedWallet = (args: RemoveLinkedWalletArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('RemoveLinkedWallet'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - generateWaaSVerificationURL = (args: GenerateWaaSVerificationURLArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GenerateWaaSVerificationURL'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - nonce: (_data.nonce), - verificationURL: (_data.verificationURL), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - validateWaaSVerificationNonce = (args: ValidateWaaSVerificationNonceArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('ValidateWaaSVerificationNonce'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - walletAddress: (_data.walletAddress), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - listAdoptedWallets = (args: ListAdoptedWalletsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('ListAdoptedWallets'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - page: (_data.page), - wallets: >(_data.wallets), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('LinkWallet'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getLinkedWallets = ( + args: GetLinkedWalletsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetLinkedWallets'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + linkedWallets: >_data.linkedWallets, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + removeLinkedWallet = ( + args: RemoveLinkedWalletArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('RemoveLinkedWallet'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + generateWaaSVerificationURL = ( + args: GenerateWaaSVerificationURLArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GenerateWaaSVerificationURL'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + nonce: _data.nonce, + verificationURL: _data.verificationURL, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + validateWaaSVerificationNonce = ( + args: ValidateWaaSVerificationNonceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('ValidateWaaSVerificationNonce'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + walletAddress: _data.walletAddress, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + listAdoptedWallets = ( + args: ListAdoptedWalletsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('ListAdoptedWallets'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + page: _data.page, + wallets: >_data.wallets, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getLifiChains = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetLifiChains'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - chains: >(_data.chains), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetLifiChains'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + chains: >_data.chains, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getLifiTokens = (args: GetLifiTokensArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetLifiTokens'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - tokens: >(_data.tokens), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getLifiSwapRoutes = (args: GetLifiSwapRoutesArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetLifiSwapRoutes'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - routes: >(_data.routes), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getLifiSwapQuote = (args: GetLifiSwapQuoteArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetLifiSwapQuote'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - quote: (_data.quote), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getIntentCallsPayloads = (args: GetIntentCallsPayloadsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetIntentCallsPayloads'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - calls: >(_data.calls), - preconditions: >(_data.preconditions), - metaTxns: >(_data.metaTxns), - trailsFee: (_data.trailsFee), - quote: (_data.quote), - feeQuotes: <{[key: string]: string}>(_data.feeQuotes), - originIntentAddress: (_data.originIntentAddress), - destinationIntentAddress: (_data.destinationIntentAddress), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - commitIntentConfig = (args: CommitIntentConfigArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('CommitIntentConfig'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - config: (_data.config), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getIntentConfig = (args: GetIntentConfigArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetIntentConfig'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - config: (_data.config), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetLifiTokens'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + tokens: >_data.tokens, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getLifiSwapRoutes = ( + args: GetLifiSwapRoutesArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetLifiSwapRoutes'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + routes: >_data.routes, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getLifiSwapQuote = ( + args: GetLifiSwapQuoteArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetLifiSwapQuote'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + quote: _data.quote, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getIntentCallsPayloads = ( + args: GetIntentCallsPayloadsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetIntentCallsPayloads'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + calls: >_data.calls, + preconditions: >_data.preconditions, + metaTxns: >_data.metaTxns, + trailsFee: _data.trailsFee, + quote: _data.quote, + feeQuotes: <{ [key: string]: string }>_data.feeQuotes, + originIntentAddress: _data.originIntentAddress, + destinationIntentAddress: _data.destinationIntentAddress, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + commitIntentConfig = ( + args: CommitIntentConfigArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('CommitIntentConfig'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + config: _data.config, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getIntentConfig = ( + args: GetIntentConfigArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetIntentConfig'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + config: _data.config, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + listCurrencyGroups = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('ListCurrencyGroups'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - currencyGroups: >(_data.currencyGroups), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - addOffchainInventory = (args: AddOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('AddOffchainInventory'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - inventoryId: (_data.inventoryId), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getOffchainInventory = (args: GetOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetOffchainInventory'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - inventory: (_data.inventory), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - listOffchainInventories = (args: ListOffchainInventoriesArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('ListOffchainInventories'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - inventory: >(_data.inventory), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - updateOffchainInventory = (args: UpdateOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('UpdateOffchainInventory'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return {} - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - deleteOffchainInventory = (args: DeleteOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('DeleteOffchainInventory'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - ok: (_data.ok), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - requestOffchainPayment = (args: RequestOffchainPaymentArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('RequestOffchainPayment'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - payment: (_data.payment), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - listOffchainPayments = (args: ListOffchainPaymentsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('ListOffchainPayments'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - page: (_data.page), - payments: >(_data.payments), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('ListCurrencyGroups'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + currencyGroups: >_data.currencyGroups, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + addOffchainInventory = ( + args: AddOffchainInventoryArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('AddOffchainInventory'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + inventoryId: _data.inventoryId, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getOffchainInventory = ( + args: GetOffchainInventoryArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetOffchainInventory'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + inventory: _data.inventory, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + listOffchainInventories = ( + args: ListOffchainInventoriesArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('ListOffchainInventories'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + inventory: >_data.inventory, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + updateOffchainInventory = ( + args: UpdateOffchainInventoryArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('UpdateOffchainInventory'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return {} + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + deleteOffchainInventory = ( + args: DeleteOffchainInventoryArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('DeleteOffchainInventory'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + ok: _data.ok, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + requestOffchainPayment = ( + args: RequestOffchainPaymentArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('RequestOffchainPayment'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + payment: _data.payment, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + listOffchainPayments = ( + args: ListOffchainPaymentsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('ListOffchainPayments'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + page: _data.page, + payments: >_data.payments, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + savePack = (args: SavePackArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SavePack'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - merkleRoot: (_data.merkleRoot), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('SavePack'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + merkleRoot: _data.merkleRoot, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getPack = (args: GetPackArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetPack'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - pack: (_data.pack), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetPack'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + pack: _data.pack, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getPackIds = (args: GetPackIdsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetPackIds'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - packIds: >(_data.packIds), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - deletePack = (args: DeletePackArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('DeletePack'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - updatePackContent = (args: UpdatePackContentArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('UpdatePackContent'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - merkleRoot: (_data.merkleRoot), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getRevealTxData = (args: GetRevealTxDataArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetRevealTxData'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - txData: (_data.txData), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - checkoutOptionsPrimary = (args: CheckoutOptionsPrimaryArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('CheckoutOptionsPrimary'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - options: (_data.options), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - checkoutOptionsSecondary = (args: CheckoutOptionsSecondaryArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('CheckoutOptionsSecondary'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - options: (_data.options), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - checkoutOptionsGetTransakContractID = (args: CheckoutOptionsGetTransakContractIDArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('CheckoutOptionsGetTransakContractID'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - contractId: (_data.contractId), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - fortePayCreateIntent = (args: FortePayCreateIntentArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('FortePayCreateIntent'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - resp: (_data.resp), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - fortePayGetPaymentStatuses = (args: FortePayGetPaymentStatusesArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('FortePayGetPaymentStatuses'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - statuses: >(_data.statuses), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getCCTPTransfer = (args: GetCCTPTransferArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetCCTPTransfer'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - transfer: (_data.transfer), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - queueCCTPTransfer = (args: QueueCCTPTransferArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('QueueCCTPTransfer'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - transfer: (_data.transfer), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - queueIntentConfigExecution = (args: QueueIntentConfigExecutionArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('QueueIntentConfigExecution'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getIntentConfigExecutionStatus = (args: GetIntentConfigExecutionStatusArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetIntentConfigExecutionStatus'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - executionStatus: (_data.executionStatus), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - listIntentConfigs = (args: ListIntentConfigsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('ListIntentConfigs'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - page: (_data.page), - intentConfigs: >(_data.intentConfigs), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - queueMetaTxnReceipt = (args: QueueMetaTxnReceiptArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('QueueMetaTxnReceipt'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetPackIds'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + packIds: >_data.packIds, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - -} - const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => { - const reqHeaders: {[key: string]: string} = { ...headers, 'Content-Type': 'application/json' } + deletePack = (args: DeletePackArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch(this.url('DeletePack'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + updatePackContent = ( + args: UpdatePackContentArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('UpdatePackContent'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + merkleRoot: _data.merkleRoot, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getRevealTxData = ( + args: GetRevealTxDataArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetRevealTxData'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + txData: _data.txData, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + checkoutOptionsPrimary = ( + args: CheckoutOptionsPrimaryArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('CheckoutOptionsPrimary'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + options: _data.options, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + checkoutOptionsSecondary = ( + args: CheckoutOptionsSecondaryArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('CheckoutOptionsSecondary'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + options: _data.options, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + checkoutOptionsGetTransakContractID = ( + args: CheckoutOptionsGetTransakContractIDArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('CheckoutOptionsGetTransakContractID'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + contractId: _data.contractId, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + fortePayCreateIntent = ( + args: FortePayCreateIntentArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('FortePayCreateIntent'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + resp: _data.resp, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + fortePayGetPaymentStatuses = ( + args: FortePayGetPaymentStatusesArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('FortePayGetPaymentStatuses'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + statuses: >_data.statuses, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getCCTPTransfer = ( + args: GetCCTPTransferArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetCCTPTransfer'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + transfer: _data.transfer, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + queueCCTPTransfer = ( + args: QueueCCTPTransferArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('QueueCCTPTransfer'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + transfer: _data.transfer, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + queueIntentConfigExecution = ( + args: QueueIntentConfigExecutionArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('QueueIntentConfigExecution'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getIntentConfigExecutionStatus = ( + args: GetIntentConfigExecutionStatusArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetIntentConfigExecutionStatus'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + executionStatus: _data.executionStatus, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + listIntentConfigs = ( + args: ListIntentConfigsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('ListIntentConfigs'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + page: _data.page, + intentConfigs: >_data.intentConfigs, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + queueMetaTxnReceipt = ( + args: QueueMetaTxnReceiptArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('QueueMetaTxnReceipt'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } +} + +const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => { + const reqHeaders: { [key: string]: string } = { ...headers, 'Content-Type': 'application/json' } reqHeaders[WebrpcHeader] = WebrpcHeaderValue return { method: 'POST', headers: reqHeaders, body: JSON.stringify(body || {}), - signal + signal, } } const buildResponse = (res: Response): Promise => { - return res.text().then(text => { + return res.text().then((text) => { let data try { data = JSON.parse(text) - } catch(error) { + } catch (error) { let message = '' - if (error instanceof Error) { + if (error instanceof Error) { message = error.message } throw WebrpcBadResponseError.new({ status: res.status, - cause: `JSON.parse(): ${message}: response text: ${text}`}, - ) + cause: `JSON.parse(): ${message}: response text: ${text}`, + }) } if (!res.ok) { - const code: number = (typeof data.code === 'number') ? data.code : 0 + const code: number = typeof data.code === 'number' ? data.code : 0 throw (webrpcErrorByCode[code] || WebrpcError).new(data) } return data @@ -3435,7 +3933,7 @@ export class WebrpcEndpointError extends WebrpcError { code: number = 0, message: string = `endpoint error`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcEndpointError.prototype) @@ -3448,7 +3946,7 @@ export class WebrpcRequestFailedError extends WebrpcError { code: number = -1, message: string = `request failed`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype) @@ -3461,7 +3959,7 @@ export class WebrpcBadRouteError extends WebrpcError { code: number = -2, message: string = `bad route`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadRouteError.prototype) @@ -3474,7 +3972,7 @@ export class WebrpcBadMethodError extends WebrpcError { code: number = -3, message: string = `bad method`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadMethodError.prototype) @@ -3487,7 +3985,7 @@ export class WebrpcBadRequestError extends WebrpcError { code: number = -4, message: string = `bad request`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadRequestError.prototype) @@ -3500,7 +3998,7 @@ export class WebrpcBadResponseError extends WebrpcError { code: number = -5, message: string = `bad response`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadResponseError.prototype) @@ -3513,7 +4011,7 @@ export class WebrpcServerPanicError extends WebrpcError { code: number = -6, message: string = `server panic`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcServerPanicError.prototype) @@ -3526,7 +4024,7 @@ export class WebrpcInternalErrorError extends WebrpcError { code: number = -7, message: string = `internal error`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype) @@ -3539,7 +4037,7 @@ export class WebrpcClientDisconnectedError extends WebrpcError { code: number = -8, message: string = `client disconnected`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcClientDisconnectedError.prototype) @@ -3552,7 +4050,7 @@ export class WebrpcStreamLostError extends WebrpcError { code: number = -9, message: string = `stream lost`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcStreamLostError.prototype) @@ -3565,14 +4063,13 @@ export class WebrpcStreamFinishedError extends WebrpcError { code: number = -10, message: string = `stream finished`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype) } } - // Schema errors export class UnauthorizedError extends WebrpcError { @@ -3581,7 +4078,7 @@ export class UnauthorizedError extends WebrpcError { code: number = 1000, message: string = `Unauthorized access`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnauthorizedError.prototype) @@ -3594,7 +4091,7 @@ export class PermissionDeniedError extends WebrpcError { code: number = 1001, message: string = `Permission denied`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, PermissionDeniedError.prototype) @@ -3607,7 +4104,7 @@ export class SessionExpiredError extends WebrpcError { code: number = 1002, message: string = `Session expired`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, SessionExpiredError.prototype) @@ -3620,7 +4117,7 @@ export class MethodNotFoundError extends WebrpcError { code: number = 1003, message: string = `Method not found`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, MethodNotFoundError.prototype) @@ -3633,7 +4130,7 @@ export class RequestConflictError extends WebrpcError { code: number = 1004, message: string = `Conflict with target resource`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, RequestConflictError.prototype) @@ -3646,7 +4143,7 @@ export class AbortedError extends WebrpcError { code: number = 1005, message: string = `Request aborted`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AbortedError.prototype) @@ -3659,7 +4156,7 @@ export class GeoblockedError extends WebrpcError { code: number = 1006, message: string = `Geoblocked region`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, GeoblockedError.prototype) @@ -3672,7 +4169,7 @@ export class RateLimitedError extends WebrpcError { code: number = 1007, message: string = `Rate-limited. Please slow down.`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, RateLimitedError.prototype) @@ -3685,7 +4182,7 @@ export class ProjectNotFoundError extends WebrpcError { code: number = 1008, message: string = `Project not found`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, ProjectNotFoundError.prototype) @@ -3698,7 +4195,7 @@ export class AccessKeyNotFoundError extends WebrpcError { code: number = 1101, message: string = `Access key not found`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AccessKeyNotFoundError.prototype) @@ -3711,7 +4208,7 @@ export class AccessKeyMismatchError extends WebrpcError { code: number = 1102, message: string = `Access key mismatch`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AccessKeyMismatchError.prototype) @@ -3724,7 +4221,7 @@ export class InvalidOriginError extends WebrpcError { code: number = 1103, message: string = `Invalid origin for Access Key`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InvalidOriginError.prototype) @@ -3737,7 +4234,7 @@ export class InvalidServiceError extends WebrpcError { code: number = 1104, message: string = `Service not enabled for Access key`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InvalidServiceError.prototype) @@ -3750,7 +4247,7 @@ export class UnauthorizedUserError extends WebrpcError { code: number = 1105, message: string = `Unauthorized user`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnauthorizedUserError.prototype) @@ -3763,7 +4260,7 @@ export class QuotaExceededError extends WebrpcError { code: number = 1200, message: string = `Quota request exceeded`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, QuotaExceededError.prototype) @@ -3776,7 +4273,7 @@ export class QuotaRateLimitError extends WebrpcError { code: number = 1201, message: string = `Quota rate limit exceeded`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, QuotaRateLimitError.prototype) @@ -3789,7 +4286,7 @@ export class NoDefaultKeyError extends WebrpcError { code: number = 1300, message: string = `No default access key found`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, NoDefaultKeyError.prototype) @@ -3802,7 +4299,7 @@ export class MaxAccessKeysError extends WebrpcError { code: number = 1301, message: string = `Access keys limit reached`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, MaxAccessKeysError.prototype) @@ -3815,7 +4312,7 @@ export class AtLeastOneKeyError extends WebrpcError { code: number = 1302, message: string = `You need at least one Access Key`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AtLeastOneKeyError.prototype) @@ -3828,7 +4325,7 @@ export class TimeoutError extends WebrpcError { code: number = 1900, message: string = `Request timed out`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, TimeoutError.prototype) @@ -3841,7 +4338,7 @@ export class InvalidArgumentError extends WebrpcError { code: number = 2000, message: string = `Invalid argument`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InvalidArgumentError.prototype) @@ -3854,7 +4351,7 @@ export class UnavailableError extends WebrpcError { code: number = 2002, message: string = `Unavailable resource`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnavailableError.prototype) @@ -3867,7 +4364,7 @@ export class QueryFailedError extends WebrpcError { code: number = 2003, message: string = `Query failed`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, QueryFailedError.prototype) @@ -3880,7 +4377,7 @@ export class NotFoundError extends WebrpcError { code: number = 3000, message: string = `Resource not found`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, NotFoundError.prototype) @@ -3893,14 +4390,13 @@ export class UnsupportedNetworkError extends WebrpcError { code: number = 3008, message: string = `Unsupported network`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnsupportedNetworkError.prototype) } } - export enum errors { WebrpcEndpoint = 'WebrpcEndpoint', WebrpcRequestFailed = 'WebrpcRequestFailed', @@ -4019,4 +4515,3 @@ export const webrpcErrorByCode: { [code: number]: any } = { } export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise - diff --git a/packages/services/relayer/src/rpc-relayer/relayer.gen.ts b/packages/services/relayer/src/rpc-relayer/relayer.gen.ts index 79ca492968..a9e6b44405 100644 --- a/packages/services/relayer/src/rpc-relayer/relayer.gen.ts +++ b/packages/services/relayer/src/rpc-relayer/relayer.gen.ts @@ -5,72 +5,71 @@ // // webrpc-gen -schema=relayer.ridl -target=typescript -client -out=./clients/relayer.gen.ts -export const WebrpcHeader = "Webrpc" +export const WebrpcHeader = 'Webrpc' -export const WebrpcHeaderValue = "webrpc@v0.26.0;gen-typescript@v0.17.0;sequence-relayer@v0.4.1" +export const WebrpcHeaderValue = 'webrpc@v0.26.0;gen-typescript@v0.17.0;sequence-relayer@v0.4.1' // WebRPC description and code-gen version -export const WebRPCVersion = "v1" +export const WebRPCVersion = 'v1' // Schema version of your RIDL schema -export const WebRPCSchemaVersion = "v0.4.1" +export const WebRPCSchemaVersion = 'v0.4.1' // Schema hash generated from your RIDL schema -export const WebRPCSchemaHash = "62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a" +export const WebRPCSchemaHash = '62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a' type WebrpcGenVersions = { - webrpcGenVersion: string; - codeGenName: string; - codeGenVersion: string; - schemaName: string; - schemaVersion: string; -}; + webrpcGenVersion: string + codeGenName: string + codeGenVersion: string + schemaName: string + schemaVersion: string +} export function VersionFromHeader(headers: Headers): WebrpcGenVersions { - const headerValue = headers.get(WebrpcHeader); + const headerValue = headers.get(WebrpcHeader) if (!headerValue) { return { - webrpcGenVersion: "", - codeGenName: "", - codeGenVersion: "", - schemaName: "", - schemaVersion: "", - }; + webrpcGenVersion: '', + codeGenName: '', + codeGenVersion: '', + schemaName: '', + schemaVersion: '', + } } - return parseWebrpcGenVersions(headerValue); + return parseWebrpcGenVersions(headerValue) } function parseWebrpcGenVersions(header: string): WebrpcGenVersions { - const versions = header.split(";"); + const versions = header.split(';') if (versions.length < 3) { return { - webrpcGenVersion: "", - codeGenName: "", - codeGenVersion: "", - schemaName: "", - schemaVersion: "", - }; + webrpcGenVersion: '', + codeGenName: '', + codeGenVersion: '', + schemaName: '', + schemaVersion: '', + } } - const [_, webrpcGenVersion] = versions[0]!.split("@"); - const [codeGenName, codeGenVersion] = versions[1]!.split("@"); - const [schemaName, schemaVersion] = versions[2]!.split("@"); + const [_, webrpcGenVersion] = versions[0]!.split('@') + const [codeGenName, codeGenVersion] = versions[1]!.split('@') + const [schemaName, schemaVersion] = versions[2]!.split('@') return { - webrpcGenVersion: webrpcGenVersion ?? "", - codeGenName: codeGenName ?? "", - codeGenVersion: codeGenVersion ?? "", - schemaName: schemaName ?? "", - schemaVersion: schemaVersion ?? "", - }; + webrpcGenVersion: webrpcGenVersion ?? '', + codeGenName: codeGenName ?? '', + codeGenVersion: codeGenVersion ?? '', + schemaName: schemaName ?? '', + schemaVersion: schemaVersion ?? '', + } } // // Types // - export enum ETHTxnStatus { UNKNOWN = 'UNKNOWN', DROPPED = 'DROPPED', @@ -79,7 +78,7 @@ export enum ETHTxnStatus { SUCCEEDED = 'SUCCEEDED', PARTIALLY_FAILED = 'PARTIALLY_FAILED', FAILED = 'FAILED', - PENDING_PRECONDITION = 'PENDING_PRECONDITION' + PENDING_PRECONDITION = 'PENDING_PRECONDITION', } export enum TransferType { @@ -88,7 +87,7 @@ export enum TransferType { BRIDGE_DEPOSIT = 'BRIDGE_DEPOSIT', BRIDGE_WITHDRAW = 'BRIDGE_WITHDRAW', BURN = 'BURN', - UNKNOWN = 'UNKNOWN' + UNKNOWN = 'UNKNOWN', } export enum SimulateStatus { @@ -97,18 +96,18 @@ export enum SimulateStatus { FAILED = 'FAILED', ABORTED = 'ABORTED', REVERTED = 'REVERTED', - NOT_ENOUGH_GAS = 'NOT_ENOUGH_GAS' + NOT_ENOUGH_GAS = 'NOT_ENOUGH_GAS', } export enum FeeTokenType { UNKNOWN = 'UNKNOWN', ERC20_TOKEN = 'ERC20_TOKEN', - ERC1155_TOKEN = 'ERC1155_TOKEN' + ERC1155_TOKEN = 'ERC1155_TOKEN', } export enum SortOrder { DESC = 'DESC', - ASC = 'ASC' + ASC = 'ASC', } export interface Version { @@ -138,8 +137,7 @@ export interface SenderStatus { active: boolean } -export interface RuntimeChecks { -} +export interface RuntimeChecks {} export interface SequenceContext { factory: string @@ -215,8 +213,8 @@ export interface MetaTxnLog { minedAt: string target: string input: string - txnArgs: {[key: string]: any} - txnReceipt?: {[key: string]: any} + txnArgs: { [key: string]: any } + txnReceipt?: { [key: string]: any } walletAddress: string metaTxnNonce: string gasLimit: number @@ -353,9 +351,9 @@ export interface Relayer { getSequenceContext(headers?: object, signal?: AbortSignal): Promise getChainID(headers?: object, signal?: AbortSignal): Promise /** - * + * * Transactions - * + * * TODO (future): rename this to just, 'SendTransaction(txn: MetaTransaction)' or 'SendTransaction(txn: SignedTransaction)', or something.. * Project ID is only used by service and admin calls. Other clients must have projectID passed via the context * TODO: rename return txnHash: string to metaTxnID: string @@ -370,21 +368,41 @@ export interface Relayer { * new, GetTransactionReceipt and WaitTransactionReceipt methods * we can also accept metaTxnId and txnHash .. so can take either or.. I wonder if ERC-4337 has any convention on this? */ - getMetaTxnReceipt(args: GetMetaTxnReceiptArgs, headers?: object, signal?: AbortSignal): Promise + getMetaTxnReceipt( + args: GetMetaTxnReceiptArgs, + headers?: object, + signal?: AbortSignal, + ): Promise simulate(args: SimulateArgs, headers?: object, signal?: AbortSignal): Promise simulateV3(args: SimulateV3Args, headers?: object, signal?: AbortSignal): Promise /** * TODO: deprecated, to be removed by https://github.com/0xsequence/stack/pull/356 at a later date */ - updateMetaTxnGasLimits(args: UpdateMetaTxnGasLimitsArgs, headers?: object, signal?: AbortSignal): Promise + updateMetaTxnGasLimits( + args: UpdateMetaTxnGasLimitsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise feeTokens(headers?: object, signal?: AbortSignal): Promise feeOptions(args: FeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise /** * TODO: deprecated, to be removed by https://github.com/0xsequence/stack/pull/356 at a later date */ - getMetaTxnNetworkFeeOptions(args: GetMetaTxnNetworkFeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise - getMetaTransactions(args: GetMetaTransactionsArgs, headers?: object, signal?: AbortSignal): Promise - getTransactionCost(args: GetTransactionCostArgs, headers?: object, signal?: AbortSignal): Promise + getMetaTxnNetworkFeeOptions( + args: GetMetaTxnNetworkFeeOptionsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + getMetaTransactions( + args: GetMetaTransactionsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + getTransactionCost( + args: GetTransactionCostArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** * Sent transactions from an account. If filter is omitted then it will return all transactions. */ @@ -393,7 +411,11 @@ export interface Relayer { * Pending transactions waiting to be mined for an account. This endpoint is just a sugar of `SentTransactions` * with the filter set to pending: true. */ - pendingTransactions(args: PendingTransactionsArgs, headers?: object, signal?: AbortSignal): Promise + pendingTransactions( + args: PendingTransactionsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** * Legacy Gas Tank */ @@ -403,10 +425,26 @@ export interface Relayer { /** * Legacy Gas Adjustment */ - nextGasTankBalanceAdjustmentNonce(args: NextGasTankBalanceAdjustmentNonceArgs, headers?: object, signal?: AbortSignal): Promise - adjustGasTankBalance(args: AdjustGasTankBalanceArgs, headers?: object, signal?: AbortSignal): Promise - getGasTankBalanceAdjustment(args: GetGasTankBalanceAdjustmentArgs, headers?: object, signal?: AbortSignal): Promise - listGasTankBalanceAdjustments(args: ListGasTankBalanceAdjustmentsArgs, headers?: object, signal?: AbortSignal): Promise + nextGasTankBalanceAdjustmentNonce( + args: NextGasTankBalanceAdjustmentNonceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + adjustGasTankBalance( + args: AdjustGasTankBalanceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + getGasTankBalanceAdjustment( + args: GetGasTankBalanceAdjustmentArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + listGasTankBalanceAdjustments( + args: ListGasTankBalanceAdjustmentsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** * Gas Sponsorship */ @@ -418,43 +456,50 @@ export interface Relayer { /** * Gas Sponsor Lookup */ - addressGasSponsors(args: AddressGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise + addressGasSponsors( + args: AddressGasSponsorsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** * Project Balance */ - getProjectBalance(args: GetProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise - adjustProjectBalance(args: AdjustProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise + getProjectBalance( + args: GetProjectBalanceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + adjustProjectBalance( + args: AdjustProjectBalanceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise } -export interface PingArgs { -} +export interface PingArgs {} export interface PingReturn { - status: boolean -} -export interface VersionArgs { + status: boolean } +export interface VersionArgs {} export interface VersionReturn { - version: Version -} -export interface RuntimeStatusArgs { + version: Version } +export interface RuntimeStatusArgs {} export interface RuntimeStatusReturn { - status: RuntimeStatus -} -export interface GetSequenceContextArgs { + status: RuntimeStatus } +export interface GetSequenceContextArgs {} export interface GetSequenceContextReturn { - data: SequenceContext -} -export interface GetChainIDArgs { + data: SequenceContext } +export interface GetChainIDArgs {} export interface GetChainIDReturn { - chainID: number + chainID: number } export interface SendMetaTxnArgs { call: MetaTxn @@ -465,7 +510,7 @@ export interface SendMetaTxnArgs { export interface SendMetaTxnReturn { status: boolean - txnHash: string + txnHash: string } export interface GetMetaTxnNonceArgs { walletContractAddress: string @@ -473,14 +518,14 @@ export interface GetMetaTxnNonceArgs { } export interface GetMetaTxnNonceReturn { - nonce: string + nonce: string } export interface GetMetaTxnReceiptArgs { metaTxID: string } export interface GetMetaTxnReceiptReturn { - receipt: MetaTxnReceipt + receipt: MetaTxnReceipt } export interface SimulateArgs { wallet: string @@ -488,7 +533,7 @@ export interface SimulateArgs { } export interface SimulateReturn { - results: Array + results: Array } export interface SimulateV3Args { wallet: string @@ -496,7 +541,7 @@ export interface SimulateV3Args { } export interface SimulateV3Return { - results: Array + results: Array } export interface UpdateMetaTxnGasLimitsArgs { walletAddress: string @@ -505,14 +550,13 @@ export interface UpdateMetaTxnGasLimitsArgs { } export interface UpdateMetaTxnGasLimitsReturn { - payload: string -} -export interface FeeTokensArgs { + payload: string } +export interface FeeTokensArgs {} export interface FeeTokensReturn { isFeeRequired: boolean - tokens: Array + tokens: Array } export interface FeeOptionsArgs { wallet: string @@ -524,7 +568,7 @@ export interface FeeOptionsArgs { export interface FeeOptionsReturn { options: Array sponsored: boolean - quote?: string + quote?: string } export interface GetMetaTxnNetworkFeeOptionsArgs { walletConfig: any @@ -532,7 +576,7 @@ export interface GetMetaTxnNetworkFeeOptionsArgs { } export interface GetMetaTxnNetworkFeeOptionsReturn { - options: Array + options: Array } export interface GetMetaTransactionsArgs { projectId: number @@ -541,7 +585,7 @@ export interface GetMetaTransactionsArgs { export interface GetMetaTransactionsReturn { page: Page - transactions: Array + transactions: Array } export interface GetTransactionCostArgs { projectId: number @@ -550,7 +594,7 @@ export interface GetTransactionCostArgs { } export interface GetTransactionCostReturn { - cost: number + cost: number } export interface SentTransactionsArgs { filter?: SentTransactionsFilter @@ -559,7 +603,7 @@ export interface SentTransactionsArgs { export interface SentTransactionsReturn { page: Page - transactions: Array + transactions: Array } export interface PendingTransactionsArgs { page?: Page @@ -567,14 +611,14 @@ export interface PendingTransactionsArgs { export interface PendingTransactionsReturn { page: Page - transactions: Array + transactions: Array } export interface GetGasTankArgs { id: number } export interface GetGasTankReturn { - gasTank: GasTank + gasTank: GasTank } export interface AddGasTankArgs { name: string @@ -584,7 +628,7 @@ export interface AddGasTankArgs { export interface AddGasTankReturn { status: boolean - gasTank: GasTank + gasTank: GasTank } export interface UpdateGasTankArgs { id: number @@ -595,14 +639,14 @@ export interface UpdateGasTankArgs { export interface UpdateGasTankReturn { status: boolean - gasTank: GasTank + gasTank: GasTank } export interface NextGasTankBalanceAdjustmentNonceArgs { id: number } export interface NextGasTankBalanceAdjustmentNonceReturn { - nonce: number + nonce: number } export interface AdjustGasTankBalanceArgs { id: number @@ -612,7 +656,7 @@ export interface AdjustGasTankBalanceArgs { export interface AdjustGasTankBalanceReturn { status: boolean - adjustment: GasTankBalanceAdjustment + adjustment: GasTankBalanceAdjustment } export interface GetGasTankBalanceAdjustmentArgs { id: number @@ -620,7 +664,7 @@ export interface GetGasTankBalanceAdjustmentArgs { } export interface GetGasTankBalanceAdjustmentReturn { - adjustment: GasTankBalanceAdjustment + adjustment: GasTankBalanceAdjustment } export interface ListGasTankBalanceAdjustmentsArgs { id: number @@ -629,7 +673,7 @@ export interface ListGasTankBalanceAdjustmentsArgs { export interface ListGasTankBalanceAdjustmentsReturn { page: Page - adjustments: Array + adjustments: Array } export interface ListGasSponsorsArgs { projectId: number @@ -638,7 +682,7 @@ export interface ListGasSponsorsArgs { export interface ListGasSponsorsReturn { page: Page - gasSponsors: Array + gasSponsors: Array } export interface GetGasSponsorArgs { projectId: number @@ -646,7 +690,7 @@ export interface GetGasSponsorArgs { } export interface GetGasSponsorReturn { - gasSponsor: GasSponsor + gasSponsor: GasSponsor } export interface AddGasSponsorArgs { projectId: number @@ -657,7 +701,7 @@ export interface AddGasSponsorArgs { export interface AddGasSponsorReturn { status: boolean - gasSponsor: GasSponsor + gasSponsor: GasSponsor } export interface UpdateGasSponsorArgs { projectId: number @@ -668,7 +712,7 @@ export interface UpdateGasSponsorArgs { export interface UpdateGasSponsorReturn { status: boolean - gasSponsor: GasSponsor + gasSponsor: GasSponsor } export interface RemoveGasSponsorArgs { projectId: number @@ -676,7 +720,7 @@ export interface RemoveGasSponsorArgs { } export interface RemoveGasSponsorReturn { - status: boolean + status: boolean } export interface AddressGasSponsorsArgs { address: string @@ -685,14 +729,14 @@ export interface AddressGasSponsorsArgs { export interface AddressGasSponsorsReturn { page: Page - gasSponsors: Array + gasSponsors: Array } export interface GetProjectBalanceArgs { projectId: number } export interface GetProjectBalanceReturn { - balance: number + balance: number } export interface AdjustProjectBalanceArgs { projectId: number @@ -701,11 +745,9 @@ export interface AdjustProjectBalanceArgs { } export interface AdjustProjectBalanceReturn { - balance: number + balance: number } - - // // Client // @@ -722,521 +764,619 @@ export class Relayer implements Relayer { private url(name: string): string { return this.hostname + this.path + name } - + ping = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('Ping'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('Ping'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + version = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('Version'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - version: (_data.version), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('Version'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + version: _data.version, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + runtimeStatus = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('RuntimeStatus'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('RuntimeStatus'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getSequenceContext = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetSequenceContext'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - data: (_data.data), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetSequenceContext'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + data: _data.data, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getChainID = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetChainID'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - chainID: (_data.chainID), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetChainID'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + chainID: _data.chainID, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + sendMetaTxn = (args: SendMetaTxnArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SendMetaTxn'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - txnHash: (_data.txnHash), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getMetaTxnNonce = (args: GetMetaTxnNonceArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetMetaTxnNonce'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - nonce: (_data.nonce), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getMetaTxnReceipt = (args: GetMetaTxnReceiptArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetMetaTxnReceipt'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - receipt: (_data.receipt), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('SendMetaTxn'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + txnHash: _data.txnHash, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getMetaTxnNonce = ( + args: GetMetaTxnNonceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetMetaTxnNonce'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + nonce: _data.nonce, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getMetaTxnReceipt = ( + args: GetMetaTxnReceiptArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetMetaTxnReceipt'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + receipt: _data.receipt, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + simulate = (args: SimulateArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('Simulate'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - results: >(_data.results), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('Simulate'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + results: >_data.results, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + simulateV3 = (args: SimulateV3Args, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SimulateV3'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - results: >(_data.results), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - updateMetaTxnGasLimits = (args: UpdateMetaTxnGasLimitsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('UpdateMetaTxnGasLimits'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - payload: (_data.payload), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('SimulateV3'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + results: >_data.results, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + updateMetaTxnGasLimits = ( + args: UpdateMetaTxnGasLimitsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('UpdateMetaTxnGasLimits'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + payload: _data.payload, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + feeTokens = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('FeeTokens'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - isFeeRequired: (_data.isFeeRequired), - tokens: >(_data.tokens), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('FeeTokens'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + isFeeRequired: _data.isFeeRequired, + tokens: >_data.tokens, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + feeOptions = (args: FeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('FeeOptions'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - options: >(_data.options), - sponsored: (_data.sponsored), - quote: (_data.quote), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getMetaTxnNetworkFeeOptions = (args: GetMetaTxnNetworkFeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetMetaTxnNetworkFeeOptions'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - options: >(_data.options), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getMetaTransactions = (args: GetMetaTransactionsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetMetaTransactions'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - page: (_data.page), - transactions: >(_data.transactions), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getTransactionCost = (args: GetTransactionCostArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetTransactionCost'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - cost: (_data.cost), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - sentTransactions = (args: SentTransactionsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SentTransactions'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - page: (_data.page), - transactions: >(_data.transactions), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - pendingTransactions = (args: PendingTransactionsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('PendingTransactions'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - page: (_data.page), - transactions: >(_data.transactions), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('FeeOptions'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + options: >_data.options, + sponsored: _data.sponsored, + quote: _data.quote, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getMetaTxnNetworkFeeOptions = ( + args: GetMetaTxnNetworkFeeOptionsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetMetaTxnNetworkFeeOptions'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + options: >_data.options, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getMetaTransactions = ( + args: GetMetaTransactionsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetMetaTransactions'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + page: _data.page, + transactions: >_data.transactions, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getTransactionCost = ( + args: GetTransactionCostArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetTransactionCost'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + cost: _data.cost, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + sentTransactions = ( + args: SentTransactionsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('SentTransactions'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + page: _data.page, + transactions: >_data.transactions, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + pendingTransactions = ( + args: PendingTransactionsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('PendingTransactions'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + page: _data.page, + transactions: >_data.transactions, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getGasTank = (args: GetGasTankArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetGasTank'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - gasTank: (_data.gasTank), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetGasTank'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + gasTank: _data.gasTank, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + addGasTank = (args: AddGasTankArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('AddGasTank'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - gasTank: (_data.gasTank), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('AddGasTank'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + gasTank: _data.gasTank, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + updateGasTank = (args: UpdateGasTankArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('UpdateGasTank'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - gasTank: (_data.gasTank), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - nextGasTankBalanceAdjustmentNonce = (args: NextGasTankBalanceAdjustmentNonceArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('NextGasTankBalanceAdjustmentNonce'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - nonce: (_data.nonce), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - adjustGasTankBalance = (args: AdjustGasTankBalanceArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('AdjustGasTankBalance'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - adjustment: (_data.adjustment), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getGasTankBalanceAdjustment = (args: GetGasTankBalanceAdjustmentArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetGasTankBalanceAdjustment'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - adjustment: (_data.adjustment), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - listGasTankBalanceAdjustments = (args: ListGasTankBalanceAdjustmentsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('ListGasTankBalanceAdjustments'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - page: (_data.page), - adjustments: >(_data.adjustments), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - listGasSponsors = (args: ListGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('ListGasSponsors'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - page: (_data.page), - gasSponsors: >(_data.gasSponsors), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('UpdateGasTank'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + gasTank: _data.gasTank, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + nextGasTankBalanceAdjustmentNonce = ( + args: NextGasTankBalanceAdjustmentNonceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('NextGasTankBalanceAdjustmentNonce'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + nonce: _data.nonce, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + adjustGasTankBalance = ( + args: AdjustGasTankBalanceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('AdjustGasTankBalance'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + adjustment: _data.adjustment, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getGasTankBalanceAdjustment = ( + args: GetGasTankBalanceAdjustmentArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetGasTankBalanceAdjustment'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + adjustment: _data.adjustment, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + listGasTankBalanceAdjustments = ( + args: ListGasTankBalanceAdjustmentsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('ListGasTankBalanceAdjustments'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + page: _data.page, + adjustments: >_data.adjustments, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + listGasSponsors = ( + args: ListGasSponsorsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('ListGasSponsors'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + page: _data.page, + gasSponsors: >_data.gasSponsors, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getGasSponsor = (args: GetGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetGasSponsor'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - gasSponsor: (_data.gasSponsor), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - addGasSponsor = (args: AddGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('AddGasSponsor'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - gasSponsor: (_data.gasSponsor), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - updateGasSponsor = (args: UpdateGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('UpdateGasSponsor'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - gasSponsor: (_data.gasSponsor), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - removeGasSponsor = (args: RemoveGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('RemoveGasSponsor'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - addressGasSponsors = (args: AddressGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('AddressGasSponsors'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - page: (_data.page), - gasSponsors: >(_data.gasSponsors), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getProjectBalance = (args: GetProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetProjectBalance'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - balance: (_data.balance), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - adjustProjectBalance = (args: AdjustProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('AdjustProjectBalance'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - balance: (_data.balance), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetGasSponsor'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + gasSponsor: _data.gasSponsor, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - -} - const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => { - const reqHeaders: {[key: string]: string} = { ...headers, 'Content-Type': 'application/json' } + addGasSponsor = (args: AddGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch(this.url('AddGasSponsor'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + gasSponsor: _data.gasSponsor, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + updateGasSponsor = ( + args: UpdateGasSponsorArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('UpdateGasSponsor'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + gasSponsor: _data.gasSponsor, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + removeGasSponsor = ( + args: RemoveGasSponsorArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('RemoveGasSponsor'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + addressGasSponsors = ( + args: AddressGasSponsorsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('AddressGasSponsors'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + page: _data.page, + gasSponsors: >_data.gasSponsors, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getProjectBalance = ( + args: GetProjectBalanceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetProjectBalance'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + balance: _data.balance, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + adjustProjectBalance = ( + args: AdjustProjectBalanceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('AdjustProjectBalance'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + balance: _data.balance, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } +} + +const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => { + const reqHeaders: { [key: string]: string } = { ...headers, 'Content-Type': 'application/json' } reqHeaders[WebrpcHeader] = WebrpcHeaderValue return { method: 'POST', headers: reqHeaders, body: JSON.stringify(body || {}), - signal + signal, } } const buildResponse = (res: Response): Promise => { - return res.text().then(text => { + return res.text().then((text) => { let data try { data = JSON.parse(text) - } catch(error) { + } catch (error) { let message = '' - if (error instanceof Error) { + if (error instanceof Error) { message = error.message } throw WebrpcBadResponseError.new({ status: res.status, - cause: `JSON.parse(): ${message}: response text: ${text}`}, - ) + cause: `JSON.parse(): ${message}: response text: ${text}`, + }) } if (!res.ok) { - const code: number = (typeof data.code === 'number') ? data.code : 0 + const code: number = typeof data.code === 'number' ? data.code : 0 throw (webrpcErrorByCode[code] || WebrpcError).new(data) } return data @@ -1281,7 +1421,7 @@ export class WebrpcEndpointError extends WebrpcError { code: number = 0, message: string = `endpoint error`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcEndpointError.prototype) @@ -1294,7 +1434,7 @@ export class WebrpcRequestFailedError extends WebrpcError { code: number = -1, message: string = `request failed`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype) @@ -1307,7 +1447,7 @@ export class WebrpcBadRouteError extends WebrpcError { code: number = -2, message: string = `bad route`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadRouteError.prototype) @@ -1320,7 +1460,7 @@ export class WebrpcBadMethodError extends WebrpcError { code: number = -3, message: string = `bad method`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadMethodError.prototype) @@ -1333,7 +1473,7 @@ export class WebrpcBadRequestError extends WebrpcError { code: number = -4, message: string = `bad request`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadRequestError.prototype) @@ -1346,7 +1486,7 @@ export class WebrpcBadResponseError extends WebrpcError { code: number = -5, message: string = `bad response`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadResponseError.prototype) @@ -1359,7 +1499,7 @@ export class WebrpcServerPanicError extends WebrpcError { code: number = -6, message: string = `server panic`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcServerPanicError.prototype) @@ -1372,7 +1512,7 @@ export class WebrpcInternalErrorError extends WebrpcError { code: number = -7, message: string = `internal error`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype) @@ -1385,7 +1525,7 @@ export class WebrpcClientDisconnectedError extends WebrpcError { code: number = -8, message: string = `client disconnected`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcClientDisconnectedError.prototype) @@ -1398,7 +1538,7 @@ export class WebrpcStreamLostError extends WebrpcError { code: number = -9, message: string = `stream lost`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcStreamLostError.prototype) @@ -1411,14 +1551,13 @@ export class WebrpcStreamFinishedError extends WebrpcError { code: number = -10, message: string = `stream finished`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype) } } - // Schema errors export class UnauthorizedError extends WebrpcError { @@ -1427,7 +1566,7 @@ export class UnauthorizedError extends WebrpcError { code: number = 1000, message: string = `Unauthorized access`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnauthorizedError.prototype) @@ -1440,7 +1579,7 @@ export class PermissionDeniedError extends WebrpcError { code: number = 1001, message: string = `Permission denied`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, PermissionDeniedError.prototype) @@ -1453,7 +1592,7 @@ export class SessionExpiredError extends WebrpcError { code: number = 1002, message: string = `Session expired`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, SessionExpiredError.prototype) @@ -1466,7 +1605,7 @@ export class MethodNotFoundError extends WebrpcError { code: number = 1003, message: string = `Method not found`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, MethodNotFoundError.prototype) @@ -1479,7 +1618,7 @@ export class RequestConflictError extends WebrpcError { code: number = 1004, message: string = `Conflict with target resource`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, RequestConflictError.prototype) @@ -1492,7 +1631,7 @@ export class AbortedError extends WebrpcError { code: number = 1005, message: string = `Request aborted`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AbortedError.prototype) @@ -1505,7 +1644,7 @@ export class GeoblockedError extends WebrpcError { code: number = 1006, message: string = `Geoblocked region`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, GeoblockedError.prototype) @@ -1518,7 +1657,7 @@ export class RateLimitedError extends WebrpcError { code: number = 1007, message: string = `Rate-limited. Please slow down.`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, RateLimitedError.prototype) @@ -1531,7 +1670,7 @@ export class ProjectNotFoundError extends WebrpcError { code: number = 1008, message: string = `Project not found`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, ProjectNotFoundError.prototype) @@ -1544,7 +1683,7 @@ export class AccessKeyNotFoundError extends WebrpcError { code: number = 1101, message: string = `Access key not found`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AccessKeyNotFoundError.prototype) @@ -1557,7 +1696,7 @@ export class AccessKeyMismatchError extends WebrpcError { code: number = 1102, message: string = `Access key mismatch`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AccessKeyMismatchError.prototype) @@ -1570,7 +1709,7 @@ export class InvalidOriginError extends WebrpcError { code: number = 1103, message: string = `Invalid origin for Access Key`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InvalidOriginError.prototype) @@ -1583,7 +1722,7 @@ export class InvalidServiceError extends WebrpcError { code: number = 1104, message: string = `Service not enabled for Access key`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InvalidServiceError.prototype) @@ -1596,7 +1735,7 @@ export class UnauthorizedUserError extends WebrpcError { code: number = 1105, message: string = `Unauthorized user`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnauthorizedUserError.prototype) @@ -1609,7 +1748,7 @@ export class QuotaExceededError extends WebrpcError { code: number = 1200, message: string = `Quota request exceeded`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, QuotaExceededError.prototype) @@ -1622,7 +1761,7 @@ export class QuotaRateLimitError extends WebrpcError { code: number = 1201, message: string = `Quota rate limit exceeded`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, QuotaRateLimitError.prototype) @@ -1635,7 +1774,7 @@ export class NoDefaultKeyError extends WebrpcError { code: number = 1300, message: string = `No default access key found`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, NoDefaultKeyError.prototype) @@ -1648,7 +1787,7 @@ export class MaxAccessKeysError extends WebrpcError { code: number = 1301, message: string = `Access keys limit reached`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, MaxAccessKeysError.prototype) @@ -1661,7 +1800,7 @@ export class AtLeastOneKeyError extends WebrpcError { code: number = 1302, message: string = `You need at least one Access Key`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AtLeastOneKeyError.prototype) @@ -1674,7 +1813,7 @@ export class TimeoutError extends WebrpcError { code: number = 1900, message: string = `Request timed out`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, TimeoutError.prototype) @@ -1687,7 +1826,7 @@ export class InvalidArgumentError extends WebrpcError { code: number = 2001, message: string = `Invalid argument`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InvalidArgumentError.prototype) @@ -1700,7 +1839,7 @@ export class UnavailableError extends WebrpcError { code: number = 2002, message: string = `Unavailable resource`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnavailableError.prototype) @@ -1713,7 +1852,7 @@ export class QueryFailedError extends WebrpcError { code: number = 2003, message: string = `Query failed`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, QueryFailedError.prototype) @@ -1726,7 +1865,7 @@ export class NotFoundError extends WebrpcError { code: number = 3000, message: string = `Resource not found`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, NotFoundError.prototype) @@ -1739,7 +1878,7 @@ export class InsufficientFeeError extends WebrpcError { code: number = 3004, message: string = `Insufficient fee`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InsufficientFeeError.prototype) @@ -1752,7 +1891,7 @@ export class NotEnoughBalanceError extends WebrpcError { code: number = 3005, message: string = `Not enough balance`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, NotEnoughBalanceError.prototype) @@ -1765,14 +1904,13 @@ export class SimulationFailedError extends WebrpcError { code: number = 3006, message: string = `Simulation failed`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, SimulationFailedError.prototype) } } - export enum errors { WebrpcEndpoint = 'WebrpcEndpoint', WebrpcRequestFailed = 'WebrpcRequestFailed', @@ -1897,4 +2035,3 @@ export const webrpcErrorByCode: { [code: number]: any } = { } export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise - diff --git a/packages/wallet/core/src/index.ts b/packages/wallet/core/src/index.ts index 1bc32aed48..d84206d678 100644 --- a/packages/wallet/core/src/index.ts +++ b/packages/wallet/core/src/index.ts @@ -6,3 +6,9 @@ export * as Relayer from './relayer/index.js' export * as Envelope from './envelope.js' export * as Preconditions from './preconditions/index.js' export * as Utils from './utils/index.js' +export { + type ExplicitSessionConfig, + type ExplicitSession, + type ImplicitSession, + type Session, +} from './utils/session/types.js' diff --git a/packages/wallet/core/src/utils/session/types.ts b/packages/wallet/core/src/utils/session/types.ts new file mode 100644 index 0000000000..6bf1086d4d --- /dev/null +++ b/packages/wallet/core/src/utils/session/types.ts @@ -0,0 +1,33 @@ +import { Permission } from '@0xsequence/wallet-primitives' +import { Address } from 'ox' + +export type ExplicitSessionConfig = { + valueLimit: bigint + deadline: bigint + permissions: Permission.Permission[] + chainId: number +} + +// Complete session types - what the SDK returns after session creation +export type ImplicitSession = { + sessionAddress: Address.Address + type: 'implicit' +} + +export type ExplicitSession = { + sessionAddress: Address.Address + valueLimit: bigint + deadline: bigint + permissions: Permission.Permission[] + chainId: number + type: 'explicit' +} + +export type Session = { + type: 'explicit' | 'implicit' + sessionAddress: Address.Address + valueLimit?: bigint + deadline?: bigint + permissions?: Permission.Permission[] + chainId?: number +} diff --git a/packages/wallet/core/test/session-manager.test.ts b/packages/wallet/core/test/session-manager.test.ts index bde3b12994..aa154df916 100644 --- a/packages/wallet/core/test/session-manager.test.ts +++ b/packages/wallet/core/test/session-manager.test.ts @@ -13,6 +13,7 @@ import { USDC_ADDRESS, } from './constants' import { Extensions } from '@0xsequence/wallet-primitives' +import { ExplicitSessionConfig } from '../../wdk/src/sequence/types/sessions.js' const { PermissionBuilder, ERC20PermissionBuilder } = Utils @@ -86,7 +87,7 @@ for (const extension of ALL_EXTENSIONS) { let topology = SessionConfig.emptySessionsTopology(identityAddress) // Add random signer to the topology - const sessionPermission: Signers.Session.ExplicitParams = { + const sessionPermission: ExplicitSessionConfig = { chainId, valueLimit: 1000000000000000000n, deadline: BigInt(Math.floor(Date.now() / 1000) + 3600), // 1 hour from now @@ -419,7 +420,7 @@ for (const extension of ALL_EXTENSIONS) { // Create explicit signer const explicitPrivateKey = Secp256k1.randomPrivateKey() - const explicitPermissions: Signers.Session.ExplicitParams = { + const explicitPermissions: ExplicitSessionConfig = { chainId: useChainId ? chainId : 0, valueLimit: 1000000000000000000n, // 1 ETH deadline: BigInt(Math.floor(Date.now() / 1000) + 3600), // 1 hour from now @@ -721,7 +722,7 @@ for (const extension of ALL_EXTENSIONS) { // Create explicit signer const explicitPrivateKey = Secp256k1.randomPrivateKey() - const sessionPermission: Signers.Session.ExplicitParams = { + const sessionPermission: ExplicitSessionConfig = { chainId, valueLimit: 1000000000000000000n, // 1 ETH deadline: BigInt(Math.floor(Date.now() / 1000) + 3600), // 1 hour from now @@ -794,7 +795,7 @@ for (const extension of ALL_EXTENSIONS) { // Create explicit signer const explicitPrivateKey = Secp256k1.randomPrivateKey() - const sessionPermission: Signers.Session.ExplicitParams = { + const sessionPermission: ExplicitSessionConfig = { chainId, valueLimit: 0n, deadline: BigInt(Math.floor(Date.now() / 1000) + 3600), // 1 hour from now @@ -888,7 +889,7 @@ for (const extension of ALL_EXTENSIONS) { const explicitPrivateKey = Secp256k1.randomPrivateKey() const explicitAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: explicitPrivateKey })) const approveAmount = 10000000n // 10 USDC - const sessionPermission: Signers.Session.ExplicitParams = { + const sessionPermission: ExplicitSessionConfig = { chainId, valueLimit: 0n, deadline: BigInt(Math.floor(Date.now() / 1000) + 3600), // 1 hour from now @@ -990,7 +991,7 @@ for (const extension of ALL_EXTENSIONS) { // Create explicit signer const explicitPrivateKey = Secp256k1.randomPrivateKey() const explicitAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: explicitPrivateKey })) - const sessionPermission: Signers.Session.ExplicitParams = { + const sessionPermission: ExplicitSessionConfig = { chainId, valueLimit: 1000000000000000000n, // 1 ETH deadline: BigInt(Math.floor(Date.now() / 1000) + 3600), // 1 hour from now @@ -1100,7 +1101,7 @@ for (const extension of ALL_EXTENSIONS) { // Create explicit signer const explicitPrivateKey = Secp256k1.randomPrivateKey() const explicitAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: explicitPrivateKey })) - const sessionPermission: Signers.Session.ExplicitParams = { + const sessionPermission: ExplicitSessionConfig = { chainId, valueLimit: 1000000000000000000n, // 1 ETH deadline: BigInt(Math.floor(Date.now() / 1000) + 3600), // 1 hour from now @@ -1224,7 +1225,7 @@ for (const extension of ALL_EXTENSIONS) { // Create explicit signer const explicitPrivateKey = Secp256k1.randomPrivateKey() const explicitAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: explicitPrivateKey })) - const sessionPermission: Signers.Session.ExplicitParams = { + const sessionPermission: ExplicitSessionConfig = { chainId, valueLimit: 1000000000000000000n, // 1 ETH deadline: BigInt(Math.floor(Date.now() / 1000) + 3600), // 1 hour from now diff --git a/packages/wallet/dapp-client/src/ChainSessionManager.ts b/packages/wallet/dapp-client/src/ChainSessionManager.ts index 76b62a3f3d..623fc1faa2 100644 --- a/packages/wallet/dapp-client/src/ChainSessionManager.ts +++ b/packages/wallet/dapp-client/src/ChainSessionManager.ts @@ -1,8 +1,19 @@ -import { Envelope, Relayer, Signers, State, Wallet } from '@0xsequence/wallet-core' -import { Attestation, Constants, Extensions, Payload, SessionConfig } from '@0xsequence/wallet-primitives' import * as Guard from '@0xsequence/guard' import { AbiFunction, Address, Hex, Provider, RpcTransport, Secp256k1 } from 'ox' +import { + Envelope, + Relayer, + Signers, + State, + Wallet, + Attestation, + Constants, + Extensions, + Payload, + SessionConfig, +} from './index.js' + import { DappTransport } from './DappTransport.js' import { @@ -18,21 +29,21 @@ import { SequenceStorage } from './utils/storage.js' import { getRelayerUrl, getRpcUrl } from './utils/index.js' import { - AddExplicitSessionPayload, - CreateNewSessionPayload, - ConnectSuccessResponsePayload, + CreateNewSessionResponse, ExplicitSessionEventListener, - ModifySessionPayload, - ModifySessionSuccessResponsePayload, LoginMethod, RandomPrivateKeyFn, RequestActionType, - Session, Transaction, TransportMode, GuardConfig, + CreateNewSessionPayload, + ModifyExplicitSessionPayload, + SessionResponse, + AddExplicitSessionPayload, } from './types/index.js' import { CACHE_DB_NAME, VALUE_FORWARDER_ADDRESS } from './utils/constants.js' +import { ExplicitSession, ImplicitSession, ExplicitSessionConfig } from './index.js' interface ChainSessionManagerEventMap { explicitSessionResponse: ExplicitSessionEventListener @@ -54,7 +65,8 @@ export class ChainSessionManager { [K in keyof ChainSessionManagerEventMap]?: Set } = {} - private sessions: Session[] = [] + private explicitSessions: ExplicitSession[] = [] + private implicitSession: ImplicitSession | null = null private walletAddress: Address.Address | null = null private sessionManager: Signers.SessionManager | null = null @@ -250,13 +262,14 @@ export class ChainSessionManager { /** * Initiates the creation of a new session by sending a request to the wallet. - * @param permissions (Optional) Permissions for an initial explicit session. + * @param origin The origin of the session. + * @param sessionConfig (Optional) Session configuration for an initial explicit session. * @param options (Optional) Additional options like preferred login method. * @throws {InitializationError} If a session already exists or the transport fails to initialize. */ async createNewSession( origin: string, - permissions?: Signers.Session.ExplicitParams, + sessionConfig?: ExplicitSessionConfig, options: { preferredLoginMethod?: LoginMethod email?: string @@ -269,14 +282,17 @@ export class ChainSessionManager { const newPk = await this.randomPrivateKeyFn() const newSignerAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: newPk })) + const completeSession = { + sessionAddress: newSignerAddress, + ...sessionConfig, + } try { if (!this.transport) throw new InitializationError('Transport failed to initialize.') const payload: CreateNewSessionPayload = { - sessionAddress: newSignerAddress, origin, - permissions, + session: completeSession as ExplicitSession, includeImplicitSession: options.includeImplicitSession ?? false, preferredLoginMethod: options.preferredLoginMethod, email: options.preferredLoginMethod === 'email' ? options.email : undefined, @@ -292,7 +308,7 @@ export class ChainSessionManager { await this.sequenceStorage.setPendingRedirectRequest(true) } - const connectResponse = await this.transport.sendRequest( + const connectResponse = await this.transport.sendRequest( RequestActionType.CREATE_NEW_SESSION, this.redirectUrl, payload, @@ -319,7 +335,7 @@ export class ChainSessionManager { ) } - if (permissions) { + if (sessionConfig) { this.initializeWithWallet(receivedAddress) await this._initializeExplicitSessionInternal(newPk, loginMethod, userEmail, guard, true) await this.sequenceStorage.saveExplicitSession({ @@ -344,11 +360,11 @@ export class ChainSessionManager { /** * Initiates the addition of a new explicit session by sending a request to the wallet. - * @param permissions The permissions for the new explicit session. + * @param explicitSessionConfig The explicit session configuration for the new explicit session. * @throws {InitializationError} If the manager is not initialized. * @throws {AddExplicitSessionError} If adding the session fails. */ - async addExplicitSession(permissions: Signers.Session.ExplicitParams): Promise { + async addExplicitSession(explicitSessionConfig: ExplicitSessionConfig): Promise { if (!this.walletAddress) { throw new InitializationError( 'Cannot add an explicit session without a wallet address. Initialize the manager with a wallet address first.', @@ -363,8 +379,7 @@ export class ChainSessionManager { const newSignerAddress = Address.fromPublicKey(Secp256k1.getPublicKey({ privateKey: newPk })) const payload: AddExplicitSessionPayload = { - sessionAddress: newSignerAddress, - permissions, + session: { ...explicitSessionConfig, sessionAddress: newSignerAddress, type: 'explicit' }, } if (this.transport.mode === TransportMode.REDIRECT) { @@ -377,7 +392,7 @@ export class ChainSessionManager { await this.sequenceStorage.setPendingRedirectRequest(true) } - const response = await this.transport.sendRequest( + const response = await this.transport.sendRequest( RequestActionType.ADD_EXPLICIT_SESSION, this.redirectUrl, payload, @@ -415,15 +430,11 @@ export class ChainSessionManager { /** * Initiates the modification of an existing explicit session by sending a request to the wallet. - * @param sessionAddress The address of the explicit session to modify. - * @param newPermissions The new permissions for the session. + * @param modifiedExplicitSession The modified explicit session. * @throws {InitializationError} If the manager is not initialized. * @throws {ModifyExplicitSessionError} If modifying the session fails. */ - async modifyExplicitSession( - sessionAddress: Address.Address, - newPermissions: Signers.Session.ExplicitParams, - ): Promise { + async modifyExplicitSession(modifiedExplicitSession: ExplicitSession): Promise { if (!this.walletAddress) { throw new InitializationError( 'Cannot modify an explicit session without a wallet address. Initialize the manager with a wallet address first.', @@ -433,15 +444,22 @@ export class ChainSessionManager { try { if (!this.transport) throw new InitializationError('Transport failed to initialize.') - const session = this.sessions.find((s) => Address.isEqual(s.address, sessionAddress)) - if (!session) { + if (!modifiedExplicitSession.sessionAddress) { + throw new ModifyExplicitSessionError('Session address is required.') + } + + const existingExplicitSession: ExplicitSession = this.explicitSessions.find((s) => + Address.isEqual(s.sessionAddress!, modifiedExplicitSession.sessionAddress!), + ) as ExplicitSession + if (!existingExplicitSession) { throw new ModifyExplicitSessionError('Session not found.') } - const payload: ModifySessionPayload = { + const payload: ModifyExplicitSessionPayload = { walletAddress: this.walletAddress, - sessionAddress: sessionAddress, - permissions: newPermissions, + session: { + ...modifiedExplicitSession, + }, } if (this.transport.mode === TransportMode.REDIRECT) { @@ -453,7 +471,7 @@ export class ChainSessionManager { await this.sequenceStorage.setPendingRedirectRequest(true) } - const response = await this.transport.sendRequest( + const response = await this.transport.sendRequest( RequestActionType.MODIFY_EXPLICIT_SESSION, this.redirectUrl, payload, @@ -462,12 +480,12 @@ export class ChainSessionManager { if ( !Address.isEqual(Address.from(response.walletAddress), this.walletAddress) && - !Address.isEqual(Address.from(response.sessionAddress), sessionAddress) + !Address.isEqual(Address.from(response.sessionAddress), modifiedExplicitSession.sessionAddress) ) { throw new ModifyExplicitSessionError('Wallet or session address mismatch.') } - session.permissions = newPermissions + existingExplicitSession.permissions = modifiedExplicitSession.permissions if (this.transport?.mode === TransportMode.POPUP) { this.transport?.closeWallet() @@ -484,7 +502,7 @@ export class ChainSessionManager { * @returns A promise resolving to true on success. */ private async _handleRedirectConnectionResponse(response: { - payload: ConnectSuccessResponsePayload + payload: CreateNewSessionResponse action: string }): Promise { const tempPk = await this.sequenceStorage.getAndClearTempSessionPk() @@ -519,7 +537,7 @@ export class ChainSessionManager { ) } - if (savedRequest && savedPayload && savedPayload.permissions) { + if (savedRequest && savedPayload && savedPayload.session) { await this._initializeExplicitSessionInternal(tempPk, loginMethod, userEmail, guard, true) await this.sequenceStorage.saveExplicitSession({ pk: tempPk, @@ -613,10 +631,10 @@ export class ChainSessionManager { ) this.sessionManager = this.sessionManager.withImplicitSigner(implicitSigner) - this.sessions.push({ - address: implicitSigner.address, - isImplicit: true, - }) + this.implicitSession = { + sessionAddress: implicitSigner.address, + type: 'implicit', + } this.walletAddress = address if (saveSession) @@ -679,11 +697,13 @@ export class ChainSessionManager { const explicitSigner = new Signers.Session.Explicit(pk, permissions) this.sessionManager = this.sessionManager.withExplicitSigner(explicitSigner) - this.sessions.push({ - address: explicitSigner.address, - isImplicit: false, + this.explicitSessions.push({ + sessionAddress: explicitSigner.address, chainId: this.chainId, - permissions, + permissions: permissions.permissions, + valueLimit: permissions.valueLimit, + deadline: permissions.deadline, + type: 'explicit', }) if (guard && !this.guard) this.guard = guard @@ -853,7 +873,7 @@ export class ChainSessionManager { ) { return this._handleRedirectConnectionResponse(response) } else if (response.action === RequestActionType.MODIFY_EXPLICIT_SESSION) { - const modifyResponse = response.payload as ModifySessionSuccessResponsePayload + const modifyResponse = response.payload as SessionResponse if (!Address.isEqual(Address.from(modifyResponse.walletAddress), this.walletAddress!)) { throw new ModifyExplicitSessionError('Wallet address mismatch on redirect response.') } @@ -881,11 +901,19 @@ export class ChainSessionManager { } /** - * Gets the sessions (signers) managed by this instance. + * Gets the sessions (signers) managed by this session manager. * @returns An array of session objects. */ - getSessions(): Session[] { - return this.sessions + getExplicitSessions(): ExplicitSession[] { + return this.explicitSessions + } + + /** + * Gets the implicit session managed by this session manager. + * @returns An implicit session object or null if no implicit session is found. + */ + getImplicitSession(): ImplicitSession | null { + return this.implicitSession } /** @@ -973,7 +1001,8 @@ export class ChainSessionManager { * @private Resets the internal state of the manager without clearing stored credentials. */ private _resetState(): void { - this.sessions = [] + this.explicitSessions = [] + this.implicitSession = null this.walletAddress = null this.wallet = null this.sessionManager = null diff --git a/packages/wallet/dapp-client/src/DappClient.ts b/packages/wallet/dapp-client/src/DappClient.ts index 4bff6bdb4a..dcc7d81ceb 100644 --- a/packages/wallet/dapp-client/src/DappClient.ts +++ b/packages/wallet/dapp-client/src/DappClient.ts @@ -1,10 +1,16 @@ -/* eslint-disable @typescript-eslint/no-explicit-any */ -import { Relayer, Signers } from '@0xsequence/wallet-core' import { Address, Hex } from 'ox' +import { + Relayer, + type ExplicitSession, + type ExplicitSessionConfig, + type ImplicitSession, + type Session, +} from './index.js' + import { ChainSessionManager } from './ChainSessionManager.js' import { DappTransport } from './DappTransport.js' -import { InitializationError, SigningError, TransactionError } from './utils/errors.js' +import { ConnectionError, InitializationError, SigningError, TransactionError } from './utils/errors.js' import { SequenceStorage, WebStorage } from './utils/storage.js' import { DappClientExplicitSessionEventListener, @@ -15,7 +21,6 @@ import { RequestActionType, SendWalletTransactionPayload, SequenceSessionStorage, - Session, SignMessagePayload, SignTypedDataPayload, Transaction, @@ -39,8 +44,6 @@ interface DappClientEventMap { * This client manages user sessions across multiple chains, handles connection * and disconnection, and provides methods for signing and sending transactions. * - * @see {@link https://docs.sequence.xyz/sdk/typescript/v3/dapp-client} for more detailed documentation. - * * @example * // It is recommended to manage a singleton instance of this client. * const dappClient = new DappClient('http://localhost:5173'); @@ -164,8 +167,6 @@ export class DappClient { * @param listener The listener to call when the event occurs. * @returns A function to remove the listener. * - * @see {@link https://docs.sequence.xyz/sdk/typescript/v3/dapp-client/on} for more detailed documentation. - * * @example * useEffect(() => { * const handleWalletAction = (response) => { @@ -191,8 +192,6 @@ export class DappClient { * Retrieves the wallet address of the current session. * @returns The wallet address of the current session, or null if not initialized. {@link Address.Address} * - * @see {@link https://docs.sequence.xyz/sdk/typescript/v3/dapp-client/get-wallet-address} for more detailed documentation. - * * @example * const dappClient = new DappClient('http://localhost:5173'); * await dappClient.initialize(); @@ -207,31 +206,64 @@ export class DappClient { } /** - * Retrieves a list of all active sessions (signers) associated with the current wallet. - * @returns An array of all the active sessions. {@link { address: Address.Address, isImplicit: boolean }[]} - * - * @see {@link https://docs.sequence.xyz/sdk/typescript/v3/dapp-client/get-all-sessions} for more detailed documentation. + * Retrieves a list of all active explicit sessions (signers) associated with the current wallet. + * @returns An array of all the active explicit sessions. {@link ExplicitSession[]} * * @example * const dappClient = new DappClient('http://localhost:5173'); * await dappClient.initialize(); * * if (dappClient.isInitialized) { - * const sessions = dappClient.getAllSessions(); - * console.log('Sessions:', sessions); + * const explicitSessions = dappClient.getAllExplicitSessions(); + * console.log('Sessions:', explicitSessions); * } */ - public getAllSessions(): Session[] { - const allSessions = new Map() + public getAllExplicitSessions(): ExplicitSession[] { + const allExplicitSessions = new Map() Array.from(this.chainSessionManagers.values()).forEach((chainSessionManager) => { - chainSessionManager.getSessions().forEach((session) => { - const uniqueKey = `${session.address.toLowerCase()}-${session.isImplicit}` - if (!allSessions.has(uniqueKey)) { - allSessions.set(uniqueKey, session) + chainSessionManager.getExplicitSessions().forEach((session) => { + const uniqueKey = session.sessionAddress?.toLowerCase() + if (!allExplicitSessions.has(uniqueKey)) { + allExplicitSessions.set(uniqueKey, session) } }) }) - return Array.from(allSessions.values()) + return Array.from(allExplicitSessions.values()) + } + + /** + * Retrieves a list of all active implicit sessions (signers) associated with the current wallet. + * @note There can only be one implicit session per chain. + * @returns An array of all the active implicit sessions. {@link ImplicitSession[]} + * + * @example + * const dappClient = new DappClient('http://localhost:5173'); + * await dappClient.initialize(); + * + * if (dappClient.isInitialized) { + * const implicitSessions = dappClient.getAllImplicitSessions(); + * console.log('Sessions:', implicitSessions); + * } + */ + public getAllImplicitSessions(): ImplicitSession[] { + const allImplicitSessions = new Map() + Array.from(this.chainSessionManagers.values()).forEach((chainSessionManager) => { + const session = chainSessionManager.getImplicitSession() + if (!session) return + const uniqueKey = session?.sessionAddress?.toLowerCase() + if (uniqueKey && !allImplicitSessions.has(uniqueKey)) { + allImplicitSessions.set(uniqueKey, session) + } + }) + return Array.from(allImplicitSessions.values()) + } + + /** + * Gets all the sessions (explicit and implicit) managed by the client. + * @returns An array of session objects. {@link Session[]} + */ + public getAllSessions(): Session[] { + return [...this.getAllImplicitSessions(), ...this.getAllExplicitSessions()] } /** @@ -280,8 +312,6 @@ export class DappClient { * * @returns A promise that resolves when initialization is complete. * - * @see {@link https://docs.sequence.xyz/sdk/typescript/v3/dapp-client/initialize} for more detailed documentation. - * * @example * const dappClient = new DappClient('http://localhost:5173'); * await dappClient.initialize(); @@ -362,24 +392,28 @@ export class DappClient { /** * Initiates a connection with the wallet and creates a new session. * @param chainId The primary chain ID for the new session. - * @param permissions (Optional) Permissions to request for an initial explicit session. {@link Signers.Session.ExplicitParams} + * @param sessionConfig Session configuration {@link ExplicitSessionConfig} to request for an initial session. * @param options (Optional) Connection options, such as a preferred login method or email for social or email logins. * @throws If the connection process fails. {@link ConnectionError} * @throws If a session already exists. {@link InitializationError} * * @returns A promise that resolves when the connection is established. * - * @see {@link https://docs.sequence.xyz/sdk/typescript/v3/dapp-client/connect} for more detailed documentation. - * * @example - * const dappClient = new DappClient('http://localhost:5173'); - * await dappClient.connect(137, window.location.origin, undefined, { + * // Connect with an explicit session configuration + * const explicitSessionConfig: ExplicitSessionConfig = { + * valueLimit: 0n, + * deadline: BigInt(Date.now() + 1000 * 60 * 60), // 1 hour + * permissions: [...], + * chainId: 137 + * }; + * await dappClient.connect(137, explicitSessionConfig, { * preferredLoginMethod: 'google', * }); */ async connect( chainId: number, - permissions?: Signers.Session.ExplicitParams, + sessionConfig?: ExplicitSessionConfig, options: { preferredLoginMethod?: LoginMethod email?: string @@ -392,7 +426,7 @@ export class DappClient { try { const chainSessionManager = this.getChainSessionManager(chainId) - await chainSessionManager.createNewSession(this.origin, permissions, options) + await chainSessionManager.createNewSession(this.origin, sessionConfig, options) // For popup mode, we need to manually update the state and emit an event. // For redirect mode, this code won't be reached; the page will navigate away. @@ -401,7 +435,7 @@ export class DappClient { } } catch (err) { await this.disconnect() - throw err + throw new ConnectionError(`Connection failed: ${err}`) } } @@ -409,19 +443,16 @@ export class DappClient { * Adds a new explicit session for a given chain to an existing wallet. * @remarks * An `explicit session` is a session that can interact with any contract, subject to user-approved permissions. - * @param chainId The chain ID on which to add the explicit session. - * @param permissions The permissions to request for the new session. {@link Signers.Session.ExplicitParams} + * @param session The explicit session to add. {@link ExplicitSession} * * @throws If the session cannot be added. {@link AddExplicitSessionError} * @throws If the client or relevant chain is not initialized. {@link InitializationError} * * @returns A promise that resolves when the session is added. * - * @see {@link https://docs.sequence.xyz/sdk/typescript/v3/dapp-client/add-explicit-session} for more detailed documentation. - * * @example * ... - * import { Signers, Utils } from "@0xsequence/wallet-core"; + * import { ExplicitSession, Utils } from "@0xsequence/wallet-core"; * import { DappClient } from "@0xsequence/sessions"; * ... * @@ -433,24 +464,24 @@ export class DappClient { * * if (dappClient.isInitialized) { * // Allow Dapp (Session Signer) to transfer "amount" of USDC - * const permissions: Signers.Session.ExplicitParams = { + * const explicitSession: ExplicitSession = { * chainId: Number(chainId), * valueLimit: 0n, // Not allowed to transfer native tokens (ETH, etc) * deadline: BigInt(Date.now() + 1000 * 60 * 5000), // 5000 minutes from now * permissions: [Utils.ERC20PermissionBuilder.buildTransfer(USDC_ADDRESS, amount)] * }; - * await dappClient.addExplicitSession(1, permissions); + * await dappClient.addExplicitSession(explicitSession); * } */ - async addExplicitSession(chainId: number, permissions: Signers.Session.ExplicitParams): Promise { + async addExplicitSession(explicitSessionConfig: ExplicitSessionConfig): Promise { if (!this.isInitialized || !this.walletAddress) throw new InitializationError('Cannot add an explicit session without an existing wallet.') - const chainSessionManager = this.getChainSessionManager(chainId) + const chainSessionManager = this.getChainSessionManager(explicitSessionConfig.chainId) if (!chainSessionManager.isInitialized) { chainSessionManager.initializeWithWallet(this.walletAddress) } - await chainSessionManager.addExplicitSession(permissions) + await chainSessionManager.addExplicitSession(explicitSessionConfig) if (this.transport.mode === TransportMode.POPUP) { await this._loadStateFromStorage() @@ -458,48 +489,34 @@ export class DappClient { } /** - * Modifies the permissions of an existing explicit session for a given chain and session address. - * @param chainId The chain ID on which the explicit session exists. - * @param sessionAddress The address of the explicit session to modify. {@link Address.Address} - * @param permissions The new permissions to set for the session. {@link Signers.Session.ExplicitParams} + * Modifies an explicit session for a given chain + * @param explicitSession The explicit session to modify. {@link ExplicitSession} * * @throws If the client or relevant chain is not initialized. {@link InitializationError} * @throws If something goes wrong while modifying the session. {@link ModifyExplicitSessionError} * * @returns A promise that resolves when the session permissions are updated. * - * @see {@link https://docs.sequence.xyz/sdk/typescript/v3/dapp-client/modify-explicit-session} for more detailed documentation. - * * @example * const dappClient = new DappClient('http://localhost:5173'); * await dappClient.initialize(); * * if (dappClient.isInitialized) { - * // The address of an existing explicit session (Grants the Dapp permission to transfer 100 USDC for the user) - * const sessionAddress = '0x...'; - * // We create a new permission object where we can increase the granted transfer amount limit - * const permissions: Signers.Session.ExplicitParams = { - * chainId: Number(chainId), - * valueLimit: 0n, - * deadline: BigInt(Date.now() + 1000 * 60 * 5000), - * permissions: [Utils.ERC20PermissionBuilder.buildTransfer(USDC_ADDRESS, amount)] - * }; - * await dappClient.modifyExplicitSession(1, sessionAddress, permissions); + * // Increase the deadline of the current session by 24 hours + * const currentExplicitSession = {...} + * const newExplicitSession = {...currentExplicitSession, deadline: currentExplicitSession.deadline + 24 * 60 * 60} + * await dappClient.modifyExplicitSession(newExplicitSession); * } */ - async modifyExplicitSession( - chainId: number, - sessionAddress: Address.Address, - permissions: Signers.Session.ExplicitParams, - ): Promise { + async modifyExplicitSession(explicitSession: ExplicitSession): Promise { if (!this.isInitialized || !this.walletAddress) throw new InitializationError('Cannot modify an explicit session without an existing wallet.') - const chainSessionManager = this.getChainSessionManager(chainId) + const chainSessionManager = this.getChainSessionManager(explicitSession.chainId) if (!chainSessionManager.isInitialized) { chainSessionManager.initializeWithWallet(this.walletAddress) } - await chainSessionManager.modifyExplicitSession(sessionAddress, permissions) + await chainSessionManager.modifyExplicitSession(explicitSession) if (this.transport.mode === TransportMode.POPUP) { await this._loadStateFromStorage() @@ -515,8 +532,6 @@ export class DappClient { * * @returns A promise that resolves with the fee options. {@link Relayer.FeeOption[]} * - * @see {@link https://docs.sequence.xyz/sdk/typescript/v3/dapp-client/get-fee-options} for more detailed documentation. - * * @example * const dappClient = new DappClient('http://localhost:5173'); * await dappClient.initialize(); @@ -567,8 +582,6 @@ export class DappClient { * * @returns A promise that resolves with the transaction hash. * - * @see {@link https://docs.sequence.xyz/sdk/typescript/v3/dapp-client/send-transaction} for more detailed documentation. - * * @example * const dappClient = new DappClient('http://localhost:5173'); * await dappClient.initialize(); @@ -599,8 +612,6 @@ export class DappClient { * * @returns A promise that resolves when the signing process is initiated. The signature is delivered via the `walletActionResponse` event listener. * - * @see {@link https://docs.sequence.xyz/sdk/typescript/v3/dapp-client/sign-message} for more detailed documentation. - * * @example * const dappClient = new DappClient('http://localhost:5173'); * await dappClient.initialize(); @@ -633,8 +644,6 @@ export class DappClient { * * @returns A promise that resolves when the signing process is initiated. The signature is returned in the `walletActionResponse` event listener. * - * @see {@link https://docs.sequence.xyz/sdk/typescript/v3/dapp-client/sign-typed-data} for more detailed documentation. - * * @example * const dappClient = new DappClient('http://localhost:5173'); * await dappClient.initialize(); @@ -688,8 +697,6 @@ export class DappClient { * @remarks This action does not revoke the sessions on-chain. Sessions remain active until they expire or are manually revoked by the user in their wallet. * @returns A promise that resolves when disconnection is complete. * - * @see {@link https://docs.sequence.xyz/sdk/typescript/v3/dapp-client/disconnect} for more detailed documentation. - * * @example * const dappClient = new DappClient('http://localhost:5173'); * await dappClient.initialize(); @@ -793,7 +800,7 @@ export class DappClient { this.chainSessionManagers.set(chainId, chainSessionManager) chainSessionManager.on('explicitSessionResponse', (data) => { - this.emit('explicitSessionResponse', { ...data, chainId }) + this.emit('explicitSessionResponse', { ...data }) }) } return chainSessionManager diff --git a/packages/wallet/dapp-client/src/index.ts b/packages/wallet/dapp-client/src/index.ts index c920a0ac5b..3770dd8808 100644 --- a/packages/wallet/dapp-client/src/index.ts +++ b/packages/wallet/dapp-client/src/index.ts @@ -4,24 +4,21 @@ export type { LoginMethod, GuardConfig, Transaction, - SignatureSuccessResponse, - ChainSessionManagerEvent, + SignatureResponse, SequenceSessionStorage, RandomPrivateKeyFn, - Session, SignMessagePayload, + SessionResponse, AddExplicitSessionPayload, - AddExplicitSessionSuccessResponsePayload, CreateNewSessionPayload, + CreateNewSessionResponse, SignTypedDataPayload, - ConnectSuccessResponsePayload, - ModifySessionSuccessResponsePayload, - ModifySessionPayload, + ModifyExplicitSessionPayload, DappClientWalletActionEventListener, DappClientExplicitSessionEventListener, TransactionRequest, SendWalletTransactionPayload, - SendWalletTransactionSuccessResponse, + SendWalletTransactionResponse, WalletActionResponse, } from './types/index.js' export { RequestActionType, TransportMode } from './types/index.js' @@ -44,5 +41,6 @@ export type { } from './utils/storage.js' export { WebStorage } from './utils/storage.js' -export { Permission, Extensions, SessionConfig } from '@0xsequence/wallet-primitives' -export { Signers, Wallet, Utils, Relayer } from '@0xsequence/wallet-core' +export { Attestation, Permission, Extensions, SessionConfig, Constants, Payload } from '@0xsequence/wallet-primitives' +export type { ExplicitSessionConfig, ExplicitSession, ImplicitSession, Session } from '@0xsequence/wallet-core' +export { Signers, Wallet, Utils, Relayer, Envelope, State } from '@0xsequence/wallet-core' diff --git a/packages/wallet/dapp-client/src/types/index.ts b/packages/wallet/dapp-client/src/types/index.ts index ad251cab49..a488c98b78 100644 --- a/packages/wallet/dapp-client/src/types/index.ts +++ b/packages/wallet/dapp-client/src/types/index.ts @@ -1,6 +1,6 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ +import { ExplicitSession } from '@0xsequence/wallet-core' import { Attestation, Payload } from '@0xsequence/wallet-primitives' -import { Signers } from '@0xsequence/wallet-core' import { Address, Hex } from 'ox' import type { TypedData } from 'ox/TypedData' @@ -25,25 +25,22 @@ export interface GuardConfig { // --- Payloads for Transport --- export interface CreateNewSessionPayload { - sessionAddress: Address.Address - origin: string - permissions?: Signers.Session.ExplicitParams + origin?: string + session?: ExplicitSession includeImplicitSession?: boolean preferredLoginMethod?: LoginMethod email?: string } export interface AddExplicitSessionPayload { - sessionAddress: Address.Address - permissions: Signers.Session.ExplicitParams + session: ExplicitSession preferredLoginMethod?: LoginMethod email?: string } -export interface ModifySessionPayload { +export interface ModifyExplicitSessionPayload { walletAddress: Address.Address - sessionAddress: Address.Address - permissions: Signers.Session.ExplicitParams + session: ExplicitSession } export interface SignMessagePayload { @@ -58,6 +55,12 @@ export interface SignTypedDataPayload { chainId: number } +export interface SendWalletTransactionPayload { + address: Address.Address + transactionRequest: TransactionRequest + chainId: number +} + export type TransactionRequest = { to: Address.Address value?: bigint @@ -65,13 +68,7 @@ export type TransactionRequest = { gasLimit?: bigint } -export interface SendWalletTransactionPayload { - address: Address.Address - transactionRequest: TransactionRequest - chainId: number -} - -export interface ConnectSuccessResponsePayload { +export interface CreateNewSessionResponse { walletAddress: string attestation?: Attestation.Attestation signature?: Hex.Hex @@ -80,28 +77,23 @@ export interface ConnectSuccessResponsePayload { guard?: GuardConfig } -export interface AddExplicitSessionSuccessResponsePayload { +export interface SignatureResponse { + signature: Hex.Hex walletAddress: string - sessionAddress: string } -export interface ModifySessionSuccessResponsePayload { +export interface SendWalletTransactionResponse { + transactionHash: Hex.Hex walletAddress: string - sessionAddress: string } -export interface SignatureSuccessResponse { - signature: Hex.Hex - walletAddress: string -} +export type WalletActionResponse = SignatureResponse | SendWalletTransactionResponse -export interface SendWalletTransactionSuccessResponse { - transactionHash: Hex.Hex +export interface SessionResponse { walletAddress: string + sessionAddress: string } -export type WalletActionResponse = SignatureSuccessResponse | SendWalletTransactionSuccessResponse - // --- Dapp-facing Types --- export type RandomPrivateKeyFn = () => Hex.Hex | Promise @@ -114,20 +106,11 @@ export type Transaction = // All other properties from Payload.Call, but optional Partial> -export type Session = { - address: Address.Address - isImplicit: boolean - permissions?: Signers.Session.ExplicitParams - chainId?: number -} - // --- Event Types --- -export type ChainSessionManagerEvent = 'sessionsUpdated' | 'explicitSessionResponse' - export type ExplicitSessionEventListener = (data: { action: (typeof RequestActionType)['ADD_EXPLICIT_SESSION' | 'MODIFY_EXPLICIT_SESSION'] - response?: AddExplicitSessionSuccessResponsePayload | ModifySessionSuccessResponsePayload + response?: SessionResponse error?: any }) => void @@ -141,12 +124,9 @@ export type DappClientWalletActionEventListener = (data: { chainId: number }) => void -export type DappClientExplicitSessionEventListener = (data: { - action: (typeof RequestActionType)['ADD_EXPLICIT_SESSION' | 'MODIFY_EXPLICIT_SESSION'] - response?: AddExplicitSessionSuccessResponsePayload | ModifySessionSuccessResponsePayload - error?: any +export type DappClientExplicitSessionEventListener = ExplicitSessionEventListener & { chainId: number -}) => void +} // --- DappTransport Types --- @@ -182,24 +162,6 @@ export interface TransportMessage { error?: any } -export interface BaseRequest { - type: string -} - -export interface MessageSignatureRequest extends BaseRequest { - type: 'message_signature' - message: string - address: Address.Address - chainId: number -} - -export interface TypedDataSignatureRequest extends BaseRequest { - type: 'typed_data_signature' - typedData: unknown - address: Address.Address - chainId: number -} - export const WalletSize = { width: 380, height: 600, @@ -211,7 +173,6 @@ export interface PendingRequest { timer: number action: string } - export interface SendRequestOptions { timeout?: number path?: string diff --git a/packages/wallet/dapp-client/src/utils/storage.ts b/packages/wallet/dapp-client/src/utils/storage.ts index a554f86fe6..c65bc0ffce 100644 --- a/packages/wallet/dapp-client/src/utils/storage.ts +++ b/packages/wallet/dapp-client/src/utils/storage.ts @@ -1,17 +1,18 @@ -import { Attestation } from '@0xsequence/wallet-primitives' import { Address, Hex } from 'ox' import { jsonReplacers, jsonRevivers } from './index.js' import { - AddExplicitSessionPayload, - CreateNewSessionPayload, - ModifySessionPayload, LoginMethod, SignMessagePayload, SignTypedDataPayload, GuardConfig, SendWalletTransactionPayload, + ModifyExplicitSessionPayload, + CreateNewSessionPayload, + AddExplicitSessionPayload, } from '../types/index.js' +import { Attestation } from '../index.js' + export interface ExplicitSessionData { pk: Hex.Hex walletAddress: Address.Address @@ -35,7 +36,7 @@ export interface ImplicitSessionData { export type PendingPayload = | CreateNewSessionPayload | AddExplicitSessionPayload - | ModifySessionPayload + | ModifyExplicitSessionPayload | SignMessagePayload | SignTypedDataPayload | SendWalletTransactionPayload diff --git a/packages/wallet/primitives/src/permission.ts b/packages/wallet/primitives/src/permission.ts index 773a176e59..c2909696d8 100644 --- a/packages/wallet/primitives/src/permission.ts +++ b/packages/wallet/primitives/src/permission.ts @@ -25,7 +25,7 @@ export type SessionPermissions = { chainId: number valueLimit: bigint deadline: bigint // uint64 - permissions: [Permission, ...Permission[]] + permissions: Permission[] } export const MAX_PERMISSIONS_COUNT = 2 ** 7 - 1 @@ -127,7 +127,7 @@ export function decodeSessionPermissions(bytes: Bytes.Bytes): SessionPermissions chainId, valueLimit, deadline, - permissions: permissions as [Permission, ...Permission[]], + permissions: permissions, } } diff --git a/packages/wallet/wdk/src/sequence/sessions.ts b/packages/wallet/wdk/src/sequence/sessions.ts index a115005598..bd6a15e38a 100644 --- a/packages/wallet/wdk/src/sequence/sessions.ts +++ b/packages/wallet/wdk/src/sequence/sessions.ts @@ -1,4 +1,4 @@ -import { Signers as CoreSigners, Envelope } from '@0xsequence/wallet-core' +import { Envelope, type ExplicitSession } from '@0xsequence/wallet-core' import { Attestation, Config, @@ -13,13 +13,7 @@ import { AuthCodePkceHandler } from './handlers/authcode-pkce.js' import { IdentityHandler, identityTypeToHex } from './handlers/identity.js' import { ManagerOptionsDefaults, Shared } from './manager.js' import { Actions } from './types/signature-request.js' -import { Kinds, Module } from './types/index.js' -import { Handler } from './handlers/index.js' - -export type AuthorizeImplicitSessionArgs = { - target: string - applicationData?: Hex.Hex -} +import { AuthorizeImplicitSessionArgs } from './types/sessions.js' export interface SessionsInterface { /** @@ -92,16 +86,11 @@ export interface SessionsInterface { * completed using the `complete` method. * * @param walletAddress The address of the wallet to modify. - * @param sessionAddress The address of the key to be added as a session signer. * @param permissions The set of rules and limits that will govern this session key's capabilities. * @returns A promise that resolves to a `requestId` for the configuration update signature request. * @see {complete} to finalize the update after it has been signed. */ - addExplicitSession( - walletAddress: Address.Address, - sessionAddress: Address.Address, - permissions: CoreSigners.Session.ExplicitParams, - ): Promise + addExplicitSession(walletAddress: Address.Address, explicitSession: ExplicitSession): Promise /** * Initiates an on-chain configuration update to modify an existing "explicit session". @@ -113,7 +102,6 @@ export interface SessionsInterface { * Like adding a session, this requires a signed configuration update. * * @param walletAddress The address of the wallet to modify. - * @param sessionAddress The address of the session signer to modify. * @param permissions The new, complete set of rules and limits for this session key. * @param origin Optional string to identify the source of the request. * @returns A promise that resolves to a `requestId` for the configuration update. @@ -121,8 +109,7 @@ export interface SessionsInterface { */ modifyExplicitSession( walletAddress: Address.Address, - sessionAddress: Address.Address, - permissions: CoreSigners.Session.ExplicitParams, + explicitSession: ExplicitSession, origin?: string, ): Promise @@ -187,24 +174,17 @@ export class Sessions implements SessionsInterface { constructor(private readonly shared: Shared) {} async getTopology(walletAddress: Address.Address, fixMissing = false): Promise { - const { loginTopology, devicesTopology, modules } = - await this.shared.modules.wallets.getConfigurationParts(walletAddress) + const { loginTopology, modules } = await this.shared.modules.wallets.getConfigurationParts(walletAddress) const managerModule = modules.find((m) => Address.isEqual(m.sapientLeaf.address, this.shared.sequence.extensions.sessions), ) if (!managerModule) { if (fixMissing) { // Create the default session manager leaf - const authorizedSigners = [...Config.topologyToFlatLeaves([devicesTopology, loginTopology])].filter( - Config.isSignerLeaf, - ) - if (authorizedSigners.length === 0) { - throw new Error('No signer leaves found') - } - let sessionsTopology = SessionConfig.emptySessionsTopology(authorizedSigners[0]!.address) - for (let i = 1; i < authorizedSigners.length; i++) { - sessionsTopology = SessionConfig.addIdentitySigner(sessionsTopology, authorizedSigners[i]!.address) + if (!Config.isSignerLeaf(loginTopology) && !Config.isSapientSignerLeaf(loginTopology)) { + throw new Error('Login topology is not a signer leaf') } + const sessionsTopology = SessionConfig.emptySessionsTopology(loginTopology.address) const sessionsConfigTree = SessionConfig.sessionsTopologyToConfigurationTree(sessionsTopology) this.shared.sequence.stateProvider.saveTree(sessionsConfigTree) const imageHash = GenericTree.hash(sessionsConfigTree) @@ -229,133 +209,23 @@ export class Sessions implements SessionsInterface { return SessionConfig.configurationTreeToSessionsTopology(tree) } - private async updateSessionModule( - modules: Module[], - transformer: (topology: SessionConfig.SessionsTopology) => SessionConfig.SessionsTopology, - ) { - const ext = this.shared.sequence.extensions.sessions - const idx = modules.findIndex((m) => Address.isEqual(m.sapientLeaf.address, ext)) - if (idx === -1) { - return - } - - const sessionModule = modules[idx] - if (!sessionModule) { - throw new Error('session-module-not-found') - } - - const genericTree = await this.shared.sequence.stateProvider.getTree(sessionModule.sapientLeaf.imageHash) - if (!genericTree) { - throw new Error('session-module-tree-not-found') - } - - const topology = SessionConfig.configurationTreeToSessionsTopology(genericTree) - const nextTopology = transformer(topology) - const nextTree = SessionConfig.sessionsTopologyToConfigurationTree(nextTopology) - await this.shared.sequence.stateProvider.saveTree(nextTree) - if (!modules[idx]) { - throw new Error('session-module-not-found-(unreachable)') - } - - modules[idx].sapientLeaf.imageHash = GenericTree.hash(nextTree) - } - - hasSessionModule(modules: Module[]): boolean { - return modules.some((m) => Address.isEqual(m.sapientLeaf.address, this.shared.sequence.extensions.sessions)) - } - - async initSessionModule(modules: Module[], identitySigners: Address.Address[], guardTopology?: Config.NestedLeaf) { - if (this.hasSessionModule(modules)) { - throw new Error('session-module-already-initialized') - } - - if (identitySigners.length === 0) { - throw new Error('No identity signers provided') - } - - // Calculate image hash with the identity signers - const sessionsTopology = SessionConfig.emptySessionsTopology( - identitySigners as [Address.Address, ...Address.Address[]], - ) - // Store this tree in the state provider - const sessionsConfigTree = SessionConfig.sessionsTopologyToConfigurationTree(sessionsTopology) - this.shared.sequence.stateProvider.saveTree(sessionsConfigTree) - // Prepare the configuration leaf - const sessionsImageHash = GenericTree.hash(sessionsConfigTree) - const signer = { - ...ManagerOptionsDefaults.defaultSessionsTopology, - address: this.shared.sequence.extensions.sessions, - imageHash: sessionsImageHash, - } - modules.push({ - sapientLeaf: signer, - weight: 255n, - guardLeaf: guardTopology, - }) - } - - async addIdentitySignerToModules(modules: Module[], address: Address.Address) { - if (!this.hasSessionModule(modules)) { - throw new Error('session-module-not-enabled') - } - - await this.updateSessionModule(modules, (topology) => { - const existingSigners = SessionConfig.getIdentitySigners(topology) - if (existingSigners?.some((s) => Address.isEqual(s, address))) { - return topology - } - - return SessionConfig.addIdentitySigner(topology, address) - }) - } - - async removeIdentitySignerFromModules(modules: Module[], address: Address.Address) { - if (!this.hasSessionModule(modules)) { - throw new Error('session-module-not-enabled') - } - - await this.updateSessionModule(modules, (topology) => { - const newTopology = SessionConfig.removeIdentitySigner(topology, address) - if (!newTopology) { - // Can't remove the last identity signer - throw new Error('Cannot remove the last identity signer') - } - return newTopology - }) - } - async prepareAuthorizeImplicitSession( walletAddress: Address.Address, sessionAddress: Address.Address, args: AuthorizeImplicitSessionArgs, ): Promise { const topology = await this.getTopology(walletAddress) - const identitySigners = SessionConfig.getIdentitySigners(topology) - if (identitySigners.length === 0) { - throw new Error('No identity signers found') + const identitySignerAddress = SessionConfig.getIdentitySigner(topology) + if (!identitySignerAddress) { + throw new Error('No identity signer address found') } - let handler: Handler | undefined - let identitySignerAddress: Address.Address | undefined - for (const identitySigner of identitySigners) { - const identityKind = await this.shared.modules.signers.kindOf(walletAddress, identitySigner) - if (!identityKind) { - console.warn('No identity handler kind found for', identitySigner) - continue - } - if (identityKind === Kinds.LoginPasskey) { - console.warn('Implicit sessions do not support passkeys', identitySigner) - continue - } - const iHandler = this.shared.handlers.get(identityKind) - if (iHandler) { - handler = iHandler - identitySignerAddress = identitySigner - break - } + const identityKind = await this.shared.modules.signers.kindOf(walletAddress, identitySignerAddress) + if (!identityKind) { + throw new Error('No identity handler kind found') } - - if (!handler || !identitySignerAddress) { - throw new Error('No identity handler or address found') + const handler = this.shared.handlers.get(identityKind) + if (!handler) { + throw new Error('No identity handler found') } // Create the attestation to sign @@ -444,33 +314,31 @@ export class Sessions implements SessionsInterface { async addExplicitSession( walletAddress: Address.Address, - sessionAddress: Address.Address, - permissions: CoreSigners.Session.ExplicitParams, + explicitSession: ExplicitSession, origin?: string, ): Promise { const topology = await this.getTopology(walletAddress, true) const newTopology = SessionConfig.addExplicitSession(topology, { - ...permissions, - signer: sessionAddress, + ...explicitSession, + signer: explicitSession.sessionAddress, }) return this.prepareSessionUpdate(walletAddress, newTopology, origin) } async modifyExplicitSession( walletAddress: Address.Address, - sessionAddress: Address.Address, - permissions: CoreSigners.Session.ExplicitParams, + explicitSession: ExplicitSession, origin?: string, ): Promise { // This will add the session manager if it's missing const topology = await this.getTopology(walletAddress, true) - const intermediateTopology = SessionConfig.removeExplicitSession(topology, sessionAddress) + const intermediateTopology = SessionConfig.removeExplicitSession(topology, explicitSession.sessionAddress) if (!intermediateTopology) { throw new Error('Incomplete session topology') } const newTopology = SessionConfig.addExplicitSession(intermediateTopology, { - ...permissions, - signer: sessionAddress, + ...explicitSession, + signer: explicitSession.sessionAddress, }) return this.prepareSessionUpdate(walletAddress, newTopology, origin) } diff --git a/packages/wallet/wdk/src/sequence/types/sessions.ts b/packages/wallet/wdk/src/sequence/types/sessions.ts new file mode 100644 index 0000000000..1efef2490a --- /dev/null +++ b/packages/wallet/wdk/src/sequence/types/sessions.ts @@ -0,0 +1,6 @@ +import { Hex } from 'ox' + +export type AuthorizeImplicitSessionArgs = { + target: string + applicationData?: Hex.Hex +} diff --git a/packages/wallet/wdk/test/sessions.test.ts b/packages/wallet/wdk/test/sessions.test.ts index bd1500e5d3..f6d8a144b0 100644 --- a/packages/wallet/wdk/test/sessions.test.ts +++ b/packages/wallet/wdk/test/sessions.test.ts @@ -4,6 +4,7 @@ import { Signers as CoreSigners, Wallet as CoreWallet, Envelope, Relayer, State import { Attestation, Constants, Extensions, Network, Payload, Permission } from '../../primitives/src/index.js' import { Sequence } from '../src/index.js' import { CAN_RUN_LIVE, EMITTER_ABI, EMITTER_ADDRESS, PRIVATE_KEY, RPC_URL } from './constants' +import { ExplicitSession } from '../src/sequence/types/sessions.js' describe('Sessions (via Manager)', () => { // Shared components @@ -24,16 +25,12 @@ describe('Sessions (via Manager)', () => { sessionManager: CoreSigners.SessionManager } - const setupExplicitSession = async ( - sessionAddress: Address.Address, - permissions: Permission.SessionPermissions, - isModify = false, - ) => { + const setupExplicitSession = async (explicitSession: ExplicitSession, isModify = false) => { let requestId: string if (isModify) { - requestId = await wdk.manager.sessions.modifyExplicitSession(dapp.wallet.address, sessionAddress, permissions) + requestId = await wdk.manager.sessions.modifyExplicitSession(dapp.wallet.address, explicitSession) } else { - requestId = await wdk.manager.sessions.addExplicitSession(dapp.wallet.address, sessionAddress, permissions) + requestId = await wdk.manager.sessions.addExplicitSession(dapp.wallet.address, explicitSession) } // Sign and complete the request @@ -225,8 +222,8 @@ describe('Sessions (via Manager)', () => { if (!s) { throw new Error('Failed to create pk store') } - const permission: Permission.SessionPermissions = { - signer: e.address, + const explicitSession: ExplicitSession = { + sessionAddress: e.address, chainId, valueLimit: 0n, deadline: BigInt(Math.floor(Date.now() / 1000) + 3600), // 1 hour from now @@ -237,11 +234,11 @@ describe('Sessions (via Manager)', () => { }, ], } - const explicitSigner = new CoreSigners.Session.Explicit(s, permission) + const explicitSigner = new CoreSigners.Session.Explicit(s, explicitSession) // Add to manager dapp.sessionManager = dapp.sessionManager.withExplicitSigner(explicitSigner) - await setupExplicitSession(explicitSigner.address, permission) + await setupExplicitSession(explicitSession) // Create a call payload const call: Payload.Call = { @@ -290,8 +287,8 @@ describe('Sessions (via Manager)', () => { if (!s) { throw new Error('Failed to create pk store') } - const permission: Permission.SessionPermissions = { - signer: e.address, + const explicitSession: ExplicitSession = { + sessionAddress: e.address, chainId, valueLimit: 0n, deadline: BigInt(Math.floor(Date.now() / 1000) + 3600), // 1 hour from now @@ -311,11 +308,11 @@ describe('Sessions (via Manager)', () => { }, ], } - const explicitSigner = new CoreSigners.Session.Explicit(s, permission) + const explicitSigner = new CoreSigners.Session.Explicit(s, explicitSession) // Add to manager dapp.sessionManager = dapp.sessionManager.withExplicitSigner(explicitSigner) - await setupExplicitSession(explicitSigner.address, permission) + await setupExplicitSession(explicitSession) // Create a call payload const call: Payload.Call = { @@ -365,8 +362,8 @@ describe('Sessions (via Manager)', () => { throw new Error('Failed to create pk store') } // Create the initial permissions - let permission: Permission.SessionPermissions = { - signer: e.address, + let explicitSession: ExplicitSession = { + sessionAddress: e.address, chainId, valueLimit: 0n, deadline: BigInt(Math.floor(Date.now() / 1000) + 3600), // 1 hour from now @@ -386,11 +383,11 @@ describe('Sessions (via Manager)', () => { }, ], } - const explicitSigner = new CoreSigners.Session.Explicit(s, permission) + const explicitSigner = new CoreSigners.Session.Explicit(s, explicitSession) // Add to manager dapp.sessionManager = dapp.sessionManager.withExplicitSigner(explicitSigner) - await setupExplicitSession(explicitSigner.address, permission) + await setupExplicitSession(explicitSession) // Create a call payload const call: Payload.Call = { @@ -429,9 +426,9 @@ describe('Sessions (via Manager)', () => { // Now we modify the permissions target contract to zero address // This should cause any session call to the EMITTER_ADDRESS contract to fail - permission.permissions[0].target = '0x0000000000000000000000000000000000000000' + explicitSession.permissions[0].target = '0x0000000000000000000000000000000000000000' - await setupExplicitSession(explicitSigner.address, permission, true) + await setupExplicitSession(explicitSession, true) // Sign and send the transaction // Should fail with 'No signer supported for call' diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 450d5be82a..f06089e93f 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -10,10 +10,10 @@ importers: devDependencies: '@changesets/cli': specifier: ^2.29.4 - version: 2.29.5 + version: 2.29.7(@types/node@22.18.6) lefthook: specifier: ^1.11.13 - version: 1.12.2 + version: 1.13.3 prettier: specifier: ^3.5.3 version: 3.6.2 @@ -22,7 +22,7 @@ importers: version: 6.0.1 turbo: specifier: ^2.5.4 - version: 2.5.5 + version: 2.5.6 typescript: specifier: 5.8.3 version: 5.8.3 @@ -33,14 +33,14 @@ importers: specifier: workspace:* version: link:../../repo/ui next: - specifier: ^15.4.7 - version: 15.4.7(react-dom@19.1.0(react@19.1.0))(react@19.1.0) + specifier: ^15.3.3 + version: 15.5.3(react-dom@19.1.1(react@19.1.1))(react@19.1.1) react: specifier: ^19.1.0 - version: 19.1.0 + version: 19.1.1 react-dom: specifier: ^19.1.0 - version: 19.1.0(react@19.1.0) + version: 19.1.1(react@19.1.1) devDependencies: '@repo/eslint-config': specifier: workspace:* @@ -50,7 +50,7 @@ importers: version: link:../../repo/typescript-config '@types/node': specifier: ^20.17.57 - version: 20.19.9 + version: 20.19.17 '@types/react': specifier: 18.3.1 version: 18.3.1 @@ -67,14 +67,14 @@ importers: specifier: workspace:* version: link:../../repo/ui next: - specifier: ^15.4.7 - version: 15.4.7(react-dom@19.1.0(react@19.1.0))(react@19.1.0) + specifier: ^15.3.3 + version: 15.5.3(react-dom@19.1.1(react@19.1.1))(react@19.1.1) react: specifier: ^19.1.0 - version: 19.1.0 + version: 19.1.1 react-dom: specifier: ^19.1.0 - version: 19.1.0(react@19.1.0) + version: 19.1.1(react@19.1.1) devDependencies: '@repo/eslint-config': specifier: workspace:* @@ -84,7 +84,7 @@ importers: version: link:../../repo/typescript-config '@types/node': specifier: ^20.17.57 - version: 20.19.9 + version: 20.19.17 '@types/react': specifier: 18.3.1 version: 18.3.1 @@ -102,7 +102,7 @@ importers: version: link:../../../repo/typescript-config '@types/node': specifier: ^22.15.29 - version: 22.16.5 + version: 22.18.6 typescript: specifier: ^5.8.3 version: 5.8.3 @@ -114,7 +114,7 @@ importers: version: link:../../../repo/typescript-config '@types/node': specifier: ^22.15.29 - version: 22.16.5 + version: 22.18.6 typescript: specifier: ^5.8.3 version: 5.8.3 @@ -130,13 +130,13 @@ importers: version: link:../../../repo/typescript-config '@types/node': specifier: ^22.15.29 - version: 22.16.5 + version: 22.18.6 typescript: specifier: ^5.8.3 version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.2) + version: 3.2.4(@types/node@22.18.6)(happy-dom@17.6.3) packages/services/identity-instrument: dependencies: @@ -155,13 +155,13 @@ importers: version: link:../../../repo/typescript-config '@types/node': specifier: ^22.15.29 - version: 22.16.5 + version: 22.18.6 typescript: specifier: ^5.8.3 version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.2) + version: 3.2.4(@types/node@22.18.6)(happy-dom@17.6.3) packages/services/indexer: devDependencies: @@ -170,7 +170,7 @@ importers: version: link:../../../repo/typescript-config '@types/node': specifier: ^22.15.29 - version: 22.16.5 + version: 22.18.6 typescript: specifier: ^5.8.3 version: 5.8.3 @@ -182,7 +182,7 @@ importers: version: link:../../../repo/typescript-config '@types/node': specifier: ^22.15.29 - version: 22.16.5 + version: 22.18.6 typescript: specifier: ^5.8.3 version: 5.8.3 @@ -194,7 +194,7 @@ importers: version: link:../../../repo/typescript-config '@types/node': specifier: ^22.15.29 - version: 22.16.5 + version: 22.18.6 typescript: specifier: ^5.8.3 version: 5.8.3 @@ -206,7 +206,7 @@ importers: version: link:../../../repo/typescript-config '@types/node': specifier: ^22.15.29 - version: 22.16.5 + version: 22.18.6 typescript: specifier: ^5.8.3 version: 5.8.3 @@ -218,7 +218,7 @@ importers: version: link:../../../repo/typescript-config '@types/node': specifier: ^22.15.29 - version: 22.16.5 + version: 22.18.6 typescript: specifier: ^5.8.3 version: 5.8.3 @@ -242,29 +242,29 @@ importers: version: 0.7.2(typescript@5.8.3) viem: specifier: ^2.30.6 - version: 2.33.0(typescript@5.8.3) + version: 2.37.8(typescript@5.8.3) devDependencies: '@repo/typescript-config': specifier: workspace:^ version: link:../../../repo/typescript-config '@types/node': specifier: ^22.15.29 - version: 22.16.5 + version: 22.18.6 '@vitest/coverage-v8': specifier: ^3.2.4 - version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.2)) + version: 3.2.4(vitest@3.2.4(@types/node@22.18.6)(happy-dom@17.6.3)) dotenv: specifier: ^16.5.0 version: 16.6.1 fake-indexeddb: specifier: ^6.0.1 - version: 6.0.1 + version: 6.2.2 typescript: specifier: ^5.8.3 version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.2) + version: 3.2.4(@types/node@22.18.6)(happy-dom@17.6.3) packages/wallet/dapp-client: dependencies: @@ -286,25 +286,25 @@ importers: version: link:../../../repo/typescript-config '@types/node': specifier: ^22.15.29 - version: 22.16.5 + version: 22.18.6 '@vitest/coverage-v8': specifier: ^3.2.4 - version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.2)) + version: 3.2.4(vitest@3.2.4(@types/node@22.18.6)(happy-dom@17.6.3)) dotenv: specifier: ^16.5.0 version: 16.6.1 fake-indexeddb: specifier: ^6.0.1 - version: 6.0.1 + version: 6.2.2 happy-dom: - specifier: ^20.0.2 - version: 20.0.2 + specifier: ^17.2.2 + version: 17.6.3 typescript: specifier: ^5.8.3 version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.2) + version: 3.2.4(@types/node@22.18.6)(happy-dom@17.6.3) packages/wallet/primitives: dependencies: @@ -317,13 +317,13 @@ importers: version: link:../../../repo/typescript-config '@vitest/coverage-v8': specifier: ^3.2.4 - version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.2)) + version: 3.2.4(vitest@3.2.4(@types/node@22.18.6)(happy-dom@17.6.3)) typescript: specifier: ^5.8.3 version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.2) + version: 3.2.4(@types/node@22.18.6)(happy-dom@17.6.3) packages/wallet/primitives-cli: dependencies: @@ -345,7 +345,7 @@ importers: version: link:../../../repo/typescript-config '@types/node': specifier: ^22.15.29 - version: 22.16.5 + version: 22.18.6 '@types/yargs': specifier: ^17.0.33 version: 17.0.33 @@ -354,7 +354,7 @@ importers: version: 8.2.2 esbuild: specifier: ^0.25.5 - version: 0.25.8 + version: 0.25.10 nodemon: specifier: ^3.1.10 version: 3.1.10 @@ -397,52 +397,52 @@ importers: version: link:../../../repo/typescript-config '@types/node': specifier: ^22.15.29 - version: 22.16.5 + version: 22.18.6 '@vitest/coverage-v8': specifier: ^3.2.4 - version: 3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.2)) + version: 3.2.4(vitest@3.2.4(@types/node@22.18.6)(happy-dom@17.6.3)) dotenv: specifier: ^16.5.0 version: 16.6.1 fake-indexeddb: specifier: ^6.0.1 - version: 6.0.1 + version: 6.2.2 happy-dom: - specifier: ^20.0.2 - version: 20.0.2 + specifier: ^17.2.2 + version: 17.6.3 typescript: specifier: ^5.8.3 version: 5.8.3 vitest: specifier: ^3.2.1 - version: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.2) + version: 3.2.4(@types/node@22.18.6)(happy-dom@17.6.3) repo/eslint-config: devDependencies: '@eslint/js': specifier: ^9.28.0 - version: 9.31.0 + version: 9.36.0 '@next/eslint-plugin-next': specifier: ^15.3.3 - version: 15.4.2 + version: 15.5.3 eslint: specifier: ^9.28.0 - version: 9.31.0 + version: 9.36.0 eslint-config-prettier: specifier: ^9.1.0 - version: 9.1.2(eslint@9.31.0) + version: 9.1.2(eslint@9.36.0) eslint-plugin-only-warn: specifier: ^1.1.0 version: 1.1.0 eslint-plugin-react: specifier: ^7.37.5 - version: 7.37.5(eslint@9.31.0) + version: 7.37.5(eslint@9.36.0) eslint-plugin-react-hooks: specifier: ^5.2.0 - version: 5.2.0(eslint@9.31.0) + version: 5.2.0(eslint@9.36.0) eslint-plugin-turbo: specifier: ^2.5.4 - version: 2.5.5(eslint@9.31.0)(turbo@2.5.5) + version: 2.5.6(eslint@9.36.0)(turbo@2.5.6) globals: specifier: ^15.15.0 version: 15.15.0 @@ -451,7 +451,7 @@ importers: version: 5.8.3 typescript-eslint: specifier: ^8.33.1 - version: 8.38.0(eslint@9.31.0)(typescript@5.8.3) + version: 8.44.1(eslint@9.36.0)(typescript@5.8.3) repo/typescript-config: {} @@ -459,10 +459,10 @@ importers: dependencies: react: specifier: ^19.1.0 - version: 19.1.0 + version: 19.1.1 react-dom: specifier: ^19.1.0 - version: 19.1.0(react@19.1.0) + version: 19.1.1(react@19.1.1) devDependencies: '@repo/eslint-config': specifier: workspace:* @@ -472,10 +472,10 @@ importers: version: link:../typescript-config '@turbo/gen': specifier: ^1.13.4 - version: 1.13.4(@types/node@20.19.9)(typescript@5.5.4) + version: 1.13.4(@types/node@20.19.17)(typescript@5.5.4) '@types/node': specifier: ^20.17.57 - version: 20.19.9 + version: 20.19.17 '@types/react': specifier: 18.3.0 version: 18.3.0 @@ -491,8 +491,8 @@ packages: '@0xsequence/tee-verifier@0.1.2': resolution: {integrity: sha512-7sKr8/T4newknx6LAukjlRI3siGiGhBnZohz2Z3jX0zb0EBQdKUq0L//A7CPSckHFPxTg/QvQU2v8e9x9GfkDw==} - '@adraffy/ens-normalize@1.11.0': - resolution: {integrity: sha512-/3DDPKHqqIqxUULp8yP4zODUY1i+2xvVWsv8A79xGWdCAG+8sb0hRh0Rk2QyOJUnnbyPUAZYcpBuRe3nS2OIUg==} + '@adraffy/ens-normalize@1.11.1': + resolution: {integrity: sha512-nhCBV3quEgesuf7c7KYfperqSS14T8bYuvJ8PcLJp6znkZpFc0AuW4qBtr8eKVyPPe/8RSr7sglCWPU5eaxwKQ==} '@ampproject/remapping@2.3.0': resolution: {integrity: sha512-30iZtAPgz+LTIYoeivqYo853f02jBYSd5uGnGpkFV0M3xOt9aN73erkgYAmZU43x4VfqcnLxW9Kpg3R5LC4YYw==} @@ -506,29 +506,29 @@ packages: resolution: {integrity: sha512-D2hP9eA+Sqx1kBZgzxZh0y1trbuU+JoDkiEwqhQ36nodYqJwyEIhPSdMNd7lOm/4io72luTPWH20Yda0xOuUow==} engines: {node: '>=6.9.0'} - '@babel/parser@7.28.0': - resolution: {integrity: sha512-jVZGvOxOuNSsuQuLRTh13nU0AogFlw32w/MT+LV6D3sP5WdbW61E77RnkbaO2dUvmPAYrBDJXGn5gGS6tH4j8g==} + '@babel/parser@7.28.4': + resolution: {integrity: sha512-yZbBqeM6TkpP9du/I2pUZnJsRMGGvOuIrhjzC1AwHwW+6he4mni6Bp/m8ijn0iOuZuPI2BfkCoSRunpyjnrQKg==} engines: {node: '>=6.0.0'} hasBin: true - '@babel/runtime-corejs3@7.28.0': - resolution: {integrity: sha512-nlIXnSqLcBij8K8TtkxbBJgfzfvi75V1pAKSM7dUXejGw12vJAqez74jZrHTsJ3Z+Aczc5Q/6JgNjKRMsVU44g==} + '@babel/runtime-corejs3@7.28.4': + resolution: {integrity: sha512-h7iEYiW4HebClDEhtvFObtPmIvrd1SSfpI9EhOeKk4CtIK/ngBWFpuhCzhdmRKtg71ylcue+9I6dv54XYO1epQ==} engines: {node: '>=6.9.0'} - '@babel/runtime@7.27.6': - resolution: {integrity: sha512-vbavdySgbTTrmFE+EsiqUTzlOr5bzlnJtUv9PynGCAKvfQqjIXbvFdumPM/GxMDfyuGMJaJAU6TO4zc1Jf1i8Q==} + '@babel/runtime@7.28.4': + resolution: {integrity: sha512-Q/N6JNWvIvPnLDvjlE1OUBLPQHH6l3CltCEsHIujp45zQUSSh8K+gHnaEX45yAT1nyngnINhvWtzN+Nb9D8RAQ==} engines: {node: '>=6.9.0'} - '@babel/types@7.28.1': - resolution: {integrity: sha512-x0LvFTekgSX+83TI28Y9wYPUfzrnl2aT5+5QLnO6v7mSJYtEEevuDRN0F0uSHRk1G1IWZC43o00Y0xDDrpBGPQ==} + '@babel/types@7.28.4': + resolution: {integrity: sha512-bkFqkLhh3pMBUQQkpVgWDWq/lqzc2678eUyDlTBhRqhCHFguYYGM0Efga7tYk4TogG/3x0EEl66/OQ+WGbWB/Q==} engines: {node: '>=6.9.0'} '@bcoe/v8-coverage@1.0.2': resolution: {integrity: sha512-6zABk/ECA/QYSCQ1NGiVwwbQerUCZ+TQbp64Q3AgmfNvurHH0j8TtXa1qbShXA6qqkpAj4V5W8pP6mLe1mcMqA==} engines: {node: '>=18'} - '@changesets/apply-release-plan@7.0.12': - resolution: {integrity: sha512-EaET7As5CeuhTzvXTQCRZeBUcisoYPDDcXvgTE/2jmmypKp0RC7LxKj/yzqeh/1qFTZI7oDGFcL1PHRuQuketQ==} + '@changesets/apply-release-plan@7.0.13': + resolution: {integrity: sha512-BIW7bofD2yAWoE8H4V40FikC+1nNFEKBisMECccS16W1rt6qqhNTBDmIw5HaqmMgtLNz9e7oiALiEUuKrQ4oHg==} '@changesets/assemble-release-plan@6.0.9': resolution: {integrity: sha512-tPgeeqCHIwNo8sypKlS3gOPmsS3wP0zHt67JDuL20P4QcXiw/O4Hl7oXiuLnP9yg+rXLQ2sScdV1Kkzde61iSQ==} @@ -536,8 +536,8 @@ packages: '@changesets/changelog-git@0.2.1': resolution: {integrity: sha512-x/xEleCFLH28c3bQeQIyeZf8lFXyDFVn1SgcBiR2Tw/r4IAWlk1fzxCEZ6NxQAjF2Nwtczoen3OA2qR+UawQ8Q==} - '@changesets/cli@2.29.5': - resolution: {integrity: sha512-0j0cPq3fgxt2dPdFsg4XvO+6L66RC0pZybT9F4dG5TBrLA3jA/1pNkdTXH9IBBVHkgsKrNKenI3n1mPyPlIydg==} + '@changesets/cli@2.29.7': + resolution: {integrity: sha512-R7RqWoaksyyKXbKXBTbT4REdy22yH81mcFK6sWtqSanxUCbUi9Uf+6aqxZtDQouIqPdem2W56CdxXgsxdq7FLQ==} hasBin: true '@changesets/config@3.1.1': @@ -589,164 +589,164 @@ packages: '@emnapi/runtime@1.5.0': resolution: {integrity: sha512-97/BJ3iXHww3djw6hYIfErCZFee7qCtrneuLa20UXFCOTCfBM2cvQHjWJ2EG0s0MtdNwInarqCTz35i4wWXHsQ==} - '@esbuild/aix-ppc64@0.25.8': - resolution: {integrity: sha512-urAvrUedIqEiFR3FYSLTWQgLu5tb+m0qZw0NBEasUeo6wuqatkMDaRT+1uABiGXEu5vqgPd7FGE1BhsAIy9QVA==} + '@esbuild/aix-ppc64@0.25.10': + resolution: {integrity: sha512-0NFWnA+7l41irNuaSVlLfgNT12caWJVLzp5eAVhZ0z1qpxbockccEt3s+149rE64VUI3Ml2zt8Nv5JVc4QXTsw==} engines: {node: '>=18'} cpu: [ppc64] os: [aix] - '@esbuild/android-arm64@0.25.8': - resolution: {integrity: sha512-OD3p7LYzWpLhZEyATcTSJ67qB5D+20vbtr6vHlHWSQYhKtzUYrETuWThmzFpZtFsBIxRvhO07+UgVA9m0i/O1w==} + '@esbuild/android-arm64@0.25.10': + resolution: {integrity: sha512-LSQa7eDahypv/VO6WKohZGPSJDq5OVOo3UoFR1E4t4Gj1W7zEQMUhI+lo81H+DtB+kP+tDgBp+M4oNCwp6kffg==} engines: {node: '>=18'} cpu: [arm64] os: [android] - '@esbuild/android-arm@0.25.8': - resolution: {integrity: sha512-RONsAvGCz5oWyePVnLdZY/HHwA++nxYWIX1atInlaW6SEkwq6XkP3+cb825EUcRs5Vss/lGh/2YxAb5xqc07Uw==} + '@esbuild/android-arm@0.25.10': + resolution: {integrity: sha512-dQAxF1dW1C3zpeCDc5KqIYuZ1tgAdRXNoZP7vkBIRtKZPYe2xVr/d3SkirklCHudW1B45tGiUlz2pUWDfbDD4w==} engines: {node: '>=18'} cpu: [arm] os: [android] - '@esbuild/android-x64@0.25.8': - resolution: {integrity: sha512-yJAVPklM5+4+9dTeKwHOaA+LQkmrKFX96BM0A/2zQrbS6ENCmxc4OVoBs5dPkCCak2roAD+jKCdnmOqKszPkjA==} + '@esbuild/android-x64@0.25.10': + resolution: {integrity: sha512-MiC9CWdPrfhibcXwr39p9ha1x0lZJ9KaVfvzA0Wxwz9ETX4v5CHfF09bx935nHlhi+MxhA63dKRRQLiVgSUtEg==} engines: {node: '>=18'} cpu: [x64] os: [android] - '@esbuild/darwin-arm64@0.25.8': - resolution: {integrity: sha512-Jw0mxgIaYX6R8ODrdkLLPwBqHTtYHJSmzzd+QeytSugzQ0Vg4c5rDky5VgkoowbZQahCbsv1rT1KW72MPIkevw==} + '@esbuild/darwin-arm64@0.25.10': + resolution: {integrity: sha512-JC74bdXcQEpW9KkV326WpZZjLguSZ3DfS8wrrvPMHgQOIEIG/sPXEN/V8IssoJhbefLRcRqw6RQH2NnpdprtMA==} engines: {node: '>=18'} cpu: [arm64] os: [darwin] - '@esbuild/darwin-x64@0.25.8': - resolution: {integrity: sha512-Vh2gLxxHnuoQ+GjPNvDSDRpoBCUzY4Pu0kBqMBDlK4fuWbKgGtmDIeEC081xi26PPjn+1tct+Bh8FjyLlw1Zlg==} + '@esbuild/darwin-x64@0.25.10': + resolution: {integrity: sha512-tguWg1olF6DGqzws97pKZ8G2L7Ig1vjDmGTwcTuYHbuU6TTjJe5FXbgs5C1BBzHbJ2bo1m3WkQDbWO2PvamRcg==} engines: {node: '>=18'} cpu: [x64] os: [darwin] - '@esbuild/freebsd-arm64@0.25.8': - resolution: {integrity: sha512-YPJ7hDQ9DnNe5vxOm6jaie9QsTwcKedPvizTVlqWG9GBSq+BuyWEDazlGaDTC5NGU4QJd666V0yqCBL2oWKPfA==} + '@esbuild/freebsd-arm64@0.25.10': + resolution: {integrity: sha512-3ZioSQSg1HT2N05YxeJWYR+Libe3bREVSdWhEEgExWaDtyFbbXWb49QgPvFH8u03vUPX10JhJPcz7s9t9+boWg==} engines: {node: '>=18'} cpu: [arm64] os: [freebsd] - '@esbuild/freebsd-x64@0.25.8': - resolution: {integrity: sha512-MmaEXxQRdXNFsRN/KcIimLnSJrk2r5H8v+WVafRWz5xdSVmWLoITZQXcgehI2ZE6gioE6HirAEToM/RvFBeuhw==} + '@esbuild/freebsd-x64@0.25.10': + resolution: {integrity: sha512-LLgJfHJk014Aa4anGDbh8bmI5Lk+QidDmGzuC2D+vP7mv/GeSN+H39zOf7pN5N8p059FcOfs2bVlrRr4SK9WxA==} engines: {node: '>=18'} cpu: [x64] os: [freebsd] - '@esbuild/linux-arm64@0.25.8': - resolution: {integrity: sha512-WIgg00ARWv/uYLU7lsuDK00d/hHSfES5BzdWAdAig1ioV5kaFNrtK8EqGcUBJhYqotlUByUKz5Qo6u8tt7iD/w==} + '@esbuild/linux-arm64@0.25.10': + resolution: {integrity: sha512-5luJWN6YKBsawd5f9i4+c+geYiVEw20FVW5x0v1kEMWNq8UctFjDiMATBxLvmmHA4bf7F6hTRaJgtghFr9iziQ==} engines: {node: '>=18'} cpu: [arm64] os: [linux] - '@esbuild/linux-arm@0.25.8': - resolution: {integrity: sha512-FuzEP9BixzZohl1kLf76KEVOsxtIBFwCaLupVuk4eFVnOZfU+Wsn+x5Ryam7nILV2pkq2TqQM9EZPsOBuMC+kg==} + '@esbuild/linux-arm@0.25.10': + resolution: {integrity: sha512-oR31GtBTFYCqEBALI9r6WxoU/ZofZl962pouZRTEYECvNF/dtXKku8YXcJkhgK/beU+zedXfIzHijSRapJY3vg==} engines: {node: '>=18'} cpu: [arm] os: [linux] - '@esbuild/linux-ia32@0.25.8': - resolution: {integrity: sha512-A1D9YzRX1i+1AJZuFFUMP1E9fMaYY+GnSQil9Tlw05utlE86EKTUA7RjwHDkEitmLYiFsRd9HwKBPEftNdBfjg==} + '@esbuild/linux-ia32@0.25.10': + resolution: {integrity: sha512-NrSCx2Kim3EnnWgS4Txn0QGt0Xipoumb6z6sUtl5bOEZIVKhzfyp/Lyw4C1DIYvzeW/5mWYPBFJU3a/8Yr75DQ==} engines: {node: '>=18'} cpu: [ia32] os: [linux] - '@esbuild/linux-loong64@0.25.8': - resolution: {integrity: sha512-O7k1J/dwHkY1RMVvglFHl1HzutGEFFZ3kNiDMSOyUrB7WcoHGf96Sh+64nTRT26l3GMbCW01Ekh/ThKM5iI7hQ==} + '@esbuild/linux-loong64@0.25.10': + resolution: {integrity: sha512-xoSphrd4AZda8+rUDDfD9J6FUMjrkTz8itpTITM4/xgerAZZcFW7Dv+sun7333IfKxGG8gAq+3NbfEMJfiY+Eg==} engines: {node: '>=18'} cpu: [loong64] os: [linux] - '@esbuild/linux-mips64el@0.25.8': - resolution: {integrity: sha512-uv+dqfRazte3BzfMp8PAQXmdGHQt2oC/y2ovwpTteqrMx2lwaksiFZ/bdkXJC19ttTvNXBuWH53zy/aTj1FgGw==} + '@esbuild/linux-mips64el@0.25.10': + resolution: {integrity: sha512-ab6eiuCwoMmYDyTnyptoKkVS3k8fy/1Uvq7Dj5czXI6DF2GqD2ToInBI0SHOp5/X1BdZ26RKc5+qjQNGRBelRA==} engines: {node: '>=18'} cpu: [mips64el] os: [linux] - '@esbuild/linux-ppc64@0.25.8': - resolution: {integrity: sha512-GyG0KcMi1GBavP5JgAkkstMGyMholMDybAf8wF5A70CALlDM2p/f7YFE7H92eDeH/VBtFJA5MT4nRPDGg4JuzQ==} + '@esbuild/linux-ppc64@0.25.10': + resolution: {integrity: sha512-NLinzzOgZQsGpsTkEbdJTCanwA5/wozN9dSgEl12haXJBzMTpssebuXR42bthOF3z7zXFWH1AmvWunUCkBE4EA==} engines: {node: '>=18'} cpu: [ppc64] os: [linux] - '@esbuild/linux-riscv64@0.25.8': - resolution: {integrity: sha512-rAqDYFv3yzMrq7GIcen3XP7TUEG/4LK86LUPMIz6RT8A6pRIDn0sDcvjudVZBiiTcZCY9y2SgYX2lgK3AF+1eg==} + '@esbuild/linux-riscv64@0.25.10': + resolution: {integrity: sha512-FE557XdZDrtX8NMIeA8LBJX3dC2M8VGXwfrQWU7LB5SLOajfJIxmSdyL/gU1m64Zs9CBKvm4UAuBp5aJ8OgnrA==} engines: {node: '>=18'} cpu: [riscv64] os: [linux] - '@esbuild/linux-s390x@0.25.8': - resolution: {integrity: sha512-Xutvh6VjlbcHpsIIbwY8GVRbwoviWT19tFhgdA7DlenLGC/mbc3lBoVb7jxj9Z+eyGqvcnSyIltYUrkKzWqSvg==} + '@esbuild/linux-s390x@0.25.10': + resolution: {integrity: sha512-3BBSbgzuB9ajLoVZk0mGu+EHlBwkusRmeNYdqmznmMc9zGASFjSsxgkNsqmXugpPk00gJ0JNKh/97nxmjctdew==} engines: {node: '>=18'} cpu: [s390x] os: [linux] - '@esbuild/linux-x64@0.25.8': - resolution: {integrity: sha512-ASFQhgY4ElXh3nDcOMTkQero4b1lgubskNlhIfJrsH5OKZXDpUAKBlNS0Kx81jwOBp+HCeZqmoJuihTv57/jvQ==} + '@esbuild/linux-x64@0.25.10': + resolution: {integrity: sha512-QSX81KhFoZGwenVyPoberggdW1nrQZSvfVDAIUXr3WqLRZGZqWk/P4T8p2SP+de2Sr5HPcvjhcJzEiulKgnxtA==} engines: {node: '>=18'} cpu: [x64] os: [linux] - '@esbuild/netbsd-arm64@0.25.8': - resolution: {integrity: sha512-d1KfruIeohqAi6SA+gENMuObDbEjn22olAR7egqnkCD9DGBG0wsEARotkLgXDu6c4ncgWTZJtN5vcgxzWRMzcw==} + '@esbuild/netbsd-arm64@0.25.10': + resolution: {integrity: sha512-AKQM3gfYfSW8XRk8DdMCzaLUFB15dTrZfnX8WXQoOUpUBQ+NaAFCP1kPS/ykbbGYz7rxn0WS48/81l9hFl3u4A==} engines: {node: '>=18'} cpu: [arm64] os: [netbsd] - '@esbuild/netbsd-x64@0.25.8': - resolution: {integrity: sha512-nVDCkrvx2ua+XQNyfrujIG38+YGyuy2Ru9kKVNyh5jAys6n+l44tTtToqHjino2My8VAY6Lw9H7RI73XFi66Cg==} + '@esbuild/netbsd-x64@0.25.10': + resolution: {integrity: sha512-7RTytDPGU6fek/hWuN9qQpeGPBZFfB4zZgcz2VK2Z5VpdUxEI8JKYsg3JfO0n/Z1E/6l05n0unDCNc4HnhQGig==} engines: {node: '>=18'} cpu: [x64] os: [netbsd] - '@esbuild/openbsd-arm64@0.25.8': - resolution: {integrity: sha512-j8HgrDuSJFAujkivSMSfPQSAa5Fxbvk4rgNAS5i3K+r8s1X0p1uOO2Hl2xNsGFppOeHOLAVgYwDVlmxhq5h+SQ==} + '@esbuild/openbsd-arm64@0.25.10': + resolution: {integrity: sha512-5Se0VM9Wtq797YFn+dLimf2Zx6McttsH2olUBsDml+lm0GOCRVebRWUvDtkY4BWYv/3NgzS8b/UM3jQNh5hYyw==} engines: {node: '>=18'} cpu: [arm64] os: [openbsd] - '@esbuild/openbsd-x64@0.25.8': - resolution: {integrity: sha512-1h8MUAwa0VhNCDp6Af0HToI2TJFAn1uqT9Al6DJVzdIBAd21m/G0Yfc77KDM3uF3T/YaOgQq3qTJHPbTOInaIQ==} + '@esbuild/openbsd-x64@0.25.10': + resolution: {integrity: sha512-XkA4frq1TLj4bEMB+2HnI0+4RnjbuGZfet2gs/LNs5Hc7D89ZQBHQ0gL2ND6Lzu1+QVkjp3x1gIcPKzRNP8bXw==} engines: {node: '>=18'} cpu: [x64] os: [openbsd] - '@esbuild/openharmony-arm64@0.25.8': - resolution: {integrity: sha512-r2nVa5SIK9tSWd0kJd9HCffnDHKchTGikb//9c7HX+r+wHYCpQrSgxhlY6KWV1nFo1l4KFbsMlHk+L6fekLsUg==} + '@esbuild/openharmony-arm64@0.25.10': + resolution: {integrity: sha512-AVTSBhTX8Y/Fz6OmIVBip9tJzZEUcY8WLh7I59+upa5/GPhh2/aM6bvOMQySspnCCHvFi79kMtdJS1w0DXAeag==} engines: {node: '>=18'} cpu: [arm64] os: [openharmony] - '@esbuild/sunos-x64@0.25.8': - resolution: {integrity: sha512-zUlaP2S12YhQ2UzUfcCuMDHQFJyKABkAjvO5YSndMiIkMimPmxA+BYSBikWgsRpvyxuRnow4nS5NPnf9fpv41w==} + '@esbuild/sunos-x64@0.25.10': + resolution: {integrity: sha512-fswk3XT0Uf2pGJmOpDB7yknqhVkJQkAQOcW/ccVOtfx05LkbWOaRAtn5SaqXypeKQra1QaEa841PgrSL9ubSPQ==} engines: {node: '>=18'} cpu: [x64] os: [sunos] - '@esbuild/win32-arm64@0.25.8': - resolution: {integrity: sha512-YEGFFWESlPva8hGL+zvj2z/SaK+pH0SwOM0Nc/d+rVnW7GSTFlLBGzZkuSU9kFIGIo8q9X3ucpZhu8PDN5A2sQ==} + '@esbuild/win32-arm64@0.25.10': + resolution: {integrity: sha512-ah+9b59KDTSfpaCg6VdJoOQvKjI33nTaQr4UluQwW7aEwZQsbMCfTmfEO4VyewOxx4RaDT/xCy9ra2GPWmO7Kw==} engines: {node: '>=18'} cpu: [arm64] os: [win32] - '@esbuild/win32-ia32@0.25.8': - resolution: {integrity: sha512-hiGgGC6KZ5LZz58OL/+qVVoZiuZlUYlYHNAmczOm7bs2oE1XriPFi5ZHHrS8ACpV5EjySrnoCKmcbQMN+ojnHg==} + '@esbuild/win32-ia32@0.25.10': + resolution: {integrity: sha512-QHPDbKkrGO8/cz9LKVnJU22HOi4pxZnZhhA2HYHez5Pz4JeffhDjf85E57Oyco163GnzNCVkZK0b/n4Y0UHcSw==} engines: {node: '>=18'} cpu: [ia32] os: [win32] - '@esbuild/win32-x64@0.25.8': - resolution: {integrity: sha512-cn3Yr7+OaaZq1c+2pe+8yxC8E144SReCQjN6/2ynubzYjvyqZjTXfQJpAcQpsdJq3My7XADANiYGHoFC69pLQw==} + '@esbuild/win32-x64@0.25.10': + resolution: {integrity: sha512-9KpxSVFCu0iK1owoez6aC/s/EdUQLDN3adTxGCqxMVhrPDj6bt5dbrHDXUuq+Bs2vATFBBrQS5vdQ/Ed2P+nbw==} engines: {node: '>=18'} cpu: [x64] os: [win32] - '@eslint-community/eslint-utils@4.7.0': - resolution: {integrity: sha512-dyybb3AcajC7uha6CvhdVRJqaKyn7w2YKqKyAN37NKYgZT36w+iRb0Dymmc5qEJ549c/S31cMMSFd75bteCpCw==} + '@eslint-community/eslint-utils@4.9.0': + resolution: {integrity: sha512-ayVFHdtZ+hsq1t2Dy24wCmGXGe4q9Gu3smhLYALJrr473ZH27MsnSL+LKUlimp4BWJqMDMLmPpx/Q9R3OAlL4g==} engines: {node: ^12.22.0 || ^14.17.0 || >=16.0.0} peerDependencies: eslint: ^6.0.0 || ^7.0.0 || >=8.0.0 @@ -759,46 +759,42 @@ packages: resolution: {integrity: sha512-ENIdc4iLu0d93HeYirvKmrzshzofPw6VkZRKQGe9Nv46ZnWUzcF1xV01dcvEg/1wXUR61OmmlSfyeyO7EvjLxQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/config-helpers@0.3.0': - resolution: {integrity: sha512-ViuymvFmcJi04qdZeDc2whTHryouGcDlaxPqarTD0ZE10ISpxGUVZGZDx4w01upyIynL3iu6IXH2bS1NhclQMw==} + '@eslint/config-helpers@0.3.1': + resolution: {integrity: sha512-xR93k9WhrDYpXHORXpxVL5oHj3Era7wo6k/Wd8/IsQNnZUTzkGS29lyn3nAT05v6ltUuTFVCCYDEGfy2Or/sPA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/core@0.15.1': - resolution: {integrity: sha512-bkOp+iumZCCbt1K1CmWf0R9pM5yKpDv+ZXtvSyQpudrI9kuFLp+bM2WOPXImuD/ceQuaa8f5pj93Y7zyECIGNA==} + '@eslint/core@0.15.2': + resolution: {integrity: sha512-78Md3/Rrxh83gCxoUc0EiciuOHsIITzLy53m3d9UyiW8y9Dj2D29FeETqyKA+BRK76tnTp6RXWb3pCay8Oyomg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/eslintrc@3.3.1': resolution: {integrity: sha512-gtF186CXhIl1p4pJNGZw8Yc6RlshoePRvE0X91oPGb3vZ8pM3qOS9W9NGPat9LziaBV7XrJWGylNQXkGcnM3IQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/js@9.31.0': - resolution: {integrity: sha512-LOm5OVt7D4qiKCqoiPbA7LWmI+tbw1VbTUowBcUMgQSuM6poJufkFkYDcQpo5KfgD39TnNySV26QjOh7VFpSyw==} + '@eslint/js@9.36.0': + resolution: {integrity: sha512-uhCbYtYynH30iZErszX78U+nR3pJU3RHGQ57NXy5QupD4SBVwDeU8TNBy+MjMngc1UyIW9noKqsRqfjQTBU2dw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@eslint/object-schema@2.1.6': resolution: {integrity: sha512-RBMg5FRL0I0gs51M/guSAj5/e14VQ4tpZnQNWwuDT66P14I43ItmPfIZRhO9fUVIPOAQXU47atlywZ/czoqFPA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@eslint/plugin-kit@0.3.4': - resolution: {integrity: sha512-Ul5l+lHEcw3L5+k8POx6r74mxEYKG5kOb6Xpy2gCRW6zweT6TEhAf8vhxGgjhqrd/VO/Dirhsb+1hNpD1ue9hw==} + '@eslint/plugin-kit@0.3.5': + resolution: {integrity: sha512-Z5kJ+wU3oA7MMIqVR9tyZRtjYPr4OC004Q4Rw7pgOKUOKkJfZ3O24nz3WYfGRpMDNmcOi3TwQOmgm7B7Tpii0w==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@humanfs/core@0.19.1': resolution: {integrity: sha512-5DyQ4+1JEUzejeK1JGICcideyfUbGixgS9jNgex5nqkW+cY7WZhxBigmieN5Qnw9ZosSNVC9KQKyb+GUaGyKUA==} engines: {node: '>=18.18.0'} - '@humanfs/node@0.16.6': - resolution: {integrity: sha512-YuI2ZHQL78Q5HbhDiBA1X4LmYdXCKCMQIfw0pw7piHJwyREFebJUvrQN4cMssyES6x+vfUbx1CIpaQUKYdQZOw==} + '@humanfs/node@0.16.7': + resolution: {integrity: sha512-/zUx+yOsIrG4Y43Eh2peDeKCxlRt/gET6aHfaKpuq267qXdYDFViVHfMaLyygZOnl0kGWxFIgsBy8QFuTLUXEQ==} engines: {node: '>=18.18.0'} '@humanwhocodes/module-importer@1.0.1': resolution: {integrity: sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==} engines: {node: '>=12.22'} - '@humanwhocodes/retry@0.3.1': - resolution: {integrity: sha512-JBxkERygn7Bv/GbN5Rv8Ul6LVknS+5Bp6RgDC/O8gEBU/yeH5Ui5C/OlWrTb6qct7LjjfT6Re2NxB0ln0yYybA==} - engines: {node: '>=18.18'} - '@humanwhocodes/retry@0.4.3': resolution: {integrity: sha512-bV0Tgo9K4hfPCek+aMAn81RppFKv2ySDQeMoSZuvTASywNTnVJCArCZE2FWqpvIatKu7VMRLWlR1EazvVhDyhQ==} engines: {node: '>=18.18'} @@ -929,6 +925,15 @@ packages: cpu: [x64] os: [win32] + '@inquirer/external-editor@1.0.2': + resolution: {integrity: sha512-yy9cOoBnx58TlsPrIxauKIFQTiyH+0MK4e97y4sV9ERbI+zDxw7i2hxHLCIEGIE/8PPvDxGhgzIOTSOWcs6/MQ==} + engines: {node: '>=18'} + peerDependencies: + '@types/node': '>=18' + peerDependenciesMeta: + '@types/node': + optional: true + '@isaacs/balanced-match@4.0.1': resolution: {integrity: sha512-yzMTt9lEb8Gv7zRioUilSglI0c0smZ9k5D65677DLWLtWJaXIS3CqcGyUFByYKlnUj6TkjLVs54fBl6+TiGQDQ==} engines: {node: 20 || >=22} @@ -945,18 +950,18 @@ packages: resolution: {integrity: sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA==} engines: {node: '>=8'} - '@jridgewell/gen-mapping@0.3.12': - resolution: {integrity: sha512-OuLGC46TjB5BbN1dH8JULVVZY4WTdkF7tV9Ys6wLL1rubZnCMstOhNHueU5bLCrnRuDhKPDM4g6sw4Bel5Gzqg==} + '@jridgewell/gen-mapping@0.3.13': + resolution: {integrity: sha512-2kkt/7niJ6MgEPxF0bYdQ6etZaA+fQvDcLKckhy1yIQOzaoKjBBjSj63/aLVjYE3qhRt5dvM+uUyfCg6UKCBbA==} '@jridgewell/resolve-uri@3.1.2': resolution: {integrity: sha512-bRISgCIjP20/tbWSPWMEi54QVPRZExkuD9lJL+UIxUKtwVJA8wW1Trb1jMs1RFXo1CBTNZ/5hpC9QvmKWdopKw==} engines: {node: '>=6.0.0'} - '@jridgewell/sourcemap-codec@1.5.4': - resolution: {integrity: sha512-VT2+G1VQs/9oz078bLrYbecdZKs912zQlkelYpuf+SXF+QvZDYJlbx/LSx+meSAwdDFnF8FVXW92AVjjkVmgFw==} + '@jridgewell/sourcemap-codec@1.5.5': + resolution: {integrity: sha512-cYQ9310grqxueWbl+WuIUIaiUaDcj7WOq5fVhEljNVgRfOUhY9fy2zTvfoqWsnebh8Sl70VScFbICvJnLKB0Og==} - '@jridgewell/trace-mapping@0.3.29': - resolution: {integrity: sha512-uw6guiW/gcAGPDhLmd77/6lW8QLeiV5RUTsAX46Db6oLhGaVj4lhnPwb184s1bkc8kdVg/+h988dro8GRDpmYQ==} + '@jridgewell/trace-mapping@0.3.31': + resolution: {integrity: sha512-zzNR+SdQSDJzc8joaeP8QQoCQr8NuYx2dIIytl1QeBEZHJ9uW6hebsrYgbz8hJwUQao3TWCMtmfV8Nu1twOLAw==} '@jridgewell/trace-mapping@0.3.9': resolution: {integrity: sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==} @@ -967,56 +972,56 @@ packages: '@manypkg/get-packages@1.1.3': resolution: {integrity: sha512-fo+QhuU3qE/2TQMQmbVMqaQ6EWbMhi4ABWP+O4AM1NqPBuy0OrApV5LO6BrrgnhtAHS2NH6RrVk9OL181tTi8A==} - '@next/env@15.4.7': - resolution: {integrity: sha512-PrBIpO8oljZGTOe9HH0miix1w5MUiGJ/q83Jge03mHEE0E3pyqzAy2+l5G6aJDbXoobmxPJTVhbCuwlLtjSHwg==} + '@next/env@15.5.3': + resolution: {integrity: sha512-RSEDTRqyihYXygx/OJXwvVupfr9m04+0vH8vyy0HfZ7keRto6VX9BbEk0J2PUk0VGy6YhklJUSrgForov5F9pw==} - '@next/eslint-plugin-next@15.4.2': - resolution: {integrity: sha512-k0rjdWjXBY6tAOty1ckrMETE6Mx66d85NsgcAIdDp7/cXOsTJ93ywmbg3uUcpxX5TUHFEcCWI5mb8nPhwCe9jg==} + '@next/eslint-plugin-next@15.5.3': + resolution: {integrity: sha512-SdhaKdko6dpsSr0DldkESItVrnPYB1NS2NpShCSX5lc7SSQmLZt5Mug6t2xbiuVWEVDLZSuIAoQyYVBYp0dR5g==} - '@next/swc-darwin-arm64@15.4.7': - resolution: {integrity: sha512-2Dkb+VUTp9kHHkSqtws4fDl2Oxms29HcZBwFIda1X7Ztudzy7M6XF9HDS2dq85TmdN47VpuhjE+i6wgnIboVzQ==} + '@next/swc-darwin-arm64@15.5.3': + resolution: {integrity: sha512-nzbHQo69+au9wJkGKTU9lP7PXv0d1J5ljFpvb+LnEomLtSbJkbZyEs6sbF3plQmiOB2l9OBtN2tNSvCH1nQ9Jg==} engines: {node: '>= 10'} cpu: [arm64] os: [darwin] - '@next/swc-darwin-x64@15.4.7': - resolution: {integrity: sha512-qaMnEozKdWezlmh1OGDVFueFv2z9lWTcLvt7e39QA3YOvZHNpN2rLs/IQLwZaUiw2jSvxW07LxMCWtOqsWFNQg==} + '@next/swc-darwin-x64@15.5.3': + resolution: {integrity: sha512-w83w4SkOOhekJOcA5HBvHyGzgV1W/XvOfpkrxIse4uPWhYTTRwtGEM4v/jiXwNSJvfRvah0H8/uTLBKRXlef8g==} engines: {node: '>= 10'} cpu: [x64] os: [darwin] - '@next/swc-linux-arm64-gnu@15.4.7': - resolution: {integrity: sha512-ny7lODPE7a15Qms8LZiN9wjNWIeI+iAZOFDOnv2pcHStncUr7cr9lD5XF81mdhrBXLUP9yT9RzlmSWKIazWoDw==} + '@next/swc-linux-arm64-gnu@15.5.3': + resolution: {integrity: sha512-+m7pfIs0/yvgVu26ieaKrifV8C8yiLe7jVp9SpcIzg7XmyyNE7toC1fy5IOQozmr6kWl/JONC51osih2RyoXRw==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@next/swc-linux-arm64-musl@15.4.7': - resolution: {integrity: sha512-4SaCjlFR/2hGJqZLLWycccy1t+wBrE/vyJWnYaZJhUVHccpGLG5q0C+Xkw4iRzUIkE+/dr90MJRUym3s1+vO8A==} + '@next/swc-linux-arm64-musl@15.5.3': + resolution: {integrity: sha512-u3PEIzuguSenoZviZJahNLgCexGFhso5mxWCrrIMdvpZn6lkME5vc/ADZG8UUk5K1uWRy4hqSFECrON6UKQBbQ==} engines: {node: '>= 10'} cpu: [arm64] os: [linux] - '@next/swc-linux-x64-gnu@15.4.7': - resolution: {integrity: sha512-2uNXjxvONyRidg00VwvlTYDwC9EgCGNzPAPYbttIATZRxmOZ3hllk/YYESzHZb65eyZfBR5g9xgCZjRAl9YYGg==} + '@next/swc-linux-x64-gnu@15.5.3': + resolution: {integrity: sha512-lDtOOScYDZxI2BENN9m0pfVPJDSuUkAD1YXSvlJF0DKwZt0WlA7T7o3wrcEr4Q+iHYGzEaVuZcsIbCps4K27sA==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@next/swc-linux-x64-musl@15.4.7': - resolution: {integrity: sha512-ceNbPjsFgLscYNGKSu4I6LYaadq2B8tcK116nVuInpHHdAWLWSwVK6CHNvCi0wVS9+TTArIFKJGsEyVD1H+4Kg==} + '@next/swc-linux-x64-musl@15.5.3': + resolution: {integrity: sha512-9vWVUnsx9PrY2NwdVRJ4dUURAQ8Su0sLRPqcCCxtX5zIQUBES12eRVHq6b70bbfaVaxIDGJN2afHui0eDm+cLg==} engines: {node: '>= 10'} cpu: [x64] os: [linux] - '@next/swc-win32-arm64-msvc@15.4.7': - resolution: {integrity: sha512-pZyxmY1iHlZJ04LUL7Css8bNvsYAMYOY9JRwFA3HZgpaNKsJSowD09Vg2R9734GxAcLJc2KDQHSCR91uD6/AAw==} + '@next/swc-win32-arm64-msvc@15.5.3': + resolution: {integrity: sha512-1CU20FZzY9LFQigRi6jM45oJMU3KziA5/sSG+dXeVaTm661snQP6xu3ykGxxwU5sLG3sh14teO/IOEPVsQMRfA==} engines: {node: '>= 10'} cpu: [arm64] os: [win32] - '@next/swc-win32-x64-msvc@15.4.7': - resolution: {integrity: sha512-HjuwPJ7BeRzgl3KrjKqD2iDng0eQIpIReyhpF5r4yeAHFwWRuAhfW92rWv/r3qeQHEwHsLRzFDvMqRjyM5DI6A==} + '@next/swc-win32-x64-msvc@15.5.3': + resolution: {integrity: sha512-JMoLAq3n3y5tKXPQwCK5c+6tmwkuFDa2XAxz8Wm4+IVthdBZdZGh+lmiLUHg9f9IDwIQpUjp+ysd6OkYTyZRZw==} engines: {node: '>= 10'} cpu: [x64] os: [win32] @@ -1025,12 +1030,12 @@ packages: resolution: {integrity: sha512-2I0gnIVPtfnMw9ee9h1dJG7tp81+8Ob3OJb3Mv37rx5L40/b0i7djjCVvGOVqc9AEIQyvyu1i6ypKdFw8R8gQw==} engines: {node: ^14.21.3 || >=16} - '@noble/curves@1.9.2': - resolution: {integrity: sha512-HxngEd2XUcg9xi20JkwlLCtYwfoFw4JGkuZpT+WlsPD4gB/cxkvTD8fSsoAnphGZhFdZYKeQIPCuFlWPm1uE0g==} + '@noble/curves@1.9.1': + resolution: {integrity: sha512-k11yZxZg+t+gWvBbIswW0yoJlu8cHOC7dhunwOzoWH/mXGBiYyR4YY6hAEK/3EUs4UpB8la1RfdRpeGsFHkWsA==} engines: {node: ^14.21.3 || >=16} - '@noble/curves@1.9.4': - resolution: {integrity: sha512-2bKONnuM53lINoDrSmK8qP8W271ms7pygDhZt4SiLOoLwBtoHqeCFi6RG42V8zd3mLHuJFhU/Bmaqo4nX0/kBw==} + '@noble/curves@1.9.7': + resolution: {integrity: sha512-gbKGcRUYIjA3/zCCNaWDciTMFI0dCkvou3TL8Zmy5Nc7sJ47a0jtOeZoTaMxkuqRo9cRhjOdZJXegxYE5FN/xw==} engines: {node: ^14.21.3 || >=16} '@noble/hashes@1.8.0': @@ -1053,103 +1058,113 @@ packages: resolution: {integrity: sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==} engines: {node: '>=14'} - '@rollup/rollup-android-arm-eabi@4.45.1': - resolution: {integrity: sha512-NEySIFvMY0ZQO+utJkgoMiCAjMrGvnbDLHvcmlA33UXJpYBCvlBEbMMtV837uCkS+plG2umfhn0T5mMAxGrlRA==} + '@rollup/rollup-android-arm-eabi@4.52.2': + resolution: {integrity: sha512-o3pcKzJgSGt4d74lSZ+OCnHwkKBeAbFDmbEm5gg70eA8VkyCuC/zV9TwBnmw6VjDlRdF4Pshfb+WE9E6XY1PoQ==} cpu: [arm] os: [android] - '@rollup/rollup-android-arm64@4.45.1': - resolution: {integrity: sha512-ujQ+sMXJkg4LRJaYreaVx7Z/VMgBBd89wGS4qMrdtfUFZ+TSY5Rs9asgjitLwzeIbhwdEhyj29zhst3L1lKsRQ==} + '@rollup/rollup-android-arm64@4.52.2': + resolution: {integrity: sha512-cqFSWO5tX2vhC9hJTK8WAiPIm4Q8q/cU8j2HQA0L3E1uXvBYbOZMhE2oFL8n2pKB5sOCHY6bBuHaRwG7TkfJyw==} cpu: [arm64] os: [android] - '@rollup/rollup-darwin-arm64@4.45.1': - resolution: {integrity: sha512-FSncqHvqTm3lC6Y13xncsdOYfxGSLnP+73k815EfNmpewPs+EyM49haPS105Rh4aF5mJKywk9X0ogzLXZzN9lA==} + '@rollup/rollup-darwin-arm64@4.52.2': + resolution: {integrity: sha512-vngduywkkv8Fkh3wIZf5nFPXzWsNsVu1kvtLETWxTFf/5opZmflgVSeLgdHR56RQh71xhPhWoOkEBvbehwTlVA==} cpu: [arm64] os: [darwin] - '@rollup/rollup-darwin-x64@4.45.1': - resolution: {integrity: sha512-2/vVn/husP5XI7Fsf/RlhDaQJ7x9zjvC81anIVbr4b/f0xtSmXQTFcGIQ/B1cXIYM6h2nAhJkdMHTnD7OtQ9Og==} + '@rollup/rollup-darwin-x64@4.52.2': + resolution: {integrity: sha512-h11KikYrUCYTrDj6h939hhMNlqU2fo/X4NB0OZcys3fya49o1hmFaczAiJWVAFgrM1NCP6RrO7lQKeVYSKBPSQ==} cpu: [x64] os: [darwin] - '@rollup/rollup-freebsd-arm64@4.45.1': - resolution: {integrity: sha512-4g1kaDxQItZsrkVTdYQ0bxu4ZIQ32cotoQbmsAnW1jAE4XCMbcBPDirX5fyUzdhVCKgPcrwWuucI8yrVRBw2+g==} + '@rollup/rollup-freebsd-arm64@4.52.2': + resolution: {integrity: sha512-/eg4CI61ZUkLXxMHyVlmlGrSQZ34xqWlZNW43IAU4RmdzWEx0mQJ2mN/Cx4IHLVZFL6UBGAh+/GXhgvGb+nVxw==} cpu: [arm64] os: [freebsd] - '@rollup/rollup-freebsd-x64@4.45.1': - resolution: {integrity: sha512-L/6JsfiL74i3uK1Ti2ZFSNsp5NMiM4/kbbGEcOCps99aZx3g8SJMO1/9Y0n/qKlWZfn6sScf98lEOUe2mBvW9A==} + '@rollup/rollup-freebsd-x64@4.52.2': + resolution: {integrity: sha512-QOWgFH5X9+p+S1NAfOqc0z8qEpJIoUHf7OWjNUGOeW18Mx22lAUOiA9b6r2/vpzLdfxi/f+VWsYjUOMCcYh0Ng==} cpu: [x64] os: [freebsd] - '@rollup/rollup-linux-arm-gnueabihf@4.45.1': - resolution: {integrity: sha512-RkdOTu2jK7brlu+ZwjMIZfdV2sSYHK2qR08FUWcIoqJC2eywHbXr0L8T/pONFwkGukQqERDheaGTeedG+rra6Q==} + '@rollup/rollup-linux-arm-gnueabihf@4.52.2': + resolution: {integrity: sha512-kDWSPafToDd8LcBYd1t5jw7bD5Ojcu12S3uT372e5HKPzQt532vW+rGFFOaiR0opxePyUkHrwz8iWYEyH1IIQA==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm-musleabihf@4.45.1': - resolution: {integrity: sha512-3kJ8pgfBt6CIIr1o+HQA7OZ9mp/zDk3ctekGl9qn/pRBgrRgfwiffaUmqioUGN9hv0OHv2gxmvdKOkARCtRb8Q==} + '@rollup/rollup-linux-arm-musleabihf@4.52.2': + resolution: {integrity: sha512-gKm7Mk9wCv6/rkzwCiUC4KnevYhlf8ztBrDRT9g/u//1fZLapSRc+eDZj2Eu2wpJ+0RzUKgtNijnVIB4ZxyL+w==} cpu: [arm] os: [linux] - '@rollup/rollup-linux-arm64-gnu@4.45.1': - resolution: {integrity: sha512-k3dOKCfIVixWjG7OXTCOmDfJj3vbdhN0QYEqB+OuGArOChek22hn7Uy5A/gTDNAcCy5v2YcXRJ/Qcnm4/ma1xw==} + '@rollup/rollup-linux-arm64-gnu@4.52.2': + resolution: {integrity: sha512-66lA8vnj5mB/rtDNwPgrrKUOtCLVQypkyDa2gMfOefXK6rcZAxKLO9Fy3GkW8VkPnENv9hBkNOFfGLf6rNKGUg==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-arm64-musl@4.45.1': - resolution: {integrity: sha512-PmI1vxQetnM58ZmDFl9/Uk2lpBBby6B6rF4muJc65uZbxCs0EA7hhKCk2PKlmZKuyVSHAyIw3+/SiuMLxKxWog==} + '@rollup/rollup-linux-arm64-musl@4.52.2': + resolution: {integrity: sha512-s+OPucLNdJHvuZHuIz2WwncJ+SfWHFEmlC5nKMUgAelUeBUnlB4wt7rXWiyG4Zn07uY2Dd+SGyVa9oyLkVGOjA==} cpu: [arm64] os: [linux] - '@rollup/rollup-linux-loongarch64-gnu@4.45.1': - resolution: {integrity: sha512-9UmI0VzGmNJ28ibHW2GpE2nF0PBQqsyiS4kcJ5vK+wuwGnV5RlqdczVocDSUfGX/Na7/XINRVoUgJyFIgipoRg==} + '@rollup/rollup-linux-loong64-gnu@4.52.2': + resolution: {integrity: sha512-8wTRM3+gVMDLLDdaT6tKmOE3lJyRy9NpJUS/ZRWmLCmOPIJhVyXwjBo+XbrrwtV33Em1/eCTd5TuGJm4+DmYjw==} cpu: [loong64] os: [linux] - '@rollup/rollup-linux-powerpc64le-gnu@4.45.1': - resolution: {integrity: sha512-7nR2KY8oEOUTD3pBAxIBBbZr0U7U+R9HDTPNy+5nVVHDXI4ikYniH1oxQz9VoB5PbBU1CZuDGHkLJkd3zLMWsg==} + '@rollup/rollup-linux-ppc64-gnu@4.52.2': + resolution: {integrity: sha512-6yqEfgJ1anIeuP2P/zhtfBlDpXUb80t8DpbYwXQ3bQd95JMvUaqiX+fKqYqUwZXqdJDd8xdilNtsHM2N0cFm6A==} cpu: [ppc64] os: [linux] - '@rollup/rollup-linux-riscv64-gnu@4.45.1': - resolution: {integrity: sha512-nlcl3jgUultKROfZijKjRQLUu9Ma0PeNv/VFHkZiKbXTBQXhpytS8CIj5/NfBeECZtY2FJQubm6ltIxm/ftxpw==} + '@rollup/rollup-linux-riscv64-gnu@4.52.2': + resolution: {integrity: sha512-sshYUiYVSEI2B6dp4jMncwxbrUqRdNApF2c3bhtLAU0qA8Lrri0p0NauOsTWh3yCCCDyBOjESHMExonp7Nzc0w==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-riscv64-musl@4.45.1': - resolution: {integrity: sha512-HJV65KLS51rW0VY6rvZkiieiBnurSzpzore1bMKAhunQiECPuxsROvyeaot/tcK3A3aGnI+qTHqisrpSgQrpgA==} + '@rollup/rollup-linux-riscv64-musl@4.52.2': + resolution: {integrity: sha512-duBLgd+3pqC4MMwBrKkFxaZerUxZcYApQVC5SdbF5/e/589GwVvlRUnyqMFbM8iUSb1BaoX/3fRL7hB9m2Pj8Q==} cpu: [riscv64] os: [linux] - '@rollup/rollup-linux-s390x-gnu@4.45.1': - resolution: {integrity: sha512-NITBOCv3Qqc6hhwFt7jLV78VEO/il4YcBzoMGGNxznLgRQf43VQDae0aAzKiBeEPIxnDrACiMgbqjuihx08OOw==} + '@rollup/rollup-linux-s390x-gnu@4.52.2': + resolution: {integrity: sha512-tzhYJJidDUVGMgVyE+PmxENPHlvvqm1KILjjZhB8/xHYqAGeizh3GBGf9u6WdJpZrz1aCpIIHG0LgJgH9rVjHQ==} cpu: [s390x] os: [linux] - '@rollup/rollup-linux-x64-gnu@4.45.1': - resolution: {integrity: sha512-+E/lYl6qu1zqgPEnTrs4WysQtvc/Sh4fC2nByfFExqgYrqkKWp1tWIbe+ELhixnenSpBbLXNi6vbEEJ8M7fiHw==} + '@rollup/rollup-linux-x64-gnu@4.52.2': + resolution: {integrity: sha512-opH8GSUuVcCSSyHHcl5hELrmnk4waZoVpgn/4FDao9iyE4WpQhyWJ5ryl5M3ocp4qkRuHfyXnGqg8M9oKCEKRA==} cpu: [x64] os: [linux] - '@rollup/rollup-linux-x64-musl@4.45.1': - resolution: {integrity: sha512-a6WIAp89p3kpNoYStITT9RbTbTnqarU7D8N8F2CV+4Cl9fwCOZraLVuVFvlpsW0SbIiYtEnhCZBPLoNdRkjQFw==} + '@rollup/rollup-linux-x64-musl@4.52.2': + resolution: {integrity: sha512-LSeBHnGli1pPKVJ79ZVJgeZWWZXkEe/5o8kcn23M8eMKCUANejchJbF/JqzM4RRjOJfNRhKJk8FuqL1GKjF5oQ==} cpu: [x64] os: [linux] - '@rollup/rollup-win32-arm64-msvc@4.45.1': - resolution: {integrity: sha512-T5Bi/NS3fQiJeYdGvRpTAP5P02kqSOpqiopwhj0uaXB6nzs5JVi2XMJb18JUSKhCOX8+UE1UKQufyD6Or48dJg==} + '@rollup/rollup-openharmony-arm64@4.52.2': + resolution: {integrity: sha512-uPj7MQ6/s+/GOpolavm6BPo+6CbhbKYyZHUDvZ/SmJM7pfDBgdGisFX3bY/CBDMg2ZO4utfhlApkSfZ92yXw7Q==} + cpu: [arm64] + os: [openharmony] + + '@rollup/rollup-win32-arm64-msvc@4.52.2': + resolution: {integrity: sha512-Z9MUCrSgIaUeeHAiNkm3cQyst2UhzjPraR3gYYfOjAuZI7tcFRTOD+4cHLPoS/3qinchth+V56vtqz1Tv+6KPA==} cpu: [arm64] os: [win32] - '@rollup/rollup-win32-ia32-msvc@4.45.1': - resolution: {integrity: sha512-lxV2Pako3ujjuUe9jiU3/s7KSrDfH6IgTSQOnDWr9aJ92YsFd7EurmClK0ly/t8dzMkDtd04g60WX6yl0sGfdw==} + '@rollup/rollup-win32-ia32-msvc@4.52.2': + resolution: {integrity: sha512-+GnYBmpjldD3XQd+HMejo+0gJGwYIOfFeoBQv32xF/RUIvccUz20/V6Otdv+57NE70D5pa8W/jVGDoGq0oON4A==} cpu: [ia32] os: [win32] - '@rollup/rollup-win32-x64-msvc@4.45.1': - resolution: {integrity: sha512-M/fKi4sasCdM8i0aWJjCSFm2qEnYRR8AMLG2kxp6wD13+tMGA4Z1tVAuHkNRjud5SW2EM3naLuK35w9twvf6aA==} + '@rollup/rollup-win32-x64-gnu@4.52.2': + resolution: {integrity: sha512-ApXFKluSB6kDQkAqZOKXBjiaqdF1BlKi+/eqnYe9Ee7U2K3pUDKsIyr8EYm/QDHTJIM+4X+lI0gJc3TTRhd+dA==} + cpu: [x64] + os: [win32] + + '@rollup/rollup-win32-x64-msvc@4.52.2': + resolution: {integrity: sha512-ARz+Bs8kY6FtitYM96PqPEVvPXqEZmPZsSkXvyX19YzDqkCaIlhCieLLMI5hxO9SRZ2XtCtm8wxhy0iJ2jxNfw==} cpu: [x64] os: [win32] @@ -1213,14 +1228,11 @@ packages: '@types/node@12.20.55': resolution: {integrity: sha512-J8xLz7q2OFulZ2cyGTLE1TbbZcjpno7FaN6zdJNrgAdrJ+DZzh/uFR6YrTb4C+nXakvud8Q4+rbhoIWlYQbUFQ==} - '@types/node@20.19.21': - resolution: {integrity: sha512-CsGG2P3I5y48RPMfprQGfy4JPRZ6csfC3ltBZSRItG3ngggmNY/qs2uZKp4p9VbrpqNNSMzUZNFZKzgOGnd/VA==} + '@types/node@20.19.17': + resolution: {integrity: sha512-gfehUI8N1z92kygssiuWvLiwcbOB3IRktR6hTDgJlXMYh5OvkPSRmgfoBUmfZt+vhwJtX7v1Yw4KvvAf7c5QKQ==} - '@types/node@20.19.9': - resolution: {integrity: sha512-cuVNgarYWZqxRJDQHEB58GEONhOK79QVR/qYx4S7kcUObQvUwvFnYxJuuHUKm2aieN9X3yZB4LZsuYNU1Qphsw==} - - '@types/node@22.16.5': - resolution: {integrity: sha512-bJFoMATwIGaxxx8VJPeM8TonI8t579oRvgAuT8zFugJsJZgzqv0Fu8Mhp68iecjzG7cnN3mO2dJQ5uUM2EFrgQ==} + '@types/node@22.18.6': + resolution: {integrity: sha512-r8uszLPpeIWbNKtvWRt/DbVi5zbqZyj1PTmhRMqBMvDnaz1QpmSKujUtJLrqGZeoM8v72MfYggDceY4K1itzWQ==} '@types/prop-types@15.7.15': resolution: {integrity: sha512-F6bEyamV9jKGAFBEmlQnesRPGOQqS2+Uwi0Em15xenOxHaf2hv6L8YCVn3rPdPJOiJfPiCnLIRyvwVaqMY3MIw==} @@ -1243,72 +1255,69 @@ packages: '@types/tinycolor2@1.4.6': resolution: {integrity: sha512-iEN8J0BoMnsWBqjVbWH/c0G0Hh7O21lpR2/+PrvAVgWdzL7eexIFm4JN/Wn10PTcmNdtS6U67r499mlWMXOxNw==} - '@types/whatwg-mimetype@3.0.2': - resolution: {integrity: sha512-c2AKvDT8ToxLIOUlN51gTiHXflsfIFisS4pO7pDPoKouJCESkhZnEy623gwP9laCy5lnLDAw1vAzu2vM2YLOrA==} - '@types/yargs-parser@21.0.3': resolution: {integrity: sha512-I4q9QU9MQv4oEOz4tAHJtNz1cwuLxn2F3xcc2iV5WdqLPpUnj30aUuxt1mAxYTG+oe8CZMV/+6rU4S4gRDzqtQ==} '@types/yargs@17.0.33': resolution: {integrity: sha512-WpxBCKWPLr4xSsHgz511rFJAM+wS28w2zEO1QDNY5zM/S8ok70NNfztH0xwhqKyaK0OHCbN98LDAZuy1ctxDkA==} - '@typescript-eslint/eslint-plugin@8.38.0': - resolution: {integrity: sha512-CPoznzpuAnIOl4nhj4tRr4gIPj5AfKgkiJmGQDaq+fQnRJTYlcBjbX3wbciGmpoPf8DREufuPRe1tNMZnGdanA==} + '@typescript-eslint/eslint-plugin@8.44.1': + resolution: {integrity: sha512-molgphGqOBT7t4YKCSkbasmu1tb1MgrZ2szGzHbclF7PNmOkSTQVHy+2jXOSnxvR3+Xe1yySHFZoqMpz3TfQsw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - '@typescript-eslint/parser': ^8.38.0 + '@typescript-eslint/parser': ^8.44.1 eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/parser@8.38.0': - resolution: {integrity: sha512-Zhy8HCvBUEfBECzIl1PKqF4p11+d0aUJS1GeUiuqK9WmOug8YCmC4h4bjyBvMyAMI9sbRczmrYL5lKg/YMbrcQ==} + '@typescript-eslint/parser@8.44.1': + resolution: {integrity: sha512-EHrrEsyhOhxYt8MTg4zTF+DJMuNBzWwgvvOYNj/zm1vnaD/IC5zCXFehZv94Piqa2cRFfXrTFxIvO95L7Qc/cw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/project-service@8.38.0': - resolution: {integrity: sha512-dbK7Jvqcb8c9QfH01YB6pORpqX1mn5gDZc9n63Ak/+jD67oWXn3Gs0M6vddAN+eDXBCS5EmNWzbSxsn9SzFWWg==} + '@typescript-eslint/project-service@8.44.1': + resolution: {integrity: sha512-ycSa60eGg8GWAkVsKV4E6Nz33h+HjTXbsDT4FILyL8Obk5/mx4tbvCNsLf9zret3ipSumAOG89UcCs/KRaKYrA==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/scope-manager@8.38.0': - resolution: {integrity: sha512-WJw3AVlFFcdT9Ri1xs/lg8LwDqgekWXWhH3iAF+1ZM+QPd7oxQ6jvtW/JPwzAScxitILUIFs0/AnQ/UWHzbATQ==} + '@typescript-eslint/scope-manager@8.44.1': + resolution: {integrity: sha512-NdhWHgmynpSvyhchGLXh+w12OMT308Gm25JoRIyTZqEbApiBiQHD/8xgb6LqCWCFcxFtWwaVdFsLPQI3jvhywg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/tsconfig-utils@8.38.0': - resolution: {integrity: sha512-Lum9RtSE3EroKk/bYns+sPOodqb2Fv50XOl/gMviMKNvanETUuUcC9ObRbzrJ4VSd2JalPqgSAavwrPiPvnAiQ==} + '@typescript-eslint/tsconfig-utils@8.44.1': + resolution: {integrity: sha512-B5OyACouEjuIvof3o86lRMvyDsFwZm+4fBOqFHccIctYgBjqR3qT39FBYGN87khcgf0ExpdCBeGKpKRhSFTjKQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/type-utils@8.38.0': - resolution: {integrity: sha512-c7jAvGEZVf0ao2z+nnz8BUaHZD09Agbh+DY7qvBQqLiz8uJzRgVPj5YvOh8I8uEiH8oIUGIfHzMwUcGVco/SJg==} + '@typescript-eslint/type-utils@8.44.1': + resolution: {integrity: sha512-KdEerZqHWXsRNKjF9NYswNISnFzXfXNDfPxoTh7tqohU/PRIbwTmsjGK6V9/RTYWau7NZvfo52lgVk+sJh0K3g==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/types@8.38.0': - resolution: {integrity: sha512-wzkUfX3plUqij4YwWaJyqhiPE5UCRVlFpKn1oCRn2O1bJ592XxWJj8ROQ3JD5MYXLORW84063z3tZTb/cs4Tyw==} + '@typescript-eslint/types@8.44.1': + resolution: {integrity: sha512-Lk7uj7y9uQUOEguiDIDLYLJOrYHQa7oBiURYVFqIpGxclAFQ78f6VUOM8lI2XEuNOKNB7XuvM2+2cMXAoq4ALQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - '@typescript-eslint/typescript-estree@8.38.0': - resolution: {integrity: sha512-fooELKcAKzxux6fA6pxOflpNS0jc+nOQEEOipXFNjSlBS6fqrJOVY/whSn70SScHrcJ2LDsxWrneFoWYSVfqhQ==} + '@typescript-eslint/typescript-estree@8.44.1': + resolution: {integrity: sha512-qnQJ+mVa7szevdEyvfItbO5Vo+GfZ4/GZWWDRRLjrxYPkhM+6zYB2vRYwCsoJLzqFCdZT4mEqyJoyzkunsZ96A==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/utils@8.38.0': - resolution: {integrity: sha512-hHcMA86Hgt+ijJlrD8fX0j1j8w4C92zue/8LOPAFioIno+W0+L7KqE8QZKCcPGc/92Vs9x36w/4MPTJhqXdyvg==} + '@typescript-eslint/utils@8.44.1': + resolution: {integrity: sha512-DpX5Fp6edTlocMCwA+mHY8Mra+pPjRZ0TfHkXI8QFelIKcbADQz1LUPNtzOFUriBB2UYqw4Pi9+xV4w9ZczHFg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' - '@typescript-eslint/visitor-keys@8.38.0': - resolution: {integrity: sha512-pWrTcoFNWuwHlA9CvlfSsGWs14JxfN1TH25zM5L7o0pRLhsoZkDnTsXfQRJBEWJoV5DL0jf+Z+sxiud+K0mq1g==} + '@typescript-eslint/visitor-keys@8.44.1': + resolution: {integrity: sha512-576+u0QD+Jp3tZzvfRfxon0EA2lzcDt3lhUbsC6Lgzy9x2VR4E+JUiNyGHi5T8vk0TV+fpJ5GLG1JsJuWCaKhw==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} '@vitest/coverage-v8@3.2.4': @@ -1349,11 +1358,22 @@ packages: '@vitest/utils@3.2.4': resolution: {integrity: sha512-fB2V0JFrQSMsCo9HiSq3Ezpdv4iYaXRG1Sx8edX3MwxfyNn83mKiGzOcH+Fkxt4MHxr3y42fQi1oeAInqgX2QA==} - abitype@1.0.8: - resolution: {integrity: sha512-ZeiI6h3GnW06uYDLx0etQtX/p8E24UaHHBj57RSjK7YBFe7iuVn07EDpOeP451D06sF27VOz9JJPlIKJmXgkEg==} + abitype@1.1.0: + resolution: {integrity: sha512-6Vh4HcRxNMLA0puzPjM5GBgT4aAcFGKZzSgAXvuZ27shJP6NEpielTuqbBmZILR5/xd0PizkBGy5hReKz9jl5A==} + peerDependencies: + typescript: '>=5.0.4' + zod: ^3.22.0 || ^4.0.0 + peerDependenciesMeta: + typescript: + optional: true + zod: + optional: true + + abitype@1.1.1: + resolution: {integrity: sha512-Loe5/6tAgsBukY95eGaPSDmQHIjRZYQq8PB1MpsNccDIK8WiV+Uw6WzaIXipvaxTEL2yEB0OpEaQv3gs8pkS9Q==} peerDependencies: typescript: '>=5.0.4' - zod: ^3 >=3.22.0 + zod: ^3.22.0 || ^4.0.0 peerDependenciesMeta: typescript: optional: true @@ -1397,8 +1417,8 @@ packages: resolution: {integrity: sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==} engines: {node: '>=8'} - ansi-regex@6.1.0: - resolution: {integrity: sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==} + ansi-regex@6.2.2: + resolution: {integrity: sha512-Bq3SmSpyFHaWjPk8If9yc6svM8c56dB5BAtW4Qbw5jHTwwXXcTLoRMkpDJp6VL0XzlWaCHTXrkFURMYmD0sLqg==} engines: {node: '>=12'} ansi-styles@3.2.1: @@ -1409,8 +1429,8 @@ packages: resolution: {integrity: sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==} engines: {node: '>=8'} - ansi-styles@6.2.1: - resolution: {integrity: sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==} + ansi-styles@6.2.3: + resolution: {integrity: sha512-4Dj6M28JB+oAH8kFkTLUo+a2jwOFkuqb3yucU0CANcRRUbxS0cP0nZYCGjcc3BNXwRIsUVmDGgzawme7zvJHvg==} engines: {node: '>=12'} anymatch@3.1.3: @@ -1470,8 +1490,8 @@ packages: resolution: {integrity: sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==} engines: {node: '>=4'} - ast-v8-to-istanbul@0.3.3: - resolution: {integrity: sha512-MuXMrSLVVoA6sYN/6Hke18vMzrT4TZNbZIj/hvh0fnYFpO+/kFXcLIaiPwXXWaQUPg4yJD8fj+lfJ7/1EBconw==} + ast-v8-to-istanbul@0.3.5: + resolution: {integrity: sha512-9SdXjNheSiE8bALAQCQQuT6fgQaoxJh7IRYrRGZ8/9nv8WhJeC1aXAwN8TbaOssGOukUvyvnkgD9+Yuykvl1aA==} async-function@1.0.0: resolution: {integrity: sha512-hsU18Ae8CDTR6Kgu9DYf0EbCr/a5iGL0rytQDobUcdpYOKokk8LEjVphnXkDkgpi0wYVsqrXuP0bZxJaTqdgoA==} @@ -1549,8 +1569,8 @@ packages: resolution: {integrity: sha512-3Cco8XQhi27DogSp9Ri6LYNZLi/TBY/JVnDe+mj06NkBjW/ZYOtekaEU4wZ4xcRMNrFkDv8KNtOAqHyDfz3lYg==} engines: {node: '>=18.7'} - chai@5.2.1: - resolution: {integrity: sha512-5nFxhUrX0PqtyogoYOA8IPswy5sZFTOsBFl/9bNsmDLgsxYTzSZQJDPppDnZPTQbzSEm0hqGjWPzRemQCYbD6A==} + chai@5.3.3: + resolution: {integrity: sha512-4zNhdJD/iOjSH0A05ea+Ke6MU5mmpQcbQsSOkgdaUMJ9zTlDTD/GYlwohmIE2u0gaxHYiVHEn1Fw9mZ/ktJWgw==} engines: {node: '>=18'} chalk@2.4.2: @@ -1571,6 +1591,9 @@ packages: chardet@0.7.0: resolution: {integrity: sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==} + chardet@2.1.0: + resolution: {integrity: sha512-bNFETTG/pM5ryzQ9Ad0lJOTa6HWD/YsScAR3EnCPZRPlQh77JocYktSHOUHelyhm8IARL+o4c4F1bP5KVOjiRA==} + check-error@2.1.1: resolution: {integrity: sha512-OAlb+T7V4Op9OwdkjmguYRqncdlx5JiofwOAUkmTF+jNdHwzTaTs4sRAGpzLF3oOz5xAyDGrPgeIDFQmDOTiJw==} engines: {node: '>= 16'} @@ -1638,8 +1661,8 @@ packages: constant-case@2.0.0: resolution: {integrity: sha512-eS0N9WwmjTqrOmR3o83F5vW8Z+9R1HnVz3xmzT2PMFug9ly+Au/fxRWlEBSb6LcZwspSsEn9Xs1uw9YgzAg1EQ==} - core-js-pure@3.44.0: - resolution: {integrity: sha512-gvMQAGB4dfVUxpYD0k3Fq8J+n5bB6Ytl15lqlZrOIXFzxOhtPaObfkQGHtMRdyjIf7z2IeNULwi1jEwyS+ltKQ==} + core-js-pure@3.45.1: + resolution: {integrity: sha512-OHnWFKgTUshEU8MK+lOs1H8kC8GkTi9Z1tvNkxrCcw9wl3MJIO7q2ld77wjWn4/xuGrVu2X+nME1iIIPBSdyEQ==} create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} @@ -1671,8 +1694,8 @@ packages: resolution: {integrity: sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==} engines: {node: '>=0.11'} - debug@4.4.1: - resolution: {integrity: sha512-KcKCqiftBJcZr++7ykoDIEwSa3XWowTfNPo92BYxjXiyYEVrUQh2aLyhxBCwww+heortUFxEJYcRzosstTEBYQ==} + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} engines: {node: '>=6.0'} peerDependencies: supports-color: '*' @@ -1793,8 +1816,8 @@ packages: resolution: {integrity: sha512-w+5mJ3GuFL+NjVtJlvydShqE1eN3h3PbI7/5LAsYJP/2qtuMXjfL2LpHSRqo4b4eSF5K/DH1JXKUAHSB2UW50g==} engines: {node: '>= 0.4'} - esbuild@0.25.8: - resolution: {integrity: sha512-vVC0USHGtMi8+R4Kz8rt6JhEWLxsv9Rnu/lGYbPR8u47B+DCBksq9JarW0zOO7bs37hyOK1l2/oqtbciutL5+Q==} + esbuild@0.25.10: + resolution: {integrity: sha512-9RiGKvCwaqxO2owP61uQ4BgNborAQskMR6QusfWzQqv7AZOg5oGehdY2pRJMTKuwxd1IDBP4rSbI5lHzU7SMsQ==} engines: {node: '>=18'} hasBin: true @@ -1837,8 +1860,8 @@ packages: peerDependencies: eslint: ^3 || ^4 || ^5 || ^6 || ^7 || ^8 || ^9.7 - eslint-plugin-turbo@2.5.5: - resolution: {integrity: sha512-IlN65X6W7rgK88u5xl1xC+7FIGKA7eyaca0yxZQ9CBNV6keAaqtjZQLw8ZfXdv7T+MzTLYkYOeOHAv8yCRUx4Q==} + eslint-plugin-turbo@2.5.6: + resolution: {integrity: sha512-KUDE23aP2JV8zbfZ4TeM1HpAXzMM/AYG/bJam7P4AalUxas8Pd/lS/6R3p4uX91qJcH1LwL4h0ED48nDe8KorQ==} peerDependencies: eslint: '>6.6.0' turbo: '>2.0.0' @@ -1855,8 +1878,8 @@ packages: resolution: {integrity: sha512-Uhdk5sfqcee/9H/rCOJikYz67o0a2Tw2hGRPOG2Y1R2dg7brRe1uG0yaNQDHu+TO/uQPF/5eCapvYSmHUjt7JQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} - eslint@9.31.0: - resolution: {integrity: sha512-QldCVh/ztyKJJZLr4jXNUByx3gR+TDYZCRXEktiZoUR3PGy4qCmSbkxcIle8GEwGpb5JBZazlaJ/CxLidXdEbQ==} + eslint@9.36.0: + resolution: {integrity: sha512-hB4FIzXovouYzwzECDcUkJ4OcfOEkXTv2zRY6B9bkwjx/cprAq0uvm1nl7zvQ0/TsUk0zQiN4uPfJpB9m+rPMQ==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} hasBin: true peerDependencies: @@ -1911,8 +1934,8 @@ packages: resolution: {integrity: sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==} engines: {node: '>=4'} - fake-indexeddb@6.0.1: - resolution: {integrity: sha512-He2AjQGHe46svIFq5+L2Nx/eHDTI1oKgoevBP+TthnjymXiKkeJQ3+ITeWey99Y5+2OaPFbI1qEsx/5RsGtWnQ==} + fake-indexeddb@6.2.2: + resolution: {integrity: sha512-SGbf7fzjeHz3+12NO1dYigcYn4ivviaeULV5yY5rdGihBvvgwMds4r4UBbNIUMwkze57KTDm32rq3j1Az8mzEw==} engines: {node: '>=18'} fast-deep-equal@3.1.3: @@ -1935,8 +1958,9 @@ packages: fastq@1.19.1: resolution: {integrity: sha512-GwLTyxkCXjXbxqIhTsMI2Nui8huMPtnxg7krajPJAjnEG/iiOS7i+zCtWGZR9G0NBKbXKh6X9m9UIsYX/N6vvQ==} - fdir@6.4.6: - resolution: {integrity: sha512-hiFoqpyZcfNm1yc4u8oWCf9A2c4D3QjCrks3zmoVKVxpQRzmPNar1hUJcBG2RQHvEVGDN+Jm81ZheVLAQMK6+w==} + fdir@6.5.0: + resolution: {integrity: sha512-tIbYtZbucOs0BRGqPJkshJUYdL+SDH7dVM8gjy+ERp3WAUjLEFJE+02kanyHtwjWOnwrKYBiwAmM0p4kLJAnXg==} + engines: {node: '>=12.0.0'} peerDependencies: picomatch: ^3 || ^4 peerDependenciesMeta: @@ -2092,8 +2116,8 @@ packages: engines: {node: '>=0.4.7'} hasBin: true - happy-dom@20.0.2: - resolution: {integrity: sha512-pYOyu624+6HDbY+qkjILpQGnpvZOusItCk+rvF5/V+6NkcgTKnbOldpIy22tBnxoaLtlM9nXgoqAcW29/B7CIw==} + happy-dom@17.6.3: + resolution: {integrity: sha512-UVIHeVhxmxedbWPCfgS55Jg2rDfwf2BCKeylcPSqazLz5w3Kri7Q4xdBJubsr/+VUzFLh0VjIvh13RaDA2/Xug==} engines: {node: '>=20.0.0'} has-bigints@1.1.0: @@ -2153,6 +2177,10 @@ packages: resolution: {integrity: sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==} engines: {node: '>=0.10.0'} + iconv-lite@0.7.0: + resolution: {integrity: sha512-cf6L2Ds3h57VVmkZe+Pn+5APsT7FpqJtEhhieDCvrE2MK5Qk9MyffgQyuxQTm6BChfeZNtcOLHp9IcWRVcIcBQ==} + engines: {node: '>=0.10.0'} + idb@7.1.1: resolution: {integrity: sha512-gchesWBzyvGHRO9W8tzUWFDycow5gwjvFKfyV9FF32Y7F50yZMp7mP+T2mJIWFx49zicqyC4uefHM17o6xKIVQ==} @@ -2196,16 +2224,16 @@ packages: resolution: {integrity: sha512-JG3eIAj5V9CwcGvuOmoo6LB9kbAYT8HXffUl6memuszlwDC/qvFAJw49XJ5NROSFNPxp3iQg1GqkFhaY/CR0IA==} engines: {node: '>=8.0.0'} - inquirer@8.2.6: - resolution: {integrity: sha512-M1WuAmb7pn9zdFRtQYk26ZBoY043Sse0wVDdk4Bppr+JOXyQYybdtvK+l9wUibhtjdjvtoiNy8tk+EgsYIUqKg==} + inquirer@8.2.7: + resolution: {integrity: sha512-UjOaSel/iddGZJ5xP/Eixh6dY1XghiBw4XK13rCCIJcJfyhhoul/7KhLLUGtebEj6GDYM6Vnx/mVsjx2L/mFIA==} engines: {node: '>=12.0.0'} internal-slot@1.1.0: resolution: {integrity: sha512-4gd7VpWNQNB4UKKCFFVcp1AVv+FMOgs9NKzjHKusc8jTMhd5eL1NqQqOpE0KzMds804/yHlglp3uxgluOqAPLw==} engines: {node: '>= 0.4'} - ip-address@9.0.5: - resolution: {integrity: sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==} + ip-address@10.0.1: + resolution: {integrity: sha512-NWv9YLW4PoW2B7xtzaS3NCot75m6nK7Icdv0o3lfMceJVRfSoQwqD4wEH5rLwoKJwUiZ/rfpiVBhnaF0FK4HoA==} engines: {node: '>= 12'} is-array-buffer@3.0.5: @@ -2377,8 +2405,8 @@ packages: resolution: {integrity: sha512-yg2d+Em4KizZC5niWhQaIomgf5WlL4vOOjZ5xGCmF8SnPE/mDWWXgvRExdcpCgh9lLRRa1/fSYp2ymmbJ1pI+A==} engines: {node: '>=10'} - istanbul-reports@3.1.7: - resolution: {integrity: sha512-BewmUXImeuRk2YY0PVbxgKAysvhRPUQE0h5QRM++nVWyubKGV0l8qQ5op8+B2DOmwSe63Jivj0BjkPQVf8fP5g==} + istanbul-reports@3.2.0: + resolution: {integrity: sha512-HGYWWS/ehqTV3xN10i23tkPkpH46MLCIMFNCaaKNavAXTF1RkqxawEPtnjnGZ6XKSInBKkiOA5BKS+aZiY3AvA==} engines: {node: '>=8'} iterator.prototype@1.1.5: @@ -2406,9 +2434,6 @@ packages: resolution: {integrity: sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==} hasBin: true - jsbn@1.1.0: - resolution: {integrity: sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==} - json-buffer@3.0.1: resolution: {integrity: sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==} @@ -2424,8 +2449,8 @@ packages: jsonfile@4.0.0: resolution: {integrity: sha512-m6F1R3z8jjlf2imQHS2Qez5sjKWQzbuuhuJ/FKYFRZvPE3PuHcSMVZzfsLhGVOkfd20obL5SWEBew5ShlquNxg==} - jsonfile@6.1.0: - resolution: {integrity: sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==} + jsonfile@6.2.0: + resolution: {integrity: sha512-FGuPw30AdOIUTRMC2OMRtQV+jkVj2cfPqSeWXv1NEAJ1qZ5zb1X6z1mFhbfOB/iy3ssJCD+3KuZ8r8C3uVFlAg==} jsx-ast-utils@3.3.5: resolution: {integrity: sha512-ZZow9HBI5O6EPgSJLUb8n2NKgmVWTwCvHGwFuJlMjvLFqlGG6pjirPhtdsseaLZjSibD8eegzmYpUZwoIlj2cQ==} @@ -2438,58 +2463,58 @@ packages: keyv@4.5.4: resolution: {integrity: sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw==} - lefthook-darwin-arm64@1.12.2: - resolution: {integrity: sha512-fTxeI9tEskrHjc3QyEO+AG7impBXY2Ed8V5aiRc3fw9POfYtVh9b5jRx90fjk2+ld5hf+Z1DsyyLq/vOHDFskQ==} + lefthook-darwin-arm64@1.13.3: + resolution: {integrity: sha512-PtCWi3yOgN50//73GH4xVeTd0WHCQWeHjHezGpPRzllavKo0z/dW4K5dj4ppn1E2nflanHEArrBfKEWHT5Gx0Q==} cpu: [arm64] os: [darwin] - lefthook-darwin-x64@1.12.2: - resolution: {integrity: sha512-T1dCDKAAfdHgYZ8qtrS02SJSHoR52RFcrGArFNll9Mu4ZSV19Sp8BO+kTwDUOcLYdcPGNaqOp9PkRBQGZWQC7g==} + lefthook-darwin-x64@1.13.3: + resolution: {integrity: sha512-lFSNWEpAP7iS260UtNPiwczq05CYBNAZpzBPE582++MB09aejdveVFDx/Hmur6xobInCCVgwzWTVW92LGIWTXQ==} cpu: [x64] os: [darwin] - lefthook-freebsd-arm64@1.12.2: - resolution: {integrity: sha512-2n9z7Q4BKeMBoB9cuEdv0UBQH82Z4GgBQpCrfjCtyzpDnYQwrH8Tkrlnlko4qPh9MM6nLLGIYMKsA5nltzo8Cg==} + lefthook-freebsd-arm64@1.13.3: + resolution: {integrity: sha512-LZ3Sj0utBxzsJWmyhHB2nBaFsI4cf/FivE0GtCGcGQZFxizgctqfuruL5oWuA9XOuRpyTICcTO01bS5/ZTMorQ==} cpu: [arm64] os: [freebsd] - lefthook-freebsd-x64@1.12.2: - resolution: {integrity: sha512-1hNY/irY+/3kjRzKoJYxG+m3BYI8QxopJUK1PQnknGo1Wy5u302SdX+tR7pnpz6JM5chrNw4ozSbKKOvdZ5VEw==} + lefthook-freebsd-x64@1.13.3: + resolution: {integrity: sha512-TXXrEpRdV86hK3j69jEaZON16kLnrXR/G1UdA2tfeeFN3t2ZejrEyAoSnbW0IrR8dK4pDx6gceTVSWJN2Pk10g==} cpu: [x64] os: [freebsd] - lefthook-linux-arm64@1.12.2: - resolution: {integrity: sha512-1W4swYIVRkxq/LFTuuK4oVpd6NtTKY4E3VY2Uq2JDkIOJV46+8qGBF+C/QA9K3O9chLffgN7c+i+NhIuGiZ/Vw==} + lefthook-linux-arm64@1.13.3: + resolution: {integrity: sha512-iSMQB5G0HlUPimvHx+zGCD0VWhwA+Tc6MpHk9TYzhuQh3FP2ksyxadjSpMn/Q+iwfq6XoEhHyX69esksVI/awg==} cpu: [arm64] os: [linux] - lefthook-linux-x64@1.12.2: - resolution: {integrity: sha512-J6VGuMfhq5iCsg1Pv7xULbuXC63gP5LaikT0PhkyBNMi3HQneZFDJ8k/sp0Ue9HkQv6QfWIo3/FgB9gz38MCFw==} + lefthook-linux-x64@1.13.3: + resolution: {integrity: sha512-3nsNNTW0TnrbZNdKJiuCcy6pRpzX+kfTqsKL7R/JlAqfSWQroMhvIVrcSPazbZAs32U0nDMQ05tkd/lEEKvjTw==} cpu: [x64] os: [linux] - lefthook-openbsd-arm64@1.12.2: - resolution: {integrity: sha512-wncDRW3ml24DaOyH22KINumjvCohswbQqbxyH2GORRCykSnE859cTjOrRIchTKBIARF7PSeGPUtS7EK0+oDbaw==} + lefthook-openbsd-arm64@1.13.3: + resolution: {integrity: sha512-g6pw2l17CF8wTUz+25vXK3xd22DyYp+qEM9acKdT/Hh/OooyOx/fyh134Hghp6cAoeo1ix9w16hmKbQq5QlYZQ==} cpu: [arm64] os: [openbsd] - lefthook-openbsd-x64@1.12.2: - resolution: {integrity: sha512-2jDOkCHNnc/oK/vR62hAf3vZb1EQ6Md2GjIlgZ/V7A3ztOsM8QZ5IxwYN3D1UOIR5ZnwMBy7PtmTJC/HJrig5w==} + lefthook-openbsd-x64@1.13.3: + resolution: {integrity: sha512-rWyErYH3G8A0/o+hzkpc+5ZuiKoanoGS4qjVS6y/Jh5LWqmkVjtEptdkcuYdNEVt9ShNHIys0F7uNCg0V+rZlA==} cpu: [x64] os: [openbsd] - lefthook-windows-arm64@1.12.2: - resolution: {integrity: sha512-ZMH/q6UNSidhHEG/1QoqIl1n4yPTBWuVmKx5bONtKHicoz4QCQ+QEiNjKsG5OO4C62nfyHGThmweCzZVUQECJw==} + lefthook-windows-arm64@1.13.3: + resolution: {integrity: sha512-xRB+DcvRSdG7+QydDvhJMm//THUpFqOcyfDgy4TuP3B0DhakuOn1K/95kNf9qHj15uLHIK2ceWGqVew2FRXP4w==} cpu: [arm64] os: [win32] - lefthook-windows-x64@1.12.2: - resolution: {integrity: sha512-TqT2jIPcTQ9uwaw+v+DTmvnUHM/p7bbsSrPoPX+fRXSGLzFjyiY+12C9dObSwfCQq6rT70xqQJ9AmftJQsa5/Q==} + lefthook-windows-x64@1.13.3: + resolution: {integrity: sha512-Or256NzKEg4hjblN8La7cnfqj+POfsiEknUdhcp+4GFUXzE6lhXadEyXKf3X9qZPpV4QZjgfobtdAEgTFUCj6Q==} cpu: [x64] os: [win32] - lefthook@1.12.2: - resolution: {integrity: sha512-2CeTu5NcmoT9YnqsHTq/TF36MlqlzHzhivGx3DrXHwcff4TdvrkIwUTA56huM3Nlo5ODAF/0hlPzaKLmNHCBnQ==} + lefthook@1.13.3: + resolution: {integrity: sha512-suxG98kRI/a4T2gkdh97o14aTaNr1cKdA2olNaNLz16dy4/J1PahYPm54sqmm/Zhoi1DCV43SUNz6T6bh0Y7Ng==} hasBin: true levn@0.4.1: @@ -2529,8 +2554,8 @@ packages: resolution: {integrity: sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==} hasBin: true - loupe@3.1.4: - resolution: {integrity: sha512-wJzkKwJrheKtknCOKNEtDK4iqg/MxmZheEMtSTYvnzRdEYaZzmgH976nenp8WdJRdx5Vc1X/9MO0Oszl6ezeXg==} + loupe@3.2.1: + resolution: {integrity: sha512-CdzqowRJCeLU72bHvWqwRBBlLcMEtIvGrlvef74kMnV2AolS9Y8xUv1I0U/MNAWMhBlKIoyuEgoJ0t/bbwHbLQ==} lower-case-first@1.0.2: resolution: {integrity: sha512-UuxaYakO7XeONbKrZf5FEgkantPf5DUqDayzP5VXZrtRPdH86s4kN47I8B3TW10S4QKiE3ziHNf3kRN//okHjA==} @@ -2541,16 +2566,16 @@ packages: lru-cache@10.4.3: resolution: {integrity: sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==} - lru-cache@11.1.0: - resolution: {integrity: sha512-QIXZUBJUx+2zHUdQujWejBkcD9+cs94tLn0+YL8UrCh+D5sCXZ4c7LaEH48pNwRY3MLDgqUFyhlCyjJPf1WP0A==} + lru-cache@11.2.1: + resolution: {integrity: sha512-r8LA6i4LP4EeWOhqBaZZjDWwehd1xUJPCJd9Sv300H0ZmcUER4+JPh7bqqZeqs1o5pgtgvXm+d9UGrB5zZGDiQ==} engines: {node: 20 || >=22} lru-cache@7.18.3: resolution: {integrity: sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==} engines: {node: '>=12'} - magic-string@0.30.17: - resolution: {integrity: sha512-sNPKHvyjVf7gyjwS4xGTaW/mCnF8wnjtifKBEhxfZ7E/S8tQ0rssrwGNn6q8JH/ohItJfSQp9mBtQYuTlH5QnA==} + magic-string@0.30.19: + resolution: {integrity: sha512-2N21sPY9Ws53PZvsEpVtNuSW+ScYbQdp4b9qUaL+9QkHUrGFKo56Lg9Emg5s9V/qrtNBmiR01sYhUOwu3H+VOw==} magicast@0.3.5: resolution: {integrity: sha512-L0WhttDl+2BOsybvEOLK7fW3UA0OQ0IQ2d6Zl2x/a6vVRs3bAY0ECOSHHeL5jD+SbOpOCUEi0y1DgHEn9Qn1AQ==} @@ -2636,8 +2661,8 @@ packages: resolution: {integrity: sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==} engines: {node: '>= 0.4.0'} - next@15.4.7: - resolution: {integrity: sha512-OcqRugwF7n7mC8OSYjvsZhhG1AYSvulor1EIUsIkbbEbf1qoE5EbH36Swj8WhF4cHqmDgkiam3z1c1W0J1Wifg==} + next@15.5.3: + resolution: {integrity: sha512-r/liNAx16SQj4D+XH/oI1dlpv9tdKJ6cONYPwwcCC46f2NjpaRWY+EKCzULfgQYV6YKXjHBchff2IZBSlZmJNw==} engines: {node: ^18.18.0 || ^19.8.0 || >= 20.0.0} hasBin: true peerDependencies: @@ -2743,8 +2768,8 @@ packages: typescript: optional: true - ox@0.8.1: - resolution: {integrity: sha512-e+z5epnzV+Zuz91YYujecW8cF01mzmrUtWotJ0oEPym/G82uccs7q0WDHTYL3eiONbTUEvcZrptAKLgTBD3u2A==} + ox@0.9.6: + resolution: {integrity: sha512-8SuCbHPvv2eZLYXrNmC0EC12rdzXQLdhnOMlHDW2wiCPLxBrOOJwX5L5E61by+UjTPOryqQiRSnjIKCI+GykKg==} peerDependencies: typescript: '>=5.4.0' peerDependenciesMeta: @@ -2913,8 +2938,8 @@ packages: resolution: {integrity: sha512-pMpnA0qRdFp32b1sJl1wOJNxZLQ2cbQx+k6tjNtZ8CpvVhNqEPRgivZ2WOUev2YMajecdH7ctUPDvEe87nariQ==} engines: {node: '>=6.0.0'} - quansync@0.2.10: - resolution: {integrity: sha512-t41VRkMYbkHyCYmOvx/6URnN80H7k4X0lLdBMGsz+maAwrJQYB1djpV6vHrQIBE0WBSGqhtEHrK9U3DWWH8v7A==} + quansync@0.2.11: + resolution: {integrity: sha512-AifT7QEbW9Nri4tAwR5M/uzpBuqfZf+zwaEM/QkzEjj7NBuFD2rBuy0K3dE+8wltbezDV7JMA0WfnCPYRSYbXA==} queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -2923,16 +2948,16 @@ packages: resolution: {integrity: sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==} hasBin: true - react-dom@19.1.0: - resolution: {integrity: sha512-Xs1hdnE+DyKgeHJeJznQmYMIBG3TKIHJJT95Q58nHLSrElKlGQqDTR2HQ9fx5CN/Gk6Vh/kupBTDLU11/nDk/g==} + react-dom@19.1.1: + resolution: {integrity: sha512-Dlq/5LAZgF0Gaz6yiqZCf6VCcZs1ghAJyrsu84Q/GT0gV+mCxbfmKNoGRKBYMJ8IEdGPqu49YWXD02GCknEDkw==} peerDependencies: - react: ^19.1.0 + react: ^19.1.1 react-is@16.13.1: resolution: {integrity: sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==} - react@19.1.0: - resolution: {integrity: sha512-FS+XFBNvn3GTAWq26joslQgWNoFu08F4kl0J4CgdNKADkdSGXQyTCnKteIAJy96Br6YbpEU1LSzV5dYtjMkMDg==} + react@19.1.1: + resolution: {integrity: sha512-w8nqGImo45dmMIfljjMwOGtbmC/mk4CMYhWIicdSflH91J9TyCyczcPFXJzrZ/ZXcgGRFeP6BU0BEJTw6tZdfQ==} engines: {node: '>=0.10.0'} read-yaml-file@1.1.0: @@ -3001,8 +3026,8 @@ packages: engines: {node: 20 || >=22} hasBin: true - rollup@4.45.1: - resolution: {integrity: sha512-4iya7Jb76fVpQyLoiVpzUrsjQ12r3dM7fIVz+4NwoYvZOShknRmiv+iu9CClZml5ZLGb0XMcYLutK6w9tgxHDw==} + rollup@4.52.2: + resolution: {integrity: sha512-I25/2QgoROE1vYV+NQ1En9T9UFB9Cmfm2CJ83zZOlaDpvz29wGQSZXWKw7MiNXau7wYgB/T9fVIdIuEQ+KbiiA==} engines: {node: '>=18.0.0', npm: '>=8.0.0'} hasBin: true @@ -3126,8 +3151,8 @@ packages: resolution: {integrity: sha512-HehCEsotFqbPW9sJ8WVYB6UbmIMv7kUUORIF2Nncq4VQvBfNBLibW9YZR5dlYCSUhwcD628pRllm7n+E+YTzJw==} engines: {node: '>= 14'} - socks@2.8.6: - resolution: {integrity: sha512-pe4Y2yzru68lXCb38aAqRf5gvN8YdjP1lok5o0J7BOHljkyCGKVz7H3vpVIXKD27rj2giOJ7DwVyk/GWrPHDWA==} + socks@2.8.7: + resolution: {integrity: sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==} engines: {node: '>= 10.0.0', npm: '>= 3.0.0'} source-map-js@1.2.1: @@ -3147,9 +3172,6 @@ packages: sprintf-js@1.0.3: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} - sprintf-js@1.1.3: - resolution: {integrity: sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==} - stackback@0.0.2: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} @@ -3194,8 +3216,8 @@ packages: resolution: {integrity: sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==} engines: {node: '>=8'} - strip-ansi@7.1.0: - resolution: {integrity: sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==} + strip-ansi@7.1.2: + resolution: {integrity: sha512-gmBGslpoQJtgnMAvOVqGZpEz9dyoKTCzy2nfz/n8aIFhN/jCE/rCmcxabB6jOOHV+0WNnylOxaxBQPSvcWklhA==} engines: {node: '>=12'} strip-bom@3.0.0: @@ -3269,8 +3291,8 @@ packages: tinyexec@0.3.2: resolution: {integrity: sha512-KQQR9yN7R5+OSwaK0XQoj22pwHoTlgYqmUscPYoknOoWCWfj/5/ABTMRi69FrKU5ffPVh5QcFikpWJI/P1ocHA==} - tinyglobby@0.2.14: - resolution: {integrity: sha512-tX5e7OM1HnYr2+a2C/4V0htOcSQcoSTH9KgJnVvNm5zm/cyEWKJ7j7YutsH9CxMdtOkkLFy2AHrMci9IM8IPZQ==} + tinyglobby@0.2.15: + resolution: {integrity: sha512-j2Zq4NyQYG5XMST4cbs02Ak8iJUdxRM0XI5QyxXuZOzKOINmWurp3smXu3y5wDcJrptwpSjgXHzIQxR0omXljQ==} engines: {node: '>=12.0.0'} tinygradient@1.1.5: @@ -3284,8 +3306,8 @@ packages: resolution: {integrity: sha512-op4nsTR47R6p0vMUUoYl/a+ljLFVtlfaXkLQmqfLR1qHma1h/ysYk4hEXZ880bf2CYgTskvTa/e196Vd5dDQXw==} engines: {node: '>=14.0.0'} - tinyspy@4.0.3: - resolution: {integrity: sha512-t2T/WLB2WRgZ9EpE4jgPJ9w+i66UZfDc8wHh0xrwiRNN+UwH98GIJkTeZqX9rg0i0ptwzqW+uYeIF0T4F8LR7A==} + tinyspy@4.0.4: + resolution: {integrity: sha512-azl+t0z7pw/z958Gy9svOTuzqIk6xq+NSheJzn5MMWtWTFywIacg2wUlzKFGtt3cthx0r2SxMK0yzJOR0IES7Q==} engines: {node: '>=14.0.0'} title-case@2.1.1: @@ -3333,38 +3355,38 @@ packages: tslib@2.8.1: resolution: {integrity: sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==} - turbo-darwin-64@2.5.5: - resolution: {integrity: sha512-RYnTz49u4F5tDD2SUwwtlynABNBAfbyT2uU/brJcyh5k6lDLyNfYKdKmqd3K2ls4AaiALWrFKVSBsiVwhdFNzQ==} + turbo-darwin-64@2.5.6: + resolution: {integrity: sha512-3C1xEdo4aFwMJAPvtlPqz1Sw/+cddWIOmsalHFMrsqqydcptwBfu26WW2cDm3u93bUzMbBJ8k3zNKFqxJ9ei2A==} cpu: [x64] os: [darwin] - turbo-darwin-arm64@2.5.5: - resolution: {integrity: sha512-Tk+ZeSNdBobZiMw9aFypQt0DlLsWSFWu1ymqsAdJLuPoAH05qCfYtRxE1pJuYHcJB5pqI+/HOxtJoQ40726Btw==} + turbo-darwin-arm64@2.5.6: + resolution: {integrity: sha512-LyiG+rD7JhMfYwLqB6k3LZQtYn8CQQUePbpA8mF/hMLPAekXdJo1g0bUPw8RZLwQXUIU/3BU7tXENvhSGz5DPA==} cpu: [arm64] os: [darwin] - turbo-linux-64@2.5.5: - resolution: {integrity: sha512-2/XvMGykD7VgsvWesZZYIIVXMlgBcQy+ZAryjugoTcvJv8TZzSU/B1nShcA7IAjZ0q7OsZ45uP2cOb8EgKT30w==} + turbo-linux-64@2.5.6: + resolution: {integrity: sha512-GOcUTT0xiT/pSnHL4YD6Yr3HreUhU8pUcGqcI2ksIF9b2/r/kRHwGFcsHgpG3+vtZF/kwsP0MV8FTlTObxsYIA==} cpu: [x64] os: [linux] - turbo-linux-arm64@2.5.5: - resolution: {integrity: sha512-DW+8CjCjybu0d7TFm9dovTTVg1VRnlkZ1rceO4zqsaLrit3DgHnN4to4uwyuf9s2V/BwS3IYcRy+HG9BL596Iw==} + turbo-linux-arm64@2.5.6: + resolution: {integrity: sha512-10Tm15bruJEA3m0V7iZcnQBpObGBcOgUcO+sY7/2vk1bweW34LMhkWi8svjV9iDF68+KJDThnYDlYE/bc7/zzQ==} cpu: [arm64] os: [linux] - turbo-windows-64@2.5.5: - resolution: {integrity: sha512-q5p1BOy8ChtSZfULuF1BhFMYIx6bevXu4fJ+TE/hyNfyHJIfjl90Z6jWdqAlyaFLmn99X/uw+7d6T/Y/dr5JwQ==} + turbo-windows-64@2.5.6: + resolution: {integrity: sha512-FyRsVpgaj76It0ludwZsNN40ytHN+17E4PFJyeliBEbxrGTc5BexlXVpufB7XlAaoaZVxbS6KT8RofLfDRyEPg==} cpu: [x64] os: [win32] - turbo-windows-arm64@2.5.5: - resolution: {integrity: sha512-AXbF1KmpHUq3PKQwddMGoKMYhHsy5t1YBQO8HZ04HLMR0rWv9adYlQ8kaeQJTko1Ay1anOBFTqaxfVOOsu7+1Q==} + turbo-windows-arm64@2.5.6: + resolution: {integrity: sha512-j/tWu8cMeQ7HPpKri6jvKtyXg9K1gRyhdK4tKrrchH8GNHscPX/F71zax58yYtLRWTiK04zNzPcUJuoS0+v/+Q==} cpu: [arm64] os: [win32] - turbo@2.5.5: - resolution: {integrity: sha512-eZ7wI6KjtT1eBqCnh2JPXWNUAxtoxxfi6VdBdZFvil0ychCOTxbm7YLRBi1JSt7U3c+u3CLxpoPxLdvr/Npr3A==} + turbo@2.5.6: + resolution: {integrity: sha512-gxToHmi9oTBNB05UjUsrWf0OyN5ZXtD0apOarC1KIx232Vp3WimRNy3810QzeNSgyD5rsaIDXlxlbnOzlouo+w==} hasBin: true type-check@0.4.0: @@ -3391,12 +3413,12 @@ packages: resolution: {integrity: sha512-3KS2b+kL7fsuk/eJZ7EQdnEmQoaho/r6KUef7hxvltNA5DR8NAUM+8wJMbJyZ4G9/7i3v5zPBIMN5aybAh2/Jg==} engines: {node: '>= 0.4'} - typescript-eslint@8.38.0: - resolution: {integrity: sha512-FsZlrYK6bPDGoLeZRuvx2v6qrM03I0U0SnfCLPs/XCCPCFD80xU9Pg09H/K+XFa68uJuZo7l/Xhs+eDRg2l3hg==} + typescript-eslint@8.44.1: + resolution: {integrity: sha512-0ws8uWGrUVTjEeN2OM4K1pLKHK/4NiNP/vz6ns+LjT/6sqpaYzIVFajZb1fj/IDwpsrrHb3Jy0Qm5u9CPcKaeg==} engines: {node: ^18.18.0 || ^20.9.0 || >=21.1.0} peerDependencies: eslint: ^8.57.0 || ^9.0.0 - typescript: '>=4.8.4 <5.9.0' + typescript: '>=4.8.4 <6.0.0' typescript@5.5.4: resolution: {integrity: sha512-Mtq29sKDAEYP7aljRgtPOpTvOfbwRWlS6dPRzwjdE+C0R4brX/GUyhHSecbHMFLNBLcJIPt9nl9yG5TZ1weH+Q==} @@ -3457,8 +3479,8 @@ packages: resolution: {integrity: sha512-OljLrQ9SQdOUqTaQxqL5dEfZWrXExyyWsozYlAWFawPVNuD83igl7uJD2RTkNMbniIYgt8l81eCJGIdQF7avLQ==} engines: {node: ^14.17.0 || ^16.13.0 || >=18.0.0} - viem@2.33.0: - resolution: {integrity: sha512-SxBM3CmeU+LWLlBclV9MPdbuFV8mQEl0NeRc9iyYU4a7Xb5sr5oku3s/bRGTPpEP+1hCAHYpM09/ui3/dQ6EsA==} + viem@2.37.8: + resolution: {integrity: sha512-mL+5yvCQbRIR6QvngDQMfEiZTfNWfd+/QL5yFaOoYbpH3b1Q2ddwF7YG2eI2AcYSh9LE1gtUkbzZLFUAVyj4oQ==} peerDependencies: typescript: '>=5.0.4' peerDependenciesMeta: @@ -3470,8 +3492,8 @@ packages: engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} hasBin: true - vite@7.0.5: - resolution: {integrity: sha512-1mncVwJxy2C9ThLwz0+2GKZyEXuC3MyWtAAlNftlZZXZDP3AJt5FmwcMit/IGGaNZ8ZOB2BNO/HFUB+CpN0NQw==} + vite@7.1.7: + resolution: {integrity: sha512-VbA8ScMvAISJNJVbRDTJdCwqQoAareR/wutevKanhR2/1EkoXVZVkkORaYm/tNVCjP/UDTKtcw3bAkwOUdedmA==} engines: {node: ^20.19.0 || >=22.12.0} hasBin: true peerDependencies: @@ -3541,6 +3563,10 @@ packages: wcwidth@1.0.1: resolution: {integrity: sha512-XHPEwS0q6TaxcvG85+8EYkbiCux2XtWG2mkc47Ng2A77BQu9+DqIOJldST4HgPkuea7dvKSj5VgX3P1d4rW8Tg==} + webidl-conversions@7.0.0: + resolution: {integrity: sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==} + engines: {node: '>=12'} + whatwg-mimetype@3.0.0: resolution: {integrity: sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==} engines: {node: '>=12'} @@ -3593,8 +3619,8 @@ packages: wrappy@1.0.2: resolution: {integrity: sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==} - ws@8.18.2: - resolution: {integrity: sha512-DMricUmwGZUVr++AEAe2uiVM7UoO9MAVZMDu05UQOaUII0lp+zOzLLU4Xqh/JvTqklB1T4uELaaPBKyjE1r4fQ==} + ws@8.18.3: + resolution: {integrity: sha512-PEIGCY5tSlUt50cqyMXfCzX+oOPqN0vuGqWzbcJ2xvnkzkq46oOpz7dQaTDBdfICb4N14+GARUDw2XV2N4tvzg==} engines: {node: '>=10.0.0'} peerDependencies: bufferutil: ^4.0.1 @@ -3632,35 +3658,35 @@ snapshots: cbor2: 1.12.0 pkijs: 3.2.5 - '@adraffy/ens-normalize@1.11.0': {} + '@adraffy/ens-normalize@1.11.1': {} '@ampproject/remapping@2.3.0': dependencies: - '@jridgewell/gen-mapping': 0.3.12 - '@jridgewell/trace-mapping': 0.3.29 + '@jridgewell/gen-mapping': 0.3.13 + '@jridgewell/trace-mapping': 0.3.31 '@babel/helper-string-parser@7.27.1': {} '@babel/helper-validator-identifier@7.27.1': {} - '@babel/parser@7.28.0': + '@babel/parser@7.28.4': dependencies: - '@babel/types': 7.28.1 + '@babel/types': 7.28.4 - '@babel/runtime-corejs3@7.28.0': + '@babel/runtime-corejs3@7.28.4': dependencies: - core-js-pure: 3.44.0 + core-js-pure: 3.45.1 - '@babel/runtime@7.27.6': {} + '@babel/runtime@7.28.4': {} - '@babel/types@7.28.1': + '@babel/types@7.28.4': dependencies: '@babel/helper-string-parser': 7.27.1 '@babel/helper-validator-identifier': 7.27.1 '@bcoe/v8-coverage@1.0.2': {} - '@changesets/apply-release-plan@7.0.12': + '@changesets/apply-release-plan@7.0.13': dependencies: '@changesets/config': 3.1.1 '@changesets/get-version-range-type': 0.4.0 @@ -3689,9 +3715,9 @@ snapshots: dependencies: '@changesets/types': 6.1.0 - '@changesets/cli@2.29.5': + '@changesets/cli@2.29.7(@types/node@22.18.6)': dependencies: - '@changesets/apply-release-plan': 7.0.12 + '@changesets/apply-release-plan': 7.0.13 '@changesets/assemble-release-plan': 6.0.9 '@changesets/changelog-git': 0.2.1 '@changesets/config': 3.1.1 @@ -3705,11 +3731,11 @@ snapshots: '@changesets/should-skip-package': 0.1.2 '@changesets/types': 6.1.0 '@changesets/write': 0.4.0 + '@inquirer/external-editor': 1.0.2(@types/node@22.18.6) '@manypkg/get-packages': 1.1.3 ansi-colors: 4.1.3 ci-info: 3.9.0 enquirer: 2.4.1 - external-editor: 3.1.0 fs-extra: 7.0.1 mri: 1.2.0 p-limit: 2.3.0 @@ -3719,6 +3745,8 @@ snapshots: semver: 7.7.2 spawndamnit: 3.0.1 term-size: 2.2.1 + transitivePeerDependencies: + - '@types/node' '@changesets/config@3.1.1': dependencies: @@ -3811,87 +3839,87 @@ snapshots: tslib: 2.8.1 optional: true - '@esbuild/aix-ppc64@0.25.8': + '@esbuild/aix-ppc64@0.25.10': optional: true - '@esbuild/android-arm64@0.25.8': + '@esbuild/android-arm64@0.25.10': optional: true - '@esbuild/android-arm@0.25.8': + '@esbuild/android-arm@0.25.10': optional: true - '@esbuild/android-x64@0.25.8': + '@esbuild/android-x64@0.25.10': optional: true - '@esbuild/darwin-arm64@0.25.8': + '@esbuild/darwin-arm64@0.25.10': optional: true - '@esbuild/darwin-x64@0.25.8': + '@esbuild/darwin-x64@0.25.10': optional: true - '@esbuild/freebsd-arm64@0.25.8': + '@esbuild/freebsd-arm64@0.25.10': optional: true - '@esbuild/freebsd-x64@0.25.8': + '@esbuild/freebsd-x64@0.25.10': optional: true - '@esbuild/linux-arm64@0.25.8': + '@esbuild/linux-arm64@0.25.10': optional: true - '@esbuild/linux-arm@0.25.8': + '@esbuild/linux-arm@0.25.10': optional: true - '@esbuild/linux-ia32@0.25.8': + '@esbuild/linux-ia32@0.25.10': optional: true - '@esbuild/linux-loong64@0.25.8': + '@esbuild/linux-loong64@0.25.10': optional: true - '@esbuild/linux-mips64el@0.25.8': + '@esbuild/linux-mips64el@0.25.10': optional: true - '@esbuild/linux-ppc64@0.25.8': + '@esbuild/linux-ppc64@0.25.10': optional: true - '@esbuild/linux-riscv64@0.25.8': + '@esbuild/linux-riscv64@0.25.10': optional: true - '@esbuild/linux-s390x@0.25.8': + '@esbuild/linux-s390x@0.25.10': optional: true - '@esbuild/linux-x64@0.25.8': + '@esbuild/linux-x64@0.25.10': optional: true - '@esbuild/netbsd-arm64@0.25.8': + '@esbuild/netbsd-arm64@0.25.10': optional: true - '@esbuild/netbsd-x64@0.25.8': + '@esbuild/netbsd-x64@0.25.10': optional: true - '@esbuild/openbsd-arm64@0.25.8': + '@esbuild/openbsd-arm64@0.25.10': optional: true - '@esbuild/openbsd-x64@0.25.8': + '@esbuild/openbsd-x64@0.25.10': optional: true - '@esbuild/openharmony-arm64@0.25.8': + '@esbuild/openharmony-arm64@0.25.10': optional: true - '@esbuild/sunos-x64@0.25.8': + '@esbuild/sunos-x64@0.25.10': optional: true - '@esbuild/win32-arm64@0.25.8': + '@esbuild/win32-arm64@0.25.10': optional: true - '@esbuild/win32-ia32@0.25.8': + '@esbuild/win32-ia32@0.25.10': optional: true - '@esbuild/win32-x64@0.25.8': + '@esbuild/win32-x64@0.25.10': optional: true - '@eslint-community/eslint-utils@4.7.0(eslint@9.31.0)': + '@eslint-community/eslint-utils@4.9.0(eslint@9.36.0)': dependencies: - eslint: 9.31.0 + eslint: 9.36.0 eslint-visitor-keys: 3.4.3 '@eslint-community/regexpp@4.12.1': {} @@ -3899,21 +3927,21 @@ snapshots: '@eslint/config-array@0.21.0': dependencies: '@eslint/object-schema': 2.1.6 - debug: 4.4.1(supports-color@5.5.0) + debug: 4.4.3(supports-color@5.5.0) minimatch: 3.1.2 transitivePeerDependencies: - supports-color - '@eslint/config-helpers@0.3.0': {} + '@eslint/config-helpers@0.3.1': {} - '@eslint/core@0.15.1': + '@eslint/core@0.15.2': dependencies: '@types/json-schema': 7.0.15 '@eslint/eslintrc@3.3.1': dependencies: ajv: 6.12.6 - debug: 4.4.1(supports-color@5.5.0) + debug: 4.4.3(supports-color@5.5.0) espree: 10.4.0 globals: 14.0.0 ignore: 5.3.2 @@ -3924,26 +3952,24 @@ snapshots: transitivePeerDependencies: - supports-color - '@eslint/js@9.31.0': {} + '@eslint/js@9.36.0': {} '@eslint/object-schema@2.1.6': {} - '@eslint/plugin-kit@0.3.4': + '@eslint/plugin-kit@0.3.5': dependencies: - '@eslint/core': 0.15.1 + '@eslint/core': 0.15.2 levn: 0.4.1 '@humanfs/core@0.19.1': {} - '@humanfs/node@0.16.6': + '@humanfs/node@0.16.7': dependencies: '@humanfs/core': 0.19.1 - '@humanwhocodes/retry': 0.3.1 + '@humanwhocodes/retry': 0.4.3 '@humanwhocodes/module-importer@1.0.1': {} - '@humanwhocodes/retry@0.3.1': {} - '@humanwhocodes/retry@0.4.3': {} '@img/colour@1.0.0': @@ -4035,6 +4061,20 @@ snapshots: '@img/sharp-win32-x64@0.34.4': optional: true + '@inquirer/external-editor@1.0.2(@types/node@20.19.17)': + dependencies: + chardet: 2.1.0 + iconv-lite: 0.7.0 + optionalDependencies: + '@types/node': 20.19.17 + + '@inquirer/external-editor@1.0.2(@types/node@22.18.6)': + dependencies: + chardet: 2.1.0 + iconv-lite: 0.7.0 + optionalDependencies: + '@types/node': 22.18.6 + '@isaacs/balanced-match@4.0.1': {} '@isaacs/brace-expansion@5.0.0': @@ -4045,85 +4085,85 @@ snapshots: dependencies: string-width: 5.1.2 string-width-cjs: string-width@4.2.3 - strip-ansi: 7.1.0 + strip-ansi: 7.1.2 strip-ansi-cjs: strip-ansi@6.0.1 wrap-ansi: 8.1.0 wrap-ansi-cjs: wrap-ansi@7.0.0 '@istanbuljs/schema@0.1.3': {} - '@jridgewell/gen-mapping@0.3.12': + '@jridgewell/gen-mapping@0.3.13': dependencies: - '@jridgewell/sourcemap-codec': 1.5.4 - '@jridgewell/trace-mapping': 0.3.29 + '@jridgewell/sourcemap-codec': 1.5.5 + '@jridgewell/trace-mapping': 0.3.31 '@jridgewell/resolve-uri@3.1.2': {} - '@jridgewell/sourcemap-codec@1.5.4': {} + '@jridgewell/sourcemap-codec@1.5.5': {} - '@jridgewell/trace-mapping@0.3.29': + '@jridgewell/trace-mapping@0.3.31': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.4 + '@jridgewell/sourcemap-codec': 1.5.5 '@jridgewell/trace-mapping@0.3.9': dependencies: '@jridgewell/resolve-uri': 3.1.2 - '@jridgewell/sourcemap-codec': 1.5.4 + '@jridgewell/sourcemap-codec': 1.5.5 '@manypkg/find-root@1.1.0': dependencies: - '@babel/runtime': 7.27.6 + '@babel/runtime': 7.28.4 '@types/node': 12.20.55 find-up: 4.1.0 fs-extra: 8.1.0 '@manypkg/get-packages@1.1.3': dependencies: - '@babel/runtime': 7.27.6 + '@babel/runtime': 7.28.4 '@changesets/types': 4.1.0 '@manypkg/find-root': 1.1.0 fs-extra: 8.1.0 globby: 11.1.0 read-yaml-file: 1.1.0 - '@next/env@15.4.7': {} + '@next/env@15.5.3': {} - '@next/eslint-plugin-next@15.4.2': + '@next/eslint-plugin-next@15.5.3': dependencies: fast-glob: 3.3.1 - '@next/swc-darwin-arm64@15.4.7': + '@next/swc-darwin-arm64@15.5.3': optional: true - '@next/swc-darwin-x64@15.4.7': + '@next/swc-darwin-x64@15.5.3': optional: true - '@next/swc-linux-arm64-gnu@15.4.7': + '@next/swc-linux-arm64-gnu@15.5.3': optional: true - '@next/swc-linux-arm64-musl@15.4.7': + '@next/swc-linux-arm64-musl@15.5.3': optional: true - '@next/swc-linux-x64-gnu@15.4.7': + '@next/swc-linux-x64-gnu@15.5.3': optional: true - '@next/swc-linux-x64-musl@15.4.7': + '@next/swc-linux-x64-musl@15.5.3': optional: true - '@next/swc-win32-arm64-msvc@15.4.7': + '@next/swc-win32-arm64-msvc@15.5.3': optional: true - '@next/swc-win32-x64-msvc@15.4.7': + '@next/swc-win32-x64-msvc@15.5.3': optional: true '@noble/ciphers@1.3.0': {} - '@noble/curves@1.9.2': + '@noble/curves@1.9.1': dependencies: '@noble/hashes': 1.8.0 - '@noble/curves@1.9.4': + '@noble/curves@1.9.7': dependencies: '@noble/hashes': 1.8.0 @@ -4144,71 +4184,77 @@ snapshots: '@pkgjs/parseargs@0.11.0': optional: true - '@rollup/rollup-android-arm-eabi@4.45.1': + '@rollup/rollup-android-arm-eabi@4.52.2': optional: true - '@rollup/rollup-android-arm64@4.45.1': + '@rollup/rollup-android-arm64@4.52.2': optional: true - '@rollup/rollup-darwin-arm64@4.45.1': + '@rollup/rollup-darwin-arm64@4.52.2': optional: true - '@rollup/rollup-darwin-x64@4.45.1': + '@rollup/rollup-darwin-x64@4.52.2': optional: true - '@rollup/rollup-freebsd-arm64@4.45.1': + '@rollup/rollup-freebsd-arm64@4.52.2': optional: true - '@rollup/rollup-freebsd-x64@4.45.1': + '@rollup/rollup-freebsd-x64@4.52.2': optional: true - '@rollup/rollup-linux-arm-gnueabihf@4.45.1': + '@rollup/rollup-linux-arm-gnueabihf@4.52.2': optional: true - '@rollup/rollup-linux-arm-musleabihf@4.45.1': + '@rollup/rollup-linux-arm-musleabihf@4.52.2': optional: true - '@rollup/rollup-linux-arm64-gnu@4.45.1': + '@rollup/rollup-linux-arm64-gnu@4.52.2': optional: true - '@rollup/rollup-linux-arm64-musl@4.45.1': + '@rollup/rollup-linux-arm64-musl@4.52.2': optional: true - '@rollup/rollup-linux-loongarch64-gnu@4.45.1': + '@rollup/rollup-linux-loong64-gnu@4.52.2': optional: true - '@rollup/rollup-linux-powerpc64le-gnu@4.45.1': + '@rollup/rollup-linux-ppc64-gnu@4.52.2': optional: true - '@rollup/rollup-linux-riscv64-gnu@4.45.1': + '@rollup/rollup-linux-riscv64-gnu@4.52.2': optional: true - '@rollup/rollup-linux-riscv64-musl@4.45.1': + '@rollup/rollup-linux-riscv64-musl@4.52.2': optional: true - '@rollup/rollup-linux-s390x-gnu@4.45.1': + '@rollup/rollup-linux-s390x-gnu@4.52.2': optional: true - '@rollup/rollup-linux-x64-gnu@4.45.1': + '@rollup/rollup-linux-x64-gnu@4.52.2': optional: true - '@rollup/rollup-linux-x64-musl@4.45.1': + '@rollup/rollup-linux-x64-musl@4.52.2': optional: true - '@rollup/rollup-win32-arm64-msvc@4.45.1': + '@rollup/rollup-openharmony-arm64@4.52.2': optional: true - '@rollup/rollup-win32-ia32-msvc@4.45.1': + '@rollup/rollup-win32-arm64-msvc@4.52.2': optional: true - '@rollup/rollup-win32-x64-msvc@4.45.1': + '@rollup/rollup-win32-ia32-msvc@4.52.2': + optional: true + + '@rollup/rollup-win32-x64-gnu@4.52.2': + optional: true + + '@rollup/rollup-win32-x64-msvc@4.52.2': optional: true '@scure/base@1.2.6': {} '@scure/bip32@1.7.0': dependencies: - '@noble/curves': 1.9.4 + '@noble/curves': 1.9.7 '@noble/hashes': 1.8.0 '@scure/base': 1.2.6 @@ -4231,17 +4277,17 @@ snapshots: '@tsconfig/node16@1.0.4': {} - '@turbo/gen@1.13.4(@types/node@20.19.9)(typescript@5.5.4)': + '@turbo/gen@1.13.4(@types/node@20.19.17)(typescript@5.5.4)': dependencies: - '@turbo/workspaces': 1.13.4 + '@turbo/workspaces': 1.13.4(@types/node@20.19.17) chalk: 2.4.2 commander: 10.0.1 fs-extra: 10.1.0 - inquirer: 8.2.6 + inquirer: 8.2.7(@types/node@20.19.17) minimatch: 9.0.5 node-plop: 0.26.3 proxy-agent: 6.5.0 - ts-node: 10.9.2(@types/node@20.19.9)(typescript@5.5.4) + ts-node: 10.9.2(@types/node@20.19.17)(typescript@5.5.4) update-check: 1.5.4 validate-npm-package-name: 5.0.1 transitivePeerDependencies: @@ -4251,7 +4297,7 @@ snapshots: - supports-color - typescript - '@turbo/workspaces@1.13.4': + '@turbo/workspaces@1.13.4(@types/node@20.19.17)': dependencies: chalk: 2.4.2 commander: 10.0.1 @@ -4259,12 +4305,14 @@ snapshots: fast-glob: 3.3.3 fs-extra: 10.1.0 gradient-string: 2.0.2 - inquirer: 8.2.6 + inquirer: 8.2.7(@types/node@20.19.17) js-yaml: 4.1.0 ora: 4.1.1 rimraf: 3.0.2 semver: 7.7.2 update-check: 1.5.4 + transitivePeerDependencies: + - '@types/node' '@types/chai@5.2.2': dependencies: @@ -4277,7 +4325,7 @@ snapshots: '@types/glob@7.2.0': dependencies: '@types/minimatch': 6.0.0 - '@types/node': 22.16.5 + '@types/node': 20.19.17 '@types/inquirer@6.5.0': dependencies: @@ -4292,15 +4340,11 @@ snapshots: '@types/node@12.20.55': {} - '@types/node@20.19.21': + '@types/node@20.19.17': dependencies: undici-types: 6.21.0 - '@types/node@20.19.9': - dependencies: - undici-types: 6.21.0 - - '@types/node@22.16.5': + '@types/node@22.18.6': dependencies: undici-types: 6.21.0 @@ -4326,27 +4370,25 @@ snapshots: '@types/through@0.0.33': dependencies: - '@types/node': 22.16.5 + '@types/node': 20.19.17 '@types/tinycolor2@1.4.6': {} - '@types/whatwg-mimetype@3.0.2': {} - '@types/yargs-parser@21.0.3': {} '@types/yargs@17.0.33': dependencies: '@types/yargs-parser': 21.0.3 - '@typescript-eslint/eslint-plugin@8.38.0(@typescript-eslint/parser@8.38.0(eslint@9.31.0)(typescript@5.8.3))(eslint@9.31.0)(typescript@5.8.3)': + '@typescript-eslint/eslint-plugin@8.44.1(@typescript-eslint/parser@8.44.1(eslint@9.36.0)(typescript@5.8.3))(eslint@9.36.0)(typescript@5.8.3)': dependencies: '@eslint-community/regexpp': 4.12.1 - '@typescript-eslint/parser': 8.38.0(eslint@9.31.0)(typescript@5.8.3) - '@typescript-eslint/scope-manager': 8.38.0 - '@typescript-eslint/type-utils': 8.38.0(eslint@9.31.0)(typescript@5.8.3) - '@typescript-eslint/utils': 8.38.0(eslint@9.31.0)(typescript@5.8.3) - '@typescript-eslint/visitor-keys': 8.38.0 - eslint: 9.31.0 + '@typescript-eslint/parser': 8.44.1(eslint@9.36.0)(typescript@5.8.3) + '@typescript-eslint/scope-manager': 8.44.1 + '@typescript-eslint/type-utils': 8.44.1(eslint@9.36.0)(typescript@5.8.3) + '@typescript-eslint/utils': 8.44.1(eslint@9.36.0)(typescript@5.8.3) + '@typescript-eslint/visitor-keys': 8.44.1 + eslint: 9.36.0 graphemer: 1.4.0 ignore: 7.0.5 natural-compare: 1.4.0 @@ -4355,57 +4397,57 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/parser@8.38.0(eslint@9.31.0)(typescript@5.8.3)': + '@typescript-eslint/parser@8.44.1(eslint@9.36.0)(typescript@5.8.3)': dependencies: - '@typescript-eslint/scope-manager': 8.38.0 - '@typescript-eslint/types': 8.38.0 - '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.8.3) - '@typescript-eslint/visitor-keys': 8.38.0 - debug: 4.4.1(supports-color@5.5.0) - eslint: 9.31.0 + '@typescript-eslint/scope-manager': 8.44.1 + '@typescript-eslint/types': 8.44.1 + '@typescript-eslint/typescript-estree': 8.44.1(typescript@5.8.3) + '@typescript-eslint/visitor-keys': 8.44.1 + debug: 4.4.3(supports-color@5.5.0) + eslint: 9.36.0 typescript: 5.8.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/project-service@8.38.0(typescript@5.8.3)': + '@typescript-eslint/project-service@8.44.1(typescript@5.8.3)': dependencies: - '@typescript-eslint/tsconfig-utils': 8.38.0(typescript@5.8.3) - '@typescript-eslint/types': 8.38.0 - debug: 4.4.1(supports-color@5.5.0) + '@typescript-eslint/tsconfig-utils': 8.44.1(typescript@5.8.3) + '@typescript-eslint/types': 8.44.1 + debug: 4.4.3(supports-color@5.5.0) typescript: 5.8.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/scope-manager@8.38.0': + '@typescript-eslint/scope-manager@8.44.1': dependencies: - '@typescript-eslint/types': 8.38.0 - '@typescript-eslint/visitor-keys': 8.38.0 + '@typescript-eslint/types': 8.44.1 + '@typescript-eslint/visitor-keys': 8.44.1 - '@typescript-eslint/tsconfig-utils@8.38.0(typescript@5.8.3)': + '@typescript-eslint/tsconfig-utils@8.44.1(typescript@5.8.3)': dependencies: typescript: 5.8.3 - '@typescript-eslint/type-utils@8.38.0(eslint@9.31.0)(typescript@5.8.3)': + '@typescript-eslint/type-utils@8.44.1(eslint@9.36.0)(typescript@5.8.3)': dependencies: - '@typescript-eslint/types': 8.38.0 - '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.8.3) - '@typescript-eslint/utils': 8.38.0(eslint@9.31.0)(typescript@5.8.3) - debug: 4.4.1(supports-color@5.5.0) - eslint: 9.31.0 + '@typescript-eslint/types': 8.44.1 + '@typescript-eslint/typescript-estree': 8.44.1(typescript@5.8.3) + '@typescript-eslint/utils': 8.44.1(eslint@9.36.0)(typescript@5.8.3) + debug: 4.4.3(supports-color@5.5.0) + eslint: 9.36.0 ts-api-utils: 2.1.0(typescript@5.8.3) typescript: 5.8.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/types@8.38.0': {} + '@typescript-eslint/types@8.44.1': {} - '@typescript-eslint/typescript-estree@8.38.0(typescript@5.8.3)': + '@typescript-eslint/typescript-estree@8.44.1(typescript@5.8.3)': dependencies: - '@typescript-eslint/project-service': 8.38.0(typescript@5.8.3) - '@typescript-eslint/tsconfig-utils': 8.38.0(typescript@5.8.3) - '@typescript-eslint/types': 8.38.0 - '@typescript-eslint/visitor-keys': 8.38.0 - debug: 4.4.1(supports-color@5.5.0) + '@typescript-eslint/project-service': 8.44.1(typescript@5.8.3) + '@typescript-eslint/tsconfig-utils': 8.44.1(typescript@5.8.3) + '@typescript-eslint/types': 8.44.1 + '@typescript-eslint/visitor-keys': 8.44.1 + debug: 4.4.3(supports-color@5.5.0) fast-glob: 3.3.3 is-glob: 4.0.3 minimatch: 9.0.5 @@ -4415,38 +4457,38 @@ snapshots: transitivePeerDependencies: - supports-color - '@typescript-eslint/utils@8.38.0(eslint@9.31.0)(typescript@5.8.3)': + '@typescript-eslint/utils@8.44.1(eslint@9.36.0)(typescript@5.8.3)': dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.31.0) - '@typescript-eslint/scope-manager': 8.38.0 - '@typescript-eslint/types': 8.38.0 - '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.8.3) - eslint: 9.31.0 + '@eslint-community/eslint-utils': 4.9.0(eslint@9.36.0) + '@typescript-eslint/scope-manager': 8.44.1 + '@typescript-eslint/types': 8.44.1 + '@typescript-eslint/typescript-estree': 8.44.1(typescript@5.8.3) + eslint: 9.36.0 typescript: 5.8.3 transitivePeerDependencies: - supports-color - '@typescript-eslint/visitor-keys@8.38.0': + '@typescript-eslint/visitor-keys@8.44.1': dependencies: - '@typescript-eslint/types': 8.38.0 + '@typescript-eslint/types': 8.44.1 eslint-visitor-keys: 4.2.1 - '@vitest/coverage-v8@3.2.4(vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.2))': + '@vitest/coverage-v8@3.2.4(vitest@3.2.4(@types/node@22.18.6)(happy-dom@17.6.3))': dependencies: '@ampproject/remapping': 2.3.0 '@bcoe/v8-coverage': 1.0.2 - ast-v8-to-istanbul: 0.3.3 - debug: 4.4.1(supports-color@5.5.0) + ast-v8-to-istanbul: 0.3.5 + debug: 4.4.3(supports-color@5.5.0) istanbul-lib-coverage: 3.2.2 istanbul-lib-report: 3.0.1 istanbul-lib-source-maps: 5.0.6 - istanbul-reports: 3.1.7 - magic-string: 0.30.17 + istanbul-reports: 3.2.0 + magic-string: 0.30.19 magicast: 0.3.5 std-env: 3.9.0 test-exclude: 7.0.1 tinyrainbow: 2.0.0 - vitest: 3.2.4(@types/node@22.16.5)(happy-dom@20.0.2) + vitest: 3.2.4(@types/node@22.18.6)(happy-dom@17.6.3) transitivePeerDependencies: - supports-color @@ -4455,16 +4497,16 @@ snapshots: '@types/chai': 5.2.2 '@vitest/spy': 3.2.4 '@vitest/utils': 3.2.4 - chai: 5.2.1 + chai: 5.3.3 tinyrainbow: 2.0.0 - '@vitest/mocker@3.2.4(vite@7.0.5(@types/node@22.16.5))': + '@vitest/mocker@3.2.4(vite@7.1.7(@types/node@22.18.6))': dependencies: '@vitest/spy': 3.2.4 estree-walker: 3.0.3 - magic-string: 0.30.17 + magic-string: 0.30.19 optionalDependencies: - vite: 7.0.5(@types/node@22.16.5) + vite: 7.1.7(@types/node@22.18.6) '@vitest/pretty-format@3.2.4': dependencies: @@ -4479,20 +4521,24 @@ snapshots: '@vitest/snapshot@3.2.4': dependencies: '@vitest/pretty-format': 3.2.4 - magic-string: 0.30.17 + magic-string: 0.30.19 pathe: 2.0.3 '@vitest/spy@3.2.4': dependencies: - tinyspy: 4.0.3 + tinyspy: 4.0.4 '@vitest/utils@3.2.4': dependencies: '@vitest/pretty-format': 3.2.4 - loupe: 3.1.4 + loupe: 3.2.1 tinyrainbow: 2.0.0 - abitype@1.0.8(typescript@5.8.3): + abitype@1.1.0(typescript@5.8.3): + optionalDependencies: + typescript: 5.8.3 + + abitype@1.1.1(typescript@5.8.3): optionalDependencies: typescript: 5.8.3 @@ -4528,7 +4574,7 @@ snapshots: ansi-regex@5.0.1: {} - ansi-regex@6.1.0: {} + ansi-regex@6.2.2: {} ansi-styles@3.2.1: dependencies: @@ -4538,7 +4584,7 @@ snapshots: dependencies: color-convert: 2.0.1 - ansi-styles@6.2.1: {} + ansi-styles@6.2.3: {} anymatch@3.1.3: dependencies: @@ -4624,9 +4670,9 @@ snapshots: dependencies: tslib: 2.8.1 - ast-v8-to-istanbul@0.3.3: + ast-v8-to-istanbul@0.3.5: dependencies: - '@jridgewell/trace-mapping': 0.3.29 + '@jridgewell/trace-mapping': 0.3.31 estree-walker: 3.0.3 js-tokens: 9.0.1 @@ -4704,12 +4750,12 @@ snapshots: cbor2@1.12.0: {} - chai@5.2.1: + chai@5.3.3: dependencies: assertion-error: 2.0.1 check-error: 2.1.1 deep-eql: 5.0.2 - loupe: 3.1.4 + loupe: 3.2.1 pathval: 2.0.1 chalk@2.4.2: @@ -4751,6 +4797,8 @@ snapshots: chardet@0.7.0: {} + chardet@2.1.0: {} + check-error@2.1.1: {} chokidar@3.6.0: @@ -4820,7 +4868,7 @@ snapshots: snake-case: 2.1.0 upper-case: 1.1.3 - core-js-pure@3.44.0: {} + core-js-pure@3.45.1: {} create-require@1.1.1: {} @@ -4854,9 +4902,9 @@ snapshots: date-fns@2.30.0: dependencies: - '@babel/runtime': 7.27.6 + '@babel/runtime': 7.28.4 - debug@4.4.1(supports-color@5.5.0): + debug@4.4.3(supports-color@5.5.0): dependencies: ms: 2.1.3 optionalDependencies: @@ -5044,34 +5092,34 @@ snapshots: is-date-object: 1.1.0 is-symbol: 1.1.1 - esbuild@0.25.8: + esbuild@0.25.10: optionalDependencies: - '@esbuild/aix-ppc64': 0.25.8 - '@esbuild/android-arm': 0.25.8 - '@esbuild/android-arm64': 0.25.8 - '@esbuild/android-x64': 0.25.8 - '@esbuild/darwin-arm64': 0.25.8 - '@esbuild/darwin-x64': 0.25.8 - '@esbuild/freebsd-arm64': 0.25.8 - '@esbuild/freebsd-x64': 0.25.8 - '@esbuild/linux-arm': 0.25.8 - '@esbuild/linux-arm64': 0.25.8 - '@esbuild/linux-ia32': 0.25.8 - '@esbuild/linux-loong64': 0.25.8 - '@esbuild/linux-mips64el': 0.25.8 - '@esbuild/linux-ppc64': 0.25.8 - '@esbuild/linux-riscv64': 0.25.8 - '@esbuild/linux-s390x': 0.25.8 - '@esbuild/linux-x64': 0.25.8 - '@esbuild/netbsd-arm64': 0.25.8 - '@esbuild/netbsd-x64': 0.25.8 - '@esbuild/openbsd-arm64': 0.25.8 - '@esbuild/openbsd-x64': 0.25.8 - '@esbuild/openharmony-arm64': 0.25.8 - '@esbuild/sunos-x64': 0.25.8 - '@esbuild/win32-arm64': 0.25.8 - '@esbuild/win32-ia32': 0.25.8 - '@esbuild/win32-x64': 0.25.8 + '@esbuild/aix-ppc64': 0.25.10 + '@esbuild/android-arm': 0.25.10 + '@esbuild/android-arm64': 0.25.10 + '@esbuild/android-x64': 0.25.10 + '@esbuild/darwin-arm64': 0.25.10 + '@esbuild/darwin-x64': 0.25.10 + '@esbuild/freebsd-arm64': 0.25.10 + '@esbuild/freebsd-x64': 0.25.10 + '@esbuild/linux-arm': 0.25.10 + '@esbuild/linux-arm64': 0.25.10 + '@esbuild/linux-ia32': 0.25.10 + '@esbuild/linux-loong64': 0.25.10 + '@esbuild/linux-mips64el': 0.25.10 + '@esbuild/linux-ppc64': 0.25.10 + '@esbuild/linux-riscv64': 0.25.10 + '@esbuild/linux-s390x': 0.25.10 + '@esbuild/linux-x64': 0.25.10 + '@esbuild/netbsd-arm64': 0.25.10 + '@esbuild/netbsd-x64': 0.25.10 + '@esbuild/openbsd-arm64': 0.25.10 + '@esbuild/openbsd-x64': 0.25.10 + '@esbuild/openharmony-arm64': 0.25.10 + '@esbuild/sunos-x64': 0.25.10 + '@esbuild/win32-arm64': 0.25.10 + '@esbuild/win32-ia32': 0.25.10 + '@esbuild/win32-x64': 0.25.10 escalade@3.2.0: {} @@ -5087,17 +5135,17 @@ snapshots: optionalDependencies: source-map: 0.6.1 - eslint-config-prettier@9.1.2(eslint@9.31.0): + eslint-config-prettier@9.1.2(eslint@9.36.0): dependencies: - eslint: 9.31.0 + eslint: 9.36.0 eslint-plugin-only-warn@1.1.0: {} - eslint-plugin-react-hooks@5.2.0(eslint@9.31.0): + eslint-plugin-react-hooks@5.2.0(eslint@9.36.0): dependencies: - eslint: 9.31.0 + eslint: 9.36.0 - eslint-plugin-react@7.37.5(eslint@9.31.0): + eslint-plugin-react@7.37.5(eslint@9.36.0): dependencies: array-includes: 3.1.9 array.prototype.findlast: 1.2.5 @@ -5105,7 +5153,7 @@ snapshots: array.prototype.tosorted: 1.1.4 doctrine: 2.1.0 es-iterator-helpers: 1.2.1 - eslint: 9.31.0 + eslint: 9.36.0 estraverse: 5.3.0 hasown: 2.0.2 jsx-ast-utils: 3.3.5 @@ -5119,11 +5167,11 @@ snapshots: string.prototype.matchall: 4.0.12 string.prototype.repeat: 1.0.0 - eslint-plugin-turbo@2.5.5(eslint@9.31.0)(turbo@2.5.5): + eslint-plugin-turbo@2.5.6(eslint@9.36.0)(turbo@2.5.6): dependencies: dotenv: 16.0.3 - eslint: 9.31.0 - turbo: 2.5.5 + eslint: 9.36.0 + turbo: 2.5.6 eslint-scope@8.4.0: dependencies: @@ -5134,17 +5182,17 @@ snapshots: eslint-visitor-keys@4.2.1: {} - eslint@9.31.0: + eslint@9.36.0: dependencies: - '@eslint-community/eslint-utils': 4.7.0(eslint@9.31.0) + '@eslint-community/eslint-utils': 4.9.0(eslint@9.36.0) '@eslint-community/regexpp': 4.12.1 '@eslint/config-array': 0.21.0 - '@eslint/config-helpers': 0.3.0 - '@eslint/core': 0.15.1 + '@eslint/config-helpers': 0.3.1 + '@eslint/core': 0.15.2 '@eslint/eslintrc': 3.3.1 - '@eslint/js': 9.31.0 - '@eslint/plugin-kit': 0.3.4 - '@humanfs/node': 0.16.6 + '@eslint/js': 9.36.0 + '@eslint/plugin-kit': 0.3.5 + '@humanfs/node': 0.16.7 '@humanwhocodes/module-importer': 1.0.1 '@humanwhocodes/retry': 0.4.3 '@types/estree': 1.0.8 @@ -5152,7 +5200,7 @@ snapshots: ajv: 6.12.6 chalk: 4.1.2 cross-spawn: 7.0.6 - debug: 4.4.1(supports-color@5.5.0) + debug: 4.4.3(supports-color@5.5.0) escape-string-regexp: 4.0.0 eslint-scope: 8.4.0 eslint-visitor-keys: 4.2.1 @@ -5222,7 +5270,7 @@ snapshots: iconv-lite: 0.4.24 tmp: 0.0.33 - fake-indexeddb@6.0.1: {} + fake-indexeddb@6.2.2: {} fast-deep-equal@3.1.3: {} @@ -5250,7 +5298,7 @@ snapshots: dependencies: reusify: 1.1.0 - fdir@6.4.6(picomatch@4.0.3): + fdir@6.5.0(picomatch@4.0.3): optionalDependencies: picomatch: 4.0.3 @@ -5295,7 +5343,7 @@ snapshots: fs-extra@10.1.0: dependencies: graceful-fs: 4.2.11 - jsonfile: 6.1.0 + jsonfile: 6.2.0 universalify: 2.0.1 fs-extra@7.0.1: @@ -5360,7 +5408,7 @@ snapshots: dependencies: basic-ftp: 5.0.5 data-uri-to-buffer: 6.0.2 - debug: 4.4.1(supports-color@5.5.0) + debug: 4.4.3(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -5448,10 +5496,9 @@ snapshots: optionalDependencies: uglify-js: 3.19.3 - happy-dom@20.0.2: + happy-dom@17.6.3: dependencies: - '@types/node': 20.19.21 - '@types/whatwg-mimetype': 3.0.2 + webidl-conversions: 7.0.0 whatwg-mimetype: 3.0.0 has-bigints@1.1.0: {} @@ -5488,14 +5535,14 @@ snapshots: http-proxy-agent@7.0.2: dependencies: agent-base: 7.1.4 - debug: 4.4.1(supports-color@5.5.0) + debug: 4.4.3(supports-color@5.5.0) transitivePeerDependencies: - supports-color https-proxy-agent@7.0.6: dependencies: agent-base: 7.1.4 - debug: 4.4.1(supports-color@5.5.0) + debug: 4.4.3(supports-color@5.5.0) transitivePeerDependencies: - supports-color @@ -5507,6 +5554,10 @@ snapshots: dependencies: safer-buffer: 2.1.2 + iconv-lite@0.7.0: + dependencies: + safer-buffer: 2.1.2 + idb@7.1.1: {} ieee754@1.2.1: {} @@ -5551,13 +5602,13 @@ snapshots: strip-ansi: 6.0.1 through: 2.3.8 - inquirer@8.2.6: + inquirer@8.2.7(@types/node@20.19.17): dependencies: + '@inquirer/external-editor': 1.0.2(@types/node@20.19.17) ansi-escapes: 4.3.2 chalk: 4.1.2 cli-cursor: 3.1.0 cli-width: 3.0.0 - external-editor: 3.1.0 figures: 3.2.0 lodash: 4.17.21 mute-stream: 0.0.8 @@ -5568,6 +5619,8 @@ snapshots: strip-ansi: 6.0.1 through: 2.3.8 wrap-ansi: 6.2.0 + transitivePeerDependencies: + - '@types/node' internal-slot@1.1.0: dependencies: @@ -5575,10 +5628,7 @@ snapshots: hasown: 2.0.2 side-channel: 1.1.0 - ip-address@9.0.5: - dependencies: - jsbn: 1.1.0 - sprintf-js: 1.1.3 + ip-address@10.0.1: {} is-array-buffer@3.0.5: dependencies: @@ -5723,9 +5773,9 @@ snapshots: isexe@2.0.0: {} - isows@1.0.7(ws@8.18.2): + isows@1.0.7(ws@8.18.3): dependencies: - ws: 8.18.2 + ws: 8.18.3 istanbul-lib-coverage@3.2.2: {} @@ -5737,13 +5787,13 @@ snapshots: istanbul-lib-source-maps@5.0.6: dependencies: - '@jridgewell/trace-mapping': 0.3.29 - debug: 4.4.1(supports-color@5.5.0) + '@jridgewell/trace-mapping': 0.3.31 + debug: 4.4.3(supports-color@5.5.0) istanbul-lib-coverage: 3.2.2 transitivePeerDependencies: - supports-color - istanbul-reports@3.1.7: + istanbul-reports@3.2.0: dependencies: html-escaper: 2.0.2 istanbul-lib-report: 3.0.1 @@ -5780,8 +5830,6 @@ snapshots: dependencies: argparse: 2.0.1 - jsbn@1.1.0: {} - json-buffer@3.0.1: {} json-canonicalize@2.0.0: {} @@ -5794,7 +5842,7 @@ snapshots: optionalDependencies: graceful-fs: 4.2.11 - jsonfile@6.1.0: + jsonfile@6.2.0: dependencies: universalify: 2.0.1 optionalDependencies: @@ -5813,48 +5861,48 @@ snapshots: dependencies: json-buffer: 3.0.1 - lefthook-darwin-arm64@1.12.2: + lefthook-darwin-arm64@1.13.3: optional: true - lefthook-darwin-x64@1.12.2: + lefthook-darwin-x64@1.13.3: optional: true - lefthook-freebsd-arm64@1.12.2: + lefthook-freebsd-arm64@1.13.3: optional: true - lefthook-freebsd-x64@1.12.2: + lefthook-freebsd-x64@1.13.3: optional: true - lefthook-linux-arm64@1.12.2: + lefthook-linux-arm64@1.13.3: optional: true - lefthook-linux-x64@1.12.2: + lefthook-linux-x64@1.13.3: optional: true - lefthook-openbsd-arm64@1.12.2: + lefthook-openbsd-arm64@1.13.3: optional: true - lefthook-openbsd-x64@1.12.2: + lefthook-openbsd-x64@1.13.3: optional: true - lefthook-windows-arm64@1.12.2: + lefthook-windows-arm64@1.13.3: optional: true - lefthook-windows-x64@1.12.2: + lefthook-windows-x64@1.13.3: optional: true - lefthook@1.12.2: + lefthook@1.13.3: optionalDependencies: - lefthook-darwin-arm64: 1.12.2 - lefthook-darwin-x64: 1.12.2 - lefthook-freebsd-arm64: 1.12.2 - lefthook-freebsd-x64: 1.12.2 - lefthook-linux-arm64: 1.12.2 - lefthook-linux-x64: 1.12.2 - lefthook-openbsd-arm64: 1.12.2 - lefthook-openbsd-x64: 1.12.2 - lefthook-windows-arm64: 1.12.2 - lefthook-windows-x64: 1.12.2 + lefthook-darwin-arm64: 1.13.3 + lefthook-darwin-x64: 1.13.3 + lefthook-freebsd-arm64: 1.13.3 + lefthook-freebsd-x64: 1.13.3 + lefthook-linux-arm64: 1.13.3 + lefthook-linux-x64: 1.13.3 + lefthook-openbsd-arm64: 1.13.3 + lefthook-openbsd-x64: 1.13.3 + lefthook-windows-arm64: 1.13.3 + lefthook-windows-x64: 1.13.3 levn@0.4.1: dependencies: @@ -5890,7 +5938,7 @@ snapshots: dependencies: js-tokens: 4.0.0 - loupe@3.1.4: {} + loupe@3.2.1: {} lower-case-first@1.0.2: dependencies: @@ -5900,18 +5948,18 @@ snapshots: lru-cache@10.4.3: {} - lru-cache@11.1.0: {} + lru-cache@11.2.1: {} lru-cache@7.18.3: {} - magic-string@0.30.17: + magic-string@0.30.19: dependencies: - '@jridgewell/sourcemap-codec': 1.5.4 + '@jridgewell/sourcemap-codec': 1.5.5 magicast@0.3.5: dependencies: - '@babel/parser': 7.28.0 - '@babel/types': 7.28.1 + '@babel/parser': 7.28.4 + '@babel/types': 7.28.4 source-map-js: 1.2.1 make-dir@4.0.0: @@ -5971,24 +6019,24 @@ snapshots: netmask@2.0.2: {} - next@15.4.7(react-dom@19.1.0(react@19.1.0))(react@19.1.0): + next@15.5.3(react-dom@19.1.1(react@19.1.1))(react@19.1.1): dependencies: - '@next/env': 15.4.7 + '@next/env': 15.5.3 '@swc/helpers': 0.5.15 caniuse-lite: 1.0.30001743 postcss: 8.4.31 - react: 19.1.0 - react-dom: 19.1.0(react@19.1.0) - styled-jsx: 5.1.6(react@19.1.0) + react: 19.1.1 + react-dom: 19.1.1(react@19.1.1) + styled-jsx: 5.1.6(react@19.1.1) optionalDependencies: - '@next/swc-darwin-arm64': 15.4.7 - '@next/swc-darwin-x64': 15.4.7 - '@next/swc-linux-arm64-gnu': 15.4.7 - '@next/swc-linux-arm64-musl': 15.4.7 - '@next/swc-linux-x64-gnu': 15.4.7 - '@next/swc-linux-x64-musl': 15.4.7 - '@next/swc-win32-arm64-msvc': 15.4.7 - '@next/swc-win32-x64-msvc': 15.4.7 + '@next/swc-darwin-arm64': 15.5.3 + '@next/swc-darwin-x64': 15.5.3 + '@next/swc-linux-arm64-gnu': 15.5.3 + '@next/swc-linux-arm64-musl': 15.5.3 + '@next/swc-linux-x64-gnu': 15.5.3 + '@next/swc-linux-x64-musl': 15.5.3 + '@next/swc-win32-arm64-msvc': 15.5.3 + '@next/swc-win32-x64-msvc': 15.5.3 sharp: 0.34.4 transitivePeerDependencies: - '@babel/core' @@ -6000,7 +6048,7 @@ snapshots: node-plop@0.26.3: dependencies: - '@babel/runtime-corejs3': 7.28.0 + '@babel/runtime-corejs3': 7.28.4 '@types/inquirer': 6.5.0 change-case: 3.1.0 del: 5.1.0 @@ -6015,7 +6063,7 @@ snapshots: nodemon@3.1.10: dependencies: chokidar: 3.6.0 - debug: 4.4.1(supports-color@5.5.0) + debug: 4.4.3(supports-color@5.5.0) ignore-by-default: 1.0.1 minimatch: 3.1.2 pstree.remy: 1.1.8 @@ -6119,28 +6167,28 @@ snapshots: ox@0.7.2(typescript@5.8.3): dependencies: - '@adraffy/ens-normalize': 1.11.0 + '@adraffy/ens-normalize': 1.11.1 '@noble/ciphers': 1.3.0 - '@noble/curves': 1.9.4 + '@noble/curves': 1.9.7 '@noble/hashes': 1.8.0 '@scure/bip32': 1.7.0 '@scure/bip39': 1.6.0 - abitype: 1.0.8(typescript@5.8.3) + abitype: 1.1.1(typescript@5.8.3) eventemitter3: 5.0.1 optionalDependencies: typescript: 5.8.3 transitivePeerDependencies: - zod - ox@0.8.1(typescript@5.8.3): + ox@0.9.6(typescript@5.8.3): dependencies: - '@adraffy/ens-normalize': 1.11.0 + '@adraffy/ens-normalize': 1.11.1 '@noble/ciphers': 1.3.0 - '@noble/curves': 1.9.2 + '@noble/curves': 1.9.1 '@noble/hashes': 1.8.0 '@scure/bip32': 1.7.0 '@scure/bip39': 1.6.0 - abitype: 1.0.8(typescript@5.8.3) + abitype: 1.1.0(typescript@5.8.3) eventemitter3: 5.0.1 optionalDependencies: typescript: 5.8.3 @@ -6179,7 +6227,7 @@ snapshots: dependencies: '@tootallnate/quickjs-emscripten': 0.23.0 agent-base: 7.1.4 - debug: 4.4.1(supports-color@5.5.0) + debug: 4.4.3(supports-color@5.5.0) get-uri: 6.0.5 http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.6 @@ -6197,7 +6245,7 @@ snapshots: package-manager-detector@0.2.11: dependencies: - quansync: 0.2.10 + quansync: 0.2.11 param-case@2.1.1: dependencies: @@ -6231,7 +6279,7 @@ snapshots: path-scurry@2.0.0: dependencies: - lru-cache: 11.1.0 + lru-cache: 11.2.1 minipass: 7.1.2 path-type@4.0.0: {} @@ -6286,7 +6334,7 @@ snapshots: proxy-agent@6.5.0: dependencies: agent-base: 7.1.4 - debug: 4.4.1(supports-color@5.5.0) + debug: 4.4.3(supports-color@5.5.0) http-proxy-agent: 7.0.2 https-proxy-agent: 7.0.6 lru-cache: 7.18.3 @@ -6308,7 +6356,7 @@ snapshots: pvutils@1.1.3: {} - quansync@0.2.10: {} + quansync@0.2.11: {} queue-microtask@1.2.3: {} @@ -6319,14 +6367,14 @@ snapshots: minimist: 1.2.8 strip-json-comments: 2.0.1 - react-dom@19.1.0(react@19.1.0): + react-dom@19.1.1(react@19.1.1): dependencies: - react: 19.1.0 + react: 19.1.1 scheduler: 0.26.0 react-is@16.13.1: {} - react@19.1.0: {} + react@19.1.1: {} read-yaml-file@1.1.0: dependencies: @@ -6408,30 +6456,32 @@ snapshots: glob: 11.0.3 package-json-from-dist: 1.0.1 - rollup@4.45.1: + rollup@4.52.2: dependencies: '@types/estree': 1.0.8 optionalDependencies: - '@rollup/rollup-android-arm-eabi': 4.45.1 - '@rollup/rollup-android-arm64': 4.45.1 - '@rollup/rollup-darwin-arm64': 4.45.1 - '@rollup/rollup-darwin-x64': 4.45.1 - '@rollup/rollup-freebsd-arm64': 4.45.1 - '@rollup/rollup-freebsd-x64': 4.45.1 - '@rollup/rollup-linux-arm-gnueabihf': 4.45.1 - '@rollup/rollup-linux-arm-musleabihf': 4.45.1 - '@rollup/rollup-linux-arm64-gnu': 4.45.1 - '@rollup/rollup-linux-arm64-musl': 4.45.1 - '@rollup/rollup-linux-loongarch64-gnu': 4.45.1 - '@rollup/rollup-linux-powerpc64le-gnu': 4.45.1 - '@rollup/rollup-linux-riscv64-gnu': 4.45.1 - '@rollup/rollup-linux-riscv64-musl': 4.45.1 - '@rollup/rollup-linux-s390x-gnu': 4.45.1 - '@rollup/rollup-linux-x64-gnu': 4.45.1 - '@rollup/rollup-linux-x64-musl': 4.45.1 - '@rollup/rollup-win32-arm64-msvc': 4.45.1 - '@rollup/rollup-win32-ia32-msvc': 4.45.1 - '@rollup/rollup-win32-x64-msvc': 4.45.1 + '@rollup/rollup-android-arm-eabi': 4.52.2 + '@rollup/rollup-android-arm64': 4.52.2 + '@rollup/rollup-darwin-arm64': 4.52.2 + '@rollup/rollup-darwin-x64': 4.52.2 + '@rollup/rollup-freebsd-arm64': 4.52.2 + '@rollup/rollup-freebsd-x64': 4.52.2 + '@rollup/rollup-linux-arm-gnueabihf': 4.52.2 + '@rollup/rollup-linux-arm-musleabihf': 4.52.2 + '@rollup/rollup-linux-arm64-gnu': 4.52.2 + '@rollup/rollup-linux-arm64-musl': 4.52.2 + '@rollup/rollup-linux-loong64-gnu': 4.52.2 + '@rollup/rollup-linux-ppc64-gnu': 4.52.2 + '@rollup/rollup-linux-riscv64-gnu': 4.52.2 + '@rollup/rollup-linux-riscv64-musl': 4.52.2 + '@rollup/rollup-linux-s390x-gnu': 4.52.2 + '@rollup/rollup-linux-x64-gnu': 4.52.2 + '@rollup/rollup-linux-x64-musl': 4.52.2 + '@rollup/rollup-openharmony-arm64': 4.52.2 + '@rollup/rollup-win32-arm64-msvc': 4.52.2 + '@rollup/rollup-win32-ia32-msvc': 4.52.2 + '@rollup/rollup-win32-x64-gnu': 4.52.2 + '@rollup/rollup-win32-x64-msvc': 4.52.2 fsevents: 2.3.3 run-async@2.4.1: {} @@ -6591,14 +6641,14 @@ snapshots: socks-proxy-agent@8.0.5: dependencies: agent-base: 7.1.4 - debug: 4.4.1(supports-color@5.5.0) - socks: 2.8.6 + debug: 4.4.3(supports-color@5.5.0) + socks: 2.8.7 transitivePeerDependencies: - supports-color - socks@2.8.6: + socks@2.8.7: dependencies: - ip-address: 9.0.5 + ip-address: 10.0.1 smart-buffer: 4.2.0 source-map-js@1.2.1: {} @@ -6614,8 +6664,6 @@ snapshots: sprintf-js@1.0.3: {} - sprintf-js@1.1.3: {} - stackback@0.0.2: {} std-env@3.9.0: {} @@ -6635,7 +6683,7 @@ snapshots: dependencies: eastasianwidth: 0.2.0 emoji-regex: 9.2.2 - strip-ansi: 7.1.0 + strip-ansi: 7.1.2 string.prototype.matchall@4.0.12: dependencies: @@ -6689,9 +6737,9 @@ snapshots: dependencies: ansi-regex: 5.0.1 - strip-ansi@7.1.0: + strip-ansi@7.1.2: dependencies: - ansi-regex: 6.1.0 + ansi-regex: 6.2.2 strip-bom@3.0.0: {} @@ -6705,10 +6753,10 @@ snapshots: dependencies: js-tokens: 9.0.1 - styled-jsx@5.1.6(react@19.1.0): + styled-jsx@5.1.6(react@19.1.1): dependencies: client-only: 0.0.1 - react: 19.1.0 + react: 19.1.1 supports-color@5.5.0: dependencies: @@ -6745,9 +6793,9 @@ snapshots: tinyexec@0.3.2: {} - tinyglobby@0.2.14: + tinyglobby@0.2.15: dependencies: - fdir: 6.4.6(picomatch@4.0.3) + fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 tinygradient@1.1.5: @@ -6759,7 +6807,7 @@ snapshots: tinyrainbow@2.0.0: {} - tinyspy@4.0.3: {} + tinyspy@4.0.4: {} title-case@2.1.1: dependencies: @@ -6782,14 +6830,14 @@ snapshots: dependencies: typescript: 5.8.3 - ts-node@10.9.2(@types/node@20.19.9)(typescript@5.5.4): + ts-node@10.9.2(@types/node@20.19.17)(typescript@5.5.4): dependencies: '@cspotcode/source-map-support': 0.8.1 '@tsconfig/node10': 1.0.11 '@tsconfig/node12': 1.0.11 '@tsconfig/node14': 1.0.3 '@tsconfig/node16': 1.0.4 - '@types/node': 20.19.9 + '@types/node': 20.19.17 acorn: 8.15.0 acorn-walk: 8.3.4 arg: 4.1.3 @@ -6804,32 +6852,32 @@ snapshots: tslib@2.8.1: {} - turbo-darwin-64@2.5.5: + turbo-darwin-64@2.5.6: optional: true - turbo-darwin-arm64@2.5.5: + turbo-darwin-arm64@2.5.6: optional: true - turbo-linux-64@2.5.5: + turbo-linux-64@2.5.6: optional: true - turbo-linux-arm64@2.5.5: + turbo-linux-arm64@2.5.6: optional: true - turbo-windows-64@2.5.5: + turbo-windows-64@2.5.6: optional: true - turbo-windows-arm64@2.5.5: + turbo-windows-arm64@2.5.6: optional: true - turbo@2.5.5: + turbo@2.5.6: optionalDependencies: - turbo-darwin-64: 2.5.5 - turbo-darwin-arm64: 2.5.5 - turbo-linux-64: 2.5.5 - turbo-linux-arm64: 2.5.5 - turbo-windows-64: 2.5.5 - turbo-windows-arm64: 2.5.5 + turbo-darwin-64: 2.5.6 + turbo-darwin-arm64: 2.5.6 + turbo-linux-64: 2.5.6 + turbo-linux-arm64: 2.5.6 + turbo-windows-64: 2.5.6 + turbo-windows-arm64: 2.5.6 type-check@0.4.0: dependencies: @@ -6870,13 +6918,13 @@ snapshots: possible-typed-array-names: 1.1.0 reflect.getprototypeof: 1.0.10 - typescript-eslint@8.38.0(eslint@9.31.0)(typescript@5.8.3): + typescript-eslint@8.44.1(eslint@9.36.0)(typescript@5.8.3): dependencies: - '@typescript-eslint/eslint-plugin': 8.38.0(@typescript-eslint/parser@8.38.0(eslint@9.31.0)(typescript@5.8.3))(eslint@9.31.0)(typescript@5.8.3) - '@typescript-eslint/parser': 8.38.0(eslint@9.31.0)(typescript@5.8.3) - '@typescript-eslint/typescript-estree': 8.38.0(typescript@5.8.3) - '@typescript-eslint/utils': 8.38.0(eslint@9.31.0)(typescript@5.8.3) - eslint: 9.31.0 + '@typescript-eslint/eslint-plugin': 8.44.1(@typescript-eslint/parser@8.44.1(eslint@9.36.0)(typescript@5.8.3))(eslint@9.36.0)(typescript@5.8.3) + '@typescript-eslint/parser': 8.44.1(eslint@9.36.0)(typescript@5.8.3) + '@typescript-eslint/typescript-estree': 8.44.1(typescript@5.8.3) + '@typescript-eslint/utils': 8.44.1(eslint@9.36.0)(typescript@5.8.3) + eslint: 9.36.0 typescript: 5.8.3 transitivePeerDependencies: - supports-color @@ -6926,16 +6974,16 @@ snapshots: validate-npm-package-name@5.0.1: {} - viem@2.33.0(typescript@5.8.3): + viem@2.37.8(typescript@5.8.3): dependencies: - '@noble/curves': 1.9.2 + '@noble/curves': 1.9.1 '@noble/hashes': 1.8.0 '@scure/bip32': 1.7.0 '@scure/bip39': 1.6.0 - abitype: 1.0.8(typescript@5.8.3) - isows: 1.0.7(ws@8.18.2) - ox: 0.8.1(typescript@5.8.3) - ws: 8.18.2 + abitype: 1.1.0(typescript@5.8.3) + isows: 1.0.7(ws@8.18.3) + ox: 0.9.6(typescript@5.8.3) + ws: 8.18.3 optionalDependencies: typescript: 5.8.3 transitivePeerDependencies: @@ -6943,13 +6991,13 @@ snapshots: - utf-8-validate - zod - vite-node@3.2.4(@types/node@22.16.5): + vite-node@3.2.4(@types/node@22.18.6): dependencies: cac: 6.7.14 - debug: 4.4.1(supports-color@5.5.0) + debug: 4.4.3(supports-color@5.5.0) es-module-lexer: 1.7.0 pathe: 2.0.3 - vite: 7.0.5(@types/node@22.16.5) + vite: 7.1.7(@types/node@22.18.6) transitivePeerDependencies: - '@types/node' - jiti @@ -6964,46 +7012,46 @@ snapshots: - tsx - yaml - vite@7.0.5(@types/node@22.16.5): + vite@7.1.7(@types/node@22.18.6): dependencies: - esbuild: 0.25.8 - fdir: 6.4.6(picomatch@4.0.3) + esbuild: 0.25.10 + fdir: 6.5.0(picomatch@4.0.3) picomatch: 4.0.3 postcss: 8.5.6 - rollup: 4.45.1 - tinyglobby: 0.2.14 + rollup: 4.52.2 + tinyglobby: 0.2.15 optionalDependencies: - '@types/node': 22.16.5 + '@types/node': 22.18.6 fsevents: 2.3.3 - vitest@3.2.4(@types/node@22.16.5)(happy-dom@20.0.2): + vitest@3.2.4(@types/node@22.18.6)(happy-dom@17.6.3): dependencies: '@types/chai': 5.2.2 '@vitest/expect': 3.2.4 - '@vitest/mocker': 3.2.4(vite@7.0.5(@types/node@22.16.5)) + '@vitest/mocker': 3.2.4(vite@7.1.7(@types/node@22.18.6)) '@vitest/pretty-format': 3.2.4 '@vitest/runner': 3.2.4 '@vitest/snapshot': 3.2.4 '@vitest/spy': 3.2.4 '@vitest/utils': 3.2.4 - chai: 5.2.1 - debug: 4.4.1(supports-color@5.5.0) + chai: 5.3.3 + debug: 4.4.3(supports-color@5.5.0) expect-type: 1.2.2 - magic-string: 0.30.17 + magic-string: 0.30.19 pathe: 2.0.3 picomatch: 4.0.3 std-env: 3.9.0 tinybench: 2.9.0 tinyexec: 0.3.2 - tinyglobby: 0.2.14 + tinyglobby: 0.2.15 tinypool: 1.1.1 tinyrainbow: 2.0.0 - vite: 7.0.5(@types/node@22.16.5) - vite-node: 3.2.4(@types/node@22.16.5) + vite: 7.1.7(@types/node@22.18.6) + vite-node: 3.2.4(@types/node@22.18.6) why-is-node-running: 2.3.0 optionalDependencies: - '@types/node': 22.16.5 - happy-dom: 20.0.2 + '@types/node': 22.18.6 + happy-dom: 17.6.3 transitivePeerDependencies: - jiti - less @@ -7022,6 +7070,8 @@ snapshots: dependencies: defaults: 1.0.4 + webidl-conversions@7.0.0: {} + whatwg-mimetype@3.0.0: {} which-boxed-primitive@1.1.1: @@ -7092,13 +7142,13 @@ snapshots: wrap-ansi@8.1.0: dependencies: - ansi-styles: 6.2.1 + ansi-styles: 6.2.3 string-width: 5.1.2 - strip-ansi: 7.1.0 + strip-ansi: 7.1.2 wrappy@1.0.2: {} - ws@8.18.2: {} + ws@8.18.3: {} y18n@5.0.8: {} From d82371d64e12196c16c931c8ba3c759ce726e100 Mon Sep 17 00:00:00 2001 From: Tolgahan Arikan Date: Tue, 23 Sep 2025 21:38:44 +0300 Subject: [PATCH 24/36] Fix check for explicit session for the updated type in dapp-client --- packages/wallet/dapp-client/src/ChainSessionManager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/wallet/dapp-client/src/ChainSessionManager.ts b/packages/wallet/dapp-client/src/ChainSessionManager.ts index 623fc1faa2..14fbdc329c 100644 --- a/packages/wallet/dapp-client/src/ChainSessionManager.ts +++ b/packages/wallet/dapp-client/src/ChainSessionManager.ts @@ -537,7 +537,7 @@ export class ChainSessionManager { ) } - if (savedRequest && savedPayload && savedPayload.session) { + if (savedRequest && savedPayload && savedPayload.session?.permissions) { await this._initializeExplicitSessionInternal(tempPk, loginMethod, userEmail, guard, true) await this.sequenceStorage.saveExplicitSession({ pk: tempPk, From b6563d16c2f6d805a3df6c0e73944e9fa716f0ad Mon Sep 17 00:00:00 2001 From: Taylan Pince Date: Wed, 24 Sep 2025 11:48:41 +0200 Subject: [PATCH 25/36] Update api.gen.ts and relayer.gen.ts --- packages/services/api/src/api.gen.ts | 3779 +++++++---------- .../relayer/src/rpc-relayer/relayer.gen.ts | 1365 +++--- 2 files changed, 2256 insertions(+), 2888 deletions(-) diff --git a/packages/services/api/src/api.gen.ts b/packages/services/api/src/api.gen.ts index 967fad8fe2..a42d143d6d 100644 --- a/packages/services/api/src/api.gen.ts +++ b/packages/services/api/src/api.gen.ts @@ -5,74 +5,75 @@ // // webrpc-gen -schema=api.ridl -target=typescript -client -out=./clients/api.gen.ts -export const WebrpcHeader = 'Webrpc' +export const WebrpcHeader = "Webrpc" -export const WebrpcHeaderValue = 'webrpc@v0.25.3;gen-typescript@v0.17.0;sequence-api@v0.4.0' +export const WebrpcHeaderValue = "webrpc@v0.25.3;gen-typescript@v0.17.0;sequence-api@v0.4.0" // WebRPC description and code-gen version -export const WebRPCVersion = 'v1' +export const WebRPCVersion = "v1" // Schema version of your RIDL schema -export const WebRPCSchemaVersion = 'v0.4.0' +export const WebRPCSchemaVersion = "v0.4.0" // Schema hash generated from your RIDL schema -export const WebRPCSchemaHash = 'd43a5aac616814072c69e63f2f81fe65ea10a7e0' +export const WebRPCSchemaHash = "d43a5aac616814072c69e63f2f81fe65ea10a7e0" type WebrpcGenVersions = { - webrpcGenVersion: string - codeGenName: string - codeGenVersion: string - schemaName: string - schemaVersion: string -} + webrpcGenVersion: string; + codeGenName: string; + codeGenVersion: string; + schemaName: string; + schemaVersion: string; +}; export function VersionFromHeader(headers: Headers): WebrpcGenVersions { - const headerValue = headers.get(WebrpcHeader) + const headerValue = headers.get(WebrpcHeader); if (!headerValue) { return { - webrpcGenVersion: '', - codeGenName: '', - codeGenVersion: '', - schemaName: '', - schemaVersion: '', - } + webrpcGenVersion: "", + codeGenName: "", + codeGenVersion: "", + schemaName: "", + schemaVersion: "", + }; } - return parseWebrpcGenVersions(headerValue) + return parseWebrpcGenVersions(headerValue); } function parseWebrpcGenVersions(header: string): WebrpcGenVersions { - const versions = header.split(';') + const versions = header.split(";"); if (versions.length < 3) { return { - webrpcGenVersion: '', - codeGenName: '', - codeGenVersion: '', - schemaName: '', - schemaVersion: '', - } + webrpcGenVersion: "", + codeGenName: "", + codeGenVersion: "", + schemaName: "", + schemaVersion: "", + }; } - const [_, webrpcGenVersion] = versions[0]!.split('@') - const [codeGenName, codeGenVersion] = versions[1]!.split('@') - const [schemaName, schemaVersion] = versions[2]!.split('@') + const [_, webrpcGenVersion] = versions[0]!.split("@"); + const [codeGenName, codeGenVersion] = versions[1]!.split("@"); + const [schemaName, schemaVersion] = versions[2]!.split("@"); return { - webrpcGenVersion: webrpcGenVersion ?? '', - codeGenName: codeGenName ?? '', - codeGenVersion: codeGenVersion ?? '', - schemaName: schemaName ?? '', - schemaVersion: schemaVersion ?? '', - } + webrpcGenVersion: webrpcGenVersion ?? "", + codeGenName: codeGenName ?? "", + codeGenVersion: codeGenVersion ?? "", + schemaName: schemaName ?? "", + schemaVersion: schemaVersion ?? "", + }; } // // Types // + export enum SortOrder { DESC = 'DESC', - ASC = 'ASC', + ASC = 'ASC' } export enum SardinePaymentType { @@ -81,57 +82,57 @@ export enum SardinePaymentType { credit = 'credit', us_debit = 'us_debit', international_debit = 'international_debit', - international_credit = 'international_credit', + international_credit = 'international_credit' } export enum SardineQuoteType { buy = 'buy', - sell = 'sell', + sell = 'sell' } export enum GetLifiSwapRouteDirection { to = 'to', - from = 'from', + from = 'from' } export enum TokenType { ERC20 = 'ERC20', ERC721 = 'ERC721', - ERC1155 = 'ERC1155', + ERC1155 = 'ERC1155' } export enum TransakBuySell { UNKNOWN = 'UNKNOWN', BUY = 'BUY', - SELL = 'SELL', + SELL = 'SELL' } export enum TradeType { EXACT_INPUT = 'EXACT_INPUT', - EXACT_OUTPUT = 'EXACT_OUTPUT', + EXACT_OUTPUT = 'EXACT_OUTPUT' } export enum CheckoutOptionCrypto { none = 'none', partially = 'partially', - all = 'all', + all = 'all' } export enum CheckoutOptionNFTCheckoutProvider { unknown = 'unknown', sardine = 'sardine', - transak = 'transak', + transak = 'transak' } export enum CheckoutOptionOnRampProvider { unknown = 'unknown', sardine = 'sardine', - transak = 'transak', + transak = 'transak' } export enum CheckoutOptionSwapProvider { unknown = 'unknown', - lifi = 'lifi', + lifi = 'lifi' } export interface Version { @@ -149,7 +150,7 @@ export interface RuntimeStatus { branch: string commitHash: string checks: RuntimeChecks - numTxnsRelayed: { [key: string]: NumTxnsRelayed } + numTxnsRelayed: {[key: string]: NumTxnsRelayed} } export interface NumTxnsRelayed { @@ -159,7 +160,8 @@ export interface NumTxnsRelayed { period: number } -export interface RuntimeChecks {} +export interface RuntimeChecks { +} export interface SequenceContext { factory: string @@ -958,14 +960,14 @@ export interface IntentQuote { quoteProvider: string quoteProviderRequestId: string quoteProviderFeeUsd: string - feeQuotes: { [key: string]: string } + feeQuotes: {[key: string]: string} } export interface API { /** - * + * * Runtime - * + * */ ping(headers?: object, signal?: AbortSignal): Promise version(headers?: object, signal?: AbortSignal): Promise @@ -973,133 +975,70 @@ export interface API { clock(headers?: object, signal?: AbortSignal): Promise getSequenceContext(headers?: object, signal?: AbortSignal): Promise /** - * + * * Auth - * + * * TODO: rename 'ewtString' arg to 'ethauthProof' */ getAuthToken(args: GetAuthTokenArgs, headers?: object, signal?: AbortSignal): Promise getAuthToken2(args: GetAuthToken2Args, headers?: object, signal?: AbortSignal): Promise - sendPasswordlessLink( - args: SendPasswordlessLinkArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - registerPublicKey( - args: RegisterPublicKeyArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + sendPasswordlessLink(args: SendPasswordlessLinkArgs, headers?: object, signal?: AbortSignal): Promise + registerPublicKey(args: RegisterPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise getPublicKey(args: GetPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Contacts / Friends - * + * */ friendList(args: FriendListArgs, headers?: object, signal?: AbortSignal): Promise - getFriendByAddress( - args: GetFriendByAddressArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + getFriendByAddress(args: GetFriendByAddressArgs, headers?: object, signal?: AbortSignal): Promise searchFriends(args: SearchFriendsArgs, headers?: object, signal?: AbortSignal): Promise addFriend(args: AddFriendArgs, headers?: object, signal?: AbortSignal): Promise - updateFriendNickname( - args: UpdateFriendNicknameArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + updateFriendNickname(args: UpdateFriendNicknameArgs, headers?: object, signal?: AbortSignal): Promise removeFriend(args: RemoveFriendArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Chain-Utils - * + * */ contractCall(args: ContractCallArgs, headers?: object, signal?: AbortSignal): Promise - decodeContractCall( - args: DecodeContractCallArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - lookupContractCallSelectors( - args: LookupContractCallSelectorsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + decodeContractCall(args: DecodeContractCallArgs, headers?: object, signal?: AbortSignal): Promise + lookupContractCallSelectors(args: LookupContractCallSelectorsArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * User Storage - * + * */ userStorageFetch(args: UserStorageFetchArgs, headers?: object, signal?: AbortSignal): Promise userStorageSave(args: UserStorageSaveArgs, headers?: object, signal?: AbortSignal): Promise - userStorageDelete( - args: UserStorageDeleteArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - userStorageFetchAll( - args: UserStorageFetchAllArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + userStorageDelete(args: UserStorageDeleteArgs, headers?: object, signal?: AbortSignal): Promise + userStorageFetchAll(args: UserStorageFetchAllArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Wallet utils - * + * */ getMoonpayLink(args: GetMoonpayLinkArgs, headers?: object, signal?: AbortSignal): Promise /** * - IsUsingGoogleMail(domain: string) => (yes: bool) */ - resolveENSAddress( - args: ResolveENSAddressArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + resolveENSAddress(args: ResolveENSAddressArgs, headers?: object, signal?: AbortSignal): Promise /** * TODO: we can add walletContext optional in the future when we need it * NOTE: chainId can be either a number or canonical name */ isValidSignature(args: IsValidSignatureArgs, headers?: object, signal?: AbortSignal): Promise - isValidMessageSignature( - args: IsValidMessageSignatureArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - isValidTypedDataSignature( - args: IsValidTypedDataSignatureArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - isValidETHAuthProof( - args: IsValidETHAuthProofArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + isValidMessageSignature(args: IsValidMessageSignatureArgs, headers?: object, signal?: AbortSignal): Promise + isValidTypedDataSignature(args: IsValidTypedDataSignatureArgs, headers?: object, signal?: AbortSignal): Promise + isValidETHAuthProof(args: IsValidETHAuthProofArgs, headers?: object, signal?: AbortSignal): Promise getOnRampURL(args: GetOnRampURLArgs, headers?: object, signal?: AbortSignal): Promise sardineGetClientToken(headers?: object, signal?: AbortSignal): Promise - sardineGetNFTCheckoutToken( - args: SardineGetNFTCheckoutTokenArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - sardineGetNFTCheckoutOrderStatus( - args: SardineGetNFTCheckoutOrderStatusArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + sardineGetNFTCheckoutToken(args: SardineGetNFTCheckoutTokenArgs, headers?: object, signal?: AbortSignal): Promise + sardineGetNFTCheckoutOrderStatus(args: SardineGetNFTCheckoutOrderStatusArgs, headers?: object, signal?: AbortSignal): Promise sardineGetSupportedRegions(headers?: object, signal?: AbortSignal): Promise - sardineGetSupportedFiatCurrencies( - headers?: object, - signal?: AbortSignal, - ): Promise + sardineGetSupportedFiatCurrencies(headers?: object, signal?: AbortSignal): Promise sardineGetSupportedTokens(headers?: object, signal?: AbortSignal): Promise - sardineGetSupportedTokenForSwap( - args: SardineGetSupportedTokenForSwapArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + sardineGetSupportedTokenForSwap(args: SardineGetSupportedTokenForSwapArgs, headers?: object, signal?: AbortSignal): Promise sardineGetEnabledTokens(headers?: object, signal?: AbortSignal): Promise sardineGetQuote(args: SardineGetQuoteArgs, headers?: object, signal?: AbortSignal): Promise /** @@ -1109,302 +1048,172 @@ export interface API { /** * Deprecated. Use SardineGetNFTCheckoutToken() instead. */ - getSardineNFTCheckoutToken( - args: GetSardineNFTCheckoutTokenArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + getSardineNFTCheckoutToken(args: GetSardineNFTCheckoutTokenArgs, headers?: object, signal?: AbortSignal): Promise /** * Deprecated. Use SardineGetNFTCheckoutOrderStatus() instead. */ - getSardineNFTCheckoutOrderStatus( - args: GetSardineNFTCheckoutOrderStatusArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + getSardineNFTCheckoutOrderStatus(args: GetSardineNFTCheckoutOrderStatusArgs, headers?: object, signal?: AbortSignal): Promise transakGetCountries(headers?: object, signal?: AbortSignal): Promise transakGetCryptoCurrencies(headers?: object, signal?: AbortSignal): Promise transakGetFiatCurrencies(headers?: object, signal?: AbortSignal): Promise transakGetPrice(args: TransakGetPriceArgs, headers?: object, signal?: AbortSignal): Promise - transakGetSupportedNFTCheckoutChains( - headers?: object, - signal?: AbortSignal, - ): Promise + transakGetSupportedNFTCheckoutChains(headers?: object, signal?: AbortSignal): Promise /** - * + * * Price Feed - * + * */ getCoinPrices(args: GetCoinPricesArgs, headers?: object, signal?: AbortSignal): Promise - getCollectiblePrices( - args: GetCollectiblePricesArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + getCollectiblePrices(args: GetCollectiblePricesArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Price Feed utils - * + * */ getExchangeRate(args: GetExchangeRateArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Util / misc - * + * */ memoryStore(args: MemoryStoreArgs, headers?: object, signal?: AbortSignal): Promise memoryLoad(args: MemoryLoadArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Legacy - * + * */ getInviteInfo(headers?: object, signal?: AbortSignal): Promise /** * NOTE: we're still using this from SW-API to Sequence-API to claim invite code */ - isValidAccessCode( - args: IsValidAccessCodeArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - internalClaimAccessCode( - args: InternalClaimAccessCodeArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + isValidAccessCode(args: IsValidAccessCodeArgs, headers?: object, signal?: AbortSignal): Promise + internalClaimAccessCode(args: InternalClaimAccessCodeArgs, headers?: object, signal?: AbortSignal): Promise /** * Utils */ - blockNumberAtTime( - args: BlockNumberAtTimeArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + blockNumberAtTime(args: BlockNumberAtTimeArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Paper * TODO: deprecate in the future - * + * */ - paperSessionSecret( - args: PaperSessionSecretArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - paperSessionSecret2( - args: PaperSessionSecret2Args, - headers?: object, - signal?: AbortSignal, - ): Promise + paperSessionSecret(args: PaperSessionSecretArgs, headers?: object, signal?: AbortSignal): Promise + paperSessionSecret2(args: PaperSessionSecret2Args, headers?: object, signal?: AbortSignal): Promise /** - * + * * Linked wallets (v0 -- simple support) - * + * */ linkWallet(args: LinkWalletArgs, headers?: object, signal?: AbortSignal): Promise getLinkedWallets(args: GetLinkedWalletsArgs, headers?: object, signal?: AbortSignal): Promise - removeLinkedWallet( - args: RemoveLinkedWalletArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + removeLinkedWallet(args: RemoveLinkedWalletArgs, headers?: object, signal?: AbortSignal): Promise /** * NOTE: these methods are deprecated, please do not use them. We may resurface them in the future, but just wanted * to be clear, they are not necessary for our linked wallets. */ - generateWaaSVerificationURL( - args: GenerateWaaSVerificationURLArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - validateWaaSVerificationNonce( - args: ValidateWaaSVerificationNonceArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + generateWaaSVerificationURL(args: GenerateWaaSVerificationURLArgs, headers?: object, signal?: AbortSignal): Promise + validateWaaSVerificationNonce(args: ValidateWaaSVerificationNonceArgs, headers?: object, signal?: AbortSignal): Promise /** - * - * + * + * * WaaS child wallet adoption - * + * */ - listAdoptedWallets( - args: ListAdoptedWalletsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + listAdoptedWallets(args: ListAdoptedWalletsArgs, headers?: object, signal?: AbortSignal): Promise getLifiChains(headers?: object, signal?: AbortSignal): Promise getLifiTokens(args: GetLifiTokensArgs, headers?: object, signal?: AbortSignal): Promise /** * All parameters except `params` are deprecated. * Use only the `params` object to pass values. */ - getLifiSwapRoutes( - args: GetLifiSwapRoutesArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + getLifiSwapRoutes(args: GetLifiSwapRoutesArgs, headers?: object, signal?: AbortSignal): Promise getLifiSwapQuote(args: GetLifiSwapQuoteArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Chain abstraction - * + * */ - getIntentCallsPayloads( - args: GetIntentCallsPayloadsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - commitIntentConfig( - args: CommitIntentConfigArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + getIntentCallsPayloads(args: GetIntentCallsPayloadsArgs, headers?: object, signal?: AbortSignal): Promise + commitIntentConfig(args: CommitIntentConfigArgs, headers?: object, signal?: AbortSignal): Promise getIntentConfig(args: GetIntentConfigArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Inventory, payments and management - * + * */ listCurrencyGroups(headers?: object, signal?: AbortSignal): Promise - addOffchainInventory( - args: AddOffchainInventoryArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - getOffchainInventory( - args: GetOffchainInventoryArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - listOffchainInventories( - args: ListOffchainInventoriesArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - updateOffchainInventory( - args: UpdateOffchainInventoryArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - deleteOffchainInventory( - args: DeleteOffchainInventoryArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - requestOffchainPayment( - args: RequestOffchainPaymentArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - listOffchainPayments( - args: ListOffchainPaymentsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + addOffchainInventory(args: AddOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise + getOffchainInventory(args: GetOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise + listOffchainInventories(args: ListOffchainInventoriesArgs, headers?: object, signal?: AbortSignal): Promise + updateOffchainInventory(args: UpdateOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise + deleteOffchainInventory(args: DeleteOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise + requestOffchainPayment(args: RequestOffchainPaymentArgs, headers?: object, signal?: AbortSignal): Promise + listOffchainPayments(args: ListOffchainPaymentsArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Packs - * + * */ savePack(args: SavePackArgs, headers?: object, signal?: AbortSignal): Promise getPack(args: GetPackArgs, headers?: object, signal?: AbortSignal): Promise getPackIds(args: GetPackIdsArgs, headers?: object, signal?: AbortSignal): Promise deletePack(args: DeletePackArgs, headers?: object, signal?: AbortSignal): Promise - updatePackContent( - args: UpdatePackContentArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + updatePackContent(args: UpdatePackContentArgs, headers?: object, signal?: AbortSignal): Promise getRevealTxData(args: GetRevealTxDataArgs, headers?: object, signal?: AbortSignal): Promise - checkoutOptionsPrimary( - args: CheckoutOptionsPrimaryArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - checkoutOptionsSecondary( - args: CheckoutOptionsSecondaryArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - checkoutOptionsGetTransakContractID( - args: CheckoutOptionsGetTransakContractIDArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - fortePayCreateIntent( - args: FortePayCreateIntentArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - fortePayGetPaymentStatuses( - args: FortePayGetPaymentStatusesArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + checkoutOptionsPrimary(args: CheckoutOptionsPrimaryArgs, headers?: object, signal?: AbortSignal): Promise + checkoutOptionsSecondary(args: CheckoutOptionsSecondaryArgs, headers?: object, signal?: AbortSignal): Promise + checkoutOptionsGetTransakContractID(args: CheckoutOptionsGetTransakContractIDArgs, headers?: object, signal?: AbortSignal): Promise + fortePayCreateIntent(args: FortePayCreateIntentArgs, headers?: object, signal?: AbortSignal): Promise + fortePayGetPaymentStatuses(args: FortePayGetPaymentStatusesArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * CCTP - * + * */ getCCTPTransfer(args: GetCCTPTransferArgs, headers?: object, signal?: AbortSignal): Promise - queueCCTPTransfer( - args: QueueCCTPTransferArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + queueCCTPTransfer(args: QueueCCTPTransferArgs, headers?: object, signal?: AbortSignal): Promise /** - * + * * Intent Machine Worker - * + * */ - queueIntentConfigExecution( - args: QueueIntentConfigExecutionArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - getIntentConfigExecutionStatus( - args: GetIntentConfigExecutionStatusArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - listIntentConfigs( - args: ListIntentConfigsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - queueMetaTxnReceipt( - args: QueueMetaTxnReceiptArgs, - headers?: object, - signal?: AbortSignal, - ): Promise -} - -export interface PingArgs {} + queueIntentConfigExecution(args: QueueIntentConfigExecutionArgs, headers?: object, signal?: AbortSignal): Promise + getIntentConfigExecutionStatus(args: GetIntentConfigExecutionStatusArgs, headers?: object, signal?: AbortSignal): Promise + listIntentConfigs(args: ListIntentConfigsArgs, headers?: object, signal?: AbortSignal): Promise + queueMetaTxnReceipt(args: QueueMetaTxnReceiptArgs, headers?: object, signal?: AbortSignal): Promise +} + +export interface PingArgs { +} export interface PingReturn { - status: boolean + status: boolean +} +export interface VersionArgs { } -export interface VersionArgs {} export interface VersionReturn { - version: Version + version: Version +} +export interface RuntimeStatusArgs { } -export interface RuntimeStatusArgs {} export interface RuntimeStatusReturn { - status: RuntimeStatus + status: RuntimeStatus +} +export interface ClockArgs { } -export interface ClockArgs {} export interface ClockReturn { - serverTime: string + serverTime: string +} +export interface GetSequenceContextArgs { } -export interface GetSequenceContextArgs {} export interface GetSequenceContextReturn { - data: SequenceContext + data: SequenceContext } export interface GetAuthTokenArgs { ewtString: string @@ -1415,7 +1224,7 @@ export interface GetAuthTokenReturn { status: boolean jwtToken: string address: string - user?: User + user?: User } export interface GetAuthToken2Args { ewtString: string @@ -1426,7 +1235,7 @@ export interface GetAuthToken2Return { status: boolean jwtToken: string address: string - user?: User + user?: User } export interface SendPasswordlessLinkArgs { email: string @@ -1435,21 +1244,21 @@ export interface SendPasswordlessLinkArgs { } export interface SendPasswordlessLinkReturn { - status: boolean + status: boolean } export interface RegisterPublicKeyArgs { publicKey: PublicKey } export interface RegisterPublicKeyReturn { - status: boolean + status: boolean } export interface GetPublicKeyArgs { id: string } export interface GetPublicKeyReturn { - publicKey: PublicKey + publicKey: PublicKey } export interface FriendListArgs { nickname?: string @@ -1458,7 +1267,7 @@ export interface FriendListArgs { export interface FriendListReturn { page: Page - friends: Array + friends: Array } export interface GetFriendByAddressArgs { friendAddress: string @@ -1466,7 +1275,7 @@ export interface GetFriendByAddressArgs { export interface GetFriendByAddressReturn { status: boolean - friend: Friend + friend: Friend } export interface SearchFriendsArgs { filterUsername: string @@ -1474,7 +1283,7 @@ export interface SearchFriendsArgs { } export interface SearchFriendsReturn { - friends: Array + friends: Array } export interface AddFriendArgs { friendAddress: string @@ -1483,7 +1292,7 @@ export interface AddFriendArgs { export interface AddFriendReturn { status: boolean - friend?: Friend + friend?: Friend } export interface UpdateFriendNicknameArgs { friendAddress: string @@ -1492,14 +1301,14 @@ export interface UpdateFriendNicknameArgs { export interface UpdateFriendNicknameReturn { status: boolean - friend?: Friend + friend?: Friend } export interface RemoveFriendArgs { friendAddress: string } export interface RemoveFriendReturn { - status: boolean + status: boolean } export interface ContractCallArgs { chainID: string @@ -1510,28 +1319,28 @@ export interface ContractCallArgs { } export interface ContractCallReturn { - returns: Array + returns: Array } export interface DecodeContractCallArgs { callData: string } export interface DecodeContractCallReturn { - call: ContractCall + call: ContractCall } export interface LookupContractCallSelectorsArgs { selectors: Array } export interface LookupContractCallSelectorsReturn { - signatures: Array> + signatures: Array> } export interface UserStorageFetchArgs { key: string } export interface UserStorageFetchReturn { - object: any + object: any } export interface UserStorageSaveArgs { key: string @@ -1539,28 +1348,28 @@ export interface UserStorageSaveArgs { } export interface UserStorageSaveReturn { - ok: boolean + ok: boolean } export interface UserStorageDeleteArgs { key: string } export interface UserStorageDeleteReturn { - ok: boolean + ok: boolean } export interface UserStorageFetchAllArgs { keys?: Array } export interface UserStorageFetchAllReturn { - objects: { [key: string]: any } + objects: {[key: string]: any} } export interface GetMoonpayLinkArgs { url: string } export interface GetMoonpayLinkReturn { - signedUrl: string + signedUrl: string } export interface ResolveENSAddressArgs { ens: string @@ -1568,7 +1377,7 @@ export interface ResolveENSAddressArgs { export interface ResolveENSAddressReturn { address: string - ok: boolean + ok: boolean } export interface IsValidSignatureArgs { chainId: string @@ -1578,7 +1387,7 @@ export interface IsValidSignatureArgs { } export interface IsValidSignatureReturn { - isValid: boolean + isValid: boolean } export interface IsValidMessageSignatureArgs { chainId: string @@ -1588,7 +1397,7 @@ export interface IsValidMessageSignatureArgs { } export interface IsValidMessageSignatureReturn { - isValid: boolean + isValid: boolean } export interface IsValidTypedDataSignatureArgs { chainId: string @@ -1598,7 +1407,7 @@ export interface IsValidTypedDataSignatureArgs { } export interface IsValidTypedDataSignatureReturn { - isValid: boolean + isValid: boolean } export interface IsValidETHAuthProofArgs { chainId: string @@ -1607,48 +1416,52 @@ export interface IsValidETHAuthProofArgs { } export interface IsValidETHAuthProofReturn { - isValid: boolean + isValid: boolean } export interface GetOnRampURLArgs { chainId: string } export interface GetOnRampURLReturn { - url: string + url: string +} +export interface SardineGetClientTokenArgs { } -export interface SardineGetClientTokenArgs {} export interface SardineGetClientTokenReturn { - token: string + token: string } export interface SardineGetNFTCheckoutTokenArgs { params: SardineNFTCheckoutParams } export interface SardineGetNFTCheckoutTokenReturn { - resp: SardineNFTCheckout + resp: SardineNFTCheckout } export interface SardineGetNFTCheckoutOrderStatusArgs { orderId: string } export interface SardineGetNFTCheckoutOrderStatusReturn { - resp: SardineOrder + resp: SardineOrder +} +export interface SardineGetSupportedRegionsArgs { } -export interface SardineGetSupportedRegionsArgs {} export interface SardineGetSupportedRegionsReturn { - regions: Array + regions: Array +} +export interface SardineGetSupportedFiatCurrenciesArgs { } -export interface SardineGetSupportedFiatCurrenciesArgs {} export interface SardineGetSupportedFiatCurrenciesReturn { - tokens: Array + tokens: Array +} +export interface SardineGetSupportedTokensArgs { } -export interface SardineGetSupportedTokensArgs {} export interface SardineGetSupportedTokensReturn { - tokens: Array + tokens: Array } export interface SardineGetSupportedTokenForSwapArgs { network: string @@ -1656,86 +1469,92 @@ export interface SardineGetSupportedTokenForSwapArgs { } export interface SardineGetSupportedTokenForSwapReturn { - token: SardineSupportedTokenForSwap + token: SardineSupportedTokenForSwap +} +export interface SardineGetEnabledTokensArgs { } -export interface SardineGetEnabledTokensArgs {} export interface SardineGetEnabledTokensReturn { - tokens: Array + tokens: Array } export interface SardineGetQuoteArgs { params: SardineGetQuoteParams } export interface SardineGetQuoteReturn { - quote: SardineQuote + quote: SardineQuote +} +export interface GetSardineClientTokenArgs { } -export interface GetSardineClientTokenArgs {} export interface GetSardineClientTokenReturn { - token: string + token: string } export interface GetSardineNFTCheckoutTokenArgs { params: SardineNFTCheckoutParams } export interface GetSardineNFTCheckoutTokenReturn { - resp: SardineNFTCheckout + resp: SardineNFTCheckout } export interface GetSardineNFTCheckoutOrderStatusArgs { orderId: string } export interface GetSardineNFTCheckoutOrderStatusReturn { - resp: SardineOrder + resp: SardineOrder +} +export interface TransakGetCountriesArgs { } -export interface TransakGetCountriesArgs {} export interface TransakGetCountriesReturn { - regions: Array + regions: Array +} +export interface TransakGetCryptoCurrenciesArgs { } -export interface TransakGetCryptoCurrenciesArgs {} export interface TransakGetCryptoCurrenciesReturn { - currencies: Array + currencies: Array +} +export interface TransakGetFiatCurrenciesArgs { } -export interface TransakGetFiatCurrenciesArgs {} export interface TransakGetFiatCurrenciesReturn { - currencies: Array + currencies: Array } export interface TransakGetPriceArgs { params: TransakGetPriceParams } export interface TransakGetPriceReturn { - price: TransakPrice + price: TransakPrice +} +export interface TransakGetSupportedNFTCheckoutChainsArgs { } -export interface TransakGetSupportedNFTCheckoutChainsArgs {} export interface TransakGetSupportedNFTCheckoutChainsReturn { - chains: Array + chains: Array } export interface GetCoinPricesArgs { tokens: Array } export interface GetCoinPricesReturn { - tokenPrices: Array + tokenPrices: Array } export interface GetCollectiblePricesArgs { tokens: Array } export interface GetCollectiblePricesReturn { - tokenPrices: Array + tokenPrices: Array } export interface GetExchangeRateArgs { toCurrency: string } export interface GetExchangeRateReturn { - exchangeRate: ExchangeRate + exchangeRate: ExchangeRate } export interface MemoryStoreArgs { key: string @@ -1743,26 +1562,27 @@ export interface MemoryStoreArgs { } export interface MemoryStoreReturn { - ok: boolean + ok: boolean } export interface MemoryLoadArgs { key: string } export interface MemoryLoadReturn { - value: string + value: string +} +export interface GetInviteInfoArgs { } -export interface GetInviteInfoArgs {} export interface GetInviteInfoReturn { - inviteInfo: InviteInfo + inviteInfo: InviteInfo } export interface IsValidAccessCodeArgs { accessCode: string } export interface IsValidAccessCodeReturn { - status: boolean + status: boolean } export interface InternalClaimAccessCodeArgs { address: string @@ -1770,7 +1590,7 @@ export interface InternalClaimAccessCodeArgs { } export interface InternalClaimAccessCodeReturn { - status: boolean + status: boolean } export interface BlockNumberAtTimeArgs { chainId: number @@ -1778,7 +1598,7 @@ export interface BlockNumberAtTimeArgs { } export interface BlockNumberAtTimeReturn { - blocks: Array + blocks: Array } export interface PaperSessionSecretArgs { chainName: string @@ -1788,7 +1608,7 @@ export interface PaperSessionSecretArgs { } export interface PaperSessionSecretReturn { - secret: string + secret: string } export interface PaperSessionSecret2Args { chainName: string @@ -1798,7 +1618,7 @@ export interface PaperSessionSecret2Args { } export interface PaperSessionSecret2Return { - secret: string + secret: string } export interface LinkWalletArgs { parentWalletAddress: string @@ -1812,7 +1632,7 @@ export interface LinkWalletArgs { } export interface LinkWalletReturn { - status: boolean + status: boolean } export interface GetLinkedWalletsArgs { parentWalletAddress: string @@ -1822,7 +1642,7 @@ export interface GetLinkedWalletsArgs { } export interface GetLinkedWalletsReturn { - linkedWallets: Array + linkedWallets: Array } export interface RemoveLinkedWalletArgs { parentWalletAddress: string @@ -1833,7 +1653,7 @@ export interface RemoveLinkedWalletArgs { } export interface RemoveLinkedWalletReturn { - status: boolean + status: boolean } export interface GenerateWaaSVerificationURLArgs { walletAddress: string @@ -1841,7 +1661,7 @@ export interface GenerateWaaSVerificationURLArgs { export interface GenerateWaaSVerificationURLReturn { nonce: string - verificationURL: string + verificationURL: string } export interface ValidateWaaSVerificationNonceArgs { nonce: string @@ -1851,7 +1671,7 @@ export interface ValidateWaaSVerificationNonceArgs { } export interface ValidateWaaSVerificationNonceReturn { - walletAddress: string + walletAddress: string } export interface ListAdoptedWalletsArgs { page?: Page @@ -1859,19 +1679,20 @@ export interface ListAdoptedWalletsArgs { export interface ListAdoptedWalletsReturn { page: Page - wallets: Array + wallets: Array +} +export interface GetLifiChainsArgs { } -export interface GetLifiChainsArgs {} export interface GetLifiChainsReturn { - chains: Array + chains: Array } export interface GetLifiTokensArgs { chainIds: Array } export interface GetLifiTokensReturn { - tokens: Array + tokens: Array } export interface GetLifiSwapRoutesArgs { params: GetLifiSwapRouteParams @@ -1882,14 +1703,14 @@ export interface GetLifiSwapRoutesArgs { } export interface GetLifiSwapRoutesReturn { - routes: Array + routes: Array } export interface GetLifiSwapQuoteArgs { params: GetLifiSwapQuoteParams } export interface GetLifiSwapQuoteReturn { - quote: LifiSwapQuote + quote: LifiSwapQuote } export interface GetIntentCallsPayloadsArgs { userAddress: string @@ -1916,9 +1737,9 @@ export interface GetIntentCallsPayloadsReturn { metaTxns: Array trailsFee: TrailsFee quote: IntentQuote - feeQuotes: { [key: string]: string } + feeQuotes: {[key: string]: string} originIntentAddress: string - destinationIntentAddress: string + destinationIntentAddress: string } export interface CommitIntentConfigArgs { originIntentAddress: string @@ -1930,52 +1751,54 @@ export interface CommitIntentConfigArgs { } export interface CommitIntentConfigReturn { - config: IntentConfig + config: IntentConfig } export interface GetIntentConfigArgs { intentAddress: string } export interface GetIntentConfigReturn { - config: IntentConfig + config: IntentConfig +} +export interface ListCurrencyGroupsArgs { } -export interface ListCurrencyGroupsArgs {} export interface ListCurrencyGroupsReturn { - currencyGroups: Array + currencyGroups: Array } export interface AddOffchainInventoryArgs { inventory: OffchainInventory } export interface AddOffchainInventoryReturn { - inventoryId: number + inventoryId: number } export interface GetOffchainInventoryArgs { inventoryId: number } export interface GetOffchainInventoryReturn { - inventory: OffchainInventory + inventory: OffchainInventory } export interface ListOffchainInventoriesArgs { projectId: number } export interface ListOffchainInventoriesReturn { - inventory: Array + inventory: Array } export interface UpdateOffchainInventoryArgs { inventory: OffchainInventory } -export interface UpdateOffchainInventoryReturn {} +export interface UpdateOffchainInventoryReturn { +} export interface DeleteOffchainInventoryArgs { inventoryId: number } export interface DeleteOffchainInventoryReturn { - ok: boolean + ok: boolean } export interface RequestOffchainPaymentArgs { inventoryId: number @@ -1985,7 +1808,7 @@ export interface RequestOffchainPaymentArgs { } export interface RequestOffchainPaymentReturn { - payment: PaymentResponse + payment: PaymentResponse } export interface ListOffchainPaymentsArgs { inventoryId: number @@ -1994,14 +1817,14 @@ export interface ListOffchainPaymentsArgs { export interface ListOffchainPaymentsReturn { page: Page - payments: Array + payments: Array } export interface SavePackArgs { pack: Pack } export interface SavePackReturn { - merkleRoot: string + merkleRoot: string } export interface GetPackArgs { contractAddress: string @@ -2010,7 +1833,7 @@ export interface GetPackArgs { } export interface GetPackReturn { - pack: Pack + pack: Pack } export interface GetPackIdsArgs { contractAddress: string @@ -2018,7 +1841,7 @@ export interface GetPackIdsArgs { } export interface GetPackIdsReturn { - packIds: Array + packIds: Array } export interface DeletePackArgs { contractAddress: string @@ -2027,14 +1850,14 @@ export interface DeletePackArgs { } export interface DeletePackReturn { - status: boolean + status: boolean } export interface UpdatePackContentArgs { pack: Pack } export interface UpdatePackContentReturn { - merkleRoot: string + merkleRoot: string } export interface GetRevealTxDataArgs { contractAddress: string @@ -2044,7 +1867,7 @@ export interface GetRevealTxDataArgs { } export interface GetRevealTxDataReturn { - txData: string + txData: string } export interface CheckoutOptionsPrimaryArgs { chainId: number @@ -2055,7 +1878,7 @@ export interface CheckoutOptionsPrimaryArgs { } export interface CheckoutOptionsPrimaryReturn { - options: CheckoutOptions + options: CheckoutOptions } export interface CheckoutOptionsSecondaryArgs { chainId: number @@ -2064,7 +1887,7 @@ export interface CheckoutOptionsSecondaryArgs { } export interface CheckoutOptionsSecondaryReturn { - options: CheckoutOptions + options: CheckoutOptions } export interface CheckoutOptionsGetTransakContractIDArgs { chainId: number @@ -2072,28 +1895,28 @@ export interface CheckoutOptionsGetTransakContractIDArgs { } export interface CheckoutOptionsGetTransakContractIDReturn { - contractId: string + contractId: string } export interface FortePayCreateIntentArgs { intent: FortePayCreateIntent } export interface FortePayCreateIntentReturn { - resp: FortePayIntent + resp: FortePayIntent } export interface FortePayGetPaymentStatusesArgs { paymentIntentIds: Array } export interface FortePayGetPaymentStatusesReturn { - statuses: Array + statuses: Array } export interface GetCCTPTransferArgs { id: string } export interface GetCCTPTransferReturn { - transfer: CCTPTransfer + transfer: CCTPTransfer } export interface QueueCCTPTransferArgs { sourceTxHash?: string @@ -2103,21 +1926,21 @@ export interface QueueCCTPTransferArgs { } export interface QueueCCTPTransferReturn { - transfer: CCTPTransfer + transfer: CCTPTransfer } export interface QueueIntentConfigExecutionArgs { intentConfigId: number } export interface QueueIntentConfigExecutionReturn { - status: boolean + status: boolean } export interface GetIntentConfigExecutionStatusArgs { intentConfigId: number } export interface GetIntentConfigExecutionStatusReturn { - executionStatus: string + executionStatus: string } export interface ListIntentConfigsArgs { page?: Page @@ -2126,16 +1949,18 @@ export interface ListIntentConfigsArgs { export interface ListIntentConfigsReturn { page: Page - intentConfigs: Array + intentConfigs: Array } export interface QueueMetaTxnReceiptArgs { metaTxID: string } export interface QueueMetaTxnReceiptReturn { - status: boolean + status: boolean } + + // // Client // @@ -2152,1743 +1977,1420 @@ export class API implements API { private url(name: string): string { return this.hostname + this.path + name } - + ping = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('Ping'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('Ping'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + version = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('Version'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - version: _data.version, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('Version'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + version: (_data.version), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + runtimeStatus = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('RuntimeStatus'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('RuntimeStatus'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + clock = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('Clock'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - serverTime: _data.serverTime, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('Clock'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + serverTime: (_data.serverTime), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getSequenceContext = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetSequenceContext'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - data: _data.data, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('GetSequenceContext'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + data: (_data.data), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getAuthToken = (args: GetAuthTokenArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetAuthToken'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - jwtToken: _data.jwtToken, - address: _data.address, - user: _data.user, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('GetAuthToken'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + jwtToken: (_data.jwtToken), + address: (_data.address), + user: (_data.user), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getAuthToken2 = (args: GetAuthToken2Args, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetAuthToken2'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - jwtToken: _data.jwtToken, - address: _data.address, - user: _data.user, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - sendPasswordlessLink = ( - args: SendPasswordlessLinkArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('SendPasswordlessLink'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - registerPublicKey = ( - args: RegisterPublicKeyArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('RegisterPublicKey'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('GetAuthToken2'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + jwtToken: (_data.jwtToken), + address: (_data.address), + user: (_data.user), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + sendPasswordlessLink = (args: SendPasswordlessLinkArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('SendPasswordlessLink'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + registerPublicKey = (args: RegisterPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('RegisterPublicKey'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getPublicKey = (args: GetPublicKeyArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetPublicKey'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - publicKey: _data.publicKey, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('GetPublicKey'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + publicKey: (_data.publicKey), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + friendList = (args: FriendListArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('FriendList'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - page: _data.page, - friends: >_data.friends, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getFriendByAddress = ( - args: GetFriendByAddressArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetFriendByAddress'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - friend: _data.friend, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('FriendList'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + page: (_data.page), + friends: >(_data.friends), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getFriendByAddress = (args: GetFriendByAddressArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetFriendByAddress'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + friend: (_data.friend), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + searchFriends = (args: SearchFriendsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('SearchFriends'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - friends: >_data.friends, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('SearchFriends'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + friends: >(_data.friends), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + addFriend = (args: AddFriendArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('AddFriend'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - friend: _data.friend, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - updateFriendNickname = ( - args: UpdateFriendNicknameArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('UpdateFriendNickname'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - friend: _data.friend, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('AddFriend'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + friend: (_data.friend), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + updateFriendNickname = (args: UpdateFriendNicknameArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('UpdateFriendNickname'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + friend: (_data.friend), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + removeFriend = (args: RemoveFriendArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('RemoveFriend'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('RemoveFriend'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + contractCall = (args: ContractCallArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('ContractCall'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - returns: >_data.returns, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - decodeContractCall = ( - args: DecodeContractCallArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('DecodeContractCall'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - call: _data.call, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - lookupContractCallSelectors = ( - args: LookupContractCallSelectorsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('LookupContractCallSelectors'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - signatures: >>_data.signatures, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - userStorageFetch = ( - args: UserStorageFetchArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('UserStorageFetch'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - object: _data.object, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - userStorageSave = ( - args: UserStorageSaveArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('UserStorageSave'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - ok: _data.ok, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - userStorageDelete = ( - args: UserStorageDeleteArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('UserStorageDelete'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - ok: _data.ok, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - userStorageFetchAll = ( - args: UserStorageFetchAllArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('UserStorageFetchAll'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - objects: <{ [key: string]: any }>_data.objects, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getMoonpayLink = ( - args: GetMoonpayLinkArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetMoonpayLink'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - signedUrl: _data.signedUrl, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - resolveENSAddress = ( - args: ResolveENSAddressArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('ResolveENSAddress'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - address: _data.address, - ok: _data.ok, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - isValidSignature = ( - args: IsValidSignatureArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('IsValidSignature'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - isValid: _data.isValid, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - isValidMessageSignature = ( - args: IsValidMessageSignatureArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('IsValidMessageSignature'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - isValid: _data.isValid, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - isValidTypedDataSignature = ( - args: IsValidTypedDataSignatureArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('IsValidTypedDataSignature'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - isValid: _data.isValid, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - isValidETHAuthProof = ( - args: IsValidETHAuthProofArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('IsValidETHAuthProof'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - isValid: _data.isValid, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('ContractCall'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + returns: >(_data.returns), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + decodeContractCall = (args: DecodeContractCallArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('DecodeContractCall'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + call: (_data.call), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + lookupContractCallSelectors = (args: LookupContractCallSelectorsArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('LookupContractCallSelectors'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + signatures: >>(_data.signatures), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + userStorageFetch = (args: UserStorageFetchArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('UserStorageFetch'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + object: (_data.object), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + userStorageSave = (args: UserStorageSaveArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('UserStorageSave'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + ok: (_data.ok), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + userStorageDelete = (args: UserStorageDeleteArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('UserStorageDelete'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + ok: (_data.ok), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + userStorageFetchAll = (args: UserStorageFetchAllArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('UserStorageFetchAll'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + objects: <{[key: string]: any}>(_data.objects), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getMoonpayLink = (args: GetMoonpayLinkArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetMoonpayLink'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + signedUrl: (_data.signedUrl), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + resolveENSAddress = (args: ResolveENSAddressArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('ResolveENSAddress'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + address: (_data.address), + ok: (_data.ok), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + isValidSignature = (args: IsValidSignatureArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('IsValidSignature'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + isValid: (_data.isValid), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + isValidMessageSignature = (args: IsValidMessageSignatureArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('IsValidMessageSignature'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + isValid: (_data.isValid), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + isValidTypedDataSignature = (args: IsValidTypedDataSignatureArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('IsValidTypedDataSignature'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + isValid: (_data.isValid), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + isValidETHAuthProof = (args: IsValidETHAuthProofArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('IsValidETHAuthProof'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + isValid: (_data.isValid), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getOnRampURL = (args: GetOnRampURLArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetOnRampURL'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - url: _data.url, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('GetOnRampURL'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + url: (_data.url), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + sardineGetClientToken = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('SardineGetClientToken'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - token: _data.token, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - sardineGetNFTCheckoutToken = ( - args: SardineGetNFTCheckoutTokenArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('SardineGetNFTCheckoutToken'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - resp: _data.resp, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - sardineGetNFTCheckoutOrderStatus = ( - args: SardineGetNFTCheckoutOrderStatusArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('SardineGetNFTCheckoutOrderStatus'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - resp: _data.resp, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('SardineGetClientToken'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + token: (_data.token), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + sardineGetNFTCheckoutToken = (args: SardineGetNFTCheckoutTokenArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('SardineGetNFTCheckoutToken'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + resp: (_data.resp), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + sardineGetNFTCheckoutOrderStatus = (args: SardineGetNFTCheckoutOrderStatusArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('SardineGetNFTCheckoutOrderStatus'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + resp: (_data.resp), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + sardineGetSupportedRegions = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('SardineGetSupportedRegions'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - regions: >_data.regions, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - sardineGetSupportedFiatCurrencies = ( - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('SardineGetSupportedFiatCurrencies'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - tokens: >_data.tokens, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('SardineGetSupportedRegions'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + regions: >(_data.regions), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + sardineGetSupportedFiatCurrencies = (headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('SardineGetSupportedFiatCurrencies'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + tokens: >(_data.tokens), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + sardineGetSupportedTokens = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('SardineGetSupportedTokens'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - tokens: >_data.tokens, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - sardineGetSupportedTokenForSwap = ( - args: SardineGetSupportedTokenForSwapArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('SardineGetSupportedTokenForSwap'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - token: _data.token, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('SardineGetSupportedTokens'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + tokens: >(_data.tokens), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + sardineGetSupportedTokenForSwap = (args: SardineGetSupportedTokenForSwapArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('SardineGetSupportedTokenForSwap'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + token: (_data.token), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + sardineGetEnabledTokens = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('SardineGetEnabledTokens'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - tokens: >_data.tokens, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - sardineGetQuote = ( - args: SardineGetQuoteArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('SardineGetQuote'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - quote: _data.quote, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('SardineGetEnabledTokens'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + tokens: >(_data.tokens), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + sardineGetQuote = (args: SardineGetQuoteArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('SardineGetQuote'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + quote: (_data.quote), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getSardineClientToken = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetSardineClientToken'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - token: _data.token, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getSardineNFTCheckoutToken = ( - args: GetSardineNFTCheckoutTokenArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetSardineNFTCheckoutToken'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - resp: _data.resp, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getSardineNFTCheckoutOrderStatus = ( - args: GetSardineNFTCheckoutOrderStatusArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetSardineNFTCheckoutOrderStatus'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - resp: _data.resp, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('GetSardineClientToken'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + token: (_data.token), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getSardineNFTCheckoutToken = (args: GetSardineNFTCheckoutTokenArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetSardineNFTCheckoutToken'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + resp: (_data.resp), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getSardineNFTCheckoutOrderStatus = (args: GetSardineNFTCheckoutOrderStatusArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetSardineNFTCheckoutOrderStatus'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + resp: (_data.resp), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + transakGetCountries = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('TransakGetCountries'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - regions: >_data.regions, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('TransakGetCountries'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + regions: >(_data.regions), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + transakGetCryptoCurrencies = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('TransakGetCryptoCurrencies'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - currencies: >_data.currencies, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('TransakGetCryptoCurrencies'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + currencies: >(_data.currencies), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + transakGetFiatCurrencies = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('TransakGetFiatCurrencies'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - currencies: >_data.currencies, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - transakGetPrice = ( - args: TransakGetPriceArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('TransakGetPrice'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - price: _data.price, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - transakGetSupportedNFTCheckoutChains = ( - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('TransakGetSupportedNFTCheckoutChains'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - chains: >_data.chains, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('TransakGetFiatCurrencies'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + currencies: >(_data.currencies), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + transakGetPrice = (args: TransakGetPriceArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('TransakGetPrice'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + price: (_data.price), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + transakGetSupportedNFTCheckoutChains = (headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('TransakGetSupportedNFTCheckoutChains'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + chains: >(_data.chains), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getCoinPrices = (args: GetCoinPricesArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetCoinPrices'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - tokenPrices: >_data.tokenPrices, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getCollectiblePrices = ( - args: GetCollectiblePricesArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetCollectiblePrices'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - tokenPrices: >_data.tokenPrices, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getExchangeRate = ( - args: GetExchangeRateArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetExchangeRate'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - exchangeRate: _data.exchangeRate, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('GetCoinPrices'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + tokenPrices: >(_data.tokenPrices), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getCollectiblePrices = (args: GetCollectiblePricesArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetCollectiblePrices'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + tokenPrices: >(_data.tokenPrices), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getExchangeRate = (args: GetExchangeRateArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetExchangeRate'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + exchangeRate: (_data.exchangeRate), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + memoryStore = (args: MemoryStoreArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('MemoryStore'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - ok: _data.ok, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('MemoryStore'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + ok: (_data.ok), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + memoryLoad = (args: MemoryLoadArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('MemoryLoad'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - value: _data.value, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('MemoryLoad'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + value: (_data.value), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getInviteInfo = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetInviteInfo'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - inviteInfo: _data.inviteInfo, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - isValidAccessCode = ( - args: IsValidAccessCodeArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('IsValidAccessCode'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - internalClaimAccessCode = ( - args: InternalClaimAccessCodeArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('InternalClaimAccessCode'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - blockNumberAtTime = ( - args: BlockNumberAtTimeArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('BlockNumberAtTime'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - blocks: >_data.blocks, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - paperSessionSecret = ( - args: PaperSessionSecretArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('PaperSessionSecret'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - secret: _data.secret, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - paperSessionSecret2 = ( - args: PaperSessionSecret2Args, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('PaperSessionSecret2'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - secret: _data.secret, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('GetInviteInfo'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + inviteInfo: (_data.inviteInfo), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + isValidAccessCode = (args: IsValidAccessCodeArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('IsValidAccessCode'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + internalClaimAccessCode = (args: InternalClaimAccessCodeArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('InternalClaimAccessCode'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + blockNumberAtTime = (args: BlockNumberAtTimeArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('BlockNumberAtTime'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + blocks: >(_data.blocks), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + paperSessionSecret = (args: PaperSessionSecretArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('PaperSessionSecret'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + secret: (_data.secret), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + paperSessionSecret2 = (args: PaperSessionSecret2Args, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('PaperSessionSecret2'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + secret: (_data.secret), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + linkWallet = (args: LinkWalletArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('LinkWallet'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getLinkedWallets = ( - args: GetLinkedWalletsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetLinkedWallets'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - linkedWallets: >_data.linkedWallets, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - removeLinkedWallet = ( - args: RemoveLinkedWalletArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('RemoveLinkedWallet'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - generateWaaSVerificationURL = ( - args: GenerateWaaSVerificationURLArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GenerateWaaSVerificationURL'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - nonce: _data.nonce, - verificationURL: _data.verificationURL, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - validateWaaSVerificationNonce = ( - args: ValidateWaaSVerificationNonceArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('ValidateWaaSVerificationNonce'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - walletAddress: _data.walletAddress, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - listAdoptedWallets = ( - args: ListAdoptedWalletsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('ListAdoptedWallets'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - page: _data.page, - wallets: >_data.wallets, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('LinkWallet'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getLinkedWallets = (args: GetLinkedWalletsArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetLinkedWallets'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + linkedWallets: >(_data.linkedWallets), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + removeLinkedWallet = (args: RemoveLinkedWalletArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('RemoveLinkedWallet'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + generateWaaSVerificationURL = (args: GenerateWaaSVerificationURLArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GenerateWaaSVerificationURL'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + nonce: (_data.nonce), + verificationURL: (_data.verificationURL), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + validateWaaSVerificationNonce = (args: ValidateWaaSVerificationNonceArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('ValidateWaaSVerificationNonce'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + walletAddress: (_data.walletAddress), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + listAdoptedWallets = (args: ListAdoptedWalletsArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('ListAdoptedWallets'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + page: (_data.page), + wallets: >(_data.wallets), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getLifiChains = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetLifiChains'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - chains: >_data.chains, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('GetLifiChains'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + chains: >(_data.chains), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getLifiTokens = (args: GetLifiTokensArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetLifiTokens'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - tokens: >_data.tokens, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getLifiSwapRoutes = ( - args: GetLifiSwapRoutesArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetLifiSwapRoutes'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - routes: >_data.routes, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getLifiSwapQuote = ( - args: GetLifiSwapQuoteArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetLifiSwapQuote'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - quote: _data.quote, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getIntentCallsPayloads = ( - args: GetIntentCallsPayloadsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetIntentCallsPayloads'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - calls: >_data.calls, - preconditions: >_data.preconditions, - metaTxns: >_data.metaTxns, - trailsFee: _data.trailsFee, - quote: _data.quote, - feeQuotes: <{ [key: string]: string }>_data.feeQuotes, - originIntentAddress: _data.originIntentAddress, - destinationIntentAddress: _data.destinationIntentAddress, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - commitIntentConfig = ( - args: CommitIntentConfigArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('CommitIntentConfig'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - config: _data.config, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getIntentConfig = ( - args: GetIntentConfigArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetIntentConfig'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - config: _data.config, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('GetLifiTokens'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + tokens: >(_data.tokens), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getLifiSwapRoutes = (args: GetLifiSwapRoutesArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetLifiSwapRoutes'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + routes: >(_data.routes), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getLifiSwapQuote = (args: GetLifiSwapQuoteArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetLifiSwapQuote'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + quote: (_data.quote), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getIntentCallsPayloads = (args: GetIntentCallsPayloadsArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetIntentCallsPayloads'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + calls: >(_data.calls), + preconditions: >(_data.preconditions), + metaTxns: >(_data.metaTxns), + trailsFee: (_data.trailsFee), + quote: (_data.quote), + feeQuotes: <{[key: string]: string}>(_data.feeQuotes), + originIntentAddress: (_data.originIntentAddress), + destinationIntentAddress: (_data.destinationIntentAddress), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + commitIntentConfig = (args: CommitIntentConfigArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('CommitIntentConfig'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + config: (_data.config), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getIntentConfig = (args: GetIntentConfigArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetIntentConfig'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + config: (_data.config), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + listCurrencyGroups = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('ListCurrencyGroups'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - currencyGroups: >_data.currencyGroups, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - addOffchainInventory = ( - args: AddOffchainInventoryArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('AddOffchainInventory'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - inventoryId: _data.inventoryId, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getOffchainInventory = ( - args: GetOffchainInventoryArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetOffchainInventory'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - inventory: _data.inventory, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - listOffchainInventories = ( - args: ListOffchainInventoriesArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('ListOffchainInventories'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - inventory: >_data.inventory, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - updateOffchainInventory = ( - args: UpdateOffchainInventoryArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('UpdateOffchainInventory'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return {} - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - deleteOffchainInventory = ( - args: DeleteOffchainInventoryArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('DeleteOffchainInventory'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - ok: _data.ok, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - requestOffchainPayment = ( - args: RequestOffchainPaymentArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('RequestOffchainPayment'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - payment: _data.payment, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - listOffchainPayments = ( - args: ListOffchainPaymentsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('ListOffchainPayments'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - page: _data.page, - payments: >_data.payments, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('ListCurrencyGroups'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + currencyGroups: >(_data.currencyGroups), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + addOffchainInventory = (args: AddOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('AddOffchainInventory'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + inventoryId: (_data.inventoryId), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getOffchainInventory = (args: GetOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetOffchainInventory'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + inventory: (_data.inventory), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + listOffchainInventories = (args: ListOffchainInventoriesArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('ListOffchainInventories'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + inventory: >(_data.inventory), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + updateOffchainInventory = (args: UpdateOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('UpdateOffchainInventory'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return {} + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + deleteOffchainInventory = (args: DeleteOffchainInventoryArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('DeleteOffchainInventory'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + ok: (_data.ok), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + requestOffchainPayment = (args: RequestOffchainPaymentArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('RequestOffchainPayment'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + payment: (_data.payment), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + listOffchainPayments = (args: ListOffchainPaymentsArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('ListOffchainPayments'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + page: (_data.page), + payments: >(_data.payments), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + savePack = (args: SavePackArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('SavePack'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - merkleRoot: _data.merkleRoot, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('SavePack'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + merkleRoot: (_data.merkleRoot), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getPack = (args: GetPackArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetPack'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - pack: _data.pack, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('GetPack'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + pack: (_data.pack), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getPackIds = (args: GetPackIdsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetPackIds'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - packIds: >_data.packIds, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('GetPackIds'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + packIds: >(_data.packIds), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + deletePack = (args: DeletePackArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('DeletePack'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - updatePackContent = ( - args: UpdatePackContentArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('UpdatePackContent'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - merkleRoot: _data.merkleRoot, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getRevealTxData = ( - args: GetRevealTxDataArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetRevealTxData'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - txData: _data.txData, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - checkoutOptionsPrimary = ( - args: CheckoutOptionsPrimaryArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('CheckoutOptionsPrimary'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - options: _data.options, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - checkoutOptionsSecondary = ( - args: CheckoutOptionsSecondaryArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('CheckoutOptionsSecondary'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - options: _data.options, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - checkoutOptionsGetTransakContractID = ( - args: CheckoutOptionsGetTransakContractIDArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('CheckoutOptionsGetTransakContractID'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - contractId: _data.contractId, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - fortePayCreateIntent = ( - args: FortePayCreateIntentArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('FortePayCreateIntent'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - resp: _data.resp, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - fortePayGetPaymentStatuses = ( - args: FortePayGetPaymentStatusesArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('FortePayGetPaymentStatuses'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - statuses: >_data.statuses, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getCCTPTransfer = ( - args: GetCCTPTransferArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetCCTPTransfer'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - transfer: _data.transfer, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - queueCCTPTransfer = ( - args: QueueCCTPTransferArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('QueueCCTPTransfer'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - transfer: _data.transfer, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - queueIntentConfigExecution = ( - args: QueueIntentConfigExecutionArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('QueueIntentConfigExecution'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getIntentConfigExecutionStatus = ( - args: GetIntentConfigExecutionStatusArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetIntentConfigExecutionStatus'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - executionStatus: _data.executionStatus, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - listIntentConfigs = ( - args: ListIntentConfigsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('ListIntentConfigs'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - page: _data.page, - intentConfigs: >_data.intentConfigs, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - queueMetaTxnReceipt = ( - args: QueueMetaTxnReceiptArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('QueueMetaTxnReceipt'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } -} - -const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => { - const reqHeaders: { [key: string]: string } = { ...headers, 'Content-Type': 'application/json' } + return this.fetch( + this.url('DeletePack'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + updatePackContent = (args: UpdatePackContentArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('UpdatePackContent'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + merkleRoot: (_data.merkleRoot), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getRevealTxData = (args: GetRevealTxDataArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetRevealTxData'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + txData: (_data.txData), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + checkoutOptionsPrimary = (args: CheckoutOptionsPrimaryArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('CheckoutOptionsPrimary'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + options: (_data.options), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + checkoutOptionsSecondary = (args: CheckoutOptionsSecondaryArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('CheckoutOptionsSecondary'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + options: (_data.options), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + checkoutOptionsGetTransakContractID = (args: CheckoutOptionsGetTransakContractIDArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('CheckoutOptionsGetTransakContractID'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + contractId: (_data.contractId), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + fortePayCreateIntent = (args: FortePayCreateIntentArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('FortePayCreateIntent'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + resp: (_data.resp), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + fortePayGetPaymentStatuses = (args: FortePayGetPaymentStatusesArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('FortePayGetPaymentStatuses'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + statuses: >(_data.statuses), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getCCTPTransfer = (args: GetCCTPTransferArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetCCTPTransfer'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + transfer: (_data.transfer), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + queueCCTPTransfer = (args: QueueCCTPTransferArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('QueueCCTPTransfer'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + transfer: (_data.transfer), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + queueIntentConfigExecution = (args: QueueIntentConfigExecutionArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('QueueIntentConfigExecution'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getIntentConfigExecutionStatus = (args: GetIntentConfigExecutionStatusArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetIntentConfigExecutionStatus'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + executionStatus: (_data.executionStatus), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + listIntentConfigs = (args: ListIntentConfigsArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('ListIntentConfigs'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + page: (_data.page), + intentConfigs: >(_data.intentConfigs), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + queueMetaTxnReceipt = (args: QueueMetaTxnReceiptArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('QueueMetaTxnReceipt'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + +} + + const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => { + const reqHeaders: {[key: string]: string} = { ...headers, 'Content-Type': 'application/json' } reqHeaders[WebrpcHeader] = WebrpcHeaderValue return { method: 'POST', headers: reqHeaders, body: JSON.stringify(body || {}), - signal, + signal } } const buildResponse = (res: Response): Promise => { - return res.text().then((text) => { + return res.text().then(text => { let data try { data = JSON.parse(text) - } catch (error) { + } catch(error) { let message = '' - if (error instanceof Error) { + if (error instanceof Error) { message = error.message } throw WebrpcBadResponseError.new({ status: res.status, - cause: `JSON.parse(): ${message}: response text: ${text}`, - }) + cause: `JSON.parse(): ${message}: response text: ${text}`}, + ) } if (!res.ok) { - const code: number = typeof data.code === 'number' ? data.code : 0 + const code: number = (typeof data.code === 'number') ? data.code : 0 throw (webrpcErrorByCode[code] || WebrpcError).new(data) } return data @@ -3933,7 +3435,7 @@ export class WebrpcEndpointError extends WebrpcError { code: number = 0, message: string = `endpoint error`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcEndpointError.prototype) @@ -3946,7 +3448,7 @@ export class WebrpcRequestFailedError extends WebrpcError { code: number = -1, message: string = `request failed`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype) @@ -3959,7 +3461,7 @@ export class WebrpcBadRouteError extends WebrpcError { code: number = -2, message: string = `bad route`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadRouteError.prototype) @@ -3972,7 +3474,7 @@ export class WebrpcBadMethodError extends WebrpcError { code: number = -3, message: string = `bad method`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadMethodError.prototype) @@ -3985,7 +3487,7 @@ export class WebrpcBadRequestError extends WebrpcError { code: number = -4, message: string = `bad request`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadRequestError.prototype) @@ -3998,7 +3500,7 @@ export class WebrpcBadResponseError extends WebrpcError { code: number = -5, message: string = `bad response`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadResponseError.prototype) @@ -4011,7 +3513,7 @@ export class WebrpcServerPanicError extends WebrpcError { code: number = -6, message: string = `server panic`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcServerPanicError.prototype) @@ -4024,7 +3526,7 @@ export class WebrpcInternalErrorError extends WebrpcError { code: number = -7, message: string = `internal error`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype) @@ -4037,7 +3539,7 @@ export class WebrpcClientDisconnectedError extends WebrpcError { code: number = -8, message: string = `client disconnected`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcClientDisconnectedError.prototype) @@ -4050,7 +3552,7 @@ export class WebrpcStreamLostError extends WebrpcError { code: number = -9, message: string = `stream lost`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcStreamLostError.prototype) @@ -4063,13 +3565,14 @@ export class WebrpcStreamFinishedError extends WebrpcError { code: number = -10, message: string = `stream finished`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype) } } + // Schema errors export class UnauthorizedError extends WebrpcError { @@ -4078,7 +3581,7 @@ export class UnauthorizedError extends WebrpcError { code: number = 1000, message: string = `Unauthorized access`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnauthorizedError.prototype) @@ -4091,7 +3594,7 @@ export class PermissionDeniedError extends WebrpcError { code: number = 1001, message: string = `Permission denied`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, PermissionDeniedError.prototype) @@ -4104,7 +3607,7 @@ export class SessionExpiredError extends WebrpcError { code: number = 1002, message: string = `Session expired`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, SessionExpiredError.prototype) @@ -4117,7 +3620,7 @@ export class MethodNotFoundError extends WebrpcError { code: number = 1003, message: string = `Method not found`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, MethodNotFoundError.prototype) @@ -4130,7 +3633,7 @@ export class RequestConflictError extends WebrpcError { code: number = 1004, message: string = `Conflict with target resource`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, RequestConflictError.prototype) @@ -4143,7 +3646,7 @@ export class AbortedError extends WebrpcError { code: number = 1005, message: string = `Request aborted`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AbortedError.prototype) @@ -4156,7 +3659,7 @@ export class GeoblockedError extends WebrpcError { code: number = 1006, message: string = `Geoblocked region`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, GeoblockedError.prototype) @@ -4169,7 +3672,7 @@ export class RateLimitedError extends WebrpcError { code: number = 1007, message: string = `Rate-limited. Please slow down.`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, RateLimitedError.prototype) @@ -4182,7 +3685,7 @@ export class ProjectNotFoundError extends WebrpcError { code: number = 1008, message: string = `Project not found`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, ProjectNotFoundError.prototype) @@ -4195,7 +3698,7 @@ export class AccessKeyNotFoundError extends WebrpcError { code: number = 1101, message: string = `Access key not found`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AccessKeyNotFoundError.prototype) @@ -4208,7 +3711,7 @@ export class AccessKeyMismatchError extends WebrpcError { code: number = 1102, message: string = `Access key mismatch`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AccessKeyMismatchError.prototype) @@ -4221,7 +3724,7 @@ export class InvalidOriginError extends WebrpcError { code: number = 1103, message: string = `Invalid origin for Access Key`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InvalidOriginError.prototype) @@ -4234,7 +3737,7 @@ export class InvalidServiceError extends WebrpcError { code: number = 1104, message: string = `Service not enabled for Access key`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InvalidServiceError.prototype) @@ -4247,7 +3750,7 @@ export class UnauthorizedUserError extends WebrpcError { code: number = 1105, message: string = `Unauthorized user`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnauthorizedUserError.prototype) @@ -4260,7 +3763,7 @@ export class QuotaExceededError extends WebrpcError { code: number = 1200, message: string = `Quota request exceeded`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, QuotaExceededError.prototype) @@ -4273,7 +3776,7 @@ export class QuotaRateLimitError extends WebrpcError { code: number = 1201, message: string = `Quota rate limit exceeded`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, QuotaRateLimitError.prototype) @@ -4286,7 +3789,7 @@ export class NoDefaultKeyError extends WebrpcError { code: number = 1300, message: string = `No default access key found`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, NoDefaultKeyError.prototype) @@ -4299,7 +3802,7 @@ export class MaxAccessKeysError extends WebrpcError { code: number = 1301, message: string = `Access keys limit reached`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, MaxAccessKeysError.prototype) @@ -4312,7 +3815,7 @@ export class AtLeastOneKeyError extends WebrpcError { code: number = 1302, message: string = `You need at least one Access Key`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AtLeastOneKeyError.prototype) @@ -4325,7 +3828,7 @@ export class TimeoutError extends WebrpcError { code: number = 1900, message: string = `Request timed out`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, TimeoutError.prototype) @@ -4338,7 +3841,7 @@ export class InvalidArgumentError extends WebrpcError { code: number = 2000, message: string = `Invalid argument`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InvalidArgumentError.prototype) @@ -4351,7 +3854,7 @@ export class UnavailableError extends WebrpcError { code: number = 2002, message: string = `Unavailable resource`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnavailableError.prototype) @@ -4364,7 +3867,7 @@ export class QueryFailedError extends WebrpcError { code: number = 2003, message: string = `Query failed`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, QueryFailedError.prototype) @@ -4377,7 +3880,7 @@ export class NotFoundError extends WebrpcError { code: number = 3000, message: string = `Resource not found`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, NotFoundError.prototype) @@ -4390,13 +3893,14 @@ export class UnsupportedNetworkError extends WebrpcError { code: number = 3008, message: string = `Unsupported network`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnsupportedNetworkError.prototype) } } + export enum errors { WebrpcEndpoint = 'WebrpcEndpoint', WebrpcRequestFailed = 'WebrpcRequestFailed', @@ -4515,3 +4019,4 @@ export const webrpcErrorByCode: { [code: number]: any } = { } export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise + diff --git a/packages/services/relayer/src/rpc-relayer/relayer.gen.ts b/packages/services/relayer/src/rpc-relayer/relayer.gen.ts index a9e6b44405..79ca492968 100644 --- a/packages/services/relayer/src/rpc-relayer/relayer.gen.ts +++ b/packages/services/relayer/src/rpc-relayer/relayer.gen.ts @@ -5,71 +5,72 @@ // // webrpc-gen -schema=relayer.ridl -target=typescript -client -out=./clients/relayer.gen.ts -export const WebrpcHeader = 'Webrpc' +export const WebrpcHeader = "Webrpc" -export const WebrpcHeaderValue = 'webrpc@v0.26.0;gen-typescript@v0.17.0;sequence-relayer@v0.4.1' +export const WebrpcHeaderValue = "webrpc@v0.26.0;gen-typescript@v0.17.0;sequence-relayer@v0.4.1" // WebRPC description and code-gen version -export const WebRPCVersion = 'v1' +export const WebRPCVersion = "v1" // Schema version of your RIDL schema -export const WebRPCSchemaVersion = 'v0.4.1' +export const WebRPCSchemaVersion = "v0.4.1" // Schema hash generated from your RIDL schema -export const WebRPCSchemaHash = '62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a' +export const WebRPCSchemaHash = "62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a" type WebrpcGenVersions = { - webrpcGenVersion: string - codeGenName: string - codeGenVersion: string - schemaName: string - schemaVersion: string -} + webrpcGenVersion: string; + codeGenName: string; + codeGenVersion: string; + schemaName: string; + schemaVersion: string; +}; export function VersionFromHeader(headers: Headers): WebrpcGenVersions { - const headerValue = headers.get(WebrpcHeader) + const headerValue = headers.get(WebrpcHeader); if (!headerValue) { return { - webrpcGenVersion: '', - codeGenName: '', - codeGenVersion: '', - schemaName: '', - schemaVersion: '', - } + webrpcGenVersion: "", + codeGenName: "", + codeGenVersion: "", + schemaName: "", + schemaVersion: "", + }; } - return parseWebrpcGenVersions(headerValue) + return parseWebrpcGenVersions(headerValue); } function parseWebrpcGenVersions(header: string): WebrpcGenVersions { - const versions = header.split(';') + const versions = header.split(";"); if (versions.length < 3) { return { - webrpcGenVersion: '', - codeGenName: '', - codeGenVersion: '', - schemaName: '', - schemaVersion: '', - } + webrpcGenVersion: "", + codeGenName: "", + codeGenVersion: "", + schemaName: "", + schemaVersion: "", + }; } - const [_, webrpcGenVersion] = versions[0]!.split('@') - const [codeGenName, codeGenVersion] = versions[1]!.split('@') - const [schemaName, schemaVersion] = versions[2]!.split('@') + const [_, webrpcGenVersion] = versions[0]!.split("@"); + const [codeGenName, codeGenVersion] = versions[1]!.split("@"); + const [schemaName, schemaVersion] = versions[2]!.split("@"); return { - webrpcGenVersion: webrpcGenVersion ?? '', - codeGenName: codeGenName ?? '', - codeGenVersion: codeGenVersion ?? '', - schemaName: schemaName ?? '', - schemaVersion: schemaVersion ?? '', - } + webrpcGenVersion: webrpcGenVersion ?? "", + codeGenName: codeGenName ?? "", + codeGenVersion: codeGenVersion ?? "", + schemaName: schemaName ?? "", + schemaVersion: schemaVersion ?? "", + }; } // // Types // + export enum ETHTxnStatus { UNKNOWN = 'UNKNOWN', DROPPED = 'DROPPED', @@ -78,7 +79,7 @@ export enum ETHTxnStatus { SUCCEEDED = 'SUCCEEDED', PARTIALLY_FAILED = 'PARTIALLY_FAILED', FAILED = 'FAILED', - PENDING_PRECONDITION = 'PENDING_PRECONDITION', + PENDING_PRECONDITION = 'PENDING_PRECONDITION' } export enum TransferType { @@ -87,7 +88,7 @@ export enum TransferType { BRIDGE_DEPOSIT = 'BRIDGE_DEPOSIT', BRIDGE_WITHDRAW = 'BRIDGE_WITHDRAW', BURN = 'BURN', - UNKNOWN = 'UNKNOWN', + UNKNOWN = 'UNKNOWN' } export enum SimulateStatus { @@ -96,18 +97,18 @@ export enum SimulateStatus { FAILED = 'FAILED', ABORTED = 'ABORTED', REVERTED = 'REVERTED', - NOT_ENOUGH_GAS = 'NOT_ENOUGH_GAS', + NOT_ENOUGH_GAS = 'NOT_ENOUGH_GAS' } export enum FeeTokenType { UNKNOWN = 'UNKNOWN', ERC20_TOKEN = 'ERC20_TOKEN', - ERC1155_TOKEN = 'ERC1155_TOKEN', + ERC1155_TOKEN = 'ERC1155_TOKEN' } export enum SortOrder { DESC = 'DESC', - ASC = 'ASC', + ASC = 'ASC' } export interface Version { @@ -137,7 +138,8 @@ export interface SenderStatus { active: boolean } -export interface RuntimeChecks {} +export interface RuntimeChecks { +} export interface SequenceContext { factory: string @@ -213,8 +215,8 @@ export interface MetaTxnLog { minedAt: string target: string input: string - txnArgs: { [key: string]: any } - txnReceipt?: { [key: string]: any } + txnArgs: {[key: string]: any} + txnReceipt?: {[key: string]: any} walletAddress: string metaTxnNonce: string gasLimit: number @@ -351,9 +353,9 @@ export interface Relayer { getSequenceContext(headers?: object, signal?: AbortSignal): Promise getChainID(headers?: object, signal?: AbortSignal): Promise /** - * + * * Transactions - * + * * TODO (future): rename this to just, 'SendTransaction(txn: MetaTransaction)' or 'SendTransaction(txn: SignedTransaction)', or something.. * Project ID is only used by service and admin calls. Other clients must have projectID passed via the context * TODO: rename return txnHash: string to metaTxnID: string @@ -368,41 +370,21 @@ export interface Relayer { * new, GetTransactionReceipt and WaitTransactionReceipt methods * we can also accept metaTxnId and txnHash .. so can take either or.. I wonder if ERC-4337 has any convention on this? */ - getMetaTxnReceipt( - args: GetMetaTxnReceiptArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + getMetaTxnReceipt(args: GetMetaTxnReceiptArgs, headers?: object, signal?: AbortSignal): Promise simulate(args: SimulateArgs, headers?: object, signal?: AbortSignal): Promise simulateV3(args: SimulateV3Args, headers?: object, signal?: AbortSignal): Promise /** * TODO: deprecated, to be removed by https://github.com/0xsequence/stack/pull/356 at a later date */ - updateMetaTxnGasLimits( - args: UpdateMetaTxnGasLimitsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + updateMetaTxnGasLimits(args: UpdateMetaTxnGasLimitsArgs, headers?: object, signal?: AbortSignal): Promise feeTokens(headers?: object, signal?: AbortSignal): Promise feeOptions(args: FeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise /** * TODO: deprecated, to be removed by https://github.com/0xsequence/stack/pull/356 at a later date */ - getMetaTxnNetworkFeeOptions( - args: GetMetaTxnNetworkFeeOptionsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - getMetaTransactions( - args: GetMetaTransactionsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - getTransactionCost( - args: GetTransactionCostArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + getMetaTxnNetworkFeeOptions(args: GetMetaTxnNetworkFeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise + getMetaTransactions(args: GetMetaTransactionsArgs, headers?: object, signal?: AbortSignal): Promise + getTransactionCost(args: GetTransactionCostArgs, headers?: object, signal?: AbortSignal): Promise /** * Sent transactions from an account. If filter is omitted then it will return all transactions. */ @@ -411,11 +393,7 @@ export interface Relayer { * Pending transactions waiting to be mined for an account. This endpoint is just a sugar of `SentTransactions` * with the filter set to pending: true. */ - pendingTransactions( - args: PendingTransactionsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + pendingTransactions(args: PendingTransactionsArgs, headers?: object, signal?: AbortSignal): Promise /** * Legacy Gas Tank */ @@ -425,26 +403,10 @@ export interface Relayer { /** * Legacy Gas Adjustment */ - nextGasTankBalanceAdjustmentNonce( - args: NextGasTankBalanceAdjustmentNonceArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - adjustGasTankBalance( - args: AdjustGasTankBalanceArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - getGasTankBalanceAdjustment( - args: GetGasTankBalanceAdjustmentArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - listGasTankBalanceAdjustments( - args: ListGasTankBalanceAdjustmentsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + nextGasTankBalanceAdjustmentNonce(args: NextGasTankBalanceAdjustmentNonceArgs, headers?: object, signal?: AbortSignal): Promise + adjustGasTankBalance(args: AdjustGasTankBalanceArgs, headers?: object, signal?: AbortSignal): Promise + getGasTankBalanceAdjustment(args: GetGasTankBalanceAdjustmentArgs, headers?: object, signal?: AbortSignal): Promise + listGasTankBalanceAdjustments(args: ListGasTankBalanceAdjustmentsArgs, headers?: object, signal?: AbortSignal): Promise /** * Gas Sponsorship */ @@ -456,50 +418,43 @@ export interface Relayer { /** * Gas Sponsor Lookup */ - addressGasSponsors( - args: AddressGasSponsorsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + addressGasSponsors(args: AddressGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise /** * Project Balance */ - getProjectBalance( - args: GetProjectBalanceArgs, - headers?: object, - signal?: AbortSignal, - ): Promise - adjustProjectBalance( - args: AdjustProjectBalanceArgs, - headers?: object, - signal?: AbortSignal, - ): Promise + getProjectBalance(args: GetProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise + adjustProjectBalance(args: AdjustProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise } -export interface PingArgs {} +export interface PingArgs { +} export interface PingReturn { - status: boolean + status: boolean +} +export interface VersionArgs { } -export interface VersionArgs {} export interface VersionReturn { - version: Version + version: Version +} +export interface RuntimeStatusArgs { } -export interface RuntimeStatusArgs {} export interface RuntimeStatusReturn { - status: RuntimeStatus + status: RuntimeStatus +} +export interface GetSequenceContextArgs { } -export interface GetSequenceContextArgs {} export interface GetSequenceContextReturn { - data: SequenceContext + data: SequenceContext +} +export interface GetChainIDArgs { } -export interface GetChainIDArgs {} export interface GetChainIDReturn { - chainID: number + chainID: number } export interface SendMetaTxnArgs { call: MetaTxn @@ -510,7 +465,7 @@ export interface SendMetaTxnArgs { export interface SendMetaTxnReturn { status: boolean - txnHash: string + txnHash: string } export interface GetMetaTxnNonceArgs { walletContractAddress: string @@ -518,14 +473,14 @@ export interface GetMetaTxnNonceArgs { } export interface GetMetaTxnNonceReturn { - nonce: string + nonce: string } export interface GetMetaTxnReceiptArgs { metaTxID: string } export interface GetMetaTxnReceiptReturn { - receipt: MetaTxnReceipt + receipt: MetaTxnReceipt } export interface SimulateArgs { wallet: string @@ -533,7 +488,7 @@ export interface SimulateArgs { } export interface SimulateReturn { - results: Array + results: Array } export interface SimulateV3Args { wallet: string @@ -541,7 +496,7 @@ export interface SimulateV3Args { } export interface SimulateV3Return { - results: Array + results: Array } export interface UpdateMetaTxnGasLimitsArgs { walletAddress: string @@ -550,13 +505,14 @@ export interface UpdateMetaTxnGasLimitsArgs { } export interface UpdateMetaTxnGasLimitsReturn { - payload: string + payload: string +} +export interface FeeTokensArgs { } -export interface FeeTokensArgs {} export interface FeeTokensReturn { isFeeRequired: boolean - tokens: Array + tokens: Array } export interface FeeOptionsArgs { wallet: string @@ -568,7 +524,7 @@ export interface FeeOptionsArgs { export interface FeeOptionsReturn { options: Array sponsored: boolean - quote?: string + quote?: string } export interface GetMetaTxnNetworkFeeOptionsArgs { walletConfig: any @@ -576,7 +532,7 @@ export interface GetMetaTxnNetworkFeeOptionsArgs { } export interface GetMetaTxnNetworkFeeOptionsReturn { - options: Array + options: Array } export interface GetMetaTransactionsArgs { projectId: number @@ -585,7 +541,7 @@ export interface GetMetaTransactionsArgs { export interface GetMetaTransactionsReturn { page: Page - transactions: Array + transactions: Array } export interface GetTransactionCostArgs { projectId: number @@ -594,7 +550,7 @@ export interface GetTransactionCostArgs { } export interface GetTransactionCostReturn { - cost: number + cost: number } export interface SentTransactionsArgs { filter?: SentTransactionsFilter @@ -603,7 +559,7 @@ export interface SentTransactionsArgs { export interface SentTransactionsReturn { page: Page - transactions: Array + transactions: Array } export interface PendingTransactionsArgs { page?: Page @@ -611,14 +567,14 @@ export interface PendingTransactionsArgs { export interface PendingTransactionsReturn { page: Page - transactions: Array + transactions: Array } export interface GetGasTankArgs { id: number } export interface GetGasTankReturn { - gasTank: GasTank + gasTank: GasTank } export interface AddGasTankArgs { name: string @@ -628,7 +584,7 @@ export interface AddGasTankArgs { export interface AddGasTankReturn { status: boolean - gasTank: GasTank + gasTank: GasTank } export interface UpdateGasTankArgs { id: number @@ -639,14 +595,14 @@ export interface UpdateGasTankArgs { export interface UpdateGasTankReturn { status: boolean - gasTank: GasTank + gasTank: GasTank } export interface NextGasTankBalanceAdjustmentNonceArgs { id: number } export interface NextGasTankBalanceAdjustmentNonceReturn { - nonce: number + nonce: number } export interface AdjustGasTankBalanceArgs { id: number @@ -656,7 +612,7 @@ export interface AdjustGasTankBalanceArgs { export interface AdjustGasTankBalanceReturn { status: boolean - adjustment: GasTankBalanceAdjustment + adjustment: GasTankBalanceAdjustment } export interface GetGasTankBalanceAdjustmentArgs { id: number @@ -664,7 +620,7 @@ export interface GetGasTankBalanceAdjustmentArgs { } export interface GetGasTankBalanceAdjustmentReturn { - adjustment: GasTankBalanceAdjustment + adjustment: GasTankBalanceAdjustment } export interface ListGasTankBalanceAdjustmentsArgs { id: number @@ -673,7 +629,7 @@ export interface ListGasTankBalanceAdjustmentsArgs { export interface ListGasTankBalanceAdjustmentsReturn { page: Page - adjustments: Array + adjustments: Array } export interface ListGasSponsorsArgs { projectId: number @@ -682,7 +638,7 @@ export interface ListGasSponsorsArgs { export interface ListGasSponsorsReturn { page: Page - gasSponsors: Array + gasSponsors: Array } export interface GetGasSponsorArgs { projectId: number @@ -690,7 +646,7 @@ export interface GetGasSponsorArgs { } export interface GetGasSponsorReturn { - gasSponsor: GasSponsor + gasSponsor: GasSponsor } export interface AddGasSponsorArgs { projectId: number @@ -701,7 +657,7 @@ export interface AddGasSponsorArgs { export interface AddGasSponsorReturn { status: boolean - gasSponsor: GasSponsor + gasSponsor: GasSponsor } export interface UpdateGasSponsorArgs { projectId: number @@ -712,7 +668,7 @@ export interface UpdateGasSponsorArgs { export interface UpdateGasSponsorReturn { status: boolean - gasSponsor: GasSponsor + gasSponsor: GasSponsor } export interface RemoveGasSponsorArgs { projectId: number @@ -720,7 +676,7 @@ export interface RemoveGasSponsorArgs { } export interface RemoveGasSponsorReturn { - status: boolean + status: boolean } export interface AddressGasSponsorsArgs { address: string @@ -729,14 +685,14 @@ export interface AddressGasSponsorsArgs { export interface AddressGasSponsorsReturn { page: Page - gasSponsors: Array + gasSponsors: Array } export interface GetProjectBalanceArgs { projectId: number } export interface GetProjectBalanceReturn { - balance: number + balance: number } export interface AdjustProjectBalanceArgs { projectId: number @@ -745,9 +701,11 @@ export interface AdjustProjectBalanceArgs { } export interface AdjustProjectBalanceReturn { - balance: number + balance: number } + + // // Client // @@ -764,619 +722,521 @@ export class Relayer implements Relayer { private url(name: string): string { return this.hostname + this.path + name } - + ping = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('Ping'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('Ping'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + version = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('Version'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - version: _data.version, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('Version'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + version: (_data.version), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + runtimeStatus = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('RuntimeStatus'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('RuntimeStatus'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getSequenceContext = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetSequenceContext'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - data: _data.data, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('GetSequenceContext'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + data: (_data.data), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getChainID = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetChainID'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - chainID: _data.chainID, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('GetChainID'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + chainID: (_data.chainID), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + sendMetaTxn = (args: SendMetaTxnArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('SendMetaTxn'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - txnHash: _data.txnHash, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getMetaTxnNonce = ( - args: GetMetaTxnNonceArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetMetaTxnNonce'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - nonce: _data.nonce, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getMetaTxnReceipt = ( - args: GetMetaTxnReceiptArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetMetaTxnReceipt'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - receipt: _data.receipt, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('SendMetaTxn'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + txnHash: (_data.txnHash), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getMetaTxnNonce = (args: GetMetaTxnNonceArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetMetaTxnNonce'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + nonce: (_data.nonce), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getMetaTxnReceipt = (args: GetMetaTxnReceiptArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetMetaTxnReceipt'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + receipt: (_data.receipt), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + simulate = (args: SimulateArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('Simulate'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - results: >_data.results, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('Simulate'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + results: >(_data.results), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + simulateV3 = (args: SimulateV3Args, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('SimulateV3'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - results: >_data.results, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - updateMetaTxnGasLimits = ( - args: UpdateMetaTxnGasLimitsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('UpdateMetaTxnGasLimits'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - payload: _data.payload, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('SimulateV3'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + results: >(_data.results), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + updateMetaTxnGasLimits = (args: UpdateMetaTxnGasLimitsArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('UpdateMetaTxnGasLimits'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + payload: (_data.payload), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + feeTokens = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('FeeTokens'), createHTTPRequest({}, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - isFeeRequired: _data.isFeeRequired, - tokens: >_data.tokens, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('FeeTokens'), + createHTTPRequest({}, headers, signal) + ).then((res) => { + return buildResponse(res).then(_data => { + return { + isFeeRequired: (_data.isFeeRequired), + tokens: >(_data.tokens), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + feeOptions = (args: FeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('FeeOptions'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - options: >_data.options, - sponsored: _data.sponsored, - quote: _data.quote, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getMetaTxnNetworkFeeOptions = ( - args: GetMetaTxnNetworkFeeOptionsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetMetaTxnNetworkFeeOptions'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - options: >_data.options, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getMetaTransactions = ( - args: GetMetaTransactionsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetMetaTransactions'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - page: _data.page, - transactions: >_data.transactions, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getTransactionCost = ( - args: GetTransactionCostArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetTransactionCost'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - cost: _data.cost, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - sentTransactions = ( - args: SentTransactionsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('SentTransactions'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - page: _data.page, - transactions: >_data.transactions, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - pendingTransactions = ( - args: PendingTransactionsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('PendingTransactions'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - page: _data.page, - transactions: >_data.transactions, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('FeeOptions'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + options: >(_data.options), + sponsored: (_data.sponsored), + quote: (_data.quote), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getMetaTxnNetworkFeeOptions = (args: GetMetaTxnNetworkFeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetMetaTxnNetworkFeeOptions'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + options: >(_data.options), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getMetaTransactions = (args: GetMetaTransactionsArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetMetaTransactions'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + page: (_data.page), + transactions: >(_data.transactions), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getTransactionCost = (args: GetTransactionCostArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetTransactionCost'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + cost: (_data.cost), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + sentTransactions = (args: SentTransactionsArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('SentTransactions'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + page: (_data.page), + transactions: >(_data.transactions), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + pendingTransactions = (args: PendingTransactionsArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('PendingTransactions'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + page: (_data.page), + transactions: >(_data.transactions), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getGasTank = (args: GetGasTankArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetGasTank'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - gasTank: _data.gasTank, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('GetGasTank'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + gasTank: (_data.gasTank), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + addGasTank = (args: AddGasTankArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('AddGasTank'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - gasTank: _data.gasTank, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('AddGasTank'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + gasTank: (_data.gasTank), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + updateGasTank = (args: UpdateGasTankArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('UpdateGasTank'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - gasTank: _data.gasTank, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - nextGasTankBalanceAdjustmentNonce = ( - args: NextGasTankBalanceAdjustmentNonceArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('NextGasTankBalanceAdjustmentNonce'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - nonce: _data.nonce, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - adjustGasTankBalance = ( - args: AdjustGasTankBalanceArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('AdjustGasTankBalance'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - adjustment: _data.adjustment, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getGasTankBalanceAdjustment = ( - args: GetGasTankBalanceAdjustmentArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetGasTankBalanceAdjustment'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - adjustment: _data.adjustment, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - listGasTankBalanceAdjustments = ( - args: ListGasTankBalanceAdjustmentsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('ListGasTankBalanceAdjustments'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - page: _data.page, - adjustments: >_data.adjustments, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - listGasSponsors = ( - args: ListGasSponsorsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('ListGasSponsors'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - page: _data.page, - gasSponsors: >_data.gasSponsors, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('UpdateGasTank'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + gasTank: (_data.gasTank), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + nextGasTankBalanceAdjustmentNonce = (args: NextGasTankBalanceAdjustmentNonceArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('NextGasTankBalanceAdjustmentNonce'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + nonce: (_data.nonce), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + adjustGasTankBalance = (args: AdjustGasTankBalanceArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('AdjustGasTankBalance'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + adjustment: (_data.adjustment), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getGasTankBalanceAdjustment = (args: GetGasTankBalanceAdjustmentArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetGasTankBalanceAdjustment'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + adjustment: (_data.adjustment), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + listGasTankBalanceAdjustments = (args: ListGasTankBalanceAdjustmentsArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('ListGasTankBalanceAdjustments'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + page: (_data.page), + adjustments: >(_data.adjustments), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + listGasSponsors = (args: ListGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('ListGasSponsors'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + page: (_data.page), + gasSponsors: >(_data.gasSponsors), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + getGasSponsor = (args: GetGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('GetGasSponsor'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - gasSponsor: _data.gasSponsor, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) + return this.fetch( + this.url('GetGasSponsor'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + gasSponsor: (_data.gasSponsor), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) } - + addGasSponsor = (args: AddGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch(this.url('AddGasSponsor'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - gasSponsor: _data.gasSponsor, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - updateGasSponsor = ( - args: UpdateGasSponsorArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('UpdateGasSponsor'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - gasSponsor: _data.gasSponsor, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - removeGasSponsor = ( - args: RemoveGasSponsorArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('RemoveGasSponsor'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - status: _data.status, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - addressGasSponsors = ( - args: AddressGasSponsorsArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('AddressGasSponsors'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - page: _data.page, - gasSponsors: >_data.gasSponsors, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - getProjectBalance = ( - args: GetProjectBalanceArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('GetProjectBalance'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - balance: _data.balance, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } - - adjustProjectBalance = ( - args: AdjustProjectBalanceArgs, - headers?: object, - signal?: AbortSignal, - ): Promise => { - return this.fetch(this.url('AdjustProjectBalance'), createHTTPRequest(args, headers, signal)).then( - (res) => { - return buildResponse(res).then((_data) => { - return { - balance: _data.balance, - } - }) - }, - (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }, - ) - } -} - -const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => { - const reqHeaders: { [key: string]: string } = { ...headers, 'Content-Type': 'application/json' } + return this.fetch( + this.url('AddGasSponsor'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + gasSponsor: (_data.gasSponsor), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + updateGasSponsor = (args: UpdateGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('UpdateGasSponsor'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + gasSponsor: (_data.gasSponsor), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + removeGasSponsor = (args: RemoveGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('RemoveGasSponsor'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + status: (_data.status), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + addressGasSponsors = (args: AddressGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('AddressGasSponsors'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + page: (_data.page), + gasSponsors: >(_data.gasSponsors), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + getProjectBalance = (args: GetProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('GetProjectBalance'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + balance: (_data.balance), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + + adjustProjectBalance = (args: AdjustProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch( + this.url('AdjustProjectBalance'), + createHTTPRequest(args, headers, signal)).then((res) => { + return buildResponse(res).then(_data => { + return { + balance: (_data.balance), + } + }) + }, (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }) + } + +} + + const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => { + const reqHeaders: {[key: string]: string} = { ...headers, 'Content-Type': 'application/json' } reqHeaders[WebrpcHeader] = WebrpcHeaderValue return { method: 'POST', headers: reqHeaders, body: JSON.stringify(body || {}), - signal, + signal } } const buildResponse = (res: Response): Promise => { - return res.text().then((text) => { + return res.text().then(text => { let data try { data = JSON.parse(text) - } catch (error) { + } catch(error) { let message = '' - if (error instanceof Error) { + if (error instanceof Error) { message = error.message } throw WebrpcBadResponseError.new({ status: res.status, - cause: `JSON.parse(): ${message}: response text: ${text}`, - }) + cause: `JSON.parse(): ${message}: response text: ${text}`}, + ) } if (!res.ok) { - const code: number = typeof data.code === 'number' ? data.code : 0 + const code: number = (typeof data.code === 'number') ? data.code : 0 throw (webrpcErrorByCode[code] || WebrpcError).new(data) } return data @@ -1421,7 +1281,7 @@ export class WebrpcEndpointError extends WebrpcError { code: number = 0, message: string = `endpoint error`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcEndpointError.prototype) @@ -1434,7 +1294,7 @@ export class WebrpcRequestFailedError extends WebrpcError { code: number = -1, message: string = `request failed`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype) @@ -1447,7 +1307,7 @@ export class WebrpcBadRouteError extends WebrpcError { code: number = -2, message: string = `bad route`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadRouteError.prototype) @@ -1460,7 +1320,7 @@ export class WebrpcBadMethodError extends WebrpcError { code: number = -3, message: string = `bad method`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadMethodError.prototype) @@ -1473,7 +1333,7 @@ export class WebrpcBadRequestError extends WebrpcError { code: number = -4, message: string = `bad request`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadRequestError.prototype) @@ -1486,7 +1346,7 @@ export class WebrpcBadResponseError extends WebrpcError { code: number = -5, message: string = `bad response`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadResponseError.prototype) @@ -1499,7 +1359,7 @@ export class WebrpcServerPanicError extends WebrpcError { code: number = -6, message: string = `server panic`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcServerPanicError.prototype) @@ -1512,7 +1372,7 @@ export class WebrpcInternalErrorError extends WebrpcError { code: number = -7, message: string = `internal error`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype) @@ -1525,7 +1385,7 @@ export class WebrpcClientDisconnectedError extends WebrpcError { code: number = -8, message: string = `client disconnected`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcClientDisconnectedError.prototype) @@ -1538,7 +1398,7 @@ export class WebrpcStreamLostError extends WebrpcError { code: number = -9, message: string = `stream lost`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcStreamLostError.prototype) @@ -1551,13 +1411,14 @@ export class WebrpcStreamFinishedError extends WebrpcError { code: number = -10, message: string = `stream finished`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype) } } + // Schema errors export class UnauthorizedError extends WebrpcError { @@ -1566,7 +1427,7 @@ export class UnauthorizedError extends WebrpcError { code: number = 1000, message: string = `Unauthorized access`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnauthorizedError.prototype) @@ -1579,7 +1440,7 @@ export class PermissionDeniedError extends WebrpcError { code: number = 1001, message: string = `Permission denied`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, PermissionDeniedError.prototype) @@ -1592,7 +1453,7 @@ export class SessionExpiredError extends WebrpcError { code: number = 1002, message: string = `Session expired`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, SessionExpiredError.prototype) @@ -1605,7 +1466,7 @@ export class MethodNotFoundError extends WebrpcError { code: number = 1003, message: string = `Method not found`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, MethodNotFoundError.prototype) @@ -1618,7 +1479,7 @@ export class RequestConflictError extends WebrpcError { code: number = 1004, message: string = `Conflict with target resource`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, RequestConflictError.prototype) @@ -1631,7 +1492,7 @@ export class AbortedError extends WebrpcError { code: number = 1005, message: string = `Request aborted`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AbortedError.prototype) @@ -1644,7 +1505,7 @@ export class GeoblockedError extends WebrpcError { code: number = 1006, message: string = `Geoblocked region`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, GeoblockedError.prototype) @@ -1657,7 +1518,7 @@ export class RateLimitedError extends WebrpcError { code: number = 1007, message: string = `Rate-limited. Please slow down.`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, RateLimitedError.prototype) @@ -1670,7 +1531,7 @@ export class ProjectNotFoundError extends WebrpcError { code: number = 1008, message: string = `Project not found`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, ProjectNotFoundError.prototype) @@ -1683,7 +1544,7 @@ export class AccessKeyNotFoundError extends WebrpcError { code: number = 1101, message: string = `Access key not found`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AccessKeyNotFoundError.prototype) @@ -1696,7 +1557,7 @@ export class AccessKeyMismatchError extends WebrpcError { code: number = 1102, message: string = `Access key mismatch`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AccessKeyMismatchError.prototype) @@ -1709,7 +1570,7 @@ export class InvalidOriginError extends WebrpcError { code: number = 1103, message: string = `Invalid origin for Access Key`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InvalidOriginError.prototype) @@ -1722,7 +1583,7 @@ export class InvalidServiceError extends WebrpcError { code: number = 1104, message: string = `Service not enabled for Access key`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InvalidServiceError.prototype) @@ -1735,7 +1596,7 @@ export class UnauthorizedUserError extends WebrpcError { code: number = 1105, message: string = `Unauthorized user`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnauthorizedUserError.prototype) @@ -1748,7 +1609,7 @@ export class QuotaExceededError extends WebrpcError { code: number = 1200, message: string = `Quota request exceeded`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, QuotaExceededError.prototype) @@ -1761,7 +1622,7 @@ export class QuotaRateLimitError extends WebrpcError { code: number = 1201, message: string = `Quota rate limit exceeded`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, QuotaRateLimitError.prototype) @@ -1774,7 +1635,7 @@ export class NoDefaultKeyError extends WebrpcError { code: number = 1300, message: string = `No default access key found`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, NoDefaultKeyError.prototype) @@ -1787,7 +1648,7 @@ export class MaxAccessKeysError extends WebrpcError { code: number = 1301, message: string = `Access keys limit reached`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, MaxAccessKeysError.prototype) @@ -1800,7 +1661,7 @@ export class AtLeastOneKeyError extends WebrpcError { code: number = 1302, message: string = `You need at least one Access Key`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AtLeastOneKeyError.prototype) @@ -1813,7 +1674,7 @@ export class TimeoutError extends WebrpcError { code: number = 1900, message: string = `Request timed out`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, TimeoutError.prototype) @@ -1826,7 +1687,7 @@ export class InvalidArgumentError extends WebrpcError { code: number = 2001, message: string = `Invalid argument`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InvalidArgumentError.prototype) @@ -1839,7 +1700,7 @@ export class UnavailableError extends WebrpcError { code: number = 2002, message: string = `Unavailable resource`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnavailableError.prototype) @@ -1852,7 +1713,7 @@ export class QueryFailedError extends WebrpcError { code: number = 2003, message: string = `Query failed`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, QueryFailedError.prototype) @@ -1865,7 +1726,7 @@ export class NotFoundError extends WebrpcError { code: number = 3000, message: string = `Resource not found`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, NotFoundError.prototype) @@ -1878,7 +1739,7 @@ export class InsufficientFeeError extends WebrpcError { code: number = 3004, message: string = `Insufficient fee`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InsufficientFeeError.prototype) @@ -1891,7 +1752,7 @@ export class NotEnoughBalanceError extends WebrpcError { code: number = 3005, message: string = `Not enough balance`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, NotEnoughBalanceError.prototype) @@ -1904,13 +1765,14 @@ export class SimulationFailedError extends WebrpcError { code: number = 3006, message: string = `Simulation failed`, status: number = 0, - cause?: string, + cause?: string ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, SimulationFailedError.prototype) } } + export enum errors { WebrpcEndpoint = 'WebrpcEndpoint', WebrpcRequestFailed = 'WebrpcRequestFailed', @@ -2035,3 +1897,4 @@ export const webrpcErrorByCode: { [code: number]: any } = { } export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise + From 26816e17952b2315603f47f7c6ba75e615a6d54a Mon Sep 17 00:00:00 2001 From: Tolgahan Arikan Date: Wed, 24 Sep 2025 19:11:03 +0300 Subject: [PATCH 26/36] Add missing chainId for dapp client event --- packages/wallet/dapp-client/src/DappClient.ts | 2 +- packages/wallet/dapp-client/src/types/index.ts | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/wallet/dapp-client/src/DappClient.ts b/packages/wallet/dapp-client/src/DappClient.ts index dcc7d81ceb..6d2b42a6de 100644 --- a/packages/wallet/dapp-client/src/DappClient.ts +++ b/packages/wallet/dapp-client/src/DappClient.ts @@ -800,7 +800,7 @@ export class DappClient { this.chainSessionManagers.set(chainId, chainSessionManager) chainSessionManager.on('explicitSessionResponse', (data) => { - this.emit('explicitSessionResponse', { ...data }) + this.emit('explicitSessionResponse', { ...data, chainId }) }) } return chainSessionManager diff --git a/packages/wallet/dapp-client/src/types/index.ts b/packages/wallet/dapp-client/src/types/index.ts index a488c98b78..62ca16df06 100644 --- a/packages/wallet/dapp-client/src/types/index.ts +++ b/packages/wallet/dapp-client/src/types/index.ts @@ -124,9 +124,12 @@ export type DappClientWalletActionEventListener = (data: { chainId: number }) => void -export type DappClientExplicitSessionEventListener = ExplicitSessionEventListener & { +export type DappClientExplicitSessionEventListener = (data: { + action: (typeof RequestActionType)['ADD_EXPLICIT_SESSION' | 'MODIFY_EXPLICIT_SESSION'] + response?: SessionResponse + error?: any chainId: number -} +}) => void // --- DappTransport Types --- From f1a9fb90db342cbe763a7ee07cc1b8fdb02bd6fc Mon Sep 17 00:00:00 2001 From: Tolgahan Arikan Date: Wed, 24 Sep 2025 19:50:59 +0300 Subject: [PATCH 27/36] Fix initializing new chain session manager on redirect --- packages/wallet/dapp-client/src/DappClient.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/wallet/dapp-client/src/DappClient.ts b/packages/wallet/dapp-client/src/DappClient.ts index 6d2b42a6de..584b146b7d 100644 --- a/packages/wallet/dapp-client/src/DappClient.ts +++ b/packages/wallet/dapp-client/src/DappClient.ts @@ -383,6 +383,9 @@ export class DappClient { this.emit('walletActionResponse', eventPayload) } else if (chainId !== undefined) { const chainSessionManager = this.getChainSessionManager(chainId) + if (!chainSessionManager.isInitialized && this.walletAddress) { + chainSessionManager.initializeWithWallet(this.walletAddress) + } await chainSessionManager.handleRedirectResponse(response) } else { throw new InitializationError(`Could not find a pending request context for the redirect action: ${action}`) From 282c0b3ab230191d792c58e7df923412525ac527 Mon Sep 17 00:00:00 2001 From: Taylan Pince Date: Fri, 26 Sep 2025 14:48:28 +0200 Subject: [PATCH 28/36] Add support for non-viem, custom Sequence chains (#882) --- .../core/src/relayer/standard/rpc/index.ts | 53 +++++++++++++++++-- 1 file changed, 48 insertions(+), 5 deletions(-) diff --git a/packages/wallet/core/src/relayer/standard/rpc/index.ts b/packages/wallet/core/src/relayer/standard/rpc/index.ts index e18bf7d94d..23f175d2fe 100644 --- a/packages/wallet/core/src/relayer/standard/rpc/index.ts +++ b/packages/wallet/core/src/relayer/standard/rpc/index.ts @@ -7,7 +7,7 @@ import { } from './relayer.gen.js' import { FeeOption, FeeQuote, OperationStatus, Relayer } from '../../relayer.js' import { Address, Hex, Bytes, AbiFunction } from 'ox' -import { Constants, Payload } from '@0xsequence/wallet-primitives' +import { Constants, Payload, Network } from '@0xsequence/wallet-primitives' import { ETHTxnStatus, FeeToken as RpcFeeToken } from './relayer.gen.js' import { decodePrecondition } from '../../../preconditions/index.js' import { @@ -25,12 +25,55 @@ export * from './relayer.gen.js' export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise +/** + * Convert a Sequence Network to a viem Chain + */ +const networkToChain = (network: Network.Network): Chain => { + return { + id: network.chainId, + name: network.title || network.name, + nativeCurrency: { + name: network.nativeCurrency.name, + symbol: network.nativeCurrency.symbol, + decimals: network.nativeCurrency.decimals, + }, + rpcUrls: { + default: { + http: [network.rpcUrl], + }, + }, + blockExplorers: network.blockExplorer + ? { + default: { + name: network.blockExplorer.name || 'Explorer', + url: network.blockExplorer.url, + }, + } + : undefined, + contracts: network.ensAddress + ? { + ensUniversalResolver: { + address: network.ensAddress as `0x${string}`, + }, + } + : undefined, + } as Chain +} + export const getChain = (chainId: number): Chain => { - const chain = Object.values(chains).find((c: any) => typeof c === 'object' && 'id' in c && c.id === chainId) - if (!chain) { - throw new Error(`Chain with id ${chainId} not found`) + // First try to get the chain from Sequence's network configurations + const sequenceNetwork = Network.getNetworkFromChainId(chainId) + if (sequenceNetwork) { + return networkToChain(sequenceNetwork) } - return chain as Chain + + // Fall back to viem's built-in chains + const viemChain = Object.values(chains).find((c: any) => typeof c === 'object' && 'id' in c && c.id === chainId) + if (viemChain) { + return viemChain as Chain + } + + throw new Error(`Chain with id ${chainId} not found in Sequence networks or viem chains`) } export class RpcRelayer implements Relayer { From 40e483a210028dbe31b30401b90496484fba0661 Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Tue, 30 Sep 2025 17:37:55 +1300 Subject: [PATCH 29/36] Provider sent to prepareBlankEnvelope --- packages/wallet/core/src/wallet.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/wallet/core/src/wallet.ts b/packages/wallet/core/src/wallet.ts index db4733e2be..05a02da09e 100644 --- a/packages/wallet/core/src/wallet.ts +++ b/packages/wallet/core/src/wallet.ts @@ -402,7 +402,7 @@ export class Wallet { factory, factoryData, }, - ...(await this.prepareBlankEnvelope(Number(chainId))), + ...(await this.prepareBlankEnvelope(Number(chainId), provider)), } } @@ -490,7 +490,7 @@ export class Wallet { nonce, calls, }, - ...(await this.prepareBlankEnvelope(Number(chainId))), + ...(await this.prepareBlankEnvelope(Number(chainId), provider)), } } @@ -597,8 +597,8 @@ export class Wallet { return encoded } - private async prepareBlankEnvelope(chainId: number) { - const status = await this.getStatus() + private async prepareBlankEnvelope(chainId: number, provider?: Provider.Provider) { + const status = await this.getStatus(provider) return { wallet: this.address, From a3f8af886a7a2b61898caa8731710b1d5c499a26 Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Thu, 2 Oct 2025 15:03:27 +1300 Subject: [PATCH 30/36] Add session signature decoding --- .../core/src/signers/session-manager.ts | 2 +- .../primitives-cli/src/subcommands/session.ts | 2 +- .../wallet/primitives/src/session-config.ts | 77 ++++++ .../primitives/src/session-signature.ts | 100 +++++++- .../primitives/test/session-config.test.ts | 219 +++++++++++++++--- .../primitives/test/session-signature.test.ts | 145 +++++++----- 6 files changed, 443 insertions(+), 102 deletions(-) diff --git a/packages/wallet/core/src/signers/session-manager.ts b/packages/wallet/core/src/signers/session-manager.ts index 99d189131e..316f9a9ad3 100644 --- a/packages/wallet/core/src/signers/session-manager.ts +++ b/packages/wallet/core/src/signers/session-manager.ts @@ -325,7 +325,7 @@ export class SessionManager implements SapientSigner { } // Perform encoding - const encodedSignature = SessionSignature.encodeSessionCallSignatures( + const encodedSignature = SessionSignature.encodeSessionSignature( signatures, await this.topology, identitySigner, diff --git a/packages/wallet/primitives-cli/src/subcommands/session.ts b/packages/wallet/primitives-cli/src/subcommands/session.ts index 28453121c3..2672721c61 100644 --- a/packages/wallet/primitives-cli/src/subcommands/session.ts +++ b/packages/wallet/primitives-cli/src/subcommands/session.ts @@ -33,7 +33,7 @@ export async function doEncodeSessionCallSignatures( } identitySigner = identitySigners[0]! } - const encoded = SessionSignature.encodeSessionCallSignatures( + const encoded = SessionSignature.encodeSessionSignature( callSignatures, sessionTopology, identitySigner as `0x${string}`, diff --git a/packages/wallet/primitives/src/session-config.ts b/packages/wallet/primitives/src/session-config.ts index 8d61113a4f..46e3d9f526 100644 --- a/packages/wallet/primitives/src/session-config.ts +++ b/packages/wallet/primitives/src/session-config.ts @@ -342,6 +342,83 @@ export function encodeSessionsTopology(topology: SessionsTopology): Bytes.Bytes throw new Error('Invalid topology') } +export function decodeSessionsTopology(bytes: Bytes.Bytes): SessionsTopology { + const { topology } = decodeSessionTopologyPointer(bytes) + return topology +} + +function decodeSessionTopologyPointer(bytes: Bytes.Bytes): { + topology: SessionsTopology + pointer: number +} { + if (bytes.length === 0) { + throw new Error('Empty topology bytes') + } + + const flagByte = bytes[0]! + const flag = (flagByte & 0xf0) >> 4 + const sizeSize = flagByte & 0x0f + + if (flag === SESSIONS_FLAG_BRANCH) { + // Branch + if (sizeSize === 0 || sizeSize > 15) { + throw new Error('Invalid branch size') + } + + let offset = 1 + const encodedLength = Bytes.toNumber(bytes.slice(offset, offset + sizeSize)) + offset += sizeSize + + const encodedBranches = bytes.slice(offset, offset + encodedLength) + const branches: SessionsTopology[] = [] + + let branchOffset = 0 + while (branchOffset < encodedBranches.length) { + const { topology: branchTopology, pointer: branchPointer } = decodeSessionTopologyPointer( + encodedBranches.slice(branchOffset), + ) + branches.push(branchTopology) + branchOffset += branchPointer + } + + return { topology: branches as SessionsTopology, pointer: offset + encodedLength } + } else if (flag === SESSIONS_FLAG_PERMISSIONS) { + // Permissions + const sessionPermissions = decodeSessionPermissions(bytes.slice(1)) + const nodeLength = 1 + encodeSessionPermissions(sessionPermissions).length + return { topology: { type: 'session-permissions', ...sessionPermissions }, pointer: nodeLength } + } else if (flag === SESSIONS_FLAG_NODE) { + // Node + if (bytes.length < 33) { + throw new Error('Invalid node length') + } + return { topology: Hex.fromBytes(bytes.slice(1, 33)), pointer: 33 } + } else if (flag === SESSIONS_FLAG_BLACKLIST) { + // Blacklist + const blacklistLength = sizeSize === 0x0f ? Bytes.toNumber(bytes.slice(1, 3)) : sizeSize + const offset = sizeSize === 0x0f ? 3 : 1 + + const blacklist: Address.Address[] = [] + for (let i = 0; i < blacklistLength; i++) { + const addressBytes = bytes.slice(offset + i * 20, offset + (i + 1) * 20) + blacklist.push(Address.from(Hex.fromBytes(addressBytes))) + } + + return { topology: { type: 'implicit-blacklist', blacklist }, pointer: offset + blacklistLength * 20 } + } else if (flag === SESSIONS_FLAG_IDENTITY_SIGNER) { + // Identity signer + if (bytes.length < 21) { + throw new Error('Invalid identity signer length') + } + return { + topology: { type: 'identity-signer', identitySigner: Address.from(Hex.fromBytes(bytes.slice(1, 21))) }, + pointer: 21, + } + } else { + throw new Error(`Invalid topology flag: ${flag}`) + } +} + // JSON export function sessionsTopologyToJson(topology: SessionsTopology): string { diff --git a/packages/wallet/primitives/src/session-signature.ts b/packages/wallet/primitives/src/session-signature.ts index 6f92fa5be1..a9f5144a13 100644 --- a/packages/wallet/primitives/src/session-signature.ts +++ b/packages/wallet/primitives/src/session-signature.ts @@ -1,7 +1,7 @@ import { Address, Bytes, Hash, Hex } from 'ox' -import { Attestation, encode, encodeForJson, fromParsed, toJson } from './attestation.js' import { MAX_PERMISSIONS_COUNT } from './permission.js' import { + decodeSessionsTopology, encodeSessionsTopology, getIdentitySigners, isCompleteSessionsTopology, @@ -9,11 +9,11 @@ import { SessionsTopology, } from './session-config.js' import { RSY } from './signature.js' -import { minBytesFor, packRSY } from './utils.js' -import { Payload } from './index.js' +import { minBytesFor, packRSY, unpackRSY } from './utils.js' +import { Attestation, Payload } from './index.js' export type ImplicitSessionCallSignature = { - attestation: Attestation + attestation: Attestation.Attestation identitySignature: RSY sessionSignature: RSY } @@ -46,7 +46,7 @@ export function sessionCallSignatureToJson(callSignature: SessionCallSignature): export function encodeSessionCallSignatureForJson(callSignature: SessionCallSignature): any { if (isImplicitSessionCallSignature(callSignature)) { return { - attestation: encodeForJson(callSignature.attestation), + attestation: Attestation.encodeForJson(callSignature.attestation), identitySignature: rsyToRsvStr(callSignature.identitySignature), sessionSignature: rsyToRsvStr(callSignature.sessionSignature), } @@ -68,7 +68,7 @@ export function sessionCallSignatureFromJson(json: string): SessionCallSignature export function sessionCallSignatureFromParsed(decoded: any): SessionCallSignature { if (decoded.attestation) { return { - attestation: fromParsed(decoded.attestation), + attestation: Attestation.fromParsed(decoded.attestation), identitySignature: rsyFromRsvStr(decoded.identitySignature), sessionSignature: rsyFromRsvStr(decoded.sessionSignature), } @@ -113,7 +113,7 @@ function rsyFromRsvStr(sigStr: string): RSY { * @param identitySigner The identity signer to encode. Others will be hashed into nodes. * @returns The encoded session call signatures. */ -export function encodeSessionCallSignatures( +export function encodeSessionSignature( callSignatures: SessionCallSignature[], topology: SessionsTopology, identitySigner: Address.Address, @@ -151,10 +151,12 @@ export function encodeSessionCallSignatures( // Map each call signature to its attestation index callSignatures.filter(isImplicitSessionCallSignature).forEach((callSig) => { if (callSig.attestation) { - const attestationStr = toJson(callSig.attestation) + const attestationStr = Attestation.toJson(callSig.attestation) if (!attestationMap.has(attestationStr)) { attestationMap.set(attestationStr, encodedAttestations.length) - encodedAttestations.push(Bytes.concat(encode(callSig.attestation), packRSY(callSig.identitySignature))) + encodedAttestations.push( + Bytes.concat(Attestation.encode(callSig.attestation), packRSY(callSig.identitySignature)), + ) } } }) @@ -169,7 +171,7 @@ export function encodeSessionCallSignatures( for (const callSignature of callSignatures) { if (isImplicitSessionCallSignature(callSignature)) { // Implicit - const attestationStr = toJson(callSignature.attestation) + const attestationStr = Attestation.toJson(callSignature.attestation) const attestationIndex = attestationMap.get(attestationStr) if (attestationIndex === undefined) { // Unreachable @@ -193,7 +195,83 @@ export function encodeSessionCallSignatures( return Bytes.concat(...parts) } -// Helper +export function decodeSessionSignature(encodedSignatures: Bytes.Bytes): { + topology: SessionsTopology + callSignatures: SessionCallSignature[] +} { + let offset = 0 + + // Parse session topology length (3 bytes) + const topologyLength = Bytes.toNumber(encodedSignatures.slice(offset, offset + 3)) + offset += 3 + + // Parse session topology + const topologyBytes = encodedSignatures.slice(offset, offset + topologyLength) + offset += topologyLength + const topology = decodeSessionsTopology(topologyBytes) + + // Parse attestations count (1 byte) + const attestationsCount = Bytes.toNumber(encodedSignatures.slice(offset, offset + 1)) + offset += 1 + + // Parse attestations and identity signatures + const attestations: Attestation.Attestation[] = [] + const identitySignatures: RSY[] = [] + + for (let i = 0; i < attestationsCount; i++) { + // Parse attestation + const attestation = Attestation.decode(encodedSignatures.slice(offset)) + offset += Attestation.encode(attestation).length + attestations.push(attestation) + + // Parse identity signature (64 bytes) + const identitySignature = unpackRSY(encodedSignatures.slice(offset, offset + 64)) + offset += 64 + identitySignatures.push(identitySignature) + } + + // Parse call signatures + const callSignatures: SessionCallSignature[] = [] + + while (offset < encodedSignatures.length) { + // Parse flag byte + const flagByte = encodedSignatures[offset]! + offset += 1 + + // Parse session signature (64 bytes) + const sessionSignature = unpackRSY(encodedSignatures.slice(offset, offset + 64)) + offset += 64 + + // Check if implicit (MSB set) or explicit + if ((flagByte & 0x80) !== 0) { + // Implicit call signature + const attestationIndex = flagByte & 0x7f + if (attestationIndex >= attestations.length) { + throw new Error('Invalid attestation index') + } + + callSignatures.push({ + attestation: attestations[attestationIndex]!, + identitySignature: identitySignatures[attestationIndex]!, + sessionSignature, + }) + } else { + // Explicit call signature + const permissionIndex = flagByte + callSignatures.push({ + permissionIndex: BigInt(permissionIndex), + sessionSignature, + }) + } + } + + return { + topology, + callSignatures, + } +} + +// Call encoding export function hashCallWithReplayProtection( payload: Payload.Calls, diff --git a/packages/wallet/primitives/test/session-config.test.ts b/packages/wallet/primitives/test/session-config.test.ts index 15e178f8cf..149b17565d 100644 --- a/packages/wallet/primitives/test/session-config.test.ts +++ b/packages/wallet/primitives/test/session-config.test.ts @@ -1,59 +1,60 @@ +import { Address, Bytes } from 'ox' import { describe, expect, it } from 'vitest' -import { Address, Bytes, Hex } from 'ox' +import { ChainId } from '../src/network.js' +import { ParameterOperation, Permission, SessionPermissions } from '../src/permission.js' import { - SESSIONS_FLAG_PERMISSIONS, - SESSIONS_FLAG_NODE, - SESSIONS_FLAG_BRANCH, + IdentitySignerLeaf, + ImplicitBlacklistLeaf, SESSIONS_FLAG_BLACKLIST, + SESSIONS_FLAG_BRANCH, SESSIONS_FLAG_IDENTITY_SIGNER, - ImplicitBlacklistLeaf, - IdentitySignerLeaf, - SessionPermissionsLeaf, - SessionNode, + SESSIONS_FLAG_NODE, + SESSIONS_FLAG_PERMISSIONS, SessionBranch, + SessionNode, + SessionPermissionsLeaf, SessionsTopology, - isSessionsTopology, - isCompleteSessionsTopology, + addExplicitSession, + addToImplicitBlacklist, + balanceSessionsTopology, + cleanSessionsTopology, + configurationTreeToSessionsTopology, + decodeLeafFromBytes, + decodeSessionsTopology, + emptySessionsTopology, + encodeLeafToGeneric, + encodeSessionsTopology, + getExplicitSigners, getIdentitySigners, getImplicitBlacklist, getImplicitBlacklistLeaf, getSessionPermissions, - getExplicitSigners, - encodeLeafToGeneric, - decodeLeafFromBytes, - sessionsTopologyToConfigurationTree, - configurationTreeToSessionsTopology, - encodeSessionsTopology, - sessionsTopologyToJson, - sessionsTopologyFromJson, - removeExplicitSession, - addExplicitSession, + isCompleteSessionsTopology, + isSessionsTopology, mergeSessionsTopologies, - balanceSessionsTopology, - cleanSessionsTopology, minimiseSessionsTopology, - addToImplicitBlacklist, + removeExplicitSession, removeFromImplicitBlacklist, - emptySessionsTopology, + sessionsTopologyFromJson, + sessionsTopologyToConfigurationTree, + sessionsTopologyToJson, } from '../src/session-config.js' -import { SessionPermissions } from '../src/permission.js' -import { ChainId } from '../src/network.js' describe('Session Config', () => { // Test data - const testAddress1 = '0x742d35cc6635c0532925a3b8d563a6b35b7f05f1' as Address.Address - const testAddress2 = '0x8ba1f109551bd432803012645aac136c776056c0' as Address.Address - const testAddress3 = '0xa0b86a33e6f8b5f56e64c9e1a1b8c6a9cc4b9a9e' as Address.Address - const testNode = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' as SessionNode + const testAddress1: Address.Address = '0x742d35cc6635c0532925a3b8d563a6b35b7f05f1' + const testAddress2: Address.Address = '0x8ba1f109551bd432803012645aac136c776056c0' + const testAddress3: Address.Address = '0xa0b86a33e6f8b5f56e64c9e1a1b8c6a9cc4b9a9e' + const testNode: SessionNode = '0x1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef' - const samplePermission = { + const samplePermission: Permission = { target: testAddress3, rules: [ { cumulative: false, - operation: 0, // EQUAL - value: Bytes.fromHex('0x'), + operation: ParameterOperation.EQUAL, + value: Bytes.fromHex('0x0000000000000000000000000000000000000000000000000000000000000000'), offset: 0n, mask: Bytes.fromHex('0xffffffff00000000000000000000000000000000000000000000000000000000'), }, @@ -399,12 +400,14 @@ describe('Session Config', () => { }) }) - describe('Sessions Topology Encoding', () => { + describe('Sessions Topology Encoding and Decoding', () => { describe('encodeSessionsTopology', () => { it('should encode session permissions leaf', () => { const result = encodeSessionsTopology(sampleSessionPermissionsLeaf) expect(result).toBeInstanceOf(Uint8Array) expect(result[0] >> 4).toBe(SESSIONS_FLAG_PERMISSIONS) + const decoded = decodeSessionsTopology(result) + expect(decoded).toEqual(sampleSessionPermissionsLeaf) }) it('should encode session node', () => { @@ -412,12 +415,16 @@ describe('Session Config', () => { expect(result).toBeInstanceOf(Uint8Array) expect(result[0] >> 4).toBe(SESSIONS_FLAG_NODE) expect(result.length).toBe(33) // 1 flag byte + 32 hash bytes + const decoded = decodeSessionsTopology(result) + expect(decoded).toEqual(testNode) }) it('should encode blacklist leaf', () => { const result = encodeSessionsTopology(sampleBlacklistLeaf) expect(result).toBeInstanceOf(Uint8Array) expect(result[0] >> 4).toBe(SESSIONS_FLAG_BLACKLIST) + const decoded = decodeSessionsTopology(result) + expect(decoded).toEqual(sampleBlacklistLeaf) }) it('should encode identity signer leaf', () => { @@ -425,12 +432,16 @@ describe('Session Config', () => { expect(result).toBeInstanceOf(Uint8Array) expect(result[0] >> 4).toBe(SESSIONS_FLAG_IDENTITY_SIGNER) expect(result.length).toBe(21) // 1 flag byte + 20 address bytes + const decoded = decodeSessionsTopology(result) + expect(decoded).toEqual(sampleIdentitySignerLeaf) }) it('should encode session branch', () => { const result = encodeSessionsTopology(sampleBranch) expect(result).toBeInstanceOf(Uint8Array) expect(result[0] >> 4).toBe(SESSIONS_FLAG_BRANCH) + const decoded = decodeSessionsTopology(result) + expect(decoded).toEqual(sampleBranch) }) it('should handle large blacklist with extended encoding', () => { @@ -441,6 +452,15 @@ describe('Session Config', () => { const result = encodeSessionsTopology(largeBlacklist) expect(result).toBeInstanceOf(Uint8Array) expect(result[0] & 0x0f).toBe(0x0f) // Extended encoding flag + const decoded = decodeSessionsTopology(result) + expect(decoded).toEqual(largeBlacklist) + }) + + it('should handle complete topology', () => { + const result = encodeSessionsTopology(sampleCompleteTopology) + expect(result).toBeInstanceOf(Uint8Array) + const decoded = decodeSessionsTopology(result) + expect(decoded).toEqual(sampleCompleteTopology) }) it('should throw for blacklist too large', () => { @@ -725,6 +745,137 @@ describe('Session Config', () => { it('should throw for invalid topology', () => { expect(() => minimiseSessionsTopology({} as any, [], [])).toThrow('Invalid topology') }) + + it('should minimize topology with multiple identity signers but keep only the specified one', () => { + // Create multiple identity signer leaves + const identitySigner1: IdentitySignerLeaf = { + type: 'identity-signer', + identitySigner: testAddress1, + } + const identitySigner2: IdentitySignerLeaf = { + type: 'identity-signer', + identitySigner: testAddress2, + } + const identitySigner3: IdentitySignerLeaf = { + type: 'identity-signer', + identitySigner: testAddress3, + } + + // Create topology with multiple identity signers + const topologyWithMultipleIdentitySigners: SessionBranch = [ + sampleBlacklistLeaf, + identitySigner1, + identitySigner2, + identitySigner3, + sampleSessionPermissionsLeaf, + ] + + // Minimize with only testAddress2 as the identity signer + const result = minimiseSessionsTopology( + topologyWithMultipleIdentitySigners, + [], // no explicit signers + [], // no implicit signers + testAddress2, // only keep this identity signer + ) + + expect(isSessionsTopology(result)).toBe(true) + + // Get all identity signers from the result + const identitySigners = getIdentitySigners(result) + + // Should only contain the specified identity signer + expect(identitySigners).toEqual([testAddress2]) + expect(identitySigners).not.toContain(testAddress1) + expect(identitySigners).not.toContain(testAddress3) + + // Verify the result is still a valid topology + expect(isSessionsTopology(result)).toBe(true) + }) + + it('should minimize deeply nested topology with multiple identity signers but keep only the specified one', () => { + // Create multiple identity signer leaves + const identitySigner1: IdentitySignerLeaf = { + type: 'identity-signer', + identitySigner: testAddress1, + } + const identitySigner2: IdentitySignerLeaf = { + type: 'identity-signer', + identitySigner: testAddress2, + } + const identitySigner3: IdentitySignerLeaf = { + type: 'identity-signer', + identitySigner: testAddress3, + } + + // Create additional session permissions for nesting + const sessionPermissions2: SessionPermissionsLeaf = { + type: 'session-permissions', + signer: testAddress2, + chainId: ChainId.MAINNET, + valueLimit: 500000000000000000n, + deadline: BigInt(Math.floor(Date.now() / 1000) + 1800), + permissions: [samplePermission], + } + + const sessionPermissions3: SessionPermissionsLeaf = { + type: 'session-permissions', + signer: testAddress3, + chainId: ChainId.MAINNET, + valueLimit: 750000000000000000n, + deadline: BigInt(Math.floor(Date.now() / 1000) + 2700), + permissions: [samplePermission], + } + + // Create a deeply nested topology structure + // Level 1: Main branch + // Level 2: Nested branches containing different combinations + const deeplyNestedTopology: SessionBranch = [ + // First nested branch: blacklist + identity signer 1 + [ + sampleBlacklistLeaf, + identitySigner1, + sampleSessionPermissionsLeaf, // testAddress1 session + ], + // Second nested branch: identity signer 2 + session permissions 2 + [ + identitySigner2, + sessionPermissions2, // testAddress2 session + ], + // Third nested branch: identity signer 3 + session permissions 3 + [ + identitySigner3, + sessionPermissions3, // testAddress3 session + ], + ] + + // Minimize with only testAddress2 as the identity signer + const result = minimiseSessionsTopology( + deeplyNestedTopology, + [], // no explicit signers + [], // no implicit signers + testAddress2, // only keep this identity signer + ) + + expect(isSessionsTopology(result)).toBe(true) + + // Get all identity signers from the result + const identitySigners = getIdentitySigners(result) + + // Should only contain the specified identity signer + expect(identitySigners).toEqual([testAddress2]) + expect(identitySigners).not.toContain(testAddress1) + expect(identitySigners).not.toContain(testAddress3) + + // Verify the result is still a valid topology + expect(isSessionsTopology(result)).toBe(true) + + // Verify that the nested structure is properly minimized + // The result should be a branch with hashed nodes and the preserved identity signer + if (Array.isArray(result)) { + // Should have some components (hashed nodes and the preserved identity signer) + expect(result.length).toBeGreaterThan(0) + } + }) }) describe('addToImplicitBlacklist', () => { diff --git a/packages/wallet/primitives/test/session-signature.test.ts b/packages/wallet/primitives/test/session-signature.test.ts index a9b193d79c..b8efe28c2f 100644 --- a/packages/wallet/primitives/test/session-signature.test.ts +++ b/packages/wallet/primitives/test/session-signature.test.ts @@ -1,29 +1,31 @@ +import { Address, Bytes, Hex } from 'ox' import { describe, expect, it } from 'vitest' -import { Address, Bytes, Hash, Hex } from 'ox' +import { Attestation } from '../src/attestation.js' +import { ChainId } from '../src/network.js' +import * as Payload from '../src/payload.js' +import { ParameterOperation } from '../src/permission.js' +import { minimiseSessionsTopology, SessionsTopology } from '../src/session-config.js' import { - ImplicitSessionCallSignature, + decodeSessionSignature, + encodeSessionCallSignatureForJson, + encodeSessionSignature, ExplicitSessionCallSignature, - SessionCallSignature, - isImplicitSessionCallSignature, + hashCallWithReplayProtection, + ImplicitSessionCallSignature, isExplicitSessionCallSignature, - sessionCallSignatureToJson, - encodeSessionCallSignatureForJson, + isImplicitSessionCallSignature, + SessionCallSignature, sessionCallSignatureFromJson, sessionCallSignatureFromParsed, - encodeSessionCallSignatures, - hashCallWithReplayProtection, + sessionCallSignatureToJson, } from '../src/session-signature.js' import { RSY } from '../src/signature.js' -import { Attestation } from '../src/attestation.js' -import { SessionsTopology } from '../src/session-config.js' -import * as Payload from '../src/payload.js' -import { ChainId } from '../src/network.js' describe('Session Signature', () => { // Test data - const testAddress1 = '0x742d35cc6635c0532925a3b8d563a6b35b7f05f1' as Address.Address - const testAddress2 = '0x8ba1f109551bd432803012645aac136c776056c0' as Address.Address + const testAddress1: Address.Address = '0x742d35cc6635c0532925a3b8d563a6b35b7f05f1' + const testAddress2: Address.Address = '0x8ba1f109551bd432803012645aac136c776056c0' const testChainId = ChainId.MAINNET const testSpace = 0n const testNonce = 1n @@ -102,7 +104,7 @@ describe('Session Signature', () => { rules: [ { cumulative: false, - operation: 0, + operation: ParameterOperation.EQUAL, value: Bytes.fromHex('0x'), offset: 0n, mask: Bytes.fromHex('0xffffffff00000000000000000000000000000000000000000000000000000000'), @@ -276,31 +278,50 @@ describe('Session Signature', () => { }) }) - describe('Signature Encoding', () => { - describe('encodeSessionCallSignatures', () => { + describe('Signature Encoding and Decoding', () => { + describe('encode / decodeSessionCallSignatures', () => { it('should encode single explicit session call signature', () => { const callSignatures = [sampleExplicitSignature] - const result = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) + const result = encodeSessionSignature(callSignatures, completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) expect(result.length).toBeGreaterThan(0) + + const decoded = decodeSessionSignature(result) + expect(decoded.callSignatures.length).toBe(1) + const callSignature = decoded.callSignatures[0]! + if (!isExplicitSessionCallSignature(callSignature)) { + throw new Error('Call signature is not explicit') + } + expect(callSignature.permissionIndex).toBe(callSignatures[0]!.permissionIndex) + // The topology gets minimized during encoding, so we expect the minimized version + const minimizedTopology = minimiseSessionsTopology(completeTopology, [], [], testAddress1) + expect(decoded.topology).toEqual(minimizedTopology) }) // Skip implicit signature tests that cause encoding issues it.skip('should encode single implicit session call signature', () => { const callSignatures = [sampleImplicitSignature] - const result = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) + const result = encodeSessionSignature(callSignatures, completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) expect(result.length).toBeGreaterThan(0) + + const decoded = decodeSessionSignature(result) + expect(decoded.callSignatures).toEqual(callSignatures) + expect(decoded.topology).toEqual(completeTopology) }) it.skip('should encode multiple mixed session call signatures', () => { const callSignatures = [sampleImplicitSignature, sampleExplicitSignature] - const result = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) + const result = encodeSessionSignature(callSignatures, completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) expect(result.length).toBeGreaterThan(0) + + const decoded = decodeSessionSignature(result) + expect(decoded.callSignatures).toEqual(callSignatures) + expect(decoded.topology).toEqual(completeTopology) }) it.skip('should encode multiple implicit signatures with same attestation', () => { @@ -311,10 +332,15 @@ describe('Session Signature', () => { sessionSignature: sampleRSY2, // Different session signature }, ] - const result = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) + const result = encodeSessionSignature(callSignatures, completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) expect(result.length).toBeGreaterThan(0) + + const decoded = decodeSessionSignature(result) + expect(decoded.callSignatures).toEqual(callSignatures) + const minimizedTopology = minimiseSessionsTopology(completeTopology, [], [], testAddress1) + expect(decoded.topology).toEqual(minimizedTopology) }) it('should throw for incomplete topology', () => { @@ -335,8 +361,8 @@ describe('Session Signature', () => { rules: [ { cumulative: false, - operation: 0, - value: Bytes.fromHex('0x'), + operation: ParameterOperation.EQUAL, + value: Bytes.fromHex('0x0000000000000000000000000000000000000000000000000000000000000000'), offset: 0n, mask: Bytes.fromHex('0xffffffff00000000000000000000000000000000000000000000000000000000'), }, @@ -347,7 +373,7 @@ describe('Session Signature', () => { // Missing identity signer, but has 2 elements for valid SessionBranch ] - expect(() => encodeSessionCallSignatures([sampleExplicitSignature], incompleteTopology, testAddress1)).toThrow( + expect(() => encodeSessionSignature([sampleExplicitSignature], incompleteTopology, testAddress1)).toThrow( 'Incomplete topology', ) }) @@ -358,43 +384,52 @@ describe('Session Signature', () => { sessionSignature: sampleRSY, } - expect(() => encodeSessionCallSignatures([largeIndexSignature], completeTopology, testAddress1)).toThrow( + expect(() => encodeSessionSignature([largeIndexSignature], completeTopology, testAddress1)).toThrow( 'Permission index is too large', ) }) - it('should throw for too many attestations (simplified)', () => { - // Just test that we can create many explicit signatures instead - const callSignatures: ExplicitSessionCallSignature[] = Array(10) - .fill(null) - .map((_, i) => ({ - permissionIndex: BigInt(i), - sessionSignature: sampleRSY, - })) - - const result = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) - expect(result).toBeInstanceOf(Uint8Array) - }) - it('should handle explicit signers parameter', () => { const callSignatures = [sampleExplicitSignature] - const result = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) + const result = encodeSessionSignature(callSignatures, completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) expect(result.length).toBeGreaterThan(0) + + const decoded = decodeSessionSignature(result) + expect(decoded.callSignatures.length).toBe(1) + const callSignature = decoded.callSignatures[0]! + if (!isExplicitSessionCallSignature(callSignature)) { + throw new Error('Call signature is not explicit') + } + expect(callSignature.permissionIndex).toBe(callSignatures[0]!.permissionIndex) + // The topology gets minimized during encoding, so we expect the minimized version + const minimizedTopology = minimiseSessionsTopology(completeTopology, [], [], testAddress1) + expect(decoded.topology).toEqual(minimizedTopology) }) it('should handle implicit signers parameter', () => { const callSignatures = [sampleExplicitSignature] - const result = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1, [], [testAddress2]) + const result = encodeSessionSignature(callSignatures, completeTopology, testAddress1, [], [testAddress2]) expect(result).toBeInstanceOf(Uint8Array) expect(result.length).toBeGreaterThan(0) + + const decoded = decodeSessionSignature(result) + expect(decoded.callSignatures.length).toBe(1) + const callSignature = decoded.callSignatures[0]! + if (!isExplicitSessionCallSignature(callSignature)) { + throw new Error('Call signature is not explicit') + } + expect(callSignature.permissionIndex).toBe(callSignatures[0]!.permissionIndex) + // The topology gets minimized during encoding, so we expect the minimized version + const minimizedTopology = minimiseSessionsTopology(completeTopology, [], [testAddress2], testAddress1) + expect(decoded.topology).toEqual(minimizedTopology) }) it('should throw for invalid call signature type', () => { const invalidSignature = {} as any - expect(() => encodeSessionCallSignatures([invalidSignature], completeTopology, testAddress1)).toThrow( + expect(() => encodeSessionSignature([invalidSignature], completeTopology, testAddress1)).toThrow( 'Invalid call signature', ) }) @@ -402,7 +437,7 @@ describe('Session Signature', () => { it('should throw for identity signer not found', () => { const callSignatures = [sampleExplicitSignature] expect(() => - encodeSessionCallSignatures(callSignatures, completeTopology, testAddress2, [], [testAddress2]), + encodeSessionSignature(callSignatures, completeTopology, testAddress2, [], [testAddress2]), ).toThrow('Identity signer not found') }) }) @@ -532,7 +567,7 @@ describe('Session Signature', () => { describe('Edge Cases and Error Handling', () => { it('should handle empty call signatures array', () => { - const result = encodeSessionCallSignatures([], completeTopology, testAddress1) + const result = encodeSessionSignature([], completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) expect(result.length).toBeGreaterThan(0) // Should still contain topology }) @@ -543,7 +578,7 @@ describe('Session Signature', () => { sessionSignature: sampleRSY, } - const result = encodeSessionCallSignatures([maxIndexSignature], completeTopology, testAddress1) + const result = encodeSessionSignature([maxIndexSignature], completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) }) @@ -553,7 +588,7 @@ describe('Session Signature', () => { sessionSignature: sampleRSY, } - const result = encodeSessionCallSignatures([zeroIndexSignature], completeTopology, testAddress1) + const result = encodeSessionSignature([zeroIndexSignature], completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) }) @@ -586,9 +621,9 @@ describe('Session Signature', () => { it.skip('should handle attestation with minimal data', () => { const minimalAttestation: Attestation = { approvedSigner: testAddress1, - identityType: Bytes.fromHex('0x00'), - issuerHash: Bytes.fromHex(('0x' + '00'.repeat(32)) as Hex.Hex), - audienceHash: Bytes.fromHex(('0x' + '00'.repeat(32)) as Hex.Hex), + identityType: Bytes.fromHex('0x00000000'), + issuerHash: Bytes.fromHex('0x0000000000000000000000000000000000000000000000000000000000000000'), + audienceHash: Bytes.fromHex('0x0000000000000000000000000000000000000000000000000000000000000000'), applicationData: Bytes.fromArray([]), authData: { redirectUrl: '', @@ -602,7 +637,7 @@ describe('Session Signature', () => { sessionSignature: sampleRSY2, } - const result = encodeSessionCallSignatures([minimalImplicitSignature], completeTopology, testAddress1) + const result = encodeSessionSignature([minimalImplicitSignature], completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) }) @@ -631,8 +666,8 @@ describe('Session Signature', () => { rules: [ { cumulative: false, - operation: 0, - value: Bytes.fromHex('0x'), + operation: ParameterOperation.EQUAL, + value: Bytes.fromHex('0x0000000000000000000000000000000000000000000000000000000000000000'), offset: 0n, mask: Bytes.fromHex('0xffffffff00000000000000000000000000000000000000000000000000000000'), }, @@ -646,7 +681,7 @@ describe('Session Signature', () => { // This test may not actually trigger the error since creating a 3-byte overflow is complex // We'll test that the function works with a large but valid topology - const result = encodeSessionCallSignatures(callSignatures, largeTopology, testAddress1) + const result = encodeSessionSignature(callSignatures, largeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) }) @@ -669,7 +704,7 @@ describe('Session Signature', () => { const callSignatures: ExplicitSessionCallSignature[] = [invalidExplicitSignature] expect(() => { - encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) + encodeSessionSignature(callSignatures, completeTopology, testAddress1) }).toThrow() // Should throw due to permission index validation }) }) @@ -685,7 +720,7 @@ describe('Session Signature', () => { ] // Encode - const encoded = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) + const encoded = encodeSessionSignature(callSignatures, completeTopology, testAddress1) expect(encoded).toBeInstanceOf(Uint8Array) // Test encoding for each signature @@ -733,7 +768,7 @@ describe('Session Signature', () => { }, ] - const result = encodeSessionCallSignatures(callSignatures, completeTopology, testAddress1) + const result = encodeSessionSignature(callSignatures, completeTopology, testAddress1) expect(result).toBeInstanceOf(Uint8Array) expect(result.length).toBeGreaterThan(0) }) From 227c4d433ebfea6f27cd84de63bad227d6c7dd82 Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Tue, 7 Oct 2025 11:27:34 +1300 Subject: [PATCH 31/36] const for node length --- packages/wallet/primitives/src/session-config.ts | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/packages/wallet/primitives/src/session-config.ts b/packages/wallet/primitives/src/session-config.ts index 46e3d9f526..67180acea1 100644 --- a/packages/wallet/primitives/src/session-config.ts +++ b/packages/wallet/primitives/src/session-config.ts @@ -35,8 +35,10 @@ export type SessionLeaf = SessionPermissionsLeaf | ImplicitBlacklistLeaf | Ident export type SessionBranch = [SessionsTopology, SessionsTopology, ...SessionsTopology[]] export type SessionsTopology = SessionBranch | SessionLeaf | SessionNode +const SESSIONS_NODE_SIZE_BYTES = 32 + function isSessionsNode(topology: any): topology is SessionNode { - return Hex.validate(topology) && Hex.size(topology) === 32 + return Hex.validate(topology) && Hex.size(topology) === SESSIONS_NODE_SIZE_BYTES } function isImplicitBlacklist(topology: any): topology is ImplicitBlacklistLeaf { @@ -389,10 +391,11 @@ function decodeSessionTopologyPointer(bytes: Bytes.Bytes): { return { topology: { type: 'session-permissions', ...sessionPermissions }, pointer: nodeLength } } else if (flag === SESSIONS_FLAG_NODE) { // Node - if (bytes.length < 33) { + const nodeLength = SESSIONS_NODE_SIZE_BYTES + 1 + if (bytes.length < nodeLength) { throw new Error('Invalid node length') } - return { topology: Hex.fromBytes(bytes.slice(1, 33)), pointer: 33 } + return { topology: Hex.fromBytes(bytes.slice(1, nodeLength)), pointer: nodeLength } } else if (flag === SESSIONS_FLAG_BLACKLIST) { // Blacklist const blacklistLength = sizeSize === 0x0f ? Bytes.toNumber(bytes.slice(1, 3)) : sizeSize From 8a5f2faa4150d703246184031b491f5c7aacbd53 Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Tue, 7 Oct 2025 11:28:02 +1300 Subject: [PATCH 32/36] Clearer blacklist size encoding --- .../wallet/primitives/src/session-config.ts | 9 +++++++-- .../primitives/test/session-config.test.ts | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/packages/wallet/primitives/src/session-config.ts b/packages/wallet/primitives/src/session-config.ts index 67180acea1..f4e94568d7 100644 --- a/packages/wallet/primitives/src/session-config.ts +++ b/packages/wallet/primitives/src/session-config.ts @@ -398,8 +398,13 @@ function decodeSessionTopologyPointer(bytes: Bytes.Bytes): { return { topology: Hex.fromBytes(bytes.slice(1, nodeLength)), pointer: nodeLength } } else if (flag === SESSIONS_FLAG_BLACKLIST) { // Blacklist - const blacklistLength = sizeSize === 0x0f ? Bytes.toNumber(bytes.slice(1, 3)) : sizeSize - const offset = sizeSize === 0x0f ? 3 : 1 + let offset = 1 + let blacklistLength = sizeSize + if (sizeSize === 0x0f) { + // Size is encoded in the next 2 bytes + blacklistLength = Bytes.toNumber(bytes.slice(offset, offset + 2)) + offset += 2 + } const blacklist: Address.Address[] = [] for (let i = 0; i < blacklistLength; i++) { diff --git a/packages/wallet/primitives/test/session-config.test.ts b/packages/wallet/primitives/test/session-config.test.ts index 149b17565d..6e20d55974 100644 --- a/packages/wallet/primitives/test/session-config.test.ts +++ b/packages/wallet/primitives/test/session-config.test.ts @@ -427,6 +427,24 @@ describe('Session Config', () => { expect(decoded).toEqual(sampleBlacklistLeaf) }) + it('should encode large blacklist leaf', () => { + const blacklistCount = 1000 + const largeBlacklist: ImplicitBlacklistLeaf = { + type: 'implicit-blacklist', + blacklist: Array(blacklistCount).fill(testAddress1), + } + const result = encodeSessionsTopology(largeBlacklist) + expect(result).toBeInstanceOf(Uint8Array) + expect(result[0]).toBe((SESSIONS_FLAG_BLACKLIST << 4) | 0x0f) // Encoded large size flag + expect(Bytes.toNumber(result.slice(1, 3))).toBe(blacklistCount) + expect(result.slice(3)).toEqual( + Bytes.concat(...largeBlacklist.blacklist.map((b) => Bytes.padLeft(Bytes.fromHex(b), 20))), + ) + expect(result.length).toBe(3 + blacklistCount * 20) + const decoded = decodeSessionsTopology(result) + expect(decoded).toEqual(largeBlacklist) + }) + it('should encode identity signer leaf', () => { const result = encodeSessionsTopology(sampleIdentitySignerLeaf) expect(result).toBeInstanceOf(Uint8Array) From 0c0bd736119b35e4e2ed3dffc6b508e5349b9a78 Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Tue, 7 Oct 2025 11:28:39 +1300 Subject: [PATCH 33/36] identity signer node length --- packages/wallet/primitives/src/session-config.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/wallet/primitives/src/session-config.ts b/packages/wallet/primitives/src/session-config.ts index f4e94568d7..38ba2056ca 100644 --- a/packages/wallet/primitives/src/session-config.ts +++ b/packages/wallet/primitives/src/session-config.ts @@ -415,12 +415,13 @@ function decodeSessionTopologyPointer(bytes: Bytes.Bytes): { return { topology: { type: 'implicit-blacklist', blacklist }, pointer: offset + blacklistLength * 20 } } else if (flag === SESSIONS_FLAG_IDENTITY_SIGNER) { // Identity signer - if (bytes.length < 21) { + const nodeLength = 21 // Flag + address + if (bytes.length < nodeLength) { throw new Error('Invalid identity signer length') } return { - topology: { type: 'identity-signer', identitySigner: Address.from(Hex.fromBytes(bytes.slice(1, 21))) }, - pointer: 21, + topology: { type: 'identity-signer', identitySigner: Address.from(Hex.fromBytes(bytes.slice(1, nodeLength))) }, + pointer: nodeLength, } } else { throw new Error(`Invalid topology flag: ${flag}`) From f7b52db15b5e770e88b5d20400a558db1f03a247 Mon Sep 17 00:00:00 2001 From: Michael Standen Date: Tue, 7 Oct 2025 05:41:17 +1300 Subject: [PATCH 34/36] Add feeTokens endpoint to relayer (#885) --- .../relayer/src/rpc-relayer/relayer.gen.ts | 1369 +++++++++-------- packages/wallet/core/src/relayer/relayer.ts | 2 + .../core/src/relayer/standard/eip6963.ts | 6 +- .../wallet/core/src/relayer/standard/local.ts | 8 +- .../core/src/relayer/standard/pk-relayer.ts | 5 + .../core/src/relayer/standard/rpc/index.ts | 21 + .../src/relayer/standard/rpc/relayer.gen.ts | 6 +- .../core/src/relayer/standard/sequence.ts | 17 + 8 files changed, 815 insertions(+), 619 deletions(-) diff --git a/packages/services/relayer/src/rpc-relayer/relayer.gen.ts b/packages/services/relayer/src/rpc-relayer/relayer.gen.ts index 79ca492968..0638fbe946 100644 --- a/packages/services/relayer/src/rpc-relayer/relayer.gen.ts +++ b/packages/services/relayer/src/rpc-relayer/relayer.gen.ts @@ -1,76 +1,75 @@ /* eslint-disable */ -// sequence-relayer v0.4.1 62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a +// sequence-relayer v0.4.1 93ac61641d0351211680e2092673726b5c4f1848 // -- // Code generated by webrpc-gen@v0.26.0 with typescript generator. DO NOT EDIT. // // webrpc-gen -schema=relayer.ridl -target=typescript -client -out=./clients/relayer.gen.ts -export const WebrpcHeader = "Webrpc" +export const WebrpcHeader = 'Webrpc' -export const WebrpcHeaderValue = "webrpc@v0.26.0;gen-typescript@v0.17.0;sequence-relayer@v0.4.1" +export const WebrpcHeaderValue = 'webrpc@v0.26.0;gen-typescript@v0.17.0;sequence-relayer@v0.4.1' // WebRPC description and code-gen version -export const WebRPCVersion = "v1" +export const WebRPCVersion = 'v1' // Schema version of your RIDL schema -export const WebRPCSchemaVersion = "v0.4.1" +export const WebRPCSchemaVersion = 'v0.4.1' // Schema hash generated from your RIDL schema -export const WebRPCSchemaHash = "62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a" +export const WebRPCSchemaHash = '93ac61641d0351211680e2092673726b5c4f1848' type WebrpcGenVersions = { - webrpcGenVersion: string; - codeGenName: string; - codeGenVersion: string; - schemaName: string; - schemaVersion: string; -}; + webrpcGenVersion: string + codeGenName: string + codeGenVersion: string + schemaName: string + schemaVersion: string +} export function VersionFromHeader(headers: Headers): WebrpcGenVersions { - const headerValue = headers.get(WebrpcHeader); + const headerValue = headers.get(WebrpcHeader) if (!headerValue) { return { - webrpcGenVersion: "", - codeGenName: "", - codeGenVersion: "", - schemaName: "", - schemaVersion: "", - }; + webrpcGenVersion: '', + codeGenName: '', + codeGenVersion: '', + schemaName: '', + schemaVersion: '', + } } - return parseWebrpcGenVersions(headerValue); + return parseWebrpcGenVersions(headerValue) } function parseWebrpcGenVersions(header: string): WebrpcGenVersions { - const versions = header.split(";"); + const versions = header.split(';') if (versions.length < 3) { return { - webrpcGenVersion: "", - codeGenName: "", - codeGenVersion: "", - schemaName: "", - schemaVersion: "", - }; + webrpcGenVersion: '', + codeGenName: '', + codeGenVersion: '', + schemaName: '', + schemaVersion: '', + } } - const [_, webrpcGenVersion] = versions[0]!.split("@"); - const [codeGenName, codeGenVersion] = versions[1]!.split("@"); - const [schemaName, schemaVersion] = versions[2]!.split("@"); + const [_, webrpcGenVersion] = versions[0]!.split('@') + const [codeGenName, codeGenVersion] = versions[1]!.split('@') + const [schemaName, schemaVersion] = versions[2]!.split('@') return { - webrpcGenVersion: webrpcGenVersion ?? "", - codeGenName: codeGenName ?? "", - codeGenVersion: codeGenVersion ?? "", - schemaName: schemaName ?? "", - schemaVersion: schemaVersion ?? "", - }; + webrpcGenVersion: webrpcGenVersion ?? '', + codeGenName: codeGenName ?? '', + codeGenVersion: codeGenVersion ?? '', + schemaName: schemaName ?? '', + schemaVersion: schemaVersion ?? '', + } } // // Types // - export enum ETHTxnStatus { UNKNOWN = 'UNKNOWN', DROPPED = 'DROPPED', @@ -79,7 +78,7 @@ export enum ETHTxnStatus { SUCCEEDED = 'SUCCEEDED', PARTIALLY_FAILED = 'PARTIALLY_FAILED', FAILED = 'FAILED', - PENDING_PRECONDITION = 'PENDING_PRECONDITION' + PENDING_PRECONDITION = 'PENDING_PRECONDITION', } export enum TransferType { @@ -88,7 +87,7 @@ export enum TransferType { BRIDGE_DEPOSIT = 'BRIDGE_DEPOSIT', BRIDGE_WITHDRAW = 'BRIDGE_WITHDRAW', BURN = 'BURN', - UNKNOWN = 'UNKNOWN' + UNKNOWN = 'UNKNOWN', } export enum SimulateStatus { @@ -97,18 +96,18 @@ export enum SimulateStatus { FAILED = 'FAILED', ABORTED = 'ABORTED', REVERTED = 'REVERTED', - NOT_ENOUGH_GAS = 'NOT_ENOUGH_GAS' + NOT_ENOUGH_GAS = 'NOT_ENOUGH_GAS', } export enum FeeTokenType { UNKNOWN = 'UNKNOWN', ERC20_TOKEN = 'ERC20_TOKEN', - ERC1155_TOKEN = 'ERC1155_TOKEN' + ERC1155_TOKEN = 'ERC1155_TOKEN', } export enum SortOrder { DESC = 'DESC', - ASC = 'ASC' + ASC = 'ASC', } export interface Version { @@ -138,8 +137,7 @@ export interface SenderStatus { active: boolean } -export interface RuntimeChecks { -} +export interface RuntimeChecks {} export interface SequenceContext { factory: string @@ -215,8 +213,8 @@ export interface MetaTxnLog { minedAt: string target: string input: string - txnArgs: {[key: string]: any} - txnReceipt?: {[key: string]: any} + txnArgs: { [key: string]: any } + txnReceipt?: { [key: string]: any } walletAddress: string metaTxnNonce: string gasLimit: number @@ -353,9 +351,9 @@ export interface Relayer { getSequenceContext(headers?: object, signal?: AbortSignal): Promise getChainID(headers?: object, signal?: AbortSignal): Promise /** - * + * * Transactions - * + * * TODO (future): rename this to just, 'SendTransaction(txn: MetaTransaction)' or 'SendTransaction(txn: SignedTransaction)', or something.. * Project ID is only used by service and admin calls. Other clients must have projectID passed via the context * TODO: rename return txnHash: string to metaTxnID: string @@ -370,21 +368,41 @@ export interface Relayer { * new, GetTransactionReceipt and WaitTransactionReceipt methods * we can also accept metaTxnId and txnHash .. so can take either or.. I wonder if ERC-4337 has any convention on this? */ - getMetaTxnReceipt(args: GetMetaTxnReceiptArgs, headers?: object, signal?: AbortSignal): Promise + getMetaTxnReceipt( + args: GetMetaTxnReceiptArgs, + headers?: object, + signal?: AbortSignal, + ): Promise simulate(args: SimulateArgs, headers?: object, signal?: AbortSignal): Promise simulateV3(args: SimulateV3Args, headers?: object, signal?: AbortSignal): Promise /** * TODO: deprecated, to be removed by https://github.com/0xsequence/stack/pull/356 at a later date */ - updateMetaTxnGasLimits(args: UpdateMetaTxnGasLimitsArgs, headers?: object, signal?: AbortSignal): Promise + updateMetaTxnGasLimits( + args: UpdateMetaTxnGasLimitsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise feeTokens(headers?: object, signal?: AbortSignal): Promise feeOptions(args: FeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise /** * TODO: deprecated, to be removed by https://github.com/0xsequence/stack/pull/356 at a later date */ - getMetaTxnNetworkFeeOptions(args: GetMetaTxnNetworkFeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise - getMetaTransactions(args: GetMetaTransactionsArgs, headers?: object, signal?: AbortSignal): Promise - getTransactionCost(args: GetTransactionCostArgs, headers?: object, signal?: AbortSignal): Promise + getMetaTxnNetworkFeeOptions( + args: GetMetaTxnNetworkFeeOptionsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + getMetaTransactions( + args: GetMetaTransactionsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + getTransactionCost( + args: GetTransactionCostArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** * Sent transactions from an account. If filter is omitted then it will return all transactions. */ @@ -393,7 +411,11 @@ export interface Relayer { * Pending transactions waiting to be mined for an account. This endpoint is just a sugar of `SentTransactions` * with the filter set to pending: true. */ - pendingTransactions(args: PendingTransactionsArgs, headers?: object, signal?: AbortSignal): Promise + pendingTransactions( + args: PendingTransactionsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** * Legacy Gas Tank */ @@ -403,10 +425,26 @@ export interface Relayer { /** * Legacy Gas Adjustment */ - nextGasTankBalanceAdjustmentNonce(args: NextGasTankBalanceAdjustmentNonceArgs, headers?: object, signal?: AbortSignal): Promise - adjustGasTankBalance(args: AdjustGasTankBalanceArgs, headers?: object, signal?: AbortSignal): Promise - getGasTankBalanceAdjustment(args: GetGasTankBalanceAdjustmentArgs, headers?: object, signal?: AbortSignal): Promise - listGasTankBalanceAdjustments(args: ListGasTankBalanceAdjustmentsArgs, headers?: object, signal?: AbortSignal): Promise + nextGasTankBalanceAdjustmentNonce( + args: NextGasTankBalanceAdjustmentNonceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + adjustGasTankBalance( + args: AdjustGasTankBalanceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + getGasTankBalanceAdjustment( + args: GetGasTankBalanceAdjustmentArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + listGasTankBalanceAdjustments( + args: ListGasTankBalanceAdjustmentsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** * Gas Sponsorship */ @@ -418,43 +456,50 @@ export interface Relayer { /** * Gas Sponsor Lookup */ - addressGasSponsors(args: AddressGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise + addressGasSponsors( + args: AddressGasSponsorsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise /** * Project Balance */ - getProjectBalance(args: GetProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise - adjustProjectBalance(args: AdjustProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise + getProjectBalance( + args: GetProjectBalanceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise + adjustProjectBalance( + args: AdjustProjectBalanceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise } -export interface PingArgs { -} +export interface PingArgs {} export interface PingReturn { - status: boolean -} -export interface VersionArgs { + status: boolean } +export interface VersionArgs {} export interface VersionReturn { - version: Version -} -export interface RuntimeStatusArgs { + version: Version } +export interface RuntimeStatusArgs {} export interface RuntimeStatusReturn { - status: RuntimeStatus -} -export interface GetSequenceContextArgs { + status: RuntimeStatus } +export interface GetSequenceContextArgs {} export interface GetSequenceContextReturn { - data: SequenceContext -} -export interface GetChainIDArgs { + data: SequenceContext } +export interface GetChainIDArgs {} export interface GetChainIDReturn { - chainID: number + chainID: number } export interface SendMetaTxnArgs { call: MetaTxn @@ -465,7 +510,7 @@ export interface SendMetaTxnArgs { export interface SendMetaTxnReturn { status: boolean - txnHash: string + txnHash: string } export interface GetMetaTxnNonceArgs { walletContractAddress: string @@ -473,14 +518,14 @@ export interface GetMetaTxnNonceArgs { } export interface GetMetaTxnNonceReturn { - nonce: string + nonce: string } export interface GetMetaTxnReceiptArgs { metaTxID: string } export interface GetMetaTxnReceiptReturn { - receipt: MetaTxnReceipt + receipt: MetaTxnReceipt } export interface SimulateArgs { wallet: string @@ -488,7 +533,7 @@ export interface SimulateArgs { } export interface SimulateReturn { - results: Array + results: Array } export interface SimulateV3Args { wallet: string @@ -496,7 +541,7 @@ export interface SimulateV3Args { } export interface SimulateV3Return { - results: Array + results: Array } export interface UpdateMetaTxnGasLimitsArgs { walletAddress: string @@ -505,14 +550,14 @@ export interface UpdateMetaTxnGasLimitsArgs { } export interface UpdateMetaTxnGasLimitsReturn { - payload: string -} -export interface FeeTokensArgs { + payload: string } +export interface FeeTokensArgs {} export interface FeeTokensReturn { isFeeRequired: boolean - tokens: Array + tokens: Array + paymentAddress: string } export interface FeeOptionsArgs { wallet: string @@ -524,7 +569,7 @@ export interface FeeOptionsArgs { export interface FeeOptionsReturn { options: Array sponsored: boolean - quote?: string + quote?: string } export interface GetMetaTxnNetworkFeeOptionsArgs { walletConfig: any @@ -532,7 +577,7 @@ export interface GetMetaTxnNetworkFeeOptionsArgs { } export interface GetMetaTxnNetworkFeeOptionsReturn { - options: Array + options: Array } export interface GetMetaTransactionsArgs { projectId: number @@ -541,7 +586,7 @@ export interface GetMetaTransactionsArgs { export interface GetMetaTransactionsReturn { page: Page - transactions: Array + transactions: Array } export interface GetTransactionCostArgs { projectId: number @@ -550,7 +595,7 @@ export interface GetTransactionCostArgs { } export interface GetTransactionCostReturn { - cost: number + cost: number } export interface SentTransactionsArgs { filter?: SentTransactionsFilter @@ -559,7 +604,7 @@ export interface SentTransactionsArgs { export interface SentTransactionsReturn { page: Page - transactions: Array + transactions: Array } export interface PendingTransactionsArgs { page?: Page @@ -567,14 +612,14 @@ export interface PendingTransactionsArgs { export interface PendingTransactionsReturn { page: Page - transactions: Array + transactions: Array } export interface GetGasTankArgs { id: number } export interface GetGasTankReturn { - gasTank: GasTank + gasTank: GasTank } export interface AddGasTankArgs { name: string @@ -584,7 +629,7 @@ export interface AddGasTankArgs { export interface AddGasTankReturn { status: boolean - gasTank: GasTank + gasTank: GasTank } export interface UpdateGasTankArgs { id: number @@ -595,14 +640,14 @@ export interface UpdateGasTankArgs { export interface UpdateGasTankReturn { status: boolean - gasTank: GasTank + gasTank: GasTank } export interface NextGasTankBalanceAdjustmentNonceArgs { id: number } export interface NextGasTankBalanceAdjustmentNonceReturn { - nonce: number + nonce: number } export interface AdjustGasTankBalanceArgs { id: number @@ -612,7 +657,7 @@ export interface AdjustGasTankBalanceArgs { export interface AdjustGasTankBalanceReturn { status: boolean - adjustment: GasTankBalanceAdjustment + adjustment: GasTankBalanceAdjustment } export interface GetGasTankBalanceAdjustmentArgs { id: number @@ -620,7 +665,7 @@ export interface GetGasTankBalanceAdjustmentArgs { } export interface GetGasTankBalanceAdjustmentReturn { - adjustment: GasTankBalanceAdjustment + adjustment: GasTankBalanceAdjustment } export interface ListGasTankBalanceAdjustmentsArgs { id: number @@ -629,7 +674,7 @@ export interface ListGasTankBalanceAdjustmentsArgs { export interface ListGasTankBalanceAdjustmentsReturn { page: Page - adjustments: Array + adjustments: Array } export interface ListGasSponsorsArgs { projectId: number @@ -638,7 +683,7 @@ export interface ListGasSponsorsArgs { export interface ListGasSponsorsReturn { page: Page - gasSponsors: Array + gasSponsors: Array } export interface GetGasSponsorArgs { projectId: number @@ -646,7 +691,7 @@ export interface GetGasSponsorArgs { } export interface GetGasSponsorReturn { - gasSponsor: GasSponsor + gasSponsor: GasSponsor } export interface AddGasSponsorArgs { projectId: number @@ -657,7 +702,7 @@ export interface AddGasSponsorArgs { export interface AddGasSponsorReturn { status: boolean - gasSponsor: GasSponsor + gasSponsor: GasSponsor } export interface UpdateGasSponsorArgs { projectId: number @@ -668,7 +713,7 @@ export interface UpdateGasSponsorArgs { export interface UpdateGasSponsorReturn { status: boolean - gasSponsor: GasSponsor + gasSponsor: GasSponsor } export interface RemoveGasSponsorArgs { projectId: number @@ -676,7 +721,7 @@ export interface RemoveGasSponsorArgs { } export interface RemoveGasSponsorReturn { - status: boolean + status: boolean } export interface AddressGasSponsorsArgs { address: string @@ -685,14 +730,14 @@ export interface AddressGasSponsorsArgs { export interface AddressGasSponsorsReturn { page: Page - gasSponsors: Array + gasSponsors: Array } export interface GetProjectBalanceArgs { projectId: number } export interface GetProjectBalanceReturn { - balance: number + balance: number } export interface AdjustProjectBalanceArgs { projectId: number @@ -701,11 +746,9 @@ export interface AdjustProjectBalanceArgs { } export interface AdjustProjectBalanceReturn { - balance: number + balance: number } - - // // Client // @@ -722,521 +765,620 @@ export class Relayer implements Relayer { private url(name: string): string { return this.hostname + this.path + name } - + ping = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('Ping'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('Ping'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + version = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('Version'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - version: (_data.version), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('Version'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + version: _data.version, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + runtimeStatus = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('RuntimeStatus'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('RuntimeStatus'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getSequenceContext = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetSequenceContext'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - data: (_data.data), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetSequenceContext'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + data: _data.data, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getChainID = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetChainID'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - chainID: (_data.chainID), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetChainID'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + chainID: _data.chainID, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + sendMetaTxn = (args: SendMetaTxnArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SendMetaTxn'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - txnHash: (_data.txnHash), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getMetaTxnNonce = (args: GetMetaTxnNonceArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetMetaTxnNonce'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - nonce: (_data.nonce), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getMetaTxnReceipt = (args: GetMetaTxnReceiptArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetMetaTxnReceipt'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - receipt: (_data.receipt), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('SendMetaTxn'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + txnHash: _data.txnHash, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getMetaTxnNonce = ( + args: GetMetaTxnNonceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetMetaTxnNonce'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + nonce: _data.nonce, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getMetaTxnReceipt = ( + args: GetMetaTxnReceiptArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetMetaTxnReceipt'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + receipt: _data.receipt, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + simulate = (args: SimulateArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('Simulate'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - results: >(_data.results), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('Simulate'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + results: >_data.results, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + simulateV3 = (args: SimulateV3Args, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SimulateV3'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - results: >(_data.results), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - updateMetaTxnGasLimits = (args: UpdateMetaTxnGasLimitsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('UpdateMetaTxnGasLimits'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - payload: (_data.payload), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('SimulateV3'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + results: >_data.results, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + updateMetaTxnGasLimits = ( + args: UpdateMetaTxnGasLimitsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('UpdateMetaTxnGasLimits'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + payload: _data.payload, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + feeTokens = (headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('FeeTokens'), - createHTTPRequest({}, headers, signal) - ).then((res) => { - return buildResponse(res).then(_data => { - return { - isFeeRequired: (_data.isFeeRequired), - tokens: >(_data.tokens), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('FeeTokens'), createHTTPRequest({}, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + isFeeRequired: _data.isFeeRequired, + tokens: >_data.tokens, + paymentAddress: _data.paymentAddress, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + feeOptions = (args: FeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('FeeOptions'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - options: >(_data.options), - sponsored: (_data.sponsored), - quote: (_data.quote), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getMetaTxnNetworkFeeOptions = (args: GetMetaTxnNetworkFeeOptionsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetMetaTxnNetworkFeeOptions'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - options: >(_data.options), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getMetaTransactions = (args: GetMetaTransactionsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetMetaTransactions'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - page: (_data.page), - transactions: >(_data.transactions), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getTransactionCost = (args: GetTransactionCostArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetTransactionCost'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - cost: (_data.cost), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - sentTransactions = (args: SentTransactionsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('SentTransactions'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - page: (_data.page), - transactions: >(_data.transactions), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - pendingTransactions = (args: PendingTransactionsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('PendingTransactions'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - page: (_data.page), - transactions: >(_data.transactions), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('FeeOptions'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + options: >_data.options, + sponsored: _data.sponsored, + quote: _data.quote, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getMetaTxnNetworkFeeOptions = ( + args: GetMetaTxnNetworkFeeOptionsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetMetaTxnNetworkFeeOptions'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + options: >_data.options, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getMetaTransactions = ( + args: GetMetaTransactionsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetMetaTransactions'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + page: _data.page, + transactions: >_data.transactions, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getTransactionCost = ( + args: GetTransactionCostArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetTransactionCost'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + cost: _data.cost, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + sentTransactions = ( + args: SentTransactionsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('SentTransactions'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + page: _data.page, + transactions: >_data.transactions, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + pendingTransactions = ( + args: PendingTransactionsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('PendingTransactions'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + page: _data.page, + transactions: >_data.transactions, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getGasTank = (args: GetGasTankArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetGasTank'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - gasTank: (_data.gasTank), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetGasTank'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + gasTank: _data.gasTank, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + addGasTank = (args: AddGasTankArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('AddGasTank'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - gasTank: (_data.gasTank), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('AddGasTank'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + gasTank: _data.gasTank, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + updateGasTank = (args: UpdateGasTankArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('UpdateGasTank'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - gasTank: (_data.gasTank), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - nextGasTankBalanceAdjustmentNonce = (args: NextGasTankBalanceAdjustmentNonceArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('NextGasTankBalanceAdjustmentNonce'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - nonce: (_data.nonce), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - adjustGasTankBalance = (args: AdjustGasTankBalanceArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('AdjustGasTankBalance'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - adjustment: (_data.adjustment), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getGasTankBalanceAdjustment = (args: GetGasTankBalanceAdjustmentArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetGasTankBalanceAdjustment'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - adjustment: (_data.adjustment), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - listGasTankBalanceAdjustments = (args: ListGasTankBalanceAdjustmentsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('ListGasTankBalanceAdjustments'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - page: (_data.page), - adjustments: >(_data.adjustments), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - listGasSponsors = (args: ListGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('ListGasSponsors'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - page: (_data.page), - gasSponsors: >(_data.gasSponsors), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('UpdateGasTank'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + gasTank: _data.gasTank, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + nextGasTankBalanceAdjustmentNonce = ( + args: NextGasTankBalanceAdjustmentNonceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('NextGasTankBalanceAdjustmentNonce'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + nonce: _data.nonce, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + adjustGasTankBalance = ( + args: AdjustGasTankBalanceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('AdjustGasTankBalance'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + adjustment: _data.adjustment, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getGasTankBalanceAdjustment = ( + args: GetGasTankBalanceAdjustmentArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetGasTankBalanceAdjustment'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + adjustment: _data.adjustment, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + listGasTankBalanceAdjustments = ( + args: ListGasTankBalanceAdjustmentsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('ListGasTankBalanceAdjustments'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + page: _data.page, + adjustments: >_data.adjustments, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + listGasSponsors = ( + args: ListGasSponsorsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('ListGasSponsors'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + page: _data.page, + gasSponsors: >_data.gasSponsors, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - + getGasSponsor = (args: GetGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetGasSponsor'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - gasSponsor: (_data.gasSponsor), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - addGasSponsor = (args: AddGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('AddGasSponsor'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - gasSponsor: (_data.gasSponsor), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - updateGasSponsor = (args: UpdateGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('UpdateGasSponsor'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - gasSponsor: (_data.gasSponsor), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - removeGasSponsor = (args: RemoveGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('RemoveGasSponsor'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - status: (_data.status), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - addressGasSponsors = (args: AddressGasSponsorsArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('AddressGasSponsors'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - page: (_data.page), - gasSponsors: >(_data.gasSponsors), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - getProjectBalance = (args: GetProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('GetProjectBalance'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - balance: (_data.balance), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) - } - - adjustProjectBalance = (args: AdjustProjectBalanceArgs, headers?: object, signal?: AbortSignal): Promise => { - return this.fetch( - this.url('AdjustProjectBalance'), - createHTTPRequest(args, headers, signal)).then((res) => { - return buildResponse(res).then(_data => { - return { - balance: (_data.balance), - } - }) - }, (error) => { - throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) - }) + return this.fetch(this.url('GetGasSponsor'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + gasSponsor: _data.gasSponsor, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) } - -} - const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => { - const reqHeaders: {[key: string]: string} = { ...headers, 'Content-Type': 'application/json' } + addGasSponsor = (args: AddGasSponsorArgs, headers?: object, signal?: AbortSignal): Promise => { + return this.fetch(this.url('AddGasSponsor'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + gasSponsor: _data.gasSponsor, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + updateGasSponsor = ( + args: UpdateGasSponsorArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('UpdateGasSponsor'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + gasSponsor: _data.gasSponsor, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + removeGasSponsor = ( + args: RemoveGasSponsorArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('RemoveGasSponsor'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + status: _data.status, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + addressGasSponsors = ( + args: AddressGasSponsorsArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('AddressGasSponsors'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + page: _data.page, + gasSponsors: >_data.gasSponsors, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + getProjectBalance = ( + args: GetProjectBalanceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('GetProjectBalance'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + balance: _data.balance, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } + + adjustProjectBalance = ( + args: AdjustProjectBalanceArgs, + headers?: object, + signal?: AbortSignal, + ): Promise => { + return this.fetch(this.url('AdjustProjectBalance'), createHTTPRequest(args, headers, signal)).then( + (res) => { + return buildResponse(res).then((_data) => { + return { + balance: _data.balance, + } + }) + }, + (error) => { + throw WebrpcRequestFailedError.new({ cause: `fetch(): ${error.message || ''}` }) + }, + ) + } +} + +const createHTTPRequest = (body: object = {}, headers: object = {}, signal: AbortSignal | null = null): object => { + const reqHeaders: { [key: string]: string } = { ...headers, 'Content-Type': 'application/json' } reqHeaders[WebrpcHeader] = WebrpcHeaderValue return { method: 'POST', headers: reqHeaders, body: JSON.stringify(body || {}), - signal + signal, } } const buildResponse = (res: Response): Promise => { - return res.text().then(text => { + return res.text().then((text) => { let data try { data = JSON.parse(text) - } catch(error) { + } catch (error) { let message = '' - if (error instanceof Error) { + if (error instanceof Error) { message = error.message } throw WebrpcBadResponseError.new({ status: res.status, - cause: `JSON.parse(): ${message}: response text: ${text}`}, - ) + cause: `JSON.parse(): ${message}: response text: ${text}`, + }) } if (!res.ok) { - const code: number = (typeof data.code === 'number') ? data.code : 0 + const code: number = typeof data.code === 'number' ? data.code : 0 throw (webrpcErrorByCode[code] || WebrpcError).new(data) } return data @@ -1281,7 +1423,7 @@ export class WebrpcEndpointError extends WebrpcError { code: number = 0, message: string = `endpoint error`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcEndpointError.prototype) @@ -1294,7 +1436,7 @@ export class WebrpcRequestFailedError extends WebrpcError { code: number = -1, message: string = `request failed`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcRequestFailedError.prototype) @@ -1307,7 +1449,7 @@ export class WebrpcBadRouteError extends WebrpcError { code: number = -2, message: string = `bad route`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadRouteError.prototype) @@ -1320,7 +1462,7 @@ export class WebrpcBadMethodError extends WebrpcError { code: number = -3, message: string = `bad method`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadMethodError.prototype) @@ -1333,7 +1475,7 @@ export class WebrpcBadRequestError extends WebrpcError { code: number = -4, message: string = `bad request`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadRequestError.prototype) @@ -1346,7 +1488,7 @@ export class WebrpcBadResponseError extends WebrpcError { code: number = -5, message: string = `bad response`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcBadResponseError.prototype) @@ -1359,7 +1501,7 @@ export class WebrpcServerPanicError extends WebrpcError { code: number = -6, message: string = `server panic`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcServerPanicError.prototype) @@ -1372,7 +1514,7 @@ export class WebrpcInternalErrorError extends WebrpcError { code: number = -7, message: string = `internal error`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcInternalErrorError.prototype) @@ -1385,7 +1527,7 @@ export class WebrpcClientDisconnectedError extends WebrpcError { code: number = -8, message: string = `client disconnected`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcClientDisconnectedError.prototype) @@ -1398,7 +1540,7 @@ export class WebrpcStreamLostError extends WebrpcError { code: number = -9, message: string = `stream lost`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcStreamLostError.prototype) @@ -1411,14 +1553,13 @@ export class WebrpcStreamFinishedError extends WebrpcError { code: number = -10, message: string = `stream finished`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, WebrpcStreamFinishedError.prototype) } } - // Schema errors export class UnauthorizedError extends WebrpcError { @@ -1427,7 +1568,7 @@ export class UnauthorizedError extends WebrpcError { code: number = 1000, message: string = `Unauthorized access`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnauthorizedError.prototype) @@ -1440,7 +1581,7 @@ export class PermissionDeniedError extends WebrpcError { code: number = 1001, message: string = `Permission denied`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, PermissionDeniedError.prototype) @@ -1453,7 +1594,7 @@ export class SessionExpiredError extends WebrpcError { code: number = 1002, message: string = `Session expired`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, SessionExpiredError.prototype) @@ -1466,7 +1607,7 @@ export class MethodNotFoundError extends WebrpcError { code: number = 1003, message: string = `Method not found`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, MethodNotFoundError.prototype) @@ -1479,7 +1620,7 @@ export class RequestConflictError extends WebrpcError { code: number = 1004, message: string = `Conflict with target resource`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, RequestConflictError.prototype) @@ -1492,7 +1633,7 @@ export class AbortedError extends WebrpcError { code: number = 1005, message: string = `Request aborted`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AbortedError.prototype) @@ -1505,7 +1646,7 @@ export class GeoblockedError extends WebrpcError { code: number = 1006, message: string = `Geoblocked region`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, GeoblockedError.prototype) @@ -1518,7 +1659,7 @@ export class RateLimitedError extends WebrpcError { code: number = 1007, message: string = `Rate-limited. Please slow down.`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, RateLimitedError.prototype) @@ -1531,7 +1672,7 @@ export class ProjectNotFoundError extends WebrpcError { code: number = 1008, message: string = `Project not found`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, ProjectNotFoundError.prototype) @@ -1544,7 +1685,7 @@ export class AccessKeyNotFoundError extends WebrpcError { code: number = 1101, message: string = `Access key not found`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AccessKeyNotFoundError.prototype) @@ -1557,7 +1698,7 @@ export class AccessKeyMismatchError extends WebrpcError { code: number = 1102, message: string = `Access key mismatch`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AccessKeyMismatchError.prototype) @@ -1570,7 +1711,7 @@ export class InvalidOriginError extends WebrpcError { code: number = 1103, message: string = `Invalid origin for Access Key`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InvalidOriginError.prototype) @@ -1583,7 +1724,7 @@ export class InvalidServiceError extends WebrpcError { code: number = 1104, message: string = `Service not enabled for Access key`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InvalidServiceError.prototype) @@ -1596,7 +1737,7 @@ export class UnauthorizedUserError extends WebrpcError { code: number = 1105, message: string = `Unauthorized user`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnauthorizedUserError.prototype) @@ -1609,7 +1750,7 @@ export class QuotaExceededError extends WebrpcError { code: number = 1200, message: string = `Quota request exceeded`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, QuotaExceededError.prototype) @@ -1622,7 +1763,7 @@ export class QuotaRateLimitError extends WebrpcError { code: number = 1201, message: string = `Quota rate limit exceeded`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, QuotaRateLimitError.prototype) @@ -1635,7 +1776,7 @@ export class NoDefaultKeyError extends WebrpcError { code: number = 1300, message: string = `No default access key found`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, NoDefaultKeyError.prototype) @@ -1648,7 +1789,7 @@ export class MaxAccessKeysError extends WebrpcError { code: number = 1301, message: string = `Access keys limit reached`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, MaxAccessKeysError.prototype) @@ -1661,7 +1802,7 @@ export class AtLeastOneKeyError extends WebrpcError { code: number = 1302, message: string = `You need at least one Access Key`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, AtLeastOneKeyError.prototype) @@ -1674,7 +1815,7 @@ export class TimeoutError extends WebrpcError { code: number = 1900, message: string = `Request timed out`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, TimeoutError.prototype) @@ -1687,7 +1828,7 @@ export class InvalidArgumentError extends WebrpcError { code: number = 2001, message: string = `Invalid argument`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InvalidArgumentError.prototype) @@ -1700,7 +1841,7 @@ export class UnavailableError extends WebrpcError { code: number = 2002, message: string = `Unavailable resource`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, UnavailableError.prototype) @@ -1713,7 +1854,7 @@ export class QueryFailedError extends WebrpcError { code: number = 2003, message: string = `Query failed`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, QueryFailedError.prototype) @@ -1726,7 +1867,7 @@ export class NotFoundError extends WebrpcError { code: number = 3000, message: string = `Resource not found`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, NotFoundError.prototype) @@ -1739,7 +1880,7 @@ export class InsufficientFeeError extends WebrpcError { code: number = 3004, message: string = `Insufficient fee`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, InsufficientFeeError.prototype) @@ -1752,7 +1893,7 @@ export class NotEnoughBalanceError extends WebrpcError { code: number = 3005, message: string = `Not enough balance`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, NotEnoughBalanceError.prototype) @@ -1765,14 +1906,13 @@ export class SimulationFailedError extends WebrpcError { code: number = 3006, message: string = `Simulation failed`, status: number = 0, - cause?: string + cause?: string, ) { super(name, code, message, status, cause) Object.setPrototypeOf(this, SimulationFailedError.prototype) } } - export enum errors { WebrpcEndpoint = 'WebrpcEndpoint', WebrpcRequestFailed = 'WebrpcRequestFailed', @@ -1897,4 +2037,3 @@ export const webrpcErrorByCode: { [code: number]: any } = { } export type Fetch = (input: RequestInfo, init?: RequestInit) => Promise - diff --git a/packages/wallet/core/src/relayer/relayer.ts b/packages/wallet/core/src/relayer/relayer.ts index db28608fca..d7c0cb617f 100644 --- a/packages/wallet/core/src/relayer/relayer.ts +++ b/packages/wallet/core/src/relayer/relayer.ts @@ -63,6 +63,8 @@ export interface Relayer { isAvailable(wallet: Address.Address, chainId: number): Promise + feeTokens(): Promise<{ isFeeRequired: boolean; tokens?: FeeToken[]; paymentAddress?: Address.Address }> + feeOptions( wallet: Address.Address, chainId: number, diff --git a/packages/wallet/core/src/relayer/standard/eip6963.ts b/packages/wallet/core/src/relayer/standard/eip6963.ts index e1a2bd1746..66e7c4c4c3 100644 --- a/packages/wallet/core/src/relayer/standard/eip6963.ts +++ b/packages/wallet/core/src/relayer/standard/eip6963.ts @@ -3,7 +3,7 @@ import { EIP1193ProviderAdapter, LocalRelayer } from './local.js' import { FeeOption, FeeQuote, OperationStatus, Relayer } from '../relayer.js' import { Address, Hex } from 'ox' import { Payload } from '@0xsequence/wallet-primitives' -import { IntentPrecondition } from './rpc/relayer.gen.js' +import { FeeToken, IntentPrecondition } from './rpc/relayer.gen.js' export class EIP6963Relayer implements Relayer { public readonly kind: 'relayer' = 'relayer' @@ -23,6 +23,10 @@ export class EIP6963Relayer implements Relayer { return this.relayer.isAvailable(wallet, chainId) } + feeTokens(): Promise<{ isFeeRequired: boolean; tokens?: FeeToken[]; paymentAddress?: Address.Address }> { + return this.relayer.feeTokens() + } + feeOptions( wallet: Address.Address, chainId: number, diff --git a/packages/wallet/core/src/relayer/standard/local.ts b/packages/wallet/core/src/relayer/standard/local.ts index 0e4f30732a..274af44eb4 100644 --- a/packages/wallet/core/src/relayer/standard/local.ts +++ b/packages/wallet/core/src/relayer/standard/local.ts @@ -2,7 +2,7 @@ import { Constants, Payload } from '@0xsequence/wallet-primitives' import { EIP1193Provider } from 'mipd' import { AbiFunction, Address, Bytes, Hex, TransactionReceipt } from 'ox' import { FeeOption, FeeQuote, OperationStatus, Relayer } from '../relayer.js' -import { IntentPrecondition } from './rpc/relayer.gen.js' +import { FeeToken, IntentPrecondition } from './rpc/relayer.gen.js' import { decodePrecondition } from '../../preconditions/index.js' import { erc20BalanceOf, @@ -47,6 +47,12 @@ export class LocalRelayer implements Relayer { return new LocalRelayer(new EIP1193ProviderAdapter(provider)) } + feeTokens(): Promise<{ isFeeRequired: boolean; tokens?: FeeToken[]; paymentAddress?: Address.Address }> { + return Promise.resolve({ + isFeeRequired: false, + }) + } + feeOptions( wallet: Address.Address, chainId: number, diff --git a/packages/wallet/core/src/relayer/standard/pk-relayer.ts b/packages/wallet/core/src/relayer/standard/pk-relayer.ts index d680f67f77..a8e850af46 100644 --- a/packages/wallet/core/src/relayer/standard/pk-relayer.ts +++ b/packages/wallet/core/src/relayer/standard/pk-relayer.ts @@ -2,6 +2,7 @@ import { Payload, Precondition } from '@0xsequence/wallet-primitives' import { Address, Hex, Provider, Secp256k1, TransactionEnvelopeEip1559, TransactionReceipt } from 'ox' import { LocalRelayer } from './local.js' import { FeeOption, FeeQuote, OperationStatus, Relayer } from '../relayer.js' +import { FeeToken } from './rpc/relayer.gen.js' export class PkRelayer implements Relayer { public readonly kind: 'relayer' = 'relayer' @@ -106,6 +107,10 @@ export class PkRelayer implements Relayer { return providerChainId === chainId } + feeTokens(): Promise<{ isFeeRequired: boolean; tokens?: FeeToken[]; paymentAddress?: Address.Address }> { + return this.relayer.feeTokens() + } + feeOptions( wallet: Address.Address, chainId: number, diff --git a/packages/wallet/core/src/relayer/standard/rpc/index.ts b/packages/wallet/core/src/relayer/standard/rpc/index.ts index 23f175d2fe..f64a8f005d 100644 --- a/packages/wallet/core/src/relayer/standard/rpc/index.ts +++ b/packages/wallet/core/src/relayer/standard/rpc/index.ts @@ -109,6 +109,27 @@ export class RpcRelayer implements Relayer { return Promise.resolve(this.chainId === chainId) } + async feeTokens(): Promise<{ isFeeRequired: boolean; tokens?: RpcFeeToken[]; paymentAddress?: Address.Address }> { + try { + const { isFeeRequired, tokens, paymentAddress } = await this.client.feeTokens() + if (isFeeRequired) { + Address.assert(paymentAddress) + return { + isFeeRequired, + tokens, + paymentAddress, + } + } + // Not required + return { + isFeeRequired, + } + } catch (e) { + console.warn('RpcRelayer.feeTokens failed:', e) + return { isFeeRequired: false } + } + } + async feeOptions( wallet: Address.Address, chainId: number, diff --git a/packages/wallet/core/src/relayer/standard/rpc/relayer.gen.ts b/packages/wallet/core/src/relayer/standard/rpc/relayer.gen.ts index a9e6b44405..0638fbe946 100644 --- a/packages/wallet/core/src/relayer/standard/rpc/relayer.gen.ts +++ b/packages/wallet/core/src/relayer/standard/rpc/relayer.gen.ts @@ -1,5 +1,5 @@ /* eslint-disable */ -// sequence-relayer v0.4.1 62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a +// sequence-relayer v0.4.1 93ac61641d0351211680e2092673726b5c4f1848 // -- // Code generated by webrpc-gen@v0.26.0 with typescript generator. DO NOT EDIT. // @@ -16,7 +16,7 @@ export const WebRPCVersion = 'v1' export const WebRPCSchemaVersion = 'v0.4.1' // Schema hash generated from your RIDL schema -export const WebRPCSchemaHash = '62fe2b49d57c4a0d3960ac1176d48ecfffc7af5a' +export const WebRPCSchemaHash = '93ac61641d0351211680e2092673726b5c4f1848' type WebrpcGenVersions = { webrpcGenVersion: string @@ -557,6 +557,7 @@ export interface FeeTokensArgs {} export interface FeeTokensReturn { isFeeRequired: boolean tokens: Array + paymentAddress: string } export interface FeeOptionsArgs { wallet: string @@ -950,6 +951,7 @@ export class Relayer implements Relayer { return { isFeeRequired: _data.isFeeRequired, tokens: >_data.tokens, + paymentAddress: _data.paymentAddress, } }) }, diff --git a/packages/wallet/core/src/relayer/standard/sequence.ts b/packages/wallet/core/src/relayer/standard/sequence.ts index d99cd41cef..d95bf19ddb 100644 --- a/packages/wallet/core/src/relayer/standard/sequence.ts +++ b/packages/wallet/core/src/relayer/standard/sequence.ts @@ -2,6 +2,7 @@ import { ETHTxnStatus, IntentPrecondition, Relayer as Service } from '@0xsequenc import { Payload } from '@0xsequence/wallet-primitives' import { AbiFunction, Address, Bytes, Hex } from 'ox' import { FeeOption, FeeQuote, OperationStatus, Relayer } from '../relayer.js' +import { FeeToken } from './rpc/relayer.gen.js' export class SequenceRelayer implements Relayer { public readonly kind: 'relayer' = 'relayer' @@ -18,6 +19,22 @@ export class SequenceRelayer implements Relayer { return true } + async feeTokens(): Promise<{ isFeeRequired: boolean; tokens?: FeeToken[]; paymentAddress?: Address.Address }> { + const { isFeeRequired, tokens, paymentAddress } = await this.service.feeTokens() + if (isFeeRequired) { + Address.assert(paymentAddress) + return { + isFeeRequired, + tokens, + paymentAddress, + } + } + // Not required + return { + isFeeRequired, + } + } + async feeOptions( wallet: Address.Address, _chainId: number, From 9629d7e113c7d29c168e68ad8fd796cb0872d4ca Mon Sep 17 00:00:00 2001 From: Gabi <56271768+VGabriel45@users.noreply.github.com> Date: Wed, 8 Oct 2025 13:27:45 +0300 Subject: [PATCH 35/36] add getFeeTokens to dapp client (#889) * add getFeeTokens to dapp client * fix typo --- .../wallet/dapp-client/src/ChainSessionManager.ts | 14 ++++++++++++++ packages/wallet/dapp-client/src/DappClient.ts | 14 ++++++++++++++ packages/wallet/dapp-client/src/types/index.ts | 8 +++++++- 3 files changed, 35 insertions(+), 1 deletion(-) diff --git a/packages/wallet/dapp-client/src/ChainSessionManager.ts b/packages/wallet/dapp-client/src/ChainSessionManager.ts index 14fbdc329c..8689cddb88 100644 --- a/packages/wallet/dapp-client/src/ChainSessionManager.ts +++ b/packages/wallet/dapp-client/src/ChainSessionManager.ts @@ -41,6 +41,7 @@ import { ModifyExplicitSessionPayload, SessionResponse, AddExplicitSessionPayload, + GetFeeTokensResponse, } from './types/index.js' import { CACHE_DB_NAME, VALUE_FORWARDER_ADDRESS } from './utils/constants.js' import { ExplicitSession, ImplicitSession, ExplicitSessionConfig } from './index.js' @@ -780,6 +781,19 @@ export class ChainSessionManager { } } + /** + * Fetches fee tokens for a chain. + * @returns {GetFeeTokensResponse} + * @throws {FeeOptionError} If fetching fee tokens fails. + */ + async getFeeTokens(): Promise { + try { + return await this.relayer.feeTokens() + } catch (err) { + throw new FeeOptionError(`Failed to get fee tokens: ${err instanceof Error ? err.message : String(err)}`) + } + } + /** * Builds, signs, and sends a batch of transactions. * @param transactions The transactions to be sent. diff --git a/packages/wallet/dapp-client/src/DappClient.ts b/packages/wallet/dapp-client/src/DappClient.ts index 584b146b7d..3f36148880 100644 --- a/packages/wallet/dapp-client/src/DappClient.ts +++ b/packages/wallet/dapp-client/src/DappClient.ts @@ -15,6 +15,7 @@ import { SequenceStorage, WebStorage } from './utils/storage.js' import { DappClientExplicitSessionEventListener, DappClientWalletActionEventListener, + GetFeeTokensResponse, GuardConfig, LoginMethod, RandomPrivateKeyFn, @@ -561,6 +562,19 @@ export class DappClient { return await chainSessionManager.getFeeOptions(transactions) } + /** + * Fetches fee tokens for a chain. + * @returns A promise that resolves with the fee tokens response. {@link GetFeeTokensResponse} + * @throws If the fee tokens cannot be fetched. {@link InitializationError} + */ + async getFeeTokens(chainId: number): Promise { + if (!this.isInitialized) throw new InitializationError('Not initialized') + const chainSessionManager = this.getChainSessionManager(chainId) + if (!chainSessionManager.isInitialized) + throw new InitializationError(`ChainSessionManager for chain ${chainId} is not initialized.`) + return await chainSessionManager.getFeeTokens() + } + /** * Checks if the current session has permission to execute a set of transactions on a specific chain. * @param chainId The chain ID on which to check the permissions. diff --git a/packages/wallet/dapp-client/src/types/index.ts b/packages/wallet/dapp-client/src/types/index.ts index 62ca16df06..88146cd8ac 100644 --- a/packages/wallet/dapp-client/src/types/index.ts +++ b/packages/wallet/dapp-client/src/types/index.ts @@ -1,5 +1,5 @@ /* eslint-disable @typescript-eslint/no-explicit-any */ -import { ExplicitSession } from '@0xsequence/wallet-core' +import { ExplicitSession, Relayer } from '@0xsequence/wallet-core' import { Attestation, Payload } from '@0xsequence/wallet-primitives' import { Address, Hex } from 'ox' import type { TypedData } from 'ox/TypedData' @@ -180,3 +180,9 @@ export interface SendRequestOptions { timeout?: number path?: string } + +export type GetFeeTokensResponse = { + isFeeRequired: boolean + tokens?: Relayer.Standard.Rpc.FeeToken[] + paymentAddress?: Address.Address +} From b574739a38bf7a75d8032a1943db518183514c8e Mon Sep 17 00:00:00 2001 From: Taylan Pince Date: Fri, 8 May 2026 14:51:43 +0200 Subject: [PATCH 36/36] Enforce minimum age limitation for packages --- pnpm-workspace.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pnpm-workspace.yaml b/pnpm-workspace.yaml index 59a78ba9a9..8b50aefa01 100644 --- a/pnpm-workspace.yaml +++ b/pnpm-workspace.yaml @@ -1,3 +1,7 @@ +minimumReleaseAge: 20160 # 60 * 24 * 7 * 2 = do not install package releases that are not at least 2 weeks old +# DO NOT REMOVE OR MODIFY minimumReleaseAge without approval +# list packages to be excluded from minimum release limitation + packages: - extras/* - packages/*