pytonapi 0.4.7
pip install pytonapi
Released:
Provide access to indexed TON blockchain.
Navigation
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License
- Author: nessshon
Classifiers
- License
- Operating System
- Programming Language
Project description
📦 PyTONAPI
Python SDK for tonapi.io.
Information about the API can be found in the documentation.
To use the API you need an API key, you can get it here tonconsole.com.
For creating wallets, transferring TON, Jetton, NFTs, and other operations, recommend using tonutils in combination with TonapiClient
. For more information, refer to the library documentation.
Usage
Installation
pip install pytonapi
Examples
from pytonapi import AsyncTonapi
# Declare an asynchronous function for using await
async def main():
# Create a new Tonapi object with the provided API key
tonapi = AsyncTonapi(api_key="Your API key")
# Specify the account ID
account_id = "EQC-3ilVr-W0Uc3pLrGJElwSaFxvhXXfkiQA3EwdVBHNNess" # noqa
# Retrieve account information asynchronously
account = await tonapi.accounts.get_info(account_id=account_id)
# Print account details
print(f"Account Address (raw): {account.address.to_raw()}")
print(f"Account Address (userfriendly): {account.address.to_userfriendly(is_bounceable=True)}")
print(f"Account Balance (nanoton): {account.balance.to_nano()}")
print(f"Account Balance (amount): {account.balance.to_amount()}")
if __name__ == '__main__':
import asyncio
# Run the asynchronous function
asyncio.run(main())
- Additional examples can be found examples folder.
Donations
TON - UQCDrgGaI6gWK-qlyw69xWZosurGxrpRgIgSkVsgahUtxZR0
USDT (TRC-20) - TGKmm9H3FApFw8xcgRcZDHSku68vozAjo9
Contribution
We welcome your contributions! If you have ideas for improvement or have identified a bug, please create an issue or submit a pull request.
Support
Supported by TONAPI and TON Society (Grants and Bounties program).
License
This repository is distributed under the MIT License. Feel free to use, modify, and distribute the code in accordance with the terms of the license.
Project details
Unverified details
These details have not been verified by PyPIProject links
Meta
- License: MIT License
- Author: nessshon
Classifiers
- License
- Operating System
- Programming Language
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file pytonapi-0.4.7.tar.gz
.
File metadata
- Download URL: pytonapi-0.4.7.tar.gz
- Upload date:
- Size: 34.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3d6a05b49c8d9dff59890e410abc262adf0fe20cc173f2309bbffd40fa73761d |
|
MD5 | 3ef8f012546a9b92c1ff2ba3be08ef2b |
|
BLAKE2b-256 | 83062945574485f9b9264df63a33d751f97b54df54f5f7688a982e1b8e814da0 |
File details
Details for the file pytonapi-0.4.7-py3-none-any.whl
.
File metadata
- Download URL: pytonapi-0.4.7-py3-none-any.whl
- Upload date:
- Size: 45.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7466299e4f4068d39c717b6f8d5387fcc074e5b0a6d0bc200eec9a396319a2bb |
|
MD5 | 216f37b8d9d9aeadca183ce1deed501d |
|
BLAKE2b-256 | b6ca4c1a864d5435338d95d4e505a12dd3a3e42cb2a0a1f48168f9a9e5915e7b |