feat: add withdraw

This commit is contained in:
2026-06-21 14:16:20 +03:00
parent 8f60637e8d
commit 56841b83ce
32 changed files with 1291 additions and 44 deletions

View File

@@ -90,10 +90,21 @@ class Settings(BaseSettings):
RABBIT_EMAIL_CODE_QUEUE: str = "email.verification_code"
RABBIT_CRYPTO_TRANSFER_QUEUE: str = "crypto.transfer.requested"
RABBIT_CRYPTO_TRANSFER_COMPLETED_QUEUE: str = "crypto.transfer.completed"
RABBIT_SBP_WITHDRAWAL_USDT_REQUESTED_QUEUE: str = 'sbp.withdrawal.usdt.requested'
RABBIT_SBP_WITHDRAWAL_WALLET_EVENTS_QUEUE: str = 'sbp.withdrawal.wallet.events'
ITPAY_PUBLIC_ID: str
ITPAY_API_SECRET: str
MOZEN_API_BASE_URL: str = 'https://extgw.mozen.io'
MOZEN_API_SECRET: str = ''
MOZEN_CLIENT_ID: str = ''
MOZEN_ENDPOINT_ID: str = ''
MOZEN_MERCHANT_ID: str = ''
MOZEN_PARK_ID: str = ''
MOZEN_PARK_TOKEN: str = ''
SBP_WITHDRAWAL_WALLET_ADDRESS: str = ''
CLOUD_KASSIR_PUBLIC_ID: str = ''
CLOUD_KASSIR_API_SECRET: str = ''
@@ -210,6 +221,28 @@ class Settings(BaseSettings):
rb_set('password', 'RABBIT_PASSWORD')
rb_set('vhost', 'RABBIT_VHOST')
extgw = read_secret_optional('extgw')
if extgw:
extgw_ci = {str(k).lower(): v for k, v in extgw.items()}
def extgw_set(field: str, env_key: str) -> None:
v = extgw_ci.get(field)
if v is None:
return
if isinstance(v, str) and not v.strip():
return
data[env_key] = str(v).strip()
extgw_set('api_base_url', 'MOZEN_API_BASE_URL')
extgw_set('api_secret', 'MOZEN_API_SECRET')
extgw_set('client_id', 'MOZEN_CLIENT_ID')
extgw_set('endpoint_id', 'MOZEN_ENDPOINT_ID')
extgw_set('merchant_id', 'MOZEN_MERCHANT_ID')
extgw_set('park_id', 'MOZEN_PARK_ID')
extgw_set('park_token', 'MOZEN_PARK_TOKEN')
extgw_set('wallet_address', 'SBP_WITHDRAWAL_WALLET_ADDRESS')
extgw_set('usdt_wallet_address', 'SBP_WITHDRAWAL_WALLET_ADDRESS')
keydb = read_secret('keydb')
k_ci = {str(k).lower(): v for k, v in keydb.items()}