Skip to content

Rewrite SDK for the v1 REST API (TypeScript + Python + Fireblocks reference)#2

Merged
lexaisnotdead merged 1 commit into
mainfrom
feat/v1-sdk-rewrite
Jul 22, 2026
Merged

Rewrite SDK for the v1 REST API (TypeScript + Python + Fireblocks reference)#2
lexaisnotdead merged 1 commit into
mainfrom
feat/v1-sdk-rewrite

Conversation

@lexaisnotdead

@lexaisnotdead lexaisnotdead commented Jul 22, 2026

Copy link
Copy Markdown
Member

Wholesale rewrite of the SDK for the current non-custodial /v1 REST API. The previous content targeted the old codebase (GraphQL/SDL, "Instant Settlement lanes", trade-service, agent layer) and no longer matches the product.

What's in it

  • typescript/ (@hashlock-tech/sdk) — zero-dependency client on native fetch/WebSocket (Node 18+, browsers, edge). Keys, assets, RFQ/quote, thread accept/propose, swaps, unsigned-tx settlement builders + broadcast, cursor pagination (page + async-iterate), webhook HMAC verify, secret/hashlock helpers, MakerFeed WebSocket. Typechecks clean.
  • python/ (hashlock-sdk) — the same surface on httpx; optional [ws] extra for the maker feed; stdlib webhook verify + secret helpers. Imports + secret/hashlock verified.
  • examples/ — TS/Python quickstarts + a Fireblocks/Copper signing reference (documented, not a live integration): CONTRACT_CALL for EVM, raw-sign for TRON/Bitcoin, and the TRON approve→re-build-fund TTL note.

Notes

  • Custody-agnostic: settlement builders return UNSIGNED transactions; signing is the caller's (wallet / HSM / Fireblocks / Copper). The server never holds keys.
  • BREAKING: full API surface change vs the old @hashlock-tech/sdk v0.3.0.
  • Default base URL points at the sandbox https://api-dev.hashlock.markets/v1.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Introduced refreshed TypeScript and Python SDKs for RFQs, swap management, unsigned settlement transactions, broadcasting, webhooks, and maker quotes.
    • Added secret/hashlock utilities and webhook signature verification.
    • Added end-to-end BTC↔USDT quickstarts and custody-provider signing examples.
  • Documentation
    • Added streamlined SDK guides, quickstarts, API capabilities, sandbox configuration, settlement workflows, and signing guidance.
  • CI
    • Added separate TypeScript build/type checks and Python syntax validation.

…cks reference)

The previous SDK targeted the OLD codebase (GraphQL/SDL, "Instant Settlement lanes",
trade-service, agent layer) and no longer matches the product. Replace it wholesale
with thin, typed clients over the current non-custodial /v1 REST API:

- typescript/ (@hashlock-tech/sdk) — zero-dep client on native fetch/WebSocket (Node
  18+, browsers, edge): keys, assets, RFQ/quote, thread accept/propose, swaps, unsigned-
  tx settlement builders + broadcast, cursor pagination (page + async-iterate), webhook
  HMAC verify, secret/hashlock helpers, MakerFeed WS.
- python/ (hashlock-sdk) — the same surface on httpx; optional [ws] extra for the maker
  feed; stdlib webhook verify + secret helpers.
- examples/ — TS/Python quickstarts + a Fireblocks/Copper signing reference (documented,
  not a live integration): CONTRACT_CALL for EVM, raw-sign for TRON/Bitcoin, and the
  TRON approve→re-build-fund TTL note.

Custody-agnostic throughout: settlement builders return UNSIGNED transactions; signing is
the caller's (wallet / HSM / Fireblocks / Copper). BREAKING: full API surface change.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jul 22, 2026

Copy link
Copy Markdown

Review Change Stack

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Free

Run ID: 7029a7e4-0baf-42df-b821-6700d8e8ebdc

📥 Commits

Reviewing files that changed from the base of the PR and between 97a1486 and c0cadab.

