{"record":{"id":"51b47d914fc44d75","repo":"FuelLabs/fuels-ts","slug":"wallet-manager-error-51b47d","errorCode":"WALLET_MANAGER_ERROR","errorMessage":"No private key found for address '${address}'.","messagePattern":"No private key found for address '(.+?)'\\.","errorType":"exception","errorClass":"FuelError","httpStatus":null,"severity":"error","filePath":"packages/account/src/wallet-manager/vaults/privatekey-vault.ts","lineNumber":64,"sourceCode":"    return this.#privateKeys.map((pk) => this.getPublicAccount(pk));\n  }\n\n  addAccount() {\n    const wallet = Wallet.generate();\n\n    this.#privateKeys.push(wallet.privateKey);\n\n    return this.getPublicAccount(wallet.privateKey);\n  }\n\n  exportAccount(address: AddressInput): string {\n    const ownerAddress = new Address(address);\n    const privateKey = this.#privateKeys.find((pk) =>\n      Wallet.fromPrivateKey(pk).address.equals(ownerAddress)\n    );\n\n    if (!privateKey) {\n      throw new FuelError(\n        ErrorCode.WALLET_MANAGER_ERROR,\n        `No private key found for address '${address}'.`\n      );\n    }\n\n    return privateKey;\n  }\n\n  getWallet(address: string | Address): WalletUnlocked {\n    const privateKey = this.exportAccount(address);\n    return Wallet.fromPrivateKey(privateKey);\n  }\n}\n","sourceCodeStart":46,"sourceCodeEnd":78,"githubUrl":"https://github.com/FuelLabs/fuels-ts/blob/b3f37c91aca4aa9d5e4c0d3967f66237190826ea/packages/account/src/wallet-manager/vaults/privatekey-vault.ts#L46-L78","documentation":"Thrown by PrivateKeyVault.exportAccount() when none of the vault's stored private keys derives to the requested address. The vault holds an explicit list of private keys; if the address was never added (or its key was removed), export fails with WALLET_MANAGER_ERROR.","triggerScenarios":"Calling privateKeyVault.exportAccount(address) / walletManager.exportWallet(address) with an address not corresponding to any stored key. The find() over this.#privateKeys returns undefined and the throw fires.","commonSituations":"Address came from a mnemonic-derived wallet but the vault only stores raw keys; the key was removed during state migration; deserialized vault lost its accounts array; address format/casing differences in storage.","solutions":["Confirm the address was added via PrivateKeyVault (constructor secret/accounts or addAccount()).","If the address is mnemonic-derived, use MnemonicVault instead.","Inspect the serialized vault state to verify the accounts/privateKeys list is intact.","Re-import the private key for the address using addAccount() or the constructor."],"exampleFix":"// before\nconst pk = pkVault.exportAccount(unknownAddress);\n// after\nconst accounts = pkVault.getAccounts();\nif (!accounts.some(a => a.address.equals(unknownAddress))) {\n  pkVault.addAccount(); // or import the known key\n}","handlingStrategy":"validation","validationCode":"const accounts = pkVault.getAccounts();\nif (!accounts.some(a => a.address.equals(new Address(target)))) {\n  throw new Error('Address not present in private-key vault');\n}","typeGuard":"const vaultHasKey = (v: PrivateKeyVault, addr: AddressInput): boolean => v.getAccounts().some(a => a.address.equals(new Address(addr)));","tryCatchPattern":null,"preventionTips":["Use MnemonicVault for mnemonic-derived addresses.","Validate serialized vault state contains the expected accounts.","Check getAccounts() before calling exportAccount."],"tags":["wallet-manager","private-key","vault","export","account"],"backgroundTag":null,"analyzedSha":"b3f37c91aca4aa9d5e4c0d3967f66237190826ea","analyzedAt":"2026-08-12T20:30:56.448Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}