Generated by DocFX

Class NeblioAPIHelpers

Main Helper class for the Neblio Blockchain Transactions

Inheritance
System.Object
NeblioAPIHelpers
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: VEDriversLite.NeblioAPI
Assembly: VEDriversLite.NeblioAPI.dll
Syntax
public static class NeblioAPIHelpers

Fields

| Improve this Doc View Source

AddressInfoCache

Address info cache. It will save for at least one second address info. If it is older, it will reqeuest new info.

Declaration
public static ConcurrentDictionary<string, (DateTime, GetAddressInfoResponse)> AddressInfoCache
Field Value
Type Description
System.Collections.Concurrent.ConcurrentDictionary<System.String, System.ValueTuple<System.DateTime, GetAddressInfoResponse>>
| Improve this Doc View Source

BDPImageLink

Declaration
public const string BDPImageLink = "https://ve-framework.com/ipfs/QmYMVuotTTpW24eJftpbUFgK7Ln8B4ox3ydbKCB6gaVwVB"
Field Value
Type Description
System.String
| Improve this Doc View Source

DogecoinImageLink

Declaration
public const string DogecoinImageLink = "https://ve-framework.com/ipfs/QmRp3eyUeqctcgBFcRuBa7uRWiABTXmLBeYuhLp8xLX1sy"
Field Value
Type Description
System.String
| Improve this Doc View Source

FromSatToMainRatio

Conversion ration for Neblio to convert from sat to 1 NEBL

Declaration
public const double FromSatToMainRatio = 100000000
Field Value
Type Description
System.Double
| Improve this Doc View Source

MaximumNeblioOutpus

Maximum number of outputs without tokens in the Neblio transaction

Declaration
public static int MaximumNeblioOutpus
Field Value
Type Description
System.Int32
| Improve this Doc View Source

MaximumTokensOutpus

Maximum number of outputs which carry some token in the Neblio transaction

Declaration
public static int MaximumTokensOutpus
Field Value
Type Description
System.Int32
| Improve this Doc View Source

MinimumAmount

Minimum amount in Satoshi on Neblio Blockchain

Declaration
public static long MinimumAmount
Field Value
Type Description
System.Int64
| Improve this Doc View Source

MinimumConfirmations

Minimum number of confirmation to send the transaction

Declaration
public static int MinimumConfirmations
Field Value
Type Description
System.Int32
| Improve this Doc View Source

NeblioImageLink

Declaration
public const string NeblioImageLink = "https://ve-framework.com/ipfs/QmPUvBN4qKvGyKKhADBJKSmNC7JGnr3Rwf5ndENGMfpX54"
Field Value
Type Description
System.String
| Improve this Doc View Source

TokenMetadataCache

Token Metadata cache list

Declaration
public static ConcurrentDictionary<string, GetTokenMetadataResponse> TokenMetadataCache
Field Value
Type Description
System.Collections.Concurrent.ConcurrentDictionary<System.String, GetTokenMetadataResponse>
| Improve this Doc View Source

TokensInfo

Tokens Info for all already loaded tokens

Declaration
public static Dictionary<string, GetTokenMetadataResponse> TokensInfo
Field Value
Type Description
System.Collections.Generic.Dictionary<System.String, GetTokenMetadataResponse>
| Improve this Doc View Source

TokenTxMetadataCache

Token metadata cache. It is same all the time for the specific hash of the tx

Declaration
public static ConcurrentDictionary<string, GetTokenMetadataResponse> TokenTxMetadataCache
Field Value
Type Description
System.Collections.Concurrent.ConcurrentDictionary<System.String, GetTokenMetadataResponse>
| Improve this Doc View Source

TransactionInfoCache

Transaction info cache. If the tx was already loaded it will remember it if it has more than MinimumConfirmations

Declaration
public static ConcurrentDictionary<string, GetTransactionInfoResponse> TransactionInfoCache
Field Value
Type Description
System.Collections.Concurrent.ConcurrentDictionary<System.String, GetTransactionInfoResponse>
| Improve this Doc View Source

TurnOnCache

Turn on and off of the cache for address info, transaction info and metadata of the transaction If it is true the cache is on. It is default state. Usually it is important to turn it off just for unit tests which uses simulated address and tx data

Declaration
public static bool TurnOnCache
Field Value
Type Description
System.Boolean
| Improve this Doc View Source

VENFTImageLink

