Skip to content
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

Open
wants to merge 7 commits into
base: add-utils-py-examples
Choose a base branch
from

Conversation

iskysun96
Copy link
Collaborator

@iskysun96 iskysun96 commented Feb 13, 2025

DVP-531
DVP-499
DVP-501
DVP-541
DVP-543

@iskysun96 iskysun96 changed the title [WIP] Add transaction type examples Add transaction type examples Feb 14, 2025
Comment on lines +54 to +55

"""
Copy link
Collaborator

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

Suggested change
"""
# example: ATOMIC_GROUP_SIMULATE
"""

Comment on lines +52 to +53
)
)
Copy link
Collaborator

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

Suggested change
)
)
)
)
# example: ATOMIC_TRANSACTION_GROUP

PaymentParams(
sender=account2.address,
receiver=account3.address,
amount=AlgoAmount(algo=2), # B sends half of what they received to C
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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
Copy link
Collaborator

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants