Skip to main content

๐ŸŽฏSLP API

Notes

For more details visit BCH APIs page.

//imports
using Cash.NetCore.Contracts;
using Cash.NetCore.Models.Response.Slp;
//inject
private readonly ISlpService _slpService;

๐Ÿ’ฐConvert address to slpAddr, cashAddr and legacy.โ€‹

Convert address to slpAddr, cashAddr and legacy.โ€‹

//Sample Request ๐ŸŽ
var address = await _slpService!.GetConvertAddressAsync(
"simpleledger:qz9tzs6d5097ejpg279rg0rnlhz546q4fsnck9wh5m");

๐Ÿ’ฐConvert multiple addresses to cash, legacy and simpleledger format.โ€‹

Convert multiple addresses to cash, legacy and simpleledger format.โ€‹

//Sample Request ๐ŸŽ
var addresses = await _slpService!.GetConvertAddressesAsync(new[]
{
"simpleledger:qrxa0unrn67rtn85v7asfddhhth43ecnxua0antk2l",
"simpleledger:qz9tzs6d5097ejpg279rg0rnlhz546q4fsnck9wh5m"
});

๐Ÿ’ฐSLP token whitelist.โ€‹

Get tokens that are on the whitelist. SLPDB is typically used to validate SLP transactions. It can become unstable during periods of high network usage. A second SLPDB has been implemented that is much more stable, because it only tracks a whitelist of SLP tokens. This endpoint will return information on the SLP tokens that are included in that whitelist.โ€‹

For tokens on the whitelist, the /slp/validateTxid3 endpoints can be used.

//Sample Request ๐ŸŽ
var tokens = await _slpService!.GetTokenWhitelistAsync();