Spore SDK
Spore SDK is a Web environment development kit written in TypeScript, designed to provide developers with the essential tools they need to interact with Spore Protocol and create digital artifacts on Nervos CKB.
Features
- ⚡ Composed APIs for efficient spores/clusters interactions with minimal time overhead
- 🧩 Joint APIs for building advanced transactions as a fun block-building process
- 🛠️ Versatile utilities for encoding/decoding data of spores/clusters
- 🎹 Fully written in TypeScript
Getting started
Installation
- npm
- pnpm
- yarn
npm i @spore-sdk/core
pnpm add @spore-sdk/core
yarn add @spore-sdk/core
Building browser env dapps
The Spore SDK is built on top of Lumos, an open-source dapp framework for Nervos CKB. Lumos incorporates certain Node-polyfills into its implementation, such as crypto-browserify
and buffer
, to provide specific functionalities.
If you intend to use the Spore SDK in a browser environment, it's important to note that you may need to manually add Node-polyfills to your application. This ensures that the Spore SDK functions properly in the browser. For detailed instructions on how to add these polyfills, refer to the Lumos documentation: CRA, Vite, Webpack or Other.
Development
Running in Node.js
If you want to use the Spore SDK in a Node.js environment, there's no extra step needed after the installation.
- For beginners, you can follow the Creating Your First Spore tutorial to learn about spore creation and how to sign a basic transaction with the CKB Default lock.
- For advanced developers, you can search for code examples in Spore Examples.
Building web applications
If you want to use the Spore SDK in a browser environment, such as building web applications with Vite/CRA/Next, etc., you may need to follow the instructions of Setup Node-polyfills to ensure the Spore SDK can function properly in your project.
- For beginners, you can start by following the Create Simple On-Chain Blog tutorial, a comprehensive guide on how to build a dapp, including wallet integration.
- For more application demos with the Spore SDK, refer to Spore Demos.