SDK Overview
The @mure/sdk is a TypeScript library that combines the Mure API with blockchain adapters into one interface for executing on-chain intents.
What the SDK Provides
- One-call transfers — create a transfer intent via the API and submit it on-chain in a single
await client.transfer(...)call.transferresolves to a bare transaction hash. - Swaps and bridges — express same-chain swaps with an
{ in, out }asset shape, or move value across chains through the sametransfercall. - Raw transaction broadcast — submit one or more prepared transactions with
client.send.sendreturns one outcome per input:success,reverted,failed, orunknown. Wallets without atomic batch support fall back to sequential sends. - Read operations — list transfers and tokens, and fetch one transfer by id, through
client.listTransfers,client.listTokens, andclient.getTransfer. - API configuration — pass an optional API URL and API key under
apiincreateClient, or configureApiClient.layerdirectly in an Effect program. - Wallet abstraction — plug in any adapter that implements the
AdapterServiceinterface. The SDK ships with a viem adapter. - Type-safe errors — every failure is surfaced as a typed
ClientServiceErrororAdapterServiceError, carrying the original cause. - Effect-TS native — the entire SDK is built on Effect-TS. Compose the client through
ClientService.layeror use the Promise-based facade.
Architecture
┌─────────────┐ ┌─────────────┐ ┌─────────────┐
│ Client │────▶│ API v2 │────▶│ Mure API │
└─────────────┘ └─────────────┘ └─────────────┘
│
▼
┌─────────────┐
│ Adapter │────▶ viem / ethers / custom
└─────────────┘
The SDK layers three concepts:
- Adapter — talks to the blockchain (signs and sends transactions).
- API Client — talks to the Mure REST API (
@mure/api-v2). - Client — orchestrates the two so you don't have to.
Installation
Quick Links
| Page | What you'll learn |
|---|---|
| Getting Started | Install, configure, and run your first transfer, swap, or bridge. Read transfers and tokens. |
| Client | The createClient factory, nested api config, transfer, send outcomes, the read methods, and Effect integration. |
| Adapters | The adapter pattern, ViemAdapter, the batch outcome contract, and how to bring your own wallet. |
When to Use the SDK
Use the SDK when you want:
- A Promise-based API that hides Effect complexity.
- Automatic transaction submission after the API returns a transfer intent.
- A single dependency that handles both the API and the blockchain.
If you only need raw HTTP access to the Mure API, consider using @mure/api-v2 directly.