Skip to content
Snippets Groups Projects
Commit f2ee683b authored by Krzysztof Mochocki's avatar Krzysztof Mochocki Committed by Jakub Ziebinski
Browse files

Add example of transaction creation using wax

parent 3107540a
No related branches found
No related tags found
1 merge request!230Implementation of the python wax interface
from beekeepy import Beekeeper
from wax import create_wax_foundation
from wax.proto.asset_pb2 import asset
from wax.proto.transfer_pb2 import transfer
PASSWORD = "pass"
WALLET_NAME = "alice"
wax = create_wax_foundation()
keys = wax.suggest_brain_key()
trx = wax.create_transaction_with_tapos("0576f3eb552fa3c7b8b103f1016c15ce2a259a0f")
trx.push_operation(transfer(from_account="alice", to_account="bob", amount=asset(**wax.hbd.satoshis(10).dict())))
with Beekeeper.factory() as beekeeper, beekeeper.create_session() as session, (
session.create_wallet(name=WALLET_NAME, password=PASSWORD)
if WALLET_NAME not in [w.name for w in session.wallets_created]
else session.open_wallet(name=WALLET_NAME).unlock(PASSWORD)
) as wallet:
wallet.import_key(private_key=keys.wif_private_key)
trx.sign(wallet=wallet, public_key=keys.associated_public_key)
print(f"Signed transaction: {trx.to_api_json()}")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment