import { IContract } from "../../chain/contract"; import { Scalar } from "../../crypto/scalar"; import { SendShielderTransaction } from "../../shielder/client"; import { Calldata } from "../../shielder/actions"; import { AccountState } from "../../shielder/state"; import { DepositReturn } from "../../wasmClient"; export interface DepositCalldata extends Calldata { calldata: DepositReturn; expectedContractVersion: `0x${string}`; amount: bigint; merkleRoot: Scalar; } export declare class DepositAction { #private; contract: IContract; constructor(contract: IContract); /** * Return the updated state after depositing `amount` into `stateOld`. * Does not perform the actual deposit on blockchain. * @param stateOld * @param amount amount to deposit * @returns updated state */ static rawDeposit(stateOld: AccountState, amount: bigint): Promise; /** * Generate calldata for depositing `amount` into the account. * @param state current account state * @param amount amount to deposit * @returns calldata for deposit action */ generateCalldata(state: AccountState, amount: bigint, expectedContractVersion: `0x${string}`): Promise; /** * Deposit `amount` into the account. * Calls the contract through RPC endpoint to perform the deposit on the blockchain. * @param calldata calldata for deposit action * @param sendShielderTransaction function to send the transaction to the blockchain * @returns transaction hash of the deposit transaction * @throws VersionRejectedByContract */ sendCalldata(calldata: DepositCalldata, sendShielderTransaction: SendShielderTransaction, from: `0x${string}`): Promise<`0x${string}`>; }