The CCIP JavaScript SDK is a monorepo for two packages:
ccip-js
: A TypeScript library that provides a client for managing cross-chain token transfers that use Chainlink's Cross-Chain Interoperability Protocol (CCIP) routers.ccip-react-components
: A set of prebuilt ready-to-use React UI components. This package depends onccip-js
.
Using both packages, you can add a fully featured CCIP bridge to your app that can be styled to match your app design.
To view more detailed documentation and more examples, visit the Chainlink Javascript SDK Documentation. Development specific information is also found in individual READMEs inside the ./packages/<<PACKAGE_NAME>>
directory.
There is also an example implementation of a front end NextJS app that uses these packages in ./examples/nextjs
. That has its own README as well.
- Clone the
ccip-javascript-sdk
repo:
git clone https://github.com/smartcontractkit/ccip-javascript-sdk.git
-
Run
pnpm install
pnpm build
pnpm dev-example
If you want to make changes to the package code, you need to rebuild the packages. Then:
-
Make sure to build the
ccip-js
package before you build theccip-react-components
package. The React components depend on the JS package. -
Make sure your client's package.json file to points to the updated local versions or use npm link or equivalent in your downstream client code. You can see examples of this in the steps below.
Follow these steps:
- Build the
ccip-js
package:
pnpm build-ccip-js
- Build the
ccip-react-components
package:
pnpm build-components
- Update the
ccip-react-components
package to use the localccip-js
version by modifyingpackages/ccip-react-components/package.json
file. Replace the@chainlink/ccip-js
dependency with the workspace reference:
"@chainlink/ccip-js": "workspace:*"
- Update the
examples/nextjs
app to use both localccip-js
andccip-react-components
version by modifyingexamples/nextjs/package.json
file. Replace the@chainlink/ccip-js
and@chainlink/ccip-react-components
dependency with relative path:
"@chainlink/ccip-js": "link:../../packages/ccip-js",
"@chainlink/ccip-react-components": "link:../../packages/ccip-react-components",
Contributions to either repos are welcome! Please open an issue or submit a pull request using the process below.
- Fork the repository.
- Clone your fork:
git clone https://github.com/YOUR_USERNAME/ccip-javascript-sdk.git
- Navigate to directory:
cd ccip-javascript-sdk
- Fetch all branches:
git fetch origin
- Switch to develop branch:
git checkout develop
- Install dependencies:
pnpm install
- Create a feature branch:
git checkout -b feature/my-feature
- Commit your changes
- Push to the branch (git push origin feature/my-feature).
- Open a pull request from your fork to the
develop
branch of this repo.
🚨 Always branch off from develop
when creating your feature branch.