Signer
An interface for signing a HashIDPreimage to produce a signature.
This enables custom signing logic such as:
Hardware wallet signing
Multi-signature coordination
Custom key management systems
Implementation Example
val signer = object : Auth.Signer {
override suspend fun sign(preimage: HashIDPreimageXdr): Auth.Signature {
// 1. Convert preimage to bytes and hash
val payload = Util.hash(preimage.toXdrByteArray())
// 2. Sign with your custom method
val signature = myHardwareWallet.sign(payload)
// 3. Return signature with public key
return Auth.Signature("G...", signature)
}
}Content copied to clipboard