internal UnlockWalletScope(IMicroCoinClient client, string password) { _client = client; _ignore = !_client.NodeStatus().Locked; if (!_ignore) { if (!_client.Unlock(password)) { throw new MicroCoinRPCException("Unable to unlock wallet"); } } }
/// <summary> /// Executes a transaction operation from "sender" to "target" /// </summary> /// <param name="sender">Sender account</param> /// <param name="target">Destination account</param> /// <param name="amount">Coins to be transferred</param> /// <param name="fee">Fee of the operation</param> /// <param name="payload">Payload "item" that will be included in this operation</param> /// <param name="payloadMethod">Encode type of the item payload</param> /// <param name="pwd">Used to encrypt payload with aes as a payload_method. If none equals to empty password</param> /// <returns>If transaction is successfull will return a JSON Object in "Operation Object" format. Otherwise, will return a JSON-RPC error code with description</returns> public static Task <OperationDTO> SendToAsync(this IMicroCoinClient client, uint sender, uint target, decimal amount, decimal fee, byte[] payload = null, PayloadEncryptionMethod?payloadMethod = null, string pwd = null) { return(Task.Run(() => client.SendTo(sender, target, amount, fee, payload, payloadMethod, pwd))); }
/// <summary> /// Get number of available wallet accounts (total or filtered by public key) /// </summary> /// <param name="enc_pubkey">HEXASTRING (optional). If provided, return only accounts of this public key</param> /// <param name="b58_pubkey">String (optional). If provided, return only accounts of this public key. Note: If use enc_pubkey and b58_pubkey together and is not the same public key, will return an error</param> /// <param name="start">Integer (optional, default = 0). If provided, will return wallet accounts starting at this position (index starts at position 0)</param> /// <param name="max">Integer (optional, default = 100). If provided, will return max accounts. If not provided, max=100 by default</param> /// <returns>Returns an integer with total</returns> public static Task <uint> GetWalletAccountsCountAsync(this IMicroCoinClient client, string enc_pubkey = null, string b58_pubkey = null, int?start = null, int?max = null) { return(Task.Run(() => client.GetWalletAccountsCount())); }
/// <summary> /// Starts the node and the server. Starts connection process /// </summary> /// <returns>Boolean "true"</returns> public static Task <bool> StartNodeAsync(this IMicroCoinClient client) { return(Task.Run(() => client.StartNode())); }
/// <summary> /// Unlocks a locked Wallet using "pwd" param /// </summary> /// <param name="pwd"></param> /// <returns>Returns a Boolean indicating if Wallet is unlocked after using pwd password</returns> public static Task <bool> UnlockAsync(this IMicroCoinClient client, string pwd) { return(Task.Run(() => client.Unlock(pwd))); }
/// <summary> /// Find accounts by name/type and returns them as an array of Account objects /// </summary> /// <param name="name">If has value, will return the account that match name</param> /// <param name="type">If has value, will return accounts with same type</param> /// <param name="status">If has value, will filter account with status as follows: 0 = all accounts, 1 = accounts for public or private sale only, 2 = accounts for private sale only, 3 = accounts for public sale only</param> /// <param name="start">Start account (by default, 0)</param> /// <param name="max">Max of accounts returned in array (by default, 100)</param> /// <returns></returns> public static Task <AccountDTO[]> FindAccountsAsync(this IMicroCoinClient client, string name, uint?type = null, uint?status = null, uint?start = null, uint?max = null) { return(Task.Run(() => client.FindAccounts(name, type, status, start, max))); }
/// <summary> /// Returns all the current connections /// </summary> /// <returns>JSON Array with Connection Objects</returns> public static Task <ConnectionDTO[]> GetConnectionsAsync(this IMicroCoinClient client) { return(Task.Run(() => client.GetConnections())); }
/// <summary> /// Encrypt a text "paylad" using "payload_method" /// </summary> /// <param name="payload">HEXASTRING - Text to encrypt in hexadecimal format</param> /// <param name="payload_method">Payload method</param> /// <param name="pwd">Using a Password. Must provide pwd param</param> /// <returns>Returns a HEXASTRING with encrypted payload</returns> public static Task <string> PayloadEncryptAsync(this IMicroCoinClient client, string payload, PayloadEncryptionMethod payload_method, string pwd) { return(Task.Run(() => client.PayloadEncrypt(payload, payload_method, pwd))); }
/// <summary> /// Creates and signs a "Send to" operation without checking information and without transfering to the network. It's usefull for "cold wallets" that are off-line (not synchronized with the network) and only holds private keys /// </summary> /// <param name="sender">Sender account</param> /// <param name="target">Target account</param> /// <param name="sender_enc_pubkey">HEXASTRING - Public key of the sender account in encoded format</param> /// <param name="sender_b58_pubkey">HEXASTRING - Public key of the sender account in base58 format</param> /// <param name="target_enc_pubkey">HEXASTRING - Public key of the target account in encoded format</param> /// <param name="target_b58_pubkey">HEXASTRING - Public key of the target account in base58 format</param> /// <param name="last_n_operation">Last value of n_operation obtained with an Account object, for example when called to getaccount</param> /// <param name="amount">Coins to be transferred</param> /// <param name="fee">Fee of the operation</param> /// <param name="payload">Payload "item" that will be included in this operation</param> /// <param name="payloadMethod">Encode type of the item payload</param> /// <param name="pwd">Used to encrypt payload with aes as a payload_method. If none equals to empty password</param> /// <param name="rawoperations">HEXASTRING (optional) - If we want to add a sign operation with other previous operations, here we must put previous rawoperations result</param> /// <remarks>Wallet must be unlocked and sender private key (searched with provided public key) must be in wallet. No other checks are made (no checks for valid target, valid n_operation, valid amount or fee ...)</remarks> /// <remarks>Only one of sender_enc_pubkey, sender_b58_pubkey needs be provided</remarks> /// <remarks>Only one of target_enc_pubkey, target_b58_pubkey needs be provided</remarks> /// <returns>Returns a Raw Operations Object</returns> public static Task <RawOperationDTO> SignSendToAsync(this IMicroCoinClient client, uint sender, uint target, string sender_enc_pubkey, string sender_b58_pubkey, string target_enc_pubkey, string target_b58_pubkey, uint last_n_operation, decimal amount, decimal fee, byte[] payload = null, PayloadEncryptionMethod?payloadMethod = null, string pwd = null, string rawoperations = null) { return(Task.Run(() => client.SignSendTo(sender, target, sender_enc_pubkey, sender_b58_pubkey, target_enc_pubkey, target_b58_pubkey, last_n_operation, amount, fee, payload, payloadMethod, pwd, rawoperations))); }
/// <summary> /// Signs a "Change Account Info" operation, suitable for cold wallet usage. /// </summary> /// <param name="account_target">Account being changed</param> /// <param name="account_signer">Account paying the fee (must have same public key as account_target)</param> /// <param name="new_enc_pubkey">New account public key encoded in hexadecimal format</param> /// <param name="new_b58_pubkey">New account public key encoded in base58 format</param> /// <param name="new_name">New account name encoded in PascalCoin64 format (null means keep current name)</param> /// <param name="new_type">New account type (null means keep current type)</param> /// <param name="last_n_operation">Last value of n_operation obtained with an Account object, for example when called to getaccount</param> /// <param name="fee">MCC - Fee of the operation</param> /// <param name="payload">Payload "item" that will be included in this operation</param> /// <param name="payloadMethod">Encode type of the item payload</param> /// <param name="pwd">Used to encrypt payload with aes as a payload_method. If none equals to empty password</param> /// <param name="signer_b58_pubkey">The current public key of "account_signer" in base58 encoding</param> /// <param name="signer_enc_pubkey">The current public key of "account_signer" in hexadecimal encoding</param> /// <param name="rawoperations">HEXASTRING (optional) - If we want to add a sign operation with other previous operations, here we must put previous rawoperations result</param> /// <remarks>Only one or none of new_b58_pubkey, new_enc_pubkey should be used. Populating both will result in an error.</remarks> /// <returns>Returns a Raw Operations Object</returns> public static Task <OperationDTO> SignChangeAccountInfo(this IMicroCoinClient client, uint account_target, uint account_signer, string new_enc_pubkey, string new_b58_pubkey, string new_name, ushort?new_type, uint last_n_operation, decimal fee, byte[] payload = null, PayloadEncryptionMethod?payloadMethod = null, string pwd = null, string signer_b58_pubkey = null, string signer_enc_pubkey = null, string rawoperations = null) { return(Task.Run(() => client.ChangeAccountInfo(account_target, account_signer, new_enc_pubkey, new_b58_pubkey, new_name, new_type, fee, payload, payloadMethod, pwd))); }
/// <summary> /// Buy an account currently listed for sale (public or private) /// </summary> /// <param name="buyer_account">Account number of buyer who is purchasing the account</param> /// <param name="account_to_purchase">Account number being purchased</param> /// <param name="price">Settlement price of account being purchased</param> /// <param name="seller_account">Account of seller, receiving payment</param> /// <param name="new_b58_pubkey">Post-settlement public key in base58 encoded format.</param> /// <param name="new_enc_pubkey">Post-settlement public key in hexadecimal encoded format.</param> /// <param name="amount">Amount being transferred from buyer_account to seller_account (the settlement). This is a MCC value.</param> /// <param name="fee">Fee of the operation. This is a MCC value.</param> /// <param name="payload">Payload "item" that will be included in this operation</param> /// <param name="payloadMethod">Encode type of the item payload</param> /// <param name="pwd">Used to encrypt payload with aes as a payload_method. If none equals to empty password</param> /// <returns>If operation is successfull will return a JSON Object in "Operation Object" format.</returns> public static Task <OperationDTO> BuyAccountAsync(this IMicroCoinClient client, uint buyer_account, uint account_to_purchase, decimal price, uint seller_account, string new_b58_pubkey, string new_enc_pubkey, decimal amount, decimal fee, byte[] payload = null, PayloadEncryptionMethod?payloadMethod = null, string pwd = null) { return(Task.Run(() => client.BuyAccount(buyer_account, account_to_purchase, price, seller_account, new_b58_pubkey, new_enc_pubkey, amount, fee, payload, payloadMethod, pwd))); }
/// <summary> /// Adds a node to connect /// </summary> /// <param name="nodes">String containing 1 or multiple IP:port separated by "{ }"</param> /// <returns>Returns an integer with nodes added</returns> public static Task <int> AddNodeAsync(this IMicroCoinClient client, string nodes) { return(Task.Run(() => client.AddNode(nodes))); }
/// <summary> /// Delist an account from sale. /// </summary> /// <param name="account_target">Account to be delisted</param> /// <param name="account_signer">Account that signs and pays the fee (must have same public key that delisted account, or be the same)</param> /// <param name="fee">MCC - Fee of the operation</param> /// <param name="payload">Payload "item" that will be included in this operation</param> /// <param name="payloadMethod">Encode type of the item payload</param> /// <param name="pwd">Used to encrypt payload with aes as a payload_method. If none equals to empty password</param> /// <returns>If operation is successfull will return a JSON Object in "Operation Object" format.</returns> public static Task <OperationDTO> DelistAccountForSaleAsync(this IMicroCoinClient client, uint account_target, uint account_signer, decimal fee, byte[] payload = null, PayloadEncryptionMethod?payloadMethod = null, string pwd = null) { return(Task.Run(() => client.DelistAccountForSale(account_target, account_signer, fee, payload, payloadMethod, pwd))); }
/// <summary> /// Lists an account for sale (public or private) /// </summary> /// <param name="account_target">Account to be listed</param> /// <param name="account_signer">Account that signs and pays the fee (must have same public key that listed account, or be the same)</param> /// <param name="price">price account can be purchased for</param> /// <param name="seller_account">Account that will receive "price" amount on sell</param> /// <param name="new_b58_pubkey">Base58 encoded public key (for private sale only)</param> /// <param name="new_enc_pubkey">Hex-encoded public key (for private sale only)</param> /// <param name="locked_until_block">Block number until this account will be locked (a locked account cannot execute operations while locked)</param> /// <param name="fee">MCC - Fee of the operation</param> /// <param name="payload">Payload "item" that will be included in this operation</param> /// <param name="payloadMethod">Encode type of the item payload</param> /// <param name="pwd">Used to encrypt payload with aes as a payload_method. If none equals to empty password</param> /// <remarks>Only one or none of new_b58_pubkey, new_enc_pubkey should be used. Populating both will result in an error.</remarks> /// <returns>If operation is successfull will return a JSON Object in "Operation Object" format.</returns> public static Task <OperationDTO> ListAccountForSaleAsync(this IMicroCoinClient client, uint account_target, uint account_signer, decimal price, uint seller_account, string new_b58_pubkey, string new_enc_pubkey, uint locked_until_block, decimal fee, byte[] payload = null, PayloadEncryptionMethod?payloadMethod = null, string pwd = null) { return(Task.Run(() => client.ListAccountForSale(account_target, account_signer, price, seller_account, new_b58_pubkey, new_enc_pubkey, locked_until_block, fee, payload, payloadMethod, pwd))); }
/// <summary> /// Executes a change key operation, changing "account" public key for a new one, in multiple accounts Works like changekey /// </summary> /// <param name="accounts">List of accounts separated by a comma</param> /// <param name="new_enc_pubkey">HEXASTRING - New public key in encoded format</param> /// <param name="new_b58_pubkey">New public key in Base 58 format (the same that Application Wallet exports)</param> /// <param name="fee">MCC - Fee of the operation</param> /// <param name="payload">Payload "item" that will be included in this operation</param> /// <param name="payloadMethod">Encode type of the item payload</param> /// <param name="pwd">Used to encrypt payload with aes as a payload_method. If none equals to empty password</param> /// <returns>If operation is successfull will return a JSON Array with Operation object items for each key If operation cannot be made, a JSON-RPC error message is returned</returns> public static Task <OperationDTO[]> ChangeKeysAsync(this IMicroCoinClient client, string accounts, string new_enc_pubkey, string new_b58_pubkey, decimal fee, byte[] payload = null, PayloadEncryptionMethod?payloadMethod = null, string pwd = null) { return(Task.Run(() => client.ChangeKeys(accounts, new_enc_pubkey, new_b58_pubkey, fee, payload, payloadMethod, pwd))); }
/// <summary> /// Encodes a public key based on params information /// </summary> /// <param name="ec_nid">key type</param> /// <param name="x">HEXASTRING with x value of public key</param> /// <param name="y">HEXASTRING with y value of public key</param> /// <returns>Returns a HEXASTRING with encoded public key</returns> public static Task <string> EncodePubKeyAsync(this IMicroCoinClient client, KeyType ec_nid, string x, string y) { return(Task.Run(() => client.EncodePubKey(ec_nid, x, y))); }
/// <summary> /// Decodes an encoded public key /// </summary> /// <param name="enc_pubkey">HEXASTRING with encoded public key</param> /// <param name="b58_pubkey">String. b58_pubkey is the same value that Application Wallet exports as a public key</param> /// <remarks>Note: If use enc_pubkey and b58_pubkey together and is not the same public key, will return an error</remarks> /// <returns>Returns a JSON Object with a "Public Key Object"</returns> public static Task <PublicKeyDTO> DecodePubKeyAsync(this IMicroCoinClient client, string enc_pubkey, string b58_pubkey) { return(Task.Run(() => client.DecodePubKey(enc_pubkey, b58_pubkey))); }
/// <summary> /// Creates and signs a "Change key" operation without checking information and without transfering to the network. It's useful for "cold wallets" that are off-line (not synchronized with the network) and only holds private keys /// </summary> /// <param name="account">Account number to change key</param> /// <param name="account_signer">Account that signs and pays the fee (must have same public key that delisted account, or be the same)</param> /// <param name="old_enc_pubkey">HEXASTRING - Public key of the account in encoded format</param> /// <param name="old_b58_pubkey">HEXASTRING - Public key of the account in base58 format</param> /// <param name="new_enc_pubkey">HEXASTRING - Public key of the new key for the account in encoded format</param> /// <param name="new_b58_pubkey">HEXASTRING - Public key of the new key for the account in base58 format</param> /// <param name="last_n_operation">Last value of n_operation obtained with an Account object, for example when called to getaccount</param> /// <param name="fee">Fee of the operation</param> /// <param name="payload">Payload "item" that will be included in this operation</param> /// <param name="payloadMethod">Encode type of the item payload</param> /// <param name="pwd">Used to encrypt payload with aes as a payload_method. If none equals to empty password</param> /// <param name="rawoperations">HEXASTRING (optional) - If we want to add a sign operation with other previous operations, here we must put previous rawoperations result</param> /// <remarks>Wallet must be unlocked and private key (searched with provided public key) must be in wallet. No other checks are made (no checks for valid n_operation, valid fee ...) </remarks> /// <remarks>Only one of old_enc_pubkey, old_b58_pubkey needs be provided</remarks> /// <remarks>Only one of new_enc_pubkey, new_b58_pubkey needs be provided</remarks> /// <returns>Returns a Raw Operations Object</returns> public static Task <RawOperationDTO> SignChangeKeyAsync(this IMicroCoinClient client, uint account, uint account_signer, string old_enc_pubkey, string old_b58_pubkey, string new_enc_pubkey, string new_b58_pubkey, uint last_n_operation, decimal fee, byte[] payload = null, PayloadEncryptionMethod?payloadMethod = null, string pwd = null, string rawoperations = null) { return(Task.Run(() => client.SignChangeKey(account, account_signer, old_enc_pubkey, old_b58_pubkey, new_enc_pubkey, new_b58_pubkey, last_n_operation, fee, payload, payloadMethod, pwd, rawoperations))); }
/// <summary> /// Returns a HEXASTRING with decrypted text (a payload) using private keys in the wallet or a list of Passwords (used in "aes" encryption) /// </summary> /// <param name="payload">HEXASTRING - Encrypted data</param> /// <param name="pwds">List of passwords to use</param> /// <remarks>If using one of private keys is able to decrypt payload then returns value "key" in payload_method and enc_pubkey contains encoded public key in HEXASTRING</remarks> /// <remarks>If using one of passwords to decrypt payload then returns value "pwd" in payload_method and pwd contains password used</remarks> /// <returns>Decryped payload</returns> public static Task <DecryptedPayloadDTO> PayloadDecryptAsync(this IMicroCoinClient client, string payload, string[] pwds = null) { return(Task.Run(() => client.PayloadDecrypt(payload, pwds))); }
/// <summary> /// Returns a JSON Object with account information including pending operations not included in blockchain yet, but affecting this account. /// </summary> /// <remarks> /// To know if there are pending operations, must look at updated_b param.It tells last block that modified this account.If this number is equal to blockchain blocks then this account is affected by pending operations (send/receive or change key) /// </remarks> /// <param name="account">Cardinal containing account number</param> public static Task <AccountDTO> GetAccountAsync(this IMicroCoinClient client, uint account) { return(Task.Run(() => client.GetAccount(account))); }
/// <summary> /// Creates a new Private key and sotres it on the wallet, returning an enc_pubkey value /// </summary> /// <param name="ec_nid">Type of key encryption</param> /// <param name="name">Name to alias this new private key</param> /// <returns></returns> public static Task <PublicKeyDTO> AddNewKeyAsync(this IMicroCoinClient client, KeyType ec_nid, string name) { return(Task.Run(() => client.AddNewKey(ec_nid, name))); }
/// <summary> /// Signs a "Delist Account For Sale" operation, suitable for cold wallet usage. /// </summary> /// <param name="account_target">Account to be delisted</param> /// <param name="account_signer">Account that signs and pays the fee (must have same public key that delisted account, or be the same)</param> /// <param name="last_n_operation">Last value of n_operation obtained with an Account object, for example when called to getaccount</param> /// <param name="fee">MCC - Fee of the operation</param> /// <param name="payload">Payload "item" that will be included in this operation</param> /// <param name="payloadMethod">Encode type of the item payload</param> /// <param name="pwd">Used to encrypt payload with aes as a payload_method. If none equals to empty password</param> /// <param name="signer_b58_pubkey">The current public key of "account_signer" in base58 encoding</param> /// <param name="signer_enc_pubkey">The current public key of "account_signer" in hexadecimal encoding</param> /// <param name="rawoperations">HEXASTRING (optional) - If we want to add a sign operation with other previous operations, here we must put previous rawoperations result</param> /// <remarks>Only one or none of signer_b58_pubkey, signer_b58_pubkey should be used. Populating both will result in an error.</remarks> /// <returns>Returns a Raw Operations Object</returns> public static Task <RawOperationDTO> SignDelistAccountForSaleAsync(this IMicroCoinClient client, uint account_target, uint account_signer, uint last_n_operation, decimal fee, byte[] payload = null, PayloadEncryptionMethod?payloadMethod = null, string pwd = null, string signer_b58_pubkey = null, string signer_enc_pubkey = null, string rawoperations = null) { return(Task.Run(() => client.SignDelistAccountForSale(account_target, account_signer, last_n_operation, fee, payload, payloadMethod, pwd, signer_b58_pubkey, signer_enc_pubkey, rawoperations))); }
/// <summary> /// Locks the Wallet if it has a password, otherwise wallet cannot be locked /// </summary> /// <returns>Returns a Boolean indicating if Wallet is locked. If false that means that Wallet has an empty password and cannot be locked</returns> public static Task <bool> LockAsync(this IMicroCoinClient client) { return(Task.Run(() => client.Lock())); }
/// <summary> /// Signs a "Buy Account" operation, suitable for cold wallet usage. /// </summary> /// <param name="buyer_account">Account number of buyer who is purchasing the account</param> /// <param name="account_to_purchase">Account number being purchased</param> /// <param name="price">Settlement price of account being purchased</param> /// <param name="seller_account">Account of seller, receiving payment</param> /// <param name="new_b58_pubkey">Post-settlement public key in base58 encoded format.</param> /// <param name="new_enc_pubkey">Post-settlement public key in hexadecimal encoded format.</param> /// <param name="amount">Amount being transferred from buyer_account to seller_account (the settlement). This is a MCC value.</param> /// <param name="last_n_operation">Last value of n_operation obtained with an Account object, for example when called to getaccount</param> /// <param name="fee">Fee of the operation. This is a MCC value.</param> /// <param name="payload">Payload "item" that will be included in this operation</param> /// <param name="payloadMethod">Encode type of the item payload</param> /// <param name="pwd">Used to encrypt payload with aes as a payload_method. If none equals to empty password</param> /// <param name="signer_b58_pubkey">The current public key of "account_signer" in base58 encoding</param> /// <param name="signer_enc_pubkey">The current public key of "account_signer" in hexadecimal encoding</param> /// <param name="rawoperations">HEXASTRING (optional) - If we want to add a sign operation with other previous operations, here we must put previous rawoperations result</param> /// <remarks>Only one or none of new_b58_pubkey, new_enc_pubkey should be used. Populating both will result in an error.</remarks> /// <remarks>Only one or none of signer_b58_pubkey, signer_b58_pubkey should be used. Populating both will result in an error.</remarks> /// <returns>Returns a Raw Operations Object</returns> public static Task <RawOperationDTO> SignBuyAccountAsync(this IMicroCoinClient client, uint buyer_account, uint account_to_purchase, decimal price, uint seller_account, string new_b58_pubkey, string new_enc_pubkey, decimal amount, uint last_n_operation, decimal fee, byte[] payload = null, PayloadEncryptionMethod?payloadMethod = null, string pwd = null, string signer_b58_pubkey = null, string signer_enc_pubkey = null, string rawoperations = null) { return(Task.Run(() => client.SignBuyAccount(buyer_account, account_to_purchase, price, seller_account, new_b58_pubkey, new_enc_pubkey, amount, last_n_operation, fee, payload, payloadMethod, pwd, signer_b58_pubkey, signer_enc_pubkey, rawoperations))); }
/// <summary> /// Changes the password of the Wallet. (Must be previously unlocked) Note: If pwd param is empty string, then wallet will be not protected by password /// </summary> /// <param name="pwd">New password</param> /// <returns>Returns a Boolean if Wallet password changed with new pwd password</returns> public static Task <bool> SetWalletPasswordAsync(this IMicroCoinClient client, string pwd) { return(Task.Run(() => client.SetWalletPassword(pwd))); }
/// <summary> /// Returns information stored in a rawoperations param (obtained calling signchangekey or signsendto) /// </summary> /// <param name="rawoperations">HEXASTRING (obtained calling signchangekey or signsendto)</param> /// <returns>Returns a JSON Array with Operation Object items, one for each operation in rawoperations param. NOTE: Remember that rawoperations are operations that maybe are not correct</returns> public static Task <OperationDTO[]> OperationsInfoAsync(this IMicroCoinClient client, string rawoperations) { return(Task.Run(() => client.OperationsInfo(rawoperations))); }
/// <summary> /// Returns a JSON array with all wallet accounts. /// </summary> /// <param name="enc_pubkey">HEXASTRING (optional). If provided, return only accounts of this public key</param> /// <param name="b58_pubkey">String (optional). If provided, return only accounts of this public key. Note: If use enc_pubkey and b58_pubkey together and is not the same public key, will return an error</param> /// <param name="start">Integer (optional, default = 0). If provided, will return wallet accounts starting at this position (index starts at position 0)</param> /// <param name="max">Integer (optional, default = 100). If provided, will return max accounts. If not provided, max=100 by default</param> /// <returns>Each JSON array item contains an Account Object</returns> public static Task <AccountDTO[]> GetWalletAccountsAsync(this IMicroCoinClient client, string enc_pubkey = null, string b58_pubkey = null, int?start = null, int?max = null) { return(Task.Run(() => client.GetWalletAccounts(enc_pubkey, b58_pubkey, start, max))); }
/// <summary> /// Executes operations included in rawopertions param and transfers to the network. Raw operations can include "Send to" oprations or "Change key" operations. /// </summary> /// <param name="rawoperations">Executes operations included in rawopertions param and transfers to the network. Raw operations can include "Send to" oprations or "Change key" operations.</param> /// <remarks>For each Operation Object item, if there is an error, param valid will be false and param errors will show error description.Otherwise, operation is correct and will contain ophash param</remarks> /// <returns>Returns a JSON Array with Operation Object items, one for each operation in rawoperations param.</returns> public static Task <OperationDTO[]> ExecuteOperationsAsync(this IMicroCoinClient client, string rawoperations) { return(Task.Run(() => client.ExecuteOperations(rawoperations))); }
/// <summary> /// Returns a JSON Object with a public key if found in the Wallet /// </summary> /// <param name="enc_pubkey">HEXASTRING</param> /// <param name="b58_pubkey">String</param> /// <remarks>Note: If use enc_pubkey and b58_pubkey together and is not the same public key, will return an error</remarks> /// <returns>Returns a JSON Object with a "Public Key Object"</returns> public static Task <PublicKeyDTO> GetWalletPubKeyAsync(this IMicroCoinClient client, string enc_pubkey = null, string b58_pubkey = null) { return(Task.Run(() => client.GetWalletPubKey(enc_pubkey, b58_pubkey))); }
/// <summary> /// Returns information of the Node in a JSON Object /// </summary> /// <returns>JSON Object with information</returns> public static Task <NodeStatusDTO> NodeStatusAsync(this IMicroCoinClient client) { return(Task.Run(() => client.NodeStatus())); }