diff --git a/README.md b/README.md index f25648b..115d3c3 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Node: >=22.0.0](https://img.shields.io/badge/node-%3E%3D22.0.0-brightgreen)](package.json) [![pnpm](https://img.shields.io/badge/maintained%20with-pnpm-cc00ff.svg)](https://pnpm.io/) -Progressive examples for [@chainlink/ccip-sdk](https://www.npmjs.com/package/@chainlink/ccip-sdk) (v1.0.0). Testnet only. EVM, Solana, and Aptos. +Progressive examples for [@chainlink/ccip-sdk](https://www.npmjs.com/package/@chainlink/ccip-sdk). Testnet only. EVM, Solana, and Aptos. > **Disclaimer** > @@ -13,11 +13,12 @@ Progressive examples for [@chainlink/ccip-sdk](https://www.npmjs.com/package/@ch ## Examples -| Example | Description | Runtime | -| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------ | ------- | -| [01-getting-started](./examples/01-getting-started) | SDK basics: chains, fees, tokens, pools | Node.js | -| [02-evm-simple-bridge](./examples/02-evm-simple-bridge) | EVM-to-EVM bridge; fee token selection (native/LINK); **send:** `chain.sendMessage()` (SDK does approval + send) | Browser | -| [03-multichain-bridge-dapp](./examples/03-multichain-bridge-dapp) | EVM + Solana + Aptos; fee token selection; **send:** `generateUnsignedSendMessage()` then wallet `sendTransaction` (unsigned tx to wallet) | Browser | +| Example | Description | Runtime | +| ----------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------- | +| [01-getting-started](./examples/01-getting-started) | SDK basics: chains, fees, tokens, pools | Node.js | +| [02-evm-simple-bridge](./examples/02-evm-simple-bridge) | EVM-to-EVM bridge; fee token selection (native/LINK); **send:** `chain.sendMessage()` (SDK does approval + send) | Browser | +| [03-multichain-bridge-dapp](./examples/03-multichain-bridge-dapp) | EVM + Solana + Aptos; fee token selection; **send:** `generateUnsignedSendMessage()` then wallet `sendTransaction` (unsigned tx to wallet) | Browser | +| [04-hardhat-ccip](./examples/04-hardhat-ccip) | Hardhat v3 + custom Sender/Receiver contracts; token transfers (TT), arbitrary messaging, programmable token transfers (PTT); SDK-assisted destination gas estimation, fee quoting, extraArgs encoding, manual execution of failed messages | Node.js | ## Prerequisites @@ -46,6 +47,10 @@ pnpm dev:02 # 03 – Multichain bridge (dev server http://localhost:5173) pnpm dev:03 + +# 04 – Hardhat tasks (compile, test, deploy, send) +pnpm -F 04-hardhat-ccip build +pnpm -F 04-hardhat-ccip test ``` Optional: in 02 or 03, copy `.env.example` to `.env` and set `RPC_` (e.g. `RPC_ETHEREUM_TESTNET_SEPOLIA`) to use custom RPC endpoints. 03 also supports `VITE_WALLETCONNECT_PROJECT_ID`. @@ -57,11 +62,13 @@ ccip-sdk-examples/ ├── examples/ │ ├── 01-getting-started/ # Node scripts │ ├── 02-evm-simple-bridge/ # EVM-only browser app -│ └── 03-multichain-bridge-dapp/ # EVM + Solana + Aptos browser app +│ ├── 03-multichain-bridge-dapp/ # EVM + Solana + Aptos browser app +│ └── 04-hardhat-ccip/ # Hardhat v3 + custom contracts ├── packages/ +│ ├── shared-brand/ # Design tokens, logos, brand assets │ ├── shared-config/ # Networks, tokens, wagmi, constants │ ├── shared-utils/ # Validation, errors, formatting, message build, hooks -│ └── shared-components/ # Button, Input, Select, Alert, MessageProgress, TransferStatus, ErrorBoundary, tokens.css +│ └── shared-components/ # Button, Input, Select, Alert, MessageProgress, TransferStatus, ErrorBoundary ├── docs/ │ └── LEARNING_PATH.md # Progression and concepts ├── pnpm-workspace.yaml diff --git a/docs/LEARNING_PATH.md b/docs/LEARNING_PATH.md index 2cac71e..0bf671a 100644 --- a/docs/LEARNING_PATH.md +++ b/docs/LEARNING_PATH.md @@ -1,6 +1,6 @@ # Learning Path -Progressive examples for using `@chainlink/ccip-sdk` v1.0.0 (testnet only). Each example adds scope; shared packages provide config, utilities, UI, and brand assets. +Progressive examples for using `@chainlink/ccip-sdk` (testnet only). Each example adds scope; shared packages provide config, utilities, UI, and brand assets. ## Example progression diff --git a/examples/01-getting-started/README.md b/examples/01-getting-started/README.md index 9656a91..76833cd 100644 --- a/examples/01-getting-started/README.md +++ b/examples/01-getting-started/README.md @@ -1,6 +1,6 @@ # 01 - Getting Started with CCIP SDK -> **CCIP SDK** [`@chainlink/ccip-sdk@1.0.0`](https://www.npmjs.com/package/@chainlink/ccip-sdk/v/1.0.0) | **Testnet only** | [CCIP Docs](https://docs.chain.link/ccip) | [CCIP Explorer](https://ccip.chain.link) +> **CCIP SDK** [`@chainlink/ccip-sdk`](https://www.npmjs.com/package/@chainlink/ccip-sdk) | **Testnet only** | [CCIP Docs](https://docs.chain.link/ccip) | [CCIP Explorer](https://ccip.chain.link) > **Disclaimer** > diff --git a/examples/02-evm-simple-bridge/README.md b/examples/02-evm-simple-bridge/README.md index 14b9835..87f817d 100644 --- a/examples/02-evm-simple-bridge/README.md +++ b/examples/02-evm-simple-bridge/README.md @@ -1,6 +1,6 @@ # 02-evm-simple-bridge -> **CCIP SDK** [`@chainlink/ccip-sdk@1.0.0`](https://www.npmjs.com/package/@chainlink/ccip-sdk/v/1.0.0) | **Testnet only** | [CCIP Docs](https://docs.chain.link/ccip) | [CCIP Explorer](https://ccip.chain.link) +> **CCIP SDK** [`@chainlink/ccip-sdk`](https://www.npmjs.com/package/@chainlink/ccip-sdk) | **Testnet only** | [CCIP Docs](https://docs.chain.link/ccip) | [CCIP Explorer](https://ccip.chain.link) > **Disclaimer** > diff --git a/examples/03-multichain-bridge-dapp/README.md b/examples/03-multichain-bridge-dapp/README.md index 0d47a1d..10252fa 100644 --- a/examples/03-multichain-bridge-dapp/README.md +++ b/examples/03-multichain-bridge-dapp/README.md @@ -1,6 +1,6 @@ # 03-multichain-bridge-dapp -Browser app: EVM, Solana, and Aptos transfers using [@chainlink/ccip-sdk](https://www.npmjs.com/package/@chainlink/ccip-sdk) (v1.0.0). Testnet only. Same layout and shared packages as 02, with Solana, Aptos, transaction history, pool info, and rate limits. +Browser app: EVM, Solana, and Aptos transfers using [@chainlink/ccip-sdk](https://www.npmjs.com/package/@chainlink/ccip-sdk). Testnet only. Same layout and shared packages as 02, with Solana, Aptos, transaction history, pool info, and rate limits. **Send flow (difference from 02):** This app does **not** use `chain.sendMessage()`. It uses `chain.generateUnsignedSendMessage()` to build unsigned transaction data, then passes that to the connected wallet (EVM, Solana, or Aptos) for signing and sending via `sendTransaction`. 02 uses `sendMessage()`, which lets the SDK handle approval and send in one call. The unsigned-tx pattern here is required for Solana/Aptos and for explicit control over the sign/send step. diff --git a/examples/04-hardhat-ccip/README.md b/examples/04-hardhat-ccip/README.md index 8d2c944..c4bed74 100644 --- a/examples/04-hardhat-ccip/README.md +++ b/examples/04-hardhat-ccip/README.md @@ -1,6 +1,6 @@ # 04 - Hardhat v3 + CCIP SDK -> **CCIP SDK** [`@chainlink/ccip-sdk@1.2.0`](https://www.npmjs.com/package/@chainlink/ccip-sdk/v/1.2.0) | **Testnet only** | [CCIP Docs](https://docs.chain.link/ccip) | [CCIP Explorer](https://ccip.chain.link) +> **CCIP SDK** [`@chainlink/ccip-sdk`](https://www.npmjs.com/package/@chainlink/ccip-sdk) | **Testnet only** | [CCIP Docs](https://docs.chain.link/ccip) | [CCIP Explorer](https://ccip.chain.link) > **Disclaimer** >