Declaration
public const string VENFTImageLink = "https://ve-framework.com/ipfs/QmZSdjuLTihuPzVwUKaHLtivw1HYhsyCdQFnVLLCjWoVBk"
Field Value
Type Description
System.String
| Improve this Doc View Source

VENFTTokenId

Declaration
public const string VENFTTokenId = "La58e9EeXUMx41uyfqk6kgVWAQq9yBs44nuQW8"
Field Value
Type Description
System.String
| Improve this Doc View Source

WDOGEImageLink

Declaration
public const string WDOGEImageLink = "https://ve-framework.com/ipfs/Qmc9xS9a8TnWmU7AN4dtsbu4vU6hpEXpMNAeUdshFfg1wT"
Field Value
Type Description
System.String

Properties

| Improve this Doc View Source

NewAPIAddress

Address of VEFramework.BlockchainIndexerServer API

Declaration
public static string NewAPIAddress { get; set; }
Property Value
Type Description
System.String

Methods

| Improve this Doc View Source

AddressInfoAsync(String)

Declaration
public static async Task<GetAddressResponse> AddressInfoAsync(string addr)
Parameters
Type Name Description
System.String addr
Returns
Type Description
System.Threading.Tasks.Task<GetAddressResponse>
| Improve this Doc View Source

AddressInfoAsyncOld(String)

Return Address info object. Contains list of all transactions

Declaration
public static async Task<GetAddressResponse> AddressInfoAsyncOld(string addr)
Parameters
Type Name Description
System.String addr
Returns
Type Description
System.Threading.Tasks.Task<GetAddressResponse>
| Improve this Doc View Source

AddressInfoUtxosAsync(String)

Return address info object. this object contains list of Utxos.

Declaration
public static async Task<GetAddressInfoResponse> AddressInfoUtxosAsync(string addr)
Parameters
Type Name Description
System.String addr
Returns
Type Description
System.Threading.Tasks.Task<GetAddressInfoResponse>
| Improve this Doc View Source

BroadcastNTP1TxAsync(BroadcastTxRequest)

Broadcast of signed transaction. Works for Neblio and Token transactions.

Declaration
public static async Task<string> BroadcastNTP1TxAsync(BroadcastTxRequest data)
Parameters
Type Name Description
BroadcastTxRequest data
Returns
Type Description
System.Threading.Tasks.Task<System.String>
| Improve this Doc View Source

BroadcastSignedTransaction(String)

Function will take hex of signed transaction and broadcast it via Neblio API

Declaration
public static async Task<string> BroadcastSignedTransaction(string txhex)
Parameters
Type Name Description
System.String txhex
Returns
Type Description
System.Threading.Tasks.Task<System.String>
| Improve this Doc View Source

BroadcastTransactionVEAPI(String)

Declaration
public static async Task<string> BroadcastTransactionVEAPI(string txhex)
Parameters
Type Name Description
System.String txhex
Returns
Type Description
System.Threading.Tasks.Task<System.String>
| Improve this Doc View Source

CheckTokensSupplies(String, GetAddressInfoResponse)

Check supply of all tokens on address.

Declaration
public static async Task<Dictionary<string, TokenSupplyDto>> CheckTokensSupplies(string address, GetAddressInfoResponse addressinfo)
Parameters
Type Name Description
System.String address

address which has utxos

GetAddressInfoResponse addressinfo

if you have already loaded address info with utxo list provide it to prevent unnecessary API requests

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<System.String, TokenSupplyDto>>
| Improve this Doc View Source

ConvertIndexedUtxoToUtxo(List<IndexedUtxoDto>)

Get Utxos List from VE Indexer API

Declaration
public static List<Utxos> ConvertIndexedUtxoToUtxo(List<IndexedUtxoDto> utxos)
Parameters
Type Name Description
System.Collections.Generic.List<IndexedUtxoDto> utxos
Returns
Type Description
System.Collections.Generic.List<Utxos>
| Improve this Doc View Source

FindUtxoForMintNFT(String, String, Int32, Double, GetAddressInfoResponse, Double)

Find utxo which can be used for minting. It means it has token amount > 1

Declaration
public static async Task<List<Utxos>> FindUtxoForMintNFT(string addr, string tokenId, int numberToMint = 1, double oneTokenSat = 10000, GetAddressInfoResponse addinfo = null, double latestBlockHeight = 0)
Parameters
Type Name Description
System.String addr

