Ejemplo n.º 1
0
 /// <summary>
 /// Executes a change key operation, changing "account" public key for a new one.
 /// </summary>
 /// <remarks>Note that new one public key can be another Wallet public key, or none.When none, it's like a transaction, tranferring account owner to an external owner</remarks>
 /// <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="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 Object in "Operation Object" format. Otherwise, will return a JSON-RPC error code with description</returns>
 public static Task <OperationDTO> ChangeKeyAsync(this IMicroCoinClient client, uint account, uint account_signer, string new_enc_pubkey, string new_b58_pubkey, decimal fee, byte[] payload = null, PayloadEncryptionMethod?payloadMethod = null, string pwd = null)
 {
     return(Task.Run(() => client.ChangeKey(account, account_signer, new_enc_pubkey, new_b58_pubkey, fee, payload, payloadMethod, pwd)));
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Signs a "List Account For Sale" operation.
 /// </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="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>
 /// <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> SignListAccountForSaleAsync(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, 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.SignListAccountForSale(account_target, account_signer, price, seller_account, new_b58_pubkey, new_enc_pubkey, locked_until_block, last_n_operation, fee, payload, payloadMethod, pwd, signer_b58_pubkey, signer_enc_pubkey, rawoperations)));
 }
 /// <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">PASCURRENCY - 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 <RawOperation> SignDelistAccountForSaleAsync(this IPascalCoinClient 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)));
 }
Ejemplo n.º 4
0
 public virtual RawOperation SignListAccountForSale(uint account_target, uint account_signer, decimal price, uint seller_account, string new_b58_pubkey, string new_enc_pubkey, uint locked_until_block, 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(Invoke <RawOperation>(ApiMethodName.signlistaccountforsale.ToString(), new Dictionary <string, object>()
     {
         ["account_target"] = account_target,
         ["account_signer"] = account_signer,
         ["price"] = price,
         ["seller_account"] = seller_account,
         ["new_b58_pubkey"] = new_b58_pubkey,
         ["new_enc_pubkey"] = new_enc_pubkey,
         ["locked_until_block"] = locked_until_block,
         ["last_n_operation"] = last_n_operation,
         ["fee"] = fee,
         ["payload"] = payload?.ToHexString(),
         ["payloadMethod"] = ToPayloadMethodString(payloadMethod),
         ["pwd"] = pwd,
         ["signer_b58_pubkey"] = signer_b58_pubkey,
         ["signer_enc_pubkey"] = signer_enc_pubkey,
         ["rawoperations"] = rawoperations,
     }));
 }
 /// <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 PASCURRENCY value.</param>
 /// <param name="fee">Fee of the operation. This is a PASCURRENCY 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 <Operation> BuyAccountAsync(this IPascalCoinClient 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>
 /// 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 <RawOperation> SignSendToAsync(this IPascalCoinClient 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)));
 }
 public virtual OperationDTO SignChangeAccountInfo(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(Invoke <OperationDTO>(ApiMethodName.signchangeaccountinfo.ToString(), new Dictionary <string, object>()
     {
         ["account_target"] = account_target,
         ["account_signer"] = account_signer,
         ["new_enc_pubkey"] = new_enc_pubkey,
         ["new_enc_pubkey"] = new_enc_pubkey,
         ["new_name"] = new_name,
         ["new_type"] = new_type,
         ["last_n_operation"] = last_n_operation,
         ["fee"] = fee,
         ["payload"] = payload?.ToHexString(),
         ["payloadMethod"] = ToPayloadMethodString(payloadMethod),
         ["pwd"] = pwd,
         ["signer_b58_pubkey"] = signer_b58_pubkey,
         ["signer_enc_pubkey"] = signer_enc_pubkey,
         ["rawoperations"] = rawoperations,
     }));
 }
 /// <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">PASCURRENCY - 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 <Operation> ListAccountForSaleAsync(this IPascalCoinClient 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)));
 }
 public virtual OperationDTO ListAccountForSale(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(Invoke <OperationDTO>(ApiMethodName.listaccountforsale.ToString(), new Dictionary <string, object>()
     {
         ["account_target"] = account_target,
         ["account_signer"] = account_signer,
         ["price"] = price,
         ["seller_account"] = seller_account,
         ["new_b58_pubkey"] = new_b58_pubkey,
         ["new_enc_pubkey"] = new_enc_pubkey,
         ["locked_until_block"] = locked_until_block,
         ["fee"] = fee,
         ["payload"] = payload.ToHexString(),
         ["payloadMethod"] = ToPayloadMethodString(payloadMethod),
         ["pwd"] = pwd,
     }));
 }
 public virtual OperationDTO DelistAccountForSale(uint account_target, uint account_signer, decimal fee, byte[] payload = null, PayloadEncryptionMethod?payloadMethod = null, string pwd = null)
 {
     return(Invoke <OperationDTO>(ApiMethodName.delistaccountforsale.ToString(), new Dictionary <string, object>()
     {
         ["account_target"] = account_target,
         ["account_signer"] = account_signer,
         ["fee"] = fee,
         ["payload"] = payload.ToHexString(),
         ["payloadMethod"] = ToPayloadMethodString(payloadMethod),
         ["pwd"] = pwd,
     }));
 }
 public virtual OperationDTO[] ChangeKeys(string accounts, string new_enc_pubkey, string new_b58_pubkey, decimal fee, byte[] payload = null, PayloadEncryptionMethod?payloadMethod = null, string pwd = null)
 {
     return(Invoke <OperationDTO[]>(ApiMethodName.changekeys.ToString(), new Dictionary <string, object>()
     {
         ["accounts"] = accounts,
         ["new_enc_pubkey"] = new_enc_pubkey,
         ["new_b58_pubkey"] = new_b58_pubkey,
         ["fee"] = fee,
         ["payload"] = payload.ToHexString(),
         ["payloadMethod"] = ToPayloadMethodString(payloadMethod),
         ["pwd"] = pwd,
     }));
 }
 public virtual OperationDTO SendTo(uint sender, uint target, decimal amount, decimal fee, byte[] payload = null, PayloadEncryptionMethod?payloadMethod = null, string pwd = null)
 {
     return(Invoke <OperationDTO>(ApiMethodName.sendto.ToString(), new Dictionary <string, object>()
     {
         ["sender"] = sender,
         ["target"] = target,
         ["amount"] = amount,
         ["fee"] = fee,
         ["payload"] = payload?.ToHexString(),
         ["payloadMethod"] = ToPayloadMethodString(payloadMethod),
         ["pwd"] = pwd
     }));
 }
Ejemplo n.º 13
0
 public virtual Operation BuyAccount(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(Invoke <Operation>(ApiMethodName.buyaccount.ToString(), new Dictionary <string, object>()
     {
         ["buyer_account"] = buyer_account,
         ["account_to_purchase"] = account_to_purchase,
         ["price"] = price,
         ["seller_account"] = seller_account,
         ["new_b58_pubkey"] = new_b58_pubkey,
         ["new_enc_pubkey"] = new_enc_pubkey,
         ["amount"] = amount,
         ["fee"] = fee,
         ["payload"] = payload.ToHexString(),
         ["payloadMethod"] = ToPayloadMethodString(payloadMethod),
         ["pwd"] = pwd,
     }));
 }
 /// <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 <Operation> SendToAsync(this IPascalCoinClient 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)));
 }
 public virtual RawOperationDTO SignSendTo(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(Invoke <RawOperationDTO>(ApiMethodName.signsendto.ToString(), new Dictionary <string, object>()
     {
         ["sender"] = sender,
         ["target"] = target,
         ["sender_enc_pubkey"] = sender_enc_pubkey,
         ["sender_b58_pubkey"] = sender_b58_pubkey,
         ["target_enc_pubkey"] = target_enc_pubkey,
         ["target_b58_pubkey"] = target_b58_pubkey,
         ["last_n_operation"] = last_n_operation,
         ["amount"] = amount,
         ["fee"] = fee,
         ["payload"] = payload.ToHexString(),
         ["payloadMethod"] = ToPayloadMethodString(payloadMethod),
         ["pwd"] = pwd,
         ["rawoperations"] = rawoperations,
     }));
 }
 /// <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">PASCURRENCY - 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 <Operation[]> ChangeKeysAsync(this IPascalCoinClient 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)));
 }
 public virtual RawOperationDTO SignChangeKey(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(Invoke <RawOperationDTO>(ApiMethodName.signchangekey.ToString(), new Dictionary <string, object>()
     {
         ["account"] = account,
         ["account_signer"] = account_signer,
         ["old_enc_pubkey"] = old_enc_pubkey,
         ["old_b58_pubkey"] = old_b58_pubkey,
         ["new_enc_pubkey"] = new_enc_pubkey,
         ["new_b58_pubkey"] = new_b58_pubkey,
         ["last_n_operation"] = last_n_operation,
         ["fee"] = fee,
         ["payload"] = payload.ToHexString(),
         ["payloadMethod"] = ToPayloadMethodString(payloadMethod),
         ["pwd"] = pwd,
         ["rawoperations"] = rawoperations,
     }));
 }
 /// <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">PASCURRENCY - 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 <Operation> DelistAccountForSaleAsync(this IPascalCoinClient 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)));
 }
 public virtual RawOperationDTO SignDelistAccountForSale(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(Invoke <RawOperationDTO>(ApiMethodName.signdelistaccountforsale.ToString(), new Dictionary <string, object>()
     {
         ["account_target"] = account_target,
         ["account_signer"] = account_signer,
         ["last_n_operation"] = last_n_operation,
         ["fee"] = fee,
         ["payload"] = payload.ToHexString(),
         ["payloadMethod"] = ToPayloadMethodString(payloadMethod),
         ["pwd"] = pwd,
         ["signer_b58_pubkey"] = signer_b58_pubkey,
         ["signer_enc_pubkey"] = signer_enc_pubkey,
         ["rawoperations"] = 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">PASCURRENCY - 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 <Operation> SignChangeAccountInfo(this IPascalCoinClient 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)));
 }
 public virtual RawOperationDTO SignBuyAccount(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(Invoke <RawOperationDTO>(ApiMethodName.signbuyaccount.ToString(), new Dictionary <string, object>()
     {
         ["buyer_account"] = buyer_account,
         ["account_to_purchase"] = account_to_purchase,
         ["price"] = price,
         ["seller_account"] = seller_account,
         ["new_b58_pubkey"] = new_b58_pubkey,
         ["new_enc_pubkey"] = new_enc_pubkey,
         ["amount"] = amount,
         ["last_n_operation"] = last_n_operation,
         ["fee"] = fee,
         ["payload"] = payload.ToHexString(),
         ["payloadMethod"] = ToPayloadMethodString(payloadMethod),
         ["pwd"] = pwd,
         ["signer_b58_pubkey"] = signer_b58_pubkey,
         ["signer_enc_pubkey"] = signer_enc_pubkey,
         ["rawoperations"] = rawoperations,
     }));
 }
 /// <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 <RawOperation> SignChangeKeyAsync(this IPascalCoinClient 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)));
 }
 protected string ToPayloadMethodString(PayloadEncryptionMethod?payload)
 {
     return(payload != null?ToPayloadMethodString(payload.Value) : null);
 }
 /// <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 PASCURRENCY 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 PASCURRENCY 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 <RawOperation> SignBuyAccountAsync(this IPascalCoinClient 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)));
 }
Ejemplo n.º 25
0
 public virtual Operation ChangeKey(uint account, uint account_signer, string new_enc_pubkey, string new_b58_pubkey, decimal fee, byte[] payload = null, PayloadEncryptionMethod?payloadMethod = null, string pwd = null)
 {
     return(Invoke <Operation>(ApiMethodName.changekey.ToString(), new Dictionary <string, object>()
     {
         ["account"] = account,
         ["account_signer"] = account_signer,
         ["new_enc_pubkey"] = new_enc_pubkey,
         ["new_b58_pubkey"] = new_b58_pubkey,
         ["fee"] = fee,
         ["payload"] = payload?.ToHexString(),
         ["payloadMethod"] = ToPayloadMethodString(payloadMethod),
         ["pwd"] = pwd
     }));
 }