diff --git a/pkg/assets/default_assets.go b/pkg/assets/default_assets.go index ddb6df51d..87fc05331 100644 --- a/pkg/assets/default_assets.go +++ b/pkg/assets/default_assets.go @@ -190,5 +190,13 @@ const AssetsJSON = `[ "decimals": 18, "MEXCSymbol": "USD", "ChainID": 77658377 + }, + { + "address": "AS1nqHKXpnFXqhDExTskXmBbbVpVpUbCQVtNSXLCqUDSUXihdWRq", + "name": "PepeOnMassa", + "symbol": "POM", + "decimals": 18, + "MEXCSymbol": "", + "ChainID": 77658377 } ]` diff --git a/web-frontend/package-lock.json b/web-frontend/package-lock.json index fddf0cb7a..551a77784 100644 --- a/web-frontend/package-lock.json +++ b/web-frontend/package-lock.json @@ -8,9 +8,9 @@ "name": "web-frontend-3", "version": "0.0.0", "dependencies": { - "@massalabs/massa-web3": "^4.0.2-dev", - "@massalabs/react-ui-kit": "^0.0.5-dev", - "@massalabs/wallet-provider": "^2.0.1-dev", + "@massalabs/massa-web3": "^5.0.1-dev", + "@massalabs/react-ui-kit": "^1.0.1-dev", + "@massalabs/wallet-provider": "^3.0.1-dev", "@tanstack/react-query": "^4.29.5", "axios": "^1.6.0", "currency.js": "^2.0.4", @@ -67,9 +67,10 @@ } }, "node_modules/@adraffy/ens-normalize": { - "version": "1.9.4", - "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.9.4.tgz", - "integrity": "sha512-UK0bHA7hh9cR39V+4gl2/NnBBjoXIxkuWAPCaY4X7fbH4L/azIi7ilWOCjMUYfpJgraLUAqkRi2BqrjME8Rynw==" + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.11.0.tgz", + "integrity": "sha512-/3DDPKHqqIqxUULp8yP4zODUY1i+2xvVWsv8A79xGWdCAG+8sb0hRh0Rk2QyOJUnnbyPUAZYcpBuRe3nS2OIUg==", + "license": "MIT" }, "node_modules/@alloc/quick-lru": { "version": "5.2.0", @@ -2394,9 +2395,10 @@ } }, "node_modules/@hicaru/bearby.js": { - "version": "0.5.8", - "resolved": "https://registry.npmjs.org/@hicaru/bearby.js/-/bearby.js-0.5.8.tgz", - "integrity": "sha512-K6mLazzHkDNF5Qmx5iQ4+UqmvBJxtuwg1ZHEDEvOKB1SV/QNuKJ54/HRlLMqJE0RHam2zP7s++RlnMZUIfWgGg==" + "version": "0.5.9", + "resolved": "https://registry.npmjs.org/@hicaru/bearby.js/-/bearby.js-0.5.9.tgz", + "integrity": "sha512-bAyPMklXovDsEkZH9cHO2LdhEqRGbFECQwHjezrRmt1kPmSqHvM+jmADucP14yrnID7ZV/lbMBM+WhmqRAfKhg==", + "license": "MIT" }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.8", @@ -3255,14 +3257,6 @@ "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz", "integrity": "sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw==" }, - "node_modules/@lukeed/csprng": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@lukeed/csprng/-/csprng-1.1.0.tgz", - "integrity": "sha512-Z7C/xXCiGWsg0KuKsHTKJxbWhpI3Vs5GwLfOean7MGyVFGqdRgBbAjOCh6u4bbjPc/8MJ2pZmK/0DLdCbivLDA==", - "engines": { - "node": ">=8" - } - }, "node_modules/@massalabs/eslint-config": { "version": "0.0.9", "resolved": "https://registry.npmjs.org/@massalabs/eslint-config/-/eslint-config-0.0.9.tgz", @@ -3280,27 +3274,20 @@ } }, "node_modules/@massalabs/massa-web3": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/@massalabs/massa-web3/-/massa-web3-4.0.3.tgz", - "integrity": "sha512-W1TtxMrTiqLfUgvIqO641M/2do6Z2Kvvq44JYhiUbteXI5S+VvCJ+HaRtIZ23r9k2wTSlSikE6j6U5bkKDMABA==", + "version": "5.0.1-dev.20241113122359", + "resolved": "https://registry.npmjs.org/@massalabs/massa-web3/-/massa-web3-5.0.1-dev.20241113122359.tgz", + "integrity": "sha512-+MgTl+Ul2FB8CDPlzl8/li4DO/5JRa83BMnKqItIb9ftHu4UjqNVKz1VDYVXaww6BWwMdUylNfvpzZOpWFaB6Q==", + "license": "MIT", "dependencies": { - "@massalabs/wallet-provider": "^2.0.0", - "@massalabs/web3-utils": "^1.4.11", "@noble/ed25519": "^1.7.3", "@noble/hashes": "^1.2.0", - "@types/ws": "^8.5.4", - "@web3pack/base58-check": "^1.0.3", - "axios": "^0.26.1", - "bignumber.js": "^9.1.1", - "bip39": "^3.0.4", - "bs58check": "^3.0.1", - "buffer": "^6.0.3", - "crypto-js": "^4.1.1", + "bs58check": "^4.0.0", + "decimal.js": "^10.4.3", "dotenv": "^16.0.3", - "js-base64": "^3.7.5", - "string_decoder": "^1.3.0", - "tslib": "^2.5.2", - "util": "^0.12.5", + "eventemitter3": "^5.0.1", + "lodash.isequal": "^4.5.0", + "secure-random": "^1.1.2", + "tslib": "^2.8.0", "varint": "^6.0.0" }, "optionalDependencies": { @@ -3308,41 +3295,6 @@ "utf-8-validate": "^6.0.2" } }, - "node_modules/@massalabs/massa-web3/node_modules/@massalabs/wallet-provider": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/@massalabs/wallet-provider/-/wallet-provider-2.0.0.tgz", - "integrity": "sha512-3BKtYszSfKMOi85cxOB1q60uiMWYmdteV28stx2NjT42VtSyKOuWiTJq4KaWbf3ov+fkg+/HknXdl5bhDghbSQ==", - "dependencies": { - "@hicaru/bearby.js": "^0.5.7", - "@massalabs/web3-utils": "^1.4.9-dev", - "axios": "^0.28.0", - "bs58check": "^3.0.1", - "buffer": "^6.0.3", - "uid": "^2.0.1" - }, - "optionalDependencies": { - "bufferutil": "^4.0.7", - "utf-8-validate": "^6.0.2" - } - }, - "node_modules/@massalabs/massa-web3/node_modules/@massalabs/wallet-provider/node_modules/axios": { - "version": "0.28.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.28.1.tgz", - "integrity": "sha512-iUcGA5a7p0mVb4Gm/sy+FSECNkPFT4y7wt6OM/CDpO/OnNCvSs3PoMG8ibrC9jRoGYU0gUK5pXVC4NPXq6lHRQ==", - "dependencies": { - "follow-redirects": "^1.15.0", - "form-data": "^4.0.0", - "proxy-from-env": "^1.1.0" - } - }, - "node_modules/@massalabs/massa-web3/node_modules/axios": { - "version": "0.26.1", - "resolved": "https://registry.npmjs.org/axios/-/axios-0.26.1.tgz", - "integrity": "sha512-fPwcX4EvnSHuInCMItEhAGnaSEXRBjtzh9fOtsE6E1G6p7vl7edEeZe11QHf18+6+9gR5PbKV/sGKNaD8YaMeA==", - "dependencies": { - "follow-redirects": "^1.14.8" - } - }, "node_modules/@massalabs/prettier-config-as": { "version": "0.0.2", "resolved": "https://registry.npmjs.org/@massalabs/prettier-config-as/-/prettier-config-as-0.0.2.tgz", @@ -3353,13 +3305,16 @@ } }, "node_modules/@massalabs/react-ui-kit": { - "version": "0.0.5-dev.20240611224415", - "resolved": "https://registry.npmjs.org/@massalabs/react-ui-kit/-/react-ui-kit-0.0.5-dev.20240611224415.tgz", - "integrity": "sha512-1H8pjj+DwV40BRrc0u7IyloJay+zhkgKteEOvNYzms66yhL/2Rbtp14nClbbzmg8hZeGQVq8YpdMd7t0qqOMCQ==", + "version": "1.0.1-dev.20241118122138", + "resolved": "https://registry.npmjs.org/@massalabs/react-ui-kit/-/react-ui-kit-1.0.1-dev.20241118122138.tgz", + "integrity": "sha512-wlBZ4zNsVSUYMABFVE1Ir770LIFtJW/V8MyllkZWvtt9+a1UHoHZWV2BoATrEhOHimL5KGUawslrfy86ICD6Ww==", "dependencies": { "@headlessui/react": "^1.7.15", + "@massalabs/massa-web3": "^5.0.1-dev", + "@massalabs/wallet-provider": "^3.0.1-dev", "copy-to-clipboard": "^3.3.3", "currency.js": "^2.0.4", + "dot-object": "^2.1.5", "minidenticons": "^4.2.1", "react": "^18.2.0", "react-currency-input-field": "^3.6.11", @@ -3368,32 +3323,24 @@ "react-icons": "^4.8.0", "react-number-format": "^5.2.2", "tw-colors": "^1.2.5", - "viem": "^1.5.2", + "viem": "^2.19.4", "vite-plugin-svgr": "^3.2.0", "zustand": "^4.5.2" - }, - "peerDependencies": { - "@massalabs/massa-web3": "^4.0.3-dev", - "@massalabs/wallet-provider": "^2.0.1-dev", - "@types/dot-object": "^2.1.6", - "dot-object": "^2.1.5" } }, "node_modules/@massalabs/wallet-provider": { - "version": "2.0.1-dev.20240423112601", - "resolved": "https://registry.npmjs.org/@massalabs/wallet-provider/-/wallet-provider-2.0.1-dev.20240423112601.tgz", - "integrity": "sha512-2NvwKho1Couwd2/gXZ0ZGBymmTiuX6rxjoX2gQnEu8LI2i15uDfRba5Gv6NSSvgLcjExzbhrJOQzPRgDAJhDlQ==", + "version": "3.0.1-dev.20241115100745", + "resolved": "https://registry.npmjs.org/@massalabs/wallet-provider/-/wallet-provider-3.0.1-dev.20241115100745.tgz", + "integrity": "sha512-7G7KgyH8g/xyvCHc+P86/fTCQzNFYlrHh1eBIIv7CI8XzQZvCRFDRULtDq7g1sIcHZmMCFvAjWBCNViWTFt2hA==", + "license": "(MIT AND Apache-2.0)", "dependencies": { - "@hicaru/bearby.js": "^0.5.7", - "@massalabs/web3-utils": "^1.4.9-dev", + "@hicaru/bearby.js": "^0.5.9", + "@massalabs/massa-web3": "^5.0.1-dev", "axios": "^0.28.0", - "bs58check": "^3.0.1", + "bs58check": "^4.0.0", "buffer": "^6.0.3", - "uid": "^2.0.1" - }, - "optionalDependencies": { - "bufferutil": "^4.0.7", - "utf-8-validate": "^6.0.2" + "eventemitter3": "^5.0.1", + "lodash.isequal": "^4.5.0" } }, "node_modules/@massalabs/wallet-provider/node_modules/axios": { @@ -3406,17 +3353,6 @@ "proxy-from-env": "^1.1.0" } }, - "node_modules/@massalabs/web3-utils": { - "version": "1.4.11", - "resolved": "https://registry.npmjs.org/@massalabs/web3-utils/-/web3-utils-1.4.11.tgz", - "integrity": "sha512-9iUoSc9OZxrvx8UbDor934z0cetenEU3PlDqTa9Hsh3EuZJ9jalcEU8Q9Z+hjLn2S9Ojmqu2ldcOAxVzYeNCbw==", - "dependencies": { - "bignumber.js": "^9.1.2", - "buffer": "^6.0.3", - "events": "^3.3.0", - "string_decoder": "^1.3.0" - } - }, "node_modules/@microsoft/tsdoc": { "version": "0.14.2", "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.14.2.tgz", @@ -3442,11 +3378,15 @@ "dev": true }, "node_modules/@noble/curves": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", - "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.6.0.tgz", + "integrity": "sha512-TlaHRXDehJuRNR9TfZDNQ45mMEd5dwUwmicsafcIX4SsNiqnCHKjE/1alYPd/lDRVhxdhUAlv8uEhMCI5zjIJQ==", + "license": "MIT", "dependencies": { - "@noble/hashes": "1.3.2" + "@noble/hashes": "1.5.0" + }, + "engines": { + "node": "^14.21.3 || >=16" }, "funding": { "url": "https://paulmillr.com/funding/" @@ -3464,11 +3404,12 @@ ] }, "node_modules/@noble/hashes": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", - "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.5.0.tgz", + "integrity": "sha512-1j6kQFb7QRru7eKN3ZDvRcP13rugwdxZqCjbiAVZfIJwgj2A65UmT4TgARXGlXgnRkORLTDTrO19ZErt7+QXgA==", + "license": "MIT", "engines": { - "node": ">= 16" + "node": "^14.21.3 || >=16" }, "funding": { "url": "https://paulmillr.com/funding/" @@ -3536,33 +3477,36 @@ } }, "node_modules/@scure/base": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.3.tgz", - "integrity": "sha512-/+SgoRjLq7Xlf0CWuLHq2LUZeL/w65kfzAPG5NH9pcmBhs+nunQTn4gvdwgMTIXnt9b2C/1SeL2XiysZEyIC9Q==", + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/@scure/base/-/base-1.1.9.tgz", + "integrity": "sha512-8YKhl8GHiNI/pU2VMaofa2Tor7PJRAjwQLBBuilkJ9L5+13yVbC7JO/wS7piioAvPSwR3JKM1IJ/u4xQzbcXKg==", + "license": "MIT", "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/@scure/bip32": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.3.2.tgz", - "integrity": "sha512-N1ZhksgwD3OBlwTv3R6KFEcPojl/W4ElJOeCZdi+vuI5QmTFwLq3OFf2zd2ROpKvxFdgZ6hUpb0dx9bVNEwYCA==", + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/@scure/bip32/-/bip32-1.5.0.tgz", + "integrity": "sha512-8EnFYkqEQdnkuGBVpCzKxyIwDCBLDVj3oiX0EKUFre/tOjL/Hqba1D6n/8RcmaQy4f95qQFrO2A8Sr6ybh4NRw==", + "license": "MIT", "dependencies": { - "@noble/curves": "~1.2.0", - "@noble/hashes": "~1.3.2", - "@scure/base": "~1.1.2" + "@noble/curves": "~1.6.0", + "@noble/hashes": "~1.5.0", + "@scure/base": "~1.1.7" }, "funding": { "url": "https://paulmillr.com/funding/" } }, "node_modules/@scure/bip39": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.2.1.tgz", - "integrity": "sha512-Z3/Fsz1yr904dduJD0NpiyRHhRYHdcnyh73FZWiV+/qhWi83wNJ3NWolYqCEN+ZWsUz2TWwajJggcRE9r1zUYg==", + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-1.4.0.tgz", + "integrity": "sha512-BEEm6p8IueV/ZTfQLp/0vhw4NPnT9oWf5+28nvmeUICjP99f4vr2d+qc7AVGDDtwRep6ifR43Yed9ERVmiITzw==", + "license": "MIT", "dependencies": { - "@noble/hashes": "~1.3.0", - "@scure/base": "~1.1.0" + "@noble/hashes": "~1.5.0", + "@scure/base": "~1.1.8" }, "funding": { "url": "https://paulmillr.com/funding/" @@ -4056,7 +4000,8 @@ "node_modules/@types/dot-object": { "version": "2.1.6", "resolved": "https://registry.npmjs.org/@types/dot-object/-/dot-object-2.1.6.tgz", - "integrity": "sha512-G1e4SNPOuO72ZXv7wz/W2x29CzQtpxko3G9hBiHqGg/AvFIKoArCs2nbc/WPXnnUkO+1dmvX9WQCyj5gIlAzZg==" + "integrity": "sha512-G1e4SNPOuO72ZXv7wz/W2x29CzQtpxko3G9hBiHqGg/AvFIKoArCs2nbc/WPXnnUkO+1dmvX9WQCyj5gIlAzZg==", + "dev": true }, "node_modules/@types/eslint": { "version": "8.37.0", @@ -4265,14 +4210,6 @@ "integrity": "sha512-Q5vtl1W5ue16D+nIaW8JWebSSraJVlK+EthKn7e7UcD4KWsaSJ8BqGPXNaPghgtcn/fhvrN17Tv8ksUsQpiplw==", "dev": true }, - "node_modules/@types/ws": { - "version": "8.5.4", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.4.tgz", - "integrity": "sha512-zdQDHKUgcX/zBc4GrwsE/7dVdAD8JR4EuiAXiiUhhfyIJXXb2+PrGshFyeXWQPMmmZ2XxgaqclgpIC7eTXc1mg==", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/yargs": { "version": "17.0.24", "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-17.0.24.tgz", @@ -4603,21 +4540,6 @@ "vite": "^4.2.0" } }, - "node_modules/@web3pack/base-x": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@web3pack/base-x/-/base-x-1.0.2.tgz", - "integrity": "sha512-P3XgVnEQ1QFyUTmHzT1sXNprLyxE1aG8WAnk5/Fj+3j4AmsK4dRfMdV3t/aIdYP3i1KvjPRkQJhFXGpxUc+M8A==" - }, - "node_modules/@web3pack/base58-check": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@web3pack/base58-check/-/base58-check-1.0.3.tgz", - "integrity": "sha512-+s4HKOnJbIkj45jhGfSxgWkKsjBENuNbfqASPTLPy/yjGGv/jGCxzFCl0fb4gudV3x0gS50gLpJsC8qQ6cV1gw==", - "dependencies": { - "@web3pack/base-x": "^1.0.1", - "buffer": "^6.0.3", - "hash.js": "^1.1.7" - } - }, "node_modules/@webassemblyjs/ast": { "version": "1.11.6", "resolved": "https://registry.npmjs.org/@webassemblyjs/ast/-/ast-1.11.6.tgz", @@ -4800,18 +4722,16 @@ "dev": true }, "node_modules/abitype": { - "version": "0.9.8", - "resolved": "https://registry.npmjs.org/abitype/-/abitype-0.9.8.tgz", - "integrity": "sha512-puLifILdm+8sjyss4S+fsUN09obiT1g2YW6CtcQF+QDzxR0euzgEB29MZujC6zMk2a6SVmtttq1fc6+YFA7WYQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/wagmi-dev" - } - ], + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/abitype/-/abitype-1.0.6.tgz", + "integrity": "sha512-MMSqYh4+C/aVqI2RQaWqbvI4Kxo5cQV40WQ4QFtDnNzCkqChm8MuENhElmynZlO0qUy/ObkEUaXtKqYnx1Kp3A==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/wevm" + }, "peerDependencies": { "typescript": ">=5.0.4", - "zod": "^3 >=3.19.1" + "zod": "^3 >=3.22.0" }, "peerDependenciesMeta": { "typescript": { @@ -5276,6 +5196,7 @@ "version": "1.0.5", "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -5514,9 +5435,10 @@ "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" }, "node_modules/base-x": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-4.0.0.tgz", - "integrity": "sha512-FuwxlW4H5kh37X/oW59pwTzzTKRzfrrQwhmyspRM7swOEZcHtDZSCt45U6oKgtuFE+WYPblePMVIPR4RZrh/hw==" + "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-js": { "version": "1.5.1", @@ -5546,14 +5468,6 @@ "tweetnacl": "^0.14.3" } }, - "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==", - "engines": { - "node": "*" - } - }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -5573,14 +5487,6 @@ "wasm2js": "bin/wasm2js" } }, - "node_modules/bip39": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/bip39/-/bip39-3.1.0.tgz", - "integrity": "sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A==", - "dependencies": { - "@noble/hashes": "^1.2.0" - } - }, "node_modules/blob-util": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/blob-util/-/blob-util-2.0.2.tgz", @@ -5641,20 +5547,22 @@ } }, "node_modules/bs58": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-5.0.0.tgz", - "integrity": "sha512-r+ihvQJvahgYT50JD05dyJNKlmmSlMoOGwn1lCcEzanPglg7TxYjioQUYehQ9mAR/+hOSd2jRc/Z2y5UxBymvQ==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/bs58/-/bs58-6.0.0.tgz", + "integrity": "sha512-PD0wEnEYg6ijszw/u8s+iI3H17cTymlrwkKhDhPZq+Sokl3AU4htyBFTjAeNAlCCmg0f53g6ih3jATyCKftTfw==", + "license": "MIT", "dependencies": { - "base-x": "^4.0.0" + "base-x": "^5.0.0" } }, "node_modules/bs58check": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-3.0.1.tgz", - "integrity": "sha512-hjuuJvoWEybo7Hn/0xOrczQKKEKD63WguEjlhLExYs2wUBcebDC1jDNK17eEAD2lYfw82d5ASC1d7K3SWszjaQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-4.0.0.tgz", + "integrity": "sha512-FsGDOnFg9aVI9erdriULkd/JjEWONV/lQE5aYziB5PoBsXRind56lh8doIZIc9X4HoxT5x4bLjMWN1/NB8Zp5g==", + "license": "MIT", "dependencies": { "@noble/hashes": "^1.2.0", - "bs58": "^5.0.0" + "bs58": "^6.0.0" } }, "node_modules/bser": { @@ -5684,6 +5592,7 @@ "url": "https://feross.org/support" } ], + "license": "MIT", "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -5730,6 +5639,7 @@ "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, "dependencies": { "function-bind": "^1.1.1", "get-intrinsic": "^1.0.2" @@ -6197,11 +6107,6 @@ "node": ">= 8" } }, - "node_modules/crypto-js": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/crypto-js/-/crypto-js-4.2.0.tgz", - "integrity": "sha512-KALDyEYgpY+Rlob/iriUtjV6d5Eq+Y191A5g4UqLAi8CyGP9N1+FdVbkc1SxKc2r4YAYqG8JzO2KGL+AizD70Q==" - }, "node_modules/cssesc": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/cssesc/-/cssesc-3.0.0.tgz", @@ -6736,8 +6641,7 @@ "node_modules/decimal.js": { "version": "10.4.3", "resolved": "https://registry.npmjs.org/decimal.js/-/decimal.js-10.4.3.tgz", - "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==", - "dev": true + "integrity": "sha512-VBBaLc1MgL5XpzgIP7ny5Z6Nx3UrRkIViUkPUdtl9aya5amy3De1gsUUSB1g3+3sExYNjCAsAznmukyxCb1GRA==" }, "node_modules/dedent": { "version": "0.7.0", @@ -7908,10 +7812,18 @@ "integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==", "dev": true }, + "node_modules/eventemitter3": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-5.0.1.tgz", + "integrity": "sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==", + "license": "MIT" + }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "dev": true, + "peer": true, "engines": { "node": ">=0.8.x" } @@ -8206,6 +8118,7 @@ "version": "0.3.3", "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", + "dev": true, "dependencies": { "is-callable": "^1.1.3" } @@ -8346,6 +8259,7 @@ "version": "1.2.1", "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.1.tgz", "integrity": "sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==", + "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", @@ -8518,6 +8432,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "dev": true, "dependencies": { "get-intrinsic": "^1.1.3" }, @@ -8602,6 +8517,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -8613,6 +8529,7 @@ "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -8624,6 +8541,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, "dependencies": { "has-symbols": "^1.0.2" }, @@ -8634,15 +8552,6 @@ "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, "node_modules/html-encoding-sniffer": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/html-encoding-sniffer/-/html-encoding-sniffer-3.0.0.tgz", @@ -8898,6 +8807,7 @@ "version": "1.1.1", "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", + "dev": true, "dependencies": { "call-bind": "^1.0.2", "has-tostringtag": "^1.0.0" @@ -8971,6 +8881,7 @@ "version": "1.2.7", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, "engines": { "node": ">= 0.4" }, @@ -9045,20 +8956,6 @@ "node": ">=6" } }, - "node_modules/is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, "node_modules/is-glob": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", @@ -9228,6 +9125,7 @@ "version": "1.1.10", "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", + "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -9307,15 +9205,16 @@ "dev": true }, "node_modules/isows": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.3.tgz", - "integrity": "sha512-2cKei4vlmg2cxEjm3wVSqn8pcoRF/LX/wpifuuNquFO4SQmPwarClT+SUCA2lt+l581tTeZIPIZuIDo2jWN1fg==", + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/isows/-/isows-1.0.6.tgz", + "integrity": "sha512-lPHCayd40oW98/I0uvgaHKWCSvkzY27LjWLbtzOm64yQ+G3Q5npjjbdppU65iZXkK1Zt+kH9pfegli0AYfwYYw==", "funding": [ { "type": "github", - "url": "https://github.com/sponsors/wagmi-dev" + "url": "https://github.com/sponsors/wevm" } ], + "license": "MIT", "peerDependencies": { "ws": "*" } @@ -11441,11 +11340,6 @@ "@sideway/pinpoint": "^2.0.0" } }, - "node_modules/js-base64": { - "version": "3.7.5", - "resolved": "https://registry.npmjs.org/js-base64/-/js-base64-3.7.5.tgz", - "integrity": "sha512-3MEt5DTINKqfScXKfJFrRbxkrnk2AxPWGBL/ycjz4dK8iqiSJ06UxD8jh8xuh6p10TX4t2+7FsBYVxxQbMg+qA==" - }, "node_modules/js-sdsl": { "version": "4.4.0", "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", @@ -11948,8 +11842,7 @@ "node_modules/lodash.isequal": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", - "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==", - "dev": true + "integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==" }, "node_modules/lodash.isfunction": { "version": "3.0.9", @@ -12349,11 +12242,6 @@ "node": ">=15.14.0" } }, - "node_modules/minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" - }, "node_modules/minimatch": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", @@ -12752,6 +12640,35 @@ "integrity": "sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==", "dev": true }, + "node_modules/ox": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ox/-/ox-0.1.2.tgz", + "integrity": "sha512-ak/8K0Rtphg9vnRJlbOdaX9R7cmxD2MiSthjWGaQdMk3D7hrAlDoM+6Lxn7hN52Za3vrXfZ7enfke/5WjolDww==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wevm" + } + ], + "license": "MIT", + "dependencies": { + "@adraffy/ens-normalize": "^1.10.1", + "@noble/curves": "^1.6.0", + "@noble/hashes": "^1.5.0", + "@scure/bip32": "^1.5.0", + "@scure/bip39": "^1.4.0", + "abitype": "^1.0.6", + "eventemitter3": "5.0.1" + }, + "peerDependencies": { + "typescript": ">=5.4.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -13917,6 +13834,7 @@ "version": "5.2.1", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, "funding": [ { "type": "github", @@ -13991,6 +13909,12 @@ "url": "https://opencollective.com/webpack" } }, + "node_modules/secure-random": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/secure-random/-/secure-random-1.1.2.tgz", + "integrity": "sha512-H2bdSKERKdBV1SwoqYm6C0y+9EA94v6SUBOWO8kDndc4NoUih7Dv6Tsgma7zO1lv27wIvjlD0ZpMQk7um5dheQ==", + "license": "MIT" + }, "node_modules/semver": { "version": "6.3.1", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz", @@ -14362,14 +14286,6 @@ "duplexer": "~0.1.1" } }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, "node_modules/string-argv": { "version": "0.3.2", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.2.tgz", @@ -14968,9 +14884,10 @@ } }, "node_modules/tslib": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", - "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" + "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/tsutils": { "version": "3.21.0", @@ -15123,15 +15040,16 @@ } }, "node_modules/typescript": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.0.4.tgz", - "integrity": "sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw==", + "version": "5.6.3", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.6.3.tgz", + "integrity": "sha512-hjcS1mhfuyi4WW8IWtjP7brDrG2cuDZukyrYrSauoXGNgx0S7zceP07adYkJycEr56BOUTNPzbInooiN3fn1qw==", + "license": "Apache-2.0", "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" }, "engines": { - "node": ">=12.20" + "node": ">=14.17" } }, "node_modules/uglify-js": { @@ -15147,17 +15065,6 @@ "node": ">=0.8.0" } }, - "node_modules/uid": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/uid/-/uid-2.0.2.tgz", - "integrity": "sha512-u3xV3X7uzvi5b1MncmZo3i2Aw222Zk1keqLA1YkHldREkAhAqi65wuPfe7lHx8H/Wzy+8CE7S7uS3jekIM5s8g==", - "dependencies": { - "@lukeed/csprng": "^1.0.0" - }, - "engines": { - "node": ">=8" - } - }, "node_modules/unbox-primitive": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", @@ -15300,18 +15207,6 @@ "node": ">=6.14.2" } }, - "node_modules/util": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", - "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", - "dependencies": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "which-typed-array": "^1.1.2" - } - }, "node_modules/util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", @@ -15371,24 +15266,26 @@ "dev": true }, "node_modules/viem": { - "version": "1.18.0", - "resolved": "https://registry.npmjs.org/viem/-/viem-1.18.0.tgz", - "integrity": "sha512-NeKi5RFj7fHdsnk5pojivHFLkTyBWyehxeSE/gSPTDJKCWnR9i+Ra0W++VwN5ghciEG55O8b4RdpYhzGmhnr7A==", + "version": "2.21.45", + "resolved": "https://registry.npmjs.org/viem/-/viem-2.21.45.tgz", + "integrity": "sha512-I+On/IiaObQdhDKWU5Rurh6nf3G7reVkAODG5ECIfjsrGQ3EPJnxirUPT4FNV6bWER5iphoG62/TidwuTSOA1A==", "funding": [ { "type": "github", - "url": "https://github.com/sponsors/wagmi-dev" + "url": "https://github.com/sponsors/wevm" } ], + "license": "MIT", "dependencies": { - "@adraffy/ens-normalize": "1.9.4", - "@noble/curves": "1.2.0", - "@noble/hashes": "1.3.2", - "@scure/bip32": "1.3.2", - "@scure/bip39": "1.2.1", - "abitype": "0.9.8", - "isows": "1.0.3", - "ws": "8.13.0" + "@noble/curves": "1.6.0", + "@noble/hashes": "1.5.0", + "@scure/bip32": "1.5.0", + "@scure/bip39": "1.4.0", + "abitype": "1.0.6", + "isows": "1.0.6", + "ox": "0.1.2", + "webauthn-p256": "0.0.10", + "ws": "8.18.0" }, "peerDependencies": { "typescript": ">=5.0.4" @@ -15918,6 +15815,22 @@ "node": ">=10.13.0" } }, + "node_modules/webauthn-p256": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/webauthn-p256/-/webauthn-p256-0.0.10.tgz", + "integrity": "sha512-EeYD+gmIT80YkSIDb2iWq0lq2zbHo1CxHlQTeJ+KkCILWpVy3zASH3ByD4bopzfk0uCwXxLqKGLqp2W4O28VFA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/wevm" + } + ], + "license": "MIT", + "dependencies": { + "@noble/curves": "^1.4.0", + "@noble/hashes": "^1.4.0" + } + }, "node_modules/webidl-conversions": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", @@ -16069,6 +15982,7 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.11.tgz", "integrity": "sha512-qe9UWWpkeG5yzZ0tNYxDmd7vo58HDBc39mZ0xWWpolAGADdFOzkfamWLDxkOWcvHQKVmdTyQdLD4NOfjLWTKew==", + "dev": true, "dependencies": { "available-typed-arrays": "^1.0.5", "call-bind": "^1.0.2", @@ -16167,9 +16081,10 @@ } }, "node_modules/ws": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.13.0.tgz", - "integrity": "sha512-x9vcZYTrFPC7aSIbj7sRCYo7L/Xb8Iy+pW0ng0wt2vCJv7M9HOMy0UoN3rr+IFC7hb7vXoqS+P9ktyLLLhO+LA==", + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "license": "MIT", "engines": { "node": ">=10.0.0" }, diff --git a/web-frontend/package.json b/web-frontend/package.json index e253b4cd3..268f998d7 100644 --- a/web-frontend/package.json +++ b/web-frontend/package.json @@ -30,9 +30,9 @@ "prepare": "cd .. && husky install web-frontend/.husky" }, "dependencies": { - "@massalabs/massa-web3": "^4.0.2-dev", - "@massalabs/react-ui-kit": "^0.0.5-dev", - "@massalabs/wallet-provider": "^2.0.1-dev", + "@massalabs/massa-web3": "^5.0.1-dev", + "@massalabs/react-ui-kit": "^1.0.1-dev", + "@massalabs/wallet-provider": "^3.0.1-dev", "@tanstack/react-query": "^4.29.5", "axios": "^1.6.0", "currency.js": "^2.0.4", diff --git a/web-frontend/src/custom/smart-contract/useFTTransfer.tsx b/web-frontend/src/custom/smart-contract/useFTTransfer.tsx index 555bf44c1..eea83ed5c 100644 --- a/web-frontend/src/custom/smart-contract/useFTTransfer.tsx +++ b/web-frontend/src/custom/smart-contract/useFTTransfer.tsx @@ -1,27 +1,45 @@ -import { useCallback, useState } from 'react'; +import { useCallback } from 'react'; -import { - Client, - EOperationStatus, - ICallData, - MAX_GAS_CALL, - Args, - strToBytes, - STORAGE_BYTE_COST, - fromMAS, -} from '@massalabs/massa-web3'; -import { ToastContent, parseAmount, toast } from '@massalabs/react-ui-kit'; -import { OperationToast } from '@massalabs/react-ui-kit/src/lib/ConnectMassaWallets/components/OperationToast'; -import { logSmartContractEvents } from '@massalabs/react-ui-kit/src/lib/massa-react/utils'; +import { Args, bytes, Mas, Provider, strToBytes } from '@massalabs/massa-web3'; +import { parseAmount, useWriteSmartContract } from '@massalabs/react-ui-kit'; -import { usePrepareScCall } from '../usePrepareScCall'; +import { useProvider } from '../useProvider'; import Intl from '@/i18n/i18n'; -import { useMassaWeb3Store } from '@/store/store'; -export function useFTTransfer() { - const { isMainnet } = useMassaWeb3Store(); - const { client } = usePrepareScCall(); +const BALANCE_KEY_PREFIX = 'BALANCE'; + +function balanceKey(address: string): Uint8Array { + return strToBytes(BALANCE_KEY_PREFIX + address); +} + +async function estimateCoinsCost( + provider: Provider, + tokenAddress: string, + recipient: string, +): Promise { + const allKeys = await provider.getStorageKeys( + tokenAddress, + BALANCE_KEY_PREFIX, + ); + const key = balanceKey(recipient); + const foundKey = allKeys.some((k) => { + return JSON.stringify(k) === JSON.stringify(key); + }); + + if (foundKey) { + return 0n; + } + const storage = + 4 + // space of a key/value in the datastore + key.length + // key length + 32; // length of the value of the balance + + return bytes(storage); +} + +export function useFTTransfer() { + const { provider, isMainnet } = useProvider(); const { opId, isPending, @@ -29,39 +47,37 @@ export function useFTTransfer() { isSuccess, isError, callSmartContract, - } = useWriteSmartContract(client, isMainnet); + } = useWriteSmartContract(provider!, isMainnet); const transfer = useCallback( - ( + async ( recipient: string, tokenAddress: string, amount: string, decimals: number, fees: string, ) => { - if (!client) { - throw new Error('Massa client not found'); + if (!callSmartContract || !provider) { + return; } - const rawAmount = parseAmount(amount, decimals); const args = new Args().addString(recipient).addU256(rawAmount); - - estimateCoinsCost(client, tokenAddress, recipient).then((coins) => { - callSmartContract( - 'transfer', - tokenAddress, - args.serialize(), - { - pending: Intl.t('send-coins.steps.ft-transfer-pending'), - success: Intl.t('send-coins.steps.ft-transfer-success'), - error: Intl.t('send-coins.steps.ft-transfer-failed'), - }, - coins, - fees, - ); - }); + const coins = await estimateCoinsCost(provider, tokenAddress, recipient); + + await callSmartContract( + 'transfer', + tokenAddress, + args.serialize(), + { + pending: Intl.t('send-coins.steps.ft-transfer-pending'), + success: Intl.t('send-coins.steps.ft-transfer-success'), + error: Intl.t('send-coins.steps.ft-transfer-failed'), + }, + coins, + Mas.fromString(fees), + ); }, - [client, callSmartContract], + [provider, callSmartContract], ); return { @@ -74,190 +90,3 @@ export function useFTTransfer() { isMainnet, }; } - -interface ToasterMessage { - pending: string; - success: string; - error: string; - timeout?: string; -} - -function minBigInt(a: bigint, b: bigint) { - return a < b ? a : b; -} - -function useWriteSmartContract(client?: Client, isMainnet?: boolean) { - const [isPending, setIsPending] = useState(false); - const [isOpPending, setIsOpPending] = useState(false); - const [isSuccess, setIsSuccess] = useState(false); - const [isError, setIsError] = useState(false); - const [opId, setOpId] = useState(undefined); - - function callSmartContract( - targetFunction: string, - targetAddress: string, - parameter: number[], - messages: ToasterMessage, - coins = BigInt(0), - fees: string, - ) { - if (!client) { - throw new Error('Massa client not found'); - } - if (isOpPending) { - throw new Error('Operation is already pending'); - } - setIsSuccess(false); - setIsError(false); - setIsOpPending(false); - setIsPending(true); - let operationId: string | undefined; - let toastId: string | undefined; - - const callData = { - targetAddress, - targetFunction, - parameter, - coins, - fee: fromMAS(fees), - } as ICallData; - - client - .smartContracts() - .readSmartContract({ - ...callData, - callerAddress: client.wallet().getBaseAccount()?.address(), - }) - .then((response) => { - const gasCost = BigInt(response.info.gas_cost); - return minBigInt(gasCost + (gasCost * 20n) / 100n, MAX_GAS_CALL); - }) - .then((maxGas: bigint) => { - callData.maxGas = maxGas; - return client.smartContracts().callSmartContract(callData); - }) - .then((opId) => { - operationId = opId; - setOpId(operationId); - setIsOpPending(true); - toastId = toast.loading( - (t) => ( - - - - ), - { - duration: Infinity, - }, - ); - return client - .smartContracts() - .awaitMultipleRequiredOperationStatus(operationId, [ - EOperationStatus.SPECULATIVE_ERROR, - EOperationStatus.SPECULATIVE_SUCCESS, - ]); - }) - .then((status: EOperationStatus) => { - if (status !== EOperationStatus.SPECULATIVE_SUCCESS) { - throw new Error('Operation failed', { cause: { status } }); - } - setIsSuccess(true); - setIsOpPending(false); - setIsPending(false); - toast.dismiss(toastId); - toast.success((t) => ( - - - - )); - }) - .catch((error) => { - console.error(error); - toast.dismiss(toastId); - setIsError(true); - setIsOpPending(false); - setIsPending(false); - - if (!operationId) { - console.error('Operation ID not found'); - toast.error((t) => ( - - - - )); - return; - } - - if (error.cause?.status === EOperationStatus.SPECULATIVE_ERROR) { - toast.error((t) => ( - - - - )); - logSmartContractEvents(client, operationId); - } else { - toast.error((t) => ( - - - - )); - } - }); - } - - return { - opId, - isOpPending, - isPending, - isSuccess, - isError, - callSmartContract, - }; -} -async function estimateCoinsCost( - client: Client, - tokenAddress: string, - recipient: string, -): Promise { - const addrInfo = await client.publicApi().getAddresses([tokenAddress]); - const allKeys = addrInfo[0].candidate_datastore_keys; - const key = balanceKey(recipient); - const foundKey = allKeys.find((k) => { - return JSON.stringify(k) === JSON.stringify(key); - }); - - if (foundKey) { - return 0n; - } - - const storage = - 4n + // space of a key/value in the datastore - BigInt(key.length) + // key length - 32n; // length of the value of the balance - - return STORAGE_BYTE_COST * storage; -} - -function balanceKey(address: string): number[] { - const BALANCE_KEY_PREFIX = 'BALANCE'; - - return Array.from(strToBytes(BALANCE_KEY_PREFIX + address)); -} diff --git a/web-frontend/src/custom/useMNS.tsx b/web-frontend/src/custom/useMNS.tsx index d51a3a483..ac758fa78 100644 --- a/web-frontend/src/custom/useMNS.tsx +++ b/web-frontend/src/custom/useMNS.tsx @@ -1,31 +1,34 @@ import { useCallback, useState } from 'react'; -import { Args } from '@massalabs/massa-web3'; -import { bytesToStr } from '@massalabs/web3-utils'; +import { Args, bytesToStr, SmartContract } from '@massalabs/massa-web3'; -import { useMassaWeb3Store } from '@/store/store'; +import { useProvider } from './useProvider'; import { contracts } from '@/utils/const'; export function useMNS() { - const { defaultClient: client, isMainnet } = useMassaWeb3Store(); - const [targetMnsAddress, setTargetMnsAddress] = useState(''); const [domainNameList, setDomainNameList] = useState([]); + const { provider, isMainnet } = useProvider(); + const targetContractAddress = isMainnet ? contracts.mainnet.mnsContract : contracts.buildnet.mnsContract; const reverseResolveDns = useCallback( async (targetAddress: string) => { - if (!client || !targetAddress) return; + if (!provider) { + return; + } try { - const result = await client.smartContracts().readSmartContract({ - targetAddress: targetContractAddress, - targetFunction: 'dnsReverseResolve', - parameter: new Args().addString(targetAddress).serialize(), - }); - const domains = bytesToStr(result.returnValue).split(','); + const mnsContract = new SmartContract(provider, targetContractAddress); + const res = await mnsContract.read( + 'dnsReverseResolve', + new Args().addString(targetAddress), + ); + const domains = bytesToStr(res.value) + .split(',') + .filter((d) => !!d.length); setDomainNameList(domains); return domains; @@ -34,35 +37,35 @@ export function useMNS() { console.error(e); } }, - [client, targetContractAddress], + [provider, targetContractAddress], ); const resolveDns = useCallback( async (domain: string): Promise => { + if (!provider) { + return; + } try { - if (!client) return; - const result = await client.smartContracts().readSmartContract({ - targetAddress: targetContractAddress, - targetFunction: 'dnsResolve', - parameter: new Args().addString(domain).serialize(), - }); + const mnsContract = new SmartContract(provider, targetContractAddress); - const targetAddress = bytesToStr(result.returnValue); - setTargetMnsAddress(bytesToStr(result.returnValue)); + const res = await mnsContract.read( + 'dnsResolve', + new Args().addString(domain), + ); + const targetAddress = bytesToStr(res.value); + setTargetMnsAddress(targetAddress); return targetAddress; } catch (e) { console.error(e); setTargetMnsAddress(''); - return ''; } }, - [client, targetContractAddress], + [provider, targetContractAddress], ); - function resetTargetMnsAddress() { + const resetTargetMnsAddress = useCallback(() => { setTargetMnsAddress(''); - } - + }, []); const resetDomainList = useCallback(() => { setDomainNameList([]); }, []); diff --git a/web-frontend/src/custom/usePrepareScCall.tsx b/web-frontend/src/custom/usePrepareScCall.tsx deleted file mode 100644 index ffa6a74ed..000000000 --- a/web-frontend/src/custom/usePrepareScCall.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import { useEffect, useState } from 'react'; - -import { Client } from '@massalabs/massa-web3'; -import { useParams } from 'react-router-dom'; - -import { prepareSCCall } from '@/utils/prepareSCCall'; - -export function usePrepareScCall() { - const { nickname } = useParams(); - const [client, setClient] = useState(); - - useEffect(() => { - if (!nickname) { - throw new Error('Nickname not found'); - } - prepareSCCall(nickname).then((result) => { - setClient(result?.client); - }); - }, [nickname, setClient]); - - return { client }; -} diff --git a/web-frontend/src/custom/useProvider.tsx b/web-frontend/src/custom/useProvider.tsx new file mode 100644 index 000000000..237a69cf9 --- /dev/null +++ b/web-frontend/src/custom/useProvider.tsx @@ -0,0 +1,38 @@ +import { useEffect, useState } from 'react'; + +import { CHAIN_ID, Provider } from '@massalabs/massa-web3'; +import { getWallet, WalletName } from '@massalabs/wallet-provider'; +import { useParams } from 'react-router-dom'; + +export function useProvider() { + const { nickname } = useParams(); + const [provider, setProvider] = useState(); + const [isMainnet, setIsMainnet] = useState(); + + useEffect(() => { + getWallet(WalletName.MassaStation).then((wallet) => { + if (!wallet) { + return; + } + + wallet.networkInfos().then((network) => { + const isMainnet = network.chainId === CHAIN_ID.Mainnet; + setIsMainnet(isMainnet); + }); + + if (nickname) { + wallet.accounts().then((accounts) => { + const provider = accounts.find((a) => a.accountName === nickname); + setProvider(provider); + }); + } + + wallet.listenNetworkChanges((network) => { + const isMainnet = network.chainId === CHAIN_ID.Mainnet; + setIsMainnet(isMainnet); + }); + }); + }, [nickname, setProvider, setIsMainnet]); + + return { provider, isMainnet }; +} diff --git a/web-frontend/src/mirage/handlers/index.ts b/web-frontend/src/mirage/handlers/index.ts index 09e6a34a8..4f58682ff 100644 --- a/web-frontend/src/mirage/handlers/index.ts +++ b/web-frontend/src/mirage/handlers/index.ts @@ -188,6 +188,87 @@ const otherDomainHandlers = (server: Server) => { }; } + if (method === 'get_status') { + return { + jsonrpc: '2.0', + result: { + node_id: 'N12sNdL7YwSawpnJrk9XCWDjKbgfNamAobp62AX5qfkgpBkGh2wC', + node_ip: '149.202.84.39', + version: 'DEVN.28.3', + current_time: 1732005865705, + current_cycle: 13533, + current_cycle_time: 1732005384000, + next_cycle_time: 1732007432000, + connected_nodes: { + N1DZb3ao8BEtdsYP1KYyWacpTENHDrQboxGaYDL4U8MQppaxvzo: [ + '::ffff:149.202.65.130', + false, + ], + N1NnuSW48GKGaYZamAVKXfXbbnt3StxWoHpYtBZSJvY9e8U1BTC: [ + '37.187.156.118', + true, + ], + N1kKfgrCveVnosUkxTzaBw5cf9f2cbTvK3R5Ssb2Pf76au8xwmH: [ + '149.202.84.7', + true, + ], + }, + last_slot: { + period: 1732254, + thread: 3, + }, + next_slot: { + period: 1732254, + thread: 4, + }, + consensus_stats: { + start_timespan: 1732005805705, + end_timespan: 1732005865705, + final_block_count: 120, + stale_block_count: 0, + clique_count: 1, + }, + pool_stats: [0, 0], + network_stats: { + in_connection_count: 1, + out_connection_count: 2, + known_peer_count: 9, + banned_peer_count: 0, + active_node_count: 3, + }, + execution_stats: { + time_window_start: 1732005805705, + time_window_end: 1732005865705, + final_block_count: 120, + final_executed_operations_count: 3, + active_cursor: { + period: 1732253, + thread: 31, + }, + final_cursor: { + period: 1732252, + thread: 2, + }, + }, + config: { + genesis_timestamp: 1704289800000, + end_timestamp: null, + thread_count: 32, + t0: 16000, + delta_f0: 1088, + operation_validity_periods: 10, + periods_per_cycle: 128, + block_reward: '1.02', + roll_price: '100', + max_block_size: 300000, + }, + chain_id: 77658366, + minimal_fees: '0.01', + }, + id: 0, + }; + } + return { jsonrpc: '2.0', result: [], diff --git a/web-frontend/src/pages/Home/Home.tsx b/web-frontend/src/pages/Home/Home.tsx index 36efd1f83..a41bf6968 100644 --- a/web-frontend/src/pages/Home/Home.tsx +++ b/web-frontend/src/pages/Home/Home.tsx @@ -30,12 +30,14 @@ export default function Home() { } = useResource(`accounts/${nickname}`); const { reverseResolveDns, domainNameList, resetDomainList } = useMNS(); - const accountAddress = account?.address ?? ''; + const accountAddress = account?.address; useEffect(() => { - resetDomainList(); - reverseResolveDns(accountAddress); - }, [reverseResolveDns, accountAddress, resetDomainList]); + if (!isLoading && accountAddress) { + resetDomainList(); + reverseResolveDns(accountAddress); + } + }, [reverseResolveDns, accountAddress, resetDomainList, isLoading]); useEffect(() => { if (error) { @@ -46,8 +48,7 @@ export default function Home() { }, [account, navigate, error, isLoading]); const unformattedBalance = account?.candidateBalance ?? '0'; - const balance = parseInt(unformattedBalance); - const formattedBalance = formatAmount(balance.toString()).preview; + const formattedBalance = formatAmount(unformattedBalance).preview; return ( @@ -91,17 +92,19 @@ export default function Home() {

{Intl.t('home.title-account-address')}

-
- + -
+ /> + + )} - {domainNameList.length > 0 && ( + {domainNameList && domainNameList.length > 0 && (

diff --git a/web-frontend/src/pages/TransferCoins/SendCoins/SendCoins.tsx b/web-frontend/src/pages/TransferCoins/SendCoins/SendCoins.tsx index ba2f16ce7..1e5fff220 100644 --- a/web-frontend/src/pages/TransferCoins/SendCoins/SendCoins.tsx +++ b/web-frontend/src/pages/TransferCoins/SendCoins/SendCoins.tsx @@ -1,6 +1,6 @@ import { useState, useEffect } from 'react'; -import { fromMAS } from '@massalabs/massa-web3'; +import { Mas } from '@massalabs/massa-web3'; import { toast } from '@massalabs/react-ui-kit'; import { maskAddress } from '@massalabs/react-ui-kit/src/lib/massa-react/utils'; import { useNavigate, useParams } from 'react-router-dom'; @@ -92,6 +92,9 @@ export default function SendCoins(props: SendCoinsProps) { setSubmit(false); } else if (data) { if (data.asset.symbol !== MAS && data.asset.address) { + if (!transferFT) { + return; + } transferFT( data.recipientAddress, data.asset.address, @@ -102,9 +105,9 @@ export default function SendCoins(props: SendCoinsProps) { } else { setErrorToastId(null); transferMAS({ - fee: fromMAS(data.fees).toString(), + fee: Mas.fromString(data.fees).toString(), recipientAddress: data.recipientAddress, - amount: fromMAS(data.amount).toString(), + amount: Mas.fromString(data.amount).toString(), }); } } @@ -118,7 +121,7 @@ export default function SendCoins(props: SendCoinsProps) { ) : ( balance) { + if (Mas.fromString(amount) + Mas.fromString(fees) > balance) { setError({ amount: Intl.t('errors.send-coins.amount-plus-fees-to-high'), }); @@ -153,6 +156,9 @@ export function SendForm(props: SendFormProps) { }; } else { setMnsAddressCorrelation(false); + if (!resetTargetMnsAddress) { + return; + } resetTargetMnsAddress(); } @@ -180,11 +186,17 @@ export function SendForm(props: SendFormProps) { setError((error) => ({ ...error, recipient: '' })); if (value !== '' && mnsExtensionRegex.test(value)) { const inputMns = value.replace(mnsExtension, ''); + if (!resolveDns) { + return; + } const targetAddress = await resolveDns(inputMns); if (targetAddress && checkAddressFormat(targetAddress)) { setMnsAddressCorrelation(true); } else { setMnsAddressCorrelation(false); + if (!resetTargetMnsAddress) { + return; + } resetTargetMnsAddress(); } } @@ -221,7 +233,7 @@ export function SendForm(props: SendFormProps) { handlePercent( balance, 25n, - fromMAS(fees), + Mas.fromString(fees), balance, selectedAsset?.decimals || 9, selectedAsset?.symbol || '', @@ -239,7 +251,7 @@ export function SendForm(props: SendFormProps) { handlePercent( balance, 50n, - fromMAS(fees), + Mas.fromString(fees), balance, selectedAsset?.decimals || 9, selectedAsset?.symbol || '', @@ -257,7 +269,7 @@ export function SendForm(props: SendFormProps) { handlePercent( balance, 75n, - fromMAS(fees), + Mas.fromString(fees), balance, selectedAsset?.decimals || 9, selectedAsset?.symbol || '', @@ -275,7 +287,7 @@ export function SendForm(props: SendFormProps) { handlePercent( balance, 100n, - fromMAS(fees), + Mas.fromString(fees), balance, selectedAsset?.decimals || 9, selectedAsset?.symbol || '', @@ -315,7 +327,7 @@ export function SendForm(props: SendFormProps) { mnsAddressCorrelation ? Intl.t('send-coins.mns.mns-correlation', { mns: recipient, - address: targetMnsAddress, + address: targetMnsAddress ?? '', }) : '' } diff --git a/web-frontend/src/store/massaWeb3Store.ts b/web-frontend/src/store/massaWeb3Store.ts deleted file mode 100644 index 2e1cc35e8..000000000 --- a/web-frontend/src/store/massaWeb3Store.ts +++ /dev/null @@ -1,69 +0,0 @@ -import { - BUILDNET, - CHAIN_ID, - Client, - ClientFactory, - DefaultProviderUrls, - MAINNET, - MAINNET_CHAIN_ID, -} from '@massalabs/massa-web3'; -import { providers } from '@massalabs/wallet-provider'; -import { MASSA_STATION_PROVIDER_NAME } from '@massalabs/wallet-provider/dist/esm/massaStation/MassaStationProvider'; - -export interface MassaWeb3StoreState { - defaultClient: Client | undefined; - setDefaultClient: (client: Client | undefined) => void; - - isMainnet: boolean | undefined; - setMainnet: (isMainnet: boolean) => void; - - initMassaDefaultClient: () => void; - initNetwork: () => void; -} - -export const massaWeb3Store = ( - set: (params: Partial) => void, - get: () => MassaWeb3StoreState, -) => ({ - defaultClient: undefined, - setDefaultClient: (publicClient: Client | undefined) => { - set({ defaultClient: publicClient }); - }, - - isMainnet: undefined, - setMainnet: (isMainnet: boolean) => { - set({ isMainnet }); - }, - - initMassaDefaultClient: async () => { - const isMainnet = get().isMainnet; - const massaClient = await ClientFactory.createDefaultClient( - isMainnet ? DefaultProviderUrls.MAINNET : DefaultProviderUrls.BUILDNET, - isMainnet ? CHAIN_ID[MAINNET] : CHAIN_ID[BUILDNET], - ); - - set({ defaultClient: massaClient }); - }, - - initNetwork: async () => { - try { - const massaProvider = (await providers())?.find( - (p) => p.name() === MASSA_STATION_PROVIDER_NAME, - ); - if (!massaProvider) { - throw new Error('FATAL: Massa provider not found'); - } - - const chainId = await massaProvider.getChainId(); - - massaProvider.listenNetworkChanges((network) => { - set({ isMainnet: network === MAINNET.toLowerCase() }); - get().initMassaDefaultClient(); - }); - - set({ isMainnet: chainId === MAINNET_CHAIN_ID }); - } catch (e) { - console.error('Error initializing Massa provider', e); - } - }, -}); diff --git a/web-frontend/src/store/store.ts b/web-frontend/src/store/store.ts index cf23b4cdd..053272fbf 100644 --- a/web-frontend/src/store/store.ts +++ b/web-frontend/src/store/store.ts @@ -1,18 +1,7 @@ import { create } from 'zustand'; import { AppStoreState, appStore } from './appStore'; -import { MassaWeb3StoreState, massaWeb3Store } from './massaWeb3Store'; export const useAppStore = create((set) => ({ ...appStore(set), })); - -export const useMassaWeb3Store = create((set, get) => ({ - ...massaWeb3Store(set, get), -})); - -function initStores() { - useMassaWeb3Store.getState().initNetwork(); -} - -initStores(); diff --git a/web-frontend/src/utils/massaFormat.tsx b/web-frontend/src/utils/massaFormat.tsx index 77741b90b..a8258da4a 100644 --- a/web-frontend/src/utils/massaFormat.tsx +++ b/web-frontend/src/utils/massaFormat.tsx @@ -8,8 +8,7 @@ import { Address } from '@massalabs/massa-web3/'; export function checkAddressFormat(recipient: string): boolean { try { - // eslint-disable-next-line no-new - new Address(recipient); + Address.fromString(recipient); } catch (error) { return false; } diff --git a/web-frontend/src/utils/prepareSCCall.ts b/web-frontend/src/utils/prepareSCCall.ts deleted file mode 100644 index 072294a30..000000000 --- a/web-frontend/src/utils/prepareSCCall.ts +++ /dev/null @@ -1,23 +0,0 @@ -import { ClientFactory } from '@massalabs/massa-web3'; -import { providers } from '@massalabs/wallet-provider'; - -export async function prepareSCCall(nickname: string) { - const massaProvider = (await providers())?.find( - (p) => p.name() === 'MASSASTATION', - ); - if (!massaProvider) { - console.error('FATAL: Massa provider not found'); - return; - } - - const account = (await massaProvider.accounts()).find( - (a) => a.name() === nickname, - ); - if (!account) { - return; - } - - return { - client: await ClientFactory.fromWalletProvider(massaProvider, account), - }; -}