Skip to main content

๐ŸŽฏElectrumX/Fulcrum API

Notes

For more details visit BCH APIs page.

//imports
using Cash.NetCore.Contracts;
using Cash.NetCore.Models.Response.ElectrumX;
using Cash.NetCore.Models.Request.ElectrumX;
//inject
private readonly IElectrumXService _electrumXService;

๐Ÿ’ฐGet count block headers starting at a heightโ€‹

Returns an array with block headers starting at the block heightโ€‹

//Sample Request ๐ŸŽ
var blockHeaders = await _electrumXService!.GetElectrumXBlockHeadersCountAsync(42, 2);

๐Ÿ’ฐGet balance for a single address.โ€‹

Returns an object with confirmed and unconfirmed balance associated with an address.โ€‹

//Sample Request ๐ŸŽ
var electrumXBalance = await _electrumXService!.GetElectrumXBalanceAsync(
"bitcoincash:qr69kyzha07dcecrsvjwsj4s6slnlq4r8c30lxnur3");

๐Ÿ’ฐGet balances for an array of addresses.โ€‹

Returns an array of balanes associated with an array of address. Limited to 20 items per request.โ€‹

//Sample Request ๐ŸŽ
var electrumXBalances = await _electrumXService!.GetElectrumXBalancesAsync(
new[]
{
"bitcoincash:qrdka2205f4hyukutc2g0s6lykperc8nsu5u2ddpqf",
"bitcoincash:qzs02v05l7qs5s24srqju498qu55dwuj0cx5ehjm2c"
});

๐Ÿ’ฐGet block headers for an array of height + count pairs.โ€‹

Returns an array of objects with blockheaders of an array of TXIDs. Limited to 20 items per request.โ€‹

//Sample Request ๐ŸŽ
var parameters = new List<BlockHeadersRequest>
{
new()
{
Height = 42,
Count = 2
},
new()
{
Height = 100,
Count = 5
}
};

var blockHeaders = await _electrumXService!.GetElectrumXBlockHeadersHeightCountAsync(parameters);

๐Ÿ’ฐGet the transaction history for an array of addresses.โ€‹

Returns an array of transactions associated with an array of address. Limited to 20 items per request.โ€‹

//Sample Request ๐ŸŽ
var transactionHistories = await _electrumXService!.GetElectrumXTransactionHistoryAsync(
new[]
{
"bitcoincash:qrdka2205f4hyukutc2g0s6lykperc8nsu5u2ddpqf",
"bitcoincash:qzs02v05l7qs5s24srqju498qu55dwuj0cx5ehjm2c"
});

๐Ÿ’ฐGet transaction details for a TXIDโ€‹

Returns an object with transaction details of the TXIDโ€‹

//Sample Request ๐ŸŽ
var transactionDetails = await _electrumXService!.GetElectrumXTransactionDetailsAsync(
"4db095f34d632a4daf942142c291f1f2abb5ba2e1ccac919d85bdc2f671fb251");

๐Ÿ’ฐGet transaction details for an array of TXIDsโ€‹

Returns an array of objects with transaction details of an array of TXIDs. Limited to 20 items per request.โ€‹

//Sample Request ๐ŸŽ
var transactionsDetail = await _electrumXService!.GetElectrumXTransactionDetailsAsync(
new[]
{
"4db095f34d632a4daf942142c291f1f2abb5ba2e1ccac919d85bdc2f671fb251",
"ff03401fd979bd980b8dce8410d875048b437054e6b2df3f49379eac34df8110"
});

๐Ÿ’ฐGet transaction history for a single address.โ€‹

Returns an array of historical transactions associated with an address.โ€‹

//Sample Request ๐ŸŽ
var transactionHistory = await _electrumXService!.GetElectrumXTransactionHistoryAsync(
"bitcoincash:qr69kyzha07dcecrsvjwsj4s6slnlq4r8c30lxnur3");

๐Ÿ’ฐGet unconfirmed utxos for a single address.โ€‹

Returns an object with unconfirmed UTXOs associated with an address.โ€‹

//Sample Request ๐ŸŽ
var utxos = await _electrumXService!.GetUnConfirmedAsync(
"bitcoincash:qp2ejsu4zt3k42723zh06az2s5rqjmrvhqp74tlslr");

๐Ÿ’ฐGet unconfirmed utxos for an array of addresses.โ€‹

Returns an array of objects with unconfirmed UTXOs associated with an address. Limited to 20 items per request.โ€‹

//Sample Request ๐ŸŽ
var utxos = await _electrumXService!.GetUnConfirmedAsync(
new[]
{
"bitcoincash:qp2ejsu4zt3k42723zh06az2s5rqjmrvhqp74tlslr",
"bitcoincash:qq78sq7ugu0kfuc4nlp4wxsqawfaf8z3vyf0lcn7l0"
});

๐Ÿ’ฐGet utxos for a single address.โ€‹

Returns an object with UTXOs associated with an address.โ€‹

//Sample Request ๐ŸŽ
var transactions = await _electrumXService!.GetUTxosAsync(
"bitcoincash:qp6v49705kspvke4h05djauds96d659pduzj3mud0e");

๐Ÿ’ฐGet utxos for an array of addresses.โ€‹

Returns an array of objects with UTXOs associated with an address. Limited to 20 items per request.โ€‹

//Sample Request ๐ŸŽ
var transactions = await _electrumXService!.GetUTxosAsync(
new[]
{
"bitcoincash:qp6v49705kspvke4h05djauds96d659pduzj3mud0e",
"bitcoincash:qq74tkwnqzvsu9gady9ndskwd9fa565tas8yzjs8ve"
});