| Crates.io | sol_rpc_client |
| lib.rs | sol_rpc_client |
| version | 3.0.0 |
| created_at | 2025-04-30 04:54:10.548127+00 |
| updated_at | 2025-09-01 13:09:31.325523+00 |
| description | Client to interact with the SOL RPC canister |
| homepage | https://github.com/dfinity/sol-rpc-canister#readme |
| repository | https://github.com/dfinity/sol-rpc-canister |
| max_upload_size | |
| id | 1654440 |
| size | 210,121 |
sol_rpc_clientLibrary to interact with the SOL RPC canister from a canister running on the Internet Computer. See the Rust documentation for more details.
If you are using the sol_rpc_types crate inside a canister, make sure to follow these steps to ensure your code compiles:
Override getrandom features
Add the following to your Cargo.toml file:
getrandom = { version = "*", features = ["custom"] }
This ensures that the getrandom crate (a transitive dependency of the Solana SDK) does not pull in wasm-bindgen, which is incompatible with canister environments.
💡 You can also specify an exact version of
getrandom, as long as thecustomfeature is enabled, e.g.getrandom = { version = "0.2.14", features = ["custom"] }.
For more information, see this blog post.
macOS-specific LLVM setup
On macOS, an llvm version that supports the wasm32-unknown-unknown target is required. This is because the zstd crate (used, for example, to decode base64+zstd-encoded responses from Solana's getAccountInfo) depends on LLVM during compilation. The default LLVM bundled with Xcode does not support wasm32-unknown-unknown. To fix this:
brew install llvm
.cargo/config.toml file in your project (or modify the existing one) and add the following entries:
[env]
AR="<LLVM_PATH>/bin/llvm-ar"
CC="<LLVM_PATH>/bin/clang"
Where you need to replace <LLVM_PATH> with the output of the following command:
brew --prefix llvm