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.InvalidAddresswhenaddressis neither a valid Ed25519 public key strkey nor a valid contract id strkey.Declaration
Swift
public init(address: String) throwsParameters
addressThe Stellar address of the signer; must be a valid
G…strkey orC…strkey. -
Converts the delegated signer to its on-chain representation.
Returns an
SCValXDR.vec([Symbol("Delegated"), Address(address)]).Throws
SmartAccountValidationException.InvalidInputif the address cannot be encoded into anSCAddressXDR.Declaration
Swift
public func toScVal() throws -> SCValXDRReturn Value
The
SCValXDRrepresentation of this signer. -
Declaration
Swift
public var uniqueKey: String { get }
View on GitHub
Install in Dash