Signer

The Signer module defines Signer—the standard interface used throughout Colibri for transaction and authorization signing. By defining a clear interface, anyone can build custom signers and key handling tools that integrate seamlessly with Colibri's pipelines and processes.

Signer Interface

All signers in Colibri implement the Signer interface:

type Signer = {
  /** Returns the public key for this signer */
  publicKey(): Ed25519PublicKey;

  /** Signs arbitrary data and returns the signature as a Buffer */
  sign(data: Buffer): Buffer;

  /** Signs a transaction and returns its XDR string */
  signTransaction(
    tx: Transaction | FeeBumpTransaction
  ): Promise<TransactionXDRBase64> | TransactionXDRBase64;

  /** Signs a Soroban authorization entry */
  signSorobanAuthEntry(
    authEntry: xdr.SorobanAuthorizationEntry,
    validUntilLedgerSeq: number,
    networkPassphrase: string
  ): Promise<xdr.SorobanAuthorizationEntry>;

  /** Returns true if this signer can sign for the given target */
  signsFor(target: Ed25519PublicKey | ContractId): boolean;
};

Using Signers

Pass signers to pipelines via the TransactionConfig:

Multiple Signers

For multi-signature transactions, pass multiple signers:

Implementing Custom Signers

For hardware wallets, custodial services, or custom signing flows, implement the Signer interface:

Available Signers

Signer
Description

Simple in-memory signer for convenience

Next Steps

Last updated