Description

Class that surfaces all of the sapling capability allowing to read from a sapling state and prepare transactions

Param: keys.saplingSigner

Holds the sapling spending key

Param: keys.saplingProver

(Optional) Allows to generate the proofs with the proving key rather than the spending key

Param: saplingContractDetails

Contains the address of the sapling contract, the memo size, and an optional sapling id that must be defined if the sapling contract contains more than one sapling state

Param: readProvider

Allows to read data from the blockchain

Param: packer

(Optional) Allows packing data. Use the MichelCodecPacker by default.

Param: saplingForger

(Optional) Allows serializing the sapling transactions. Use the SaplingForger by default.

Param: saplingTxBuilder

(Optional) Allows to prepare the sapling transactions. Use the SaplingTransactionBuilder by default.

Example

const inMemorySpendingKey = await InMemorySpendingKey.fromMnemonic('YOUR_MNEMONIC');
const readProvider = new RpcReadAdapter(new RpcClient('https://YOUR_PREFERRED_RPC_URL'))

const saplingToolkit = new SaplingToolkit(
{ saplingSigner: inMemorySpendingKey },
{ contractAddress: SAPLING_CONTRACT_ADDRESS, memoSize: 8 },
readProvider
)

Constructors

Methods

  • Parameters

    • saplingTxParams: ParametersSaplingTransaction[]

      to is the payment address that will receive the shielded tokens (zet). amount is the amount of unshielded tokens in tez by default. mutez needs to be set to true if the amount of unshielded tokens is in mutez. memo is an empty string by default.

    Returns Promise<string>

    a string representing the sapling transaction.

    Description

    Prepare a sapling transaction (zet to zet)

  • Parameters

    • shieldedTxParams: ParametersSaplingTransaction[]

      to is the payment address that will receive the shielded tokens (zet). amount is the amount of shielded tokens in tez by default. mutez needs to be set to true if the amount of shielded tokens is in mutez. memo is an empty string by default.

    Returns Promise<string>

    a string representing the sapling transaction

    Description

    Prepare a shielded transaction

  • Parameters

    • unshieldedTxParams: ParametersUnshieldedTransaction

      to is the Tezos address that will receive the unshielded tokens (tz1, tz2 or tz3). amount is the amount of unshielded tokens in tez by default. mutez needs to be set to true if the amount of unshielded tokens is in mutez.

    Returns Promise<string>

    a string representing the sapling transaction.

    Description

    Prepare an unshielded transaction

Generated using TypeDoc