> ## Documentation Index
> Fetch the complete documentation index at: https://docs.getpara.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Swift SDK API Reference

> Comprehensive API reference for the Para Swift SDK

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

<ResponseField name="wallets" type="[Wallet]">
  An array of `Wallet` objects currently associated with the authenticated user. This list is updated after operations like `fetchWallets()` or `createWallet()`.
</ResponseField>

<ResponseField name="sessionState" type="ParaSessionState">
  The current session state of the Para SDK (e.g., `.unknown`, `.inactive`, `.active`, `.activeLoggedIn`).
</ResponseField>

<ResponseField name="environment" type="ParaEnvironment">
  The environment configuration for the Para SDK (e.g., `.beta`, `.prod`).
</ResponseField>

<ResponseField name="apiKey" type="String">
  The API key used for authenticating with Para services.
</ResponseField>

<ResponseField name="isReady" type="Bool">
  Indicates if the `ParaManager` and its underlying WebView are initialized and ready to process requests.
</ResponseField>

### Initialization

<ResponseField name="init(environment:apiKey:appScheme:)" type="Function">
  Initializes a new `ParaManager` instance.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="environment" type="ParaEnvironment">
      The Para environment to use (e.g., `.beta`, `.prod`).
    </ResponseField>

    <ResponseField name="apiKey" type="String">
      Your Para API key.
    </ResponseField>

    <ResponseField name="appScheme" type="String?">
      Optional. Your app's custom URL scheme (e.g., "yourapp\://"). Defaults to the app's bundle identifier. Used for OAuth and other redirection flows.
    </ResponseField>
  </Expandable>
</ResponseField>

### Authentication Methods

<ResponseField name="initiateAuthFlow(auth:)" type="Function">
  Starts the authentication (signup or login) process for a user with the specified email or phone number. When a default `WebAuthenticationSession` is registered via `setDefaultWebAuthenticationSession(_:)`, hosted Para One Click flows are handled automatically and the returned state's `stage` will be `.done`.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="auth" type="Auth">
      The authentication identifier: `.email(String)` for email or `.phone(String)` for a full phone number (e.g., "+15551234567").
    </ResponseField>
  </Expandable>

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="authState" type="AuthState">
      An `AuthState` object indicating the next step in the flow (e.g., `.done` when hosted auth completed, `.verify` for new users, `.login` for existing users).
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="setDefaultWebAuthenticationSession(_:)" type="Function">
  Stores a `WebAuthenticationSession` that the SDK reuses for hosted login, signup, and OAuth flows.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="session" type="WebAuthenticationSession?">
      The shared session to reuse. Pass `nil` to clear the default and fall back to per-call overrides.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="handleVerificationCode(verificationCode:)" type="Function">
  Submits the verification code (OTP) received by the user via email or SMS.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="verificationCode" type="String">
      The verification code entered by the user.
    </ResponseField>
  </Expandable>

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="authState" type="AuthState">
      An `AuthState` object, typically with `stage == .signup`, indicating the user is verified and needs to choose a signup method (passkey or password).
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="resendVerificationCode()" type="Function">
  Requests a new verification code to be sent to the user's email or phone.
</ResponseField>

