Skip to content

typescript sdk#2853

Open
UnArbosSix wants to merge 47 commits into
bittensor-core-explorationfrom
bittensor-core-typescript-sdk
Open

typescript sdk#2853
UnArbosSix wants to merge 47 commits into
bittensor-core-explorationfrom
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 12, 2026 4:56pm

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: 10-day-old account with no public repositories, mitigated by repository write permission, consistent commit authorship, and no known Gittensor association; bittensor-core-typescript-sdk → bittensor-core-exploration.

No protected AI-review or Copilot instruction files were modified. Static analysis found no malicious behavior or security vulnerability in the SDK, native key-handling boundaries, locked dependencies, build scripts, or fork-gated CI execution.

Findings

No findings.

Conclusion

The prior wasm-pack supply-chain concern remains resolved, and the current diff introduces no new security findings.


🔍 AI Review — Auditor (domain review)

VERDICT: 👍

Gittensor association UNKNOWN; very new contributor with repository write access, so the large SDK received heightened scrutiny.

The description matches the implementation. No spec-version bump applies to this non-network base branch, and overlapping PRs are complementary rather than duplicates. No runtime confirmation was needed for this unchanged rerun.

Findings

No findings.

Conclusion

The SDK implementation, compatibility layers, and focused tests remain coherent. No substantive domain issues 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

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: 👍

@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: 👍

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