@metamask/multichain-account-service
Version:
Service to manage multichain accounts
283 lines • 9.1 kB
text/typescript
import type { Bip44Account } from "@metamask/account-api";
import type { EntropySourceId, KeyringAccount } from "@metamask/keyring-api";
import { KeyringTypes } from "@metamask/keyring-controller";
import type { InternalAccount } from "@metamask/keyring-internal-api";
export declare const MOCK_SNAP_1: {
id: string;
name: string;
enabled: boolean;
manifest: {
proposedName: string;
};
};
export declare const MOCK_SNAP_2: {
id: string;
name: string;
enabled: boolean;
manifest: {
proposedName: string;
};
};
export declare const MOCK_ENTROPY_SOURCE_1 = "mock-keyring-id-1";
export declare const MOCK_ENTROPY_SOURCE_2 = "mock-keyring-id-2";
export declare const MOCK_HD_KEYRING_1: {
type: KeyringTypes;
metadata: {
id: string;
name: string;
};
accounts: string[];
};
export declare const MOCK_HD_KEYRING_2: {
type: KeyringTypes;
metadata: {
id: string;
name: string;
};
accounts: string[];
};
export declare const MOCK_HD_ACCOUNT_1: Bip44Account<InternalAccount>;
export declare const MOCK_HD_ACCOUNT_2: Bip44Account<InternalAccount>;
export declare const MOCK_SOL_ACCOUNT_1: Bip44Account<InternalAccount>;
export declare const MOCK_BTC_P2WPKH_ACCOUNT_1: Bip44Account<InternalAccount>;
export declare const MOCK_BTC_P2TR_ACCOUNT_1: Bip44Account<InternalAccount>;
export declare const MOCK_SNAP_ACCOUNT_1: Bip44Account<{
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
id: string;
options: Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
} | undefined;
exportable?: boolean | undefined;
};
metadata: {
name: string;
importTime: number;
keyring: {
type: string;
};
nameLastUpdatedAt?: number | undefined;
snap?: {
name: string;
id: string;
enabled: boolean;
} | undefined;
lastSelected?: number | undefined;
};
address: string;
scopes: `${string}:${string}`[];
methods: string[];
}>;
export declare const MOCK_SNAP_ACCOUNT_2: InternalAccount;
export declare const MOCK_SNAP_ACCOUNT_3: Bip44Account<{
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
id: string;
options: Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
} | undefined;
exportable?: boolean | undefined;
};
metadata: {
name: string;
importTime: number;
keyring: {
type: string;
};
nameLastUpdatedAt?: number | undefined;
snap?: {
name: string;
id: string;
enabled: boolean;
} | undefined;
lastSelected?: number | undefined;
};
address: string;
scopes: `${string}:${string}`[];
methods: string[];
}>;
export declare const MOCK_SNAP_ACCOUNT_4: Bip44Account<{
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
id: string;
options: Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
} | undefined;
exportable?: boolean | undefined;
};
metadata: {
name: string;
importTime: number;
keyring: {
type: string;
};
nameLastUpdatedAt?: number | undefined;
snap?: {
name: string;
id: string;
enabled: boolean;
} | undefined;
lastSelected?: number | undefined;
};
address: string;
scopes: `${string}:${string}`[];
methods: string[];
}>;
export declare const MOCK_HARDWARE_ACCOUNT_1: InternalAccount;
export declare class MockAccountBuilder<Account extends KeyringAccount> {
#private;
constructor(account: Account);
static from<Account extends KeyringAccount>(account: Account): MockAccountBuilder<Account>;
withId(id: InternalAccount['id']): this;
withUuid(): this;
withAddressSuffix(suffix: string): this;
withEntropySource(entropySource: EntropySourceId): this;
withGroupIndex(groupIndex: number): this;
get(): Account;
}
export declare const MOCK_WALLET_1_ENTROPY_SOURCE = "mock-keyring-id-1";
export declare const MOCK_WALLET_1_EVM_ACCOUNT: Bip44Account<{
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
id: string;
options: Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
} | undefined;
exportable?: boolean | undefined;
};
metadata: {
name: string;
importTime: number;
keyring: {
type: string;
};
nameLastUpdatedAt?: number | undefined;
snap?: {
name: string;
id: string;
enabled: boolean;
} | undefined;
lastSelected?: number | undefined;
};
address: string;
scopes: `${string}:${string}`[];
methods: string[];
}>;
export declare const MOCK_WALLET_1_SOL_ACCOUNT: Bip44Account<{
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
id: string;
options: Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
} | undefined;
exportable?: boolean | undefined;
};
metadata: {
name: string;
importTime: number;
keyring: {
type: string;
};
nameLastUpdatedAt?: number | undefined;
snap?: {
name: string;
id: string;
enabled: boolean;
} | undefined;
lastSelected?: number | undefined;
};
address: string;
scopes: `${string}:${string}`[];
methods: string[];
}>;
export declare const MOCK_WALLET_1_BTC_P2WPKH_ACCOUNT: Bip44Account<{
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
id: string;
options: Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
} | undefined;
exportable?: boolean | undefined;
};
metadata: {
name: string;
importTime: number;
keyring: {
type: string;
};
nameLastUpdatedAt?: number | undefined;
snap?: {
name: string;
id: string;
enabled: boolean;
} | undefined;
lastSelected?: number | undefined;
};
address: string;
scopes: `${string}:${string}`[];
methods: string[];
}>;
export declare const MOCK_WALLET_1_BTC_P2TR_ACCOUNT: Bip44Account<{
type: "eip155:eoa" | "eip155:erc4337" | "bip122:p2pkh" | "bip122:p2sh" | "bip122:p2wpkh" | "bip122:p2tr" | "solana:data-account" | "tron:eoa" | "any:account";
id: string;
options: Record<string, import("@metamask/utils").Json> & {
entropy?: {
type: "mnemonic";
id: string;
derivationPath: string;
groupIndex: number;
} | {
type: "private-key";
} | undefined;
exportable?: boolean | undefined;
};
metadata: {
name: string;
importTime: number;
keyring: {
type: string;
};
nameLastUpdatedAt?: number | undefined;
snap?: {
name: string;
id: string;
enabled: boolean;
} | undefined;
lastSelected?: number | undefined;
};
address: string;
scopes: `${string}:${string}`[];
methods: string[];
}>;
export declare function mockAsInternalAccount(account: KeyringAccount): InternalAccount;
//# sourceMappingURL=accounts.d.cts.map