Created
December 29, 2023 01:01
-
-
Save WietseWind/adc5753e115a1238e31de58202fd1172 to your computer and use it in GitHub Desktop.
Run browserified cjs in NodeJS using sandbox vm (sample with `xrpl-accountlib`)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs') | |
const vm = require('vm') | |
const sandbox = {} | |
// https://cdn.jsdelivr.net/npm/xrpl-accountlib/dist/browser.min.js | |
vm.runInNewContext(fs.readFileSync('browser.min.js'), sandbox) | |
var AccountLib = sandbox.require('xrpl-accountlib') | |
var Derived = AccountLib.derive.familySeed("sni2chTNGKBHkULN8zcLwELNTUMXS") | |
console.log(Derived.address) | |
console.log(Derived.keypair.privateKey) | |
console.log(Derived) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment