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

Bug: eth_watchAsset doesn't work #247

Open
prokhorovxo opened this issue Aug 8, 2023 · 3 comments
Open

Bug: eth_watchAsset doesn't work #247

prokhorovxo opened this issue Aug 8, 2023 · 3 comments
Labels
type: bug Something isn't working

Comments

@prokhorovxo
Copy link

prokhorovxo commented Aug 8, 2023

Describe the bug

I'm trying to make eth_watchAsset method and unfortunately always get an error inside Coinbase Wallet iOS App

Steps

  1. Install last version (now it's 28.55) of Coinbase Wallet iOS App and sign in to account
  2. Install CoinbaseWalletSDK 1.0.4 via SPM
  3. Configure MWPClient
  4. Get an instance of MWPClient calling MWPClient.getInstance(to: Wallet.coinbaseWallet)
  5. Initiate handshake like this:
mwpClient.initiateHandshake(
                    initialActions: [
                        Action(jsonRpc: .eth_requestAccounts)
                    ]
                ) { [weak owner] result, account in
                    switch result {
                        case .success(let response):
                            debugPrint(response.content)
                            
                            guard let account else { return }
                            debugPrint(account)
                            
                        case .failure(let error):
                            debugPrint(error.localizedDescription)
                        }
                }
  1. Make eth_watchAsset for Tether(USDT) request like this:
mwpClient.makeRequest(
                    Request(actions: [
                        Action(
                            jsonRpc: .wallet_watchAsset(
                                type: "ERC20",
                                options: WatchAssetOptions(
                                    address: "0xdAC17F958D2ee523a2206206994597C13D831ec7",
                                    symbol: "USDT",
                                    decimals: 6,
                                    image: "https://etherscan.io/token/images/tethernew_32.png"
                                )
                            )
                        )
                    ])
                ) { result in
                    debugPrint(result)
                    // ...
                }
  1. Dapp redirects to Coinbase Wallet iOS App, then Coinbase Wallet throws an "Something went wrong" error (See Additional Info please)

Expected behavior

Coinbase Wallet doesn't throw an error and I can watch any asset

Version

1.0.4

Additional info

Coinbase Wallet "Something went wrong error"

Also I pressed "Try again" button and nothing happens. When I return to dapp nothing happens in makeRequest completion block, it just doesn't execute.

I've tried with different tokens (top 10 tokens from etherscan.io) and I've tried to send a batch request with a couple of eth_watchAsset actions and it still doesn't work.

And also I've a question: why SDK redirects me to the Coinbase Wallet if I just want to track asset? How can I get a list of assets by my wallet's address?

Desktop

No response

Smartphone

  • Device: Any device (iPhone 12 Pro Max, iPhone 13 Pro, iPhone 14 Pro)
  • Device: Any iOS, for example 16.5.1
@prokhorovxo prokhorovxo added the type: bug Something isn't working label Aug 8, 2023
@bearsworth
Copy link

I am getting similar issues and even send Transaction is failing. They should really investigate this app, but more importantly the mobile app itself to make sure everything is working properly.

@bangtoven
Copy link
Member

hey. sorry for the late response again.
seems like there had been some error on input validation.
we will take a look

@prokhorovxo
Copy link
Author

@bangtoven hi, any updates here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants