privy-rs
A Rust library for interacting with the Privy API, providing secure embedded wallet signing capabilities for Solana transactions. This library enables seamless integration with Privy's wallet infrastructure for transaction signing operations.
Installation
For up to date SDK documentation and examples, see docs.rs or the examples folder in the repo. For general documentation about the Privy API, see the API docs. Otherwise, some basic examples can be found below.
Add this to your Cargo.toml:
[]
= "0.1.0-alpha"
Usage
First, set up your Privy credentials:
use PrivyClient;
let client = new?;
Then, you can access all the sub-clients using the methods available on the client.
Creating a wallet
use *;
let wallet = client
.wallets
.create
.await?;
Signing a message on Ethereum
use ;
let ethereum_service = client.wallets.ethereum;
let auth_ctx = new;
// Sign a UTF-8 message
let result = ethereum_service
.sign_message
.await?;
Signing a message on Solana
use ;
let solana_service = client.wallets.solana;
let auth_ctx = new;
// Base64 encode your message first
let message = encode;
let signature = solana_service
.sign_message
.await?;
License
This project is dual-licensed under MIT and Apache-2.0.