@metamask/snaps-sdk
Version:
A library containing the core functionality for building MetaMask Snaps
33 lines • 1.54 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.AccountSelector = void 0;
const component_1 = require("../../component.cjs");
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
*/
exports.AccountSelector = (0, component_1.createSnapComponent)(TYPE);
//# sourceMappingURL=AccountSelector.cjs.map