示例#1
0
        /// <summary>
        /// Get token balance with string parameters
        /// </summary>
        /// <param name="tokenHash">token script hash, Example: "0x43cf98eddbe047e198a3e5d57006311442a0ca15"(NEO)</param>
        /// <param name="account">address, scripthash or public key string
        /// Example: address ("Ncm9TEzrp8SSer6Wa3UCSLTRnqzwVhCfuE"), scripthash ("0xb0a31817c80ad5f87b6ed390ecb3f9d312f7ceb8"), public key ("02f9ec1fd0a98796cf75b586772a4ddd41a0af07a1dbdf86a7238f74fb72503575")</param>
        /// <returns></returns>
        public Task <BigInteger> GetTokenBalanceAsync(string tokenHash, string account)
        {
            UInt160 scriptHash  = Utility.GetScriptHash(tokenHash);
            UInt160 accountHash = Utility.GetScriptHash(account);

            return(nep5API.BalanceOfAsync(scriptHash, accountHash));
        }