Skip to main content

Para Class

The Para class is the main entry point for the Para Flutter SDK, providing wallet operations, authentication, and blockchain interactions. The latest version includes passkey authentication, comprehensive multi-chain support, and deep linking capabilities.

Constructor

Para.fromConfig()
Constructor
Creates a new Para SDK instance using the v2 factory constructor.

Authentication Methods

initiateAuthFlow()
Future<AuthState>
Initiates authentication flow for email or phone. Returns an AuthState indicating next steps.
verifyOtp()
Future<AuthState>
Verifies the OTP code sent to email/phone during authentication.
handleLogin()
Future<Wallet>
Handles login for existing users with passkey authentication.
handleSignup()
Future<Wallet>
Handles the complete signup flow for new users, including passkey creation and wallet setup.
verifyOAuth()
Future<AuthState>
Handles complete OAuth authentication flow using an external browser.

Wallet Management

createWallet()
ParaFuture<Wallet>
Creates a new wallet with enhanced multi-chain support. Returns a ParaFuture that can be cancelled.
fetchWallets()
ParaFuture<List<Wallet>>
Retrieves all wallets for the current user.

Signing Operations

signMessage()
ParaFuture<SignatureResult>
Signs a message with the specified wallet. Returns a cancellable ParaFuture.
signTransaction()
ParaFuture<SignatureResult>
Signs an EVM transaction. Returns a cancellable ParaFuture.
This method is for EVM transactions only. For Solana, use signMessage() with the serialized transaction as messageBase64. For Cosmos, use signMessage() with cosmosSignDocBase64.EVM Transaction Return Value: The SuccessfulSignatureResult contains the complete RLP-encoded transaction ready for broadcasting via the signedTransaction property.Solana/Cosmos Return Value: For pre-serialized transactions, returns just the signature in signedTransaction. For constructed transactions, returns the complete signed transaction.
cancelOperationById()
Future<void>
Cancels an ongoing operation by its request ID.

Session Management

isSessionActive()
ParaFuture<bool>
Checks if there’s an active user session.
exportSession()
ParaFuture<String>
Exports the current session as an encrypted string.
logout()
ParaFuture<void>
Logs out the current user and clears session data.

Utility Methods

currentUser()
ParaFuture<ParaUser>
Gets the current user’s basic profile and session status.
getLoginUrl()
ParaFuture<String>
Returns a browser URL for One-Click (BASIC_LOGIN) authentication.
presentAuthUrl()
Future<Uri?>
Presents an auth URL in a secure system web view and returns the callback URI (if any).
waitForLogin()
ParaFuture<Map<String, dynamic>>
Waits for an ongoing login operation to complete.
waitForSignup()
ParaFuture<bool>
Polls for completion of a pending One-Click signup.
waitForWalletCreation()
ParaFuture<Map<String, dynamic>>
Waits for wallet creation to complete after signup.
touchSession()
ParaFuture<Map<String, dynamic>?>
Refreshes the current session metadata and returns the latest snapshot (or null if nothing changed).
formatPhoneNumber()
String?
Formats a phone number for authentication.
isUsingExternalWallet()
ParaFuture<bool>
Checks if the current user is using an external wallet.
clearStorage()
ParaFuture<void>
Clears local storage data.
dispose()
void
Disposes of SDK resources. Call when the SDK is no longer needed.

Extension Methods

Para provides extension methods for cleaner authentication flows (requires importing extensions):

ParaAuthExtensions

initiateAuthFlow()
Future<AuthState>
Initiates authentication and returns the current state using Auth helper class.
presentPasswordUrl()
Future<Uri?>
Presents a password authentication URL in a secure web view.

Types and Enums

Environment

Auth

AuthState

SignupMethod

OAuthMethod

WalletType

ParaFuture

Wallet

SignatureResult