{"id":403712,"date":"2024-06-29T17:17:09","date_gmt":"2024-06-29T17:17:09","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=403712"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=403712","title":{"rendered":"<span>\u041f\u043b\u0430\u0442\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c, \u043d\u0435 \u043f\u043b\u0430\u0442\u0438\u043c \u0437\u0430 \u0440\u0435\u043a\u043b\u0430\u043c\u0443, \u0438\u043b\u0438 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0432\u043e\u0437\u043d\u0430\u0433\u0440\u0430\u0436\u0434\u0435\u043d\u0438\u0439 \u043d\u0430 \u0441\u0430\u0439\u0442 \u0432 3 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0448\u0430\u0433\u0430<\/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<h2>\u0428\u0430\u0433 1: \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0431\u0430\u043b\u0430\u043d\u0441<\/h2>\n<p>\u0411\u0430\u043b\u0430\u043d\u0441 + \u043a\u0440\u0438\u043f\u0442\u0430 + \u043f\u0438\u0442\u043e\u043d  &#8212; \u044d\u0442\u043e decimal. \u0412 decimal \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 string:<\/p>\n<pre><code class=\"python\">from decimal import Decimal print(Decimal(f'0.001'))  0.001<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043b\u043e\u043d\u043a\u0443 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0431\u0430\u043b\u0430\u043d\u0441\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 django ORM, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u0447\u0438\u0441\u043b\u0438\u043c \u0432\u0441\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043f\u043e 4 \u0440\u0443\u0431\u043b\u044f \u0437\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">from django.db import models from django.contrib.auth.models import AbstractUser from app.models import BaseModel  class User(BaseModel, AbstractUser):   balance = models.DecimalField(     max_digits=8, decimal_places=6, default=Decimal('0.000001')   )<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 (<code>python manage.py makemigrations &amp;&amp; python manage.py migrate<\/code>). \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0431\u0430\u043b\u0430\u043d\u0441 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0435\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430 \u043a\u0430\u0440\u0442\u0443 \u043e\u0442\u043c\u0435\u0442\u043a\u0443, \u0436\u0434\u0435\u0442 \u043c\u043e\u0434\u0435\u0440\u0430\u0446\u0438\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u0440\u0430\u0446\u0438\u0438, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0432\u043e\u0437\u043d\u0430\u0433\u0440\u0430\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0430 \u0431\u0430\u043b\u0430\u043d\u0441. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438: \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u043a\u043e\u043b\u043e\u043d\u043a\u0443. \u041d\u0443 \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u0443\u0441\u043f\u0435\u0445\u0435\/\u043f\u0440\u043e\u0432\u0430\u043b\u0435 \u0441\u0432\u043e\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u0422\u0443\u0442 \u043d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 <code>post_save<\/code><\/p>\n<pre><code class=\"python\">from django.db.models.signals import post_save from django.dispatch import receiver from django.core.management import call_command from decimal import Decimal from app.models import Marker  @receiver(post_save, sender=Marker) def save_marker(sender, instance, created, **kwargs):   # is_modertaed - boolean flag means moderation is completed     if instance.is_moderated:       # this is custom add balance django command         call_command(\"add_user_balance\", instance) <\/code><\/pre>\n<p>\u041d\u0443 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0430\u043c\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>add_user_balance<\/code> \u0434\u043b\u044f django, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c package \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c commands, \u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0430\u0439\u043b \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c add_user_balance.py:<\/p>\n<pre><code class=\"python\">import json from django.core.management.base import BaseCommand from app.models import Marker, UserProfile  class Command(BaseCommand):     help = \"Add user balance for new moderated user Marker\"      def add_arguments(self, parser):         parser.add_argument(\"instance\", nargs=\"+\", type=Marker)              def handle(self, *args, **options):         instance = options[\"instance\"][0]         parsed_instance = json.loads(instance.id)         profile = UserProfile.objects.get(           id=parsed_instance[\"profile_id\"]         )         profile.user.balance += Decimal('0.00001')         profile.save()<\/code><\/pre>\n<p>\u0415\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0431\u0430\u043b\u0430\u043d\u0441\u0430 \u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u0440\u0430\u0446\u0438\u0438, \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044f \u043f\u0438\u0441\u0430\u043b \u0432 <a href=\"https:\/\/habr.com\/ru\/post\/656209\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439<\/a> \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 delete \u0443 \u0434\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0442\u043c\u0435\u0442\u043a\u0430 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0430 \u043c\u043e\u0434\u0435\u0440\u0430\u0446\u0438\u044e. <\/p>\n<h2>\u0428\u0430\u0433 2: \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0443 \u0434\u043b\u044f \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u043f\u043b\u0430\u0442\u044b<\/h2>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 &#8212; \u043e\u0434\u0438\u043d \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0431\u0430\u043b\u0430\u043d\u0441, \u0432\u0442\u043e\u0440\u043e\u0439 &#8212; \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u044b\u043f\u043b\u0430\u0442\u0443. \u041f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043c\u0435\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e React \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 material-ui.<\/p>\n<pre><code class=\"javascript\">import React, {useState} from \"react\"; import Tooltip from '@mui\/material\/Tooltip'; import Button from '@mui\/material\/Button';  import \".\/Balance.scss\";  const Balance = () => {   const [open, setOpen] = React.useState(false);   const [balance, setBalance] = React.useState(0);      const handleOpen = () => setOpen(true);   const handleClose = () => setOpen(false);      const title = '\u0417\u0434\u0435\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043d\u0430\u0448\u0438\u0445 \u0432\u043e\u0437\u043d\u0430\u0433\u0440\u0430\u0436\u0434\u0435\u043d\u0438\u0439';   return (     &lt;div className=\"Balance\">       &lt;Tooltip title={title}>       &lt;span>{balance} BTC&lt;\/span>       &lt;\/Tooltip> &lt;Button onClick={handleOpen}>\u0412\u044b\u0432\u043e\u0434&lt;\/Button> &lt;Withdrawal handleClose={handleClose} open={open} \/>     &lt;\/div>   ) };  export default Balance; <\/code><\/pre>\n<pre><code class=\"javascript\">import React, {useState} from \"react\"; import Box from '@mui\/material\/Box'; import Typography from '@mui\/material\/Typography'; import Modal from '@mui\/material\/Modal';  import \".\/Withdrawal.scss\";  const Withdrawal = ({handleClose, open}) => {   const [amount, setAmount] = React.useState('0.000100');   const [wallet, setWallet] = React.useState('');   return (     &lt;div className=\"Withdrawal\">       &lt;Modal         open={open}         onClose={handleClose}         aria-labelledby=\"modal-modal-title\"         aria-describedby=\"modal-modal-description\"       >         &lt;Box>           &lt;Typography id=\"modal-modal-title\" variant=\"h6\" component=\"h2\">           \u0412\u044b\u0432\u043e\u0434 \u043e\u0442 0.0001 BTC           &lt;\/Typography>           &lt;Typography id=\"modal-modal-description\" sx={{ mt: 2 }}>             &lt;TextField               required               id=\"amount\"               name=\"amount\"               type=\"number\"               value={amount}               variant=\"outlined\"               inputProps={{                           step: 0.00001,                           min: 0.0001                          }}               label=\"\u0421\u0443\u043c\u043c\u0430\"               onChange={(e) => setAmount(                 parseFloat(e.target.value).toFixed(6) || '0.0001'               )}             \/>             &lt;br\/>             &lt;TextField               required               id=\"wallet\"               name=\"wallet\"               value={wallet}               label=\"\u041a\u043e\u0448\u0435\u043b\u0435\u043a\"               defaultValue=\"\"               onChange={(e) => setWallet(e.target.value)}             \/>             &lt;br\/>             &lt;Button                size=\"small\"               onClick={submitWithdrawal}               variant=\"contained\"               color=\"success\"             >               \u0412\u044b\u0432\u0435\u0441\u0442\u0438             &lt;\/Button>           &lt;\/Typography>         &lt;\/Box>       &lt;\/Modal>     &lt;\/div>   ) };  export default Withdrawal;<\/code><\/pre>\n<p>\u0411\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0434\u043e\u043a\u0443\u043c\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 material-ui, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0438 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b.<\/p>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/367\/e57\/20d\/367e5720deb5d85cb985b1b23e2866a7.png\" width=\"437\" height=\"583\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/367\/e57\/20d\/367e5720deb5d85cb985b1b23e2866a7.png\"\/><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0442\u0430\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0431\u0430\u043b\u0430\u043d\u0441\u0430, \u0438 \u0447\u0442\u043e \u043e\u043d \u0432\u0432\u0435\u043b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0448\u0435\u043b\u0435\u043a. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0443\u0434\u043e\u0431\u0435\u043d Web Socket. \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f amount \u0438 wallet \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>submitWithdrawal<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c <code>socket.emit<\/code> \u0438\u043b\u0438 <code>axios.post<\/code> \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<h2>\u0428\u0430\u0433 3: \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435, \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0435\u043c \u0432\u044b\u043f\u043b\u0430\u0442\u0443<\/h2>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u043e \u0437\u0430 \u043c\u0430\u043b\u044b\u043c &#8212; \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0431\u044d\u043a\u044d\u043d\u0434\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0438\u0441\u043b\u0430\u043b\u0438 \u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u0432\u0435\u0440\u043d\u044b \u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u044f\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u0432\u0435:<\/p>\n<ol>\n<li>\n<p>\u0412\u0432\u0435\u043b\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 BTC \u043a\u043e\u0448\u0435\u043b\u0435\u043a \u0438\u043b\u0438 \u043d\u0435\u0442?<\/p>\n<\/li>\n<li>\n<p>\u0412\u0432\u0435\u043b\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u0443\u044e \u0441\u0443\u043c\u043c\u0443 \u0438 \u043e\u043d\u0430 \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0431\u0430\u043b\u0430\u043d\u0441 \u0438\u043b\u0438 \u043d\u0435\u0442?<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c 58-\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f base58. \u041f\u0435\u0440\u0432\u044b\u0435 4 \u0431\u0430\u0439\u0442\u0430 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u043e\u0439 \u0438 \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c sha256 \u0445\u0435\u0448\u0430. \u0415\u0441\u043b\u0438 \u043e\u043d\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u0442\u043e \u043a\u043e\u0448\u0435\u043b\u0435\u043a \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439.<\/p>\n<pre><code class=\"python\">def decode_base58(btc_addr: str, length: int) -> bytes:     n = 0     for char in bc:         n = n * 58 + digits58.index(char)     return n.to_bytes(length, \"big\")   def check_btc_address(btc_addr: str) -> bool:     try:         byte_addr = decode_base58(           btc_addr=btc_addr, length=25         )         return byte_addr[-4:] == sha256(           sha256(byte_addr[:-4]).digest()         ).digest()[:4]     except Exception:         return False<\/code><\/pre>\n<p>\u0421\u0443\u043c\u043c\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0442\u0440\u0443\u0434\u043d\u043e. \u0423\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0431\u0430\u043b\u0430\u043d\u0441 \u0438 \u043d\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0443\u043c\u043c\u044b \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u044b\u043f\u043b\u0430\u0442\u044b:<\/p>\n<pre><code class=\"python\">from decimal import Decimal  min_amnt = Decimal('0.0001')  def check_balance(amount: Decimal): return amnt >= min_amnt and balance - amnt >= 0 <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u044b\u0437\u043e\u0432 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u0440\u043e\u043a, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u0430\u043b\u0430\u0434\u0430\u0446\u0438\u0438 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442, \u0447\u0442\u043e\u0431\u044b \u0442\u0430\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0436\u0435 \u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u043d\u044b \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430 \u0432\u044b\u043f\u043b\u0430\u0442\u0443, \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0435\u043c\u0443 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c, \u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0432 \u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u043a\u0430\u0436\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043a\u043e\u0448\u0435\u043b\u0435\u043a \u0438 \u0441\u0443\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d \u0443\u043a\u0430\u0437\u0430\u043b \u0432 \u0437\u0430\u044f\u0432\u043a\u0435.<\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0444\u043e\u0440\u043c\u044b \u0432\u044b\u043f\u043b\u0430\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c <a href=\"https:\/\/konigsland.online\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> \u043f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 telegram \u043a\u043d\u043e\u043f\u043a\u0443.<\/p>\n<p>\u0421\u0430\u043c\u0443 \u0436\u0435 \u0432\u044b\u043f\u043b\u0430\u0442\u0443 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0445 \u043f\u043e\u0440\u0430\u0445 \u043f\u0440\u043e\u0449\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043e \u0441\u0432\u043e\u0435\u0433\u043e \u0445\u043e\u043b\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043b\u0430\u0442\u0435\u0436 \u043f\u043e \u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u0430\u043c, \u0430 \u0431\u0430\u043b\u0430\u043d\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0430\u0434\u043c\u0438\u043d\u043a\u0443. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043b\u0430\u0442\u0435\u0436 \u043f\u043e\u0441\u043b\u0435 \u043c\u043e\u0434\u0435\u0440\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 blockchain.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0420\u0435\u043a\u043b\u0430\u043c\u0430 \u043d\u044b\u043d\u0447\u0435 \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u0440\u043e\u0433\u0430\u044f. \u041f\u0440\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u0442\u0438\u0437\u0435\u0440\u043d\u044b\u0435 \u0441\u0435\u0442\u0438, \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0442\u0438 &#8212; \u0432\u0441\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0445 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0445 \u0432\u043b\u0438\u0432\u0430\u043d\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0418\u043d\u043e\u0433\u0434\u0430 \u0431\u044e\u0434\u0436\u0435\u0442 \u043d\u0430 \u0442\u0430\u043a\u0438\u0435 \u0440\u0435\u043a\u043b\u0430\u043c\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0432\u0435\u0441\u044c\u043c\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0442\u0440\u0430\u0444\u0438\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u043e\u0441\u044c \u0438 \u043d\u0435 \u0441\u0442\u043e\u044f\u043b\u043e \u043d\u0430 \u043c\u0435\u0441\u0442\u0435. \u0418\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u043e\u0437\u043d\u0430\u0433\u0440\u0430\u0436\u0434\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0435 \u0437\u0432\u0435\u043d\u043e, \u0432  \u0432\u0438\u0434\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0430 \u0440\u0435\u043a\u043b\u0430\u043c\u043d\u044b\u0445 \u0443\u0441\u043b\u0443\u0433, \u0438 \u043f\u043b\u0430\u0442\u0438\u0442\u044c \u0434\u0435\u043d\u044c\u0433\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0432\u043e\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c, \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u043e \u043c\u043e\u0442\u0438\u0432\u0438\u0440\u0443\u044f \u0438\u0445 \u043a \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0435. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0430\u043b\u044e\u0442\u0443, \u043d\u043e \u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442.  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0433\u0438\u0431\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0432\u043e\u0437\u043d\u0430\u0433\u0440\u0430\u0436\u0434\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442  \u0442\u043e\u0447\u043d\u043e \u0441\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u044e\u0434\u0436\u0435\u0442 \u043d\u0430 \u043f\u0440\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435. \u0422\u0443\u0442 \u0438 \u0432\u043e\u043b\u043a\u0438 \u0441\u044b\u0442\u044b \u0438 \u043e\u0432\u0446\u044b \u0446\u0435\u043b\u044b.<\/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\/articles\/656641\/\"> https:\/\/habr.com\/ru\/articles\/656641\/<\/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<h2>\u0428\u0430\u0433 1: \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0431\u0430\u043b\u0430\u043d\u0441<\/h2>\n<p>\u0411\u0430\u043b\u0430\u043d\u0441 + \u043a\u0440\u0438\u043f\u0442\u0430 + \u043f\u0438\u0442\u043e\u043d  &#8212; \u044d\u0442\u043e decimal. \u0412 decimal \u0443\u0434\u043e\u0431\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 string:<\/p>\n<pre><code class=\"python\">from decimal import Decimal print(Decimal(f'0.001'))  0.001<\/code><\/pre>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0432 \u0431\u0430\u0437\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043a\u043e\u043b\u043e\u043d\u043a\u0443 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0431\u0430\u043b\u0430\u043d\u0441\u0430 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043d\u0430 \u043f\u0440\u0438\u043c\u0435\u0440\u0435 django ORM, \u0430 \u0442\u0430\u043a \u0436\u0435 \u0441\u0440\u0430\u0437\u0443 \u043d\u0430\u0447\u0438\u0441\u043b\u0438\u043c \u0432\u0441\u0435\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u043f\u043e 4 \u0440\u0443\u0431\u043b\u044f \u0437\u0430 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u0430\u0446\u0438\u044e:<\/p>\n<pre><code class=\"python\">from django.db import models from django.contrib.auth.models import AbstractUser from app.models import BaseModel  class User(BaseModel, AbstractUser):   balance = models.DecimalField(     max_digits=8, decimal_places=6, default=Decimal('0.000001')   )<\/code><\/pre>\n<p>\u0421\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u043c \u043c\u0438\u0433\u0440\u0430\u0446\u0438\u0438 (<code>python manage.py makemigrations &amp;&amp; python manage.py migrate<\/code>). \u0422\u0435\u043f\u0435\u0440\u044c \u0434\u0430\u0432\u0430\u0439\u0442\u0435 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e \u0431\u0430\u043b\u0430\u043d\u0441 \u0432 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0435\u0433\u043e \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0435 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043d\u0430 \u043a\u0430\u0440\u0442\u0443 \u043e\u0442\u043c\u0435\u0442\u043a\u0443, \u0436\u0434\u0435\u0442 \u043c\u043e\u0434\u0435\u0440\u0430\u0446\u0438\u0438 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u043e\u043c \u0441\u0438\u0441\u0442\u0435\u043c\u044b, \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u0440\u0430\u0446\u0438\u0438, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0432\u043e\u0437\u043d\u0430\u0433\u0440\u0430\u0436\u0434\u0435\u043d\u0438\u0435 \u043d\u0430 \u0431\u0430\u043b\u0430\u043d\u0441. \u0418\u043d\u044b\u043c\u0438 \u0441\u043b\u043e\u0432\u0430\u043c\u0438: \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u043d\u043d\u0443\u044e \u043a\u043e\u043b\u043e\u043d\u043a\u0443. \u041d\u0443 \u0438 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u043c \u043a\u0430\u043a\u043e\u0435-\u0442\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u0443\u0441\u043f\u0435\u0445\u0435\/\u043f\u0440\u043e\u0432\u0430\u043b\u0435 \u0441\u0432\u043e\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439. \u0422\u0443\u0442 \u043d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0441\u0438\u0433\u043d\u0430\u043b\u0430 <code>post_save<\/code><\/p>\n<pre><code class=\"python\">from django.db.models.signals import post_save from django.dispatch import receiver from django.core.management import call_command from decimal import Decimal from app.models import Marker  @receiver(post_save, sender=Marker) def save_marker(sender, instance, created, **kwargs):   # is_modertaed - boolean flag means moderation is completed     if instance.is_moderated:       # this is custom add balance django command         call_command(\"add_user_balance\", instance) <\/code><\/pre>\n<p>\u041d\u0443 \u0438 \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0441\u0430\u043c\u0443 \u043a\u043e\u043c\u0430\u043d\u0434\u0443 <code>add_user_balance<\/code> \u0434\u043b\u044f django, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c package \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c commands, \u0430 \u0432\u043d\u0443\u0442\u0440\u0438 \u0444\u0430\u0439\u043b \u0441 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c add_user_balance.py:<\/p>\n<pre><code class=\"python\">import json from django.core.management.base import BaseCommand from app.models import Marker, UserProfile  class Command(BaseCommand):     help = \"Add user balance for new moderated user Marker\"      def add_arguments(self, parser):         parser.add_argument(\"instance\", nargs=\"+\", type=Marker)              def handle(self, *args, **options):         instance = options[\"instance\"][0]         parsed_instance = json.loads(instance.id)         profile = UserProfile.objects.get(           id=parsed_instance[\"profile_id\"]         )         profile.user.balance += Decimal('0.00001')         profile.save()<\/code><\/pre>\n<p>\u0415\u0449\u0435 \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u043e\u043f\u043e\u0432\u0435\u0449\u0435\u043d\u0438\u0435 \u043e\u0431 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0438 \u0431\u0430\u043b\u0430\u043d\u0441\u0430 \u0438 \u0443\u0441\u043f\u0435\u0448\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u0440\u0430\u0446\u0438\u0438, \u043e \u0442\u043e\u043c \u043a\u0430\u043a \u044d\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c, \u044f \u043f\u0438\u0441\u0430\u043b \u0432 <a href=\"https:\/\/habr.com\/ru\/post\/656209\/\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u043e\u0448\u043b\u043e\u0439<\/a> \u0441\u0442\u0430\u0442\u044c\u0435.<\/p>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u0439 \u0441\u0438\u0433\u043d\u0430\u043b \u043d\u0443\u0436\u043d\u043e \u043f\u043e\u0432\u0435\u0441\u0438\u0442\u044c \u043d\u0430 \u0441\u043e\u0431\u044b\u0442\u0438\u0435 delete \u0443 \u0434\u0430\u043d\u043d\u043e\u0439 \u043c\u043e\u0434\u0435\u043b\u0438. \u0412 \u044d\u0442\u043e\u043c \u043c\u0435\u0441\u0442\u0435 \u043c\u043e\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0435 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043e\u0442\u043c\u0435\u0442\u043a\u0430 \u043d\u0435 \u043f\u0440\u043e\u0448\u043b\u0430 \u043c\u043e\u0434\u0435\u0440\u0430\u0446\u0438\u044e. <\/p>\n<h2>\u0428\u0430\u0433 2: \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u0444\u043e\u0440\u043c\u0443 \u0434\u043b\u044f \u043e\u0444\u043e\u0440\u043c\u043b\u0435\u043d\u0438\u044f \u0432\u044b\u043f\u043b\u0430\u0442\u044b<\/h2>\n<p>\u041d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0432\u0441\u0435\u0433\u043e \u0434\u0432\u0430 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442\u0430 &#8212; \u043e\u0434\u0438\u043d \u043e\u0442\u043e\u0431\u0440\u0430\u0436\u0430\u0435\u0442 \u0431\u0430\u043b\u0430\u043d\u0441, \u0432\u0442\u043e\u0440\u043e\u0439 &#8212; \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0437\u0430\u043a\u0430\u0437\u0430\u0442\u044c \u0432\u044b\u043f\u043b\u0430\u0442\u0443. \u041f\u0435\u0440\u0432\u044b\u0439 \u043a\u043e\u043c\u043f\u043e\u043d\u0435\u043d\u0442 \u0434\u043e\u043b\u0436\u0435\u043d \u0443\u043c\u0435\u0442\u044c \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u0432\u0442\u043e\u0440\u043e\u0439. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e React \u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0443 material-ui.<\/p>\n<pre><code class=\"javascript\">import React, {useState} from \"react\"; import Tooltip from '@mui\/material\/Tooltip'; import Button from '@mui\/material\/Button';  import \".\/Balance.scss\";  const Balance = () => {   const [open, setOpen] = React.useState(false);   const [balance, setBalance] = React.useState(0);      const handleOpen = () => setOpen(true);   const handleClose = () => setOpen(false);      const title = '\u0417\u0434\u0435\u0441\u044c \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u043e\u043f\u0438\u0441\u0430\u043d\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043d\u0430\u0448\u0438\u0445 \u0432\u043e\u0437\u043d\u0430\u0433\u0440\u0430\u0436\u0434\u0435\u043d\u0438\u0439';   return (     &lt;div className=\"Balance\">       &lt;Tooltip title={title}>       &lt;span>{balance} BTC&lt;\/span>       &lt;\/Tooltip> &lt;Button onClick={handleOpen}>\u0412\u044b\u0432\u043e\u0434&lt;\/Button> &lt;Withdrawal handleClose={handleClose} open={open} \/>     &lt;\/div>   ) };  export default Balance; <\/code><\/pre>\n<pre><code class=\"javascript\">import React, {useState} from \"react\"; import Box from '@mui\/material\/Box'; import Typography from '@mui\/material\/Typography'; import Modal from '@mui\/material\/Modal';  import \".\/Withdrawal.scss\";  const Withdrawal = ({handleClose, open}) => {   const [amount, setAmount] = React.useState('0.000100');   const [wallet, setWallet] = React.useState('');   return (     &lt;div className=\"Withdrawal\">       &lt;Modal         open={open}         onClose={handleClose}         aria-labelledby=\"modal-modal-title\"         aria-describedby=\"modal-modal-description\"       >         &lt;Box>           &lt;Typography id=\"modal-modal-title\" variant=\"h6\" component=\"h2\">           \u0412\u044b\u0432\u043e\u0434 \u043e\u0442 0.0001 BTC           &lt;\/Typography>           &lt;Typography id=\"modal-modal-description\" sx={{ mt: 2 }}>             &lt;TextField               required               id=\"amount\"               name=\"amount\"               type=\"number\"               value={amount}               variant=\"outlined\"               inputProps={{                           step: 0.00001,                           min: 0.0001                          }}               label=\"\u0421\u0443\u043c\u043c\u0430\"               onChange={(e) => setAmount(                 parseFloat(e.target.value).toFixed(6) || '0.0001'               )}             \/>             &lt;br\/>             &lt;TextField               required               id=\"wallet\"               name=\"wallet\"               value={wallet}               label=\"\u041a\u043e\u0448\u0435\u043b\u0435\u043a\"               defaultValue=\"\"               onChange={(e) => setWallet(e.target.value)}             \/>             &lt;br\/>             &lt;Button                size=\"small\"               onClick={submitWithdrawal}               variant=\"contained\"               color=\"success\"             >               \u0412\u044b\u0432\u0435\u0441\u0442\u0438             &lt;\/Button>           &lt;\/Typography>         &lt;\/Box>       &lt;\/Modal>     &lt;\/div>   ) };  export default Withdrawal;<\/code><\/pre>\n<p>\u0411\u043e\u043b\u044c\u0448\u0430\u044f \u0447\u0430\u0441\u0442\u044c \u0430\u0442\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0437\u0434\u0435\u0441\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u043e\u043f\u0438\u0441\u0430\u043d\u044b \u0432 \u0434\u043e\u043a\u0443\u043c\u043c\u0435\u043d\u0442\u0430\u0446\u0438\u0438 material-ui, \u043d\u043e \u043d\u0430 \u0441\u0430\u043c\u043e\u043c \u0434\u0435\u043b\u0435, \u043c\u043d\u0435 \u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0438 \u0438\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e \u043f\u043e\u043d\u044f\u0442\u043d\u044b.<\/p>\n<p>\u0412\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u044d\u0442\u043e \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a:<\/p>\n<figure class=\"\"><figcaption><\/figcaption><\/figure>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0437\u0430\u043f\u0440\u043e\u0441 \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0442\u0430\u043c \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u044e, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c, \u0447\u0442\u043e \u0443 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0445\u0432\u0430\u0442\u0430\u0435\u0442 \u0431\u0430\u043b\u0430\u043d\u0441\u0430, \u0438 \u0447\u0442\u043e \u043e\u043d \u0432\u0432\u0435\u043b \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u0448\u0435\u043b\u0435\u043a. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u044b\u0435 \u043f\u0440\u043e\u0442\u043e\u043a\u043e\u043b\u044b \u043f\u0435\u0440\u0435\u0434\u0430\u0447\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0443\u0434\u043e\u0431\u0435\u043d Web Socket. \u041e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f amount \u0438 wallet \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440. \u041c\u043e\u0436\u043d\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <code>submitWithdrawal<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0443\u0434\u0435\u0442 \u0434\u0435\u043b\u0430\u0442\u044c <code>socket.emit<\/code> \u0438\u043b\u0438 <code>axios.post<\/code> \u043d\u0430 \u0441\u0435\u0440\u0432\u0435\u0440.<\/p>\n<h2>\u0428\u0430\u0433 3: \u0432\u0430\u043b\u0438\u0434\u0438\u0440\u0443\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435, \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0435\u043c \u0432\u044b\u043f\u043b\u0430\u0442\u0443<\/h2>\n<p>\u041e\u0441\u0442\u0430\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u043e \u0437\u0430 \u043c\u0430\u043b\u044b\u043c &#8212; \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0431\u044d\u043a\u044d\u043d\u0434\u0435, \u0447\u0442\u043e \u043d\u0430\u043c \u043f\u0440\u0438\u0441\u043b\u0430\u043b\u0438 \u0438 \u043f\u043e\u043d\u044f\u0442\u044c, \u0432\u0435\u0440\u043d\u044b \u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0440\u044f\u0434 \u043f\u0440\u043e\u0432\u0435\u0440\u043e\u043a, \u0430 \u0438\u043c\u0435\u043d\u043d\u043e \u0434\u0432\u0435:<\/p>\n<ol>\n<li>\n<p>\u0412\u0432\u0435\u043b\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439 BTC \u043a\u043e\u0448\u0435\u043b\u0435\u043a \u0438\u043b\u0438 \u043d\u0435\u0442?<\/p>\n<\/li>\n<li>\n<p>\u0412\u0432\u0435\u043b\u0438 \u0432\u0430\u043b\u0438\u0434\u043d\u0443\u044e \u0441\u0443\u043c\u043c\u0443 \u0438 \u043e\u043d\u0430 \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0431\u0430\u043b\u0430\u043d\u0441 \u0438\u043b\u0438 \u043d\u0435\u0442?<\/p>\n<\/li>\n<\/ol>\n<p>\u0414\u043b\u044f \u0432\u0430\u043b\u0438\u0434\u0430\u0446\u0438\u0438 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c 58-\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f base58. \u041f\u0435\u0440\u0432\u044b\u0435 4 \u0431\u0430\u0439\u0442\u0430 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0440\u043e\u043b\u044c\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u043e\u0439 \u0438 \u0438\u0445 \u043d\u0443\u0436\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0438\u0442\u044c \u0441\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c sha256 \u0445\u0435\u0448\u0430. \u0415\u0441\u043b\u0438 \u043e\u043d\u0438 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442, \u0442\u043e \u043a\u043e\u0448\u0435\u043b\u0435\u043a \u0432\u0430\u043b\u0438\u0434\u043d\u044b\u0439.<\/p>\n<pre><code class=\"python\">def decode_base58(btc_addr: str, length: int) -> bytes:     n = 0     for char in bc:         n = n * 58 + digits58.index(char)     return n.to_bytes(length, \"big\")   def check_btc_address(btc_addr: str) -> bool:     try:         byte_addr = decode_base58(           btc_addr=btc_addr, length=25         )         return byte_addr[-4:] == sha256(           sha256(byte_addr[:-4]).digest()         ).digest()[:4]     except Exception:         return False<\/code><\/pre>\n<p>\u0421\u0443\u043c\u043c\u0443 \u043f\u0440\u043e\u0432\u0435\u0440\u0438\u0442\u044c \u0432\u043e\u043e\u0431\u0449\u0435 \u043d\u0435 \u0442\u0440\u0443\u0434\u043d\u043e. \u0423\u0434\u043e\u0441\u0442\u043e\u0432\u0435\u0440\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u043e\u043d\u0430 \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0431\u0430\u043b\u0430\u043d\u0441 \u0438 \u043d\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u0447\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0441\u0443\u043c\u043c\u044b \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0432\u044b\u043f\u043b\u0430\u0442\u044b:<\/p>\n<pre><code class=\"python\">from decimal import Decimal  min_amnt = Decimal('0.0001')  def check_balance(amount: Decimal): return amnt >= min_amnt and balance - amnt >= 0 <\/code><\/pre>\n<p>\u041f\u043e\u0441\u043b\u0435 \u0442\u043e\u0433\u043e, \u043a\u0430\u043a \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u0435\u043c \u0432\u044b\u0437\u043e\u0432 \u044d\u0442\u0438\u0445 \u0434\u0432\u0443\u0445 \u043f\u0440\u043e\u0432\u0435\u0440\u0440\u043e\u043a, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0432\u0430\u043b\u0430\u0434\u0430\u0446\u0438\u0438 \u0438 \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u0442\u044c \u0438\u0445 \u043e\u0431\u0440\u0430\u0442\u043d\u043e \u043d\u0430 \u043a\u043b\u0438\u0435\u043d\u0442, \u0447\u0442\u043e\u0431\u044b \u0442\u0430\u043c \u043e\u0442\u043e\u0431\u0440\u0430\u0437\u0438\u0442\u044c \u0432 \u0444\u043e\u0440\u043c\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044e. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0436\u0435 \u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0435 \u0432\u0435\u0440\u043d\u044b \u0438 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0437\u0430\u0440\u0430\u0431\u043e\u0442\u0430\u043b \u043d\u0430 \u0432\u044b\u043f\u043b\u0430\u0442\u0443, \u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0435\u043c\u0443 \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0432 \u0442\u0435\u043b\u0435\u0433\u0440\u0430\u043c, \u0430 \u0430\u0434\u043c\u0438\u043d\u0438\u0441\u0442\u0440\u0430\u0442\u043e\u0440\u0443 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u043e\u0442\u043f\u0440\u0430\u0432\u0438\u043c \u0443\u0432\u0435\u0434\u043e\u043c\u043b\u0435\u043d\u0438\u0435 \u0432 \u043b\u0438\u0447\u043d\u044b\u0435 \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u044f, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0443\u043a\u0430\u0436\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f, \u043a\u043e\u0448\u0435\u043b\u0435\u043a \u0438 \u0441\u0443\u043c\u043c\u0443, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043d \u0443\u043a\u0430\u0437\u0430\u043b \u0432 \u0437\u0430\u044f\u0432\u043a\u0435.<\/p>\n<p>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u0438\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u0438 \u0444\u043e\u0440\u043c\u044b \u0432\u044b\u043f\u043b\u0430\u0442\u044b \u043c\u043e\u0436\u043d\u043e \u0443\u0432\u0438\u0434\u0435\u0442\u044c <a href=\"https:\/\/konigsland.online\/\" rel=\"noopener noreferrer nofollow\">\u0437\u0434\u0435\u0441\u044c<\/a> \u043f\u043e\u0441\u043b\u0435 \u0430\u0432\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 telegram \u043a\u043d\u043e\u043f\u043a\u0443.<\/p>\n<p>\u0421\u0430\u043c\u0443 \u0436\u0435 \u0432\u044b\u043f\u043b\u0430\u0442\u0443 \u043d\u0430 \u043f\u0435\u0440\u0432\u044b\u0445 \u043f\u043e\u0440\u0430\u0445 \u043f\u0440\u043e\u0449\u0435 \u043e\u0444\u043e\u0440\u043c\u043b\u044f\u0442\u044c \u0440\u0443\u043a\u0430\u043c\u0438, \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0441\u043e \u0441\u0432\u043e\u0435\u0433\u043e \u0445\u043e\u043b\u043e\u0434\u043d\u043e\u0433\u043e \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043b\u0430\u0442\u0435\u0436 \u043f\u043e \u0440\u0435\u043a\u0432\u0438\u0437\u0438\u0442\u0430\u043c, \u0430 \u0431\u0430\u043b\u0430\u043d\u0441 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f \u0441\u043f\u0438\u0441\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 \u0430\u0434\u043c\u0438\u043d\u043a\u0443. \u0412 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u043c \u043d\u0443\u0436\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u044d\u0442\u043e\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0438 \u0434\u0435\u043b\u0430\u0442\u044c \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u043b\u0430\u0442\u0435\u0436 \u043f\u043e\u0441\u043b\u0435 \u043c\u043e\u0434\u0435\u0440\u0430\u0446\u0438\u0438 \u0447\u0435\u0440\u0435\u0437 blockchain.<\/p>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u0420\u0435\u043a\u043b\u0430\u043c\u0430 \u043d\u044b\u043d\u0447\u0435 \u043e\u0447\u0435\u043d\u044c \u0434\u043e\u0440\u043e\u0433\u0430\u044f. \u041f\u0440\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442, \u0442\u0438\u0437\u0435\u0440\u043d\u044b\u0435 \u0441\u0435\u0442\u0438, \u0441\u043e\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0435 \u0441\u0435\u0442\u0438 &#8212; \u0432\u0441\u0435 \u044d\u0442\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u0442\u044c \u0441\u0435\u0440\u044c\u0435\u0437\u043d\u044b\u0445 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0445 \u0432\u043b\u0438\u0432\u0430\u043d\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043d\u0435\u0441\u0442\u0438 \u0436\u0435\u043b\u0430\u0435\u043c\u044b\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0418\u043d\u043e\u0433\u0434\u0430 \u0431\u044e\u0434\u0436\u0435\u0442 \u043d\u0430 \u0442\u0430\u043a\u0438\u0435 \u0440\u0435\u043a\u043b\u0430\u043c\u043d\u044b\u0435 \u043a\u043e\u043c\u043f\u0430\u043d\u0438\u0438 \u0432\u0435\u0441\u044c\u043c\u0430 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0445\u043e\u0447\u0435\u0442\u0441\u044f \u0432\u0441\u0435 \u0436\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0442\u044c \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u044b\u0439 \u0442\u0440\u0430\u0444\u0438\u043a, \u0447\u0442\u043e\u0431\u044b \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0440\u0430\u0437\u0432\u0438\u0432\u0430\u043b\u043e\u0441\u044c \u0438 \u043d\u0435 \u0441\u0442\u043e\u044f\u043b\u043e \u043d\u0430 \u043c\u0435\u0441\u0442\u0435. \u0418\u043c\u0435\u043d\u043d\u043e \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u0446\u0435\u043b\u0435\u0439 \u043e\u0442\u043b\u0438\u0447\u043d\u043e \u043f\u043e\u0434\u0445\u043e\u0434\u0438\u0442 \u0441\u0438\u0441\u0442\u0435\u043c\u0430 \u0432\u043e\u0437\u043d\u0430\u0433\u0440\u0430\u0436\u0434\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u043c\u043e\u0436\u0435\u0442 \u0438\u0437\u0431\u0435\u0436\u0430\u0442\u044c \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0435 \u0437\u0432\u0435\u043d\u043e, \u0432  \u0432\u0438\u0434\u0435 \u043f\u043e\u0441\u0442\u0430\u0432\u0449\u0438\u043a\u0430 \u0440\u0435\u043a\u043b\u0430\u043c\u043d\u044b\u0445 \u0443\u0441\u043b\u0443\u0433, \u0438 \u043f\u043b\u0430\u0442\u0438\u0442\u044c \u0434\u0435\u043d\u044c\u0433\u0438 \u043d\u0435\u043f\u043e\u0441\u0440\u0435\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0441\u0432\u043e\u0438\u043c \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c, \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u043e \u043c\u043e\u0442\u0438\u0432\u0438\u0440\u0443\u044f \u0438\u0445 \u043a \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u043d\u0430 \u043f\u043b\u043e\u0449\u0430\u0434\u043a\u0435. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u043e\u0436\u043d\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0430\u043b\u044e\u0442\u0443, \u043d\u043e \u0438 \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0444\u0438\u043d\u0430\u043d\u0441\u043e\u0432\u044b\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442.  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u0433\u0438\u0431\u043a\u043e \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440\u044b \u0432\u043e\u0437\u043d\u0430\u0433\u0440\u0430\u0436\u0434\u0435\u043d\u0438\u0439, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u0438\u0442  \u0442\u043e\u0447\u043d\u043e \u0441\u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u044e\u0434\u0436\u0435\u0442 \u043d\u0430 \u043f\u0440\u043e\u0434\u0432\u0438\u0436\u0435\u043d\u0438\u0435. \u0422\u0443\u0442 \u0438 \u0432\u043e\u043b\u043a\u0438 \u0441\u044b\u0442\u044b \u0438 \u043e\u0432\u0446\u044b \u0446\u0435\u043b\u044b.<\/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\/articles\/656641\/\"> https:\/\/habr.com\/ru\/articles\/656641\/<\/a><br \/><\/br><\/br><\/p>\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-403712","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/403712","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=403712"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/403712\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=403712"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=403712"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=403712"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}