address which has utxos

System.String tokenId

token id hash

System.Int32 numberToMint

number of tokens which will be minted - because of multimint

System.Double oneTokenSat

this is usually default. On Neblio all token tx should have value 10000sat

GetAddressInfoResponse addinfo
System.Double latestBlockHeight
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.List<Utxos>>
| Improve this Doc View Source

GetActualMintingSupply(String, String, GetAddressInfoResponse)

check actual supply for minting on some address. It is just for VENFT tokens now. Function will also load token metadta if it has not loaded yet.

Declaration
public static async Task<(double, GetTokenMetadataResponse)> GetActualMintingSupply(string address, string tokenId, GetAddressInfoResponse addressinfo)
Parameters
Type Name Description
System.String address

address which has utxos

System.String tokenId

Specify the tokenId

GetAddressInfoResponse addressinfo

if you have already loaded address info with utxo list provide it to prevent unnecessary API requests

Returns
Type Description
System.Threading.Tasks.Task<System.ValueTuple<System.Double, GetTokenMetadataResponse>>
| Improve this Doc View Source

GetAddressNeblUtxo(String, Double, Double, GetAddressInfoResponse, Double)

Returns list of spendable utxos which together match some input required amount for some transaction

Declaration
public static async Task<ICollection<Utxos>> GetAddressNeblUtxo(string address, double minAmount = 0.0001, double requiredAmount = 0.0001, GetAddressInfoResponse addinfo = null, double latestBlockHeight = 0)
Parameters
Type Name Description
System.String address

address which has utxos for spend - sender in tx

System.Double minAmount

minimum amount of one utxo

System.Double requiredAmount

amount what must be collected even by multiple utxos

GetAddressInfoResponse addinfo

If you already have loaded addinfo pass it

System.Double latestBlockHeight
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Utxos>>
| Improve this Doc View Source

GetAddressNFTsUtxos(String, List<String>, GetAddressInfoResponse)

Returns list of all Utxos which contains just one token, means amount = 1

Declaration
public static async Task<ICollection<Utxos>> GetAddressNFTsUtxos(string addr, List<string> allowedTokens, GetAddressInfoResponse addressinfo = null)
Parameters
Type Name Description
System.String addr
System.Collections.Generic.List<System.String> allowedTokens

Load just the allowed tokens

GetAddressInfoResponse addressinfo
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Utxos>>
| Improve this Doc View Source

GetAddressTokensUtxos(String, GetAddressInfoResponse)

Returns list of all Utxos which contains some tokens

Declaration
public static async Task<ICollection<Utxos>> GetAddressTokensUtxos(string addr, GetAddressInfoResponse addressinfo = null)
Parameters
Type Name Description
System.String addr
GetAddressInfoResponse addressinfo
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Utxos>>
| Improve this Doc View Source

GetAddressUtxosListFromNewAPIAsync(String)

Get Utxos List from VE Indexer API

Declaration
public static async Task<List<Utxos>> GetAddressUtxosListFromNewAPIAsync(string addr)
Parameters
Type Name Description
System.String addr
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.List<Utxos>>
| Improve this Doc View Source

GetAddressUtxosObjects(String)

Return list of Utxos object.

Declaration
public static async Task<ICollection<Utxos>> GetAddressUtxosObjects(string addr)
Parameters
Type Name Description
System.String addr
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Utxos>>
| Improve this Doc View Source

GetBlock(String)

Return Block info object

Declaration
public static async Task<GetBlockResponse> GetBlock(string block)
Parameters
Type Name Description
System.String block

Hash of block

Returns
Type Description
System.Threading.Tasks.Task<GetBlockResponse>
| Improve this Doc View Source

GetClient()

Returns private client for Neblio API. If it is null, it will create new instance.

Declaration
public static IClient GetClient()
Returns
Type Description
IClient
| Improve this Doc View Source

GetClient(IClient)

This method is written for Unit tests to pass in Mock client object

Declaration
public static void GetClient(IClient client)
Parameters
Type Name Description
IClient client
| Improve this Doc View Source

GetSendTokenObject(Double, Double, String, String)

Function prepares SendTokenRequest object. It is important to initialitze correct inside properties

Declaration
public static SendTokenRequest GetSendTokenObject(double amount, double fee = 20000, string receiver = "", string tokenId = "")
Parameters
Type Name Description
System.Double amount

