@mycelium-sdk/core
    Preparing search index...

    Interface WalletNamespace

    Wallet namespace to create and retrieve different wallet formats and overall web3 account

    This class is returned by MyceliumSDK and provides a methods to create and retrieve different wallet formats The common methods are:

    • createAccount which creates a unified account: a smart wallet with an embedded wallet as signer
    • getAccount which retrieves a unified account: a smart wallet using an embedded walletId More advanced option are also available
    // Create a smart wallet and related embedded wallet
    const { embeddedWalletId, smartWallet } = await myceliumSDK.wallet.createAccount();

    // Get the smart wallet using the embedded walletId
    const smartWallet = await myceliumSDK.wallet.getAccount({
    embeddedWalletId,
    });
    interface WalletNamespace {
        createAccount(
            params?: CreateAccountOptions,
        ): Promise<CreateAccountResult>;
        createEmbeddedWallet(): Promise<EmbeddedWallet>;
        createSmartWallet(params: CreateSmartWalletOptions): Promise<SmartWallet>;
        getAccount(params: GetAccountOptions): Promise<SmartWallet>;
        getEmbeddedWallet(
            params: GetEmbeddedWalletOptions,
        ): Promise<EmbeddedWallet>;
        getSmartWallet(params: GetSmartWalletOptions): Promise<SmartWallet>;
    }
    Index

    Creation

    • A unified a web3 account: creates a smart wallet with an embedded wallet as signer

      Parameters

      • Optionalparams: CreateAccountOptions

        Optional creation parameters

        • owners

          Optional additional owners. The embedded wallet address is inserted at the specified index

        • embeddedWalletIndex

          Optional index at which to insert the embedded wallet address (defaults to end)

        • nonce

          Optional nonce/salt for deterministic address generation (defaults to 0)

      Returns Promise<CreateAccountResult>

      Promise that resolves to the created SmartWallet

      Creates an embedded wallet first, inserts its address into the owners array, and uses its account as the signer for the smart wallet

    • Creates an embedded wallet

      Returns Promise<EmbeddedWallet>

      Promise that resolves to the newly created EmbeddedWallet

      Thin wrapper around the embedded wallet provider’s createWallet

    • Creates a smart wallet (you provide signer and owners)

      Parameters

      • params: CreateSmartWalletOptions

        Smart wallet creation parameters

        • owners

          Owners for the smart wallet (addresses or WebAuthn public keys)

        • signer

          Local account used for signing transactions

        • nonce

          Optional nonce/salt for deterministic address generation (defaults to 0)

      Returns Promise<SmartWallet>

      Promise that resolves to the created SmartWallet

      Use this when you already control a signer (e.g., LocalAccount) and want to create a smart wallet without creating an embedded wallet

    Retrieval

    • Gets a unified web3 account: a smart wallet using an embedded wallet as the signer

      Parameters

      • params: GetAccountOptions

        Retrieval parameters

        • walletId

          Embedded wallet ID used to locate the signer wallet

        • deploymentOwners

          Optional original deployment owners used for address calculation

        • signerOwnerIndex

          Index of the signer within the current owners set (defaults to 0)

        • walletAddress

          Optional explicit smart wallet address (skips calculation)

        • nonce

          Optional nonce used during original creation

      Returns Promise<SmartWallet>

      Promise that resolves to the SmartWallet

      Looks up an embedded wallet by walletId and uses it as signer If neither walletAddress nor deploymentOwners is provided, defaults to using the embedded wallet as the single owner for deterministic address calculation

      Error if the embedded wallet cannot be found

    • Gets an existing embedded wallet by ID

      Parameters

      • params: GetEmbeddedWalletOptions

        Retrieval parameters

        • walletId

          Embedded wallet ID to retrieve

      Returns Promise<EmbeddedWallet>

      Promise that resolves to the EmbeddedWallet (or null/undefined per provider contract)

    • Gets a smart wallet using a provided signer

      Parameters

      • params: GetSmartWalletOptions

        Retrieval parameters

        • signer

          Signer (local account)

        • deploymentOwners

          Original deployment owners (required if walletAddress is not provided)

        • signerOwnerIndex

          Index of the signer within the current owners set (defaults to 0)

        • walletAddress

          Explicit smart wallet address (skips calculation)

        • nonce

          Optional nonce used during original creation

      Returns Promise<SmartWallet>

      Promise that resolves to the SmartWallet

      Use when you already control a signer. Requires either:

      • walletAddress, or
      • deploymentOwners (+ optional nonce) to derive the address

      Error if neither walletAddress nor deploymentOwners is provided