ZcashRPCClient
SIP Protocol API Reference v0.7.0
SIP Protocol API Reference / ZcashRPCClient
Class: ZcashRPCClient
Section titled “Class: ZcashRPCClient”Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4957
Zcash RPC Client
Provides type-safe access to zcashd JSON-RPC API with automatic retry logic and proper error handling.
Security
Section titled “Security”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
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new ZcashRPCClient(
config):ZcashRPCClient
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4961
Parameters
Section titled “Parameters”config
Section titled “config”Returns
Section titled “Returns”ZcashRPCClient
Accessors
Section titled “Accessors”isTestnet
Section titled “isTestnet”Get Signature
Section titled “Get Signature”get isTestnet():
boolean
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5158
Check if client is configured for testnet
Returns
Section titled “Returns”boolean
endpoint
Section titled “endpoint”Get Signature
Section titled “Get Signature”get endpoint():
string
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5162
Get the RPC endpoint URL
Returns
Section titled “Returns”string
Methods
Section titled “Methods”validateAddress()
Section titled “validateAddress()”validateAddress(
address):Promise<ZcashAddressInfo>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4968
Validate a Zcash address
Parameters
Section titled “Parameters”address
Section titled “address”string
Address to validate (t-addr, z-addr, or unified)
Returns
Section titled “Returns”Promise<ZcashAddressInfo>
Address validation info
createAccount()
Section titled “createAccount()”createAccount():
Promise<ZcashNewAccount>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4974
Create a new HD account
Returns
Section titled “Returns”Promise<ZcashNewAccount>
New account number
getAddressForAccount()
Section titled “getAddressForAccount()”getAddressForAccount(
account,receiverTypes?,diversifierIndex?):Promise<ZcashAccountAddress>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4983
Get or derive an address for an account
Parameters
Section titled “Parameters”account
Section titled “account”number
Account number
receiverTypes?
Section titled “receiverTypes?”Optional receiver types (default: best shielded + p2pkh)
diversifierIndex?
Section titled “diversifierIndex?”number
Optional specific diversifier index
Returns
Section titled “Returns”Promise<ZcashAccountAddress>
Account address info
generateShieldedAddress()
Section titled “generateShieldedAddress()”generateShieldedAddress(
type?):Promise<string>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4991
Generate a new shielded address (DEPRECATED)
Parameters
Section titled “Parameters”Address type (‘sapling’ or ‘sprout’)
"sapling" | "sprout"
Returns
Section titled “Returns”Promise<string>
New shielded address
Deprecated
Section titled “Deprecated”Use createAccount() and getAddressForAccount() instead
listAddresses()
Section titled “listAddresses()”listAddresses():
Promise<string[]>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:4997
List all shielded addresses in the wallet
Returns
Section titled “Returns”Promise<string[]>
Array of shielded addresses
getAccountBalance()
Section titled “getAccountBalance()”getAccountBalance(
account,minConf?):Promise<ZcashAccountBalance>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5005
Get balance for an account
Parameters
Section titled “Parameters”account
Section titled “account”number
Account number
minConf?
Section titled “minConf?”number
Minimum confirmations (default: 1)
Returns
Section titled “Returns”Promise<ZcashAccountBalance>
Account balance by pool
getBalance()
Section titled “getBalance()”getBalance(
address,minConf?):Promise<number>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5014
Get balance for an address (DEPRECATED)
Parameters
Section titled “Parameters”address
Section titled “address”string
Address to check
minConf?
Section titled “minConf?”number
Minimum confirmations
Returns
Section titled “Returns”Promise<number>
Balance in ZEC
Deprecated
Section titled “Deprecated”Use getAccountBalance() instead
getTotalBalance()
Section titled “getTotalBalance()”getTotalBalance(
minConf?):Promise<{transparent:string;private:string;total:string; }>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5021
Get total wallet balance
Parameters
Section titled “Parameters”minConf?
Section titled “minConf?”number
Minimum confirmations
Returns
Section titled “Returns”Promise<{ transparent: string; private: string; total: string; }>
Total balances (transparent, private, total)
listUnspent()
Section titled “listUnspent()”listUnspent(
minConf?,maxConf?,includeWatchonly?,addresses?):Promise<ZcashUnspentNote[]>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5035
List unspent shielded notes
Parameters
Section titled “Parameters”minConf?
Section titled “minConf?”number
Minimum confirmations (default: 1)
maxConf?
Section titled “maxConf?”number
Maximum confirmations (default: 9999999)
includeWatchonly?
Section titled “includeWatchonly?”boolean
Include watchonly addresses
addresses?
Section titled “addresses?”string[]
Filter by addresses
Returns
Section titled “Returns”Promise<ZcashUnspentNote[]>
Array of unspent notes
sendShielded()
Section titled “sendShielded()”sendShielded(
params):Promise<string>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5042
Send a shielded transaction
Parameters
Section titled “Parameters”params
Section titled “params”Send parameters
Returns
Section titled “Returns”Promise<string>
Operation ID for tracking
shieldCoinbase()
Section titled “shieldCoinbase()”shieldCoinbase(
fromAddress,toAddress,fee?,limit?):Promise<{operationid:string;shieldingUTXOs:number;shieldingValue:number; }>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5052
Shield coinbase UTXOs to a shielded address
Parameters
Section titled “Parameters”fromAddress
Section titled “fromAddress”string
Transparent address with coinbase
toAddress
Section titled “toAddress”string
Shielded destination
number
Optional fee
limit?
Section titled “limit?”number
Max UTXOs to shield
Returns
Section titled “Returns”Promise<{ operationid: string; shieldingUTXOs: number; shieldingValue: number; }>
Operation ID
getOperationStatus()
Section titled “getOperationStatus()”getOperationStatus(
operationIds?):Promise<ZcashOperation[]>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5063
Get status of async operations
Parameters
Section titled “Parameters”operationIds?
Section titled “operationIds?”string[]
Optional specific operation IDs
Returns
Section titled “Returns”Promise<ZcashOperation[]>
Array of operation statuses
getOperationResult()
Section titled “getOperationResult()”getOperationResult(
operationIds?):Promise<ZcashOperation[]>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5070
Get and remove completed operation results
Parameters
Section titled “Parameters”operationIds?
Section titled “operationIds?”string[]
Optional specific operation IDs
Returns
Section titled “Returns”Promise<ZcashOperation[]>
Array of operation results
listOperationIds()
Section titled “listOperationIds()”listOperationIds(
status?):Promise<string[]>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5077
List all operation IDs
Parameters
Section titled “Parameters”status?
Section titled “status?”string
Optional filter by status
Returns
Section titled “Returns”Promise<string[]>
Array of operation IDs
waitForOperation()
Section titled “waitForOperation()”waitForOperation(
operationId,pollInterval?,timeout?):Promise<ZcashOperation>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5087
Wait for an operation to complete
Parameters
Section titled “Parameters”operationId
Section titled “operationId”string
Operation ID to wait for
pollInterval?
Section titled “pollInterval?”number
Poll interval in ms (default: 1000)
timeout?
Section titled “timeout?”number
Max wait time in ms (default: 300000 = 5 min)
Returns
Section titled “Returns”Promise<ZcashOperation>
Completed operation
Throws
Section titled “Throws”ZcashRPCError if operation fails or times out
getBlockCount()
Section titled “getBlockCount()”getBlockCount():
Promise<number>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5093
Get current block count
Returns
Section titled “Returns”Promise<number>
Current block height
getBlockHash()
Section titled “getBlockHash()”getBlockHash(
height):Promise<string>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5100
Get block hash at height
Parameters
Section titled “Parameters”height
Section titled “height”number
Block height
Returns
Section titled “Returns”Promise<string>
Block hash
getBlockHeader()
Section titled “getBlockHeader()”getBlockHeader(
hashOrHeight):Promise<ZcashBlockHeader>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5107
Get block header
Parameters
Section titled “Parameters”hashOrHeight
Section titled “hashOrHeight”Block hash or height
string | number
Returns
Section titled “Returns”Promise<ZcashBlockHeader>
Block header
getBlock()
Section titled “getBlock()”getBlock(
hashOrHeight):Promise<ZcashBlock>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5114
Get full block data
Parameters
Section titled “Parameters”hashOrHeight
Section titled “hashOrHeight”Block hash or height
string | number
Returns
Section titled “Returns”Promise<ZcashBlock>
Block data
getBlockchainInfo()
Section titled “getBlockchainInfo()”getBlockchainInfo():
Promise<ZcashBlockchainInfo>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5120
Get blockchain info
Returns
Section titled “Returns”Promise<ZcashBlockchainInfo>
Blockchain information
getNetworkInfo()
Section titled “getNetworkInfo()”getNetworkInfo():
Promise<ZcashNetworkInfo>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5126
Get network info
Returns
Section titled “Returns”Promise<ZcashNetworkInfo>
Network information
exportViewingKey()
Section titled “exportViewingKey()”exportViewingKey(
address):Promise<string>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5133
Export viewing key for address
Parameters
Section titled “Parameters”address
Section titled “address”string
Shielded address
Returns
Section titled “Returns”Promise<string>
Viewing key
importViewingKey()
Section titled “importViewingKey()”importViewingKey(
viewingKey,rescan?,startHeight?):Promise<void>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5141
Import viewing key
Parameters
Section titled “Parameters”viewingKey
Section titled “viewingKey”string
The viewing key to import
rescan?
Section titled “rescan?”Rescan the wallet (default: whenkeyisnew)
"yes" | "no" | "whenkeyisnew"
startHeight?
Section titled “startHeight?”number
Start height for rescan
Returns
Section titled “Returns”Promise<void>
call()
Section titled “call()”call<
T>(method,params?):Promise<T>
Defined in: @sip-protocol/sdk/dist/index-BYZbDjal.d.ts:5149
Make a raw RPC call
Type Parameters
Section titled “Type Parameters”T
Parameters
Section titled “Parameters”method
Section titled “method”string
RPC method name
params?
Section titled “params?”unknown[]
Method parameters
Returns
Section titled “Returns”Promise<T>
RPC response result