sign

suspend fun sign(signer: KeyPair)

Adds a signature by signing the transaction hash with the provided keypair.

The signature is created by:

  1. Computing the transaction hash

  2. Signing the hash with the keypair's private key

  3. Creating a decorated signature with the signature hint

  4. Adding it to the signatures list

Parameters

signer

The keypair to sign with (must have private key)

Throws

if the keypair doesn't contain a private key