Skip to main content
The Swift SDK supports iOS 15+ and macOS 12+. OMSClient is the entry point for wallet auth, signing, signature verification, ID tokens, transaction helpers, and balance queries.

Install

Add the package in Xcode with File -> Add Package Dependencies and enter the following git URL.
https://github.com/0xsequence/swift-sdk.git
Select version 0.1.0-alpha.4. For CocoaPods, add the pod to your Podfile.
pod 'oms-client-swift-sdk', '0.1.0-alpha.4'
Import the SDK in the files that use it.
import OMS_SDK

Create The Client

Create one OMSClient when your app starts and keep it alive for the current app session.
let oms = try OMSClient(publishableKey: "YOUR_PUBLISHABLE_KEY")
The publishableKey selects the matching OMS Wallet environment for client SDK calls. The client exposes:
PropertyUse
oms.walletAuthentication, session state, wallet selection, signing, signature verification, ID tokens, and transactions.
oms.indexerToken balance and transaction history reads.
oms.supportedNetworksNetworks supported by this SDK build.

Authenticate With Email

Email auth is a two-step OTP flow.
try await oms.wallet.startEmailAuth(email: "user@example.com")

// Show your OTP input, then complete auth with the user-entered code.
let result = try await oms.wallet.completeEmailAuth(code: "123456")

if case let .walletSelected(walletAddress, _, _, _) = result {
    print("Wallet address:", walletAddress)
}
completeEmailAuth verifies the OTP, loads an existing wallet for the user, or creates one when needed. Wallet metadata and session state are persisted in the device keychain.

Send A Transaction

After authentication, send a native token transaction with oms.wallet.sendTransaction. Values are raw base-unit integer strings. Polygon Amoy is a good first network for testing.
let tx = try await oms.wallet.sendTransaction(
    network: .polygonAmoy,
    to: "0x1111111111111111111111111111111111111111",
    value: "0"
)

print("Transaction:", tx.txnHash ?? tx.txnId)