๐ฏ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.โ
- Request
- Response
- ...
//Sample Request ๐
var address = await _slpService!.GetConvertAddressAsync(
"simpleledger:qz9tzs6d5097ejpg279rg0rnlhz546q4fsnck9wh5m");
//will return SlpConvertAddress: ๐
var address = new SlpConvertAddress
{
SlpAddress = "simpleledger:qz9tzs6d5097ejpg279rg0rnlhz546q4fsnck9wh5m",
CashAddress = "bitcoincash:qz9tzs6d5097ejpg279rg0rnlhz546q4fslra7mh29",
LegacyAddress = "1DeLbv5EMzLEFDvQ8wZiKeSuPGGtSSz5HP"
};
๐ For more information Check out Convert address to slpAddr, cashAddr and legacy.
๐ฐConvert multiple addresses to cash, legacy and simpleledger format.โ
Convert multiple addresses to cash, legacy and simpleledger format.โ
- Request
- Response
- ...
//Sample Request ๐
var addresses = await _slpService!.GetConvertAddressesAsync(new[]
{
"simpleledger:qrxa0unrn67rtn85v7asfddhhth43ecnxua0antk2l",
"simpleledger:qz9tzs6d5097ejpg279rg0rnlhz546q4fsnck9wh5m"
});
//will return List<SlpConvertAddress>: ๐
var addresses = new List<SlpConvertAddress>()
{
new()
{
SlpAddress = "simpleledger:qrxa0unrn67rtn85v7asfddhhth43ecnxua0antk2l",
CashAddress = "bitcoincash:qrxa0unrn67rtn85v7asfddhhth43ecnxu35kg7k5p",
LegacyAddress = "1KmQDaJdUDwwEFRwVwGwTqJ9gqBzyGYzjY"
},
new()
{
SlpAddress = "simpleledger:qz9tzs6d5097ejpg279rg0rnlhz546q4fsnck9wh5m",
CashAddress = "bitcoincash:qz9tzs6d5097ejpg279rg0rnlhz546q4fslra7mh29",
LegacyAddress = "1DeLbv5EMzLEFDvQ8wZiKeSuPGGtSSz5HP"
}
};
๐ For more information Check out Convert multiple addresses to cash, legacy and simpleledger format.
๐ฐ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.
- Request
- Response
- ...
//Sample Request ๐
var tokens = await _slpService!.GetTokenWhitelistAsync();
//will return List<SlpTokenWhitelist>: ๐
var tokens = new List<SlpTokenWhitelist>
{
new()
{
Name = "USDH",
TokenId = "c4b0d62156b3fa5c8f3436079b5394f7edc1bef5dc1cd2f9d0c4d46f82cca479"
},
new()
{
Name = "SPICE",
TokenId = "4de69e374a8ed21cbddd47f2338cc0f479dc58daa2bbe11cd604ca488eca0ddf"
},
new()
{
Name = "PSF",
TokenId = "38e97c5d7d3585a2cbf3f9580c82ca33985f9cb0845d4dcce220cb709f9538b0"
},
new()
{
Name = "TROUT",
TokenId = "a4fb5c2da1aa064e25018a43f9165040071d9e984ba190c222a7f59053af84b2"
},
new()
{
Name = "PSFTEST",
TokenId = "d0ef4de95b78222bfee2326ab11382f4439aa0855936e2fe6ac129a8d778baa0"
}
};
๐ For more information Check out SLP token whitelist.