Skip to content

typescript sdk#2853

Open
UnArbosSix wants to merge 77 commits into
mainfrom
bittensor-core-typescript-sdk
Open

typescript sdk#2853
UnArbosSix wants to merge 77 commits into
mainfrom
bittensor-core-typescript-sdk

Conversation

@UnArbosSix

@UnArbosSix UnArbosSix commented Jul 10, 2026

Copy link
Copy Markdown
Collaborator

Motivation

Add a first-party TypeScript SDK backed by the shared Rust bittensor-core implementation. This avoids reimplementing key handling, SCALE/runtime operations, signed extrinsics, timelock cryptography, metadata proofs, Ledger support, and MEV-shield primitives in JavaScript while providing idiomatic TypeScript chain APIs.

Changes

  • Added sdk/bittensor-ts as @bittensor/sdk, with CommonJS, ESM, native, browser, and TypeScript declaration entry points.
  • Added a Node-API bridge over bittensor-core for keys and keyfiles, runtime metadata and SCALE operations, signed extrinsics, timelock operations, ML-KEM, metadata proofs, and Ledger support.
  • Added an explicit browser entry point backed by bittensor-core-wasm, without Node native addons, Buffer, filesystem access, or native HID.
  • Added lossless conversion for bytes, large integers, and maps with non-string keys, plus typed SDK error handling.
  • Added JSON-RPC transport, endpoint fallback and reconnection, subscriptions, runtime caching, nonce management, extrinsic submission and outcome handling, storage queries, and runtime API calls.
  • Added wallet and balance APIs, generated-style descriptors, and higher-level operations for transfers, subnets, metagraphs, staking, registration, serving, and weights.
  • Added Polkadot.js, PAPI, and Moonwall-compatible keypair and signer adapters.
  • Updated the TypeScript e2e utilities to use the Rust-backed SDK.
  • Added native binding parity checks, Node package tests, browser smoke tests, and a dev-chain transaction integration test.
  • Replaced the previous TypeScript e2e workflow with a workflow that builds the SDK artifact and runs the existing dev and zombienet suites against it.

Files of interest

  • sdk/bittensor-ts/native/ — Node-API binding layer
  • sdk/bittensor-ts/src/ — TypeScript client, wallet, runtime, and compatibility APIs
  • sdk/bittensor-ts/src/browser.ts — browser/WASM entry point
  • sdk/bittensor-ts/test/basic.test.cjs — package-level tests
  • ts-tests/suites/dev/sdk/test-bittensor-ts.ts — chain integration test
  • .github/workflows/bittensor-ts-e2e.yml — SDK build and e2e integration

Behavioral impact

TypeScript consumers can use the shared Rust implementation through @bittensor/sdk, with a native Node.js API and a portable browser/WASM subset. Existing TypeScript e2e helpers now use the SDK for key, address, balance, and transaction operations. This PR does not change on-chain runtime behavior.

Migration and spec version

No storage migration is required. No runtime spec-version bump is required because the runtime is unchanged and the target branch has no network spec-version check.

Testing

CI type-checks and builds the native and browser SDKs, verifies binding parity, runs package and browser tests on the minimum supported Node version, submits and verifies a signed dev-chain transaction, and runs the dev and zombienet TypeScript e2e suites using the built SDK artifact.

@vercel

vercel Bot commented Jul 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
subtensor Ready Ready Preview, Comment Jul 13, 2026 8:02pm

Request Review

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread sdk/typescript-sdk/src/keys.ts Outdated
Comment thread sdk/typescript-sdk/src/keys.ts Outdated
@github-actions

github-actions Bot commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

🛡️ AI Review — Skeptic (security review)

VERDICT: SAFE

VERY HIGH scrutiny: 11-day-old account with minimal public history; tempered by repository write permission, consistent authorship, and no known Gittensor association; bittensor-core-typescript-sdk → main.

Static analysis covered the full SDK and workflow diff, with emphasis on build-time execution, CI credentials, dependency pinning, key material, signing, metadata validation, nonce handling, RPC trust boundaries, and transaction submission. The sole commit after the prior SAFE review is a semantics-preserving options-struct/clippy refactor. Protected AI-review instructions are unchanged.

Findings

No findings.

Conclusion

No malicious payload or security vulnerability was identified in the current revision.


🔍 AI Review — Auditor (domain review)

VERDICT: 👍

Gittensor association UNKNOWN; 11-day-old contributor with repository write access, warranting heightened scrutiny.

The implementation remains consistent with the substantive PR description and has broad package, browser, binding-parity, and dev-chain coverage. The only commit since the prior Auditor review is a semantics-preserving options-struct/clippy refactor.

Overlapping PR #2850 is stacked/complementary rather than competing; other overlaps are incidental. Description correction: main does have a mainnet spec-version check, but no bump is required because runtime behavior is unchanged. No auto-fix was needed.

Findings

No findings.

Conclusion

No correctness or domain issue was found that should block merge.

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread sdk/typescript-sdk/src/wire.ts Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: VULNERABLE

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread sdk/typescript-sdk/src/keys.ts Outdated
Comment thread .github/workflows/typescript-e2e.yml Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread sdk/typescript-sdk/src/keys.ts Outdated
Comment thread .github/workflows/typescript-e2e.yml Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👎

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

AI review — see the sticky summary comment for the verdict and the inline comments below for specific findings.

Comment thread .github/workflows/bittensor-ts-e2e.yml Outdated
@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

@github-actions

Copy link
Copy Markdown
Contributor

🔄 AI review updated — Skeptic: SAFE Auditor: 👍

This was referenced Jul 13, 2026
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