FuelLabs/fuels-ts · error · FuelError

NOT_IMPLEMENTED

NOT_IMPLEMENTED

Error message

Not implemented.

What it means

Thrown by the abstract Vault base class constructor (wallet-manager/types.ts) when invoked directly. The Vault class defines stub methods that always throw NOT_IMPLEMENTED; concrete vaults (MnemonicVault, PrivateKeyVault) override them. Instantiating Vault itself or calling an un-overridden constructor path triggers this.

Source

Thrown at packages/account/src/wallet-manager/types.ts:38

  secret?: string;
};

export type VaultsState = Array<{
  type: string;
  title?: string;
  data?: VaultConfig;
  vault: Vault;
}>;

export interface WalletManagerState {
  vaults: VaultsState;
}

export abstract class Vault<TOptions = { secret?: string }> {
  static readonly type: string;

  constructor(_options: TOptions) {
    throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');
  }

  serialize(): TOptions {
    throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');
  }

  getAccounts(): WalletManagerAccount[] {
    throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');
  }

  addAccount(): WalletManagerAccount {
    throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');
  }

  exportAccount(_address: Address): string {
    throw new FuelError(ErrorCode.NOT_IMPLEMENTED, 'Not implemented.');
  }

View on GitHub (pinned to b3f37c91ac)

Solutions

  1. Use a concrete vault: new MnemonicVault(...) or new PrivateKeyVault(...).
  2. If writing a custom vault, implement the constructor to set up state and NOT call super() in a way that reaches the throwing body — or restructure so the base constructor does not throw.
  3. Do not instantiate the Vault base class directly.

Example fix

// before
const vault = new Vault({ secret: '...' });
// after
const vault = new MnemonicVault({ secret: '...' });
Defensive patterns

Strategy: type-guard

Type guard

import { MnemonicVault, PrivateKeyVault } from '@fuel-ts/account/wallet-manager';
function isConcreteVault(v: unknown): v is MnemonicVault | PrivateKeyVault {
  return v instanceof MnemonicVault || v instanceof PrivateKeyVault;
}

Prevention

When it happens

Trigger: Constructing `new Vault(options)` directly, or a custom subclass that extends Vault without supplying its own constructor implementation that avoids falling through to the base. The base constructor unconditionally throws.

Common situations: Creating a custom vault type and forgetting to override the constructor; importing Vault and instantiating it by mistake instead of MnemonicVault/PrivateKeyVault; TypeScript allowing `new Vault()` because the class isn't declared abstract.

Related errors


AI-assisted analysis of FuelLabs/fuels-ts@b3f37c91ac (2026-08-12). Data as JSON: /api/errors/e3f3a4f6b96dcf14. Report an issue: GitHub.