Skip to content

Reference

stellarPublicKeyToBase64

Convert Stellar Keypairs into Canton-compatible DER base64 public keys using wrapEd25519PublicKeyInDER.

Delegates to wrapEd25519PublicKeyInDER(Keypair.rawPublicKey()) then toString('base64').

Use before generateExternalPartyTopology publicKey.keyData payloads.

Setup

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

const keypair = Keypair.random();

Minimal example

const encoded = stellarPublicKeyToBase64(keypair);
console.log(encoded);

Parameters

  • keypairKeypair from @stellar/stellar-base.

Returns

string — Base64 DER SubjectPublicKeyInfo blob.

Errors

Propagates ValidationError from wrapEd25519PublicKeyInDER when raw key malformed.

Source

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