Пример #1
0
        public async Task <int> GetDecimals(string tokenScriptHash)
        {
            var result = await GetTokenDecimals.SendRequestAsync(tokenScriptHash);

            if (result.State == "FAULT, BREAK")
            {
                throw new RpcResponseException(new RpcError(0, "RPC state response: FAULT, BREAK "));
            }

            return(int.Parse(result.Stack[0].Value.ToString()));
        }
Пример #2
0
        public async Task <string> GetDecimals()
        {
            string decimals = string.Empty;

            var result = await GetTokenDecimals.SendRequestAsync();

            if (result != null)
            {
                decimals = result.Stack[0].Value.ToString();
            }
            return(decimals);
        }
Пример #3
0
        //TODO: can refractor this more
        public void ChangeTokenScripHash(string tokenScriptHash)
        {
            if (string.IsNullOrEmpty(tokenScriptHash))
            {
                throw new ArgumentNullException(nameof(tokenScriptHash));
            }

            TokenScriptHash = tokenScriptHash;
            GetTokenBalance.ChangeScriptHash(tokenScriptHash);
            GetTokenDecimals.ChangeScriptHash(tokenScriptHash);
            GetTokenName.ChangeScriptHash(tokenScriptHash);
            GetTokenTotalSupply.ChangeScriptHash(tokenScriptHash);
            GetTokenSymbol.ChangeScriptHash(tokenScriptHash);
        }
Пример #4
0
        public async Task <string> GetDecimals()
        {
            var result = await GetTokenDecimals.SendRequestAsync().ConfigureAwait(false);

            return(result.Stack[0].Value.ToString());
        }