Steps executed internally:
- Encode
Keypairpublic key (CRYPTO_KEY_FORMAT_DER_X509_SUBJECT_PUBLIC_KEY_INFO). generateExternalPartyTopologyvialedgerClientwith participant hints.- Validate
partyId,multiHash,topologyTransactionsresponses. - Sign
multiHashusingsignHexWithStellarKeypair. allocateExternalPartywith hashed signatures referencingpublicKeyFingerprintparsed frompartyId.
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 togenerateExternalPartyTopology.
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.