From 4f66a8281b7079db005e4d66c66c1d7d0890fbd4 Mon Sep 17 00:00:00 2001
From: Nate Reiners <nate.reiners@coinbase.com>
Date: Wed, 8 May 2024 14:13:39 -0700
Subject: [PATCH 1/2] format

---
 docs/pages/sdk/v3-to-v4-changes.mdx | 123 ++++++++++++++++++++++++++++
 vocs.config.ts                      |   4 +
 2 files changed, 127 insertions(+)
 create mode 100644 docs/pages/sdk/v3-to-v4-changes.mdx

diff --git a/docs/pages/sdk/v3-to-v4-changes.mdx b/docs/pages/sdk/v3-to-v4-changes.mdx
new file mode 100644
index 0000000..b5f7a97
--- /dev/null
+++ b/docs/pages/sdk/v3-to-v4-changes.mdx
@@ -0,0 +1,123 @@
+# CoinbaseWalletSDK Changes (v3 to v4)
+
+This page details changes between versions 3.x and 4.x of the [Coinbase Wallet SDK](https://github.com/coinbase/coinbase-wallet-sdk).
+
+## CoinbaseWalletSDK
+
+### CoinbaseWalletSDKOptions
+
+```ts
+// v4
+type CoinbaseWalletSDKOptions = {
+  appName?: string | undefined;
+  appLogoUrl?: string | null | undefined;
+  appChainIds?: number[] | undefined;
+};
+```
+
+#### New (v4 only):
+
+- `appChainIds?: number[]`
+  - An array of chain IDs your dapp supports
+  - The first chain in this array will be used as the default chain.
+  - Removes the need for non-mainnet dapps to request switching chains before making first request.
+  - Default value is `[1]` (mainnet)
+
+#### Deprecated (v3 only):
+
+- `enableMobileWalletLink` (enabled by default in v4)
+- `jsonRpcUrl`
+- `reloadOnDisconnect`
+- `uiConstructor`
+- `overrideIsMetaMask`
+- `overrideIsCoinbaseWallet`
+- `diagnosticLogger`
+- `reloadOnDisconnect`
+- `headlessMode`
+
+### Deprecated functions
+- `CoinbaseWalletSDK.disconnect()` is deprecated
+  - dapps should call `CoinbaseWalletProvider.disconnect()` instead
+- `CoinbaseWalletSDK.setAppInfo()` is deprecated
+  - Dapps should pass in `appName` and `appLogoUrl` via `CoinbaseWalletSDKOptions`
+
+### `makeWeb3Provider`
+
+#### Signature
+    ```ts
+    // v3
+    makeWeb3Provider(jsonRpcUrl?: string, chainId?: number): CoinbaseWalletProvider
+
+    // v4 // [!code focus]
+    makeWeb3Provider(preference: Preference = { options: 'all' }): ProviderInterface // [!code focus]
+    ```
+#### Parameters
+      ```ts
+      interface Preference {
+        options: 'all' | 'smartWalletOnly' | 'eoaOnly';
+        keysUrl?: string;
+      }
+      ```
+      - `options`
+        - `'all'` (default) show both smart wallet and EOA options
+        - `'smartWalletOnly'` only show smart wallet option
+        - `'eoaOnly'` only show EOA option
+      - `keysUrl`
+        - You probably don't need this. Use only if you'd like to use a frontend other than `"https://keys.coinbase.com/connect"` as your connection popup.
+#### Return type
+      ```ts
+      export interface ProviderInterface extends EventEmitter {
+        request<T>(args: RequestArguments): Promise<T>;
+        disconnect(): Promise<void>;
+        on(event: 'connect', listener: (info: ProviderConnectInfo) => void): this;
+        on(event: 'disconnect', listener: (error: ProviderRpcError) => void): this;
+        on(event: 'chainChanged', listener: (chainId: string) => void): this;
+        on(event: 'accountsChanged', listener: (accounts: string[]) => void): this;
+        on(event: 'message', listener: (message: ProviderMessage) => void): this;
+      }
+      ```
+
+## CoinbaseWalletProvider
+
+### `connect` event fix
+- v3 returned `chainIdStr` instead of `chainId`.
+- v4 is [EIP-1193](https://eips.ethereum.org/EIPS/eip-1193#connect) compliant.
+
+```ts
+// v4
+interface ProviderConnectInfo { readonly chainId: string; } 
+on(event: 'connect', listener: (info: ProviderConnectInfo) => void): this; 
+```
+
+
+### Deprecated functionality
+
+#### Instance properties
+
+- `isCoinbaseBrowser: boolean`
+- `qrUrl?: string | null`
+- `reloadOnDisconnect: boolean`
+
+#### Getter methods
+
+- `selectedAddress`
+- `networkVersion`
+- `isWalletLink`
+- `ismetaMask`
+- `host`
+
+#### Methods
+
+- `disableReloadOnDisconnect`
+- `setProviderInfo`
+- `setAppInfo`
+- `close`
+- `send`
+- `sendAsync`
+- `scanQRCode`
+- `genericRequest`
+- `connectAndSignIn`
+- `selectProvider`
+- `supportsSubscriptions`
+- `subscribe`
+- `unsubscribe`
diff --git a/vocs.config.ts b/vocs.config.ts
index 8105dd8..65cd809 100644
--- a/vocs.config.ts
+++ b/vocs.config.ts
@@ -99,6 +99,10 @@ export default defineConfig({
           text: "makeWeb3Provider",
           link: "/sdk/makeWeb3Provider",
         },
+        {
+          text: "3.x to 4.x Changes",
+          link: "/sdk/v3-to-v4-changes",
+        },
       ],
     },
     {

From d90d158c344cbb3533642fc5ca6df426fa91d4b9 Mon Sep 17 00:00:00 2001
From: Nate Reiners <nate.reiners@coinbase.com>
Date: Wed, 8 May 2024 14:14:59 -0700
Subject: [PATCH 2/2] nav title change

---
 vocs.config.ts | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/vocs.config.ts b/vocs.config.ts
index 65cd809..8948f4d 100644
--- a/vocs.config.ts
+++ b/vocs.config.ts
@@ -100,7 +100,7 @@ export default defineConfig({
           link: "/sdk/makeWeb3Provider",
         },
         {
-          text: "3.x to 4.x Changes",
+          text: "Upgrading from 3.x",
           link: "/sdk/v3-to-v4-changes",
         },
       ],