Sign In

@hashlock-tech/sdk

Package Overview
Dependencies
Maintainers
2
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hashlock-tech/sdk

TypeScript SDK for the Hashlock Markets developer API — non-custodial cross-chain atomic swaps (BTC ↔ EVM/TRON) over sealed RFQ + HTLC.

latest
Source
npmnpm
Version
0.4.0
Version published
Maintainers
2
Created
Source

@hashlock-tech/sdk

TypeScript SDK for the Hashlock Markets developer API — non-custodial cross-chain atomic swaps (BTC ↔ EVM/TRON). Runs on Node 18+, browsers, and edge runtimes (native fetch / WebSocket, zero runtime dependencies).

⚠️ Sandbox / testnet preview (0.x) — defaults to api-dev.hashlock.markets, testnets only, pre-mainnet. The API may change before the stable 1.0. Not for mainnet funds.

npm i @hashlock-tech/sdk
import { HashlockClient, newSecret, verifyWebhook, MakerFeed } from '@hashlock-tech/sdk';

const client = new HashlockClient({ apiKey: process.env.HASHLOCK_API_KEY! });
await client.me();

// cursor pagination — page or auto-iterate
const page = await client.listSwaps({ limit: 20 });
for await (const swap of client.swaps()) { /* … */ }

// webhooks: verify a delivery against the raw body
const ok = await verifyWebhook({ secret, rawBody, signature: req.headers['x-hashlock-signature'], timestamp: req.headers['x-hashlock-timestamp'] });

// maker feed: stream RFQs and quote over a socket
const feed = new MakerFeed({ apiKey, onRfq: (rfq) => feed.quote(rfq.id, '650000') });
await feed.connect();

Settlement is custody-agnostic: buildFund / buildClaim / buildRefund return unsigned transactions — sign with your wallet or HSM (see ../examples/fireblocks) and broadcast(...) (or let your custody provider broadcast). See the root README for the full swap lifecycle.

Build

npm install && npm run build   # tsup → dist (esm + d.ts)
npm run typecheck

MIT

Keywords

hashlock

FAQs

Package last updated on 24 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts