diff --git a/README.md b/README.md index a624328..6636d2a 100644 --- a/README.md +++ b/README.md @@ -5,15 +5,17 @@ An open source Jetton deployer webapp, based on [jetton contracts starter templa ## How to use Instructions: -Make sure you have a TON wallet with at least 0.25 TON balance. Supported wallets include TonHub and Chrome Extension. +Make sure you have a TON wallet with at least 0.25 TON balance. Use your web browser to open the site of the deploy form: https://minter.ton.org +To use the Testnet version open this link: https://minter.ton.org?testnet=true + > Safety Notice: The form is based on this repo and served from GitHub Pages Click the "Connect Wallet" button to connect your wallet. -Fill in the information about your Jetton in the form - choose a name, ticker and image URI. +Fill in the information about your Jetton in the form - choose a name, ticker and image URL. Deploy and approve the deploy transaction in your wallet. diff --git a/package-lock.json b/package-lock.json index b994a0f..4dff1e5 100644 --- a/package-lock.json +++ b/package-lock.json @@ -18,7 +18,7 @@ "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^13.3.0", "@testing-library/user-event": "^13.5.0", - "@tonconnect/ui-react": "^1.0.0-beta.6", + "@tonconnect/ui-react": "^2.0.11", "@types/jest": "^27.5.1", "@types/node": "^16.11.36", "@types/react": "^18.0.9", @@ -4195,56 +4195,58 @@ } }, "node_modules/@tonconnect/isomorphic-eventsource": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@tonconnect/isomorphic-eventsource/-/isomorphic-eventsource-0.0.1.tgz", - "integrity": "sha512-ODk48pMlqLSOvu3fM0R1sdlz/Cv2y4hSfwtXmLq9ky9+H7ZQfw/16ElpIJ69B4lUvHycxrueNgrRtF9PJHoGMw==", + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@tonconnect/isomorphic-eventsource/-/isomorphic-eventsource-0.0.2.tgz", + "integrity": "sha512-B4UoIjPi0QkvIzZH5fV3BQLWrqSYABdrzZQSI9sJA9aA+iC0ohOzFwVVGXanlxeDAy1bcvPbb29f6sVUk0UnnQ==", "dependencies": { "eventsource": "^2.0.2" } }, "node_modules/@tonconnect/isomorphic-fetch": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@tonconnect/isomorphic-fetch/-/isomorphic-fetch-0.0.2.tgz", - "integrity": "sha512-DAyA4oL7MqbBo9k8+8E+YiWsGCYi6UMhDTcsZjhgzhESkBNG6b+NBkpb1KH4oi0xDZQoknFtY9XogJLuQtSMQQ==", + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@tonconnect/isomorphic-fetch/-/isomorphic-fetch-0.0.3.tgz", + "integrity": "sha512-jIg5nTrDwnite4fXao3dD83eCpTvInTjZon/rZZrIftIegh4XxyVb5G2mpMqXrVGk1e8SVXm3Kj5OtfMplQs0w==", "dependencies": { "node-fetch": "^2.6.9" } }, "node_modules/@tonconnect/protocol": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@tonconnect/protocol/-/protocol-2.2.5.tgz", - "integrity": "sha512-kR0E+CWZl6JrE/30283v+sRiAvEu21t1xOLFx6f/BxlCNLY2wki39+L32+iicX8gn/Ig99L1flr9TAI9QW9bnQ==", + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/@tonconnect/protocol/-/protocol-2.2.6.tgz", + "integrity": "sha512-kyoDz5EqgsycYP+A+JbVsAUYHNT059BCrK+m0pqxykMODwpziuSAXfwAZmHcg8v7NB9VKYbdFY55xKeXOuEd0w==", "dependencies": { "tweetnacl": "^1.0.3", "tweetnacl-util": "^0.15.1" } }, "node_modules/@tonconnect/sdk": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@tonconnect/sdk/-/sdk-2.1.3.tgz", - "integrity": "sha512-LxHJr96NvGTqj4qSKYPPS/7fMlUpHNyj5bCNlzY5xMW8JmdgPj+jXxm5wEI00xBWy478dbE9ZaBhLMLH1V2wZw==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@tonconnect/sdk/-/sdk-3.0.6.tgz", + "integrity": "sha512-dJipe0Cw43p/7o3Pa6Y6h0QMDtY2V2YKzwdCqcYvmyCYadBNmvA+8ScH9QK5GpkngRJnYaWq+321lAaQTFpUwA==", "dependencies": { - "@tonconnect/isomorphic-eventsource": "^0.0.1", - "@tonconnect/isomorphic-fetch": "^0.0.2", - "@tonconnect/protocol": "^2.2.5" + "@tonconnect/isomorphic-eventsource": "^0.0.2", + "@tonconnect/isomorphic-fetch": "^0.0.3", + "@tonconnect/protocol": "^2.2.6" } }, "node_modules/@tonconnect/ui": { - "version": "1.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@tonconnect/ui/-/ui-1.0.0-beta.5.tgz", - "integrity": "sha512-F1Z/GAsuebvmMSS5SkY90DyIYogUYNx+b7I8A2LF8nbwDVA0ImsN6oOiOl5PzOhBlNZru8LXJuUUfqgDv1ZHuw==", + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@tonconnect/ui/-/ui-2.0.11.tgz", + "integrity": "sha512-5TOhfEDeyY8R9oyEGavLU+DRmDW3wSGyxVshWhHisi8597cZIuG39HHNbP05WJBBjmVm/Kh/bhcHtfx7lQp/Ig==", "dependencies": { - "@tonconnect/sdk": "^2.1.3", + "@tonconnect/sdk": "3.0.6", "classnames": "^2.3.2", - "deepmerge": "^4.2.2" + "csstype": "^3.1.1", + "deepmerge": "^4.2.2", + "ua-parser-js": "^1.0.35" } }, "node_modules/@tonconnect/ui-react": { - "version": "1.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@tonconnect/ui-react/-/ui-react-1.0.0-beta.6.tgz", - "integrity": "sha512-j4ziq+5JHmAI74XXodjIomqvLKEwfomJ4mv1LulYWs7izNBDwlpzIW/Un0UzsGZq9fjnuJ/A2Xb9M30j9ucOEg==", + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@tonconnect/ui-react/-/ui-react-2.0.11.tgz", + "integrity": "sha512-h8E4zlbdNBJCAPgg6+O5ZkVDZh8mvnc82VRmhInSPLFAr6qDZbE+qSjRVm4lkuN1N/m24lhkDXFCFjvJ9CgCow==", "dependencies": { - "@tonconnect/ui": "^1.0.0-beta.5" + "@tonconnect/ui": "2.0.11" }, "peerDependencies": { "react": ">=17.0.0", @@ -6483,9 +6485,9 @@ } }, "node_modules/classnames": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", - "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==" }, "node_modules/clean-css": { "version": "5.3.0", @@ -7267,9 +7269,9 @@ "integrity": "sha512-b0tGHbfegbhPJpxpiBPU2sCkigAqtM9O121le6bbOlgyV+NyGyCmVfJ6QW9eRjz8CpNfWEOYBIMIGRYkLwsIYg==" }, "node_modules/csstype": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.0.tgz", - "integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "node_modules/customize-cra": { "version": "1.0.0", @@ -19286,9 +19288,9 @@ } }, "node_modules/ua-parser-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.2.tgz", - "integrity": "sha512-00y/AXhx0/SsnI51fTc0rLRmafiGOM4/O+ny10Ps7f+j/b8p/ZY11ytMgznXkOVo4GQ+KwQG5UQLkLGirsACRg==", + "version": "1.0.40", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.40.tgz", + "integrity": "sha512-z6PJ8Lml+v3ichVojCiB8toQJBuwR42ySM4ezjXIqXK3M0HczmKQ3LF4rhU55PfD99KEEXQG6yb7iOMyvYuHew==", "funding": [ { "type": "opencollective", @@ -19297,8 +19299,15 @@ { "type": "paypal", "url": "https://paypal.me/faisalman" + }, + { + "type": "github", + "url": "https://github.com/sponsors/faisalman" } ], + "bin": { + "ua-parser-js": "script/cli.js" + }, "engines": { "node": "*" } @@ -23377,56 +23386,58 @@ } }, "@tonconnect/isomorphic-eventsource": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/@tonconnect/isomorphic-eventsource/-/isomorphic-eventsource-0.0.1.tgz", - "integrity": "sha512-ODk48pMlqLSOvu3fM0R1sdlz/Cv2y4hSfwtXmLq9ky9+H7ZQfw/16ElpIJ69B4lUvHycxrueNgrRtF9PJHoGMw==", + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@tonconnect/isomorphic-eventsource/-/isomorphic-eventsource-0.0.2.tgz", + "integrity": "sha512-B4UoIjPi0QkvIzZH5fV3BQLWrqSYABdrzZQSI9sJA9aA+iC0ohOzFwVVGXanlxeDAy1bcvPbb29f6sVUk0UnnQ==", "requires": { "eventsource": "^2.0.2" } }, "@tonconnect/isomorphic-fetch": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/@tonconnect/isomorphic-fetch/-/isomorphic-fetch-0.0.2.tgz", - "integrity": "sha512-DAyA4oL7MqbBo9k8+8E+YiWsGCYi6UMhDTcsZjhgzhESkBNG6b+NBkpb1KH4oi0xDZQoknFtY9XogJLuQtSMQQ==", + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/@tonconnect/isomorphic-fetch/-/isomorphic-fetch-0.0.3.tgz", + "integrity": "sha512-jIg5nTrDwnite4fXao3dD83eCpTvInTjZon/rZZrIftIegh4XxyVb5G2mpMqXrVGk1e8SVXm3Kj5OtfMplQs0w==", "requires": { "node-fetch": "^2.6.9" } }, "@tonconnect/protocol": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@tonconnect/protocol/-/protocol-2.2.5.tgz", - "integrity": "sha512-kR0E+CWZl6JrE/30283v+sRiAvEu21t1xOLFx6f/BxlCNLY2wki39+L32+iicX8gn/Ig99L1flr9TAI9QW9bnQ==", + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/@tonconnect/protocol/-/protocol-2.2.6.tgz", + "integrity": "sha512-kyoDz5EqgsycYP+A+JbVsAUYHNT059BCrK+m0pqxykMODwpziuSAXfwAZmHcg8v7NB9VKYbdFY55xKeXOuEd0w==", "requires": { "tweetnacl": "^1.0.3", "tweetnacl-util": "^0.15.1" } }, "@tonconnect/sdk": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/@tonconnect/sdk/-/sdk-2.1.3.tgz", - "integrity": "sha512-LxHJr96NvGTqj4qSKYPPS/7fMlUpHNyj5bCNlzY5xMW8JmdgPj+jXxm5wEI00xBWy478dbE9ZaBhLMLH1V2wZw==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/@tonconnect/sdk/-/sdk-3.0.6.tgz", + "integrity": "sha512-dJipe0Cw43p/7o3Pa6Y6h0QMDtY2V2YKzwdCqcYvmyCYadBNmvA+8ScH9QK5GpkngRJnYaWq+321lAaQTFpUwA==", "requires": { - "@tonconnect/isomorphic-eventsource": "^0.0.1", - "@tonconnect/isomorphic-fetch": "^0.0.2", - "@tonconnect/protocol": "^2.2.5" + "@tonconnect/isomorphic-eventsource": "^0.0.2", + "@tonconnect/isomorphic-fetch": "^0.0.3", + "@tonconnect/protocol": "^2.2.6" } }, "@tonconnect/ui": { - "version": "1.0.0-beta.5", - "resolved": "https://registry.npmjs.org/@tonconnect/ui/-/ui-1.0.0-beta.5.tgz", - "integrity": "sha512-F1Z/GAsuebvmMSS5SkY90DyIYogUYNx+b7I8A2LF8nbwDVA0ImsN6oOiOl5PzOhBlNZru8LXJuUUfqgDv1ZHuw==", + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@tonconnect/ui/-/ui-2.0.11.tgz", + "integrity": "sha512-5TOhfEDeyY8R9oyEGavLU+DRmDW3wSGyxVshWhHisi8597cZIuG39HHNbP05WJBBjmVm/Kh/bhcHtfx7lQp/Ig==", "requires": { - "@tonconnect/sdk": "^2.1.3", + "@tonconnect/sdk": "3.0.6", "classnames": "^2.3.2", - "deepmerge": "^4.2.2" + "csstype": "^3.1.1", + "deepmerge": "^4.2.2", + "ua-parser-js": "^1.0.35" } }, "@tonconnect/ui-react": { - "version": "1.0.0-beta.6", - "resolved": "https://registry.npmjs.org/@tonconnect/ui-react/-/ui-react-1.0.0-beta.6.tgz", - "integrity": "sha512-j4ziq+5JHmAI74XXodjIomqvLKEwfomJ4mv1LulYWs7izNBDwlpzIW/Un0UzsGZq9fjnuJ/A2Xb9M30j9ucOEg==", + "version": "2.0.11", + "resolved": "https://registry.npmjs.org/@tonconnect/ui-react/-/ui-react-2.0.11.tgz", + "integrity": "sha512-h8E4zlbdNBJCAPgg6+O5ZkVDZh8mvnc82VRmhInSPLFAr6qDZbE+qSjRVm4lkuN1N/m24lhkDXFCFjvJ9CgCow==", "requires": { - "@tonconnect/ui": "^1.0.0-beta.5" + "@tonconnect/ui": "2.0.11" } }, "@tootallnate/once": { @@ -25150,9 +25161,9 @@ } }, "classnames": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.3.2.tgz", - "integrity": "sha512-CSbhY4cFEJRe6/GQzIk5qXZ4Jeg5pcsP7b5peFSDpffpe1cqjASH/n9UTjBwOp6XpMSTwQ8Za2K5V02ueA7Tmw==" + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/classnames/-/classnames-2.5.1.tgz", + "integrity": "sha512-saHYOzhIQs6wy2sVxTM6bUDsQO4F50V9RQ22qBpEdCW+I+/Wmke2HOl6lS6dTpdxVhb88/I6+Hs+438c3lfUow==" }, "clean-css": { "version": "5.3.0", @@ -25715,9 +25726,9 @@ } }, "csstype": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.0.tgz", - "integrity": "sha512-uX1KG+x9h5hIJsaKR9xHUeUraxf8IODOwq9JLNPq6BwB04a/xgpq3rcx47l5BZu5zBPlgD342tdke3Hom/nJRA==" + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/csstype/-/csstype-3.1.3.tgz", + "integrity": "sha512-M1uQkMl8rQK/szD0LNhtqxIPLpimGm8sOBwU7lLnCpSbTyY3yeU1Vc7l4KT5zT4s/yOxHH5O7tIuuLOCnLADRw==" }, "customize-cra": { "version": "1.0.0", @@ -34279,9 +34290,9 @@ "integrity": "sha512-C0WQT0gezHuw6AdY1M2jxUO83Rjf0HP7Sk1DtXj6j1EwkQNZrHAg2XPWlq62oqEhYvONq5pkC2Y9oPljWToLmQ==" }, "ua-parser-js": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.2.tgz", - "integrity": "sha512-00y/AXhx0/SsnI51fTc0rLRmafiGOM4/O+ny10Ps7f+j/b8p/ZY11ytMgznXkOVo4GQ+KwQG5UQLkLGirsACRg==" + "version": "1.0.40", + "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-1.0.40.tgz", + "integrity": "sha512-z6PJ8Lml+v3ichVojCiB8toQJBuwR42ySM4ezjXIqXK3M0HczmKQ3LF4rhU55PfD99KEEXQG6yb7iOMyvYuHew==" }, "unbox-primitive": { "version": "1.0.2", diff --git a/package.json b/package.json index 7d539bd..e663bd9 100644 --- a/package.json +++ b/package.json @@ -14,7 +14,7 @@ "@testing-library/jest-dom": "^5.16.4", "@testing-library/react": "^13.3.0", "@testing-library/user-event": "^13.5.0", - "@tonconnect/ui-react": "^1.0.0-beta.6", + "@tonconnect/ui-react": "^2.0.11", "@types/jest": "^27.5.1", "@types/node": "^16.11.36", "@types/react": "^18.0.9", diff --git a/public/index.html b/public/index.html index 9108f4d..d3afbd6 100644 --- a/public/index.html +++ b/public/index.html @@ -6,17 +6,17 @@ - Ton Minter + TON Minter - + @@ -26,16 +26,16 @@ - + @@ -63,7 +63,7 @@ Learn how to configure a non-root public URL by running `npm run build`. --> - Ton Minter + TON Minter diff --git a/src/App.tsx b/src/App.tsx index 1d872cc..f099e0b 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -85,12 +85,15 @@ const App = () => { resetJetton(); }, [location.pathname]); + const isSandbox = window.location.search.includes("sandbox"); + const isTestnet = window.location.search.includes("testnet"); + return ( diff --git a/src/assets/icons/bullet.svg b/src/assets/icons/bullet.svg index fbbde74..fcc9d58 100644 --- a/src/assets/icons/bullet.svg +++ b/src/assets/icons/bullet.svg @@ -1,3 +1,3 @@ - + diff --git a/src/assets/icons/github-hover.svg b/src/assets/icons/github-hover.svg index b16e1e3..1e076ce 100644 --- a/src/assets/icons/github-hover.svg +++ b/src/assets/icons/github-hover.svg @@ -1,4 +1,4 @@ - + diff --git a/src/assets/icons/logo.svg b/src/assets/icons/logo.svg index 0c66ca3..bd2a52e 100644 --- a/src/assets/icons/logo.svg +++ b/src/assets/icons/logo.svg @@ -1,5 +1,5 @@ - + @@ -8,7 +8,7 @@ - + diff --git a/src/assets/icons/mail-hover.svg b/src/assets/icons/mail-hover.svg index b65c2ff..669c863 100644 --- a/src/assets/icons/mail-hover.svg +++ b/src/assets/icons/mail-hover.svg @@ -1,5 +1,5 @@ - + diff --git a/src/assets/icons/pen.svg b/src/assets/icons/pen.svg index 79b9df6..e25c817 100644 --- a/src/assets/icons/pen.svg +++ b/src/assets/icons/pen.svg @@ -1,8 +1,8 @@ - - - - - - + + + + + + diff --git a/src/assets/icons/telegram-hover.svg b/src/assets/icons/telegram-hover.svg index 58cd971..d427f35 100644 --- a/src/assets/icons/telegram-hover.svg +++ b/src/assets/icons/telegram-hover.svg @@ -1,4 +1,4 @@ - + diff --git a/src/assets/icons/twitter-hover.svg b/src/assets/icons/twitter-hover.svg index 6a05c4f..204e8be 100644 --- a/src/assets/icons/twitter-hover.svg +++ b/src/assets/icons/twitter-hover.svg @@ -1,4 +1,4 @@ - + diff --git a/src/components/appLogo/AppLogo.tsx b/src/components/appLogo/AppLogo.tsx index 5efdaa7..6e36a92 100644 --- a/src/components/appLogo/AppLogo.tsx +++ b/src/components/appLogo/AppLogo.tsx @@ -14,7 +14,7 @@ export const AppLogo = () => { Logo {APP_DISPLAY_NAME} - {network === "testnet" && } + {network === "testnet" && } ); }; diff --git a/src/components/editLogoPopup/EditLogoPopup.tsx b/src/components/editLogoPopup/EditLogoPopup.tsx index b284490..3b8649d 100644 --- a/src/components/editLogoPopup/EditLogoPopup.tsx +++ b/src/components/editLogoPopup/EditLogoPopup.tsx @@ -66,7 +66,7 @@ export const EditLogoPopup = ({ setTempUrl("https://bitcoincash-example.github.io/website/logo.png")} style={{ fontWeight: 700, cursor: "pointer" }}> - example + Use example. )} @@ -89,7 +89,7 @@ export const EditLogoPopup = ({ setLogoUrl(tempUrl); close(); }} - background="#0088CC"> + background="#0098EA"> Save URL diff --git a/src/components/footer/Footer.tsx b/src/components/footer/Footer.tsx index 43c5b06..ccbcf3e 100644 --- a/src/components/footer/Footer.tsx +++ b/src/components/footer/Footer.tsx @@ -18,17 +18,21 @@ import telegramHovered from "assets/icons/telegram-hover.svg"; import github from "assets/icons/github.svg"; import orbsLogo from "assets/icons/orbs.svg"; import githubHovered from "assets/icons/github-hover.svg"; -import { AppLogo } from "components/appLogo"; import heart from "assets/icons/heart.svg"; import { Outlet } from "react-router-dom"; +import { useNetwork } from "../../lib/hooks/useNetwork"; export const Footer = () => { + const { network } = useNetwork(); + + let isTestnet = network === "testnet"; + let switchNetworkText = isTestnet ? "Switch to Mainnet" : "Switch to Testnet"; + let switchNetworkURL = isTestnet ? "/" : "/?testnet=true"; + return ( - - - + { - © 2023 TON Foundation + © {new Date().getFullYear()} TON Foundation Contributed with - Orbs logo + Love by @@ -66,8 +70,8 @@ export const Footer = () => { - - Support + + {switchNetworkText} diff --git a/src/components/form/Form.tsx b/src/components/form/Form.tsx index b41a284..abaa1dd 100644 --- a/src/components/form/Form.tsx +++ b/src/components/form/Form.tsx @@ -185,8 +185,8 @@ export function Form({ fontWeight={700} type="button" onClick={onConnect} - background="#0088CC"> - Connect wallet + background="#0098EA"> + Connect Wallet ) : ( diff --git a/src/components/form/input/Input.tsx b/src/components/form/input/Input.tsx index 4d51a7a..c974284 100644 --- a/src/components/form/input/Input.tsx +++ b/src/components/form/input/Input.tsx @@ -109,7 +109,7 @@ export function Input({ variant="body2" onClick={() => onExampleClick()}> {" "} - example + Use example. )} diff --git a/src/components/header/Header.tsx b/src/components/header/Header.tsx index 61da6df..fdf48de 100644 --- a/src/components/header/Header.tsx +++ b/src/components/header/Header.tsx @@ -56,7 +56,7 @@ export const Header = () => { Enter an existing Jetton contract address. setExample(EXAMPLE_ADDRESS)}> {" "} - example + Use example. diff --git a/src/components/header/headerMenu/HeaderMenu.tsx b/src/components/header/headerMenu/HeaderMenu.tsx index 2879707..d735723 100644 --- a/src/components/header/headerMenu/HeaderMenu.tsx +++ b/src/components/header/headerMenu/HeaderMenu.tsx @@ -1,4 +1,4 @@ -import { Box, Drawer, IconButton, styled } from "@mui/material"; +import { Drawer, IconButton, styled } from "@mui/material"; import githubIcon from "assets/icons/github-logo.svg"; import CloseRoundedIcon from "@mui/icons-material/CloseRounded"; import { AppLogo } from "components/appLogo"; diff --git a/src/components/logoAlertPopup/LogoAlertPopup.tsx b/src/components/logoAlertPopup/LogoAlertPopup.tsx index fecc625..ef0663f 100644 --- a/src/components/logoAlertPopup/LogoAlertPopup.tsx +++ b/src/components/logoAlertPopup/LogoAlertPopup.tsx @@ -58,7 +58,7 @@ export const LogoAlertPopup = ({ onValidate(); close(); }} - background="#0088CC"> + background="#0098EA"> {isUpdateText ? "Update Metadata" : "Deploy"} diff --git a/src/index.tsx b/src/index.tsx index 8158cf0..636100e 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -12,7 +12,7 @@ import { ThemeProvider } from "@mui/material/styles"; import { ThemeProvider as MakeStylesProvider } from "@mui/material"; import theme from "theme"; import { SnackbarProvider } from "notistack"; -import { TonConnectUIProvider } from "@tonconnect/ui-react"; +import { THEME, TonConnectUIProvider } from "@tonconnect/ui-react"; const root = ReactDOM.createRoot(document.getElementById("root") as HTMLElement); root.render( @@ -22,7 +22,9 @@ root.render( - + diff --git a/src/lib/contract-deployer.ts b/src/lib/contract-deployer.ts index bd8e7f9..fa67aaf 100644 --- a/src/lib/contract-deployer.ts +++ b/src/lib/contract-deployer.ts @@ -1,5 +1,5 @@ import BN from "bn.js"; -import { Address, beginCell, Cell, contractAddress, StateInit } from "ton"; +import { Address, Cell, contractAddress, StateInit } from "ton"; import { SendTransactionRequest, TonConnectUI } from "@tonconnect/ui-react"; interface ContractDeployDetails { diff --git a/src/lib/deploy-controller.ts b/src/lib/deploy-controller.ts index f6e7e5d..f828892 100644 --- a/src/lib/deploy-controller.ts +++ b/src/lib/deploy-controller.ts @@ -294,12 +294,12 @@ class JettonDeployController { [s in JettonMetaDataKeys]?: string | undefined; }, connection: TonConnectUI, - walltAddress: string, + walletAddress: string, ) { const tc = await getClient(); const waiter = await waitForSeqno( tc.openWalletFromAddress({ - source: Address.parse(walltAddress), + source: Address.parse(walletAddress), }), ); diff --git a/src/lib/utils.ts b/src/lib/utils.ts index d2921ce..6ca7f63 100644 --- a/src/lib/utils.ts +++ b/src/lib/utils.ts @@ -1,7 +1,6 @@ -import BN from "bn.js"; -import { Address, beginCell, Cell, toNano, TonClient, Wallet } from "ton"; +import { Address, beginCell, toNano, TonClient, Wallet } from "ton"; import { JettonDeployParams, JETTON_DEPLOY_GAS } from "./deploy-controller"; -import { initData, JettonMetaDataKeys, JETTON_MINTER_CODE, mintBody } from "./jetton-minter"; +import { initData, JETTON_MINTER_CODE, mintBody } from "./jetton-minter"; export async function sleep(time: number) { return new Promise((resolve) => { diff --git a/src/pages/deployer/index.tsx b/src/pages/deployer/index.tsx index 8aeb653..69232ef 100644 --- a/src/pages/deployer/index.tsx +++ b/src/pages/deployer/index.tsx @@ -8,13 +8,7 @@ import { ContractDeployer } from "lib/contract-deployer"; import { Link as ReactRouterLink } from "react-router-dom"; import { ROUTES } from "consts"; import useNotification from "hooks/useNotification"; -import { - FormWrapper, - ScreenHeading, - StyledDescription, - StyledTxLoaderContent, - SubHeadingWrapper, -} from "./styles"; +import { FormWrapper, ScreenHeading, StyledDescription, SubHeadingWrapper } from "./styles"; import { Screen, ScreenContent } from "components/Screen"; import analytics, { AnalyticsAction, AnalyticsCategory } from "services/analytics"; import { getUrlParam, toDecimalsBN } from "utils"; @@ -39,12 +33,12 @@ async function fetchDecimalsOffchain(url: string): Promise<{ decimals?: string } function DeployerPage() { const { showNotification } = useNotification(); const walletAddress = useTonAddress(); - const [tonconnect] = useTonConnectUI(); + const [tonConnectUI] = useTonConnectUI(); const [isLoading, setIsLoading] = useState(false); const navigate = useNavigatePreserveQuery(); async function deployContract(data: any) { - if (!walletAddress || !tonconnect) { + if (!walletAddress || !tonConnectUI) { throw new Error("Wallet not connected"); } @@ -89,7 +83,7 @@ function DeployerPage() { } try { - const result = await jettonDeployController.createJetton(params, tonconnect, walletAddress); + const result = await jettonDeployController.createJetton(params, tonConnectUI, walletAddress); analytics.sendEvent( AnalyticsCategory.DEPLOYER_PAGE, AnalyticsAction.DEPLOY, @@ -170,7 +164,7 @@ function Description() { {" "} for{" "} - TON blockchain + TON Blockchain . This free educational tool allows you to deploy your own Jetton to mainnet in one click. You will need at least 0.25 TON for deployment fees.
@@ -204,6 +198,12 @@ function Description() { this {" "} to understand why. + + Learn more about other token-minting solutions in our{" "} + + article + + . diff --git a/src/pages/jetton/FaultyDeploy.tsx b/src/pages/jetton/FaultyDeploy.tsx index 369b90b..00e194b 100644 --- a/src/pages/jetton/FaultyDeploy.tsx +++ b/src/pages/jetton/FaultyDeploy.tsx @@ -21,7 +21,7 @@ function FaultyDeploy() { jettonImage, } = useJettonStore(); const [isLoading, setIsLoading] = useState(false); - const [tonconnect] = useTonConnectUI(); + const [tonConnectUI] = useTonConnectUI(); const address = useTonAddress(); const onSubmit = async () => { @@ -38,7 +38,7 @@ function FaultyDeploy() { description, image: jettonImage, }, - tonconnect, + tonConnectUI, address, ); await getJettonDetails(); diff --git a/src/pages/jetton/actions/BurnJettonsAction.tsx b/src/pages/jetton/actions/BurnJettonsAction.tsx index 3c93d2e..d6ca62b 100644 --- a/src/pages/jetton/actions/BurnJettonsAction.tsx +++ b/src/pages/jetton/actions/BurnJettonsAction.tsx @@ -8,8 +8,6 @@ import useJettonStore from "store/jetton-store/useJettonStore"; import { AppButton } from "components/appButton"; import { AppNumberInput } from "components/appInput"; import { toDecimalsBN } from "utils"; -import { useRecoilState } from "recoil"; -import { jettonActionsState } from "pages/jetton/actions/jettonActions"; import { useTonAddress, useTonConnectUI } from "@tonconnect/ui-react"; function BurnJettonsAction() { @@ -26,7 +24,7 @@ function BurnJettonsAction() { } = useJettonStore(); const { showNotification } = useNotification(); const [actionInProgress, setActionInProgress] = useState(false); - const [tonconnect] = useTonConnectUI(); + const [tonConnectUI] = useTonConnectUI(); const walletAddress = useTonAddress(); if (!balance || !isMyWallet) { return null; @@ -58,7 +56,7 @@ function BurnJettonsAction() { try { setActionInProgress(true); await jettonDeployController.burnJettons( - tonconnect, + tonConnectUI, valueDecimals, jettonWalletAddress!, walletAddress, diff --git a/src/pages/jetton/actions/ConnectAction.tsx b/src/pages/jetton/actions/ConnectAction.tsx index 3f3dafe..19f498b 100644 --- a/src/pages/jetton/actions/ConnectAction.tsx +++ b/src/pages/jetton/actions/ConnectAction.tsx @@ -2,7 +2,7 @@ import { AppButton } from "components/appButton"; import { onConnect } from "utils"; function ConnectAction() { - return Connect wallet; + return Connect Wallet; } export default ConnectAction; diff --git a/src/pages/jetton/actions/MintJettonsAction.tsx b/src/pages/jetton/actions/MintJettonsAction.tsx index cba8cca..76dc99e 100644 --- a/src/pages/jetton/actions/MintJettonsAction.tsx +++ b/src/pages/jetton/actions/MintJettonsAction.tsx @@ -4,21 +4,18 @@ import { Popup } from "components/Popup"; import useNotification from "hooks/useNotification"; import { jettonDeployController } from "lib/deploy-controller"; import { useState } from "react"; -import WalletConnection from "services/wallet-connection"; import useJettonStore from "store/jetton-store/useJettonStore"; import { Address } from "ton"; import { toDecimalsBN } from "utils"; import { AppButton } from "components/appButton"; import { AppNumberInput } from "components/appInput"; -import { useRecoilState } from "recoil"; -import { jettonActionsState } from "pages/jetton/actions/jettonActions"; import { useTonAddress, useTonConnectUI } from "@tonconnect/ui-react"; function MintJettonsAction() { const [amount, setAmount] = useState(undefined); const [open, setOpen] = useState(false); const [actionInProgress, setActionInProgress] = useState(false); - const [tonconnect] = useTonConnectUI(); + const [tonConnectUI] = useTonConnectUI(); const { jettonMaster, isAdmin, symbol, getJettonDetails, isMyWallet, decimals } = useJettonStore(); const walletAddress = useTonAddress(); @@ -42,7 +39,7 @@ function MintJettonsAction() { try { setActionInProgress(true); await jettonDeployController.mint( - tonconnect, + tonConnectUI, Address.parse(jettonMaster), value, walletAddress, diff --git a/src/pages/jetton/actions/RevokeOwnershipAction.tsx b/src/pages/jetton/actions/RevokeOwnershipAction.tsx index ce632a4..73829f8 100644 --- a/src/pages/jetton/actions/RevokeOwnershipAction.tsx +++ b/src/pages/jetton/actions/RevokeOwnershipAction.tsx @@ -1,11 +1,8 @@ import useNotification from "hooks/useNotification"; import { jettonDeployController } from "lib/deploy-controller"; -import WalletConnection from "services/wallet-connection"; import useJettonStore from "store/jetton-store/useJettonStore"; import { Address } from "ton"; import { AppButton } from "components/appButton"; -import { useSetRecoilState } from "recoil"; -import { jettonActionsState } from "pages/jetton/actions/jettonActions"; import { useState } from "react"; import { CenteringWrapper } from "components/footer/styled"; import { Popup } from "components/Popup"; @@ -21,7 +18,7 @@ function RevokeOwnershipAction() { const { jettonMaster, isAdmin, getJettonDetails, isMyWallet, symbol, isImageBroken } = useJettonStore(); const walletAddress = useTonAddress(); - const [tonconnect] = useTonConnectUI(); + const [tonConnectUI] = useTonConnectUI(); const { showNotification } = useNotification(); if (!isAdmin || !isMyWallet) { return null; @@ -40,7 +37,7 @@ function RevokeOwnershipAction() { setActionInProgress(true); await jettonDeployController.burnAdmin( Address.parse(jettonMaster), - tonconnect, + tonConnectUI, walletAddress, ); getJettonDetails(); diff --git a/src/pages/jetton/actions/UpdateMetadata.tsx b/src/pages/jetton/actions/UpdateMetadata.tsx index 5f6e1ea..c39fdb0 100644 --- a/src/pages/jetton/actions/UpdateMetadata.tsx +++ b/src/pages/jetton/actions/UpdateMetadata.tsx @@ -3,11 +3,8 @@ import { onchainFormSpec } from "pages/deployer/data"; import { Form } from "components/form"; import { JettonStoreState } from "store/jetton-store"; import { jettonDeployController } from "lib/deploy-controller"; -import WalletConnection from "services/wallet-connection"; import { Address } from "ton"; import useNotification from "hooks/useNotification"; -import { useSetRecoilState } from "recoil"; -import { jettonActionsState } from "pages/jetton/actions/jettonActions"; import { useTonAddress, useTonConnectUI } from "@tonconnect/ui-react"; import { useState } from "react"; @@ -49,8 +46,8 @@ function UpdateMetadata({ setOpen }: UpdateMetadataProps) { const { isAdmin, getJettonDetails, jettonMaster } = store; const [actionInProgress, setActionInProgress] = useState(false); const { showNotification } = useNotification(); - const [tonconnect] = useTonConnectUI(); - const walltAddress = useTonAddress(); + const [tonConnectUI] = useTonConnectUI(); + const walletAddress = useTonAddress(); if (!isAdmin) { return null; } @@ -71,8 +68,8 @@ function UpdateMetadata({ setOpen }: UpdateMetadataProps) { image: values.tokenImage, decimals: parseInt(values.decimals).toFixed(0), }, - tonconnect, - walltAddress, + tonConnectUI, + walletAddress, ); await getJettonDetails(); setOpen(false); diff --git a/src/pages/jetton/actions/transfer/TransferAction.tsx b/src/pages/jetton/actions/transfer/TransferAction.tsx index 2291825..393a65e 100644 --- a/src/pages/jetton/actions/transfer/TransferAction.tsx +++ b/src/pages/jetton/actions/transfer/TransferAction.tsx @@ -8,7 +8,7 @@ import { ButtonWrapper, TransferContent, TransferWrapper } from "./styled"; import { AppHeading } from "components/appHeading"; import { AppNumberInput, AppTextInput } from "components/appInput"; import { toDecimalsBN } from "utils"; -import { useRecoilState, useSetRecoilState } from "recoil"; +import { useRecoilState } from "recoil"; import { jettonActionsState } from "pages/jetton/actions/jettonActions"; import { useTonAddress, useTonConnectUI } from "@tonconnect/ui-react"; @@ -20,7 +20,7 @@ export const TransferAction = () => { const [amount, setAmount] = useState(undefined); const { showNotification } = useNotification(); const connectedWalletAddress = useTonAddress(); - const [tonconnect] = useTonConnectUI(); + const [tonConnectUI] = useTonConnectUI(); const [actionInProgress, setActionInProgress] = useRecoilState(jettonActionsState); if (!balance || !jettonWalletAddress || !isMyWallet) { @@ -43,7 +43,7 @@ export const TransferAction = () => { setActionInProgress(true); try { await jettonDeployController.transfer( - tonconnect, + tonConnectUI, toDecimalsBN(amount!.toString(), decimals!), toAddress!, connectedWalletAddress!, diff --git a/src/pages/jetton/dataRow/styled.tsx b/src/pages/jetton/dataRow/styled.tsx index f52bada..cf19950 100644 --- a/src/pages/jetton/dataRow/styled.tsx +++ b/src/pages/jetton/dataRow/styled.tsx @@ -38,7 +38,7 @@ const RowActionsButton = styled(Box)({ padding: "0px 10px", fontSize: 13, fontWeight: 700, - background: "#0088CC", + background: "#0098EA", color: "#fff", borderRadius: 24, "&:hover": { diff --git a/src/pages/jetton/util.ts b/src/pages/jetton/util.ts index b5d6822..2b3de29 100644 --- a/src/pages/jetton/util.ts +++ b/src/pages/jetton/util.ts @@ -44,13 +44,13 @@ export const getAdminMessage = ( return { type: "warning", text: `You should revoke this token's ownership. Your ${symbol} tokens will - remain safely in your wallet. [Read more](${commonGithubUrl})`, + remain safely in your wallet. [Read more](${commonGithubUrl}).`, }; } return { type: "warning", - text: `This token is not 100% safe because admin has not revoked ownership. [Read more](${commonGithubUrl})`, + text: `This token is not 100% safe because admin has not revoked ownership. [Read more](${commonGithubUrl}).`, }; }; @@ -61,19 +61,19 @@ export const getMetadataWarning = ( if (persistenceType === "onchain" && !adminRevokedOwnership) { return { type: "warning", - text: `This can be changed by the admin without warning. [Read more](${commonGithubUrl})`, + text: `This can be changed by the admin without warning. [Read more](${commonGithubUrl}).`, }; } switch (persistenceType) { case "offchain_ipfs": return { type: "warning", - text: `This jetton’s metadata (name, decimals and symbol) is stored on IPFS instead of on-chain. It will not change, but be careful, it can disappear and become unpinned. [Read more](${offChainGithubUrl})`, + text: `This jetton’s metadata (name, decimals and symbol) is stored on IPFS instead of on-chain. It will not change, but be careful, it can disappear and become unpinned. [Read more](${offChainGithubUrl}).`, }; case "offchain_private_domain": return { type: "warning", - text: `Can be changed without warning by admin since metadata is stored on privately owned website. [Read more](${offChainGithubUrl})`, + text: `Can be changed without warning by admin since metadata is stored on privately owned website. [Read more](${offChainGithubUrl}).`, }; default: diff --git a/src/store/jetton-store/useJettonStore.ts b/src/store/jetton-store/useJettonStore.ts index 4f48b8e..b69b9a9 100644 --- a/src/store/jetton-store/useJettonStore.ts +++ b/src/store/jetton-store/useJettonStore.ts @@ -31,9 +31,17 @@ function useJettonStore() { showNotification("Invalid jetton address in query param", "error", undefined, 5000); } - const address = queryAddress || connectedWalletAddress; + let address: Address | null = null; + try { + address = Address.parse(queryAddress || connectedWalletAddress); + } catch (error) {} + + let userAddress: Address | null = null; + try { + userAddress = Address.parse(connectedWalletAddress); + } catch (error) {} - const isMyWallet = address ? address === connectedWalletAddress : false; + const isMyWallet = address && userAddress ? address.equals(userAddress) : false; reset(); @@ -52,7 +60,7 @@ function useJettonStore() { const result = await jettonDeployController.getJettonDetails( parsedJettonMaster, - address ? Address.parse(address) : zeroAddress(), + address ?? zeroAddress(), ); if (!result) { @@ -61,7 +69,8 @@ function useJettonStore() { return; } const _adminAddress = result.minter.admin?.toFriendly() ?? zeroAddress().toFriendly(); - const admin = isMyWallet && _adminAddress === connectedWalletAddress; + const adminAddress = Address.parse(_adminAddress); + const admin = (isMyWallet && userAddress && adminAddress.equals(userAddress)) || false; let image: string | undefined; @@ -106,15 +115,15 @@ function useJettonStore() { totalSupply: result.minter.totalSupply, name: result.minter.metadata.name, symbol: result.minter.metadata.symbol, - adminRevokedOwnership: _adminAddress === zeroAddress().toFriendly(), + adminRevokedOwnership: zeroAddress().equals(adminAddress), isAdmin: admin, decimals: result.minter.metadata.decimals || "9", - adminAddress: _adminAddress, + adminAddress: adminAddress.toFriendly({ urlSafe: true, bounceable: false }), balance: result.jettonWallet ? result.jettonWallet.balance : undefined, jettonWalletAddress: result.jettonWallet?.jWalletAddress?.toFriendly(), jettonMaster: jettonAddress, isMyWallet, - selectedWalletAddress: address, + selectedWalletAddress: address?.toFriendly({ urlSafe: true, bounceable: false }), }; }); } catch (error) { diff --git a/src/theme.ts b/src/theme.ts index 8fd0883..f4bc670 100644 --- a/src/theme.ts +++ b/src/theme.ts @@ -9,7 +9,7 @@ declare module "@mui/material" { let theme = createTheme({ palette: { primary: { - main: "#0088CC", + main: "#0098EA", contrastText: "#fff", },