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

[r2r] Complete MetaMask #1591

Closed
wants to merge 48 commits into from
Closed

[r2r] Complete MetaMask #1591

wants to merge 48 commits into from

Conversation

sergeyboyko0791
Copy link

Done:

TODO:

  • Figure out how to mock the MetaMask provider to test the swaps and the wallet functionality.
  • Design a notification protocol to notify the GUI on ETH account changed.
  • Find a workaround to sign/send Swap Watcher P2P messages

* Match MetaMask RPC error
* Add and use `wallet_switch_ethereum_chain` RPC
* TODO error deserializing a nonce
* Fix `ethabi::Function::decode_input`
# Conflicts:
#	mm2src/coins/eth.rs
#	mm2src/coins/eth/web3_transport/metamask_transport.rs
* Wrap the `web3::Eip1193` transport into an event-driven pattern to make it `Send`
* Fix circle dependencies by removing `serde_json::preserve_order` feature
* Avoid using `serde_json::RawValue` for the `MmNumber`
* TODO figure out how to integrate `MetamaskSession` into `EthCoin`
* Add `MetamaskError` to all mm2 RPC errors
* Get rid of `Web3Session` that makes the code super complicated
* Add `mm2_eth` crate with EIP712 helpers
* Don't check ETH account on each RPC
* Don't return a public key on `task::connect_metamask::init`
* Try to switch the ChainId on each RPC
* Check if `WithdrawRequest::broadcast` is set
* Remove `url` and `version` fields from `AtomicDEXDomain` type
* Reimplement `ParityNonce` and `EthNonce` custom namespaces from `artemii235/rust-web3`
@sergeyboyko0791 sergeyboyko0791 changed the title [wip] Complete MetaMask [r2r] Complete MetaMask Dec 31, 2022
@sergeyboyko0791 sergeyboyko0791 changed the title [r2r] Complete MetaMask [wip] Complete MetaMask Jan 2, 2023
@sergeyboyko0791 sergeyboyko0791 changed the title [r2r] Complete MetaMask [wip] Complete MetaMask Jan 9, 2023
@shamardy shamardy mentioned this pull request Jan 10, 2023
24 tasks
* Uninline extra `SwapOps` methods
* Return a Lightning Node ID as an HTLC pubkey
Copy link
Member

@onur-ozkan onur-ozkan left a comment

Choose a reason for hiding this comment

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

Last review iteration from my side.

Thanks for the fixes for previous notes:rocket:

mm2src/crypto/src/metamask_ctx.rs Show resolved Hide resolved
mm2src/crypto/src/metamask_ctx.rs Show resolved Hide resolved
mm2src/crypto/src/metamask_ctx.rs Show resolved Hide resolved
mm2src/crypto/src/metamask_login.rs Show resolved Hide resolved
mm2src/crypto/src/metamask_login.rs Show resolved Hide resolved
mm2src/coins/eth.rs Outdated Show resolved Hide resolved
mm2src/coins/eth.rs Outdated Show resolved Hide resolved
mm2src/coins/eth.rs Show resolved Hide resolved
mm2src/coins/eth.rs Outdated Show resolved Hide resolved
mm2src/coins/eth.rs Outdated Show resolved Hide resolved
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

Great work as always! only 2 comments from me

mm2src/coins/coin_errors.rs Outdated Show resolved Hide resolved
mm2src/coins/eth.rs Outdated Show resolved Hide resolved
@sergeyboyko0791 sergeyboyko0791 changed the title [wip] Complete MetaMask [r2r] Complete MetaMask Jan 13, 2023
shamardy
shamardy previously approved these changes Jan 13, 2023
Copy link
Collaborator

@shamardy shamardy left a comment

Choose a reason for hiding this comment

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

🔥

onur-ozkan
onur-ozkan previously approved these changes Jan 15, 2023
Copy link
Member

@onur-ozkan onur-ozkan left a comment

Choose a reason for hiding this comment

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

thanks for the fixes! looks good to me:)

@sergeyboyko0791 sergeyboyko0791 dismissed stale reviews from onur-ozkan and shamardy via 0b6a4ff January 16, 2023 11:13
artemii235
artemii235 previously approved these changes Jan 16, 2023
Copy link
Member

@artemii235 artemii235 left a comment

Choose a reason for hiding this comment

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

Re-approving.

@ca333
Copy link

ca333 commented Feb 19, 2023

@sergeyboyko0791 plz resolve the conflicts

@sergeyboyko0791
Copy link
Author

sergeyboyko0791 commented Feb 19, 2023

@ca333 I would be happy to resolve them, but I can't push commits into this branch.
I'm waiting for #1651 to be merged first, because I try to merge sergeyboyko0791/atomicDEX-API/dev into KomodoPlatform/atomicDEX-API/dev. This is also the reason why I can't resolve #1633 PR issues.
@shamardy has approved the PR already.

@sergei-boiko sergei-boiko mentioned this pull request Feb 22, 2023
8 tasks
@ca333
Copy link

ca333 commented Feb 23, 2023

@ca333 I would be happy to resolve them, but I can't push commits into this branch. I'm waiting for #1651 to be merged first, because I try to merge sergeyboyko0791/atomicDEX-API/dev into KomodoPlatform/atomicDEX-API/dev. This is also the reason why I can't resolve #1633 PR issues. @shamardy has approved the PR already.

The fix/conflict-resolution could have been simply PR'd directly into https://github.com/KomodoPlatform/atomicDEX-API/tree/metamask-feature which would have resolved the situation. Either way, I will close this PR for #1674 . Thank you.

@ca333 ca333 closed this Feb 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Consider updating web3 crate Add possibility to login with metamask-like browser wallets
5 participants