public final class OMSWallet: Sendable {
public let wallet: WalletClient
public let indexer: IndexerClient
public convenience init(publishableKey: String) throws
}public final class WalletClient: @unchecked Sendablepublic internal(set) var walletAddress: String? { get set }public internal(set) var walletId: String { get set }public var session: OMSWalletSessionState { get }Snapshot of the current durable wallet-session state.
@discardableResult public func addSessionExpiredObserver(_ observer: @escaping @MainActor @Sendable (OMSWalletSessionExpiredEvent) -> Void) -> OMSWalletSessionExpiredObservationpublic func startEmailAuth(email: String, sessionLifetimeSeconds: UInt32 = 604_800) async throwsInitiates email-based OTP authentication by sending a one-time code to the given address.
@discardableResult public func completeEmailAuth(code: String, walletSelection: WalletSelectionBehavior = .automatic, walletType: WalletType = WalletType.ethereum) async throws -> CompleteAuthResultCompletes the email OTP authentication flow.
WalletClient.signInWithOidcIdToken(idToken:issuer:audience:walletType:walletSelection:sessionLifetimeSeconds:provider:providerLabel:)
@discardableResult public func signInWithOidcIdToken(idToken: String, issuer: String, audience: String, walletType: WalletType = WalletType.ethereum, walletSelection: WalletSelectionBehavior = .automatic, sessionLifetimeSeconds: UInt32 = 604_800, provider: String? = nil, providerLabel: String? = nil) async throws -> CompleteAuthResultSigns in with an OIDC ID token.
WalletClient.startOIDCRedirectAuth(provider:walletType:loginHint:authorizeParams:walletSelection:sessionLifetimeSeconds:)
public func startOIDCRedirectAuth(provider: CustomOIDCProviderConfiguration, walletType: WalletType = WalletType.ethereum, loginHint: String? = nil, authorizeParams: [String : String] = [:], walletSelection: WalletSelectionBehavior? = nil, sessionLifetimeSeconds: UInt32? = nil) async throws -> StartOIDCRedirectAuthResultStarts OIDC authorization-code redirect authentication.
WalletClient.startOIDCRedirectAuth(provider:omsRelayReturnURI:walletType:loginHint:walletSelection:sessionLifetimeSeconds:)
public func startOIDCRedirectAuth(provider: OMSRelayOIDCProvider, omsRelayReturnURI: String, walletType: WalletType = WalletType.ethereum, loginHint: String? = nil, walletSelection: WalletSelectionBehavior? = nil, sessionLifetimeSeconds: UInt32? = nil) async throws -> StartOIDCRedirectAuthResultStarts OIDC authorization-code redirect authentication through the built-in OMS relay for the fixed Google and Apple provider values.
public func handleOIDCRedirectCallback(_ callbackURL: String?, walletSelection: WalletSelectionBehavior? = nil, sessionLifetimeSeconds: UInt32? = nil) async throws -> OIDCRedirectAuthResultSafely handles an incoming OIDC authorization-code redirect callback.
public func listWallets() async throws -> [Wallet]Lists all wallets available to the authenticated credential.
@discardableResult public func useWallet(walletId: String) async throws -> WalletSelectionResultActivates an existing wallet by its WaaS wallet ID and persists its address and signer metadata to the keychain.
@discardableResult public func createWallet(walletType: WalletType = WalletType.ethereum, reference: String? = nil) async throws -> WalletSelectionResultCreates a new wallet of the specified type for the authenticated user and persists its address and signer metadata to the keychain.
@discardableResult public func importWallet(privateKey: WalletImportPrivateKey, reference: String? = nil) async throws -> WalletSelectionResultImports and activates an Ethereum or Solana private key.
public func getWalletImportRecipientKey(cipherSuite: WalletImportCipherSuite) async throws -> WalletImportRecipientKeyFetches an attested recipient key for advanced wallet-import encryption flows.
@discardableResult public func importEncryptedWallet(walletType: WalletType, keyMaterial: EncryptedWalletImportKeyMaterial, reference: String? = nil) async throws -> WalletSelectionResultImports and activates key material encrypted by the caller for an attested WaaS recipient key.
public func getIdToken(ttlSeconds: UInt32? = nil, customClaims: [String : JSONValue]? = nil) async throws -> Stringpublic func inspectRemoteCredential(credentialId: String) async throws -> RemoteCredentialMetadataReturns display metadata for a remote credential before the owner approves access.
public func authorizeRemoteAccess(credentialId: String, network: Network, grants: [SmartSessionGrant], expiresAt: String, sessionId: String? = nil) async throws -> AuthorizedRemoteAccessAuthorizes owner-approved EVM smart-session grants for a remote credential. Omit sessionId
to create a session; pass an existing session ID to replace that session's grants and
requested expiry without changing its signer. WaaS caps the effective expiry at the remote
credential's expiry.
public func listAccess(pageSize: UInt32? = nil, type: AccessGrantType? = nil) async throws -> [AccessGrant]Returns all wallet access grants, following WaaS cursors automatically.
public func listAccessPage(pageSize: UInt32? = nil, cursor: String? = nil, type: AccessGrantType? = nil) async throws -> AccessGrantPageReturns one credential-access page for this wallet.
public func listAccessPages(pageSize: UInt32? = nil, type: AccessGrantType? = nil) -> ListAccessPagesReturns credential-access pages for this wallet until WaaS stops returning a cursor.
public func getRemoteAccessSession(sessionId: String) async throws -> RemoteAccessSessionReturns one owner-visible remote session and verifies that it belongs to the selected wallet.
public func getRemoteAccessSessionUsage(sessionId: String, network: Network) async throws -> [SmartSessionGrantUsage]Returns the current usage for each bounded grant in an owner-visible remote session.
public func revokeAccess(credentialId: String, sessionId: String? = nil) async throwsRevokes one access grant from the selected wallet. Use listAccess() or
listAccessPage(pageSize:cursor:type:) first to retrieve the direct or remote grant. Omit
sessionId for a direct grant; for a remote grant, pass its session ID to revoke exactly
that session.
public func signOut() throwsClears the wallet session from the device keychain.
public enum WalletSelectionBehavior: String, Codable, Equatable, Sendable {
case automatic
case manual
public init?(rawValue: String)
}public enum CompleteAuthResult: Sendable {
case walletSelected(
walletAddress: String,
wallet: Wallet,
wallets: [Wallet],
credential: WalletCredential
)
case walletSelection(PendingWalletSelection)
public var credential: WalletCredential { get }
public var walletAddress: String? { get }
public var wallet: Wallet? { get }
}public final class PendingWalletSelection: @unchecked Sendable {
public let walletType: WalletType
public let wallets: [Wallet]
public let credential: WalletCredential
@discardableResult public func selectWallet(walletId: String) async throws -> WalletSelectionResult
@discardableResult public func createAndSelectWallet(reference: String? = nil) async throws -> WalletSelectionResult
}public struct WalletSelectionResult: Sendable {
public let walletAddress: String
public let wallet: Wallet
public init(walletAddress: String, wallet: Wallet)
}public struct Wallet: Codable, Equatable, Sendable {
public let id: String
public let type: WalletType
public let address: String
public let reference: String?
public let keyOrigin: WalletKeyOrigin
public init(id: String, type: WalletType, address: String, reference: String? = nil, keyOrigin: WalletKeyOrigin)
public init(from decoder: any Decoder) throws
}public enum WalletType: Codable, Equatable, Hashable, Sendable {
case ethereum
case solana
case unknown(String)
public var wireValue: String { get }
public init(wireValue: String)
public init(from decoder: Decoder) throws
public func encode(to encoder: Encoder) throws
}public enum WalletKeyOrigin: Codable, Equatable, Hashable, Sendable {
case enclave
case imported
case unknown(String)
public var wireValue: String { get }
public init(wireValue: String)
public init(from decoder: Decoder) throws
public func encode(to encoder: Encoder) throws
}public enum WalletImportCipherSuite: String, CaseIterable, Sendable {
case x25519Sha256Aes256Gcm = "x25519-sha256-aes256gcm"
case x25519Sha256ChaCha20Poly1305 = "x25519-sha256-chacha20poly1305"
case p256Sha256Aes256Gcm = "p256-sha256-aes256gcm"
case p256Sha256ChaCha20Poly1305 = "p256-sha256-chacha20poly1305"
public init?(rawValue: String)
}public enum WalletImportPrivateKey: Sendable {
case ethereum(String)
case ethereumBytes(Data)
case solana(String)
case solanaBytes(Data)
}public struct WalletImportRecipientKey: Equatable, Sendable {
public let keyId: String
public let cipherSuite: WalletImportCipherSuite
public let publicKey: String
public init(keyId: String, cipherSuite: WalletImportCipherSuite, publicKey: String)
}public struct EncryptedWalletImportKeyMaterial: Equatable, Sendable {
public let keyId: String
public let cipherSuite: WalletImportCipherSuite
public let encapsulatedKey: String
public let ciphertext: String
public init(keyId: String, cipherSuite: WalletImportCipherSuite, encapsulatedKey: String, ciphertext: String)
}public struct WalletCredential: Codable, Equatable, Sendable {
public let credentialId: String
public let expiresAt: String
public let isCaller: Bool
public init(credentialId: String, expiresAt: String, isCaller: Bool)
public init(from decoder: any Decoder) throws
}public struct RemoteCredentialMetadata: Codable, Equatable, Sendable {
public let appUrl: String
public let appName: String
public let appLogoUrl: String
public let custom: [String : String]
public init(appUrl: String, appName: String, appLogoUrl: String, custom: [String : String])
public init(from decoder: any Decoder) throws
}public enum SmartSessionGrant: Equatable, Sendable {
case nativeTransfer(to: String, limit: String)
case erc20Transfer(token: String, to: String? = nil, limit: String, cumulative: Bool? = nil)
}public enum AccessGrantType: String, Codable, Equatable, Sendable {
case direct
case remote
public init?(rawValue: String)
}public struct RemoteAccessGrant: Equatable, Sendable {
public let credential: WalletCredential
public let sessionId: String
public let metadata: RemoteCredentialMetadata
public let grants: [SmartSessionGrant]
public init(credential: WalletCredential, sessionId: String, metadata: RemoteCredentialMetadata, grants: [SmartSessionGrant])
}public enum AccessGrant: Equatable, Sendable {
case direct(WalletCredential)
case remote(RemoteAccessGrant)
public var credential: WalletCredential { get }
}public struct AccessGrantPage: Equatable, Sendable {
public let grants: [AccessGrant]
public let page: Page?
public init(grants: [AccessGrant], page: Page? = nil)
}public struct AuthorizedRemoteAccess: Equatable, Sendable {
public let walletId: String
public let sessionId: String
public let expiresAt: String
}public struct RemoteAccessSession: Equatable, Sendable {
public let sessionId: String
public let walletId: String
public let signerAddress: String
public let grants: [SmartSessionGrant]
public let chainId: Int
public let expiresAt: String
}public struct SmartSessionGrantUsage: Equatable, Sendable {
public let grant: SmartSessionGrant
public let used: String?
}public struct CustomOIDCProviderConfiguration: Sendable {
public let issuer: String
public let clientID: String
public let authorizationURL: String
public let provider: String?
public let providerLabel: String?
public let scopes: [String]
public let providerRedirectURI: String
public let authorizeParams: [String : String]
public let authMode: OIDCAuthMode
public init(issuer: String, clientID: String, authorizationURL: String, providerRedirectURI: String, provider: String? = nil, providerLabel: String? = nil, scopes: [String] = [], authorizeParams: [String : String] = [:], authMode: OIDCAuthMode = .authCodePKCE)
}A caller-owned OIDC provider configuration for authorization-code redirect auth.
public enum OIDCAuthMode: String, Codable, Equatable, Sendable {
case authCode = "auth-code"
case authCodePKCE = "auth-code-pkce"
public init?(rawValue: String)
}OIDC redirect auth-code mode.
public struct OMSRelayOIDCProvider: Equatable, Hashable, SendableA fixed OIDC provider whose OAuth callback is owned by the OMS relay.
public enum OMSRelayOIDCProviders {
public static let google: OMSRelayOIDCProvider
public static let apple: OMSRelayOIDCProvider
}SDK-owned OMS relay provider values.
public struct StartOIDCRedirectAuthResult: Sendable {
public let authorizationURL: String
public init(authorizationURL: String)
}Result returned after starting an OIDC authorization-code redirect flow.
public enum OIDCRedirectAuthResult: Sendable {
case completed(CompleteAuthResult)
case notOIDCRedirectCallback
case noPendingAuth
}Result of handling an incoming OIDC authorization-code redirect callback.
public struct OMSWalletSessionState: Equatable, Sendable {
/// Address of the selected wallet in a completed session, or `nil` when the SDK is signed out.
public let walletAddress: String?
/// Expiration time for the current completed wallet session, or `nil` when unavailable.
public let expiresAt: Date?
/// Auth metadata for the current completed wallet session.
public let auth: OMSWalletSessionAuth?
public init(walletAddress: String?, expiresAt: Date? = nil, auth: OMSWalletSessionAuth? = nil)
}public enum OMSWalletSessionAuth: Codable, Equatable, Sendable {
case email(OMSWalletEmailSessionAuth)
case oidc(OMSWalletOidcSessionAuth)
public var email: String? { get }
public init(from decoder: Decoder) throws
public func encode(to encoder: Encoder) throws
}public struct OMSWalletEmailSessionAuth: Codable, Equatable, Sendable {
public let email: String
public init(email: String)
public init(from decoder: Decoder) throws
public func encode(to encoder: Encoder) throws
}public struct OMSWalletOidcSessionAuth: Codable, Equatable, Sendable {
public let flow: OMSWalletOidcSessionAuthFlow
public let issuer: String
public let provider: String?
public let providerLabel: String?
public let email: String?
public init(flow: OMSWalletOidcSessionAuthFlow, issuer: String, provider: String? = nil, providerLabel: String? = nil, email: String? = nil)
public init(from decoder: Decoder) throws
public func encode(to encoder: Encoder) throws
}public enum OMSWalletOidcSessionAuthFlow: String, Codable, Equatable, Sendable {
case redirect
case idToken = "id-token"
public init?(rawValue: String)
}public struct OMSWalletSessionExpiredEvent: Equatable, Sendable {
public let session: OMSWalletSessionState
public let expiredAt: Date
public init(session: OMSWalletSessionState, expiredAt: Date)
}public final class OMSWalletSessionExpiredObservation: @unchecked Sendable {
public func cancel()
}public struct ListAccessPages: AsyncSequence {
public typealias Element = AccessGrantPage
public func makeAsyncIterator() -> AsyncIterator
public struct AsyncIterator: AsyncIteratorProtocol {
public mutating func next() async throws -> AccessGrantPage?
}
}public func signMessage(network: Network, message: String) async throws -> StringSigns an arbitrary message using the wallet's session key.
public func signSolanaMessage(message: String) async throws -> Stringpublic func signTypedData(network: Network, typedData: JSONValue) async throws -> Stringpublic func isValidMessageSignature(network: Network, walletAddress: String, message: String, signature: String) async throws -> Boolpublic func isValidSolanaMessageSignature(walletAddress: String, message: String, signature: String) async throws -> Boolpublic func isValidTypedDataSignature(network: Network, walletAddress: String, typedData: JSONValue, signature: String) async throws -> Boolpublic func sendTransaction(network: Network, to: String, value: String, selectFeeOption: FeeOptionSelector? = nil, mode: TransactionMode = .relayer, waitForStatus: Bool = true, statusPolling: TransactionStatusPollingOptions = TransactionStatusPollingOptions()) async throws -> SendTransactionResponsepublic func sendTransaction(network: Network, request: SendTransactionRequest, selectFeeOption: FeeOptionSelector? = nil, waitForStatus: Bool = true, statusPolling: TransactionStatusPollingOptions = TransactionStatusPollingOptions()) async throws -> SendTransactionResponseWalletClient.sendSolanaTransfer(network:asset:to:amount:selectFeeOption:mode:waitForStatus:statusPolling:)
public func sendSolanaTransfer(network: SolanaNetwork, asset: String, to: String, amount: String, selectFeeOption: FeeOptionSelector? = nil, mode: TransactionMode = .relayer, waitForStatus: Bool = true, statusPolling: TransactionStatusPollingOptions = TransactionStatusPollingOptions()) async throws -> SendTransactionResponseWalletClient.callContract(network:contract:method:args:selectFeeOption:mode:waitForStatus:statusPolling:)
public func callContract(network: Network, contract: String, method: String, args: [AbiArg]?, selectFeeOption: FeeOptionSelector? = nil, mode: TransactionMode = .relayer, waitForStatus: Bool = true, statusPolling: TransactionStatusPollingOptions = TransactionStatusPollingOptions()) async throws -> SendTransactionResponsepublic func getTransactionStatus(txnId: String) async throws -> TransactionStatusResponseReturns the current execution status for a prepared or submitted transaction.
public struct SendTransactionRequest: Sendable {
public let to: String
public let value: String
public let data: String?
public let mode: TransactionMode
public init(to: String, value: String, data: String? = nil, mode: TransactionMode = .relayer)
}public struct SendTransactionResponse: Codable, Sendable, Equatable {
public let txnId: String
public let status: TransactionStatus
public let txnHash: String?
public let statusResolution: TransactionStatusResolution
public init(txnId: String, status: TransactionStatus, txnHash: String? = nil, statusResolution: TransactionStatusResolution)
public init(from decoder: any Decoder) throws
}public enum TransactionMode: Codable, Equatable, Hashable, Sendable {
case native
case relayer
case unknown(String)
public var wireValue: String { get }
public init(wireValue: String)
public init(from decoder: Decoder) throws
public func encode(to encoder: Encoder) throws
}public struct TransactionStatusPollingOptions: Sendable, Equatable {
public let timeoutMs: UInt64?
public let intervalMs: UInt64?
public let fastIntervalMs: UInt64?
public let fastPollCount: Int?
public init(timeoutMs: UInt64? = nil, intervalMs: UInt64? = nil, fastIntervalMs: UInt64? = nil, fastPollCount: Int? = nil)
}public struct TransactionStatusResponse: Codable, Equatable, Sendable {
public let status: TransactionStatus
public let txnHash: String?
public init(status: TransactionStatus, txnHash: String? = nil)
public init(from decoder: any Decoder) throws
}public enum TransactionStatus: Codable, Equatable, Hashable, Sendable {
case quoted
case pending
case executed
case failed
case unknown(String)
public var wireValue: String { get }
public init(wireValue: String)
public init(from decoder: Decoder) throws
public func encode(to encoder: Encoder) throws
}public enum TransactionStatusResolution: String, Codable, Sendable, Equatable {
case notRequested
case resolved
case timedOut
public init?(rawValue: String)
}public struct FeeOptionSelector: Sendable {
/// Sponsored transactions pass an empty array. Returning `nil` acknowledges the free fee;
/// throw to stop execution.
public typealias Select = @Sendable (_ options: [FeeOptionWithBalance]) async throws -> FeeOptionSelection?
public init(_ select: @escaping Select)
public func callAsFunction(_ options: [FeeOptionWithBalance]) async throws -> FeeOptionSelection?
public func callAsFunction(_ options: [FeeOption]) async throws -> FeeOptionSelection?
public static let firstAvailable: FeeOptionSelector
public static func custom(_ pick: @escaping Select) -> FeeOptionSelector
}public struct FeeOptionWithBalance: Sendable {
public let feeOption: FeeOption
public let selection: FeeOptionSelection
public let balance: TokenBalance?
public let available: String?
public let availableRaw: String?
public let decimals: Int?
public init(feeOption: FeeOption, selection: FeeOptionSelection? = nil, balance: TokenBalance? = nil, available: String? = nil, availableRaw: String? = nil, decimals: Int? = nil)
}public struct FeeOption: Codable, Equatable, Sendable {
public let token: FeeToken
public let value: String
public let displayValue: String
public init(token: FeeToken, value: String, displayValue: String)
public init(from decoder: any Decoder) throws
}public struct FeeOptionSelection: Codable, Equatable, Sendable {
public let token: String
public let index: UInt32?
public init(token: String, index: UInt32? = nil)
public init(feeOption: FeeOption, index: UInt32? = nil)
public init(from decoder: any Decoder) throws
}public struct FeeToken: Codable, Equatable, Sendable {
public let network: String
public let name: String
public let symbol: String
public let type: String
public let decimals: UInt32?
public let logoUrl: String?
public let contractAddress: String?
public let tokenId: String?
public init(network: String, name: String, symbol: String, type: String, decimals: UInt32? = nil, logoUrl: String? = nil, contractAddress: String? = nil, tokenId: String? = nil)
public init(from decoder: any Decoder) throws
}public struct AbiArg: Codable, Equatable, Sendable {
public let type: String
public let value: JSONValue
public init(type: String, value: JSONValue)
public init(from decoder: any Decoder) throws
}public final class IndexerClient: Sendablepublic func getBalances(_ params: GetBalancesParams) async throws -> BalancesResultpublic func getTransactionHistory(_ params: GetTransactionHistoryParams) async throws -> TransactionHistoryResultpublic func getSolanaBalances(_ params: GetSolanaBalancesParams) async throws -> SolanaBalancesResultpublic struct GetSolanaBalancesParams: Sendable {
public let walletAddress: String
public let networks: [SolanaNetwork]
public let includeMetadata: Bool
public let omitNativeBalances: Bool?
public let mintAddresses: [String]
public let excludedMintAddresses: [String]
public init(walletAddress: String, networks: [SolanaNetwork] = [.mainnet, .devnet], includeMetadata: Bool = true, omitNativeBalances: Bool? = nil, mintAddresses: [String] = [], excludedMintAddresses: [String] = [])
}public struct SolanaBalancesResult: Sendable {
public let status: Int
public let balances: [SolanaBalance]
public let errors: [SolanaNetworkError]
}public enum SolanaBalance: Decodable, Sendable {
case native(SolanaNativeBalance)
case fungibleToken(SolanaFungibleTokenBalance)
public init(from decoder: Decoder) throws
}public struct SolanaNativeBalance: Codable, Sendable {
public let network: SolanaNetwork
public let accountAddress: String
public let name: String
public let symbol: String
public let decimals: Int
public let balance: String
public let formattedBalance: String
public let imageUrl: String?
public let metadataUri: String?
public let verificationStatus: SolanaVerificationStatus
public let verificationSource: SolanaVerificationSource
public let priceUSD: String?
public let balanceUSD: String?
public init(from decoder: any Decoder) throws
}public struct SolanaFungibleTokenBalance: Codable, Sendable {
public let network: SolanaNetwork
public let accountAddress: String
public let tokenProgram: SolanaTokenProgram
public let mintAddress: String
public let name: String
public let symbol: String
public let decimals: Int
public let balance: String
public let formattedBalance: String
public let imageUrl: String?
public let metadataUri: String?
public let verificationStatus: SolanaVerificationStatus
public let verificationSource: SolanaVerificationSource
public let priceUSD: String?
public let balanceUSD: String?
public init(from decoder: any Decoder) throws
}public struct SolanaNetworkError: Codable, Sendable {
public let network: SolanaNetwork
public let reason: String
public init(from decoder: any Decoder) throws
}public enum SolanaVerificationStatus: String, Codable, Sendable {
case verified
case unverified
case unknown
public init?(rawValue: String)
}public enum SolanaVerificationSource: String, Codable, Sendable {
case jupiter
case solflareUtl = "solflare-utl"
case none
public init?(rawValue: String)
}public enum SolanaTokenProgram: String, Codable, Sendable {
case splToken = "spl-token"
case token2022 = "token-2022"
public init?(rawValue: String)
}public struct GetBalancesParams: Sendable {
public let walletAddress: String
public let networks: [Network]?
public let networkType: IndexerNetworkType?
public let contractAddresses: [String]?
public let includeMetadata: Bool
public let omitPrices: Bool?
public let tokenIds: [String]?
public let contractStatus: ContractVerificationStatus?
public let page: TokenBalancesPageRequest?
public init(walletAddress: String, networks: [Network]? = nil, networkType: IndexerNetworkType? = nil, contractAddresses: [String]? = nil, includeMetadata: Bool = true, omitPrices: Bool? = nil, tokenIds: [String]? = nil, contractStatus: ContractVerificationStatus? = nil, page: TokenBalancesPageRequest? = nil)
}public struct BalancesResult: Sendable {
public let status: Int
public let page: TokenBalancesPage?
public let nativeBalances: [NativeTokenBalance]
public let balances: [ContractTokenBalance]
public init(status: Int, page: TokenBalancesPage?, nativeBalances: [NativeTokenBalance], balances: [ContractTokenBalance])
}public struct NativeTokenBalance: Codable, Sendable {
public let contractType: String
public let accountAddress: String
public let name: String
public let symbol: String
public let balance: String
public let chainId: Int64
public let balanceUSD: String?
public let priceUSD: String?
public let priceUpdatedAt: String?
public init(accountAddress: String, name: String, symbol: String, balance: String, chainId: Int64, balanceUSD: String? = nil, priceUSD: String? = nil, priceUpdatedAt: String? = nil)
public init(from decoder: Decoder) throws
public func encode(to encoder: Encoder) throws
}public struct ContractTokenBalance: Codable, Sendable {
public let contractType: String
public let contractAddress: String
public let accountAddress: String
public let tokenId: String
public let balance: String
public let blockHash: String
public let blockNumber: Int64
public let chainId: Int64
public let balanceUSD: String?
public let priceUSD: String?
public let priceUpdatedAt: String?
public let uniqueCollectibles: String?
public let isSummary: Bool?
public let contractInfo: TokenContractInfo?
public let tokenMetadata: TokenMetadata?
public init(contractType: String, contractAddress: String, accountAddress: String, tokenId: String, balance: String, blockHash: String, blockNumber: Int64, chainId: Int64, balanceUSD: String? = nil, priceUSD: String? = nil, priceUpdatedAt: String? = nil, uniqueCollectibles: String? = nil, isSummary: Bool? = nil, contractInfo: TokenContractInfo? = nil, tokenMetadata: TokenMetadata? = nil)
public init(from decoder: Decoder) throws
public func encode(to encoder: Encoder) throws
}public enum TokenBalance: Sendable {
case native(NativeTokenBalance)
case contract(ContractTokenBalance)
public var contractType: String { get }
public var accountAddress: String { get }
public var balance: String { get }
public var chainId: Int64 { get }
public var balanceUSD: String? { get }
public var priceUSD: String? { get }
public var priceUpdatedAt: String? { get }
}public struct TokenBalancesPage: Codable, Sendable {
public let page: Int
public let column: String?
public let before: JSONValue?
public let after: JSONValue?
public let sort: [SortBy]?
public let pageSize: Int
public let more: Bool
public init(page: Int, column: String? = nil, before: JSONValue? = nil, after: JSONValue? = nil, sort: [SortBy]? = nil, pageSize: Int, more: Bool)
public init(from decoder: any Decoder) throws
}public struct TokenBalancesPageRequest: Codable, Sendable {
public let page: Int?
public let column: String?
public let before: JSONValue?
public let after: JSONValue?
public let sort: [SortBy]?
public let pageSize: Int?
public init(page: Int? = nil, column: String? = nil, before: JSONValue? = nil, after: JSONValue? = nil, sort: [SortBy]? = nil, pageSize: Int? = nil)
public init(from decoder: any Decoder) throws
}public struct TokenContractInfo: Codable, Sendable {
public let chainId: Int64
public let address: String
public let source: String
public let name: String
public let type: String
public let symbol: String
public let decimals: Int?
public let logoURI: String?
public let deployed: Bool
public let bytecodeHash: String
public let extensions: [String : JSONValue]
public let updatedAt: String
public let queuedAt: String?
public let status: String
public init(chainId: Int64, address: String, source: String, name: String, type: String, symbol: String, decimals: Int? = nil, logoURI: String? = nil, deployed: Bool, bytecodeHash: String, extensions: [String : JSONValue], updatedAt: String, queuedAt: String? = nil, status: String)
public init(from decoder: any Decoder) throws
}public struct TokenMetadata: Codable, Sendable {
public let chainId: Int64?
public let contractAddress: String?
public let tokenId: String
public let source: String
public let name: String
public let description: String?
public let image: String?
public let video: String?
public let audio: String?
public let properties: [String : JSONValue]?
public let attributes: [[String : JSONValue]]
public let imageData: String?
public let externalUrl: String?
public let backgroundColor: String?
public let animationUrl: String?
public let decimals: Int?
public let updatedAt: String?
public let assets: [TokenMetadataAsset]?
public let status: String
public let queuedAt: String?
public let lastFetched: String?
public init(chainId: Int64? = nil, contractAddress: String? = nil, tokenId: String, source: String, name: String, description: String? = nil, image: String? = nil, video: String? = nil, audio: String? = nil, properties: [String : JSONValue]? = nil, attributes: [[String : JSONValue]], imageData: String? = nil, externalUrl: String? = nil, backgroundColor: String? = nil, animationUrl: String? = nil, decimals: Int? = nil, updatedAt: String? = nil, assets: [TokenMetadataAsset]? = nil, status: String, queuedAt: String? = nil, lastFetched: String? = nil)
public init(from decoder: Decoder) throws
public func encode(to encoder: Encoder) throws
}public struct TokenMetadataAsset: Codable, Sendable {
public let id: Int64?
public let collectionId: Int64?
public let tokenId: String?
public let url: String?
public let metadataField: String?
public let name: String?
public let filesize: Int64?
public let mimeType: String?
public let width: Int?
public let height: Int?
public let updatedAt: String?
public init(id: Int64? = nil, collectionId: Int64? = nil, tokenId: String? = nil, url: String? = nil, metadataField: String? = nil, name: String? = nil, filesize: Int64? = nil, mimeType: String? = nil, width: Int? = nil, height: Int? = nil, updatedAt: String? = nil)
public init(from decoder: Decoder) throws
public func encode(to encoder: Encoder) throws
}public struct GetTransactionHistoryParams: Sendable {
public let walletAddress: String
public let networks: [Network]?
public let networkType: IndexerNetworkType?
public let contractAddresses: [String]?
public let transactionHashes: [String]?
public let metaTransactionIds: [String]?
public let fromBlock: Int?
public let toBlock: Int?
public let tokenId: String?
public let includeMetadata: Bool
public let omitPrices: Bool?
public let metadataOptions: MetadataOptions?
public let page: TokenBalancesPageRequest?
public init(walletAddress: String, networks: [Network]? = nil, networkType: IndexerNetworkType? = nil, contractAddresses: [String]? = nil, transactionHashes: [String]? = nil, metaTransactionIds: [String]? = nil, fromBlock: Int? = nil, toBlock: Int? = nil, tokenId: String? = nil, includeMetadata: Bool = true, omitPrices: Bool? = nil, metadataOptions: MetadataOptions? = nil, page: TokenBalancesPageRequest? = nil)
}public struct TransactionHistoryResult: Sendable {
public let status: Int
public let page: TokenBalancesPage?
public let transactions: [Transaction]
public init(status: Int, page: TokenBalancesPage?, transactions: [Transaction])
}public struct Transaction: Codable, Sendable {
public let txnHash: String
public let blockNumber: Int64
public let blockHash: String
public let chainId: Int64
public let metaTxnId: String?
public let transfers: [TransactionTransfer]
public let timestamp: String
public init(txnHash: String, blockNumber: Int64, blockHash: String, chainId: Int64, metaTxnId: String? = nil, transfers: [TransactionTransfer] = [], timestamp: String)
public init(from decoder: Decoder) throws
public func encode(to encoder: Encoder) throws
}public struct TransactionTransfer: Codable, Sendable {
public let transferType: String
public let contractAddress: String
public let contractType: String
public let from: String
public let to: String
public let tokenIds: [String]?
public let amounts: [String]
public let logIndex: Int
public let amountsUSD: [String]?
public let pricesUSD: [String]?
public let contractInfo: TokenContractInfo?
public let tokenMetadata: [String : TokenMetadata]?
public init(transferType: String, contractAddress: String, contractType: String, from: String, to: String, tokenIds: [String]? = nil, amounts: [String], logIndex: Int, amountsUSD: [String]? = nil, pricesUSD: [String]? = nil, contractInfo: TokenContractInfo? = nil, tokenMetadata: [String : TokenMetadata]? = nil)
public init(from decoder: Decoder) throws
public func encode(to encoder: Encoder) throws
}public enum IndexerNetworkType: String, Codable, Sendable {
case mainnets = "MAINNETS"
case testnets = "TESTNETS"
case all = "ALL"
public init?(rawValue: String)
}public enum ContractVerificationStatus: String, Codable, Sendable {
case verified = "VERIFIED"
case unverified = "UNVERIFIED"
case all = "ALL"
public init?(rawValue: String)
}public struct MetadataOptions: Codable, Sendable {
public let verifiedOnly: Bool?
public let unverifiedOnly: Bool?
public let includeContracts: [String]?
public init(verifiedOnly: Bool? = nil, unverifiedOnly: Bool? = nil, includeContracts: [String]? = nil)
public init(from decoder: any Decoder) throws
}public struct Page: Codable, Equatable, Sendable {
public let limit: UInt32?
public let cursor: String?
public init(limit: UInt32? = nil, cursor: String? = nil)
public init(from decoder: any Decoder) throws
}public struct SortBy: Codable, Sendable {
public let column: String
public let order: SortOrder
public init(column: String, order: SortOrder)
public init(from decoder: any Decoder) throws
}public enum SortOrder: String, Codable, Sendable {
case descending = "DESC"
case ascending = "ASC"
public init?(rawValue: String)
}public enum Network: String, CaseIterable, Sendable, CustomStringConvertible {
case mainnet
case sepolia
case polygon
case polygonAmoy = "amoy"
case arbitrum
case arbitrumSepolia = "arbitrum-sepolia"
case optimism
case optimismSepolia = "optimism-sepolia"
case base
case baseSepolia = "base-sepolia"
case bsc
case bscTestnet = "bsc-testnet"
case arbitrumNova = "arbitrum-nova"
case avalanche
case avalancheTestnet = "avalanche-testnet"
case katana
public static let amoy: Network
public var id: Int { get }
public var chainId: String { get }
public var name: String { get }
public var nativeTokenSymbol: String { get }
public var explorerUrl: String { get }
public var explorerURL: URL { get }
public var displayName: String { get }
public var description: String { get }
public static var supportedNetworks: [Network] { get }
public static func findById(_ chainId: Int) -> Network?
public static func findByName(_ name: String) -> Network?
public init?(rawValue: String)
}public enum SolanaNetwork: String, CaseIterable, Codable, Sendable, CustomStringConvertible {
case devnet = "solana:devnet"
case mainnet = "solana:mainnet"
public var description: String { get }
public init?(rawValue: String)
}public enum SolanaNetworks {
public static let devnet: SolanaNetwork
public static let mainnet: SolanaNetwork
}public enum JSONValue: Codable, Equatable, Sendable {
case object([String: JSONValue])
case array([JSONValue])
case string(String)
case integer(Int64)
case unsignedInteger(UInt64)
case number(Double)
case bool(Bool)
case null
public init(from decoder: Decoder) throws
public func encode(to encoder: Encoder) throws
}JSON value used by SDK APIs that accept or return dynamic JSON payloads.
public struct OMSWalletError: Error, LocalizedError, @unchecked Sendable {
public let code: OMSWalletErrorCode
public let operation: OMSWalletOperation?
public let status: Int?
public let txnId: String?
public let retryable: Bool?
public let upstreamError: OMSWalletUpstreamError?
public let underlyingError: (any Error)?
public var errorDescription: String? { get }
}public enum OMSWalletErrorCode: String, Sendable {
case httpError = "OMS_HTTP_ERROR"
case invalidResponse = "OMS_INVALID_RESPONSE"
case requestFailed = "OMS_REQUEST_FAILED"
case authCommitmentConsumed = "OMS_AUTH_COMMITMENT_CONSUMED"
case sessionMissing = "OMS_SESSION_MISSING"
case sessionExpired = "OMS_SESSION_EXPIRED"
case walletSelectionStale = "OMS_WALLET_SELECTION_STALE"
case walletSelectionUnavailable = "OMS_WALLET_SELECTION_UNAVAILABLE"
case walletSelectionInFlight = "OMS_WALLET_SELECTION_IN_FLIGHT"
case transactionExecutionUnconfirmed = "OMS_TRANSACTION_EXECUTION_UNCONFIRMED"
case transactionStatusLookupFailed = "OMS_TRANSACTION_STATUS_LOOKUP_FAILED"
case validationError = "OMS_VALIDATION_ERROR"
case storageError = "OMS_STORAGE_ERROR"
case attestationVerificationFailed = "OMS_ATTESTATION_VERIFICATION_FAILED"
public init?(rawValue: String)
}public enum OMSWalletOperation: String, Sendable {
case pendingWalletSelection = "wallet.pendingWalletSelection"
case pendingWalletSelectionSelectWallet = "wallet.pendingWalletSelection.selectWallet"
case pendingWalletSelectionCreateAndSelectWallet = "wallet.pendingWalletSelection.createAndSelectWallet"
case walletStartEmailAuth = "wallet.startEmailAuth"
case walletCompleteEmailAuth = "wallet.completeEmailAuth"
case walletSignInWithOidcIdToken = "wallet.signInWithOidcIdToken"
case walletStartOIDCRedirectAuth = "wallet.startOIDCRedirectAuth"
case walletHandleOIDCRedirectCallback = "wallet.handleOIDCRedirectCallback"
case walletUseWallet = "wallet.useWallet"
case walletCreateWallet = "wallet.createWallet"
case walletImportWallet = "wallet.importWallet"
case walletGetImportRecipientKey = "wallet.getWalletImportRecipientKey"
case walletImportEncryptedWallet = "wallet.importEncryptedWallet"
case walletListWallets = "wallet.listWallets"
case walletSignOut = "wallet.signOut"
case walletListAccess = "wallet.listAccess"
case walletListAccessPage = "wallet.listAccessPage"
case walletListAccessPages = "wallet.listAccessPages"
case walletInspectRemoteCredential = "wallet.inspectRemoteCredential"
case walletAuthorizeRemoteAccess = "wallet.authorizeRemoteAccess"
case walletGetRemoteAccessSession = "wallet.getRemoteAccessSession"
case walletGetRemoteAccessSessionUsage = "wallet.getRemoteAccessSessionUsage"
case walletGetIdToken = "wallet.getIdToken"
case walletRevokeAccess = "wallet.revokeAccess"
case walletSignMessage = "wallet.signMessage"
case walletSignSolanaMessage = "wallet.signSolanaMessage"
case walletSignTypedData = "wallet.signTypedData"
case walletIsValidMessageSignature = "wallet.isValidMessageSignature"
case walletIsValidSolanaMessageSignature = "wallet.isValidSolanaMessageSignature"
case walletIsValidTypedDataSignature = "wallet.isValidTypedDataSignature"
case walletSendTransaction = "wallet.sendTransaction"
case walletSendSolanaTransfer = "wallet.sendSolanaTransfer"
case walletCallContract = "wallet.callContract"
case walletExecute = "wallet.execute"
case walletGetTransactionStatus = "wallet.getTransactionStatus"
case walletTransactionStatus = "wallet.transactionStatus"
case indexerGetBalances = "indexer.getBalances"
case indexerGetSolanaBalances = "indexer.getSolanaBalances"
case indexerGetTransactionHistory = "indexer.getTransactionHistory"
public init?(rawValue: String)
}public struct OMSWalletUpstreamError: Equatable, Sendable {
public let service: OMSWalletUpstreamService
public let name: String?
public let code: String?
public let message: String?
public let status: Int?
}public enum OMSWalletUpstreamService: String, Sendable {
case waas = "Waas"
case indexer = "Indexer"
public init?(rawValue: String)
}public enum UnitConversionError: Error, Equatable {
case invalidDecimals(Int)
case invalidValue(String)
case fractionalComponentExceedsDecimals(value: String, decimals: Int)
}public func parseUnits(value: String, decimals: Int = 18) throws -> Stringpublic func formatUnits(value: String, decimals: Int = 18) throws -> String