Python client library for interacting with LTO Network
The chain_id is 'L' for the mainnet and 'T' testnet
from lto.accounts.ed25519 import AccountFactory
account = AccountFactory(chain_id).create()
from lto.accounts.ed25519 import AccountFactory
account = AccountFactory(chain_id).create_from_seed(seed)
from lto.accounts.ed25519 import AccountFactory
account = AccountFactory(chain_id).create_from_public_key(public_key)
from lto.accounts.ed25519 import AccountFactory
account = AccountFactory(chain_id).create_from_private_key(private_key)
First a transaction needs to be created.
from src.LTO.Transactions.Transfer import Transfer
transaction = Transfer(recipient, amount)
The Transaction needs then to be signed. In order to sign a transaction an account is needed.
transaction.sign_with(account)
For last the transaction needs to be broadcasted to the node. In order to do so we need to connect to the node using the PublicNode class.
from src.LTO.PublicNode import PublicNode
node = PublicNode(url)
The url refers to the node, there are many nodes available, here there are two examples, one for the mainnet and one for the testnet
transaction.broadcast_to(node)
from lto.transactions import Transfer
transaction = Transfer(recipient, amount)
from lto.transactions import MassTransfer
transaction = MassTransfer(transfers)
from lto.transactions import Anchor
transaction = Anchor(anchor)
from lto.transactions import Lease
transaction = Lease(recipient, amount)
from lto.transactions import CancelLease
transaction = CancelLease(lease_id)
from lto.transactions import SetScript
transaction = SetScript(script)
from lto.transactions import Sponsorship
transaction = Sponsorship(recipient)
from lto.transactions import CancelSponsorship
transaction = CancelSponsorship(recipient)
from lto.transactions import Association
transaction = Association(recipient, association_type, anchor)
from lto.transactions import RevokeAssociation
transaction = RevokeAssociation(recipient, association_type, anchor)
from lto.transactions import Data
transaction = Data(data_entries)
from lto.transactions import Register
transaction = Register(account2, account3)
from lto.transactions import Burn
transaction = Burn(amount)