I have tried both ways to interact with solana blockchain, I regconized that Anza-xyz adapter faster than extension wallet browser API when I'm doing sign and send transaction. anza adapter in the best connection is about 1-2 sec, and using extension API is about 10s
1 Answer
Simply use Anza's Solana Wallet Adapter, it has a lot more features and is built to support the best wallet connect functionality out of the box. You might want to read this: https://solana.com/news/solana-why-you-should-use-wallet-adapter
In terms of speed, wallet adapter is more optimized and handles a lot of things behind the scenes with more efficiency, which is why it is faster than raw window.solana API, which also has conflicting and unexpected behaviors in different situations.
-
hey mate, I got confused with commitment, while "confirmed" create txHash faster than "finalized" why is that happened like that, there is difference between them Commented May 24 at 6:48
-
1yes there is! in terms of speed, processed > confirmed > finalized. check out solana docs for difference: docs.solanalabs.com/consensus/commitments Commented May 24 at 8:00
-
That's very helpful, thanks mate, one question, how can I detect event listener like websocket in Connection solana/web3js to catch balance when transaction is happened. Commented May 24 at 8:58
-
1You can follow this guide by quicknode: quicknode.com/guides/solana-development/getting-started/… What you are looking for is the
onAccountChange
listener from Solana connection, which is mentioned in the article. Also if you found my answers helpful, would appreciate you marking it as correct so that others can also benefit :) Commented May 24 at 11:27 -