Registry /
storage / fabric-wallet-migration
Install & Compatibility
Where this runs
No compatibility data collected yet for this library.
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
* as WalletMigration
✓ import * as WalletMigration from 'fabric-wallet-migration'
✗ const WalletMigration = require('fabric-wallet-migration')
Library is ESM-only; no CommonJS support.
wallets
✓ import { wallets } from 'fabric-wallet-migration'
✗ import { wallets } from 'fabric-wallet-migration/src/index.js'
wallets is a named export; don't import from internal paths.
newFileSystemWalletStoreV1
✓ import { newFileSystemWalletStoreV1 } from 'fabric-wallet-migration'
✗ import { newFileSystemWalletStoreV1 } from 'fabric-wallet-migration/lib/fsWalletStore'
This is a named export at the package root.
Migrates all identities from a v1.4 wallet directory to a v2 wallet directory using fabric-wallet-migration and fabric-network.
import * as WalletMigration from 'fabric-wallet-migration';
import { Wallet, Wallets } from 'fabric-network';
async function migrate(oldDir, newDir) {
const store = await WalletMigration.newFileSystemWalletStoreV1(oldDir);
const oldWallet = new Wallet(store);
const newWallet = await Wallets.newFileSystemWallet(newDir);
const labels = await oldWallet.list();
for (const label of labels) {
const identity = await oldWallet.get(label);
if (identity) await newWallet.put(label, identity);
}
}
Errors
Common errors & fixes
Error: Cannot find module 'fabric-network'
Missing peer dependency fabric-network.
fixnpm install fabric-network@^2.0.0
TypeError: Cannot read properties of undefined (reading 'identity')
Using Gateway wallet entry incorrectly; entry may be undefined.
fixCheck if entry is defined before accessing properties.
Error [ERR_REQUIRE_ESM]: require() of ES Module not supported
Using CommonJS require() with ESM-only package.
fixUse import syntax or set type: module in package.json.
Audit
Dependencies
fabric-networkoptionalProvides Wallet class used for migration (v2 SDK)
@hyperledger/fabric-gatewayoptionalRequired for using Gateway wallet API