import { IContract } from "../../chain/contract"; import { SendShielderTransaction } from "../../shielder/client"; import { AccountState } from "../../shielder/state"; import { NewAccountReturn } from "../../wasmClient"; export interface NewAccountCalldata { calldata: NewAccountReturn; expectedContractVersion: `0x${string}`; provingTimeMillis: number; amount: bigint; } export declare class NewAccountAction { #private; contract: IContract; constructor(contract: IContract); /** * Return the updated state after creating a new account with an initial deposit. * Does not perform the actual account creation on blockchain. * @param stateOld * @param amount initial deposit * @returns updated state */ static rawNewAccount(stateOld: AccountState, amount: bigint): Promise; /** * Generate calldata for creation of a new account with an initial deposit. * @param state current account state * @param amount initial deposit * @returns calldata for new account action */ generateCalldata(state: AccountState, amount: bigint, expectedContractVersion: `0x${string}`): Promise; /** * Create a new account with an initial deposit. * Calls the contract through RPC endpoint to create the account on the blockchain. * @param calldata calldata for new account action * @param sendShielderTransaction function to send the transaction to the blockchain * @returns transaction hash of the new account transaction */ sendCalldata(calldata: NewAccountCalldata, sendShielderTransaction: SendShielderTransaction, from: `0x${string}`): Promise<`0x${string}`>; }