LTO Network
Search…
Public layer

Executing Transactions

Create transaction

First a transaction needs to be created.
1
from src.LTO.Transactions.Transfer import Transfer
2
transaction = Transfer(recipient, amount)
Copied!
The Transaction needs then to be signed. In order to sign a transaction an account is needed.

Sign transaction

1
transaction.sign_with(account)
Copied!

Broadcast transaction

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.
1
from src.LTO.PublicNode import PublicNode
2
node = PublicNode(url)
Copied!
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
  • https://nodes.lto.network
  • https://testnet.lto.network
1
transaction.broadcast_to(node)
Copied!

Transactions

Transfer Transaction

1
from lto.transactions import Transfer
2
3
transaction = Transfer(recipient, amount)
Copied!

Mass Transfer Transaction

1
from lto.transactions import MassTransfer
2
3
transaction = MassTransfer(transfers)
Copied!

Anchor Transaction

1
from lto.transactions import Anchor
2
3
transaction = Anchor(anchor)
Copied!

Lease Transaction

1
from lto.transactions import Lease
2
3
transaction = Lease(recipient, amount)
Copied!

Cancel Lease Transaction

1
from lto.transactions import CancelLease
2
3
transaction = CancelLease(lease_id)
Copied!

SetScript Transaction

1
from lto.transactions import SetScript
2
3
transaction = SetScript(script)
Copied!

Sponsorship transaction

1
from lto.transactions import Sponsorship
2
3
transaction = Sponsorship(recipient)
Copied!

Cancel Sponsorship transaction

1
from lto.transactions import CancelSponsorship
2
3
transaction = CancelSponsorship(recipient)
Copied!

Association transaction

1
from lto.transactions import Association
2
3
transaction = Association(recipient, association_type, anchor)
Copied!

Revoke Association transaction

1
from lto.transactions import RevokeAssociation
2
3
transaction = RevokeAssociation(recipient, association_type, anchor)
Copied!

Data transaction

1
from lto.transactions import Data
2
3
transaction = Data(data_entries)
Copied!

Register transaction

1
from lto.transactions import Register
2
3
transaction = Register(account2, account3)
Copied!

Burn transaction

1
from lto.transactions import Burn
2
3
transaction = Burn(amount)
Copied!