<ResponseField name="isSignupMethodAvailable(method:authState:)" type="Function">
  Checks if a specific signup method (passkey or password) is available based on the current `AuthState`.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="method" type="SignupMethod">
      The signup method to check (e.g., `.passkey`).
    </ResponseField>

    <ResponseField name="authState" type="AuthState">
      The current `AuthState` (should have `stage == .signup`).
    </ResponseField>
  </Expandable>

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="isAvailable" type="Bool">
      `true` if the method is available, `false` otherwise.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="handleSignup(authState:method:authorizationController:webAuthenticationSession:)" type="Function">
  Completes the signup process for a new, verified user using the chosen method (passkey or password). This typically includes creating a passkey/password and the first wallet.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="authState" type="AuthState">
      The current `AuthState` (must have `stage == .signup`).
    </ResponseField>

    <ResponseField name="method" type="SignupMethod">
      The chosen signup method (`.passkey` or `.password`).
    </ResponseField>

    <ResponseField name="authorizationController" type="AuthorizationController">
      An `ASAuthorizationController` instance for handling Passkey UI operations.
    </ResponseField>

    <ResponseField name="webAuthenticationSession" type="WebAuthenticationSession?">
      Optional override for web-based authentication (e.g., password setup). Defaults to the session registered via `setDefaultWebAuthenticationSession(_:)`.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="isLoginMethodAvailable(method:authState:)" type="Function">
  Checks if a specific login method (passkey or password) is available for an existing user.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="method" type="LoginMethod">
      The login method to check (e.g., `.passkey`).
    </ResponseField>

    <ResponseField name="authState" type="AuthState">
      The current `AuthState` (should have `stage == .login`).
    </ResponseField>
  </Expandable>

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="isAvailable" type="Bool">
      `true` if the method is available, `false` otherwise.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="handleLogin(authState:authorizationController:webAuthenticationSession:)" type="Function">
  Logs in an existing user, automatically determining and using the preferred available method (passkey or password).

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="authState" type="AuthState">
      The current `AuthState` (must have `stage == .login`).
    </ResponseField>

    <ResponseField name="authorizationController" type="AuthorizationController">
      An `ASAuthorizationController` instance for Passkey UI.
    </ResponseField>

    <ResponseField name="webAuthenticationSession" type="WebAuthenticationSession?">
      Optional override for web-based login (e.g., password). Defaults to the session registered via `setDefaultWebAuthenticationSession(_:)`.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="loginWithPasskey(authorizationController:email:phone:)" type="Function">
  Logs in a user directly using their passkey.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="authorizationController" type="AuthorizationController">
      An `ASAuthorizationController` instance for Passkey UI.
    </ResponseField>

    <ResponseField name="email" type="String?">
      Optional. The user's email if known, to help filter passkeys.
    </ResponseField>

    <ResponseField name="phone" type="String?">
      Optional. The user's full phone number if known, to help filter passkeys. If both email and phone are nil, the system prompts for any available passkey.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="generatePasskey(identifier:biometricsId:authorizationController:)" type="Function">
  Generates and registers a new passkey for the user. Typically called during signup when `authState.stage == .signup` and `SignupMethod.passkey` is chosen.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="identifier" type="String">
      The user's identifier (email or full phone number).
    </ResponseField>

    <ResponseField name="biometricsId" type="String">
      The `passkeyId` obtained from `AuthState.passkeyId` when `authState.stage == .signup`.
    </ResponseField>

    <ResponseField name="authorizationController" type="AuthorizationController">
      An `ASAuthorizationController` instance for Passkey UI.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="presentPasswordUrl(_ url:webAuthenticationSession:)" type="Function">
  Presents a web URL (typically for password setup/login) using a web authentication session.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="url" type="String">
      The URL to present (e.g., `authState.passwordUrl`).
    </ResponseField>

    <ResponseField name="webAuthenticationSession" type="WebAuthenticationSession?">
      Optional override. Defaults to the session registered via `setDefaultWebAuthenticationSession(_:)`.
    </ResponseField>
  </Expandable>

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="callbackURL" type="URL?">
      The callback URL if authentication was successful via direct callback, or nil on failure/cancellation.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="handleOAuth(provider:webAuthenticationSession:authorizationController:)" type="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.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="provider" type="OAuthProvider">
      The OAuth provider to use (e.g., `.google`).
    </ResponseField>

    <ResponseField name="webAuthenticationSession" type="WebAuthenticationSession?">
      Optional override for handling the OAuth web flow. Defaults to the session registered via `setDefaultWebAuthenticationSession(_:)`.
    </ResponseField>

    <ResponseField name="authorizationController" type="AuthorizationController">
      An `ASAuthorizationController` for potential passkey setup.
    </ResponseField>
  </Expandable>

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="result" type="Void">
      Returns nothing on success. Throws ParaError or other authentication-related errors on failure.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="loginExternalWallet(wallet:)" type="Function">
  Logs into Para using an externally managed wallet (e.g., MetaMask).

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="wallet" type="ExternalWalletInfo">
      Information about the external wallet, including its address and type.
    </ResponseField>
  </Expandable>
</ResponseField>

### Session Management Methods

<ResponseField name="isFullyLoggedIn()" type="Function">
  Checks if there is an active session and the user is fully authenticated (e.g., passkey/password set up).

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="isLoggedIn" type="Bool">
      `true` if the user is fully logged in, `false` otherwise.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="isSessionActive()" type="Function">
  Checks if there is any active session with Para, even if the user is not fully logged in (e.g., pending verification).

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="isActive" type="Bool">
      `true` if there is any active session, `false` otherwise.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="exportSession()" type="Function">
  Exports the current session for backup or transfer purposes.

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="sessionData" type="String">
      The session data as a string that can be saved and restored later.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="logout()" type="Function">
  Logs out the current user and clears all session data.
</ResponseField>

<ResponseField name="getCurrentUserAuthDetails()" type="Function">
  Gets the current user's persisted authentication details.

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="authState" type="AuthState?">
      The current user's authentication state, or nil if no user is authenticated. The 'stage' will be set to 'login' for active sessions.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="checkSessionState()" type="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.
</ResponseField>

### Wallet Management Methods

<ResponseField name="fetchWallets()" type="Function">
  Retrieves all wallets associated with the current user.

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="wallets" type="[Wallet]">
      An array of `Wallet` objects associated with the user.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="createWallet(type:skipDistributable:)" type="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.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="type" type="WalletType">
      The type of wallet to create (e.g., `.evm`, `.solana`, `.cosmos`).
    </ResponseField>

    <ResponseField name="skipDistributable" type="Bool">
      Whether to skip the distributable key generation step.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="getEmail()" type="Function">
  Retrieves the email of the currently authenticated user, if available and the session was initiated with an email.

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="email" type="String">
      The user's email address.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="distributeNewWalletShare(walletId:userShare:)" type="Function">
  (Advanced) Distributes a new share for an existing wallet.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="walletId" type="String">
      The ID of the wallet.
    </ResponseField>

    <ResponseField name="userShare" type="String">
      The user share to distribute.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="getBalance(walletId:token:rpcUrl:chainPrefix:denom:)" type="Function">
  Gets the balance for any wallet type. This unified method works with all wallet types (EVM, Solana, Cosmos).

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="walletId" type="String">
      The ID of the wallet.
    </ResponseField>

    <ResponseField name="token" type="String?">
      Optional token identifier (contract address for EVM, mint address for Solana, etc.).
    </ResponseField>

    <ResponseField name="rpcUrl" type="String?">
      Optional RPC URL (recommended for Solana and Cosmos to avoid 403/CORS issues).
    </ResponseField>

    <ResponseField name="chainPrefix" type="String?">
      Optional bech32 prefix for Cosmos (e.g., "juno", "stars").
    </ResponseField>

    <ResponseField name="denom" type="String?">
      Optional denom for Cosmos balances (e.g., "ujuno", "ustars").
    </ResponseField>
  </Expandable>

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="balance" type="String">
      The balance as a string (format depends on the chain).
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="synchronizeRequiredWallets()" type="Function">
  Synchronizes required wallets by creating any missing non-optional wallet types. This should be called after successful authentication for new users.

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="wallets" type="[Wallet]">
      Array of newly created wallets, if any.
    </ResponseField>
  </Expandable>
</ResponseField>

### Transfer Methods

<ResponseField name="transfer(walletId:to:amount:chainId:rpcUrl:)" type="Function">
  Transfers tokens using an EVM wallet. This method builds, signs, and broadcasts the transaction in one call.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="walletId" type="String">
      The ID of the EVM wallet to use for the transfer.
    </ResponseField>

    <ResponseField name="to" type="String">
      The recipient address.
    </ResponseField>

    <ResponseField name="amount" type="String">
      The amount to send in wei (smallest unit).
    </ResponseField>

    <ResponseField name="chainId" type="String?">
      Optional. The chain ID for the EVM network. If not provided, uses the wallet's default chain.
    </ResponseField>

    <ResponseField name="rpcUrl" type="String?">
      Optional. Custom RPC URL for the transaction. If not provided, uses the default RPC for the chain.
    </ResponseField>
  </Expandable>

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="result" type="TransferResult">
      A TransferResult object containing transaction details.
    </ResponseField>
  </Expandable>

  <Expandable title="Note" defaultOpen="true">
    This method is only available for EVM wallets. Solana and Cosmos wallets must use signing methods only.
  </Expandable>
