From Pypi
pip install pycrystalpay
from pycrystalpay import AsyncCrystalPay, types
client = AsyncCrystalPay(
auth_login="mylogin",
auth_secret="mysecret",
wait_cooldown=True # auto wait 5 rps
)Создание платежа
/invoice/create
payment: types.InvoiceCreate = await client.invoice_create("100","purchase","1")
payment.url # Ссылка для оплаты
payment.idПолучение информации о платеже по id
/invoice/info
response: types.InvoiceInfo = await client.invoice_info("id_платежа")
if response.is_payed:
...response: types.MeInfo = await client.me_info()response: types.BalanceList = await client.balance_list(hide_empty=True)response: types.BalanceGet = await client.balance_list(method="BITCOIN")response: types.MethodList = await client.method_list(compact=True)response: types.MethodInfo = await client.method_get(method="BITCOIN")response: bool = await client.method_edit(method="BITCOIN", enabled=True, extra_commission_percent=0)response: types.PayoffCreate = await client.payoff_create(
"SBPP2P",
"somewallet",
100,
"amount"
)response: types.PayoffData = await client.payoff_create(id="some_id")response: types.PayoffData = await client.payoff_cancel(id="some_id")response: types.PayoffData = await client.payoff_get(id="some_id")response: List[str] = await client.ticker_list()response: types.TickerGet = await self.client.ticker_get(["ETH", "BTC"], "BNB")