Solana Signers V2 is a modern approach to handling transaction signing on Solana. This guide will show you
how to integrate Para’s wallet and signing capabilities with Solana using our Signers V2 integration package.
Prerequisites
To use Para, you need an API key. This key authenticates your requests to Para services and is essential for integration. Before integrating Para with your application, ensure you have:
- Completed Para authentication setup in your application (see one of our Setup Guides)
- A valid Para API key
- An RPC endpoint for your desired network
Need an API key? Visit the Developer Portal to create API keys, manage billing, teams, and more.
Installation
Choose your preferred package manager to install the required dependencies:
npm install @getpara/solana-signers-v2-integration@alpha @solana/kit
Setting Up the Signer
Initialize the Para Solana V2 signer using the createParaSolanaSigner
function:
import { createParaSolanaSigner, ParaSolanaSigner } from "@getpara/solana-signers-v2-integration";
import { createSolanaRpc } from "@solana/kit";
import { useClient } from "@getpara/react-sdk"; // or your Para client initialization
// Get Para client
const para = useClient();
// Create RPC client using @solana/kit (required for Para signer)
const paraRpc = createSolanaRpc("https://api.testnet.solana.com");
// Create the Para Solana Signer
const signer: ParaSolanaSigner = createParaSolanaSigner({
para: para,
rpc: paraRpc,
});
Message Signing
Sign messages using the signer:
import { getUtf8Encoder } from "@solana/codecs";
import bs58 from "bs58";
// Convert message to bytes
const message = "Hello, Solana!";
const messageBytes = new Uint8Array(getUtf8Encoder().encode(message));
// Sign the message
const signatureResult = await signer.signMessages([
{ content: messageBytes, signatures: {} }
]);
// Get the signature
const signatureBytes = signatureResult[0][signer.address];
const signatureBase58 = bs58.encode(signatureBytes);
console.log("Signature:", signatureBase58);
Transaction Signing and Sending
Sign and Send Transactions
The Para Solana Signer provides a convenient signAndSendTransactions
method that handles both signing and sending in one step:
import { Transaction, SystemProgram, LAMPORTS_PER_SOL } from "@solana/kit";
// Create a transaction (example: transfer SOL)
const transaction = new Transaction().add(
SystemProgram.transfer({
fromPubkey: signer.sender,
toPubkey: recipientPublicKey,
lamports: LAMPORTS_PER_SOL * 0.1, // 0.1 SOL
})
);
// Sign and send the transaction in one step
const signatures = await signer.signAndSendTransactions([transaction]);
const signature = signatures[0];
console.log("Transaction signature:", signature);
Signing Transactions Only
If you need to sign transactions without sending them immediately:
import { getBase64EncodedWireTransaction } from "@solana/kit";
// Sign the transaction
const signedTxs = await signer.modifyAndSignTransactions([transaction]);
const signedTx = signedTxs[0];
// Serialize for later use
const serializedTx = getBase64EncodedWireTransaction(signedTx);
Key Properties and Methods
The ParaSolanaSigner
provides the following key properties and methods:
address
: Get the wallet address as a string
sender
: Get the wallet public key buffer
signMessages()
: Sign messages
modifyAndSignTransactions()
: Sign transactions without sending
signAndSendTransactions()
: Sign and send transactions in one step
Server-Side Signing
Para’s signers can also be used on the server-side using pregen wallets or an active client side session. To learn more about using para on the server, check out these guides:
Examples
If you’d like to learn more about how to use the ParaSolanaSigner
for different transaction types, check out this example in our Examples Hub: