UNPKG

@fairmint/canton-node-sdk

Version:
71 lines 2.75 kB
import type { Keypair } from '@stellar/stellar-base'; import type { LedgerJsonApiClient } from '../../clients/ledger-json-api'; /** Parameters for creating an external party */ export interface CreateExternalPartyParams { /** Ledger JSON API client instance */ ledgerClient: LedgerJsonApiClient; /** Stellar keypair for the party (Ed25519) */ keypair: Keypair; /** Party name hint (will be used as prefix in party ID) */ partyName: string; /** Synchronizer ID to onboard the party on */ synchronizerId: string; /** Identity provider ID (default: 'default') */ identityProviderId?: string; /** If true, the local participant will only observe, not confirm (default: false) */ localParticipantObservationOnly?: boolean; /** Other participant UIDs that should confirm for this party */ otherConfirmingParticipantUids?: string[]; /** Confirmation threshold for multi-hosted party (default: all confirmers) */ confirmationThreshold?: number; /** Other participant UIDs that should only observe */ observingParticipantUids?: string[]; } /** Result of creating an external party */ export interface CreateExternalPartyResult { /** Generated party ID (e.g., "alice::12abc...") */ partyId: string; /** User ID for preparing transactions */ userId: string; /** Base64-encoded public key */ publicKey: string; /** Fingerprint of the public key */ publicKeyFingerprint: string; /** Stellar address (public key in Stellar format) */ stellarAddress: string; /** Stellar secret key (KEEP SECURE!) */ stellarSecret: string; } /** * Creates an external party in Canton * * This is a convenience function that combines the three-step process: * * 1. Generate topology transactions * 2. Sign the multi-hash * 3. Allocate the party * * The keypair's private key is used to sign the onboarding transactions, proving ownership of the public key. * * @example * ```typescript * import { Keypair } from '@stellar/stellar-base'; * import { createExternalParty } from '@fairmint/canton-node-sdk'; * * const keypair = Keypair.random(); * const party = await createExternalParty({ * ledgerClient, * keypair, * partyName: 'alice', * synchronizerId: 'global-synchronizer', * }); * * console.log('Party ID:', party.partyId); * console.log('Public Key Fingerprint:', party.publicKeyFingerprint); * ```; * * @param params - Configuration for external party creation * @returns Party details including party ID and key fingerprint */ export declare function createExternalParty(params: CreateExternalPartyParams): Promise<CreateExternalPartyResult>; //# sourceMappingURL=create-external-party.d.ts.map