{"version":3,"file":"app-client.mjs","names":[],"sources":["../src/app-client.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AppSpecAppDetails, AppSpecAppDetailsByCreatorAndName, AppSpecAppDetailsById, ApplicationClient } from './types/app-client'\nimport Algodv2 = algosdk.Algodv2\n\n/**\n * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById` or\n * `algorand.client.getAppClientByCreatorAndName`.\n * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n *\n * Create a new ApplicationClient instance\n * @param appDetails The details of the app\n * @param algod An algod instance\n *\n * @example Resolve by creator and name\n * const client = algokit.getAppClient(\n *     {\n *       resolveBy: 'creatorAndName',\n *       app: {appSpec},\n *       sender: {account},\n *       creatorAddress: {creator},\n *       findExistingUsing: indexerClient,\n *     },\n *     algodClient,\n *   )\n *\n * @example Resolve by id:\n * const client = algokit.getAppClient(\n *     {\n *       resolveBy: 'id',\n *       app: {appSpec},\n *       sender: {account},\n *       id: {id},\n *     },\n *    algodClient,\n * )\n *\n * @returns The application client\n */\nexport function getAppClient(appDetails: AppSpecAppDetails, algod: Algodv2) {\n  return new ApplicationClient(appDetails, algod)\n}\n\n/**\n * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientById`.\n * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n *\n *\n * Create a new ApplicationClient instance by id\n * @param appDetails The details of the app\n * @param algod An algod instance\n *\n * @example\n * const client = algokit.getAppClientById(\n *     {\n *       app: {appSpec},\n *       sender: {account},\n *       id: {id},\n *     },\n *     algodClient,\n *   )\n *\n * @returns The application client\n */\nexport function getAppClientById(appDetails: AppSpecAppDetailsById, algod: Algodv2) {\n  return new ApplicationClient({ ...appDetails, resolveBy: 'id' }, algod)\n}\n\n/**\n * @deprecated Use `AppClient` instead e.g. via `algorand.client.getAppClientByCreatorAndName`.\n * If you want to `create` or `deploy` then use `AppFactory` e.g. via `algorand.client.getAppFactory`,\n * which will in turn give you an `AppClient` instance against the created/deployed app to make other calls.\n *\n *\n * Create a new ApplicationClient instance by creator and name\n * @param appDetails The details of the app by creator and name\n * @param algod An algod instance\n *\n * @example\n * const client = algokit.getAppClientByCreatorAndName(\n *     {\n *       app: appSpec,\n *       sender: account,\n *       creatorAddress: account,\n *       findExistingUsing: indexerClient,\n *     },\n *     algodClient,\n *   )\n *\n * @returns The application client\n */\nexport function getAppClientByCreatorAndName(appDetails: AppSpecAppDetailsByCreatorAndName, algod: Algodv2) {\n  return new ApplicationClient({ ...appDetails, resolveBy: 'creatorAndName' }, algod)\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCA,SAAgB,aAAa,YAA+B,OAAgB;CAC1E,OAAO,IAAI,kBAAkB,YAAY,KAAK;AAChD;;;;;;;;;;;;;;;;;;;;;;;AAwBA,SAAgB,iBAAiB,YAAmC,OAAgB;CAClF,OAAO,IAAI,kBAAkB;EAAE,GAAG;EAAY,WAAW;CAAK,GAAG,KAAK;AACxE;;;;;;;;;;;;;;;;;;;;;;;;AAyBA,SAAgB,6BAA6B,YAA+C,OAAgB;CAC1G,OAAO,IAAI,kBAAkB;EAAE,GAAG;EAAY,WAAW;CAAiB,GAAG,KAAK;AACpF"}