mirror of
https://github.com/mempool/mempool.git
synced 2025-01-09 23:16:48 +01:00
20 lines
522 B
TypeScript
20 lines
522 B
TypeScript
import config from '../../config';
|
|
import { AbstractBitcoinApi } from './bitcoin-api-abstract-factory';
|
|
import EsploraApi from './esplora-api';
|
|
import BitcoinApi from './bitcoin-api';
|
|
import ElectrumApi from './electrum-api';
|
|
|
|
function bitcoinApiFactory(): AbstractBitcoinApi {
|
|
switch (config.MEMPOOL.BACKEND) {
|
|
case 'esplora':
|
|
return new EsploraApi();
|
|
case 'electrum':
|
|
return new ElectrumApi();
|
|
case 'none':
|
|
default:
|
|
return new BitcoinApi();
|
|
}
|
|
}
|
|
|
|
export default bitcoinApiFactory();
|