Fix typos
This commit is contained in:
parent
9ddda9b565
commit
004285e67f
@ -61,10 +61,10 @@ function createSignedTransaction(bitcoreLib, privateKeyString, sourceAddress, de
|
|||||||
* Create a UTXO.
|
* Create a UTXO.
|
||||||
*
|
*
|
||||||
* @param {type} sourceAddress Sender's wallet address
|
* @param {type} sourceAddress Sender's wallet address
|
||||||
* @param {type} txHash From UXTO (unspent output)
|
* @param {type} txHash From UTXO (unspent output)
|
||||||
* @param {type} txOutputIndex From UXTO (unspent output)
|
* @param {type} txOutputIndex From UTXO (unspent output)
|
||||||
* @param {type} script From UXTO (unspent output)
|
* @param {type} script From UTXO (unspent output)
|
||||||
* @param {type} inputSatoshis From UXTO (unspent output)
|
* @param {type} inputSatoshis From UTXO (unspent output)
|
||||||
* @returns {createUtxo.utxo}
|
* @returns {createUtxo.utxo}
|
||||||
*/
|
*/
|
||||||
function createUtxo(sourceAddress, txHash, txOutputIndex, script, inputSatoshis) {
|
function createUtxo(sourceAddress, txHash, txOutputIndex, script, inputSatoshis) {
|
||||||
@ -81,17 +81,17 @@ function createUtxo(sourceAddress, txHash, txOutputIndex, script, inputSatoshis)
|
|||||||
/**
|
/**
|
||||||
* Get unspent outputs for a wallet address.
|
* Get unspent outputs for a wallet address.
|
||||||
* @param {string} walletaddress
|
* @param {string} walletaddress
|
||||||
* @param {function} successCallback Passes object with {uxtos: [{txHash,txOutputIndex,script,value}], currency: "DOGE", label: "Dogecoin"}
|
* @param {function} successCallback Passes object with {utxos: [{txHash,txOutputIndex,script,value}], currency: "DOGE", label: "Dogecoin"}
|
||||||
* @param {function} errorCallback Passes string error message suitable for display
|
* @param {function} errorCallback Passes string error message suitable for display
|
||||||
* @returns {undefined}
|
* @returns {undefined}
|
||||||
*/
|
*/
|
||||||
function getUXTOData(walletaddress, successCallback, errorCallback) {
|
function getUTXOData(walletaddress, successCallback, errorCallback) {
|
||||||
apirequest(SETTINGS.apis.getuxto, {
|
apirequest(SETTINGS.apis.getutxo, {
|
||||||
walletaddress: walletaddress
|
walletaddress: walletaddress
|
||||||
}, function (resp) {
|
}, function (resp) {
|
||||||
if (resp.status == "OK") {
|
if (resp.status == "OK") {
|
||||||
successCallback({
|
successCallback({
|
||||||
uxtos: resp.unspent_outputs,
|
utxos: resp.unspent_outputs,
|
||||||
currency: resp.currency,
|
currency: resp.currency,
|
||||||
label: resp.label
|
label: resp.label
|
||||||
});
|
});
|
||||||
@ -103,26 +103,26 @@ function getUXTOData(walletaddress, successCallback, errorCallback) {
|
|||||||
var error = $.parseJSON(errorData.responseText);
|
var error = $.parseJSON(errorData.responseText);
|
||||||
if (error && typeof error.msg != 'undefined') {
|
if (error && typeof error.msg != 'undefined') {
|
||||||
errorCallback(resp.msg);
|
errorCallback(resp.msg);
|
||||||
sendErrorReport("Crypto", "Couldn't get UXTO data", error.msg);
|
sendErrorReport("Crypto", "Couldn't get UTXO data", error.msg);
|
||||||
} else {
|
} else {
|
||||||
errorCallback("There's a server or network problem. Check your Internet connection or try again later. Your funds are safe.");
|
errorCallback("There's a server or network problem. Check your Internet connection or try again later. Your funds are safe.");
|
||||||
sendErrorReport("Crypto", "Couldn't get UXTO data", "Server/network problem: " + xhr.status + ": " + xhr.statusText);
|
sendErrorReport("Crypto", "Couldn't get UTXO data", "Server/network problem: " + xhr.status + ": " + xhr.statusText);
|
||||||
}
|
}
|
||||||
} catch (ex) {
|
} catch (ex) {
|
||||||
errorCallback("There's a server or network problem. Check your Internet connection or try again later. Your funds are safe.");
|
errorCallback("There's a server or network problem. Check your Internet connection or try again later. Your funds are safe.");
|
||||||
sendErrorReport("Crypto", "Couldn't get UXTO data", "Server/network problem: " + xhr.status + ": " + xhr.statusText);
|
sendErrorReport("Crypto", "Couldn't get UTXO data", "Server/network problem: " + xhr.status + ": " + xhr.statusText);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
function sendCoins(privatekey, fromaddress, toaddress, amount) {
|
function sendCoins(privatekey, fromaddress, toaddress, amount) {
|
||||||
var progressdialog = app.dialog.progress("Querying blockchain...", 25);
|
var progressdialog = app.dialog.progress("Querying blockchain...", 25);
|
||||||
getUXTOData(fromaddress, function (success) {
|
getUTXOData(fromaddress, function (success) {
|
||||||
progressdialog.setProgress(50);
|
progressdialog.setProgress(50);
|
||||||
progressdialog.setText("Creating transaction...");
|
progressdialog.setText("Creating transaction...");
|
||||||
if (success.uxtos.length == 0) {
|
if (success.utxos.length == 0) {
|
||||||
app.dialog.close();
|
app.dialog.close();
|
||||||
app.dialog.alert("Your wallet has no available funds (ZERO_LENGTH_UXTO).", "Error");
|
app.dialog.alert("Your wallet has no available funds (ZERO_LENGTH_UTXO).", "Error");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var utxos = [];
|
var utxos = [];
|
||||||
|
@ -40,7 +40,7 @@ var SETTINGS = {
|
|||||||
getreceipt: "http://localhost/helena.express/apis/account/getreceipt",
|
getreceipt: "http://localhost/helena.express/apis/account/getreceipt",
|
||||||
// Crypto: check balance and send transactions
|
// Crypto: check balance and send transactions
|
||||||
walletbalance: "http://localhost/helena.express/apis/crypto/walletbalance",
|
walletbalance: "http://localhost/helena.express/apis/crypto/walletbalance",
|
||||||
getuxto: "http://localhost/helena.express/apis/crypto/getuxto",
|
getutxo: "http://localhost/helena.express/apis/crypto/getutxo",
|
||||||
broadcasttransaction: "http://localhost/helena.express/apis/crypto/broadcasttransaction"
|
broadcasttransaction: "http://localhost/helena.express/apis/crypto/broadcasttransaction"
|
||||||
},
|
},
|
||||||
stripe_pubkey: "pk_test_51J6qFXCa1Fboir5UzPO3LCiMsVNiFP2lq4wR0dEcjJJVzAaJ3uRggDekZPB3qeYpMD3ayIYHKyD5sSn0IFLlEXMW001LqrvGSH",
|
stripe_pubkey: "pk_test_51J6qFXCa1Fboir5UzPO3LCiMsVNiFP2lq4wR0dEcjJJVzAaJ3uRggDekZPB3qeYpMD3ayIYHKyD5sSn0IFLlEXMW001LqrvGSH",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user