Skip to content

Reference

signHexWithStellarKeypair

Sign hexadecimal digests emitted by Canton topology / multi-hash flows using Stellar Ed25519 keys.

Parses hexHash via Buffer.from(hexHash, 'hex'), signs with Keypair.sign, returns signature.toString('hex').

Used inside createExternalParty before converting signatures to base64 for allocateExternalParty.

Setup

import { Keypair } from '@stellar/stellar-base';
import { signHexWithStellarKeypair } from '@fairmint/canton-node-sdk';

const keypair = Keypair.random();

Minimal example

const hexSig = signHexWithStellarKeypair(keypair, MULTI_HASH_HEX_STRING);
console.log(hexSig);

Parameters

  • keypair — Signing Keypair.
  • hexHash — Lowercase / uppercase hex digest without 0x.

Returns

string — Hex-encoded signature bytes.

Source

src/utils/external-signing/stellar-utils.ts