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

[trivial] rename to CDP (#22) #32

Open
wants to merge 1 commit into
base: dependabot/npm_and_yarn/examples/alchemy/follow-redirects-1.15.6
Choose a base branch
from
Open
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
17 changes: 9 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# [Coinbase Cloud Paymaster & Bundler Examples](https://github.com/coinbase/paymaster-bundler-examples)
# [Coinbase Developer Platform Paymaster & Bundler Examples](https://github.com/coinbase/paymaster-bundler-examples)

This repo has code examples on how to sponsor a mint for a [Knight Warriors](https://sepolia.basescan.org/token/0x66519fcaee1ed65bc9e0acc25ccd900668d3ed49) NFT on Base Sepolia using Coinbase Cloud's Paymaster & Bundler. If you'd like to see a live demo app sponsoring NFT mints in action, check out ours [here](https://buildonchainapps.xyz/paymaster-bundler).
This repo has code examples on how to sponsor a mint for a [Knight Warriors](https://sepolia.basescan.org/token/0x66519fcaee1ed65bc9e0acc25ccd900668d3ed49) NFT on Base Sepolia using Coinbase Developer Platform's Paymaster & Bundler. If you'd like to see a live demo app sponsoring NFT mints in action, check out ours [here](https://buildonchainapps.xyz/paymaster-bundler).

We currently have examples for the following SDKs, but contributions are always welcome! See [Contributing](https://github.com/coinbase/paymaster-bundler-examples/blob/master/CONTRIBUTING.md) for more details.

Expand Down Expand Up @@ -50,13 +50,14 @@ yarn

- This will setup dotenv to load the env file for private values

- ### Create your Base Node RPC URL
- ### Get your Node RPC URL

- Navigate to https://coinbase.com/cloud/products/base/rpc
- Sign up for a Coinbase Cloud account, if you don't have one already
- Create a project, and select **Base Sepolia**
- Click "**Activate**" on the Paymaster & Bundler modal
- Navigate to https://www.coinbase.com/developer-platform/products/base-node
- Sign up for a Coinbase Developer Platform account, if you don't have one already.
- Under the **Build Onchain** section in the Portal, select **Node**
- In the dropdown on the top right of **Configuration**, select **Base Testnet (Sepolia)**
- Copy your RPC endpoint, and paste it into `.env` as the `RPC_URL` variable.
- The RPC URL should look like `https://api.developer.coinbase.com/rpc/v1/base-sepolia/<api_key>`

- ### Add a signer

Expand Down Expand Up @@ -101,7 +102,7 @@ You should receive an Etherscan link with your sponsored transaction in the term
```
Minting to 0xF19CEA17462220437000F459f721e3e393bd1fc9
Waiting for transaction...
⛽ Successfully sponsored gas for mintTo transaction with Coinbase Cloud!
⛽ Successfully sponsored gas for mintTo transaction with Coinbase Developer Platform!
🔍 View on Etherscan: https://sepolia.basescan.org/tx/0xe51e9bf6fea0dfecfcbf7168bcc7da2c833ad0dcac5651940953a89857674885
✨ Done in 5.66s.
```
Expand Down
9 changes: 6 additions & 3 deletions examples/alchemy/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,32 @@

This example uses Alchemy's Account Kit [aa-core](https://accountkit.alchemy.com/packages/aa-core/) to create a [ERC-4337](https://www.erc4337.io/) smart contract account and send a sponsored transaction.

We'll be minting a NFT on Base Sepolia using Coinbase Cloud's Paymaster & Bundler.
We'll be minting a NFT on Base Sepolia using Coinbase Developer Platform's Paymaster & Bundler.

### 1. Setup

Ensure you have the `rpc_url` and `private_key` variables set in the `config.json`.

### 2. Install dependencies

```
yarn
```

### 3. Run the example

```
yarn dev
```

### 4. See your sponsored transaction live!

You should receive an Etherscan link with your sponsored transaction in the terminal output. [Example](https://sepolia.basescan.org/tx/0xe51e9bf6fea0dfecfcbf7168bcc7da2c833ad0dcac5651940953a89857674885)

```
Minting to 0xF19CEA17462220437000F459f721e3e393bd1fc9
Waiting for transaction...
⛽ Successfully sponsored gas for mintTo transaction with Coinbase Cloud!
⛽ Successfully sponsored gas for mintTo transaction with Coinbase Developer Platform!
🔍 View on Etherscan: https://sepolia.basescan.org/tx/0xe51e9bf6fea0dfecfcbf7168bcc7da2c833ad0dcac5651940953a89857674885
✨ Done in 5.66s.
```
```
2 changes: 1 addition & 1 deletion examples/alchemy/src/mint.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ try {
} catch (error) {
// There's currently an issue with viem not being able to find the transaction hash, but it does exist
const txHash = extractHashFromError(error.toString())
console.log("\x1b[32m", `⛽ Successfully sponsored gas for ${config.function_name} transaction with Coinbase Cloud!`);
console.log("\x1b[32m", `⛽ Successfully sponsored gas for ${config.function_name} transaction with Coinbase Developer Platform!`);
console.log("\x1b[36m", `🔍 View on Etherscan: https://sepolia.basescan.org/tx/${txHash}`);
}
9 changes: 6 additions & 3 deletions examples/pimlico/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,32 @@

This example uses Pimlico's [permissionless.js](https://docs.pimlico.io/permissionless/reference) SDK to create a [ERC-4337](https://www.erc4337.io/) smart contract account and send a sponsored transaction.

We'll be minting a NFT on Base Sepolia using Coinbase Cloud's Paymaster & Bundler.
We'll be minting a NFT on Base Sepolia using Coinbase Developer Platform's Paymaster & Bundler.

### 1. Setup

Ensure you have the `rpc_url` and `private_key` variables set in the `config.json`.

### 2. Install dependencies

```
yarn
```

### 3. Run the example

```
yarn dev
```

### 4. See your sponsored transaction live!

You should receive an Etherscan link with your sponsored transaction in the terminal output. [Example](https://sepolia.basescan.org/tx/0xe51e9bf6fea0dfecfcbf7168bcc7da2c833ad0dcac5651940953a89857674885)

```
Minting to 0xF19CEA17462220437000F459f721e3e393bd1fc9
Waiting for transaction...
⛽ Successfully sponsored gas for mintTo transaction with Coinbase Cloud!
⛽ Successfully sponsored gas for mintTo transaction with Coinbase Developer Platform!
🔍 View on Etherscan: https://sepolia.basescan.org/tx/0xe51e9bf6fea0dfecfcbf7168bcc7da2c833ad0dcac5651940953a89857674885
✨ Done in 5.66s.
```
```
2 changes: 1 addition & 1 deletion examples/pimlico/src/mint.js
Original file line number Diff line number Diff line change
Expand Up @@ -48,5 +48,5 @@ const txHash = await smartAccountClient.sendTransaction({
value: BigInt(0),
});

console.log("\x1b[32m", `⛽ Successfully sponsored gas for ${config.function_name} transaction with Coinbase Cloud!`);
console.log("\x1b[32m", `⛽ Successfully sponsored gas for ${config.function_name} transaction with Coinbase Developer Platform!`);
console.log("\x1b[36m", `🔍 View on Etherscan: https://sepolia.basescan.org/tx/${txHash}`);
7 changes: 5 additions & 2 deletions examples/zerodev/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,29 +2,32 @@

This example uses [the ZeroDev SDK](https://docs.zerodev.app/) to create a [ERC-4337](https://www.erc4337.io/) smart contract account and send a sponsored transaction.

We'll be minting a NFT on Base Sepolia using Coinbase Cloud's Paymaster & Bundler.
We'll be minting a NFT on Base Sepolia using Coinbase Developer Platform's Paymaster & Bundler.

### 1. Setup

Ensure you have the `rpc_url` and `private_key` variables set in the `config.json`.

### 2. Install dependencies

```
yarn
```

### 3. Run the example

```
yarn dev
```

### 4. See your sponsored transaction live!

You should receive an Etherscan link with your sponsored transaction in the terminal output. [Example](https://sepolia.basescan.org/tx/0xe51e9bf6fea0dfecfcbf7168bcc7da2c833ad0dcac5651940953a89857674885)

```
Minting to 0xF19CEA17462220437000F459f721e3e393bd1fc9
Waiting for transaction...
⛽ Successfully sponsored gas for mintTo transaction with Coinbase Cloud!
⛽ Successfully sponsored gas for mintTo transaction with Coinbase Developer Platform!
🔍 View on Etherscan: https://sepolia.basescan.org/tx/0xe51e9bf6fea0dfecfcbf7168bcc7da2c833ad0dcac5651940953a89857674885
✨ Done in 5.66s.
```
2 changes: 1 addition & 1 deletion examples/zerodev/src/mint.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,5 +33,5 @@ const txHash = await kernelClient.sendTransaction({
}),
})

console.log("\x1b[32m", `⛽ Successfully sponsored gas for ${config.function_name} transaction with Coinbase Cloud!`);
console.log("\x1b[32m", `⛽ Successfully sponsored gas for ${config.function_name} transaction with Coinbase Developer Platform!`);
console.log("\x1b[36m", `🔍 View on Etherscan: https://sepolia.basescan.org/tx/${txHash}`);
Loading