API reference
Use the chapter links for examples. The package entry point lists actual exports; the source contracts contain complete TypeScript shapes. Your editor reads the same declarations from the installed package.
Package exports
| Export | Purpose | Guide |
|---|---|---|
defineNetwork, encodeNetworkParameters | Validate and register network parameters | Networks |
getConsensusContext | Derive consensus context from a registered network and target height | Networks |
parseZec, formatZec | Exact ZEC/zatoshi conversion | Amounts |
accountIndex, diversifierIndex, txId, blockHash | Validate typed identifiers | Identifiers |
httpTransport, readGenesisHash, createPublicClient | JSON-RPC transport and public reads | Public client |
grpc, createLightClient | Lightwallet transport and reads | Light client |
createWalletClient | Open the local wallet and recover recorded work | Wallet setup |
createZcashClient | Group existing same-network clients | Introduction |
resolveBirthday | Resolve a scan starting point | Accounts |
accountFromViewingKey, viewing, addresses | Standalone viewing and address operations | Receiving |
createCustomSigner, pczt | Signer integration and standalone PCZT tools | Signing |
isZcashError | Narrow a structured SDK failure | Errors |
@zcashlabs/zcash.js/grpc-node additionally exports createGrpcNodeTransport for explicit Node byte-transport use.
Wallet methods
| Group | Methods | Effect |
|---|---|---|
accounts | create, import, list, get, remove, attachSigner, restoreSigner, detachSigner | Local account records and signer bindings |
addresses | current, next, list, at | Read or record receive-address exposure |
| Planning | propose | Retain an immutable proposal and its locks |
| Execution | send, shield | Plan/execute and explicitly dispatch payment work |
| Stages | build, prove, sign, finalize | Prepare artifacts; finalize retains bytes without submission |
pczt | export, import | Exchange artifacts associated with an operation |
operations | list, get, resume, abandon | Inspect/recover work or retire an unbuilt proposal |
| Submission | broadcast | Submit retained bytes for an operation |
| Queries | getBalance, getHistory, getTransaction, listNotes, listUtxos | Read local scan/accounting state |
| Sync | sync, getSyncStatus, watchSync | Scan or observe progress |
| Lifetime | close | Drain work and close the wallet |
A PendingPayment exposes operationId, snapshot, events, broadcast, and wait. A wallet exposes network and the startup recovery report.
Public and light methods
| Public client | Light client |
|---|---|
getTip | getTip, getServerInfo |
getBlock, getBlockHeader | streamCompactBlocks |
getTransaction, getTransactionStatus | getTransaction |
getUtxos | getAddressUtxos, getAddressBalance |
getTreeState, getSubtreeRoots | getTreeState, getSubtreeRoots |
watchTransaction, waitForTransaction | streamAddressTransactions, streamMempool |
broadcastTransaction | broadcastTransaction |
Most asynchronous methods accept an optional signal. Pass only the documented options: unknown fields can reject. Streams need sequential consumption and explicit cleanup. Source observations include sourceId and observedAt; they are source evidence, not a full-node consensus verdict.