Skip to content
This repository has been archived by the owner on Jun 10, 2021. It is now read-only.

add getEtherPriceBtc ethers.js #503 #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions source/ethers.js/source/api-providers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1006,6 +1006,9 @@ Etherscan
:sup:`prototype` . getEtherPrice ( )
Returns a :ref:`Promise <promise>` with the price of ether in USD.

:sup:`prototype` . getEtherPriceBtc ( )
Returns a :ref:`Promise <promise>` with the price of ether in BTC.

:sup:`prototype` . getHistory ( addressOrName [ , startBlock :sup:`= 0` [ , endBlock :sup:`= "latest"` ] ] )
Returns a :ref:`Promise <promise>` with an array of :ref:`Transaction Responses <transaction-response>`
for each transaction to or from *addressOrName* between *startBlock* and *endBlock* (inclusive).
Expand All @@ -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';
Expand Down