
/* 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 NestedUtilityContractArtifactJson from '../artifacts/nested_utility_contract-NestedUtility.json' with { type: 'json' };
export const NestedUtilityContractArtifact = loadContractArtifact(NestedUtilityContractArtifactJson as NoirCompiledContract);



/**
 * Type-safe interface for contract NestedUtility;
 */
export class NestedUtilityContract extends ContractBase {
  
  private constructor(
    address: AztecAddress,
    wallet: Wallet,
  ) {
    super(address, NestedUtilityContractArtifact, 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,
  ): NestedUtilityContract {
    return Contract.at(address, NestedUtilityContract.artifact, wallet) as NestedUtilityContract;
  }

  
  /**
   * 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<NestedUtilityContract>(
      wallet,
      {
        artifact: NestedUtilityContractArtifact,
        postDeployCtor: (instance, wallet) => NestedUtilityContract.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 NestedUtilityContract['methods']>(
    opts: { method?: M; wallet: Wallet; instantiation?: DeployInstantiationOptions },
    ...args: Parameters<NestedUtilityContract['methods'][M]>
  ) {
    return DeployMethod.create<NestedUtilityContract>(
      opts.wallet,
      {
        artifact: NestedUtilityContractArtifact,
        postDeployCtor: (instance, wallet) => NestedUtilityContract.at(instance.address, wallet),
        args,
        constructorNameOrArtifact: opts.method ?? 'constructor',
      },
      opts.instantiation,
    );
  }
  

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

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

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

  /** Type-safe wrappers for the public methods exposed by the contract. */
  public declare methods: {
    
    /** delegate_pow_from_storage(target: struct, owner: struct) */
    delegate_pow_from_storage: ((target: AztecAddressLike, owner: AztecAddressLike) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

    /** delegate_pow_private(target: struct, x: field, n: integer) */
    delegate_pow_private: ((target: AztecAddressLike, x: FieldLike, n: (bigint | number)) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

    /** delegate_pow_utility(target: struct, x: field, n: integer) */
    delegate_pow_utility: ((target: AztecAddressLike, x: FieldLike, n: (bigint | number)) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

    /** offchain_receive(messages: struct) */
    offchain_receive: ((messages: { ciphertext: FieldLike[], recipient: AztecAddressLike, tx_hash: OptionLike<FieldLike>, anchor_block_timestamp: (bigint | number) }[]) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

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

    /** pow_private(x: field, n: integer) */
    pow_private: ((x: FieldLike, n: (bigint | number)) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

    /** pow_utility(x: field, n: integer) */
    pow_utility: ((x: FieldLike, n: (bigint | number)) => ContractFunctionInteraction) & Pick<ContractMethod, 'selector'>;

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

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

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

  
}
