Skip to Content
On this page

This guide shows you how to make your dApp work well inside the MyDoge app’s in-app browser. Your normal SDK setup already works there; these steps cover what MyDoge users need on top. For how MyDoge runs dApps, see About the MyDoge In-App Browser.

Before you start:

Connect the Wallet#

  1. Keep your normal WalletConnectProvider configuration and connect button. You can keep email and social sign-in turned on for ordinary browsers; inside MyDoge the SDK connects MyDoge’s wallet on its own.
  2. Put the connect button where a first-time user sees it straight away. Inside MyDoge nothing asks to connect when the page loads; the user taps your button, and MyDoge asks them to approve.
  3. Add your own Disconnect button and, if you support several networks, a network switch using switchChain(). MyDoge 3.1.1 (build 652) and earlier have no account sheet, so openModal() does nothing once a wallet is connected.
  4. Keep your page’s first load light, and load heavy media after it. The SDK connects only after the page has loaded, and until then WalletConnectProvider shows “Preparing wallet connection…” in place of your app.

To connect from your own code and get the account back, use useWalletHost().connect(); see Connect From Your Own Code.

Use the Wallet#

For wallet actions, read the current account, chain and provider from useAccount(), and check isConnected. Don’t wait for walletStatus or isWalletReady: they describe the embedded wallet, which isn’t used inside MyDoge.

Read the account again before each action. Until MyDoge sends account-change events, a user who switches wallet in MyDoge can leave your page showing the old account, so verify the signer on your server.

Send Requests#

  1. Switch to the matching network before you send a transaction or typed data for it. MyDoge rejects a mismatched chain ID.
  2. Use native DOGE through its built-in ERC-20 interface rather than wrapped DOGE, which most MyDoge users don’t hold; see Native DOGE as an ERC-20. Offer a “Wrap DOGE” step only if a contract must stay on wrapped DOGE.
  3. Read chain data through the wallet’s provider for occasional reads; MyDoge sends them to the network’s RPC. For frequent reads, such as polling, use your own RPC connection, because MyDoge answers one request at a time.
  4. Handle rejections: the user can reject any request, and switching wallet or account in MyDoge cancels pending ones. See Handle Wallet Errors.

The MyDoge reference lists the requests MyDoge supports.

Change Behavior Inside MyDoge#

When part of your UI should differ inside MyDoge, such as links to other dApps, sign-in options or account controls, see Detect MyDoge and Adapt Your dApp.

Next Steps#

  1. Detect MyDoge and Adapt Your dApp
  2. Test Before You’re Listed
  3. Set Up Your Listing and Origins
  4. Sign Users In Inside MyDoge
  5. Link to Other dApps and Websites

If something doesn’t work, see Inside MyDoge in Troubleshooting.