</ResponseField>

### Signing Methods

<ResponseField name="signMessage(walletId:message:timeoutMs:)" type="Function">
  Signs an arbitrary message using the specified wallet.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="walletId" type="String">
      The ID of the wallet to use for signing.
    </ResponseField>

    <ResponseField name="message" type="String">
      The raw message string to sign. The SDK will Base64-encode this string before signing.
    </ResponseField>

    <ResponseField name="timeoutMs" type="Int?">
      Optional. Timeout for the signing operation in milliseconds.
    </ResponseField>
  </Expandable>

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="result" type="SignatureResult">
      A SignatureResult object containing the signature and metadata.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="signTransaction(walletId:transaction:timeoutMs:)" type="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.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="walletId" type="String">
      The ID of the wallet to use for signing.
    </ResponseField>

    <ResponseField name="transaction" type="Encodable">
      The transaction object to sign. Can be EVMTransaction, SolanaTransaction, or CosmosTransaction.
    </ResponseField>

    <ResponseField name="timeoutMs" type="Int?">
      Optional. Timeout for the signing operation in milliseconds.
    </ResponseField>
  </Expandable>

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="result" type="SignatureResult">
      A SignatureResult containing the signed transaction. For EVM, this includes the complete RLP-encoded transaction in `signedTransaction`. For Solana/Cosmos, if only a signature is available (e.g., pre-serialized transactions), it's provided in `signedTransaction`. Use `result.transactionData` (computed property) to get the value for broadcasting.
    </ResponseField>
  </Expandable>

  <Note>
    For EVM transactions, the returned `SignatureResult` contains the complete RLP-encoded transaction ready for broadcasting via `eth_sendRawTransaction`.
  </Note>
</ResponseField>

<ResponseField name="signTransaction(walletId:rlpEncodedTx:chainId:timeoutMs:)" type="Function">
  Signs an RLP-encoded EVM transaction string using the private key of the specified wallet. This method is maintained for backward compatibility.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="walletId" type="String">
      The ID of the EVM wallet to use for signing.
    </ResponseField>

    <ResponseField name="rlpEncodedTx" type="String">
      The RLP-encoded transaction as a hex string. The SDK will Base64-encode this string.
    </ResponseField>

    <ResponseField name="chainId" type="String">
      The chain ID of the EVM network.
    </ResponseField>

    <ResponseField name="timeoutMs" type="Int?">
      Optional. Timeout for the signing operation in milliseconds.
    </ResponseField>
  </Expandable>

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="signature" type="String">
      The resulting transaction signature as a hex string.
    </ResponseField>
  </Expandable>
</ResponseField>

### Two-Factor Authentication (2FA) Methods

<ResponseField name="setup2fa()" type="Function">
  Initiates the setup process for 2FA.

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="response" type="TwoFactorSetupResponse">
      Returns `.alreadySetup` if 2FA is already configured, or `.needsSetup(uri: String)` containing the URI to be displayed in an authenticator app (e.g., as a QR code).
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="enable2fa(verificationCode:)" type="Function">
  Enables 2FA for the user after they have scanned the URI and entered the code from their authenticator app.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="verificationCode" type="String">
      The 2FA code from the user's authenticator app.
    </ResponseField>
  </Expandable>
</ResponseField>

## MetaMaskConnector Class

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

### Properties

<ResponseField name="isConnected" type="Bool">
  Indicates whether the connector is currently connected to MetaMask.
</ResponseField>

<ResponseField name="accounts" type="[String]">
  Array of connected MetaMask account addresses.
</ResponseField>

<ResponseField name="chainId" type="String?">
  The current chain ID from MetaMask (e.g., "0x1" for Ethereum mainnet, "0xaa36a7" for Sepolia).
</ResponseField>

### Initialization

<ResponseField name="init(para:appUrl:config:)" type="Function">
  Initializes a new `MetaMaskConnector` instance.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="para" type="ParaManager">
      The ParaManager instance.
    </ResponseField>

    <ResponseField name="appUrl" type="String">
      Your app's URL scheme for deep link callbacks.
    </ResponseField>

    <ResponseField name="config" type="MetaMaskConfig">
      Configuration object containing app metadata.
    </ResponseField>
  </Expandable>
</ResponseField>

### Methods

<ResponseField name="handleURL(_:)" type="Function">
  Processes incoming deep link URLs from MetaMask responses.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="url" type="URL">
      The incoming URL to process.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="connect()" type="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.
</ResponseField>

<ResponseField name="signMessage(_:account:)" type="Function">
  Requests MetaMask to sign a message with the specified account.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="message" type="String">
      The message string to be signed.
    </ResponseField>

    <ResponseField name="account" type="String">
      The account address to use for signing.
    </ResponseField>
  </Expandable>

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="signature" type="String">
      The resulting signature from MetaMask.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="sendTransaction(_:account:)" type="Function">
  Sends a transaction through MetaMask using the specified account.

  <Expandable title="Parameters" defaultOpen="true">
    <ResponseField name="transaction" type="EVMTransaction or [String: String]">
      The transaction object or dictionary containing transaction parameters.
    </ResponseField>

    <ResponseField name="account" type="String">
      The account address to use for the transaction.
    </ResponseField>
  </Expandable>

  <Expandable title="Returns" defaultOpen="true">
    <ResponseField name="transactionHash" type="String">
      The transaction hash returned by MetaMask.
    </ResponseField>
  </Expandable>
</ResponseField>

## Error Types

<ResponseField name="ParaError" type="Error">
  The main error type for Para SDK operations.

  <Expandable title="Cases" defaultOpen="true">
    <ResponseField name="bridgeError(String)" type="Case">
      An error occurred while executing JavaScript bridge code.
    </ResponseField>

    <ResponseField name="bridgeTimeoutError" type="Case">
      The JavaScript bridge did not respond in time.
    </ResponseField>

    <ResponseField name="error(String)" type="Case">
      A general error occurred.
    </ResponseField>

    <ResponseField name="notImplemented(String)" type="Case">
      Feature not implemented yet.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="MetaMaskError" type="Error">
  Errors specific to MetaMask connector operations.

  <Expandable title="Cases" defaultOpen="true">
    <ResponseField name="alreadyProcessing" type="Case">
      Another MetaMask operation is already in progress.
    </ResponseField>

    <ResponseField name="invalidURL" type="Case">
      Failed to construct a valid URL for MetaMask communication.
    </ResponseField>

    <ResponseField name="invalidResponse" type="Case">
      Received an invalid or unexpected response from MetaMask.
    </ResponseField>

    <ResponseField name="metaMaskError(code: Int, message: String)" type="Case">
      An error reported by the MetaMask app itself (e.g., user rejection code 4001).
    </ResponseField>

    <ResponseField name="notInstalled" type="Case">
      MetaMask app is not installed on the device.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="CosmosTransactionError" type="Error">
  Errors specific to CosmosTransaction operations.

  <Expandable title="Cases" defaultOpen="true">
    <ResponseField name="invalidAddress(String)" type="Case">
      Invalid address format.
    </ResponseField>

    <ResponseField name="invalidAmount(String)" type="Case">
      Invalid amount format.
    </ResponseField>

    <ResponseField name="invalidDenom(String)" type="Case">
      Invalid denomination.
    </ResponseField>

    <ResponseField name="invalidPrefix(String)" type="Case">
      Invalid chain prefix.
    </ResponseField>

    <ResponseField name="encodingFailed(String)" type="Case">
      Transaction encoding failed.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="AuthorizationHandlingError" type="Error">
  Errors related to authorization handling in external wallet operations.

  <Expandable title="Cases" defaultOpen="true">
    <ResponseField name="invalidResponse" type="Case">
      Invalid response received from authorization process.
    </ResponseField>

    <ResponseField name="authorizationCancelled" type="Case">
      Authorization was cancelled by the user.
    </ResponseField>
  </Expandable>
