@algorandfoundation/algokit-utils 7.0.0 → 8.0.0

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 (148) hide show
  1. package/README.md +14 -3
  2. package/account/account.d.ts +4 -1
  3. package/account/account.js +4 -3
  4. package/account/account.js.map +1 -1
  5. package/account/account.mjs +5 -4
  6. package/account/account.mjs.map +1 -1
  7. package/account/get-dispenser-account.d.ts +1 -1
  8. package/amount.d.ts +1 -0
  9. package/amount.js +3 -2
  10. package/amount.js.map +1 -1
  11. package/amount.mjs +3 -3
  12. package/amount.mjs.map +1 -1
  13. package/app-client.d.ts +4 -4
  14. package/app-client.js +4 -4
  15. package/app-client.js.map +1 -1
  16. package/app-client.mjs +4 -4
  17. package/app-client.mjs.map +1 -1
  18. package/app-deploy.js +23 -5
  19. package/app-deploy.js.map +1 -1
  20. package/app-deploy.mjs +24 -6
  21. package/app-deploy.mjs.map +1 -1
  22. package/app.js +7 -4
  23. package/app.js.map +1 -1
  24. package/app.mjs +7 -4
  25. package/app.mjs.map +1 -1
  26. package/index.js +1 -1
  27. package/index.mjs +2 -2
  28. package/indexer-lookup.d.ts +10 -8
  29. package/indexer-lookup.js +14 -10
  30. package/indexer-lookup.js.map +1 -1
  31. package/indexer-lookup.mjs +14 -10
  32. package/indexer-lookup.mjs.map +1 -1
  33. package/network-client.d.ts +1 -7
  34. package/network-client.js +2 -9
  35. package/network-client.js.map +1 -1
  36. package/network-client.mjs +2 -9
  37. package/network-client.mjs.map +1 -1
  38. package/package.json +2 -2
  39. package/testing/_asset.d.ts +2 -1
  40. package/testing/account.d.ts +4 -3
  41. package/testing/account.js +8 -2
  42. package/testing/account.js.map +1 -1
  43. package/testing/account.mjs +9 -3
  44. package/testing/account.mjs.map +1 -1
  45. package/testing/fixtures/algorand-fixture.js +5 -6
  46. package/testing/fixtures/algorand-fixture.js.map +1 -1
  47. package/testing/fixtures/algorand-fixture.mjs +5 -6
  48. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  49. package/testing/test-logger.js +7 -1
  50. package/testing/test-logger.js.map +1 -1
  51. package/testing/test-logger.mjs +7 -1
  52. package/testing/test-logger.mjs.map +1 -1
  53. package/transaction/perform-atomic-transaction-composer-simulate.d.ts +4 -1
  54. package/transaction/perform-atomic-transaction-composer-simulate.js +14 -10
  55. package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
  56. package/transaction/perform-atomic-transaction-composer-simulate.mjs +15 -11
  57. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
  58. package/transaction/transaction.d.ts +1 -17
  59. package/transaction/transaction.js +110 -82
  60. package/transaction/transaction.js.map +1 -1
  61. package/transaction/transaction.mjs +112 -83
  62. package/transaction/transaction.mjs.map +1 -1
  63. package/transfer/transfer.js +3 -1
  64. package/transfer/transfer.js.map +1 -1
  65. package/transfer/transfer.mjs +3 -1
  66. package/transfer/transfer.mjs.map +1 -1
  67. package/types/account-manager.d.ts +20 -20
  68. package/types/account-manager.js +27 -20
  69. package/types/account-manager.js.map +1 -1
  70. package/types/account-manager.mjs +28 -21
  71. package/types/account-manager.mjs.map +1 -1
  72. package/types/account.d.ts +8 -8
  73. package/types/account.js +2 -2
  74. package/types/account.js.map +1 -1
  75. package/types/account.mjs +3 -3
  76. package/types/account.mjs.map +1 -1
  77. package/types/algo-http-client-with-retry.d.ts +1 -2
  78. package/types/algo-http-client-with-retry.js +33 -3
  79. package/types/algo-http-client-with-retry.js.map +1 -1
  80. package/types/algo-http-client-with-retry.mjs +32 -2
  81. package/types/algo-http-client-with-retry.mjs.map +1 -1
  82. package/types/algorand-client-transaction-creator.d.ts +11 -11
  83. package/types/algorand-client-transaction-sender.d.ts +97 -97
  84. package/types/algorand-client-transaction-sender.js.map +1 -1
  85. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  86. package/types/algorand-client.d.ts +3 -3
  87. package/types/algorand-client.js +1 -1
  88. package/types/algorand-client.js.map +1 -1
  89. package/types/algorand-client.mjs +1 -1
  90. package/types/algorand-client.mjs.map +1 -1
  91. package/types/app-client.d.ts +280 -279
  92. package/types/app-client.js +10 -10
  93. package/types/app-client.js.map +1 -1
  94. package/types/app-client.mjs +11 -11
  95. package/types/app-client.mjs.map +1 -1
  96. package/types/app-deployer.d.ts +4 -4
  97. package/types/app-deployer.js +22 -23
  98. package/types/app-deployer.js.map +1 -1
  99. package/types/app-deployer.mjs +23 -24
  100. package/types/app-deployer.mjs.map +1 -1
  101. package/types/app-factory.d.ts +128 -138
  102. package/types/app-factory.js +4 -3
  103. package/types/app-factory.js.map +1 -1
  104. package/types/app-factory.mjs +5 -4
  105. package/types/app-factory.mjs.map +1 -1
  106. package/types/app-manager.d.ts +5 -5
  107. package/types/app-manager.js +11 -15
  108. package/types/app-manager.js.map +1 -1
  109. package/types/app-manager.mjs +12 -16
  110. package/types/app-manager.mjs.map +1 -1
  111. package/types/app.d.ts +4 -4
  112. package/types/app.js.map +1 -1
  113. package/types/app.mjs.map +1 -1
  114. package/types/asset-manager.d.ts +5 -5
  115. package/types/asset-manager.js +8 -11
  116. package/types/asset-manager.js.map +1 -1
  117. package/types/asset-manager.mjs +8 -11
  118. package/types/asset-manager.mjs.map +1 -1
  119. package/types/client-manager.d.ts +2 -9
  120. package/types/client-manager.js +9 -19
  121. package/types/client-manager.js.map +1 -1
  122. package/types/client-manager.mjs +9 -19
  123. package/types/client-manager.mjs.map +1 -1
  124. package/types/composer.d.ts +22 -22
  125. package/types/composer.js +73 -83
  126. package/types/composer.js.map +1 -1
  127. package/types/composer.mjs +74 -84
  128. package/types/composer.mjs.map +1 -1
  129. package/types/dispenser-client.d.ts +2 -1
  130. package/types/dispenser-client.js +5 -1
  131. package/types/dispenser-client.js.map +1 -1
  132. package/types/dispenser-client.mjs +5 -1
  133. package/types/dispenser-client.mjs.map +1 -1
  134. package/types/indexer.d.ts +74 -755
  135. package/types/indexer.js.map +1 -1
  136. package/types/indexer.mjs.map +1 -1
  137. package/types/kmd-account-manager.d.ts +2 -2
  138. package/types/kmd-account-manager.js.map +1 -1
  139. package/types/kmd-account-manager.mjs.map +1 -1
  140. package/types/network-client.d.ts +1 -1
  141. package/types/network-client.js.map +1 -1
  142. package/types/network-client.mjs.map +1 -1
  143. package/types/testing.d.ts +5 -6
  144. package/types/urlTokenBaseHTTPClient.d.ts +0 -40
  145. package/types/urlTokenBaseHTTPClient.js +0 -153
  146. package/types/urlTokenBaseHTTPClient.js.map +0 -1
  147. package/types/urlTokenBaseHTTPClient.mjs +0 -151
  148. package/types/urlTokenBaseHTTPClient.mjs.map +0 -1
package/README.md CHANGED
@@ -10,13 +10,23 @@ Note: If you prefer Python there's an equivalent [Python utility library](https:
10
10
 
11
11
  ## Install
12
12
 
13
- This library can be installed from NPM using your favourite npm client, e.g.:
13
+ Before installing, you'll need to decide on the version you want to target. Version 7 and 8 have the same feature set, however v7 leverages algosdk@>=2.9.0<3.0, whereas v8 leverages algosdk@>=3.0.0. Your project and it's dependencies will help you decide which version to target.
14
+
15
+ Once you've decided on the target version, this library can be installed from NPM using your favourite npm client, e.g.:
16
+
17
+ To target algosdk@2 and use version 7 of AlgoKit Utils, run the below:
18
+
19
+ ```
20
+ npm install algosdk@^2.9.0 @algorandfoundation/algokit-utils@^7.0.0
21
+ ```
22
+
23
+ To target algosdk@3 and use the latest version of AlgoKit Utils, run the below:
14
24
 
15
25
  ```
16
- npm install algosdk@2 @algorandfoundation/algokit-utils
26
+ npm install algosdk@^3.0.0 @algorandfoundation/algokit-utils
17
27
  ```
18
28
 
19
- Then to import it:
29
+ Now you can import the library:
20
30
 
21
31
  ```typescript
22
32
  import { AlgorandClient, Config } from '@algorandfoundation/algokit-utils'
@@ -30,6 +40,7 @@ Whilst we aim to minimise breaking changes, there are situations where they are
30
40
  JSDoc deprecations should guide you through most migration paths inside your IDE, however the migration guides will provide more detailed information should you need it.
31
41
 
32
42
  If you're targetting v7, please refer to the [v7 migration guide](./docs/v7-migration.md).
43
+ If you're targetting v8, please refer to the [v8 migration guide](./docs/v8-migration.md).
33
44
 
34
45
  ## Guiding principles
35
46
 
@@ -101,7 +101,10 @@ export type NumberConverter<T extends AccountInformationModel> = {
101
101
  };
102
102
  type ToNumberIfExtends<K, E> = K extends E ? number : K;
103
103
  /** @deprecated Account information at a given round. */
104
- export type AccountInformation = Omit<NumberConverter<AccountInformationModel>, 'get_obj_for_encoding'>;
104
+ export type AccountInformation = Omit<NumberConverter<AccountInformationModel>, 'getEncodingSchema' | 'toEncodingData' | 'authAddr'> & {
105
+ /** (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. */
106
+ authAddr?: string;
107
+ };
105
108
  /**
106
109
  * @deprecated Use `algorand.account.getInformation(sender)` or `new AccountManager(clientManager).getInformation(sender)` instead.
107
110
  *
@@ -7,7 +7,6 @@ var types_accountManager = require('../types/account-manager.js');
7
7
  var types_algorandClient = require('../types/algorand-client.js');
8
8
  var types_clientManager = require('../types/client-manager.js');
9
9
 
10
- var AccountInformationModel = algosdk.modelsv2.Account;
11
10
  /**
12
11
  * @deprecated Use `algorand.account.multisig(multisigParams, signingAccounts)` or `new MultisigAccount(multisigParams, signingAccounts)` instead.
13
12
  *
@@ -39,7 +38,7 @@ function rekeyedAccount(signer, sender) {
39
38
  * @returns The SigningAccount wrapper
40
39
  */
41
40
  function transactionSignerAccount(signer, sender) {
42
- return { addr: sender, signer };
41
+ return { addr: algosdk.Address.fromString(sender), signer };
43
42
  }
44
43
  /**
45
44
  * @deprecated Use `algorand.account.random()` or `algosdk.generateAccount()` instead.
@@ -125,9 +124,11 @@ function getAccountAddressAsString(addressEncodedInB64) {
125
124
  * @returns The account information
126
125
  */
127
126
  async function getAccountInformation(sender, algod) {
128
- const account = AccountInformationModel.from_obj_for_encoding(await algod.accountInformation(transaction.getSenderAddress(sender)).do());
127
+ const account = await algod.accountInformation(transaction.getSenderAddress(sender)).do();
129
128
  return {
130
129
  ...account,
130
+ address: account.address.toString(),
131
+ authAddr: account.authAddr ? account.authAddr.toString() : undefined,
131
132
  // None of these can practically overflow 2^53
132
133
  amount: Number(account.amount),
133
134
  amountWithoutPendingRewards: Number(account.amountWithoutPendingRewards),
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","sources":["../../src/account/account.ts"],"sourcesContent":["import algosdk 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: 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>, 'get_obj_for_encoding'>\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 = AccountInformationModel.from_obj_for_encoding(await algod.accountInformation(getSenderAddress(sender)).do())\n\n return {\n ...account,\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":["MultisigAccount","SigningAccount","AccountManager","ClientManager","getSenderAddress","AlgorandClient"],"mappings":";;;;;;;;;AAaA,IAAO,uBAAuB,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO;AAEzD;;;;;;;AAOG;AACa,SAAA,eAAe,CAAC,cAAgC,EAAE,eAA6C,EAAA;AAC7G,IAAA,OAAO,IAAIA,6BAAe,CAAC,cAAc,EAAE,eAAe,CAAC;AAC7D;AAEA;;;;;;;AAOG;AACa,SAAA,cAAc,CAAC,MAAe,EAAE,MAAc,EAAA;AAC5D,IAAA,OAAO,IAAIC,4BAAc,CAAC,MAAM,EAAE,MAAM,CAAC;AAC3C;AAEA;;;;;;;AAOG;AACa,SAAA,wBAAwB,CAAC,MAAyB,EAAE,MAAc,EAAA;AAChF,IAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE;AACjC;AAEA;;;;;;;AAOG;SACa,aAAa,GAAA;;AAE3B,IAAA,OAAO,OAAO,CAAC,eAAe,EAAE;AAClC;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;AACI,eAAe,8BAA8B,CAClD,OAAyD,EACzD,KAAc,EACd,SAAe,EAAA;IAEf,OAAO,CACL,MAAM,IAAIC,mCAAc,CAAC,IAAIC,iCAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,eAAe,CACpF,OAAO,OAAO,KAAK,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,EACpD,OAAO,OAAO,KAAK,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC,QAAQ,CAC3D,EACD,OAAO;AACX;AAEA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CAAC;AACtD,QAAA,mBAAmB,EAAE,OAAO,CAAC,mBAAmB,KAAK,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,SAAS;AAChH,QAAA,UAAU,EAAE,OAAO,CAAC,UAAU,KAAK,SAAS,GAAG,MAAM,CAAC,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,UAAU,EAAE,OAAO,CAAC,UAAU,KAAK,SAAS,GAAG,MAAM,CAAC,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;AACH;AAEA;;;;;;;;;;;;;;;;;AAiBG;AACI,eAAe,0BAA0B,CAC9C,MAAoC,EACpC,OAAwB,EACxB,KAAc,EAAA;IAEd,OAAOC,mCAAc,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAACD,4BAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;AACrH;;;;;;;;;;;;"}
1
+ {"version":3,"file":"account.js","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":["MultisigAccount","SigningAccount","Address","AccountManager","ClientManager","getSenderAddress","AlgorandClient"],"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AO,CAAC,UAAU,KAAK,SAAS,GAAG,MAAM,CAAC,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,UAAU,EAAE,OAAO,CAAC,UAAU,KAAK,SAAS,GAAG,MAAM,CAAC,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;AACH;AAEA;;;;;;;;;;;;;;;;;AAiBG;AACI,eAAe,0BAA0B,CAC9C,MAAoC,EACpC,OAAwB,EACxB,KAAc,EAAA;IAEd,OAAOC,mCAAc,CAAC,WAAW,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,KAAK,CAAC,qBAAqB,CAACD,4BAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;AACrH;;;;;;;;;;;;"}
@@ -1,11 +1,10 @@
1
- import algosdk from 'algosdk';
1
+ import algosdk, { Address } from 'algosdk';
2
2
  import { getSenderAddress } from '../transaction/transaction.mjs';
3
3
  import { MultisigAccount, SigningAccount } from '../types/account.mjs';
4
4
  import { AccountManager } from '../types/account-manager.mjs';
5
5
  import { AlgorandClient } from '../types/algorand-client.mjs';
6
6
  import { ClientManager } from '../types/client-manager.mjs';
7
7
 
8
- var AccountInformationModel = algosdk.modelsv2.Account;
9
8
  /**
10
9
  * @deprecated Use `algorand.account.multisig(multisigParams, signingAccounts)` or `new MultisigAccount(multisigParams, signingAccounts)` instead.
11
10
  *
@@ -37,7 +36,7 @@ function rekeyedAccount(signer, sender) {
37
36
  * @returns The SigningAccount wrapper
38
37
  */
39
38
  function transactionSignerAccount(signer, sender) {
40
- return { addr: sender, signer };
39
+ return { addr: Address.fromString(sender), signer };
41
40
  }
42
41
  /**
43
42
  * @deprecated Use `algorand.account.random()` or `algosdk.generateAccount()` instead.
@@ -123,9 +122,11 @@ function getAccountAddressAsString(addressEncodedInB64) {
123
122
  * @returns The account information
124
123
  */
125
124
  async function getAccountInformation(sender, algod) {
126
- const account = AccountInformationModel.from_obj_for_encoding(await algod.accountInformation(getSenderAddress(sender)).do());
125
+ const account = await algod.accountInformation(getSenderAddress(sender)).do();
127
126
  return {
128
127
  ...account,
128
+ address: account.address.toString(),
129
+ authAddr: account.authAddr ? account.authAddr.toString() : undefined,
129
130
  // None of these can practically overflow 2^53
130
131
  amount: Number(account.amount),
131
132
  amountWithoutPendingRewards: Number(account.amountWithoutPendingRewards),
@@ -1 +1 @@
1
- {"version":3,"file":"account.mjs","sources":["../../src/account/account.ts"],"sourcesContent":["import algosdk 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: 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>, 'get_obj_for_encoding'>\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 = AccountInformationModel.from_obj_for_encoding(await algod.accountInformation(getSenderAddress(sender)).do())\n\n return {\n ...account,\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":";;;;;;;AAaA,IAAO,uBAAuB,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO;AAEzD;;;;;;;AAOG;AACa,SAAA,eAAe,CAAC,cAAgC,EAAE,eAA6C,EAAA;AAC7G,IAAA,OAAO,IAAI,eAAe,CAAC,cAAc,EAAE,eAAe,CAAC;AAC7D;AAEA;;;;;;;AAOG;AACa,SAAA,cAAc,CAAC,MAAe,EAAE,MAAc,EAAA;AAC5D,IAAA,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC;AAC3C;AAEA;;;;;;;AAOG;AACa,SAAA,wBAAwB,CAAC,MAAyB,EAAE,MAAc,EAAA;AAChF,IAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE;AACjC;AAEA;;;;;;;AAOG;SACa,aAAa,GAAA;;AAE3B,IAAA,OAAO,OAAO,CAAC,eAAe,EAAE;AAClC;AAEA;;;;;;;;;;;;;;;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AqB,CAAC,gBAAgB,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,OAAO,CAAC,CAAC;AACrH;;;;"}
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;AAC7D;AAEA;;;;;;;AAOG;AACa,SAAA,cAAc,CAAC,MAAe,EAAE,MAAc,EAAA;AAC5D,IAAA,OAAO,IAAI,cAAc,CAAC,MAAM,EAAE,MAAM,CAAC;AAC3C;AAEA;;;;;;;AAOG;AACa,SAAA,wBAAwB,CAAC,MAAyB,EAAE,MAAc,EAAA;AAChF,IAAA,OAAO,EAAE,IAAI,EAAE,OAAO,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,MAAM,EAAE;AACrD;AAEA;;;;;;;AAOG;SACa,aAAa,GAAA;;AAE3B,IAAA,OAAO,OAAO,CAAC,eAAe,EAAE;AAClC;AAEA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;AACI,eAAe,8BAA8B,CAClD,OAAyD,EACzD,KAAc,EACd,SAAe,EAAA;IAEf,OAAO,CACL,MAAM,IAAI,cAAc,CAAC,IAAI,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,EAAE,SAAS,EAAE,CAAC,CAAC,CAAC,eAAe,CACpF,OAAO,OAAO,KAAK,QAAQ,GAAG,OAAO,GAAG,OAAO,CAAC,IAAI,EACpD,OAAO,OAAO,KAAK,QAAQ,GAAG,SAAS,GAAG,OAAO,CAAC,QAAQ,CAC3D,EACD,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AO,CAAC,kBAAkB,CAAC;AACtD,QAAA,gBAAgB,EAAE,MAAM,CAAC,OAAO,CAAC,gBAAgB,CAAC;AAClD,QAAA,kBAAkB,EAAE,MAAM,CAAC,OAAO,CAAC,kBAAkB,CAAC;AACtD,QAAA,mBAAmB,EAAE,OAAO,CAAC,mBAAmB,KAAK,SAAS,GAAG,MAAM,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,SAAS;AAChH,QAAA,UAAU,EAAE,OAAO,CAAC,UAAU,KAAK,SAAS,GAAG,MAAM,CAAC,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,UAAU,EAAE,OAAO,CAAC,UAAU,KAAK,SAAS,GAAG,MAAM,CAAC,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;AACH;AAEA;;;;;;;;;;;;;;;;;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;AACrH;;;;"}
@@ -12,6 +12,6 @@ import Kmd = algosdk.Kmd;
12
12
  * @param algod An algod client
13
13
  * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables
14
14
  */
15
- export declare function getDispenserAccount(algod: Algodv2, kmd?: Kmd): Promise<import("../types/account").TransactionSignerAccount & {
15
+ export declare function getDispenserAccount(algod: Algodv2, kmd?: Kmd): Promise<algosdk.Address & import("../types/account").TransactionSignerAccount & {
16
16
  account: import("../types/account").SigningAccount;
17
17
  }>;
package/amount.d.ts CHANGED
@@ -49,3 +49,4 @@ export declare const microAlgo: (microAlgos: number | bigint) => AlgoAmount;
49
49
  * @param numberOfTransactions The of standard transaction fees to return the amount of Algo
50
50
  */
51
51
  export declare const transactionFees: (numberOfTransactions: number) => AlgoAmount;
52
+ export declare const ALGORAND_MIN_TX_FEE: AlgoAmount;
package/amount.js CHANGED
@@ -1,6 +1,5 @@
1
1
  'use strict';
2
2
 
3
- var algosdk = require('algosdk');
4
3
  var types_amount = require('./types/amount.js');
5
4
 
6
5
  Number.prototype.microAlgos = function () {
@@ -49,9 +48,11 @@ const microAlgo = (microAlgos) => {
49
48
  * @param numberOfTransactions The of standard transaction fees to return the amount of Algo
50
49
  */
51
50
  const transactionFees = (numberOfTransactions) => {
52
- return types_amount.AlgoAmount.MicroAlgo(numberOfTransactions * algosdk.ALGORAND_MIN_TX_FEE);
51
+ return types_amount.AlgoAmount.MicroAlgo(BigInt(numberOfTransactions) * ALGORAND_MIN_TX_FEE.microAlgo);
53
52
  };
53
+ const ALGORAND_MIN_TX_FEE = types_amount.AlgoAmount.MicroAlgo(1000);
54
54
 
55
+ exports.ALGORAND_MIN_TX_FEE = ALGORAND_MIN_TX_FEE;
55
56
  exports.algo = algo;
56
57
  exports.algos = algos;
57
58
  exports.microAlgo = microAlgo;
package/amount.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"amount.js","sources":["../src/amount.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { 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(numberOfTransactions * algosdk.ALGORAND_MIN_TX_FEE)\n}\n"],"names":["AlgoAmount"],"mappings":";;;;;AAkCA,M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,OAAOA,uBAAU,CAAC,SAAS,CAAC,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACjF;;;;;;;;"}
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,CAAC,SAAS,CAAC,UAAU,GAAG,YAAA;AAC5B,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,IAAI,CAAC;AACnC,CAAC;AAED,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,YAAA;AACvB,IAAA,OAAOA,uBAAU,CAAC,IAAI,CAAC,IAAI,CAAC;AAC9B,CAAC;AAED,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,YAAA;AAC3B,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,IAAI,CAAC;AACnC,CAAC;AAED,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAA;AACtB,IAAA,OAAOA,uBAAU,CAAC,IAAI,CAAC,IAAI,CAAC;AAC9B,CAAC;AAED,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,YAAA;AAC3B,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,IAAI,CAAC;AACnC,CAAC;AAED,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAA;AACtB,IAAA,OAAOA,uBAAU,CAAC,IAAI,CAAC,IAAI,CAAC;AAC9B,CAAC;AAED;;AAEG;AACU,MAAA,KAAK,GAAG,CAAC,KAAsB,KAAI;AAC9C,IAAA,OAAOA,uBAAU,CAAC,IAAI,CAAC,KAAK,CAAC;AAC/B;AAEA;;AAEG;AACU,MAAA,IAAI,GAAG,CAAC,KAAsB,KAAI;AAC7C,IAAA,OAAOA,uBAAU,CAAC,IAAI,CAAC,KAAK,CAAC;AAC/B;AAEA;;AAEG;AACU,MAAA,UAAU,GAAG,CAAC,UAA2B,KAAI;AACxD,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,UAAU,CAAC;AACzC;AAEA;;AAEG;AACU,MAAA,SAAS,GAAG,CAAC,UAA2B,KAAI;AACvD,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,UAAU,CAAC;AACzC;AAEA;;AAEG;AACU,MAAA,eAAe,GAAG,CAAC,oBAA4B,KAAI;AAC9D,IAAA,OAAOA,uBAAU,CAAC,SAAS,CAAC,MAAM,CAAC,oBAAoB,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC;AAC3F;AAEa,MAAA,mBAAmB,GAAGA,uBAAU,CAAC,SAAS,CAAC,IAAK;;;;;;;;;"}
package/amount.mjs CHANGED
@@ -1,4 +1,3 @@
1
- import algosdk from 'algosdk';
2
1
  import { AlgoAmount } from './types/amount.mjs';
3
2
 
4
3
  Number.prototype.microAlgos = function () {
@@ -47,8 +46,9 @@ const microAlgo = (microAlgos) => {
47
46
  * @param numberOfTransactions The of standard transaction fees to return the amount of Algo
48
47
  */
49
48
  const transactionFees = (numberOfTransactions) => {
50
- return AlgoAmount.MicroAlgo(numberOfTransactions * algosdk.ALGORAND_MIN_TX_FEE);
49
+ return AlgoAmount.MicroAlgo(BigInt(numberOfTransactions) * ALGORAND_MIN_TX_FEE.microAlgo);
51
50
  };
51
+ const ALGORAND_MIN_TX_FEE = AlgoAmount.MicroAlgo(1000);
52
52
 
53
- export { algo, algos, microAlgo, microAlgos, transactionFees };
53
+ export { ALGORAND_MIN_TX_FEE, algo, algos, microAlgo, microAlgos, transactionFees };
54
54
  //# sourceMappingURL=amount.mjs.map
package/amount.mjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"amount.mjs","sources":["../src/amount.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { 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(numberOfTransactions * algosdk.ALGORAND_MIN_TX_FEE)\n}\n"],"names":[],"mappings":";;;AAkCA,MAAM,CAAC,SAAS,CAAC,UAAU,GAAG,YAAA;AAC5B,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC;AACnC,CAAC;AAED,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,YAAA;AACvB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;AAC9B,CAAC;AAED,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,YAAA;AAC3B,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC;AACnC,CAAC;AAED,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAA;AACtB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;AAC9B,CAAC;AAED,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,YAAA;AAC3B,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC;AACnC,CAAC;AAED,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAA;AACtB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;AAC9B,CAAC;AAED;;AAEG;AACU,MAAA,KAAK,GAAG,CAAC,KAAsB,KAAI;AAC9C,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;AAC/B;AAEA;;AAEG;AACU,MAAA,IAAI,GAAG,CAAC,KAAsB,KAAI;AAC7C,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;AAC/B;AAEA;;AAEG;AACU,MAAA,UAAU,GAAG,CAAC,UAA2B,KAAI;AACxD,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC;AACzC;AAEA;;AAEG;AACU,MAAA,SAAS,GAAG,CAAC,UAA2B,KAAI;AACvD,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC;AACzC;AAEA;;AAEG;AACU,MAAA,eAAe,GAAG,CAAC,oBAA4B,KAAI;IAC9D,OAAO,UAAU,CAAC,SAAS,CAAC,oBAAoB,GAAG,OAAO,CAAC,mBAAmB,CAAC;AACjF;;;;"}
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;AACnC,CAAC;AAED,MAAM,CAAC,SAAS,CAAC,KAAK,GAAG,YAAA;AACvB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;AAC9B,CAAC;AAED,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,YAAA;AAC3B,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC;AACnC,CAAC;AAED,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAA;AACtB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;AAC9B,CAAC;AAED,MAAM,CAAC,SAAS,CAAC,SAAS,GAAG,YAAA;AAC3B,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,IAAI,CAAC;AACnC,CAAC;AAED,MAAM,CAAC,SAAS,CAAC,IAAI,GAAG,YAAA;AACtB,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;AAC9B,CAAC;AAED;;AAEG;AACU,MAAA,KAAK,GAAG,CAAC,KAAsB,KAAI;AAC9C,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;AAC/B;AAEA;;AAEG;AACU,MAAA,IAAI,GAAG,CAAC,KAAsB,KAAI;AAC7C,IAAA,OAAO,UAAU,CAAC,IAAI,CAAC,KAAK,CAAC;AAC/B;AAEA;;AAEG;AACU,MAAA,UAAU,GAAG,CAAC,UAA2B,KAAI;AACxD,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC;AACzC;AAEA;;AAEG;AACU,MAAA,SAAS,GAAG,CAAC,UAA2B,KAAI;AACvD,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,UAAU,CAAC;AACzC;AAEA;;AAEG;AACU,MAAA,eAAe,GAAG,CAAC,oBAA4B,KAAI;AAC9D,IAAA,OAAO,UAAU,CAAC,SAAS,CAAC,MAAM,CAAC,oBAAoB,CAAC,GAAG,mBAAmB,CAAC,SAAS,CAAC;AAC3F;AAEa,MAAA,mBAAmB,GAAG,UAAU,CAAC,SAAS,CAAC,IAAK;;;;"}
package/app-client.d.ts CHANGED
@@ -73,10 +73,10 @@ export declare function getAppClientById(appDetails: AppSpecAppDetailsById, algo
73
73
  * @example
74
74
  * const client = algokit.getAppClientByCreatorAndName(
75
75
  * {
76
- * app: {appSpec},
77
- * sender: {account},
78
- * creatorAddress: {account.addr},
79
- * findExistingUsing: {indexerClient},
76
+ * app: appSpec,
77
+ * sender: account,
78
+ * creatorAddress: account,
79
+ * findExistingUsing: indexerClient,
80
80
  * },
81
81
  * algodClient,
82
82
  * )
package/app-client.js CHANGED
@@ -78,10 +78,10 @@ function getAppClientById(appDetails, algod) {
78
78
  * @example
79
79
  * const client = algokit.getAppClientByCreatorAndName(
80
80
  * {
81
- * app: {appSpec},
82
- * sender: {account},
83
- * creatorAddress: {account.addr},
84
- * findExistingUsing: {indexerClient},
81
+ * app: appSpec,
82
+ * sender: account,
83
+ * creatorAddress: account,
84
+ * findExistingUsing: indexerClient,
85
85
  * },
86
86
  * algodClient,
87
87
  * )
package/app-client.js.map CHANGED
@@ -1 +1 @@
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.addr},\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;AACjD;AAEA;;;;;;;;;;;;;;;;;;;;;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;AACzE;AAEA;;;;;;;;;;;;;;;;;;;;;;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;AACrF;;;;;;"}
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;AACjD;AAEA;;;;;;;;;;;;;;;;;;;;;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;AACzE;AAEA;;;;;;;;;;;;;;;;;;;;;;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;AACrF;;;;;;"}
package/app-client.mjs CHANGED
@@ -76,10 +76,10 @@ function getAppClientById(appDetails, algod) {
76
76
  * @example
77
77
  * const client = algokit.getAppClientByCreatorAndName(
78
78
  * {
79
- * app: {appSpec},
80
- * sender: {account},
81
- * creatorAddress: {account.addr},
82
- * findExistingUsing: {indexerClient},
79
+ * app: appSpec,
80
+ * sender: account,
81
+ * creatorAddress: account,
82
+ * findExistingUsing: indexerClient,
83
83
  * },
84
84
  * algodClient,
85
85
  * )
@@ -1 +1 @@
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.addr},\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;AACjD;AAEA;;;;;;;;;;;;;;;;;;;;;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;AACzE;AAEA;;;;;;;;;;;;;;;;;;;;;;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;AACrF;;;;"}
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;AACjD;AAEA;;;;;;;;;;;;;;;;;;;;;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;AACzE;AAEA;;;;;;;;;;;;;;;;;;;;;;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;AACrF;;;;"}
package/app-deploy.js CHANGED
@@ -129,10 +129,16 @@ async function deployApp(deployment, algod, indexer) {
129
129
  onUpdate: deployment.onUpdate,
130
130
  existingDeployments: deployment.existingDeployments
131
131
  ? {
132
- creator: deployment.existingDeployments.creator,
132
+ creator: algosdk.Address.fromString(deployment.existingDeployments.creator),
133
133
  apps: Object.fromEntries(Object.entries(deployment.existingDeployments.apps).map(([name, app]) => [
134
134
  name,
135
- { ...app, appId: BigInt(app.appId), createdRound: BigInt(app.createdRound), updatedRound: BigInt(app.updatedRound) },
135
+ {
136
+ ...app,
137
+ appAddress: algosdk.Address.fromString(app.appAddress),
138
+ appId: BigInt(app.appId),
139
+ createdRound: BigInt(app.createdRound),
140
+ updatedRound: BigInt(app.updatedRound),
141
+ },
136
142
  ])),
137
143
  }
138
144
  : undefined,
@@ -140,7 +146,13 @@ async function deployApp(deployment, algod, indexer) {
140
146
  populateAppCallResources: deployment.populateAppCallResources,
141
147
  suppressLog: deployment.suppressLog,
142
148
  });
143
- return { ...result, appId: Number(result.appId), createdRound: Number(result.createdRound), updatedRound: Number(result.updatedRound) };
149
+ return {
150
+ ...result,
151
+ appAddress: result.appAddress.toString(),
152
+ appId: Number(result.appId),
153
+ createdRound: Number(result.createdRound),
154
+ updatedRound: Number(result.updatedRound),
155
+ };
144
156
  }
145
157
  /**
146
158
  * @deprecated Use `before.numByteSlice < after.numByteSlice || before.numUint < after.numUint` instead.
@@ -170,10 +182,16 @@ function isSchemaIsBroken(before, after) {
170
182
  async function getCreatorAppsByName(creatorAccount, indexer) {
171
183
  const lookup = await new types_appDeployer.AppDeployer(undefined, undefined, indexer).getCreatorAppsByName(transaction.getSenderAddress(creatorAccount));
172
184
  return {
173
- creator: lookup.creator,
185
+ creator: lookup.creator.toString(),
174
186
  apps: Object.fromEntries(Object.entries(lookup.apps).map(([name, app]) => [
175
187
  name,
176
- { ...app, appId: Number(app.appId), createdRound: Number(app.createdRound), updatedRound: Number(app.updatedRound) },
188
+ {
189
+ ...app,
190
+ appAddress: app.appAddress.toString(),
191
+ appId: Number(app.appId),
192
+ createdRound: Number(app.createdRound),
193
+ updatedRound: Number(app.updatedRound),
194
+ },
177
195
  ])),
178
196
  };
179
197
  }
package/app-deploy.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"app-deploy.js","sources":["../src/app-deploy.ts"],"sourcesContent":["import algosdk 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: deployment.existingDeployments.creator,\n apps: Object.fromEntries(\n Object.entries(deployment.existingDeployments.apps).map(([name, app]) => [\n name,\n { ...app, appId: BigInt(app.appId), createdRound: BigInt(app.createdRound), updatedRound: BigInt(app.updatedRound) },\n ]),\n ),\n }\n : undefined,\n maxRoundsToWaitForConfirmation: deployment.maxRoundsToWaitForConfirmation,\n populateAppCallResources: deployment.populateAppCallResources,\n suppressLog: deployment.suppressLog,\n })\n\n return { ...result, appId: Number(result.appId), createdRound: Number(result.createdRound), updatedRound: Number(result.updatedRound) }\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,\n apps: Object.fromEntries(\n Object.entries(lookup.apps).map(([name, app]) => [\n name,\n { ...app, appId: Number(app.appId), createdRound: Number(app.createdRound), updatedRound: Number(app.updatedRound) },\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","APP_DEPLOY_NOTE_DAPP","compileTeal"],"mappings":";;;;;;;;;;;;;AAiCA;;;;;;;;;;;;;;;;AAgBG;AACI,eAAe,SAAS,CAC7B,UAA+B,EAC/B,KAAc,EACd,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iB,CAAC,QAAQ,CAAC;AAEtC,IAAA,QAAQ,GAAG,2BAA2B,CAAC,QAAQ,EAAE,cAAc,CAAC;IAEhE,IAAI,kBAAkB,EAAE;AACtB,QAAA,QAAQ,GAAG,8BAA8B,CAAC,QAAQ,EAAE,kBAAkB,CAAC;;AAGzE,IAAA,OAAO,MAAMW,eAAW,CAAC,QAAQ,EAAE,KAAK,CAAC;AAC3C;AAEA;;;;;;;AAOG;AACG,SAAU,iBAAiB,CAAC,QAAgB,EAAA;AAChD,IAAA,OAAOX,2BAAU,CAAC,iBAAiB,CAAC,QAAQ,CAAC;AAC/C;;;;;;;;;;;"}
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;AACxC,IAAA,MAAM,QAAQ,GAAG,MACf,IAAIC,kCAAmB,CAAC;QACtB,KAAK;QACL,SAAS,EAAE,MAAMC,sCAA0B,CAAC,UAAU,CAAC,IAAI,CAAC;QAC5D,kBAAkB,EAAE,YAClB,UAAU,CAAC,iBAAiB,GAAG,EAAE,GAAG,UAAU,CAAC,iBAAiB,EAAE,GAAG,MAAM,KAAK,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