chore: use monorepo organization
This commit is contained in:
parent
deaf7d6ecc
commit
a687827f7e
1099 changed files with 8184 additions and 11535 deletions
|
|
@ -1,54 +0,0 @@
|
|||
const ph = require('./plugin-helper')
|
||||
const argv = require('minimist')(process.argv.slice(2))
|
||||
|
||||
// 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: {} }
|
||||
}
|
||||
|
||||
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) {
|
||||
return Promise.resolve()
|
||||
.then(() => {
|
||||
const { plugin, account } = loadWalletScoring(settings)
|
||||
|
||||
return plugin.rateAddress(account, cryptoCode, address)
|
||||
})
|
||||
}
|
||||
|
||||
function rateAddress (settings, cryptoCode, address) {
|
||||
return Promise.resolve()
|
||||
.then(() => {
|
||||
const { plugin, account } = loadWalletScoring(settings)
|
||||
|
||||
return plugin.rateAddress(account, cryptoCode, address)
|
||||
})
|
||||
}
|
||||
|
||||
function isWalletScoringEnabled (settings, cryptoCode) {
|
||||
return Promise.resolve()
|
||||
.then(() => {
|
||||
const { plugin, account } = loadWalletScoring(settings)
|
||||
|
||||
return plugin.isWalletScoringEnabled(account, cryptoCode)
|
||||
})
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
rateAddress,
|
||||
rateTransaction,
|
||||
isWalletScoringEnabled
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue