/** * 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 Optimizations contract */ export type OptimizationsArgs = { /** * The object representation of the arguments for each method */ obj: { 'sha256()byte[]': Record; 'sha3_256()byte[]': Record; 'sha512_256()byte[]': Record; 'keccak256()byte[]': Record; 'all(byte[])(byte[],byte[],byte[],byte[])': { valueToHash: Uint8Array; }; }; /** * The tuple representation of the arguments for each method */ tuple: { 'sha256()byte[]': []; 'sha3_256()byte[]': []; 'sha512_256()byte[]': []; 'keccak256()byte[]': []; 'all(byte[])(byte[],byte[],byte[],byte[])': [valueToHash: Uint8Array]; }; }; /** * The return type for each method */ export type OptimizationsReturns = { 'sha256()byte[]': Uint8Array; 'sha3_256()byte[]': Uint8Array; 'sha512_256()byte[]': Uint8Array; 'keccak256()byte[]': Uint8Array; 'all(byte[])(byte[],byte[],byte[],byte[])': [Uint8Array, Uint8Array, Uint8Array, Uint8Array]; }; /** * Defines the types of available calls and state of the Optimizations smart contract. */ export type OptimizationsTypes = { /** * Maps method signatures / names to their argument and return types. */ methods: Record<'sha256()byte[]' | 'sha256', { argsObj: OptimizationsArgs['obj']['sha256()byte[]']; argsTuple: OptimizationsArgs['tuple']['sha256()byte[]']; returns: OptimizationsReturns['sha256()byte[]']; }> & Record<'sha3_256()byte[]' | 'sha3_256', { argsObj: OptimizationsArgs['obj']['sha3_256()byte[]']; argsTuple: OptimizationsArgs['tuple']['sha3_256()byte[]']; returns: OptimizationsReturns['sha3_256()byte[]']; }> & Record<'sha512_256()byte[]' | 'sha512_256', { argsObj: OptimizationsArgs['obj']['sha512_256()byte[]']; argsTuple: OptimizationsArgs['tuple']['sha512_256()byte[]']; returns: OptimizationsReturns['sha512_256()byte[]']; }> & Record<'keccak256()byte[]' | 'keccak256', { argsObj: OptimizationsArgs['obj']['keccak256()byte[]']; argsTuple: OptimizationsArgs['tuple']['keccak256()byte[]']; returns: OptimizationsReturns['keccak256()byte[]']; }> & Record<'all(byte[])(byte[],byte[],byte[],byte[])' | 'all', { argsObj: OptimizationsArgs['obj']['all(byte[])(byte[],byte[],byte[],byte[])']; argsTuple: OptimizationsArgs['tuple']['all(byte[])(byte[],byte[],byte[],byte[])']; returns: OptimizationsReturns['all(byte[])(byte[],byte[],byte[],byte[])']; }>; }; /** * Defines the possible abi call signatures. */ export type OptimizationsSignatures = keyof OptimizationsTypes['methods']; /** * Defines the possible abi call signatures for methods that return a non-void value. */ export type OptimizationsNonVoidMethodSignatures = keyof OptimizationsTypes['methods'] extends infer T ? T extends keyof OptimizationsTypes['methods'] ? MethodReturn extends void ? never : T : never : never; /** * 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 Optimizations smart contract to the method's arguments in either tuple or struct form */ export type MethodArgs = OptimizationsTypes['methods'][TSignature]['argsObj' | 'argsTuple']; /** * Maps a method signature from the Optimizations smart contract to the method's return type */ export type MethodReturn = OptimizationsTypes['methods'][TSignature]['returns']; /** * Exposes methods for constructing `AppClient` params objects for ABI calls to the Optimizations smart contract */ export declare abstract class OptimizationsParamsFactory { /** * Constructs a no op call for the sha256()byte[] ABI method * * @param params Parameters for the call * @returns An `AppClientMethodCallParams` object for the call */ static sha256(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete; /** * Constructs a no op call for the sha3_256()byte[] ABI method * * @param params Parameters for the call * @returns An `AppClientMethodCallParams` object for the call */ static sha3_256(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete; /** * Constructs a no op call for the sha512_256()byte[] ABI method * * @param params Parameters for the call * @returns An `AppClientMethodCallParams` object for the call */ static sha512_256(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete; /** * Constructs a no op call for the keccak256()byte[] ABI method * * @param params Parameters for the call * @returns An `AppClientMethodCallParams` object for the call */ static keccak256(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete; /** * Constructs a no op call for the all(byte[])(byte[],byte[],byte[],byte[]) ABI method * * @param params Parameters for the call * @returns An `AppClientMethodCallParams` object for the call */ static all(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete; } /** * A client to make calls to the Optimizations smart contract */ export declare class OptimizationsClient { /** * The underlying `AppClient` for when you want to have more flexibility */ readonly appClient: _AppClient; /** * Creates a new instance of `OptimizationsClient` * * @param appClient An `AppClient` instance which has been created with the Optimizations app spec */ constructor(appClient: _AppClient); /** * Creates a new instance of `OptimizationsClient` * * @param params The parameters to initialise the app client with */ constructor(params: Omit); /** * Checks for decode errors on the given return value and maps the return value to the return type for the given method * @returns The typed return value or undefined if there was no value */ decodeReturnValue(method: TSignature, returnValue: ABIReturn | undefined): MethodReturn; /** * Returns a new `OptimizationsClient` 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 `OptimizationsClient` 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 Optimizations 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 Optimizations smart contract using the `sha256()byte[]` ABI method. * * @param params The params for the smart contract call * @returns The call params */ sha256: (params?: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise; /** * Makes a call to the Optimizations smart contract using the `sha3_256()byte[]` ABI method. * * @param params The params for the smart contract call * @returns The call params */ sha3_256: (params?: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise; /** * Makes a call to the Optimizations smart contract using the `sha512_256()byte[]` ABI method. * * @param params The params for the smart contract call * @returns The call params */ sha512_256: (params?: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise; /** * Makes a call to the Optimizations smart contract using the `keccak256()byte[]` ABI method. * * @param params The params for the smart contract call * @returns The call params */ keccak256: (params?: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise; /** * Makes a call to the Optimizations smart contract using the `all(byte[])(byte[],byte[],byte[],byte[])` ABI method. * * @param params The params for the smart contract call * @returns The call params */ all: (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 Optimizations smart contract. * * @param params The params for the bare (raw) call * @returns The clearState result */ clearState: (params?: Expand) => Promise; /** * Makes a call to the Optimizations smart contract using the `sha256()byte[]` ABI method. * * @param params The params for the smart contract call * @returns The call transaction */ sha256: (params?: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise<{ transactions: Transaction[]; methodCalls: Map; signers: Map; }>; /** * Makes a call to the Optimizations smart contract using the `sha3_256()byte[]` ABI method. * * @param params The params for the smart contract call * @returns The call transaction */ sha3_256: (params?: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise<{ transactions: Transaction[]; methodCalls: Map; signers: Map; }>; /** * Makes a call to the Optimizations smart contract using the `sha512_256()byte[]` ABI method. * * @param params The params for the smart contract call * @returns The call transaction */ sha512_256: (params?: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise<{ transactions: Transaction[]; methodCalls: Map; signers: Map; }>; /** * Makes a call to the Optimizations smart contract using the `keccak256()byte[]` ABI method. * * @param params The params for the smart contract call * @returns The call transaction */ keccak256: (params?: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise<{ transactions: Transaction[]; methodCalls: Map; signers: Map; }>; /** * Makes a call to the Optimizations smart contract using the `all(byte[])(byte[],byte[],byte[],byte[])` ABI method. * * @param params The params for the smart contract call * @returns The call transaction */ all: (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 Optimizations 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 Optimizations smart contract using the `sha256()byte[]` ABI method. * * @param params The params for the smart contract call * @returns The call result */ sha256: (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 | OptimizationsReturns['sha256()byte[]']); }>; /** * Makes a call to the Optimizations smart contract using the `sha3_256()byte[]` ABI method. * * @param params The params for the smart contract call * @returns The call result */ sha3_256: (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 | OptimizationsReturns['sha3_256()byte[]']); }>; /** * Makes a call to the Optimizations smart contract using the `sha512_256()byte[]` ABI method. * * @param params The params for the smart contract call * @returns The call result */ sha512_256: (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 | OptimizationsReturns['sha512_256()byte[]']); }>; /** * Makes a call to the Optimizations smart contract using the `keccak256()byte[]` ABI method. * * @param params The params for the smart contract call * @returns The call result */ keccak256: (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 | OptimizationsReturns['keccak256()byte[]']); }>; /** * Makes a call to the Optimizations smart contract using the `all(byte[])(byte[],byte[],byte[],byte[])` ABI method. * * @param params The params for the smart contract call * @returns The call result */ all: (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 | OptimizationsReturns['all(byte[])(byte[],byte[],byte[],byte[])']); }>; }; /** * 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): OptimizationsClient; /** * Methods to access state for the current Optimizations app */ state: {}; newGroup(): OptimizationsComposer; } export type OptimizationsComposer = { /** * Calls the sha256()byte[] 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 */ sha256(params?: CallParams): OptimizationsComposer<[...TReturns, OptimizationsReturns['sha256()byte[]'] | undefined]>; /** * Calls the sha3_256()byte[] 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 */ sha3_256(params?: CallParams): OptimizationsComposer<[...TReturns, OptimizationsReturns['sha3_256()byte[]'] | undefined]>; /** * Calls the sha512_256()byte[] 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 */ sha512_256(params?: CallParams): OptimizationsComposer<[...TReturns, OptimizationsReturns['sha512_256()byte[]'] | undefined]>; /** * Calls the keccak256()byte[] 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 */ keccak256(params?: CallParams): OptimizationsComposer<[...TReturns, OptimizationsReturns['keccak256()byte[]'] | undefined]>; /** * Calls the all(byte[])(byte[],byte[],byte[],byte[]) 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 */ all(params?: CallParams): OptimizationsComposer<[...TReturns, OptimizationsReturns['all(byte[])(byte[],byte[],byte[],byte[])'] | undefined]>; /** * Makes a clear_state call to an existing instance of the Optimizations 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): OptimizationsComposer<[...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): OptimizationsComposer; /** * 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 OptimizationsComposerResults = Expand;