WalletAccountZcash
Defined in: wallet-zcash/src/account.ts:42
Signing Zcash account — BIP-44 P2PKH at m/44’/133’/0’/0/i (t1…). The key never
enters this package: every input is one signer.sign(...) call over the
ZIP-244 signature digest computed here (ecdsa, DER-encoded + SIGHASH_ALL
into the scriptSig); messages are ecdsa-recoverable over the Zcash magic hash.
Every spend is resolved to a full description (“what you sign”) and run through the hard safety checks (fee ceiling, recipient/amount exactness, change ownership) before signing AND before broadcast — also for caller-supplied raw hex.
Extends
Section titled “Extends”Implements
Section titled “Implements”IWalletAccount
Constructors
Section titled “Constructors”Constructor
Section titled “Constructor”new WalletAccountZcash(
signer,publicKey,path,config?):WalletAccountZcash
Defined in: wallet-zcash/src/account.ts:61
publicKey is the signer’s compressed secp256k1 key (33 bytes); it is needed synchronously for the address.
Parameters
Section titled “Parameters”signer
Section titled “signer”Signer
publicKey
Section titled “publicKey”Uint8Array
string
config?
Section titled “config?”ZcashConfig = {}
Returns
Section titled “Returns”WalletAccountZcash
Overrides
Section titled “Overrides”WalletAccountReadOnlyZcash.constructor
Properties
Section titled “Properties”_client
Section titled “_client”
protectedreadonly_client:ZcashClient|undefined
Defined in: wallet-zcash/src/read-only-account.ts:28
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash._client
_config
Section titled “_config”
protectedreadonly_config:ZcashConfig
Defined in: wallet-zcash/src/read-only-account.ts:27
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash._config
_network
Section titled “_network”
protectedreadonly_network:ZcashNetwork
Defined in: wallet-zcash/src/read-only-account.ts:29
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash._network
address
Section titled “address”
readonlyaddress:string
Defined in: wallet-zcash/src/read-only-account.ts:21
The transparent address.
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash.address
readonlychain:string
Defined in: wallet-zcash/src/read-only-account.ts:22
CAIP-2 chain id, e.g. “eip155:1”, “solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp”, “ton:-239”, “tron:0x2b6653dc”, “bip122:000000000019d6689c085ae165831e93”.
Implementation of
Section titled “Implementation of”IWalletAccount.chain
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash.chain
needsNetwork
Section titled “needsNetwork”
readonlyneedsNetwork:true=true
Defined in: wallet-zcash/src/account.ts:44
UTXOs and the tip height come from the network before signing.
Implementation of
Section titled “Implementation of”IWalletAccount.needsNetwork
readonlypath:string
Defined in: wallet-zcash/src/account.ts:46
Derivation path, or external for an external signer.
publicKey
Section titled “publicKey”
readonlypublicKey:Uint8Array
Defined in: wallet-zcash/src/account.ts:48
Compressed secp256k1 public key.
scriptKind
Section titled “scriptKind”
readonlyscriptKind:ScriptKind
Defined in: wallet-zcash/src/read-only-account.ts:26
Script type of the address.
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash.scriptKind
scriptPubKey
Section titled “scriptPubKey”
readonlyscriptPubKey:Uint8Array
Defined in: wallet-zcash/src/read-only-account.ts:24
The address’s scriptPubKey.
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash.scriptPubKey
signerKind
Section titled “signerKind”
readonlysignerKind:"key"|"seed"|"external"
Defined in: wallet-zcash/src/account.ts:56
What holds the key: seed, key (one imported key) or external.
Accessors
Section titled “Accessors”Get Signature
Section titled “Get Signature”get index():
number|undefined
Defined in: wallet-zcash/src/account.ts:76
Account index for the standard m/44’/133’/0’/0/i path.
Returns
Section titled “Returns”number | undefined
maxFee
Section titled “maxFee”Get Signature
Section titled “Get Signature”get maxFee():
bigint
Defined in: wallet-zcash/src/read-only-account.ts:48
Fee ceiling in zatoshis: ZcashConfig.maxFee or the default.
Returns
Section titled “Returns”bigint
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash.maxFee
Methods
Section titled “Methods”describeTransaction()
Section titled “describeTransaction()”describeTransaction(
tx):Promise<ZcashTxDescription>
Defined in: wallet-zcash/src/account.ts:175
“What you sign”: the fully resolved spend (signed, NOT broadcast) or a caller’s raw hex.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<ZcashTxDescription>
dispose()
Section titled “dispose()”dispose():
void
Defined in: wallet-zcash/src/account.ts:244
Zeroize this account’s key material.
Returns
Section titled “Returns”void
Implementation of
Section titled “Implementation of”IWalletAccount.dispose
getAddress()
Section titled “getAddress()”getAddress():
Promise<string>
Defined in: wallet-zcash/src/read-only-account.ts:53
The transparent address.
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”IWalletAccount.getAddress
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash.getAddress
getBalance()
Section titled “getBalance()”getBalance():
Promise<bigint>
Defined in: wallet-zcash/src/read-only-account.ts:56
Confirmed plus incoming mempool value (the transports do not expose pending spends of our own outputs).
Returns
Section titled “Returns”Promise<bigint>
Implementation of
Section titled “Implementation of”IWalletAccount.getBalance
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash.getBalance
getMaxSpendable()
Section titled “getMaxSpendable()”getMaxSpendable(
opts?):Promise<ZcashMaxSpendableResult>
Defined in: wallet-zcash/src/read-only-account.ts:98
Everything spendable in ONE transaction to a single output, no change.
Parameters
Section titled “Parameters”number | bigint
string
Returns
Section titled “Returns”Promise<ZcashMaxSpendableResult>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash.getMaxSpendable
getTokenBalance()
Section titled “getTokenBalance()”getTokenBalance(
_token):Promise<bigint>
Defined in: wallet-zcash/src/read-only-account.ts:62
Always throws: Zcash has no tokens.
Parameters
Section titled “Parameters”_token
Section titled “_token”string
Returns
Section titled “Returns”Promise<bigint>
Implementation of
Section titled “Implementation of”IWalletAccount.getTokenBalance
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash.getTokenBalance
getTransactionReceipt()
Section titled “getTransactionReceipt()”getTransactionReceipt(
hash):Promise<ZcashReceipt|undefined>
Defined in: wallet-zcash/src/read-only-account.ts:107
Undefined until the transaction is mined.
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Promise<ZcashReceipt | undefined>
Implementation of
Section titled “Implementation of”IWalletAccount.getTransactionReceipt
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash.getTransactionReceipt
planSpend()
Section titled “planSpend()”
protectedplanSpend(spend):Promise<SpendPlan>
Defined in: wallet-zcash/src/read-only-account.ts:67
Coin selection for a spend (ZIP-317 fee). Validates the recipient and the dust floor first.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<SpendPlan>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash.planSpend
quoteSendTransaction()
Section titled “quoteSendTransaction()”quoteSendTransaction(
tx):Promise<{fee:bigint; }>
Defined in: wallet-zcash/src/account.ts:193
ZIP-317 fee of a spend in zatoshis.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<{ fee: bigint; }>
Implementation of
Section titled “Implementation of”IWalletAccount.quoteSendTransaction
Overrides
Section titled “Overrides”WalletAccountReadOnlyZcash.quoteSendTransaction
quoteTransfer()
Section titled “quoteTransfer()”quoteTransfer(
o):Promise<{fee:bigint; }>
Defined in: wallet-zcash/src/read-only-account.ts:92
ZIP-317 fee of a transfer in zatoshis.
Parameters
Section titled “Parameters”Returns
Section titled “Returns”Promise<{ fee: bigint; }>
Implementation of
Section titled “Implementation of”IWalletAccount.quoteTransfer
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash.quoteTransfer
requireClient()
Section titled “requireClient()”
protectedrequireClient(what):ZcashClient
Defined in: wallet-zcash/src/read-only-account.ts:42
Parameters
Section titled “Parameters”string
Returns
Section titled “Returns”Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash.requireClient
sendTransaction()
Section titled “sendTransaction()”sendTransaction(
tx,options?):Promise<TransferResult>
Defined in: wallet-zcash/src/account.ts:198
Sign and broadcast.
Parameters
Section titled “Parameters”options?
Section titled “options?”WriteOptions = {}
Returns
Section titled “Returns”Promise<TransferResult>
Implementation of
Section titled “Implementation of”IWalletAccount.sendTransaction
sign()
Section titled “sign()”sign(
message):Promise<string>
Defined in: wallet-zcash/src/account.ts:86
Zcash message signature (zcashd signmessage encoding), base64.
Parameters
Section titled “Parameters”message
Section titled “message”string | Uint8Array<ArrayBufferLike>
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”IWalletAccount.sign
signTransaction()
Section titled “signTransaction()”signTransaction(
tx,options?):Promise<string>
Defined in: wallet-zcash/src/account.ts:181
Sign without broadcasting. Returns the raw transaction hex. Raw hex input gets the checks sendTransaction runs (prevouts through the client) and is returned unchanged, never re-signed.
Parameters
Section titled “Parameters”options?
Section titled “options?”WriteOptions = {}
Returns
Section titled “Returns”Promise<string>
Implementation of
Section titled “Implementation of”IWalletAccount.signTransaction
tipHeight()
Section titled “tipHeight()”
protectedtipHeight():Promise<number|undefined>
Defined in: wallet-zcash/src/read-only-account.ts:122
Chain tip for lock time / expiry; undefined when the transport cannot tell.
Returns
Section titled “Returns”Promise<number | undefined>
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash.tipHeight
toReadOnlyAccount()
Section titled “toReadOnlyAccount()”toReadOnlyAccount():
IWalletAccountReadOnly
Defined in: wallet-zcash/src/account.ts:239
The same address as a WalletAccountReadOnlyZcash.
Returns
Section titled “Returns”IWalletAccountReadOnly
Implementation of
Section titled “Implementation of”IWalletAccount.toReadOnlyAccount
transfer()
Section titled “transfer()”transfer(
o,writeOptions?):Promise<TransferResult>
Defined in: wallet-zcash/src/account.ts:214
Native ZEC only (token is rejected). Subject to transferMaxFee.
Parameters
Section titled “Parameters”writeOptions?
Section titled “writeOptions?”WriteOptions = {}
Returns
Section titled “Returns”Promise<TransferResult>
Implementation of
Section titled “Implementation of”IWalletAccount.transfer
verify()
Section titled “verify()”verify(
message,signature):Promise<boolean>
Defined in: wallet-zcash/src/read-only-account.ts:115
Recover the key from a Zcash message signature and compare its P2PKH address with ours.
Parameters
Section titled “Parameters”message
Section titled “message”string | Uint8Array<ArrayBufferLike>
signature
Section titled “signature”string
Returns
Section titled “Returns”Promise<boolean>
Implementation of
Section titled “Implementation of”IWalletAccount.verify
Inherited from
Section titled “Inherited from”WalletAccountReadOnlyZcash.verify
fromPrivateKey()
Section titled “fromPrivateKey()”
staticfromPrivateKey(privateKey,publicKey,path,config?):WalletAccountZcash
Defined in: wallet-zcash/src/account.ts:71
Back-compat: wrap a raw derived key in a LocalSigner (the account takes ownership; it cannot derive).
Parameters
Section titled “Parameters”privateKey
Section titled “privateKey”Uint8Array
publicKey
Section titled “publicKey”Uint8Array
string
config?
Section titled “config?”ZcashConfig = {}
Returns
Section titled “Returns”WalletAccountZcash