trustwallet / wallet-connect-swift

WalletConnect Swift client SDK
MIT License
102 stars 130 forks source link

Method Parsing Error: The operation couldn’t be completed #29

Closed muhibpirani closed 4 years ago

muhibpirani commented 4 years ago

Hello,

I am receiving following parsing error when I try to parse method "personal_sign" and "eth_signTypedData".

Error: onReceiveMessage error: The operation couldn’t be completed. (ProjectName.WCError error 1.)

Please check the sample responses:

  1. {"id":1591192697963930,"jsonrpc":"2.0","method":"personal_sign","params":["0xff23dfebda182be2dcea172b545b656b89215e23490859bf3377923e50c7d132"]}

{"id":1591192738365970,"jsonrpc":"2.0","method":"eth_signTypedData","params":[{"visible":false,"txID":"4cac5a8fab5de7f10824c02caa7419ca71f190436476e79a460b33c44f556559","raw_data":{"contract":[{"parameter":{"value":{"amount":1000000,"owner_address":"3ffbaaf54f9166c1c17e94f71bff9eb","to_address":"3f5e6bee2355afad7d3ad18aa9"},"type_url":"type.googleapis.com/protocol.TransferContract"},"type":"TransferContract"}],"ref_block_bytes":"03cc","ref_block_hash":"9a65b84bb66bdf74","expiration":1591192797000,"timestamp":1591192737877},"raw_data_hex":"0a0203cc22089a65b84bb66bdf7440c8feecd3a72e5a67080112630a2d747970652e676f6f676c65617069732e636f6d2f70726f746f636f6c2e5472616e73666572436f6e747261637412320a153ffbaaf54f9166c1c17e94f71bff9eb14539f9790c12153f5e6bee2355afad7d3ad18aa9c7f7bbb550f8209518c0"}]}

hewigovens commented 4 years ago

please check your data with:

  1. https://github.com/trustwallet/wallet-connect-swift/blob/master/Example/Tests/test_data/personal_sign.json
  2. https://github.com/trustwallet/wallet-connect-swift/blob/master/Example/Tests/test_data/sign_typed_string.json

looks like not a valid signing payload

muhibpirani commented 4 years ago

@hewigovens , personal_sign structure is the same as your test_data/personal_sign.json. Can you please check why it is not parsing? I agree that "eth_signTypedData" doesn't have a valid format.

hewigovens commented 4 years ago

personal_sign params: [sig, address], where did you get this test data??