Skip to content

docs(readme + barrel): polish to truth — actual API + correct surface count#26

Merged
github-actions[bot] merged 1 commit into
mainfrom
chore/polish-readme-truth
May 13, 2026
Merged

docs(readme + barrel): polish to truth — actual API + correct surface count#26
github-actions[bot] merged 1 commit into
mainfrom
chore/polish-readme-truth

Conversation

@satyakwok
Copy link
Copy Markdown
Member

@satyakwok satyakwok commented May 13, 2026

5 of N in the all-READMEs polish sweep.

Truth gaps fixed

1. Surface count was 5, actual is 6

README intro said "Five independent surfaces"; Status section said "five-door surface". Actually six per package.json exports + src/ subdirs:

`./evm ./native ./bft ./wallet ./grpc ./grpc-web`

Updated both to "six".

2. Sign-and-broadcast example used a fictional API

The previous example called:

  • `wallet.buildAndSignTransfer(w, {...})` — doesn't exist (only `SentrixWallet.fromPrivateKeyHex` + `.sign(tx)` are exported)
  • `sentrix.broadcast(tx)` — actual method is `submitTx(tx)`
  • `sentrix.nextNonce(addr)` — doesn't exist; callers read `nonce` off `balance(addr)` which returns `{ address, balance_srx, nonce }`

Replaced with the real flow verified against `src/native/tx.ts` + `src/wallet/index.ts`:

```ts
import { native, SentrixWallet } from "@sentrix/chain";
import { buildTransfer } from "@sentrix/chain/native";

const w = SentrixWallet.fromPrivateKeyHex(...);
const sentrix = native.nativeClient("mainnet");
const { nonce } = await sentrix.balance(w.address);

const unsigned = buildTransfer({ from: w.address, to, amount, fee, nonce, chainId: 7119n });
const signed = await w.sign(unsigned);
const { txid } = await sentrix.submitTx(signed);
```

A copy-paste user following the previous example would hit `TypeError: wallet.buildAndSignTransfer is not a function` at runtime — that's the kind of doc-rot worth fixing first.

3. `src/index.ts` barrel comment was even more outdated

Header claimed "three independent surfaces" listing only evm + native + bft. The barrel actually re-exports four (those + SentrixWallet) and exposes six total via subpath. Updated to document all six + the rationale for keeping gRPC + gRPC-Web subpath-only.

Summary by CodeRabbit

  • Documentation
    • Updated feature overview to reflect six available surfaces, including new token operations and staking capabilities
    • Enhanced quick-start examples with improved wallet initialization and native transaction submission patterns
    • Clarified surface re-export structure and transport layer configuration across different runtime environments

Review Change Stack

… count

Three classes of stale claims in the README + main barrel comment:

1. **"Five independent surfaces"** but the package actually has six
   (evm, native, bft, wallet, grpc, grpc-web — confirmed via package.json
   exports + src/ subdirs). Status section also said "five-door".
   Updated both to "six".

2. **"Sign + broadcast" example used a fictional API**:
   - `wallet.buildAndSignTransfer(w, {...})` doesn't exist (only
     `SentrixWallet.fromPrivateKeyHex` / `.sign(tx)` are exported)
   - `sentrix.broadcast(tx)` doesn't exist (the actual method is
     `submitTx(tx)`)
   - `sentrix.nextNonce(addr)` doesn't exist (callers read `nonce` off
     `balance(addr)` which returns `{ address, balance_srx, nonce }`)
   Replaced with the real flow: import `buildTransfer` from
   `@sentrix/chain/native`, build the unsigned tx struct, call
   `wallet.sign()`, submit via `submitTx()`. Verified against
   src/native/tx.ts + src/wallet/index.ts.

3. **`src/index.ts` barrel comment claimed "three independent surfaces"**
   listing only evm + native + bft. The barrel actually re-exports four
   (evm + native + bft + SentrixWallet) and exposes six total via
   subpath. Updated to document all six + the rationale for keeping
   gRPC + gRPC-Web subpath-only (transport can't load in the other env).
@github-actions github-actions Bot enabled auto-merge (squash) May 13, 2026 18:19
@github-actions github-actions Bot merged commit a09a12f into main May 13, 2026
5 of 6 checks passed
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented May 13, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro Plus

Run ID: 2fc0ae8e-2cb6-436a-8b48-348100e19f69

📥 Commits

Reviewing files that changed from the base of the PR and between 0de404b and a12234a.

📒 Files selected for processing (2)
  • README.md
  • src/index.ts

📝 Walkthrough

Walkthrough

This PR updates package documentation and examples to reflect a newly expanded six-surface model for the SDK. The src/index.ts barrel documentation is revised to describe six independent surfaces—EVM, native, BFT, wallet, gRPC, and gRPC-Web—while clarifying that only the first four are safe for root re-export due to transport and runtime differences. The README feature count is updated from five to six surfaces, and the native transaction signing example is rewritten to demonstrate the new API: deriving a wallet from a private key, fetching nonce via balance, constructing an unsigned transfer with explicit chain ID, signing it, and submitting via sentrix.submitTx.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/polish-readme-truth

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

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