anza-xyz / wallet-adapter

Modular TypeScript wallet adapters and components for Solana applications.
https://anza-xyz.github.io/wallet-adapter/
Apache License 2.0
1.44k stars 906 forks source link

Please give a option to use custom Websocket RPC endpoint in react package #953

Closed ronypk999 closed 1 month ago

ronypk999 commented 2 months ago

https://github.com/anza-xyz/wallet-adapter/blob/master/packages/core/react/src/ConnectionProvider.tsx

On this

Just like the custom RPC endpoint it would be great to have custom Websocket RPC endpoint.

mcintyre94 commented 1 month ago

You can do this by passing a config parameter including wsEndpoint. The default value is {commitment: "confirmed"} so I'd suggest including that in your config object. For example:

<ConnectionProvider endpoint='...' config={{commitment: "confirmed", wsEndpoint: "..."}}

See https://solana-labs.github.io/solana-web3.js/types/ConnectionConfig.html

If you have any further questions please use https://solana.stackexchange.com