Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(wallet-connect): switch to the safe-apps-provider under the hood #537

Merged
merged 2 commits into from
Oct 5, 2022

Conversation

mmv08
Copy link
Member

@mmv08 mmv08 commented Sep 29, 2022

This came out as an attempt to fix #377

What it solves

It switches the walletconnect Safe App to the safe-apps-provider package, so in case we change the handling of any of the RPC requests for the Safe Apps we can simply update it once in the SDK and bump the package version

How to test it

Connect to your favourite app, transact with it and make sure everything is sound

Why #377 wasn't solved

The problem is that in the case of walletconnect most of the wallet libraries are using the wallet provider only for WRITE requests, and READ requests are performed with a separate provider:

  1. Chase wallet libraries to adjust the behaviour and use the connector for read requests
  2. Adjust .sendTransaction behaviour not to return safeTxHash right away and poll for the ethereum transaction hash
  3. Do nothing and encourage apps to add Safe Apps support where this should work

I’m personally leaning towards 3) as the easiest option

@github-actions
Copy link

CLA Assistant Lite All Contributors have signed the CLA.

@github-actions
Copy link

github-actions bot commented Sep 29, 2022

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@mmv08 mmv08 requested review from rmeissner, yagopv, DaniSomoza and dasanra and removed request for rmeissner September 29, 2022 14:18
result = safeTxHash
break
}
case 'gs_multi_send': {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I supose this was a test method that wasn't still implemented?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the method for batching transactions implemented by the OG app. I'm not sure if it's widely used. Quick GitHub search shows 1-2 apps: https://github.com/search?q=gs_multi_send&type=code

I think the mobile app continues to support it, so if we want to keep the support, we can implement it in the provider

}

let result = await web3Provider.send(payload.method, payload.params)
console.log({ result })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remember to remove this 😄

@mmv08
Copy link
Member Author

mmv08 commented Sep 30, 2022

@dasanra there are some challenges related to the gs_multi_send migration to the provider, I outlined them in this ticket safe-global/safe-apps-sdk#373

@github-actions
Copy link

github-actions bot commented Oct 4, 2022

ESLint Summary View Full Report

Annotations are provided inline on the Files Changed tab. You can also see all annotations that were generated on the annotations page.

Type Occurrences Fixable
Errors 0 0
Warnings 0 0
Ignored 0 N/A
  • Result: ✅ success
  • Annotations: 0 total

Report generated by eslint-plus-action

@mmv08 mmv08 merged commit 52f1194 into development Oct 5, 2022
@mmv08 mmv08 deleted the feature/support-ethers-wait branch October 5, 2022 07:18
@github-actions github-actions bot locked and limited conversation to collaborators Oct 5, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Adjust walletconnect app to support ethers .wait method
2 participants