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.1.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.1-py3-none-any.whl (5.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: agton_jetton-0.2.1.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.1.tar.gz
Algorithm Hash digest
SHA256 2133abfe66882bfce81fc45aa5e1f8ee9d15de46b32fde77ed7ff1486fcad2a5
MD5 685c216db1d0a6b899a686d3b69621b6
BLAKE2b-256 19099966443a8c4f5068df526e10763c9806e666dffe0730da4ba5b0210d911f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: agton_jetton-0.2.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3b3cdc3f83624d9b939e21d05fbcb92eb17206fa1b9c9e70b7cc9bd14818e148
MD5 75fd84a618965adb529b1be9fac5f7f7
BLAKE2b-256 6d5da0b4df56604a82107ba5985658eb8309527ffc2588579b4489cef3f51ebd

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