
/* Autogenerated file, do not edit! */

/* eslint-disable */
import { AztecAddress, CompleteAddress } from '@aztec/aztec.js/addresses';
import { type AbiType, type AztecAddressLike, type ContractArtifact, EventSelector, decodeFromAbi, type EthAddressLike, type FieldLike, type FunctionSelectorLike, loadContractArtifact, loadContractArtifactForPublic, type NoirCompiledContract, type OptionLike, type U128Like, type WrappedFieldLike } from '@aztec/aztec.js/abi';
import { Contract, ContractBase, ContractFunctionInteraction, type ContractMethod, type ContractStorageLayout, type DeployInstantiationOptions, DeployMethod } from '@aztec/aztec.js/contracts';
import { EthAddress } from '@aztec/aztec.js/addresses';
import { Fr, Point } from '@aztec/aztec.js/fields';
import { type PublicKey, PublicKeys } from '@aztec/aztec.js/keys';
import type { Wallet } from '@aztec/aztec.js/wallet';
import ChildContractArtifactJson from '../artifacts/child_contract-Child.json' with { type: 'json' };
export const ChildContractArtifact = loadContractArtifact(ChildContractArtifactJson as NoirCompiledContract);



/**
 * Type-safe interface for contract Child;
 */
export class ChildContract extends ContractBase {
  
  private constructor(
    address: AztecAddress,
    wallet: Wallet,
  ) {
    super(address, ChildContractArtifact, wallet);
  }
  

  
  /**
   * Creates a contract instance.
   * @param address - The deployed contract's address.
   * @param wallet - The wallet to use when interacting with the contract.
   * @returns A new Contract instance.
   */
  public static at(
    address: AztecAddress,
    wallet: Wallet,
  ): ChildContract {
    return Contract.at(address, ChildContract.artifact, wallet) as ChildContract;
  }

  
  /**
   * Creates a tx to deploy a new instance of this contract.
   * @param instantiation - Optional address-affecting parameters (salt, deployer / universalDeploy, publicKeys).
   *                       Salt defaults to a random value; the deployer is locked lazily from the first send-time `from`.
   */
  public static deploy(wallet: Wallet, instantiation?: DeployInstantiationOptions) {
    return DeployMethod.create<ChildContract>(
      wallet,
      {
        artifact: ChildContractArtifact,
        postDeployCtor: (instance, wallet) => ChildContract.at(instance.address, wallet),
        args: [],
      },
      instantiation,
    );
  }

  /**
   * Creates a tx to deploy a new instance of this contract using the specified constructor method.
   */
  public static deployWithOpts<M extends keyof ChildContract['methods']>(
    opts: { method?: M; wallet: Wallet; instantiation?: DeployInstantiationOptions },
    ...args: Parameters<ChildContract['methods'][M]>
  ) {
    return DeployMethod.create<ChildContract>(
      opts.wallet,
      {
        artifact: ChildContractArtifact,
        postDeployCtor: (instance, wallet) => ChildContract.at(instance.address, wallet),
        args,
        constructorNameOrArtifact: opts.method ?? 'constructor',
      },
      opts.instantiation,
    );
  }
  

  
  /**
   * Returns this contract's artifact.
   */
  public static get artifact(): ContractArtifact {
    return ChildContractArtifact;
  }

  /**
   * Returns this contract's artifact with public bytecode.
   */
  public static get artifactForPublic(): ContractArtifact {
    return loadContractArtifactForPublic(ChildContractArtifactJson as NoirCompiledContract);
  }
  

  public static get storage(): ContractStorageLayout<'current_value' | 'private_values'> {
      return {
        current_value: {
      slot: new Fr(1n),
    },
private_values: {
      slot: new Fr(2n),
    }
      } as ContractStorageLayout<'current_value' | 'private_values'>;
    }
    

  /** Type-safe wrappers for the public methods exposed by the contract. */
  public declare methods: {
    
    /** offchain_receive(messages: struct) */
    offchain_receive: ((messages: { ciphertext: FieldLike[], recipient: AztecAddressLike, tx_hash: OptionLike<FieldLike>, anchor_block_timestamp: (bigint | number) }[]) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

    /** private_get_value(amount: field, owner: struct) */
    private_get_value: ((amount: FieldLike, owner: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

    /** private_set_value(new_value: field, owner: struct) */
    private_set_value: ((new_value: FieldLike, owner: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

    /** pub_get_value(base_value: field) */
    pub_get_value: ((base_value: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

    /** pub_inc_value(new_value: field) */
    pub_inc_value: ((new_value: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

    /** pub_set_value(new_value: field) */
    pub_set_value: ((new_value: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

    /** public_dispatch(selector: field) */
    public_dispatch: ((selector: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

    /** set_value_twice_with_nested_first() */
    set_value_twice_with_nested_first: (() => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

    /** set_value_twice_with_nested_last() */
    set_value_twice_with_nested_last: (() => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

    /** set_value_with_two_nested_calls() */
    set_value_with_two_nested_calls: (() => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

    /** sync_state(scope: struct) */
    sync_state: ((scope: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

    /** value(input: field) */
    value: ((input: FieldLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;
  };

  
}
