import { KeypairCurve } from "@talismn/crypto"; //#region src/types/account.d.ts type LedgerPolkadotCurve = "ed25519" | "ethereum"; type AccountBase = { address: string; name: string; createdAt: number; }; type AccountKeypair = AccountBase & { type: "keypair"; curve: KeypairCurve; mnemonicId?: string; derivationPath?: string; }; type AccountContact = AccountBase & { type: "contact"; genesisHash?: `0x${string}`; }; type AccountWatchOnly = AccountBase & { type: "watch-only"; isPortfolio: boolean; }; type AccountLedgerPolkadot = AccountBase & { type: "ledger-polkadot"; curve: LedgerPolkadotCurve; app: string; accountIndex: number; addressOffset: number; genesisHash?: `0x${string}`; }; type AccountLedgerEthereum = AccountBase & { type: "ledger-ethereum"; derivationPath: string; }; type AccountLedgerSolana = AccountBase & { type: "ledger-solana"; derivationPath: string; }; type AccountPolkadotVault = AccountBase & { type: "polkadot-vault"; genesisHash: `0x${string}` | null; }; type AccountSignet = AccountBase & { type: "signet"; genesisHash: `0x${string}`; url: string; }; type Account = AccountKeypair | AccountContact | AccountWatchOnly | AccountLedgerEthereum | AccountLedgerPolkadot | AccountLedgerSolana | AccountPolkadotVault | AccountSignet; type AccountType = Account["type"]; //#endregion //#region src/types/keyring.d.ts type AddMnemonicOptions = { mnemonic: string; name: string; confirmed: boolean; }; type UpdateMnemonicOptions = { name?: string; confirmed?: boolean; }; type DeriveFromNewMnemonic = { type: "new-mnemonic"; mnemonic: string; mnemonicName: string; confirmed: boolean; curve: KeypairCurve; derivationPath: string; }; type DeriveFromExistingMnemonic = { type: "existing-mnemonic"; mnemonicId: string; curve: KeypairCurve; derivationPath: string; }; type DeriveFromMnemonicOptions = DeriveFromNewMnemonic | DeriveFromExistingMnemonic; type AddAccountDeriveOptions = Omit & DeriveFromMnemonicOptions; type AddAccountKeypairOptions = Omit & { curve: KeypairCurve; secretKey: Uint8Array; }; type AddAccountExternalOptions = Omit | Omit | Omit | Omit | Omit | Omit | Omit; type UpdateAccountOptions = { name?: string; isPortfolio?: boolean; genesisHash?: `0x${string}`; }; //#endregion //#region src/types/mnemonic.d.ts type Mnemonic = { id: string; name: string; confirmed: boolean; createdAt: number; }; //#endregion //#region src/types/utils.d.ts type AccountOfType = Extract; declare const isAccountOfType: (account: Account | null | undefined, type: Type) => account is AccountOfType; declare const isAccountInTypes: (account: Account | null | undefined, types: Types) => account is AccountOfType; declare const ACCOUNT_TYPES_OWNED: readonly ["keypair", "ledger-ethereum", "ledger-polkadot", "ledger-solana", "polkadot-vault"]; declare const ACCOUNT_TYPES_EXTERNAL: readonly ["contact", "watch-only", "ledger-ethereum", "ledger-polkadot", "ledger-solana", "polkadot-vault", "signet"]; declare const ACCOUNT_TYPES_ADDRESS_ETHEREUM: readonly ["contact", "watch-only", "keypair", "ledger-ethereum", "ledger-polkadot"]; declare const ACCOUNT_TYPES_PLATFORM_ETHEREUM: readonly ["contact", "watch-only", "keypair", "ledger-ethereum"]; declare const ACCOUNT_TYPES_PLATFORM_POLKADOT: readonly ["contact", "watch-only", "keypair", "ledger-polkadot", "polkadot-vault", "signet"]; declare const ACCOUNT_TYPES_ADDRESS_SS58: readonly ["contact", "watch-only", "keypair", "ledger-polkadot", "polkadot-vault", "signet"]; declare const ACCOUNT_TYPES_PLATFORM_SOLANA: readonly ["contact", "watch-only", "keypair", "ledger-solana"]; declare const ACCOUNT_TYPES_BITCOIN: readonly ["contact", "watch-only"]; declare const isAccountExternal: (account: Account | null | undefined) => account is AccountOfType<(typeof ACCOUNT_TYPES_EXTERNAL)[number]>; declare const isAccountOwned: (account: Account | null | undefined) => account is AccountOfType<(typeof ACCOUNT_TYPES_OWNED)[number]>; declare const isAccountPortfolio: (account: Account | null | undefined) => account is Account; declare const isAccountNotContact: (acc: Account) => acc is AccountKeypair | AccountLedgerEthereum | AccountLedgerPolkadot | AccountLedgerSolana | AccountPolkadotVault | AccountSignet | AccountWatchOnly; type AccountAddressEthereum = Extract & { address: `0x${string}`; }; declare const isAccountAddressEthereum: (account: Account | null | undefined) => account is AccountAddressEthereum; type AccountPlatformEthereum = Extract & { address: `0x${string}`; }; declare const isAccountPlatformEthereum: (account: Account | null | undefined) => account is AccountPlatformEthereum; type AccountPlatformSolana = Extract; declare const isAccountPlatformSolana: (account: Account | null | undefined) => account is AccountPlatformSolana; type AccountPlatformPolkadot = Extract; declare const isAccountPlatformPolkadot: (account: Account | null | undefined) => account is AccountPlatformPolkadot; type AccountAddressSs58 = Extract & { genesisHash?: `0x${string}`; }; declare const isAccountAddressSs58: (account: Account | null | undefined) => account is AccountAddressSs58; declare const isAccountLedgerPolkadot: (account: Account | null | undefined) => account is AccountLedgerPolkadot; declare const isAccountLedgerPolkadotGeneric: (account: Account | null | undefined) => account is AccountLedgerPolkadot & { genesisHash: undefined; }; declare const isAccountLedgerPolkadotLegacy: (account: Account | null | undefined) => account is AccountLedgerPolkadot & { genesisHash: `0x${string}`; }; type AccountBitcoin = Extract; declare const isAccountBitcoin: (account: Account | null | undefined) => account is AccountBitcoin; declare const getAccountGenesisHash: (account: Account | null | undefined) => `0x${string}` | undefined; declare const getAccountSignetUrl: (account: Account | null | undefined) => string | undefined; declare const getAccountPlatform: (account: Account | null | undefined) => import("@talismn/crypto").AccountPlatform | undefined; //#endregion //#region src/keyring/types.d.ts type MnemonicStorage = Mnemonic & { entropy: string; }; type AccountKeypairStorage = AccountKeypair & { secretKey: string; }; type AccountStorage = AccountKeypairStorage | AccountContact | AccountWatchOnly | AccountLedgerEthereum | AccountLedgerPolkadot | AccountLedgerSolana | AccountPolkadotVault | AccountSignet; //#endregion //#region src/keyring/Keyring.d.ts type KeyringStorage = { passwordCheck: string | null; mnemonics: MnemonicStorage[]; accounts: AccountStorage[]; }; declare class Keyring { #private; protected constructor(data: KeyringStorage); static create(): Keyring; static load(data: KeyringStorage): Keyring; private checkPassword; /** Returns true if a password has been set on this keyring. */ hasPassword(): boolean; /** * Verify a password against the keyring's passwordCheck blob. * Returns true on success, false on wrong password. * Throws if no password has been set (caller should check hasPassword() first). */ verifyPassword(password: string): Promise; /** * Initialize the password on a fresh keyring that has no password set. * Throws if a password is already set (use changePassword flow instead). */ initializePassword(password: string): Promise; toJson(): KeyringStorage; export(password: string, jsonPassword: string): Promise; getMnemonics(): Mnemonic[]; addMnemonic({ name, mnemonic, confirmed }: AddMnemonicOptions, password: string): Promise; getMnemonic(id: string): Mnemonic | null; updateMnemonic(id: string, { name, confirmed }: UpdateMnemonicOptions): Mnemonic; removeMnemonic(id: string): void; getMnemonicText(id: string, password: string): Promise; getExistingMnemonicId(mnemonic: string): string | null; getAccounts(): Account[]; getAccount(address: string): Account | null; updateAccount(address: string, { name, isPortfolio, genesisHash }: UpdateAccountOptions): Account; removeAccount(address: string): void; addAccountExternal(options: AddAccountExternalOptions): Account; /** * Needs to be called before deriving an account from a mnemonic. * * This will ensure that it is present (or add it if possible) in the keyring before actually creating the account. * * @param options * @param password * @returns the id of the mnemonic */ private ensureMnemonic; addAccountDerive(options: AddAccountDeriveOptions, password: string): Promise; addAccountKeypair({ curve, name, secretKey }: AddAccountKeypairOptions, password: string): Promise; getAccountSecretKey(address: string, password: string): Promise; getDerivedAddress(mnemonicId: string, derivationPath: string, curve: KeypairCurve, password: string): Promise; } //#endregion export { Account, AccountBase, AccountContact, AccountKeypair, AccountLedgerEthereum, AccountLedgerPolkadot, AccountLedgerSolana, AccountOfType, AccountPolkadotVault, AccountSignet, AccountType, AccountWatchOnly, AddAccountDeriveOptions, AddAccountExternalOptions, AddAccountKeypairOptions, AddMnemonicOptions, Keyring, KeyringStorage, LedgerPolkadotCurve, Mnemonic, UpdateAccountOptions, UpdateMnemonicOptions, getAccountGenesisHash, getAccountPlatform, getAccountSignetUrl, isAccountAddressEthereum, isAccountAddressSs58, isAccountBitcoin, isAccountExternal, isAccountInTypes, isAccountLedgerPolkadot, isAccountLedgerPolkadotGeneric, isAccountLedgerPolkadotLegacy, isAccountNotContact, isAccountOfType, isAccountOwned, isAccountPlatformEthereum, isAccountPlatformPolkadot, isAccountPlatformSolana, isAccountPortfolio }; //# sourceMappingURL=index.d.mts.map