From a399b93ee4bc03a7f8de87b28c99f5824949ef83 Mon Sep 17 00:00:00 2001 From: Jake <95890768+cb-jake@users.noreply.github.com> Date: Mon, 5 May 2025 21:26:41 -0600 Subject: [PATCH 1/2] fix up doc config --- .../components/smart-wallet/SubAccount.tsx | 4 ++-- .../technical-reference/sdk/index.mdx | 10 +++++----- .../sdk/sub-account-reference.mdx | 19 +++++++++++++------ 3 files changed, 20 insertions(+), 13 deletions(-) diff --git a/apps/base-docs/docs/components/smart-wallet/SubAccount.tsx b/apps/base-docs/docs/components/smart-wallet/SubAccount.tsx index 663b3fa9304..f2835c1d1b6 100644 --- a/apps/base-docs/docs/components/smart-wallet/SubAccount.tsx +++ b/apps/base-docs/docs/components/smart-wallet/SubAccount.tsx @@ -28,8 +28,8 @@ export default function SubAccount() { keysUrl: 'https://keys-dev.coinbase.com/connect', options: 'smartWalletOnly', }, - subaccount: { - getSigner: getCryptoKeyAccount, + subAccounts: { + toOwnerAccount: getCryptoKeyAccount, }, }).getProvider(); diff --git a/apps/base-docs/docs/pages/identity/smart-wallet/technical-reference/sdk/index.mdx b/apps/base-docs/docs/pages/identity/smart-wallet/technical-reference/sdk/index.mdx index 01302633af3..587e18f7eb0 100644 --- a/apps/base-docs/docs/pages/identity/smart-wallet/technical-reference/sdk/index.mdx +++ b/apps/base-docs/docs/pages/identity/smart-wallet/technical-reference/sdk/index.mdx @@ -36,17 +36,17 @@ Creates a new `CoinbaseWalletProvider` instance using a `CoinbaseWalletSDK` inst import {sdk} from "./setup"; // Create provider -const provider = sdk.makeWeb3Provider({options: 'smartWalletOnly'}); +const provider = sdk.getProvider(); // Use provider -const addresses = provider.request({method: 'eth_requestAccounts'}); +const addresses = provider.request({ method: 'eth_requestAccounts' }); ``` ```ts twoslash [setup.ts] filename="setup.ts" -import { CoinbaseWalletSDK } from '@coinbase/wallet-sdk' +import { createCoinbaseWalletSDK } from '@coinbase/wallet-sdk' -export const sdk = new CoinbaseWalletSDK({ +export const sdk = createCoinbaseWalletSDK({ appName: 'My App Name', - appChainIds: [8453] + appChainIds: [8453], }); ``` diff --git a/apps/base-docs/docs/pages/identity/smart-wallet/technical-reference/sdk/sub-account-reference.mdx b/apps/base-docs/docs/pages/identity/smart-wallet/technical-reference/sdk/sub-account-reference.mdx index 4ff2a97e912..42eb7085d76 100644 --- a/apps/base-docs/docs/pages/identity/smart-wallet/technical-reference/sdk/sub-account-reference.mdx +++ b/apps/base-docs/docs/pages/identity/smart-wallet/technical-reference/sdk/sub-account-reference.mdx @@ -28,10 +28,15 @@ import { createCoinbaseWalletSDK, getCryptoKeyAccount } from '@coinbase/wallet-s const sdk = createCoinbaseWalletSDK({ appName: 'My Dapp', appLogoUrl: 'https://example.com/logo.png', + paymasterUrls: { + 84532: 'https://', + }, // Set up Sub Account support with a signer function - toSubAccountSigner: async () => { - // Return a signer that can be used to authenticate operations - return await getCryptoKeyAccount(); + subAccounts: { + toOwnerAccount: async () => { + // Return a signer that can be used to authenticate operations + return await getCryptoKeyAccount(); + }, }, }); @@ -108,7 +113,9 @@ const signature = await provider.request({ createCoinbaseWalletSDK({ appName: string, appLogoUrl: string, - toSubAccountSigner: () => Promise<{ account: { publicKey: string; address?: string } }>, + subAccount: { + toOwnerAccount: () => Promise<{ account: { publicKey: string; address?: string } }>, + }, }); ``` @@ -147,13 +154,13 @@ Parameters: Returns: `Promise` - Response from the smart contract call -#### `sdk.subaccount.setSigner(toSubAccountSigner)` +#### `sdk.subaccount.setToOwnerAccount(toOwnerAccount)` Sets the signer function for Sub Account operations. Parameters: -- `toSubAccountSigner`: Function that returns a Promise resolving to a signer object +- `toOwnerAccount`: Function that returns a Promise resolving to a signer object ## Technical Details From e769d6ff192e2c6546ed4634dd021c196f4f615f Mon Sep 17 00:00:00 2001 From: Jake <95890768+cb-jake@users.noreply.github.com> Date: Mon, 5 May 2025 21:28:52 -0600 Subject: [PATCH 2/2] update --- .../identity/smart-wallet/technical-reference/sdk/index.mdx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/apps/base-docs/docs/pages/identity/smart-wallet/technical-reference/sdk/index.mdx b/apps/base-docs/docs/pages/identity/smart-wallet/technical-reference/sdk/index.mdx index 587e18f7eb0..a75cdda0139 100644 --- a/apps/base-docs/docs/pages/identity/smart-wallet/technical-reference/sdk/index.mdx +++ b/apps/base-docs/docs/pages/identity/smart-wallet/technical-reference/sdk/index.mdx @@ -47,6 +47,9 @@ import { createCoinbaseWalletSDK } from '@coinbase/wallet-sdk' export const sdk = createCoinbaseWalletSDK({ appName: 'My App Name', appChainIds: [8453], + preference: { + options: 'smartWalletOnly', + }, }); ```