Skip to content

Commit

Permalink
[trivial] rename to CDP (#22)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xAlec authored May 29, 2024
1 parent dc78047 commit 9ce0c50
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 19 deletions.
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

This comment has been minimized.

Copy link
@bpmoney29

bpmoney29 Sep 5, 2024

branbran88


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}`);

0 comments on commit 9ce0c50

Please sign in to comment.