Skip to content

Commit bed9999

Browse files
committed
refactor(chains): rename primitives to signing components
Replace Primitive* types and registry APIs with SigningComponent* across chain-core and sdk. Migrate lattice signers/context to resolveSigningComponent with EXTERNAL.SIGNING fallback to preserve DeviceContext compatibility. Rename primitive-focused modules/tests and keep transactional plugin register/unregister cleanup for plugin-owned signing components.
1 parent b06f89d commit bed9999

19 files changed

Lines changed: 588 additions & 531 deletions

packages/chains/chain-core/src/index.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -33,23 +33,23 @@ export type ChainCapabilities = {
3333
getXpub?: boolean;
3434
};
3535

36-
export type PrimitiveKind = 'hash' | 'curve' | 'encoding';
36+
export type SigningComponentKind = 'hash' | 'curve' | 'encoding';
3737

38-
export type PrimitiveDefinition = {
39-
kind: PrimitiveKind;
38+
export type SigningComponentDefinition = {
39+
kind: SigningComponentKind;
4040
name: string;
4141
code: number;
4242
};
4343

44-
export type PrimitiveRequirement = {
45-
kind: PrimitiveKind;
44+
export type SigningComponentRequirement = {
45+
kind: SigningComponentKind;
4646
name: string;
4747
minFirmware: [number, number, number];
4848
};
4949

50-
export type PluginPrimitives = {
51-
definitions?: PrimitiveDefinition[];
52-
requirements?: PrimitiveRequirement[];
50+
export type ChainSigningSuite = {
51+
definitions?: SigningComponentDefinition[];
52+
requirements?: SigningComponentRequirement[];
5353
};
5454

5555
export type GetAddressParams = {
@@ -146,7 +146,7 @@ export type ChainPlugin<
146146
signer: TSigner,
147147
options?: TOptions,
148148
) => Promise<TAdapter> | TAdapter;
149-
primitives?: PluginPrimitives;
149+
signingSuite?: ChainSigningSuite;
150150
};
151151

152152
export type ChainRegistryResolveOptions = {
@@ -269,10 +269,10 @@ export function createChainRegistry<TContext = DeviceContext>(
269269
}
270270

271271
export {
272-
createPrimitiveRegistry,
273-
PrimitiveConflictError,
274-
type PrimitiveRegistry,
275-
} from './primitiveRegistry';
272+
createSigningComponentRegistry,
273+
SigningComponentConflictError,
274+
type SigningComponentRegistry,
275+
} from './signingComponentRegistry';
276276

277277
// ---------------------------------------------------------------------------
278278
// Firmware version utilities

packages/chains/chain-core/src/primitiveRegistry.ts

Lines changed: 0 additions & 220 deletions
This file was deleted.

0 commit comments

Comments
 (0)