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.2.tar.gz (4.1 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.2-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agton_jetton-0.2.2.tar.gz
  • Upload date:
  • Size: 4.1 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.2.tar.gz
Algorithm Hash digest
SHA256 e81b52b8a9e851a070fd9749305c8feac353e42c139d38972da236dacf09fff8
MD5 4805a82c33110045d5d0b4e87a50d7bb
BLAKE2b-256 ac9185a05a35328e0daa4920a36dcf914def08f074d39af26d417f868b818e1b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agton_jetton-0.2.2-py3-none-any.whl
  • Upload date:
  • Size: 5.6 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 ac00aa5f8198b4990d5f81eecc9e625591a73c3117b438c58069b102a142ec65
MD5 ac0936dbf20ddc5da8741501aae2db1e
BLAKE2b-256 11c50638d0877580004c531372a35c8b243bda2c5059fe35bf5208109efbefb9

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