wallet-mobile-sdk icon indicating copy to clipboard operation
wallet-mobile-sdk copied to clipboard

Bug: requesting `eth_sendTransaction` failed with `4200: Unable to complete action`

Open runjuu opened this issue 1 year ago • 0 comments

Describe the bug

I'm using SampleClient to initiate a transaction. After confirming the request in the Coinbase Wallet app and redirecting back to SampleClient, the log shows that the action has failed with error 4200: Unable to complete action.

Steps

  1. Select Coinbase Wallet in the SampleClient app.
  2. Click Initiate handshake and confirm in Coinbase Wallet.
  3. Click Make request and confirm in Coinbase Wallet.

I've made the following changes to makeRequest to send an eth_sendTransaction request:

mwpClient.makeRequest(
-  Request(actions: [
-    Action(jsonRpc: .personal_sign(address: address, message: "message")),
-    Action(jsonRpc: .eth_signTypedData_v3(
-      address: address,
-      typedDataJson: JSONString(encode: typedData)!
-    ))
-  ])
+  Request(actions: [
+    Action(jsonRpc: .eth_sendTransaction(
+      fromAddress: address,
+      toAddress: "0x000000000000000000000000000000000000dEaD",
+      weiValue: "10000000000000",
+      data: "0x",
+      nonce: 1,
+      gasPriceInWei: "30000000000",
+      maxFeePerGas: "60000000000",
+      maxPriorityFeePerGas: "2500000000",
+      gasLimit: "1000",
+      chainId: "1"
+    ))
+  ])
) { result in

Expected behavior

Successfully sent transaction

Version

1.0.4

Additional info

No response

Desktop

No response

Smartphone

  • iOS 16.6
  • Coinbase Wallet 28.44.0

runjuu avatar Jun 02 '23 00:06 runjuu