OMSWallet
OMSWallet
public final class OMSWallet: Sendable {
public let wallet: WalletClient
public let indexer: IndexerClient
public convenience init(publishableKey: String) throws
}
WalletClient
public final class WalletClient: @unchecked Sendable
Authentication and sessions
WalletClient.walletAddress
public internal(set) var walletAddress: String? { get set }
WalletClient.walletId
public internal(set) var walletId: String { get set }
WalletClient.session
public var session: OMSWalletSessionState { get }
WalletClient.addSessionExpiredObserver(_:)
@discardableResult public func addSessionExpiredObserver(_ observer: @escaping @MainActor @Sendable (OMSWalletSessionExpiredEvent) -> Void) -> OMSWalletSessionExpiredObservation
WalletClient.startEmailAuth(email:sessionLifetimeSeconds:)
public func startEmailAuth(email: String, sessionLifetimeSeconds: UInt32 = 604_800) async throws
WalletClient.completeEmailAuth(code:walletSelection:walletType:)
@discardableResult public func completeEmailAuth(code: String, walletSelection: WalletSelectionBehavior = .automatic, walletType: WalletType = WalletType.ethereum) async throws -> CompleteAuthResult
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 -> CompleteAuthResult
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 -> StartOIDCRedirectAuthResult
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 -> StartOIDCRedirectAuthResult
WalletClient.handleOIDCRedirectCallback(_:walletSelection:sessionLifetimeSeconds:)
public func handleOIDCRedirectCallback(_ callbackURL: String?, walletSelection: WalletSelectionBehavior? = nil, sessionLifetimeSeconds: UInt32? = nil) async throws -> OIDCRedirectAuthResult
WalletClient.listWallets()
public func listWallets() async throws -> [Wallet]
WalletClient.useWallet(walletId:)
@discardableResult public func useWallet(walletId: String) async throws -> WalletSelectionResult
WalletClient.createWallet(walletType:reference:)
@discardableResult public func createWallet(walletType: WalletType = WalletType.ethereum, reference: String? = nil) async throws -> WalletSelectionResult
WalletClient.getIdToken(ttlSeconds:customClaims:)
public func getIdToken(ttlSeconds: UInt32? = nil, customClaims: [String : JSONValue]? = nil) async throws -> String
WalletClient.listAccess(pageSize:)
public func listAccess(pageSize: UInt32? = nil) async throws -> [CredentialInfo]
WalletClient.listAccessPage(pageSize:cursor:)
public func listAccessPage(pageSize: UInt32? = nil, cursor: String? = nil) async throws -> ListAccessResponse
WalletClient.listAccessPages(pageSize:)
public func listAccessPages(pageSize: UInt32? = nil) -> ListAccessPages
WalletClient.revokeAccess(targetCredentialId:)
public func revokeAccess(targetCredentialId: String) async throws
WalletClient.signOut()
public func signOut() throws
WalletSelectionBehavior
public enum WalletSelectionBehavior: String, Codable, Equatable, Sendable {
case automatic
case manual
public init?(rawValue: String)
}
CompleteAuthResult
public enum CompleteAuthResult: Sendable {
case walletSelected(
walletAddress: String,
wallet: Wallet,
wallets: [Wallet],
credential: CredentialInfo
)
case walletSelection(PendingWalletSelection)
public var credential: CredentialInfo { get }
public var walletAddress: String? { get }
public var wallet: Wallet? { get }
}
PendingWalletSelection
public final class PendingWalletSelection: @unchecked Sendable {
public let walletType: WalletType
public let wallets: [Wallet]
public let credential: CredentialInfo
@discardableResult public func selectWallet(walletId: String) async throws -> WalletSelectionResult
@discardableResult public func createAndSelectWallet(reference: String? = nil) async throws -> WalletSelectionResult
}
WalletSelectionResult
public struct WalletSelectionResult: Sendable {
public let walletAddress: String
public let wallet: Wallet
public init(walletAddress: String, wallet: 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 init(id: String, type: WalletType, address: String, reference: String? = nil)
public init(from decoder: any Decoder) throws
}
WalletType
public enum WalletType: Codable, Equatable, Hashable, Sendable {
case ethereum
case unknown(String)
public var wireValue: String { get }
public init(wireValue: String)
public init(from decoder: any Decoder) throws
public func encode(to encoder: any Encoder) throws
}
CredentialInfo
public struct CredentialInfo: 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
}
CustomOIDCProviderConfiguration
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)
}
OIDCAuthMode
public enum OIDCAuthMode: String, Codable, Equatable, Sendable {
case authCode = "auth-code"
case authCodePKCE = "auth-code-pkce"
public init?(rawValue: String)
}
OMSRelayOIDCProvider
public struct OMSRelayOIDCProvider: Equatable, Hashable, Sendable
OMSRelayOIDCProviders
public enum OMSRelayOIDCProviders {
public static let google: OMSRelayOIDCProvider
public static let apple: OMSRelayOIDCProvider
}
StartOIDCRedirectAuthResult
public struct StartOIDCRedirectAuthResult: Sendable {
public let authorizationURL: String
public init(authorizationURL: String)
}
OIDCRedirectAuthResult
public enum OIDCRedirectAuthResult: Sendable {
case completed(CompleteAuthResult)
case notOIDCRedirectCallback
case noPendingAuth
}
OMSWalletSessionState
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)
}
OMSWalletSessionAuth
public enum OMSWalletSessionAuth: Codable, Equatable, Sendable {
case email(OMSWalletEmailSessionAuth)
case oidc(OMSWalletOidcSessionAuth)
public var email: String? { get }
public init(from decoder: any Decoder) throws
public func encode(to encoder: any Encoder) throws
}
OMSWalletEmailSessionAuth
public struct OMSWalletEmailSessionAuth: Codable, Equatable, Sendable {
public let email: String
public init(email: String)
public init(from decoder: any Decoder) throws
public func encode(to encoder: any Encoder) throws
}
OMSWalletOidcSessionAuth
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: any Decoder) throws
public func encode(to encoder: any Encoder) throws
}
OMSWalletOidcSessionAuthFlow
public enum OMSWalletOidcSessionAuthFlow: String, Codable, Equatable, Sendable {
case redirect
case idToken = "id-token"
public init?(rawValue: String)
}
OMSWalletSessionExpiredEvent
public struct OMSWalletSessionExpiredEvent: Equatable, Sendable {
public let session: OMSWalletSessionState
public let expiredAt: Date
public init(session: OMSWalletSessionState, expiredAt: Date)
}
OMSWalletSessionExpiredObservation
public final class OMSWalletSessionExpiredObservation: @unchecked Sendable {
public func cancel()
}
ListAccessResponse
public struct ListAccessResponse: Codable, Equatable, Sendable {
public let credentials: [CredentialInfo]
public let page: Page?
public init(credentials: [CredentialInfo], page: Page? = nil)
public init(from decoder: any Decoder) throws
}
ListAccessPages
public struct ListAccessPages: AsyncSequence {
public typealias Element = ListAccessResponse
public func makeAsyncIterator() -> ListAccessPages.AsyncIterator
public struct AsyncIterator: AsyncIteratorProtocol {
public mutating func next() async throws -> ListAccessResponse?
}
}
Transactions and signing
WalletClient.signMessage(network:message:)
public func signMessage(network: Network, message: String) async throws -> String
WalletClient.signTypedData(network:typedData:)
public func signTypedData(network: Network, typedData: JSONValue) async throws -> String
WalletClient.isValidMessageSignature(network:walletAddress:message:signature:)
public func isValidMessageSignature(network: Network, walletAddress: String, message: String, signature: String) async throws -> Bool
WalletClient.isValidTypedDataSignature(network:walletAddress:typedData:signature:)
public func isValidTypedDataSignature(network: Network, walletAddress: String, typedData: JSONValue, signature: String) async throws -> Bool
WalletClient.sendTransaction(network:to:value:selectFeeOption:mode:waitForStatus:statusPolling:)
public func sendTransaction(network: Network, to: String, value: String, selectFeeOption: FeeOptionSelector? = nil, mode: TransactionMode = .relayer, waitForStatus: Bool = true, statusPolling: TransactionStatusPollingOptions = TransactionStatusPollingOptions()) async throws -> SendTransactionResponse
WalletClient.sendTransaction(network:request:selectFeeOption:waitForStatus:statusPolling:)
public func sendTransaction(network: Network, request: SendTransactionRequest, selectFeeOption: FeeOptionSelector? = nil, waitForStatus: Bool = true, statusPolling: TransactionStatusPollingOptions = TransactionStatusPollingOptions()) async throws -> SendTransactionResponse
WalletClient.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 -> SendTransactionResponse
WalletClient.getTransactionStatus(txnId:)
public func getTransactionStatus(txnId: String) async throws -> TransactionStatusResponse
SendTransactionRequest
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)
}
SendTransactionResponse
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
}
TransactionMode
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: any Decoder) throws
public func encode(to encoder: any Encoder) throws
}
TransactionStatusPollingOptions
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)
}
TransactionStatusResponse
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
}
TransactionStatus
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: any Decoder) throws
public func encode(to encoder: any Encoder) throws
}
TransactionStatusResolution
public enum TransactionStatusResolution: String, Codable, Sendable, Equatable {
case notRequested
case resolved
case timedOut
public init?(rawValue: String)
}
FeeOptionSelector
public struct FeeOptionSelector: Sendable {
public typealias Select = @Sendable ([FeeOptionWithBalance]) async throws -> FeeOptionSelection?
public init(_ select: @escaping FeeOptionSelector.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 FeeOptionSelector.Select) -> FeeOptionSelector
}
FeeOptionWithBalance
public struct FeeOptionWithBalance: Sendable {
public let feeOption: FeeOption
public let balance: TokenBalance?
public let available: String?
public let availableRaw: String?
public let decimals: Int?
public init(feeOption: FeeOption, balance: TokenBalance? = nil, available: String? = nil, availableRaw: String? = nil, decimals: Int? = nil)
public var selection: FeeOptionSelection { get }
}
FeeOption
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
}
FeeOptionSelection
public struct FeeOptionSelection: Codable, Equatable, Sendable {
public let token: String
public init(token: String)
public init(feeOption: FeeOption)
public init(from decoder: any Decoder) throws
}
FeeToken
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
}
AbiArg
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
}
Indexer
IndexerClient
public final class IndexerClient: Sendable
IndexerClient.getBalances(_:)
public func getBalances(_ params: GetBalancesParams) async throws -> BalancesResult
IndexerClient.getTransactionHistory(_:)
public func getTransactionHistory(_ params: GetTransactionHistoryParams) async throws -> TransactionHistoryResult
GetBalancesParams
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)
}
BalancesResult
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])
}
NativeTokenBalance
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: any Decoder) throws
public func encode(to encoder: any Encoder) throws
}
ContractTokenBalance
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: any Decoder) throws
public func encode(to encoder: any Encoder) throws
}
TokenBalance
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 }
}
TokenBalancesPage
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
}
TokenBalancesPageRequest
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
}
TokenContractInfo
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
}
TokenMetadata
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: any Decoder) throws
public func encode(to encoder: any Encoder) throws
}
TokenMetadataAsset
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: any Decoder) throws
public func encode(to encoder: any Encoder) throws
}
GetTransactionHistoryParams
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)
}
TransactionHistoryResult
public struct TransactionHistoryResult: Sendable {
public let status: Int
public let page: TokenBalancesPage?
public let transactions: [Transaction]
public init(status: Int, page: TokenBalancesPage?, transactions: [Transaction])
}
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: any Decoder) throws
public func encode(to encoder: any Encoder) throws
}
TransactionTransfer
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: any Decoder) throws
public func encode(to encoder: any Encoder) throws
}
IndexerNetworkType
public enum IndexerNetworkType: String, Codable, Sendable {
case mainnets = "MAINNETS"
case testnets = "TESTNETS"
case all = "ALL"
public init?(rawValue: String)
}
ContractVerificationStatus
public enum ContractVerificationStatus: String, Codable, Sendable {
case verified = "VERIFIED"
case unverified = "UNVERIFIED"
case all = "ALL"
public init?(rawValue: String)
}
MetadataOptions
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
}
Page
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
}
SortBy
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
}
SortOrder
public enum SortOrder: String, Codable, Sendable {
case descending = "DESC"
case ascending = "ASC"
public init?(rawValue: String)
}
Networks, types, and errors
Network
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)
}
JSONValue
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: any Decoder) throws
public func encode(to encoder: any Encoder) throws
}
OMSWalletError
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 }
}
OMSWalletErrorCode
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"
public init?(rawValue: String)
}
OMSWalletOperation
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 walletListWallets = "wallet.listWallets"
case walletSignOut = "wallet.signOut"
case walletListAccess = "wallet.listAccess"
case walletListAccessPage = "wallet.listAccessPage"
case walletListAccessPages = "wallet.listAccessPages"
case walletGetIdToken = "wallet.getIdToken"
case walletRevokeAccess = "wallet.revokeAccess"
case walletSignMessage = "wallet.signMessage"
case walletSignTypedData = "wallet.signTypedData"
case walletIsValidMessageSignature = "wallet.isValidMessageSignature"
case walletIsValidTypedDataSignature = "wallet.isValidTypedDataSignature"
case walletSendTransaction = "wallet.sendTransaction"
case walletCallContract = "wallet.callContract"
case walletExecute = "wallet.execute"
case walletGetTransactionStatus = "wallet.getTransactionStatus"
case walletTransactionStatus = "wallet.transactionStatus"
case indexerGetBalances = "indexer.getBalances"
case indexerGetTransactionHistory = "indexer.getTransactionHistory"
public init?(rawValue: String)
}
OMSWalletUpstreamError
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?
}
OMSWalletUpstreamService
public enum OMSWalletUpstreamService: String, Sendable {
case waas = "Waas"
case indexer = "Indexer"
public init?(rawValue: String)
}
UnitConversionError
public enum UnitConversionError: Error, Equatable {
case invalidDecimals(Int)
case invalidValue(String)
case fractionalComponentExceedsDecimals(value: String, decimals: Int)
}
parseUnits(value:decimals:)
public func parseUnits(value: String, decimals: Int = 18) throws -> String
formatUnits(value:decimals:)
public func formatUnits(value: String, decimals: Int = 18) throws -> String