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. 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.
- 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.
Install the Beyond SDK with npm:
npm install @beyond/sdk
Or with yarn:
yarn add @beyond/sdk
To get started with the Beyond SDK, you first need to import it into your project:
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:
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));
If you need help or have any questions, please submit an issue on this GitHub repository or get in touch.