UNPKG

@metamask/snaps-sdk

Version:

A library containing the core functionality for building MetaMask Snaps

30 lines 1.42 kB
import { createSnapComponent } from "../../component.mjs"; const TYPE = 'AccountSelector'; /** * An account selector component, which is used to create an account selector. * * @param props - The props of the component. * @param props.name - The name of the account selector. This is used to identify the * state in the form data. * @param props.hideExternalAccounts - Whether to hide accounts that doesn't belong to the snap. * @param props.chainIds - The chain IDs to filter the accounts to show. * @param props.switchGlobalAccount - Whether to switch the selected account in the client. * @param props.value - The selected address. * @param props.disabled - Whether the account selector is disabled. * @returns An account selector element. * @example * <AccountSelector name="account-selector" /> * @example * <AccountSelector name="account-selector" hideExternalAccounts /> * @example * <AccountSelector name="account-selector" chainIds={['eip155:1']} /> * @example * <AccountSelector name="account-selector" switchGlobalAccount /> * @example * <AccountSelector name="account-selector" value="eip155:1:0x1234..." /> * @example * <AccountSelector name="account-selector" hideExternalAccounts chainIds={['eip155:1']} switchGlobalAccount value="eip155:1:0x1234..." /> * @category Components */ export const AccountSelector = createSnapComponent(TYPE); //# sourceMappingURL=AccountSelector.mjs.map