lamassu-server/lib/plugins/wallet/infura/infura.js
Sérgio Salgado 4af07a3609 fix: always set new web3 providers despite one being previously set
feat: separate eth wallet names
2022-06-21 08:30:52 +01:00

15 lines
396 B
JavaScript

const _ = require('lodash/fp')
const base = require('../geth/base')
const NAME = 'infura'
function run (account) {
if (!account.endpoint) throw new Error('Need to configure API endpoint for Infura')
const endpoint = _.startsWith('https://')(account.endpoint)
? account.endpoint : `https://${account.endpoint}`
base.connect(endpoint)
}
module.exports = _.merge(base, { NAME, run })