Skip to content

ZcashRPCClient

SIP Protocol API Reference v0.7.2


SIP Protocol API Reference / ZcashRPCClient

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5020

Zcash RPC Client

Provides type-safe access to zcashd JSON-RPC API with automatic retry logic and proper error handling.

IMPORTANT: Always use HTTPS in production environments. This client uses HTTP Basic Authentication which transmits credentials in base64-encoded cleartext. Without TLS/HTTPS, credentials and all RPC data are vulnerable to network sniffing and man-in-the-middle attacks.

Production configuration should use:

  • HTTPS endpoint (e.g., https://your-node.com:8232)
  • Valid TLS certificates
  • Secure credential storage
  • Network-level access controls

new ZcashRPCClient(config): ZcashRPCClient

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5024

ZcashConfig

ZcashRPCClient

get isTestnet(): boolean

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5221

Check if client is configured for testnet

boolean


get endpoint(): string

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5225

Get the RPC endpoint URL

string

validateAddress(address): Promise<ZcashAddressInfo>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5031

Validate a Zcash address

string

Address to validate (t-addr, z-addr, or unified)

Promise<ZcashAddressInfo>

Address validation info


createAccount(): Promise<ZcashNewAccount>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5037

Create a new HD account

Promise<ZcashNewAccount>

New account number


getAddressForAccount(account, receiverTypes?, diversifierIndex?): Promise<ZcashAccountAddress>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5046

Get or derive an address for an account

number

Account number

ZcashReceiverType[]

Optional receiver types (default: best shielded + p2pkh)

number

Optional specific diversifier index

Promise<ZcashAccountAddress>

Account address info


generateShieldedAddress(type?): Promise<string>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5054

Generate a new shielded address (DEPRECATED)

Address type (‘sapling’ or ‘sprout’)

"sapling" | "sprout"

Promise<string>

New shielded address

Use createAccount() and getAddressForAccount() instead


listAddresses(): Promise<string[]>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5060

List all shielded addresses in the wallet

Promise<string[]>

Array of shielded addresses


getAccountBalance(account, minConf?): Promise<ZcashAccountBalance>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5068

Get balance for an account

number

Account number

number

Minimum confirmations (default: 1)

Promise<ZcashAccountBalance>

Account balance by pool


getBalance(address, minConf?): Promise<number>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5077

Get balance for an address (DEPRECATED)

string

Address to check

number

Minimum confirmations

Promise<number>

Balance in ZEC

Use getAccountBalance() instead


getTotalBalance(minConf?): Promise<{ transparent: string; private: string; total: string; }>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5084

Get total wallet balance

number

Minimum confirmations

Promise<{ transparent: string; private: string; total: string; }>

Total balances (transparent, private, total)


listUnspent(minConf?, maxConf?, includeWatchonly?, addresses?): Promise<ZcashUnspentNote[]>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5098

List unspent shielded notes

number

Minimum confirmations (default: 1)

number

Maximum confirmations (default: 9999999)

boolean

Include watchonly addresses

string[]

Filter by addresses

Promise<ZcashUnspentNote[]>

Array of unspent notes


sendShielded(params): Promise<string>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5105

Send a shielded transaction

ZcashShieldedSendParams

Send parameters

Promise<string>

Operation ID for tracking


shieldCoinbase(fromAddress, toAddress, fee?, limit?): Promise<{ operationid: string; shieldingUTXOs: number; shieldingValue: number; }>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5115

Shield coinbase UTXOs to a shielded address

string

Transparent address with coinbase

string

Shielded destination

number

Optional fee

number

Max UTXOs to shield

Promise<{ operationid: string; shieldingUTXOs: number; shieldingValue: number; }>

Operation ID


getOperationStatus(operationIds?): Promise<ZcashOperation[]>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5126

Get status of async operations

string[]

Optional specific operation IDs

Promise<ZcashOperation[]>

Array of operation statuses


getOperationResult(operationIds?): Promise<ZcashOperation[]>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5133

Get and remove completed operation results

string[]

Optional specific operation IDs

Promise<ZcashOperation[]>

Array of operation results


listOperationIds(status?): Promise<string[]>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5140

List all operation IDs

string

Optional filter by status

Promise<string[]>

Array of operation IDs


waitForOperation(operationId, pollInterval?, timeout?): Promise<ZcashOperation>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5150

Wait for an operation to complete

string

Operation ID to wait for

number

Poll interval in ms (default: 1000)

number

Max wait time in ms (default: 300000 = 5 min)

Promise<ZcashOperation>

Completed operation

ZcashRPCError if operation fails or times out


getBlockCount(): Promise<number>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5156

Get current block count

Promise<number>

Current block height


getBlockHash(height): Promise<string>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5163

Get block hash at height

number

Block height

Promise<string>

Block hash


getBlockHeader(hashOrHeight): Promise<ZcashBlockHeader>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5170

Get block header

Block hash or height

string | number

Promise<ZcashBlockHeader>

Block header


getBlock(hashOrHeight): Promise<ZcashBlock>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5177

Get full block data

Block hash or height

string | number

Promise<ZcashBlock>

Block data


getBlockchainInfo(): Promise<ZcashBlockchainInfo>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5183

Get blockchain info

Promise<ZcashBlockchainInfo>

Blockchain information


getNetworkInfo(): Promise<ZcashNetworkInfo>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5189

Get network info

Promise<ZcashNetworkInfo>

Network information


exportViewingKey(address): Promise<string>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5196

Export viewing key for address

string

Shielded address

Promise<string>

Viewing key


importViewingKey(viewingKey, rescan?, startHeight?): Promise<void>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5204

Import viewing key

string

The viewing key to import

Rescan the wallet (default: whenkeyisnew)

"yes" | "no" | "whenkeyisnew"

number

Start height for rescan

Promise<void>


call<T>(method, params?): Promise<T>

Defined in: @sip-protocol/sdk/dist/index-CzWPI6Le.d.ts:5212

Make a raw RPC call

T

string

RPC method name

unknown[]

Method parameters

Promise<T>

RPC response result