Cardano Explorer API
Isomorphic Javascript Interface for cardano-explorer
Wrapper for https://cardanodocs.com/technical/explorer/api/#path--api-blocks-pages using promises.
Install
npm instal cardano-explorer-api
## Usage
Initialize with optional options endpoint
and debug
. Default Endpoint: https://cardanoexplorer.com/api.
new CardanoExplorerApi(options);
API
addressesSummary({ address }) | address | /addresses/summary/{address} |
blocksPages({ page, pageSize }) | | /blocks/pages |
blocksPagesTotal({ pageSize }) | | /blocks/pages/total |
blocksSummary({ hash }) | blockSummary , block | /blocks/summary/{hash} |
blocksTxs({ hash, limit, offset }) | blockTxs | /blocks/txs/{hash} |
epochs({ epoch, page }) | epoch | /epochs/{epoch} |
epochsSlot({ epoch, slot }) | slot | /epochs/{epoch}/{slot} |
genesisAddress({ page, pageSize, filter }) | | /genesis/address |
genesisAddressPagesTotal({ pageSize, filter }) | | /genesis/address/pages/total |
genesisSummary({ }) | | /genesis/summary |
statsTxs({ page }) | recentTransactions | /stats/txs |
supplyAda({ }) | totalSupply | /supply/ada |
txsLast({ }) | lastTransaction | /txs/last |
txsSummary({ txid }) | tx | /txs/summary/{txid} |
Example
const explorer = new CardanoExplorerApi();
(async () => {
const hash = 'f9b473a4a8f264adc14dbe349921a35d9580aa357dcbe1181c12553c12a7312c';
const block = await explorer.blocksSummary({ hash });
console.log(block);
})();
Test
Currently uses default endpoint mainnet data, todo: implement mock test server.
npm run test
MIT 2018