Skip to content
Merged
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions packages/account-api/src/api/provider.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import type { EntropySourceId, KeyringAccount } from '@metamask/keyring-api';

export enum AccountProviderType {
Comment thread
gantunesr marked this conversation as resolved.
Evm = 'Evm',
Solana = 'Solana',
Btc = 'Btc',
Comment thread
hmalik88 marked this conversation as resolved.
}

/**
* An account provider is reponsible of providing accounts to an account group.
*/
export type AccountProvider<Account extends KeyringAccount> = {
/**
* The type of the provider.
*/
providerType: AccountProviderType;
Comment thread
hmalik88 marked this conversation as resolved.
/**
* Gets an account for a given ID.
*
Expand Down Expand Up @@ -33,18 +43,15 @@ export type AccountProvider<Account extends KeyringAccount> = {
}) => Promise<Account[]>;

/**
* Discover accounts for a given entropy source and a given group
* index.
* Discover accounts for a given entropy source.
*
* NOTE: This method needs to also create the discovered accounts.
*
* @param options - Options.
* @param options.entropySource - Entropy source to use.
* @param options.groupIndex - Group index to use.
* @returns The list of discovered and created accounts.
*/
discoverAndCreateAccounts: (options: {
entropySource: EntropySourceId;
groupIndex: number;
Comment thread
hmalik88 marked this conversation as resolved.
}) => Promise<Account[]>;
};
Loading