OZDelegatedSigner

public struct OZDelegatedSigner : OZSmartAccountSigner, Equatable, Hashable

A signer authorized through a Soroban address using the host’s require_auth mechanism.

Delegated signers are Stellar accounts (G… strkey) or smart contracts (C… strkey) that use the native Soroban authorization mechanism. The wallet contract calls require_auth_for_args() on the address to verify authorization, so no custom signature-verification logic is required.

Example:

let accountSigner = try OZDelegatedSigner(address: "GA7QYNF7SOWQ...")
let contractSigner = try OZDelegatedSigner(address: "CBCD1234...")
  • The Stellar address of the signer (G… for accounts, C… for contracts).

    Declaration

    Swift

    public let address: String
  • Initializes a new OZDelegatedSigner.

    Throws

    SmartAccountValidationException.InvalidAddress when address is neither a valid Ed25519 public key strkey nor a valid contract id strkey.

    Declaration

    Swift

    public init(address: String) throws

    Parameters

    address

    The Stellar address of the signer; must be a valid G… strkey or C… strkey.

  • Converts the delegated signer to its on-chain representation.

    Returns an SCValXDR.vec([Symbol("Delegated"), Address(address)]).

    Throws

    SmartAccountValidationException.InvalidInput if the address cannot be encoded into an SCAddressXDR.

    Declaration

    Swift

    public func toScVal() throws -> SCValXDR

    Return Value

    The SCValXDR representation of this signer.

  • Declaration

    Swift

    public var uniqueKey: String { get }