Skip to main content

Tonviewer is a Python library that allows you to fetch ( real-time balance of wallet , transactions , price ) data .

Project description

Telegram Owner

🚀 Quick Start

from Tonviewer import Wallet, HashTx
from Tonviewer.dollers import Dollers

def main():
    # Replace with your wallet address
    wallet = Wallet("wallet_address_here")

    # Get wallet info (balance + TON details)
    wallet.info()

    # Example: Get last 3 transactions (default limit = 1)
    wallet.transactions(limit=3)
    
    # get (Sent TON, Received TON, NFT Transfer, Transfer Token, Gas Relay) with limit
    _map = {
            "send":           "Sent TON",
            "sent":           "Sent TON",
            "send ton":       "Sent TON",
            "sent ton":       "Sent TON",
            "receive":        "Received TON",
            "received":       "Received TON",
            "receive ton":    "Received TON",
            "received ton":   "Received TON",
            "nft":            "NFT Transfer",
            "nft transfer":   "NFT Transfer",
            "transfer token": "Transfer Token",
            "jetton":         "Transfer Token",
            "token":          "Transfer Token",
            "gas relay":      "Gas Relay",
            "gas":            "Gas Relay",
            "relay":          "Gas Relay",
        }
    wallet.action(action="sent ton", limit=4)
    
    # Print Ton Price --> $
    Ton_price = Dollers()
    print(Ton_price._TON_USDT())

def get_transaction_by_hash():
    # Pass a transaction hash
    tx = HashTx(
        hashtx="b4566294bb20e0c22c57109f1128b903d4446d12710b3926b48c42cfc60dd097"
    )

    tx.get()  # Prints and returns dict

if __name__ == "__main__":
    main()
    get_transaction_by_hash()

Installation and Development 🚀

  • Via Git:
$ python -m pip install git+https://github.com/DevZ44d/Tonviewer.git
  • Via PyPi:
$ python -m pip install --upgrade Tonviewer

Tonviewer

  • Tonviewer is a Python library that allows you to fetch real-time data.

  • It enables users to view wallet balances and live coin information and get transactions of Wallet with ease, making it perfect for TON developers, analysts, and bot creators.

✨ Features

  • 🧾 Real-time TON wallet balance fetching.
  • 🔎 Transaction by Hash → Simply pass a transaction hash, it grabs the page via Selenium.
  • 📄 Parse Raw HTML → Already have the page source? Pass it directly.
  • 🟢 Successful TX → Extracts Time, Action, From, To, Paid For, Price, Status, Comment.
  • 🔴 Failed TX → Extracts only the essentials (Time, Action, From, To, Comment, Status).
  • ⚠️ Invalid Hash → Clean error message when the transaction address is not valid.
  • 🧾 Auto JSON Print → Prints a formatted JSON result and returns it as a Python dict.

Using in Terminal 🚀

Tonviewer -[OPTIONS] "[Wallet]"

Usage 📚

Tonviewer -[OPTIONS] "[FOR-OPTION]"

Options
    -w, --wallet                    Prints balance of wallet .
    -i, --info                      Get wallet info
    -t, --transactions              Get transactions of Wallet . 
    -l, --limit                     Number of times to get transactions .
    -a, --action                    Filter by action .
    -H, --hashtx                    Pass a transaction hash
    -h, --help                      Display help message .
    -v, --version                   Show Version Of Libarary and info .

🚀 Usage (Class Terminal)

  • 🔹 Get wallet info:
