Transactions
Send transactions on the public layer
Basic usage
import LTO, { Binary } from '@ltonetwork/lto';
enum RELATIONSHIP { MEMBER_OF=0x3400 };
enum STATEMENT { VERIFIED=0x3500 };
lto = new LTO('T');
const account = lto.account();
const recipient = '3N2XoMuukk4BPiLn95vDkv4ocU5szMXuxVN';
lto.getBalance(account);
lto.transfer(account, recipient, 100_00000000);
lto.massTransfer(account, [{recipient: recipient1, amount: 100_00000000}, {recipient: recipient2, amount: 50_00000000}]);
lto.anchor(account, new Binary('some value').hash(), new Binary('other value').hash());
lto.anchor(
account,
{ key: new Binary('some key').hash(), value: new Binary('some value').hash() },
{ key: new Binary('other key').hash(), value: new Binary('other value').hash() },
);
lto.associate(account, RELATIONSHIP.MEMBER_OF, recipient);
lto.revokeAssociation(account, RELATIONSHIP.MEMBER_OF, recipient);
lto.lease(account, recipient, 10000_00000000);
lto.cancelLease(account, '9V7tdKEEJiH86eCPNxPg1vxhmp8oNH6Mqtf1fQeSeS4U');
lto.sponsor(account, recipient);
lto.cancelSponsorship(account, recipient);
lto.makeStatement(account, STATEMENT.VERIFIED, recipient);
lto.setData(account, {foo: 'bar'});
lto.getData(account);Executing Transactions
Create transaction
Sign transaction
Broadcasting transaction
Fluent interface
Sponsoring transactions
Transaction types
Transfer transaction
Mass Transfer transaction
Anchor transaction
Mapped Anchor transaction
Lease transaction
Cancel Lease transaction
SetScript transaction
Sponsorship transaction
Cancel Sponsorship transaction
Association transaction
Revoke Association transaction
Statement transaction
Data transaction
Public Node
Last updated