This file contains hidden or 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
import { RPC_ERRORS, HWI_ERRORS } from "@app/constants" | |
const bitcoinRpcErrorCodeToConstant = { | |
"-32600": RPC_ERRORS.INVALID_REQUEST, | |
"-32601": RPC_ERRORS.METHOD_NOT_FOUND, | |
"-32602": RPC_ERRORS.INVALID_PARAMS, | |
"-32603": RPC_ERRORS.INTERNAL_ERROR, | |
"-32700": RPC_ERRORS.PARSE_ERROR, | |
"-1": RPC_ERRORS.MISC_ERROR, | |
"-3": RPC_ERRORS.TYPE_ERROR, |
This file contains hidden or 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
Remember how we've seen some weirdness in the output of listtransactions ? | |
If you make one transactions there will be multiple entries in our transaction list? | |
That's because each separate input / output gets a different entry in listtransactions | |
This is one transaction: | |
{ | |
"involvesWatchonly": true, | |
"address": "bcrt1qg9xjv8raj57pynq39hmgswruectr6qzdmeppvtgnnrwjvs4z9hws42jalj", |
This file contains hidden or 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
// Just update for a single network. Maybe they don't want to enable their mainnet RPC, for instance ... | |
function updateBitcoinConfig(config, network) { | |
// Would be better if this required confirmation ... | |
delete config['global']['testnet'] | |
delete config['global']['regtest'] | |
config[network]['server'] = 1 | |
config[network]['disablewallet'] = 0 | |
return config | |
} |
This file has been truncated, but you can view the full file.
This file contains hidden or 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
$ cargo clean | |
$ cargo build -vv | |
Compiling cc v1.0.50 | |
Compiling pkg-config v0.3.17 | |
Running `CARGO_PKG_VERSION_MAJOR=1 CARGO_PKG_HOMEPAGE='https://github.com/alexcrichton/cc-rs' CARGO_PKG_AUTHORS='Alex Crichton <[email protected]>' CARGO_PKG_VERSION_MINOR=0 CARGO_PKG_VERSION_PATCH=50 CARGO_PKG_VERSION_PRE= CARGO_MANIFEST_DIR=/home/justin/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.50 CARGO_PKG_VERSION=1.0.50 LD_LIBRARY_PATH='/home/justin/dev/runlibtor/target/debug/deps:/usr/lib' CARGO_PKG_NAME=cc CARGO=/usr/bin/cargo CARGO_PKG_DESCRIPTION='A build-time dependency for Cargo build scripts to assist in invoking the native | |
C compiler to compile native C code into a static archive to be linked into Rust | |
code. | |
' CARGO_PKG_REPOSITORY='https://github.com/alexcrichton/cc-rs' rustc --crate-name cc --edition=2018 /home/justin/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.50/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata, |
This file contains hidden or 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
$ cargo clean | |
$ cargo build -vv | |
Compiling cc v1.0.50 | |
Compiling pkg-config v0.3.17 | |
Running `CARGO_PKG_VERSION_MAJOR=1 CARGO_PKG_HOMEPAGE='https://github.com/alexcrichton/cc-rs' CARGO_PKG_AUTHORS='Alex Crichton <[email protected]>' CARGO_PKG_VERSION_MINOR=0 CARGO_PKG_VERSION_PATCH=50 CARGO_PKG_VERSION_PRE= CARGO_MANIFEST_DIR=/home/justin/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.50 CARGO_PKG_VERSION=1.0.50 LD_LIBRARY_PATH='/home/justin/dev/runlibtor/target/debug/deps:/usr/lib' CARGO_PKG_NAME=cc CARGO=/usr/bin/cargo CARGO_PKG_DESCRIPTION='A build-time dependency for Cargo build scripts to assist in invoking the native | |
C compiler to compile native C code into a static archive to be linked into Rust | |
code. | |
' CARGO_PKG_REPOSITORY='https://github.com/alexcrichton/cc-rs' rustc --crate-name cc --edition=2018 /home/justin/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.50/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata, |
This file contains hidden or 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
$ cargo clean | |
$ cargo build -vv | |
Compiling cc v1.0.50 | |
Compiling pkg-config v0.3.17 | |
Running `CARGO_PKG_VERSION_MAJOR=1 CARGO_PKG_HOMEPAGE='https://github.com/alexcrichton/cc-rs' CARGO_PKG_AUTHORS='Alex Crichton <[email protected]>' CARGO_PKG_VERSION_MINOR=0 CARGO_PKG_VERSION_PATCH=50 CARGO_PKG_VERSION_PRE= CARGO_MANIFEST_DIR=/home/justin/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.50 CARGO_PKG_VERSION=1.0.50 LD_LIBRARY_PATH='/home/justin/dev/runlibtor/target/debug/deps:/usr/lib' CARGO_PKG_NAME=cc CARGO=/usr/bin/cargo CARGO_PKG_DESCRIPTION='A build-time dependency for Cargo build scripts to assist in invoking the native | |
C compiler to compile native C code into a static archive to be linked into Rust | |
code. | |
' CARGO_PKG_REPOSITORY='https://github.com/alexcrichton/cc-rs' rustc --crate-name cc --edition=2018 /home/justin/.cargo/registry/src/github.com-1ecc6299db9ec823/cc-1.0.50/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata, |
This file contains hidden or 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 spawnCkcc = require('./src/utils/ckcc.js') | |
const spawnHwi = require('./src/utils/hwi.js') | |
spawnHwi(['--fingerprint=f25d9737', 'getxpub', "m/0"]) | |
.then(r => console.log('hwi success', r)) | |
.catch(e => console.log('hwi error', e)) | |
spawnCkcc(['xpub', "m/0"]) | |
.then(r => console.log('ckcc success', r)) | |
.catch(e => console.log('ckcc error', e)) | |
spawnHwi(['--fingerprint=f25d9737', 'getxpub', "m/0"]) |
This file contains hidden or 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
// Available variables: | |
// - Machine | |
// - interpret | |
// - assign | |
// - send | |
// - sendParent | |
// - spawn | |
// - raise | |
// - actions |
This file contains hidden or 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
``` | |
$ npm run test | |
[email protected] test /home/justin/dev/junctionwallet/web | |
mocha --require ./test_init.js src/**/*.test.js | |
This file contains hidden or 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
``` | |
$ tree | |
. | |
├── index.json | |
├── opam | |
│ ├── astring.0.8.3 | |
│ │ └── opam | |
│ ├── atd.2.0.0 | |
│ │ └── opam | |
│ ├── atdgen.2.0.0 |