Access all wallets associated with a user’s Para account using React hooks or the Para client methods.

Prerequisites

Before retrieving wallets, ensure you have completed setup and authenticated users.

Setup & Authentication

useAccount

Access all wallets through the account hook.

useAccount.tsx
import { useAccount } from '@getpara/react-sdk';

const { embedded } = useAccount();
const wallets = embedded.wallets; // Record<string, Wallet>

useWallet

Access the currently selected wallet.

useWallet.tsx
import { useWallet } from '@getpara/react-sdk';

const { data: selectedWallet } = useWallet();
const walletAddress = selectedWallet?.address;

Using React Hooks

These examples demonstrate how to use React hooks to access and work with wallet data in your components.

Access All Wallets

Retrieve all wallets from the user’s account and convert them to different formats for easy manipulation.

accessAllWallets.tsx
import { useAccount } from '@getpara/react-sdk';

const { embedded, external } = useAccount();

// Access embedded wallets
const embeddedWallets = embedded.wallets;
const walletCount = Object.keys(embeddedWallets).length;

// Check connection status
const hasWallets = embedded.isConnected && walletCount > 0;

// Convert to array for iteration
const walletList = Object.values(embeddedWallets);

// Get first wallet
const firstWallet = walletList[0];

Access Selected Wallet

Use the useWallet hook to get information about the currently selected wallet.

accessSelectedWallet.tsx
import { useWallet } from '@getpara/react-sdk';

const { data: selectedWallet, isLoading, isSuccess } = useWallet();

// Access wallet properties
const walletId = selectedWallet?.id;
const walletAddress = selectedWallet?.address;
const walletScheme = selectedWallet?.scheme;

// Check if wallet is external
const isExternalWallet = selectedWallet?.isExternal;

Client Methods

These methods are available on the Para client instance for direct wallet operations.

getWallets

Retrieve all wallets as an object indexed by wallet ID.

getWalletsByType

Filter wallets by blockchain type to get only wallets for a specific network.

getAllWallets.tsx
import { useClient } from '@getpara/react-sdk';

const para = useClient();

// Get all wallets as object
const allWallets = para.getWallets();

// Convert wallet object to array
const walletArray = Object.values(allWallets);
import { useClient } from '@getpara/react-sdk';

const para = useClient();
const evmWallets = para.getWalletsByType('EVM');

Wallet Properties

Each wallet object contains the following properties that provide comprehensive information about the wallet.

Usage Examples

These examples show common patterns for working with wallets in your application.

Filter by Wallet Type

Retrieve wallets for specific blockchain networks using the getWalletsByType method.

import { useClient } from '@getpara/react-sdk';

const para = useClient();

// Get EVM wallets
const evmWallets = para.getWalletsByType('EVM');

// Access addresses
const evmAddresses = evmWallets.map(w => w.address);

// Get first EVM wallet
const primaryEvmWallet = evmWallets[0];

Filter by Wallet Source

Separate embedded wallets (created by Para) from external wallets (connected from third-party providers).

filterBySource.tsx
import { useClient } from '@getpara/react-sdk';

const para = useClient();
const allWallets = para.getWallets();

// Convert to array and filter
const walletArray = Object.values(allWallets);
const embeddedWallets = walletArray.filter(w => !w.isExternal);
const externalWallets = walletArray.filter(w => w.isExternal);

// Count by type
const embeddedCount = embeddedWallets.length;
const externalCount = externalWallets.length;

Working with Wallet Data

These examples demonstrate how to search and access specific wallets from your wallet collection.

Find Specific Wallet

Locate wallets by their ID or address using different search methods.

findWallet.tsx
import { useClient } from '@getpara/react-sdk';

const para = useClient();
const wallets = para.getWallets();

// Find by wallet ID (direct access)
const walletById = wallets['wallet-id-here'];

// Find by address
const walletArray = Object.values(wallets);
const walletByAddress = walletArray.find(
  w => w.address?.toLowerCase() === '0x123...'.toLowerCase()
);

// Check if wallet exists
const walletExists = 'wallet-id-here' in wallets;

Next Steps