/** * This file was automatically generated by @algorandfoundation/algokit-client-generator. * DO NOT MODIFY IT BY HAND. * requires: @algorandfoundation/algokit-utils: ^7 */ import { type AlgorandClient } from '@algorandfoundation/algokit-utils/types/algorand-client'; import { ABIReturn } from '@algorandfoundation/algokit-utils/types/app'; import { Arc56Contract } from '@algorandfoundation/algokit-utils/types/app-arc56'; import { AppClient as _AppClient, AppClientMethodCallParams, AppClientParams, AppClientBareCallParams, CallOnComplete, ResolveAppClientByCreatorAndName, ResolveAppClientByNetwork, CloneAppClientParams } from '@algorandfoundation/algokit-utils/types/app-client'; import { TransactionComposer, AppCallMethodCall, RawSimulateOptions, SkipSignaturesSimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'; import { SendParams, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction'; import { Address, modelsv2, OnApplicationComplete, Transaction, TransactionSigner } from 'algosdk'; export declare const APP_SPEC: Arc56Contract; /** * A state record containing binary data */ export interface BinaryState { /** * Gets the state value as a Uint8Array */ asByteArray(): Uint8Array | undefined; /** * Gets the state value as a string */ asString(): string | undefined; } /** * Expands types for IntelliSense so they are more human readable * See https://stackoverflow.com/a/69288824 */ export type Expand = T extends (...args: infer A) => infer R ? (...args: Expand) => Expand : T extends infer O ? { [K in keyof O]: O[K]; } : never; /** * The argument types for the StateProxyContract contract */ export type StateProxyContractArgs = { /** * The object representation of the arguments for each method */ obj: { 'create()void': Record; 'clear()void': Record; 'order_of_eval_global()void': Record; 'order_of_eval_local()void': Record; 'order_of_eval_box()void': Record; }; /** * The tuple representation of the arguments for each method */ tuple: { 'create()void': []; 'clear()void': []; 'order_of_eval_global()void': []; 'order_of_eval_local()void': []; 'order_of_eval_box()void': []; }; }; /** * The return type for each method */ export type StateProxyContractReturns = { 'create()void': void; 'clear()void': void; 'order_of_eval_global()void': void; 'order_of_eval_local()void': void; 'order_of_eval_box()void': void; }; /** * Defines the types of available calls and state of the StateProxyContract smart contract. */ export type StateProxyContractTypes = { /** * Maps method signatures / names to their argument and return types. */ methods: Record<'create()void' | 'create', { argsObj: StateProxyContractArgs['obj']['create()void']; argsTuple: StateProxyContractArgs['tuple']['create()void']; returns: StateProxyContractReturns['create()void']; }> & Record<'clear()void' | 'clear', { argsObj: StateProxyContractArgs['obj']['clear()void']; argsTuple: StateProxyContractArgs['tuple']['clear()void']; returns: StateProxyContractReturns['clear()void']; }> & Record<'order_of_eval_global()void' | 'order_of_eval_global', { argsObj: StateProxyContractArgs['obj']['order_of_eval_global()void']; argsTuple: StateProxyContractArgs['tuple']['order_of_eval_global()void']; returns: StateProxyContractReturns['order_of_eval_global()void']; }> & Record<'order_of_eval_local()void' | 'order_of_eval_local', { argsObj: StateProxyContractArgs['obj']['order_of_eval_local()void']; argsTuple: StateProxyContractArgs['tuple']['order_of_eval_local()void']; returns: StateProxyContractReturns['order_of_eval_local()void']; }> & Record<'order_of_eval_box()void' | 'order_of_eval_box', { argsObj: StateProxyContractArgs['obj']['order_of_eval_box()void']; argsTuple: StateProxyContractArgs['tuple']['order_of_eval_box()void']; returns: StateProxyContractReturns['order_of_eval_box()void']; }>; /** * Defines the shape of the state of the application. */ state: { global: { keys: { /** * g1 description */ global1: bigint; /** * g2 description */ global2: bigint; }; maps: {}; }; local: { keys: { /** * l1 description */ local1: bigint; /** * l2 description */ local2: bigint; }; maps: {}; }; box: { keys: {}; maps: { boxMap: Map; }; }; }; }; /** * Defines the possible abi call signatures. */ export type StateProxyContractSignatures = keyof StateProxyContractTypes['methods']; /** * Defines an object containing all relevant parameters for a single call to the contract. */ export type CallParams = Expand & { /** The args for the ABI method call, either as an ordered array or an object */ args: Expand; }>; /** * Maps a method signature from the StateProxyContract smart contract to the method's arguments in either tuple or struct form */ export type MethodArgs = StateProxyContractTypes['methods'][TSignature]['argsObj' | 'argsTuple']; /** * Maps a method signature from the StateProxyContract smart contract to the method's return type */ export type MethodReturn = StateProxyContractTypes['methods'][TSignature]['returns']; /** * Defines the shape of the keyed global state of the application. */ export type GlobalKeysState = StateProxyContractTypes['state']['global']['keys']; /** * Defines the shape of the keyed local state of the application. */ export type LocalKeysState = StateProxyContractTypes['state']['local']['keys']; /** * Defines the shape of the keyed box state of the application. */ export type BoxKeysState = StateProxyContractTypes['state']['box']['keys']; /** * Exposes methods for constructing `AppClient` params objects for ABI calls to the StateProxyContract smart contract */ export declare abstract class StateProxyContractParamsFactory { /** * Constructs a no op call for the clear()void ABI method * * @param params Parameters for the call * @returns An `AppClientMethodCallParams` object for the call */ static clear(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete; /** * Constructs a no op call for the order_of_eval_global()void ABI method * * @param params Parameters for the call * @returns An `AppClientMethodCallParams` object for the call */ static orderOfEvalGlobal(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete; /** * Constructs a no op call for the order_of_eval_local()void ABI method * * @param params Parameters for the call * @returns An `AppClientMethodCallParams` object for the call */ static orderOfEvalLocal(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete; /** * Constructs a no op call for the order_of_eval_box()void ABI method * * @param params Parameters for the call * @returns An `AppClientMethodCallParams` object for the call */ static orderOfEvalBox(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete; } /** * A client to make calls to the StateProxyContract smart contract */ export declare class StateProxyContractClient { /** * The underlying `AppClient` for when you want to have more flexibility */ readonly appClient: _AppClient; /** * Creates a new instance of `StateProxyContractClient` * * @param appClient An `AppClient` instance which has been created with the StateProxyContract app spec */ constructor(appClient: _AppClient); /** * Creates a new instance of `StateProxyContractClient` * * @param params The parameters to initialise the app client with */ constructor(params: Omit); /** * Returns a new `StateProxyContractClient` client, resolving the app by creator address and name * using AlgoKit app deployment semantics (i.e. looking for the app creation transaction note). * @param params The parameters to create the app client */ static fromCreatorAndName(params: Omit): Promise; /** * Returns an `StateProxyContractClient` instance for the current network based on * pre-determined network-specific app IDs specified in the ARC-56 app spec. * * If no IDs are in the app spec or the network isn't recognised, an error is thrown. * @param params The parameters to create the app client */ static fromNetwork(params: Omit): Promise; /** The ID of the app instance this client is linked to. */ get appId(): bigint; /** The app address of the app instance this client is linked to. */ get appAddress(): Address; /** The name of the app. */ get appName(): string; /** The ARC-56 app spec being used */ get appSpec(): Arc56Contract; /** A reference to the underlying `AlgorandClient` this app client is using. */ get algorand(): AlgorandClient; /** * Get parameters to create transactions for the current app. A good mental model for this is that these parameters represent a deferred transaction creation. */ readonly params: { /** * Makes a clear_state call to an existing instance of the StateProxyContract smart contract. * * @param params The params for the bare (raw) call * @returns The clearState result */ clearState: (params?: Expand) => import("@algorandfoundation/algokit-utils/types/composer").AppCallParams; /** * Makes a call to the StateProxyContract smart contract using the `clear()void` ABI method. * * @param params The params for the smart contract call * @returns The call params */ clear: (params?: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise; /** * Makes a call to the StateProxyContract smart contract using the `order_of_eval_global()void` ABI method. * * @param params The params for the smart contract call * @returns The call params */ orderOfEvalGlobal: (params?: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise; /** * Makes a call to the StateProxyContract smart contract using the `order_of_eval_local()void` ABI method. * * @param params The params for the smart contract call * @returns The call params */ orderOfEvalLocal: (params?: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise; /** * Makes a call to the StateProxyContract smart contract using the `order_of_eval_box()void` ABI method. * * @param params The params for the smart contract call * @returns The call params */ orderOfEvalBox: (params?: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise; }; /** * Create transactions for the current app */ readonly createTransaction: { /** * Makes a clear_state call to an existing instance of the StateProxyContract smart contract. * * @param params The params for the bare (raw) call * @returns The clearState result */ clearState: (params?: Expand) => Promise; /** * Makes a call to the StateProxyContract smart contract using the `clear()void` ABI method. * * @param params The params for the smart contract call * @returns The call transaction */ clear: (params?: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise<{ transactions: Transaction[]; methodCalls: Map; signers: Map; }>; /** * Makes a call to the StateProxyContract smart contract using the `order_of_eval_global()void` ABI method. * * @param params The params for the smart contract call * @returns The call transaction */ orderOfEvalGlobal: (params?: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise<{ transactions: Transaction[]; methodCalls: Map; signers: Map; }>; /** * Makes a call to the StateProxyContract smart contract using the `order_of_eval_local()void` ABI method. * * @param params The params for the smart contract call * @returns The call transaction */ orderOfEvalLocal: (params?: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise<{ transactions: Transaction[]; methodCalls: Map; signers: Map; }>; /** * Makes a call to the StateProxyContract smart contract using the `order_of_eval_box()void` ABI method. * * @param params The params for the smart contract call * @returns The call transaction */ orderOfEvalBox: (params?: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise<{ transactions: Transaction[]; methodCalls: Map; signers: Map; }>; }; /** * Send calls to the current app */ readonly send: { /** * Makes a clear_state call to an existing instance of the StateProxyContract smart contract. * * @param params The params for the bare (raw) call * @returns The clearState result */ clearState: (params?: Expand) => Promise<{ groupId: string; txIds: string[]; returns?: ABIReturn[] | undefined; confirmations: modelsv2.PendingTransactionResponse[]; transactions: Transaction[]; confirmation: modelsv2.PendingTransactionResponse; transaction: Transaction; return?: ABIReturn | undefined; }>; /** * Makes a call to the StateProxyContract smart contract using the `clear()void` ABI method. * * @param params The params for the smart contract call * @returns The call result */ clear: (params?: CallParams & SendParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise<{ groupId: string; txIds: string[]; returns?: ABIReturn[] | undefined; confirmations: modelsv2.PendingTransactionResponse[]; transactions: Transaction[]; confirmation: modelsv2.PendingTransactionResponse; transaction: Transaction; return: (undefined | StateProxyContractReturns['clear()void']); }>; /** * Makes a call to the StateProxyContract smart contract using the `order_of_eval_global()void` ABI method. * * @param params The params for the smart contract call * @returns The call result */ orderOfEvalGlobal: (params?: CallParams & SendParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise<{ groupId: string; txIds: string[]; returns?: ABIReturn[] | undefined; confirmations: modelsv2.PendingTransactionResponse[]; transactions: Transaction[]; confirmation: modelsv2.PendingTransactionResponse; transaction: Transaction; return: (undefined | StateProxyContractReturns['order_of_eval_global()void']); }>; /** * Makes a call to the StateProxyContract smart contract using the `order_of_eval_local()void` ABI method. * * @param params The params for the smart contract call * @returns The call result */ orderOfEvalLocal: (params?: CallParams & SendParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise<{ groupId: string; txIds: string[]; returns?: ABIReturn[] | undefined; confirmations: modelsv2.PendingTransactionResponse[]; transactions: Transaction[]; confirmation: modelsv2.PendingTransactionResponse; transaction: Transaction; return: (undefined | StateProxyContractReturns['order_of_eval_local()void']); }>; /** * Makes a call to the StateProxyContract smart contract using the `order_of_eval_box()void` ABI method. * * @param params The params for the smart contract call * @returns The call result */ orderOfEvalBox: (params?: CallParams & SendParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise<{ groupId: string; txIds: string[]; returns?: ABIReturn[] | undefined; confirmations: modelsv2.PendingTransactionResponse[]; transactions: Transaction[]; confirmation: modelsv2.PendingTransactionResponse; transaction: Transaction; return: (undefined | StateProxyContractReturns['order_of_eval_box()void']); }>; }; /** * Clone this app client with different params * * @param params The params to use for the the cloned app client. Omit a param to keep the original value. Set a param to override the original value. Setting to undefined will clear the original value. * @returns A new app client with the altered params */ clone(params: CloneAppClientParams): StateProxyContractClient; /** * Methods to access state for the current StateProxyContract app */ state: { /** * Methods to access global state for the current StateProxyContract app */ global: { /** * Get all current keyed values from global state */ getAll: () => Promise>>; /** * Get the current value of the global1 key in global state */ global1: () => Promise; /** * Get the current value of the global2 key in global state */ global2: () => Promise; }; /** * Methods to access local state for the current StateProxyContract app */ local: (address: string | Address) => { /** * Get all current keyed values from local state */ getAll: () => Promise>>; /** * Get the current value of the local1 key in local state */ local1: () => Promise; /** * Get the current value of the local2 key in local state */ local2: () => Promise; }; /** * Methods to access box state for the current StateProxyContract app */ box: { /** * Get all current keyed values from box state */ getAll: () => Promise>>; /** * Get values from the box_map map in box state */ boxMap: { /** * Get all current values of the box_map map in box state */ getMap: () => Promise>; /** * Get a current value of the box_map map by key from box state */ value: (key: Uint8Array | string) => Promise; }; }; }; newGroup(): StateProxyContractComposer; } export type StateProxyContractComposer = { /** * Calls the clear()void ABI method. * * @param args The arguments for the contract call * @param params Any additional parameters for the call * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions */ clear(params?: CallParams): StateProxyContractComposer<[...TReturns, StateProxyContractReturns['clear()void'] | undefined]>; /** * Calls the order_of_eval_global()void ABI method. * * @param args The arguments for the contract call * @param params Any additional parameters for the call * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions */ orderOfEvalGlobal(params?: CallParams): StateProxyContractComposer<[...TReturns, StateProxyContractReturns['order_of_eval_global()void'] | undefined]>; /** * Calls the order_of_eval_local()void ABI method. * * @param args The arguments for the contract call * @param params Any additional parameters for the call * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions */ orderOfEvalLocal(params?: CallParams): StateProxyContractComposer<[...TReturns, StateProxyContractReturns['order_of_eval_local()void'] | undefined]>; /** * Calls the order_of_eval_box()void ABI method. * * @param args The arguments for the contract call * @param params Any additional parameters for the call * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions */ orderOfEvalBox(params?: CallParams): StateProxyContractComposer<[...TReturns, StateProxyContractReturns['order_of_eval_box()void'] | undefined]>; /** * Makes a clear_state call to an existing instance of the StateProxyContract smart contract. * * @param args The arguments for the bare call * @returns The typed transaction composer so you can fluently chain multiple calls or call execute to execute all queued up transactions */ clearState(params?: AppClientBareCallParams): StateProxyContractComposer<[...TReturns, undefined]>; /** * Adds a transaction to the composer * * @param txn A transaction to add to the transaction group * @param signer The optional signer to use when signing this transaction. */ addTransaction(txn: Transaction, signer?: TransactionSigner): StateProxyContractComposer; /** * Returns the underlying AtomicTransactionComposer instance */ composer(): Promise; /** * Simulates the transaction group and returns the result */ simulate(): Promise & { simulateResponse: modelsv2.SimulateResponse; }>; simulate(options: SkipSignaturesSimulateOptions): Promise & { simulateResponse: modelsv2.SimulateResponse; }>; simulate(options: RawSimulateOptions): Promise & { simulateResponse: modelsv2.SimulateResponse; }>; /** * Sends the transaction group to the network and returns the results */ send(params?: SendParams): Promise>; }; export type StateProxyContractComposerResults = Expand;