Skip to content

Example python code to create a SEND transaction

alexjlan edited this page Apr 29, 2020 · 1 revision
from actions import *
from unsafe_wallet import addresses, new_account, sign

# Create New account, keep in mind, this account's private key is not securely encrypted. 
result = new_account('testing_account')
print result
addrs = addresses()

print addrs

# send 2000 OLT
raw_txn = send(addrs[0], "oltdeadbeefdeadbeefdeadbeefdeadbeefdeadbeef", (int("2000")*10**18))
print raw_txn

signed = sign(raw_txn, addrs[0])
print signed
print

result = broadcast_commit(raw_txn, signed['signature']['Signed'], signed['signature']['Signer'])
print result

Clone this wiki locally