Expose funded transaction ID in findOrCreateAccount

This commit is contained in:
Snazzah 2020-08-12 22:50:26 -05:00
parent 98a53aaad0
commit 5d3957f243
No known key found for this signature in database
GPG key ID: 5E71D54F3D86282E

View file

@ -210,7 +210,8 @@ Util.LBRY = {
if (create) { if (create) {
const newAccount = await Util.LBRY.createAccount(client, discordID); const newAccount = await Util.LBRY.createAccount(client, discordID);
return { return {
accountID: newAccount.result.id, accountID: newAccount.account.result.id,
txID: newAccount.transaction.result.txid,
newAccount: true newAccount: true
}; };
} else return { accountID: null }; } else return { accountID: null };
@ -231,7 +232,7 @@ Util.LBRY = {
const response = await client.lbry.fundAccount({ to: account.result.id, amount: config.startingBalance }); const response = await client.lbry.fundAccount({ to: account.result.id, amount: config.startingBalance });
const transaction = await response.json(); const transaction = await response.json();
console.info('Funded account', account.result.id, transaction.result.txid); console.info('Funded account', account.result.id, transaction.result.txid);
return account; return { account, transaction };
}, },
ensureDecimal(str) { ensureDecimal(str) {
const num = parseFloat(str); const num = parseFloat(str);