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

cli: spl-token transfer --no-wait still waits for transaction to confirm #67

Open
joncinque opened this issue Jan 13, 2025 · 0 comments

Comments

@joncinque
Copy link
Contributor

Recreation of solana-labs/solana-program-library#7595

Problem

Running the transfer command with the --no-wait flag still waits for transaction confirmation.

Given the above description, the expected behavior is to return the transaction signature immediately after sending the transaction.

Solution

The simplest solution would be to change the client.send_and_confirm_transaction call to client.send_transaction, especially since the transactions are already being confirmed inside the finish_tx function as mentioned earlier.

However, this would affect people who use the spl-token-client and expect the methods of Token to confirm transactions. For example, it may break local testing, including the tests in this repository. Considering this, an improved version of this solution would be to convert the ProgramRpcClientSendTransaction struct to a named one and add a confirm field to decide whether to also confirm the transaction inside its SendTransactionRpc implementation.

Another solution would be to:

  • Rename ProgramRpcClientSendTransaction to ProgramRpcClientSendAndConfirmTransaction
  • Add ProgramRpcClientSendTransaction that only sends the transaction in its SendTransactionRpc::send method

as mentioned in solana-labs/solana-program-library#3139 (review), but a downside of this solution is that it requires quite a bit more changes than the previous solution.

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

No branches or pull requests

2 participants
@joncinque and others