</ResponseField>

### CosmosChain

<ResponseField name="CosmosChain" type="Enum">
  Supported Cosmos chains with testnet configurations.

  <Expandable title="Cases" defaultOpen="true">
    <ResponseField name="cosmos" type="Case">
      Cosmos Hub network with chain ID "provider", prefix "cosmos" and default denom "uatom" (testnet).
    </ResponseField>

    <ResponseField name="osmosis" type="Case">
      Osmosis network with chain ID "osmo-test-5", prefix "osmo" and default denom "uosmo" (testnet).
    </ResponseField>

    <ResponseField name="juno" type="Case">
      Juno network with chain ID "uni-6", prefix "juno" and default denom "ujuno" (testnet).
    </ResponseField>

    <ResponseField name="stargaze" type="Case">
      Stargaze network with chain ID "elgafar-1", prefix "stars" and default denom "ustars" (testnet).
    </ResponseField>
  </Expandable>

  <Expandable title="Properties" defaultOpen="true">
    <ResponseField name="chainId" type="String">
      The chain ID for this network.
    </ResponseField>

    <ResponseField name="prefix" type="String">
      The bech32 prefix for this chain.
    </ResponseField>

    <ResponseField name="defaultDenom" type="String">
      Default denomination for this chain.
    </ResponseField>

    <ResponseField name="rpcUrl" type="String">
      Default RPC URL for this chain's testnet.
    </ResponseField>
  </Expandable>
</ResponseField>

### CosmosSigningMethod

<ResponseField name="CosmosSigningMethod" type="Enum">
  Signing method for Cosmos transactions.

  <Expandable title="Cases" defaultOpen="true">
    <ResponseField name="amino" type="Case">
      Legacy Amino JSON signing method for backward compatibility.
    </ResponseField>

    <ResponseField name="proto" type="Case">
      Modern Proto/Direct binary signing method (recommended - more efficient).
    </ResponseField>
  </Expandable>
</ResponseField>

### CosmosTransaction

<ResponseField name="CosmosTransaction" type="Struct">
  A struct representing a Cosmos transaction with messages, fees, and metadata.

  <Expandable title="Properties" defaultOpen="true">
    <ResponseField name="messages" type="[CosmosMessage]">
      The transaction messages.
    </ResponseField>

    <ResponseField name="fee" type="CosmosFee">
      Transaction fee.
    </ResponseField>

    <ResponseField name="memo" type="String?">
      Optional memo.
    </ResponseField>

    <ResponseField name="signingMethod" type="CosmosSigningMethod">
      Preferred signing method (defaults to proto).
    </ResponseField>
  </Expandable>

  <Expandable title="Static Methods" defaultOpen="true">
    <ResponseField name="transfer(fromAddress:toAddress:amount:denom:feeDenom:feeAmount:gas:memo:signingMethod:)" type="Function">
      Convenience initializer for creating token transfer transactions.
    </ResponseField>
  </Expandable>
</ResponseField>

### CosmosSignResponse

<ResponseField name="CosmosSignResponse" type="Struct">
  Response from a Cosmos transaction signing operation.

  <Expandable title="Properties" defaultOpen="true">
    <ResponseField name="signature" type="CosmosSignature">
      The signature information.
    </ResponseField>

    <ResponseField name="signedDoc" type="[String: Any]">
      The signed document.
    </ResponseField>
  </Expandable>
</ResponseField>

### CosmosCoin

<ResponseField name="CosmosCoin" type="Struct">
  Represents a coin amount in Cosmos with denomination and amount.

  <Expandable title="Properties" defaultOpen="true">
    <ResponseField name="denom" type="String">
      The token denomination (e.g., "uatom").
    </ResponseField>

    <ResponseField name="amount" type="String">
      The amount as a string in the smallest unit.
    </ResponseField>
  </Expandable>

  <Expandable title="Initializers" defaultOpen="true">
    <ResponseField name="init(denom:amount:)" type="Function">
      Creates a new coin with string amount.
    </ResponseField>

    <ResponseField name="init(denom:amount:)" type="Function">
      Creates a new coin with UInt64 amount.
    </ResponseField>
  </Expandable>
