Skip to main content

TON Blockchain jetton wrappers, implementation of TEP-74

Project description

agton-jetton

import os
from agton.ton import ToncenterClient, Address, to_nano, comment
from agton.jetton import JettonMaster
from agton.wallet import WalletV3R2

mnemonic = os.environ["WALLET_MNEMONIC"]
provider = ToncenterClient(net="testnet") # pass api_key=... if you have one

wallet = WalletV3R2.from_mnemonic(provider, mnemonic)
jetton_master = JettonMaster(provider, Address.parse("kQBLdsCM9ksHe22vgPMBN7OScP6z6w8xAsM5AuHldrDT9EwR"))
jetton_wallet = jetton_master.get_jetton_wallet(wallet.address)

message = jetton_wallet.create_jetton_transfer(
    value=to_nano(0.5),                  # native TON to cover forwarding fees
    query_id=0,
    amount=to_nano(777),                 # jetton amount
    destination=wallet.address,
    response_destination=wallet.address,
    forward_amount=to_nano(0.1),
    forward_payload=comment("agton"),
)

wallet.send(message)

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

agton_jetton-0.2.4.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

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

agton_jetton-0.2.4-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file agton_jetton-0.2.4.tar.gz.

File metadata

  • Download URL: agton_jetton-0.2.4.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for agton_jetton-0.2.4.tar.gz
Algorithm Hash digest
SHA256 baeb44395c0b4b0b8a72a19d6b5fa519026d7717f2a225dec0b4287c5c0547ce
MD5 6ce1f6925dae51a935dce483e573c5c7
BLAKE2b-256 489f79788b12ffd7cbb6009db7d57b06880234ca22d27acf423df411b1b131c3

See more details on using hashes here.

File details

Details for the file agton_jetton-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: agton_jetton-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.13.2

File hashes

Hashes for agton_jetton-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 c5b48a724e654fdb8e414aaff8e1954a041c6bb14795a4dfd787d0c55646823f
MD5 0f035801874684b4f06f918f6d3255be
BLAKE2b-256 a11332da0c2a587406ac277393bb263102bfc2b36bb2a2328879782549f2675b

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