Repository navigation
feat: wait for every transaction's outcome by default, add --fast (0.4.0) - #51
Conversation
Sending commands reported success as soon as a transaction was sent, so one that reverted or never landed read as done, and a slow confirmation ended in "check it with tx-status". Commands now wait until the transaction lands, fails, or can no longer land because its blockhash expired, and say which. --fast sends without waiting and says the result is unconfirmed; --confirm is still accepted. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A sell's quote_received was the pre-trade estimate even once the transaction was confirmed. It is now read from the landed transaction, with its quote_received_raw twin: the payer's lamport change plus the fee, less any token-account rent the sale returned, or the token balance change for a non-SOL quote. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
… may have closed Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Caution Review failedThe pull request is closed. Walkthrough
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
|
@coderabbitai review |
Action not completed
|
Summary
Every command that sends a transaction now waits for its outcome by default and says what happened on chain, instead of reporting success as soon as the RPC accepted it.
TransactionFailedError, with its error code), or can no longer land: once the chain is past its blockhash's last valid block height and a history search doesn't find it, the command says it never ran, nothing was spent and it is safe to send again. If the RPC stops answering for a minute, the outcome is reported as unknown. No command tells the user to runtx-statusto learn an outcome.--fastsends without waiting; JSON carriesconfirmed: falseand human output says the result is unconfirmed.--confirmis still accepted (hidden), and rejected together with--fast. Every sending result carriesconfirmed.quote_receivedis read from the landed transaction, with aquote_received_rawtwin: for SOL, the payer's lamport change plus the fee, less any token-account rent the sale returned; otherwise the token balance change.drainreads the balance it sends atconfirmed, so the rent its closes just recovered goes with it.close-atasand thecollect-creator-feesweeps, a later transaction that expired or was refused counts as not run, and one whose outcome is unknown is reported as possibly landed.No issue.
Layers touched
commands/(CLI wiring)core/(business logic)protocol/(Solana/pump.fun primitives)Does this affect transaction construction or signing?
No change to instructions or signing. Sending changes:
send_txkeeps the blockhash'slast_valid_block_heightand, unless--fast, pollsgetSignatureStatusesuntil the transaction is confirmed, failed or past that height.Test Plan
--fastand--confirmflags, human output, and the sell receipt including the rent subtractionquote_receivedplus the recovered rent, less the fee, matched the wallet's balance change to the lamport; a PumpSwap buy and sell-all with--fast, both reported unconfirmed and then landed; the wallet ended with no token accountsThis PR changes transaction-sending commands to wait for a final outcome by default: landed, failed (
TransactionFailedError), or expired.--fastskips the wait.--confirmis hidden and rejected with--fast.This PR touches code paths that send Solana transactions.
RpcClient._send_and_confirmpolls signature status until the blockhash'slast_valid_block_height. If RPC stays silent for over 60 seconds, it raisesRuntimeErrorand the outcome is unknown. Inclose-atasand creator-fee sweeps, later batches that expire or are refused count as not run. Unknown batches may have landed.Confirmed sell receipts now use on-chain balance deltas.
wallet drainalways waits and rejects--fast.Review focus: unknown-outcome handling in sweeps, and the 60-second silence path. Source was not inspected. Test results are reported by the PR author and were not verified.