From ae87694bc34267460562ac8a61f39f7fd2fd54d0 Mon Sep 17 00:00:00 2001 From: softsimon Date: Tue, 29 Dec 2020 14:14:34 +0700 Subject: [PATCH] Use @mempool/electrum-client lib as Electrum Client lib. --- backend/src/api/bitcoin/electrum-api.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/backend/src/api/bitcoin/electrum-api.ts b/backend/src/api/bitcoin/electrum-api.ts index 164607d30..ab805ea70 100644 --- a/backend/src/api/bitcoin/electrum-api.ts +++ b/backend/src/api/bitcoin/electrum-api.ts @@ -3,18 +3,13 @@ import { AbstractBitcoinApi } from './bitcoin-api-abstract-factory'; import { IBitcoinApi } from './bitcoin-api.interface'; import { IEsploraApi } from './esplora-api.interface'; import { IElectrumApi } from './electrum-api.interface'; -import * as sha256 from 'crypto-js/sha256'; -import * as hexEnc from 'crypto-js/enc-hex'; import BitcoinApi from './bitcoin-api'; import bitcoinBaseApi from './bitcoin-base.api'; import mempool from '../mempool'; import logger from '../../logger'; - -// @ts-ignore -global.net = require('net'); -// @ts-ignore -global.tls = require('tls'); -import * as ElectrumClient from 'electrum-client'; +import * as ElectrumClient from '@mempool/electrum-client'; +import * as sha256 from 'crypto-js/sha256'; +import * as hexEnc from 'crypto-js/enc-hex'; class BitcoindElectrsApi extends BitcoinApi implements AbstractBitcoinApi { private electrumClient: any;