Signer
public final class Signer : Sendable
Utility class for creating signer keys used in multi-signature account configurations. Supports ED25519 public keys, SHA256 hashes, pre-authorized transactions, and signed payloads.
-
Creates an ED25519 public key signer from a key pair.
Declaration
Swift
public static func ed25519PublicKey(keyPair: KeyPair) -> SignerKeyXDRParameters
keyPairThe key pair containing the public key to use as a signer.
Return Value
A signer key representing the ED25519 public key.
-
Creates an ED25519 public key signer from an account ID.
Declaration
Swift
public static func ed25519PublicKey(accountId: String) throws -> SignerKeyXDRParameters
accountIdThe Stellar account ID to use as a signer.
Return Value
A signer key representing the ED25519 public key.
-
Creates a SHA256 hash signer for hash-based authorization.
Declaration
Swift
public static func sha256Hash(hash: Data) -> SignerKeyXDRParameters
hashThe SHA256 hash value to use as a signer.
Return Value
A signer key representing the hash.
-
Creates a pre-authorized transaction signer that authorizes a specific transaction.
Declaration
Swift
public static func preAuthTx(transaction: Transaction, network: Network) throws -> SignerKeyXDRParameters
transactionThe transaction to pre-authorize.
networkThe network on which the transaction will be submitted.
Return Value
A signer key representing the pre-authorized transaction hash.
-
Creates a signed payload signer that combines an account ID with custom payload data (CAP-40).
Declaration
Swift
public static func signedPayload(accountId: String, payload: Data) throws -> SignerKeyXDRParameters
accountIdThe Stellar account ID to use as the signer.
payloadThe custom payload data (max 64 bytes).
Return Value
A signer key representing the signed payload.
View on GitHub
Install in Dash