{"id":47543,"library":"fabric-wallet-migration","title":"fabric-wallet-migration","description":"Library for migrating Hyperledger Fabric wallets from version 1.4 to version 2.0, published as v0.3.0. It provides a custom WalletStore for the Fabric v2 Node SDK (fabric-network v2) to read v1.4 wallets, and a wallet API for the Fabric Gateway client API. Unlike manual migration scripts, it supports both SDK-based and Gateway-based consumption. Ships TypeScript types.","status":"active","version":"0.3.0","language":"javascript","source_language":"en","source_url":"https://github.com/bestbeforetoday/fabric-wallet-migration","tags":["javascript","typescript"],"install":[{"cmd":"npm install fabric-wallet-migration","lang":"bash","label":"npm"},{"cmd":"yarn add fabric-wallet-migration","lang":"bash","label":"yarn"},{"cmd":"pnpm add fabric-wallet-migration","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Provides Wallet class used for migration (v2 SDK)","package":"fabric-network","optional":true},{"reason":"Required for using Gateway wallet API","package":"@hyperledger/fabric-gateway","optional":true}],"imports":[{"note":"Library is ESM-only; no CommonJS support.","wrong":"const WalletMigration = require('fabric-wallet-migration')","symbol":"* as WalletMigration","correct":"import * as WalletMigration from 'fabric-wallet-migration'"},{"note":"wallets is a named export; don't import from internal paths.","wrong":"import { wallets } from 'fabric-wallet-migration/src/index.js'","symbol":"wallets","correct":"import { wallets } from 'fabric-wallet-migration'"},{"note":"This is a named export at the package root.","wrong":"import { newFileSystemWalletStoreV1 } from 'fabric-wallet-migration/lib/fsWalletStore'","symbol":"newFileSystemWalletStoreV1","correct":"import { newFileSystemWalletStoreV1 } from 'fabric-wallet-migration'"}],"quickstart":{"code":"import * as WalletMigration from 'fabric-wallet-migration';\nimport { Wallet, Wallets } from 'fabric-network';\n\nasync function migrate(oldDir, newDir) {\n    const store = await WalletMigration.newFileSystemWalletStoreV1(oldDir);\n    const oldWallet = new Wallet(store);\n    const newWallet = await Wallets.newFileSystemWallet(newDir);\n    const labels = await oldWallet.list();\n    for (const label of labels) {\n        const identity = await oldWallet.get(label);\n        if (identity) await newWallet.put(label, identity);\n    }\n}\n","lang":"typescript","description":"Migrates all identities from a v1.4 wallet directory to a v2 wallet directory using fabric-wallet-migration and fabric-network."},"warnings":[{"fix":"Use Node.js 20 or later.","message":"Requires Node.js >=20","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Use import syntax instead of require().","message":"ESM-only; no CJS support","severity":"breaking","affected_versions":">=0.3.0"},{"fix":"Instantiate Wallet with the store.","message":"newFileSystemWalletStoreV1 returns a store object, not a wallet. Must wrap in new Wallet(store)","severity":"gotcha","affected_versions":">=0.3.0"},{"fix":"Consider using the wallets module for Gateway integration.","message":"Fabric Network SDK usage is being replaced by Fabric Gateway client API","severity":"deprecated","affected_versions":">=0.3.0"},{"fix":"Use signers.newPrivateKeySigner(entry.privateKey) correctly.","message":"Gateway wallet entry has identity and privateKey fields; privateKey is a CryptoKey, not a string","severity":"gotcha","affected_versions":">=0.3.0"}],"env_vars":null,"search_vec":"'1.4':13 '2.0':16 'api':42,48 'base':58,62 'client':47 'consumpt':63 'custom':23 'fabric':2,9,27,32,45 'fabric-network':31 'fabric-wallet-migr':1 'gateway':46,61 'gateway-bas':60 'hyperledg':8 'javascript':67 'librari':5 'manual':50 'migrat':4,7,51 'network':33 'node':29 'provid':21 'publish':17 'read':36 'script':52 'sdk':30,57 'sdk-base':56 'ship':64 'support':54 'type':66 'typescript':65,68 'unlik':49 'v0.3.0':19 'v1.4':37 'v2':28,34 'version':12,15 'wallet':3,10,38,41 'walletstor':24","created_at":"2026-06-07T16:52:03.051082+00:00","updated_at":"2026-06-07T16:52:03.051082+00:00","problems":[{"fix":"npm install fabric-network@^2.0.0","cause":"Missing peer dependency fabric-network.","error":"Error: Cannot find module 'fabric-network'"},{"fix":"Check if entry is defined before accessing properties.","cause":"Using Gateway wallet entry incorrectly; entry may be undefined.","error":"TypeError: Cannot read properties of undefined (reading 'identity')"},{"fix":"Use import syntax or set type: module in package.json.","cause":"Using CommonJS require() with ESM-only package.","error":"Error [ERR_REQUIRE_ESM]: require() of ES Module not supported"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://github.com/bestbeforetoday/fabric-wallet-migration#readme","github":"https://github.com/bestbeforetoday/fabric-wallet-migration","docs":null,"changelog":null,"pypi":null,"npm":"fabric-wallet-migration","openapi_spec":null,"status_page":null,"smithery":null,"categories":["storage"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}