Class DogeTransactionHelpers
Doge Transaction Helpers
Inheritance
Inherited Members
Namespace: VEDriversLite
Assembly: VEDriversLite.dll
Syntax
public static class DogeTransactionHelpers
Fields
| Improve this Doc View SourceFromSatToMainRatio
Conversion ration for Doge to convert from sat to 1 DOGE
Declaration
public static double FromSatToMainRatio
Field Value
Type | Description |
---|---|
System.Double |
MinimumConfirmations
Minimum number of confirmation to send the transaction
Declaration
public static int MinimumConfirmations
Field Value
Type | Description |
---|---|
System.Int32 |
Network
NBitcoin Instance of Mainet Network of Dogecoin
Declaration
public static Network Network
Field Value
Type | Description |
---|---|
NBitcoin.Network |
Methods
| Improve this Doc View SourceAddressReceivedTxsAsync(String)
Return address received transaction list.
Declaration
public static async Task<List<ReceivedTx>> AddressReceivedTxsAsync(string addr)
Parameters
Type | Name | Description |
---|---|---|
System.String | addr |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.List<ReceivedTx>> | This object contains list of spended Txs. |
AddressSpendTxsAsync(String)
Return address spended transaction list.
Declaration
public static async Task<List<SpentTx>> AddressSpendTxsAsync(string addr)
Parameters
Type | Name | Description |
---|---|---|
System.String | addr |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.List<SpentTx>> | This object contains list of spended Txs. |
AddressUtxosAsync(String)
Return address info object. this object contains list of Utxos.
Declaration
public static async Task<GetAddressUtxosResponse> AddressUtxosAsync(string addr)
Parameters
Type | Name | Description |
---|---|---|
System.String | addr |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<GetAddressUtxosResponse> |
CalcFee(Int32, Int32, String, Boolean)
This function will calculate the fee based of the known lenght of the intputs and the outputs If there is the OP_RETURN output it is considered as the customMessage. Please fill it for token transactions. Token transaction also will add just for sure one output to calculation of the size for the case there will be some tokens back to original address
Declaration
public static double CalcFee(int numOfInputs, int numOfOutputs, string customMessageInOPReturn, bool isTokenTransaction)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | numOfInputs | Number of input of the transaction "in" vector |
System.Int32 | numOfOutputs | Number of outpus of the transaction "out" vector |
System.String | customMessageInOPReturn | Custom message - "OP_RETURN" output |
System.Boolean | isTokenTransaction | Token transaction will add another output for getting back the tokens |
Returns
Type | Description |
---|---|
System.Double |
ChainSoBroadcastTxAsync(ChainSoBroadcastTxRequest)
Broadcast of signed transaction. with chain.so
Declaration
public static async Task<string> ChainSoBroadcastTxAsync(ChainSoBroadcastTxRequest data)
Parameters
Type | Name | Description |
---|---|---|
ChainSoBroadcastTxRequest | data | tx hex |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> |
GetAddressFromPrivateKey(String)
Get Address from Dogecoin private key
Declaration
public static CommonReturnTypeDto GetAddressFromPrivateKey(string privatekey)
Parameters
Type | Name | Description |
---|---|---|
System.String | privatekey | Excpected Dogecoin private key |
Returns
Type | Description |
---|---|
CommonReturnTypeDto | true and Address if it is correct Dogecoin private key |
GetAddressSpendableUtxo(String, Double, Double)
Returns list of spendable utxos which together match some input required amount for some transaction
Declaration
public static async Task<ICollection<Utxo>> GetAddressSpendableUtxo(string addr, double minAmount = 0.0001, double requiredAmount = 0.0001)
Parameters
Type | Name | Description |
---|---|---|
System.String | addr | 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 |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.Collections.Generic.ICollection<Utxo>> |
GetDogeTransactionAsync(SendTxData, BitcoinAddress, ICollection<Utxo>)
Function will send standard Neblio transaction - Async version
Declaration
public static Transaction GetDogeTransactionAsync(SendTxData data, BitcoinAddress addressForTx, ICollection<Utxo> utxos)
Parameters
Type | Name | Description |
---|---|---|
SendTxData | data | Send data, please see SendTxData class for the details |
NBitcoin.BitcoinAddress | addressForTx | Address for process transaction - signature |
System.Collections.Generic.ICollection<Utxo> | utxos | Optional input neblio utxo |
Returns
Type | Description |
---|---|
NBitcoin.Transaction | New Transaction Hash - TxId |
GetDogeTransactionWithMessageAsync(SendTxData, BitcoinAddress, ICollection<Utxo>)
Function will send standard Neblio transaction with included message.
Declaration
public static Transaction GetDogeTransactionWithMessageAsync(SendTxData data, BitcoinAddress addressForTx, ICollection<Utxo> utxos)
Parameters
Type | Name | Description |
---|---|---|
SendTxData | data | Send data, please see SendTxData class for the details - this include field for custom message |
NBitcoin.BitcoinAddress | addressForTx | Address for process transaction - signature |
System.Collections.Generic.ICollection<Utxo> | utxos | Optional input neblio utxo |
Returns
Type | Description |
---|---|
NBitcoin.Transaction | New Transaction Hash - TxId |
GetTransactionWithDogecoinInputs(ICollection<Utxo>, BitcoinAddress)
This function will crate empty Transaction object based on Neblio network standard Then add the Neblio Inputs and sumarize their value
Declaration
public static (Transaction, double) GetTransactionWithDogecoinInputs(ICollection<Utxo> dutxos, BitcoinAddress address)
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.ICollection<Utxo> | dutxos | List of Dogecoin Utxos to use |
NBitcoin.BitcoinAddress | address | Address of the owner |
Returns
Type | Description |
---|---|
System.ValueTuple<NBitcoin.Transaction, System.Double> | (NBitcoin Transaction object, sum of all inputs values in double) |
IsPrivateKeyValid(String)
Verify the Dogecoin private key
Declaration
public static CommonReturnTypeDto IsPrivateKeyValid(string privatekey)
Parameters
Type | Name | Description |
---|---|---|
System.String | privatekey | Excpected Dogecoin private key |
Returns
Type | Description |
---|---|
CommonReturnTypeDto | true and NBitcoin.BitcoinSecret if it is correct Dogecoin private key |
ParseDogeMessage(GetTransactionInfoResponse)
Parse Message from Doge transaction (from OP_RETURN)
Declaration
public static CommonReturnTypeDto ParseDogeMessage(GetTransactionInfoResponse txinfo)
Parameters
Type | Name | Description |
---|---|---|
GetTransactionInfoResponse | txinfo |
Returns
Type | Description |
---|---|
CommonReturnTypeDto |
ParseTotalSentValue(GetTransactionInfoResponse)
Parse the total sent value from Doge Tx Info. It takes all outputs together.
Declaration
public static CommonReturnTypeDto ParseTotalSentValue(GetTransactionInfoResponse txinfo)
Parameters
Type | Name | Description |
---|---|---|
GetTransactionInfoResponse | txinfo |
Returns
Type | Description |
---|---|
CommonReturnTypeDto |
SendDogeTransactionWithMessageMultipleOutputAsync(Dictionary<String, Double>, BitcoinAddress, ICollection<Utxo>, String, String)
Function will send standard Neblio transaction with message and outputs which goes to different addresses
Declaration
public static Transaction SendDogeTransactionWithMessageMultipleOutputAsync(Dictionary<string, double> receiverAmount, BitcoinAddress addressForTx, ICollection<Utxo> utxos, string password = "", string message = "")
Parameters
Type | Name | Description |
---|---|---|
System.Collections.Generic.Dictionary<System.String, System.Double> | receiverAmount | Dictionary of all receivers and amounts to send them |
NBitcoin.BitcoinAddress | addressForTx | Address for process transaction - signature |
System.Collections.Generic.ICollection<Utxo> | utxos | Optional input neblio utxo |
System.String | password | Password for encrypted key if it is encrypted and locked |
System.String | message | Custom message |
Returns
Type | Description |
---|---|
NBitcoin.Transaction | New Transaction Hash - TxId |
SignAndBroadcastTransaction(Transaction, BitcoinSecret, ICollection<Utxo>)
Function will sign transaction with provided key and broadcast with Neblio API
Declaration
public static async Task<string> SignAndBroadcastTransaction(Transaction transaction, BitcoinSecret key, ICollection<Utxo> utxos)
Parameters
Type | Name | Description |
---|---|---|
NBitcoin.Transaction | transaction | NBitcoin Transaction object |
NBitcoin.BitcoinSecret | key | NBitcoin Key - must contain Private Key |
System.Collections.Generic.ICollection<Utxo> | utxos | List of the input utxos |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> | New Transaction Hash - TxId |
TransactionInfoAsync(String, Boolean)
Return transaction object
Declaration
public static async Task<GetTransactionInfoResponse> TransactionInfoAsync(string txid, bool fromMemory = false)
Parameters
Type | Name | Description |
---|---|---|
System.String | txid | |
System.Boolean | fromMemory |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<GetTransactionInfoResponse> |
ValidateDogeAddress(String)
Verify the Dogecoin address
Declaration
public static CommonReturnTypeDto ValidateDogeAddress(string dogeAddress)
Parameters
Type | Name | Description |
---|---|---|
System.String | dogeAddress | Excpected Dogecoin address |
Returns
Type | Description |
---|---|
CommonReturnTypeDto | true and Address if it is correct Dogecoin Address |
VENFTBroadcastTxAsync(VENFTBroadcastTxRequest)
Broadcast of signed transaction. with VENFT API
Declaration
public static async Task<string> VENFTBroadcastTxAsync(VENFTBroadcastTxRequest data)
Parameters
Type | Name | Description |
---|---|---|
VENFTBroadcastTxRequest | data | tx hex |
Returns
Type | Description |
---|---|
System.Threading.Tasks.Task<System.String> |