@algorandfoundation/algokit-utils 9.0.0-beta.1 → 9.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 (48) hide show
  1. package/account/account.d.ts +2 -2
  2. package/account/account.js +2 -2
  3. package/account/account.js.map +1 -1
  4. package/account/account.mjs +2 -2
  5. package/account/account.mjs.map +1 -1
  6. package/indexer-lookup.js +1 -1
  7. package/indexer-lookup.js.map +1 -1
  8. package/indexer-lookup.mjs +1 -1
  9. package/indexer-lookup.mjs.map +1 -1
  10. package/package.json +1 -1
  11. package/transaction/transaction.d.ts +1 -1
  12. package/transaction/transaction.js +1 -1
  13. package/transaction/transaction.js.map +1 -1
  14. package/transaction/transaction.mjs +1 -1
  15. package/transaction/transaction.mjs.map +1 -1
  16. package/transfer/transfer.d.ts +2 -2
  17. package/transfer/transfer.js +2 -2
  18. package/transfer/transfer.js.map +1 -1
  19. package/transfer/transfer.mjs +2 -2
  20. package/transfer/transfer.mjs.map +1 -1
  21. package/types/account-manager.d.ts +5 -5
  22. package/types/account-manager.js +5 -5
  23. package/types/account-manager.js.map +1 -1
  24. package/types/account-manager.mjs +5 -5
  25. package/types/account-manager.mjs.map +1 -1
  26. package/types/algorand-client-transaction-sender.d.ts +78 -0
  27. package/types/app.d.ts +2 -2
  28. package/types/app.js.map +1 -1
  29. package/types/app.mjs.map +1 -1
  30. package/types/asset-manager.d.ts +1 -1
  31. package/types/asset-manager.js +1 -1
  32. package/types/asset-manager.js.map +1 -1
  33. package/types/asset-manager.mjs +1 -1
  34. package/types/asset-manager.mjs.map +1 -1
  35. package/types/asset.d.ts +2 -2
  36. package/types/client-manager.d.ts +3 -3
  37. package/types/client-manager.js.map +1 -1
  38. package/types/client-manager.mjs.map +1 -1
  39. package/types/composer.d.ts +9 -9
  40. package/types/composer.js.map +1 -1
  41. package/types/composer.mjs.map +1 -1
  42. package/types/indexer.d.ts +36 -37
  43. package/types/indexer.js +1 -1
  44. package/types/indexer.js.map +1 -1
  45. package/types/indexer.mjs +1 -1
  46. package/types/indexer.mjs.map +1 -1
  47. package/types/transaction.d.ts +1 -1
  48. package/types/transfer.d.ts +4 -4
@@ -116,7 +116,7 @@ export type AccountInformation = Omit<NumberConverter<AccountInformationModel>,
116
116
  * const accountInfo = await account.getInformation(address, algod);
117
117
  * ```
118
118
  *
119
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddress)
119
+ * [Response data schema details](https://dev.algorand.co/reference/rest-apis/algod/#accountinformation)
120
120
  * @param sender The address of the sender/account to look up
121
121
  * @param algod The algod instance
122
122
  * @returns The account information
@@ -134,7 +134,7 @@ export declare function getAccountInformation(sender: string | SendTransactionFr
134
134
  * const accountInfo = await account.getAccountAssetInformation(address, assetId, algod);
135
135
  * ```
136
136
  *
