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
/// impl bip174 by rust-bitcoin crate | |
/// Creates the PSBT, in BIP174 parlance this is the 'Creator'. | |
/// reference | |
/// https://crates.io/crates/bitcoin | |
/// https://github.com/bitcoin/bips/blob/master/bip-0174.mediawiki | |
use third_party::bitcoin::psbt::{Psbt}; | |
use third_party::bitcoin::{Amount, OutPoint, ScriptBuf, Sequence, Transaction, Txid, TxIn, TxOut, Witness}; | |
use third_party::bitcoin_hashes::hex::FromHex; | |
use third_party::{hex}; |
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
/// eip155 https://github.com/ethereum/EIPs/blob/master/EIPS/eip-155.md | |
/// use ethers v5.7 | |
const ethers = require('ethers') | |
const CHAIN_ID = 1 | |
async function main() { | |
// private key | |
let private_key = | |
'0x4646464646464646464646464646464646464646464646464646464646464646' | |
let wallet = new ethers.Wallet(private_key) |