Tonviewer -w "UQ..." -i
  • 🔹 All transactions (-t [-l
Tonviewer -t "UQ..." -l 3
  • 📦 Pass a transaction hash:
Tonviewer -H "d0..."
  • 🔹 Action filter (-w -a [-l
Tonviewer -w "UQ..." -a "Sent TON" -l 5

📦 Example format response of Wallet Method:

{
  "Balance": "0.70629411 TON ≈ 0.854 $",
  "Status": "active",
  "Last Activity": "2026-02-26 05:06:48 PM",
  "Name": "ddddi.t.me",
  "Icon": "https://cache.tonapi.io/imgproxy/wVVaalJBHOeiyU0Tf_bqX1QQjbvEl5oFOS8OvwIV5Do/rs:fill:200:200:1/g:no/aHR0cHM6Ly90Lm1lL2kvdXNlcnBpYy8zMjAvZGRkZGkuanBn.webp",
  "NFT Count": 351
}

📦 Example format response of Transactions Method ,

{
  "transactions": [
    {
      "Hash": "e1d33799a2ab8160514aca0f3a757161d141ceeaee06bf27284b464ca9161124",
      "Time": "08 Mar 05:11:07 AM",
      "Action": "Received TON",
      "From": "UQAh_cfG6nAD8EazS3dED8mtQo3bmeGn6nMM8TAZ-9h50k1D",
      "To": "ddddi.t.me",
      "Price": "+0.772 TON ≈ 1.03790 $",
      "State": "Success",
      "Comment": "احبك",
      "Limit": "1"
    },
    {
      "Hash": "965e0cfc878ceb81fbbdddbf0b7c19dad5ec790ab1888e2a5ba72638224a5308",
      "Time": "07 Mar 01:25:09 AM",
      "Action": "NFT Transfer",
      "From": "UQAh_cfG6nAD8EazS3dED8mtQo3bmeGn6nMM8TAZ-9h50k1D",
      "To": "ddddi.t.me",
      "State": "Success",
      "Limit": "2"
    }
  ],
  "skipped": "Skipped 0 unsupported transactions"
}

📦 Example Output of HashTx Method (NFT,BID,TON,AUCTION) .

✅ Successful Transaction :

{
  "actions": [
    {
      "Time": "2026-03-02 07:38:07 PM",
      "Action": "OK GASRELAY",
      "From": "TONAPI gas proxy",
      "To": "UQBAZ3qWaaoIC8Pq5ELnz2ofYoGN_E3mhzxhE-8EWTpMYgyc",
      "Price": "0.154 TON",
      "Comment": "Relay for gas",
      "Status": "SUCCESS"
    },
    {
      "Time": "2026-03-02 07:38:07 PM",
      "Action": "OK JETTONTRANSFER",
      "From": "UQBAZ3qWaaoIC8Pq5ELnz2ofYoGN_E3mhzxhE-8EWTpMYgyc",
      "To": "UQAh_cfG6nAD8EazS3dED8mtQo3bmeGn6nMM8TAZ-9h50k1D",
      "Price": "1.3 USD₮",
      "Status": "SUCCESS",
      "Comment": "Congratulations"
    }
  ]
}

❌ Failed Transaction:

{
  "actions": [
    {
      "Time": "2024-01-28 08:37:32 PM",
      "Action": "FAILED AUCTION BID",
      "From": "UQAh_cfG6nAD8EazS3dED8mtQo3bmeGn6nMM8TAZ-9h50k1D",
      "To": "UQC7Ptcp7G1IhS2t__alZVlPQF7TtXk7XgsLf-wCBbHMboYF",
      "Price": "20.000 TON ≈ 24.96000 $",
      "Status": "FAILED"
    }
  ]
}

⚠️ Invalid Hash:

{
  "Error": "This doesn't look like a valid transaction address. Where'd you get that?"
}

💬 Help & Support .

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

tonviewer-1.1.7.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

tonviewer-1.1.7-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

File details

Details for the file tonviewer-1.1.7.tar.gz.

File metadata

  • Download URL: tonviewer-1.1.7.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for tonviewer-1.1.7.tar.gz
Algorithm Hash digest
SHA256 105425768c6212513ad7c0a715af57e02fe59e84dac122d516ec3a3e0d3fac19
MD5 6e35fe84f767cca21131167aa10017aa
BLAKE2b-256 99667a4a24c6a01b818e66750db13bd5a0918c5da3d1ae65f8157a21ab2cca66

See more details on using hashes here.

File details

Details for the file tonviewer-1.1.7-py3-none-any.whl.

File metadata

  • Download URL: tonviewer-1.1.7-py3-none-any.whl
  • Upload date:
  • Size: 16.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.0

File hashes

Hashes for tonviewer-1.1.7-py3-none-any.whl
Algorithm Hash digest
SHA256 d7d59a450f3fd6cad60c2a9ee402fe9350a84c8e3f7303f13121c0094a6d4fad
MD5 e2a1a74cc4f86d6add3a479830c95901
BLAKE2b-256 73ef2de842b674717304c06d1cf151c41d02d064c340d1c4821978bc91bd2052

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page