Network

Network is a class allows you to build a URL to the API endpoints for specific network.

Crypto Pay API has two networks:

The main network for transactions with real cryptocurrency.

The network for testing purposes in which currency has no real value.

Usage example

You can create an instance of CryptoPay client for both nets.

from aiosend import MAINNET, TESTNET, CryptoPay

main_client = CryptoPay(
    "TOKEN",
    MAINNET,  # MAINNET is default
)

test_client = CryptoPay(
    "TOKEN",
    TESTNET,
)
class aiosend.client.network.Network(name, base)

Configuration for endpoints.

base: str

Base URL

get_check_image(asset, asset_amount, fiat, fiat_amount, main)

Return check image url.

Return type:

str

get_qr(link)

Return qr code link.

Return type:

str

get_rates_image(base, quote, rate, percent)

Return rates image url.

Return type:

str

name: str

Net name

url(method)

Return URL for method.

Return type:

str