OZDelegatedSigner

public struct OZDelegatedSigner : OZSmartAccountSigner, Equatable, Hashable

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

Delegated signers 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.

The type holds a Stellar account (G… strkey) or a contract (C… strkey), so signers already on a wallet are read as stored. The kit adds only G… addresses: OZSignerManager.addDelegated, OZContextRuleManager.addContextRule and the signing pipelines refuse a contract, the wallet itself and the shared default deployer, because a contract delegate can let anyone authorize the account without a key (GHSA-jpg9-m7w4-c7wc) and the default deployer’s secret derives from a public string.

Example:

let accountSigner = try OZDelegatedSigner(address: "GA7QYNF7SOWQ...")
  • 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 }