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

ATC: addMethodCall, addTransaction returns this #799

Open
wants to merge 1 commit into
base: develop
Choose a base branch
from

Conversation

joe-p
Copy link
Contributor

@joe-p joe-p commented Jun 28, 2023

This simply changes the return type of addTransaction and addMethodCall from void to AtomicTransactionCompose so these methods return the ATC.

The goal is to allow chaining of methods when using the ATC rather than having to instantiate an object and call the methods on that object each time.

For example:

  const atc = new algosdk.AtomicTransactionComposer();
  atc.addTransaction();
  atc.addMethodCall();
  atc.execute();

vs

  new algosdk.AtomicTransactionComposer()
    .addTransaction()
    .addMethodCall()
    .execute();

No major reason other than a nice minor QOL improvement

@jasonpaulos
Copy link
Member

Note that this is in conflict with @robdmoore's desire to have addMethodCall() return the newly created transaction: #759 (comment)

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.

None yet

2 participants