For Privy setup, app configuration, and wallet policies, see the Privy Developer Docs.
How It Works
eth_sendTransaction with the transaction fields (to, data, value). For Solana, you call signAndSendTransaction with the base64-encoded serialized transaction. Both return the transaction hash immediately — no polling required.
Prerequisites
- A Privy account with server wallets enabled
- An App ID and App Secret from Dashboard → App settings → Basics
- A Privy server wallet on the target network
- The wallet address registered with RebelFi
- No additional SDK required — uses
fetchwith Basic Auth
Registering a Wallet
Create a Privy server wallet (or use an existing one) and register its address with RebelFi:The Privy Signer
The core of the integration is a function that takes a RebelFi unsigned transaction and sends it through Privy. It handles both EVM and Solana transactions:Unlike Fireblocks and Dfns, Privy returns the transaction hash immediately after broadcasting — no polling loop needed. Privy handles gas estimation and signing server-side. RebelFi’s reconciliation tracks on-chain confirmation.
Supply Example
Supply operations may produce multiple transactions (e.g., EVM token approval + deposit, or a single Solana transaction). Sign and submit them sequentially through Privy:What Happens Step by Step
Plan the supply
Call
operations.supply() with your wallet, strategy, amount, and token address. RebelFi returns an operation with status AWAITING_SIGNATURE.Fetch unsigned transactions
Call
operations.getUnsignedTransactions() to get the transactions to sign. For EVM, you’ll typically get two (approval + deposit). For Solana, you’ll get one.Send via Privy
For each unsigned transaction, POST to Privy’s RPC endpoint. For EVM, call
eth_sendTransaction with the to, data, and value fields. For Solana, call signAndSendTransaction with the base64-encoded transaction. Privy signs and broadcasts on-chain, returning the txHash immediately.Submit hash to RebelFi
Take the
txHash from Privy’s response and submit it to RebelFi via transactions.submitHash(). Include the transactionId to identify which transaction in the operation you’re submitting.Unwind Example
Unwinding (withdrawing from a yield strategy) follows the same pattern:EVM vs Solana
ThesignAndBroadcast function handles both chains. The key difference is the RPC method and transaction format:
| EVM | Solana | |
|---|---|---|
| RPC method | eth_sendTransaction | signAndSendTransaction |
| Chain identifier | eip155:<chainId> (e.g. eip155:1) | solana:<genesis-hash> |
| Transaction format | JSON object (to, data, value) | Base64-encoded serialized transaction |
| Source field | tx.evmTransaction | tx.unsignedTransaction.serialized |
| Typical tx count | 2 (approve + deposit) | 1 |
| Polling needed | No | No |
The
tx.blockchain field on each unsigned transaction tells you which chain it targets. Use this to route to the correct RPC method.Authentication
Privy uses Basic Auth with your App ID and App Secret. Every request must include:Troubleshooting
401 Unauthorized
401 Unauthorized
Transaction broadcast but not confirmed
Transaction broadcast but not confirmed
Cause: Privy returns the txHash immediately upon broadcast. The transaction may still be pending on-chain.Solution: This is expected behavior. RebelFi monitors the chain and will update the operation status once the transaction is confirmed. You can also check transaction status via
GET /v1/transactions/{transaction_id}.Wrong chain_type for wallet
Wrong chain_type for wallet
Cause: Registering a Solana wallet as Ethereum (or vice versa) with RebelFi.Solution: Check the Privy wallet’s
chain_type field and register with the matching Blockchain enum. A Solana Privy wallet must be registered as Blockchain.SOLANA.Invalid CAIP-2 identifier
Invalid CAIP-2 identifier
Cause: Using an EVM-style chain ID for a Solana wallet, or an incorrect Solana genesis hash.Solution: For EVM, use
eip155:<chainId> (e.g. eip155:11155111 for Sepolia). For Solana, use the full CAIP-2 identifier with the genesis hash (e.g. solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1 for devnet).