OZSmartAccountSigner

public protocol OZSmartAccountSigner : Sendable

Represents a signer that can authorize OpenZeppelin Smart Account transactions.

Smart account signers describe who can authorize transactions on the wallet contract. Two concrete signer types exist:

  • OZDelegatedSigner: A Soroban address (G… for accounts or C… for contracts) using the host’s built-in require_auth verification.
  • OZExternalSigner: A verifier-contract address combined with public-key bytes that describe a custom signature scheme (e.g. WebAuthn / secp256r1, Ed25519).

Example:

let delegated = try OZDelegatedSigner(address: "<G-address>")
let webAuthn = try OZExternalSigner.webAuthn(
    verifierAddress: "CBCD...",
    publicKey: publicKeyBytes,
    credentialId: credentialIdBytes
)
let scVal = try delegated.toScVal()
  • Converts this signer to its on-chain SCValXDR representation for contract calls.

    Throws

    SmartAccountValidationException.InvalidInput if conversion fails (for example, when address strkey decoding fails).

    Declaration

    Swift

    func toScVal() throws -> SCValXDR

    Return Value

    An SCValXDR describing the signer in the format the wallet contract expects.

  • Stable string identifying this signer for deduplication and lookup ("delegated:<address>" or "external:<verifierAddress>:<keyDataHex>").

    Declaration

    Swift

    var uniqueKey: String { get }