Merge pull request #1108 from chaotixkilla/fix-xmr-getstatus-interface

Fix XMR interfaces
This commit is contained in:
Rafael Taranto 2022-02-14 19:04:55 +00:00 committed by GitHub
commit 749cfbc1dd

View file

@ -94,7 +94,7 @@ function accountBalance (cryptoCode) {
.catch(err => handleError(err)) .catch(err => handleError(err))
} }
function balance (account, cryptoCode) { function balance (account, cryptoCode, settings, operatorId) {
return accountBalance(cryptoCode) return accountBalance(cryptoCode)
} }
@ -121,7 +121,7 @@ function sendCoins (account, tx, settings, operatorId, feeMultiplier) {
.catch(err => handleError(err)) .catch(err => handleError(err))
} }
function newAddress (account, info) { function newAddress (account, info, tx, settings, operatorId) {
return checkCryptoCode(info.cryptoCode) return checkCryptoCode(info.cryptoCode)
.then(() => fetch('create_address', { account_index: 0 })) .then(() => fetch('create_address', { account_index: 0 }))
.then(res => res.address) .then(res => res.address)
@ -149,7 +149,8 @@ function pendingBalance (address, cryptoCode) {
.catch(err => handleError(err)) .catch(err => handleError(err))
} }
function getStatus (account, toAddress, requested, cryptoCode) { function getStatus (account, tx, requested, settings, operatorId) {
const { toAddress, cryptoCode } = tx
return checkCryptoCode(cryptoCode) return checkCryptoCode(cryptoCode)
.then(() => refreshWallet()) .then(() => refreshWallet())
.then(() => confirmedBalance(toAddress, cryptoCode)) .then(() => confirmedBalance(toAddress, cryptoCode))
@ -166,7 +167,7 @@ function getStatus (account, toAddress, requested, cryptoCode) {
.catch(err => handleError(err)) .catch(err => handleError(err))
} }
function newFunding (account, cryptoCode) { function newFunding (account, cryptoCode, settings, operatorId) {
return checkCryptoCode(cryptoCode) return checkCryptoCode(cryptoCode)
.then(() => refreshWallet()) .then(() => refreshWallet())
.then(() => fetch('get_balance', { account_index: 0, address_indices: [0] })) .then(() => fetch('get_balance', { account_index: 0, address_indices: [0] }))
@ -182,7 +183,7 @@ function newFunding (account, cryptoCode) {
.catch(err => handleError(err)) .catch(err => handleError(err))
} }
function cryptoNetwork (account, cryptoCode) { function cryptoNetwork (account, cryptoCode, settings, operatorId) {
return checkCryptoCode(cryptoCode) return checkCryptoCode(cryptoCode)
.then(() => { .then(() => {
switch(parseInt(rpcConfig().port, 10)) { switch(parseInt(rpcConfig().port, 10)) {