-
Notifications
You must be signed in to change notification settings - Fork 102
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(walletconnect): walletconnect integration #2223
base: dev
Are you sure you want to change the base?
Conversation
unfortunately the example wallet didn't add support for Is it something you can do or I can help with that |
For the EVM/WalletConnect side of things, I'm able to connect, activate coin and withdraw funds - but am failing to complete a swap. Do both swap participants (and seednode) need to be running this branch? Error logs for swap attempts:
|
message was sent to wallet successfully but did you approve the sign request from your wallet? @smk762 |
Yes, approved both times. Third attempt progressed a little further (new WC session, same swap kickstarting), but then failed towards the end (after clicking confirm button in react wallet)
|
|
Thanks, session delete works like a charm now! Using metamask app, was able to:
Attempting to withdraw a token (USDC-PLG20) returned the following error:
and in console logs:
A subsequent attempt to withdraw MATIC via metamask also failed with the same message. Withdrawal attempts for MATIC/USDC-PLG20 using walletconnect (react example) also failed, but with a different error:
With console errors:
|
So if you want to withdraw with Metamask connected set the {
"userpass": "password",
"method": "withdraw",
"mmrpc": "2.0",
"params": {
"to": "0x4A434d26fC9cACd44AaCEe20aedC70023E91ad80",
"coin": "ETH",
"amount": "0.001",
"broadcast": true
}
}
This was fixed already. |
I was able to send a tx via metamask with the Req:
Resp:
Console logs:
Explorer links:
A tx to pay gas for the token transfer looks like it happened, but there is no token transfer recorded on chain. Incidentally, when confirming tx in metamask app, it showed amount in sats - so token xfer might have been rejected due to lack of funds. A non-token transfer of MATIC itself completed as expected: https://polygonscan.com/tx/0x062fc218a48a4df7715024bdc8614e82aed9b889c2768cae5a188ec546da0fa0
Retesting withdrawal via WC react wallet, using
Console logs:
|
USDC-PLG20 / KMD swap completed successfully with React walletconnect example. Swap uuid: Transactions
|
This is incorrect: For metamask, only one EIP155 chain ID can be used in |
Logs for failed Metamask swap (failed due to low battery / screen sleep)
APPROVED (approval request shows 0.00012 USDC; correct units and ticker)
APPROVED: Spending cap in approval set to very high number (higher than balance or trade value)!
NOT APPROVED: phone screen went dark, and approval pop up disappeared when re-activated. Dont do this on 5% battery kids.
Worth noting here that unlike the USDC-PLG20 withdraw request approval confirmation pop up, in this case the units and coin ticker are correct. In terms of UX, the approval which concerns a "spending cap" of a huge number may be met with suspicion. A second metamask swap attempt (with phone plugged into charger) was successful (uuid: |
USDC-PLG20 withdraw still fails. When using params:
Metamask app approval pop up requests confirmation for 762000 ERC20 (wrong units, wrong ticker). App implies successful transfer, and logs show no errors:
Reviewing transaction on block explorer shows no movement of USDC-PLG20: https://polygonscan.com/tx/0x53ab39f4c7146a9bd72753cdcd32df4e91a40c73dfd74dcb6ec48d3dedcac6fe A withdrawal through metamask for MATIC (POL) showed the correct unit and ticker. and completed successfully.
https://polygonscan.com/tx/0xf8a2c8152ae9be8b860df859a69dd1506729b19e78f93bba48c62c9f1d0a504c |
Confirmed token withdrawals now functional on WC and metamask. |
Testing tendermint via Keplr mobile wallet:
Get Sessions shows an unexpected
Attempting to activate ATOM in KDF fails.
Resp:
Related console logs for this session:
Unable to proceed with further cosmos testing until activation succeeds. |
#1543
This PR introduces the integration of WalletConnect into the Komodo DeFi Framework (KDF), enabling secure wallet connections for Cosmos and EVM-based chains. KDF acts as the DApp(in this PR), allowing users to initiate and manage transactions securely with external wallets e.g via Metamask.
Key changes include:
Tendermint
andEVM
.Tendermint
andEVM
https://specs.walletconnect.com/2.0/specs/clients/sign/
https://specs.walletconnect.com/2.0/specs/clients/core/pairing/
https://specs.walletconnect.com/2.0/specs/clients/core/crypto/
https://specs.walletconnect.com/2.0/specs/servers/relay/
https://docs.reown.com/advanced/multichain/rpc-reference/ethereum-rpc
Additional improvements include cleanup of unused dependencies, minor code refinements, and WASM compatibility
Updated deps:
Added deps:
Removed deps:
How to test using EVM coin e.g
ETH
(Native && WASM)cargo run
)ETH
coin (set"priv_key_policy": "wallet_connect": { "session_topic": your_session_topic" }
in activation params).Note: To add more
eip155
chains, modify the chains array like this:["eip155:1", "eip155:250"]
New RPC Methods
New connection
method: wc_new_connection
Get/Retrieve Walletconnect session(s)
method: wc_get_session | wc_get_sessions
Ping Walletconnect session
method: wc_ping_session
Delete Walletconnect session
method: wc_delete_session
Active ETH/ERC
method: enable_eth_with_tokens
Active Tendermint/Cosmos
method: enable_tendermint_with_assets
cc @smk762