Skip to content

TONAPI library for Python #375

@nessshon

Description

@nessshon

Summary

A Python library for Tonapi, offering comprehensive type descriptions.

Context

This library allows users to use different versions of Tonapi, supporting both testnet and mainnet. The Tonapi library is structured to improve usability. When creating an instance of the class, users can specify the network and token. The library carefully documents Tonapi methods, organizing them into
intuitive subclasses.

Library Features

  • Asynchronous and synchronous function calls.
  • Data validation using Pydantic, providing helpful insights.
  • Raw and Streaming API support.

The library, hosted on GitHub, has been making remarkable progress. Almost all popular methods have been implemented, with just a few remaining for completion. The library is poised to offer the complete set of Tonapi features.

The creators of Tonapi have officially recognized and endorsed this library. It is now affiliated with Tonapi and linked on the TonKeeper GitHub page, solidifying its integration with the Tonapi ecosystem.

Tonapi methods marked with a checkmark are already described and organized into subclasses:

UPD:
Done! All methods have been added.

Streaming API

  • SSE

  • v2/sse/accounts/transactions?accounts={accounts}

  • v2/sse/accounts/traces?accounts={accounts}

  • v2/sse/mempool?accounts={accounts}

  • Websocket

  • v2/websocket/subscribe_account

  • v2/websocket/subscribe_trace

  • v2/websocket/subscribe_mempool

Raw API

  • Blockchain

  • /v2/blockchain/blocks/{block_id}

  • /v2/blockchain/masterchain/{masterchain_seqno}/shards

  • /v2/blockchain/blocks/{block_id}/transactions

  • /v2/blockchain/blocks/{block_id}/config/raw

  • /v2/blockchain/transactions/{transaction_id}

  • /v2/blockchain/messages/{msg_id}/transaction

  • /v2/blockchain/validators

  • /v2/blockchain/masterchain-head

  • /v2/blockchain/accounts/{account_id}

  • /v2/blockchain/accounts/{account_id}/transactions

  • /v2/blockchain/accounts/{account_id}/methods/{method_name}

  • /v2/blockchain/message

  • /v2/blockchain/config

  • /v2/blockchain/config/raw

  • /v2/blockchain/accounts/{account_id}/inspect

  • Accounts

  • /v2/address/{account_id}/parse

  • /v2/accounts/_bulk

  • /v2/accounts/{account_id}

  • /v2/accounts/{account_id}/dns/backresolve

  • /v2/accounts/{account_id}/jettons

  • /v2/accounts/{account_id}/jettons/history

  • /v2/accounts/{account_id}/jettons/{jetton_id}/history

  • /v2/accounts/{account_id}/nfts

  • /v2/accounts/{account_id}/nfts/history

  • /v2/accounts/{account_id}/events

  • /v2/accounts/{account_id}/events/{event_id}

  • /v2/accounts/{account_id}/traces

  • /v2/accounts/{account_id}/subscriptions

  • /v2/accounts/{account_id}/reindex

  • /v2/accounts/search

  • /v2/accounts/{account_id}/dns/expiring

  • /v2/accounts/{account_id}/publickey

  • /v2/accounts/{account_id}/diff

  • Emulation

  • /v2/events/emulate

  • /v2/traces/emulate

  • /v2/wallet/emulate

  • /v2/accounts/{account_id}/events/emulate

  • NFT

  • /v2/accounts/{account_id}/nfts/history

  • /v2/nfts/collections

  • /v2/nfts/collections/{account_id}

  • /v2/nfts/collections/{account_id}/items

  • /v2/nfts/_bulk

  • /v2/nfts/{account_id}

  • /v2/nfts/{account_id}/history

  • DNS

  • /v2/dns/{domain_name}

  • /v2/nfts/{account_id}/history

  • /v2/dns/{domain_name}/resolve

  • /v2/dns/{domain_name}/bids

  • /v2/dns/auctions

  • Traces

  • /v2/traces/{trace_id}

  • Events

  • /v2/events/{event_id}

  • Jettons

  • /v2/jettons

  • /v2/jettons/{account_id}

  • /v2/jettons/{account_id}/holders

  • /v2/events/{event_id}/jettons

  • Staking

  • /v2/staking/nominator/{account_id}/pools

  • /v2/staking/pool/{account_id}

  • /v2/staking/pool/{account_id}/history

  • /v2/staking/pools

  • Storage

  • /v2/storage/providers

  • Rates

  • /v2/rates

  • /v2/rates/chart

  • Connect

  • /v2/tonconnect/payload

  • /v2/tonconnect/stateinit

  • Wallet

  • /v2/wallet/backup

  • /v2/wallet/auth/proof

  • /v2/pubkeys/{public_key}/wallets

  • /v2/wallet/{account_id}/seqno

  • Lite Server

  • /v2/liteserver/get_masterchain_info

  • /v2/liteserver/get_masterchain_info_ext

  • /v2/liteserver/get_time

  • /v2/liteserver/get_block/{block_id}

  • /v2/liteserver/get_state/{block_id}

  • /v2/liteserver/get_block_header/{block_id}

  • /v2/liteserver/send_message

  • /v2/liteserver/get_account_state/{account_id}

  • /v2/liteserver/get_shard_info/{block_id}

  • /v2/liteserver/get_all_shards_info/{block_id}

  • /v2/liteserver/get_transactions/{account_id}

  • /v2/liteserver/list_block_transactions/{block_id}

  • /v2/liteserver/get_block_proof

  • /v2/liteserver/get_config_all/{block_id}

  • /v2/liteserver/get_shard_block_proof/{block_id}

References

tonapi.io

Estimate suggested reward

  • Standard TON Footstep NFT
  • 500 USD in TON

Metadata

Metadata

Assignees

Labels

ApprovedThis proposal is approved by the committeeDeveloper ToolRelated to tools or utilities used by developers

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions