Skip to content

sociallayer-im/mobit-sdk

Repository files navigation

Mobit SDK

npm version npm downloads license

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

Leap Transactions

RGBPP Functions

Spore Functions

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.

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.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published