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())); }
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); }
//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); }
public async Task <string> GetDecimals() { var result = await GetTokenDecimals.SendRequestAsync().ConfigureAwait(false); return(result.Stack[0].Value.ToString()); }