Solana-Web3.js
Learn how to integrate Capsule with Solana using @usecapsule/solana-web3.js-v1-integration
Solana Web3.js is the official Solana JavaScript API for interacting with the Solana network. This guide will show you how to integrate Capsule’s wallet and signing capabilities with Solana using our integration package.
Prerequisites
Before integrating Capsule with Solana, ensure you have:
- Set up authentication with Capsule. See our Getting Started guides for details.
- Configured the Capsule client in your application
- Enabled Solana wallet support in the Capsule Developer Portal
If you haven’t set up Capsule authentication yet, complete one of our authentication tutorials first and return to this guide when you’re ready to implement Solana integration.
Installation
Choose your preferred package manager to install the required dependencies:
Setting Up the Signer
Initialize the Capsule Solana signer:
Transaction Signing
Signing Transactions
Sending Transactions
Additional Methods
The CapsuleSolanaWeb3Signer
provides several additional methods and properties:
signBytes(bytes: Buffer)
: Sign arbitrary bytes directlysignVersionedTransaction(transaction: VersionedTransaction)
: Sign a versioned transactionaddress
: Get the wallet address as a stringsender
: Get the wallet public key as asolana.PublicKey
object
Server-Side Usage
For server-side signing operations with Solana, please refer to our Server-Side Signing Guide for specific instructions.
When using Solana Web3.js server-side, ensure you’re following proper security practices and handling authentication appropriately.