RAPTOR v18.4: Исправлена отчетность, активированы выходные

This commit is contained in:
root
2026-04-18 23:26:45 +03:00
commit ef0958239e
312 changed files with 54247 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
import asyncio
import os
import uuid
from _decimal import Decimal
from t_tech.invest import AccountType, AsyncClient
from t_tech.invest.schemas import CurrencyTransferRequest
from t_tech.invest.utils import decimal_to_money
async def main():
token = os.environ["INVEST_TOKEN"]
async with AsyncClient(token) as client:
accounts = [
i
for i in (await client.users.get_accounts()).accounts
if i.type == AccountType.ACCOUNT_TYPE_TINKOFF
]
if len(accounts) < 2:
print("Недостаточно счетов для демонстрации")
return
from_account_id = accounts[0].id
to_account_id = accounts[1].id
await client.users.currency_transfer(
CurrencyTransferRequest(
from_account_id=from_account_id,
to_account_id=to_account_id,
amount=decimal_to_money(Decimal(1), "rub"),
transaction_id=str(uuid.uuid4()),
)
)
print("Перевод выполнен")
if __name__ == "__main__":
asyncio.run(main())

View File

@@ -0,0 +1,16 @@
import asyncio
import os
from t_tech.invest import AsyncClient
async def main():
token = os.environ["INVEST_TOKEN"]
async with AsyncClient(token) as client:
response = await client.users.get_bank_accounts()
print(response)
if __name__ == "__main__":
asyncio.run(main())

View File

@@ -0,0 +1,41 @@
import asyncio
import os
from _decimal import Decimal
from t_tech.invest import AccountType, AsyncClient
from t_tech.invest.schemas import PayInRequest
from t_tech.invest.utils import decimal_to_money
async def main():
token = os.environ["INVEST_TOKEN"]
async with AsyncClient(token) as client:
accounts = [
i
for i in (await client.users.get_accounts()).accounts
if i.type == AccountType.ACCOUNT_TYPE_TINKOFF
]
bank_accounts = await client.users.get_bank_accounts()
if len(accounts) < 1 or len(bank_accounts.bank_accounts) < 1:
print("Недостаточно счетов для демонстрации")
return
from_account_id = bank_accounts.bank_accounts[0].id
to_account_id = accounts[0].id
await client.users.pay_in(
PayInRequest(
from_account_id=from_account_id,
to_account_id=to_account_id,
amount=decimal_to_money(Decimal(1), "rub"),
)
)
print("Пополнение выполнено")
if __name__ == "__main__":
asyncio.run(main())

View File

@@ -0,0 +1,40 @@
import os
import uuid
from _decimal import Decimal
from t_tech.invest import AccountType, Client
from t_tech.invest.schemas import CurrencyTransferRequest
from t_tech.invest.utils import decimal_to_money
def main():
token = os.environ["INVEST_TOKEN"]
with Client(token) as client:
accounts = [
i
for i in client.users.get_accounts().accounts
if i.type == AccountType.ACCOUNT_TYPE_TINKOFF
]
if len(accounts) < 2:
print("Недостаточно счетов для демонстрации")
return
from_account_id = accounts[0].id
to_account_id = accounts[1].id
client.users.currency_transfer(
CurrencyTransferRequest(
from_account_id=from_account_id,
to_account_id=to_account_id,
amount=decimal_to_money(Decimal(1), "rub"),
transaction_id=str(uuid.uuid4()),
)
)
print("Перевод выполнен")
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,15 @@
import os
from t_tech.invest import Client
def main():
token = os.environ["INVEST_TOKEN"]
with Client(token) as client:
response = client.users.get_bank_accounts()
print(response)
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,15 @@
import os
from t_tech.invest import Client
TOKEN = os.environ["INVEST_TOKEN"]
def main():
with Client(TOKEN) as client:
response = client.users.get_info()
print(response)
if __name__ == "__main__":
main()

View File

@@ -0,0 +1,40 @@
import os
from _decimal import Decimal
from t_tech.invest import AccountType, Client
from t_tech.invest.schemas import PayInRequest
from t_tech.invest.utils import decimal_to_money
def main():
token = os.environ["INVEST_TOKEN"]
with Client(token) as client:
accounts = [
i
for i in client.users.get_accounts().accounts
if i.type == AccountType.ACCOUNT_TYPE_TINKOFF
]
bank_accounts = client.users.get_bank_accounts().bank_accounts
if len(accounts) < 1 or len(bank_accounts) < 1:
print("Недостаточно счетов для демонстрации")
return
from_account_id = bank_accounts[0].id
to_account_id = accounts[0].id
client.users.pay_in(
PayInRequest(
from_account_id=from_account_id,
to_account_id=to_account_id,
amount=decimal_to_money(Decimal(1), "rub"),
)
)
print("Пополнение выполнено")
if __name__ == "__main__":
main()