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.
Para Swift SDK eliminates the complexity of blockchain integration by providing a unified interface for wallet creation, authentication, and multi-chain transactions in iOS applications.
Quick Start
import SwiftUI
import ParaSwift
struct AuthView: View {
@EnvironmentObject var paraManager: ParaManager
@Environment(\.webAuthenticationSession) private var webAuthenticationSession
@Environment(\.authorizationController) private var authorizationController
var body: some View {
VStack {
Button("Authenticate") {
startAuth()
}
}
.task {
// Reuse the system WebAuthenticationSession for hosted auth flows
paraManager.setDefaultWebAuthenticationSession(webAuthenticationSession)
}
}
private func startAuth() {
Task {
do {
let authState = try await paraManager.initiateAuthFlow(auth: .email("user@example.com"))
switch authState.stage {
case .done:
// One Click hosted auth finished automatically
handleAuthenticatedUser()
case .verify:
// Show OTP or passkey enrollment UI
presentVerification(authState)
case .signup:
// Let the user pick passkey vs password enrollment
presentSignupOptions(authState)
case .login:
// Existing user — Para chooses passkey/password automatically
try await paraManager.handleLogin(
authState: authState,
authorizationController: authorizationController
)
handleAuthenticatedUser()
default:
// Handle other states as needed (e.g., show error UI)
break
}
} catch {
// Handle errors according to your UI needs
}
}
}
}
Implement lightweight helpers like handleAuthenticatedUser(), presentVerification(_:), or presentSignupOptions(_:) to align with your navigation flow.
Create the ParaManager once at your app entry point (for example with @StateObject in App) and inject it into views with .environmentObject(paraManager).
Sign Transactions
// Get wallet
let wallets = try await paraManager.fetchWallets()
let evmWallet = wallets.first { $0.type == .evm }!
let solanaWallet = wallets.first { $0.type == .solana }!
// EVM transaction
let transaction = EVMTransaction(
to: "0x742d35Cc6634C0532925a3b844Bc9e7595f6E2c0",
value: BigUInt("1000000000000000")!, // 0.001 ETH in wei
gasLimit: BigUInt("21000")!
)
let result = try await paraManager.signTransaction(
walletId: evmWallet.id,
transaction: transaction,
chainId: "11155111", // Sepolia
rpcUrl: "https://sepolia.infura.io/v3/YOUR_API_KEY"
)
// Solana message signing
let signature = try await paraManager.signMessage(
walletId: solanaWallet.id,
message: "Hello, Solana!"
)
Next Steps