示例#1
0
            /**
             * Mint asset to Alice address
             */
            async Task <string> GenerateAsset()
            {
                var aliceAddress  = _aliceWallet.GetAddress();
                var generateAsset = new AssetGen(TOKEN_NAME, 1000000m, aliceAddress);
                var memo          = new MemoEntry(new[] { "Generate 1000000m CookiePoints." });

                var tx = TransactionCreator.SimpleSignedTransaction(
                    new ITransactionEntry[] { generateAsset, memo },
                    new[] { _aliceWallet.GetPrivateKey() });

                await _transactionService.SendTransaction(tx);

                return(tx.Id.ToString());
            }
示例#2
0
        /// <summary>
        ///  Make Asset Table Method
        /// </summary>
        /// <param name="client"></param>
        /// <returns>tx.Id</returns>
        private static async Task <string> CreateAssetTable(IClient client)
        {
            //Get PublicKey from Utils's GetOwnerKeyPair()
            var aliceAddress = new PublicKeyAddress(Utils.GetOwnerKeyPair().PublicKey);
            var assetTable   = new CreateTable(new AssetTableDescriptor(
                                                   TableName, false, false, new[] { aliceAddress }));

            var memo = new MemoEntry(new[] { "Hinatazaka_Token" });
            var tx   = TransactionCreator.SimpleSignedTransaction(
                new ITransactionEntry[] { assetTable, memo },
                new[] { Utils.GetTableAdminKeyPair().PrivateKey });

            await SendTransaction(tx);

            return(tx.Id.ToString());
        }
示例#3
0
            /**
             * Create the Asset table for Alice.
             */
            async Task <string> CreateTable()
            {
                var aliceAddress = _aliceWallet.GetAddress();

                // Create a new asset table with alice's address set as a owner.
                // A Table admin key is required to send this transaction.
                var assetTable = new CreateTable(new AssetTableDescriptor(
                                                     TOKEN_NAME, false, false, new[] { aliceAddress }));
                var memo = new MemoEntry(new[] { "Point system for Alice's shops" });

                var tx = TransactionCreator.SimpleSignedTransaction(
                    new ITransactionEntry[] { assetTable, memo },
                    new[] { PrivateKey.Parse(TABLE_ADMIN_PRIVATE_KEY) });

                await _transactionService.SendTransaction(tx);

                return(tx.Id.ToString());
            }