static JToken StackItemToJson(StackItem item, string?typeHint) { return(typeHint switch { "Boolean" => item.GetBoolean().ToString(), "Integer" => item.GetBigInteger().ToString(), "String" => item.GetString(), _ => item switch { Neo.VM.Types.Boolean _ => item.GetBoolean().ToString(), Neo.VM.Types.ByteArray _ => $"{item.GetBigInteger().ToHexString()} ({item.GetString()})", Neo.VM.Types.Integer _ => item.GetBigInteger().ToString(), Neo.VM.Types.Array array => new JArray(array.Select(i => StackItemToJson(i, null))), _ => throw new NotSupportedException(item.GetType().Name), } });
public ByteArrayStackItem(byte[] value) : base(value) { _item = new Neo.VM.Types.ByteArray(value); }
public ByteArrayStackItem(Neo.VM.Types.ByteArray item) : base(item.GetByteArray()) { _item = item; }