Skip to content

Commit

Permalink
Merge main into release
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Dec 6, 2024
2 parents b494dac + cb6848a commit d91e660
Show file tree
Hide file tree
Showing 17 changed files with 547 additions and 473 deletions.
15 changes: 0 additions & 15 deletions .eslintignore

This file was deleted.

10 changes: 0 additions & 10 deletions .eslintrc

This file was deleted.

32 changes: 32 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import eslint from '@eslint/js'
import prettier from 'eslint-config-prettier'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{
ignores: ['.eslint.config.mjs', 'node_modules/**', 'dist/**', 'build/**', 'coverage/**', '**/*.d.ts', '.idea/**', '.vscode/**'],
},
eslint.configs.recommended,
tseslint.configs.recommended,
{
files: ['**/*.ts'],
languageOptions: {
parser: tseslint.parser,
parserOptions: {
project: './tsconfig.json',
ecmaVersion: 'latest',
sourceType: 'module',
},
},
rules: {
'no-console': 'warn',
'@typescript-eslint/no-unused-vars': [
'error',
{ ignoreRestSiblings: true, argsIgnorePattern: '^_', destructuredArrayIgnorePattern: '^_', varsIgnorePattern: '^_' },
],
'@typescript-eslint/no-unused-expressions': 'off',
'prefer-template': 'error',
},
},
prettier,
)
8 changes: 5 additions & 3 deletions examples/arc56_test/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
CloneAppClientParams,
} from '@algorandfoundation/algokit-utils/types/app-client'
import { AppFactory as _AppFactory, AppFactoryAppClientParams, AppFactoryResolveAppClientByCreatorAndNameParams, AppFactoryDeployParams, AppFactoryParams, CreateSchema } from '@algorandfoundation/algokit-utils/types/app-factory'
import { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
import { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions, RawSimulateOptions, SkipSignaturesSimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
import { SendParams, SendSingleTransactionResult, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction'
import { Address, encodeAddress, modelsv2, OnApplicationComplete, Transaction, TransactionSigner } from 'algosdk'
import SimulateResponse = modelsv2.SimulateResponse
Expand Down Expand Up @@ -839,7 +839,7 @@ export class Arc56TestClient {
},
async simulate(options?: SimulateOptions) {
await promiseChain
const result = await composer.simulate(options)
const result = await (!options ? composer.simulate() : composer.simulate(options))
return {
...result,
returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val) : val.returnValue)
Expand Down Expand Up @@ -902,7 +902,9 @@ export type Arc56TestComposer<TReturns extends [...any[]] = []> = {
/**
* Simulates the transaction group and returns the result
*/
simulate(options?: SimulateOptions): Promise<Arc56TestComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(): Promise<Arc56TestComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(options: SkipSignaturesSimulateOptions): Promise<Arc56TestComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(options: RawSimulateOptions): Promise<Arc56TestComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
/**
* Sends the transaction group to the network and returns the results
*/
Expand Down
8 changes: 5 additions & 3 deletions examples/duplicate_structs/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
CloneAppClientParams,
} from '@algorandfoundation/algokit-utils/types/app-client'
import { AppFactory as _AppFactory, AppFactoryAppClientParams, AppFactoryResolveAppClientByCreatorAndNameParams, AppFactoryDeployParams, AppFactoryParams, CreateSchema } from '@algorandfoundation/algokit-utils/types/app-factory'
import { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
import { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions, RawSimulateOptions, SkipSignaturesSimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
import { SendParams, SendSingleTransactionResult, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction'
import { Address, encodeAddress, modelsv2, OnApplicationComplete, Transaction, TransactionSigner } from 'algosdk'
import SimulateResponse = modelsv2.SimulateResponse
Expand Down Expand Up @@ -591,7 +591,7 @@ export class DuplicateStructsContractClient {
},
async simulate(options?: SimulateOptions) {
await promiseChain
const result = await composer.simulate(options)
const result = await (!options ? composer.simulate() : composer.simulate(options))
return {
...result,
returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val) : val.returnValue)
Expand Down Expand Up @@ -649,7 +649,9 @@ export type DuplicateStructsContractComposer<TReturns extends [...any[]] = []> =
/**
* Simulates the transaction group and returns the result
*/
simulate(options?: SimulateOptions): Promise<DuplicateStructsContractComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(): Promise<DuplicateStructsContractComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(options: SkipSignaturesSimulateOptions): Promise<DuplicateStructsContractComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(options: RawSimulateOptions): Promise<DuplicateStructsContractComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
/**
* Sends the transaction group to the network and returns the results
*/
Expand Down
8 changes: 5 additions & 3 deletions examples/helloworld/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
CloneAppClientParams,
} from '@algorandfoundation/algokit-utils/types/app-client'
import { AppFactory as _AppFactory, AppFactoryAppClientParams, AppFactoryResolveAppClientByCreatorAndNameParams, AppFactoryDeployParams, AppFactoryParams, CreateSchema } from '@algorandfoundation/algokit-utils/types/app-factory'
import { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
import { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions, RawSimulateOptions, SkipSignaturesSimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
import { SendParams, SendSingleTransactionResult, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction'
import { Address, encodeAddress, modelsv2, OnApplicationComplete, Transaction, TransactionSigner } from 'algosdk'
import SimulateResponse = modelsv2.SimulateResponse
Expand Down Expand Up @@ -750,7 +750,7 @@ export class HelloWorldAppClient {
},
async simulate(options?: SimulateOptions) {
await promiseChain
const result = await composer.simulate(options)
const result = await (!options ? composer.simulate() : composer.simulate(options))
return {
...result,
returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val) : val.returnValue)
Expand Down Expand Up @@ -825,7 +825,9 @@ export type HelloWorldAppComposer<TReturns extends [...any[]] = []> = {
/**
* Simulates the transaction group and returns the result
*/
simulate(options?: SimulateOptions): Promise<HelloWorldAppComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(): Promise<HelloWorldAppComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(options: SkipSignaturesSimulateOptions): Promise<HelloWorldAppComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(options: RawSimulateOptions): Promise<HelloWorldAppComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
/**
* Sends the transaction group to the network and returns the results
*/
Expand Down
8 changes: 5 additions & 3 deletions examples/lifecycle/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
CloneAppClientParams,
} from '@algorandfoundation/algokit-utils/types/app-client'
import { AppFactory as _AppFactory, AppFactoryAppClientParams, AppFactoryResolveAppClientByCreatorAndNameParams, AppFactoryDeployParams, AppFactoryParams, CreateSchema } from '@algorandfoundation/algokit-utils/types/app-factory'
import { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
import { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions, RawSimulateOptions, SkipSignaturesSimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
import { SendParams, SendSingleTransactionResult, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction'
import { Address, encodeAddress, modelsv2, OnApplicationComplete, Transaction, TransactionSigner } from 'algosdk'
import SimulateResponse = modelsv2.SimulateResponse
Expand Down Expand Up @@ -836,7 +836,7 @@ export class LifeCycleAppClient {
},
async simulate(options?: SimulateOptions) {
await promiseChain
const result = await composer.simulate(options)
const result = await (!options ? composer.simulate() : composer.simulate(options))
return {
...result,
returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val) : val.returnValue)
Expand Down Expand Up @@ -894,7 +894,9 @@ export type LifeCycleAppComposer<TReturns extends [...any[]] = []> = {
/**
* Simulates the transaction group and returns the result
*/
simulate(options?: SimulateOptions): Promise<LifeCycleAppComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(): Promise<LifeCycleAppComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(options: SkipSignaturesSimulateOptions): Promise<LifeCycleAppComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(options: RawSimulateOptions): Promise<LifeCycleAppComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
/**
* Sends the transaction group to the network and returns the results
*/
Expand Down
8 changes: 5 additions & 3 deletions examples/minimal/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
CloneAppClientParams,
} from '@algorandfoundation/algokit-utils/types/app-client'
import { AppFactory as _AppFactory, AppFactoryAppClientParams, AppFactoryResolveAppClientByCreatorAndNameParams, AppFactoryDeployParams, AppFactoryParams, CreateSchema } from '@algorandfoundation/algokit-utils/types/app-factory'
import { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
import { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions, RawSimulateOptions, SkipSignaturesSimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
import { SendParams, SendSingleTransactionResult, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction'
import { Address, encodeAddress, modelsv2, OnApplicationComplete, Transaction, TransactionSigner } from 'algosdk'
import SimulateResponse = modelsv2.SimulateResponse
Expand Down Expand Up @@ -610,7 +610,7 @@ export class AppClient {
},
async simulate(options?: SimulateOptions) {
await promiseChain
const result = await composer.simulate(options)
const result = await (!options ? composer.simulate() : composer.simulate(options))
return {
...result,
returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val) : val.returnValue)
Expand Down Expand Up @@ -663,7 +663,9 @@ export type AppComposer<TReturns extends [...any[]] = []> = {
/**
* Simulates the transaction group and returns the result
*/
simulate(options?: SimulateOptions): Promise<AppComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(): Promise<AppComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(options: SkipSignaturesSimulateOptions): Promise<AppComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(options: RawSimulateOptions): Promise<AppComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
/**
* Sends the transaction group to the network and returns the results
*/
Expand Down
8 changes: 5 additions & 3 deletions examples/nested/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
CloneAppClientParams,
} from '@algorandfoundation/algokit-utils/types/app-client'
import { AppFactory as _AppFactory, AppFactoryAppClientParams, AppFactoryResolveAppClientByCreatorAndNameParams, AppFactoryDeployParams, AppFactoryParams, CreateSchema } from '@algorandfoundation/algokit-utils/types/app-factory'
import { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
import { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions, RawSimulateOptions, SkipSignaturesSimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
import { SendParams, SendSingleTransactionResult, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction'
import { Address, encodeAddress, modelsv2, OnApplicationComplete, Transaction, TransactionSigner } from 'algosdk'
import SimulateResponse = modelsv2.SimulateResponse
Expand Down Expand Up @@ -645,7 +645,7 @@ export class NestedContractClient {
},
async simulate(options?: SimulateOptions) {
await promiseChain
const result = await composer.simulate(options)
const result = await (!options ? composer.simulate() : composer.simulate(options))
return {
...result,
returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val) : val.returnValue)
Expand Down Expand Up @@ -712,7 +712,9 @@ export type NestedContractComposer<TReturns extends [...any[]] = []> = {
/**
* Simulates the transaction group and returns the result
*/
simulate(options?: SimulateOptions): Promise<NestedContractComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(): Promise<NestedContractComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(options: SkipSignaturesSimulateOptions): Promise<NestedContractComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(options: RawSimulateOptions): Promise<NestedContractComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
/**
* Sends the transaction group to the network and returns the results
*/
Expand Down
8 changes: 5 additions & 3 deletions examples/reti/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
CloneAppClientParams,
} from '@algorandfoundation/algokit-utils/types/app-client'
import { AppFactory as _AppFactory, AppFactoryAppClientParams, AppFactoryResolveAppClientByCreatorAndNameParams, AppFactoryDeployParams, AppFactoryParams, CreateSchema } from '@algorandfoundation/algokit-utils/types/app-factory'
import { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
import { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions, RawSimulateOptions, SkipSignaturesSimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
import { SendParams, SendSingleTransactionResult, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction'
import { Address, encodeAddress, modelsv2, OnApplicationComplete, Transaction, TransactionSigner } from 'algosdk'
import SimulateResponse = modelsv2.SimulateResponse
Expand Down Expand Up @@ -3792,7 +3792,7 @@ export class ValidatorRegistryClient {
},
async simulate(options?: SimulateOptions) {
await promiseChain
const result = await composer.simulate(options)
const result = await (!options ? composer.simulate() : composer.simulate(options))
return {
...result,
returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val) : val.returnValue)
Expand Down Expand Up @@ -4240,7 +4240,9 @@ export type ValidatorRegistryComposer<TReturns extends [...any[]] = []> = {
/**
* Simulates the transaction group and returns the result
*/
simulate(options?: SimulateOptions): Promise<ValidatorRegistryComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(): Promise<ValidatorRegistryComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(options: SkipSignaturesSimulateOptions): Promise<ValidatorRegistryComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(options: RawSimulateOptions): Promise<ValidatorRegistryComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
/**
* Sends the transaction group to the network and returns the results
*/
Expand Down
8 changes: 5 additions & 3 deletions examples/state/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ import {
CloneAppClientParams,
} from '@algorandfoundation/algokit-utils/types/app-client'
import { AppFactory as _AppFactory, AppFactoryAppClientParams, AppFactoryResolveAppClientByCreatorAndNameParams, AppFactoryDeployParams, AppFactoryParams, CreateSchema } from '@algorandfoundation/algokit-utils/types/app-factory'
import { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
import { TransactionComposer, AppCallMethodCall, AppMethodCallTransactionArgument, SimulateOptions, RawSimulateOptions, SkipSignaturesSimulateOptions } from '@algorandfoundation/algokit-utils/types/composer'
import { SendParams, SendSingleTransactionResult, SendAtomicTransactionComposerResults } from '@algorandfoundation/algokit-utils/types/transaction'
import { Address, encodeAddress, modelsv2, OnApplicationComplete, Transaction, TransactionSigner } from 'algosdk'
import SimulateResponse = modelsv2.SimulateResponse
Expand Down Expand Up @@ -2240,7 +2240,7 @@ export class StateAppClient {
},
async simulate(options?: SimulateOptions) {
await promiseChain
const result = await composer.simulate(options)
const result = await (!options ? composer.simulate() : composer.simulate(options))
return {
...result,
returns: result.returns?.map((val, i) => resultMappers[i] !== undefined ? resultMappers[i]!(val) : val.returnValue)
Expand Down Expand Up @@ -2459,7 +2459,9 @@ export type StateAppComposer<TReturns extends [...any[]] = []> = {
/**
* Simulates the transaction group and returns the result
*/
simulate(options?: SimulateOptions): Promise<StateAppComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(): Promise<StateAppComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(options: SkipSignaturesSimulateOptions): Promise<StateAppComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
simulate(options: RawSimulateOptions): Promise<StateAppComposerResults<TReturns> & { simulateResponse: SimulateResponse }>
/**
* Sends the transaction group to the network and returns the results
*/
Expand Down
Loading

0 comments on commit d91e660

Please sign in to comment.