Skip to content

MultichainNexusAccount

The MultichainNexusAccount represents a smart account that can be deployed and operated across multiple chains. It provides methods for managing balances, bridging tokens, and executing transactions across different networks.

Parameters

ParameterTypeDescription
chainsChain[]Array of chains where the account will be deployed
signerSignerThe signer instance used for account creation
validatorAddressAddress(Optional) Custom validator address
factoryAddressAddress(Optional) Custom factory address
attestersAddress[](Optional) Custom attesters array

Returns

PropertyTypeDescription
deploymentsModularSmartAccount[]Array of account deployments across different chains
signerSignerThe signer associated with this multichain account
deploymentOn(chainId: number, strictMode?: boolean) => ModularSmartAccount | undefinedFunction to get deployment for a specific chain
addressOn(chainId: number, strictMode?: boolean) => Hex | undefinedFunction to get address for a specific chain

Example

const account = await toMultichainNexusAccount({
  signer: mySigner,
  chains: [optimism, base],
  transports: [http(), http()]
});
 
// Get deployment on specific chain
const optimismDeployment = account.deploymentOn(10);
 
// Check token balance across chains
const balance = await account.getUnifiedERC20Balance(mcUSDC);

Error Handling

Throws an error if:

  • Invalid chain configuration is provided
  • Signer is not connected
  • Account deployment fails on any chain

Type Definitions

MultichainNexusParams

type MultichainNexusParams = Partial<Omit<ToNexusSmartAccountParameters, "signer">> & {
  chains: Chain[]
  signer: Signer
}

MultichainSmartAccount

type MultichainSmartAccount = {
  deployments: ModularSmartAccount[]
  signer: Signer
  deploymentOn: (chainId: number, strictMode?: boolean) => ModularSmartAccount | undefined
  addressOn: (chainId: number, strictMode?: boolean) => Hex | undefined
}