Skip to content

Instantly share code, notes, and snippets.

@xeroc
Created December 9, 2020 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save xeroc/01c680fe60bea80bde5e0c3ebccab723 to your computer and use it in GitHub Desktop.
Save xeroc/01c680fe60bea80bde5e0c3ebccab723 to your computer and use it in GitHub Desktop.
from getpass import getpass
from pprint import pprint
from bitshares import BitShares
from bitshares.account import Account
from bitshares.amount import Amount
from bitsharesbase import operations
bitshares = BitShares("wss://eu.nodes.bitshares.ws")
bitshares.wallet.unlock(getpass())
ops = list()
from_account = Account("xeroc")
to_account = Account("init0")
amount = Amount(1000000, "BTS")
ops.append(
operations.Transfer(
**{
"fee": {"amount": 0, "asset_id": "1.3.0"},
"from": from_account["id"],
"to": to_account["id"],
"amount": amount.json(),
}
)
)
ops.append(
operations.Transfer(
**{
"fee": {"amount": 0, "asset_id": "1.3.0"},
"from": from_account["id"],
"to": to_account["id"],
"amount": amount.json(),
}
)
)
ops.append(
operations.Transfer(
**{
"fee": {"amount": 0, "asset_id": "1.3.0"},
"from": from_account["id"],
"to": to_account["id"],
"amount": amount.json(),
}
)
)
ops.append(
operations.Transfer(
**{
"fee": {"amount": 0, "asset_id": "1.3.0"},
"from": from_account["id"],
"to": to_account["id"],
"amount": amount.json(),
}
)
)
pprint(bitshares.finalizeOp(ops, from_account, "active"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment