account-kit/core

Enumerations

Classes

ClassDescription
ClientOnlyPropertyErrorError thrown when a client only property is accessed on the server
InvalidAggregatedSignatureErrorError thrown when the aggregated signature is invalid
InvalidContextSignatureErrorError thrown when the context signature is invalid
MultisigAccountExpectedErrorError thrown when the expected account is not a multisig modular account
MultisigMissingSignatureErrorError thrown when a multisig user op is missing a signature
SessionKeyPermissionsBuilderA builder for creating the hex-encoded data for updating session key permissions.
SessionKeySignerA simple session key signer that uses localStorage or sessionStorage to store a private key. If the key is not found, it will generate a new one and store it in the storage.

Interfaces

Type Aliases

Type AliasDescription
AccountConfig-
AccountLoupeActions-
AccountState-
AlchemyAccountsConfig-
AlchemyChainConfig-
AlchemyClientState-
AlchemyLightAccountClientConfig-
AlchemyModularAccountClientConfig-
AlchemyMultiOwnerLightAccountClientConfig-
AlchemyMultisigAccountClientConfig-
AlchemyRpcSchema-
AlchemySigner-
AlchemySignerClient-
AlchemySmartAccountClient-
AlchemySmartAccountClient_Base-
AlchemySmartAccountClientActions-
AlchemySmartAccountClientConfig-
AlchemyTransport-
AlchemyTransportConfig-
BaseAlchemyActions-
BaseCreateConfigProps-
BuildDeferredActionDigestParams-
BuildNonceParams-
ClientActions-
ClientStoreConfig-
ClientWithAlchemyMethods-
Connection-
ContractAccessEntry-
ContractMethodEntry-
CreateAccountParams-
CreateConfigProps-
CreateLightAccountParams-
CreateMAV2BaseParams-
CreateMAV2BaseReturnType-
CreateModularAccountV2AlchemyClientParams-
CreateModularAccountV2ClientParams-
CreateModularAccountV2Params-
CreateMultiOwnerLightAccountParams-
CreateMultiOwnerModularAccountParams-
CreateMultisigModularAccountParams-
CreateWebauthnMAV2BaseParams-
CreateWebauthnModularAccountV2ClientParams-
CreateWebauthnModularAccountV2Params-
Erc20TokenLimit-
ExecutionDataView-
ExecutionFunctionConfig-
ExecutionHooks-
FunctionId-
FunctionReference-
GasSpendLimit-
GetAccountParams-
GetAccountResult-
GetLightAccountType-
GetMAV2UpgradeToData-
GetPluginAddressParameter-
GetSmartAccountClientParams-
GetSmartAccountClientResult-
GetSmartWalletClientParams-
GetSmartWalletClientResult-
GetUserResult-
InstallMultiOwnerPluginParams-
InstallMultisigPluginParams-
InstallPluginParams-
InstallSessionKeyPluginParams-
LightAccount-
LightAccountClientActions-
LightAccountEntryPointVersion-
LightAccountTypeLight account types supported: LightAccount, MultiOwnerLightAccount
LightAccountVersion-
LightAccountVersionConfig-
LightAccountVersionConfigs-
ModularAccountsV2-
ModularAccountV2-
ModularAccountV2Client-
MultiOwnerLightAccount-
MultiOwnerLightAccountClientActions-
MultiOwnerModularAccount-
MultiOwnerPluginActions-
MultisigModularAccount-
MultisigPluginActions-
MultisigUserOperationContext-
NativeTokenLimit-
Pack1271SignatureParams-
PackUOSignatureParams-
Plugin-
PluginManagerActions-
PolicyToken-
PreValidationHooks-
ProposeUserOperationResult-
RequestGasAndPaymasterAndDataRequest-
RequestGasAndPaymasterAndDataResponse-
RequestPaymasterTokenQuoteRequest-
RequestPaymasterTokenQuoteResponse-
SessionKeyPluginActions-
Signature-
SignerEntity-
SignerStatus-
SignerType-
SignMultisigUserOperationParams-
SignMultisigUserOperationResult-
SimulateUserOperationAssetChangesRequest-
SimulateUserOperationAssetChangesResponse-
SolanaConnection-
Store-
StoredState-
StoreState-
SupportedAccount-
SupportedAccounts-
SupportedAccountTypes-
TimeRange-
UninstallPluginParams-
UserOpSignatureType-
ValidationDataParams-
ValidationDataView-
WebauthnModularAccountV2-
WebauthnModularAccountV2Client-

Variables

| Variable | Description | | :----------------------------------------------------------------------------------------------------------------- | :----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- | ------ | --------------------------------------------------------------------------------------------------- | | accountLoupeActions | Provides a set of actions for account loupe operations using the specified client. NOTE: this is already added to the client when using any of the Modular Account Clients. | | AccountVersionRegistry | Account version registry interface that defines the light account versions and the version definition for each light account type | | alchemyActions | Provides a set of actions for interacting with the Alchemy Smart Account client, including the ability to simulate user operations. | | AlchemyChainSchema | - | | alchemyFeeEstimator | Function that estimates the transaction fees using Alchemy methods for a given client. It fetches the latest block and estimates the max priority fee per gas, applying any overrides or fee options provided. | | arbitrum | - | | arbitrumGoerli | - | | arbitrumNova | - | | arbitrumSepolia | - | | assertNeverSignatureRequestType | - | | base | - | | baseGoerli | - | | baseSepolia | - | | beraChainBartio | - | | bobaMainnet | - | | bobaSepolia | - | | buildDeferredActionDigest | Creates the digest which must be prepended to the userOp signature. | | buildFullNonceKey | - | | celoAlfajores | - | | celoMainnet | - | | convertHeadersToObject | - | | createAlchemyPublicRpcClient | Creates an Alchemy public RPC client with the provided chain, connection configuration, and optional fetch options. The client has alchemy methods and can dynamically update HTTP headers. | | DEFAULT_IFRAME_CONTAINER_ID | - | | DEFAULT_OWNER_ENTITY_ID | - | | defaultLightAccountVersion | Get the default light account version for the given light account type | | defineAlchemyChain | Defines an Alchemy chain configuration by adding an Alchemy-specific RPC base URL to the chain’s RPC URLs. | | entityIdAndNonceReaderBytecode | - | | executeUserOpSelector | - | | formatSignatures | Formats a collection of Signature objects into a single aggregated signature. The format is in the form of EOA_SIGS | CONTRACT_SIG_DATAS. The signatures are ordered by signer address. The EOA SIGS contain the 65 signautre data for EOA signers and 65 bytes containing SIGNER | OFFSET | V for contract signers. The OFFSET is used to fetch the signature data from the CONTRACT_SIG_DATAS. | | fraxtal | - | | fraxtalSepolia | - | | gensynTestnet | - | | getAlchemyPaymasterAddress | Retrieves the Alchemy paymaster address for the given chain. Returns different addresses based on the chain ID. | | getDefaultLightAccountFactoryAddress | Utility method returning the default light account factory address given a Chain object | | getDefaultMAV2Address | - | | getDefaultMAV2FactoryAddress | - | | getDefaultMultiOwnerLightAccountFactoryAddress | Utility method returning the default multi owner light account factory address given a Chain object | | getDefaultMultiOwnerModularAccountFactoryAddress | Utility method returning the default multi owner msca factory address given a chain | | getDefaultMultisigModularAccountFactoryAddress | Utility method returning the default multi sig msca factory address given a chain | | getDefaultSMAV27702Address | - | | getDefaultSMAV2BytecodeAddress | - | | getDefaultSMAV2StorageAddress | - | | getDefaultUserOperationFeeOptions | Retrieves the default user operation fee options for a given chain. Adjusts fees for specific chains like Arbitrum and Optimism. | | getDefaultWebAuthnMAV2FactoryAddress | - | | getSignerType | Determines the type of signer (Externally Owned Account (EOA) or CONTRACT) based on the provided client, signature, and signer. | | goerli | - | | IAccountLoupeAbi | - | | inkMainnet | - | | inkSepolia | - | | IPluginAbi | - | | IPluginManagerAbi | - | | isMultisigModularAccount | - | | IStandardExecutorAbi | - | | lightAccountClientActions | Provides a set of actions for managing a light account client, including transferring ownership. | | LightAccountUnsupported1271Factories | Can be used to check if the account with one of the following factory addresses to not support 1271 signing. | | LightAccountUnsupported1271Impls | Can be used to check if the account with one of the following implementation addresses to not support 1271 signing. | | mainnet | - | | mekong | - | | mintableERC20Abi | - | | mintableERC20Bytecode | - | | monadTestnet | - | | multiOwnerLightAccountClientActions | Generates client actions for a multi-owner light account, including the ability to update owners. | | MultiOwnerModularAccountFactoryAbi | - | | MultiOwnerPlugin | - | | MultiOwnerPluginAbi | - | | multiOwnerPluginActions | Creates actions for the MultiOwner plugin, including reading owners and checking ownership. NOTE: this is already added to the client returned from createMultiOwnerModularAccountClient | | MultiOwnerPluginExecutionFunctionAbi | - | | MULTISIG_ACCOUNT_SOURCE | - | | MultisigModularAccountFactoryAbi | - | | MultisigPlugin | - | | MultisigPluginAbi | - | | multisigPluginActions | Provides actions for managing a multisig plugin within the specified client, including reading owners, checking ownership, getting the threshold, proposing user operations, and signing multisig user operations. | | MultisigPluginExecutionFunctionAbi | - | | multisigSignatureMiddleware | A signer middleware to be used with Multisig Account Clients. This middleware handles correctly aggregating signatures passed through as context when sending UserOperations, proposing UserOperations, or adding signatures to a UserOperation. | | opbnbMainnet | - | | opbnbTestnet | - | | openlootSepolia | - | | optimism | - | | optimismGoerli | - | | optimismSepolia | - | | pack1271Signature | - | | packUOSignature | - | | parseDeferredAction | - | | polygon | - | | polygonAmoy | - | | polygonMumbai | - | | riseTestnet | - | | semiModularAccountBytecodeAbi | - | | sepolia | - | | SessionKeyPlugin | - | | SessionKeyPluginAbi | - | | sessionKeyPluginActions | Creates actions for managing session keys in a smart contract associated with a client, including adding, removing, rotating, and updating session key permissions. | | SessionKeyPluginExecutionFunctionAbi | - | | shape | - | | shapeSepolia | - | | simulateUserOperationChanges | Simulates user operation changes including asset changes for a specified user operation and returns the resulting state changes. | | soneiumMainnet | - | | soneiumMinato | - | | splitAggregatedSignature | Takes an aggregated signature and threshold and splits it into its components | | standardExecutor | - | | storyAeneid | - | | storyMainnet | - | | teaSepolia | - | | transferLightAccountOwnership | Transfers the ownership of a light account to a new owner. This function ensures that the client is a compatible smart acccount client and that a Light Account is provided. If the waitForTxn parameter is true, it will wait for the transaction to be completed before returning. | | unichainMainnet | - | | unichainSepolia | - | | updateMultiOwnerLightAccountOwners | Updates the owners of a multi-owner light account. This includes adding new owners and removing existing ones. | | UpgradeableModularAccountAbi | - | | worldChain | - | | worldChainSepolia | - | | zora | - | | zoraSepolia | - |

Functions

FunctionDescription
alchemyCreates an Alchemy transport with the specified configuration options. When sending all traffic to Alchemy, you must pass in one of rpcUrl, apiKey, or jwt. If you want to send Bundler and Paymaster traffic to Alchemy and Node traffic to a different RPC, you must pass in alchemyConnection and nodeRpcUrl.
alchemyGasAndPaymasterAndDataMiddlewarePaymaster middleware factory that uses Alchemy’s Gas Manager for sponsoring transactions. Uses Alchemy’s custom alchemy_requestGasAndPaymasterAndData method instead of conforming to the standard ERC-7677 interface. Note that if you use createAlchemySmartAccountClient, this middleware is already used by default and you do not need to manually include it.
alchemyGasManagerMiddlewarePaymaster middleware factory that uses Alchemy’s Gas Manager for sponsoring transactions. Adheres to the ERC-7677 standardized communication protocol.
alchemyUserOperationSimulatorA middleware function to be used during simulation of user operations which leverages Alchemy’s RPC uo simulation method.
buildSessionKeysToRemoveStructFinds predecessors for each provided key and returns them in the struct ISessionKeyPlugin.SessionKeyToRemove[].
combineSignaturesCombines multiple signatures with provided upper limit values for gas fees and returns the concatenated result.
convertSignerStatusToStateConverts the AlchemySigner’s status to a more readable object
cookieStorageFunction to create cookie based Storage
cookieToInitialStateConverts a cookie into an initial state object
createAccountCreates an account of a specified type using the provided parameters and configuration. Supports creating LightAccount and MultiOwnerModularAccount types.
createAlchemySmartAccountClient-
createConfigCreates an AlchemyAccountsConfig object that can be used in conjunction with the actions exported from @account-kit/core.
createDefaultAccountStateCreates the default account state for the given chains.
createLightAccount-
createLightAccountAlchemyClient-
createLightAccountClient-
createMAv2Base-
createModularAccount-
createModularAccountAlchemyClient-
createModularAccountV2-
createModularAccountV2Client-
createMultiOwnerLightAccount-
createMultiOwnerLightAccountAlchemyClient-
createMultiOwnerLightAccountClient-
createMultiOwnerModularAccountClient-
createMultisigAccountAlchemyClient-
createMultisigModularAccount-
createMultisigModularAccountClient-
createSignerGiven initial client store parameters, it initializes an AlchemySigner instance. This should only be called on the client.
defaultAccountStateReturns the default state for an account of a supported type.
disconnectDisconnects the current signer, accounts, and clears the store.
getAccountRetrieves the account of the specified type from the client store based on the provided configuration.
getBundlerClientRetrieves the BundlerClient from the core store of the given AlchemyAccountsConfig.
getChainGets the currently active chain
getConnectionUsed to get the connection for the currently active chain
getLightAccountVersionForAccountGet the light account version definition for the given light account and chain
getMAInitializationDataRetrieves the initialization data for a multi-owner modular account. Throws an error if the client’s chain is not found or if the multi-owner plugin address is not retrievable.
getMAV2UpgradeToDataRetrieves the data necessary to upgrade to a Modular Account V2 (MA v2). Note that the upgrade will be to the Semi Modular Account Storage variant
getMSCAUpgradeToDataRetrieves the data necessary to upgrade to a Multi-Signature Contract Account (MSCA) and provides a method to create a Multi-Owner Modular Account.
getSignerIf there is a signer attached to the client state, it will return it. The signer should always be null on the server, and will be set on the client if the store was properly hydrated.
getSignerStatusRetrieves the signer status from the client’s store in the provided configuration.
getSignerTypeHeader-
getSmartAccountClientObtains a smart account client based on the provided parameters and configuration. Supports creating any of the SupportAccountTypes in Account Kit. If the signer is not connected, or an account is already being intializes, this results in a loading state.
getSmartWalletClientCreates and returns a Smart Wallet Client instance. Returns undefined if running in a server environment or if no signer is connected. Caches clients by chain ID & address for performance optimization.
getSolanaConnectionUsed to get the connection for the id
getUserReturns the currently logged in user if using an SCA with the AlchemySigner or the connected EOA details.
headersUpdateUpdate the headers with the trace header and breadcrumb.
hydrateWill hydrate the client store with the provided initial state if one is provided.
installPluginInstalls a plugin on a smart account via the client, sending the user operation with the appropriate parameters. NOTE: it’s recommended to just use the installPlugin action returned from generated plugins
isAlchemySmartAccountClientChecks if a given client is an Alchemy Smart Account Client. The goal of this check is to ensure that the client supports certain RPC methods.
isAlchemyTransportA type guard for the transport to determine if it is an Alchemy transport. Used in cases where we would like to do switching depending on the transport, where there used to be two clients for an alchemy and a non-alchemy, and with this switch we don’t need the two seperate clients. *
isLightAccountParams-
isModularAccountV2-
isModularV2AccountParams-
isMultiOwnerLightAccountParams-
isMultiOwnerModularAccountParams-
mutateRemoveTrackingHeadersRemove the tracking headers. This is used in our split transport to ensure that we remove the headers that are not used by the other systems.
parseCookieHelper function that can be used to parse a cookie string on the server or client
pluginManagerActionsProvides actions for managing plugins on a given client, including installing and uninstalling plugins. NOTE: this is provided by default when using a modular account client
predictLightAccountAddressPredicts the address of a light account based on provided parameters such as factory address, salt, owner address, and version.
predictModularAccountV2AddressPredicts the address of a modular account V2 based on the provided parameters, which include factory address, salt, and implementation address. This function supports different types of accounts including “SMA”, “MA”, and “WebAuthn”.
predictMultiOwnerLightAccountAddressPredicts the address of a Multi-Owner Light Account given the factory, salt and the set of owner addresses.
reconnectThis method will use the current state in the client store and attempt to restore connected instances of previously used accounts and the signer.
setChainAllows you to change the current chain in the core store. Note, this chain must be one of the chains configured in your original createConfig call.
watchAccountWatches for changes to a specific type of account and triggers the provided callback function when changes occur.
watchBundlerClientWatches for changes to the bundler client within the given configuration and triggers a callback when changes occur.
watchChainAllows you to subscribe to changes of the chain in the client store.
watchConnectionSubscribe to changes to the active connection
watchSignerSubscribe to changes of the signer instance on the client store.
watchSignerStatusWatches the signer status in the client store and triggers the provided callback function when the status changes.
watchSmartAccountClientWatches for changes to the smart account client and triggers the provided callback when a change is detected.
watchSmartWalletClientCreates a subscription function that watches for changes to the Smart Wallet Client. Triggers the onChange callback whenever the signer status or chain changes.
watchSolanaConnectionSubscribe to changes to the solana connection for the id
watchUserWatches for changes to the user in the client store and triggers the provided callback when a change is detected.

References

createMultiOwnerModularAccount

Renames and re-exports createModularAccount


internalCreateWebSigner

Renames and re-exports createSigner