Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions packages/hdwallet-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"@shapeshiftoss/bitcoinjs-lib": "7.0.0-shapeshift.2",
"@shapeshiftoss/proto-tx-builder": "0.10.0",
"@solana/web3.js": "1.95.8",
"bs58check": "^4.0.0",
"eip-712": "^1.0.0",
"ethers": "5.7.2",
"eventemitter2": "^5.0.1",
Expand Down
6 changes: 3 additions & 3 deletions packages/hdwallet-core/src/utxoUtils.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { decode, encode } from "bs58check";
import bs58check from "bs58check";

import { BTCInputScriptType } from "./bitcoin";

Expand Down Expand Up @@ -70,15 +70,15 @@ export function convertXpubVersion(xpub: string, accountType: UtxoAccountType |
if (!accountType) return xpub;
if (!convertVersions.includes(xpub.substring(0, 4))) return xpub;

const payload = decode(xpub);
const payload = Buffer.from(bs58check.decode(xpub));
const version = payload.subarray(0, 4);
const desiredVersion = accountTypeToVersion(coin, accountType);

if (version.compare(desiredVersion) !== 0) {
// Get the key without the version code at the front
const key = payload.subarray(4);

return encode(Buffer.concat([desiredVersion, key]));
return bs58check.encode(Buffer.concat([desiredVersion, key]));
}

return xpub;
Expand Down
2 changes: 1 addition & 1 deletion packages/hdwallet-ledger/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"base64-js": "^1.5.1",
"bchaddrjs": "^0.4.4",
"bitcoinjs-message": "^2.0.0",
"bs58check": "2.1.2",
"bs58check": "^4.0.0",
"ethereumjs-tx": "1.3.7",
"ethereumjs-util": "^6.1.0",
"ethers": "5.7.2",
Expand Down
2 changes: 1 addition & 1 deletion packages/hdwallet-ledger/src/solana.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import * as core from "@shapeshiftoss/hdwallet-core";
import { PublicKey } from "@solana/web3.js";
import * as bs58 from "bs58";
import bs58 from "bs58";

import { LedgerTransport } from "./transport";
import { handleError } from "./utils";
Expand Down
1 change: 1 addition & 0 deletions packages/hdwallet-native/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
"bip32": "^2.0.5",
"bip39": "^3.0.2",
"bnb-javascript-sdk-nobroadcast": "2.16.15",
"bs58check": "^4.0.0",
"crypto-js": "^4.0.0",
"ecpair": "^3.0.0-rc.0",
"eip-712": "^1.0.0",
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { keccak256 } from "@ethersproject/keccak256";
import * as core from "@shapeshiftoss/hdwallet-core";
import * as bs58check from "bs58check";
import bs58check from "bs58check";

import { Isolation } from "../..";
import { SecP256K1 } from "../core";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { toArrayBuffer } from "@shapeshiftoss/hdwallet-core";
import * as bs58check from "bs58check";
import bs58check from "bs58check";

import * as BIP32 from "../../core/bip32";
import * as BIP39 from "../../core/bip39";
Expand Down