</ResponseField>

### CosmosFee

<ResponseField name="CosmosFee" type="Struct">
  Represents transaction fees in Cosmos.

  <Expandable title="Properties" defaultOpen="true">
    <ResponseField name="amount" type="[CosmosCoin]">
      Array of fee coins.
    </ResponseField>

    <ResponseField name="gas" type="String">
      Gas limit as a string.
    </ResponseField>
  </Expandable>

  <Expandable title="Initializers" defaultOpen="true">
    <ResponseField name="init(amount:gas:)" type="Function">
      Creates a fee with array of coins.
    </ResponseField>

    <ResponseField name="init(denom:amount:gas:)" type="Function">
      Convenience initializer for simple fee.
    </ResponseField>
  </Expandable>
</ResponseField>

## Type Definitions

### SignatureResult

<ResponseField name="SignatureResult" type="Struct">
  Result of a message or transaction signing operation.

  <Expandable title="Properties" defaultOpen="true">
    <ResponseField name="signedTransaction" type="String">
      For transaction signing: Contains the complete signed transaction ready for broadcasting (RLP-encoded for EVM, serialized for other chains).
      For message signing: Contains just the signature.
      Note: The bridge returns `signature` for messages and `signedTransaction` for transactions, but Swift SDK normalizes both to `signedTransaction` for consistency.
    </ResponseField>

    <ResponseField name="transactionData" type="String" computed="true">
      Computed property that returns the signed transaction data for broadcasting.
    </ResponseField>

    <ResponseField name="walletId" type="String">
      The ID of the wallet that performed the signing.
    </ResponseField>

    <ResponseField name="type" type="String">
      The wallet type that signed (e.g., "evm", "solana", "cosmos").
    </ResponseField>
  </Expandable>
</ResponseField>

### AuthState

<ResponseField name="AuthState" type="Struct">
  Authentication state returned by authentication operations.

  <Expandable title="Properties" defaultOpen="true">
    <ResponseField name="stage" type="AuthStage">
      The stage of authentication (`.verify`, `.signup`, `.login`).
    </ResponseField>

    <ResponseField name="userId" type="String">
      The Para userId for the currently authenticating user.
    </ResponseField>

    <ResponseField name="email" type="String?">
      Email address if using email auth.
    </ResponseField>

    <ResponseField name="phone" type="String?">
      Phone number if using phone auth.
    </ResponseField>

    <ResponseField name="displayName" type="String?">
      Display name for the authenticating user.
    </ResponseField>

    <ResponseField name="pfpUrl" type="String?">
      Profile picture URL for the authenticating user.
    </ResponseField>

    <ResponseField name="username" type="String?">
      Username for the authenticating user.
    </ResponseField>

    <ResponseField name="passkeyUrl" type="String?">
      URL for passkey authentication.
    </ResponseField>

    <ResponseField name="passkeyId" type="String?">
      ID for the passkey.
    </ResponseField>

    <ResponseField name="passkeyKnownDeviceUrl" type="String?">
      URL for passkey authentication on a known device.
    </ResponseField>

    <ResponseField name="passwordUrl" type="String?">
      URL for password authentication.
    </ResponseField>

    <ResponseField name="biometricHints" type="[BiometricHint]?">
      Biometric hints for the user's devices.
    </ResponseField>
  </Expandable>
</ResponseField>

### TransferResult

<ResponseField name="TransferResult" type="Struct">
  Result returned from a successful EVM transfer operation.

  <Expandable title="Properties" defaultOpen="true">
    <ResponseField name="hash" type="String">
      The transaction hash on the blockchain.
    </ResponseField>

    <ResponseField name="from" type="String">
      The sender address.
    </ResponseField>

    <ResponseField name="to" type="String">
      The recipient address.
    </ResponseField>

    <ResponseField name="amount" type="String">
      The amount transferred in wei (smallest unit).
    </ResponseField>

    <ResponseField name="chainId" type="String">
      The chain ID where the transaction was broadcast.
    </ResponseField>
  </Expandable>
