Python
Python client library for interacting with LTO Network

Initiate library

1
pl = PyCLTO.PyCLTO() pl.NODE = "https://testnet.ltonode.turtlenetwork.eu" pl.setChain("testnet")
Copied!

Initiate addresses

1
addr1 = pl.Address(seed="seedhere")
2
addr2 = pl.Address(seed="seed2here")
3
addr3 = pl.Address(seed="scripted account seed here")
Copied!

Mass transaction

1
transfers = [ { 'recipient': addr1.address, 'amount': 1 }, { 'recipient': addr2.address, 'amount': 1 }, ] addr1.massTransferLTO(transfers)
Copied!
1
addr1.sponsor(addr2)
Copied!

Cancel sponsor transaction

1
addr1.cancelSponsor(addr2)
Copied!

Lease transaction

1
tx = addr1.lease(addr2,1) print(tx)
Copied!

Lease cancel transaction

1
addr1.leaseCancel(tx['id'])
Copied!

Set script transaction

1
script = 'match tx { \n' +
2
' case _ => true\n' +
3
'}' addr3.setScript(script)
Copied!
Last modified 9mo ago