Shielded Addresses
Used to transfer funds inside a privacy pool
Generate Shielded Address (pool specific)
A regular shielded address for the currently selected privacy pool (aka pool-specific address).
async generateAddress(): Promise<string>Returns
Promise returns the shielded address for the current pool.
Example
console.log(`${await zkClient.generateAddress()}`);
// output: zkbob_sepolia:MrjNRn4ja5ctEW5PVFkZDe6XG97ZNCCHtgchKGzUgbrQDYUf26PikByp61oDVD9Generate Universal Shielded Address
A universal shielded address for use with any privacy pool (aka generic address).
async generateUniversalAddress(): Promise<string>Returns
Promise returns the shielded address for any pool
Example
Generate Shielded Address for Another Account
You can also generate a pool-specific address for another user account. To generate, you must provide the account spending key.
Parameters
seed - spending key for the account generated address belongs to
Returns
Promise returns the shielded address for the current pool belonging to the provided spending key
Example
Shielded Address Verification
Parameters
address - pool-specific or generic shielded address
Returns
Promise returns true if address checksum is correct and can be used on the current privacy pool
Example
Check if a Shielded Address Belongs to an Account
Parameters
address - pool-specific or generic shielded address
Returns
Promise returns true if address checksum is correct, it can be used on the current privacy pool and it belongs to the current user account
Example
Get Components of a Shielded Address
Parameters
address - pool-specific or generic shielded address
Returns
Promise returns IAddressComponents for the provided address
Example
Last updated
Was this helpful?