@beyond-tech/sdk
Version:
A minimal SDK to interact with the Beyond protocol, for seamless Bitcoin interoperability.
70 lines (45 loc) • 2.64 kB
Markdown
A minimal SDK to interact with the Beyond protocol, for seamless Bitcoin interoperability.
The Beyond SDK enables developers to move tokens and assets between Bitcoin (L1 and L2s) and the 80+ chains supported by [LayerZero](https://layerzero.network). The SDK also provides tools for managing token inscriptions from all the major standards (BRC20, Runes, BTC), enabling seamless Bitcoin interoperability for your blockchain app.
## Features
- **Token Management**: Easily create, mint, and manage BRC20, CBRC20, and Runes tokens on Bitcoin Layer 1.
- **Wallet Integration**: Securely manage wallet operations, including generating new wallets and signing transactions.
- **Transaction Handling**: Craft, sign, and broadcast transactions with intuitive interfaces.
- **Network Compatibility**: Seamlessly switch between Bitcoin's mainnet and testnet environments.
## Installation
Install the Beyond SDK with npm:
```bash
npm install @beyond/sdk
```
Or with yarn:
```bash
yarn add @beyond/sdk
```
## Quick Start
To get started with the Beyond SDK, you first need to import it into your project:
```javascript
import { Wallet, BRC20, Runes } from '@beyond/sdk';
```
Here is a full example demonstrating how to use the Beyond SDK to create a wallet, and interact with BRC20 and Runes tokens:
```javascript
import { Wallet, BRC20, Runes } from '@beyond/sdk';
// Initialize your wallet. In a real-world application, always keep your private keys secure.
const myWallet = new Wallet('your-private-key-here');
// Example of creating and using a BRC20 token
const myBRC20Token = new BRC20('token-address-here', myWallet);
// Mint 1000 BRC20 tokens to an address
myBRC20Token.mint('recipient-address-here', 1000)
.then((transaction) => console.log(`BRC20 Mint Transaction Hash: ${transaction.txid}`))
.catch((error) => console.error('Error minting BRC20 tokens:', error));
// Example of transferring Runes tokens
const myRunesToken = new Runes('token-address-here', myWallet);
// Transfer 500 Runes tokens to an address
myRunesToken.transfer('recipient-address-here', 500)
.then((transaction) => console.log(`Runes Transfer Transaction Hash: ${transaction.txid}`))
.catch((error) => console.error('Error transferring Runes tokens:', error));
```
<!--
We welcome contributions to the Beyond SDK! Please read our contributing guidelines in CONTRIBUTING.md before submitting pull requests.-->
If you need help or have any questions, please submit an issue on this GitHub repository or [get in touch](https://docs.beyond.tech/community/socials#feedback--bug-reports).