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: enable walletconnect #450

Open
wants to merge 32 commits into
base: master
Choose a base branch
from
Open

Conversation

andreabadesso
Copy link
Contributor

Acceptance Criteria

  • Updated walletconnect to

Security Checklist

  • Make sure you do not include new dependencies in the project unless strictly necessary and do not include dev-dependencies as production ones. More dependencies increase the possibility of one of them being hijacked and affecting us.

@andreabadesso andreabadesso marked this pull request as draft March 25, 2024 19:30
@andreabadesso andreabadesso self-assigned this Mar 25, 2024
@andreabadesso andreabadesso added the enhancement New feature or request label Mar 25, 2024
@andreabadesso andreabadesso changed the base branch from master to feat/lavamoat-integration March 25, 2024 19:30
@andreabadesso andreabadesso force-pushed the feat/enable-walletconnect branch from 218e722 to 9b85311 Compare April 12, 2024 15:50
@andreabadesso andreabadesso force-pushed the feat/lavamoat-integration branch from d3f602a to 98b3ac1 Compare April 15, 2024 16:18
@andreabadesso andreabadesso force-pushed the feat/enable-walletconnect branch from 2240d26 to 3aa74bc Compare April 15, 2024 16:22
"assert": "2.0.0",
"buffer": "4.9.2",
"console-browserify": "1.2.0",
"crypto-js": "4.1.1",
"deprecated-react-native-prop-types": "2.3.0",
"events": "1.1.1",
"ethers": "5.7.2",
"events": "3.3.0",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had to update this to the latest version as the old version didn't have events.off...

I tested most of the features and they worked, but there is no changelog in the repo.

The idea of the lib is to match the node.js implementation, so I'll check each method before merging this PR, but until then, this is open to review

Comment on lines +36 to +45
if (typeof btoa === 'undefined') {
global.btoa = function (str) {
return Buffer.from(str, 'binary').toString('base64');
};
}

if (typeof atob === 'undefined') {
global.atob = function (b64Encoded) {
return Buffer.from(b64Encoded, 'base64').toString('binary');
};
}
Copy link
Contributor Author

Choose a reason for hiding this comment

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

shims needed by wallet-connect

Copy link
Contributor

Choose a reason for hiding this comment

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

suggestion: Add this information to the code itself. Either through simple comments or function docstrings.

This way it will be easier to identify when the shims are no longer needed in the future.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added a simple comment indicating that those shims are needed by wallet-connect

6471cb6

@@ -45,6 +45,7 @@
* loaded.
*/

import '@walletconnect/react-native-compat';
Copy link
Contributor Author

Choose a reason for hiding this comment

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

@andreabadesso andreabadesso requested a review from tuliomir April 15, 2024 16:42
@andreabadesso andreabadesso marked this pull request as ready for review April 15, 2024 17:28
@andreabadesso andreabadesso force-pushed the feat/enable-walletconnect branch from 3aa74bc to 44e1876 Compare April 15, 2024 17:53
package.json Outdated Show resolved Hide resolved
shim.js Outdated Show resolved Hide resolved
// Dynamically import walletconnect modules so that it's not loaded in case
// wallet connect is not enabled.
const { Core } = yield call(() => import('@walletconnect/core'));
const { Web3Wallet } = yield call(() => import('@walletconnect/web3wallet'));
Copy link
Contributor

Choose a reason for hiding this comment

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

🌟 Nice solution!

@andreabadesso andreabadesso force-pushed the feat/enable-walletconnect branch from 44e1876 to 9701573 Compare April 24, 2024 15:23
@andreabadesso andreabadesso requested a review from tuliomir April 24, 2024 16:51
@andreabadesso andreabadesso force-pushed the feat/lavamoat-integration branch 2 times, most recently from 4c95a93 to e9a0644 Compare November 7, 2024 01:43
Base automatically changed from feat/lavamoat-integration to master November 7, 2024 10:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants