-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[proposal] properly use inheritence for proposals and show how to use…
… them in an example script
- Loading branch information
Showing
2 changed files
with
65 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
from graphenebase.transactions import formatTimeFromNow | ||
from grapheneapi import GrapheneClient | ||
from grapheneextra.proposal import Proposal | ||
from pprint import pprint | ||
|
||
|
||
symbol = "MILLLIONTDD" | ||
issuer = "jonnybitcoin" | ||
pm_result = False | ||
expiration = formatTimeFromNow(60 * 60 * 24) | ||
proposer = "xeroc" | ||
|
||
|
||
class Config(): | ||
wallet_host = "localhost" | ||
wallet_port = 8092 | ||
|
||
if __name__ == '__main__': | ||
graphene = Proposal(Config) | ||
account = graphene.rpc.get_account(issuer) | ||
asset = graphene.rpc.get_asset(symbol) | ||
# Publish a price | ||
settle_price = {"quote": {"asset_id": "1.3.0", | ||
"amount": 1 if pm_result else 0}, | ||
"base": {"asset_id": asset["id"], | ||
"amount": 1 | ||
}} | ||
tx = graphene.rpc.global_settle_asset(symbol, settle_price, False) | ||
tx = graphene.propose_operations(tx["operations"], expiration, proposer, broadcast=True) | ||
pprint(tx) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters