docs icon indicating copy to clipboard operation
docs copied to clipboard

Coinbase - Error when swapping ETH without enough funds to cover gas

Open RyanCoinbase opened this issue 3 years ago • 0 comments

My engineering team here at Coinbase is receiving the below error. Could we get this fixed?

Steps to reproduce:

  1. Go to Uniswap
  2. Swap some Eth but without enough funds to cover gas
  3. Hit Cancel on the transaction sign confirmation

Swap failed: [object object]

The code snippet how we send the error to the dapp. The response object has a field named errorMessage that has the error string

const { id, ...rest } = response; constresp = JSON.stringify( { type:'WEB3_RESPONSE', id, response:rest, } ); // Notify CipherProvider when we get a response back. // https://github.cbhq.net/wallet/wallet-mobile/blob/master/libs/cipher-web-view/src/CipherProviderWalletLinkRelay.ts#L117 constjs = ``window.CipherProvider.respond(${resp});``; webViewRef.current?.injectJavaScript(js);

RyanCoinbase avatar Jun 23 '22 22:06 RyanCoinbase