docs(readme + barrel): polish to truth — actual API + correct surface count#26
Conversation
… 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).
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR updates package documentation and examples to reflect a newly expanded six-surface model for the SDK. The Estimated code review effort🎯 1 (Trivial) | ⏱️ ~5 minutes ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
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:
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