v12.0.0 - initial commit

This commit is contained in:
padreug 2025-12-31 19:04:13 +01:00
commit e2c49ea43c
1145 changed files with 97211 additions and 0 deletions

View file

@ -0,0 +1,29 @@
const _ = require('lodash/fp')
const pluginCodes = {
TICKER: 'ticker',
EXCHANGE: 'exchange',
WALLET: 'wallet',
WALLET_SCORING: 'wallet-scoring',
LAYER2: 'layer2',
SMS: 'sms',
EMAIL: 'email',
ZERO_CONF: 'zero-conf',
COMPLIANCE: 'compliance',
}
module.exports = _.assign({ load }, pluginCodes)
function load(type, pluginCode) {
if (!_.includes(type, _.values(pluginCodes))) {
throw new Error(`Unallowed plugin type: ${type}`)
}
if (!pluginCode) throw new Error(`No plugin defined for ${type}`)
if (pluginCode.search(/[a-z0-9-]/) === -1) {
throw new Error(`Unallowed plugin name: ${pluginCode}`)
}
return require(`./plugins/${type}/${pluginCode}/${pluginCode}`)
}