-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add transaction type examples #13
base: add-utils-py-examples
Are you sure you want to change the base?
Conversation
|
||
""" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the opening example comment
""" | |
# example: ATOMIC_GROUP_SIMULATE | |
""" |
) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the closing example comment
) | |
) | |
) | |
) | |
# example: ATOMIC_TRANSACTION_GROUP |
PaymentParams( | ||
sender=account2.address, | ||
receiver=account3.address, | ||
amount=AlgoAmount(algo=2), # B sends half of what they received to C |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sending double of what they received :)
Create a transaction group that will execute atomically | ||
Either all transactions succeed, or they all fail | ||
""" | ||
algorand_client.new_group().add_payment( # First transaction: Payment from A to B |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry - I changed my accounts from account1, account2 to accountA, accountB ... felt it was a bit clearer. If you agree, I'd change the var names from localnet setup. Otherwise, update the comments referencing account A/B to 1/2.
|
||
|
||
def leases() -> None: | ||
# example: LEASES |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing the closing comment # example: LEASES
total=10_000_000, | ||
decimals=6, | ||
default_frozen=False, # optional | ||
manager=account1.address, # optional. Can be permanently disabled by setting to None |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
in my case I was passing in Account
rather than the address... not sure which is better in practice, maybe we revisit and settle on one method over the other once it's in the docs. I believe utils caches the signers either way?
DVP-531
DVP-499
DVP-501
DVP-541
DVP-543