### Getting Started with Privy and Solana (Next.js)
Source: https://docs.privy.io/llms-full.txt
End-to-end guide for setting up a Next.js app with Privy Solana embedded wallets.
```javascript
import { PrivyProvider } from '@privy-io/react';
import { SolanaWalletConnector } from '@privy-io/solana';
function App({ Component, pageProps }) {
return (
);
}
export default App;
// Example usage in a page component:
// import { usePrivy } from '@privy-io/react';
// import { useSignTransaction, useCreateWallet } from '@privy-io/react-solana';
//
// function MySolanaPage() {
// const { ready, authenticated } = usePrivy();
// const { createWallet } = useCreateWallet();
// const { signTransaction } = useSignTransaction();
//
// const handleCreateAndSign = async () => {
// if (ready && authenticated) {
// await createWallet(); // Creates a Solana embedded wallet
// // ... prepare and sign a transaction using signTransaction
// }
// };
// // ...
// }
```
--------------------------------
### Introduction
Source: https://docs.privy.io/llms-full.txt
Getting started with the Privy REST API.
```APIDOC
## Introduction
### Description
Getting started with the Privy REST API.
### Endpoint
/introduction
```
--------------------------------
### HyperEVM Integration
Source: https://docs.privy.io/llms-full.txt
Guides for integrating with HyperEVM, focusing on its specific features and requirements.
```markdown
This section provides guidance on integrating with HyperEVM. Refer to the specific sub-pages for detailed instructions on client-side usage, policies, and offline actions.
```
--------------------------------
### Wallet Recovery Setup Webhook
Source: https://docs.privy.io/llms-full.txt
This webhook is triggered when a wallet recovery setup is initiated.
```APIDOC
## POST /webhooks/wallet/recovery_setup
### Description
This endpoint receives notifications when a wallet recovery setup is initiated. It is part of the wallet webhook system.
### Method
POST
### Endpoint
/webhooks/wallet/recovery_setup
### Response
#### Success Response (200)
Details of the webhook payload are not specified in the source.
```
--------------------------------
### Start KYC process
Source: https://docs.privy.io/llms-full.txt
Initiates the Know Your Customer (KYC) process.
```APIDOC
## POST /fiat/kyc/create
### Description
Initiates the Know Your Customer (KYC) process.
### Method
POST
### Endpoint
/fiat/kyc/create
```
--------------------------------
### Off-ramping with Privy
Source: https://docs.privy.io/llms-full.txt
Instructions and examples for implementing off-ramping functionalities using Privy.
```markdown
This recipe covers the integration of off-ramping services with Privy, enabling users to convert digital assets to fiat currency.
```
--------------------------------
### Clearing State on Fresh Installs (React Native)
Source: https://docs.privy.io/llms-full.txt
Guidance on clearing application state for a fresh install experience in React Native apps using Privy.
```javascript
import { usePrivy } from '@privy-io/react-native';
function App() {
const { ready, logout } = usePrivy();
const handleFreshInstall = async () => {
if (ready) {
await logout({ clear: true });
// Additional logic to clear app-specific state
console.log('Privy state cleared for fresh install.');
}
};
// ... rest of your app component
return (
<>
{/* ... */}
>
);
}
```
--------------------------------
### Wallet List Configuration Recipes (React)
Source: https://docs.privy.io/llms-full.txt
Examples and configurations for customizing the wallet list displayed to users in React applications.
```javascript
import { PrivyProvider } from '@privy-io/react';
function App() {
return (
{/* Your application components */}
);
}
```
--------------------------------
### Get balance
Source: https://docs.privy.io/llms-full.txt
Retrieves the balance of a wallet.
```APIDOC
## GET /wallets/get-balance
### Description
Retrieves the balance of a wallet.
### Method
GET
### Endpoint
/wallets/get-balance
```
--------------------------------
### Get wallet
Source: https://docs.privy.io/llms-full.txt
Retrieves wallet information.
```APIDOC
## GET /wallets/get
### Description
Retrieves wallet information.
### Method
GET
### Endpoint
/wallets/get
```
--------------------------------
### Executing Trades on Hyperliquid
Source: https://docs.privy.io/llms-full.txt
Instructions and examples for executing trades within the Hyperliquid ecosystem using Privy.
```markdown
This section covers executing trades on Hyperliquid. It includes patterns and best practices for interacting with the trading system.
```
--------------------------------
### Integrating Morpho with Privy
Source: https://docs.privy.io/llms-full.txt
A guide for integrating the Morpho protocol with Privy for enhanced DeFi functionalities.
```markdown
This guide details the integration process of Morpho with Privy, enabling users to leverage Morpho's lending and borrowing features through Privy wallets.
```
--------------------------------
### Get intent
Source: https://docs.privy.io/llms-full.txt
Retrieves details of an intent.
```APIDOC
## GET /intents/get
### Description
Retrieves details of an intent.
### Method
GET
### Endpoint
/intents/get
```
--------------------------------
### Payy Network Integration
Source: https://docs.privy.io/llms-full.txt
Guide to integrating Privy embedded wallets for authentication and transactions on the Payy Network.
```javascript
import { usePrivy } from '@privy-io/react-auth';
function PayyNetworkComponent() {
const { ready, authenticated, user, login, sendTransaction } = usePrivy();
const handleSendPUSD = async () => {
if (!authenticated) {
await login();
}
// Example transaction details for sending PUSD on Payy Network
const tx = {
to: 'RECIPIENT_ADDRESS',
value: '1000000000000000000', // 1 PUSD in wei
data: '0x...', // Contract interaction data if needed
};
await sendTransaction(tx);
};
return (
);
}
```
--------------------------------
### Integrating with ethers.js
Source: https://docs.privy.io/llms-full.txt
Get an ethers.js provider and signer from a Privy connected wallet for Ethereum interactions.
```APIDOC
## GET /wallets/connectors/ethereum/integrations/ethers
### Description
Obtains an ethers.js provider and signer from a Privy connected wallet for interacting with the Ethereum blockchain.
### Method
GET
### Endpoint
/wallets/connectors/ethereum/integrations/ethers
### Response
#### Success Response (200)
- **provider** (object) - An ethers.js provider instance.
- **signer** (object) - An ethers.js signer instance.
```
--------------------------------
### Get account
Source: https://docs.privy.io/llms-full.txt
Retrieves details of a specific account.
```APIDOC
## GET /accounts/get
### Description
Retrieves details of a specific account.
### Method
GET
### Endpoint
/accounts/get
```
--------------------------------
### Get wallets
Source: https://docs.privy.io/llms-full.txt
Retrieves a list of all wallets associated with an account.
```APIDOC
## GET /wallets/get-all
### Description
Retrieves a list of all wallets associated with an account.
### Method
GET
### Endpoint
/wallets/get-all
```
--------------------------------
### Sending a SOL Transaction (Solana)
Source: https://docs.privy.io/llms-full.txt
Complete example of sending SOL from a Privy embedded wallet using @solana/kit.
```javascript
import { usePrivy } from '@privy-io/react-auth';
import { useSignAndSendTransaction } from '@privy-io/react-solana';
import { SystemProgram, Transaction } from '@solana/web3.js';
import { getTransferSolInstruction } from '@solana/kit';
function SendSOLComponent() {
const { ready, authenticated, user } = usePrivy();
const { signAndSendTransaction } = useSignAndSendTransaction();
const handleSendSOL = async () => {
if (!ready || !authenticated || !user?.solana) {
console.error('Privy not ready, not authenticated, or no Solana wallet found.');
return;
}
const recipientAddress = 'RECIPIENT_SOLANA_ADDRESS'; // Replace with actual recipient
const amountInLamports = 1000000; // 1 SOL = 1,000,000,000 Lamports. This is 0.001 SOL.
try {
// Get the transfer instruction
const instruction = getTransferSolInstruction({
fromPubkey: user.solana.address,
toPubkey: recipientAddress,
lamports: amountInLamports,
});
// Create a new transaction
const transaction = new Transaction().add(instruction);
// Sign and send the transaction
const txSignature = await signAndSendTransaction(transaction);
console.log(`SOL transaction sent successfully! Signature: ${txSignature}`);
} catch (error) {
console.error('Error sending SOL transaction:', error);
}
};
return (
);
}
```
--------------------------------
### Get wallet by address
Source: https://docs.privy.io/llms-full.txt
Retrieves wallet information using its address.
```APIDOC
## GET /wallets/get-by-address
### Description
Retrieves wallet information using its address.
### Method
GET
### Endpoint
/wallets/get-by-address
```
--------------------------------
### Get all wallets for an application
Source: https://docs.privy.io/llms-full.txt
Retrieve a list of all wallets associated with your application using the Privy API.
```APIDOC
## GET /wallets
### Description
Get all wallets for your application using the Privy API. This endpoint allows you to list all wallets managed by your application.
### Method
GET
### Endpoint
/wallets
### Parameters
#### Query Parameters
- **limit** (integer) - Optional - The maximum number of wallets to return.
- **offset** (integer) - Optional - The number of wallets to skip before returning results.
### Response
#### Success Response (200)
- **wallets** (array) - A list of wallet objects.
- Each object contains wallet details such as id, type, and associated user information.
#### Response Example
{
"wallets": [
{
"id": "wallet_abc123",
"type": "privy",
"userId": "user_xyz789"
},
{
"id": "wallet_def456",
"type": "external",
"userId": "user_xyz789"
}
]
}
```
--------------------------------
### Integrating Solana Mobile Wallet Adapter
Source: https://docs.privy.io/llms-full.txt
Guide for integrating the Solana Mobile Wallet Adapter (MWA) with Privy in your applications.
```javascript
import { usePrivy } from '@privy-io/react-auth';
import { useSolanaMobileWalletAdapter } from '@privy-io/react-solana';
function SolanaMWAComponent() {
const { ready, authenticated } = usePrivy();
const { adapter, connect, disconnect } = useSolanaMobileWalletAdapter();
const handleConnect = async () => {
if (ready && authenticated && adapter) {
await connect();
console.log('Connected to Solana Mobile Wallet Adapter.');
}
};
return (
);
}
```
--------------------------------
### getSwapQuote
Source: https://docs.privy.io/llms-full.txt
Get a price quote for swapping tokens within a wallet.
```APIDOC
## GET /wallets/swap/quote
### Description
Get a price quote for swapping tokens within a wallet.
### Method
GET
### Endpoint
/wallets/swap/quote
### Parameters
#### Query Parameters
- **wallet_id** (string) - Required - The ID of the wallet.
- **from_token_address** (string) - Required - The address of the token to swap from.
- **to_token_address** (string) - Required - The address of the token to swap to.
- **amount** (number) - Required - The amount of tokens to swap.
```
--------------------------------
### Get a swap quote
Source: https://docs.privy.io/llms-full.txt
Request a price quote to preview estimated swap output amounts before executing.
```APIDOC
## GET /wallets/actions/swap/get-quote
### Description
Requests a price quote for a token swap, providing estimated output amounts before execution.
### Method
GET
### Endpoint
/wallets/actions/swap/get-quote
### Query Parameters
- **tokenIn** (string) - Required - The token to swap from.
- **tokenOut** (string) - Required - The token to swap to.
- **amountIn** (string) - Required - The amount of tokenIn to swap.
### Response
#### Success Response (200)
- **amountOut** (string) - The estimated amount of tokenOut to receive.
- **estimatedGas** (string) - The estimated gas cost for the swap.
```
--------------------------------
### Get all items from a condition set
Source: https://docs.privy.io/llms-full.txt
Retrieves all items associated with a condition set.
```APIDOC
## GET /condition-sets/condition-set-items/get-all
### Description
Retrieves all items associated with a condition set.
### Method
GET
### Endpoint
/condition-sets/condition-set-items/get-all
```
--------------------------------
### Get portfolio summary
Source: https://docs.privy.io/llms-full.txt
Provides a summary of a user's portfolio, including total value and key holdings.
```APIDOC
## GET /api-reference/kraken-embed/users/summary
### Description
Provides a summary of a user's portfolio.
### Method
GET
### Endpoint
/api-reference/kraken-embed/users/summary
```
--------------------------------
### Sending USDC (or other ERC-20s)
Source: https://docs.privy.io/llms-full.txt
Example code for sending USDC or other ERC-20 tokens from a Privy wallet.
```javascript
import { usePrivy } from '@privy-io/react-auth';
function SendUSDCComponent() {
const { ready, authenticated, user, sendTransaction } = usePrivy();
const handleSendUSDC = async () => {
if (!authenticated) {
// Handle login if not authenticated
return;
}
const usdcContractAddress = '0x...'; // Replace with actual USDC contract address
const recipientAddress = '0x...'; // Replace with recipient address
const amount = '1000000'; // Amount in USDC (e.g., 1 USDC = 1,000,000 micro-units)
// Construct the transaction object for ERC-20 transfer
const tx = {
to: usdcContractAddress,
data: '0xa9059cbb' + // transfer function signature hash
'0'.repeat(24) + recipientAddress.substring(2) + // recipient address (padded)
'0'.repeat(64 - (amount.length)) + amount, // amount (padded)
};
try {
await sendTransaction(tx);
console.log('USDC transaction sent successfully!');
} catch (error) {
console.error('Error sending USDC transaction:', error);
}
};
return (
);
}
```
--------------------------------
### Get user portfolio summary
Source: https://docs.privy.io/llms-full.txt
Provides a summary of a user's portfolio, including total value and key holdings.
```APIDOC
## GET /api-reference/kraken-embed/master-account/summary
### Description
Provides a summary of a user's portfolio.
### Method
GET
### Endpoint
/api-reference/kraken-embed/master-account/summary
```
--------------------------------
### Get assets
Source: https://docs.privy.io/llms-full.txt
Retrieves a list of available assets. This endpoint can be used to discover supported assets and their basic information.
```APIDOC
## GET /api-reference/kraken-embed/assets/get
### Description
Retrieves a list of available assets.
### Method
GET
### Endpoint
/api-reference/kraken-embed/assets/get
```
--------------------------------
### Setting up Earn
Source: https://docs.privy.io/llms-full.txt
Deploy a fee wrapper and configure your vault in the Privy Dashboard.
```APIDOC
## POST /wallets/actions/earn/setup
### Description
Initiate the setup process for earning yield by deploying a fee wrapper and configuring a vault.
### Method
POST
### Endpoint
/wallets/actions/earn/setup
### Parameters
#### Request Body
- **vault_address** (string) - Required - The address of the yield vault.
- **fee_wrapper_address** (string) - Required - The address of the fee wrapper.
### Request Example
```json
{
"vault_address": "0x...",
"fee_wrapper_address": "0x..."
}
```
### Response
#### Success Response (200)
- **message** (string) - A confirmation message indicating the earn setup process has been initiated.
```
--------------------------------
### Using Passkeys with Wallets
Source: https://docs.privy.io/llms-full.txt
Instructions on how to use passkeys for authentication with Privy wallets.
```markdown
This recipe explains the integration of passkeys as a method for authenticating and managing Privy server wallets, enhancing security.
```
--------------------------------
### Initialize import
Source: https://docs.privy.io/llms-full.txt
Initializes the wallet import process.
```APIDOC
## POST /wallets/import/init
### Description
Initializes the wallet import process.
### Method
POST
### Endpoint
/wallets/import/init
```
--------------------------------
### Get portfolio details for user
Source: https://docs.privy.io/llms-full.txt
Retrieves detailed portfolio information for a specific user. This includes their assets and their current values.
```APIDOC
## GET /api-reference/kraken-embed/users/details
### Description
Retrieves detailed portfolio information for a specific user.
### Method
GET
### Endpoint
/api-reference/kraken-embed/users/details
```
--------------------------------
### Get aggregation
Source: https://docs.privy.io/llms-full.txt
Retrieves details of an aggregation.
```APIDOC
## GET /aggregations/get
### Description
Retrieves details of an aggregation.
### Method
GET
### Endpoint
/aggregations/get
```
--------------------------------
### Login with Lens
Source: https://docs.privy.io/llms-full.txt
Instructions on how to implement login functionality using Lens protocol with Privy.
```markdown
This recipe explains how to integrate Lens login into your application using Privy, allowing users to authenticate with their Lens profiles.
```
--------------------------------
### Get transactions
Source: https://docs.privy.io/llms-full.txt
Retrieves transaction history for a wallet.
```APIDOC
## GET /wallets/get-transactions
### Description
Retrieves transaction history for a wallet.
### Method
GET
### Endpoint
/wallets/get-transactions
```
--------------------------------
### Client-side SDK Usage
Source: https://docs.privy.io/llms-full.txt
Demonstrates basic client-side usage of Privy SDKs. Ensure necessary imports and configurations are in place.
```javascript
import { PrivyClient, WalletClient } from "@privy-io/privy-node";
const client = new PrivyClient("YOUR_API_KEY");
async function example() {
const wallet = new WalletClient(client, "YOUR_WALLET_ID");
const balance = await wallet.getBalance("YOUR_TOKEN_ADDRESS");
console.log(balance);
}
```
--------------------------------
### Get transactions
Source: https://docs.privy.io/llms-full.txt
Retrieves a list of fiat transactions.
```APIDOC
## GET /fiat/status
### Description
Retrieves a list of fiat transactions.
### Method
GET
### Endpoint
/fiat/status
```
--------------------------------
### Create user
Source: https://docs.privy.io/llms-full.txt
Creates a new user within the system. This is the initial step for onboarding new users.
```APIDOC
## POST /api-reference/kraken-embed/users/create
### Description
Creates a new user within the system.
### Method
POST
### Endpoint
/api-reference/kraken-embed/users/create
```
--------------------------------
### Pregenerating Wallets
Source: https://docs.privy.io/llms-full.txt
Instructions on how to pre-generate or pre-provision wallets using Privy.
```javascript
import { PrivyClient } from "@privy-io/privy-node";
const client = new PrivyClient("YOUR_API_KEY");
async function pregenerateWallet() {
const wallet = await client.createWallet({
// Configuration for pre-generating the wallet
// e.g., specifying a user ID or other parameters
});
console.log("Pregenerated wallet address:", wallet.address);
return wallet;
}
```
--------------------------------
### Get fiat accounts
Source: https://docs.privy.io/llms-full.txt
Retrieves a list of fiat accounts.
```APIDOC
## GET /fiat/accounts/get
### Description
Retrieves a list of fiat accounts.
### Method
GET
### Endpoint
/fiat/accounts/get
```
--------------------------------
### Create account
Source: https://docs.privy.io/llms-full.txt
Creates a new account within the system.
```APIDOC
## POST /accounts/create
### Description
Creates a new account within the system.
### Method
POST
### Endpoint
/accounts/create
```
--------------------------------
### Get yield sweep
Source: https://docs.privy.io/llms-full.txt
Retrieves details of a yield sweep.
```APIDOC
## GET /ethereum_yield/get-sweep-by-id
### Description
Retrieves details of a yield sweep.
### Method
GET
### Endpoint
/ethereum_yield/get-sweep-by-id
```
--------------------------------
### Integrating the Base App (External Wallets - React)
Source: https://docs.privy.io/llms-full.txt
Guidance on integrating the 'Base App' for managing external wallets with Privy in React.
```javascript
import { PrivyProvider, useExternalWallet } from '@privy-io/react';
function BaseAppIntegration() {
const { connect } = useExternalWallet('base'); // 'base' is the connector name for Base App
const handleConnectBaseApp = async () => {
try {
await connect();
console.log('Successfully connected to Base App.');
} catch (error) {
console.error('Failed to connect to Base App:', error);
}
};
return (
);
}
function App() {
return (
{/* Your application components */}
);
}
```
--------------------------------
### Get condition set
Source: https://docs.privy.io/llms-full.txt
Retrieves details of a condition set.
```APIDOC
## GET /condition-sets/get
### Description
Retrieves details of a condition set.
### Method
GET
### Endpoint
/condition-sets/get
```
--------------------------------
### Get asset details
Source: https://docs.privy.io/llms-full.txt
Fetches detailed information about a specific asset. This includes properties like name, symbol, and current valuation.
```APIDOC
## GET /api-reference/kraken-embed/assets/details
### Description
Fetches detailed information about a specific asset.
### Method
GET
### Endpoint
/api-reference/kraken-embed/assets/details
```
--------------------------------
### Get account balance
Source: https://docs.privy.io/llms-full.txt
Retrieves the balance of a specified account.
```APIDOC
## GET /accounts/balance
### Description
Retrieves the balance of a specified account.
### Method
GET
### Endpoint
/accounts/balance
```
--------------------------------
### Guest Accounts
Source: https://docs.privy.io/llms-full.txt
Create guest accounts so users can use your app immediately without a login flow. This provides a frictionless onboarding experience.
```APIDOC
## Guest Accounts
### Description
Enable guest accounts to allow users to start using your application instantly without requiring them to go through a formal login or signup process. This approach significantly improves the initial user experience and reduces friction during onboarding.
### Key Method
- **`useLoginAsGuest()`:** A hook or function provided by the Privy SDK to create and log in a user as a guest.
### Usage
When a user chooses to proceed as a guest, your application can call `useLoginAsGuest()`. Privy will then create a temporary guest account for the user, allowing them immediate access to your app's features. This guest account can optionally be converted to a permanent account later.
### Example (Conceptual)
```javascript
const { login } = useLoginAsGuest();
async function handleGuestLogin() {
await login();
}
```
```
--------------------------------
### Create wallet
Source: https://docs.privy.io/llms-full.txt
Creates a new wallet.
```APIDOC
## POST /wallets/create
### Description
Creates a new wallet.
### Method
POST
### Endpoint
/wallets/create
```
--------------------------------
### Integrating OneBalance
Source: https://docs.privy.io/llms-full.txt
Guidance on integrating the OneBalance feature with your application using Privy.
```markdown
This document provides instructions for integrating OneBalance, a feature that simplifies balance management, into your application via Privy.
```
--------------------------------
### Get KYC process status
Source: https://docs.privy.io/llms-full.txt
Retrieves the status of a KYC process.
```APIDOC
## GET /fiat/kyc/get
### Description
Retrieves the status of a KYC process.
### Method
GET
### Endpoint
/fiat/kyc/get
```
--------------------------------
### Webhooks Overview
Source: https://docs.privy.io/llms-full.txt
Set up webhooks to receive real-time notifications when users take actions in your application.
```APIDOC
## Webhooks Overview
### Description
Set up webhooks to receive real-time notifications when users take actions in your application. This section provides an overview of available webhook events.
### Available Webhook Events:
- `earn/claim_confirmed`
- `earn/deposit_confirmed`
- `earn/withdraw_confirmed`
- `intents/authorized`
- `intents/created`
- `intents/executed`
- `intents/failed`
- `mfa/disabled`
- `mfa/enabled`
- `transaction/broadcasted`
- `transaction/confirmed`
- `transaction/execution_reverted`
- `transaction/failed`
- `transaction/provider_error`
- `transaction/replaced`
- `transaction/still_pending`
- `user-operation/completed`
- `user/authenticated`
- `user/created`
- `user/linked_account`
- `user/transferred_account`
- `user/unlinked_account`
- `user/updated_account`
- `user/wallet_created`
- `wallet-action/earn-deposit/created`
- `wallet-action/earn-deposit/failed`
- `wallet-action/earn-deposit/rejected`
- `wallet-action/earn-deposit/succeeded`
- `wallet-action/earn-incentive-claim/created`
- `wallet-action/earn-incentive-claim/failed`
- `wallet-action/earn-incentive-claim/rejected`
- `wallet-action/earn-incentive-claim/succeeded`
- `wallet-action/earn-withdraw/created`
```
--------------------------------
### Create wallets in batch
Source: https://docs.privy.io/llms-full.txt
Creates multiple wallets in a single request.
```APIDOC
## POST /wallets/batch-create
### Description
Creates multiple wallets in a single request.
### Method
POST
### Endpoint
/wallets/batch-create
```
--------------------------------
### Configuring External Connectors (React)
Source: https://docs.privy.io/llms-full.txt
How to configure and use external wallet connectors with Privy in a React application.
```javascript
import { PrivyProvider, useConnectors } from '@privy-io/react';
function App() {
const connectors = useConnectors();
return (
{/* Your application components */}
);
}
```
--------------------------------
### Get Account
Source: https://docs.privy.io/llms-full.txt
Retrieve details of a specific account by its unique account ID.
```APIDOC
## GET /wallets/accounts/get
### Description
Retrieve details of a specific account by its unique account ID.
### Method
GET
### Endpoint
/wallets/accounts/get
### Parameters
#### Query Parameters
- **account_id** (string) - Required - The unique identifier of the account to retrieve.
### Response
#### Success Response (200)
- **account_id** (string) - The unique identifier for the account.
- **chain_type** (string) - The chain type of the account.
- **custody_configuration** (string) - The custody configuration of the account.
- **display_name** (string) - The display name of the account.
- **created_at** (string) - The timestamp when the account was created.
- **wallets** (array) - A list of wallets associated with the account.
```
--------------------------------
### Create Account
Source: https://docs.privy.io/llms-full.txt
Create a digital asset account with wallets across multiple chain types and custody configurations.
```APIDOC
## POST /wallets/accounts/create
### Description
Create a digital asset account with wallets across multiple chain types and custody configurations.
### Method
POST
### Endpoint
/wallets/accounts/create
### Parameters
#### Request Body
- **chain_type** (string) - Required - The type of blockchain network (e.g., "ethereum", "solana").
- **custody_configuration** (string) - Required - The desired custody configuration (e.g., "self-custodial", "custodial").
- **display_name** (string) - Optional - A user-friendly name for the account.
### Request Example
```json
{
"chain_type": "ethereum",
"custody_configuration": "self-custodial",
"display_name": "My Ethereum Account"
}
```
### Response
#### Success Response (201)
- **account_id** (string) - The unique identifier for the newly created account.
- **chain_type** (string) - The chain type of the account.
- **custody_configuration** (string) - The custody configuration of the account.
- **display_name** (string) - The display name of the account.
- **created_at** (string) - The timestamp when the account was created.
```
--------------------------------
### Get wallet action
Source: https://docs.privy.io/llms-full.txt
Retrieves the current status of a wallet action by its ID.
```APIDOC
## GET /wallets/actions/get
### Description
Get the current status of a wallet action by its ID.
### Method
GET
### Endpoint
/wallets/actions/get
```
--------------------------------
### Get a KYC link for a user
Source: https://docs.privy.io/llms-full.txt
Generates a KYC link for a specific user.
```APIDOC
## GET /fiat/kyc/kyc-link
### Description
Generates a KYC link for a specific user.
### Method
GET
### Endpoint
/fiat/kyc/kyc-link
```
--------------------------------
### Get yield claim by ID
Source: https://docs.privy.io/llms-full.txt
Retrieves a specific yield claim by its ID.
```APIDOC
## GET /ethereum_yield/get-claim-by-id
### Description
Retrieves a specific yield claim by its ID.
### Method
GET
### Endpoint
/ethereum_yield/get-claim-by-id
```
--------------------------------
### Using Base Sub Accounts (External Wallets - React)
Source: https://docs.privy.io/llms-full.txt
Instructions for utilizing Base Sub Accounts for managing multiple wallets with Privy in React.
```javascript
import { PrivyProvider, useExternalWallet } from '@privy-io/react';
function BaseSubAccountComponent() {
const { connect, switchAccount } = useExternalWallet('base'); // Assuming 'base' connector supports sub-accounts
const handleConnectAndSwitch = async () => {
try {
await connect();
// Replace 'SUB_ACCOUNT_ADDRESS' with the actual sub-account address
await switchAccount('SUB_ACCOUNT_ADDRESS');
console.log('Connected and switched to Base Sub Account.');
} catch (error) {
console.error('Failed to connect or switch account:', error);
}
};
return (
);
}
function App() {
return (
{/* Your application components */}
);
}
```
--------------------------------
### Earn Overview
Source: https://docs.privy.io/llms-full.txt
Put balances to work with integrations to yield-generating vaults.
```APIDOC
## GET /wallets/actions/earn/overview
### Description
Provides an overview of available yield-generating vaults and earning opportunities.
### Method
GET
### Endpoint
/wallets/actions/earn/overview
### Response
#### Success Response (200)
- **vaults** (array) - A list of available yield vaults, including their IDs and brief descriptions.
```
--------------------------------
### Configure wallet options
Source: https://docs.privy.io/llms-full.txt
Customize the list of external wallets shown to users with WalletListEntry configuration.
```APIDOC
## POST /wallets/connectors/setup/configuring-external-connector-wallets
### Description
Customizes the list of external wallets presented to users by configuring `WalletListEntry` settings.
### Method
POST
### Endpoint
/wallets/connectors/setup/configuring-external-connector-wallets
### Request Body
- **walletListEntries** (array) - Required - An array of `WalletListEntry` objects to define the displayed wallets.
### Response
#### Success Response (200)
- **message** (string) - Confirmation message about the wallet list configuration.
```
--------------------------------
### Get an item from a condition set
Source: https://docs.privy.io/llms-full.txt
Retrieves a specific item from a condition set.
```APIDOC
## GET /condition-sets/condition-set-items/get
### Description
Retrieves a specific item from a condition set.
### Method
GET
### Endpoint
/condition-sets/condition-set-items/get
```
--------------------------------
### NodeJS (server-auth) Legacy Reference
Source: https://docs.privy.io/llms-full.txt
Compiled legacy documentation for the @privy-io/server-auth package. For new integrations, use @privy-io/node.
```javascript
const { PrivyServerAuth } = require('@privy-io/server-auth');
const auth = new PrivyServerAuth({
apiKey: 'YOUR_API_KEY',
// other legacy options
});
async function verifyToken(token) {
try {
const decodedToken = await auth.verify(token);
console.log('Verified token for user:', decodedToken.userId);
return decodedToken;
} catch (error) {
console.error('Token verification failed:', error);
return null;
}
}
```
--------------------------------
### Get transaction
Source: https://docs.privy.io/llms-full.txt
Retrieves details of a specific transaction. This is a general endpoint for fetching transaction information.
```APIDOC
## GET /api-reference/transactions/get
### Description
Retrieves details of a specific transaction.
### Method
GET
### Endpoint
/api-reference/transactions/get
```
--------------------------------
### Integrating with viem
Source: https://docs.privy.io/llms-full.txt
Create a viem wallet client from a Privy connected wallet for type-safe Ethereum interactions.
```APIDOC
## GET /wallets/connectors/ethereum/integrations/viem
### Description
Creates a viem wallet client from a Privy connected wallet, enabling type-safe interactions with the Ethereum blockchain.
### Method
GET
### Endpoint
/wallets/connectors/ethereum/integrations/viem
### Response
#### Success Response (200)
- **walletClient** (object) - A viem wallet client instance.
```
--------------------------------
### Get policy
Source: https://docs.privy.io/llms-full.txt
Retrieves details of a specific policy. This allows inspection of policy settings and rules.
```APIDOC
## GET /api-reference/policies/get
### Description
Retrieves details of a specific policy.
### Method
GET
### Endpoint
/api-reference/policies/get
```
--------------------------------
### Get transactions for user
Source: https://docs.privy.io/llms-full.txt
Retrieves a list of all transactions associated with a specific user's account.
```APIDOC
## GET /api-reference/kraken-embed/users/transactions
### Description
Retrieves a list of all transactions associated with a specific user's account.
### Method
GET
### Endpoint
/api-reference/kraken-embed/users/transactions
```
--------------------------------
### Wallet Actions Overview
Source: https://docs.privy.io/llms-full.txt
Wallet action APIs for transfers, swaps, and DeFi interactions with asynchronous processing.
```APIDOC
## GET /wallets/actions/overview
### Description
Provides an overview of available wallet actions, including transfers, swaps, and DeFi interactions.
### Method
GET
### Endpoint
/wallets/actions/overview
### Response
#### Success Response (200)
- **actions** (array) - A list of available wallet actions and their descriptions.
```
--------------------------------
### Provision new devices
Source: https://docs.privy.io/llms-full.txt
Transfer embedded wallet key material to new devices through the provisioning process.
```APIDOC
## POST /wallets/advanced-topics/new-devices/provision-new-devices
### Description
Transfers embedded wallet key material to new devices as part of the provisioning process.
### Method
POST
### Endpoint
/wallets/advanced-topics/new-devices/provision-new-devices
### Request Body
- **userId** (string) - Required - The ID of the user.
- **deviceId** (string) - Required - The ID of the new device to provision.
- **provisioningToken** (string) - Required - The token used for provisioning.
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the new device was successfully provisioned.
```
--------------------------------
### Submit import
Source: https://docs.privy.io/llms-full.txt
Submits the wallet import process.
```APIDOC
## POST /wallets/import/submit
### Description
Submits the wallet import process.
### Method
POST
### Endpoint
/wallets/import/submit
```
--------------------------------
### Get wallet by ID
Source: https://docs.privy.io/llms-full.txt
Retrieve details for a specific wallet using its unique ID from the Privy API.
```APIDOC
## GET /wallets/{walletId}
### Description
Get a specific wallet by its unique ID from the Privy API. This endpoint retrieves all details associated with a given wallet.
### Method
GET
### Endpoint
/wallets/{walletId}
### Parameters
#### Path Parameters
- **walletId** (string) - Required - The unique identifier of the wallet.
### Response
#### Success Response (200)
- **id** (string) - The unique ID of the wallet.
- **type** (string) - The type of the wallet.
- **userId** (string) - The ID of the user the wallet belongs to.
- **createdAt** (string) - The timestamp when the wallet was created.
#### Response Example
{
"id": "wallet_abc123",
"type": "privy",
"userId": "user_xyz789",
"createdAt": "2023-10-27T10:00:00Z"
}
```
--------------------------------
### Worldcoin Mini App SIWE with Privy (React)
Source: https://docs.privy.io/llms-full.txt
Integrating Worldcoin's Sign-In with Ethereum (SIWE) into a Mini App using Privy in React.
```javascript
import { PrivyProvider, usePrivy, useSIWE } from '@privy-io/react';
function WorldcoinSIWEComponent() {
const { ready, authenticated, user } = usePrivy();
const { signIn, signOut, verify } = useSIWE();
const handleSignInWithWorldcoin = async () => {
if (ready && authenticated) {
// Assuming Worldcoin is configured as an OAuth provider or similar
// The signIn function might internally handle Worldcoin integration
await signIn();
console.log('Attempted Sign-In with Ethereum.');
}
};
// ... verification logic using 'verify' function
return (
);
}
function App() {
return (
{/* Your application components */}
);
}
```
--------------------------------
### Prompt users to authenticate new devices
Source: https://docs.privy.io/llms-full.txt
Prompt users to authenticate on new devices before accessing their embedded wallets.
```APIDOC
## POST /wallets/advanced-topics/new-devices/auth
### Description
Initiates a prompt for users to authenticate on a new device before granting access to their embedded wallets.
### Method
POST
### Endpoint
/wallets/advanced-topics/new-devices/auth
### Request Body
- **userId** (string) - Required - The ID of the user.
- **deviceId** (string) - Required - The ID of the new device.
### Response
#### Success Response (200)
- **success** (boolean) - Indicates if the authentication prompt was successfully initiated.
```
--------------------------------
### Get Wallet Action Status
Source: https://docs.privy.io/llms-full.txt
Check the status of asynchronous wallet actions like transfers and swaps.
```APIDOC
## GET /wallets/actions/status
### Description
Check the status of asynchronous wallet actions like transfers and swaps.
### Method
GET
### Endpoint
/wallets/actions/status
### Parameters
#### Query Parameters
- **action_id** (string) - Required - The ID of the wallet action to check.
### Response
#### Success Response (200)
- **action_id** (string) - The ID of the action.
- **status** (string) - The current status of the action (e.g., "pending", "completed", "failed").
- **result** (object) - The result of the action if completed or failed.
```
--------------------------------
### Get Vault Position
Source: https://docs.privy.io/llms-full.txt
Query a wallet's holdings, display balances, and calculate earned yield.
```APIDOC
## GET /wallets/actions/earn/get-vault-position
### Description
Query a wallet's holdings, display balances, and calculate earned yield.
### Method
GET
### Endpoint
/wallets/actions/earn/get-vault-position
### Parameters
#### Query Parameters
- **account_id** (string) - Required - The ID of the account.
- **vault_id** (string) - Required - The ID of the yield vault.
### Response
#### Success Response (200)
- **account_id** (string) - The ID of the account.
- **vault_id** (string) - The ID of the vault.
- **balance** (string) - The current balance of assets held in the vault.
- **earned_yield** (string) - The amount of yield earned.
```
--------------------------------
### Configure Allowed Domains (React)
Source: https://docs.privy.io/llms-full.txt
How to configure the list of allowed domains for your Privy application in a React environment.
```javascript
import { PrivyProvider } from '@privy-io/react';
function App() {
return (
{/* Your application components */}
);
}
```
--------------------------------
### Get Vault Details
Source: https://docs.privy.io/llms-full.txt
Retrieve vault-level information like current APY, TVL, and available liquidity.
```APIDOC
## GET /wallets/actions/earn/get-vault-details
### Description
Retrieve vault-level information like current APY, TVL, and available liquidity.
### Method
GET
### Endpoint
/wallets/actions/earn/get-vault-details
### Parameters
#### Query Parameters
- **vault_id** (string) - Required - The ID of the yield vault.
### Response
#### Success Response (200)
- **vault_id** (string) - The ID of the vault.
- **apy** (string) - The current Annual Percentage Yield.
- **tvl** (string) - The Total Value Locked in the vault.
- **available_liquidity** (string) - The amount of liquidity available for withdrawal.
```
--------------------------------
### Get user by wallet address
Source: https://docs.privy.io/llms-full.txt
Retrieves a user's profile information using their wallet address.
```APIDOC
## GET /users/get-by-wallet-address
### Description
Retrieves a user's profile information using their wallet address.
### Method
GET
### Endpoint
/users/get-by-wallet-address
```
--------------------------------
### Guest Accounts (React)
Source: https://docs.privy.io/llms-full.txt
Implementing guest account functionality using Privy in a React application.
```javascript
import { PrivyProvider, usePrivy } from '@privy-io/react';
function GuestAccountComponent() {
const { ready, login, user } = usePrivy();
const handleLoginAsGuest = async () => {
if (ready) {
await login.guest();
console.log('Logged in as guest.');
}
};
return (
{!user ? (
) : (
Welcome, Guest!
)}
);
}
function App() {
return (
{/* Your application components */}
);
}
```
--------------------------------
### Get user by Twitter username
Source: https://docs.privy.io/llms-full.txt
Retrieves a user's profile information using their Twitter username.
```APIDOC
## GET /users/get-by-twitter-username
### Description
Retrieves a user's profile information using their Twitter username.
### Method
GET
### Endpoint
/users/get-by-twitter-username
```
--------------------------------
### Configure external connector chains
Source: https://docs.privy.io/llms-full.txt
Configure which chain types (EVM, Solana) external wallet connectors support in your app.
```APIDOC
## POST /wallets/connectors/setup/configuring-external-connector-chains
### Description
Configures the supported chain types (EVM, Solana) for external wallet connectors within your application.
### Method
POST
### Endpoint
/wallets/connectors/setup/configuring-external-connector-chains
### Request Body
- **evmChains** (array) - Optional - A list of EVM chain IDs to support.
- **solanaChains** (array) - Optional - A list of Solana network identifiers to support.
### Response
#### Success Response (200)
- **message** (string) - Confirmation message about the chain configuration.
```
--------------------------------
### Configuring Wallet Confirmation Modals (React)
Source: https://docs.privy.io/llms-full.txt
Customizing the appearance and behavior of wallet confirmation modals in React applications using Privy.
```javascript
import { PrivyProvider } from '@privy-io/react';
function App() {
return (
{/* Your application components */}
);
}
```
--------------------------------
### Get user by Twitch username
Source: https://docs.privy.io/llms-full.txt
Retrieves a user's profile information using their Twitch username.
```APIDOC
## GET /users/get-by-twitch-username
### Description
Retrieves a user's profile information using their Twitch username.
### Method
GET
### Endpoint
/users/get-by-twitch-username
```
--------------------------------
### createLightningInvoice
Source: https://docs.privy.io/llms-full.txt
Creates a Lightning invoice for the given wallet, allowing funds to be received via the Lightning Network.
```APIDOC
## POST /wallets/spark/create-lightning-invoice
### Description
Creates a Lightning invoice for the given wallet, allowing funds to be received via the Lightning Network.
### Method
POST
### Endpoint
/wallets/spark/create-lightning-invoice
### Parameters
#### Request Body
- **wallet_id** (string) - Required - The ID of the wallet to create the invoice for.
- **amount** (number) - Required - The amount of the invoice in satoshis.
- **memo** (string) - Optional - A memo for the invoice.
```
--------------------------------
### Get user by Telegram username
Source: https://docs.privy.io/llms-full.txt
Retrieves a user's profile information using their Telegram username.
```APIDOC
## GET /users/get-by-telegram-username
### Description
Retrieves a user's profile information using their Telegram username.
### Method
GET
### Endpoint
/users/get-by-telegram-username
```