diff --git a/sui-agent/package-lock.json b/sui-agent/package-lock.json index 1b8dbe2..adbb6ef 100644 --- a/sui-agent/package-lock.json +++ b/sui-agent/package-lock.json @@ -9,6 +9,8 @@ "version": "1.0.0", "license": "ISC", "dependencies": { + "@mysten/sui": "^1.21.0", + "@suilend/sdk": "^1.1.36", "aftermath-ts-sdk": "^1.2.49", "atoma-sdk": "github:atoma-network/atoma-sdk-typescript", "axios": "^1.7.9", @@ -34,7 +36,6 @@ "resolved": "https://registry.npmjs.org/@0no-co/graphql.web/-/graphql.web-1.0.13.tgz", "integrity": "sha512-jqYxOevheVTU1S36ZdzAkJIdvRp2m3OYIG5SEoKDw5NI8eVwkoI0D/Q3DYNGmXCxkA6CQuoa7zvMiDPTLqUNuw==", "license": "MIT", - "peer": true, "peerDependencies": { "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0" }, @@ -49,7 +50,6 @@ "resolved": "https://registry.npmjs.org/@0no-co/graphqlsp/-/graphqlsp-1.12.16.tgz", "integrity": "sha512-B5pyYVH93Etv7xjT6IfB7QtMBdaaC07yjbhN6v8H7KgFStMkPvi+oWYBTibMFRMY89qwc9H8YixXg8SXDVgYWw==", "license": "MIT", - "peer": true, "dependencies": { "@gql.tada/internal": "^1.0.0", "graphql": "^15.5.0 || ^16.0.0 || ^17.0.0" @@ -83,6 +83,23 @@ "node": ">=12" } }, + "node_modules/@emnapi/runtime": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/@emnapi/runtime/-/runtime-1.3.1.tgz", + "integrity": "sha512-kEBmG8KyqtxJZv+ygbEim+KCGtIq1fC22Ms3S4ziXmYKm8uyoLX0MHONVKwp+9opg390VaKRNt4a7A9NwmpNhw==", + "license": "MIT", + "optional": true, + "dependencies": { + "tslib": "^2.4.0" + } + }, + "node_modules/@emnapi/runtime/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD", + "optional": true + }, "node_modules/@eslint-community/eslint-utils": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.1.tgz", @@ -151,7 +168,6 @@ "resolved": "https://registry.npmjs.org/@gql.tada/cli-utils/-/cli-utils-1.6.3.tgz", "integrity": "sha512-jFFSY8OxYeBxdKi58UzeMXG1tdm4FVjXa8WHIi66Gzu9JWtCE6mqom3a8xkmSw+mVaybFW5EN2WXf1WztJVNyQ==", "license": "MIT", - "peer": true, "dependencies": { "@0no-co/graphqlsp": "^1.12.13", "@gql.tada/internal": "1.0.8", @@ -178,7 +194,6 @@ "resolved": "https://registry.npmjs.org/@gql.tada/internal/-/internal-1.0.8.tgz", "integrity": "sha512-XYdxJhtHC5WtZfdDqtKjcQ4d7R1s0d1rnlSs3OcBEUbYiPoJJfZU7tWsVXuv047Z6msvmr4ompJ7eLSK5Km57g==", "license": "MIT", - "peer": true, "dependencies": { "@0no-co/graphql.web": "^1.0.5" }, @@ -192,7 +207,6 @@ "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", "license": "MIT", - "peer": true, "peerDependencies": { "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } @@ -235,6 +249,367 @@ "dev": true, "license": "BSD-3-Clause" }, + "node_modules/@img/sharp-darwin-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-arm64/-/sharp-darwin-arm64-0.33.5.tgz", + "integrity": "sha512-UT4p+iz/2H4twwAoLCqfA9UH5pI6DggwKEGuaPy7nCVQ8ZsiY5PIcrRvD1DzuY3qYL07NtIQcWnBSY/heikIFQ==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-darwin-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-darwin-x64/-/sharp-darwin-x64-0.33.5.tgz", + "integrity": "sha512-fyHac4jIc1ANYGRDxtiqelIbdWkIuQaI84Mv45KvGRRxSAa7o7d1ZKAOBaYbnepLC1WqxfpimdeWfvqqSGwR2Q==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-darwin-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-libvips-darwin-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-arm64/-/sharp-libvips-darwin-arm64-1.0.4.tgz", + "integrity": "sha512-XblONe153h0O2zuFfTAbQYAX2JhYmDHeWikp1LM9Hul9gVPjFY427k6dFEcOL72O01QxQsWi761svJ/ev9xEDg==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-darwin-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-darwin-x64/-/sharp-libvips-darwin-x64-1.0.4.tgz", + "integrity": "sha512-xnGR8YuZYfJGmWPvmlunFaWJsb9T/AO2ykoP3Fz/0X5XV2aoYBPkX6xqCQvUTKKiLddarLaxpzNe+b1hjeWHAQ==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "darwin" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm/-/sharp-libvips-linux-arm-1.0.5.tgz", + "integrity": "sha512-gvcC4ACAOPRNATg/ov8/MnbxFDJqf/pDePbBnuBDcjsI8PssmjoKMAz4LtLaVi+OnSb5FK/yIOamqDwGmXW32g==", + "cpu": [ + "arm" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-arm64/-/sharp-libvips-linux-arm64-1.0.4.tgz", + "integrity": "sha512-9B+taZ8DlyyqzZQnoeIvDVR/2F4EbMepXMc/NdVbkzsJbzkUjhXv/70GQJ7tdLA4YJgNP25zukcxpX2/SueNrA==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-s390x": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-s390x/-/sharp-libvips-linux-s390x-1.0.4.tgz", + "integrity": "sha512-u7Wz6ntiSSgGSGcjZ55im6uvTrOxSIS8/dgoVMoiGE9I6JAfU50yH5BoDlYA1tcuGS7g/QNtetJnxA6QEsCVTA==", + "cpu": [ + "s390x" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linux-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linux-x64/-/sharp-libvips-linux-x64-1.0.4.tgz", + "integrity": "sha512-MmWmQ3iPFZr0Iev+BAgVMb3ZyC4KeFc3jFxnNbEPas60e1cIfevbtuyf9nDGIzOaW9PdnDciJm+wFFaTlj5xYw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-arm64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-arm64/-/sharp-libvips-linuxmusl-arm64-1.0.4.tgz", + "integrity": "sha512-9Ti+BbTYDcsbp4wfYib8Ctm1ilkugkA/uscUn6UXK1ldpC1JjiXbLfFZtRlBhjPZ5o1NCLiDbg8fhUPKStHoTA==", + "cpu": [ + "arm64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-libvips-linuxmusl-x64": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/@img/sharp-libvips-linuxmusl-x64/-/sharp-libvips-linuxmusl-x64-1.0.4.tgz", + "integrity": "sha512-viYN1KX9m+/hGkJtvYYp+CCLgnJXwiQB39damAO7WMdKWlIhmYTfHjwSbQeUK/20vY154mwezd9HflVFM1wVSw==", + "cpu": [ + "x64" + ], + "license": "LGPL-3.0-or-later", + "optional": true, + "os": [ + "linux" + ], + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-linux-arm": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm/-/sharp-linux-arm-0.33.5.tgz", + "integrity": "sha512-JTS1eldqZbJxjvKaAkxhZmBqPRGmxgu+qFKSInv8moZ2AmT5Yib3EQ1c6gp493HvrvV8QgdOXdyaIBrhvFhBMQ==", + "cpu": [ + "arm" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm": "1.0.5" + } + }, + "node_modules/@img/sharp-linux-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-arm64/-/sharp-linux-arm64-0.33.5.tgz", + "integrity": "sha512-JMVv+AMRyGOHtO1RFBiJy/MBsgz0x4AWrT6QoEVVTyh1E39TrCUpTRI7mx9VksGX4awWASxqCYLCV4wBZHAYxA==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-s390x": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-s390x/-/sharp-linux-s390x-0.33.5.tgz", + "integrity": "sha512-y/5PCd+mP4CA/sPDKl2961b+C9d+vPAveS33s6Z3zfASk2j5upL6fXVPZi7ztePZ5CuH+1kW8JtvxgbuXHRa4Q==", + "cpu": [ + "s390x" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-s390x": "1.0.4" + } + }, + "node_modules/@img/sharp-linux-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linux-x64/-/sharp-linux-x64-0.33.5.tgz", + "integrity": "sha512-opC+Ok5pRNAzuvq1AG0ar+1owsu842/Ab+4qvU879ippJBHvyY5n2mxF1izXqkPYlGuP/M556uh53jRLJmzTWA==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linux-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-arm64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-arm64/-/sharp-linuxmusl-arm64-0.33.5.tgz", + "integrity": "sha512-XrHMZwGQGvJg2V/oRSUfSAfjfPxO+4DkiRh6p2AFjLQztWUuY/o8Mq0eMQVIY7HJ1CDQUJlxGGZRw1a5bqmd1g==", + "cpu": [ + "arm64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4" + } + }, + "node_modules/@img/sharp-linuxmusl-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-linuxmusl-x64/-/sharp-linuxmusl-x64-0.33.5.tgz", + "integrity": "sha512-WT+d/cgqKkkKySYmqoZ8y3pxx7lx9vVejxW/W4DOFMYVSkErR+w7mf2u8m/y4+xHe7yY9DAXQMWQhpnMuFfScw==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-libvips-linuxmusl-x64": "1.0.4" + } + }, + "node_modules/@img/sharp-wasm32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-wasm32/-/sharp-wasm32-0.33.5.tgz", + "integrity": "sha512-ykUW4LVGaMcU9lu9thv85CbRMAwfeadCJHRsg2GmeRa/cJxsVY9Rbd57JcMxBkKHag5U/x7TSBpScF4U8ElVzg==", + "cpu": [ + "wasm32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later AND MIT", + "optional": true, + "dependencies": { + "@emnapi/runtime": "^1.2.0" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-ia32": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-ia32/-/sharp-win32-ia32-0.33.5.tgz", + "integrity": "sha512-T36PblLaTwuVJ/zw/LaH0PdZkRz5rd3SmMHX8GSmR7vtNSP5Z6bQkExdSK7xGWyxLw4sUknBuugTelgw2faBbQ==", + "cpu": [ + "ia32" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, + "node_modules/@img/sharp-win32-x64": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/@img/sharp-win32-x64/-/sharp-win32-x64-0.33.5.tgz", + "integrity": "sha512-MpY/o8/8kj+EcnxwvrP4aTJSWw/aZ7JIGR4aBeZkZw5B7/Jn+tY9/VNwtcoGmdT7GfggGIU4kygOMSbYnOrAbg==", + "cpu": [ + "x64" + ], + "license": "Apache-2.0 AND LGPL-3.0-or-later", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + } + }, "node_modules/@jridgewell/resolve-uri": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.1.2.tgz", @@ -265,17 +640,15 @@ "resolved": "https://registry.npmjs.org/@mysten/bcs/-/bcs-1.2.1.tgz", "integrity": "sha512-RMSaUsNb8oR0rTRVIOOcyoEVJqQi6DLvMXN+7mvDcki12FJFQ0lF89zQa7AV7cIurWlDQfJ8VIbCuRDyK+955A==", "license": "Apache-2.0", - "peer": true, "dependencies": { "bs58": "^6.0.0" } }, "node_modules/@mysten/sui": { - "version": "1.20.0", - "resolved": "https://registry.npmjs.org/@mysten/sui/-/sui-1.20.0.tgz", - "integrity": "sha512-/XLogwOYaSP31lPt377fj5b+8sRIyt2Opi/Ssos5dssPqol9vgvN/ZzV5Y5qVl4VquhATJHRpwV33B5rIVi7Ow==", + "version": "1.21.0", + "resolved": "https://registry.npmjs.org/@mysten/sui/-/sui-1.21.0.tgz", + "integrity": "sha512-A+UXOo2ODhmktV6J6lOIqelRtVvQ0V252T2qaoJ0E92HYjIi3xMNEQrqu4K8TcN3gZCjqK8jQZwmbYZku8rIpw==", "license": "Apache-2.0", - "peer": true, "dependencies": { "@graphql-typed-document-node/core": "^3.2.0", "@mysten/bcs": "1.2.1", @@ -283,7 +656,6 @@ "@noble/hashes": "^1.4.0", "@scure/bip32": "^1.4.0", "@scure/bip39": "^1.3.0", - "@simplewebauthn/typescript-types": "^7.4.0", "@suchipi/femver": "^1.0.0", "bech32": "^2.0.0", "gql.tada": "^1.8.2", @@ -348,6 +720,140 @@ "base-x": "^4.0.0" } }, + "node_modules/@next/env": { + "version": "15.1.6", + "resolved": "https://registry.npmjs.org/@next/env/-/env-15.1.6.tgz", + "integrity": "sha512-d9AFQVPEYNr+aqokIiPLNK/MTyt3DWa/dpKveiAaVccUadFbhFEvY6FXYX2LJO2Hv7PHnLBu2oWwB4uBuHjr/w==", + "license": "MIT" + }, + "node_modules/@next/swc-darwin-arm64": { + "version": "15.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-arm64/-/swc-darwin-arm64-15.1.6.tgz", + "integrity": "sha512-u7lg4Mpl9qWpKgy6NzEkz/w0/keEHtOybmIl0ykgItBxEM5mYotS5PmqTpo+Rhg8FiOiWgwr8USxmKQkqLBCrw==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-darwin-x64": { + "version": "15.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-darwin-x64/-/swc-darwin-x64-15.1.6.tgz", + "integrity": "sha512-x1jGpbHbZoZ69nRuogGL2MYPLqohlhnT9OCU6E6QFewwup+z+M6r8oU47BTeJcWsF2sdBahp5cKiAcDbwwK/lg==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-gnu": { + "version": "15.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-gnu/-/swc-linux-arm64-gnu-15.1.6.tgz", + "integrity": "sha512-jar9sFw0XewXsBzPf9runGzoivajeWJUc/JkfbLTC4it9EhU8v7tCRLH7l5Y1ReTMN6zKJO0kKAGqDk8YSO2bg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-arm64-musl": { + "version": "15.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-arm64-musl/-/swc-linux-arm64-musl-15.1.6.tgz", + "integrity": "sha512-+n3u//bfsrIaZch4cgOJ3tXCTbSxz0s6brJtU3SzLOvkJlPQMJ+eHVRi6qM2kKKKLuMY+tcau8XD9CJ1OjeSQQ==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-gnu": { + "version": "15.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-gnu/-/swc-linux-x64-gnu-15.1.6.tgz", + "integrity": "sha512-SpuDEXixM3PycniL4iVCLyUyvcl6Lt0mtv3am08sucskpG0tYkW1KlRhTgj4LI5ehyxriVVcfdoxuuP8csi3kQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-linux-x64-musl": { + "version": "15.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-linux-x64-musl/-/swc-linux-x64-musl-15.1.6.tgz", + "integrity": "sha512-L4druWmdFSZIIRhF+G60API5sFB7suTbDRhYWSjiw0RbE+15igQvE2g2+S973pMGvwN3guw7cJUjA/TmbPWTHQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-arm64-msvc": { + "version": "15.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-win32-arm64-msvc/-/swc-win32-arm64-msvc-15.1.6.tgz", + "integrity": "sha512-s8w6EeqNmi6gdvM19tqKKWbCyOBvXFbndkGHl+c9YrzsLARRdCHsD9S1fMj8gsXm9v8vhC8s3N8rjuC/XrtkEg==", + "cpu": [ + "arm64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, + "node_modules/@next/swc-win32-x64-msvc": { + "version": "15.1.6", + "resolved": "https://registry.npmjs.org/@next/swc-win32-x64-msvc/-/swc-win32-x64-msvc-15.1.6.tgz", + "integrity": "sha512-6xomMuu54FAFxttYr5PJbEfu96godcxBTRk1OhAvJq0/EnmFU/Ybiax30Snis4vdWZ9LGpf7Roy5fSs7v/5ROQ==", + "cpu": [ + "x64" + ], + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">= 10" + } + }, "node_modules/@noble/curves": { "version": "1.8.1", "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.8.1.tgz", @@ -537,6 +1043,12 @@ "base-x": "^4.0.0" } }, + "node_modules/@rrweb/types": { + "version": "2.0.0-alpha.18", + "resolved": "https://registry.npmjs.org/@rrweb/types/-/types-2.0.0-alpha.18.tgz", + "integrity": "sha512-iMH3amHthJZ9x3gGmBPmdfim7wLGygC2GciIkw2A6SO8giSn8PHYtRT8OKNH4V+k3SZ6RSnYHcTQxBA7pSWZ3Q==", + "license": "MIT" + }, "node_modules/@scure/base": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.2.4.tgz", @@ -578,14 +1090,138 @@ "resolved": "https://registry.npmjs.org/@simplewebauthn/typescript-types/-/typescript-types-7.4.0.tgz", "integrity": "sha512-8/ZjHeUPe210Bt5oyaOIGx4h8lHdsQs19BiOT44gi/jBEgK7uBGA0Fy7NRsyh777al3m6WM0mBf0UR7xd4R7WQ==", "deprecated": "This package has been renamed to @simplewebauthn/types. Please install @simplewebauthn/types instead to ensure you receive future updates.", + "license": "MIT" + }, + "node_modules/@suchipi/femver": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@suchipi/femver/-/femver-1.0.0.tgz", + "integrity": "sha512-bprE8+K5V+DPX7q2e2K57ImqNBdfGHDIWaGI5xHxZoxbKOuQZn4wzPiUxOAHnsUr3w3xHrWXwN7gnG/iIuEMIg==", + "license": "MIT" + }, + "node_modules/@suilend/frontend-sui": { + "version": "0.2.33", + "resolved": "https://registry.npmjs.org/@suilend/frontend-sui/-/frontend-sui-0.2.33.tgz", + "integrity": "sha512-GjAHWdnKiAW/wc1Oo0WGoa401+rs7rg044SUpjIfBm4QEXfYmHUJTyT9Yn9LODYQgyN4tZ1fP4wGhMTmUZa0aA==", "license": "MIT", - "peer": true + "dependencies": { + "@mysten/sui": "1.20.0", + "@pythnetwork/pyth-sui-js": "^2.1.0", + "bignumber.js": "^9.1.2", + "lodash": "^4.17.21", + "mixpanel-browser": "^2.56.0", + "next": "^15.0.3" + }, + "peerDependencies": { + "date-fns": "^4.1.0" + } + }, + "node_modules/@suilend/frontend-sui/node_modules/@mysten/sui": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/@mysten/sui/-/sui-1.20.0.tgz", + "integrity": "sha512-/XLogwOYaSP31lPt377fj5b+8sRIyt2Opi/Ssos5dssPqol9vgvN/ZzV5Y5qVl4VquhATJHRpwV33B5rIVi7Ow==", + "license": "Apache-2.0", + "dependencies": { + "@graphql-typed-document-node/core": "^3.2.0", + "@mysten/bcs": "1.2.1", + "@noble/curves": "^1.4.2", + "@noble/hashes": "^1.4.0", + "@scure/bip32": "^1.4.0", + "@scure/bip39": "^1.3.0", + "@simplewebauthn/typescript-types": "^7.4.0", + "@suchipi/femver": "^1.0.0", + "bech32": "^2.0.0", + "gql.tada": "^1.8.2", + "graphql": "^16.9.0", + "jose": "^5.6.3", + "poseidon-lite": "^0.2.0", + "valibot": "^0.36.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@suilend/frontend-sui/node_modules/@pythnetwork/pyth-sui-js": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@pythnetwork/pyth-sui-js/-/pyth-sui-js-2.1.0.tgz", + "integrity": "sha512-oSfpqtLATTEVaac/YbaRQBvOI7DM+Qds5O0GJjEcky7UQRtz/tlU9tjQ6VRn3vm8IXw8P1mKzJcaTIO134X9Sw==", + "license": "Apache-2.0", + "dependencies": { + "@mysten/sui": "^1.3.0", + "@pythnetwork/price-service-client": "1.9.0", + "buffer": "^6.0.3" + } + }, + "node_modules/@suilend/sdk": { + "version": "1.1.36", + "resolved": "https://registry.npmjs.org/@suilend/sdk/-/sdk-1.1.36.tgz", + "integrity": "sha512-mhofvhfiq+3ImIxQ9cGEIytiTjtp0SrswIHtimBkXGfMU/ZMBSd65dtdDlh4A8+AMayQI4S8SkLniyztHod6uA==", + "license": "MIT", + "dependencies": { + "@mysten/bcs": "1.2.1", + "@mysten/sui": "1.20.0", + "@pythnetwork/pyth-sui-js": "^2.1.0", + "@suilend/frontend-sui": "^0.2.33", + "bignumber.js": "^9.1.2", + "p-limit": "3.1.0", + "uuid": "^11.0.3" + } + }, + "node_modules/@suilend/sdk/node_modules/@mysten/sui": { + "version": "1.20.0", + "resolved": "https://registry.npmjs.org/@mysten/sui/-/sui-1.20.0.tgz", + "integrity": "sha512-/XLogwOYaSP31lPt377fj5b+8sRIyt2Opi/Ssos5dssPqol9vgvN/ZzV5Y5qVl4VquhATJHRpwV33B5rIVi7Ow==", + "license": "Apache-2.0", + "dependencies": { + "@graphql-typed-document-node/core": "^3.2.0", + "@mysten/bcs": "1.2.1", + "@noble/curves": "^1.4.2", + "@noble/hashes": "^1.4.0", + "@scure/bip32": "^1.4.0", + "@scure/bip39": "^1.3.0", + "@simplewebauthn/typescript-types": "^7.4.0", + "@suchipi/femver": "^1.0.0", + "bech32": "^2.0.0", + "gql.tada": "^1.8.2", + "graphql": "^16.9.0", + "jose": "^5.6.3", + "poseidon-lite": "^0.2.0", + "valibot": "^0.36.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@suilend/sdk/node_modules/@pythnetwork/pyth-sui-js": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@pythnetwork/pyth-sui-js/-/pyth-sui-js-2.1.0.tgz", + "integrity": "sha512-oSfpqtLATTEVaac/YbaRQBvOI7DM+Qds5O0GJjEcky7UQRtz/tlU9tjQ6VRn3vm8IXw8P1mKzJcaTIO134X9Sw==", + "license": "Apache-2.0", + "dependencies": { + "@mysten/sui": "^1.3.0", + "@pythnetwork/price-service-client": "1.9.0", + "buffer": "^6.0.3" + } + }, + "node_modules/@swc/counter": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@swc/counter/-/counter-0.1.3.tgz", + "integrity": "sha512-e2BR4lsJkkRlKZ/qCHPw9ZaSxc0MVUd7gtbtaB7aMvHeJVYe8sOB8DBZkP2DtISHGSku9sCK6T6cnY0CtXrOCQ==", + "license": "Apache-2.0" }, - "node_modules/@suchipi/femver": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@suchipi/femver/-/femver-1.0.0.tgz", - "integrity": "sha512-bprE8+K5V+DPX7q2e2K57ImqNBdfGHDIWaGI5xHxZoxbKOuQZn4wzPiUxOAHnsUr3w3xHrWXwN7gnG/iIuEMIg==", - "license": "MIT" + "node_modules/@swc/helpers": { + "version": "0.5.15", + "resolved": "https://registry.npmjs.org/@swc/helpers/-/helpers-0.5.15.tgz", + "integrity": "sha512-JQ5TuMi45Owi4/BIMAJBoSQoOJu12oOk/gADqlcUL9JEdHB8vyjUSsxqeNXnmXHjYKMi2WcYtezGEEhqUI/E2g==", + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.8.0" + } + }, + "node_modules/@swc/helpers/node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "license": "0BSD" }, "node_modules/@tsconfig/node10": { "version": "1.0.11", @@ -649,6 +1285,12 @@ "@types/node": "*" } }, + "node_modules/@types/css-font-loading-module": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/@types/css-font-loading-module/-/css-font-loading-module-0.0.7.tgz", + "integrity": "sha512-nl09VhutdjINdWyXxHWN/w9zlNCfr60JUqJbd24YXUuCwgeL0TpFSdElCwb6cxfB6ybE19Gjj4g0jsgkXxKv1Q==", + "license": "MIT" + }, "node_modules/@types/express": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/@types/express/-/express-5.0.0.tgz", @@ -961,6 +1603,12 @@ "dev": true, "license": "ISC" }, + "node_modules/@xstate/fsm": { + "version": "1.6.5", + "resolved": "https://registry.npmjs.org/@xstate/fsm/-/fsm-1.6.5.tgz", + "integrity": "sha512-b5o1I6aLNeYlU/3CPlj/Z91ybk1gUsKT+5NAJI+2W4UjvS5KLG28K9v5UvNoFVjHV8PajVZ00RH3vnjyQO7ZAw==", + "license": "MIT" + }, "node_modules/accepts": { "version": "1.3.8", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", @@ -1058,6 +1706,7 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, "license": "MIT", "dependencies": { "color-convert": "^2.0.1" @@ -1160,8 +1809,16 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/base-x/-/base-x-5.0.0.tgz", "integrity": "sha512-sMW3VGSX1QWVFA6l8U62MLKz29rRfpTlYdCqLdpLo1/Yd4zZwSbnUaDfciIAowAqvq7YFnWq9hrhdg1KYgc1lQ==", + "license": "MIT" + }, + "node_modules/base64-arraybuffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", + "integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==", "license": "MIT", - "peer": true + "engines": { + "node": ">= 0.6.0" + } }, "node_modules/base64-js": { "version": "1.5.1", @@ -1187,8 +1844,16 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/bech32/-/bech32-2.0.0.tgz", "integrity": "sha512-LcknSilhIGatDAsY1ak2I8VtGaHNhgMSYVxFrGLXv+xLHytaKZKcaUJJUE7qmBr7h33o5YQwP55pMI0xmkpJwg==", + "license": "MIT" + }, + "node_modules/bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", "license": "MIT", - "peer": true + "engines": { + "node": "*" + } }, "node_modules/binary-extensions": { "version": "2.3.0", @@ -1287,7 +1952,6 @@ "resolved": "https://registry.npmjs.org/bs58/-/bs58-6.0.0.tgz", "integrity": "sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==", "license": "MIT", - "peer": true, "dependencies": { "base-x": "^5.0.0" } @@ -1316,6 +1980,17 @@ "ieee754": "^1.2.1" } }, + "node_modules/busboy": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", + "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "dependencies": { + "streamsearch": "^1.1.0" + }, + "engines": { + "node": ">=10.16.0" + } + }, "node_modules/bytes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", @@ -1364,10 +2039,31 @@ "node": ">=6" } }, + "node_modules/caniuse-lite": { + "version": "1.0.30001695", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001695.tgz", + "integrity": "sha512-vHyLade6wTgI2u1ec3WQBxv+2BrTERV28UXQu9LO6lZ9pYeMk34vjXFLOxo1A4UBA8XTL4njRQZdno/yYaSmWw==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/browserslist" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/caniuse-lite" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "CC-BY-4.0" + }, "node_modules/chalk": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, "license": "MIT", "dependencies": { "ansi-styles": "^4.1.0", @@ -1416,10 +2112,31 @@ "node": ">= 6" } }, + "node_modules/client-only": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/client-only/-/client-only-0.0.1.tgz", + "integrity": "sha512-IV3Ou0jSMzZrd3pZ48nLkT9DA7Ag1pnPzaiQhpW7c3RbcqqzvzzVu+L8gfqMp/8IM2MQtSiqaCxrrcfu8I8rMA==", + "license": "MIT" + }, + "node_modules/color": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/color/-/color-4.2.3.tgz", + "integrity": "sha512-1rXeuUUiGGrykh+CeBdu5Ie7OJwinCgQY0bc7GCRxy5xVHy+moaqkpL/jqQq0MtQOeYcrqEz4abc5f0KtU7W4A==", + "license": "MIT", + "optional": true, + "dependencies": { + "color-convert": "^2.0.1", + "color-string": "^1.9.0" + }, + "engines": { + "node": ">=12.5.0" + } + }, "node_modules/color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "devOptional": true, "license": "MIT", "dependencies": { "color-name": "~1.1.4" @@ -1432,8 +2149,20 @@ "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "devOptional": true, "license": "MIT" }, + "node_modules/color-string": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/color-string/-/color-string-1.9.1.tgz", + "integrity": "sha512-shrVawQFojnZv6xM40anx4CkoDP+fZsw/ZerEMsW/pyzsRbElpsL/DBVW7q3ExxwusdNXI3lXpuhEZkzs8p5Eg==", + "license": "MIT", + "optional": true, + "dependencies": { + "color-name": "^1.0.0", + "simple-swizzle": "^0.2.2" + } + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -1531,6 +2260,17 @@ "node": ">= 12" } }, + "node_modules/date-fns": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-4.1.0.tgz", + "integrity": "sha512-Ukq0owbQXxa/U3EGtsdVBkR1w7KOQ5gIBqdH2hkvknzZPYvBxb/aa6E8L7tmjFtkwZBu3UXBbjIgPo/Ez4xaNg==", + "license": "MIT", + "peer": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/kossnocorp" + } + }, "node_modules/dayjs": { "version": "1.11.13", "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", @@ -1589,6 +2329,16 @@ "npm": "1.2.8000 || >= 1.4.16" } }, + "node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "license": "Apache-2.0", + "optional": true, + "engines": { + "node": ">=8" + } + }, "node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -2072,6 +2822,12 @@ "node": "^12.20 || >= 14.13" } }, + "node_modules/fflate": { + "version": "0.4.8", + "resolved": "https://registry.npmjs.org/fflate/-/fflate-0.4.8.tgz", + "integrity": "sha512-FJqqoDBR00Mdj9ppamLa/Y7vxm+PRmNWA67N846RvsoYVMKB4q3y/de5PA7gUmRMYK/8CMz2GDZQmCRN1wBcWA==", + "license": "MIT" + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -2237,6 +2993,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "dev": true, "license": "ISC" }, "node_modules/fsevents": { @@ -2304,6 +3061,7 @@ "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", "deprecated": "Glob versions prior to v9 are no longer supported", + "dev": true, "license": "ISC", "dependencies": { "fs.realpath": "^1.0.0", @@ -2387,7 +3145,6 @@ "resolved": "https://registry.npmjs.org/gql.tada/-/gql.tada-1.8.10.tgz", "integrity": "sha512-FrvSxgz838FYVPgZHGOSgbpOjhR+yq44rCzww3oOPJYi0OvBJjAgCiP6LEokZIYND2fUTXzQAyLgcvgw1yNP5A==", "license": "MIT", - "peer": true, "dependencies": { "@0no-co/graphql.web": "^1.0.5", "@0no-co/graphqlsp": "^1.12.13", @@ -2414,7 +3171,6 @@ "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.10.0.tgz", "integrity": "sha512-AjqGKbDGUFRKIRCP9tCKiIGHyriz2oHEbPIbEtcSLSs4YjReZOIPQQWek4+6hjw62H9QShXHyaGivGiYVLeYFQ==", "license": "MIT", - "peer": true, "engines": { "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" } @@ -2423,6 +3179,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, "license": "MIT", "engines": { "node": ">=8" @@ -2556,6 +3313,7 @@ "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "dev": true, "license": "ISC", "dependencies": { "once": "^1.3.0", @@ -2577,6 +3335,13 @@ "node": ">= 0.10" } }, + "node_modules/is-arrayish": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.3.2.tgz", + "integrity": "sha512-eVRqCvVlZbuw3GrM63ovNSNAeA1K16kaR/LRY/92w0zxQ5/1YzwblUX652i4Xs9RwAGjW9d9y6X88t8OaAJfWQ==", + "license": "MIT", + "optional": true + }, "node_modules/is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", @@ -2645,6 +3410,7 @@ "version": "2.0.0", "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, "license": "ISC" }, "node_modules/isomorphic-fetch": { @@ -2691,7 +3457,6 @@ "resolved": "https://registry.npmjs.org/jose/-/jose-5.9.6.tgz", "integrity": "sha512-AMlnetc9+CV9asI19zHmrgS/WYsWUwCn2R7RzlbJWD7F9eWYUTGyBmU9o6PxngtLGOiDGPRu+Uc4fhKzbpteZQ==", "license": "MIT", - "peer": true, "funding": { "url": "https://github.com/sponsors/panva" } @@ -2770,6 +3535,12 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -2888,6 +3659,21 @@ "node": "*" } }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", + "license": "MIT" + }, + "node_modules/mixpanel-browser": { + "version": "2.59.0", + "resolved": "https://registry.npmjs.org/mixpanel-browser/-/mixpanel-browser-2.59.0.tgz", + "integrity": "sha512-YYCVLBII2eqC71QoZAZxLMVC0kVJpvOnZ9PBU8X4Ts0MDEZfjE/jzArfg2BTizuJAc+3G5ZzOX3U2Cwbr4jchw==", + "license": "Apache-2.0", + "dependencies": { + "rrweb": "2.0.0-alpha.13" + } + }, "node_modules/ms": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", @@ -2900,6 +3686,24 @@ "integrity": "sha512-nbajikzWTMwsW+eSsNm3QwlOs7het9gGJU5dDZzRTQGk03vyBOauxgI4VakDzE0PtsGTmXPsXTbbjVhRwR5mpw==", "license": "MIT" }, + "node_modules/nanoid": { + "version": "3.3.8", + "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.8.tgz", + "integrity": "sha512-WNLf5Sd8oZxOm+TzppcYk8gVOgP+l58xNy58D0nbUnOxOWRWvlcCV4kUF7ltmI6PsrLl/BgKEyS4mqsGChFN0w==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + } + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -2923,6 +3727,60 @@ "node": ">= 0.6" } }, + "node_modules/next": { + "version": "15.1.6", + "resolved": "https://registry.npmjs.org/next/-/next-15.1.6.tgz", + "integrity": "sha512-Hch4wzbaX0vKQtalpXvUiw5sYivBy4cm5rzUKrBnUB/y436LGrvOUqYvlSeNVCWFO/770gDlltR9gqZH62ct4Q==", + "license": "MIT", + "dependencies": { + "@next/env": "15.1.6", + "@swc/counter": "0.1.3", + "@swc/helpers": "0.5.15", + "busboy": "1.6.0", + "caniuse-lite": "^1.0.30001579", + "postcss": "8.4.31", + "styled-jsx": "5.1.6" + }, + "bin": { + "next": "dist/bin/next" + }, + "engines": { + "node": "^18.18.0 || ^19.8.0 || >= 20.0.0" + }, + "optionalDependencies": { + "@next/swc-darwin-arm64": "15.1.6", + "@next/swc-darwin-x64": "15.1.6", + "@next/swc-linux-arm64-gnu": "15.1.6", + "@next/swc-linux-arm64-musl": "15.1.6", + "@next/swc-linux-x64-gnu": "15.1.6", + "@next/swc-linux-x64-musl": "15.1.6", + "@next/swc-win32-arm64-msvc": "15.1.6", + "@next/swc-win32-x64-msvc": "15.1.6", + "sharp": "^0.33.5" + }, + "peerDependencies": { + "@opentelemetry/api": "^1.1.0", + "@playwright/test": "^1.41.2", + "babel-plugin-react-compiler": "*", + "react": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "react-dom": "^18.2.0 || 19.0.0-rc-de68d2f4-20241204 || ^19.0.0", + "sass": "^1.3.0" + }, + "peerDependenciesMeta": { + "@opentelemetry/api": { + "optional": true + }, + "@playwright/test": { + "optional": true + }, + "babel-plugin-react-compiler": { + "optional": true + }, + "sass": { + "optional": true + } + } + }, "node_modules/node-domexception": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/node-domexception/-/node-domexception-1.0.0.tgz", @@ -6079,6 +6937,7 @@ "version": "1.4.0", "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, "license": "ISC", "dependencies": { "wrappy": "1" @@ -6106,7 +6965,6 @@ "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dev": true, "license": "MIT", "dependencies": { "yocto-queue": "^0.1.0" @@ -6170,6 +7028,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "dev": true, "license": "MIT", "engines": { "node": ">=0.10.0" @@ -6201,6 +7060,12 @@ "node": ">=8" } }, + "node_modules/picocolors": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.1.1.tgz", + "integrity": "sha512-xceH2snhtb5M9liqDsmEw56le376mTZkEX/jEb/RxNFyegNul7eNslCXP9FDj/Lcu0X8KEyMceP2ntpaHrDEVA==", + "license": "ISC" + }, "node_modules/picomatch": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", @@ -6217,8 +7082,35 @@ "version": "0.2.1", "resolved": "https://registry.npmjs.org/poseidon-lite/-/poseidon-lite-0.2.1.tgz", "integrity": "sha512-xIr+G6HeYfOhCuswdqcFpSX47SPhm0EpisWJ6h7fHlWwaVIvH3dLnejpatrtw6Xc6HaLrpq05y7VRfvDmDGIog==", + "license": "MIT" + }, + "node_modules/postcss": { + "version": "8.4.31", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.4.31.tgz", + "integrity": "sha512-PS08Iboia9mts/2ygV3eLpY5ghnUcfLV/EXTOW1E2qYxJKGGBUtNjN76FYHnMs36RmARn41bC0AZmn+rR0OVpQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], "license": "MIT", - "peer": true + "dependencies": { + "nanoid": "^3.3.6", + "picocolors": "^1.0.0", + "source-map-js": "^1.0.2" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } }, "node_modules/prelude-ls": { "version": "1.2.1", @@ -6347,6 +7239,29 @@ "node": ">= 0.8" } }, + "node_modules/react": { + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/react/-/react-19.0.0.tgz", + "integrity": "sha512-V8AVnmPIICiWpGfm6GLzCR/W5FXLchHop40W4nXBmdlEceh16rCN8O8LNWm5bh5XUX91fh7KpA+W0TgMKmgTpQ==", + "license": "MIT", + "peer": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/react-dom": { + "version": "19.0.0", + "resolved": "https://registry.npmjs.org/react-dom/-/react-dom-19.0.0.tgz", + "integrity": "sha512-4GV5sHFG0e/0AD4X+ySy6UJd3jVl1iNsNHdpad0qhABJ11twS3TTBnseqsKurKcsNqCEFeGL3uLpVChpIO3QfQ==", + "license": "MIT", + "peer": true, + "dependencies": { + "scheduler": "^0.25.0" + }, + "peerDependencies": { + "react": "^19.0.0" + } + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -6403,6 +7318,68 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/rrdom": { + "version": "2.0.0-alpha.18", + "resolved": "https://registry.npmjs.org/rrdom/-/rrdom-2.0.0-alpha.18.tgz", + "integrity": "sha512-fSFzFFxbqAViITyYVA4Z0o5G6p1nEqEr/N8vdgSKie9Rn0FJxDSNJgjV0yiCIzcDs0QR+hpvgFhpbdZ6JIr5Nw==", + "license": "MIT", + "dependencies": { + "rrweb-snapshot": "^2.0.0-alpha.18" + } + }, + "node_modules/rrweb": { + "version": "2.0.0-alpha.13", + "resolved": "https://registry.npmjs.org/rrweb/-/rrweb-2.0.0-alpha.13.tgz", + "integrity": "sha512-a8GXOCnzWHNaVZPa7hsrLZtNZ3CGjiL+YrkpLo0TfmxGLhjNZbWY2r7pE06p+FcjFNlgUVTmFrSJbK3kO7yxvw==", + "license": "MIT", + "dependencies": { + "@rrweb/types": "^2.0.0-alpha.13", + "@types/css-font-loading-module": "0.0.7", + "@xstate/fsm": "^1.4.0", + "base64-arraybuffer": "^1.0.1", + "fflate": "^0.4.4", + "mitt": "^3.0.0", + "rrdom": "^2.0.0-alpha.13", + "rrweb-snapshot": "^2.0.0-alpha.13" + } + }, + "node_modules/rrweb-snapshot": { + "version": "2.0.0-alpha.18", + "resolved": "https://registry.npmjs.org/rrweb-snapshot/-/rrweb-snapshot-2.0.0-alpha.18.tgz", + "integrity": "sha512-hBHZL/NfgQX6wO1D9mpwqFu1NJPpim+moIcKhFEjVTZVRUfCln+LOugRc4teVTCISYHN8Cw5e2iNTWCSm+SkoA==", + "license": "MIT", + "dependencies": { + "postcss": "^8.4.38" + } + }, + "node_modules/rrweb-snapshot/node_modules/postcss": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.1.tgz", + "integrity": "sha512-6oz2beyjc5VMn/KV1pPw8fliQkhBXrVn1Z3TVyqZxU8kZpzEKhBdmCFqI6ZbmGtamQvQGuU1sgPTk8ZrXDD7jQ==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/postcss/" + }, + { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/postcss" + }, + { + "type": "github", + "url": "https://github.com/sponsors/ai" + } + ], + "license": "MIT", + "dependencies": { + "nanoid": "^3.3.8", + "picocolors": "^1.1.1", + "source-map-js": "^1.2.1" + }, + "engines": { + "node": "^10 || ^12 || >=14" + } + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -6453,6 +7430,13 @@ "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "license": "MIT" }, + "node_modules/scheduler": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/scheduler/-/scheduler-0.25.0.tgz", + "integrity": "sha512-xFVuu11jh+xcO7JOAGJNOXld8/TcEHK/4CituBUeUb5hqxJLj9YuemAEuvm9gQ/+pgXYfbQuqAkiYu+u7YEsNA==", + "license": "MIT", + "peer": true + }, "node_modules/semver": { "version": "7.6.3", "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", @@ -6534,6 +7518,46 @@ "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", "license": "ISC" }, + "node_modules/sharp": { + "version": "0.33.5", + "resolved": "https://registry.npmjs.org/sharp/-/sharp-0.33.5.tgz", + "integrity": "sha512-haPVm1EkS9pgvHrQ/F3Xy+hgcuMV0Wm9vfIBSiwZ05k+xgb0PkBQpGsAA/oWdDobNaZTH5ppvHtzCFbnSEwHVw==", + "hasInstallScript": true, + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "color": "^4.2.3", + "detect-libc": "^2.0.3", + "semver": "^7.6.3" + }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "funding": { + "url": "https://opencollective.com/libvips" + }, + "optionalDependencies": { + "@img/sharp-darwin-arm64": "0.33.5", + "@img/sharp-darwin-x64": "0.33.5", + "@img/sharp-libvips-darwin-arm64": "1.0.4", + "@img/sharp-libvips-darwin-x64": "1.0.4", + "@img/sharp-libvips-linux-arm": "1.0.5", + "@img/sharp-libvips-linux-arm64": "1.0.4", + "@img/sharp-libvips-linux-s390x": "1.0.4", + "@img/sharp-libvips-linux-x64": "1.0.4", + "@img/sharp-libvips-linuxmusl-arm64": "1.0.4", + "@img/sharp-libvips-linuxmusl-x64": "1.0.4", + "@img/sharp-linux-arm": "0.33.5", + "@img/sharp-linux-arm64": "0.33.5", + "@img/sharp-linux-s390x": "0.33.5", + "@img/sharp-linux-x64": "0.33.5", + "@img/sharp-linuxmusl-arm64": "0.33.5", + "@img/sharp-linuxmusl-x64": "0.33.5", + "@img/sharp-wasm32": "0.33.5", + "@img/sharp-win32-ia32": "0.33.5", + "@img/sharp-win32-x64": "0.33.5" + } + }, "node_modules/shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -6629,6 +7653,16 @@ "url": "https://github.com/sponsors/ljharb" } }, + "node_modules/simple-swizzle": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/simple-swizzle/-/simple-swizzle-0.2.2.tgz", + "integrity": "sha512-JA//kQgZtbuY83m+xT+tXJkmJncGMTFT+C+g2h2R9uxkYIrE2yy9sgmcLhCnw57/WSD+Eh3J97FPEDFnbXnDUg==", + "license": "MIT", + "optional": true, + "dependencies": { + "is-arrayish": "^0.3.1" + } + }, "node_modules/simple-update-notifier": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/simple-update-notifier/-/simple-update-notifier-2.0.0.tgz", @@ -6651,6 +7685,15 @@ "node": ">=8" } }, + "node_modules/source-map-js": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/source-map-js/-/source-map-js-1.2.1.tgz", + "integrity": "sha512-UXWMKhLOwVKb728IUtQPXxfYU+usdybtUrK/8uGE8CQMvrhOpwvzDBwj0QhSL7MQc7vIsISBG8VQ8+IDQxpfQA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -6660,6 +7703,14 @@ "node": ">= 0.8" } }, + "node_modules/streamsearch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", + "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/strict-event-emitter-types": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/strict-event-emitter-types/-/strict-event-emitter-types-2.0.0.tgz", @@ -6692,6 +7743,29 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/styled-jsx": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.6.tgz", + "integrity": "sha512-qSVyDTeMotdvQYoHWLNGwRFJHC+i+ZvdBRYosOFgC+Wg1vx4frN2/RG/NA7SYqqvKNLf39P2LSRA2pu6n0XYZA==", + "license": "MIT", + "dependencies": { + "client-only": "0.0.1" + }, + "engines": { + "node": ">= 12.0.0" + }, + "peerDependencies": { + "react": ">= 16.8.0 || 17.x.x || ^18.0.0-0 || ^19.0.0-0" + }, + "peerDependenciesMeta": { + "@babel/core": { + "optional": true + }, + "babel-plugin-macros": { + "optional": true + } + } + }, "node_modules/superstruct": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/superstruct/-/superstruct-1.0.4.tgz", @@ -6705,6 +7779,7 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "license": "MIT", "dependencies": { "has-flag": "^4.0.0" @@ -6717,6 +7792,7 @@ "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true, "license": "MIT" }, "node_modules/to-regex-range": { @@ -6925,6 +8001,19 @@ "node": ">= 0.4.0" } }, + "node_modules/uuid": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-11.0.5.tgz", + "integrity": "sha512-508e6IcKLrhxKdBbcA2b4KQZlLVp2+J5UwQ6F7Drckkc5N9ZJwFa4TgWtsww9UG8fGHbm6gbV19TdM5pQ4GaIA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "license": "MIT", + "bin": { + "uuid": "dist/esm/bin/uuid" + } + }, "node_modules/v8-compile-cache-lib": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", @@ -6935,8 +8024,7 @@ "version": "0.36.0", "resolved": "https://registry.npmjs.org/valibot/-/valibot-0.36.0.tgz", "integrity": "sha512-CjF1XN4sUce8sBK9TixrDqFM7RwNkuXdJu174/AwmQUB62QbCQADg5lLe8ldBalFgtj1uKj+pKwDJiNo4Mn+eQ==", - "license": "MIT", - "peer": true + "license": "MIT" }, "node_modules/vary": { "version": "1.1.2", @@ -6982,6 +8070,7 @@ "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, "license": "ISC", "dependencies": { "isexe": "^2.0.0" @@ -7007,6 +8096,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, "license": "ISC" }, "node_modules/ws": { @@ -7043,7 +8133,6 @@ "version": "0.1.0", "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true, "license": "MIT", "engines": { "node": ">=10" diff --git a/sui-agent/package.json b/sui-agent/package.json index 6c70fc1..7f87794 100644 --- a/sui-agent/package.json +++ b/sui-agent/package.json @@ -16,6 +16,8 @@ "license": "ISC", "description": "", "dependencies": { + "@mysten/sui": "^1.21.0", + "@suilend/sdk": "^1.1.36", "aftermath-ts-sdk": "^1.2.49", "atoma-sdk": "github:atoma-network/atoma-sdk-typescript", "axios": "^1.7.9", @@ -32,7 +34,7 @@ "@types/express": "^5.0.0", "@typescript-eslint/eslint-plugin": "^5.0.0", "@typescript-eslint/parser": "^5.0.0", - "prettier": "^3.4.2", - "eslint": "^8.57.0" + "eslint": "^8.57.0", + "prettier": "^3.4.2" } } diff --git a/sui-agent/src/agents/ToolRegistry.ts b/sui-agent/src/agents/ToolRegistry.ts index fe6649f..13ace2f 100644 --- a/sui-agent/src/agents/ToolRegistry.ts +++ b/sui-agent/src/agents/ToolRegistry.ts @@ -27,6 +27,17 @@ import { getAfSuiExchangeRateWrapper, getStakeTransactionWrapper, } from '../utils/toolWrappers'; +import { + depositIntoObligationWrapper, + depositLiquidityAndGetCTokensWrapper, + redeemCtokensAndWithdrawLiquidityWrapper, + withdrawAndSendToUserWrapper, +} from '../tools/suilend/depositWithdraw'; +import { + borrowAndSendToUserWrapper, + repayIntoObligationWrapper, +} from '../tools/suilend/borrowRepay'; +import { liquidateAndRedeemWrapper } from '../tools/suilend/liquidation'; /* format for tool registry is: @@ -565,4 +576,235 @@ export function registerAllTools(tools: Tools) { ], getStakeTransactionWrapper, ); + + // Suilend Tools + + // 1. Deposit Into Obligation + tools.registerTool( + 'deposit_into_obligation', + 'Tool to deposit coins into an obligation', + [ + { + name: 'lendingMarketId', + type: 'string', + description: 'ID of the lending market', + required: true, + }, + { + name: 'lendingMarketType', + type: 'string', + description: 'Type of the lending market', + required: true, + }, + { + name: 'ownerId', + type: 'string', + description: 'Address of the owner', + required: true, + }, + { + name: 'coinType', + type: 'string', + description: 'Type of coin to deposit', + required: true, + }, + { + name: 'value', + type: 'string', + description: 'Amount to deposit (in base units)', + required: true, + }, + { + name: 'obligationOwnerCapId', + type: 'string', + description: 'Obligation owner capability ID', + required: true, + }, + ], + depositIntoObligationWrapper, + ); + + // 2. Deposit Liquidity and Get CTokens + tools.registerTool( + 'deposit_liquidity_get_ctokens', + 'Tool to deposit liquidity and receive CTokens', + [ + { + name: 'lendingMarketId', + type: 'string', + description: 'ID of the lending market', + required: true, + }, + { + name: 'lendingMarketType', + type: 'string', + description: 'Type of the lending market', + required: true, + }, + { + name: 'ownerId', + type: 'string', + description: 'Address of the owner', + required: true, + }, + { + name: 'coinType', + type: 'string', + description: 'Type of coin to deposit', + required: true, + }, + { + name: 'value', + type: 'string', + description: 'Amount to deposit (in base units)', + required: true, + }, + ], + depositLiquidityAndGetCTokensWrapper, + ); + + // 3. Withdraw and Send to User + tools.registerTool( + 'withdraw_and_send', + 'Tool to withdraw funds and send them to a user', + [ + { + name: 'lendingMarketId', + type: 'string', + description: 'ID of the lending market', + required: true, + }, + { + name: 'lendingMarketType', + type: 'string', + description: 'Type of the lending market', + required: true, + }, + { + name: 'ownerId', + type: 'string', + description: 'Address of the recipient', + required: true, + }, + { + name: 'obligationOwnerCapId', + type: 'string', + description: 'Obligation owner capability ID', + required: true, + }, + { + name: 'obligationId', + type: 'string', + description: 'ID of the obligation', + required: true, + }, + { + name: 'coinType', + type: 'string', + description: 'Type of coin to withdraw', + required: true, + }, + { + name: 'value', + type: 'string', + description: 'Amount to withdraw (in base units)', + required: true, + }, + ], + withdrawAndSendToUserWrapper, + ); + + // 4. Redeem CTokens and Withdraw Liquidity + tools.registerTool( + 'redeem_ctokens_and_withdraw', + 'Tool to redeem CTokens and withdraw underlying liquidity', + [ + { + name: 'lendingMarketId', + type: 'string', + description: 'ID of the lending market', + required: true, + }, + { + name: 'lendingMarketType', + type: 'string', + description: 'Type of the lending market', + required: true, + }, + { + name: 'ownerId', + type: 'string', + description: 'Address of the owner', + required: true, + }, + { + name: 'ctokenCoinTypes', + type: 'array', + description: 'Array of CToken coin types to redeem', + required: true, + }, + ], + redeemCtokensAndWithdrawLiquidityWrapper, + ); + + // 5. Borrow and Send to User + tools.registerTool( + 'borrow_and_send', + 'Tool to borrow funds and send them to a user', + [], + borrowAndSendToUserWrapper, + ); + + // 6. Repay Into Obligation + tools.registerTool( + 'repay_into_obligation', + 'Tool to repay funds into an obligation', + [], + repayIntoObligationWrapper, + ); + + // 7. Liquidate and Redeem + tools.registerTool( + 'liquidate_and_redeem', + 'Tool to liquidate an underwater position and redeem collateral', + [ + { + name: 'lendingMarketId', + type: 'string', + description: 'ID of the lending market', + required: true, + }, + { + name: 'lendingMarketType', + type: 'string', + description: 'Type of the lending market', + required: true, + }, + { + name: 'obligation', + type: 'string', + description: 'ID of the obligation to liquidate', + required: true, + }, + { + name: 'repayCoinType', + type: 'string', + description: 'Type of coin used to repay the debt', + required: true, + }, + { + name: 'withdrawCoinType', + type: 'string', + description: 'Type of collateral coin to withdraw', + required: true, + }, + { + name: 'repayCoinId', + type: 'string', + description: 'ID of the coin object used for repayment', + required: true, + }, + ], + liquidateAndRedeemWrapper, + ); } diff --git a/sui-agent/src/tools/suilend/borrowRepay.ts b/sui-agent/src/tools/suilend/borrowRepay.ts new file mode 100644 index 0000000..a3c4fdc --- /dev/null +++ b/sui-agent/src/tools/suilend/borrowRepay.ts @@ -0,0 +1,112 @@ +import { Transaction } from '@mysten/sui/transactions'; +import { handleError } from '../../utils'; +import { suilendClientWrapper } from '.'; + +/** + * Borrow and send funds to user + * @param ownerId - The owner ID + * @param obligationOwnerCapId - The obligation owner cap ID + * @param obligationId - The obligation ID + * @param coinType - The coin type + * @param value - The value + * @returns A JSON string containing the result of the borrow and send to user operation + */ +export async function borrowAndSendToUserWrapper( + ownerId: string, + obligationOwnerCapId: string, + obligationId: string, + coinType: string, + value: string, +): Promise { + try { + const client = await suilendClientWrapper(); + const transaction = new Transaction(); + await client.borrowAndSendToUser( + ownerId, + obligationOwnerCapId, + obligationId, + coinType, + value, + transaction, + ); + return JSON.stringify([ + { + reasoning: 'Successfully borrowed and sent funds to user', + response: JSON.stringify( + { + ownerId: ownerId, + obligationId: obligationId, + coinType: coinType, + borrowedAmount: value, + status: 'success', + }, + null, + 2, + ), + status: 'success', + query: `Borrowed ${value} of ${coinType} for ${ownerId}`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to borrow and send funds to user', + query: `Attempted to borrow ${value} of ${coinType}`, + }), + ]); + } +} + +/** + * Repay into obligation + * @param ownerId - The owner ID + * @param obligationId - The obligation ID + * @param coinType - The coin type + * @param value - The value + * @returns A JSON string containing the result of the repay into obligation operation + */ +export async function repayIntoObligationWrapper( + ownerId: string, + obligationId: string, + coinType: string, + value: string, +): Promise { + try { + const client = await suilendClientWrapper(); + const transaction = new Transaction(); + await client.repayIntoObligation( + ownerId, + obligationId, + coinType, + value, + transaction, + ); + return JSON.stringify([ + { + reasoning: 'Successfully repaid into obligation', + response: JSON.stringify( + { + ownerId: ownerId, + obligationId: obligationId, + coinType: coinType, + repaidAmount: value, + status: 'success', + }, + null, + 2, + ), + status: 'success', + query: `Repaid ${value} of ${coinType} into obligation`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to repay into obligation', + query: `Attempted to repay ${value} of ${coinType}`, + }), + ]); + } +} diff --git a/sui-agent/src/tools/suilend/depositWithdraw.ts b/sui-agent/src/tools/suilend/depositWithdraw.ts new file mode 100644 index 0000000..b7a41bf --- /dev/null +++ b/sui-agent/src/tools/suilend/depositWithdraw.ts @@ -0,0 +1,214 @@ +import { Transaction } from '@mysten/sui/transactions'; +import { handleError } from '../../utils'; +import { suilendClientWrapper } from '.'; + +/** + * Deposits funds into an obligation in a Suilend lending market and returns the result as a JSON string. + * + * @param lendingMarketId - The ID of the lending market + * @param lendingMarketType - The type of lending market + * @param ownerId - The ID of the owner + * @param coinType - The type of coin + * @param value - The amount of coin to deposit + * @param obligationOwnerCapId - The ID of the obligation owner capability + * @returns A JSON string containing the result of the deposit operation + */ +export async function depositIntoObligationWrapper( + ownerId: string, + coinType: string, + value: string, + obligationOwnerCapId: string, +): Promise { + try { + const client = await suilendClientWrapper(); + const transaction = new Transaction(); + await client.depositIntoObligation( + ownerId, + coinType, + value, + transaction, + obligationOwnerCapId, + ); + return JSON.stringify([ + { + reasoning: 'Successfully deposited into obligation', + response: JSON.stringify( + { + transaction: transaction, + ownerId: ownerId, + coinType: coinType, + value: value, + status: 'success', + }, + null, + 2, + ), + status: 'success', + query: `Deposited ${value} of ${coinType} into obligation`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to deposit into obligation', + query: `Attempted to deposit ${value} of ${coinType}`, + }), + ]); + } +} + +/** + * Deposits liquidity into a Suilend lending market and returns the result as a JSON string. + * + * @param ownerId - The ID of the owner + * @param coinType - The type of coin + * @param value - The amount of coin to deposit + * @returns A JSON string containing the result of the deposit operation + */ +export async function depositLiquidityAndGetCTokensWrapper( + ownerId: string, + coinType: string, + value: string, +): Promise { + try { + const client = await suilendClientWrapper(); + const transaction = new Transaction(); + await client.depositLiquidityAndGetCTokens( + ownerId, + coinType, + value, + transaction, + ); + return JSON.stringify([ + { + reasoning: 'Successfully deposited liquidity and received CTokens', + response: JSON.stringify( + { + ownerId: ownerId, + coinType: coinType, + depositedValue: value, + transaction: transaction, + status: 'success', + }, + null, + 2, + ), + status: 'success', + query: `Deposited ${value} of ${coinType} for CTokens`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to deposit liquidity and get CTokens', + query: `Attempted to deposit ${value} of ${coinType}`, + }), + ]); + } +} + +/** + * Withdraws funds from an obligation in a Suilend lending market and returns the result as a JSON string. + * + * @param ownerId - The ID of the owner + * @param obligationOwnerCapId - The ID of the obligation owner capability + * @param obligationId - The ID of the obligation + * @param coinType - The type of coin + * @param value - The amount of coin to withdraw + * @returns A JSON string containing the result of the withdrawal operation + */ +export async function withdrawAndSendToUserWrapper( + ownerId: string, + obligationOwnerCapId: string, + obligationId: string, + coinType: string, + value: string, +): Promise { + try { + const client = await suilendClientWrapper(); + const transaction = new Transaction(); + await client.withdrawAndSendToUser( + ownerId, + obligationOwnerCapId, + obligationId, + coinType, + value, + transaction, + ); + return JSON.stringify([ + { + reasoning: 'Successfully withdrew and sent funds to user', + response: JSON.stringify( + { + ownerId: ownerId, + coinType: coinType, + withdrawnValue: value, + transaction: transaction, + status: 'success', + }, + null, + 2, + ), + status: 'success', + query: `Withdrew ${value} of ${coinType} to ${ownerId}`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to withdraw and send to user', + query: `Attempted to withdraw ${value} of ${coinType}`, + }), + ]); + } +} + +/** + * Redeems CTokens and withdraws liquidity from a Suilend lending market and returns the result as a JSON string. + * + * @param ownerId - The ID of the owner + * @param ctokenCoinTypes - The types of CTokens to redeem + * @returns A JSON string containing the result of the redemption operation + */ +export async function redeemCtokensAndWithdrawLiquidityWrapper( + ownerId: string, + ctokenCoinTypes: string[], +): Promise { + try { + const client = await suilendClientWrapper(); + const transaction = new Transaction(); + await client.redeemCtokensAndWithdrawLiquidity( + ownerId, + ctokenCoinTypes, + transaction, + ); + return JSON.stringify([ + { + reasoning: 'Successfully redeemed CTokens and withdrew liquidity', + response: JSON.stringify( + { + ownerId: ownerId, + ctokenCoinTypes: ctokenCoinTypes, + transaction: transaction, + status: 'success', + }, + null, + 2, + ), + status: 'success', + query: `Redeemed CTokens for types: ${ctokenCoinTypes.join(', ')}`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to redeem CTokens and withdraw liquidity', + query: `Attempted to redeem CTokens for types: ${ctokenCoinTypes.join(', ')}`, + }), + ]); + } +} diff --git a/sui-agent/src/tools/suilend/index.ts b/sui-agent/src/tools/suilend/index.ts new file mode 100644 index 0000000..389b8a5 --- /dev/null +++ b/sui-agent/src/tools/suilend/index.ts @@ -0,0 +1,91 @@ +import { SuiClient, SuiHTTPTransport } from '@mysten/sui/client'; +import { + SuilendClient, + LENDING_MARKET_ID, + LENDING_MARKET_TYPE, +} from '@suilend/sdk/client'; +import { NETWORK_CONFIG } from '../../../@types/interface'; + +/** + * Initializes and returns a SuilendClient instance configured for the mainnet. + * + * This function creates a configured SuilendClient by: + * 1. Establishing a connection to the Sui mainnet using SuiClient + * 2. Initializing a SuilendClient with predefined lending market parameters + * + * @returns {Promise} A configured SuilendClient instance ready for lending operations + * @throws {Error} If client initialization fails, with detailed error message + * + * @example + * try { + * const client = await suilendClientWrapper(); + * // Use client for lending operations + * } catch (error) { + * console.error('Failed to initialize SuilendClient:', error); + * } + * + * @see {@link SuilendClient} For available lending operations + * @see {@link LENDING_MARKET_ID} For the configured lending market identifier + * @see {@link LENDING_MARKET_TYPE} For the lending market type configuration + */ +async function suilendClientWrapper(): Promise { + try { + const suiClient = new SuiClient({ + transport: new SuiHTTPTransport({ + url: NETWORK_CONFIG.MAINNET.fullnode, + }), + }); + + const suilendClient = await SuilendClient.initialize( + LENDING_MARKET_ID, + LENDING_MARKET_TYPE, + suiClient, + ); + + return suilendClient; + } catch (error) { + throw new Error( + `Failed to initialize SuilendClient: ${error instanceof Error ? error.message : String(error)}`, + ); + } +} + +export { suilendClientWrapper }; + +// // Market Management Methods +// 1. createLendingMarket(registryId, lendingMarketType) +// 2. createReserve(lendingMarketOwnerCapId, pythPriceId, coinType, config) +// 3. updateReserveConfig(lendingMarketOwnerCapId, coinType, config) +// 4. changeReservePriceFeed(lendingMarketOwnerCapId, coinType, pythPriceId) +// 5. updateRateLimiterConfig(lendingMarketOwnerCapId, config) +// 6. migrate(lendingMarketOwnerCapId) +// 7. setFeeReceiversAndWeights(lendingMarketOwnerCapId, receivers, weights) +// 8. claimFees(coinType) + +// // Obligation Management +// 9. createObligation() +// 10. newObligationOwnerCap(lendingMarketOwnerCapId, destinationAddress, obligationId) + +// // Deposit/Withdraw Operations +// 11. depositIntoObligation(ownerId, coinType, value, obligationOwnerCapId) +// 12. depositLiquidityAndGetCTokens(ownerId, coinType, value) +// 13. withdrawAndSendToUser(ownerId, obligationOwnerCapId, obligationId, coinType, value) +// 14. redeemCtokensAndWithdrawLiquidity(ownerId, ctokenCoinTypes) + +// // Borrow/Repay Operations +// 15. borrowAndSendToUser(ownerId, obligationOwnerCapId, obligationId, coinType, value) +// 16. repayIntoObligation(ownerId, obligationId, coinType, value) + +// // Reward Management +// 17. addReward(ownerId, lendingMarketOwnerCapId, reserveArrayIndex, isDepositReward, rewardCoinType, rewardValue, startTimeMs, endTimeMs) +// 18. cancelReward(lendingMarketOwnerCapId, reserveArrayIndex, isDepositReward, rewardIndex, rewardCoinType) +// 19. closeReward(lendingMarketOwnerCapId, reserveArrayIndex, isDepositReward, rewardIndex, rewardCoinType) +// 20. claimRewardsAndSendToUser(ownerId, obligationOwnerCapId, rewards) +// 21. claimRewardsAndDeposit(ownerId, obligationOwnerCapId, rewards) + +// // Liquidation Operations +// 22. liquidateAndRedeem(obligation, repayCoinType, withdrawCoinType, repayCoinId) + +// // Query Methods +// 23. getLendingMarketOwnerCapId(ownerId) +// 24. getObligation(obligationId) diff --git a/sui-agent/src/tools/suilend/liquidation.ts b/sui-agent/src/tools/suilend/liquidation.ts new file mode 100644 index 0000000..21d7484 --- /dev/null +++ b/sui-agent/src/tools/suilend/liquidation.ts @@ -0,0 +1,65 @@ +import { Transaction } from '@mysten/sui/transactions'; +import { handleError } from '../../utils'; +import { suilendClientWrapper } from '.'; + +/** + * Liquidate and redeem + * @param obligation - The obligation ID + * @param repayCoinType - The type of coin to repay + * @param withdrawCoinType - The type of coin to withdraw + * @param repayCoinId - The ID of the coin to repay + * @returns A JSON string containing the result of the liquidation and redemption operation + */ +export async function liquidateAndRedeemWrapper( + obligation: string, + repayCoinType: string, + withdrawCoinType: string, + repayCoinId: string, +): Promise { + try { + const client = await suilendClientWrapper(); + const transaction = new Transaction(); + // Fetch obligation details first to include in response + const obligationDetails = await client.getObligation(obligation); + // Perform liquidation + await client.liquidateAndRedeem( + transaction, + obligation, + repayCoinType, + withdrawCoinType, + repayCoinId, + ); + + return JSON.stringify([ + { + reasoning: 'Successfully performed liquidation', + response: JSON.stringify( + { + transaction: transaction, + liquidationDetails: { + transaction: transaction, + obligation: obligation, + repaidCoinType: repayCoinType, + withdrawnCoinType: withdrawCoinType, + repayCoinId: repayCoinId, + obligationDetails: obligationDetails, // Include original obligation state + }, + status: 'success', + }, + null, + 2, + ), + status: 'success', + query: `Liquidated obligation ${obligation} repaying with ${repayCoinType} and withdrawing ${withdrawCoinType}`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to perform liquidation', + query: `Attempted to liquidate obligation ${obligation}`, + }), + ]); + } +} diff --git a/sui-agent/src/tools/suilend/marketManagement.ts b/sui-agent/src/tools/suilend/marketManagement.ts new file mode 100644 index 0000000..66ac8d3 --- /dev/null +++ b/sui-agent/src/tools/suilend/marketManagement.ts @@ -0,0 +1,288 @@ +import { Transaction } from '@mysten/sui/transactions'; +import { SuilendClient } from '@suilend/sdk/client'; +import { handleError } from '../../utils'; +import { suilendClientWrapper } from '.'; +import { CreateReserveConfigArgs } from '@suilend/sdk/_generated/suilend/reserve-config/functions'; + +/** + * Creates a new lending market in the Suilend protocol and returns the result as a JSON string. + * + * @param registryId - The ID of the registry where the lending market will be created + * @param lendingMarketType - The type of lending market to create + * @returns A JSON string containing: + * - On success: An array with one object containing: + * - reasoning: Success message + * - response: JSON string with ownerCap and transaction details + * - status: 'success' + * - query: Description of the action performed + * - errors: Empty array + * - On failure: An array with one error object containing: + * - reasoning: Error message + * - query: Description of the attempted action + * - Additional error details from handleError + */ +export async function createLendingMarketWrapper( + registryId: string, + lendingMarketType: string, +): Promise { + try { + const transaction = new Transaction(); + const ownerCap = SuilendClient.createNewLendingMarket( + registryId, + lendingMarketType, + transaction, + ); + + return JSON.stringify([ + { + reasoning: 'Successfully created new lending market', + response: JSON.stringify( + { + ownerCap: ownerCap, + transaction: transaction, + }, + null, + 2, + ), + status: 'success', + query: `Created lending market with registry ID: ${registryId}`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to create lending market', + query: `Attempted to create lending market with registry ID: ${registryId}`, + }), + ]); + } +} + +/** + * Creates a new reserve in an existing Suilend lending market and returns the result as a JSON string. + * + * @param lendingMarketOwnerCapId - The ID of the owner capability for the lending market + * @param pythPriceId - The ID of the Pyth price feed to use for the reserve + * @param coinType - The type of coin to be used in the reserve + * @param config - Configuration parameters for the reserve + * @returns A JSON string containing: + * - On success: An array with one object containing: + * - reasoning: Success message with coin type + * - response: JSON string with transaction and result details + * - status: 'success' + * - query: Description of the action performed + * - errors: Empty array + * - On failure: An array with one error object containing: + * - reasoning: Error message + * - query: Description of the attempted action + * - Additional error details from handleError + */ +export async function createReserveWrapper( + lendingMarketOwnerCapId: string, + pythPriceId: string, + coinType: string, + config: CreateReserveConfigArgs, +) { + try { + const transaction = new Transaction(); + const client = await suilendClientWrapper(); + const result = await client.createReserve( + lendingMarketOwnerCapId, + transaction, + pythPriceId, + coinType, + config, + ); + return JSON.stringify([ + { + reasoning: + 'Successfully created reserve in lending market with coin type: ' + + coinType, + response: JSON.stringify({ + transaction: transaction, + createdReserveConfig: { + openLtvPct: config.openLtvPct, + closeLtvPct: config.closeLtvPct, + maxCloseLtvPct: config.maxCloseLtvPct, + borrowWeightBps: config.borrowWeightBps, + depositLimit: config.depositLimit, + borrowLimit: config.borrowLimit, + liquidationBonusBps: config.liquidationBonusBps, + maxLiquidationBonusBps: config.maxLiquidationBonusBps, + depositLimitUsd: config.depositLimitUsd, + borrowLimitUsd: config.borrowLimitUsd, + }, + result: result, + }), + status: 'success', + query: `Created reserve with coin type: ${coinType}`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to create reserve', + query: `Attempted to create reserve with coin type: ${coinType}`, + }), + ]); + } +} + +/** + * Updates the configuration of an existing reserve in a Suilend lending market and returns the result as a JSON string. + * + * @param lendingMarketOwnerCapId - The ID of the owner capability for the lending market + * @param coinType - The type of coin used in the reserve to update + * @param config - Configuration parameters for the reserve, including: + * - openLtvPct: Open loan-to-value percentage + * - closeLtvPct: Close loan-to-value percentage + * - maxCloseLtvPct: Maximum close loan-to-value percentage + * - borrowWeightBps: Borrow weight in basis points + * - depositLimit: Maximum deposit limit in base units + * - borrowLimit: Maximum borrow limit in base units + * - liquidationBonusBps: Liquidation bonus in basis points + * - maxLiquidationBonusBps: Maximum liquidation bonus in basis points + * - depositLimitUsd: Maximum deposit limit in USD + * - borrowLimitUsd: Maximum borrow limit in USD + * - borrowFeeBps: Borrow fee in basis points + * - spreadFeeBps: Spread fee in basis points + * - protocolLiquidationFeeBps: Protocol liquidation fee in basis points + * - interestRateUtils: Interest rate utility parameters + * - interestRateAprs: Interest rate APR configurations + * - isolated: Whether the reserve is isolated + * - openAttributedBorrowLimitUsd: Open attributed borrow limit in USD + * - closeAttributedBorrowLimitUsd: Close attributed borrow limit in USD + * @returns A JSON string containing: + * - On success: An array with one object containing: + * - reasoning: Success message + * - response: JSON string with transaction details and updated configuration + * - status: 'success' + * - query: Description of the action performed + * - errors: Empty array + * - On failure: An array with one error object containing: + * - reasoning: Error message + * - query: Description of the attempted action + * - Additional error details from handleError + */ +export async function updateReserveConfigWrapper( + lendingMarketOwnerCapId: string, + coinType: string, + config: CreateReserveConfigArgs, +): Promise { + try { + const transaction = new Transaction(); + const client = await suilendClientWrapper(); + const result = await client.updateReserveConfig( + lendingMarketOwnerCapId, + transaction, + coinType, + config, + ); + // Format the response with the updated configuration + return JSON.stringify([ + { + reasoning: 'Successfully updated reserve configuration', + response: JSON.stringify( + { + lendingMarketOwnerCapId: lendingMarketOwnerCapId, + coinType: coinType, + transaction: transaction, + updatedConfig: { + openLtvPct: config.openLtvPct, + closeLtvPct: config.closeLtvPct, + maxCloseLtvPct: config.maxCloseLtvPct, + borrowWeightBps: config.borrowWeightBps, + depositLimit: config.depositLimit, + borrowLimit: config.borrowLimit, + liquidationBonusBps: config.liquidationBonusBps, + maxLiquidationBonusBps: config.maxLiquidationBonusBps, + depositLimitUsd: config.depositLimitUsd, + borrowLimitUsd: config.borrowLimitUsd, + borrowFeeBps: config.borrowFeeBps, + spreadFeeBps: config.spreadFeeBps, + protocolLiquidationFeeBps: config.protocolLiquidationFeeBps, + interestRateUtils: config.interestRateUtils, + interestRateAprs: config.interestRateAprs, + isolated: config.isolated, + openAttributedBorrowLimitUsd: config.openAttributedBorrowLimitUsd, + closeAttributedBorrowLimitUsd: + config.closeAttributedBorrowLimitUsd, + }, + status: 'success', + }, + null, + 2, + ), + status: 'success', + query: `Updated reserve configuration for coin type: ${coinType}`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to update reserve config', + query: `Attempted to update reserve config with coin type: ${coinType}`, + }), + ]); + } +} + +/** + * Changes the price feed for an existing reserve in a Suilend lending market and returns the result as a JSON string. + * + * @param lendingMarketOwnerCapId - The ID of the owner capability for the lending market + * @param coinType - The type of coin used in the reserve + * @param pythPriceId - The ID of the new Pyth price feed to use + * @returns A JSON string containing: + * - On success: An array with one object containing: + * - reasoning: Success message + * - response: JSON string with transaction details and new price feed + * - status: 'success' + * - query: Description of the action performed + * - errors: Empty array + */ +export async function changeReservePriceFeedWrapper( + lendingMarketOwnerCapId: string, + coinType: string, + pythPriceId: string, +) { + try { + const client = await suilendClientWrapper(); + const transaction = new Transaction(); + const result = await client.changeReservePriceFeed( + lendingMarketOwnerCapId, + coinType, + pythPriceId, + transaction, + ); + return JSON.stringify([ + { + reasoning: 'Successfully changed reserve price feed', + response: JSON.stringify( + { + transaction: transaction, + lendingMarketId: lendingMarketOwnerCapId, + coinType: coinType, + newPriceId: pythPriceId, + status: 'success', + }, + null, + 2, + ), + status: 'success', + query: `Changed reserve price feed for coin type: ${coinType}`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to change reserve price feed', + query: `Attempted to change reserve price feed for coin type: ${coinType}`, + }), + ]); + } +} diff --git a/sui-agent/src/tools/suilend/queryMethods.ts b/sui-agent/src/tools/suilend/queryMethods.ts new file mode 100644 index 0000000..2ba74d7 --- /dev/null +++ b/sui-agent/src/tools/suilend/queryMethods.ts @@ -0,0 +1,83 @@ +import { handleError } from '../../utils'; +import { suilendClientWrapper } from '.'; + +/** + * Get lending market owner capability ID + * @param ownerId - The ID of the owner + * @param lendingMarketId - The ID of the lending market + * @param lendingMarketType - The type of the lending market + * @returns A JSON string containing the lending market owner capability ID + */ +export async function getLendingMarketOwnerCapIdWrapper( + ownerId: string, + lendingMarketId: string, +): Promise { + try { + const client = await suilendClientWrapper(); + const ownerCapId = await client.getLendingMarketOwnerCapId(ownerId); + return JSON.stringify([ + { + reasoning: 'Successfully retrieved lending market owner capability ID', + response: JSON.stringify( + { + ownerId: ownerId, + ownerCapId: ownerCapId, + lendingMarketId: lendingMarketId, + status: 'success', + }, + null, + 2, + ), + status: 'success', + query: `Retrieved owner capability ID for ${ownerId}`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to retrieve lending market owner capability ID', + query: `Attempted to get owner capability ID for ${ownerId}`, + }), + ]); + } +} + +/** + * Get obligation details + * @param obligationId - The ID of the obligation + * @returns A JSON string containing the obligation details + */ +export async function getObligationWrapper( + obligationId: string, +): Promise { + try { + const client = await suilendClientWrapper(); + + const obligation = await client.getObligation(obligationId); + return JSON.stringify([ + { + reasoning: 'Successfully retrieved obligation details', + response: JSON.stringify( + { + obligationId: obligationId, + obligationDetails: obligation, + status: 'success', + }, + null, + 2, + ), + status: 'success', + query: `Retrieved obligation details for ${obligationId}`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to retrieve obligation details', + query: `Attempted to get obligation details for ${obligationId}`, + }), + ]); + } +} diff --git a/sui-agent/src/tools/suilend/rewardManagement.ts b/sui-agent/src/tools/suilend/rewardManagement.ts new file mode 100644 index 0000000..dedd047 --- /dev/null +++ b/sui-agent/src/tools/suilend/rewardManagement.ts @@ -0,0 +1,297 @@ +import { Transaction } from '@mysten/sui/transactions'; +import { suilendClientWrapper } from '.'; +import { ClaimRewardsReward, SuilendClient } from '@suilend/sdk/client'; +import { handleError } from '../../utils'; + +/** + * Add a reward + * @param ownerId - The owner ID + * @param lendingMarketOwnerCapId - The lending market owner cap ID + * @param reserveArrayIndex - The reserve array index + * @param isDepositReward - Whether the reward is a deposit reward + * @param rewardCoinType - The reward coin type + * @param rewardValue - The reward value + * @param startTimeMs - The start time in milliseconds + * @param endTimeMs - The end time in milliseconds + * @returns A JSON string containing the result of the add reward operation + */ +export async function addRewardWrapper( + ownerId: string, + lendingMarketOwnerCapId: string, + reserveArrayIndex: number, + isDepositReward: boolean, + rewardCoinType: string, + rewardValue: string, + startTimeMs: string, + endTimeMs: string, +): Promise { + try { + const client = await suilendClientWrapper(); + const transaction = new Transaction(); + await client.addReward( + ownerId, + lendingMarketOwnerCapId, + BigInt(reserveArrayIndex), + isDepositReward, + rewardCoinType, + rewardValue, + BigInt(startTimeMs), + BigInt(endTimeMs), + transaction, + ); + + return JSON.stringify([ + { + reasoning: 'Successfully added reward', + response: JSON.stringify( + { + transaction: transaction, + rewardDetails: { + reserveIndex: reserveArrayIndex, + rewardType: isDepositReward ? 'deposit' : 'borrow', + coinType: rewardCoinType, + value: rewardValue, + duration: `${startTimeMs} to ${endTimeMs}`, + }, + status: 'success', + }, + null, + 2, + ), + status: 'success', + query: `Added ${rewardValue} ${rewardCoinType} reward`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to add reward', + query: `Attempted to add ${rewardValue} ${rewardCoinType} reward`, + }), + ]); + } +} + +/** + * Cancel a reward + * @param lendingMarketOwnerCapId - The lending market owner cap ID + * @param reserveArrayIndex - The reserve array index + * @param isDepositReward - Whether the reward is a deposit reward + * @param rewardIndex - The reward index + * @param rewardCoinType - The reward coin type + * @returns A JSON string containing the result of the cancel reward operation + */ +export async function cancelRewardWrapper( + lendingMarketOwnerCapId: string, + reserveArrayIndex: number, + isDepositReward: boolean, + rewardIndex: number, + rewardCoinType: string, +): Promise { + try { + const client = await suilendClientWrapper(); + const transaction = new Transaction(); + await client.cancelReward( + lendingMarketOwnerCapId, + BigInt(reserveArrayIndex), + isDepositReward, + BigInt(rewardIndex), + rewardCoinType, + transaction, + ); + + return JSON.stringify([ + { + reasoning: 'Successfully cancelled reward', + response: JSON.stringify( + { + transaction: transaction, + cancelledReward: { + reserveIndex: reserveArrayIndex, + rewardIndex: rewardIndex, + rewardType: isDepositReward ? 'deposit' : 'borrow', + coinType: rewardCoinType, + }, + status: 'success', + }, + null, + 2, + ), + status: 'success', + query: `Cancelled reward at index ${rewardIndex}`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to cancel reward', + query: `Attempted to cancel reward at index ${rewardIndex}`, + }), + ]); + } +} + +/** + * Close a reward + * @param lendingMarketOwnerCapId - The lending market owner cap ID + * @param reserveArrayIndex - The reserve array index + * @param isDepositReward - Whether the reward is a deposit reward + * @param rewardIndex - The reward index + * @param rewardCoinType - The reward coin type + * @returns A JSON string containing the result of the close reward operation + */ +export async function closeRewardWrapper( + lendingMarketOwnerCapId: string, + reserveArrayIndex: number, + isDepositReward: boolean, + rewardIndex: number, + rewardCoinType: string, +): Promise { + try { + const client = await suilendClientWrapper(); + const transaction = new Transaction(); + + await client.closeReward( + lendingMarketOwnerCapId, + BigInt(reserveArrayIndex), + isDepositReward, + BigInt(rewardIndex), + rewardCoinType, + transaction, + ); + + return JSON.stringify([ + { + reasoning: 'Successfully closed reward', + response: JSON.stringify( + { + transaction: transaction, + closedReward: { + reserveIndex: reserveArrayIndex, + rewardIndex: rewardIndex, + rewardType: isDepositReward ? 'deposit' : 'borrow', + coinType: rewardCoinType, + }, + status: 'success', + }, + null, + 2, + ), + status: 'success', + query: `Closed reward at index ${rewardIndex}`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to close reward', + query: `Attempted to close reward at index ${rewardIndex}`, + }), + ]); + } +} + +/** + * Claim rewards and send to user + * @param ownerId - The owner ID + * @param obligationOwnerCapId - The obligation owner cap ID + * @param rewards - The rewards + * @returns A JSON string containing the result of the claim rewards and send to user operation + */ +export async function claimRewardsAndSendToUserWrapper( + ownerId: string, + obligationOwnerCapId: string, + rewards: ClaimRewardsReward[], +): Promise { + try { + const client = await suilendClientWrapper(); + const transaction = new Transaction(); + + await client.claimRewardsAndSendToUser( + ownerId, + obligationOwnerCapId, + rewards, + transaction, + ); + + return JSON.stringify([ + { + reasoning: 'Successfully claimed and sent rewards', + response: JSON.stringify( + { + transaction: transaction, + claimedRewards: rewards, + recipient: ownerId, + status: 'success', + }, + null, + 2, + ), + status: 'success', + query: `Claimed rewards for ${ownerId}`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to claim and send rewards', + query: `Attempted to claim rewards for ${ownerId}`, + }), + ]); + } +} + +/** + * Claim rewards and deposit + * @param ownerId - The owner ID + * @param obligationOwnerCapId - The obligation owner cap ID + * @param rewards - The rewards + * @returns A JSON string containing the result of the claim rewards and deposit operation + */ +export async function claimRewardsAndDepositWrapper( + ownerId: string, + obligationOwnerCapId: string, + rewards: ClaimRewardsReward[], +): Promise { + try { + const client = await suilendClientWrapper(); + const transaction = new Transaction(); + + await client.claimRewardsAndDeposit( + ownerId, + obligationOwnerCapId, + rewards, + transaction, + ); + + return JSON.stringify([ + { + reasoning: 'Successfully claimed and deposited rewards', + response: JSON.stringify( + { + transaction: transaction, + claimedRewards: rewards, + depositor: ownerId, + status: 'success', + }, + null, + 2, + ), + status: 'success', + query: `Claimed and deposited rewards for ${ownerId}`, + errors: [], + }, + ]); + } catch (error: unknown) { + return JSON.stringify([ + handleError(error, { + reasoning: 'Failed to claim and deposit rewards', + query: `Attempted to claim and deposit rewards for ${ownerId}`, + }), + ]); + } +}