Skip to main content

Types Reference

Complete type definitions for Volr SDK.

Core Types

VolrUser

interface VolrUser {
id: string;
projectId?: string;
projectName?: string;
email?: string | null;
authWallet?: string | null;
evmAddress?: string | null;
keyStorageType?: 'passkey' | 'mpc';
signerType?: 'passkey' | 'external_wallet' | 'mpc';
walletConnector?: string;
lastWalletChainId?: number;
externalWalletPreferred?: boolean;
registeredPasskeys?: PasskeyInfo[];
}

PaymentResult

interface PaymentResult {
id: string;
txHash: string;
status: 'pending' | 'processing' | 'confirmed' | 'failed';
amount: string;
currency: string;
createdAt: string;
}

Balance

interface Balance {
tokenId: string;
symbol: string;
balance: string;
usdValue: number;
chainId: number;
address: string;
decimals: number;
}

Configuration Types

VolrUIConfig

interface VolrUIConfig {
projectApiKey: string;
appName: string;
rpcOverrides?: Record<number, string>;
accentColor?: string;
theme?: 'light' | 'dark' | 'system';
enabledLoginMethods?: ('email' | 'social' | 'siwe')[];
socialProviders?: ('google' | 'twitter')[];
branding?: BrandingConfig;
keyStorageType?: 'passkey' | 'mpc';
walletPolicy?: {
requireVolrWalletOnLogin?: boolean;
};
allowExternalWalletPayment?: boolean;
}

BrandingConfig

interface BrandingConfig {
logoUrl?: string;
primaryColor?: string;
backgroundColor?: string;
}

ModalMode

type ModalMode = 'account' | 'deposit' | 'payment';

ModalAsset

interface ModalAsset {
chainId: number;
symbol: string;
}

Authentication Types

SetSessionParams

interface SetSessionParams {
accessToken: string;
refreshToken: string;
}

OidcExchangeResult

interface OidcExchangeResult {
userId: string;
isNewUser: boolean;
keyStorageType: 'passkey' | 'mpc' | null;
signerType: 'passkey' | 'mpc' | null;
accessToken: string;
}

Payment Types

PaymentModalOptions

interface PaymentModalOptions {
amount: string;
currency: string;
item?: {
name: string;
description?: string;
image?: string;
};
onSuccess?: (result: PaymentResult) => void;
onError?: (error: Error) => void;
onCancel?: () => void;
}

PaymentItem

interface PaymentItem {
name: string;
description?: string;
image?: string;
}

Next Steps