From 4a34595630e8f6ac67f0a121cd515f5338beffe8 Mon Sep 17 00:00:00 2001 From: Eugene Gusev Date: Fri, 3 May 2019 11:24:51 +0000 Subject: [PATCH] add getEtherPriceBtc ethers.js #503 --- source/ethers.js/source/api-providers.rst | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/source/ethers.js/source/api-providers.rst b/source/ethers.js/source/api-providers.rst index 346352f..9177c26 100644 --- a/source/ethers.js/source/api-providers.rst +++ b/source/ethers.js/source/api-providers.rst @@ -1006,6 +1006,9 @@ Etherscan :sup:`prototype` . getEtherPrice ( ) Returns a :ref:`Promise ` with the price of ether in USD. +:sup:`prototype` . getEtherPriceBtc ( ) + Returns a :ref:`Promise ` with the price of ether in BTC. + :sup:`prototype` . getHistory ( addressOrName [ , startBlock :sup:`= 0` [ , endBlock :sup:`= "latest"` ] ] ) Returns a :ref:`Promise ` with an array of :ref:`Transaction Responses ` for each transaction to or from *addressOrName* between *startBlock* and *endBlock* (inclusive). @@ -1020,6 +1023,11 @@ Etherscan console.log("Ether price in USD: " + price); }); + // Getting the current Ethereum price in Bitcoin + etherscanProvider.getEtherPriceBtc().then(function(price) { + console.log("Ether price in BTC: " + price); + }); + // Getting the transaction history of an address let address = '0xb2682160c482eB985EC9F3e364eEc0a904C44C23';