feat: pick wallet scoring without UI

This commit is contained in:
Rafael Taranto 2024-08-27 10:59:00 +01:00
parent d7d2b89556
commit d619974de7
2 changed files with 26 additions and 7 deletions

View file

@ -1,14 +1,23 @@
const ph = require('./plugin-helper')
const argv = require('minimist')(process.argv.slice(2))
const configManager = require('./new-config-manager')
function loadWalletScoring (settings, cryptoCode) {
const pluginCode = argv.mockScoring ? 'mock-scoring' : 'scorechain'
const wallet = cryptoCode ? ph.load(ph.WALLET, configManager.getWalletSettings(cryptoCode, settings.config).wallet) : null
const plugin = ph.load(ph.WALLET_SCORING, pluginCode)
const account = settings.accounts[pluginCode]
// TODO - This function should be rolled back after UI is created for this feature
function loadWalletScoring (settings) {
if (argv.mockScoring) {
const mock = ph.load(ph.WALLET_SCORING, 'mock-scoring')
return { plugin: mock, account: {} }
}
return { plugin, account, wallet }
const scorechainAccount = settings.accounts['scorechain']
if (scorechainAccount?.enabled) {
const scorechain = ph.load(ph.WALLET_SCORING, 'scorechain')
return { plugin: scorechain, account: scorechainAccount}
}
const ellipticAccount = settings.accounts['elliptic']
const elliptic = ph.load(ph.WALLET_SCORING, 'elliptic')
return { plugin: elliptic, account: ellipticAccount }
}
function rateTransaction (settings, cryptoCode, address) {