137
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddressassetsasset-id)
137
+ * [Response data schema details](https://dev.algorand.co/reference/rest-apis/algod/#accountassetinformation)
138
138
  * @param sender The address of the sender/account to look up
139
139
  * @param assetId The ID of the asset to return a holding for
140
140
  * @param algod The algod instance
@@ -118,7 +118,7 @@ function getAccountAddressAsString(addressEncodedInB64) {
118
118
  * const accountInfo = await account.getInformation(address, algod);
119
119
  * ```
120
120
  *
121
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddress)
121
+ * [Response data schema details](https://dev.algorand.co/reference/rest-apis/algod/#accountinformation)
122
122
  * @param sender The address of the sender/account to look up
123
123
  * @param algod The algod instance
124
124
  * @returns The account information
@@ -160,7 +160,7 @@ async function getAccountInformation(sender, algod) {
160
160
  * const accountInfo = await account.getAccountAssetInformation(address, assetId, algod);
161
161
  * ```
162
162
  *
163
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddressassetsasset-id)
163
+ * [Response data schema details](https://dev.algorand.co/reference/rest-apis/algod/#accountassetinformation)
164
164
  * @param sender The address of the sender/account to look up
165
165
  * @param assetId The ID of the asset to return a holding for
166
166
  * @param algod The algod instance
@@ -1 +1 @@
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"],"mappings":";;;;;;;;;AAeA;;;;;;;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,EAAEC,eAAO,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,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,GAA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enderAddress } 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://dev.algorand.co/reference/rest-apis/algod/#accountinformation)\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://dev.algorand.co/reference/rest-apis/algod/#accountassetinformation)\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"],"mappings":";;;;;;;;;AAeA;;;;;;;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,EAAEC,eAAO,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,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;;;;;;AAMG;AACG,SAAU,6BAA6B,CAAC,OAAqC,EAAA;IACjF,OAAO,OAAO,CAAC,aAAa,CAAC,OAAO,OAAO,KAAK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M,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,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;;;;;;;;;;;;"}
@@ -116,7 +116,7 @@ function getAccountAddressAsString(addressEncodedInB64) {
116
116
  * const accountInfo = await account.getInformation(address, algod);
117
117
  * ```
118
118
  *
119
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddress)
119
+ * [Response data schema details](https://dev.algorand.co/reference/rest-apis/algod/#accountinformation)
120
120
  * @param sender The address of the sender/account to look up
121
121
  * @param algod The algod instance
122
122
  * @returns The account information
@@ -158,7 +158,7 @@ async function getAccountInformation(sender, algod) {
158
158
  * const accountInfo = await account.getAccountAssetInformation(address, assetId, algod);
159
159
  * ```
160
160
  *
161
- * [Response data schema details](https://developer.algorand.org/docs/rest-apis/algod/#get-v2accountsaddressassetsasset-id)
161
+ * [Response data schema details](https://dev.algorand.co/reference/rest-apis/algod/#accountassetinformation)
162
162
  * @param sender The address of the sender/account to look up
163
163
  * @param assetId The ID of the asset to return a holding for
164
164
  * @param algod The algod instance
@@ -1 +1 @@
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,MAA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AC,CAAC,KAAK,CAAC,qBAAqB,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://dev.algorand.co/reference/rest-apis/algod/#accountinformation)\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://dev.algorand.co/reference/rest-apis/algod/#accountassetinformation)\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,CAC3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AAC,OAAO,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;;;;"}
package/indexer-lookup.js CHANGED
@@ -109,7 +109,7 @@ async function searchTransactions(indexer, searchCriteria, paginationLimit) {
109
109
  transactions: transactions,
110
110
  });
111
111
  }
112
- // https://developer.algorand.org/docs/get-details/indexer/#paginated-results
112
+ // https://dev.algorand.co/reference/rest-apis/indexer
113
113
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
114
114
  async function executePaginatedRequest(
115
115
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1 +1 @@
1
- {"version":3,"file":"indexer-lookup.js","sources":["../src/indexer-lookup.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { LookupAssetHoldingsOptions } from './types/indexer'\nimport Indexer = algosdk.Indexer\nexport type SearchForTransactions = ReturnType<Indexer['searchForTransactions']>\n\nconst DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT = 1000 //MaxAPIResourcesPerAccount: This is the default maximum, though may be provider specific\n\n/**\n * @deprecated Use `indexer.lookupTransactionByID(transactionId).do()`.\n * Looks up a transaction by ID using Indexer.\n * @param transactionId The ID of the transaction to look up\n * @param indexer An indexer client\n * @returns The result of the look-up\n */\nexport async function lookupTransactionById(transactionId: string, indexer: Indexer) {\n return await indexer.lookupTransactionByID(transactionId).do()\n}\n\n/**\n * @deprecated Use `indexer.lookupAccountByID(accountAddress).do()`.\n * Looks up an account by address using Indexer.\n * @param accountAddress The address of the account to look up\n * @param indexer An indexer client\n * @returns The result of the look-up\n */\nexport async function lookupAccountByAddress(accountAddress: string | Address, indexer: Indexer) {\n return await indexer.lookupAccountByID(accountAddress).do()\n}\n\n/**\n * Looks up applications that were created by the given address; will automatically paginate through all data.\n * @param indexer An indexer instance\n * @param address The address of the creator to look up\n * @param getAll Whether or not to include deleted applications\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The list of application results\n */\nexport async function lookupAccountCreatedApplicationByAddress(\n indexer: Indexer,\n address: string | Address,\n getAll: boolean | undefined = undefined,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.Application[]> {\n return await executePaginatedRequest(\n (response: algosdk.indexerModels.ApplicationsResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n return response.applications\n },\n (nextToken) => {\n let s = indexer\n .lookupAccountCreatedApplications(address)\n .includeAll(getAll)\n .limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n}\n\n/**\n * Looks up asset holdings for the given asset; will automatically paginate through all data.\n * @param indexer An indexer instance\n * @param assetId The ID of the asset to look up holdings for\n * @param options Optional options to control the lookup\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The list of application results\n */\nexport async function lookupAssetHoldings(\n indexer: Indexer,\n assetId: number | bigint,\n options?: LookupAssetHoldingsOptions,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.MiniAssetHolding[]> {\n return await executePaginatedRequest(\n (response: algosdk.indexerModels.AssetBalancesResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n return response.balances\n },\n (nextToken) => {\n let s = indexer.lookupAssetBalances(Number(assetId)).limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (options?.currencyGreaterThan !== undefined) {\n s = s.currencyGreaterThan(options.currencyGreaterThan)\n }\n if (options?.currencyLessThan !== undefined) {\n s = s.currencyLessThan(options.currencyLessThan)\n }\n if (options?.includeAll !== undefined) {\n s = s.includeAll(options.includeAll)\n }\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n}\n\n/**\n * Allows transactions to be searched for the given criteria.\n * @param indexer An indexer client\n * @param searchCriteria The criteria to search for\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The search results\n */\nexport async function searchTransactions(\n indexer: Indexer,\n searchCriteria: (s: SearchForTransactions) => SearchForTransactions,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.TransactionsResponse> {\n let currentRound = 0n\n const transactions = await executePaginatedRequest(\n (response: algosdk.indexerModels.TransactionsResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n if (response.currentRound > currentRound) {\n currentRound = response.currentRound\n }\n return response.transactions\n },\n (nextToken) => {\n let s = searchCriteria(indexer.searchForTransactions()).limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n\n return new algosdk.indexerModels.TransactionsResponse({\n currentRound,\n nextToken: undefined,\n transactions: transactions,\n })\n}\n\n// https://developer.algorand.org/docs/get-details/indexer/#paginated-results\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function executePaginatedRequest<TResult, TRequest extends { do: () => Promise<any> }>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n extractItems: (response: any) => TResult[],\n buildRequest: (nextToken?: string) => TRequest,\n): Promise<TResult[]> {\n const results = []\n\n let nextToken: string | undefined = undefined\n while (true) {\n const request = buildRequest(nextToken)\n const response = await request.do()\n const items = extractItems(response)\n if (items == null || items.length === 0) {\n break\n }\n results.push(...items)\n nextToken = response['nextToken']\n if (!nextToken) {\n break\n }\n }\n\n return results\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,6CAA6C,GAAG,IAAI,CAAA;AAE1D;;;;;;AAMG;AACI,eAAe,qBAAqB,CAAC,aAAqB,EAAE,OAAgB,EAAA;IACjF,OAAO,MAAM,OAAO,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC,EAAE,EAAE;AAChE;AAEA;;;;;;AAMG;AACI,eAAe,sBAAsB,CAAC,cAAgC,EAAE,OAAgB,EAAA;IAC7F,OAAO,MAAM,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,EAAE,EAAE;AAC7D;AAEA;;;;;;;AAOG;AACI,eAAe,wCAAwC,CAC5D,OAAgB,EAChB,OAAyB,EACzB,MAAA,GAA8B,SAAS,EACvC,eAAwB,EAAA;AAExB,IAAA,OAAO,MAAM,uBAAuB,CAClC,CAAC,QAA0E,KAAI;AAC7E,QAAA,IAAI,SAAS,IAAI,QAAQ,EAAE;YACzB,MAAM,E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AC,EAAE,EAAE;AACnC,QAAA,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC;QACpC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACvC;;AAEF,QAAA,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;AACtB,QAAA,SAAS,GAAG,QAAQ,CAAC,WAAW,CAAC;QACjC,IAAI,CAAC,SAAS,EAAE;YACd;;;AAIJ,IAAA,OAAO,OAAO;AAChB;;;;;;;;;"}
1
+ {"version":3,"file":"indexer-lookup.js","sources":["../src/indexer-lookup.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { LookupAssetHoldingsOptions } from './types/indexer'\nimport Indexer = algosdk.Indexer\nexport type SearchForTransactions = ReturnType<Indexer['searchForTransactions']>\n\nconst DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT = 1000 //MaxAPIResourcesPerAccount: This is the default maximum, though may be provider specific\n\n/**\n * @deprecated Use `indexer.lookupTransactionByID(transactionId).do()`.\n * Looks up a transaction by ID using Indexer.\n * @param transactionId The ID of the transaction to look up\n * @param indexer An indexer client\n * @returns The result of the look-up\n */\nexport async function lookupTransactionById(transactionId: string, indexer: Indexer) {\n return await indexer.lookupTransactionByID(transactionId).do()\n}\n\n/**\n * @deprecated Use `indexer.lookupAccountByID(accountAddress).do()`.\n * Looks up an account by address using Indexer.\n * @param accountAddress The address of the account to look up\n * @param indexer An indexer client\n * @returns The result of the look-up\n */\nexport async function lookupAccountByAddress(accountAddress: string | Address, indexer: Indexer) {\n return await indexer.lookupAccountByID(accountAddress).do()\n}\n\n/**\n * Looks up applications that were created by the given address; will automatically paginate through all data.\n * @param indexer An indexer instance\n * @param address The address of the creator to look up\n * @param getAll Whether or not to include deleted applications\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The list of application results\n */\nexport async function lookupAccountCreatedApplicationByAddress(\n indexer: Indexer,\n address: string | Address,\n getAll: boolean | undefined = undefined,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.Application[]> {\n return await executePaginatedRequest(\n (response: algosdk.indexerModels.ApplicationsResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n return response.applications\n },\n (nextToken) => {\n let s = indexer\n .lookupAccountCreatedApplications(address)\n .includeAll(getAll)\n .limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n}\n\n/**\n * Looks up asset holdings for the given asset; will automatically paginate through all data.\n * @param indexer An indexer instance\n * @param assetId The ID of the asset to look up holdings for\n * @param options Optional options to control the lookup\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The list of application results\n */\nexport async function lookupAssetHoldings(\n indexer: Indexer,\n assetId: number | bigint,\n options?: LookupAssetHoldingsOptions,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.MiniAssetHolding[]> {\n return await executePaginatedRequest(\n (response: algosdk.indexerModels.AssetBalancesResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n return response.balances\n },\n (nextToken) => {\n let s = indexer.lookupAssetBalances(Number(assetId)).limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (options?.currencyGreaterThan !== undefined) {\n s = s.currencyGreaterThan(options.currencyGreaterThan)\n }\n if (options?.currencyLessThan !== undefined) {\n s = s.currencyLessThan(options.currencyLessThan)\n }\n if (options?.includeAll !== undefined) {\n s = s.includeAll(options.includeAll)\n }\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n}\n\n/**\n * Allows transactions to be searched for the given criteria.\n * @param indexer An indexer client\n * @param searchCriteria The criteria to search for\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The search results\n */\nexport async function searchTransactions(\n indexer: Indexer,\n searchCriteria: (s: SearchForTransactions) => SearchForTransactions,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.TransactionsResponse> {\n let currentRound = 0n\n const transactions = await executePaginatedRequest(\n (response: algosdk.indexerModels.TransactionsResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n if (response.currentRound > currentRound) {\n currentRound = response.currentRound\n }\n return response.transactions\n },\n (nextToken) => {\n let s = searchCriteria(indexer.searchForTransactions()).limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n\n return new algosdk.indexerModels.TransactionsResponse({\n currentRound,\n nextToken: undefined,\n transactions: transactions,\n })\n}\n\n// https://dev.algorand.co/reference/rest-apis/indexer\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function executePaginatedRequest<TResult, TRequest extends { do: () => Promise<any> }>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n extractItems: (response: any) => TResult[],\n buildRequest: (nextToken?: string) => TRequest,\n): Promise<TResult[]> {\n const results = []\n\n let nextToken: string | undefined = undefined\n while (true) {\n const request = buildRequest(nextToken)\n const response = await request.do()\n const items = extractItems(response)\n if (items == null || items.length === 0) {\n break\n }\n results.push(...items)\n nextToken = response['nextToken']\n if (!nextToken) {\n break\n }\n }\n\n return results\n}\n"],"names":[],"mappings":";;;;AAKA,MAAM,6CAA6C,GAAG,IAAI,CAAA;AAE1D;;;;;;AAMG;AACI,eAAe,qBAAqB,CAAC,aAAqB,EAAE,OAAgB,EAAA;IACjF,OAAO,MAAM,OAAO,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC,EAAE,EAAE;AAChE;AAEA;;;;;;AAMG;AACI,eAAe,sBAAsB,CAAC,cAAgC,EAAE,OAAgB,EAAA;IAC7F,OAAO,MAAM,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,EAAE,EAAE;AAC7D;AAEA;;;;;;;AAOG;AACI,eAAe,wCAAwC,CAC5D,OAAgB,EAChB,O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AAG,EAAE;IAElB,IAAI,SAAS,GAAuB,SAAS;IAC7C,OAAO,IAAI,EAAE;AACX,QAAA,MAAM,OAAO,GAAG,YAAY,CAAC,SAAS,CAAC;AACvC,QAAA,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,EAAE,EAAE;AACnC,QAAA,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC;QACpC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACvC;;AAEF,QAAA,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;AACtB,QAAA,SAAS,GAAG,QAAQ,CAAC,WAAW,CAAC;QACjC,IAAI,CAAC,SAAS,EAAE;YACd;;;AAIJ,IAAA,OAAO,OAAO;AAChB;;;;;;;;;"}
@@ -107,7 +107,7 @@ async function searchTransactions(indexer, searchCriteria, paginationLimit) {
107
107
  transactions: transactions,
108
108
  });
109
109
  }
110
- // https://developer.algorand.org/docs/get-details/indexer/#paginated-results
110
+ // https://dev.algorand.co/reference/rest-apis/indexer
111
111
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
112
112
  async function executePaginatedRequest(
113
113
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -1 +1 @@
1
- {"version":3,"file":"indexer-lookup.mjs","sources":["../src/indexer-lookup.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { LookupAssetHoldingsOptions } from './types/indexer'\nimport Indexer = algosdk.Indexer\nexport type SearchForTransactions = ReturnType<Indexer['searchForTransactions']>\n\nconst DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT = 1000 //MaxAPIResourcesPerAccount: This is the default maximum, though may be provider specific\n\n/**\n * @deprecated Use `indexer.lookupTransactionByID(transactionId).do()`.\n * Looks up a transaction by ID using Indexer.\n * @param transactionId The ID of the transaction to look up\n * @param indexer An indexer client\n * @returns The result of the look-up\n */\nexport async function lookupTransactionById(transactionId: string, indexer: Indexer) {\n return await indexer.lookupTransactionByID(transactionId).do()\n}\n\n/**\n * @deprecated Use `indexer.lookupAccountByID(accountAddress).do()`.\n * Looks up an account by address using Indexer.\n * @param accountAddress The address of the account to look up\n * @param indexer An indexer client\n * @returns The result of the look-up\n */\nexport async function lookupAccountByAddress(accountAddress: string | Address, indexer: Indexer) {\n return await indexer.lookupAccountByID(accountAddress).do()\n}\n\n/**\n * Looks up applications that were created by the given address; will automatically paginate through all data.\n * @param indexer An indexer instance\n * @param address The address of the creator to look up\n * @param getAll Whether or not to include deleted applications\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The list of application results\n */\nexport async function lookupAccountCreatedApplicationByAddress(\n indexer: Indexer,\n address: string | Address,\n getAll: boolean | undefined = undefined,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.Application[]> {\n return await executePaginatedRequest(\n (response: algosdk.indexerModels.ApplicationsResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n return response.applications\n },\n (nextToken) => {\n let s = indexer\n .lookupAccountCreatedApplications(address)\n .includeAll(getAll)\n .limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n}\n\n/**\n * Looks up asset holdings for the given asset; will automatically paginate through all data.\n * @param indexer An indexer instance\n * @param assetId The ID of the asset to look up holdings for\n * @param options Optional options to control the lookup\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The list of application results\n */\nexport async function lookupAssetHoldings(\n indexer: Indexer,\n assetId: number | bigint,\n options?: LookupAssetHoldingsOptions,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.MiniAssetHolding[]> {\n return await executePaginatedRequest(\n (response: algosdk.indexerModels.AssetBalancesResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n return response.balances\n },\n (nextToken) => {\n let s = indexer.lookupAssetBalances(Number(assetId)).limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (options?.currencyGreaterThan !== undefined) {\n s = s.currencyGreaterThan(options.currencyGreaterThan)\n }\n if (options?.currencyLessThan !== undefined) {\n s = s.currencyLessThan(options.currencyLessThan)\n }\n if (options?.includeAll !== undefined) {\n s = s.includeAll(options.includeAll)\n }\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n}\n\n/**\n * Allows transactions to be searched for the given criteria.\n * @param indexer An indexer client\n * @param searchCriteria The criteria to search for\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The search results\n */\nexport async function searchTransactions(\n indexer: Indexer,\n searchCriteria: (s: SearchForTransactions) => SearchForTransactions,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.TransactionsResponse> {\n let currentRound = 0n\n const transactions = await executePaginatedRequest(\n (response: algosdk.indexerModels.TransactionsResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n if (response.currentRound > currentRound) {\n currentRound = response.currentRound\n }\n return response.transactions\n },\n (nextToken) => {\n let s = searchCriteria(indexer.searchForTransactions()).limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n\n return new algosdk.indexerModels.TransactionsResponse({\n currentRound,\n nextToken: undefined,\n transactions: transactions,\n })\n}\n\n// https://developer.algorand.org/docs/get-details/indexer/#paginated-results\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function executePaginatedRequest<TResult, TRequest extends { do: () => Promise<any> }>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n extractItems: (response: any) => TResult[],\n buildRequest: (nextToken?: string) => TRequest,\n): Promise<TResult[]> {\n const results = []\n\n let nextToken: string | undefined = undefined\n while (true) {\n const request = buildRequest(nextToken)\n const response = await request.do()\n const items = extractItems(response)\n if (items == null || items.length === 0) {\n break\n }\n results.push(...items)\n nextToken = response['nextToken']\n if (!next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O,CAAC,qBAAqB,EAAE,CAAC,CAAC,KAAK,CAAC,eAAe,IAAI,6CAA6C,CAAC;QAC/H,IAAI,SAAS,EAAE;AACb,YAAA,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC;;AAE5B,QAAA,OAAO,CAAC;AACV,KAAC,CACF;AAED,IAAA,OAAO,IAAI,OAAO,CAAC,aAAa,CAAC,oBAAoB,CAAC;QACpD,YAAY;AACZ,QAAA,SAAS,EAAE,SAAS;AACpB,QAAA,YAAY,EAAE,YAAY;AAC3B,KAAA,CAAC;AACJ;AAEA;AACA;AACO,eAAe,uBAAuB;AAC3C;AACA,YAA0C,EAC1C,YAA8C,EAAA;IAE9C,MAAM,OAAO,GAAG,EAAE;IAElB,IAAI,SAAS,GAAuB,SAAS;IAC7C,OAAO,IAAI,EAAE;AACX,QAAA,MAAM,OAAO,GAAG,YAAY,CAAC,SAAS,CAAC;AACvC,QAAA,MAAM,QAAQ,GAAG,MAAM,OAAO,CAAC,EAAE,EAAE;AACnC,QAAA,MAAM,KAAK,GAAG,YAAY,CAAC,QAAQ,CAAC;QACpC,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE;YACvC;;AAEF,QAAA,OAAO,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;AACtB,QAAA,SAAS,GAAG,QAAQ,CAAC,WAAW,CAAC;QACjC,IAAI,CAAC,SAAS,EAAE;YACd;;;AAIJ,IAAA,OAAO,OAAO;AAChB;;;;"}
1
+ {"version":3,"file":"indexer-lookup.mjs","sources":["../src/indexer-lookup.ts"],"sourcesContent":["import algosdk, { Address } from 'algosdk'\nimport { LookupAssetHoldingsOptions } from './types/indexer'\nimport Indexer = algosdk.Indexer\nexport type SearchForTransactions = ReturnType<Indexer['searchForTransactions']>\n\nconst DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT = 1000 //MaxAPIResourcesPerAccount: This is the default maximum, though may be provider specific\n\n/**\n * @deprecated Use `indexer.lookupTransactionByID(transactionId).do()`.\n * Looks up a transaction by ID using Indexer.\n * @param transactionId The ID of the transaction to look up\n * @param indexer An indexer client\n * @returns The result of the look-up\n */\nexport async function lookupTransactionById(transactionId: string, indexer: Indexer) {\n return await indexer.lookupTransactionByID(transactionId).do()\n}\n\n/**\n * @deprecated Use `indexer.lookupAccountByID(accountAddress).do()`.\n * Looks up an account by address using Indexer.\n * @param accountAddress The address of the account to look up\n * @param indexer An indexer client\n * @returns The result of the look-up\n */\nexport async function lookupAccountByAddress(accountAddress: string | Address, indexer: Indexer) {\n return await indexer.lookupAccountByID(accountAddress).do()\n}\n\n/**\n * Looks up applications that were created by the given address; will automatically paginate through all data.\n * @param indexer An indexer instance\n * @param address The address of the creator to look up\n * @param getAll Whether or not to include deleted applications\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The list of application results\n */\nexport async function lookupAccountCreatedApplicationByAddress(\n indexer: Indexer,\n address: string | Address,\n getAll: boolean | undefined = undefined,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.Application[]> {\n return await executePaginatedRequest(\n (response: algosdk.indexerModels.ApplicationsResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n return response.applications\n },\n (nextToken) => {\n let s = indexer\n .lookupAccountCreatedApplications(address)\n .includeAll(getAll)\n .limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n}\n\n/**\n * Looks up asset holdings for the given asset; will automatically paginate through all data.\n * @param indexer An indexer instance\n * @param assetId The ID of the asset to look up holdings for\n * @param options Optional options to control the lookup\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The list of application results\n */\nexport async function lookupAssetHoldings(\n indexer: Indexer,\n assetId: number | bigint,\n options?: LookupAssetHoldingsOptions,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.MiniAssetHolding[]> {\n return await executePaginatedRequest(\n (response: algosdk.indexerModels.AssetBalancesResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n return response.balances\n },\n (nextToken) => {\n let s = indexer.lookupAssetBalances(Number(assetId)).limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (options?.currencyGreaterThan !== undefined) {\n s = s.currencyGreaterThan(options.currencyGreaterThan)\n }\n if (options?.currencyLessThan !== undefined) {\n s = s.currencyLessThan(options.currencyLessThan)\n }\n if (options?.includeAll !== undefined) {\n s = s.includeAll(options.includeAll)\n }\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n}\n\n/**\n * Allows transactions to be searched for the given criteria.\n * @param indexer An indexer client\n * @param searchCriteria The criteria to search for\n * @param paginationLimit The number of records to return per paginated request, default 1000\n * @returns The search results\n */\nexport async function searchTransactions(\n indexer: Indexer,\n searchCriteria: (s: SearchForTransactions) => SearchForTransactions,\n paginationLimit?: number,\n): Promise<algosdk.indexerModels.TransactionsResponse> {\n let currentRound = 0n\n const transactions = await executePaginatedRequest(\n (response: algosdk.indexerModels.TransactionsResponse | { message: string }) => {\n if ('message' in response) {\n throw { status: 404, ...response }\n }\n if (response.currentRound > currentRound) {\n currentRound = response.currentRound\n }\n return response.transactions\n },\n (nextToken) => {\n let s = searchCriteria(indexer.searchForTransactions()).limit(paginationLimit ?? DEFAULT_INDEXER_MAX_API_RESOURCES_PER_ACCOUNT)\n if (nextToken) {\n s = s.nextToken(nextToken)\n }\n return s\n },\n )\n\n return new algosdk.indexerModels.TransactionsResponse({\n currentRound,\n nextToken: undefined,\n transactions: transactions,\n })\n}\n\n// https://dev.algorand.co/reference/rest-apis/indexer\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport async function executePaginatedRequest<TResult, TRequest extends { do: () => Promise<any> }>(\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n extractItems: (response: any) => TResult[],\n buildRequest: (nextToken?: string) => TRequest,\n): Promise<TResult[]> {\n const results = []\n\n let nextToken: string | undefined = undefined\n while (true) {\n const request = buildRequest(nextToken)\n const response = await request.do()\n const items = extractItems(response)\n if (items == null || items.length === 0) {\n break\n }\n results.push(...items)\n nextToken = response['nextToken']\n if (!nextToken) {\n break\n }\n }\n\n return results\n}\n"],"names":[],"mappings":";;AAKA,MAAM,6CAA6C,GAAG,IAAI,CAAA;AAE1D;;;;;;AAMG;AACI,eAAe,qBAAqB,CAAC,aAAqB,EAAE,OAAgB,EAAA;IACjF,OAAO,MAAM,OAAO,CAAC,qBAAqB,CAAC,aAAa,CAAC,CAAC,EAAE,EAAE;AAChE;AAEA;;;;;;AAMG;AACI,eAAe,sBAAsB,CAAC,cAAgC,EAAE,OAAgB,EAAA;IAC7F,OAAO,MAAM,OAAO,CAAC,iBAAiB,CAAC,cAAc,CAAC,CAAC,EAAE,EAAE;AAC7D;AAEA;;;;;;;AAOG;AACI,eAAe,wCAAwC,CAC5D,OAAgB,EAChB,OAAyB,EACzB,MAAA,GAA8B,SAAS,EACvC,eAAwB,EAAA;AAExB,IAAA,OAAO,MAAM,uBAAuB,CAClC,CAAC,QAA0E,KAAI;AAC7E,QAAA,IAAI,SAAS,IAAI,QAAQ,EAAE;YACzB,MAAM,EAAE,MAAM,EAAE,GAAG,EAAE,GAAG,QAAQ,EAAE;;QAEpC,OAAO,QAAQ,CAAC,YAAY;AAC9B,KAAC,EACD,CAAC,SAAS,KAAI;QACZ,IAAI,CAAC,GAAG;aACL,gCAAgC,CAAC,OAAO;aACxC,UAAU,CAAC,MAAM;AACjB,aAAA,KAAK,CAAC,eAAe,IAAI,6CAA6C,CAAC;QAC1E,IAAI,SAAS,EAAE;AACb,YAAA,CAAC,GAAG,CAAC,CAAC,SAAS,CAAC,SAAS,CAAC;;AAE5B,QAAA,OAAO,CAAC;AACV,KAAC,CACF;AACH;AAEA;;;;;;;AAOG;AACI,eAAe,mBAAmB,CACvC,OAAgB,EAChB,OAAwB,EACxB,OAAoC,EACpC,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10
  "private": false,
11
11
  "description": "A set of core Algorand utilities written in TypeScript and released via npm that make it easier to build solutions on Algorand.",
12
12
  "author": "Algorand Foundation",
@@ -148,7 +148,7 @@ export declare function getABIReturnValue(result: algosdk.ABIResult): ABIReturn;
148
148
  /**
149
149
  * @deprecated Use `TransactionComposer` (`algorand.newGroup()`) or `AtomicTransactionComposer` to construct and send group transactions instead.
150
150
  *
151
- * Signs and sends a group of [up to 16](https://developer.algorand.org/docs/get-details/atomic_transfers/#create-transactions) transactions to the chain
151
+ * Signs and sends a group of [up to 16](https://dev.algorand.co/concepts/transactions/atomic-txn-groups/#create-transactions) transactions to the chain
152
152
  *
153
153
  * @param groupSend The group details to send, with:
154
154
  * * `transactions`: The array of transactions to send along with their signing account
@@ -772,7 +772,7 @@ function getABIReturnValue(result) {
772
772
  /**
773
773
  * @deprecated Use `TransactionComposer` (`algorand.newGroup()`) or `AtomicTransactionComposer` to construct and send group transactions instead.
774
774
  *
775
- * Signs and sends a group of [up to 16](https://developer.algorand.org/docs/get-details/atomic_transfers/#create-transactions) transactions to the chain
775
+ * Signs and sends a group of [up to 16](https://dev.algorand.co/concepts/transactions/atomic-txn-groups/#create-transactions) transactions to the chain
776
776
  *
777
777
  * @param groupSend The group details to send, with:
778
778
  * * `transactions`: The array of transactions to send along with their signing account