/// <summary> /// Send Asset Method /// </summary> /// <param name="client"></param> /// <returns>tx.Id</returns> public async Task <Tuple <string, string> > Send(Address myaddress, Address opponetaddress, decimal amount) { var client = SetClient(); var generalApi = new GeneralApi(client); var from = myaddress; var to = opponetaddress; System.Diagnostics.Debug.WriteLine(myaddress); System.Diagnostics.Debug.WriteLine(opponetaddress); System.Diagnostics.Debug.WriteLine(amount); var privatekey = new[] { PrivateKey.Parse("263b6a4606168f64aca7c5ac1640ecb52a36142b0d96b07cb520de2eb4d237e5") }; System.Diagnostics.Debug.WriteLine(PrivateKey.Parse("263b6a4606168f64aca7c5ac1640ecb52a36142b0d96b07cb520de2eb4d237e5")); // enter the send amount var moveCoin = new AssetMove(TableName, amount, from, to); System.Diagnostics.Debug.WriteLine(moveCoin); var move = new ITransactionEntry[] { moveCoin }; System.Diagnostics.Debug.WriteLine(move); Transaction tx = TransactionCreator.SimpleSignedTransaction(moveCoin, privatekey); await this.SendTransaction(tx); var result = await Utils.WaitTx(generalApi, tx.Id); return(new Tuple <string, string>(tx.Id.ToString(), result)); }
public async Task Send(decimal amount, Address to) { var from = GetAddress(); var moveCoin = new AssetMove("CookiePoint", amount, from, to); var tx = TransactionCreator.SimpleSignedTransaction( new ITransactionEntry[] { moveCoin }, new [] { _keyPair.PrivateKey }); await _transactionService.SendTransaction(tx); }
/// <summary> /// Send Asset Method /// </summary> /// <param name="client"></param> /// <returns>tx.Id</returns> public static async Task <string> Send(IClient client) { var from = new PublicKeyAddress(Utils.GetUser0KeyPair()); var to = new PublicKeyAddress(Utils.GetUser1KeyPair()); var amount = Inputjudgement(); var moveCoin = new AssetMove(TableName, amount, from, to); var tx = TransactionCreator.SimpleSignedTransaction( new ITransactionEntry[] { moveCoin }, new [] { Utils.GetUser0KeyPair().PrivateKey }); await SendTransaction(tx); return(tx.Id.ToString()); }
/// <summary> /// Send Asset Method /// </summary> /// <param name="client"></param> /// <returns>tx.Id</returns> public async Task <Tuple <string, string> > Send(KeyPair formerprivatekey, Address myaddress, Address opponetaddress, decimal amount) { var client = this.SetClient(); var generalApi = new GeneralApi(client); var from = myaddress; var to = opponetaddress; // enter the send amount var moveCoin = new AssetMove(TableName, amount, from, to); var tx = TransactionCreator.SimpleSignedTransaction( new ITransactionEntry[] { moveCoin }, new[] { formerprivatekey.PrivateKey }); await this.SendTransaction(tx); var result = await WaitTx(generalApi, tx.Id); return(new Tuple <string, string>(tx.Id.ToString(), result)); }