feat: add digest auth request queueing
This commit is contained in:
parent
3c33695b9d
commit
f660d60e2d
2 changed files with 115 additions and 13 deletions
|
|
@ -15,7 +15,6 @@ const blockchainDir = options.blockchainDir
|
|||
const cryptoRec = utils.getCryptoCurrency(COINS.XMR)
|
||||
const configPath = utils.configPath(cryptoRec, blockchainDir)
|
||||
const walletDir = path.resolve(utils.cryptoDir(cryptoRec, blockchainDir), 'wallets')
|
||||
const unitScale = cryptoRec.unitScale
|
||||
|
||||
function rpcConfig () {
|
||||
try {
|
||||
|
|
@ -31,7 +30,7 @@ function rpcConfig () {
|
|||
}
|
||||
|
||||
function fetch (method, params) {
|
||||
return jsonRpc.fetchDigest(rpcConfig(), method, params)
|
||||
return jsonRpc.createDigestRequest(rpcConfig(), method, params)
|
||||
}
|
||||
|
||||
function handleError (error, method) {
|
||||
|
|
@ -151,16 +150,11 @@ function getStatus (account, tx, requested, settings, operatorId) {
|
|||
function newFunding (account, cryptoCode, settings, operatorId) {
|
||||
return checkCryptoCode(cryptoCode)
|
||||
.then(() => refreshWallet())
|
||||
.then(() => fetch('get_balance', { account_index: 0, address_indices: [0] }))
|
||||
.then(balanceRes => Promise.all([
|
||||
balanceRes,
|
||||
fetch('create_address', { account_index: 0 })
|
||||
]))
|
||||
.then(([balanceRes, addressRes]) => Promise.all([
|
||||
balanceRes,
|
||||
addressRes,
|
||||
fetch('get_transfers', { pool: true, account_index: 0 })
|
||||
]))
|
||||
.then(() => Promise.all([
|
||||
fetch('get_balance', { account_index: 0, address_indices: [0] }),
|
||||
fetch('create_address', { account_index: 0 }),
|
||||
fetch('get_transfers', { pool: true, account_index: 0 })
|
||||
]))
|
||||
.then(([balanceRes, addressRes, transferRes]) => {
|
||||
const memPoolBalance = _.reduce((acc, value) => acc.plus(value.amount), BN(0), transferRes.pool)
|
||||
return {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue