{"id":347305,"date":"2023-03-26T21:00:44","date_gmt":"2023-03-26T21:00:44","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=347305"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=347305","title":{"rendered":"<span>\u041a\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u0432 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0435 TON<\/span>"},"content":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/401\/366\/e50\/401366e5067f17be1ebe8aee253b884f.jpg\" width=\"1200\" height=\"628\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/401\/366\/e50\/401366e5067f17be1ebe8aee253b884f.jpg\" data-blurred=\"true\"\/><\/figure>\n<h3>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412\u0430\u0436\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u0440\u0438\u043f\u0442\u043e \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0430 TON \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/github.com\/ton-connect\/sdk\" rel=\"noopener noreferrer nofollow\">tonconnect\/sdk<\/a>.<\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f(\u0441\u0430\u0439\u0442) \u0441 \u043a\u043d\u043e\u043f\u043a\u043e\u0439, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0435\u0439 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 <a href=\"https:\/\/tonkeeper.com\/\" rel=\"noopener noreferrer nofollow\">Tonkeeper<\/a>. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b, \u043c\u043d\u043e\u0433\u0438\u0435 \u0432\u0435\u0449\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u043e\u043f\u0443\u0449\u0435\u043d\u044b.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0438\u043b\u044f\u0445, \u0442\u0430\u043a \u043a\u0430\u043a \u0446\u0435\u043b\u044c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u0434 \u0432\u0430\u0448\u0438 \u043d\u0443\u0436\u0434\u044b \u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<h3>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>\u043a\u043d\u043e\u043f\u043a\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c QR-\u043a\u043e\u0434, \u043b\u0438\u0431\u043e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0447\u0435\u0440\u0435\u0437 Tonkeeper <\/p>\n<ul>\n<li>\n<p>\u0441\u0441\u044b\u043b\u043a\u0443 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u0432 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430, \u043b\u0438\u0431\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u043f\u0440\u044f\u043c\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 (\u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0414\u0435\u0441\u043a\u0442\u043e\u043f\u0435) \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c QR \u043a\u043e\u0434<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c<\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u0435\u0442\u0438 (\u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0438\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439) \u0432 \u0445\u0435\u0434\u0435\u0440\u0435 \u043f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>\u0434\u0438\u0441\u043a\u043e\u043d\u0435\u043a\u0442 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u043e\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a:<\/p>\n<ol>\n<li>\n<p>\u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f42\/7e2\/28b\/f427e228b8c48004fbf7d78a0a001708.PNG\" width=\"947\" height=\"354\"\/><\/figure>\n<ol start=\"2\">\n<li>\n<p>\u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u043c QR \u043a\u043e\u0434 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/d8e\/129\/6d7\/d8e1296d7838f1c64a5a395a6f4d7e9e.jpg\" width=\"591\" height=\"1280\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d8e\/129\/6d7\/d8e1296d7838f1c64a5a395a6f4d7e9e.jpg\" data-blurred=\"true\"\/><\/figure>\n<ol start=\"3\">\n<li>\n<p>\u0443\u0432\u0438\u0434\u0438\u043c \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u0438 \u043c\u0435\u0442\u043a\u0443 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0435\u0442\u0438<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/515\/79b\/8a0\/51579b8a005b1b27e4ea5cbc2c77cb40.PNG\" width=\"946\" height=\"406\"\/><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432 <a href=\"https:\/\/github.com\/ton-connect\/sdk\" rel=\"noopener noreferrer nofollow\">tonconnect\/sdk<\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0433 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e tonkeeper.<\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c Vite<\/h3>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043d\u0430\u0447\u0430\u0442\u044c, \u0432 \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b Node \u0438 npm. \u041f\u0435\u0440\u0432\u044b\u0439 \u043d\u0430\u0448 \u0448\u0430\u0433 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>vite<\/code> \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>npm init<\/code> \u0431\u0435\u0437 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0432 \u043f\u0430\u043f\u043a\u0435 \u043f\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u044b\u0431\u043e\u0440\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443.<\/p>\n<pre><code>npm init vite@latest vite-tonconnect -- --template react-ts<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0439\u0434\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0443<\/p>\n<pre><code>cd vite-tonconnect<\/code><\/pre>\n<p>\u0418 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/p>\n<pre><code> npm install <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c, \u0447\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e:<\/p>\n<pre><code>npm run dev<\/code><\/pre>\n<p>\u0414\u043e\u043b\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u044d\u0442\u043e\u0433\u043e<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2a6\/4fa\/02c\/2a64fa02ccf204301bbae6bf7d7398b8.PNG\" width=\"1432\" height=\"842\"\/><\/figure>\n<h3>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h3>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u043e\u043c TON:<\/p>\n<pre><code>npm i ton ton-core ton-crypto<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <code>tonconnect<\/code>:<\/p>\n<pre><code>npm i @tonconnect\/sdk<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0449\u0435\u043f\u043e\u0442\u043a\u0443 \u043a\u0440\u0430\u0441\u043e\u0442\u044b \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<pre><code>npm i antd sass<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e TonConnect, \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Tonkeeper, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c QR \u043a\u043e\u0434 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0435. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f qr \u043a\u043e\u0434\u043e\u0432:<\/p>\n<pre><code>npm i react-qr-code<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0435\u043c\u0441\u044f \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0447\u0442\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432 (\u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>recoil<\/code>:<\/p>\n<pre><code>npm i recoil<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 ton(\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e), \u0442\u043e \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443 Buffer is not defined. \u0427\u0442\u043e\u0431\u044b \u043e\u0431\u043e\u0439\u0442\u0438 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443.<\/p>\n<pre><code>npm i node-stdlib-browser vite-plugin-node-stdlib-browser<\/code><\/pre>\n<p>\u0418 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Vite <code>vite.config.ts<\/code> <code>nodePolyfills()<\/code> \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u044b.<\/p>\n<pre><code>import { defineConfig } from 'vite' import react from '@vitejs\/plugin-react' import nodePolyfills from 'vite-plugin-node-stdlib-browser'  \/\/ https:\/\/vitejs.dev\/config\/ export default defineConfig({   plugins: [react(),nodePolyfills()], }) <\/code><\/pre>\n<h3>\u041f\u0438\u0448\u0435\u043c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h3>\n<p>\u0412 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u043c<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043e\u043c<\/p>\n<\/li>\n<li>\n<p>\u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0441\u0441\u044b\u043b\u043a\u0438 \u0434\u043b\u044f \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 \u043f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043f\u0430\u043f\u043a\u0435 <code>src<\/code> \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>utils.ts<\/code> \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>isMobile()<\/code> \u0438 <code>isDesktop()<\/code>. \u041f\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 \u043e\u043a\u043d\u0430, <code>innerWidth<\/code> \u0431\u0443\u0434\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e:<\/p>\n<pre><code>export function isMobile(): boolean { return window.innerWidth &lt;= 500; }  export function isDesktop(): boolean { return window.innerWidth >= 1050; } <\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0441\u0441\u044b\u043b\u043a\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Window\/open\" rel=\"noopener noreferrer nofollow\">open<\/a> \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <code>window<\/code>:<\/p>\n<pre><code>export function openLink(href: string, target = '_self') { window.open(href, target, 'noreferrer noopener'); } <\/code><\/pre>\n<p><code>noreferrer noopener<\/code> &#8212; \u043d\u0443\u0436\u0435\u043d\u044b \u0434\u043b\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u0432\u0440\u0435\u0434\u043d\u044b\u043c\u0438 \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438 \u043d\u043e\u0432\u043e\u0439 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442 <code>JavaScript window.opener<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043d\u043e\u0432\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u043e\u043a\u043d\u043e\u043c.<\/p>\n<h3>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c TonConnect<\/h3>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u0432 \u043f\u0430\u043f\u043a\u0435 <code>src<\/code> <code>connector.ts<\/code>. \u0418 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442 <code>TonConnect<\/code>:<\/p>\n<pre><code>import { TonConnect } from '@tonconnect\/sdk';<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c <code>new TonConnect()<\/code> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0448\u0435\u043b\u0435\u043a \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043d \u0443\u0432\u0438\u0434\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0432\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u0443\u0434\u0430 \u043e\u043d \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u043b\u0438 \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f:<\/p>\n<pre><code>{   \"url\": \"&lt;app-url>\",                        \/\/ required   \"name\": \"&lt;app-name>\",                      \/\/ required   \"iconUrl\": \"&lt;app-icon-url>\",               \/\/ required   \"termsOfUseUrl\": \"&lt;terms-of-use-url>\",     \/\/ optional   \"privacyPolicyUrl\": \"&lt;privacy-policy-url>\" \/\/ optional }<\/code><\/pre>\n<p>\u041b\u0443\u0447\u0448\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u043a\u043e\u0440\u043d\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0438 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431:<\/p>\n<pre><code>const dappMetadata = { manifestUrl: 'https:\/\/gist.githubusercontent.com\/siandreev\/75f1a2ccf2f3b4e2771f6089aeb06d7f\/raw\/d4986344010ec7a2d1cc8a2a9baa57de37aaccb8\/gistfile1.txt', }; <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u043f\u043e\u043b\u0443\u0447\u0438\u043c<\/p>\n<pre><code>import { TonConnect } from '@tonconnect\/sdk';  const dappMetadata = { manifestUrl: 'https:\/\/gist.githubusercontent.com\/siandreev\/75f1a2ccf2f3b4e2771f6089aeb06d7f\/raw\/d4986344010ec7a2d1cc8a2a9baa57de37aaccb8\/gistfile1.txt', };  export const connector = new TonConnect(dappMetadata);<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u043b \u0441\u0432\u043e\u0439 \u043a\u043e\u0448\u0435\u043b\u0435\u043a, \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435<\/p>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e UX \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0440\u0430\u043d\u0435\u0435 \u0443\u0436\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u043b \u043a\u043e\u0448\u0435\u043b\u0435\u043a \u0438 \u043e\u043f\u044f\u0442\u044c \u0437\u0430\u0448\u0435\u043b \u0432 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0441\u0440\u0430\u0437\u0443 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/legacy.reactjs.org\/docs\/hooks-effect.html\" rel=\"noopener noreferrer nofollow\">\u0445\u0443\u043a useEffect<\/a>, \u0432 \u0445\u0443\u043a\u0435 \u0432\u044b\u0437\u043e\u0432\u0435\u043c <code>connector.restoreConnection()<\/code>. \u0414\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432 \u0444\u0430\u0439\u043b\u0435 <code>App.tsx<\/code>:<\/p>\n<pre><code>import React, { useEffect } from 'react'; import reactLogo from '.\/assets\/react.svg' import viteLogo from '\/vite.svg' import '.\/App.css'  import { connector } from '..\/src\/connector';  function App() {   useEffect(() => { connector.restoreConnection(); }, []);    return ( &lt;div>Auth will be here&lt;\/div>   ) }  export default App<\/code><\/pre>\n<blockquote>\n<p>\u044f \u0441\u0440\u0430\u0437\u0443 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u0442\u0438\u043b\u0438, \u043d\u0430 \u043d\u0438\u0445 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e<\/p>\n<\/blockquote>\n<h3>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0445\u0443\u043a\u0438<\/h3>\n<p>\u0414\u043b\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u0445\u0443\u043a\u043e\u0432. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u043b\u044f \u043d\u0438\u0445 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 hooks \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u043c \u0447\u0435\u0442\u044b\u0440\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430:<\/p>\n<ul>\n<li>\n<p><code>useTonWallet.ts<\/code><\/p>\n<\/li>\n<li>\n<p><code>useTonWalletConnectionError.ts<\/code><\/p>\n<\/li>\n<li>\n<p><code>useSlicedAddress.ts<\/code><\/p>\n<\/li>\n<li>\n<p><code>useForceUpdate.ts<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u043e\u0439\u0434\u0435\u043c \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<h3>useTonWallet<\/h3>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043d\u043e\u043f\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>connector.onStatusChange()<\/code>:<\/p>\n<pre><code>import { Wallet } from '@tonconnect\/sdk'; import { useEffect, useState } from 'react'; import { connector } from '..\/connector';  export function useTonWallet() { const [wallet, setWallet] = useState&lt;Wallet | null>(connector.wallet);  useEffect(() => connector.onStatusChange(setWallet, console.error), []);  return wallet; } <\/code><\/pre>\n<h3>useTonWalletConnectionError<\/h3>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>connector.onStatusChange()<\/code> \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 <code>UserRejectsError<\/code> \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432 <code>tonconnect\/sdk<\/code>, \u043e\u043d\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0435.<\/p>\n<pre><code>import { UserRejectsError } from '@tonconnect\/sdk'; import { useCallback, useEffect } from 'react'; import { connector } from '..\/connector';  export function useTonWalletConnectionError(callback: () => void) { const errorsHandler = useCallback( (error: unknown) => { if (typeof error === 'object' &amp;&amp; error instanceof UserRejectsError) { callback(); } }, [callback], );  const emptyCallback = useCallback(() => {}, []);  useEffect(() => connector.onStatusChange(emptyCallback, errorsHandler), [emptyCallback, errorsHandler]); }<\/code><\/pre>\n<h3>useSlicedAddress<\/h3>\n<p>\u0423\u0434\u043e\u0431\u043d\u044b\u043c UX \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u043c \u0434\u043b\u044f \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u0412 TON Connect \u0430\u0434\u0440\u0435\u0441\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 <code>0:&lt;hex><\/code>  \u0444\u043e\u0440\u043c\u0430\u0442\u0435 (raw format), \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0431\u044b\u043b \u0431\u044b \u0443\u0434\u043e\u0431\u0435\u043d \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0434\u0440\u0443\u0436\u0435\u043b\u044e\u0431\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u044b \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0432 TON <a href=\"https:\/\/docs.ton.org\/learn\/overviews\/addresses\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<pre><code>import { CHAIN } from '@tonconnect\/sdk'; import { useMemo } from 'react'; import { Address } from 'ton';   export function useSlicedAddress(address: string | null | undefined, chain?: CHAIN) { return useMemo(() => { if (!address) { return ''; }  const userFriendlyAddress = Address.parseRaw(address).toString({ testOnly: chain === CHAIN.TESTNET });  return userFriendlyAddress.slice(0, 4) + '...' + userFriendlyAddress.slice(-3);  }, [address]); }<\/code><\/pre>\n<blockquote>\n<p>\u041e\u0442\u043c\u0435\u0447\u0443 \u0442\u0430\u043a\u0436\u0435, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0447\u0442\u043e \u043a\u043e\u0448\u0435\u043b\u0435\u043a \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0435\u0442\u0438<\/p>\n<\/blockquote>\n<h3>useForceUpdate<\/h3>\n<p>\u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 React \u0441\u0430\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430. \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0442\u043e\u043c, \u043a\u043e\u0433\u0434\u0430 props&#8217;\u044b \u0438\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0431\u044b\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u044b. \u041e\u0434\u043d\u0430\u043a\u043e, \u043d\u0430\u0448 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 (\u043a\u043d\u043e\u043f\u043a\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438) \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u0440\u0435\u0442\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b &#8212; \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0441\u0432\u043e\u0435 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u0432\u0430\u0436\u043d\u043e \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 React \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<pre><code>import { useState } from 'react';  export function useForceUpdate() { const [_, setValue] = useState(0); return () => setValue((value) => value + 1); }<\/code><\/pre>\n<h3>\u0414\u043e\u0441\u0442\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432<\/h3>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0448\u0435\u043b\u0435\u043a Tonkeeper \u0432 TONConnect \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0430 \u0432\u044b\u0431\u043e\u0440 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 <code>src<\/code> \u043f\u0430\u043f\u043a\u0443 <code>state<\/code> \u0438 \u0432 \u043d\u0435\u0439 \u0444\u0430\u0439\u043b <code>wallets-list.ts<\/code>. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0438\u0437 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <code>\u0441onnector.getWallets() <\/code>. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>recoil <\/code> \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440:<\/p>\n<pre><code>import { isWalletInfoInjected } from '@tonconnect\/sdk'; import { selector } from 'recoil'; import { connector } from '..\/..\/src\/connector';  export const walletsListQuery = selector({ key: 'walletsList', get: async () => { const walletsList = await connector.getWallets();  }, });<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u043c\u043e\u0433\u0443\u0442 \u0432\u043e\u0437\u043d\u0438\u043a\u043d\u0443\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u0438 \u043a\u043e\u043d\u0435\u0447\u043d\u043e \u0432 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u0442 \u0441\u043c\u044b\u0441\u043b\u0430 \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432, \u043b\u0443\u0447\u0448\u0435 \u0441\u0440\u0430\u0437\u0443 \u043e\u0442\u0434\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439, \u0434\u043b\u044f \u043f\u043e\u0434\u043e\u0431\u043d\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0432 <code>tonconnect\/sdk<\/code> \u0435\u0441\u0442\u044c <code>isWalletInfoInjected<\/code>, \u0431\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044f \u043a\u043e\u0442\u043e\u0440\u043e\u043c\u0443 \u043c\u044b \u0441\u0440\u0430\u0437\u0443 \u0441\u043c\u043e\u0436\u0435\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u043d\u0443\u0436\u043d\u044b\u0439 \u043a\u043e\u0448\u0435\u043b\u0435\u043a:<\/p>\n<pre><code>import { isWalletInfoInjected } from '@tonconnect\/sdk'; import { selector } from 'recoil'; import { connector } from '..\/..\/src\/connector';  export const walletsListQuery = selector({ key: 'walletsList', get: async () => { const walletsList = await connector.getWallets();  const embeddedWallet = walletsList.filter(isWalletInfoInjected).find((wallet) => wallet.embedded);  return { walletsList, embeddedWallet, }; }, });<\/code><\/pre>\n<h3>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043a\u043d\u043e\u043f\u043a\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/h3>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446-\u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u0430\u043c\u043e\u0439 \u043a\u043d\u043e\u043f\u043a\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u0421 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c \u0441\u043a\u0440\u0438\u043f\u0442\u044b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u0435\u043c \u0432\u0441\u0435 \u0447\u0442\u043e, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0432\u0435\u0440\u0441\u0442\u043a\u0438:<\/p>\n<pre><code>import { DownOutlined } from '@ant-design\/icons'; import { Button, Dropdown, Menu, Modal, notification, Space } from 'antd'; import React, { useCallback, useEffect, useState } from 'react'; import QRCode from 'react-qr-code'; import { useRecoilValueLoadable } from 'recoil'; import { addReturnStrategy, connector } from '..\/..\/..\/src\/connector'; import { useForceUpdate } from '..\/..\/..\/src\/hooks\/useForceUpdate'; import { useSlicedAddress } from '..\/..\/..\/src\/hooks\/useSlicedAddress'; import { useTonWallet } from '..\/..\/..\/src\/hooks\/useTonWallet'; import { useTonWalletConnectionError } from '..\/..\/..\/src\/hooks\/useTonWalletConnectionError'; import { walletsListQuery } from '..\/..\/..\/src\/state\/wallets-list'; import { isDesktop, isMobile, openLink } from '..\/..\/..\/src\/utils'; import '.\/style.scss';<\/code><\/pre>\n<p>\u0412\u044b \u043c\u043e\u0433\u043b\u0438 \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0445 \u0448\u0430\u0433\u0430\u0445 \u043d\u0438\u0433\u0434\u0435 \u043d\u0435 \u0443\u043f\u043e\u043c\u0438\u043d\u0430\u043b\u043e\u0441\u044c \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u043e\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f(\u0434\u0438\u0441\u043a\u043e\u043d\u043d\u0435\u043a\u0442). \u041f\u043e \u043b\u043e\u0433\u0438\u043a\u0435 \u043d\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u0430, \u043f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u0434\u0440\u0435\u0441 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430, \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u043f\u043e\u044f\u0432\u0438\u0442\u044c\u0441\u044f \u0432\u044b\u043f\u0430\u0434\u0430\u044e\u0449\u0435\u0435 \u043c\u0435\u043d\u044e \u0441 \u043e\u043f\u0446\u0438\u0435\u0439. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>Menu<\/code> \u0438\u0437 \u0431\u0438\u0431\u0438\u043b\u0438\u043e\u0442\u0435\u043a\u0438 <code>antd<\/code>.<\/p>\n<pre><code>const menu = ( &lt;Menu onClick={() => connector.disconnect()} items={[ { label: 'Disconnect', key: '1', }, ]} \/> );<\/code><\/pre>\n<p>\u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0441\u0430\u043c\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430, \u043f\u043e \u0441\u0443\u0442\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u2014 \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0438 \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0435\u0451 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e (\u043b\u0438\u0431\u043e \u0441\u0441\u044b\u043b\u043a\u043e\u0439, \u043b\u0438\u0431\u043e QR-\u043a\u043e\u0434\u043e\u043c), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u0448 \u0441\u0430\u043c\u044b\u0439 \u0433\u043b\u0430\u0432\u043d\u044b\u0439 \u0445\u0443\u043a \u2014 \u044d\u0442\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u0441\u0441\u044b\u043b\u043a\u0438:<\/p>\n<pre><code>export function AuthButton() { const [modalUniversalLink, setModalUniversalLink] = useState('');  return ( &lt;> &lt;div className=\"auth-button\">  &lt;\/div>  &lt;\/> ); } <\/code><\/pre>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0445\u0443\u043a \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u0443\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0441\u0441\u044b\u043b\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043d\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d \u0435\u043c\u0443 \u043d\u0430\u0434\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443 \u0441 \u0437\u0430\u043f\u0443\u0441\u043a\u0430\u044e\u0449\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0435\u0441\u043b\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043d \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u043a\u043d\u043e\u043f\u043a\u0443-\u0430\u0434\u0440\u0435\u0441, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442 \u043e\u0442\u043a\u043b\u044e\u0447\u0438\u0442\u044c \u043a\u043e\u0448\u0435\u043b\u0435\u043a. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0430\u0434\u043e \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d \u043b\u0438 \u043a\u043e\u0448\u0435\u043b\u0435\u043a, \u0432 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0445\u0443\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043c\u044b \u043d\u0430\u043f\u0438\u0441\u0430\u043b\u0438 \u0434\u043e \u044d\u0442\u043e\u0433\u043e <code>useTonWallet()<\/code>. \u0422\u0430\u043a \u0432\u0430\u0436\u043d\u043e \u0432\u0441\u043f\u043e\u043c\u043d\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430\u0448 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e\u0431 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0438 \u043e\u0442 \u0442\u0440\u0435\u0442\u044c\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0447\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442:<\/p>\n<pre><code>export function AuthButton() { const [modalUniversalLink, setModalUniversalLink] = useState(''); const forceUpdate = useForceUpdate(); const wallet = useTonWallet();  return ( &lt;> &lt;div className=\"auth-button\"> {wallet ? ( &lt;Dropdown overlay={menu}> &lt;Button shape=\"round\" type=\"primary\"> &lt;Space> {address} &lt;DownOutlined \/> &lt;\/Space> &lt;\/Button> &lt;\/Dropdown> ) : ( &lt;Button shape=\"round\" type=\"primary\" onClick={handleButtonClick}> Connect Wallet &lt;\/Button> )} &lt;\/div> &lt;\/> ); }<\/code><\/pre>\n<p>\u0417\u0434\u0435\u0441\u044c \u0436\u0435 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438 \u0438 \u0434\u043e\u0441\u0442\u0430\u043d\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432, \u0430 \u0442\u0430\u043a\u0436\u0435 \u0441\u0440\u0430\u0437\u0443 \u0436\u0435 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u0443\u0435\u043c \u0430\u0434\u0440\u0435\u0441:<\/p>\n<pre><code>export function AuthButton() { const [modalUniversalLink, setModalUniversalLink] = useState(''); const forceUpdate = useForceUpdate(); const wallet = useTonWallet(); const onConnectErrorCallback = useCallback(() => { setModalUniversalLink(''); notification.error({ message: 'Connection was rejected', description: 'Please approve connection to the dApp in your wallet.', }); }, []); useTonWalletConnectionError(onConnectErrorCallback);  const walletsList = useRecoilValueLoadable(walletsListQuery);  const address = useSlicedAddress(wallet?.account.address, wallet?.account.chain);  return ( &lt;> &lt;div className=\"auth-button\"> {wallet ? ( &lt;Dropdown overlay={menu}> &lt;Button shape=\"round\" type=\"primary\"> &lt;Space> {address} &lt;DownOutlined \/> &lt;\/Space> &lt;\/Button> &lt;\/Dropdown> ) : ( &lt;Button shape=\"round\" type=\"primary\" onClick={handleButtonClick}> Connect Wallet &lt;\/Button> )} &lt;\/div>  &lt;\/> ); }<\/code><\/pre>\n<p>\u041e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u043d\u0430\u0436\u0430\u0442\u0438\u0435 \u043a\u043b\u0430\u0432\u0438\u0448\u0438, \u043f\u0435\u0440\u0432\u043e\u0435 \u0447\u0442\u043e \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u043c, \u043f\u043e\u0434 \u0433\u0440\u0443\u0437\u0438\u043b\u0441\u044f \u043b\u0438 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442, \u043f\u043e\u0434\u043e\u0436\u0434\u0435\u043c:<\/p>\n<pre><code>const handleButtonClick = useCallback(async () => {  if (!(walletsList.state === 'hasValue')) { setTimeout(handleButtonClick, 200); }  }, [walletsList]);<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0438 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432 \u043c\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u043b\u0438 \u0441\u043b\u0443\u0447\u0430\u0439, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430, \u043f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u043e\u0439. \u0415\u0441\u043b\u0438 \u044d\u0442\u043e \u043d\u0435 \u0434\u0435\u0441\u043a\u0442\u043e\u043f \u0438 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u043e\u0442\u043a\u0440\u044b\u0442\u043e \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430, \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u0438\u043c\u0435\u043d\u043d\u043e \u044d\u0442\u0438\u043c \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u043c \u0434\u043b\u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f:<\/p>\n<pre><code>const handleButtonClick = useCallback(async () => { if (!(walletsList.state === 'hasValue')) { setTimeout(handleButtonClick, 200); }  if (!isDesktop() &amp;&amp; walletsList.contents.embeddedWallet) { connector.connect({ jsBridgeKey: walletsList.contents.embeddedWallet.jsBridgeKey }); return; }   }, [walletsList]);<\/code><\/pre>\n<p>\u041f\u0440\u0438\u0448\u043b\u043e \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0442\u0443 \u0441\u0430\u043c\u0443\u044e \u0441\u0441\u044b\u043b\u043a\u0443 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u043f\u0435\u0440\u0432\u044b\u0439 &#8212; \u044d\u0442\u043e Tonkeeper \u0438 \u0434\u043e\u0441\u0442\u0430\u043d\u0435\u043c \u0441\u0441\u044b\u043b\u043a\u0443 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f <code>connector.connect()<\/code>:<\/p>\n<pre><code>const handleButtonClick = useCallback(async () => { if (!(walletsList.state === 'hasValue')) { setTimeout(handleButtonClick, 200); }  if (!isDesktop() &amp;&amp; walletsList.contents.embeddedWallet) { connector.connect({ jsBridgeKey: walletsList.contents.embeddedWallet.jsBridgeKey }); return; }  const tonkeeperConnectionSource = { universalLink: walletsList.contents.walletsList[0].universalLink, bridgeUrl: walletsList.contents.walletsList[0].bridgeUrl, };  const universalLink = connector.connect(tonkeeperConnectionSource);  }, [walletsList]); <\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0441 \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u043c\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u0430\u043c\u0438, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0442\u044c QR \u043a\u043e\u0434 \u043d\u0435 \u0443\u0434\u043e\u0431\u043d\u043e, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0431\u0443\u0434\u0435\u043c \u0441\u0440\u0430\u0437\u0443 \u043a\u0438\u0434\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443, \u0432 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 \u0431\u0443\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0441\u044b\u043b\u043a\u0443 \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u0434 QR \u043a\u043e\u0434. \u0412 \u044d\u0442\u043e\u043c \u043d\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043c\u044b \u043f\u0438\u0441\u0430\u043b\u0438 \u0440\u0430\u043d\u0435\u0435:<\/p>\n<pre><code>const handleButtonClick = useCallback(async () => { \/\/ Use loading screen\/UI instead (while wallets list is loading) if (!(walletsList.state === 'hasValue')) { setTimeout(handleButtonClick, 200); }  if (!isDesktop() &amp;&amp; walletsList.contents.embeddedWallet) { connector.connect({ jsBridgeKey: walletsList.contents.embeddedWallet.jsBridgeKey }); return; }  const tonkeeperConnectionSource = { universalLink: walletsList.contents.walletsList[0].universalLink, bridgeUrl: walletsList.contents.walletsList[0].bridgeUrl, };  const universalLink = connector.connect(tonkeeperConnectionSource);  if (isMobile()) { openLink(addReturnStrategy(universalLink, 'none'), '_blank'); } else { setModalUniversalLink(universalLink); } }, [walletsList]);<\/code><\/pre>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043c\u043e\u0434\u0430\u043b\u043a\u0443 \u0438 \u0432\u043e\u0442 \u0438\u0442\u043e\u0433\u043e\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>AuthButton.tsx<\/code>:<\/p>\n<pre><code>import { DownOutlined } from '@ant-design\/icons'; import { Button, Dropdown, Menu, Modal, notification, Space } from 'antd'; import React, { useCallback, useEffect, useState } from 'react'; import QRCode from 'react-qr-code'; import { useRecoilValueLoadable } from 'recoil'; import { addReturnStrategy, connector } from '..\/..\/..\/src\/connector'; import { useForceUpdate } from '..\/..\/..\/src\/hooks\/useForceUpdate'; import { useSlicedAddress } from '..\/..\/..\/src\/hooks\/useSlicedAddress'; import { useTonWallet } from '..\/..\/..\/src\/hooks\/useTonWallet'; import { useTonWalletConnectionError } from '..\/..\/..\/src\/hooks\/useTonWalletConnectionError'; import { walletsListQuery } from '..\/..\/..\/src\/state\/wallets-list'; import { isDesktop, isMobile, openLink } from '..\/..\/..\/src\/utils'; import '.\/style.scss';   const menu = ( &lt;Menu onClick={() => connector.disconnect()} items={[ { label: 'Disconnect', key: '1', }, ]} \/> );  export function AuthButton() { const [modalUniversalLink, setModalUniversalLink] = useState(''); const forceUpdate = useForceUpdate(); const wallet = useTonWallet(); const onConnectErrorCallback = useCallback(() => { setModalUniversalLink(''); notification.error({ message: 'Connection was rejected', description: 'Please approve connection to the dApp in your wallet.', }); }, []); useTonWalletConnectionError(onConnectErrorCallback);  const walletsList = useRecoilValueLoadable(walletsListQuery);  const address = useSlicedAddress(wallet?.account.address, wallet?.account.chain);  useEffect(() => { if (modalUniversalLink &amp;&amp; wallet) { setModalUniversalLink(''); } }, [modalUniversalLink, wallet]);  const handleButtonClick = useCallback(async () => { if (!(walletsList.state === 'hasValue')) { setTimeout(handleButtonClick, 200); }  if (!isDesktop() &amp;&amp; walletsList.contents.embeddedWallet) { connector.connect({ jsBridgeKey: walletsList.contents.embeddedWallet.jsBridgeKey }); return; }  const tonkeeperConnectionSource = { universalLink: walletsList.contents.walletsList[0].universalLink, bridgeUrl: walletsList.contents.walletsList[0].bridgeUrl, };  const universalLink = connector.connect(tonkeeperConnectionSource);  if (isMobile()) { openLink(addReturnStrategy(universalLink, 'none'), '_blank'); } else { setModalUniversalLink(universalLink); } }, [walletsList]);  return ( &lt;> &lt;div className=\"auth-button\"> {wallet ? ( &lt;Dropdown overlay={menu}> &lt;Button shape=\"round\" type=\"primary\"> &lt;Space> {address} &lt;DownOutlined \/> &lt;\/Space> &lt;\/Button> &lt;\/Dropdown> ) : ( &lt;Button shape=\"round\" type=\"primary\" onClick={handleButtonClick}> Connect Wallet &lt;\/Button> )} &lt;\/div> &lt;Modal title=\"Connect to Tonkeeper\" open={!!modalUniversalLink} onOk={() => setModalUniversalLink('')} onCancel={() => setModalUniversalLink('')} > &lt;QRCode size={256} style={{ height: '260px', maxWidth: '100%', width: '100%' }} value={modalUniversalLink} viewBox={`0 0 256 256`} \/> &lt;\/Modal> &lt;\/> ); }<\/code><\/pre>\n<h3>\u041a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0445\u0435\u0434\u0435\u0440 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u0441\u0442\u0432\u0430 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f\u043c\u0438 \u0432\u0430\u0436\u043d\u043e \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0432 \u043a\u0430\u043a\u043e\u0439 \u0441\u0435\u0442\u0438 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0438\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439 \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435. \u0412\u044b\u0432\u0435\u0434\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0432 \u043a\u0430\u043a\u043e\u0439 \u0441\u0435\u0442\u0438 \u043a\u043e\u0448\u0435\u043b\u0435\u043a, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043e\u043d \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043b \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u044f\u0434\u043e\u043c \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 <code>AppTitle.tsx<\/code>.<\/p>\n<pre><code>import { CHAIN } from '@tonconnect\/sdk'; import React, { useEffect, useRef, useState } from 'react'; import { useTonWallet } from '..\/..\/..\/src\/hooks\/useTonWallet'; import '.\/style.scss';  const chainNames = { [CHAIN.MAINNET]: 'mainnet', [CHAIN.TESTNET]: 'testnet', };  export function AppTitle() { const wallet = useTonWallet();  return ( &lt;> &lt;div className=\"dapp-title\" > &lt;span className=\"dapp-title__text\">My Dapp&lt;\/span> {wallet &amp;&amp; &lt;span className=\"dapp-title__badge\">{chainNames[wallet.account.chain]}&lt;\/span>} &lt;\/div> &lt;\/> ); }<\/code><\/pre>\n<p>\u041a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0432\u0438\u0434\u0435\u0442\u044c, \u0437\u0434\u0435\u0441\u044c \u0432\u0441\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043d\u0430\u0448 \u0445\u0443\u043a \u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u0438\u0437 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u043d\u043e\u043c\u0435\u0440 \u0441\u0435\u0442\u0438 \u0438 \u043f\u043e \u0441\u043f\u0440\u0430\u0432\u043e\u0447\u043d\u0438\u043a\u0443 <code>CHAIN <\/code> \u0437\u0430\u0448\u0438\u0442\u043e\u043c\u0443 \u0432  <code>tonconnect\/sdk <\/code> \u043f\u043e\u043b\u0443\u0447\u0438\u043c \u0441\u0435\u0442\u044c.<\/p>\n<h3>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u0448\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u043d\u0430 \u0441\u0442\u0440\u0430\u043d\u0438\u0446\u0443<\/h3>\n<p>\u0412 \u0444\u0430\u0439\u043b\u0435 App.tsx \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u043d\u0430\u043c\u0438 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0432 \u0445\u0435\u0434\u0435\u0440:<\/p>\n<pre><code>import React, { useEffect } from 'react'; import { AppTitle } from '..\/src\/components\/AppTitle\/AppTitle'; import { AuthButton } from '..\/src\/components\/AuthButton\/AuthButton'; import { connector } from '..\/src\/connector'; import 'antd\/dist\/reset.css'; import '.\/app.scss';  function App() {   useEffect(() => { connector.restoreConnection(); }, []);    return ( &lt;div className=\"app\">   &lt;header> &lt;AppTitle \/> &lt;AuthButton \/>   &lt;\/header>   &lt;main>   &lt;\/main> &lt;\/div>       ) }  export default App<\/code><\/pre>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432\u0430\u0436\u043d\u043e \u0432 \u0444\u0430\u0439\u043b\u0435 <code>main.tsx<\/code> \u043e\u0431\u0435\u0440\u043d\u0443\u0442\u044c \u0432 <code>RecoilRoot<\/code> \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u044b.<\/p>\n<pre><code>import React from 'react' import ReactDOM from 'react-dom\/client' import App from '.\/App' import '.\/index.scss'; import { RecoilRoot } from 'recoil';   ReactDOM.createRoot(document.getElementById('root') as HTMLElement).render(   &lt;RecoilRoot>   &lt;React.StrictMode> &lt;App \/>   &lt;\/React.StrictMode>   &lt;\/RecoilRoot>, )<\/code><\/pre>\n<p>\u0418 \u043d\u0430 \u044d\u0442\u043e \u0432\u0441\u0451. \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0440\u0430\u0437\u0431\u0435\u0440\u0435\u043c \u043a\u0430\u043a \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0442\u0440\u0430\u043d\u0437\u0430\u043a\u0446\u0438\u0438 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u0438 \u0440\u0430\u0441\u0448\u0438\u0440\u0438\u043c \u043d\u0430\u0448 \u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<h3>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h3>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0435\u0441\u0442\u044c \u043d\u0430 <a href=\"https:\/\/github.com\/romanovichim\/TonFunClessons_ru\/tree\/main\/21lesson\/code\/vite-tonconnect\" rel=\"noopener noreferrer nofollow\">\u0433\u0438\u0442\u0445\u0430\u0431<\/a>. \u041f\u043e\u0434\u043e\u0431\u043d\u044b\u0435 \u0441\u0442\u0430\u0442\u044c\u044f \u043f\u0443\u0431\u043b\u0438\u043a\u0443\u044e <a href=\"https:\/\/t.me\/ton_learn\" rel=\"noopener noreferrer nofollow\">\u0441\u044e\u0434\u0430<\/a>. \u0421\u043f\u0430\u0441\u0438\u0431\u043e \u0437\u0430 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435.<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p> <!----> <!----><\/div>\n<p> <!----> <!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/724866\/\"> https:\/\/habr.com\/ru\/post\/724866\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<h3>\u0412\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0435<\/h3>\n<p>\u0412\u0430\u0436\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u044c\u044e \u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u0440\u0438\u043f\u0442\u043e \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u043f\u043e\u0448\u0430\u0433\u043e\u0432\u043e \u0441\u043e\u0431\u0435\u0440\u0435\u043c \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u0430 TON \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <a href=\"https:\/\/github.com\/ton-connect\/sdk\" rel=\"noopener noreferrer nofollow\">tonconnect\/sdk<\/a>.<\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0430 \u0441\u043e\u0431\u0440\u0430\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u043e\u0434\u043d\u043e\u0441\u0442\u0440\u0430\u043d\u0438\u0447\u043d\u043e\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f(\u0441\u0430\u0439\u0442) \u0441 \u043a\u043d\u043e\u043f\u043a\u043e\u0439, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0435\u0439 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 <a href=\"https:\/\/tonkeeper.com\/\" rel=\"noopener noreferrer nofollow\">Tonkeeper<\/a>. \u0414\u043b\u044f \u043f\u0440\u043e\u0441\u0442\u043e\u0442\u044b, \u043c\u043d\u043e\u0433\u0438\u0435 \u0432\u0435\u0449\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0436\u043d\u043e \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u0441 \u0442\u043e\u0447\u043a\u0438 \u0437\u0440\u0435\u043d\u0438\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043a\u043e\u0434\u0430 \u043e\u043f\u0443\u0449\u0435\u043d\u044b.<\/p>\n<p>\u0422\u0430\u043a\u0436\u0435 \u043c\u044b \u043d\u0435 \u0431\u0443\u0434\u0435\u043c \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0441\u0442\u0438\u043b\u044f\u0445, \u0442\u0430\u043a \u043a\u0430\u043a \u0446\u0435\u043b\u044c \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c \u0443\u0434\u043e\u0431\u043d\u044b\u0439 \u0434\u043b\u044f \u0431\u0443\u0434\u0443\u0449\u0435\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u0434 \u0432\u0430\u0448\u0438 \u043d\u0443\u0436\u0434\u044b \u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<h3>\u0424\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f<\/h3>\n<p>\u0412 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c:<\/p>\n<ul>\n<li>\n<p>\u043a\u043d\u043e\u043f\u043a\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u0438 \u043d\u0430\u0436\u0430\u0442\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c QR-\u043a\u043e\u0434, \u043b\u0438\u0431\u043e \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e \u0447\u0435\u0440\u0435\u0437 Tonkeeper <\/p>\n<ul>\n<li>\n<p>\u0441\u0441\u044b\u043b\u043a\u0443 \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u0434\u0430\u0432\u0430\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0437\u0430\u0445\u043e\u0434\u0438\u0442 \u0432 \u043d\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0441 \u0442\u0435\u043b\u0435\u0444\u043e\u043d\u0430, \u043b\u0438\u0431\u043e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0435\u0433\u043e \u043f\u0440\u044f\u043c\u043e \u0432 \u0431\u0440\u0430\u0443\u0437\u0435\u0440\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430<\/p>\n<\/li>\n<li>\n<p>\u0432\u043e \u0432\u0441\u0435\u0445 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0441\u043b\u0443\u0447\u0430\u044f\u0445 (\u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432 \u0414\u0435\u0441\u043a\u0442\u043e\u043f\u0435) \u0431\u0443\u0434\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c QR \u043a\u043e\u0434<\/p>\n<\/li>\n<\/ul>\n<\/li>\n<li>\n<p>\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u043b\u0441\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c<\/p>\n<\/li>\n<li>\n<p>\u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0441\u0435\u0442\u0438 (\u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0438\u043b\u0438 \u043e\u0441\u043d\u043e\u0432\u043d\u043e\u0439) \u0432 \u0445\u0435\u0434\u0435\u0440\u0435 \u043f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<li>\n<p>\u0434\u0438\u0441\u043a\u043e\u043d\u0435\u043a\u0442 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u043e\u0442 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/p>\n<\/li>\n<\/ul>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0435\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043a:<\/p>\n<ol>\n<li>\n<p>\u043d\u0430\u0436\u0438\u043c\u0430\u0435\u043c \u043d\u0430 \u043a\u043d\u043e\u043f\u043a\u0443 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><\/figure>\n<ol start=\"2\">\n<li>\n<p>\u0441\u043a\u0430\u043d\u0438\u0440\u0443\u0435\u043c QR \u043a\u043e\u0434 \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0432 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><\/figure>\n<ol start=\"3\">\n<li>\n<p>\u0443\u0432\u0438\u0434\u0438\u043c \u0430\u0434\u0440\u0435\u0441 \u043d\u0430\u0448\u0435\u0433\u043e \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u0438 \u043c\u0435\u0442\u043a\u0443 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0435\u0442\u0438<\/p>\n<\/li>\n<\/ol>\n<figure class=\"full-width\"><\/figure>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0432 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u043c\u044b \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0432\u0430\u0442\u044c \u0441\u043f\u0438\u0441\u043e\u043a \u0440\u0430\u0437\u043d\u044b\u0445 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432 \u0438\u043d\u0442\u0435\u0433\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0432 <a href=\"https:\/\/github.com\/ton-connect\/sdk\" rel=\"noopener noreferrer nofollow\">tonconnect\/sdk<\/a>, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043c\u043e\u0433 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e tonkeeper.<\/p>\n<h3>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c Vite<\/h3>\n<p>\u041f\u0440\u0435\u0436\u0434\u0435 \u0447\u0435\u043c \u043d\u0430\u0447\u0430\u0442\u044c, \u0432 \u0432\u0430\u0448\u0435\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0434\u043e\u043b\u0436\u043d\u044b \u0431\u044b\u0442\u044c \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043b\u0435\u043d\u044b Node \u0438 npm. \u041f\u0435\u0440\u0432\u044b\u0439 \u043d\u0430\u0448 \u0448\u0430\u0433 \u2014 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>vite<\/code> \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u044b <code>npm init<\/code> \u0431\u0435\u0437 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e\u0433\u043e \u043e\u0431\u0435\u0441\u043f\u0435\u0447\u0435\u043d\u0438\u044f. \u041e\u0442\u043a\u0440\u043e\u0439\u0442\u0435 \u0442\u0435\u0440\u043c\u0438\u043d\u0430\u043b \u0432 \u043f\u0430\u043f\u043a\u0435 \u043f\u043e \u0432\u0430\u0448\u0435\u043c\u0443 \u0432\u044b\u0431\u043e\u0440\u0443 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u0435 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043a\u043e\u043c\u0430\u043d\u0434\u0443.<\/p>\n<pre><code>npm init vite@latest vite-tonconnect -- --template react-ts<\/code><\/pre>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0437\u0430\u0439\u0434\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0443<\/p>\n<pre><code>cd vite-tonconnect<\/code><\/pre>\n<p>\u0418 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043a\u043e\u043c\u0430\u043d\u0434\u0443<\/p>\n<pre><code> npm install <\/code><\/pre>\n<p>\u041f\u0440\u043e\u0442\u0435\u0441\u0442\u0438\u0440\u0443\u0435\u043c, \u0447\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438 \u0432\u0441\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e:<\/p>\n<pre><code>npm run dev<\/code><\/pre>\n<p>\u0414\u043e\u043b\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c, \u0447\u0442\u043e-\u0442\u043e \u0432\u0440\u043e\u0434\u0435 \u044d\u0442\u043e\u0433\u043e<\/p>\n<figure class=\"full-width\"><\/figure>\n<h3>\u0423\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0435\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438<\/h3>\n<p>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0435 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u043b\u043e\u043a\u0447\u0435\u0439\u043d\u043e\u043c TON:<\/p>\n<pre><code>npm i ton ton-core ton-crypto<\/code><\/pre>\n<p>\u0414\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 <code>tonconnect<\/code>:<\/p>\n<pre><code>npm i @tonconnect\/sdk<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0449\u0435\u043f\u043e\u0442\u043a\u0443 \u043a\u0440\u0430\u0441\u043e\u0442\u044b \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u044f\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<pre><code>npm i antd sass<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u043e\u0432\u0430\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e TonConnect, \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c Tonkeeper, \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u043a\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c QR \u043a\u043e\u0434 \u0432 \u043d\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438 \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0442\u044c \u0435\u0433\u043e \u0432 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0435. \u042d\u0442\u043e \u0437\u043d\u0430\u0447\u0438\u0442, \u0447\u0442\u043e \u043d\u0443\u0436\u043d\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f qr \u043a\u043e\u0434\u043e\u0432:<\/p>\n<pre><code>npm i react-qr-code<\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438, \u043c\u044b \u0441\u0442\u043e\u043b\u043a\u043d\u0435\u043c\u0441\u044f \u0441 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0447\u0442\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0430\u0441\u0438\u043d\u0445\u0440\u043e\u043d\u043d\u044b\u0445 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440\u043e\u0432 (\u0434\u043b\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043a\u0430 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432), \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 <code>recoil<\/code>:<\/p>\n<pre><code>npm i recoil<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u0440\u044f\u043c\u043e \u0441\u0435\u0439\u0447\u0430\u0441 \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 ton(\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u0434\u0440\u0435\u0441 \u0438 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u0435\u0433\u043e \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e), \u0442\u043e \u0432\u044b \u0443\u0432\u0438\u0434\u0438\u0442\u0435 \u043e\u0448\u0438\u0431\u043a\u0443 Buffer is not defined. \u0427\u0442\u043e\u0431\u044b \u043e\u0431\u043e\u0439\u0442\u0438 \u044d\u0442\u0443 \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0443, \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443.<\/p>\n<pre><code>npm i node-stdlib-browser vite-plugin-node-stdlib-browser<\/code><\/pre>\n<p>\u0418 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u0444\u0430\u0439\u043b Vite <code>vite.config.ts<\/code> <code>nodePolyfills()<\/code> \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u044b.<\/p>\n<pre><code>import { defineConfig } from 'vite' import react from '@vitejs\/plugin-react' import nodePolyfills from 'vite-plugin-node-stdlib-browser'  \/\/ https:\/\/vitejs.dev\/config\/ export default defineConfig({   plugins: [react(),nodePolyfills()], }) <\/code><\/pre>\n<h3>\u041f\u0438\u0448\u0435\u043c \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438<\/h3>\n<p>\u0412 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f\u043c\u0438, \u043d\u0430\u043c \u043f\u043e\u043d\u0430\u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p>\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u043c\u043e\u0431\u0438\u043b\u044c\u043d\u044b\u043c<\/p>\n<\/li>\n<li>\n<p>\u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e \u0434\u0435\u0441\u043a\u0442\u043e\u043f\u043e\u043c<\/p>\n<\/li>\n<li>\n<p>\u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0441\u0441\u044b\u043b\u043a\u0438 \u0434\u043b\u044f \u0440\u0435\u0434\u0438\u0440\u0435\u043a\u0442\u0430 \u043f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438<\/p>\n<\/li>\n<\/ul>\n<p>\u0412 \u043f\u0430\u043f\u043a\u0435 <code>src<\/code> \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b <code>utils.ts<\/code> \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <code>isMobile()<\/code> \u0438 <code>isDesktop()<\/code>. \u041f\u043e \u0441\u0432\u043e\u0439\u0441\u0442\u0432\u0443 \u043e\u043a\u043d\u0430, <code>innerWidth<\/code> \u0431\u0443\u0434\u0435\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0442\u044c \u0443\u0441\u0442\u0440\u043e\u0439\u0441\u0442\u0432\u043e:<\/p>\n<pre><code>export function isMobile(): boolean { return window.innerWidth &lt;= 500; }  export function isDesktop(): boolean { return window.innerWidth >= 1050; } <\/code><\/pre>\n<p>\u0414\u043b\u044f \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f \u0441\u0441\u044b\u043b\u043a\u0438 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043c\u0435\u0442\u043e\u0434\u043e\u043c <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/API\/Window\/open\" rel=\"noopener noreferrer nofollow\">open<\/a> \u0438\u043d\u0442\u0435\u0440\u0444\u0435\u0439\u0441\u0430 <code>window<\/code>:<\/p>\n<pre><code>export function openLink(href: string, target = '_self') { window.open(href, target, 'noreferrer noopener'); } <\/code><\/pre>\n<p><code>noreferrer noopener<\/code> &#8212; \u043d\u0443\u0436\u0435\u043d\u044b \u0434\u043b\u044f \u0431\u0435\u0437\u043e\u043f\u0430\u0441\u043d\u043e\u0441\u0442\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0435\u0434\u043e\u0442\u0432\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u0435\u0440\u0435\u0445\u0432\u0430\u0442 \u0432\u0440\u0435\u0434\u043d\u044b\u043c\u0438 \u0441\u0441\u044b\u043b\u043a\u0430\u043c\u0438 \u043d\u043e\u0432\u043e\u0439 \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0438, \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u0431\u044a\u0435\u043a\u0442 <code>JavaScript window.opener<\/code> \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u043d\u043e\u0432\u044c \u043e\u0442\u043a\u0440\u044b\u0442\u043e\u0439 \u0432\u043a\u043b\u0430\u0434\u043a\u0435 \u0443\u043f\u0440\u0430\u0432\u043b\u044f\u0442\u044c \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u0441\u043a\u0438\u043c \u043e\u043a\u043d\u043e\u043c.<\/p>\n<h3>\u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u043c TonConnect<\/h3>\n<p>\u041f\u0435\u0440\u0432\u043e\u0435 \u0447\u0442\u043e \u043d\u0430\u0434\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044d\u0442\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0444\u0430\u0439\u043b \u0432 \u043f\u0430\u043f\u043a\u0435 <code>src<\/code> <code>connector.ts<\/code>. \u0418 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0438\u043c\u043f\u043e\u0440\u0442 <code>TonConnect<\/code>:<\/p>\n<pre><code>import { TonConnect } from '@tonconnect\/sdk';<\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0437\u0432\u0430\u0442\u044c <code>new TonConnect()<\/code> \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0442\u044c \u0442\u0443\u0434\u0430 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0431\u0443\u0434\u0435\u0442 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043a\u043e\u0448\u0435\u043b\u0435\u043a \u0434\u043b\u044f \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043e\u043d \u0443\u0432\u0438\u0434\u0438\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u0432\u0430\u0448\u0435\u043c \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438 \u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u043a\u0443\u0434\u0430 \u043e\u043d \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f. \u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b \u0438\u043b\u0438 \u043f\u043e-\u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u043c\u0435\u044e\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f:<\/p>\n<pre><code>{   \"url\": \"&lt;app-url>\",                        \/\/ required   \"name\": \"&lt;app-name>\",                      \/\/ required   \"iconUrl\": \"&lt;app-icon-url>\",               \/\/ required   \"termsOfUseUrl\": \"&lt;terms-of-use-url>\",     \/\/ optional   \"privacyPolicyUrl\": \"&lt;privacy-policy-url>\" \/\/ optional }<\/code><\/pre>\n<p>\u041b\u0443\u0447\u0448\u0435\u0439 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u043e\u0439 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0440\u0430\u0437\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u043c\u0430\u043d\u0438\u0444\u0435\u0441\u0442\u0430 c \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u043a\u043e\u0440\u043d\u0435 \u0432\u0430\u0448\u0435\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c \u0438 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435. \u0414\u043b\u044f \u043f\u0440\u0438\u043c\u0435\u0440\u0430 \u043f\u0440\u0438\u043b\u043e\u0436\u0443 \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431:<\/p>\n<pre><code>const dappMetadata = { manifestUrl: 'https:\/\/gist.githubusercontent.com\/siandreev\/75f1a2ccf2f3b4e2771f6089aeb06d7f\/raw\/d4986344010ec7a2d1cc8a2a9baa57de37aaccb8\/gistfile1.txt', }; <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u043c\u0435\u0442\u0430\u0434\u0430\u043d\u043d\u044b\u0445, \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0437\u0432\u0430\u0442\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435, \u043f\u043e\u043b\u0443\u0447\u0438\u043c<\/p>\n<pre><code>import { TonConnect } from '@tonconnect\/sdk';  const dappMetadata = { manifestUrl: 'https:\/\/gist.githubusercontent.com\/siandreev\/75f1a2ccf2f3b4e2771f6089aeb06d7f\/raw\/d4986344010ec7a2d1cc8a2a9baa57de37aaccb8\/gistfile1.txt', };  export const connector = new TonConnect(dappMetadata);<\/code><\/pre>\n<p>\u0415\u0441\u043b\u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u043b \u0441\u0432\u043e\u0439 \u043a\u043e\u0448\u0435\u043b\u0435\u043a, \u043a\u043e\u043d\u043d\u0435\u043a\u0442\u043e\u0440 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435<\/p>\n<p>\u0414\u043b\u044f \u0443\u0434\u043e\u0431\u043d\u043e\u0433\u043e UX \u043d\u0443\u0436\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044e, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0440\u0430\u043d\u0435\u0435 \u0443\u0436\u0435 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u043b \u043a\u043e\u0448\u0435\u043b\u0435\u043a \u0438 \u043e\u043f\u044f\u0442\u044c \u0437\u0430\u0448\u0435\u043b \u0432 \u0432\u0430\u0448\u0435 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0432 \u0442\u0430\u043a\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0441\u0440\u0430\u0437\u0443 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0435.<\/p>\n<p>\u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/legacy.reactjs.org\/docs\/hooks-effect.html\" rel=\"noopener noreferrer nofollow\">\u0445\u0443\u043a useEffect<\/a>, \u0432 \u0445\u0443\u043a\u0435 \u0432\u044b\u0437\u043e\u0432\u0435\u043c <code>connector.restoreConnection()<\/code>. \u0414\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0432 \u0444\u0430\u0439\u043b\u0435 <code>App.tsx<\/code>:<\/p>\n<pre><code>import React, { useEffect } from 'react'; import reactLogo from '.\/assets\/react.svg' import viteLogo from '\/vite.svg' import '.\/App.css'  import { connector } from '..\/src\/connector';  function App() {   useEffect(() => { connector.restoreConnection(); }, []);    return ( &lt;div>Auth will be here&lt;\/div>   ) }  export default App<\/code><\/pre>\n<blockquote>\n<p>\u044f \u0441\u0440\u0430\u0437\u0443 \u0438\u043c\u043f\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043b \u0441\u0442\u0438\u043b\u0438, \u043d\u0430 \u043d\u0438\u0445 \u044f \u043d\u0435 \u0431\u0443\u0434\u0443 \u043e\u0441\u0442\u0430\u043d\u0430\u0432\u043b\u0438\u0432\u0430\u0442\u044c\u0441\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u0434\u0430\u043d\u043d\u044b\u0439 \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b \u043f\u043e\u043a\u0440\u044b\u0432\u0430\u0435\u0442 \u0438\u043c\u0435\u043d\u043d\u043e \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u044e<\/p>\n<\/blockquote>\n<h3>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0435 \u0445\u0443\u043a\u0438<\/h3>\n<p>\u0414\u043b\u044f \u043a\u043d\u043e\u043f\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0431\u0443\u0434\u0435\u0442 \u0443\u0434\u043e\u0431\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043a\u0430\u0441\u0442\u043e\u043c\u043d\u044b\u0445 \u0445\u0443\u043a\u043e\u0432. \u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u043b\u044f \u043d\u0438\u0445 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u0443\u044e \u043f\u0430\u043f\u043a\u0443 hooks \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u043c \u0447\u0435\u0442\u044b\u0440\u0435 \u0441\u043a\u0440\u0438\u043f\u0442\u0430:<\/p>\n<ul>\n<li>\n<p><code>useTonWallet.ts<\/code><\/p>\n<\/li>\n<li>\n<p><code>useTonWalletConnectionError.ts<\/code><\/p>\n<\/li>\n<li>\n<p><code>useSlicedAddress.ts<\/code><\/p>\n<\/li>\n<li>\n<p><code>useForceUpdate.ts<\/code><\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u043e\u0439\u0434\u0435\u043c \u043f\u043e \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<h3>useTonWallet<\/h3>\n<p>\u0414\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u043a\u043d\u043e\u043f\u043a\u0438 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0434\u043f\u0438\u0441\u0430\u0442\u044c\u0441\u044f \u043d\u0430 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u0443\u0441\u0430 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f, \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>connector.onStatusChange()<\/code>:<\/p>\n<pre><code>import { Wallet } from '@tonconnect\/sdk'; import { useEffect, useState } from 'react'; import { connector } from '..\/connector';  export function useTonWallet() { const [wallet, setWallet] = useState&lt;Wallet | null>(connector.wallet);  useEffect(() => connector.onStatusChange(setWallet, console.error), []);  return wallet; } <\/code><\/pre>\n<h3>useTonWalletConnectionError<\/h3>\n<p>\u0422\u0430\u043a\u0436\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e <code>connector.onStatusChange()<\/code> \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0438. \u041e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u043e\u0448\u0438\u0431\u043a\u0443 <code>UserRejectsError<\/code> \u043f\u0440\u043e\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0439 \u0432 <code>tonconnect\/sdk<\/code>, \u043e\u043d\u0430 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442, \u043a\u043e\u0433\u0434\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043e\u0442\u043a\u043b\u043e\u043d\u044f\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0432 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0435.<\/p>\n<pre><code>import { UserRejectsError } from '@tonconnect\/sdk'; import { useCallback, useEffect } from 'react'; import { connector } from '..\/connector';  export function useTonWalletConnectionError(callback: () => void) { const errorsHandler = useCallback( (error: unknown) => { if (typeof error === 'object' &amp;&amp; error instanceof UserRejectsError) { callback(); } }, [callback], );  const emptyCallback = useCallback(() => {}, []);  useEffect(() => connector.onStatusChange(emptyCallback, errorsHandler), [emptyCallback, errorsHandler]); }<\/code><\/pre>\n<h3>useSlicedAddress<\/h3>\n<p>\u0423\u0434\u043e\u0431\u043d\u044b\u043c UX \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u043e\u043c \u0434\u043b\u044f \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u043f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438. \u0412 TON Connect \u0430\u0434\u0440\u0435\u0441\u0430 \u043f\u0435\u0440\u0435\u0434\u0430\u044e\u0442\u0441\u044f \u0432 <code>0:&lt;hex><\/code>  \u0444\u043e\u0440\u043c\u0430\u0442\u0435 (raw format), \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0431\u044b\u043b \u0431\u044b \u0443\u0434\u043e\u0431\u0435\u043d \u0442\u0430\u043a \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0439 \u0434\u0440\u0443\u0436\u0435\u043b\u044e\u0431\u043d\u044b\u0439 \u0444\u043e\u0440\u043c\u0430\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435 \u043f\u0440\u043e \u0444\u043e\u0440\u043c\u0430\u0442\u044b \u0430\u0434\u0440\u0435\u0441\u043e\u0432 \u0432 TON <a href=\"https:\/\/docs.ton.org\/learn\/overviews\/addresses\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a>.<\/p>\n<pre><code>import { CHAIN } from '@tonconnect\/sdk'; import { useMemo } from 'react'; import { Address } from 'ton';   export function useSlicedAddress(address: string | null | undefined, chain?: CHAIN) { return useMemo(() => { if (!address) { return ''; }  const userFriendlyAddress = Address.parseRaw(address).toString({ testOnly: chain === CHAIN.TESTNET });  return userFriendlyAddress.slice(0, 4) + '...' + userFriendlyAddress.slice(-3);  }, [address]); }<\/code><\/pre>\n<blockquote>\n<p>\u041e\u0442\u043c\u0435\u0447\u0443 \u0442\u0430\u043a\u0436\u0435, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432\u0430\u0440\u0438\u0430\u043d\u0442, \u0447\u0442\u043e \u043a\u043e\u0448\u0435\u043b\u0435\u043a \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c\u0441\u044f \u0432 \u0442\u0435\u0441\u0442\u043e\u0432\u043e\u0439 \u0441\u0435\u0442\u0438<\/p>\n<\/blockquote>\n<h3>useForceUpdate<\/h3>\n<p>\u0412 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0441\u043b\u0443\u0447\u0430\u0435\u0432 React \u0441\u0430\u043c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u044b \u0434\u043b\u044f \u043f\u043e\u0432\u0442\u043e\u0440\u043d\u043e\u0433\u043e \u0440\u0435\u043d\u0434\u0435\u0440\u0438\u043d\u0433\u0430. \u041f\u0440\u0438\u0447\u0438\u043d\u0430 \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u043e\u0441\u043d\u043e\u0432\u0430\u043d\u0430 \u043d\u0430 \u0442\u043e\u043c, \u043a\u043e\u0433\u0434\u0430 props&#8217;\u044b \u0438\u043b\u0438 \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u0435 \u0431\u044b\u043b\u0438 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u044b. \u041e\u0434\u043d\u0430\u043a\u043e, \u043d\u0430\u0448 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 (\u043a\u043d\u043e\u043f\u043a\u0430 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438) \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0442\u0440\u0435\u0442\u0435\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b &#8212; \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u043f\u043e\u0434\u0442\u0432\u0435\u0440\u0436\u0434\u0430\u0435\u0442 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0432 \u0441\u0432\u043e\u0435 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0435, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u043d\u0430\u043c \u0432\u0430\u0436\u043d\u043e \u043f\u0440\u0438\u043d\u0443\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 React \u043c\u043e\u0436\u0435\u0442 \u043d\u0435 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u0442\u044c \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u044f.<\/p>\n<pre><code>import { useState } from 'react';  export function useForceUpdate() { const [_, setValue] = useState(0); return () => setValue((value) => value + 1); }<\/code><\/pre>\n<h3>\u0414\u043e\u0441\u0442\u0430\u0435\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432<\/h3>\n<p>\u041d\u0435\u0441\u043c\u043e\u0442\u0440\u044f \u043d\u0430 \u0442\u043e, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u0448\u0435\u043b\u0435\u043a Tonkeeper \u0432 TONConnect \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u0442\u044c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u043d\u0430 \u0432\u044b\u0431\u043e\u0440 \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0438\u0445 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0432 <code>src<\/code> \u043f\u0430\u043f\u043a\u0443 <code>state<\/code> \u0438 \u0432 \u043d\u0435\u0439 \u0444\u0430\u0439\u043b <code>wallets-list.ts<\/code>. \u0414\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0438\u0437 \u0441\u043e\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f <code>\u0441onnector.getWallets() <\/code>. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0442\u0443\u0442\u043e\u0440\u0438\u0430\u043b\u0435 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <code>recoil <\/code> \u0434\u043b\u044f \u0443\u043f\u0440\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0441\u043e\u0441\u0442\u043e\u044f\u043d\u0438\u044f\u043c.<\/p>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u0440:<\/p>\n<pre><code>import { isWalletInfoInjected } from '@tonconnect\/sdk'; import { selector } from 'recoil'; import { connector } from<\/code><\/pre>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-347305","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/347305","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=347305"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/347305\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=347305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=347305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=347305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}