Closed AphobiaCat closed 5 months ago
Here is the information to fill in the check-in wallet
This error is encountered after execution
Hey @AphobiaCat
walletClient.Engine.SessionRequestEvents<EthSignTypedDataV4, string>()
is not valid, you should pass a response model, like this:
[JsonConverter(typeof(EthSignTypedDataV4ResponseJsonConverter))]
[RpcMethod("eth_signTypedData_v4"), RpcResponseOptions(Clock.ONE_MINUTE, 99993)]
public class EthSignTypedDataV4Response
{
public string Signature { get; set; }
public EthSignTypedDataV4Response(string signature)
{
Signature = signature;
}
public EthSignTypedDataV4Response()
{
}
public static implicit operator string(EthSignTypedDataV4Response d) {
return d.Signature;
}
public override string ToString()
{
return Signature;
}
}
public class EthSignTypedDataV4ResponseJsonConverter : JsonConverter
{
public override bool CanConvert(Type objectType)
{
return true;
}
public override void WriteJson(JsonWriter writer, object value, JsonSerializer serializer)
{
writer.WriteValue(value.ToString());
}
public override bool CanRead
{
get { return true; }
}
public override object ReadJson(JsonReader reader, Type objectType, object existingValue, JsonSerializer serializer)
{
return new EthSignTypedDataV4Response(reader.Value?.ToString());
}
}
Oh Thanks,I'll try it now
Hi @AphobiaCat, were you able to resolve the issue?
using System; using WalletConnectSharp.Core; using WalletConnectSharp.Sign.Models;
using WalletConnectSharp.Sign; using WalletConnectSharp.Storage;
using Nethereum.Web3.Accounts;
using WalletConnectSharp.Common.Utils; using WalletConnectSharp.Network.Models;
[RpcMethod("eth_signTypedData_v4")] [RpcRequestOptions(Clock.ONE_MINUTE, 99999)] public class EthSignTypedDataV4 : List
{
public EthSignTypedDataV4(string account, string data) : base(new[] { account, data })
{
}
}
class Program { static string projectID = "a67f7428be992afdffa43f961029112a"; static string relayUrl = "wss://relay.walletconnect.com";
}