dart-esplora
Blockstream Esplora wrapper for dart
Getting started
From pub.dev
dart pub add esplora
dependencies:
esplora: ^1.0.0
From Github
dependencies:
esplora:
git:
url: https://github.com/ethicnology/dart-esplora.git
ref: main
Usage
final url = Uri.parse("https://blockstream.info/");
const address = "1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa";
const txid =
"e6b148846d7db3367aab6ea46a64e27528764f36581dec6ffc2326e3af2af874";
var esplora = Esplora(url);
Transaction tx = await esplora.getTx(txid);
print(tx.txid);
List<Transaction> txs = await esplora.getAddressTxs(address);
print(txs[0].txid);
Transactions
GET /tx/:txid
getTx(String txid);
GET /tx/:txid/status
getTxStatus(String txid);
GET /tx/:txid/hex
getTxHex(String txid);
GET /tx/:txid/merkleblock-proof
getTxMerkleblockProof(String txid);
GET /tx/:txid/merkle-proof
getTxMerkleProof(String txid);
GET /tx/:txid/outspend/:vout
getTxOutspend(String txid, int vout);
GET /tx/:txid/outspends
getTxOutspends(String txid);
Addresses
GET /address/:address
getAddress(String address);
GET /address/:address/txs
getAddressTxs(String address);
GET /address/:address/txs/chain/:last_seen_txid(optional)
getAddressTxsChain(String address);
getAddressTxsChain(String address, String lastSeenTxid: "");
GET /address/:address/utxo
getAddressUtxo(String address);
GET /address/:address/txs/mempool
getAddressUtxoMempool(String address);
GET /address-prefix/:prefix
getAddressPrefix(String prefix);
Blocks
GET /block/:hash
getBlock(String hash);
GET /block/:hash/header
getBlockHeader(String hash);
GET /block/:hash/status
getBlockStatus(String hash);
GET /block/:hash/txs/:start_index(optional)
getBlockTxs(String hash);
getBlockTxs(String hash, startIndex: String);
GET /block/:hash/txids
getBlockTxids(String hash);
GET /block/:hash/txid/:index
getBlockTxid(String hash, int index);
GET /block-height/:height
getBlockHeight(int height);
GET /blocks/:start_height(optional)
getBlocks();
getBlocks(startHeight: int);
GET /blocks/tip/height
getBlocksTipHeight();
GET /blocks/tip/hash
getBlocksTipHash();
Mempool
GET /mempool
getMempool();
GET /mempool/txids
getMempoolTxids();
GET /mempool/recent
getMempoolRecent();
Fee
GET /fee-estimates
getFeeEstimates();
Libraries
- esplora
- Support for doing something awesome.