⛔ Files ignored due to path filters (2)
  • package-lock.json is excluded by !**/package-lock.json
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (50)
  • .env.example
  • .github/workflows/ci.yml
  • .gitignore
  • CHANGELOG.md
  • README.md
  • docs/architecture/ARCHITECTURE.md
  • docs/architecture/ARCHITECTURE.ru.md
  • examples/README.md
  • examples/fireblocks/README.md
  • examples/fireblocks/sign_evm.py
  • examples/fireblocks/sign_evm.ts
  • examples/quickstart.py
  • examples/quickstart.ts
  • package.json
  • python/README.md
  • python/hashlock/__init__.py
  • python/hashlock/client.py
  • python/hashlock/errors.py
  • python/hashlock/secret.py
  • python/hashlock/webhooks.py
  • python/hashlock/ws.py
  • python/pyproject.toml
  • scripts/vendor-schema.mjs
  • src/__tests__/hashlock.test.ts
  • src/__tests__/instant.test.ts
  • src/__tests__/schema-validate.test.ts
  • src/client.ts
  • src/errors.ts
  • src/experimental.ts
  • src/hashlock.ts
  • src/index.ts
  • src/instant.ts
  • src/principal.ts
  • src/types.ts
  • src/ws.ts
  • test/fixtures/schema.graphql
  • test/fixtures/schema.subscriptions.graphql
  • tsconfig.json
  • typescript/README.md
  • typescript/package.json
  • typescript/src/client.ts
  • typescript/src/errors.ts
  • typescript/src/index.ts
  • typescript/src/secret.ts
  • typescript/src/types.ts
  • typescript/src/webhooks.ts
  • typescript/src/ws.ts
  • typescript/tsconfig.json
  • typescript/tsup.config.ts
  • vitest.config.ts
💤 Files with no reviewable changes (22)
  • docs/architecture/ARCHITECTURE.md
  • .env.example
  • CHANGELOG.md
  • docs/architecture/ARCHITECTURE.ru.md
  • package.json
  • src/principal.ts
  • vitest.config.ts
  • tsconfig.json
  • src/experimental.ts
  • test/fixtures/schema.graphql
  • scripts/vendor-schema.mjs
  • src/tests/hashlock.test.ts
  • src/errors.ts
  • src/ws.ts
  • src/hashlock.ts
  • test/fixtures/schema.subscriptions.graphql
  • src/index.ts
  • src/tests/instant.test.ts
  • src/tests/schema-validate.test.ts
  • src/instant.ts
  • src/client.ts
  • src/types.ts

📝 Walkthrough

Walkthrough

The repository transitions from a GraphQL TypeScript SDK to new TypeScript and Python REST SDK packages. It adds typed API clients, settlement builders, webhook verification, secret utilities, maker feeds, examples, documentation, packaging metadata, and separate TypeScript/Python CI jobs.

Changes

SDK transition

Layer / File(s) Summary
TypeScript contracts and helpers
typescript/src/types.ts, typescript/src/errors.ts, typescript/src/secret.ts, typescript/src/webhooks.ts, typescript/src/index.ts
Adds REST API models, settlement build types, structured errors, secret/hash utilities, webhook verification, and public exports.
TypeScript client and maker feed
typescript/src/client.ts, typescript/src/ws.ts, typescript/package.json, typescript/tsconfig.json, typescript/tsup.config.ts
Adds HTTP API operations, pagination, RFQ and swap workflows, settlement and webhook endpoints, and a WebSocket maker feed with ESM build configuration.
Python SDK implementation
python/hashlock/*, python/pyproject.toml, python/README.md
Adds the Python package with HTTP API methods, pagination, errors, secret/hash helpers, webhook verification, optional WebSocket support, and packaging metadata.
Examples and usage documentation
examples/*, README.md, typescript/README.md
Adds BTC↔USDT quickstarts, Fireblocks signing examples, API usage documentation, and a shortened root overview.
Repository documentation and tooling
.github/workflows/ci.yml, .gitignore
Splits CI into TypeScript and Python jobs and updates ignored build, cache, environment, and platform artifacts.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant SDK
  participant HashlockMarketsAPI
  participant SigningProvider
  participant Blockchain
  SDK->>HashlockMarketsAPI: Create RFQ and accept terms
  HashlockMarketsAPI-->>SDK: Return swap and unsigned settlement build
  SDK->>SigningProvider: Submit unsigned transaction
  SigningProvider->>Blockchain: Sign and broadcast
  Blockchain-->>SigningProvider: Return transaction hash
  SigningProvider->>HashlockMarketsAPI: Relay signed transaction
Loading

Note

🎁 Summarized by CodeRabbit Free

Your organization is on the Free plan. CodeRabbit will generate a high-level summary and a walkthrough for each pull request. For a comprehensive line-by-line review, please upgrade your subscription to CodeRabbit Pro by visiting https://app.coderabbit.ai/login.

Comment @coderabbitai help to get the list of available commands.

@lexaisnotdead
lexaisnotdead merged commit 22e769a into main Jul 22, 2026
5 checks passed
@lexaisnotdead
lexaisnotdead deleted the feat/v1-sdk-rewrite branch July 24, 2026 14:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant