コード例 #1
0
        static void Main(string[] args)
        {
            // create connection
            Con = new Connection();

            // set to testnet, remove for live net.
            Con.SetTestNet();

            // create deposit account
            DepositAccount = new AccountFactory(Con).FromEncodedAddress(ConfigurationManager.AppSettings["depositAccountAddress"]);

            // create mosaic issuer/distributor account
            SecretAccount = new AccountFactory(Con).FromPrivateKey(ConfigurationManager.AppSettings["secretAccountKey"]);

            // get required mosaic details
            MosaicToReturn = SecretAccount.GetMosaicsAsync().Result.Data.Single(
                e => e.Id.Name == ConfigurationManager.AppSettings["mosaicNameID"] &&
                e.Id.NamespaceId == ConfigurationManager.AppSettings["mosaicNameSpace"]);

            // run task to scan for incoming transactions and return x amount of asset
            ScanTransactions();

            Console.WriteLine("Bot started..");
        }