0.0.40 • Published 6 years ago
web3override v0.0.40
bitcoin.js
- extendbitcoinjs-lib
with keychain related methodsprepareTx
,buildTxKeychain
keychain.js
- Keychain class with ws connection initializationindex.js
- overrideweb3.eth.accounts.signTransaction
methodtest.js
- example usage together (keychain
+web3
)
Usage
- Sign ethereum transaction
import { web3Override, Keychain } from 'web3override'
// create new key in Keychain
const keyInstance = await Keychain.create();
const data = await keyInstance.selectKey();
const key = data.result;
await keyInstance.term();
web3.eth.accounts.signTransaction = web3Override(web3).signTransaction;
// now we use web3 with keychain
await web3.eth.accounts.signTransaction(transactionParams, key); // overriden web3 function usage
- Sign & build ready for broadcast bitcoin transaction
// import library
import { bitcoin, Keychain } from 'web3override';
// tx - bitcoin.TransactionBuilder instance with inputs & outputs
const keyInstance = await Keychain.create();
const data = await keyInstance.selectKey();
const publicKey = data.result;
tx.inputs.forEach((input, index) => {
tx.prepareTx(index, publicKey)
});
const txRawHex = await tx.buildTxKeychain(keyInstance, publicKey);
Run tests
npm run test
Add key to your key_data
:
keyname: test1@76de427d42c38be4
password: qwe
TODO bitcoin tests
0.0.40
6 years ago
0.0.39
6 years ago
0.0.38
6 years ago
0.0.37
6 years ago
0.0.36
6 years ago
0.0.34
6 years ago
0.0.33
6 years ago
0.0.32
6 years ago
0.0.30
6 years ago
0.0.29
6 years ago
0.0.28
6 years ago
0.0.26
6 years ago
0.0.25
6 years ago
0.0.24
6 years ago
0.0.23
6 years ago
0.0.21
7 years ago
0.0.20
7 years ago
0.0.19
7 years ago
0.0.18
7 years ago
0.0.17
7 years ago
0.0.16
7 years ago
0.0.15
7 years ago
0.0.14
7 years ago
0.0.13
7 years ago
0.0.12
7 years ago
0.0.11
7 years ago
0.0.10
7 years ago
0.0.9
7 years ago
0.0.8
7 years ago
0.0.7
7 years ago
0.0.6
7 years ago
0.0.5
7 years ago
0.0.4
7 years ago
0.0.3
7 years ago
0.0.2
7 years ago
0.0.1
7 years ago