npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@satora/swap

v0.0.5

Published

Satora swap client

Readme

@satora/swap

The Satora swap client — a Lightning / on-chain BTC / Arkade ↔ EVM on/off-ramp. Pure TypeScript, works in every JS environment (browser, Node, React Native).

This is the @satora-scoped name for the swap client and re-exports the @lendasat/lendaswap-sdk-pure bundle verbatim (Client, ClientBuilder, Asset, EvmSigner, storage backends, …). New code should import @satora/swap.

Install

npm install @satora/swap

Supported swaps

| Direction | Source | Target | | --------- | --------------------------- | --------------------------- | | BTC → EVM | Lightning, Arkade, on-chain | Ethereum, Polygon, Arbitrum | | EVM → BTC | Ethereum, Polygon, Arbitrum | Lightning, Arkade, on-chain |

Refunds: Lightning auto-expires; Arkade refunds off-chain; on-chain BTC and EVM refund after their timelock.

Quick start

Build a client

import { Client, IdbWalletStorage, IdbSwapStorage } from "@satora/swap";

// Browser, persistent storage (IndexedDB). Omit the storages for a fresh
// ephemeral wallet, or pass .withMnemonic("abandon abandon …") to import one.
const client = await Client.builder()
  .withSignerStorage(new IdbWalletStorage())
  .withSwapStorage(new IdbSwapStorage())
  .build();

const mnemonic = client.getMnemonic(); // back this up

Quote and create a swap

createSwap handles every direction; the SDK routes by source/target asset.

import { Asset } from "@satora/swap";

const quote = await client.getQuote({
  sourceChain: Asset.BTC_ARKADE.chain,
  sourceToken: Asset.BTC_ARKADE.tokenId,
  targetChain: Asset.USDC_POLYGON.chain,
  targetToken: Asset.USDC_POLYGON.tokenId,
  sourceAmount: 100_000, // sats
});

// BTC → EVM: Arkade BTC to USDC on Polygon
const {response} = await client.createSwap({
  source: Asset.BTC_ARKADE,
  target: Asset.USDC_POLYGON,
  sourceAmount: 100_000,       // sats
  targetAddress: "0x…",        // your EVM address
});
const swapId = response.id;

Fund EVM-sourced swaps

EVM-sourced swaps are funded after creation. The SDK runs the full Permit2 flow (allowance, ERC-20 approval, EIP-712 signing, submission) in one call — you provide an EvmSigner (a small wallet abstraction; adapters for viem/wagmi and ethers v6 are a few lines — see the underlying SDK's README).

const {txHash} = await client.fundSwap(swapId, signer);

Monitor, claim, refund

const swap = await client.getSwap(swapId);
// pending → clientfunded → serverfunded → clientredeemed → serverredeemed

// BTC → EVM: once serverfunded, claim your tokens
await client.claim(swapId);

// Refund after timeout
await client.refundSwap(swapId, {destinationAddress: "bc1q…"}); // or "ark1…"
await client.collabRefundEvmWithSigner(swapId, signer, "swap-back"); // EVM, instant/gasless

License

MIT