-
Notifications
You must be signed in to change notification settings - Fork 922
Missing sendAndConfirmTransaction in @solana/web3.js v2.0.0 Release Candidates #3608
Comments
This is more a documentation error - you make your own Here's what I do:
And then:
The better solution might be to make migration steps more prominent in the README. |
Thank you for the clarification! I understand now that the current approach is to use the factory method to create That said, I believe it might be a good idea to add Additionally, updating the documentation with prominent migration steps in the README would be an excellent way to guide users through this change. Thank you again for the detailed explanation! |
That may actually complicate the developer experience. Imagine needing to confirm a transaction somewhere deep in your app. In order to do so, you will need to pass one or more values down to that function/component, or make it/them available through context. If you create a method to confirm transactions using the factory, you will have exactly one value to pass down to your leaf function/component. If instead you need the confirm function, the RPC instance, and the RPC Subscriptions instance, you now have three things. There's another thing that might not be immediately obvious, which is that when we create a single instance of a transaction confirmer, we can make it stateful. That means all transaction confirmations can theoretically share – for instance – one blockheight subscription, for greater efficiency. This is something that we might implement in the future, and this design pattern makes that possible without any changes to your code. If this doesn't work for you, you're absolutely welcome to look at what the factory method does, to unbundle its component parts, and to reassemble them into your preferred API. Regarding the documentation, if this section isn't what you needed, feel free to open a PR to suggest a change. |
Because there has been no activity on this issue for 7 days since it was closed, it has been automatically locked. Please open a new issue if it requires a follow up. |
Overview
While using the latest version of
@solana/web3.js
(^2.0.0-rc.0
and^2.0.0-rc.4
), I was unable to find thesendAndConfirmTransaction
function, which is a critical method for submitting and confirming transactions in Solana applications. Instead, I discovered alternative functions with internal naming conventions that suggest they are not intended for general use, such as:sendAndConfirmTransactionFactory
sendAndConfirmDurableNonceTransactionFactory
sendAndConfirmTransactionWithBlockhashLifetime_INTERNAL_ONLY_DO_NOT_EXPORT
sendAndConfirmDurableNonceTransaction_INTERNAL_ONLY_DO_NOT_EXPORT
This appears to be an unintended omission or a breaking change that is not documented.
Steps to reproduce
@solana/web3.js
package using npm:sendAndConfirmTransaction
function:Description of bug
The
sendAndConfirmTransaction
function is absent in the latest release candidates (^2.0.0-rc.0
and^2.0.0-rc.4
). This function is essential for users of the library, and its absence is unexpected. Based on the library exports, only factory methods and internal methods appear to be available, none of which provide clear documentation or guidance for users.This breaks existing codebases that rely on the previous stable versions of
@solana/web3.js
. Additionally, the lack of documentation regarding this change exacerbates the issue.Environment Details
v20.11.1
10.4.0
@solana/web3.js
version:^2.0.0-rc.0
and^2.0.0-rc.4
The text was updated successfully, but these errors were encountered: