Skip to content

Commit

Permalink
[WC v1] Fixed signTypedData_v4 routing (#3141)
Browse files Browse the repository at this point in the history
* Fixed signTypedData_v4 routing
* Add signTypedData_v3 to parser
  • Loading branch information
justindg authored Mar 13, 2023
1 parent 6203dac commit cf609cb
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,7 @@ private boolean validChainId(List<String> chains)
public void onSessionRequest(@NonNull Model.SessionRequest sessionRequest)
{
String method = sessionRequest.getRequest().getMethod();
if ("eth_signTypedData_v4".equals(method))
if (method.startsWith("eth_signTypedData"))
{
method = "eth_signTypedData";
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -390,7 +390,9 @@ open class WCClient : WebSocketListener() {
WCMethod.ETH_PERSONAL_SIGN -> {
signRequest(request, WCEthereumSignMessage.WCSignType.PERSONAL_MESSAGE)
}
WCMethod.ETH_SIGN_TYPE_DATA -> {
WCMethod.ETH_SIGN_TYPE_DATA,
WCMethod.ETH_SIGN_TYPE_DATA_V3,
WCMethod.ETH_SIGN_TYPE_DATA_V4 -> {
signRequest(request, WCEthereumSignMessage.WCSignType.TYPED_MESSAGE)
}
WCMethod.ETH_SIGN_TRANSACTION -> {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@ enum class WCMethod {
@SerializedName("eth_signTypedData")
ETH_SIGN_TYPE_DATA,

@SerializedName("eth_signTypedData_v3")
ETH_SIGN_TYPE_DATA_V3,

@SerializedName("eth_signTypedData_v4")
ETH_SIGN_TYPE_DATA_V4,

@SerializedName("eth_signTransaction")
ETH_SIGN_TRANSACTION,

Expand Down

0 comments on commit cf609cb

Please sign in to comment.