-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathwallet-address-sign.js
56 lines (30 loc) · 1.41 KB
/
wallet-address-sign.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
const {
getGeneratedMnemonic,
getWalletFromMnemonic,
getAddressForWallet,
printSignedHex
} = require('./js/counterwallet-mini');
///////////////////////////////////////////////////
// section of the script that is user edited
///////////////////////////////////////////////////
// 1.generate / 2.write mnemonic //////////////////
// first generate your seed here
const my_mnemonic = getGeneratedMnemonic().join(' ');
// then to use the same seed, write your seed below (uncomment the below and comment the above)
// const my_mnemonic = `one two three four five six seven eight nine ten eleven twelve`;
// 3.choose address ///////////////////////////////
// choose from multiple addresses 0, 1, 2, ...
const my_address_index = 0;
// 4.write hex ////////////////////////////////////
// put counterpartylib unsigned tx hex here
const my_tx_hex = "000000000000000000000000000000";
///////////////////////////////////////////////////
///////////////////////////////////////////////////
// no need to edit after here
const my_wallet = getWalletFromMnemonic(my_mnemonic);
const my_address_for_index = getAddressForWallet(my_wallet, my_address_index);
console.log(`Mnemonic: ${my_mnemonic}`);
console.log(`Address ${my_address_index}: ${my_address_for_index}`);
// 6.broadcast 5.signed hex ///////////////////////
// broadcast the signed tx hex printed here
printSignedHex(my_wallet, my_address_index, my_tx_hex);