Amount to send

System.Double fee

Fee - min 10000, with metadata you need at least 20000

System.String receiver

Receiver of the amount

System.String tokenId

Token Id hash

Returns
Type Description
SendTokenRequest
| Improve this Doc View Source

GetTokenInfo(String)

Get token info. Contains image url, issuer, and other info

Declaration
public static async Task<TokenSupplyDto> GetTokenInfo(string tokenId)
Parameters
Type Name Description
System.String tokenId

token id hash

Returns
Type Description
System.Threading.Tasks.Task<TokenSupplyDto>
| Improve this Doc View Source

GetTokenMetadata(String)

Get token issue metadata. Contains image url, issuer, and other info

Declaration
public static async Task<GetTokenMetadataResponse> GetTokenMetadata(string tokenId)
Parameters
Type Name Description
System.String tokenId

token id hash

Returns
Type Description
System.Threading.Tasks.Task<GetTokenMetadataResponse>
| Improve this Doc View Source

GetTokenMetadataOfUtxoCache(String, String, Double, GetTransactionInfoResponse)

Get token metadata from the specific transaction cache logic

Declaration
public static async Task<GetTokenMetadataResponse> GetTokenMetadataOfUtxoCache(string tokenid, string txid, double verbosity = 0, GetTransactionInfoResponse txinfo = null)
Parameters
Type Name Description
System.String tokenid
System.String txid
System.Double verbosity
GetTransactionInfoResponse txinfo
Returns
Type Description
System.Threading.Tasks.Task<GetTokenMetadataResponse>
| Improve this Doc View Source

GetTokenOwners(String)

Return VENFT top owners. It eliminate some testing addresses.

Declaration
public static async Task<List<TokenOwnerDto>> GetTokenOwners(string tokenId = "La58e9EeXUMx41uyfqk6kgVWAQq9yBs44nuQW8")
Parameters
Type Name Description
System.String tokenId

Token Id hash

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.List<TokenOwnerDto>>
| Improve this Doc View Source

GetTokenOwnersList(String)

Return VENFT top owners. It eliminate some testing addresses.

Declaration
public static async Task<List<Holders>> GetTokenOwnersList(string tokenId)
Parameters
Type Name Description
System.String tokenId

Token Id hash

Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.List<Holders>>
| Improve this Doc View Source

GetTransactionInfo(String)

Declaration
public static async Task<GetTransactionInfoResponse> GetTransactionInfo(string txid)
Parameters
Type Name Description
System.String txid
Returns
Type Description
System.Threading.Tasks.Task<GetTransactionInfoResponse>
| Improve this Doc View Source

GetTransactionInfoOld(String)

Get transaction info.

Declaration
public static async Task<GetTransactionInfoResponse> GetTransactionInfoOld(string txid)
Parameters
Type Name Description
System.String txid

tx id hash

Returns
Type Description
System.Threading.Tasks.Task<GetTransactionInfoResponse>

Neblio API GetTransactionInfo object

| Improve this Doc View Source

GetTransactionInternal(String, String, GetTransactionInfoResponse)

Declaration
public static async Task<string> GetTransactionInternal(string txid, string mode, GetTransactionInfoResponse txinfo = null)
Parameters
Type Name Description
System.String txid
System.String mode
GetTransactionInfoResponse txinfo
Returns
Type Description
System.Threading.Tasks.Task<System.String>
| Improve this Doc View Source

GetTransactionMetadata(String, String, GetTransactionInfoResponse)

Returns metadata in the token transction

Declaration
public static async Task<Dictionary<string, string>> GetTransactionMetadata(string tokenid, string txid, GetTransactionInfoResponse txinfo = null)
Parameters
Type Name Description
System.String tokenid

token id hash

System.String txid

tx id hash

GetTransactionInfoResponse txinfo
Returns
Type Description
System.Threading.Tasks.Task<System.Collections.Generic.Dictionary<System.String, System.String>>
| Improve this Doc View Source

GetTransactionReceiver(String, GetTransactionInfoResponse)

Get transaction sender.

Declaration
public static async Task<string> GetTransactionReceiver(string txid, GetTransactionInfoResponse txinfo = null)
Parameters
Type Name Description
System.String txid

tx id hash

GetTransactionInfoResponse txinfo

if you already have txinfo object

Returns
Type Description
System.Threading.Tasks.Task<System.String>

