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

Uploaded Python 3

File details

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

File metadata

  • Download URL: agton_jetton-0.2.3.tar.gz
  • Upload date:
  • Size: 4.0 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.3.tar.gz
Algorithm Hash digest
SHA256 522ca9dec59658d24df3ac45a73fd301501ac20645b28ff07fe43e85f67240a2
MD5 1cdfa0f7e379de5a138cddfdee43fa50
BLAKE2b-256 a981fd7dcee1c37ce81998af0f61c595f859333f1d75092d0b70703545bca4d0

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agton_jetton-0.2.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 d0185158b75be3f7ff634eb3804aadfbcbcded0e57704b24b6880494c8786be0
MD5 0ce9df858549faec07adae517bdcf94d
BLAKE2b-256 3342e03ee32bd199f9b6247a9e3c5cf92870a2d2c973a20f6b3d185c94843d2a

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