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

# Swift SDK quickstart

> Install the Swift OMS Wallet SDK, authenticate a wallet, and send a transaction on Polygon Amoy.

The Swift SDK supports iOS 15+, macOS 12+, and Swift 6.2+.

## Install the SDK

In Xcode, choose **File > Add Package Dependencies**, enter the repository URL, and select the latest tagged release available to your project.

```text theme={null}
https://github.com/0xsequence/swift-sdk.git
```

For CocoaPods, add the published pod to your `Podfile`.

```ruby theme={null}
pod 'oms-wallet-swift-sdk'
```

Import the package in files that use it.

```swift theme={null}
import OMSWallet
```

## Create the client

Create one `OMSWallet` when your app starts and keep it alive. The publishable key selects the OMS project and environment.

```swift theme={null}
let omsWallet = try OMSWallet(publishableKey: "YOUR_PUBLISHABLE_KEY")
```

Use `omsWallet.wallet` for authenticated wallet operations and `omsWallet.indexer` for read-only balance and history queries.

## Authenticate with email

Send an OTP, collect the code in your UI, and complete authentication. Automatic wallet selection is the default: the SDK activates the first matching wallet or creates one when needed.

```swift theme={null}
try await omsWallet.wallet.startEmailAuth(email: "user@example.com")

let auth = try await omsWallet.wallet.completeEmailAuth(code: "123456")

guard case .walletSelected(let walletAddress, _, _, _) = auth else {
    fatalError("Automatic wallet selection did not complete")
}

print("Active wallet:", walletAddress)
```

The completed session is persisted and restored when you create `OMSWallet` on a later app launch.

## Send a transaction

An active wallet session is required. This example submits a zero-value transaction on Polygon Amoy and waits for the default status resolution.

```swift theme={null}
let transaction = try await omsWallet.wallet.sendTransaction(
    network: .polygonAmoy,
    to: "0x1111111111111111111111111111111111111111",
    value: "0"
)

print("Wallet transaction ID:", transaction.txnId)
print("Onchain hash:", transaction.txnHash ?? "not available yet")
```

The SDK prepares, executes, and waits for status. See [send transactions](/wallets/sdk/swift/send-transactions) for other transaction inputs, fee selection, and status handling.
