mobit-sdk
v1.8.2
Published
[![npm version](https://img.shields.io/npm/v/mobit-sdk.svg)](https://www.npmjs.com/package/mobit-sdk) [![npm downloads](https://img.shields.io/npm/dm/mobit-sdk.svg)](https://www.npmjs.com/package/mobit-sdk) [![license](https://img.shields.io/npm/l/mobit-s
Downloads
1,315
Readme
Mobit SDK
Overview
The Mobit SDK is a comprehensive toolkit designed for interacting with the CKB (Nervos Network) and Bitcoin networks. It provides a set of utilities for handling XUDT tokens and RGBPP assets, enabling developers to create, manage, and transfer assets across these networks with ease.
Installation
To install the Mobit SDK, run the following command:
npm install mobit-sdk
Usage
Initializing the SDK
To start using the SDK, you need to initialize the RgbppSDK
class with the
appropriate network configuration. Here’s how you can do it:
import { RgbppSDK } from "mobit-sdk";
const isMainnet = true; // Set to false for testnet
const sdk = new RgbppSDK(isMainnet);
CKB Helper
The CkbHelper
class provides a way to interact with the CKB network, depending
on whether you're on the mainnet or testnet.
import { CkbHelper } from "mobit-sdk";
const ckbHelper = new CkbHelper(true); // true for mainnet, false for testnet
BTC Helper
The BtcHelper
class provides utilities for interacting with the Bitcoin
network.
import { BtcHelper, AbstractWallet } from "mobit-sdk";
const wallet: AbstractWallet = // Initialize your wallet instance
const networkType = "mainnet" || "testnet";
const btcTestnetType = "testnet" || undefined;
const btcHelper = new BtcHelper(wallet, networkType, btcTestnetType);
Transactions
The SDK provides several functions to create different types of transactions. For detailed usage and parameters, refer to the API Documentation on GitHub.
XUDT Transactions
- Burn XUDT Tokens: Documentation
- Issue XUDT Tokens: Documentation
- Merge XUDT Tokens: Documentation
- Transfer XUDT Tokens: Documentation
Leap Transactions
- Leap from CKB to BTC: Documentation
- Leap Spore from CKB to BTC: Documentation
- Leap from BTC to CKB: Documentation
- Leap Spore from BTC to CKB: Documentation
RGBPP Functions
- Distribute RGBPP Assets: Documentation
- Launch RGBPP Assets: Documentation
- Transfer RGBPP Assets: Documentation
Spore Functions
- Create Cluster: Documentation
- Create Spores: Documentation
- Transfer Spores: Documentation
Preparing Transactions
The SDK also provides functions to prepare unsigned transactions and PSBTs (Partially Signed Bitcoin Transactions). For detailed usage and parameters, refer to the API Documentation on GitHub.
- Prepare Cluster Cell Transaction: Documentation
- Prepare Create Spore Unsigned PSBT: Documentation
- Prepare Create Spore Unsigned Transaction: Documentation
- Prepare Distribute Unsigned PSBT: Documentation
- Prepare Launch Cell Transaction: Documentation
- Prepare Launcher Unsigned PSBT: Documentation
- Prepare Leap Unsigned PSBT: Documentation
- Prepare Leap Spore Unsigned PSBT: Documentation
- Prepare Transfer Unsigned PSBT: Documentation
- Prepare Transfer Spore Unsigned PSBT: Documentation
Contributing
Contributions are welcome! Please open an issue or submit a pull request for any changes.
License
This project is licensed under the MIT License. See the LICENSE file for details.