</ResponseField>

### Auth

<ResponseField name="Auth" type="Enum">
  Authentication type for initiateAuthFlow method.

  <Expandable title="Cases" defaultOpen="true">
    <ResponseField name="email(String)" type="Case">
      Email-based authentication.
    </ResponseField>

    <ResponseField name="phone(String)" type="Case">
      Phone-based authentication with full phone number including country code.
    </ResponseField>
  </Expandable>
</ResponseField>

### OAuthProvider

<ResponseField name="OAuthProvider" type="Enum">
  Supported OAuth provider types for authentication.

  <Expandable title="Cases" defaultOpen="true">
    <ResponseField name="google" type="Case">
      Google authentication provider.
    </ResponseField>

    <ResponseField name="discord" type="Case">
      Discord authentication provider.
    </ResponseField>

    <ResponseField name="apple" type="Case">
      Apple authentication provider.
    </ResponseField>
  </Expandable>
</ResponseField>

### SignupMethod & LoginMethod

<ResponseField name="SignupMethod" type="Enum">
  The possible methods for signup when the stage is .signup.

  <Expandable title="Cases" defaultOpen="true">
    <ResponseField name="passkey" type="Case">
      Passkey-based signup.
    </ResponseField>

    <ResponseField name="password" type="Case">
      Password-based signup.
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="LoginMethod" type="Enum">
  The possible methods for login when the stage is .login.

  <Expandable title="Cases" defaultOpen="true">
    <ResponseField name="passkey" type="Case">
      Passkey-based login.
    </ResponseField>

    <ResponseField name="password" type="Case">
      Password-based login.
    </ResponseField>

    <ResponseField name="passkeyKnownDevice" type="Case">
      Passkey login on a known device.
    </ResponseField>
  </Expandable>
</ResponseField>

### Wallet

<ResponseField name="Wallet" type="Struct">
  Represents a wallet associated with a Para user account.

  <Expandable title="Properties" defaultOpen="true">
    <ResponseField name="id" type="String">
      Unique identifier for the wallet.
    </ResponseField>

    <ResponseField name="type" type="WalletType">
      The type of wallet (e.g., `.evm`, `.solana`, `.cosmos`).
    </ResponseField>

    <ResponseField name="address" type="String?">
      Primary public address of the wallet.
    </ResponseField>

    <ResponseField name="addressSecondary" type="String?">
      Secondary address (e.g., Cosmos bech32 address for Cosmos wallets).
    </ResponseField>

    <ResponseField name="publicKey" type="String?">
      Public key of the wallet.
    </ResponseField>

    <ResponseField name="scheme" type="String?">
      Scheme used by the wallet.
    </ResponseField>

    <ResponseField name="createdAt" type="Date?">
      Timestamp when the wallet was created.
    </ResponseField>
  </Expandable>
</ResponseField>

### WalletType

<ResponseField name="WalletType" type="Enum">
  Supported wallet types for Para wallets.

  <Expandable title="Cases" defaultOpen="true">
    <ResponseField name="evm" type="Case">
      Ethereum Virtual Machine compatible wallet (Ethereum, Polygon, etc.).
    </ResponseField>

    <ResponseField name="solana" type="Case">
      Solana blockchain wallet.
    </ResponseField>

    <ResponseField name="cosmos" type="Case">
      Cosmos ecosystem wallet supporting bech32 addresses.
    </ResponseField>
  </Expandable>
</ResponseField>

### MetaMaskConfig

<ResponseField name="MetaMaskConfig" type="Struct">
  Configuration object for MetaMask connector initialization.

  <Expandable title="Properties" defaultOpen="true">
    <ResponseField name="appName" type="String">
      The name of your application as displayed in MetaMask.
    </ResponseField>

    <ResponseField name="appId" type="String">
      Your application's identifier (typically the bundle identifier).
    </ResponseField>

    <ResponseField name="apiVersion" type="String">
      The API version to use (e.g., "1.0").
    </ResponseField>
  </Expandable>
</ResponseField>
