We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi All,
`const ecc = require('tiny-secp256k1'); console.log(ecc.isPoint) const { BIP32Factory } = require('bip32'); // You must wrap a tiny-secp256k1 compatible implementation const bip32 = BIP32Factory(ecc); const bip39 = require('bip39'); const bitcoin = require('bitcoinjs-lib');
export function generateBitcoinTestAddress(mnemonic) { //const bip32 = BIP32Factory.default(ecc); const seed = bip39.mnemonicToSeedSync(mnemonic); const root = bip32.fromSeed(seed);
const path = "m/49'/1'/0'/0/0"; const child = root.derivePath(path);
const { address } = bitcoin.payments.p2sh({ redeem: bitcoin.payments.p2wpkh({ pubkey: child.publicKey, network: bitcoin.networks.testnet, }), network: bitcoin.networks.testnet, }); console.log(address, "address"); }
export function generateBitcoinMainAddress(mnemonic) { //const bip32 = BIP32Factory.default(ecc); const seed = bip39.mnemonicToSeedSync(mnemonic); const root = bip32.fromSeed(seed);
const path = "m/49'/0'/0'/0"; const child = root.derivePath(path);
const { address } = bitcoin.payments.p2sh({ redeem: bitcoin.payments.p2wpkh({ pubkey: child.publicKey, network: bitcoin.networks.bitcoin, }), network: bitcoin.networks.bitcoin, }); } `
I could not able to bip32 throws following error Unhandled Runtime Error TypeError: ecc.isPoint is not a function
Source Object.testEcc node_modules\bip32\src\testecc.js (5:0) BIP32Factory node_modules\bip32\src\bip32.js (9:0)
` pages\api\Utilities.js (5:14) @ BIP32Factory
3 | const { BIP32Factory } = require('bip32'); 4 | // You must wrap a tiny-secp256k1 compatible implementation
5 | const bip32 = BIP32Factory(ecc); `
The text was updated successfully, but these errors were encountered:
I'm having the same issue
\node_modules\.pnpm\[email protected]\node_modules\bip32\src\testecc.js:6 assert(ecc.isPoint(h('0279be667ef9dcbbac55a06295ce870b07029bfcdb2dce28d959f2815b16f81798'))); ^ TypeError: Cannot read properties of undefined (reading 'isPoint')
EDIT: I fixed using import * as ecc from 'tiny-secp256k1';
Sorry, something went wrong.
No branches or pull requests
Hi All,
`const ecc = require('tiny-secp256k1');
console.log(ecc.isPoint)
const { BIP32Factory } = require('bip32');
// You must wrap a tiny-secp256k1 compatible implementation
const bip32 = BIP32Factory(ecc);
const bip39 = require('bip39');
const bitcoin = require('bitcoinjs-lib');
export function generateBitcoinTestAddress(mnemonic) {
//const bip32 = BIP32Factory.default(ecc);
const seed = bip39.mnemonicToSeedSync(mnemonic);
const root = bip32.fromSeed(seed);
const path = "m/49'/1'/0'/0/0";
const child = root.derivePath(path);
const { address } = bitcoin.payments.p2sh({
redeem: bitcoin.payments.p2wpkh({
pubkey: child.publicKey,
network: bitcoin.networks.testnet,
}),
network: bitcoin.networks.testnet,
});
console.log(address, "address");
}
export function generateBitcoinMainAddress(mnemonic) {
//const bip32 = BIP32Factory.default(ecc);
const seed = bip39.mnemonicToSeedSync(mnemonic);
const root = bip32.fromSeed(seed);
const path = "m/49'/0'/0'/0";
const child = root.derivePath(path);
const { address } = bitcoin.payments.p2sh({
redeem: bitcoin.payments.p2wpkh({
pubkey: child.publicKey,
network: bitcoin.networks.bitcoin,
}),
network: bitcoin.networks.bitcoin,
});
} `
I could not able to bip32 throws following error
Unhandled Runtime Error
TypeError: ecc.isPoint is not a function
Source
Object.testEcc
node_modules\bip32\src\testecc.js (5:0)
BIP32Factory
node_modules\bip32\src\bip32.js (9:0)
`
pages\api\Utilities.js (5:14) @ BIP32Factory
3 | const { BIP32Factory } = require('bip32');
4 | // You must wrap a tiny-secp256k1 compatible implementation
The text was updated successfully, but these errors were encountered: