@algorandfoundation/algokit-utils 7.0.0-alpha.1 → 7.0.0-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (210) hide show
  1. package/{src/account → account}/account.js +4 -4
  2. package/account/account.js.map +1 -0
  3. package/{src/account → account}/account.mjs +4 -4
  4. package/account/account.mjs.map +1 -0
  5. package/account/get-account-config-from-environment.js.map +1 -0
  6. package/account/get-account-config-from-environment.mjs.map +1 -0
  7. package/{src/account → account}/get-account.js +2 -2
  8. package/account/get-account.js.map +1 -0
  9. package/{src/account → account}/get-account.mjs +2 -2
  10. package/account/get-account.mjs.map +1 -0
  11. package/{src/account → account}/get-dispenser-account.js +2 -2
  12. package/account/get-dispenser-account.js.map +1 -0
  13. package/{src/account → account}/get-dispenser-account.mjs +2 -2
  14. package/account/get-dispenser-account.mjs.map +1 -0
  15. package/account/mnemonic-account.js.map +1 -0
  16. package/account/mnemonic-account.mjs.map +1 -0
  17. package/{src/amount.js → amount.js} +1 -1
  18. package/amount.js.map +1 -0
  19. package/{src/amount.mjs → amount.mjs} +1 -1
  20. package/amount.mjs.map +1 -0
  21. package/{src/app-client.js → app-client.js} +1 -1
  22. package/app-client.js.map +1 -0
  23. package/{src/app-client.mjs → app-client.mjs} +1 -1
  24. package/app-client.mjs.map +1 -0
  25. package/{src/app-deploy.js → app-deploy.js} +6 -6
  26. package/app-deploy.js.map +1 -0
  27. package/{src/app-deploy.mjs → app-deploy.mjs} +6 -6
  28. package/app-deploy.mjs.map +1 -0
  29. package/{src/app.js → app.js} +1 -1
  30. package/app.js.map +1 -0
  31. package/{src/app.mjs → app.mjs} +1 -1
  32. package/app.mjs.map +1 -0
  33. package/{src/asset.js → asset.js} +1 -1
  34. package/asset.js.map +1 -0
  35. package/{src/asset.mjs → asset.mjs} +1 -1
  36. package/asset.mjs.map +1 -0
  37. package/{src/config.js → config.js} +1 -1
  38. package/config.js.map +1 -0
  39. package/{src/config.mjs → config.mjs} +1 -1
  40. package/config.mjs.map +1 -0
  41. package/debugging/debugging.js.map +1 -0
  42. package/debugging/debugging.mjs.map +1 -0
  43. package/{src/dispenser-client.js → dispenser-client.js} +1 -1
  44. package/dispenser-client.js.map +1 -0
  45. package/{src/dispenser-client.mjs → dispenser-client.mjs} +1 -1
  46. package/dispenser-client.mjs.map +1 -0
  47. package/index.js +23 -23
  48. package/index.mjs +24 -24
  49. package/indexer-lookup.js.map +1 -0
  50. package/indexer-lookup.mjs.map +1 -0
  51. package/{src/localnet → localnet}/get-kmd-wallet-account.js +2 -2
  52. package/localnet/get-kmd-wallet-account.js.map +1 -0
  53. package/{src/localnet → localnet}/get-kmd-wallet-account.mjs +2 -2
  54. package/localnet/get-kmd-wallet-account.mjs.map +1 -0
  55. package/{src/localnet → localnet}/get-localnet-dispenser-account.js +2 -2
  56. package/localnet/get-localnet-dispenser-account.js.map +1 -0
  57. package/{src/localnet → localnet}/get-localnet-dispenser-account.mjs +2 -2
  58. package/localnet/get-localnet-dispenser-account.mjs.map +1 -0
  59. package/{src/localnet → localnet}/get-or-create-kmd-wallet-account.js +2 -2
  60. package/localnet/get-or-create-kmd-wallet-account.js.map +1 -0
  61. package/{src/localnet → localnet}/get-or-create-kmd-wallet-account.mjs +2 -2
  62. package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -0
  63. package/{src/localnet → localnet}/is-localnet.js +1 -1
  64. package/localnet/is-localnet.js.map +1 -0
  65. package/{src/localnet → localnet}/is-localnet.mjs +1 -1
  66. package/localnet/is-localnet.mjs.map +1 -0
  67. package/{src/network-client.js → network-client.js} +1 -1
  68. package/network-client.js.map +1 -0
  69. package/{src/network-client.mjs → network-client.mjs} +1 -1
  70. package/network-client.mjs.map +1 -0
  71. package/package.json +1 -1
  72. package/{src/testing → testing}/account.js +1 -1
  73. package/testing/account.js.map +1 -0
  74. package/{src/testing → testing}/account.mjs +1 -1
  75. package/testing/account.mjs.map +1 -0
  76. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -0
  77. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -0
  78. package/{src/testing → testing}/fixtures/algorand-fixture.js +2 -2
  79. package/testing/fixtures/algorand-fixture.js.map +1 -0
  80. package/{src/testing → testing}/fixtures/algorand-fixture.mjs +2 -2
  81. package/testing/fixtures/algorand-fixture.mjs.map +1 -0
  82. package/testing/index.js +6 -6
  83. package/testing/index.mjs +6 -6
  84. package/testing/indexer.js.map +1 -0
  85. package/testing/indexer.mjs.map +1 -0
  86. package/testing/test-logger.js.map +1 -0
  87. package/testing/test-logger.mjs.map +1 -0
  88. package/testing/transaction-logger.js.map +1 -0
  89. package/testing/transaction-logger.mjs.map +1 -0
  90. package/{src/transaction → transaction}/legacy-bridge.js +5 -5
  91. package/transaction/legacy-bridge.js.map +1 -0
  92. package/{src/transaction → transaction}/legacy-bridge.mjs +5 -5
  93. package/transaction/legacy-bridge.mjs.map +1 -0
  94. package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -0
  95. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -0
  96. package/{src/transaction → transaction}/transaction.js +1 -1
  97. package/transaction/transaction.js.map +1 -0
  98. package/{src/transaction → transaction}/transaction.mjs +1 -1
  99. package/transaction/transaction.mjs.map +1 -0
  100. package/transfer/transfer-algos.js.map +1 -0
  101. package/transfer/transfer-algos.mjs.map +1 -0
  102. package/{src/transfer → transfer}/transfer.js +2 -2
  103. package/transfer/transfer.js.map +1 -0
  104. package/{src/transfer → transfer}/transfer.mjs +2 -2
  105. package/transfer/transfer.mjs.map +1 -0
  106. package/types/account-manager.js +2 -2
  107. package/types/account-manager.mjs +2 -2
  108. package/types/algo-http-client-with-retry.js +3 -3
  109. package/types/algo-http-client-with-retry.js.map +1 -1
  110. package/types/algo-http-client-with-retry.mjs +2 -2
  111. package/types/algorand-client-transaction-sender.js +1 -1
  112. package/types/algorand-client-transaction-sender.mjs +1 -1
  113. package/types/app-client.js +6 -6
  114. package/types/app-client.mjs +6 -6
  115. package/types/app-deployer.js +2 -2
  116. package/types/app-deployer.mjs +2 -2
  117. package/types/app-manager.js +1 -1
  118. package/types/app-manager.mjs +1 -1
  119. package/types/asset-manager.js +2 -2
  120. package/types/asset-manager.mjs +2 -2
  121. package/types/composer.js +2 -2
  122. package/types/composer.mjs +2 -2
  123. package/types/kmd-account-manager.js +1 -1
  124. package/types/kmd-account-manager.mjs +1 -1
  125. package/util.js.map +1 -0
  126. package/util.mjs.map +1 -0
  127. package/src/account/account.js.map +0 -1
  128. package/src/account/account.mjs.map +0 -1
  129. package/src/account/get-account-config-from-environment.js.map +0 -1
  130. package/src/account/get-account-config-from-environment.mjs.map +0 -1
  131. package/src/account/get-account.js.map +0 -1
  132. package/src/account/get-account.mjs.map +0 -1
  133. package/src/account/get-dispenser-account.js.map +0 -1
  134. package/src/account/get-dispenser-account.mjs.map +0 -1
  135. package/src/account/mnemonic-account.js.map +0 -1
  136. package/src/account/mnemonic-account.mjs.map +0 -1
  137. package/src/amount.js.map +0 -1
  138. package/src/amount.mjs.map +0 -1
  139. package/src/app-client.js.map +0 -1
  140. package/src/app-client.mjs.map +0 -1
  141. package/src/app-deploy.js.map +0 -1
  142. package/src/app-deploy.mjs.map +0 -1
  143. package/src/app.js.map +0 -1
  144. package/src/app.mjs.map +0 -1
  145. package/src/asset.js.map +0 -1
  146. package/src/asset.mjs.map +0 -1
  147. package/src/config.js.map +0 -1
  148. package/src/config.mjs.map +0 -1
  149. package/src/debugging/debugging.js.map +0 -1
  150. package/src/debugging/debugging.mjs.map +0 -1
  151. package/src/dispenser-client.js.map +0 -1
  152. package/src/dispenser-client.mjs.map +0 -1
  153. package/src/indexer-lookup.js.map +0 -1
  154. package/src/indexer-lookup.mjs.map +0 -1
  155. package/src/localnet/get-kmd-wallet-account.js.map +0 -1
  156. package/src/localnet/get-kmd-wallet-account.mjs.map +0 -1
  157. package/src/localnet/get-localnet-dispenser-account.js.map +0 -1
  158. package/src/localnet/get-localnet-dispenser-account.mjs.map +0 -1
  159. package/src/localnet/get-or-create-kmd-wallet-account.js.map +0 -1
  160. package/src/localnet/get-or-create-kmd-wallet-account.mjs.map +0 -1
  161. package/src/localnet/is-localnet.js.map +0 -1
  162. package/src/localnet/is-localnet.mjs.map +0 -1
  163. package/src/network-client.js.map +0 -1
  164. package/src/network-client.mjs.map +0 -1
  165. package/src/testing/account.js.map +0 -1
  166. package/src/testing/account.mjs.map +0 -1
  167. package/src/testing/fixtures/algokit-log-capture-fixture.js.map +0 -1
  168. package/src/testing/fixtures/algokit-log-capture-fixture.mjs.map +0 -1
  169. package/src/testing/fixtures/algorand-fixture.js.map +0 -1
  170. package/src/testing/fixtures/algorand-fixture.mjs.map +0 -1
  171. package/src/testing/indexer.js.map +0 -1
  172. package/src/testing/indexer.mjs.map +0 -1
  173. package/src/testing/test-logger.js.map +0 -1
  174. package/src/testing/test-logger.mjs.map +0 -1
  175. package/src/testing/transaction-logger.js.map +0 -1
  176. package/src/testing/transaction-logger.mjs.map +0 -1
  177. package/src/transaction/legacy-bridge.js.map +0 -1
  178. package/src/transaction/legacy-bridge.mjs.map +0 -1
  179. package/src/transaction/perform-atomic-transaction-composer-simulate.js.map +0 -1
  180. package/src/transaction/perform-atomic-transaction-composer-simulate.mjs.map +0 -1
  181. package/src/transaction/transaction.js.map +0 -1
  182. package/src/transaction/transaction.mjs.map +0 -1
  183. package/src/transfer/transfer-algos.js.map +0 -1
  184. package/src/transfer/transfer-algos.mjs.map +0 -1
  185. package/src/transfer/transfer.js.map +0 -1
  186. package/src/transfer/transfer.mjs.map +0 -1
  187. package/src/util.js.map +0 -1
  188. package/src/util.mjs.map +0 -1
  189. /package/{src/account → account}/get-account-config-from-environment.js +0 -0
  190. /package/{src/account → account}/get-account-config-from-environment.mjs +0 -0
  191. /package/{src/account → account}/mnemonic-account.js +0 -0
  192. /package/{src/account → account}/mnemonic-account.mjs +0 -0
  193. /package/{src/debugging → debugging}/debugging.js +0 -0
  194. /package/{src/debugging → debugging}/debugging.mjs +0 -0
  195. /package/{src/indexer-lookup.js → indexer-lookup.js} +0 -0
  196. /package/{src/indexer-lookup.mjs → indexer-lookup.mjs} +0 -0
  197. /package/{src/testing → testing}/fixtures/algokit-log-capture-fixture.js +0 -0
  198. /package/{src/testing → testing}/fixtures/algokit-log-capture-fixture.mjs +0 -0
  199. /package/{src/testing → testing}/indexer.js +0 -0
  200. /package/{src/testing → testing}/indexer.mjs +0 -0
  201. /package/{src/testing → testing}/test-logger.js +0 -0
  202. /package/{src/testing → testing}/test-logger.mjs +0 -0
  203. /package/{src/testing → testing}/transaction-logger.js +0 -0
  204. /package/{src/testing → testing}/transaction-logger.mjs +0 -0
  205. /package/{src/transaction → transaction}/perform-atomic-transaction-composer-simulate.js +0 -0
  206. /package/{src/transaction → transaction}/perform-atomic-transaction-composer-simulate.mjs +0 -0
  207. /package/{src/transfer → transfer}/transfer-algos.js +0 -0
  208. /package/{src/transfer → transfer}/transfer-algos.mjs +0 -0
  209. /package/{src/util.js → util.js} +0 -0
  210. /package/{src/util.mjs → util.mjs} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"file":"account.mjs","sources":["../../../src/account/account.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { getSenderAddress } from '../transaction/transaction'\nimport { AccountAssetInformation, MultisigAccount, SigningAccount, TransactionSignerAccount } from '../types/account'\nimport { AccountManager } from '../types/account-manager'\nimport { AlgorandClient } from '../types/algorand-client'\nimport { AlgoAmount } from '../types/amount'\nimport { ClientManager } from '../types/client-manager'\nimport { SendTransactionFrom } from '../types/transaction'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\nimport MultisigMetadata = algosdk.MultisigMetadata\nimport TransactionSigner = algosdk.TransactionSigner\nimport AccountInformationModel = algosdk.modelsv2.Account\n\n/**\n * @deprecated Use `algorand.account.multisig(multisigParams, signingAccounts)` or `new MultisigAccount(multisigParams, signingAccounts)` instead.\n *\n * Returns an account wrapper that supports partial or full multisig signing.\n * @param multisigParams The parameters that define the multisig account\n * @param signingAccounts The signers that are currently present\n * @returns A multisig account wrapper\n */\nexport function multisigAccount(multisigParams: MultisigMetadata, signingAccounts: (Account | SigningAccount)[]) {\n return new MultisigAccount(multisigParams, signingAccounts)\n}\n\n/**\n * @deprecated Use `algorand.account.rekeyed(sender, account)` or `new SigningAccount(account, sender)` instead.\n *\n * Returns an account wrapper that supports a rekeyed account.\n * @param signer The account, with private key loaded, that is signing\n * @param sender The address of the rekeyed account that will act as a sender\n * @returns The SigningAccount wrapper\n */\nexport function rekeyedAccount(signer: Account, sender: string) {\n return new SigningAccount(signer, sender)\n}\n\n/**\n * @deprecated Use `algorand.account.getSigner(sender)` (after previously registering the signer with `setSigner`) or `{ addr: sender, signer }` instead.\n *\n * Returns an account wrapper that supports a transaction signer with associated sender address.\n * @param signer The transaction signer\n * @param sender The address of sender account\n * @returns The SigningAccount wrapper\n */\nexport function transactionSignerAccount(signer: TransactionSigner, sender: string): TransactionSignerAccount {\n return { addr: Address.fromString(sender), signer }\n}\n\n/**\n * @deprecated Use `algorand.account.random()` or `algosdk.generateAccount()` instead.\n *\n * Returns a new, random Algorand account with secret key loaded.\n *\n * This is a wrapper around algosdk.generateAccount to provide a more friendly/obvious name.\n *\n */\nexport function randomAccount(): Account {\n // This method is confusingly named, so this function provides a more dev friendly \"wrapper\" name\n return algosdk.generateAccount()\n}\n\n/**\n * @deprecated Use `algorand.account.fromEnvironment(name, fundWith)` or `new AccountManager(clientManager).fromEnvironment()` instead.\n *\n * Returns an Algorand account with private key loaded by convention from environment variables based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.MY_ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await mnemonicAccountFromEnvironment('MY_ACCOUNT', algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `MY_ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n * If not running against LocalNet then it will use proces.env.MY_ACCOUNT_MNEMONIC as the private key and (if present) process.env.MY_ACCOUNT_SENDER as the sender address.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `name`: string: The name identifier of the account\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function mnemonicAccountFromEnvironment(\n account: string | { name: string; fundWith?: AlgoAmount },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount> {\n return (\n await new AccountManager(new ClientManager({ algod, kmd: kmdClient })).fromEnvironment(\n typeof account === 'string' ? account : account.name,\n typeof account === 'string' ? undefined : account.fundWith,\n )\n ).account\n}\n\n/**\n * @deprecated Use `algosdk.decodeAddress` instead.\n *\n * Returns an account's address as a byte array\n *\n * @param account Either an account (with private key loaded) or the string address of an account\n */\nexport function getAccountAddressAsUint8Array(account: SendTransactionFrom | string) {\n return algosdk.decodeAddress(typeof account === 'string' ? account : getSenderAddress(account)).publicKey\n}\n\n/**\n * @deprecated Use `algosdk.encodeAddress` instead.\n *\n * Returns the string address of an Algorand account from a base64 encoded version of the underlying byte array of the address public key\n *\n * @param addressEncodedInB64 The base64 encoded version of the underlying byte array of the address public key\n */\nexport function getAccountAddressAsString(addressEncodedInB64: string): string {\n return algosdk.encodeAddress(Buffer.from(addressEncodedInB64, 'base64'))\n}\n\nexport type NumberConverter<T extends AccountInformationModel> = { [key in keyof T]: ToNumberIfExtends<T[key], number | bigint> }\ntype ToNumberIfExtends<K, E> = K extends E ? number : K\n/** @deprecated Account information at a given round. */\nexport type AccountInformation = Omit<NumberConverter<AccountInformationModel>, 'getEncodingSchema' | 'toEncodingData' | 'authAddr'> & {\n /** (spend) the address against which signing should be checked. If empty, the address of the current account is used. This field can be updated in any transaction by setting the RekeyTo field. */\n authAddr?: string\n}\n\n/**\n * @deprecated Use `algorand.account.getInformation(sender)` or `new AccountManager(clientManager).getInformation(sender)` instead.\n *\n * Returns the given sender account's current status, balance and spendable amounts.\n *\n * @example\n * ```typescript\n * const address = \"XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA\";\n * const accountInfo = await account.getInformation(address, algod);\n * ```\n *\n * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddress)\n * @param sender The address of the sender/account to look up\n * @param algod The algod instance\n * @returns The account information\n */\nexport async function getAccountInformation(sender: string | SendTransactionFrom, algod: Algodv2): Promise<AccountInformation> {\n const account = await algod.accountInformation(getSenderAddress(sender)).do()\n\n return {\n ...account,\n address: account.address.toString(),\n authAddr: account.authAddr ? account.authAddr.toString() : undefined,\n // None of these can practically overflow 2^53\n amount: Number(account.amount),\n amountWithoutPendingRewards: Number(account.amountWithoutPendingRewards),\n minBalance: Number(account.minBalance),\n pendingRewards: Number(account.pendingRewards),\n rewards: Number(account.rewards),\n round: Number(account.round),\n totalAppsOptedIn: Number(account.totalAppsOptedIn),\n totalAssetsOptedIn: Number(account.totalAssetsOptedIn),\n totalCreatedApps: Number(account.totalCreatedApps),\n totalCreatedAssets: Number(account.totalCreatedAssets),\n appsTotalExtraPages: account.appsTotalExtraPages !== undefined ? Number(account.appsTotalExtraPages) : undefined,\n rewardBase: account.rewardBase !== undefined ? Number(account.rewardBase) : undefined,\n totalBoxBytes: account.totalBoxBytes !== undefined ? Number(account.totalBoxBytes) : undefined,\n totalBoxes: account.totalBoxes !== undefined ? Number(account.totalBoxes) : undefined,\n lastHeartbeat: account.lastHeartbeat !== undefined ? Number(account.lastHeartbeat) : undefined,\n lastProposed: account.lastProposed !== undefined ? Number(account.lastProposed) : undefined,\n }\n}\n\n/**\n * @deprecated Use `algorand.asset.getAccountInformation(sender, assetId)` or `new AssetManager(...).getAccountInformation(sender, assetId)` instead.\n *\n * Returns the given sender account's asset holding for a given asset.\n *\n * @example\n * ```typescript\n * const address = \"XBYLS2E6YI6XXL5BWCAMOA4GTWHXWENZMX5UHXMRNWWUQ7BXCY5WC5TEPA\";\n * const assetId = 123345;\n * const accountInfo = await account.getAccountAssetInformation(address, assetId, algod);\n * ```\n *\n * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddressassetsasset-id)\n * @param sender The address of the sender/account to look up\n * @param assetId The ID of the asset to return a holding for\n * @param algod The algod instance\n * @returns The account asset holding information\n */\nexport async function getAccountAssetInformation(\n sender: string | SendTransactionFrom,\n assetId: number | bigint,\n algod: Algodv2,\n): Promise<AccountAssetInformation> {\n return AlgorandClient.fromClients({ algod }).asset.getAccountInformation(getSenderAddress(sender), BigInt(assetId))\n}\n"],"names":[],"mappings":";;;;;;;AAeA;;;;;;;AAOG;AACa,SAAA,eAAe,CAAC,cAAgC,EAAE,eAA6C,EAAA;AAC7G,IAAA,OAAO,IAAI,eAAe,CAAC,cAAc,EAAE,eAAe,CAAC,CAAA;AAC7D,CAAC;AAED;;;;;;;AAOG;AACa,SAAA,cAAc,CAAC,MAAe,EAAE,MAAc,EAAA;AAC5D,IAAA,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;AAC3C,CAAC;AAED;;;;;;;AAOG;AACa,S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OAAO,CAAC,UAAU,CAAC,GAAG,SAAS;AACrF,QAAA,aAAa,EAAE,OAAO,CAAC,aAAa,KAAK,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,aAAa,CAAC,GAAG,SAAS;AAC9F,QAAA,YAAY,EAAE,OAAO,CAAC,YAAY,KAAK,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,GAAG,SAAS;KAC5F,CAAA;AACH,CAAC;AAED;;;;;;;;;;;;;;;;;AAiBG;AACI,eAAe,0BAA0B,CAC9C,MAAoC,EACpC,OAAwB,EACxB,KAAc,EAAA;IAEd,OAAO,cAAc,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC,CAAA;AACrH;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-account-config-from-environment.js","sources":["../../../src/account/get-account-config-from-environment.ts"],"sourcesContent":["import { AccountConfig } from '../types/account'\n\n/** @deprecated Use algokit.mnemonicAccountFromEnvironment, which doesn't need this function\n * Returns the Account configuration from environment variables\n *\n * @param accountName account name\n *\n * @example environment variables\n * {accountName}_MNEMONIC\n * {accountName}_SENDER\n *\n */\nexport function getAccountConfigFromEnvironment(accountName: string): AccountConfig {\n if (!process || !process.env) {\n throw new Error('Attempt to get account with private key from a non Node.js context; not supported!')\n }\n\n return {\n accountMnemonic: process.env[`${accountName.toUpperCase()}_MNEMONIC`] || '',\n senderAddress: process.env[`${accountName.toUpperCase()}_SENDER`],\n accountName,\n }\n}\n"],"names":[],"mappings":";;AAEA;;;;;;;;;AASG;AACG,SAAU,+BAA+B,CAAC,WAAmB,EAAA;IACjE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;AAC5B,QAAA,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAA;KACtG;IAED,OAAO;AACL,QAAA,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA,EAAG,WAAW,CAAC,WAAW,EAAE,CAAW,SAAA,CAAA,CAAC,IAAI,EAAE;QAC3E,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,CAAG,EAAA,WAAW,CAAC,WAAW,EAAE,CAAA,OAAA,CAAS,CAAC;QACjE,WAAW;KACZ,CAAA;AACH;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-account-config-from-environment.mjs","sources":["../../../src/account/get-account-config-from-environment.ts"],"sourcesContent":["import { AccountConfig } from '../types/account'\n\n/** @deprecated Use algokit.mnemonicAccountFromEnvironment, which doesn't need this function\n * Returns the Account configuration from environment variables\n *\n * @param accountName account name\n *\n * @example environment variables\n * {accountName}_MNEMONIC\n * {accountName}_SENDER\n *\n */\nexport function getAccountConfigFromEnvironment(accountName: string): AccountConfig {\n if (!process || !process.env) {\n throw new Error('Attempt to get account with private key from a non Node.js context; not supported!')\n }\n\n return {\n accountMnemonic: process.env[`${accountName.toUpperCase()}_MNEMONIC`] || '',\n senderAddress: process.env[`${accountName.toUpperCase()}_SENDER`],\n accountName,\n }\n}\n"],"names":[],"mappings":"AAEA;;;;;;;;;AASG;AACG,SAAU,+BAA+B,CAAC,WAAmB,EAAA;IACjE,IAAI,CAAC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE;AAC5B,QAAA,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAA;KACtG;IAED,OAAO;AACL,QAAA,eAAe,EAAE,OAAO,CAAC,GAAG,CAAC,CAAA,EAAG,WAAW,CAAC,WAAW,EAAE,CAAW,SAAA,CAAA,CAAC,IAAI,EAAE;QAC3E,aAAa,EAAE,OAAO,CAAC,GAAG,CAAC,CAAG,EAAA,WAAW,CAAC,WAAW,EAAE,CAAA,OAAA,CAAS,CAAC;QACjE,WAAW;KACZ,CAAA;AACH;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-account.js","sources":["../../../src/account/get-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountConfig, SigningAccount } from '../types/account'\nimport { AccountManager } from '../types/account-manager'\nimport { AlgoAmount } from '../types/amount'\nimport { ClientManager } from '../types/client-manager'\nimport { getAccountConfigFromEnvironment } from './get-account-config-from-environment'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n *\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount('ACCOUNT', algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `name`: The name identifier of the account\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { name: string; fundWith?: AlgoAmount } | string,\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount>\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount({config: getAccountConfigFromEnvironment('ACCOUNT')}, algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, an object with:\n * * `config`: Account configuration. To get from environment use getAccountConfigFromEnvironment(accountName)\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { config: AccountConfig; fundWith?: AlgoAmount },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount>\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount({config: getAccountConfigFromEnvironment('ACCOUNT')}, algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `config`: Account configuration. To get from environment use getAccountConfigFromEnvironment(accountName) OR\n * * `name`: string: The name identifier of the account (deprecated)\n * And optionally\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { name: string; fundWith?: AlgoAmount } | { config: AccountConfig; fundWith?: AlgoAmount } | string,\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount> {\n let name: string\n let fundWith: AlgoAmount | undefined = undefined\n let config: AccountConfig\n\n if (typeof account === 'string') {\n name = account\n config = getAccountConfigFromEnvironment(name)\n } else if ('name' in account) {\n name = account.name\n config = getAccountConfigFromEnvironment(name)\n fundWith = account.fundWith\n } else if ('config' in account) {\n config = account.config\n name = config.accountName\n fundWith = account.fundWith\n } else {\n throw new Error('Missing name or account config')\n }\n\n return (await new AccountManager(new ClientManager({ algod, kmd: kmdClient })).fromEnvironment(name, fundWith)).account\n}\n"],"names":["getAccountConfigFromEnvironment","AccountManager","ClientManager"],"mappings":";;;;;;AAyEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACI,eAAe,UAAU,CAC9B,OAA4G,EAC5G,KAAc,EACd,SAAe,EAAA;AAEf,IAAA,IAAI,IAAY,CAAA;IAChB,IAAI,QAAQ,GAA2B,SAAS,CAAA;AAChD,IAAA,IAAI,MAAqB,CAAA;AAEzB,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,IAAI,GAAG,OAAO,CAAA;AACd,QAAA,MAAM,GAAGA,+DAA+B,CAAC,IAAI,CAAC,CAAA;KAC/C;AAAM,SAAA,IAAI,MAAM,IAAI,OAAO,EAAE;AAC5B,QAAA,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;AACnB,QAAA,MAAM,GAAGA,+DAA+B,CAAC,IAAI,CAAC,CAAA;AAC9C,QAAA,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;KAC5B;AAAM,SAAA,IAAI,QAAQ,IAAI,OAAO,EAAE;AAC9B,QAAA,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;AACvB,QAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAA;AACzB,QAAA,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;KAC5B;SAAM;AACL,QAAA,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;KAClD;IAED,OAAO,CAAC,MAAM,IAAIC,mCAAc,CAAC,IAAIC,iCAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;AACzH;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-account.mjs","sources":["../../../src/account/get-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountConfig, SigningAccount } from '../types/account'\nimport { AccountManager } from '../types/account-manager'\nimport { AlgoAmount } from '../types/amount'\nimport { ClientManager } from '../types/client-manager'\nimport { getAccountConfigFromEnvironment } from './get-account-config-from-environment'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n *\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount('ACCOUNT', algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `name`: The name identifier of the account\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { name: string; fundWith?: AlgoAmount } | string,\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount>\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount({config: getAccountConfigFromEnvironment('ACCOUNT')}, algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, an object with:\n * * `config`: Account configuration. To get from environment use getAccountConfigFromEnvironment(accountName)\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { config: AccountConfig; fundWith?: AlgoAmount },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount>\n\n/** @deprecated use `algorand.account.fromEnvironment()` instead\n * Returns an Algorand account with private key loaded by convention based on the given name identifier.\n *\n * Note: This function expects to run in a Node.js environment.\n *\n * ## Convention:\n * * **Non-LocalNet:** will load process.env['\\{NAME\\}_MNEMONIC'] as a mnemonic secret; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it via a secret storage service rather than the file system.\n * If process.env['\\{NAME\\}_SENDER'] is defined then it will use that for the sender address (i.e. to support rekeyed accounts)\n * * **LocalNet:** will load the account from a KMD wallet called \\{NAME\\} and if that wallet doesn't exist it will create it and fund the account for you\n *\n * This allows you to write code that will work seamlessly in production and local development (LocalNet) without manual config locally (including when you reset the LocalNet).\n *\n * @example Default\n *\n * If you have a mnemonic secret loaded into `process.env.ACCOUNT_MNEMONIC` then you can call the following to get that private key loaded into an account object:\n * ```typescript\n * const account = await getAccount({config: getAccountConfigFromEnvironment('ACCOUNT')}, algod)\n * ```\n *\n * If that code runs against LocalNet then a wallet called `ACCOUNT` will automatically be created with an account that is automatically funded with 1000 (default) ALGO from the default LocalNet dispenser.\n *\n * @param account The details of the account to get, either the name identifier (string) or an object with:\n * * `config`: Account configuration. To get from environment use getAccountConfigFromEnvironment(accountName) OR\n * * `name`: string: The name identifier of the account (deprecated)\n * And optionally\n * * `fundWith`: The amount to fund the account with when it gets created (when targeting LocalNet), if not specified then 1000 ALGO will be funded from the dispenser account\n * @param algod An algod client\n * @param kmdClient An optional KMD client to use to create an account (when targeting LocalNet), if not specified then a default KMD client will be loaded from environment variables\n * @returns The requested account with private key loaded from the environment variables or when targeting LocalNet from KMD (idempotently creating and funding the account)\n */\nexport async function getAccount(\n account: { name: string; fundWith?: AlgoAmount } | { config: AccountConfig; fundWith?: AlgoAmount } | string,\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | SigningAccount> {\n let name: string\n let fundWith: AlgoAmount | undefined = undefined\n let config: AccountConfig\n\n if (typeof account === 'string') {\n name = account\n config = getAccountConfigFromEnvironment(name)\n } else if ('name' in account) {\n name = account.name\n config = getAccountConfigFromEnvironment(name)\n fundWith = account.fundWith\n } else if ('config' in account) {\n config = account.config\n name = config.accountName\n fundWith = account.fundWith\n } else {\n throw new Error('Missing name or account config')\n }\n\n return (await new AccountManager(new ClientManager({ algod, kmd: kmdClient })).fromEnvironment(name, fundWith)).account\n}\n"],"names":[],"mappings":";;;;AAyEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACI,eAAe,UAAU,CAC9B,OAA4G,EAC5G,KAAc,EACd,SAAe,EAAA;AAEf,IAAA,IAAI,IAAY,CAAA;IAChB,IAAI,QAAQ,GAA2B,SAAS,CAAA;AAChD,IAAA,IAAI,MAAqB,CAAA;AAEzB,IAAA,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE;QAC/B,IAAI,GAAG,OAAO,CAAA;AACd,QAAA,MAAM,GAAG,+BAA+B,CAAC,IAAI,CAAC,CAAA;KAC/C;AAAM,SAAA,IAAI,MAAM,IAAI,OAAO,EAAE;AAC5B,QAAA,IAAI,GAAG,OAAO,CAAC,IAAI,CAAA;AACnB,QAAA,MAAM,GAAG,+BAA+B,CAAC,IAAI,CAAC,CAAA;AAC9C,QAAA,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;KAC5B;AAAM,SAAA,IAAI,QAAQ,IAAI,OAAO,EAAE;AAC9B,QAAA,MAAM,GAAG,OAAO,CAAC,MAAM,CAAA;AACvB,QAAA,IAAI,GAAG,MAAM,CAAC,WAAW,CAAA;AACzB,QAAA,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAA;KAC5B;SAAM;AACL,QAAA,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAA;KAClD;IAED,OAAO,CAAC,MAAM,IAAI,cAAc,CAAC,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,eAAe,CAAC,IAAI,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAA;AACzH;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-dispenser-account.js","sources":["../../../src/account/get-dispenser-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountManager } from '../types/account-manager'\nimport { ClientManager } from '../types/client-manager'\n\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/**\n * @deprecated Use `algorand.account.dispenserFromEnvironment()` or `new AccountManager(clientManager).dispenserFromEnvironment()` instead\n *\n * Returns an account (with private key loaded) that can act as a dispenser\n *\n * If running on LocalNet then it will return the default dispenser account automatically,\n * otherwise it will load the account mnemonic stored in process.env.DISPENSER_MNEMONIC\n *\n * @param algod An algod client\n * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables\n */\nexport async function getDispenserAccount(algod: Algodv2, kmd?: Kmd) {\n return new AccountManager(new ClientManager({ algod, kmd })).dispenserFromEnvironment()\n}\n"],"names":["AccountManager","ClientManager"],"mappings":";;;;;AAOA;;;;;;;;;;AAUG;AACI,eAAe,mBAAmB,CAAC,KAAc,EAAE,GAAS,EAAA;AACjE,IAAA,OAAO,IAAIA,mCAAc,CAAC,IAAIC,iCAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAA;AACzF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-dispenser-account.mjs","sources":["../../../src/account/get-dispenser-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountManager } from '../types/account-manager'\nimport { ClientManager } from '../types/client-manager'\n\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/**\n * @deprecated Use `algorand.account.dispenserFromEnvironment()` or `new AccountManager(clientManager).dispenserFromEnvironment()` instead\n *\n * Returns an account (with private key loaded) that can act as a dispenser\n *\n * If running on LocalNet then it will return the default dispenser account automatically,\n * otherwise it will load the account mnemonic stored in process.env.DISPENSER_MNEMONIC\n *\n * @param algod An algod client\n * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables\n */\nexport async function getDispenserAccount(algod: Algodv2, kmd?: Kmd) {\n return new AccountManager(new ClientManager({ algod, kmd })).dispenserFromEnvironment()\n}\n"],"names":[],"mappings":";;;AAOA;;;;;;;;;;AAUG;AACI,eAAe,mBAAmB,CAAC,KAAc,EAAE,GAAS,EAAA;AACjE,IAAA,OAAO,IAAI,cAAc,CAAC,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,wBAAwB,EAAE,CAAA;AACzF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mnemonic-account.js","sources":["../../../src/account/mnemonic-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport Account = algosdk.Account\n\n/**\n * @deprecated Use `algorand.account.fromMnemonic(mnemonicSecret)` or `algosdk.mnemonicToSecretKey(mnemonicSecret)` instead.\n *\n * Returns an Algorand account with secret key loaded (i.e. that can sign transactions) by taking the mnemonic secret.\n *\n * This is a wrapper around algosdk.mnemonicToSecretKey to provide a more friendly/obvious name.\n *\n * @param mnemonicSecret The mnemonic secret representing the private key of an account; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it from the environment (ideally via a secret storage service) rather than the file system.\n */\nexport function mnemonicAccount(mnemonicSecret: string): Account {\n // This method is confusingly named, so this function provides a more dev friendly \"wrapper\" name\n return algosdk.mnemonicToSecretKey(mnemonicSecret)\n}\n"],"names":[],"mappings":";;;;AAGA;;;;;;;;;AASG;AACG,SAAU,eAAe,CAAC,cAAsB,EAAA;;AAEpD,IAAA,OAAO,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAA;AACpD;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"mnemonic-account.mjs","sources":["../../../src/account/mnemonic-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport Account = algosdk.Account\n\n/**\n * @deprecated Use `algorand.account.fromMnemonic(mnemonicSecret)` or `algosdk.mnemonicToSecretKey(mnemonicSecret)` instead.\n *\n * Returns an Algorand account with secret key loaded (i.e. that can sign transactions) by taking the mnemonic secret.\n *\n * This is a wrapper around algosdk.mnemonicToSecretKey to provide a more friendly/obvious name.\n *\n * @param mnemonicSecret The mnemonic secret representing the private key of an account; **Note: Be careful how the mnemonic is handled**,\n * never commit it into source control and ideally load it from the environment (ideally via a secret storage service) rather than the file system.\n */\nexport function mnemonicAccount(mnemonicSecret: string): Account {\n // This method is confusingly named, so this function provides a more dev friendly \"wrapper\" name\n return algosdk.mnemonicToSecretKey(mnemonicSecret)\n}\n"],"names":[],"mappings":";;AAGA;;;;;;;;;AASG;AACG,SAAU,eAAe,CAAC,cAAsB,EAAA;;AAEpD,IAAA,OAAO,OAAO,CAAC,mBAAmB,CAAC,cAAc,CAAC,CAAA;AACpD;;;;"}
package/src/amount.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"amount.js","sources":["../../src/amount.ts"],"sourcesContent":["import { AlgoAmount } from './types/amount'\n\ndeclare global {\n interface Number {\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgos(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algos(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgo(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algo(this: number): AlgoAmount\n }\n interface BigInt {\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgo(this: bigint): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algo(this: bigint): AlgoAmount\n }\n}\n\nNumber.prototype.microAlgos = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nNumber.prototype.algos = function () {\n return AlgoAmount.Algo(this)\n}\n\nNumber.prototype.microAlgo = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nNumber.prototype.algo = function () {\n return AlgoAmount.Algo(this)\n}\n\nBigInt.prototype.microAlgo = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nBigInt.prototype.algo = function () {\n return AlgoAmount.Algo(this)\n}\n\n/** Returns an amount of Algo using AlgoAmount\n * @param algos The amount of Algo\n */\nexport const algos = (algos: number | bigint) => {\n return AlgoAmount.Algo(algos)\n}\n\n/** Returns an amount of Algo using AlgoAmount\n * @param algos The amount of Algo\n */\nexport const algo = (algos: number | bigint) => {\n return AlgoAmount.Algo(algos)\n}\n\n/** Returns an amount of µAlgo using AlgoAmount\n * @param microAlgos The amount of µAlgo\n */\nexport const microAlgos = (microAlgos: number | bigint) => {\n return AlgoAmount.MicroAlgo(microAlgos)\n}\n\n/** Returns an amount of µAlgo using AlgoAmount\n * @param microAlgos The amount of µAlgo\n */\nexport const microAlgo = (microAlgos: number | bigint) => {\n return AlgoAmount.MicroAlgo(microAlgos)\n}\n\n/** Returns an amount of µAlgo to cover standard fees for the given number of transactions using AlgoAmount\n * @param numberOfTransactions The of standard transaction fees to return the amount of Algo\n */\nexport const transactionFees = (numberOfTransactions: number) => {\n return AlgoAmount.MicroAlgo(BigInt(numberOfTransactions) * ALGORAND_MIN_TX_FEE.microAlgo)\n}\n\nexport const ALGORAND_MIN_TX_FEE = AlgoAmount.MicroAlgo(1_000)\n"],"names":["AlgoAmount"],"mappings":";;;;AAiCA,MAAM,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,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;AACzC,EAAC;AAED;;AAEG;AACU,MAAA,eAAe,GAAG,CAAC,oBAA4B,KAAI;AAC9D,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,MAAM,CAAC,oBAAoB,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAA;AAC3F,EAAC;AAEY,MAAA,mBAAmB,GAAGA,uBAAU,CAAC,SAAS,CAAC,IAAK;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"amount.mjs","sources":["../../src/amount.ts"],"sourcesContent":["import { AlgoAmount } from './types/amount'\n\ndeclare global {\n interface Number {\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgos(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algos(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgo(this: number): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algo(this: number): AlgoAmount\n }\n interface BigInt {\n /**\n * Returns an `AlgoAmount` using this number of microAlgo.\n */\n microAlgo(this: bigint): AlgoAmount\n /**\n * Returns an `AlgoAmount` using this number of Algo.\n */\n algo(this: bigint): AlgoAmount\n }\n}\n\nNumber.prototype.microAlgos = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nNumber.prototype.algos = function () {\n return AlgoAmount.Algo(this)\n}\n\nNumber.prototype.microAlgo = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nNumber.prototype.algo = function () {\n return AlgoAmount.Algo(this)\n}\n\nBigInt.prototype.microAlgo = function () {\n return AlgoAmount.MicroAlgo(this)\n}\n\nBigInt.prototype.algo = function () {\n return AlgoAmount.Algo(this)\n}\n\n/** Returns an amount of Algo using AlgoAmount\n * @param algos The amount of Algo\n */\nexport const algos = (algos: number | bigint) => {\n return AlgoAmount.Algo(algos)\n}\n\n/** Returns an amount of Algo using AlgoAmount\n * @param algos The amount of Algo\n */\nexport const algo = (algos: number | bigint) => {\n return AlgoAmount.Algo(algos)\n}\n\n/** Returns an amount of µAlgo using AlgoAmount\n * @param microAlgos The amount of µAlgo\n */\nexport const microAlgos = (microAlgos: number | bigint) => {\n return AlgoAmount.MicroAlgo(microAlgos)\n}\n\n/** Returns an amount of µAlgo using AlgoAmount\n * @param microAlgos The amount of µAlgo\n */\nexport const microAlgo = (microAlgos: number | bigint) => {\n return AlgoAmount.MicroAlgo(microAlgos)\n}\n\n/** Returns an amount of µAlgo to cover standard fees for the given number of transactions using AlgoAmount\n * @param numberOfTransactions The of standard transaction fees to return the amount of Algo\n */\nexport const transactionFees = (numberOfTransactions: number) => {\n return AlgoAmount.MicroAlgo(BigInt(numberOfTransactions) * ALGORAND_MIN_TX_FEE.microAlgo)\n}\n\nexport const ALGORAND_MIN_TX_FEE = AlgoAmount.MicroAlgo(1_000)\n"],"names":[],"mappings":";;AAiCA,MAAM,CAAC,SAAS,CAAC,UAAU,GAAG,YAAA;AAC5B,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,YAAA;AACvB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,YAAA;AAC3B,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAA;AACtB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,YAAA;AAC3B,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC,CAAA;AACnC,CAAC,CAAA;AAED,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAA;AACtB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC9B,CAAC,CAAA;AAED;;AAEG;AACU,MAAA,KAAK,GAAG,CAAC,KAAsB,KAAI;AAC9C,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC/B,EAAC;AAED;;AAEG;AACU,MAAA,IAAI,GAAG,CAAC,KAAsB,KAAI;AAC7C,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC/B,EAAC;AAED;;AAEG;AACU,MAAA,UAAU,GAAG,CAAC,UAA2B,KAAI;AACxD,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;AACzC,EAAC;AAED;;AAEG;AACU,MAAA,SAAS,GAAG,CAAC,UAA2B,KAAI;AACvD,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC,CAAA;AACzC,EAAC;AAED;;AAEG;AACU,MAAA,eAAe,GAAG,CAAC,oBAA4B,KAAI;AAC9D,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,oBAAoB,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC,CAAA;AAC3F,EAAC;AAEY,MAAA,mBAAmB,GAAG,UAAU,CAAC,SAAS,CAAC,IAAK;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"app-client.js","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"],"names":["ApplicationClient"],"mappings":";;;;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACa,SAAA,YAAY,CAAC,UAA6B,EAAE,KAAc,EAAA;AACxE,IAAA,OAAO,IAAIA,iCAAiB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;AACjD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;AAqBG;AACa,SAAA,gBAAgB,CAAC,UAAiC,EAAE,KAAc,EAAA;AAChF,IAAA,OAAO,IAAIA,iCAAiB,CAAC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,CAAA;AACzE,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACa,SAAA,4BAA4B,CAAC,UAA6C,EAAE,KAAc,EAAA;AACxG,IAAA,OAAO,IAAIA,iCAAiB,CAAC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,KAAK,CAAC,CAAA;AACrF;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"app-client.mjs","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"],"names":[],"mappings":";;AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACa,SAAA,YAAY,CAAC,UAA6B,EAAE,KAAc,EAAA;AACxE,IAAA,OAAO,IAAI,iBAAiB,CAAC,UAAU,EAAE,KAAK,CAAC,CAAA;AACjD,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;AAqBG;AACa,SAAA,gBAAgB,CAAC,UAAiC,EAAE,KAAc,EAAA;AAChF,IAAA,OAAO,IAAI,iBAAiB,CAAC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,IAAI,EAAE,EAAE,KAAK,CAAC,CAAA;AACzE,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;AAsBG;AACa,SAAA,4BAA4B,CAAC,UAA6C,EAAE,KAAc,EAAA;AACxG,IAAA,OAAO,IAAI,iBAAiB,CAAC,EAAE,GAAG,UAAU,EAAE,SAAS,EAAE,gBAAgB,EAAE,EAAE,KAAK,CAAC,CAAA;AACrF;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"app-deploy.js","sources":["../../src/app-deploy.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { compileTeal, getAppOnCompleteAction } from './app'\nimport { _getAppArgsForABICall, _getBoxReference } from './transaction/legacy-bridge'\nimport { getSenderAddress, getSenderTransactionSigner } from './transaction/transaction'\nimport { AlgorandClientTransactionSender } from './types/algorand-client-transaction-sender'\nimport {\n ABIReturn,\n APP_DEPLOY_NOTE_DAPP,\n AppCompilationResult,\n AppDeployMetadata,\n AppDeploymentParams,\n AppLookup,\n AppMetadata,\n CompiledTeal,\n TealTemplateParams,\n} from './types/app'\nimport { AppDeployer } from './types/app-deployer'\nimport { AppManager, BoxReference } from './types/app-manager'\nimport { AssetManager } from './types/asset-manager'\nimport {\n AppCreateMethodCall,\n AppCreateParams,\n AppDeleteMethodCall,\n AppDeleteParams,\n AppUpdateMethodCall,\n AppUpdateParams,\n TransactionComposer,\n} from './types/composer'\nimport { Arc2TransactionNote, ConfirmedTransactionResult, ConfirmedTransactionResults, SendTransactionFrom } from './types/transaction'\nimport Algodv2 = algosdk.Algodv2\nimport Indexer = algosdk.Indexer\nimport modelsv2 = algosdk.modelsv2\n\n/**\n * @deprecated Use `algorand.appDeployer.deploy` instead.\n *\n * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.\n *\n * To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md\n *\n * **Note:** When using the return from this function be sure to check `operationPerformed` to get access to various return properties like `transaction`, `confirmation` and `deleteResult`.\n *\n * **Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created.\n *\n * **Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created.\n * @param deployment The arguments to control the app deployment\n * @param algod An algod client\n * @param indexer An indexer client, needed if `existingDeployments` not passed in\n * @returns The app reference of the new/existing app\n */\nexport async function deployApp(\n deployment: AppDeploymentParams,\n algod: Algodv2,\n indexer?: Indexer,\n): Promise<\n Partial<AppCompilationResult> &\n (\n | (ConfirmedTransactionResults & AppMetadata & { return?: ABIReturn; operationPerformed: 'create' | 'update' })\n | (ConfirmedTransactionResults &\n AppMetadata & {\n return?: ABIReturn\n deleteReturn?: ABIReturn\n deleteResult: ConfirmedTransactionResult\n operationPerformed: 'replace'\n })\n | (AppMetadata & { operationPerformed: 'nothing' })\n )\n> {\n const appManager = new AppManager(algod)\n const newGroup = () =>\n new TransactionComposer({\n algod,\n getSigner: () => getSenderTransactionSigner(deployment.from),\n getSuggestedParams: async () =>\n deployment.transactionParams ? { ...deployment.transactionParams } : await algod.getTransactionParams().do(),\n appManager,\n })\n const deployer = new AppDeployer(\n appManager,\n new AlgorandClientTransactionSender(newGroup, new AssetManager(algod, newGroup), appManager),\n indexer,\n )\n\n const createParams = {\n approvalProgram: deployment.approvalProgram,\n clearStateProgram: deployment.clearStateProgram,\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.createArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.createArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.createArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.createArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.createArgs?.lease,\n rekeyTo: deployment.createArgs?.rekeyTo ? getSenderAddress(deployment.createArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n extraProgramPages: deployment.schema.extraPages,\n onComplete: getAppOnCompleteAction(deployment.createOnCompleteAction) as Exclude<\n algosdk.OnApplicationComplete,\n algosdk.OnApplicationComplete.ClearStateOC\n >,\n schema: deployment.schema,\n } satisfies Partial<AppCreateParams>\n\n const updateParams = {\n approvalProgram: deployment.approvalProgram,\n clearStateProgram: deployment.clearStateProgram,\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.updateArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.updateArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.updateArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.updateArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.updateArgs?.lease,\n rekeyTo: deployment.updateArgs?.rekeyTo ? getSenderAddress(deployment.updateArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n } satisfies Partial<AppUpdateParams>\n\n const deleteParams = {\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.deleteArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.deleteArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.deleteArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.deleteArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.deleteArgs?.lease,\n rekeyTo: deployment.deleteArgs?.rekeyTo ? getSenderAddress(deployment.deleteArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n } satisfies Partial<AppDeleteParams>\n\n const encoder = new TextEncoder()\n\n const result = await deployer.deploy({\n createParams: deployment.createArgs?.method\n ? ({\n ...createParams,\n method:\n 'txnCount' in deployment.createArgs.method ? deployment.createArgs.method : new algosdk.ABIMethod(deployment.createArgs.method),\n args: (await _getAppArgsForABICall(deployment.createArgs, deployment.from)).methodArgs,\n } satisfies AppCreateMethodCall)\n : ({\n ...createParams,\n args:\n 'appArgs' in (deployment?.createArgs ?? {})\n ? deployment.createArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies AppCreateParams),\n updateParams: deployment.updateArgs?.method\n ? ({\n ...updateParams,\n method:\n 'txnCount' in deployment.updateArgs.method ? deployment.updateArgs.method : new algosdk.ABIMethod(deployment.updateArgs.method),\n args: (await _getAppArgsForABICall(deployment.updateArgs, deployment.from)).methodArgs,\n } satisfies Omit<AppUpdateMethodCall, 'appId'>)\n : ({\n ...updateParams,\n args:\n 'appArgs' in (deployment?.updateArgs ?? {})\n ? deployment.updateArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies Omit<AppUpdateParams, 'appId'>),\n deleteParams: deployment.deleteArgs?.method\n ? ({\n ...deleteParams,\n method:\n 'txnCount' in deployment.deleteArgs.method ? deployment.deleteArgs.method : new algosdk.ABIMethod(deployment.deleteArgs.method),\n args: (await _getAppArgsForABICall(deployment.deleteArgs, deployment.from)).methodArgs,\n } satisfies Omit<AppDeleteMethodCall, 'appId'>)\n : ({\n ...deleteParams,\n args:\n 'appArgs' in (deployment?.deleteArgs ?? {})\n ? deployment.deleteArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies Omit<AppDeleteParams, 'appId'>),\n metadata: deployment.metadata,\n deployTimeParams: deployment.deployTimeParams,\n onSchemaBreak: deployment.onSchemaBreak,\n onUpdate: deployment.onUpdate,\n existingDeployments: deployment.existingDeployments\n ? {\n creator: Address.fromString(deployment.existingDeployments.creator),\n apps: Object.fromEntries(\n Object.entries(deployment.existingDeployments.apps).map(([name, app]) => [\n name,\n {\n ...app,\n appAddress: Address.fromString(app.appAddress),\n appId: BigInt(app.appId),\n createdRound: BigInt(app.createdRound),\n updatedRound: BigInt(app.updatedRound),\n },\n ]),\n ),\n }\n : undefined,\n maxRoundsToWaitForConfirmation: deployment.maxRoundsToWaitForConfirmation,\n populateAppCallResources: deployment.populateAppCallResources,\n suppressLog: deployment.suppressLog,\n })\n\n return {\n ...result,\n appAddress: result.appAddress.toString(),\n appId: Number(result.appId),\n createdRound: Number(result.createdRound),\n updatedRound: Number(result.updatedRound),\n }\n}\n\n/**\n * @deprecated Use `before.numByteSlice < after.numByteSlice || before.numUint < after.numUint` instead.\n *\n * Returns true is there is a breaking change in the application state schema from before to after.\n * i.e. if the schema becomes larger, since applications can't ask for more schema after creation.\n * Otherwise, there is no error, the app just doesn't store data in the extra schema :(\n *\n * @param before The existing schema\n * @param after The new schema\n * @returns Whether or not there is a breaking change\n */\nexport function isSchemaIsBroken(before: modelsv2.ApplicationStateSchema, after: modelsv2.ApplicationStateSchema) {\n return before.numByteSlice < after.numByteSlice || before.numUint < after.numUint\n}\n\n/**\n * @deprecated Use `algorand.appDeployer.getCreatorAppsByName` instead.\n *\n * Returns a lookup of name => app metadata (id, address, ...metadata) for all apps created by the given account that have an `AppDeployNote` in the transaction note of the creation transaction.\n *\n * **Note:** It's recommended this is only called once and then stored since it's a somewhat expensive operation (multiple indexer calls).\n *\n * @param creatorAccount The account (with private key loaded) or string address of an account that is the creator of the apps you want to search for\n * @param indexer An indexer client\n * @returns A name-based lookup of the app information (id, address)\n */\nexport async function getCreatorAppsByName(creatorAccount: SendTransactionFrom | string, indexer: Indexer): Promise<AppLookup> {\n const lookup = await new AppDeployer(undefined!, undefined!, indexer).getCreatorAppsByName(getSenderAddress(creatorAccount))\n\n return {\n creator: lookup.creator.toString(),\n apps: Object.fromEntries(\n Object.entries(lookup.apps).map(([name, app]) => [\n name,\n {\n ...app,\n appAddress: app.appAddress.toString(),\n appId: Number(app.appId),\n createdRound: Number(app.createdRound),\n updatedRound: Number(app.updatedRound),\n },\n ]),\n ),\n }\n}\n\n/**\n * @deprecated Use `{ dAppName: APP_DEPLOY_NOTE_DAPP, data: metadata, format: 'j' }` instead.\n *\n * Return the transaction note for an app deployment.\n * @param metadata The metadata of the deployment\n * @returns The transaction note as a utf-8 string\n */\nexport function getAppDeploymentTransactionNote(metadata: AppDeployMetadata): Arc2TransactionNote {\n return {\n dAppName: APP_DEPLOY_NOTE_DAPP,\n data: metadata,\n format: 'j',\n }\n}\n\n/**\n * @deprecated Use `AppManager.replaceTealTemplateDeployTimeControlParams` instead\n *\n * Replaces deploy-time deployment control parameters within the given teal code.\n *\n * * `TMPL_UPDATABLE` for updatability / immutability control\n * * `TMPL_DELETABLE` for deletability / permanence control\n *\n * Note: If these values are not undefined, but the corresponding `TMPL_*` value\n * isn't in the teal code it will throw an exception.\n *\n * @param tealCode The TEAL code to substitute\n * @param params The deploy-time deployment control parameter value to replace\n * @returns The replaced TEAL code\n */\nexport function replaceDeployTimeControlParams(tealCode: string, params: { updatable?: boolean; deletable?: boolean }) {\n return AppManager.replaceTealTemplateDeployTimeControlParams(tealCode, params)\n}\n\n/**\n * @deprecated Use `AppManager.replaceTealTemplateParams` instead\n *\n * Performs template substitution of a teal file.\n *\n * Looks for `TMPL_{parameter}` for template replacements.\n *\n * @param tealCode The TEAL logic to compile\n * @param templateParams Any parameters to replace in the .teal file before compiling\n * @returns The TEAL code with replacements\n */\nexport function performTemplateSubstitution(tealCode: string, templateParams?: TealTemplateParams) {\n return AppManager.replaceTealTemplateParams(tealCode, templateParams)\n}\n\n/**\n * @deprecated Use `algorand.appManager.compileTealTemplate` instead.\n *\n * Performs template substitution of a teal file and compiles it, returning the compiled result.\n *\n * Looks for `TMPL_{parameter}` for template replacements.\n *\n * @param tealCode The TEAL logic to compile\n * @param algod An algod client\n * @param templateParams Any parameters to replace in the .teal file before compiling\n * @param deploymentMetadata The deployment metadata the app will be deployed with\n * @returns The information about the compiled code\n */\nexport async function performTemplateSubstitutionAndCompile(\n tealCode: string,\n algod: Algodv2,\n templateParams?: TealTemplateParams,\n deploymentMetadata?: AppDeployMetadata,\n): Promise<CompiledTeal> {\n tealCode = stripTealComments(tealCode)\n\n tealCode = performTemplateSubstitution(tealCode, templateParams)\n\n if (deploymentMetadata) {\n tealCode = replaceDeployTimeControlParams(tealCode, deploymentMetadata)\n }\n\n return await compileTeal(tealCode, algod)\n}\n\n/**\n * @deprecated Use `AppManager.stripTealComments` instead.\n *\n * Remove comments from TEAL Code\n *\n * @param tealCode The TEAL logic to compile\n * @returns The TEAL without comments\n */\nexport function stripTealComments(tealCode: string) {\n return AppManager.stripTealComments(tealCode)\n}\n"],"names":["AppManager","TransactionComposer","getSenderTransactionSigner","AppDeployer","AlgorandClientTransactionSender","AssetManager","getSenderAddress","_getBoxReference","getAppOnCompleteAction","_getAppArgsForABICall","Address","APP_DEPLOY_NOTE_DAPP","compileTeal"],"mappings":";;;;;;;;;;;;;AAiCA;;;;;;;;;;;;;;;;AAgBG;AACI,eAAe,SAAS,CAC7B,UAA+B,EAC/B,KAAc,EACd,OAAiB,EAAA;AAejB,IAAA,MAAM,UAAU,GAAG,IAAIA,2BAAU,CAAC,KAAK,CAAC,CAAA;AACxC,IAAA,MAAM,QAAQ,GAAG,MACf,IAAIC,kCAAmB,CAAC;QACtB,KAAK;QACL,SAAS,EAAE,MAAMC,sCAA0B,CAAC,UAAU,C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0CAA0C,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;AAChF,CAAC;AAED;;;;;;;;;;AAUG;AACa,SAAA,2BAA2B,CAAC,QAAgB,EAAE,cAAmC,EAAA;IAC/F,OAAOA,2BAAU,CAAC,yBAAyB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;AACvE,CAAC;AAED;;;;;;;;;;;;AAYG;AACI,eAAe,qCAAqC,CACzD,QAAgB,EAChB,KAAc,EACd,cAAmC,EACnC,kBAAsC,EAAA;AAEtC,IAAA,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAA;AAEtC,IAAA,QAAQ,GAAG,2BAA2B,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;IAEhE,IAAI,kBAAkB,EAAE;AACtB,QAAA,QAAQ,GAAG,8BAA8B,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAA;KACxE;AAED,IAAA,OAAO,MAAMY,eAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAED;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAC,QAAgB,EAAA;AAChD,IAAA,OAAOZ,2BAAU,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAA;AAC/C;;;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"app-deploy.mjs","sources":["../../src/app-deploy.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { compileTeal, getAppOnCompleteAction } from './app'\nimport { _getAppArgsForABICall, _getBoxReference } from './transaction/legacy-bridge'\nimport { getSenderAddress, getSenderTransactionSigner } from './transaction/transaction'\nimport { AlgorandClientTransactionSender } from './types/algorand-client-transaction-sender'\nimport {\n ABIReturn,\n APP_DEPLOY_NOTE_DAPP,\n AppCompilationResult,\n AppDeployMetadata,\n AppDeploymentParams,\n AppLookup,\n AppMetadata,\n CompiledTeal,\n TealTemplateParams,\n} from './types/app'\nimport { AppDeployer } from './types/app-deployer'\nimport { AppManager, BoxReference } from './types/app-manager'\nimport { AssetManager } from './types/asset-manager'\nimport {\n AppCreateMethodCall,\n AppCreateParams,\n AppDeleteMethodCall,\n AppDeleteParams,\n AppUpdateMethodCall,\n AppUpdateParams,\n TransactionComposer,\n} from './types/composer'\nimport { Arc2TransactionNote, ConfirmedTransactionResult, ConfirmedTransactionResults, SendTransactionFrom } from './types/transaction'\nimport Algodv2 = algosdk.Algodv2\nimport Indexer = algosdk.Indexer\nimport modelsv2 = algosdk.modelsv2\n\n/**\n * @deprecated Use `algorand.appDeployer.deploy` instead.\n *\n * Idempotently deploy (create, update/delete if changed) an app against the given name via the given creator account, including deploy-time template placeholder substitutions.\n *\n * To understand the architecture decisions behind this functionality please see https://github.com/algorandfoundation/algokit-cli/blob/main/docs/architecture-decisions/2023-01-12_smart-contract-deployment.md\n *\n * **Note:** When using the return from this function be sure to check `operationPerformed` to get access to various return properties like `transaction`, `confirmation` and `deleteResult`.\n *\n * **Note:** if there is a breaking state schema change to an existing app (and `onSchemaBreak` is set to `'replace'`) the existing app will be deleted and re-created.\n *\n * **Note:** if there is an update (different TEAL code) to an existing app (and `onUpdate` is set to `'replace'`) the existing app will be deleted and re-created.\n * @param deployment The arguments to control the app deployment\n * @param algod An algod client\n * @param indexer An indexer client, needed if `existingDeployments` not passed in\n * @returns The app reference of the new/existing app\n */\nexport async function deployApp(\n deployment: AppDeploymentParams,\n algod: Algodv2,\n indexer?: Indexer,\n): Promise<\n Partial<AppCompilationResult> &\n (\n | (ConfirmedTransactionResults & AppMetadata & { return?: ABIReturn; operationPerformed: 'create' | 'update' })\n | (ConfirmedTransactionResults &\n AppMetadata & {\n return?: ABIReturn\n deleteReturn?: ABIReturn\n deleteResult: ConfirmedTransactionResult\n operationPerformed: 'replace'\n })\n | (AppMetadata & { operationPerformed: 'nothing' })\n )\n> {\n const appManager = new AppManager(algod)\n const newGroup = () =>\n new TransactionComposer({\n algod,\n getSigner: () => getSenderTransactionSigner(deployment.from),\n getSuggestedParams: async () =>\n deployment.transactionParams ? { ...deployment.transactionParams } : await algod.getTransactionParams().do(),\n appManager,\n })\n const deployer = new AppDeployer(\n appManager,\n new AlgorandClientTransactionSender(newGroup, new AssetManager(algod, newGroup), appManager),\n indexer,\n )\n\n const createParams = {\n approvalProgram: deployment.approvalProgram,\n clearStateProgram: deployment.clearStateProgram,\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.createArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.createArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.createArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.createArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.createArgs?.lease,\n rekeyTo: deployment.createArgs?.rekeyTo ? getSenderAddress(deployment.createArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n extraProgramPages: deployment.schema.extraPages,\n onComplete: getAppOnCompleteAction(deployment.createOnCompleteAction) as Exclude<\n algosdk.OnApplicationComplete,\n algosdk.OnApplicationComplete.ClearStateOC\n >,\n schema: deployment.schema,\n } satisfies Partial<AppCreateParams>\n\n const updateParams = {\n approvalProgram: deployment.approvalProgram,\n clearStateProgram: deployment.clearStateProgram,\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.updateArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.updateArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.updateArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.updateArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.updateArgs?.lease,\n rekeyTo: deployment.updateArgs?.rekeyTo ? getSenderAddress(deployment.updateArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n } satisfies Partial<AppUpdateParams>\n\n const deleteParams = {\n sender: getSenderAddress(deployment.from),\n accountReferences: deployment.deleteArgs?.accounts?.map((a) => (typeof a === 'string' ? a : algosdk.encodeAddress(a.publicKey))),\n appReferences: deployment.deleteArgs?.apps?.map((a) => BigInt(a)),\n assetReferences: deployment.deleteArgs?.assets?.map((a) => BigInt(a)),\n boxReferences: deployment.deleteArgs?.boxes\n ?.map(_getBoxReference)\n ?.map((r) => ({ appId: BigInt(r.appIndex), name: r.name }) satisfies BoxReference),\n lease: deployment.deleteArgs?.lease,\n rekeyTo: deployment.deleteArgs?.rekeyTo ? getSenderAddress(deployment.deleteArgs?.rekeyTo) : undefined,\n staticFee: deployment.fee,\n maxFee: deployment.maxFee,\n onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n } satisfies Partial<AppDeleteParams>\n\n const encoder = new TextEncoder()\n\n const result = await deployer.deploy({\n createParams: deployment.createArgs?.method\n ? ({\n ...createParams,\n method:\n 'txnCount' in deployment.createArgs.method ? deployment.createArgs.method : new algosdk.ABIMethod(deployment.createArgs.method),\n args: (await _getAppArgsForABICall(deployment.createArgs, deployment.from)).methodArgs,\n } satisfies AppCreateMethodCall)\n : ({\n ...createParams,\n args:\n 'appArgs' in (deployment?.createArgs ?? {})\n ? deployment.createArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies AppCreateParams),\n updateParams: deployment.updateArgs?.method\n ? ({\n ...updateParams,\n method:\n 'txnCount' in deployment.updateArgs.method ? deployment.updateArgs.method : new algosdk.ABIMethod(deployment.updateArgs.method),\n args: (await _getAppArgsForABICall(deployment.updateArgs, deployment.from)).methodArgs,\n } satisfies Omit<AppUpdateMethodCall, 'appId'>)\n : ({\n ...updateParams,\n args:\n 'appArgs' in (deployment?.updateArgs ?? {})\n ? deployment.updateArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies Omit<AppUpdateParams, 'appId'>),\n deleteParams: deployment.deleteArgs?.method\n ? ({\n ...deleteParams,\n method:\n 'txnCount' in deployment.deleteArgs.method ? deployment.deleteArgs.method : new algosdk.ABIMethod(deployment.deleteArgs.method),\n args: (await _getAppArgsForABICall(deployment.deleteArgs, deployment.from)).methodArgs,\n } satisfies Omit<AppDeleteMethodCall, 'appId'>)\n : ({\n ...deleteParams,\n args:\n 'appArgs' in (deployment?.deleteArgs ?? {})\n ? deployment.deleteArgs?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a))\n : undefined,\n } satisfies Omit<AppDeleteParams, 'appId'>),\n metadata: deployment.metadata,\n deployTimeParams: deployment.deployTimeParams,\n onSchemaBreak: deployment.onSchemaBreak,\n onUpdate: deployment.onUpdate,\n existingDeployments: deployment.existingDeployments\n ? {\n creator: Address.fromString(deployment.existingDeployments.creator),\n apps: Object.fromEntries(\n Object.entries(deployment.existingDeployments.apps).map(([name, app]) => [\n name,\n {\n ...app,\n appAddress: Address.fromString(app.appAddress),\n appId: BigInt(app.appId),\n createdRound: BigInt(app.createdRound),\n updatedRound: BigInt(app.updatedRound),\n },\n ]),\n ),\n }\n : undefined,\n maxRoundsToWaitForConfirmation: deployment.maxRoundsToWaitForConfirmation,\n populateAppCallResources: deployment.populateAppCallResources,\n suppressLog: deployment.suppressLog,\n })\n\n return {\n ...result,\n appAddress: result.appAddress.toString(),\n appId: Number(result.appId),\n createdRound: Number(result.createdRound),\n updatedRound: Number(result.updatedRound),\n }\n}\n\n/**\n * @deprecated Use `before.numByteSlice < after.numByteSlice || before.numUint < after.numUint` instead.\n *\n * Returns true is there is a breaking change in the application state schema from before to after.\n * i.e. if the schema becomes larger, since applications can't ask for more schema after creation.\n * Otherwise, there is no error, the app just doesn't store data in the extra schema :(\n *\n * @param before The existing schema\n * @param after The new schema\n * @returns Whether or not there is a breaking change\n */\nexport function isSchemaIsBroken(before: modelsv2.ApplicationStateSchema, after: modelsv2.ApplicationStateSchema) {\n return before.numByteSlice < after.numByteSlice || before.numUint < after.numUint\n}\n\n/**\n * @deprecated Use `algorand.appDeployer.getCreatorAppsByName` instead.\n *\n * Returns a lookup of name => app metadata (id, address, ...metadata) for all apps created by the given account that have an `AppDeployNote` in the transaction note of the creation transaction.\n *\n * **Note:** It's recommended this is only called once and then stored since it's a somewhat expensive operation (multiple indexer calls).\n *\n * @param creatorAccount The account (with private key loaded) or string address of an account that is the creator of the apps you want to search for\n * @param indexer An indexer client\n * @returns A name-based lookup of the app information (id, address)\n */\nexport async function getCreatorAppsByName(creatorAccount: SendTransactionFrom | string, indexer: Indexer): Promise<AppLookup> {\n const lookup = await new AppDeployer(undefined!, undefined!, indexer).getCreatorAppsByName(getSenderAddress(creatorAccount))\n\n return {\n creator: lookup.creator.toString(),\n apps: Object.fromEntries(\n Object.entries(lookup.apps).map(([name, app]) => [\n name,\n {\n ...app,\n appAddress: app.appAddress.toString(),\n appId: Number(app.appId),\n createdRound: Number(app.createdRound),\n updatedRound: Number(app.updatedRound),\n },\n ]),\n ),\n }\n}\n\n/**\n * @deprecated Use `{ dAppName: APP_DEPLOY_NOTE_DAPP, data: metadata, format: 'j' }` instead.\n *\n * Return the transaction note for an app deployment.\n * @param metadata The metadata of the deployment\n * @returns The transaction note as a utf-8 string\n */\nexport function getAppDeploymentTransactionNote(metadata: AppDeployMetadata): Arc2TransactionNote {\n return {\n dAppName: APP_DEPLOY_NOTE_DAPP,\n data: metadata,\n format: 'j',\n }\n}\n\n/**\n * @deprecated Use `AppManager.replaceTealTemplateDeployTimeControlParams` instead\n *\n * Replaces deploy-time deployment control parameters within the given teal code.\n *\n * * `TMPL_UPDATABLE` for updatability / immutability control\n * * `TMPL_DELETABLE` for deletability / permanence control\n *\n * Note: If these values are not undefined, but the corresponding `TMPL_*` value\n * isn't in the teal code it will throw an exception.\n *\n * @param tealCode The TEAL code to substitute\n * @param params The deploy-time deployment control parameter value to replace\n * @returns The replaced TEAL code\n */\nexport function replaceDeployTimeControlParams(tealCode: string, params: { updatable?: boolean; deletable?: boolean }) {\n return AppManager.replaceTealTemplateDeployTimeControlParams(tealCode, params)\n}\n\n/**\n * @deprecated Use `AppManager.replaceTealTemplateParams` instead\n *\n * Performs template substitution of a teal file.\n *\n * Looks for `TMPL_{parameter}` for template replacements.\n *\n * @param tealCode The TEAL logic to compile\n * @param templateParams Any parameters to replace in the .teal file before compiling\n * @returns The TEAL code with replacements\n */\nexport function performTemplateSubstitution(tealCode: string, templateParams?: TealTemplateParams) {\n return AppManager.replaceTealTemplateParams(tealCode, templateParams)\n}\n\n/**\n * @deprecated Use `algorand.appManager.compileTealTemplate` instead.\n *\n * Performs template substitution of a teal file and compiles it, returning the compiled result.\n *\n * Looks for `TMPL_{parameter}` for template replacements.\n *\n * @param tealCode The TEAL logic to compile\n * @param algod An algod client\n * @param templateParams Any parameters to replace in the .teal file before compiling\n * @param deploymentMetadata The deployment metadata the app will be deployed with\n * @returns The information about the compiled code\n */\nexport async function performTemplateSubstitutionAndCompile(\n tealCode: string,\n algod: Algodv2,\n templateParams?: TealTemplateParams,\n deploymentMetadata?: AppDeployMetadata,\n): Promise<CompiledTeal> {\n tealCode = stripTealComments(tealCode)\n\n tealCode = performTemplateSubstitution(tealCode, templateParams)\n\n if (deploymentMetadata) {\n tealCode = replaceDeployTimeControlParams(tealCode, deploymentMetadata)\n }\n\n return await compileTeal(tealCode, algod)\n}\n\n/**\n * @deprecated Use `AppManager.stripTealComments` instead.\n *\n * Remove comments from TEAL Code\n *\n * @param tealCode The TEAL logic to compile\n * @returns The TEAL without comments\n */\nexport function stripTealComments(tealCode: string) {\n return AppManager.stripTealComments(tealCode)\n}\n"],"names":[],"mappings":";;;;;;;;;;;AAiCA;;;;;;;;;;;;;;;;AAgBG;AACI,eAAe,SAAS,CAC7B,UAA+B,EAC/B,KAAc,EACd,OAAiB,EAAA;AAejB,IAAA,MAAM,UAAU,GAAG,IAAI,UAAU,CAAC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AC;AAED;;;;;;;;;;;;;;AAcG;AACa,SAAA,8BAA8B,CAAC,QAAgB,EAAE,MAAoD,EAAA;IACnH,OAAO,UAAU,CAAC,0CAA0C,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAA;AAChF,CAAC;AAED;;;;;;;;;;AAUG;AACa,SAAA,2BAA2B,CAAC,QAAgB,EAAE,cAAmC,EAAA;IAC/F,OAAO,UAAU,CAAC,yBAAyB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;AACvE,CAAC;AAED;;;;;;;;;;;;AAYG;AACI,eAAe,qCAAqC,CACzD,QAAgB,EAChB,KAAc,EACd,cAAmC,EACnC,kBAAsC,EAAA;AAEtC,IAAA,QAAQ,GAAG,iBAAiB,CAAC,QAAQ,CAAC,CAAA;AAEtC,IAAA,QAAQ,GAAG,2BAA2B,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAA;IAEhE,IAAI,kBAAkB,EAAE;AACtB,QAAA,QAAQ,GAAG,8BAA8B,CAAC,QAAQ,EAAE,kBAAkB,CAAC,CAAA;KACxE;AAED,IAAA,OAAO,MAAM,WAAW,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAED;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAC,QAAgB,EAAA;AAChD,IAAA,OAAO,UAAU,CAAC,iBAAiB,CAAC,QAAQ,CAAC,CAAA;AAC/C;;;;"}
package/src/app.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.js","sources":["../../src/app.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { _getAppArgsForABICall, _getBoxReference, legacySendAppTransactionBridge } from './transaction/legacy-bridge'\nimport { encodeLease, getSenderAddress } from './transaction/transaction'\nimport {\n ABIAppCallArgs,\n ABIReturn,\n AppCallArgs,\n AppCallParams,\n AppCallTransactionResult,\n AppCallType,\n AppCompilationResult,\n AppReference,\n AppState,\n BoxIdentifier,\n BoxName,\n BoxReference,\n BoxValueRequestParams,\n BoxValuesRequestParams,\n CompiledTeal,\n CreateAppParams,\n RawAppCallArgs,\n UpdateAppParams,\n} from './types/app'\nimport { AppManager } from './types/app-manager'\nimport { SendTransactionFrom } from './types/transaction'\nimport { toNumber } from './util'\nimport ABIMethod = algosdk.ABIMethod\nimport ABIMethodParams = algosdk.ABIMethodParams\nimport ABIValue = algosdk.ABIValue\nimport Address = algosdk.Address\nimport Algodv2 = algosdk.Algodv2\nimport modelsv2 = algosdk.modelsv2\nimport OnApplicationComplete = algosdk.OnApplicationComplete\n\n/**\n * @deprecated Use `algorand.send.appCreate()` / `algorand.createTransaction.appCreate()` / `algorand.send.appCreateMethodCall()`\n * / `algorand.createTransaction.appCreateMethodCall()` instead\n *\n * Creates a smart contract app, returns the details of the created app.\n * @param create The parameters to create the app with\n * @param algod An algod client\n * @returns The details of the created app, or the transaction to create it if `skipSending` and the compilation result\n */\nexport async function createApp(\n create: CreateAppParams,\n algod: Algodv2,\n): Promise<Partial<AppCompilationResult> & AppCallTransactionResult & AppReference> {\n const onComplete = getAppOnCompleteAction(create.onCompleteAction)\n if (onComplete === algosdk.OnApplicationComplete.ClearStateOC) {\n throw new Error('Cannot create an app with on-complete action of ClearState')\n }\n\n const result = create.args?.method\n ? await legacySendAppTransactionBridge(\n algod,\n create.from,\n create.args,\n create,\n {\n sender: getSenderAddress(create.from),\n onComplete,\n approvalProgram: create.approvalProgram,\n clearStateProgram: create.clearStateProgram,\n method: create.args.method instanceof ABIMethod ? create.args.method : new ABIMethod(create.args.method),\n extraProgramPages: create.schema.extraPages,\n schema: create.schema,\n },\n (c) => c.appCreateMethodCall,\n (c) => c.appCreateMethodCall,\n )\n : await legacySendAppTransactionBridge(\n algod,\n create.from,\n create.args,\n create,\n {\n sender: getSenderAddress(create.from),\n onComplete,\n approvalProgram: create.approvalProgram,\n clearStateProgram: create.clearStateProgram,\n extraProgramPages: create.schema.extraPages,\n schema: create.schema,\n },\n (c) => c.appCreate,\n (c) => c.appCreate,\n )\n\n return {\n ...result,\n appId: 'appId' in result ? Number(result.appId) : 0,\n appAddress: 'appAddress' in result ? result.appAddress.toString() : '',\n }\n}\n\n/**\n * @deprecated Use `algorand.send.appUpdate()` / `algorand.createTransaction.appUpdate()` / `algorand.send.appUpdateMethodCall()`\n * / `algorand.createTransaction.appUpdateMethodCall()` instead\n *\n * Updates a smart contract app.\n * @param update The parameters to update the app with\n * @param algod An algod client\n * @returns The transaction send result and the compilation result\n */\nexport async function updateApp(\n update: UpdateAppParams,\n algod: Algodv2,\n): Promise<Partial<AppCompilationResult> & AppCallTransactionResult> {\n return update.args?.method\n ? await legacySendAppTransactionBridge(\n algod,\n update.from,\n update.args,\n update,\n {\n appId: BigInt(update.appId),\n sender: getSenderAddress(update.from),\n onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n approvalProgram: update.approvalProgram,\n clearStateProgram: update.clearStateProgram,\n method: update.args.method instanceof ABIMethod ? update.args.method : new ABIMethod(update.args.method),\n },\n (c) => c.appUpdateMethodCall,\n (c) => c.appUpdateMethodCall,\n )\n : await legacySendAppTransactionBridge(\n algod,\n update.from,\n update.args,\n update,\n {\n appId: BigInt(update.appId),\n sender: getSenderAddress(update.from),\n onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n approvalProgram: update.approvalProgram,\n clearStateProgram: update.clearStateProgram,\n },\n (c) => c.appUpdate,\n (c) => c.appUpdate,\n )\n}\n\n/**\n * @deprecated Use `algosdk.OnApplicationComplete` directly instead.\n *\n * Returns a `algosdk.OnApplicationComplete` for the given onCompleteAction.\n *\n * If given `undefined` will return `OnApplicationComplete.NoOpOC`.\n *\n * If given an `AppCallType` will convert the string enum to the correct underlying `algosdk.OnApplicationComplete`.\n *\n * @param onCompletionAction The on completion action\n * @returns The `algosdk.OnApplicationComplete`\n */\nexport function getAppOnCompleteAction(onCompletionAction?: AppCallType | OnApplicationComplete) {\n switch (onCompletionAction) {\n case undefined:\n case 'no_op':\n case OnApplicationComplete.NoOpOC:\n return OnApplicationComplete.NoOpOC\n case 'opt_in':\n case OnApplicationComplete.OptInOC:\n return OnApplicationComplete.OptInOC\n case 'close_out':\n case OnApplicationComplete.CloseOutOC:\n return OnApplicationComplete.CloseOutOC\n case 'clear_state':\n case OnApplicationComplete.ClearStateOC:\n return OnApplicationComplete.ClearStateOC\n case 'update_application':\n case OnApplicationComplete.UpdateApplicationOC:\n return OnApplicationComplete.UpdateApplicationOC\n case 'delete_application':\n case OnApplicationComplete.DeleteApplicationOC:\n return OnApplicationComplete.DeleteApplicationOC\n }\n}\n\n/**\n * @deprecated Use `algorand.send.appUpdate()` / `algorand.createTransaction.appUpdate()` / `algorand.send.appUpdateMethodCall()`\n * / `algorand.createTransaction.appUpdateMethodCall()` instead\n *\n * Issues a call to a given app.\n * @param call The call details.\n * @param algod An algod client\n * @returns The result of the call\n */\nexport async function callApp(call: AppCallParams, algod: Algodv2): Promise<AppCallTransactionResult> {\n const onComplete = getAppOnCompleteAction(call.callType)\n if (onComplete === algosdk.OnApplicationComplete.UpdateApplicationOC) {\n throw new Error('Cannot execute an app call with on-complete action of Update')\n }\n if (call.args?.method && onComplete === algosdk.OnApplicationComplete.ClearStateOC) {\n throw new Error('Cannot execute an ABI method call with on-complete action of ClearState')\n }\n\n return call.args?.method\n ? await legacySendAppTransactionBridge(\n algod,\n call.from,\n call.args,\n call,\n {\n appId: BigInt(call.appId),\n sender: getSenderAddress(call.from),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onComplete: onComplete as any,\n method: call.args.method instanceof ABIMethod ? call.args.method : new ABIMethod(call.args.method),\n },\n (c) => c.appCallMethodCall,\n (c) => c.appCallMethodCall,\n )\n : await legacySendAppTransactionBridge(\n algod,\n call.from,\n call.args,\n call,\n {\n appId: BigInt(call.appId),\n sender: getSenderAddress(call.from),\n onComplete,\n },\n (c) => c.appCall,\n (c) => c.appCall,\n )\n}\n\n/**\n * @deprecated Use `AppManager.getABIReturn` instead.\n *\n * Returns any ABI return values for the given app call arguments and transaction confirmation.\n * @param args The arguments that were used for the call\n * @param confirmation The transaction confirmation from algod\n * @returns The return value for the method call\n */\nexport function getABIReturn(args?: AppCallArgs, confirmation?: modelsv2.PendingTransactionResponse): ABIReturn | undefined {\n if (!args || !args.method) {\n return undefined\n }\n const method = 'txnCount' in args.method ? args.method : new ABIMethod(args.method)\n\n return AppManager.getABIReturn(confirmation, method)\n}\n\n/**\n * @deprecated Use `algorand.app.getGlobalState` instead.\n *\n * Returns the current global state values for the given app ID\n * @param appId The ID of the app return global state for\n * @param algod An algod client instance\n * @returns The current global state\n */\nexport async function getAppGlobalState(appId: number | bigint, algod: Algodv2) {\n return await new AppManager(algod).getGlobalState(BigInt(appId))\n}\n\n/**\n * @deprecated Use `algorand.app.getLocalState` instead.\n *\n * Returns the current global state values for the given app ID and account\n * @param appId The ID of the app return global state for\n * @param account Either the string address of an account or an account object for the account to get local state for the given app\n * @param algod An algod client instance\n * @returns The current local state for the given (app, account) combination\n */\nexport async function getAppLocalState(appId: number | bigint, account: string | SendTransactionFrom, algod: Algodv2) {\n return new AppManager(algod).getLocalState(BigInt(appId), getSenderAddress(account))\n}\n\n/**\n * @deprecated Use `algorand.app.getBoxNames` instead.\n * Returns the names of the boxes for the given app.\n * @param appId The ID of the app return box names for\n * @param algod An algod client instance\n * @returns The current box names\n */\nexport async function getAppBoxNames(appId: number | bigint, algod: Algodv2): Promise<BoxName[]> {\n return new AppManager(algod).getBoxNames(BigInt(appId))\n}\n\n/**\n * @deprecated Use `algorand.app.getBoxValue` instead.\n * Returns the value of the given box name for the given app.\n * @param appId The ID of the app return box names for\n * @param boxName The name of the box to return either as a string, binary array or `BoxName`\n * @param algod An algod client instance\n * @returns The current box value as a byte array\n */\nexport async function getAppBoxValue(appId: number | bigint, boxName: string | Uint8Array | BoxName, algod: Algodv2): Promise<Uint8Array> {\n return new AppManager(algod).getBoxValue(BigInt(appId), typeof boxName !== 'string' && 'name' in boxName ? boxName.nameRaw : boxName)\n}\n\n/**\n * @deprecated Use `algorand.app.getBoxValues` instead.\n * Returns the value of the given box names for the given app.\n * @param appId The ID of the app return box names for\n * @param boxNames The names of the boxes to return either as a string, binary array or `BoxName`\n * @param algod An algod client instance\n * @returns The current box values as a byte array in the same order as the passed in box names\n */\nexport async function getAppBoxValues(appId: number, boxNames: (string | Uint8Array | BoxName)[], algod: Algodv2): Promise<Uint8Array[]> {\n return new AppManager(algod).getBoxValues(\n BigInt(appId),\n boxNames.map((b) => (typeof b !== 'string' && 'name' in b ? b.nameRaw : b)),\n )\n}\n\n/**\n * @deprecated Use `algorand.app.getBoxValueFromABIType` instead.\n * Returns the value of the given box name for the given app decoded based on the given ABI type.\n * @param request The parameters for the box value request\n * @param algod An algod client instance\n * @returns The current box value as an ABI value\n */\nexport async function getAppBoxValueFromABIType(request: BoxValueRequestParams, algod: Algodv2): Promise<ABIValue> {\n return new AppManager(algod).getBoxValueFromABIType({\n appId: BigInt(request.appId),\n boxName: typeof request.boxName !== 'string' && 'name' in request.boxName ? request.boxName.nameRaw : request.boxName,\n type: request.type,\n })\n}\n\n/**\n * @deprecated Use `algorand.app.getBoxValuesFromABIType` instead.\n * Returns the value of the given box names for the given app decoded based on the given ABI type.\n * @param request The parameters for the box value request\n * @param algod An algod client instance\n * @returns The current box values as an ABI value in the same order as the passed in box names\n */\nexport async function getAppBoxValuesFromABIType(request: BoxValuesRequestParams, algod: Algodv2): Promise<ABIValue[]> {\n return new AppManager(algod).getBoxValuesFromABIType({\n appId: BigInt(request.appId),\n boxNames: request.boxNames.map((b) => (typeof b !== 'string' && 'name' in b ? b.nameRaw : b)),\n type: request.type,\n })\n}\n\n/**\n * @deprecated Use `AppManager.decodeAppState` instead.\n *\n * Converts an array of global/local state values from the algod api to a more friendly\n * generic object keyed by the UTF-8 value of the key.\n * @param state A `global-state`, `local-state`, `global-state-deltas` or `local-state-deltas`\n * @returns An object keyeed by the UTF-8 representation of the key with various parsings of the values\n */\nexport function decodeAppState(state: { key: string; value: modelsv2.TealValue | modelsv2.EvalDelta }[]): AppState {\n return AppManager.decodeAppState(state.map(({ key, value }) => ({ key: Buffer.from(key, 'utf-8'), value })))\n}\n\n/**\n * @deprecated Use `TransactionComposer` methods to construct transactions instead.\n *\n * Returns the app args ready to load onto an app `Transaction` object\n * @param args The app call args\n * @returns The args ready to load into a `Transaction`\n */\nexport function getAppArgsForTransaction(args?: RawAppCallArgs) {\n if (!args) return undefined\n\n const encoder = new TextEncoder()\n return {\n accounts: args?.accounts?.map(_getAccountAddress),\n appArgs: args?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a)),\n boxes: args.boxes?.map(getBoxReference),\n foreignApps: args?.apps,\n foreignAssets: args?.assets,\n lease: encodeLease(args?.lease),\n }\n}\n\n/**\n * @deprecated Use `TransactionComposer` methods to construct transactions instead.\n *\n * Returns the app args ready to load onto an ABI method call in `AtomicTransactionComposer`\n * @param args The ABI app call args\n * @param from The transaction signer\n * @returns The parameters ready to pass into `addMethodCall` within AtomicTransactionComposer\n */\nexport async function getAppArgsForABICall(args: ABIAppCallArgs, from: SendTransactionFrom) {\n return _getAppArgsForABICall(args, from)\n}\n\n/**\n * @deprecated Use `AppManager.getBoxReference()` instead.\n *\n * Returns a `algosdk.BoxReference` given a `BoxIdentifier` or `BoxReference`.\n * @param box The box to return a reference for\n * @returns The box reference ready to pass into a `Transaction`\n */\nexport function getBoxReference(box: BoxIdentifier | BoxReference | algosdk.BoxReference): algosdk.BoxReference {\n return _getBoxReference(box)\n}\n\nfunction _getAccountAddress(account: string | Address) {\n return typeof account === 'string' ? account : algosdk.encodeAddress(account.publicKey)\n}\n\n/**\n * @deprecated Use `algorand.app.getById` instead.\n *\n * Gets the current data for the given app from algod.\n *\n * @param appId The id of the app\n * @param algod An algod client\n * @returns The data about the app\n */\nexport async function getAppById(appId: number | bigint, algod: Algodv2) {\n return await algod.getApplicationByID(toNumber(appId)).do()\n}\n\n/**\n * @deprecated Use `algorand.app.compileTeal` instead.\n *\n * Compiles the given TEAL using algod and returns the result, including source map.\n *\n * @param algod An algod client\n * @param tealCode The TEAL code\n * @returns The information about the compiled file\n */\nexport async function compileTeal(tealCode: string, algod: Algodv2): Promise<CompiledTeal> {\n return await new AppManager(algod).compileTeal(tealCode)\n}\n\n/**\n * @deprecated Use `abiMethod.getSignature()` or `new ABIMethod(abiMethodParams).getSignature()` instead.\n *\n * Returns the encoded ABI spec for a given ABI Method\n * @param method The method to return a signature for\n * @returns The encoded ABI method spec e.g. `method_name(uint64,string)string`\n */\nexport const getABIMethodSignature = (method: ABIMethodParams | ABIMethod) => {\n return 'getSignature' in method ? method.getSignature() : new ABIMethod(method).getSignature()\n}\n"],"names":["legacySendAppTransactionBridge","getSenderAddress","AppManager","encodeLease","_getAppArgsForABICall","_getBoxReference","toNumber"],"mappings":";;;;;;;;AA0BA,IAAO,SAAS,GAAG,OAAO,CAAC,SAAS,CAAA;AAMpC,IAAO,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAA;AAE5D;;;;;;;;AAQG;AACI,eAAe,SAAS,CAC7B,MAAuB,EACvB,KAAc,EAAA;IAEd,MAAM,UAAU,GAAG,sBAAsB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA;IAClE,IAAI,UAAU,KAAK,OAAO,CAAC,qBAAqB,CAAC,YAAY,EAAE;AAC7D,QAAA,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAA;KAC9E;AAED,IAAA,MAAM,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,MAAM;AAChC,UAAE,MAAMA,2CAA8B,CAClC,KAAK,EACL,MAAM,CAAC,IAAI,EACX,MAAM,CAAC,IAAI,EACX,MAAM,EACN;AACE,YAAA,MAAM,EAAEC,4BAAgB,CAAC,MAAM,CAAC,IAAI,CAAC;YACrC,UAAU;YACV,eAAe,EAAE,MAAM,CAAC,eAAe;YACvC,iBAAiB,EAAE,MAAM,CAAC,iBAAiB;YAC3C,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,MAAM,YAAY,SAAS,GAAG,MAAM,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M,GAAG,MAAM,CAAC,YAAY,EAAE,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,YAAY,EAAE,CAAA;AAChG;;;;;;;;;;;;;;;;;;;;;;"}
package/src/app.mjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"app.mjs","sources":["../../src/app.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { _getAppArgsForABICall, _getBoxReference, legacySendAppTransactionBridge } from './transaction/legacy-bridge'\nimport { encodeLease, getSenderAddress } from './transaction/transaction'\nimport {\n ABIAppCallArgs,\n ABIReturn,\n AppCallArgs,\n AppCallParams,\n AppCallTransactionResult,\n AppCallType,\n AppCompilationResult,\n AppReference,\n AppState,\n BoxIdentifier,\n BoxName,\n BoxReference,\n BoxValueRequestParams,\n BoxValuesRequestParams,\n CompiledTeal,\n CreateAppParams,\n RawAppCallArgs,\n UpdateAppParams,\n} from './types/app'\nimport { AppManager } from './types/app-manager'\nimport { SendTransactionFrom } from './types/transaction'\nimport { toNumber } from './util'\nimport ABIMethod = algosdk.ABIMethod\nimport ABIMethodParams = algosdk.ABIMethodParams\nimport ABIValue = algosdk.ABIValue\nimport Address = algosdk.Address\nimport Algodv2 = algosdk.Algodv2\nimport modelsv2 = algosdk.modelsv2\nimport OnApplicationComplete = algosdk.OnApplicationComplete\n\n/**\n * @deprecated Use `algorand.send.appCreate()` / `algorand.createTransaction.appCreate()` / `algorand.send.appCreateMethodCall()`\n * / `algorand.createTransaction.appCreateMethodCall()` instead\n *\n * Creates a smart contract app, returns the details of the created app.\n * @param create The parameters to create the app with\n * @param algod An algod client\n * @returns The details of the created app, or the transaction to create it if `skipSending` and the compilation result\n */\nexport async function createApp(\n create: CreateAppParams,\n algod: Algodv2,\n): Promise<Partial<AppCompilationResult> & AppCallTransactionResult & AppReference> {\n const onComplete = getAppOnCompleteAction(create.onCompleteAction)\n if (onComplete === algosdk.OnApplicationComplete.ClearStateOC) {\n throw new Error('Cannot create an app with on-complete action of ClearState')\n }\n\n const result = create.args?.method\n ? await legacySendAppTransactionBridge(\n algod,\n create.from,\n create.args,\n create,\n {\n sender: getSenderAddress(create.from),\n onComplete,\n approvalProgram: create.approvalProgram,\n clearStateProgram: create.clearStateProgram,\n method: create.args.method instanceof ABIMethod ? create.args.method : new ABIMethod(create.args.method),\n extraProgramPages: create.schema.extraPages,\n schema: create.schema,\n },\n (c) => c.appCreateMethodCall,\n (c) => c.appCreateMethodCall,\n )\n : await legacySendAppTransactionBridge(\n algod,\n create.from,\n create.args,\n create,\n {\n sender: getSenderAddress(create.from),\n onComplete,\n approvalProgram: create.approvalProgram,\n clearStateProgram: create.clearStateProgram,\n extraProgramPages: create.schema.extraPages,\n schema: create.schema,\n },\n (c) => c.appCreate,\n (c) => c.appCreate,\n )\n\n return {\n ...result,\n appId: 'appId' in result ? Number(result.appId) : 0,\n appAddress: 'appAddress' in result ? result.appAddress.toString() : '',\n }\n}\n\n/**\n * @deprecated Use `algorand.send.appUpdate()` / `algorand.createTransaction.appUpdate()` / `algorand.send.appUpdateMethodCall()`\n * / `algorand.createTransaction.appUpdateMethodCall()` instead\n *\n * Updates a smart contract app.\n * @param update The parameters to update the app with\n * @param algod An algod client\n * @returns The transaction send result and the compilation result\n */\nexport async function updateApp(\n update: UpdateAppParams,\n algod: Algodv2,\n): Promise<Partial<AppCompilationResult> & AppCallTransactionResult> {\n return update.args?.method\n ? await legacySendAppTransactionBridge(\n algod,\n update.from,\n update.args,\n update,\n {\n appId: BigInt(update.appId),\n sender: getSenderAddress(update.from),\n onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n approvalProgram: update.approvalProgram,\n clearStateProgram: update.clearStateProgram,\n method: update.args.method instanceof ABIMethod ? update.args.method : new ABIMethod(update.args.method),\n },\n (c) => c.appUpdateMethodCall,\n (c) => c.appUpdateMethodCall,\n )\n : await legacySendAppTransactionBridge(\n algod,\n update.from,\n update.args,\n update,\n {\n appId: BigInt(update.appId),\n sender: getSenderAddress(update.from),\n onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n approvalProgram: update.approvalProgram,\n clearStateProgram: update.clearStateProgram,\n },\n (c) => c.appUpdate,\n (c) => c.appUpdate,\n )\n}\n\n/**\n * @deprecated Use `algosdk.OnApplicationComplete` directly instead.\n *\n * Returns a `algosdk.OnApplicationComplete` for the given onCompleteAction.\n *\n * If given `undefined` will return `OnApplicationComplete.NoOpOC`.\n *\n * If given an `AppCallType` will convert the string enum to the correct underlying `algosdk.OnApplicationComplete`.\n *\n * @param onCompletionAction The on completion action\n * @returns The `algosdk.OnApplicationComplete`\n */\nexport function getAppOnCompleteAction(onCompletionAction?: AppCallType | OnApplicationComplete) {\n switch (onCompletionAction) {\n case undefined:\n case 'no_op':\n case OnApplicationComplete.NoOpOC:\n return OnApplicationComplete.NoOpOC\n case 'opt_in':\n case OnApplicationComplete.OptInOC:\n return OnApplicationComplete.OptInOC\n case 'close_out':\n case OnApplicationComplete.CloseOutOC:\n return OnApplicationComplete.CloseOutOC\n case 'clear_state':\n case OnApplicationComplete.ClearStateOC:\n return OnApplicationComplete.ClearStateOC\n case 'update_application':\n case OnApplicationComplete.UpdateApplicationOC:\n return OnApplicationComplete.UpdateApplicationOC\n case 'delete_application':\n case OnApplicationComplete.DeleteApplicationOC:\n return OnApplicationComplete.DeleteApplicationOC\n }\n}\n\n/**\n * @deprecated Use `algorand.send.appUpdate()` / `algorand.createTransaction.appUpdate()` / `algorand.send.appUpdateMethodCall()`\n * / `algorand.createTransaction.appUpdateMethodCall()` instead\n *\n * Issues a call to a given app.\n * @param call The call details.\n * @param algod An algod client\n * @returns The result of the call\n */\nexport async function callApp(call: AppCallParams, algod: Algodv2): Promise<AppCallTransactionResult> {\n const onComplete = getAppOnCompleteAction(call.callType)\n if (onComplete === algosdk.OnApplicationComplete.UpdateApplicationOC) {\n throw new Error('Cannot execute an app call with on-complete action of Update')\n }\n if (call.args?.method && onComplete === algosdk.OnApplicationComplete.ClearStateOC) {\n throw new Error('Cannot execute an ABI method call with on-complete action of ClearState')\n }\n\n return call.args?.method\n ? await legacySendAppTransactionBridge(\n algod,\n call.from,\n call.args,\n call,\n {\n appId: BigInt(call.appId),\n sender: getSenderAddress(call.from),\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n onComplete: onComplete as any,\n method: call.args.method instanceof ABIMethod ? call.args.method : new ABIMethod(call.args.method),\n },\n (c) => c.appCallMethodCall,\n (c) => c.appCallMethodCall,\n )\n : await legacySendAppTransactionBridge(\n algod,\n call.from,\n call.args,\n call,\n {\n appId: BigInt(call.appId),\n sender: getSenderAddress(call.from),\n onComplete,\n },\n (c) => c.appCall,\n (c) => c.appCall,\n )\n}\n\n/**\n * @deprecated Use `AppManager.getABIReturn` instead.\n *\n * Returns any ABI return values for the given app call arguments and transaction confirmation.\n * @param args The arguments that were used for the call\n * @param confirmation The transaction confirmation from algod\n * @returns The return value for the method call\n */\nexport function getABIReturn(args?: AppCallArgs, confirmation?: modelsv2.PendingTransactionResponse): ABIReturn | undefined {\n if (!args || !args.method) {\n return undefined\n }\n const method = 'txnCount' in args.method ? args.method : new ABIMethod(args.method)\n\n return AppManager.getABIReturn(confirmation, method)\n}\n\n/**\n * @deprecated Use `algorand.app.getGlobalState` instead.\n *\n * Returns the current global state values for the given app ID\n * @param appId The ID of the app return global state for\n * @param algod An algod client instance\n * @returns The current global state\n */\nexport async function getAppGlobalState(appId: number | bigint, algod: Algodv2) {\n return await new AppManager(algod).getGlobalState(BigInt(appId))\n}\n\n/**\n * @deprecated Use `algorand.app.getLocalState` instead.\n *\n * Returns the current global state values for the given app ID and account\n * @param appId The ID of the app return global state for\n * @param account Either the string address of an account or an account object for the account to get local state for the given app\n * @param algod An algod client instance\n * @returns The current local state for the given (app, account) combination\n */\nexport async function getAppLocalState(appId: number | bigint, account: string | SendTransactionFrom, algod: Algodv2) {\n return new AppManager(algod).getLocalState(BigInt(appId), getSenderAddress(account))\n}\n\n/**\n * @deprecated Use `algorand.app.getBoxNames` instead.\n * Returns the names of the boxes for the given app.\n * @param appId The ID of the app return box names for\n * @param algod An algod client instance\n * @returns The current box names\n */\nexport async function getAppBoxNames(appId: number | bigint, algod: Algodv2): Promise<BoxName[]> {\n return new AppManager(algod).getBoxNames(BigInt(appId))\n}\n\n/**\n * @deprecated Use `algorand.app.getBoxValue` instead.\n * Returns the value of the given box name for the given app.\n * @param appId The ID of the app return box names for\n * @param boxName The name of the box to return either as a string, binary array or `BoxName`\n * @param algod An algod client instance\n * @returns The current box value as a byte array\n */\nexport async function getAppBoxValue(appId: number | bigint, boxName: string | Uint8Array | BoxName, algod: Algodv2): Promise<Uint8Array> {\n return new AppManager(algod).getBoxValue(BigInt(appId), typeof boxName !== 'string' && 'name' in boxName ? boxName.nameRaw : boxName)\n}\n\n/**\n * @deprecated Use `algorand.app.getBoxValues` instead.\n * Returns the value of the given box names for the given app.\n * @param appId The ID of the app return box names for\n * @param boxNames The names of the boxes to return either as a string, binary array or `BoxName`\n * @param algod An algod client instance\n * @returns The current box values as a byte array in the same order as the passed in box names\n */\nexport async function getAppBoxValues(appId: number, boxNames: (string | Uint8Array | BoxName)[], algod: Algodv2): Promise<Uint8Array[]> {\n return new AppManager(algod).getBoxValues(\n BigInt(appId),\n boxNames.map((b) => (typeof b !== 'string' && 'name' in b ? b.nameRaw : b)),\n )\n}\n\n/**\n * @deprecated Use `algorand.app.getBoxValueFromABIType` instead.\n * Returns the value of the given box name for the given app decoded based on the given ABI type.\n * @param request The parameters for the box value request\n * @param algod An algod client instance\n * @returns The current box value as an ABI value\n */\nexport async function getAppBoxValueFromABIType(request: BoxValueRequestParams, algod: Algodv2): Promise<ABIValue> {\n return new AppManager(algod).getBoxValueFromABIType({\n appId: BigInt(request.appId),\n boxName: typeof request.boxName !== 'string' && 'name' in request.boxName ? request.boxName.nameRaw : request.boxName,\n type: request.type,\n })\n}\n\n/**\n * @deprecated Use `algorand.app.getBoxValuesFromABIType` instead.\n * Returns the value of the given box names for the given app decoded based on the given ABI type.\n * @param request The parameters for the box value request\n * @param algod An algod client instance\n * @returns The current box values as an ABI value in the same order as the passed in box names\n */\nexport async function getAppBoxValuesFromABIType(request: BoxValuesRequestParams, algod: Algodv2): Promise<ABIValue[]> {\n return new AppManager(algod).getBoxValuesFromABIType({\n appId: BigInt(request.appId),\n boxNames: request.boxNames.map((b) => (typeof b !== 'string' && 'name' in b ? b.nameRaw : b)),\n type: request.type,\n })\n}\n\n/**\n * @deprecated Use `AppManager.decodeAppState` instead.\n *\n * Converts an array of global/local state values from the algod api to a more friendly\n * generic object keyed by the UTF-8 value of the key.\n * @param state A `global-state`, `local-state`, `global-state-deltas` or `local-state-deltas`\n * @returns An object keyeed by the UTF-8 representation of the key with various parsings of the values\n */\nexport function decodeAppState(state: { key: string; value: modelsv2.TealValue | modelsv2.EvalDelta }[]): AppState {\n return AppManager.decodeAppState(state.map(({ key, value }) => ({ key: Buffer.from(key, 'utf-8'), value })))\n}\n\n/**\n * @deprecated Use `TransactionComposer` methods to construct transactions instead.\n *\n * Returns the app args ready to load onto an app `Transaction` object\n * @param args The app call args\n * @returns The args ready to load into a `Transaction`\n */\nexport function getAppArgsForTransaction(args?: RawAppCallArgs) {\n if (!args) return undefined\n\n const encoder = new TextEncoder()\n return {\n accounts: args?.accounts?.map(_getAccountAddress),\n appArgs: args?.appArgs?.map((a) => (typeof a === 'string' ? encoder.encode(a) : a)),\n boxes: args.boxes?.map(getBoxReference),\n foreignApps: args?.apps,\n foreignAssets: args?.assets,\n lease: encodeLease(args?.lease),\n }\n}\n\n/**\n * @deprecated Use `TransactionComposer` methods to construct transactions instead.\n *\n * Returns the app args ready to load onto an ABI method call in `AtomicTransactionComposer`\n * @param args The ABI app call args\n * @param from The transaction signer\n * @returns The parameters ready to pass into `addMethodCall` within AtomicTransactionComposer\n */\nexport async function getAppArgsForABICall(args: ABIAppCallArgs, from: SendTransactionFrom) {\n return _getAppArgsForABICall(args, from)\n}\n\n/**\n * @deprecated Use `AppManager.getBoxReference()` instead.\n *\n * Returns a `algosdk.BoxReference` given a `BoxIdentifier` or `BoxReference`.\n * @param box The box to return a reference for\n * @returns The box reference ready to pass into a `Transaction`\n */\nexport function getBoxReference(box: BoxIdentifier | BoxReference | algosdk.BoxReference): algosdk.BoxReference {\n return _getBoxReference(box)\n}\n\nfunction _getAccountAddress(account: string | Address) {\n return typeof account === 'string' ? account : algosdk.encodeAddress(account.publicKey)\n}\n\n/**\n * @deprecated Use `algorand.app.getById` instead.\n *\n * Gets the current data for the given app from algod.\n *\n * @param appId The id of the app\n * @param algod An algod client\n * @returns The data about the app\n */\nexport async function getAppById(appId: number | bigint, algod: Algodv2) {\n return await algod.getApplicationByID(toNumber(appId)).do()\n}\n\n/**\n * @deprecated Use `algorand.app.compileTeal` instead.\n *\n * Compiles the given TEAL using algod and returns the result, including source map.\n *\n * @param algod An algod client\n * @param tealCode The TEAL code\n * @returns The information about the compiled file\n */\nexport async function compileTeal(tealCode: string, algod: Algodv2): Promise<CompiledTeal> {\n return await new AppManager(algod).compileTeal(tealCode)\n}\n\n/**\n * @deprecated Use `abiMethod.getSignature()` or `new ABIMethod(abiMethodParams).getSignature()` instead.\n *\n * Returns the encoded ABI spec for a given ABI Method\n * @param method The method to return a signature for\n * @returns The encoded ABI method spec e.g. `method_name(uint64,string)string`\n */\nexport const getABIMethodSignature = (method: ABIMethodParams | ABIMethod) => {\n return 'getSignature' in method ? method.getSignature() : new ABIMethod(method).getSignature()\n}\n"],"names":[],"mappings":";;;;;;AA0BA,IAAO,SAAS,GAAG,OAAO,CAAC,SAAS,CAAA;AAMpC,IAAO,qBAAqB,GAAG,OAAO,CAAC,qBAAqB,CAAA;AAE5D;;;;;;;;AAQG;AACI,eAAe,SAAS,CAC7B,MAAuB,EACvB,KAAc,EAAA;IAEd,MAAM,UAAU,GAAG,sBAAsB,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAA;IAClE,IAAI,UAAU,KAAK,OAAO,CAAC,qBAAqB,CAAC,YAAY,EAAE;AAC7D,QAAA,MAAM,IAAI,KAAK,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rE,IAAA,OAAO,MAAM,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAA;AAC7D,CAAC;AAED;;;;;;;;AAQG;AACI,eAAe,WAAW,CAAC,QAAgB,EAAE,KAAc,EAAA;IAChE,OAAO,MAAM,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,QAAQ,CAAC,CAAA;AAC1D,CAAC;AAED;;;;;;AAMG;AACU,MAAA,qBAAqB,GAAG,CAAC,MAAmC,KAAI;IAC3E,OAAO,cAAc,IAAI,MAAM,GAAG,MAAM,CAAC,YAAY,EAAE,GAAG,IAAI,SAAS,CAAC,MAAM,CAAC,CAAC,YAAY,EAAE,CAAA;AAChG;;;;"}
package/src/asset.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"asset.js","sources":["../../src/asset.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { encodeTransactionNote, getSenderAddress } from './transaction'\nimport { legacySendTransactionBridge } from './transaction/legacy-bridge'\nimport { AlgorandClient } from './types/algorand-client'\nimport { AssetBulkOptInOutParams, AssetOptInParams, AssetOptOutParams, CreateAssetParams } from './types/asset'\nimport { AssetCreateParams, AssetOptInParams as NewAssetOptInParams, AssetOptOutParams as NewAssetOptOutParams } from './types/composer'\nimport { SendTransactionResult } from './types/transaction'\nimport Algodv2 = algosdk.Algodv2\n\n/**\n * @deprecated use `algorand.send.assetCreate()` / `algorand.createTransaction.assetCreate()` instead\n *\n * Create an Algorand Standard Asset (ASA).\n * @param create The asset creation definition\n * @param algod An algod client\n * @returns The transaction object and optionally the confirmation if it was sent to the chain (`skipSending` is `false` or unset)\n *\n * @example Usage example\n * ```typescript\n * await algokit.createAsset({ creator: account, total: 1, decimals: 0, name: 'My asset' }, algod)\n * ```\n */\nexport async function createAsset(\n create: CreateAssetParams,\n algod: Algodv2,\n): Promise<SendTransactionResult & { confirmation?: { assetIndex: number | bigint } }> {\n const params: AssetCreateParams = {\n sender: getSenderAddress(create.creator),\n total: BigInt(create.total),\n decimals: create.decimals,\n assetName: create.name,\n unitName: create.unit,\n manager: create.manager ? getSenderAddress(create.manager) : undefined,\n clawback: create.clawbackAccount ? getSenderAddress(create.clawbackAccount) : undefined,\n freeze: create.freezeAccount ? getSenderAddress(create.freezeAccount) : undefined,\n reserve: create.reserveAccount ? getSenderAddress(create.reserveAccount) : undefined,\n defaultFrozen: create.frozenByDefault,\n lease: create.lease,\n metadataHash: create.metadataHash,\n note: encodeTransactionNote(create.note),\n url: create.url,\n }\n\n return (await legacySendTransactionBridge(\n algod,\n create.creator,\n create,\n params,\n (client) => client.assetCreate,\n (client) => client.assetCreate,\n )) as SendTransactionResult & { confirmation: { assetIndex: number | bigint } }\n}\n\n/**\n * @deprecated use `algorand.send.assetOptIn()` / `algorand.createTransaction.assetOptIn()` instead\n *\n * Opt-in an account to an asset.\n * @param optIn The opt-in definition\n * @param algod An algod client\n * @returns The transaction object and optionally the confirmation if it was sent to the chain (`skipSending` is `false` or unset)\n *\n * @example Usage example\n * ```typescript\n * await algokit.assetOptIn({ account, assetId }, algod)\n * ```\n */\nexport async function assetOptIn(optIn: AssetOptInParams, algod: Algodv2): Promise<SendTransactionResult> {\n const params: NewAssetOptInParams = {\n assetId: BigInt(optIn.assetId),\n sender: getSenderAddress(optIn.account),\n note: encodeTransactionNote(optIn.note),\n lease: optIn.lease,\n }\n\n return legacySendTransactionBridge(\n algod,\n optIn.account,\n optIn,\n params,\n (c) => c.assetOptIn,\n (c) => c.assetOptIn,\n )\n}\n\n/**\n * @deprecated use `algorand.send.assetOptOut()` / `algorand.createTransaction.assetOptOut()` instead\n *\n * Opt-out an account from an asset.\n * @param optOut The opt-in definition\n * @param algod An algod client\n * @returns The transaction object and optionally the confirmation if it was sent to the chain (`skipSending` is `false` or unset)\n *\n * @example Usage example\n * ```typescript\n * await algokit.assetOptOut({ account, assetId, assetCreatorAddress }, algod)\n * ```\n */\nexport async function assetOptOut(optOut: AssetOptOutParams, algod: Algodv2): Promise<SendTransactionResult> {\n const assetCreatorAddress = optOut.assetCreatorAddress ?? (await algod.getAssetByID(optOut.assetId).do()).params.creator\n\n const params: NewAssetOptOutParams = {\n assetId: BigInt(optOut.assetId),\n creator: assetCreatorAddress,\n sender: getSenderAddress(optOut.account),\n note: encodeTransactionNote(optOut.note),\n lease: optOut.lease,\n }\n\n return legacySendTransactionBridge(\n algod,\n optOut.account,\n optOut,\n params,\n (c) => c.assetOptOut,\n (c) => (params: NewAssetOptOutParams) => c.assetOptOut({ ...params, ensureZeroBalance: optOut.ensureZeroBalance ?? true }),\n )\n}\n\n/**\n * @deprecated use `algorand.asset.bulkOptIn()` instead\n *\n * Opt in to a list of assets on the Algorand blockchain.\n *\n * @param optIn - The bulk opt-in request.\n * @param algod - An instance of the Algodv2 class from the `algosdk` library.\n * @returns A record object where the keys are the asset IDs and the values are the corresponding transaction IDs for successful opt-ins.\n * @throws If there is an error during the opt-in process.\n * @example algokit.bulkOptIn({ account: account, assetIds: [12345, 67890] }, algod)\n */\nexport async function assetBulkOptIn(optIn: AssetBulkOptInOutParams, algod: Algodv2): Promise<Record<number, string>> {\n const result = await AlgorandClient.fromClients({ algod })\n .setSignerFromAccount(optIn.account)\n .asset.bulkOptIn(getSenderAddress(optIn.account), optIn.assetIds.map(BigInt), {\n note: encodeTransactionNote(optIn.note),\n maxFee: optIn.maxFee,\n suppressLog: optIn.suppressLog,\n })\n\n const returnResult: Record<number, string> = {}\n for (const r of result) {\n returnResult[Number(r.assetId)] = r.transactionId\n }\n return returnResult\n}\n\n/**\n * @deprecated use `algorand.asset.bulkOptOut()` instead\n *\n * Opt out of multiple assets in Algorand blockchain.\n *\n * @param optOut The bulk opt-out request.\n * @param algod - An instance of the Algodv2 client used to interact with the Algorand blockchain.\n * @returns A record object containing asset IDs as keys and their corresponding transaction IDs as values.\n * @throws If there is an error during the opt-out process.\n * @example algokit.bulkOptOut({ account: account, assetIds: [12345, 67890] }, algod)\n */\nexport async function assetBulkOptOut(optOut: AssetBulkOptInOutParams, algod: Algodv2): Promise<Record<number, string>> {\n const result = await AlgorandClient.fromClients({ algod })\n .setSignerFromAccount(optOut.account)\n .asset.bulkOptOut(getSenderAddress(optOut.account), optOut.assetIds.map(BigInt), {\n ensureZeroBalance: optOut.validateBalances ?? true,\n note: encodeTransactionNote(optOut.note),\n maxFee: optOut.maxFee,\n suppressLog: optOut.suppressLog,\n })\n\n const returnResult: Record<number, string> = {}\n for (const r of result) {\n returnResult[Number(r.assetId)] = r.transactionId\n }\n return returnResult\n}\n"],"names":["getSenderAddress","encodeTransactionNote","legacySendTransactionBridge","AlgorandClient"],"mappings":";;;;;;AASA;;;;;;;;;;;;AAYG;AACI,eAAe,WAAW,CAC/B,MAAyB,EACzB,KAAc,EAAA;AAEd,IAAA,MAAM,MAAM,GAAsB;AAChC,QAAA,MAAM,EAAEA,4BAAgB,CAAC,MAAM,CAAC,OAAO,CAAC;AACxC,QAAA,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;QAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,SAAS,EAAE,MAAM,CAAC,IAAI;QACtB,QAAQ,EAAE,MAAM,CAAC,IAAI;AACrB,QAAA,OAAO,EAAE,MAAM,CAAC,OAAO,GAAGA,4BAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,SAAS;AACtE,QAAA,QAAQ,EAAE,MAAM,CAAC,eAAe,GAAGA,4BAAgB,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,SAAS;AACvF,QAAA,MAAM,EAAE,MAAM,CAAC,aAAa,GAAGA,4BAAgB,CAAC,MAAM,CAAC,aAAa,CAAC,GAAG,SAAS;AACjF,QAAA,OAAO,EAAE,MAAM,CAAC,cAAc,GAAGA,4BAAgB,CAAC,MAAM,CAAC,cAAc,CAAC,GAAG,SAAS;QACpF,aAAa,EAAE,MAAM,CAAC,eAAe;QACrC,KAAK,EAAE,MAAM,CAAC,KAAK;Q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Ae,eAAe,CAAC,MAA+B,EAAE,KAAc,EAAA;IACnF,MAAM,MAAM,GAAG,MAAME,mCAAc,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC;AACvD,SAAA,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC;AACpC,SAAA,KAAK,CAAC,UAAU,CAACH,4BAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;AAC/E,QAAA,iBAAiB,EAAE,MAAM,CAAC,gBAAgB,IAAI,IAAI;AAClD,QAAA,IAAI,EAAEC,iCAAqB,CAAC,MAAM,CAAC,IAAI,CAAC;QACxC,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,WAAW,EAAE,MAAM,CAAC,WAAW;AAChC,KAAA,CAAC,CAAA;IAEJ,MAAM,YAAY,GAA2B,EAAE,CAAA;AAC/C,IAAA,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;AACtB,QAAA,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,aAAa,CAAA;KAClD;AACD,IAAA,OAAO,YAAY,CAAA;AACrB;;;;;;;;"}
package/src/asset.mjs.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"asset.mjs","sources":["../../src/asset.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { encodeTransactionNote, getSenderAddress } from './transaction'\nimport { legacySendTransactionBridge } from './transaction/legacy-bridge'\nimport { AlgorandClient } from './types/algorand-client'\nimport { AssetBulkOptInOutParams, AssetOptInParams, AssetOptOutParams, CreateAssetParams } from './types/asset'\nimport { AssetCreateParams, AssetOptInParams as NewAssetOptInParams, AssetOptOutParams as NewAssetOptOutParams } from './types/composer'\nimport { SendTransactionResult } from './types/transaction'\nimport Algodv2 = algosdk.Algodv2\n\n/**\n * @deprecated use `algorand.send.assetCreate()` / `algorand.createTransaction.assetCreate()` instead\n *\n * Create an Algorand Standard Asset (ASA).\n * @param create The asset creation definition\n * @param algod An algod client\n * @returns The transaction object and optionally the confirmation if it was sent to the chain (`skipSending` is `false` or unset)\n *\n * @example Usage example\n * ```typescript\n * await algokit.createAsset({ creator: account, total: 1, decimals: 0, name: 'My asset' }, algod)\n * ```\n */\nexport async function createAsset(\n create: CreateAssetParams,\n algod: Algodv2,\n): Promise<SendTransactionResult & { confirmation?: { assetIndex: number | bigint } }> {\n const params: AssetCreateParams = {\n sender: getSenderAddress(create.creator),\n total: BigInt(create.total),\n decimals: create.decimals,\n assetName: create.name,\n unitName: create.unit,\n manager: create.manager ? getSenderAddress(create.manager) : undefined,\n clawback: create.clawbackAccount ? getSenderAddress(create.clawbackAccount) : undefined,\n freeze: create.freezeAccount ? getSenderAddress(create.freezeAccount) : undefined,\n reserve: create.reserveAccount ? getSenderAddress(create.reserveAccount) : undefined,\n defaultFrozen: create.frozenByDefault,\n lease: create.lease,\n metadataHash: create.metadataHash,\n note: encodeTransactionNote(create.note),\n url: create.url,\n }\n\n return (await legacySendTransactionBridge(\n algod,\n create.creator,\n create,\n params,\n (client) => client.assetCreate,\n (client) => client.assetCreate,\n )) as SendTransactionResult & { confirmation: { assetIndex: number | bigint } }\n}\n\n/**\n * @deprecated use `algorand.send.assetOptIn()` / `algorand.createTransaction.assetOptIn()` instead\n *\n * Opt-in an account to an asset.\n * @param optIn The opt-in definition\n * @param algod An algod client\n * @returns The transaction object and optionally the confirmation if it was sent to the chain (`skipSending` is `false` or unset)\n *\n * @example Usage example\n * ```typescript\n * await algokit.assetOptIn({ account, assetId }, algod)\n * ```\n */\nexport async function assetOptIn(optIn: AssetOptInParams, algod: Algodv2): Promise<SendTransactionResult> {\n const params: NewAssetOptInParams = {\n assetId: BigInt(optIn.assetId),\n sender: getSenderAddress(optIn.account),\n note: encodeTransactionNote(optIn.note),\n lease: optIn.lease,\n }\n\n return legacySendTransactionBridge(\n algod,\n optIn.account,\n optIn,\n params,\n (c) => c.assetOptIn,\n (c) => c.assetOptIn,\n )\n}\n\n/**\n * @deprecated use `algorand.send.assetOptOut()` / `algorand.createTransaction.assetOptOut()` instead\n *\n * Opt-out an account from an asset.\n * @param optOut The opt-in definition\n * @param algod An algod client\n * @returns The transaction object and optionally the confirmation if it was sent to the chain (`skipSending` is `false` or unset)\n *\n * @example Usage example\n * ```typescript\n * await algokit.assetOptOut({ account, assetId, assetCreatorAddress }, algod)\n * ```\n */\nexport async function assetOptOut(optOut: AssetOptOutParams, algod: Algodv2): Promise<SendTransactionResult> {\n const assetCreatorAddress = optOut.assetCreatorAddress ?? (await algod.getAssetByID(optOut.assetId).do()).params.creator\n\n const params: NewAssetOptOutParams = {\n assetId: BigInt(optOut.assetId),\n creator: assetCreatorAddress,\n sender: getSenderAddress(optOut.account),\n note: encodeTransactionNote(optOut.note),\n lease: optOut.lease,\n }\n\n return legacySendTransactionBridge(\n algod,\n optOut.account,\n optOut,\n params,\n (c) => c.assetOptOut,\n (c) => (params: NewAssetOptOutParams) => c.assetOptOut({ ...params, ensureZeroBalance: optOut.ensureZeroBalance ?? true }),\n )\n}\n\n/**\n * @deprecated use `algorand.asset.bulkOptIn()` instead\n *\n * Opt in to a list of assets on the Algorand blockchain.\n *\n * @param optIn - The bulk opt-in request.\n * @param algod - An instance of the Algodv2 class from the `algosdk` library.\n * @returns A record object where the keys are the asset IDs and the values are the corresponding transaction IDs for successful opt-ins.\n * @throws If there is an error during the opt-in process.\n * @example algokit.bulkOptIn({ account: account, assetIds: [12345, 67890] }, algod)\n */\nexport async function assetBulkOptIn(optIn: AssetBulkOptInOutParams, algod: Algodv2): Promise<Record<number, string>> {\n const result = await AlgorandClient.fromClients({ algod })\n .setSignerFromAccount(optIn.account)\n .asset.bulkOptIn(getSenderAddress(optIn.account), optIn.assetIds.map(BigInt), {\n note: encodeTransactionNote(optIn.note),\n maxFee: optIn.maxFee,\n suppressLog: optIn.suppressLog,\n })\n\n const returnResult: Record<number, string> = {}\n for (const r of result) {\n returnResult[Number(r.assetId)] = r.transactionId\n }\n return returnResult\n}\n\n/**\n * @deprecated use `algorand.asset.bulkOptOut()` instead\n *\n * Opt out of multiple assets in Algorand blockchain.\n *\n * @param optOut The bulk opt-out request.\n * @param algod - An instance of the Algodv2 client used to interact with the Algorand blockchain.\n * @returns A record object containing asset IDs as keys and their corresponding transaction IDs as values.\n * @throws If there is an error during the opt-out process.\n * @example algokit.bulkOptOut({ account: account, assetIds: [12345, 67890] }, algod)\n */\nexport async function assetBulkOptOut(optOut: AssetBulkOptInOutParams, algod: Algodv2): Promise<Record<number, string>> {\n const result = await AlgorandClient.fromClients({ algod })\n .setSignerFromAccount(optOut.account)\n .asset.bulkOptOut(getSenderAddress(optOut.account), optOut.assetIds.map(BigInt), {\n ensureZeroBalance: optOut.validateBalances ?? true,\n note: encodeTransactionNote(optOut.note),\n maxFee: optOut.maxFee,\n suppressLog: optOut.suppressLog,\n })\n\n const returnResult: Record<number, string> = {}\n for (const r of result) {\n returnResult[Number(r.assetId)] = r.transactionId\n }\n return returnResult\n}\n"],"names":[],"mappings":";;;;AASA;;;;;;;;;;;;AAYG;AACI,eAAe,WAAW,CAC/B,MAAyB,EACzB,KAAc,EAAA;AAEd,IAAA,MAAM,MAAM,GAAsB;AAChC,QAAA,MAAM,EAAE,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC;AACxC,QAAA,KAAK,EAAE,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC;QAC3B,QAAQ,EAAE,MAAM,CAAC,QAAQ;QACzB,SAAS,EAAE,MAAM,CAAC,IAAI;QACtB,QAAQ,EAAE,MAAM,CAAC,IAAI;AACrB,QAAA,OAAO,EAAE,MAAM,CAAC,OAAO,GAAG,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,GAAG,SAAS;AACtE,QAAA,QAAQ,EAAE,MAAM,CAAC,eAAe,GAAG,gBAAgB,CAAC,MAAM,CAAC,eAAe,CAAC,GAAG,SAAS;AACvF,QAAA,MAAM,EAAE,MAAM,CAAC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;AAC/C,IAAA,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;AACtB,QAAA,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,aAAa,CAAA;KAClD;AACD,IAAA,OAAO,YAAY,CAAA;AACrB,CAAC;AAED;;;;;;;;;;AAUG;AACI,eAAe,eAAe,CAAC,MAA+B,EAAE,KAAc,EAAA;IACnF,MAAM,MAAM,GAAG,MAAM,cAAc,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC;AACvD,SAAA,oBAAoB,CAAC,MAAM,CAAC,OAAO,CAAC;AACpC,SAAA,KAAK,CAAC,UAAU,CAAC,gBAAgB,CAAC,MAAM,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC,QAAQ,CAAC,GAAG,CAAC,MAAM,CAAC,EAAE;AAC/E,QAAA,iBAAiB,EAAE,MAAM,CAAC,gBAAgB,IAAI,IAAI;AAClD,QAAA,IAAI,EAAE,qBAAqB,CAAC,MAAM,CAAC,IAAI,CAAC;QACxC,MAAM,EAAE,MAAM,CAAC,MAAM;QACrB,WAAW,EAAE,MAAM,CAAC,WAAW;AAChC,KAAA,CAAC,CAAA;IAEJ,MAAM,YAAY,GAA2B,EAAE,CAAA;AAC/C,IAAA,KAAK,MAAM,CAAC,IAAI,MAAM,EAAE;AACtB,QAAA,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,aAAa,CAAA;KAClD;AACD,IAAA,OAAO,YAAY,CAAA;AACrB;;;;"}
package/src/config.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.js","sources":["../../src/config.ts"],"sourcesContent":["import { UpdatableConfig } from './types/config'\n\n/** The AlgoKit config. To update it use the configure method. */\nexport const Config = new UpdatableConfig()\n"],"names":["UpdatableConfig"],"mappings":";;;;AAEA;AACa,MAAA,MAAM,GAAG,IAAIA,4BAAe;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"config.mjs","sources":["../../src/config.ts"],"sourcesContent":["import { UpdatableConfig } from './types/config'\n\n/** The AlgoKit config. To update it use the configure method. */\nexport const Config = new UpdatableConfig()\n"],"names":[],"mappings":";;AAEA;AACa,MAAA,MAAM,GAAG,IAAI,eAAe;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"debugging.js","sources":["../../../src/debugging/debugging.ts"],"sourcesContent":["/**\n * @deprecated Use latest version of `AlgoKit AVM Debugger` VSCode extension instead. It will automatically manage your sourcemaps.\n *\n * This function persists the source maps for the given sources.\n *\n * @returns A promise that resolves when the source maps have been persisted.\n */\nexport async function persistSourceMaps(_params: unknown): Promise<void> {\n throw new Error('Deprecated. Use latest version of `AlgoKit AVM Debugger` VSCode extension instead.')\n}\n"],"names":[],"mappings":";;AAAA;;;;;;AAMG;AACI,eAAe,iBAAiB,CAAC,OAAgB,EAAA;AACtD,IAAA,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAA;AACvG;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"debugging.mjs","sources":["../../../src/debugging/debugging.ts"],"sourcesContent":["/**\n * @deprecated Use latest version of `AlgoKit AVM Debugger` VSCode extension instead. It will automatically manage your sourcemaps.\n *\n * This function persists the source maps for the given sources.\n *\n * @returns A promise that resolves when the source maps have been persisted.\n */\nexport async function persistSourceMaps(_params: unknown): Promise<void> {\n throw new Error('Deprecated. Use latest version of `AlgoKit AVM Debugger` VSCode extension instead.')\n}\n"],"names":[],"mappings":"AAAA;;;;;;AAMG;AACI,eAAe,iBAAiB,CAAC,OAAgB,EAAA;AACtD,IAAA,MAAM,IAAI,KAAK,CAAC,oFAAoF,CAAC,CAAA;AACvG;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dispenser-client.js","sources":["../../src/dispenser-client.ts"],"sourcesContent":["import { TestNetDispenserApiClient, TestNetDispenserApiClientParams } from './types/dispenser-client'\n\n/**\n * @deprecated Use `clientManager.getTestNetDispenser` or `clientManager.getTestNetDispenserFromEnvironment` instead\n *\n * Create a new TestNetDispenserApiClient instance.\n * Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.\n *\n * @param params An object containing parameters for the TestNetDispenserApiClient class.\n * Or null if you want the client to load the access token from the environment variable `ALGOKIT_DISPENSER_ACCESS_TOKEN`.\n * @example\n * const client = algokit.getTestNetDispenserApiClient(\n * {\n * authToken: 'your_auth_token',\n * requestTimeout: 15,\n * }\n * )\n *\n * @returns An instance of the TestNetDispenserApiClient class.\n */\nexport function getTestNetDispenserApiClient(params: TestNetDispenserApiClientParams | null = null) {\n return new TestNetDispenserApiClient(params === null ? undefined : params)\n}\n"],"names":["TestNetDispenserApiClient"],"mappings":";;;;AAEA;;;;;;;;;;;;;;;;;AAiBG;AACa,SAAA,4BAA4B,CAAC,MAAA,GAAiD,IAAI,EAAA;AAChG,IAAA,OAAO,IAAIA,+CAAyB,CAAC,MAAM,KAAK,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,CAAA;AAC5E;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"dispenser-client.mjs","sources":["../../src/dispenser-client.ts"],"sourcesContent":["import { TestNetDispenserApiClient, TestNetDispenserApiClientParams } from './types/dispenser-client'\n\n/**\n * @deprecated Use `clientManager.getTestNetDispenser` or `clientManager.getTestNetDispenserFromEnvironment` instead\n *\n * Create a new TestNetDispenserApiClient instance.\n * Refer to [docs](https://github.com/algorandfoundation/algokit/blob/main/docs/testnet_api.md) on guidance to obtain an access token.\n *\n * @param params An object containing parameters for the TestNetDispenserApiClient class.\n * Or null if you want the client to load the access token from the environment variable `ALGOKIT_DISPENSER_ACCESS_TOKEN`.\n * @example\n * const client = algokit.getTestNetDispenserApiClient(\n * {\n * authToken: 'your_auth_token',\n * requestTimeout: 15,\n * }\n * )\n *\n * @returns An instance of the TestNetDispenserApiClient class.\n */\nexport function getTestNetDispenserApiClient(params: TestNetDispenserApiClientParams | null = null) {\n return new TestNetDispenserApiClient(params === null ? undefined : params)\n}\n"],"names":[],"mappings":";;AAEA;;;;;;;;;;;;;;;;;AAiBG;AACa,SAAA,4BAA4B,CAAC,MAAA,GAAiD,IAAI,EAAA;AAChG,IAAA,OAAO,IAAI,yBAAyB,CAAC,MAAM,KAAK,IAAI,GAAG,SAAS,GAAG,MAAM,CAAC,CAAA;AAC5E;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"indexer-lookup.js","sources":["../../src/indexer-lookup.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { LookupAssetHoldingsOptions } from './types/indexer'\nimport Indexer = algosdk.Indexer\nexport type SearchForTransactions = ReturnType<Indexer['searchForTransactions']>\n\nconst DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT = 1000 //MaxAPIResourcesPerAccount: This is the default maximum, though may be provider specific\n\n/**\n * @deprecated Use `indexer.lookupTransactionByID(transactionId).do()`.\n * Looks up a transaction by ID using Indexer.\n * @param transactionId The ID of the transaction to look up\n * @param indexer An indexer client\n * @returns The result of the look-up\n */\nexport async function lookupTransactionById(transactionId: string, indexer: Indexer) {\n return await indexer.lookupTransactionByID(transactionId).do()\n}\n\n/**\n * @deprecated Use `indexer.lookupAccountByID(accountAddress).do()`.\n * Looks up an account by address using Indexer.\n * @param accountAddress The address of the account to look up\n * @param indexer An indexer client\n * @returns The result of the look-up\n */\nexport async function lookupAccountByAddress(accountAddress: string | Address, indexer: Indexer) {\n return await indexer.lookupAccountByID(accountAddress).do()\n}\n\n/**\n * Looks up applications that were created by the given address; will automatically paginate through all data.\n * @param indexer An indexer instance\n * @param address The address of the creator to look up\n * @param getAll Whether or not to include deleted applications\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The list of application results\n */\nexport async function lookupAccountCreatedApplicationByAddress(\n indexer: Indexer,\n address: string | Address,\n getAll: boolean | undefined = undefined,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.Application[]> {\n return await executePaginatedRequest(\n (response: algosdk.indexerModels.ApplicationsResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n return response.applications\n },\n (nextToken) => {\n let s = indexer\n .lookupAccountCreatedApplications(address)\n .includeAll(getAll)\n .limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n}\n\n/**\n * Looks up asset holdings for the given asset; will automatically paginate through all data.\n * @param indexer An indexer instance\n * @param assetId The ID of the asset to look up holdings for\n * @param options Optional options to control the lookup\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The list of application results\n */\nexport async function lookupAssetHoldings(\n indexer: Indexer,\n assetId: number | bigint,\n options?: LookupAssetHoldingsOptions,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.MiniAssetHolding[]> {\n return await executePaginatedRequest(\n (response: algosdk.indexerModels.AssetBalancesResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n return response.balances\n },\n (nextToken) => {\n let s = indexer.lookupAssetBalances(Number(assetId)).limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (options?.currencyGreaterThan !== undefined) {\n s = s.currencyGreaterThan(options.currencyGreaterThan)\n }\n if (options?.currencyLessThan !== undefined) {\n s = s.currencyLessThan(options.currencyLessThan)\n }\n if (options?.includeAll !== undefined) {\n s = s.includeAll(options.includeAll)\n }\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n}\n\n/**\n * Allows transactions to be searched for the given criteria.\n * @param indexer An indexer client\n * @param searchCriteria The criteria to search for\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The search results\n */\nexport async function searchTransactions(\n indexer: Indexer,\n searchCriteria: (s: SearchForTransactions) => SearchForTransactions,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.TransactionsResponse> {\n let currentRound = 0n\n const transactions = await executePaginatedRequest(\n (response: algosdk.indexerModels.TransactionsResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n if (response.currentRound > currentRound) {\n currentRound = response.currentRound\n }\n return response.transactions\n },\n (nextToken) => {\n let s = searchCriteria(indexer.searchForTransactions()).limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n\n return new algosdk.indexerModels.TransactionsResponse({\n currentRound,\n nextToken: undefined,\n transactions: transactions,\n })\n}\n\n// https://developer.algorand.org/docs/get-details/indexer/#paginated-results\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function executePaginatedRequest<TResult, TRequest extends { do: () => Promise<any> }>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n extractItems: (response: any) => TResult[],\n buildRequest: (nextToken?: string) => TRequest,\n): Promise<TResult[]> {\n const results = []\n\n let nextToken: string | undefined = undefined\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const request = buildRequest(nextToken)\n const response = await request.do()\n const items = extractItems(response)\n if (items == null || items.length === 0) {\n break\n }\n results.push(...items)\n nextToken = response['nextToken']\n if (!nextToken) {\n break\n }\n }\n\n return results\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,6CAA6C,GAAG,IAAI,CAAA;AAE1D;;;;;;AAMG;AACI,eAAe,qBAAqB,CAAC,aAAqB,EAAE,OAAgB,EAAA;IACjF,OAAO,MAAM,OAAO,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC,EAAE,EAAE,CAAA;AAChE,CAAC;AAED;;;;;;AAMG;AACI,eAAe,sBAAsB,CAAC,cAAgC,EAAE,OAAgB,EAAA;IAC7F,OAAO,MAAM,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,EAAE,EAAE,CAAA;AAC7D,CAAC;AAED;;;;;;;AAOG;AACI,eAAe,wCAAwC,CAC5D,OAAgB,EAChB,OAAyB,EACzB,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pD,YAAY;AACZ,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,YAAY,EAAE,YAAY;AAC3B,KAAA,CAAC,CAAA;AACJ,CAAC;AAED;AACA;AACO,eAAe,uBAAuB;AAC3C;AACA,YAA0C,EAC1C,YAA8C,EAAA;IAE9C,MAAM,OAAO,GAAG,EAAE,CAAA;IAElB,IAAI,SAAS,GAAuB,SAAS,CAAA;;IAE7C,OAAO,IAAI,EAAE;AACX,QAAA,MAAM,OAAO,GAAG,YAAY,CAAC,SAAS,CAAC,CAAA;AACvC,QAAA,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,EAAE,EAAE,CAAA;AACnC,QAAA,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC,CAAA;QACpC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACvC,MAAK;SACN;AACD,QAAA,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAA;AACtB,QAAA,SAAS,GAAG,QAAQ,CAAC,WAAW,CAAC,CAAA;QACjC,IAAI,CAAC,SAAS,EAAE;YACd,MAAK;SACN;KACF;AAED,IAAA,OAAO,OAAO,CAAA;AAChB;;;;;;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"indexer-lookup.mjs","sources":["../../src/indexer-lookup.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { LookupAssetHoldingsOptions } from './types/indexer'\nimport Indexer = algosdk.Indexer\nexport type SearchForTransactions = ReturnType<Indexer['searchForTransactions']>\n\nconst DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT = 1000 //MaxAPIResourcesPerAccount: This is the default maximum, though may be provider specific\n\n/**\n * @deprecated Use `indexer.lookupTransactionByID(transactionId).do()`.\n * Looks up a transaction by ID using Indexer.\n * @param transactionId The ID of the transaction to look up\n * @param indexer An indexer client\n * @returns The result of the look-up\n */\nexport async function lookupTransactionById(transactionId: string, indexer: Indexer) {\n return await indexer.lookupTransactionByID(transactionId).do()\n}\n\n/**\n * @deprecated Use `indexer.lookupAccountByID(accountAddress).do()`.\n * Looks up an account by address using Indexer.\n * @param accountAddress The address of the account to look up\n * @param indexer An indexer client\n * @returns The result of the look-up\n */\nexport async function lookupAccountByAddress(accountAddress: string | Address, indexer: Indexer) {\n return await indexer.lookupAccountByID(accountAddress).do()\n}\n\n/**\n * Looks up applications that were created by the given address; will automatically paginate through all data.\n * @param indexer An indexer instance\n * @param address The address of the creator to look up\n * @param getAll Whether or not to include deleted applications\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The list of application results\n */\nexport async function lookupAccountCreatedApplicationByAddress(\n indexer: Indexer,\n address: string | Address,\n getAll: boolean | undefined = undefined,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.Application[]> {\n return await executePaginatedRequest(\n (response: algosdk.indexerModels.ApplicationsResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n return response.applications\n },\n (nextToken) => {\n let s = indexer\n .lookupAccountCreatedApplications(address)\n .includeAll(getAll)\n .limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n}\n\n/**\n * Looks up asset holdings for the given asset; will automatically paginate through all data.\n * @param indexer An indexer instance\n * @param assetId The ID of the asset to look up holdings for\n * @param options Optional options to control the lookup\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The list of application results\n */\nexport async function lookupAssetHoldings(\n indexer: Indexer,\n assetId: number | bigint,\n options?: LookupAssetHoldingsOptions,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.MiniAssetHolding[]> {\n return await executePaginatedRequest(\n (response: algosdk.indexerModels.AssetBalancesResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n return response.balances\n },\n (nextToken) => {\n let s = indexer.lookupAssetBalances(Number(assetId)).limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (options?.currencyGreaterThan !== undefined) {\n s = s.currencyGreaterThan(options.currencyGreaterThan)\n }\n if (options?.currencyLessThan !== undefined) {\n s = s.currencyLessThan(options.currencyLessThan)\n }\n if (options?.includeAll !== undefined) {\n s = s.includeAll(options.includeAll)\n }\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n}\n\n/**\n * Allows transactions to be searched for the given criteria.\n * @param indexer An indexer client\n * @param searchCriteria The criteria to search for\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The search results\n */\nexport async function searchTransactions(\n indexer: Indexer,\n searchCriteria: (s: SearchForTransactions) => SearchForTransactions,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.TransactionsResponse> {\n let currentRound = 0n\n const transactions = await executePaginatedRequest(\n (response: algosdk.indexerModels.TransactionsResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n if (response.currentRound > currentRound) {\n currentRound = response.currentRound\n }\n return response.transactions\n },\n (nextToken) => {\n let s = searchCriteria(indexer.searchForTransactions()).limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n\n return new algosdk.indexerModels.TransactionsResponse({\n currentRound,\n nextToken: undefined,\n transactions: transactions,\n })\n}\n\n// https://developer.algorand.org/docs/get-details/indexer/#paginated-results\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function executePaginatedRequest<TResult, TRequest extends { do: () => Promise<any> }>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n extractItems: (response: any) => TResult[],\n buildRequest: (nextToken?: string) => TRequest,\n): Promise<TResult[]> {\n const results = []\n\n let nextToken: string | undefined = undefined\n // eslint-disable-next-line no-constant-condition\n while (true) {\n const request = buildRequest(nextToken)\n const response = await request.do()\n const items = extractItems(response)\n if (items == null || items.length === 0) {\n break\n }\n results.push(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ED,IAAA,OAAO,OAAO,CAAA;AAChB;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-kmd-wallet-account.js","sources":["../../../src/localnet/get-kmd-wallet-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { ClientManager } from '../types/client-manager'\nimport { KmdAccountManager } from '../types/kmd-account-manager'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/**\n * @deprecated use `algorand.account.kmd.getWalletAccount(name, predicate)` or `new KMDAccountManager(clientManager).getWalletAccount(name, predicate)` instead.\n *\n * Returns an Algorand account with private key loaded from the given KMD wallet (identified by name).\n *\n * @param walletAccount The details of the wallet, with:\n * * `name`: The name of the wallet to retrieve an account from\n * * `predicate`: An optional filter to use to find the account (otherwise it will return a random account from the wallet)\n * @param algod An algod client\n * @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables\n * @example Get default funded account in a LocalNet\n *\n * ```typescript\n * const defaultDispenserAccount = await getKmdWalletAccount(algod,\n * 'unencrypted-default-wallet',\n * a => a.status !== 'Offline' && a.amount > 1_000_000_000\n * )\n * ```\n */\nexport async function getKmdWalletAccount(\n walletAccount: {\n name: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n predicate?: (account: Record<string, any>) => boolean\n },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | undefined> {\n return (\n await new KmdAccountManager(new ClientManager({ algod, kmd: kmdClient })).getWalletAccount(walletAccount.name, walletAccount.predicate)\n )?.account\n}\n"],"names":["KmdAccountManager","ClientManager"],"mappings":";;;;;AAOA;;;;;;;;;;;;;;;;;;AAkBG;AACI,eAAe,mBAAmB,CACvC,aAIC,EACD,KAAc,EACd,SAAe,EAAA;AAEf,IAAA,OAAO,CACL,MAAM,IAAIA,yCAAiB,CAAC,IAAIC,iCAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,GACtI,OAAO,CAAA;AACZ;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-kmd-wallet-account.mjs","sources":["../../../src/localnet/get-kmd-wallet-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { ClientManager } from '../types/client-manager'\nimport { KmdAccountManager } from '../types/kmd-account-manager'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n\n/**\n * @deprecated use `algorand.account.kmd.getWalletAccount(name, predicate)` or `new KMDAccountManager(clientManager).getWalletAccount(name, predicate)` instead.\n *\n * Returns an Algorand account with private key loaded from the given KMD wallet (identified by name).\n *\n * @param walletAccount The details of the wallet, with:\n * * `name`: The name of the wallet to retrieve an account from\n * * `predicate`: An optional filter to use to find the account (otherwise it will return a random account from the wallet)\n * @param algod An algod client\n * @param kmdClient A KMD client, if not specified then a default KMD client will be loaded from environment variables\n * @example Get default funded account in a LocalNet\n *\n * ```typescript\n * const defaultDispenserAccount = await getKmdWalletAccount(algod,\n * 'unencrypted-default-wallet',\n * a => a.status !== 'Offline' && a.amount > 1_000_000_000\n * )\n * ```\n */\nexport async function getKmdWalletAccount(\n walletAccount: {\n name: string\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n predicate?: (account: Record<string, any>) => boolean\n },\n algod: Algodv2,\n kmdClient?: Kmd,\n): Promise<Account | undefined> {\n return (\n await new KmdAccountManager(new ClientManager({ algod, kmd: kmdClient })).getWalletAccount(walletAccount.name, walletAccount.predicate)\n )?.account\n}\n"],"names":[],"mappings":";;;AAOA;;;;;;;;;;;;;;;;;;AAkBG;AACI,eAAe,mBAAmB,CACvC,aAIC,EACD,KAAc,EACd,SAAe,EAAA;AAEf,IAAA,OAAO,CACL,MAAM,IAAI,iBAAiB,CAAC,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,gBAAgB,CAAC,aAAa,CAAC,IAAI,EAAE,aAAa,CAAC,SAAS,CAAC,GACtI,OAAO,CAAA;AACZ;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-localnet-dispenser-account.js","sources":["../../../src/localnet/get-localnet-dispenser-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountManager } from '../types/account-manager'\nimport { ClientManager } from '../types/client-manager'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n/**\n * @deprecated Use `algorand.account.kmd.getLocalNetDispenserAccount()` instead.\n *\n * Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts)\n *\n * @param algod An algod client\n * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables\n */\nexport async function getLocalNetDispenserAccount(algod: Algodv2, kmd?: Kmd): Promise<Account> {\n return (await new AccountManager(new ClientManager({ algod, kmd })).kmd.getLocalNetDispenserAccount()).account\n}\n"],"names":["AccountManager","ClientManager"],"mappings":";;;;;AAMA;;;;;;;AAOG;AACI,eAAe,2BAA2B,CAAC,KAAc,EAAE,GAAS,EAAA;IACzE,OAAO,CAAC,MAAM,IAAIA,mCAAc,CAAC,IAAIC,iCAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,2BAA2B,EAAE,EAAE,OAAO,CAAA;AAChH;;;;"}
@@ -1 +0,0 @@
1
- {"version":3,"file":"get-localnet-dispenser-account.mjs","sources":["../../../src/localnet/get-localnet-dispenser-account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AccountManager } from '../types/account-manager'\nimport { ClientManager } from '../types/client-manager'\nimport Account = algosdk.Account\nimport Algodv2 = algosdk.Algodv2\nimport Kmd = algosdk.Kmd\n/**\n * @deprecated Use `algorand.account.kmd.getLocalNetDispenserAccount()` instead.\n *\n * Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts)\n *\n * @param algod An algod client\n * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables\n */\nexport async function getLocalNetDispenserAccount(algod: Algodv2, kmd?: Kmd): Promise<Account> {\n return (await new AccountManager(new ClientManager({ algod, kmd })).kmd.getLocalNetDispenserAccount()).account\n}\n"],"names":[],"mappings":";;;AAMA;;;;;;;AAOG;AACI,eAAe,2BAA2B,CAAC,KAAc,EAAE,GAAS,EAAA;IACzE,OAAO,CAAC,MAAM,IAAI,cAAc,CAAC,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC,GAAG,CAAC,2BAA2B,EAAE,EAAE,OAAO,CAAA;AAChH;;;;"}