Wallet Connect Session Request Handler #34
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR, when merged, should minimally meet expectations to close #33. We introduce a method
wcRouter
that builds relevant byte array payload to for Near MPC contract to sign. It handles all immediately apparent request types (eth_sign
,personal_sign
,eth_sendTransaction
,eth_signTypedData
andeth_signTypedData_v4
).Vague Example Usage
From a browser wallet with adapter instance connected to a dapp via Wallet Connect:
Given:
Note:
evmSignature
is still in a form that no front end should have to deal with. More refined signature recovery will be introduced in a follow-up PR.(evmMessage, nearPayload)
pairing construction.Test Plan
Unit tests are added for each of the supported handler routes.
cc @SurgeCode