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

use steps for better formatting #60

Merged
merged 2 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions docs/pages/checklist.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# Smart Wallet Launch-Ready Checklist
## The Basics
::::steps

:::steps

### Test your app with Smart Wallet

Test your app with Smart Wallet enabled. See [our guide](/guides/update-existing-app).
Expand All @@ -20,6 +22,7 @@ and ensure they are not blocking actions based solely on onchain balance checks.
### Use SDK 4.0 or later
Ensure your app is using SDK version 4.0 ahead of mainnet launch. If you are using a wallet library, check
[Wallet Library Support](/wallet-library-support) to ensure day 1 readiness.

:::info
Ahead of mainnet release, we have released a 4.0 version of the Coinbase Wallet SDK. For now,
this version still only supports connecting via the Coinbase Wallet Extension or mobile app, but
Expand All @@ -28,14 +31,15 @@ will begin showing a Smart Wallet connection option, as well.
See our [documentation](/sdk/makeWeb3Provider#parameters) for configuration options.
:::

::::


## Bonus: Make the most of Smart Wallet!
::::steps
:::steps
### Batch Transactions
Improve your app's UX by using batch transactions, allowing, for examples,
approvals and swaps to happen in a single transaction. See [our guide](/guides/batch-transactions).
### Paymasters (sponsored transactions)
Smart Wallet is one of the first wallets to support app-defined paymasters. This enables sponsoring
certain transactions for your users, so they do not have to know or think about gas cost.
See [our guide](/guides/paymasters).
::::
:::
11 changes: 7 additions & 4 deletions docs/pages/guides/batch-transactions.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@ The `useWriteContracts` and `useCapabilities` hooks used below rely on new walle
It is recommended to have a fallback function if your app supports wallets other than Smart Wallet.
:::

### 1. (Optional) Check for atomic batching support
:::steps
### (Optional) Check for atomic batching support

Smart Wallet will submit multiple calls as part of a single transaction. However, if your app supports other wallets, and you want to check that multiple calls will be submitted atomically (in a single transaction), check the wallet's capabilities.

Expand All @@ -37,7 +38,7 @@ function App() {

The `useCapabilities` method will return, per chain, the capabilities that the connected wallet supports. If the connected wallet supports atomic batching, it will return an `atomicBatch` capability with a `supported` field equal to `true` for each chain it supports atomic batching on.

### 2. Send the calls
### Send the calls

If you have your smart contract ABIs, the easiest way to send multiple calls is to use the Wagmi `useWriteContracts` hook.

Expand Down Expand Up @@ -89,7 +90,7 @@ function App() {
}
```

### 3. Check on the status of your calls
### Check on the status of your calls

The `useWriteContracts` hook returns an object with a `data` field. This `data` is a call bundle identifier. Use the Wagmi `useCallsStatus` hook with this identifier to check on the status of your calls.

Expand Down Expand Up @@ -172,4 +173,6 @@ function App() {
</div>
)
}
```
```

:::
10 changes: 6 additions & 4 deletions docs/pages/guides/create-app/using-boat.mdx
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
# Getting started with Build Onchain Apps Template
This guide uses [Build Onchain Apps Template](https://buildonchainapps.xyz/).
## 1. Create project
::::steps
## Create project
Run the command below and proceed through the following steps, choosing "yes"
when asked "Do you want to use Smart Wallet?".
```bash
npx @coinbase/build-onchain-apps@latest create
```

## 2. Setup project
## Setup project
Open your newly created project, and create a new `.env` file in the `web` folder. Add the following to this file.
```bash
NEXT_PUBLIC_RPC_URL=https://sepolia.base.org
ENVIRONMENT=localhost
```

## 3. Install dependencies and run dev
## Install dependencies and run dev
```bash
yarn install && yarn dev
```
Visit your site locally and click the "Connect Wallet" button. You'll see a popup window with a Smart Wallet
connection option.
connection option.
::::
12 changes: 7 additions & 5 deletions docs/pages/guides/create-app/using-wagmi.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

This guide covers creating a new Wagmi template project that uses Smart Wallet.

## 1. Run the following command and proceed through the prompts.
::::steps
## Run the following command and proceed through the prompts.

:::code-group

Expand All @@ -16,7 +17,7 @@ bun create wagmi

:::

## 3. Install packages and run dev.
## Install packages and run dev.

:::code-group

Expand All @@ -30,7 +31,7 @@ bun install && bun run dev

:::

## 4. Update the Wagmi config and coinbaseWallet connector to use baseSepolia
## Update the Wagmi config and coinbaseWallet connector to use baseSepolia

`src/wagmi.ts` should look something like this:

Expand All @@ -56,12 +57,13 @@ declare module 'wagmi' {
}
```

## 5. Visit your site locally, click the "Coinbase Wallet" button, and choose "Create a Smart Wallet."
## Visit your site locally, click the "Coinbase Wallet" button, and choose "Create a Smart Wallet."

Note, if you are using a browser with Coinbase Wallet Extension enabled,
that will be the default connection method and you will not see a screen to choose Smart Wallet.
Temporarily disable the Extension to connect with Smart Wallet.

## 6. Keep building
## Keep building

You can find everything you need here: https://wagmi.sh/react/api/hooks
::::
11 changes: 7 additions & 4 deletions docs/pages/guides/paymasters.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ The `useWriteContracts` and `useCapabilities` hooks used below rely on new walle
It is recommended to have a fallback function if your app supports wallets other than Smart Wallet.
:::

### 1. Choose a paymaster service provider
::::steps
### Choose a paymaster service provider

As a prerequisite, you'll need to obtain a paymaster service URL from a paymaster service provider. To be compatible with Smart Wallet, the paymaster provider you choose must be ERC-7677-compliant.

Expand All @@ -19,7 +20,7 @@ You can find a full list of ERC-7677-compliant paymaster services [here](https:/

Once you choose a paymaster service provider and obtain a paymaster service URL, you can proceed to integration.

### 2. (Recommended) Setup your paymaster proxy
### (Recommended) Setup your paymaster proxy

Creating an API to proxy calls to your paymaster service is important for two reasons.
1. Allows you to protect any API secret.
Expand Down Expand Up @@ -261,7 +262,7 @@ export const paymasterClient = createClient({
```
:::

### 3. Send EIP-5792 requests with a paymaster service capability
### Send EIP-5792 requests with a paymaster service capability

Once you have your paymaster service set up, you can now pass its URL along to Wagmi's `useWriteContracts` hook.

Expand Down Expand Up @@ -345,4 +346,6 @@ export const myNFTAddress = "0x119Ea671030FBf79AB93b436D2E20af6ea469a19";
:::

That's it! Smart Wallet will handle the rest. If your paymaster service is able to sponsor the transaction,
in the UI Smart Wallet will indicate to your user that the transaction is sponsored.
in the UI Smart Wallet will indicate to your user that the transaction is sponsored.

::::
6 changes: 4 additions & 2 deletions docs/pages/guides/siwe.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ This guide covers creating a new Sign-In with Ethereum template project that use
replay attacks through session duplication.
</Callout>

::::steps
## Create a project

Follow the [wagmi guide](/guides/create-app/using-wagmi) to set up a template project and connect a Smart Wallet.
Follow the [Wagmi guide](/guides/create-app/using-wagmi) to set up a template project and connect a Smart Wallet.

## Install dependencies

Expand Down Expand Up @@ -100,7 +101,7 @@ export default App


## Prompt to sign and store signature
wagmi's `signMessage` function will open the Smart Wallet popup to sign the message. The signature is stored in the component's state.
Wagmi's `signMessage` function will open the Smart Wallet popup to sign the message. The signature is stored in the component's state.

```tsx twoslash [src/SignInWithEthereum.tsx]
import React, { useCallback, useEffect, useMemo, useState } from 'react';
Expand Down Expand Up @@ -205,3 +206,4 @@ export function SignInWithEthereum() {

## Sign in with Ethereum
Visit your local server and click "Sign In with Ethereum"
::::
Loading