Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create the "Bulk CSV Download" function for the Bulk Wallet #189

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions bitaddress.org.html
Original file line number Diff line number Diff line change
Expand Up @@ -6708,6 +6708,7 @@
<span><label id="bulklabelcompressed" for="bulkcompressed">Compressed addresses?</label> <input type="checkbox" id="bulkcompressed" checked="checked" /></span>
<span><input type="button" id="bulkgenerate" value="Generate" onclick="ninja.wallets.bulkwallet.buildCSV(document.getElementById('bulklimit').value * 1, document.getElementById('bulkstartindex').value * 1, document.getElementById('bulkcompressed').checked, document.getElementById('bulkpassphrase').value);" /> </span>
<span class="print"><input type="button" name="print" id="bulkprint" value="Print" onclick="window.print();" /></span>
<span><input type="button" name="download" id="bulkdownload" value="Download" onclick="ninja.wallets.bulkwallet.download();" /></span>
</div>
<div id="bulkadvancedcommands" class="row extra">
<span><label id="bulklabelencrypt" for="bulkencrypt">BIP38 Encrypt?</label> <input type="checkbox" id="bulkencrypt" onchange="ninja.wallets.bulkwallet.toggleEncrypt(this);" /></span>
Expand Down Expand Up @@ -10049,6 +10050,24 @@
document.getElementById("bulkarea").style.display = "none";
},

// use this function to download the bulk generated addresses
// parametrs:
// returns:
// save the generated addresses as the format of (index,bitcoinAddress,privateKeyWif)
// save as file name "BitcoinKeys.csv"
download: function () {
let csvContent = "data:text/csv;charset=utf-8,";
csvContent += document.getElementById("bulktextarea").value;

var encodedUri = encodeURI(csvContent);
var link = document.createElement("a");
link.setAttribute("href", encodedUri);
link.setAttribute("download", "BitcoinKeys.csv");
document.body.appendChild(link);

link.click();
},

// use this function to bulk generate addresses
// rowLimit: number of Bitcoin Addresses to generate
// startIndex: add this number to the row index for output purposes
Expand Down