@secux/app-dgb
SecuX Hardware Wallet DGB API
Usage
import { SecuxDGB } from "@secux/app-dgb";
First, create instance of ITransport.
Examples
-
Get address by BIP32 path.
- native segwit address (default script: P2WPKH)
const path = "m/84'/20'/0'/0/0";
const address = await deivce.getAddress(path);
- segwit address (default script: P2SH_P2WPKH)
const address = await deivce.getAddress("m/49'/20'/0'/0/0");
- legacy address (default script: P2PKH)
const address = await deivce.getAddress("m/44'/20'/0'/0/0");
-
Sign transaction (native segwit has not supported yet).
const inputs = [
{
hash: "4632c6b99925ebae5b806f5956d2d730415fe0c8c7edbfa2edea22e99a8f9f56",
vout: 0,
satoshis: 100000000,
path: "m/44'/20'/0'/0/0",
},
{
hash: "18638cd984ab631ad7dafc5a701bec3ffa9b26bed5855eee4598d53a2ecad870",
vout: 0,
satoshis: 50000000,
path: "m/49'/20'/0'/0/0",
}
];
const to = {
address: "D7TwNix9ziu8k16gAcqkyKWvXhXg7tkdAC",
satoshis: 70000000
};
const utxo = {
path: `m/44'/20'/0'/0/11`,
satoshis: 77777777,
}
const { raw_tx } = await device.sign(inputs, { to, utxo });
API doc
Similar to @secux/app-btc.