Skip to content

Commit

Permalink
Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
gruve-p committed Jan 26, 2024
1 parent 98869d1 commit cfb2f71
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 12 deletions.
12 changes: 6 additions & 6 deletions src/bip32.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
exports.BIP32Factory = void 0;
const crypto = require("./crypto");
const testecc_1 = require("./testecc");
const _bs58check = require('bs58grscheck');
const _bs58grscheck = require('bs58grscheck');
const typeforce = require('typeforce');
const wif = require('wifgrs');
const bs58check = {
encode: (data) => _bs58check.encode(Uint8Array.from(data)),
decode: (str) => Buffer.from(_bs58check.decode(str)),
const bs58grscheck = {
encode: (data) => _bs58grscheck.encode(Uint8Array.from(data)),
decode: (str) => Buffer.from(_bs58grscheck.decode(str)),
};
function BIP32Factory(ecc) {
(0, testecc_1.testEcc)(ecc);
Expand Down Expand Up @@ -158,7 +158,7 @@ function BIP32Factory(ecc) {
// X9.62 encoding for public keys
this.publicKey.copy(buffer, 45);
}
return bs58check.encode(buffer);
return bs58grscheck.encode(buffer);
}
toWIF() {
if (!this.privateKey)
Expand Down Expand Up @@ -278,7 +278,7 @@ function BIP32Factory(ecc) {
}
}
function fromBase58(inString, network) {
const buffer = bs58check.decode(inString);
const buffer = bs58grscheck.decode(inString);
if (buffer.length !== 78)
throw new TypeError('Invalid buffer length');
network = network || BITCOIN;
Expand Down
12 changes: 6 additions & 6 deletions ts-src/bip32.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import * as crypto from './crypto';
import { testEcc } from './testecc';
const _bs58check = require('bs58grscheck');
const _bs58grscheck = require('bs58grscheck');
const typeforce = require('typeforce');
const wif = require('wifgrs');
const bs58check = {
encode: (data: Buffer): string => _bs58check.encode(Uint8Array.from(data)),
decode: (str: string): Buffer => Buffer.from(_bs58check.decode(str)),
const bs58grscheck = {
encode: (data: Buffer): string => _bs58grscheck.encode(Uint8Array.from(data)),
decode: (str: string): Buffer => Buffer.from(_bs58grscheck.decode(str)),
};

interface Network {
Expand Down Expand Up @@ -278,7 +278,7 @@ export function BIP32Factory(ecc: TinySecp256k1Interface): BIP32API {
this.publicKey.copy(buffer, 45);
}

return bs58check.encode(buffer);
return bs58grscheck.encode(buffer);
}

toWIF(): string {
Expand Down Expand Up @@ -432,7 +432,7 @@ export function BIP32Factory(ecc: TinySecp256k1Interface): BIP32API {
}

function fromBase58(inString: string, network?: Network): BIP32Interface {
const buffer = bs58check.decode(inString);
const buffer = bs58grscheck.decode(inString);
if (buffer.length !== 78) throw new TypeError('Invalid buffer length');
network = network || BITCOIN;

Expand Down

0 comments on commit cfb2f71

Please sign in to comment.