> ## Documentation Index
> Fetch the complete documentation index at: https://docs.spark.money/llms.txt
> Use this file to discover all available pages before exploring further.

# initialize

> Create or restore an IssuerSparkWallet instance from mnemonic or seed.

Creates and initializes a new `IssuerSparkWallet` instance.

## Method Signature

```typescript theme={null}
interface IssuerSparkWalletProps {
  mnemonicOrSeed?: Uint8Array | string;
  accountNumber?: number;
  signer?: SparkSigner;
  options?: ConfigOptions;
}

static async initialize(props: IssuerSparkWalletProps): Promise<{
  wallet: IssuerSparkWallet;
  mnemonic?: string;
}>
```

## Parameters

<ResponseField name="mnemonicOrSeed" type="Uint8Array | string">
  BIP-39 mnemonic phrase or raw seed
</ResponseField>

<ResponseField name="accountNumber" type="number">
  Number used to generate multiple identity keys from the same mnemonic
</ResponseField>

<ResponseField name="signer" type="SparkSigner">
  Custom signer implementation for advanced use cases
</ResponseField>

<ResponseField name="options" type="ConfigOptions">
  Wallet configuration options including network selection
</ResponseField>

## Returns

<ResponseField name="wallet" type="IssuerSparkWallet" required>
  The initialized IssuerSparkWallet instance
</ResponseField>

<ResponseField name="mnemonic" type="string">
  The mnemonic if one was generated (undefined for raw seed)
</ResponseField>

## Example

<CodeGroup>
  ```typescript Create New Wallet theme={null}
  import { IssuerSparkWallet } from "@buildonspark/issuer-sdk";

  // Create a new issuer wallet
  const { wallet, mnemonic } = await IssuerSparkWallet.initialize({
    options: { network: "REGTEST" } // or "MAINNET"
  });

  console.log("Issuer wallet initialized:", wallet);
  console.log("Generated mnemonic:", mnemonic);
  ```

  ```typescript Import Existing Wallet theme={null}
  import { IssuerSparkWallet } from "@buildonspark/issuer-sdk";

  // Import issuer wallet from existing mnemonic
  const { wallet } = await IssuerSparkWallet.initialize({
    mnemonicOrSeed: "abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon abandon about",
    accountNumber: 0, // Optional: specify account index
    options: { network: "REGTEST" }
  });

  console.log("Issuer wallet restored from mnemonic");
  ```
</CodeGroup>
