@metamask-previews/account-api
Version:
MetaMask Multichain Account API
28 lines • 1.32 kB
text/typescript
import type { EntropySourceId } from "@metamask/keyring-api";
import type { AccountGroupId } from "../group.mjs";
import { AccountWalletCategory } from "../wallet.mjs";
export type MultichainAccountWalletId = `${AccountWalletCategory.Entropy}:${string}`;
export type MultichainAccountId = `${MultichainAccountWalletId}:${number}`;
/**
* Gets the multichain account wallet ID from its entropy source.
*
* @param entropySource - Entropy source ID of that wallet.
* @returns The multichain account wallet ID.
*/
export declare function toMultichainAccountWalletId(entropySource: EntropySourceId): MultichainAccountWalletId;
/**
* Gets the multichain account ID from its multichain account wallet ID and its index.
*
* @param walletId - Multichain account wallet ID.
* @param groupIndex - Index of that multichain account.
* @returns The multichain account ID.
*/
export declare function toMultichainAccountId(walletId: MultichainAccountWalletId, groupIndex: number): MultichainAccountId;
/**
* Gets the multichain account index from an account group ID.
*
* @param groupId - Account group ID.
* @returns The multichain account index if extractable, undefined otherwise.
*/
export declare function getGroupIndexFromAccountGroupId(groupId: AccountGroupId): number | undefined;
//# sourceMappingURL=id.d.mts.map