Represents an authenticated user in the Dynamic system.
Copy
Ask AI
public struct SdkUser { public let id: String public let email: String? public let phoneNumber: String? public let verifiedCredentials: [JwtVerifiedCredential]? public let token: String? public let projectSettings: ProjectSettings? // ... other properties}
Represents a verified credential associated with a user in JWT format.
Copy
Ask AI
public struct JwtVerifiedCredential { public let id: String public let format: CredentialFormat public let oauthProvider: OAuthProvider? public let walletProvider: WalletProvider? public let walletName: String? public let chain: String? public let publicIdentifier: String? public let walletProperties: WalletProperties? // ... other properties}
if let verifiedCredentials = dynamicClient.user?.verifiedCredentials { for credential in verifiedCredentials { print("Credential ID: \(credential.id)") print("Format: \(credential.format.rawValue)") if let oauthProvider = credential.oauthProvider { print("OAuth Provider: \(oauthProvider.rawValue)") } if let walletProvider = credential.walletProvider { print("Wallet Provider: \(walletProvider.rawValue)") } if let walletName = credential.walletName { print("Wallet Name: \(walletName)") } if let chain = credential.chain { print("Chain: \(chain)") } if let publicIdentifier = credential.publicIdentifier { print("Public Identifier: \(publicIdentifier)") } }}
Represents the state of an OTP verification process.
Copy
Ask AI
public struct OTPVerification { public let email: String? public let phoneNumber: String? public let phoneCountryCode: String? public let isoCountryCode: String? public let verificationUUID: String}
Enumeration of supported social authentication providers.
Copy
Ask AI
public enum ProviderType: String { case apple = "apple" case google = "google" case twitter = "twitter" case discord = "discord" case github = "github" case twitch = "twitch" case facebook = "facebook" case farcaster = "farcaster" // ... other providers}
Swift’s Data type for handling binary data in transactions.
Copy
Ask AI
// Empty data for ETH transferslet emptyData = Data()// Custom data for contract interactionslet customData = Data([0x12, 0x34, 0x56, 0x78])// String to data conversionlet messageData = "Hello".data(using: .utf8) ?? Data()
do { let result = try await someSDKFunction()} catch { if let nsError = error as NSError? { switch nsError.code { case 1003: print("Could not determine wallet ID from address") case 1004: print("Invalid OTP code") case 1005: print("Network error") default: print("Unknown error: \(error)") } } else { print("Error: \(error)") }}