-
Notifications
You must be signed in to change notification settings - Fork 204
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
Expose ATC transactions field with a getter method #759
Comments
I think it's in our best interests to keep all implementation fields private. This prevents users from modifying any internal state in unexpected ways, and it makes maintenance and future code changes easier for us. However, if you wanted to add a getter method to access individual transactions, that's probably reasonable. |
protected
Ben raised this after I provided some feedback to him about how ATC has a bunch of useful logic, but it's not very flexible for extension, hiding most of it away. Agreed making protected isn't right, but I'd like to request the following two changes which would significantly improve the flexibility / extensibility:
|
Thanks for that insight @robdmoore. I just have a few questions:
This seems like a reasonable request. Can I ask why you're interested in seeing the transactions produced by addMethodCall though?
We currently do return the PendingTransactionInfo for all method calls from execute. They're accessible in |
Apologies for the delay in replying. I want to see the transactions from Here's some relevant lines with one example: https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-deploy.ts#L198 and https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/app-deploy.ts#L234. Yes - PendingTransactionInfo is what we want, I didn't realise it was available in the ABIResult. I do also want it for non-ABI calls too for consistency. Currently, I need to reissue HTTP requests to get this info per: https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L182-L187 https://github.com/algorandfoundation/algokit-utils-ts/blob/main/src/transaction.ts#L147 |
I agree it definitely makes sense to do these things:
About returning pending transaction info for non-method calls from |
Problem
Right now the ATC holds an array of TransactionWithSigner objects that is private
https://github.com/algorand/js-algorand-sdk/blob/develop/src/composer.ts#L120
This means to get access to the transactions, the developer must call
buildGroup
which changes the state of the ATC.It is possible to
clone
the ATC prior to callingbuildGroup
so that the state of the original ATC is unchanged but this is not obvious.Solution
Add a getter method to allow access to the transactions constructed so far
The text was updated successfully, but these errors were encountered: