Skip to main content
The Para Swift SDK provides a comprehensive toolkit for integrating non-custodial wallet functionality, passkey-based authentication, and blockchain interactions into your native iOS applications.

ParaManager Class

The ParaManager class is the central component for managing user authentication, wallet operations, and session state.

Properties

[Wallet]
An array of Wallet objects currently associated with the authenticated user. This list is updated after operations like fetchWallets() or createWallet().
ParaSessionState
The current session state of the Para SDK: .unknown, .inactive, .restoring (a saved session is being restored at launch), .active, or .activeLoggedIn.
ParaEnvironment
The environment configuration for the Para SDK (e.g., .beta, .prod).
String
The API key used for authenticating with Para services.
Bool
Indicates if the ParaManager and its underlying WebView are initialized and ready to process requests.

Initialization

Function
Initializes a new ParaManager instance.

Authentication Methods

Function
Signs a user up or in with their email or phone and runs the whole flow to an authenticated session, including wallet creation. Recommended for new integrations. Every email or phone sign-in starts on a Para-hosted code page; a returning passkey account is then handed back for the native passkey prompt. verificationCodeProvider is still required, but isn’t called while every sign-in starts on that page. Throws if a user is already signed in (call logout() first), if the user cancels a Para-hosted page (ParaError.error("Authentication cancelled")) or passkey prompt, if verification fails, or if the user picks a passkey that belongs to a different account. When Para’s updated authentication flow isn’t running for your app, it throws ParaTwoFactorRequiredError for an account that must complete login 2FA. See the Email & Phone Login guide.
Function
Starts the stage-based authentication (signup or login) process for a user with the specified email or phone number. When a WebAuthenticationSession is available (passed in or registered via setDefaultWebAuthenticationSession(_:)), hosted Para One Click flows are handled automatically and the returned state’s stage will be .done. The stage-based methods always use the code-entry flow; prefer authenticateWithEmailOrPhone for new integrations.
Function
Stores a WebAuthenticationSession that the SDK reuses for hosted login, signup, and OAuth flows.
Function
Submits the verification code (OTP) received by the user via email or SMS.
Function
Requests a new verification code to be sent to the user’s email or phone.
Function
Checks if a specific signup method (passkey or password) is available based on the current AuthState.
Function
Completes the signup process for a new, verified user using the chosen method (passkey or password). This creates the passkey or password and then creates the user’s required wallets, so you don’t need to call synchronizeRequiredWallets() afterward.
Function
Checks if a specific login method (passkey or password) is available for an existing user.
Function
Logs in an existing user, automatically determining and using the preferred available method (passkey or password).
Function
Logs in a user directly using their passkey.
Function
Generates and registers a new passkey for the user. Typically called during signup when authState.stage == .signup and SignupMethod.passkey is chosen.
Function
Presents a Para-hosted page (for example authState.loginUrl) in a web authentication session. Throws if no session is available or the user cancels.
Function
Presents a web URL (typically for password setup/login) using a web authentication session.
Function
Signs a user up or in with an OAuth provider and runs the whole flow to an authenticated session. Recommended for new integrations. Works on both Para sign-in experiences: on Para’s updated authentication flow the provider sign-in runs on a Para-hosted page, then a new user creates their first credential (a native passkey when your app offers passkeys, otherwise a password or PIN on a Para-hosted page) and a returning passkey user signs in with their native passkey. Otherwise it runs the same flow as handleOAuth. Throws if no WebAuthenticationSession is available, if the user cancels the sheet or passkey prompt, if the user picks a passkey that belongs to a different account, or, on Para’s updated authentication flow, if a user is already signed in (call logout() first). When Para’s updated authentication flow isn’t running for your app, it throws ParaTwoFactorRequiredError for an account that must complete login 2FA. See the Social Login guide.
Function
Initiates and handles the entire OAuth flow with the specified provider (e.g., Google, Apple, Discord). This includes user authentication with the provider, Para account lookup/creation, and passkey setup if it’s a new Para user. Always runs the provider-then-passkey flow; prefer authenticateWithOAuth for new integrations.
Function
Signs a user in to Para with an external wallet they control. Recommended for new integrations. On Para’s updated authentication flow it asks signMessage (or signCosmosMessage for a Cosmos wallet) to sign a sign-in message with the wallet (Sign-In With Ethereum for EVM, plain text for other chains) and verifies the signature. Supports EVM, Solana, and Cosmos wallets; Stellar isn’t supported yet. This is a verify-only sign-in: every account, new or returning, is signed in once the signature is verified, no embedded Para wallet is created, and the session can’t sign with any embedded Para wallets the account already has. Otherwise it runs loginExternalWallet(wallet:) with isConnectionOnly: false, which doesn’t ask for a signature. On both flows an active connection-only session (for example from MetaMaskConnector.connect()) is logged out first. Throws if a signing closure throws, if the signature can’t be verified, or, on Para’s updated authentication flow, if a user is already signed in to a Para account (call logout() first) or a Cosmos wallet is passed without signCosmosMessage. When Para’s updated authentication flow isn’t running for your app, it throws ParaTwoFactorRequiredError for an account that must complete login 2FA. See the External Wallets guide.
Function
Logs into Para using an externally managed wallet (e.g., MetaMask) without asking the wallet for a signature. With isConnectionOnly: true (the ExternalWalletInfo default) it starts a connection-only session; pass false to sign in to a Para account. Prefer authenticateWithExternalWallet for new integrations.

Session Management Methods

Function
Checks if there is an active session and the user is fully authenticated (e.g., passkey/password set up).
Function
Checks if there is any active session with Para, even if the user is not fully logged in (e.g., pending verification).
Function
Exports the current session for backup or transfer purposes.
Function
Logs out the current user and clears all session data.
Function
Gets the current user’s persisted authentication details.
Function
Manually checks and updates the current session state. This method waits for the Para WebView to be ready and updates the session state accordingly.

Wallet Management Methods

Function
Retrieves all wallets associated with the current user.
Function
Creates a new wallet for the authenticated user. This method initiates wallet creation and refreshes the internal wallets list. Observe the paraManager.wallets property for the new wallet.
Function
Retrieves the email of the currently authenticated user, if available and the session was initiated with an email.
Function
(Advanced) Distributes a new share for an existing wallet.
Function
Gets the balance for any wallet type. This unified method works with all wallet types (EVM, Solana, Cosmos).
Function
Synchronizes required wallets by creating any missing non-optional wallet types. You usually don’t need to call this: authenticateWithEmailOrPhone, handleSignup, hosted One Click signup, and handleOAuth already create a new user’s required wallets. Call it only if your integration needs to create wallet types that are still missing, for example after you add a required wallet type for existing users.

Transfer Methods

Function
Transfers tokens using an EVM wallet. This method builds, signs, and broadcasts the transaction in one call.

Signing Methods

Function
Signs an arbitrary message using the specified wallet.
Function
Signs a transaction object using the specified wallet. The method accepts any Encodable transaction type (EVMTransaction, SolanaTransaction, CosmosTransaction) and handles chain-specific formatting internally.
For EVM transactions, the returned SignatureResult contains the complete RLP-encoded transaction ready for broadcasting via eth_sendRawTransaction.
Function
Signs an RLP-encoded EVM transaction string using the private key of the specified wallet. This method is maintained for backward compatibility.

Two-Factor Authentication (2FA) Methods

Function
Initiates the setup process for 2FA.
Function
Enables 2FA for the user after they have scanned the URI and entered the code from their authenticator app.

MetaMaskConnector Class

The MetaMaskConnector class enables integration with MetaMask wallet for external wallet operations and authentication.

Properties

Bool
Indicates whether the connector is currently connected to MetaMask.
[String]
Array of connected MetaMask account addresses.
String?
The current chain ID from MetaMask (e.g., “0x1” for Ethereum mainnet, “0xaa36a7” for Sepolia).

Initialization

Function
Initializes a new MetaMaskConnector instance.

Methods

Function
Processes incoming deep link URLs from MetaMask responses.
Function
Initiates connection to MetaMask and requests account access. This method is async throws. Upon successful connection, the accounts, chainId, and isConnected properties of the MetaMaskConnector instance are updated. ParaManager.loginExternalWallet is also called internally with the connected address, which starts a connection-only session. Call ParaManager.authenticateWithExternalWallet afterward to sign the user in to Para.
Function
Requests MetaMask to sign a message with the specified account.
Function
Sends a transaction through MetaMask using the specified account.

Error Types

Error
The main error type for Para SDK operations.
Error
Thrown by the stage-based sign-in methods (initiateAuthFlow, handleVerificationCode, handleOAuth, and loginExternalWallet) when the account must complete login two-factor authentication, which those flows can’t host. The SDK cancels the pending sign-in first. The authenticate methods throw it too when Para’s updated authentication flow isn’t running for your app; on the updated flow they complete the second factor on a Para-hosted page. A separate type rather than a ParaError case, so existing switch statements over ParaError keep compiling. mode (.verify or .enroll, or nil when Para didn’t say) tells you whether the account must verify an enrolled second factor or set one up, and methods lists the second-factor methods Para offered.
Error
Errors specific to MetaMask connector operations.
Error
Errors specific to CosmosTransaction operations.
Error
Errors related to authorization handling in external wallet operations.

CosmosChain

Enum
Supported Cosmos chains with testnet configurations.

CosmosSigningMethod

Enum
Signing method for Cosmos transactions.

CosmosTransaction

Struct
A struct representing a Cosmos transaction with messages, fees, and metadata.

CosmosSignResponse

Struct
Response from a Cosmos transaction signing operation.

CosmosCoin

Struct
Represents a coin amount in Cosmos with denomination and amount.

CosmosFee

Struct
Represents transaction fees in Cosmos.

Type Definitions

SignatureResult

Struct
Result of a message or transaction signing operation.

AuthState

Struct
Authentication state returned by authentication operations.

AuthenticationResult

Struct
The result of authenticateWithEmailOrPhone, authenticateWithOAuth, and authenticateWithExternalWallet.

CosmosSignedMessage

Struct
A Cosmos wallet’s signature over the sign-in message, returned from signCosmosMessage in authenticateWithExternalWallet. Create it with CosmosSignedMessage(signature:signer:publicKeyHex:).

TransferResult

Struct
Result returned from a successful EVM transfer operation.

Auth

Enum
Authentication identifier for authenticateWithEmailOrPhone and initiateAuthFlow.

OAuthProvider

Enum
Supported OAuth provider types for authentication.

SignupMethod & LoginMethod

Enum
The possible methods for signup when the stage is .signup.
Enum
The possible methods for login when the stage is .login.

Wallet

Struct
Represents a wallet associated with a Para user account.

WalletType

Enum
Supported wallet types for Para wallets.

MetaMaskConfig

Struct
Configuration object for MetaMask connector initialization.