Sender address

| Improve this Doc View Source

GetTransactionSender(String, GetTransactionInfoResponse)

Get transaction sender.

Declaration
public static async Task<string> GetTransactionSender(string txid, GetTransactionInfoResponse txinfo = null)
Parameters
Type Name Description
System.String txid

tx id hash

GetTransactionInfoResponse txinfo

if you already have txinfo object

Returns
Type Description
System.Threading.Tasks.Task<System.String>

Sender address

| Improve this Doc View Source

GetTxHex(String)

Return transaction Hex

Declaration
public static async Task<string> GetTxHex(string txid)
Parameters
Type Name Description
System.String txid
Returns
Type Description
System.Threading.Tasks.Task<System.String>
| Improve this Doc View Source

GetTxsAsync(String, String, Nullable<Double>)

Return list of the transactions in the block

Declaration
public static async Task<GetTxsResponse> GetTxsAsync(string addr, string block, double? pageNum = 100)
Parameters
Type Name Description
System.String addr
System.String block
System.Nullable<System.Double> pageNum
Returns
Type Description
System.Threading.Tasks.Task<GetTxsResponse>
| Improve this Doc View Source

IsEnoughConfirmationsForSend(Int32)

Check if the number of the confirmation is enough for doing transactions. It mainly usefull for UI stuff or console.

Declaration
public static string IsEnoughConfirmationsForSend(int confirmations)
Parameters
Type Name Description
System.Int32 confirmations
Returns
Type Description
System.String
| Improve this Doc View Source

IsValidUtxo(Double, Double)

Does UTXO has enough confirmations? Based on the utxo block height and current block height.

Declaration
public static bool IsValidUtxo(double UtxoBlockHeight, double latestBlockCount)
Parameters
Type Name Description
System.Double UtxoBlockHeight
System.Double latestBlockCount
Returns
Type Description
System.Boolean
| Improve this Doc View Source

LoadAllowedTokensInfo(List<String>)

Load informations about allowed tokens.

Declaration
public static async Task LoadAllowedTokensInfo(List<string> tokenIds)
Parameters
Type Name Description
System.Collections.Generic.List<System.String> tokenIds

List of allowed tokens to works with.

Returns
Type Description
System.Threading.Tasks.Task
| Improve this Doc View Source

ParseCustomMetadata(String)

Parse and decompress the custom metadata from the OP_RETURN output

Declaration
public static Dictionary<string, string> ParseCustomMetadata(string metadata)
Parameters
Type Name Description
System.String metadata
Returns
Type Description
System.Collections.Generic.Dictionary<System.String, System.String>
| Improve this Doc View Source

SendRawNTP1TxAsync(SendTokenRequest)

Send request for creating RAW token transaction

Declaration
public static async Task<string> SendRawNTP1TxAsync(SendTokenRequest data)
Parameters
Type Name Description
SendTokenRequest data
Returns
Type Description
System.Threading.Tasks.Task<System.String>
| Improve this Doc View Source

ShortenAddress(String)

Create short version of address, 3 chars on start...3 chars on end

Declaration
public static string ShortenAddress(string address)
Parameters
Type Name Description
System.String address
Returns
Type Description
System.String
| Improve this Doc View Source

ShortenTxId(String, Boolean, Int32)

Create short version of txid hash, 3 chars on start...3 chars on end

Declaration
public static string ShortenTxId(string txid, bool withDots = true, int len = 10)
Parameters
Type Name Description
System.String txid
System.Boolean withDots

default true. add .... between start and end of the tx hash

System.Int32 len

Length of the result shortened tx hash

Returns
Type Description
System.String
| Improve this Doc View Source

ValidateOneTokenNFTUtxo(String, String, String, Int32, GetAddressInfoResponse, Double)

Check if the NFT token is spendable. Means utxos with token amount = 1

Declaration
public static async Task<double> ValidateOneTokenNFTUtxo(string address, string tokenId, string txid, int indx, GetAddressInfoResponse addinfo = null, double latestBlockHeight = 0)
Parameters
Type Name Description
System.String address

address which should have this utxo

System.String tokenId

input token id hash

System.String txid

input txid hash

System.Int32 indx
GetAddressInfoResponse addinfo

if you already have addinfo pass it

System.Double latestBlockHeight
Returns
Type Description
System.Threading.Tasks.Task<System.Double>

true and index of utxo