Skip to content

Reference

createExternalParty

End-to-end onboarding helper — topology generation, multi-hash signing via Stellar Ed25519 keypairs, then allocateExternalParty submission.

Steps executed internally:

  1. Encode Keypair public key (CRYPTO_KEY_FORMAT_DER_X509_SUBJECT_PUBLIC_KEY_INFO).
  2. generateExternalPartyTopology via ledgerClient with participant hints.
  3. Validate partyId, multiHash, topologyTransactions responses.
  4. Sign multiHash using signHexWithStellarKeypair.
  5. allocateExternalParty with hashed signatures referencing publicKeyFingerprint parsed from partyId.

Returns descriptive OperationError PARTY_CREATION_FAILED when any prerequisite missing.

Setup

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

const canton = new Canton({
  network: 'NETWORK_NAME',
  partyId: 'PARTY_ID',
});

Minimal example

const keypair = Keypair.random();

const party = await createExternalParty({
  ledgerClient: canton.ledger,
  keypair,
  partyName: 'alice',
  synchronizerId: 'SYNCHRONIZER_ID',
});

console.log(party.partyId, party.publicKeyFingerprint);

Parameters

CreateExternalPartyParams:

  • ledgerClient, keypair, partyName, synchronizerId (required) — Topology inputs.
  • identityProviderId (optional, default 'default')
  • localParticipantObservationOnly, otherConfirmingParticipantUids, confirmationThreshold, observingParticipantUids (optional) — Multi-hosted onboarding knobs forwarded to generateExternalPartyTopology.

Returns

Promise<CreateExternalPartyResult>partyId, publicKey hex, publicKeyFingerprint, stellarAddress, stellarSecret (keep secret offline).

Errors

Throws OperationError PARTY_CREATION_FAILED when topology omit fields or allocate lacks partyId.

Auth and party

Uses authenticated ledgerClient for topology + allocate endpoints; Keypair proves offline custody.

See also

Source

src/utils/external-signing/create-external-party.ts