Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
W
wax
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hive
wax
Commits
f2ee683b
Commit
f2ee683b
authored
4 months ago
by
Krzysztof Mochocki
Committed by
Jakub Ziebinski
1 month ago
Browse files
Options
Downloads
Patches
Plain Diff
Add example of transaction creation using wax
parent
3107540a
No related branches found
No related tags found
1 merge request
!230
Implementation of the python wax interface
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
examples/python/create_and_sign_transation.py
+24
-0
24 additions, 0 deletions
examples/python/create_and_sign_transation.py
with
24 additions
and
0 deletions
examples/python/create_and_sign_transation.py
0 → 100644
+
24
−
0
View file @
f2ee683b
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
()
}
"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment