-
Notifications
You must be signed in to change notification settings - Fork 81
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
Sell results: { success: false, error: 'Transaction failed' } #24
Comments
I also encountered this situation. In fact, the transaction was successful. I ran it in the Chrome browser, and there were always some WebSocket connection errors: chunk-KCB7GPR7.js?v=ff63d6b4:8850 WebSocket connection to 'wss://go.getblock.io/*****' failed: |
Does this connection also need to support WebSocket? |
i think , its the handling if sugnature part from the sdk . The sdk automatically prints signature of tx as solscan link , and if you want to check the signature for success or failure of the transaction, the signature isnt the signature alone but the solscan link , which is invalid signature to parse . |
Hmm, it may be websockets + Anchor. Ill take a look. Any input will help: Just to make sure its reporting the TX failed but it was a success? |
yes , the tx is successful , the signature with solscan link is also valid and can be visited to see tx was finalized (mostly, and sometimes slippage error), the sol and slp balance before and after sell is also correct (just to check if the sell function of sdk was working ). I wanted to verify if the tx was successful, and implement retries if it failed ,but to my surprise, the sell result was identified as false (even when its true), which led to retries because the loop assumed the tx had failed . ALSO , tried making the buy function that buys pumpfun tokens , got the same error. The buy works with valid solscan link containing the signature, but buy results return success:false and error: transaction failed. |
Same issue. |
If you got time, can you show me how you are setting up your connection? |
const provider = getProvider(wallet); const mintAddress = new PublicKey('DrbLgXTPZ31P17Tt11pYngkbZ4SUEXJHU2xBPDenpump'); await printSOLBalance(connection, sellerKeypair.publicKey, 'Seller SOL balance before sell'); const currentSolBalance = await connection.getBalance(sellerKeypair.publicKey); await sellToken(sdk, sellerKeypair, mintAddress); await printSOLBalance(connection, sellerKeypair.publicKey, 'Seller SOL balance after sell'); |
Any update on this? |
My assumption is its a mix up between expected commit levels where the transaction may not exist yet relative to those levels. Im trying out different scenarios and will update it. You can also just copy the buy logic and have your own way of customizing the tx handling, but Im going to see if I can pull it apart a bit and see what the scenario is. Thank you, @oneplusfive555 im checking it out. |
hi @rckprtr error: SendTransactionError: Simulation failed. sig: https://solscan.io/tx/35PmNWX1e6aJGZxoN1Pug66XaT2MjnwnMxG9vJL9uMS2mp6jGqpDVCz2nJqbdCmEPpH8wwTFS4Lt4JYpm4VQQVfz |
@rckprtr i dont know if it helps other, but i fixed the issue by implementing a delay of 5 sec to check the success of tx results (i assumed the blockchian would take 5-8 seconds to finalize the tx). I would send the buy/ sell tx , wait 5 seconds to fetch the slp balance or token account creation after function excution (because if tx is successful, the associated token account must be created or slp balance must be there in the wallet ). Instead of relying on if success.results is true/false , i now rely on if slp balance>0 or if token account is present after 5 sec of sending tx. if true buy/sell is success else failed with reties implemented. heres one log of successful tx .. |
I need to get back to this, I will probably make the next release a lot easier to just builder a transaction and allow people to have their own send and sign. Im going to reproduce it and also see if I can fix the buy/sell results to work with websockets correctly. Thank you for updating the thread, it will help quite a bit of devs. |
i tried to use the sdk to create a sell function to sell a random token on pumpfun thats in my wallet , the tx goes through, prints out the signature tx as solscan link , however, it throws success as false and error as tx failed , which will lead to attempted retries for selling. is it sdks handling of succes as false when the tx is confirmed or im doing something wrong ????
Heres THE LOGS ...
Seller SOL balance before sell: 0.054742152 SOL
Seller SPL balance before sell: 29166.843056 tokens
sig: https://solscan.io/tx/56AG7V89fHNeN4cwDaXJiSZMuNaaaXJ4zZ2wFRzkGK3UFcKX4tbKe2xdn74bWqMLE6dQKe6moKY6Hotc9gp6pFKq
Sell results: { success: false, error: 'Transaction failed' }
Transaction confirmed. View it on Solscan: https://solscan.io/tx/undefined
Seller SOL balance after sell: 0.055481914 SOL
Seller SPL balance after sell: 2.916685 tokens.
lance after sell: 2.916685 tokens
The text was updated successfully, but these errors were encountered: