public async Task AnnounceTransferTransactionWithMosaicWithMessage()
        {
            KeyPair keyPair = new KeyPair(Config.PrivateKeyMain);

            TransferTransaction transaction = TransferTransaction.Create(
                NetworkType.Types.TEST_NET,
                Deadline.CreateHours(2),
                new Address("TACOPE-XRLZTU-WBQA3U-XV66R4-55L76E-NWK6OY-ITBJ"),
                new List <MosaicAmount> {
                new MosaicAmount("nem:xem", 1)
            },
                EmptyMessage.Create()
                );

            SignedTransaction signedTransaction = transaction.SignWith(keyPair);

            Console.WriteLine(signedTransaction.Hash);
            Console.WriteLine(transaction.Fee);
            TransactionResponse response = await new TransactionHttp(host).Announce(signedTransaction);

            Assert.AreEqual("SUCCESS", response.Message);
        }
        public async Task AnnounceTransferTransactionWithMosaicWithMessage()
        {
            KeyPair keyPair = KeyPair.CreateFromPrivateKey(Config.PrivateKeyMain);

            TransferTransaction transaction = TransferTransaction.Create(
                NetworkType.Types.TEST_NET,
                Deadline.CreateHours(2),
                Address.CreateFromEncoded("TACOPE-XRLZTU-WBQA3U-XV66R4-55L76E-NWK6OY-ITBJ"),
                new List <Mosaic> {
                Mosaic.CreateFromIdentifier("nem:xem", 1)
            },
                EmptyMessage.Create()
                );

            SignedTransaction signedTransaction = transaction.SignWith(keyPair);

            Console.WriteLine(signedTransaction.Hash);
            Console.WriteLine(transaction.Fee);
            TransactionResponse response = await new TransactionHttp("http://" + Config.Domain + ":7890").Announce(signedTransaction);

            Assert.AreEqual("SUCCESS", response.Message);
        }
示例#3
0
        public static async Task <bool> TransferTest()
        {
            KeyPair keyPair = KeyPair.CreateFromPrivateKey(Config.PrivateKeyMain);

            TransferTransaction transaction = TransferTransaction.Create(
                NetworkType.Types.TEST_NET,
                Deadline.CreateHours(2),
                Address.CreateFromEncoded("TBZQXJ-N7JNQL-N7ZAMC-HFFZAU-WBMPB4-4RMIZU-XKNQ"),
                new List <Mosaic> {
                Mosaic.CreateFromIdentifier("nem:xem", 1000000)
            },
                PlainMessage.Create("Sr Alejo")
                );

            SignedTransaction signedTransaction = transaction.SignWith(keyPair);

            Console.WriteLine(signedTransaction.Hash);
            Console.WriteLine(transaction.Fee);
            TransactionResponse response = await
                                           new TransactionHttp("http://" + Config.Domain + ":7890").Announce(signedTransaction);

            return(true);
        }