/** * 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; export type TupleWithMutable = { arr: bigint[]; bar: bigint; }; /** * Converts the ABI tuple representation of a TupleWithMutable to the struct representation */ export declare function TupleWithMutableFromTuple(abiTuple: [bigint[], bigint]): TupleWithMutable; /** * The argument types for the NestedTuplesStorage contract */ export type NestedTuplesStorageArgs = { /** * The object representation of the arguments for each method */ obj: { 'bootstrap()void': Record; 'mutate_tuple(uint64)void': { val: bigint | number; }; 'mutate_box(uint64)void': { val: bigint | number; }; 'mutate_global(uint64)void': { val: bigint | number; }; 'mutate_local(uint64)void': { val: bigint | number; }; }; /** * The tuple representation of the arguments for each method */ tuple: { 'bootstrap()void': []; 'mutate_tuple(uint64)void': [val: bigint | number]; 'mutate_box(uint64)void': [val: bigint | number]; 'mutate_global(uint64)void': [val: bigint | number]; 'mutate_local(uint64)void': [val: bigint | number]; }; }; /** * The return type for each method */ export type NestedTuplesStorageReturns = { 'bootstrap()void': void; 'mutate_tuple(uint64)void': void; 'mutate_box(uint64)void': void; 'mutate_global(uint64)void': void; 'mutate_local(uint64)void': void; }; /** * Defines the types of available calls and state of the NestedTuplesStorage smart contract. */ export type NestedTuplesStorageTypes = { /** * Maps method signatures / names to their argument and return types. */ methods: Record<'bootstrap()void' | 'bootstrap', { argsObj: NestedTuplesStorageArgs['obj']['bootstrap()void']; argsTuple: NestedTuplesStorageArgs['tuple']['bootstrap()void']; returns: NestedTuplesStorageReturns['bootstrap()void']; }> & Record<'mutate_tuple(uint64)void' | 'mutate_tuple', { argsObj: NestedTuplesStorageArgs['obj']['mutate_tuple(uint64)void']; argsTuple: NestedTuplesStorageArgs['tuple']['mutate_tuple(uint64)void']; returns: NestedTuplesStorageReturns['mutate_tuple(uint64)void']; }> & Record<'mutate_box(uint64)void' | 'mutate_box', { argsObj: NestedTuplesStorageArgs['obj']['mutate_box(uint64)void']; argsTuple: NestedTuplesStorageArgs['tuple']['mutate_box(uint64)void']; returns: NestedTuplesStorageReturns['mutate_box(uint64)void']; }> & Record<'mutate_global(uint64)void' | 'mutate_global', { argsObj: NestedTuplesStorageArgs['obj']['mutate_global(uint64)void']; argsTuple: NestedTuplesStorageArgs['tuple']['mutate_global(uint64)void']; returns: NestedTuplesStorageReturns['mutate_global(uint64)void']; }> & Record<'mutate_local(uint64)void' | 'mutate_local', { argsObj: NestedTuplesStorageArgs['obj']['mutate_local(uint64)void']; argsTuple: NestedTuplesStorageArgs['tuple']['mutate_local(uint64)void']; returns: NestedTuplesStorageReturns['mutate_local(uint64)void']; }>; /** * Defines the shape of the state of the application. */ state: { global: { keys: { glob: TupleWithMutable; tup: TupleWithMutable; }; maps: {}; }; local: { keys: { loc: TupleWithMutable; }; maps: {}; }; box: { keys: { box: TupleWithMutable; }; maps: {}; }; }; }; /** * Defines the possible abi call signatures. */ export type NestedTuplesStorageSignatures = keyof NestedTuplesStorageTypes['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 NestedTuplesStorage smart contract to the method's arguments in either tuple or struct form */ export type MethodArgs = NestedTuplesStorageTypes['methods'][TSignature]['argsObj' | 'argsTuple']; /** * Maps a method signature from the NestedTuplesStorage smart contract to the method's return type */ export type MethodReturn = NestedTuplesStorageTypes['methods'][TSignature]['returns']; /** * Defines the shape of the keyed global state of the application. */ export type GlobalKeysState = NestedTuplesStorageTypes['state']['global']['keys']; /** * Defines the shape of the keyed local state of the application. */ export type LocalKeysState = NestedTuplesStorageTypes['state']['local']['keys']; /** * Defines the shape of the keyed box state of the application. */ export type BoxKeysState = NestedTuplesStorageTypes['state']['box']['keys']; /** * Exposes methods for constructing `AppClient` params objects for ABI calls to the NestedTuplesStorage smart contract */ export declare abstract class NestedTuplesStorageParamsFactory { /** * Gets available optIn ABI call param factories */ static get optIn(): { /** * Constructs opt-in ABI call params for the NestedTuplesStorage smart contract using the bootstrap()void ABI method * * @param params Parameters for the call * @returns An `AppClientMethodCallParams` object for the call */ bootstrap(params: CallParams): AppClientMethodCallParams; }; /** * Constructs a no op call for the mutate_tuple(uint64)void ABI method * * @param params Parameters for the call * @returns An `AppClientMethodCallParams` object for the call */ static mutateTuple(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete; /** * Constructs a no op call for the mutate_box(uint64)void ABI method * * @param params Parameters for the call * @returns An `AppClientMethodCallParams` object for the call */ static mutateBox(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete; /** * Constructs a no op call for the mutate_global(uint64)void ABI method * * @param params Parameters for the call * @returns An `AppClientMethodCallParams` object for the call */ static mutateGlobal(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete; /** * Constructs a no op call for the mutate_local(uint64)void ABI method * * @param params Parameters for the call * @returns An `AppClientMethodCallParams` object for the call */ static mutateLocal(params: CallParams & CallOnComplete): AppClientMethodCallParams & CallOnComplete; } /** * A client to make calls to the NestedTuplesStorage smart contract */ export declare class NestedTuplesStorageClient { /** * The underlying `AppClient` for when you want to have more flexibility */ readonly appClient: _AppClient; /** * Creates a new instance of `NestedTuplesStorageClient` * * @param appClient An `AppClient` instance which has been created with the NestedTuplesStorage app spec */ constructor(appClient: _AppClient); /** * Creates a new instance of `NestedTuplesStorageClient` * * @param params The parameters to initialise the app client with */ constructor(params: Omit); /** * Returns a new `NestedTuplesStorageClient` 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 `NestedTuplesStorageClient` 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: { /** * Gets available optIn methods */ optIn: { /** * Opts the user into an existing instance of the NestedTuplesStorage smart contract using the `bootstrap()void` ABI method. * * @param params The params for the smart contract call * @returns The optIn params */ bootstrap: (params?: CallParams) => Promise; }; /** * Makes a clear_state call to an existing instance of the NestedTuplesStorage 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 NestedTuplesStorage smart contract using the `mutate_tuple(uint64)void` ABI method. * * @param params The params for the smart contract call * @returns The call params */ mutateTuple: (params: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise; /** * Makes a call to the NestedTuplesStorage smart contract using the `mutate_box(uint64)void` ABI method. * * @param params The params for the smart contract call * @returns The call params */ mutateBox: (params: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise; /** * Makes a call to the NestedTuplesStorage smart contract using the `mutate_global(uint64)void` ABI method. * * @param params The params for the smart contract call * @returns The call params */ mutateGlobal: (params: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise; /** * Makes a call to the NestedTuplesStorage smart contract using the `mutate_local(uint64)void` ABI method. * * @param params The params for the smart contract call * @returns The call params */ mutateLocal: (params: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise; }; /** * Create transactions for the current app */ readonly createTransaction: { /** * Gets available optIn methods */ optIn: { /** * Opts the user into an existing instance of the NestedTuplesStorage smart contract using the `bootstrap()void` ABI method. * * @param params The params for the smart contract call * @returns The optIn transaction */ bootstrap: (params?: CallParams) => Promise<{ transactions: Transaction[]; methodCalls: Map; signers: Map; }>; }; /** * Makes a clear_state call to an existing instance of the NestedTuplesStorage smart contract. * * @param params The params for the bare (raw) call * @returns The clearState result */ clearState: (params?: Expand) => Promise; /** * Makes a call to the NestedTuplesStorage smart contract using the `mutate_tuple(uint64)void` ABI method. * * @param params The params for the smart contract call * @returns The call transaction */ mutateTuple: (params: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise<{ transactions: Transaction[]; methodCalls: Map; signers: Map; }>; /** * Makes a call to the NestedTuplesStorage smart contract using the `mutate_box(uint64)void` ABI method. * * @param params The params for the smart contract call * @returns The call transaction */ mutateBox: (params: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise<{ transactions: Transaction[]; methodCalls: Map; signers: Map; }>; /** * Makes a call to the NestedTuplesStorage smart contract using the `mutate_global(uint64)void` ABI method. * * @param params The params for the smart contract call * @returns The call transaction */ mutateGlobal: (params: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise<{ transactions: Transaction[]; methodCalls: Map; signers: Map; }>; /** * Makes a call to the NestedTuplesStorage smart contract using the `mutate_local(uint64)void` ABI method. * * @param params The params for the smart contract call * @returns The call transaction */ mutateLocal: (params: CallParams & { onComplete?: OnApplicationComplete.NoOpOC; }) => Promise<{ transactions: Transaction[]; methodCalls: Map; signers: Map; }>; }; /** * Send calls to the current app */ readonly send: { /** * Gets available optIn methods */ optIn: { /** * Opts the user into an existing instance of the NestedTuplesStorage smart contract using the `bootstrap()void` ABI method. * * @param params The params for the smart contract call * @returns The optIn result */ bootstrap: (params?: CallParams & SendParams) => Promise<{ groupId: string; txIds: string[]; returns?: ABIReturn[] | undefined; confirmations: modelsv2.PendingTransactionResponse[]; transactions: Transaction[]; confirmation: modelsv2.PendingTransactionResponse; transaction: Transaction; return: (undefined | NestedTuplesStorageReturns['bootstrap()void']); }>; }; /** * Makes a clear_state call to an existing instance of the NestedTuplesStorage 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 NestedTuplesStorage smart contract using the `mutate_tuple(uint64)void` ABI method. * * @param params The params for the smart contract call * @returns The call result */ mutateTuple: (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 | NestedTuplesStorageReturns['mutate_tuple(uint64)void']); }>; /** * Makes a call to the NestedTuplesStorage smart contract using the `mutate_box(uint64)void` ABI method. * * @param params The params for the smart contract call * @returns The call result */ mutateBox: (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 | NestedTuplesStorageReturns['mutate_box(uint64)void']); }>; /** * Makes a call to the NestedTuplesStorage smart contract using the `mutate_global(uint64)void` ABI method. * * @param params The params for the smart contract call * @returns The call result */ mutateGlobal: (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 | NestedTuplesStorageReturns['mutate_global(uint64)void']); }>; /** * Makes a call to the NestedTuplesStorage smart contract using the `mutate_local(uint64)void` ABI method. * * @param params The params for the smart contract call * @returns The call result */ mutateLocal: (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 | NestedTuplesStorageReturns['mutate_local(uint64)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): NestedTuplesStorageClient; /** * Methods to access state for the current NestedTuplesStorage app */ state: { /** * Methods to access global state for the current NestedTuplesStorage app */ global: { /** * Get all current keyed values from global state */ getAll: () => Promise>>; /** * Get the current value of the glob key in global state */ glob: () => Promise; /** * Get the current value of the tup key in global state */ tup: () => Promise; }; /** * Methods to access local state for the current NestedTuplesStorage app */ local: (address: string | Address) => { /** * Get all current keyed values from local state */ getAll: () => Promise>>; /** * Get the current value of the loc key in local state */ loc: () => Promise; }; /** * Methods to access box state for the current NestedTuplesStorage app */ box: { /** * Get all current keyed values from box state */ getAll: () => Promise>>; /** * Get the current value of the box key in box state */ box: () => Promise; }; }; newGroup(): NestedTuplesStorageComposer; } export type NestedTuplesStorageComposer = { /** * Calls the mutate_tuple(uint64)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 */ mutateTuple(params?: CallParams): NestedTuplesStorageComposer<[...TReturns, NestedTuplesStorageReturns['mutate_tuple(uint64)void'] | undefined]>; /** * Calls the mutate_box(uint64)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 */ mutateBox(params?: CallParams): NestedTuplesStorageComposer<[...TReturns, NestedTuplesStorageReturns['mutate_box(uint64)void'] | undefined]>; /** * Calls the mutate_global(uint64)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 */ mutateGlobal(params?: CallParams): NestedTuplesStorageComposer<[...TReturns, NestedTuplesStorageReturns['mutate_global(uint64)void'] | undefined]>; /** * Calls the mutate_local(uint64)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 */ mutateLocal(params?: CallParams): NestedTuplesStorageComposer<[...TReturns, NestedTuplesStorageReturns['mutate_local(uint64)void'] | undefined]>; /** * Gets available optIn methods */ readonly optIn: { /** * Opts the user into an existing instance of the NestedTuplesStorage smart contract using the bootstrap()void ABI method. * * @param args The arguments for the smart 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 */ bootstrap(params?: CallParams): NestedTuplesStorageComposer<[...TReturns, NestedTuplesStorageReturns['bootstrap()void'] | undefined]>; }; /** * Makes a clear_state call to an existing instance of the NestedTuplesStorage 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): NestedTuplesStorageComposer<[...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): NestedTuplesStorageComposer; /** * 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 NestedTuplesStorageComposerResults = Expand;