SDK
Heads up! We're currently working on a new version of our Garden SDK alongside revamped documentation. Stay tuned—fresh documentation is coming soon!
The Garden SDK is a set of typescript packages that allow you to bridge Bitcoin to EVM-based chains. It is an abstraction over the Garden APIs, allowing developers to integrate Garden components into their dApps easily.
Want to know how everything works internally? Check out Core Concepts.
Features
- Cross-chain Swaps: Swap assets between Bitcoin and EVM-based chains.
- Compatibility: The SDK is compatible with ethers.js or other standard Web3 providers making it easy to integrate with dApps.
- OTAs: Create one-time Bitcoin accounts using your Web3 providers, giving you access to all Bitcoin wallet features.
📄️ Installation
To install the Garden SDK, You can use the following options:
📄️ Quickstart
Garden SDK is a set of packages that aims to quickly and seamlessly swap your cross-chain assets.
📄️ Core Concepts
Bringing Bitcoin to EVM-based chains or vice versa is not a simple process. To accomplish this, Garden utilizes an atomic swap contract. If Alice, a trader, wants to swap her Bitcoin for an asset on an EVM-based chain or Ethereum itself, she needs a way to communicate with Garden that she wants to swap Bitcoin. This is where Garden comes into play; Garden uses an Orderbook engine to create orders that are matched by actors known as Fillers. Alice can now use the Garden to place an order to swap her Bitcoin for WBTC on Ethereum. We'll cover more details on how this swapping works below.
📄️ Supported Chains
SDK also supports EVM localnets and bitcoin regtest. This is possible with merry, a complete localnet environment setup for testing the Garden systems. If Merry is not running, whenever you pass localnets to the SDK, it will throw an error saying unsupported asset.
📄️ API Reference
API Reference contains two primary packages: Orderbook and Core. Discover the APIs each package offers in this section.
📄️ SDK Guides
SDK Guides are dedicated to providing developers with detailed, step-by-step instructions and insights necessary for integrating and utilizing the Garden SDK.