Nintondo / browser-hdkey

MIT License
1 stars 2 forks source link

Buffer is not defined #1

Closed macterra closed 2 months ago

macterra commented 3 months ago

What's the work around?

ReferenceError: Buffer is not defined
    at hdkey.js:7:23
macterra commented 3 months ago

It works when I add the import to a local copy of the source:

import { Buffer } from 'buffer';
const MASTER_SECRET = Buffer.from("Bitcoin seed", "utf8");
kieled commented 2 months ago

Actually we use esbuild and this package is used in an extension that includes all the necessary configuration to prevent errors like those that occur in your environment. You can find this configuration here: https://github.com/Nintondo/extension/blob/main/build.ts