import type { Address } from '../types/primitives.mjs'; /** `loadMasterKeystore` 가 반환하는 파싱된 master keystore payload. */ export type MasterKeyInfo = { address: Address; mkeyAlgorithm: string; msecretKey: string; mpublicKey: string; }; /** `loadNormalKeystore` 가 반환하는 파싱된 normal keystore payload. */ export type NormalKeyInfo = { address: Address; nkeyAlgorithm: string; nsecretKey: string; npublicKey: string; keyBind: unknown; }; /** 평탄화된 키 자료 — `keysToAccount` 가 받는 형태. */ export type UnlockedKeyPair = { address: Address; msk: string; mpk: string; nsk: string; npk: string; }; export type CreateKeystoreBundleArgs = { passwordMaster: string; passwordNormal: string; /** 비어 있으면 WASM 헬퍼가 내부적으로 'FALCON+ED25519' 를 기본값으로 쓴다. */ algoMaster?: string; /** 비어 있으면 WASM 헬퍼가 내부적으로 'ED25519' 를 기본값으로 쓴다. */ algoNormal?: string; }; export type AccountKeystoreBundle = { /** 원본 JSON array 문자열 — 영속화에 적합. */ raw: string; /** master / normal 두 반쪽의 개별 JSON 문자열. */ masterKsJson: string; normalKsJson: string; }; /** * 새 dual-key keystore 를 만들고 결과 JSON array 를 master / normal 두 * 반쪽으로 분리한다. 각 반쪽은 독립적으로 영속화한 뒤 unlockMasterKeystore * / unlockNormalKeystore 로 다시 unlock 할 수 있다. * * WASM 의 `createAccountAndKeystore` 에 대한 얇은 래퍼다. `utils/index.mts` * 가 raw WASM export 도 함께 re-export 하므로 충돌을 피하려고 이름을 * 새로 붙였다. */ export declare function createKeystoreBundle(args: CreateKeystoreBundleArgs): AccountKeystoreBundle; /** * WASM `createAccountAndKeystore` 헬퍼가 반환한 `[master, normal]` keystore * 배열을 두 JSON 문자열로 분리한다. */ export declare function splitKeystoreBundle(bundleJson: string): { masterKsJson: string; normalKsJson: string; }; /** * master keystore JSON 을 password 로 복호화한다. * * WASM 헬퍼가 emit 하는 lowercase-camelCase 필드 (`address`, `mkeyAlgorithm`, * `msecretKey`, `mpublicKey`) 를 그대로 반환한다. */ export declare function unlockMasterKeystore(args: { ksJson: string; password: string; }): MasterKeyInfo; /** * normal keystore JSON 을 password 로 복호화한다. * * WASM 헬퍼가 emit 하는 lowercase-camelCase 필드 (`address`, `nkeyAlgorithm`, * `nsecretKey`, `npublicKey`, `keyBind`) 를 그대로 반환한다. */ export declare function unlockNormalKeystore(args: { ksJson: string; password: string; }): NormalKeyInfo; /** * one-shot 헬퍼: 전체 `[master, normal]` keystore JSON 과 두 password 를 * 받아 `keysToAccount` 가 소비하는 평탄한 (address, msk, mpk, nsk, npk) * tuple 을 반환한다. */ export declare function unlockKeystoreBundle(args: { ksJsonBundle: string | AccountKeystoreBundle; passwordMaster: string; passwordNormal: string; }): UnlockedKeyPair;