@algorandfoundation/algokit-utils 7.0.0-beta.8 → 7.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 (189) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +7 -0
  3. package/account/account.js +6 -4
  4. package/account/account.js.map +1 -1
  5. package/account/account.mjs +6 -4
  6. package/account/account.mjs.map +1 -1
  7. package/account/get-account-config-from-environment.js.map +1 -1
  8. package/account/get-account-config-from-environment.mjs.map +1 -1
  9. package/account/get-account.js.map +1 -1
  10. package/account/get-account.mjs.map +1 -1
  11. package/account/get-dispenser-account.js.map +1 -1
  12. package/account/get-dispenser-account.mjs.map +1 -1
  13. package/account/mnemonic-account.js.map +1 -1
  14. package/account/mnemonic-account.mjs.map +1 -1
  15. package/amount.js.map +1 -1
  16. package/amount.mjs.map +1 -1
  17. package/app-client.js.map +1 -1
  18. package/app-client.mjs.map +1 -1
  19. package/app-deploy.js +2 -10
  20. package/app-deploy.js.map +1 -1
  21. package/app-deploy.mjs +3 -11
  22. package/app-deploy.mjs.map +1 -1
  23. package/app.d.ts +2 -2
  24. package/app.js +2 -2
  25. package/app.js.map +1 -1
  26. package/app.mjs +2 -2
  27. package/app.mjs.map +1 -1
  28. package/asset.js.map +1 -1
  29. package/asset.mjs.map +1 -1
  30. package/debugging/debugging.js.map +1 -1
  31. package/debugging/debugging.mjs.map +1 -1
  32. package/dispenser-client.js.map +1 -1
  33. package/dispenser-client.mjs.map +1 -1
  34. package/index.d.ts +1 -0
  35. package/index.js +6 -0
  36. package/index.js.map +1 -1
  37. package/index.mjs +2 -1
  38. package/index.mjs.map +1 -1
  39. package/indexer-lookup.js.map +1 -1
  40. package/indexer-lookup.mjs.map +1 -1
  41. package/localnet/get-kmd-wallet-account.js.map +1 -1
  42. package/localnet/get-kmd-wallet-account.mjs.map +1 -1
  43. package/localnet/get-localnet-dispenser-account.js.map +1 -1
  44. package/localnet/get-localnet-dispenser-account.mjs.map +1 -1
  45. package/localnet/get-or-create-kmd-wallet-account.js.map +1 -1
  46. package/localnet/get-or-create-kmd-wallet-account.mjs.map +1 -1
  47. package/localnet/is-localnet.js.map +1 -1
  48. package/localnet/is-localnet.mjs.map +1 -1
  49. package/network-client.js.map +1 -1
  50. package/network-client.mjs.map +1 -1
  51. package/package.json +5 -5
  52. package/testing/account.js.map +1 -1
  53. package/testing/account.mjs.map +1 -1
  54. package/testing/fixtures/algokit-log-capture-fixture.js.map +1 -1
  55. package/testing/fixtures/algokit-log-capture-fixture.mjs.map +1 -1
  56. package/testing/fixtures/algorand-fixture.js.map +1 -1
  57. package/testing/fixtures/algorand-fixture.mjs.map +1 -1
  58. package/testing/indexer.js.map +1 -1
  59. package/testing/indexer.mjs.map +1 -1
  60. package/testing/test-logger.js.map +1 -1
  61. package/testing/test-logger.mjs.map +1 -1
  62. package/testing/transaction-logger.js.map +1 -1
  63. package/testing/transaction-logger.mjs.map +1 -1
  64. package/transaction/legacy-bridge.js +2 -2
  65. package/transaction/legacy-bridge.js.map +1 -1
  66. package/transaction/legacy-bridge.mjs +3 -3
  67. package/transaction/legacy-bridge.mjs.map +1 -1
  68. package/transaction/perform-atomic-transaction-composer-simulate.js +1 -0
  69. package/transaction/perform-atomic-transaction-composer-simulate.js.map +1 -1
  70. package/transaction/perform-atomic-transaction-composer-simulate.mjs +1 -0
  71. package/transaction/perform-atomic-transaction-composer-simulate.mjs.map +1 -1
  72. package/transaction/transaction.d.ts +14 -7
  73. package/transaction/transaction.js +57 -31
  74. package/transaction/transaction.js.map +1 -1
  75. package/transaction/transaction.mjs +55 -30
  76. package/transaction/transaction.mjs.map +1 -1
  77. package/transfer/transfer-algos.js.map +1 -1
  78. package/transfer/transfer-algos.mjs.map +1 -1
  79. package/transfer/transfer.js.map +1 -1
  80. package/transfer/transfer.mjs.map +1 -1
  81. package/types/account-manager.d.ts +1 -1
  82. package/types/account-manager.js +10 -8
  83. package/types/account-manager.js.map +1 -1
  84. package/types/account-manager.mjs +11 -9
  85. package/types/account-manager.mjs.map +1 -1
  86. package/types/account.d.ts +9 -0
  87. package/types/account.js.map +1 -1
  88. package/types/account.mjs.map +1 -1
  89. package/types/algo-http-client-with-retry.js.map +1 -1
  90. package/types/algo-http-client-with-retry.mjs.map +1 -1
  91. package/types/algorand-client-interface.d.ts +2 -2
  92. package/types/algorand-client-transaction-creator.d.ts +5 -3
  93. package/types/algorand-client-transaction-creator.js +3 -1
  94. package/types/algorand-client-transaction-creator.js.map +1 -1
  95. package/types/algorand-client-transaction-creator.mjs +3 -1
  96. package/types/algorand-client-transaction-creator.mjs.map +1 -1
  97. package/types/algorand-client-transaction-sender.d.ts +12 -8
  98. package/types/algorand-client-transaction-sender.js +6 -2
  99. package/types/algorand-client-transaction-sender.js.map +1 -1
  100. package/types/algorand-client-transaction-sender.mjs +6 -2
  101. package/types/algorand-client-transaction-sender.mjs.map +1 -1
  102. package/types/algorand-client.d.ts +3 -4
  103. package/types/algorand-client.js +2 -5
  104. package/types/algorand-client.js.map +1 -1
  105. package/types/algorand-client.mjs +4 -4
  106. package/types/algorand-client.mjs.map +1 -1
  107. package/types/amount.js.map +1 -1
  108. package/types/amount.mjs.map +1 -1
  109. package/types/app-arc56.d.ts +31 -20
  110. package/types/app-arc56.js.map +1 -1
  111. package/types/app-arc56.mjs.map +1 -1
  112. package/types/app-client.d.ts +97 -78
  113. package/types/app-client.js +171 -54
  114. package/types/app-client.js.map +1 -1
  115. package/types/app-client.mjs +169 -52
  116. package/types/app-client.mjs.map +1 -1
  117. package/types/app-deployer.js +1 -1
  118. package/types/app-deployer.js.map +1 -1
  119. package/types/app-deployer.mjs +2 -2
  120. package/types/app-deployer.mjs.map +1 -1
  121. package/types/app-factory.d.ts +30 -10
  122. package/types/app-factory.js +26 -20
  123. package/types/app-factory.js.map +1 -1
  124. package/types/app-factory.mjs +26 -20
  125. package/types/app-factory.mjs.map +1 -1
  126. package/types/app-manager.js +105 -23
  127. package/types/app-manager.js.map +1 -1
  128. package/types/app-manager.mjs +105 -23
  129. package/types/app-manager.mjs.map +1 -1
  130. package/types/app-spec.js +8 -2
  131. package/types/app-spec.js.map +1 -1
  132. package/types/app-spec.mjs +8 -2
  133. package/types/app-spec.mjs.map +1 -1
  134. package/types/app.d.ts +8 -7
  135. package/types/app.js.map +1 -1
  136. package/types/app.mjs.map +1 -1
  137. package/types/asset-manager.d.ts +4 -4
  138. package/types/asset-manager.js +2 -2
  139. package/types/asset-manager.js.map +1 -1
  140. package/types/asset-manager.mjs +2 -2
  141. package/types/asset-manager.mjs.map +1 -1
  142. package/types/async-event-emitter.d.ts +1 -10
  143. package/types/async-event-emitter.js +0 -5
  144. package/types/async-event-emitter.js.map +1 -1
  145. package/types/async-event-emitter.mjs +1 -6
  146. package/types/async-event-emitter.mjs.map +1 -1
  147. package/types/client-manager.js +2 -2
  148. package/types/client-manager.js.map +1 -1
  149. package/types/client-manager.mjs +2 -2
  150. package/types/client-manager.mjs.map +1 -1
  151. package/types/composer.d.ts +40 -25
  152. package/types/composer.js +114 -40
  153. package/types/composer.js.map +1 -1
  154. package/types/composer.mjs +115 -39
  155. package/types/composer.mjs.map +1 -1
  156. package/types/config.js.map +1 -1
  157. package/types/config.mjs.map +1 -1
  158. package/types/debugging.d.ts +1 -1
  159. package/types/debugging.js +1 -1
  160. package/types/debugging.js.map +1 -1
  161. package/types/debugging.mjs +1 -1
  162. package/types/debugging.mjs.map +1 -1
  163. package/types/dispenser-client.js.map +1 -1
  164. package/types/dispenser-client.mjs.map +1 -1
  165. package/types/indexer.js.map +1 -1
  166. package/types/indexer.mjs.map +1 -1
  167. package/types/kmd-account-manager.js +1 -1
  168. package/types/kmd-account-manager.js.map +1 -1
  169. package/types/kmd-account-manager.mjs +2 -2
  170. package/types/kmd-account-manager.mjs.map +1 -1
  171. package/types/lifecycle-events.d.ts +10 -0
  172. package/types/lifecycle-events.js +8 -0
  173. package/types/lifecycle-events.js.map +1 -0
  174. package/types/lifecycle-events.mjs +8 -0
  175. package/types/lifecycle-events.mjs.map +1 -0
  176. package/types/logging.js.map +1 -1
  177. package/types/logging.mjs.map +1 -1
  178. package/types/logic-error.d.ts +2 -3
  179. package/types/logic-error.js +3 -3
  180. package/types/logic-error.js.map +1 -1
  181. package/types/logic-error.mjs +3 -3
  182. package/types/logic-error.mjs.map +1 -1
  183. package/types/network-client.js.map +1 -1
  184. package/types/network-client.mjs.map +1 -1
  185. package/types/testing.d.ts +1 -1
  186. package/types/urlTokenBaseHTTPClient.js.map +1 -1
  187. package/types/urlTokenBaseHTTPClient.mjs.map +1 -1
  188. package/util.js.map +1 -1
  189. package/util.mjs.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"indexer.js","sources":["../../src/types/indexer.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport modelsv2 = algosdk.modelsv2\nimport TransactionType = algosdk.TransactionType\n\n/** Indexer result for a transaction search, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactions */\nexport interface TransactionSearchResults {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned transactions */\n transactions: TransactionResult[]\n}\n\n/** Indexer result for an account lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-id */\nexport interface AccountLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned account */\n account: AccountResult\n}\n\n/** Indexer result for an account's asset holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idassets */\nexport interface AssetsLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned asset holdings */\n assets: AssetHolding[]\n}\n\n/** Indexer result for an account's created assets, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-assets */\nexport interface AssetsCreatedLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned assets */\n assets: AssetResult[]\n}\n\n/** Indexer result for an account's created applications, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-applications */\nexport interface ApplicationCreatedLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned applications */\n applications: ApplicationResult[]\n}\n\n/** Indexer result for an asset lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-id */\nexport interface AssetLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned asset */\n asset: AssetResult\n}\n\n/** Options when looking up an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface LookupAssetHoldingsOptions {\n /** Results should have a decimal units amount less than this value. */\n currencyLessThan?: number\n /** Results should have a decimal units amount greater than this value. */\n currencyGreaterThan?: number\n /** Include all items including closed accounts and opted-out asset holdings. */\n includeAll?: boolean\n}\n\n/** Indexer result for an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface AssetBalancesLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The list of accounts who hold this asset with their balance */\n balances: MiniAssetHolding[]\n}\n\n/** Indexer result for a transaction lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactionstxid */\nexport interface TransactionLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned transaction */\n transaction: TransactionResult\n}\n\n/** Indexer result for an application lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2applicationsapplication-id */\nexport interface ApplicationLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned application */\n application: ApplicationResult\n}\n\n/** Indexer result for a transaction, https://developer.algorand.org/docs/rest-apis/indexer/#transaction */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface TransactionResult extends Record<string, any> {\n /** Transaction ID */\n id: string\n /** [type] Indicates what type of transaction this is. Different types have different fields.\n * Valid types, and where their fields are stored:\n * * [pay] payment-transaction\n * * [keyreg] keyreg-transaction\n * * [acfg] asset-config-transaction\n * * [axfer] asset-transfer-transaction\n * * [afrz] asset-freeze-transaction\n * * [appl] application-transaction\n * * [stpf] state-proof-transaction\n */\n 'tx-type': TransactionType\n /** [fee] Transaction fee. */\n fee: number\n /** [snd] Sender's address. */\n sender: string\n /** [fv] First valid round for this transaction. */\n 'first-valid': number\n /** [lv] Last valid round for this transaction. */\n 'last-valid': number\n /** Round when the transaction was confirmed. */\n 'confirmed-round'?: number\n /** [grp] Base64 encoded byte array of a sha512/256 digest.\n *\n * When present indicates that this transaction is part of a transaction group\n * and the value is the sha512/256 hash of the transactions in that group.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n group?: string\n /**\n * [note] Free form data.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n note?: string\n /** [lg] Logs for the application being executed by this transaction. */\n logs?: string[]\n /** Time when the block this transaction is in was confirmed. */\n 'round-time'?: number\n /** Offset into the round where this transaction was confirmed. */\n 'intra-round-offset'?: number\n /** Signature of the transaction */\n signature?: TransactionSignature\n /** If the transaction is an `appl` transaction this will be populated see `tx-type` */\n 'application-transaction'?: ApplicationTransactionResult\n /** If the transaction is an `appl` transaction that resulted in an application creation then this\n * specifies the application index (ID) of that application.\n */\n 'created-application-index'?: number\n /** If the transaction is an `acfg` transaction this will be populated see `tx-type` */\n 'asset-config-transaction'?: AssetConfigTransactionResult\n /** If the transaction is an `acfg` transaction that resulted in an asset creation then this\n * specifies the asset index (ID) of that asset.\n */\n 'created-asset-index'?: number\n /** If the transaction is an `afrz` transaction this will be populated see `tx-type` */\n 'asset-freeze-transaction'?: AssetFreezeTransactionResult\n /** If the transaction is an `axfer` transaction this will be populated see `tx-type` */\n 'asset-transfer-transaction'?: AssetTransferTransactionResult\n /** If the transaction is a `keyreg` transaction this will be populated see `tx-type` */\n 'keyreg-transaction'?: KeyRegistrationTransactionResult\n /** If the transaction is a `pay` transaction this will be populated see `tx-type` */\n 'payment-transaction'?: PaymentTransactionResult\n /** If the transaction is a `stpf` transaction this will be populated see `tx-type` */\n 'state-proof-transaction'?: StateProofTransactionResult\n /** [sgnr] this is included with signed transactions when the signing address does not equal the sender.\n * The backend can use this to ensure that auth addr is equal to the accounts auth addr.\n */\n 'auth-addr'?: string\n /** [ca] closing amount for transaction. */\n 'closing-amount'?: number\n /** [gh] Hash of genesis block.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'genesis-hash'?: string\n /** [gen] genesis block ID. */\n 'genesis-id'?: string\n /** Inner transactions produced by application execution. */\n 'inner-txns'?: TransactionResult[]\n /** [rekey] when included in a valid transaction, the accounts auth addr will be updated with\n * this value and future signatures must be signed with the key represented by this address.\n */\n 'rekey-to'?: string\n /** [lx] Base64 encoded 32-byte array. Lease enforces mutual exclusion of transactions.\n *\n * If this field is nonzero, then once the transaction is confirmed, it acquires the lease\n * identified by the (Sender, Lease) pair of the transaction until the LastValid round passes.\n *\n * While this transaction possesses the lease, no other transaction specifying this lease can be confirmed.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n lease?: string\n /** [ld] Local state key/value changes for the application being executed by this transaction. */\n 'local-state-delta'?: AccountStateDelta[]\n /** [gd] Global state key/value changes for the application being executed by this transaction. */\n 'global-state-delta'?: StateDelta\n /** [rr] rewards applied to receiver account. */\n 'receiver-rewards'?: number\n /** [rs] rewards applied to sender account. */\n 'sender-rewards'?: number\n /** [rc] rewards applied to close-remainder-to account. */\n 'close-rewards'?: number\n}\n\n/** Account information at a given round https://developer.algorand.org/docs/rest-apis/indexer/#account */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface AccountResult extends Record<string, any> {\n /** the account public key */\n address: string\n /** [algo] total number of µAlgo in the account */\n amount: number\n /** specifies the amount of µAlgo in the account, without the pending rewards. */\n 'amount-without-pending-rewards': number\n /** [appl] applications local data stored in this account.\n *\n * Note the raw object uses map[int] -> AppLocalState for this type.\n */\n 'apps-local-state'?: AppLocalState[]\n /** [teap] the sum of all extra application program pages for this account. */\n 'apps-total-extra-pages'?: number\n /** [tsch] stores the sum of all of the local schemas and global schemas in this account.\n *\n * Note: the raw account uses StateSchema for this type.\n */\n 'apps-total-schema'?: StateSchema\n /** [asset] assets held by this account.\n *\n * Note the raw object uses map[int] -> AssetHolding for this type.\n */\n assets?: AssetHolding[]\n /** [spend] the address against which signing should be checked.\n *\n * If empty, the address of the current account is used.\n *\n * This field can be updated in any transaction by setting the RekeyTo field.\n */\n 'auth-addr'?: string\n /** Round during which this account was most recently closed. */\n 'closed-at-round'?: number\n /** [appp] parameters of applications created by this account including app global data.\n *\n * Note: the raw account uses map[int] -> AppParams for this type.\n */\n 'created-apps'?: ApplicationResult[]\n /** [apar] parameters of assets created by this account.\n *\n * Note: the raw account uses map[int] -> Asset for this type.\n */\n 'created-assets'?: AssetResult[]\n /** Round during which this account first appeared in a transaction. */\n 'created-at-round'?: number\n /** Whether or not this account is currently closed. */\n deleted?: boolean\n /** If participating in consensus, the parameters used by this account in the consensus protocol. */\n participation?: AccountParticipation\n /** amount of µAlgo of pending rewards in this account. */\n 'pending-rewards': number\n /** [ebase] used as part of the rewards computation. Only applicable to accounts which are participating. */\n 'reward-base'?: number\n /** [ern] total rewards of µAlgo the account has received, including pending rewards. */\n rewards: number\n /** The round for which this information is relevant. */\n round: number\n /** Indicates what type of signature is used by this account */\n 'sig-type': SignatureType\n /** [onl] delegation status of the account's µAlgo */\n status: AccountStatus\n /** The count of all applications that have been opted in, equivalent to the count of application local data (AppLocalState objects) stored in this account. */\n 'total-apps-opted-in': number\n /** The count of all assets that have been opted in, equivalent to the count of AssetHolding objects held by this account. */\n 'total-assets-opted-in': number\n /** For app-accounts only. The total number of bytes allocated for the keys and values of boxes which belong to the associated application. */\n 'total-box-bytes': number\n /** For app-accounts only. The total number of boxes which belong to the associated application. */\n 'total-boxes': number\n /** The count of all apps (AppParams objects) created by this account. */\n 'total-created-apps': number\n /** The count of all assets (AssetParams objects) created by this account. */\n 'total-created-assets': number\n}\n\n/** Fields for a payment transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionpayment */\nexport interface PaymentTransactionResult {\n /** [amt] number of µAlgo intended to be transferred. */\n amount: number\n /** Number of µAlgo that were sent to the close-remainder-to address when closing the sender account. */\n 'close-amount'?: number\n /** [close] when set, indicates that the sending account should be closed and all remaining funds be transferred to this address. */\n 'close-remainder-to'?: string\n /** [rcv] receiver's address. */\n receiver: string\n}\n\n/** Fields for a state proof transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionstateproof.\n *\n * See also https://developer.algorand.org/docs/get-details/stateproofs/,\n * https://developer.algorand.org/docs/get-details/stateproofs/light_client/,\n * https://github.com/algorand/go-algorand/blob/master/data/transactions/stateproof.go,\n * https://github.com/algorand/go-algorand/blob/master/crypto/stateproof/structs.go,\n * https://github.com/algorand/go-algorand/blob/master/data/stateproofmsg/message.go, and\n * https://developer.algorand.org/docs/rest-apis/algod/#stateproof.\n */\nexport interface StateProofTransactionResult {\n /** [spmsg] State proof message\n *\n * Message represents the message that the state proofs are attesting to. This message can be\n * used by lightweight client and gives it the ability to verify proofs on the Algorand's state.\n *\n * In addition to that proof, this message also contains fields that\n * are needed in order to verify the next state proofs (VotersCommitment and LnProvenWeight).\n */\n message: {\n /** [b] BlockHeadersCommitment contains a commitment on all light block headers within a state proof interval. */\n 'block-headers-commitment': string\n /** [f] First round the message attests to */\n 'first-attested-round': number\n /** [l] Last round the message attests to */\n 'latest-attested-round': number\n /** [P] An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof. */\n 'ln-proven-weight': number | bigint\n /** [v] The vector commitment root of the top N accounts to sign the next StateProof.\n *\n * Pattern : \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\" */\n 'voters-commitment': string\n }\n /** [sp] a proof on Algorand's state */\n 'state-proof': {\n /** [P] Part proofs that make up the overall proof */\n 'part-proofs': MerkleArrayProof\n /** [pr] The positions that are revealed */\n 'positions-to-reveal': number[]\n /** [r] Reveals is a sparse map from the position being revealed\n * to the corresponding elements from the sigs and participants\n * arrays.\n */\n reveals: {\n /** The position being revealed */\n position: number\n /** [p] Participant\n *\n * A Participant corresponds to an account whose AccountData.Status\n * is Online, and for which the expected sigRound satisfies\n * AccountData.VoteFirstValid <= sigRound <= AccountData.VoteLastValid.\n *\n * In the Algorand ledger, it is possible for multiple accounts to have\n * the same PK. Thus, the PK is not necessarily unique among Participants.\n * However, each account will produce a unique Participant struct, to avoid\n * potential DoS attacks where one account claims to have the same VoteID PK\n * as another account.\n */\n participant: {\n /** [p] PK is the identifier used to verify the signature for a specific participant\n *\n * Verifier is used to verify a merklesignature.Signature produced by merklesignature.Secrets.\n */\n verifier: {\n /** [cmt] Commitment represents the root of the vector commitment tree built upon the MSS keys. */\n commitment: string\n /** [lf] The lifetime of the key */\n 'key-lifetime': number\n }\n /** [w] Weight is AccountData.MicroAlgos. */\n weight: number | bigint\n }\n /** [s] A sigslotCommit is a single slot in the sigs array that forms the state proof. */\n 'sig-slot': {\n /** [l] L is the total weight of signatures in lower-numbered slots.\n * This is initialized once the builder has collected a sufficient\n * number of signatures.\n */\n 'lower-sig-weight': number | bigint\n /** [s] Sig is a signature by the participant on the expected message.\n *\n * Signature represents a signature in the Merkle signature scheme using falcon signatures as an underlying crypto scheme.\n * It consists of an ephemeral public key, a signature, a Merkle verification path and an index.\n * The Merkle signature considered valid only if the Signature is verified under the ephemeral public key and\n * the Merkle verification path verifies that the ephemeral public key is located at the given index of the tree\n * (for the root given in the long-term public key).\n * More details can be found on Algorand's spec\n */\n signature: {\n /** [sig] Signature in the Merkle signature scheme using falcon signatures */\n 'falcon-signature': string\n /** [idx] Merkle array index */\n 'merkle-array-index': number\n /** [prf] Merkle verification path */\n proof: MerkleArrayProof\n /** [vkey] Falcon verifier key */\n 'verifying-key': string\n }\n }\n }[]\n /** [v] Merkle signature salt version */\n 'salt-version': number\n /** [c] Digest of the signature commit */\n 'sig-commit': string\n /** [S] Proofs for the signature */\n 'sig-proofs': MerkleArrayProof\n /** [w] The combined weight of the signatures */\n 'signed-weight': number | bigint\n }\n /** [sptype] State proof type, per https://github.com/algorand/go-algorand/blob/master/protocol/stateproof.go#L24\n *\n * * 0: StateProofBasic is our initial state proof setup. using falcon keys and subset-sum hash\n */\n 'state-proof-type': number\n}\n\n/**\n * Merkle array Proof.\n *\n * Proof is used to convince a verifier about membership of leaves: h0,h1...hn\n * at indexes i0,i1...in on a tree. The verifier has a trusted value of the tree\n * root hash.\n *\n * Path is bounded by MaxNumLeaves since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxTreeDepth / 2\n *\n * Consider two different reveals for the same tree:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^\n * . hints: [a, r, z, z4]\n * . len(hints) = 4\n * ```\n * You need a to combine with b to get q, need r to combine with the computed q and get y, and so on.\n *\n * The worst case is this:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^ ^ ^ ^ ^ ^ ^ ^\n * .\n * . hints: [b, d, e, g, j, l, m, o]\n * . len(hints) = 2^4/2\n * ```\n */\nexport interface MerkleArrayProof {\n /** [hsh] The metadata of the hash factory that was used to hash the proofs */\n 'hash-factory': {\n /** [t] The type of hash https://github.com/algorand/go-algorand/blob/master/crypto/hashes.go#L42 */\n 'hash-type': number\n }\n /** [pth] Path is bounded by MaxNumLeavesOnEncodedTree since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxEncodedTreeDepth / 2\n */\n path: string[]\n /** [td] TreeDepth represents the depth of the tree that is being proven.\n * It is the number of edges from the root to a leaf.\n */\n 'tree-depth': number\n}\n\n/** Fields for an application transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionapplication */\nexport interface ApplicationTransactionResult extends Omit<ApplicationParams, 'creator' | 'global-state'> {\n /** [apat] List of accounts in addition to the sender that may be accessed from the application's approval-program and clear-state-program. */\n accounts?: string[]\n /** [apaa] transaction specific arguments accessed from the application's approval-program and clear-state-program. */\n 'application-args'?: string[]\n /** [apid] ID of the application being configured or empty if creating. */\n 'application-id': number\n /** [apfa] Lists the applications in addition to the application-id whose global states may be accessed by this application's approval-program and clear-state-program. The access is read-only. */\n 'foreign-apps'?: number[]\n /** [apas] lists the assets whose parameters may be accessed by this application's ApprovalProgram and ClearStateProgram. The access is read-only. */\n 'foreign-assets'?: number[]\n /** [apan] defines the what additional actions occur with the transaction. */\n 'on-completion': ApplicationOnComplete\n}\n\n/** Fields for asset allocation, re-configuration, and destruction.\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetconfig\n *\n * A zero value for asset-id indicates asset creation. A zero value for the params indicates asset destruction.\n */\nexport interface AssetConfigTransactionResult {\n /** [xaid] ID of the asset being configured or empty if creating. */\n 'asset-id': number\n /** [apar] the parameters for the asset. */\n params?: AssetParams\n}\n\n/** Fields for an asset freeze transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetfreeze */\nexport interface AssetFreezeTransactionResult {\n /** [fadd] Address of the account whose asset is being frozen or thawed. */\n address: string\n /** [faid] ID of the asset being frozen or thawed. */\n 'asset-id': number\n /** [afrz] The new freeze status. */\n 'new-freeze-status': boolean\n}\n\n/** Fields for an asset transfer transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassettransfer */\nexport interface AssetTransferTransactionResult {\n /** [aamt] Amount of asset to transfer. A zero amount transferred to self allocates that asset in the account's Assets map. */\n amount: number | bigint\n /** [xaid] ID of the asset being transferred. */\n 'asset-id': number\n /** Number of assets transfered to the close-to account as part of the transaction. */\n 'close-amount'?: number | bigint\n /** [aclose] Indicates that the asset should be removed from the account's Assets map, and specifies where the remaining asset holdings should be transferred. It's always valid to transfer remaining asset holdings to the creator account. */\n 'close-to'?: string\n /** [arcv] Recipient address of the transfer. */\n receiver: string\n /** [asnd] The effective sender during a clawback transactions. If this is not a zero value, the real transaction sender must be the Clawback address from the AssetParams. */\n sender?: string\n}\n\n/** Fields for a `keyreg` transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionkeyreg */\nexport interface KeyRegistrationTransactionResult {\n /** [nonpart] Mark the account as participating or non-participating. */\n 'non-participation'?: boolean\n /** [selkey] Public key used with the Verified Random Function (VRF) result during committee selection.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'selection-participation-key'?: string\n /** [selkey] Public key used with the Verified Random Function (VRF) result during committee selection.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'state-proof-key'?: string\n /** [votefst] First round this participation key is valid. */\n 'vote-first-valid'?: number\n /** [votekd] Number of subkeys in each batch of participation keys. */\n 'vote-key-dilution'?: number\n /** [votelst] Last round this participation key is valid. */\n 'vote-last-valid'?: number\n /** [votekey] Participation public key used in key registration transactions.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'vote-participation-key'?: string\n}\n\n/** Specifies both the unique identifier and the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#asset */\nexport interface AssetResult {\n /** Unique asset identifier. */\n index: number\n /** Whether or not this asset is currently deleted. */\n deleted?: boolean\n /** Round during which this asset was created. */\n 'created-at-round'?: number\n /** Round during which this asset was destroyed. */\n 'destroyed-at-round'?: number\n /** The parameters for the asset */\n params: AssetParams\n}\n\n/**\n * The result of looking up an application\n */\nexport interface ApplicationResult {\n id: number\n params: ApplicationParams\n 'created-at-round'?: number\n deleted?: boolean\n 'deleted-at-round'?: number\n}\n\n/** Validation signature associated with some data. Only one of the signatures should be provided. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignature */\nexport interface TransactionSignature {\n /** Logicsig signature */\n logicsig?: LogicTransactionSignature\n /** Multisig signature */\n multisig?: MultisigTransactionSignature\n /** [sig] Standard ed25519 signature.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n sig?: string\n}\n\n/** [lsig] Programatic transaction signature.\n *\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturelogicsig\n *\n * https://developer.algorand.org/docs/get-details/transactions/signatures/#logic-signatures\n */\nexport interface LogicTransactionSignature {\n /** [arg] Logic arguments, base64 encoded. */\n args?: string[]\n /** [l] Program signed by a signature or multi signature, or hashed to be the address of ana ccount.\n *\n * Base64 encoded TEAL program.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n logic: string\n /** The signature of the multisig the logic signature delegating the logicsig. https://developer.algorand.org/docs/get-details/dapps/smart-contracts/smartsigs/modes/#delegated-approval */\n 'multisig-signature'?: MultisigTransactionSignature\n /** [sig] Standard ed25519 signature delegating the logicsig. https://developer.algorand.org/docs/get-details/dapps/smart-contracts/smartsigs/modes/#delegated-approval\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n signature?: string\n}\n\n/** [msig] structure holding multiple subsignatures. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisig */\nexport interface MultisigTransactionSignature {\n /** [subsig] Holds pairs of public key and signatures. */\n subsignature: MultisigTransactionSubSignature[]\n /** [thr] The threshold of signatures required for the multisig */\n threshold: number\n /** [v] The version of the multisig */\n version: number\n}\n\n/** Sub-signature for a multisig signature https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisigsubsignature */\nexport interface MultisigTransactionSubSignature {\n /** [pk] The public key of the account making the signature\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'public-key': string\n /** [s] The signature\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n signature?: string\n}\n\nexport interface EvalDeltaKeyValue {\n key: string\n value: EvalDelta\n}\n\nexport interface AccountStateDelta {\n address: string\n delta: StateDelta\n}\n\nexport type StateDelta = EvalDeltaKeyValue[]\n\n/** Represents a TEAL value delta. https://developer.algorand.org/docs/rest-apis/indexer/#evaldelta */\nexport interface EvalDelta {\n /** [at] delta action. */\n action: number\n /** [bs] bytes value. */\n bytes?: string\n /** [ui] uint value. */\n uint?: number\n}\n\n/** Stores the global information associated with an application https://developer.algorand.org/docs/rest-apis/indexer/#applicationparams */\nexport interface ApplicationParams {\n /** The address that created this application. This is the address where the parameters and global state for this application can be found. */\n creator: string\n /**\n * [apap]/[approv] Logic executed for every application transaction, except when on-completion is set to \"clear\".\n *\n * It can read and write global state for the application, as well as account-specific local state.\n *\n * Approval programs may reject the transaction.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'approval-program': string\n /**\n * [apsu]/[clearp] Logic executed for application transactions with on-completion set to \"clear\".\n *\n * It can read and write global state for the application, as well as account-specific local state.\n *\n * Clear state programs cannot reject the transaction.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'clear-state-program': string\n /** [epp] the amount of extra program pages available to this app. */\n 'extra-program-pages'?: number\n /** [gs] global schema */\n 'global-state': modelsv2.TealKeyValue[]\n /** [gsch] global schema */\n 'global-state-schema'?: StateSchema\n /** [lsch] local schema */\n 'local-state-schema'?: StateSchema\n}\n\n/** Represents a [apls] local-state or [apgs] global-state schema.\n * https://developer.algorand.org/docs/rest-apis/indexer/#stateschema\n *\n * These schemas determine how much storage may be used in a local-state or global-state for an application.\n *\n * The more space used, the larger minimum balance must be maintained in the account holding the data.\n */\nexport interface StateSchema {\n /** Maximum number of TEAL byte slices that may be stored in the key/value store. */\n 'num-byte-slice': number\n /** Maximum number of TEAL uints that may be stored in the key/value store. */\n 'num-uint': number\n}\n\n/** Defines the what additional actions occur with the transaction https://developer.algorand.org/docs/rest-apis/indexer/#oncompletion */\nexport enum ApplicationOnComplete {\n noop = 'noop',\n optin = 'optin',\n closeout = 'closeout',\n clear = 'clear',\n update = 'update',\n delete = 'delete',\n}\n\n/** AssetParams specifies the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#assetparams */\nexport interface AssetParams {\n /**\n * The address that created this asset. This is the address where the parameters\n * for this asset can be found, and also the address where unwanted asset units can\n * be sent in the worst case.\n */\n creator: string\n /**\n * (dc) The number of digits to use after the decimal point when displaying this\n * asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in\n * tenths. If 2, the base unit of the asset is in hundredths, and so on. This value\n * must be between 0 and 19 (inclusive).\n */\n decimals: number | bigint\n /**\n * (t) The total number of units of this asset.\n */\n total: number | bigint\n /**\n * (c) Address of account used to clawback holdings of this asset. If empty,\n * clawback is not permitted.\n */\n clawback?: string\n /**\n * (df) Whether holdings of this asset are frozen by default.\n */\n 'default-frozen'?: boolean\n /**\n * (f) Address of account used to freeze holdings of this asset. If empty, freezing\n * is not permitted.\n */\n freeze?: string\n /**\n * (m) Address of account used to manage the keys of this asset and to destroy it.\n */\n manager?: string\n /**\n * (am) A commitment to some unspecified asset metadata. The format of this\n * metadata is up to the application.\n */\n 'metadata-hash'?: Uint8Array\n /**\n * (an) Name of this asset, as supplied by the creator. Included only when the\n * asset name is composed of printable utf-8 characters.\n */\n name?: string\n /**\n * Base64 encoded name of this asset, as supplied by the creator.\n */\n 'name-b64'?: Uint8Array\n /**\n * (r) Address of account holding reserve (non-minted) units of this asset.\n */\n reserve?: string\n /**\n * (un) Name of a unit of this asset, as supplied by the creator. Included only\n * when the name of a unit of this asset is composed of printable utf-8 characters.\n */\n 'unit-name'?: string\n /**\n * Base64 encoded name of a unit of this asset, as supplied by the creator.\n */\n 'unit-name-b64'?: Uint8Array\n /**\n * (au) URL where more information about the asset can be retrieved. Included only\n * when the URL is composed of printable utf-8 characters.\n */\n url?: string\n /**\n * Base64 encoded URL where more information about the asset can be retrieved.\n */\n 'url-b64'?: Uint8Array\n}\n\n/** Type of signature used by an account */\nexport enum SignatureType {\n /** Normal signature */\n sig = 'sig',\n /** Multisig */\n msig = 'msig',\n /** Logic signature */\n lsig = 'lsig',\n}\n\n/** Delegation status of the account */\nexport enum AccountStatus {\n /** Indicates that the associated account is delegated */\n Offline = 'Offline',\n /** Indicates that the associated account used as part of the delegation pool */\n Online = 'Online',\n /** Indicates that the associated account is neither a delegator nor a delegate */\n NotParticipating = 'NotParticipating',\n}\n\n/** AccountParticipation describes the parameters used by this account in consensus protocol. https://developer.algorand.org/docs/rest-apis/indexer/#accountparticipation */\nexport interface AccountParticipation {\n /** [sel] Selection public key (if any) currently registered for this round.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'selection-participation-key': string\n /** [stprf] Root of the state proof key (if any).\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'state-proof-key'?: string\n /** [voteFst] First round for which this participation is valid. */\n 'vote-first-valid': number\n /** [voteKD] Number of subkeys in each batch of participation keys. */\n 'vote-key-dilution': number\n /** [voteLst] Last round for which this participation is valid. */\n 'vote-last-valid': number\n /** [vote] root participation public key (if any) currently registered for this round.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'vote-participation-key': string\n}\n\n/** Stores local state associated with an application. https://developer.algorand.org/docs/rest-apis/indexer/#applicationlocalstate */\nexport interface AppLocalState {\n /** Round when account closed out of the application. */\n 'closed-out-at-round'?: number\n /** Whether or not the application local state is currently deleted from its account. */\n deleted?: boolean\n /** The application which this local state is for. */\n id: number\n /** [tkv] storage. */\n 'key-value'?: modelsv2.TealKeyValue[]\n /** Round when the account opted into the application. */\n 'opted-in-at-round'?: number\n /** [hsch] schema. */\n schema: StateSchema\n}\n\n/** Describes an asset held by an account. https://developer.algorand.org/docs/rest-apis/indexer/#assetholding */\nexport interface AssetHolding {\n /**\n * (a) number of units held.\n */\n amount: number | bigint\n /**\n * Asset ID of the holding.\n */\n 'asset-id': number\n /** Whether or not the asset holding is currently deleted from its account. */\n deleted?: boolean\n /**\n * [f] whether or not the holding is frozen.\n */\n 'is-frozen': boolean\n /** Round during which the account opted into this asset holding. */\n 'opted-in-at-round': number\n /** Round during which the account opted out of this asset holding. */\n 'opted-out-at-round': number\n}\n\n/** Describes an asset holding for an account of a known asset. https://developer.algorand.org/docs/rest-apis/indexer/#miniassetholding */\nexport interface MiniAssetHolding {\n /**\n * Address of the account that holds the asset.\n */\n address: string\n /**\n * (a) number of units held.\n */\n amount: number | bigint\n /** Whether or not the asset holding is currently deleted from its account. */\n deleted?: boolean\n /**\n * [f] whether or not the holding is frozen.\n */\n 'is-frozen': boolean\n /** Round during which the account opted into this asset holding. */\n 'opted-in-at-round'?: number\n /** Round during which the account opted out of this asset holding. */\n 'opted-out-at-round'?: number\n}\n"],"names":["ApplicationOnComplete","SignatureType","AccountStatus"],"mappings":";;AA+rBA;AACYA,uCAOX;AAPD,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,qBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACrB,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACnB,CAAC,EAPWA,6BAAqB,KAArBA,6BAAqB,GAOhC,EAAA,CAAA,CAAA,CAAA;AA6ED;AACYC,+BAOX;AAPD,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;;AAEX,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;;AAEb,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAPWA,qBAAa,KAAbA,qBAAa,GAOxB,EAAA,CAAA,CAAA,CAAA;AAED;AACYC,+BAOX;AAPD,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;;AAEnB,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;;AAEjB,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC,CAAA;AACvC,CAAC,EAPWA,qBAAa,KAAbA,qBAAa,GAOxB,EAAA,CAAA,CAAA;;"}
1
+ {"version":3,"file":"indexer.js","sources":["../../src/types/indexer.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport modelsv2 = algosdk.modelsv2\nimport TransactionType = algosdk.TransactionType\n\n/** Indexer result for a transaction search, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactions */\nexport interface TransactionSearchResults {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned transactions */\n transactions: TransactionResult[]\n}\n\n/** Indexer result for an account lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-id */\nexport interface AccountLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned account */\n account: AccountResult\n}\n\n/** Indexer result for an account's asset holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idassets */\nexport interface AssetsLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned asset holdings */\n assets: AssetHolding[]\n}\n\n/** Indexer result for an account's created assets, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-assets */\nexport interface AssetsCreatedLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned assets */\n assets: AssetResult[]\n}\n\n/** Indexer result for an account's created applications, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-applications */\nexport interface ApplicationCreatedLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned applications */\n applications: ApplicationResult[]\n}\n\n/** Indexer result for an asset lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-id */\nexport interface AssetLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned asset */\n asset: AssetResult\n}\n\n/** Options when looking up an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface LookupAssetHoldingsOptions {\n /** Results should have a decimal units amount less than this value. */\n currencyLessThan?: number\n /** Results should have a decimal units amount greater than this value. */\n currencyGreaterThan?: number\n /** Include all items including closed accounts and opted-out asset holdings. */\n includeAll?: boolean\n}\n\n/** Indexer result for an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface AssetBalancesLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The list of accounts who hold this asset with their balance */\n balances: MiniAssetHolding[]\n}\n\n/** Indexer result for a transaction lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactionstxid */\nexport interface TransactionLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned transaction */\n transaction: TransactionResult\n}\n\n/** Indexer result for an application lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2applicationsapplication-id */\nexport interface ApplicationLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned application */\n application: ApplicationResult\n}\n\n/** Indexer result for a transaction, https://developer.algorand.org/docs/rest-apis/indexer/#transaction */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface TransactionResult extends Record<string, any> {\n /** Transaction ID */\n id: string\n /** [type] Indicates what type of transaction this is. Different types have different fields.\n * Valid types, and where their fields are stored:\n * * [pay] payment-transaction\n * * [keyreg] keyreg-transaction\n * * [acfg] asset-config-transaction\n * * [axfer] asset-transfer-transaction\n * * [afrz] asset-freeze-transaction\n * * [appl] application-transaction\n * * [stpf] state-proof-transaction\n */\n 'tx-type': TransactionType\n /** [fee] Transaction fee. */\n fee: number\n /** [snd] Sender's address. */\n sender: string\n /** [fv] First valid round for this transaction. */\n 'first-valid': number\n /** [lv] Last valid round for this transaction. */\n 'last-valid': number\n /** Round when the transaction was confirmed. */\n 'confirmed-round'?: number\n /** [grp] Base64 encoded byte array of a sha512/256 digest.\n *\n * When present indicates that this transaction is part of a transaction group\n * and the value is the sha512/256 hash of the transactions in that group.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n group?: string\n /**\n * [note] Free form data.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n note?: string\n /** [lg] Logs for the application being executed by this transaction. */\n logs?: string[]\n /** Time when the block this transaction is in was confirmed. */\n 'round-time'?: number\n /** Offset into the round where this transaction was confirmed. */\n 'intra-round-offset'?: number\n /** Signature of the transaction */\n signature?: TransactionSignature\n /** If the transaction is an `appl` transaction this will be populated see `tx-type` */\n 'application-transaction'?: ApplicationTransactionResult\n /** If the transaction is an `appl` transaction that resulted in an application creation then this\n * specifies the application index (ID) of that application.\n */\n 'created-application-index'?: number\n /** If the transaction is an `acfg` transaction this will be populated see `tx-type` */\n 'asset-config-transaction'?: AssetConfigTransactionResult\n /** If the transaction is an `acfg` transaction that resulted in an asset creation then this\n * specifies the asset index (ID) of that asset.\n */\n 'created-asset-index'?: number\n /** If the transaction is an `afrz` transaction this will be populated see `tx-type` */\n 'asset-freeze-transaction'?: AssetFreezeTransactionResult\n /** If the transaction is an `axfer` transaction this will be populated see `tx-type` */\n 'asset-transfer-transaction'?: AssetTransferTransactionResult\n /** If the transaction is a `keyreg` transaction this will be populated see `tx-type` */\n 'keyreg-transaction'?: KeyRegistrationTransactionResult\n /** If the transaction is a `pay` transaction this will be populated see `tx-type` */\n 'payment-transaction'?: PaymentTransactionResult\n /** If the transaction is a `stpf` transaction this will be populated see `tx-type` */\n 'state-proof-transaction'?: StateProofTransactionResult\n /** [sgnr] this is included with signed transactions when the signing address does not equal the sender.\n * The backend can use this to ensure that auth addr is equal to the accounts auth addr.\n */\n 'auth-addr'?: string\n /** [ca] closing amount for transaction. */\n 'closing-amount'?: number\n /** [gh] Hash of genesis block.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'genesis-hash'?: string\n /** [gen] genesis block ID. */\n 'genesis-id'?: string\n /** Inner transactions produced by application execution. */\n 'inner-txns'?: TransactionResult[]\n /** [rekey] when included in a valid transaction, the accounts auth addr will be updated with\n * this value and future signatures must be signed with the key represented by this address.\n */\n 'rekey-to'?: string\n /** [lx] Base64 encoded 32-byte array. Lease enforces mutual exclusion of transactions.\n *\n * If this field is nonzero, then once the transaction is confirmed, it acquires the lease\n * identified by the (Sender, Lease) pair of the transaction until the LastValid round passes.\n *\n * While this transaction possesses the lease, no other transaction specifying this lease can be confirmed.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n lease?: string\n /** [ld] Local state key/value changes for the application being executed by this transaction. */\n 'local-state-delta'?: AccountStateDelta[]\n /** [gd] Global state key/value changes for the application being executed by this transaction. */\n 'global-state-delta'?: StateDelta\n /** [rr] rewards applied to receiver account. */\n 'receiver-rewards'?: number\n /** [rs] rewards applied to sender account. */\n 'sender-rewards'?: number\n /** [rc] rewards applied to close-remainder-to account. */\n 'close-rewards'?: number\n}\n\n/** Account information at a given round https://developer.algorand.org/docs/rest-apis/indexer/#account */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface AccountResult extends Record<string, any> {\n /** the account public key */\n address: string\n /** [algo] total number of µAlgo in the account */\n amount: number\n /** specifies the amount of µAlgo in the account, without the pending rewards. */\n 'amount-without-pending-rewards': number\n /** [appl] applications local data stored in this account.\n *\n * Note the raw object uses map[int] -> AppLocalState for this type.\n */\n 'apps-local-state'?: AppLocalState[]\n /** [teap] the sum of all extra application program pages for this account. */\n 'apps-total-extra-pages'?: number\n /** [tsch] stores the sum of all of the local schemas and global schemas in this account.\n *\n * Note: the raw account uses StateSchema for this type.\n */\n 'apps-total-schema'?: StateSchema\n /** [asset] assets held by this account.\n *\n * Note the raw object uses map[int] -> AssetHolding for this type.\n */\n assets?: AssetHolding[]\n /** [spend] the address against which signing should be checked.\n *\n * If empty, the address of the current account is used.\n *\n * This field can be updated in any transaction by setting the RekeyTo field.\n */\n 'auth-addr'?: string\n /** Round during which this account was most recently closed. */\n 'closed-at-round'?: number\n /** [appp] parameters of applications created by this account including app global data.\n *\n * Note: the raw account uses map[int] -> AppParams for this type.\n */\n 'created-apps'?: ApplicationResult[]\n /** [apar] parameters of assets created by this account.\n *\n * Note: the raw account uses map[int] -> Asset for this type.\n */\n 'created-assets'?: AssetResult[]\n /** Round during which this account first appeared in a transaction. */\n 'created-at-round'?: number\n /** Whether or not this account is currently closed. */\n deleted?: boolean\n /** If participating in consensus, the parameters used by this account in the consensus protocol. */\n participation?: AccountParticipation\n /** amount of µAlgo of pending rewards in this account. */\n 'pending-rewards': number\n /** [ebase] used as part of the rewards computation. Only applicable to accounts which are participating. */\n 'reward-base'?: number\n /** [ern] total rewards of µAlgo the account has received, including pending rewards. */\n rewards: number\n /** The round for which this information is relevant. */\n round: number\n /** Indicates what type of signature is used by this account */\n 'sig-type': SignatureType\n /** [onl] delegation status of the account's µAlgo */\n status: AccountStatus\n /** The count of all applications that have been opted in, equivalent to the count of application local data (AppLocalState objects) stored in this account. */\n 'total-apps-opted-in': number\n /** The count of all assets that have been opted in, equivalent to the count of AssetHolding objects held by this account. */\n 'total-assets-opted-in': number\n /** For app-accounts only. The total number of bytes allocated for the keys and values of boxes which belong to the associated application. */\n 'total-box-bytes': number\n /** For app-accounts only. The total number of boxes which belong to the associated application. */\n 'total-boxes': number\n /** The count of all apps (AppParams objects) created by this account. */\n 'total-created-apps': number\n /** The count of all assets (AssetParams objects) created by this account. */\n 'total-created-assets': number\n}\n\n/** Fields for a payment transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionpayment */\nexport interface PaymentTransactionResult {\n /** [amt] number of µAlgo intended to be transferred. */\n amount: number\n /** Number of µAlgo that were sent to the close-remainder-to address when closing the sender account. */\n 'close-amount'?: number\n /** [close] when set, indicates that the sending account should be closed and all remaining funds be transferred to this address. */\n 'close-remainder-to'?: string\n /** [rcv] receiver's address. */\n receiver: string\n}\n\n/** Fields for a state proof transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionstateproof.\n *\n * See also https://developer.algorand.org/docs/get-details/stateproofs/,\n * https://developer.algorand.org/docs/get-details/stateproofs/light_client/,\n * https://github.com/algorand/go-algorand/blob/master/data/transactions/stateproof.go,\n * https://github.com/algorand/go-algorand/blob/master/crypto/stateproof/structs.go,\n * https://github.com/algorand/go-algorand/blob/master/data/stateproofmsg/message.go, and\n * https://developer.algorand.org/docs/rest-apis/algod/#stateproof.\n */\nexport interface StateProofTransactionResult {\n /** [spmsg] State proof message\n *\n * Message represents the message that the state proofs are attesting to. This message can be\n * used by lightweight client and gives it the ability to verify proofs on the Algorand's state.\n *\n * In addition to that proof, this message also contains fields that\n * are needed in order to verify the next state proofs (VotersCommitment and LnProvenWeight).\n */\n message: {\n /** [b] BlockHeadersCommitment contains a commitment on all light block headers within a state proof interval. */\n 'block-headers-commitment': string\n /** [f] First round the message attests to */\n 'first-attested-round': number\n /** [l] Last round the message attests to */\n 'latest-attested-round': number\n /** [P] An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof. */\n 'ln-proven-weight': number | bigint\n /** [v] The vector commitment root of the top N accounts to sign the next StateProof.\n *\n * Pattern : \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\" */\n 'voters-commitment': string\n }\n /** [sp] a proof on Algorand's state */\n 'state-proof': {\n /** [P] Part proofs that make up the overall proof */\n 'part-proofs': MerkleArrayProof\n /** [pr] The positions that are revealed */\n 'positions-to-reveal': number[]\n /** [r] Reveals is a sparse map from the position being revealed\n * to the corresponding elements from the sigs and participants\n * arrays.\n */\n reveals: {\n /** The position being revealed */\n position: number\n /** [p] Participant\n *\n * A Participant corresponds to an account whose AccountData.Status\n * is Online, and for which the expected sigRound satisfies\n * AccountData.VoteFirstValid <= sigRound <= AccountData.VoteLastValid.\n *\n * In the Algorand ledger, it is possible for multiple accounts to have\n * the same PK. Thus, the PK is not necessarily unique among Participants.\n * However, each account will produce a unique Participant struct, to avoid\n * potential DoS attacks where one account claims to have the same VoteID PK\n * as another account.\n */\n participant: {\n /** [p] PK is the identifier used to verify the signature for a specific participant\n *\n * Verifier is used to verify a merklesignature.Signature produced by merklesignature.Secrets.\n */\n verifier: {\n /** [cmt] Commitment represents the root of the vector commitment tree built upon the MSS keys. */\n commitment: string\n /** [lf] The lifetime of the key */\n 'key-lifetime': number\n }\n /** [w] Weight is AccountData.MicroAlgos. */\n weight: number | bigint\n }\n /** [s] A sigslotCommit is a single slot in the sigs array that forms the state proof. */\n 'sig-slot': {\n /** [l] L is the total weight of signatures in lower-numbered slots.\n * This is initialized once the builder has collected a sufficient\n * number of signatures.\n */\n 'lower-sig-weight': number | bigint\n /** [s] Sig is a signature by the participant on the expected message.\n *\n * Signature represents a signature in the Merkle signature scheme using falcon signatures as an underlying crypto scheme.\n * It consists of an ephemeral public key, a signature, a Merkle verification path and an index.\n * The Merkle signature considered valid only if the Signature is verified under the ephemeral public key and\n * the Merkle verification path verifies that the ephemeral public key is located at the given index of the tree\n * (for the root given in the long-term public key).\n * More details can be found on Algorand's spec\n */\n signature: {\n /** [sig] Signature in the Merkle signature scheme using falcon signatures */\n 'falcon-signature': string\n /** [idx] Merkle array index */\n 'merkle-array-index': number\n /** [prf] Merkle verification path */\n proof: MerkleArrayProof\n /** [vkey] Falcon verifier key */\n 'verifying-key': string\n }\n }\n }[]\n /** [v] Merkle signature salt version */\n 'salt-version': number\n /** [c] Digest of the signature commit */\n 'sig-commit': string\n /** [S] Proofs for the signature */\n 'sig-proofs': MerkleArrayProof\n /** [w] The combined weight of the signatures */\n 'signed-weight': number | bigint\n }\n /** [sptype] State proof type, per https://github.com/algorand/go-algorand/blob/master/protocol/stateproof.go#L24\n *\n * * 0: StateProofBasic is our initial state proof setup. using falcon keys and subset-sum hash\n */\n 'state-proof-type': number\n}\n\n/**\n * Merkle array Proof.\n *\n * Proof is used to convince a verifier about membership of leaves: h0,h1...hn\n * at indexes i0,i1...in on a tree. The verifier has a trusted value of the tree\n * root hash.\n *\n * Path is bounded by MaxNumLeaves since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxTreeDepth / 2\n *\n * Consider two different reveals for the same tree:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^\n * . hints: [a, r, z, z4]\n * . len(hints) = 4\n * ```\n * You need a to combine with b to get q, need r to combine with the computed q and get y, and so on.\n *\n * The worst case is this:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^ ^ ^ ^ ^ ^ ^ ^\n * .\n * . hints: [b, d, e, g, j, l, m, o]\n * . len(hints) = 2^4/2\n * ```\n */\nexport interface MerkleArrayProof {\n /** [hsh] The metadata of the hash factory that was used to hash the proofs */\n 'hash-factory': {\n /** [t] The type of hash https://github.com/algorand/go-algorand/blob/master/crypto/hashes.go#L42 */\n 'hash-type': number\n }\n /** [pth] Path is bounded by MaxNumLeavesOnEncodedTree since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxEncodedTreeDepth / 2\n */\n path: string[]\n /** [td] TreeDepth represents the depth of the tree that is being proven.\n * It is the number of edges from the root to a leaf.\n */\n 'tree-depth': number\n}\n\n/** Fields for an application transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionapplication */\nexport interface ApplicationTransactionResult extends Omit<ApplicationParams, 'creator' | 'global-state'> {\n /** [apat] List of accounts in addition to the sender that may be accessed from the application's approval-program and clear-state-program. */\n accounts?: string[]\n /** [apaa] transaction specific arguments accessed from the application's approval-program and clear-state-program. */\n 'application-args'?: string[]\n /** [apid] ID of the application being configured or empty if creating. */\n 'application-id': number\n /** [apfa] Lists the applications in addition to the application-id whose global states may be accessed by this application's approval-program and clear-state-program. The access is read-only. */\n 'foreign-apps'?: number[]\n /** [apas] lists the assets whose parameters may be accessed by this application's ApprovalProgram and ClearStateProgram. The access is read-only. */\n 'foreign-assets'?: number[]\n /** [apan] defines the what additional actions occur with the transaction. */\n 'on-completion': ApplicationOnComplete\n}\n\n/** Fields for asset allocation, re-configuration, and destruction.\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetconfig\n *\n * A zero value for asset-id indicates asset creation. A zero value for the params indicates asset destruction.\n */\nexport interface AssetConfigTransactionResult {\n /** [xaid] ID of the asset being configured or empty if creating. */\n 'asset-id': number\n /** [apar] the parameters for the asset. */\n params?: AssetParams\n}\n\n/** Fields for an asset freeze transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetfreeze */\nexport interface AssetFreezeTransactionResult {\n /** [fadd] Address of the account whose asset is being frozen or thawed. */\n address: string\n /** [faid] ID of the asset being frozen or thawed. */\n 'asset-id': number\n /** [afrz] The new freeze status. */\n 'new-freeze-status': boolean\n}\n\n/** Fields for an asset transfer transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassettransfer */\nexport interface AssetTransferTransactionResult {\n /** [aamt] Amount of asset to transfer. A zero amount transferred to self allocates that asset in the account's Assets map. */\n amount: number | bigint\n /** [xaid] ID of the asset being transferred. */\n 'asset-id': number\n /** Number of assets transfered to the close-to account as part of the transaction. */\n 'close-amount'?: number | bigint\n /** [aclose] Indicates that the asset should be removed from the account's Assets map, and specifies where the remaining asset holdings should be transferred. It's always valid to transfer remaining asset holdings to the creator account. */\n 'close-to'?: string\n /** [arcv] Recipient address of the transfer. */\n receiver: string\n /** [asnd] The effective sender during a clawback transactions. If this is not a zero value, the real transaction sender must be the Clawback address from the AssetParams. */\n sender?: string\n}\n\n/** Fields for a `keyreg` transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionkeyreg */\nexport interface KeyRegistrationTransactionResult {\n /** [nonpart] Mark the account as participating or non-participating. */\n 'non-participation'?: boolean\n /** [selkey] Public key used with the Verified Random Function (VRF) result during committee selection.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'selection-participation-key'?: string\n /** [selkey] Public key used with the Verified Random Function (VRF) result during committee selection.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'state-proof-key'?: string\n /** [votefst] First round this participation key is valid. */\n 'vote-first-valid'?: number\n /** [votekd] Number of subkeys in each batch of participation keys. */\n 'vote-key-dilution'?: number\n /** [votelst] Last round this participation key is valid. */\n 'vote-last-valid'?: number\n /** [votekey] Participation public key used in key registration transactions.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'vote-participation-key'?: string\n}\n\n/** Specifies both the unique identifier and the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#asset */\nexport interface AssetResult {\n /** Unique asset identifier. */\n index: number\n /** Whether or not this asset is currently deleted. */\n deleted?: boolean\n /** Round during which this asset was created. */\n 'created-at-round'?: number\n /** Round during which this asset was destroyed. */\n 'destroyed-at-round'?: number\n /** The parameters for the asset */\n params: AssetParams\n}\n\n/**\n * The result of looking up an application\n */\nexport interface ApplicationResult {\n id: number\n params: ApplicationParams\n 'created-at-round'?: number\n deleted?: boolean\n 'deleted-at-round'?: number\n}\n\n/** Validation signature associated with some data. Only one of the signatures should be provided. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignature */\nexport interface TransactionSignature {\n /** Logicsig signature */\n logicsig?: LogicTransactionSignature\n /** Multisig signature */\n multisig?: MultisigTransactionSignature\n /** [sig] Standard ed25519 signature.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n sig?: string\n}\n\n/** [lsig] Programatic transaction signature.\n *\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturelogicsig\n *\n * https://developer.algorand.org/docs/get-details/transactions/signatures/#logic-signatures\n */\nexport interface LogicTransactionSignature {\n /** [arg] Logic arguments, base64 encoded. */\n args?: string[]\n /** [l] Program signed by a signature or multi signature, or hashed to be the address of ana ccount.\n *\n * Base64 encoded TEAL program.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n logic: string\n /** The signature of the multisig the logic signature delegating the logicsig. https://developer.algorand.org/docs/get-details/dapps/smart-contracts/smartsigs/modes/#delegated-approval */\n 'multisig-signature'?: MultisigTransactionSignature\n /** [sig] Standard ed25519 signature delegating the logicsig. https://developer.algorand.org/docs/get-details/dapps/smart-contracts/smartsigs/modes/#delegated-approval\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n signature?: string\n}\n\n/** [msig] structure holding multiple subsignatures. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisig */\nexport interface MultisigTransactionSignature {\n /** [subsig] Holds pairs of public key and signatures. */\n subsignature: MultisigTransactionSubSignature[]\n /** [thr] The threshold of signatures required for the multisig */\n threshold: number\n /** [v] The version of the multisig */\n version: number\n}\n\n/** Sub-signature for a multisig signature https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisigsubsignature */\nexport interface MultisigTransactionSubSignature {\n /** [pk] The public key of the account making the signature\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'public-key': string\n /** [s] The signature\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n signature?: string\n}\n\nexport interface EvalDeltaKeyValue {\n key: string\n value: EvalDelta\n}\n\nexport interface AccountStateDelta {\n address: string\n delta: StateDelta\n}\n\nexport type StateDelta = EvalDeltaKeyValue[]\n\n/** Represents a TEAL value delta. https://developer.algorand.org/docs/rest-apis/indexer/#evaldelta */\nexport interface EvalDelta {\n /** [at] delta action. */\n action: number\n /** [bs] bytes value. */\n bytes?: string\n /** [ui] uint value. */\n uint?: number\n}\n\n/** Stores the global information associated with an application https://developer.algorand.org/docs/rest-apis/indexer/#applicationparams */\nexport interface ApplicationParams {\n /** The address that created this application. This is the address where the parameters and global state for this application can be found. */\n creator: string\n /**\n * [apap]/[approv] Logic executed for every application transaction, except when on-completion is set to \"clear\".\n *\n * It can read and write global state for the application, as well as account-specific local state.\n *\n * Approval programs may reject the transaction.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'approval-program': string\n /**\n * [apsu]/[clearp] Logic executed for application transactions with on-completion set to \"clear\".\n *\n * It can read and write global state for the application, as well as account-specific local state.\n *\n * Clear state programs cannot reject the transaction.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'clear-state-program': string\n /** [epp] the amount of extra program pages available to this app. */\n 'extra-program-pages'?: number\n /** [gs] global schema */\n 'global-state': modelsv2.TealKeyValue[]\n /** [gsch] global schema */\n 'global-state-schema'?: StateSchema\n /** [lsch] local schema */\n 'local-state-schema'?: StateSchema\n}\n\n/** Represents a [apls] local-state or [apgs] global-state schema.\n * https://developer.algorand.org/docs/rest-apis/indexer/#stateschema\n *\n * These schemas determine how much storage may be used in a local-state or global-state for an application.\n *\n * The more space used, the larger minimum balance must be maintained in the account holding the data.\n */\nexport interface StateSchema {\n /** Maximum number of TEAL byte slices that may be stored in the key/value store. */\n 'num-byte-slice': number\n /** Maximum number of TEAL uints that may be stored in the key/value store. */\n 'num-uint': number\n}\n\n/** Defines the what additional actions occur with the transaction https://developer.algorand.org/docs/rest-apis/indexer/#oncompletion */\nexport enum ApplicationOnComplete {\n noop = 'noop',\n optin = 'optin',\n closeout = 'closeout',\n clear = 'clear',\n update = 'update',\n delete = 'delete',\n}\n\n/** AssetParams specifies the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#assetparams */\nexport interface AssetParams {\n /**\n * The address that created this asset. This is the address where the parameters\n * for this asset can be found, and also the address where unwanted asset units can\n * be sent in the worst case.\n */\n creator: string\n /**\n * (dc) The number of digits to use after the decimal point when displaying this\n * asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in\n * tenths. If 2, the base unit of the asset is in hundredths, and so on. This value\n * must be between 0 and 19 (inclusive).\n */\n decimals: number | bigint\n /**\n * (t) The total number of units of this asset.\n */\n total: number | bigint\n /**\n * (c) Address of account used to clawback holdings of this asset. If empty,\n * clawback is not permitted.\n */\n clawback?: string\n /**\n * (df) Whether holdings of this asset are frozen by default.\n */\n 'default-frozen'?: boolean\n /**\n * (f) Address of account used to freeze holdings of this asset. If empty, freezing\n * is not permitted.\n */\n freeze?: string\n /**\n * (m) Address of account used to manage the keys of this asset and to destroy it.\n */\n manager?: string\n /**\n * (am) A commitment to some unspecified asset metadata. The format of this\n * metadata is up to the application.\n */\n 'metadata-hash'?: Uint8Array\n /**\n * (an) Name of this asset, as supplied by the creator. Included only when the\n * asset name is composed of printable utf-8 characters.\n */\n name?: string\n /**\n * Base64 encoded name of this asset, as supplied by the creator.\n */\n 'name-b64'?: Uint8Array\n /**\n * (r) Address of account holding reserve (non-minted) units of this asset.\n */\n reserve?: string\n /**\n * (un) Name of a unit of this asset, as supplied by the creator. Included only\n * when the name of a unit of this asset is composed of printable utf-8 characters.\n */\n 'unit-name'?: string\n /**\n * Base64 encoded name of a unit of this asset, as supplied by the creator.\n */\n 'unit-name-b64'?: Uint8Array\n /**\n * (au) URL where more information about the asset can be retrieved. Included only\n * when the URL is composed of printable utf-8 characters.\n */\n url?: string\n /**\n * Base64 encoded URL where more information about the asset can be retrieved.\n */\n 'url-b64'?: Uint8Array\n}\n\n/** Type of signature used by an account */\nexport enum SignatureType {\n /** Normal signature */\n sig = 'sig',\n /** Multisig */\n msig = 'msig',\n /** Logic signature */\n lsig = 'lsig',\n}\n\n/** Delegation status of the account */\nexport enum AccountStatus {\n /** Indicates that the associated account is delegated */\n Offline = 'Offline',\n /** Indicates that the associated account used as part of the delegation pool */\n Online = 'Online',\n /** Indicates that the associated account is neither a delegator nor a delegate */\n NotParticipating = 'NotParticipating',\n}\n\n/** AccountParticipation describes the parameters used by this account in consensus protocol. https://developer.algorand.org/docs/rest-apis/indexer/#accountparticipation */\nexport interface AccountParticipation {\n /** [sel] Selection public key (if any) currently registered for this round.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'selection-participation-key': string\n /** [stprf] Root of the state proof key (if any).\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'state-proof-key'?: string\n /** [voteFst] First round for which this participation is valid. */\n 'vote-first-valid': number\n /** [voteKD] Number of subkeys in each batch of participation keys. */\n 'vote-key-dilution': number\n /** [voteLst] Last round for which this participation is valid. */\n 'vote-last-valid': number\n /** [vote] root participation public key (if any) currently registered for this round.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'vote-participation-key': string\n}\n\n/** Stores local state associated with an application. https://developer.algorand.org/docs/rest-apis/indexer/#applicationlocalstate */\nexport interface AppLocalState {\n /** Round when account closed out of the application. */\n 'closed-out-at-round'?: number\n /** Whether or not the application local state is currently deleted from its account. */\n deleted?: boolean\n /** The application which this local state is for. */\n id: number\n /** [tkv] storage. */\n 'key-value'?: modelsv2.TealKeyValue[]\n /** Round when the account opted into the application. */\n 'opted-in-at-round'?: number\n /** [hsch] schema. */\n schema: StateSchema\n}\n\n/** Describes an asset held by an account. https://developer.algorand.org/docs/rest-apis/indexer/#assetholding */\nexport interface AssetHolding {\n /**\n * (a) number of units held.\n */\n amount: number | bigint\n /**\n * Asset ID of the holding.\n */\n 'asset-id': number\n /** Whether or not the asset holding is currently deleted from its account. */\n deleted?: boolean\n /**\n * [f] whether or not the holding is frozen.\n */\n 'is-frozen': boolean\n /** Round during which the account opted into this asset holding. */\n 'opted-in-at-round': number\n /** Round during which the account opted out of this asset holding. */\n 'opted-out-at-round': number\n}\n\n/** Describes an asset holding for an account of a known asset. https://developer.algorand.org/docs/rest-apis/indexer/#miniassetholding */\nexport interface MiniAssetHolding {\n /**\n * Address of the account that holds the asset.\n */\n address: string\n /**\n * (a) number of units held.\n */\n amount: number | bigint\n /** Whether or not the asset holding is currently deleted from its account. */\n deleted?: boolean\n /**\n * [f] whether or not the holding is frozen.\n */\n 'is-frozen': boolean\n /** Round during which the account opted into this asset holding. */\n 'opted-in-at-round'?: number\n /** Round during which the account opted out of this asset holding. */\n 'opted-out-at-round'?: number\n}\n"],"names":["ApplicationOnComplete","SignatureType","AccountStatus"],"mappings":";;AA+rBA;AACYA;AAAZ,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,qBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACnB,CAAC,EAPWA,6BAAqB,KAArBA,6BAAqB,GAOhC,EAAA,CAAA,CAAA;AA6ED;AACYC;AAAZ,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,KAAA,CAAA,GAAA,KAAW;;AAEX,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa;;AAEb,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EAPWA,qBAAa,KAAbA,qBAAa,GAOxB,EAAA,CAAA,CAAA;AAED;AACYC;AAAZ,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;;AAEnB,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;;AAEjB,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;AACvC,CAAC,EAPWA,qBAAa,KAAbA,qBAAa,GAOxB,EAAA,CAAA,CAAA;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"indexer.mjs","sources":["../../src/types/indexer.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport modelsv2 = algosdk.modelsv2\nimport TransactionType = algosdk.TransactionType\n\n/** Indexer result for a transaction search, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactions */\nexport interface TransactionSearchResults {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned transactions */\n transactions: TransactionResult[]\n}\n\n/** Indexer result for an account lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-id */\nexport interface AccountLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned account */\n account: AccountResult\n}\n\n/** Indexer result for an account's asset holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idassets */\nexport interface AssetsLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned asset holdings */\n assets: AssetHolding[]\n}\n\n/** Indexer result for an account's created assets, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-assets */\nexport interface AssetsCreatedLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned assets */\n assets: AssetResult[]\n}\n\n/** Indexer result for an account's created applications, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-applications */\nexport interface ApplicationCreatedLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned applications */\n applications: ApplicationResult[]\n}\n\n/** Indexer result for an asset lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-id */\nexport interface AssetLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned asset */\n asset: AssetResult\n}\n\n/** Options when looking up an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface LookupAssetHoldingsOptions {\n /** Results should have a decimal units amount less than this value. */\n currencyLessThan?: number\n /** Results should have a decimal units amount greater than this value. */\n currencyGreaterThan?: number\n /** Include all items including closed accounts and opted-out asset holdings. */\n includeAll?: boolean\n}\n\n/** Indexer result for an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface AssetBalancesLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The list of accounts who hold this asset with their balance */\n balances: MiniAssetHolding[]\n}\n\n/** Indexer result for a transaction lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactionstxid */\nexport interface TransactionLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned transaction */\n transaction: TransactionResult\n}\n\n/** Indexer result for an application lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2applicationsapplication-id */\nexport interface ApplicationLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned application */\n application: ApplicationResult\n}\n\n/** Indexer result for a transaction, https://developer.algorand.org/docs/rest-apis/indexer/#transaction */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface TransactionResult extends Record<string, any> {\n /** Transaction ID */\n id: string\n /** [type] Indicates what type of transaction this is. Different types have different fields.\n * Valid types, and where their fields are stored:\n * * [pay] payment-transaction\n * * [keyreg] keyreg-transaction\n * * [acfg] asset-config-transaction\n * * [axfer] asset-transfer-transaction\n * * [afrz] asset-freeze-transaction\n * * [appl] application-transaction\n * * [stpf] state-proof-transaction\n */\n 'tx-type': TransactionType\n /** [fee] Transaction fee. */\n fee: number\n /** [snd] Sender's address. */\n sender: string\n /** [fv] First valid round for this transaction. */\n 'first-valid': number\n /** [lv] Last valid round for this transaction. */\n 'last-valid': number\n /** Round when the transaction was confirmed. */\n 'confirmed-round'?: number\n /** [grp] Base64 encoded byte array of a sha512/256 digest.\n *\n * When present indicates that this transaction is part of a transaction group\n * and the value is the sha512/256 hash of the transactions in that group.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n group?: string\n /**\n * [note] Free form data.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n note?: string\n /** [lg] Logs for the application being executed by this transaction. */\n logs?: string[]\n /** Time when the block this transaction is in was confirmed. */\n 'round-time'?: number\n /** Offset into the round where this transaction was confirmed. */\n 'intra-round-offset'?: number\n /** Signature of the transaction */\n signature?: TransactionSignature\n /** If the transaction is an `appl` transaction this will be populated see `tx-type` */\n 'application-transaction'?: ApplicationTransactionResult\n /** If the transaction is an `appl` transaction that resulted in an application creation then this\n * specifies the application index (ID) of that application.\n */\n 'created-application-index'?: number\n /** If the transaction is an `acfg` transaction this will be populated see `tx-type` */\n 'asset-config-transaction'?: AssetConfigTransactionResult\n /** If the transaction is an `acfg` transaction that resulted in an asset creation then this\n * specifies the asset index (ID) of that asset.\n */\n 'created-asset-index'?: number\n /** If the transaction is an `afrz` transaction this will be populated see `tx-type` */\n 'asset-freeze-transaction'?: AssetFreezeTransactionResult\n /** If the transaction is an `axfer` transaction this will be populated see `tx-type` */\n 'asset-transfer-transaction'?: AssetTransferTransactionResult\n /** If the transaction is a `keyreg` transaction this will be populated see `tx-type` */\n 'keyreg-transaction'?: KeyRegistrationTransactionResult\n /** If the transaction is a `pay` transaction this will be populated see `tx-type` */\n 'payment-transaction'?: PaymentTransactionResult\n /** If the transaction is a `stpf` transaction this will be populated see `tx-type` */\n 'state-proof-transaction'?: StateProofTransactionResult\n /** [sgnr] this is included with signed transactions when the signing address does not equal the sender.\n * The backend can use this to ensure that auth addr is equal to the accounts auth addr.\n */\n 'auth-addr'?: string\n /** [ca] closing amount for transaction. */\n 'closing-amount'?: number\n /** [gh] Hash of genesis block.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'genesis-hash'?: string\n /** [gen] genesis block ID. */\n 'genesis-id'?: string\n /** Inner transactions produced by application execution. */\n 'inner-txns'?: TransactionResult[]\n /** [rekey] when included in a valid transaction, the accounts auth addr will be updated with\n * this value and future signatures must be signed with the key represented by this address.\n */\n 'rekey-to'?: string\n /** [lx] Base64 encoded 32-byte array. Lease enforces mutual exclusion of transactions.\n *\n * If this field is nonzero, then once the transaction is confirmed, it acquires the lease\n * identified by the (Sender, Lease) pair of the transaction until the LastValid round passes.\n *\n * While this transaction possesses the lease, no other transaction specifying this lease can be confirmed.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n lease?: string\n /** [ld] Local state key/value changes for the application being executed by this transaction. */\n 'local-state-delta'?: AccountStateDelta[]\n /** [gd] Global state key/value changes for the application being executed by this transaction. */\n 'global-state-delta'?: StateDelta\n /** [rr] rewards applied to receiver account. */\n 'receiver-rewards'?: number\n /** [rs] rewards applied to sender account. */\n 'sender-rewards'?: number\n /** [rc] rewards applied to close-remainder-to account. */\n 'close-rewards'?: number\n}\n\n/** Account information at a given round https://developer.algorand.org/docs/rest-apis/indexer/#account */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface AccountResult extends Record<string, any> {\n /** the account public key */\n address: string\n /** [algo] total number of µAlgo in the account */\n amount: number\n /** specifies the amount of µAlgo in the account, without the pending rewards. */\n 'amount-without-pending-rewards': number\n /** [appl] applications local data stored in this account.\n *\n * Note the raw object uses map[int] -> AppLocalState for this type.\n */\n 'apps-local-state'?: AppLocalState[]\n /** [teap] the sum of all extra application program pages for this account. */\n 'apps-total-extra-pages'?: number\n /** [tsch] stores the sum of all of the local schemas and global schemas in this account.\n *\n * Note: the raw account uses StateSchema for this type.\n */\n 'apps-total-schema'?: StateSchema\n /** [asset] assets held by this account.\n *\n * Note the raw object uses map[int] -> AssetHolding for this type.\n */\n assets?: AssetHolding[]\n /** [spend] the address against which signing should be checked.\n *\n * If empty, the address of the current account is used.\n *\n * This field can be updated in any transaction by setting the RekeyTo field.\n */\n 'auth-addr'?: string\n /** Round during which this account was most recently closed. */\n 'closed-at-round'?: number\n /** [appp] parameters of applications created by this account including app global data.\n *\n * Note: the raw account uses map[int] -> AppParams for this type.\n */\n 'created-apps'?: ApplicationResult[]\n /** [apar] parameters of assets created by this account.\n *\n * Note: the raw account uses map[int] -> Asset for this type.\n */\n 'created-assets'?: AssetResult[]\n /** Round during which this account first appeared in a transaction. */\n 'created-at-round'?: number\n /** Whether or not this account is currently closed. */\n deleted?: boolean\n /** If participating in consensus, the parameters used by this account in the consensus protocol. */\n participation?: AccountParticipation\n /** amount of µAlgo of pending rewards in this account. */\n 'pending-rewards': number\n /** [ebase] used as part of the rewards computation. Only applicable to accounts which are participating. */\n 'reward-base'?: number\n /** [ern] total rewards of µAlgo the account has received, including pending rewards. */\n rewards: number\n /** The round for which this information is relevant. */\n round: number\n /** Indicates what type of signature is used by this account */\n 'sig-type': SignatureType\n /** [onl] delegation status of the account's µAlgo */\n status: AccountStatus\n /** The count of all applications that have been opted in, equivalent to the count of application local data (AppLocalState objects) stored in this account. */\n 'total-apps-opted-in': number\n /** The count of all assets that have been opted in, equivalent to the count of AssetHolding objects held by this account. */\n 'total-assets-opted-in': number\n /** For app-accounts only. The total number of bytes allocated for the keys and values of boxes which belong to the associated application. */\n 'total-box-bytes': number\n /** For app-accounts only. The total number of boxes which belong to the associated application. */\n 'total-boxes': number\n /** The count of all apps (AppParams objects) created by this account. */\n 'total-created-apps': number\n /** The count of all assets (AssetParams objects) created by this account. */\n 'total-created-assets': number\n}\n\n/** Fields for a payment transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionpayment */\nexport interface PaymentTransactionResult {\n /** [amt] number of µAlgo intended to be transferred. */\n amount: number\n /** Number of µAlgo that were sent to the close-remainder-to address when closing the sender account. */\n 'close-amount'?: number\n /** [close] when set, indicates that the sending account should be closed and all remaining funds be transferred to this address. */\n 'close-remainder-to'?: string\n /** [rcv] receiver's address. */\n receiver: string\n}\n\n/** Fields for a state proof transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionstateproof.\n *\n * See also https://developer.algorand.org/docs/get-details/stateproofs/,\n * https://developer.algorand.org/docs/get-details/stateproofs/light_client/,\n * https://github.com/algorand/go-algorand/blob/master/data/transactions/stateproof.go,\n * https://github.com/algorand/go-algorand/blob/master/crypto/stateproof/structs.go,\n * https://github.com/algorand/go-algorand/blob/master/data/stateproofmsg/message.go, and\n * https://developer.algorand.org/docs/rest-apis/algod/#stateproof.\n */\nexport interface StateProofTransactionResult {\n /** [spmsg] State proof message\n *\n * Message represents the message that the state proofs are attesting to. This message can be\n * used by lightweight client and gives it the ability to verify proofs on the Algorand's state.\n *\n * In addition to that proof, this message also contains fields that\n * are needed in order to verify the next state proofs (VotersCommitment and LnProvenWeight).\n */\n message: {\n /** [b] BlockHeadersCommitment contains a commitment on all light block headers within a state proof interval. */\n 'block-headers-commitment': string\n /** [f] First round the message attests to */\n 'first-attested-round': number\n /** [l] Last round the message attests to */\n 'latest-attested-round': number\n /** [P] An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof. */\n 'ln-proven-weight': number | bigint\n /** [v] The vector commitment root of the top N accounts to sign the next StateProof.\n *\n * Pattern : \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\" */\n 'voters-commitment': string\n }\n /** [sp] a proof on Algorand's state */\n 'state-proof': {\n /** [P] Part proofs that make up the overall proof */\n 'part-proofs': MerkleArrayProof\n /** [pr] The positions that are revealed */\n 'positions-to-reveal': number[]\n /** [r] Reveals is a sparse map from the position being revealed\n * to the corresponding elements from the sigs and participants\n * arrays.\n */\n reveals: {\n /** The position being revealed */\n position: number\n /** [p] Participant\n *\n * A Participant corresponds to an account whose AccountData.Status\n * is Online, and for which the expected sigRound satisfies\n * AccountData.VoteFirstValid <= sigRound <= AccountData.VoteLastValid.\n *\n * In the Algorand ledger, it is possible for multiple accounts to have\n * the same PK. Thus, the PK is not necessarily unique among Participants.\n * However, each account will produce a unique Participant struct, to avoid\n * potential DoS attacks where one account claims to have the same VoteID PK\n * as another account.\n */\n participant: {\n /** [p] PK is the identifier used to verify the signature for a specific participant\n *\n * Verifier is used to verify a merklesignature.Signature produced by merklesignature.Secrets.\n */\n verifier: {\n /** [cmt] Commitment represents the root of the vector commitment tree built upon the MSS keys. */\n commitment: string\n /** [lf] The lifetime of the key */\n 'key-lifetime': number\n }\n /** [w] Weight is AccountData.MicroAlgos. */\n weight: number | bigint\n }\n /** [s] A sigslotCommit is a single slot in the sigs array that forms the state proof. */\n 'sig-slot': {\n /** [l] L is the total weight of signatures in lower-numbered slots.\n * This is initialized once the builder has collected a sufficient\n * number of signatures.\n */\n 'lower-sig-weight': number | bigint\n /** [s] Sig is a signature by the participant on the expected message.\n *\n * Signature represents a signature in the Merkle signature scheme using falcon signatures as an underlying crypto scheme.\n * It consists of an ephemeral public key, a signature, a Merkle verification path and an index.\n * The Merkle signature considered valid only if the Signature is verified under the ephemeral public key and\n * the Merkle verification path verifies that the ephemeral public key is located at the given index of the tree\n * (for the root given in the long-term public key).\n * More details can be found on Algorand's spec\n */\n signature: {\n /** [sig] Signature in the Merkle signature scheme using falcon signatures */\n 'falcon-signature': string\n /** [idx] Merkle array index */\n 'merkle-array-index': number\n /** [prf] Merkle verification path */\n proof: MerkleArrayProof\n /** [vkey] Falcon verifier key */\n 'verifying-key': string\n }\n }\n }[]\n /** [v] Merkle signature salt version */\n 'salt-version': number\n /** [c] Digest of the signature commit */\n 'sig-commit': string\n /** [S] Proofs for the signature */\n 'sig-proofs': MerkleArrayProof\n /** [w] The combined weight of the signatures */\n 'signed-weight': number | bigint\n }\n /** [sptype] State proof type, per https://github.com/algorand/go-algorand/blob/master/protocol/stateproof.go#L24\n *\n * * 0: StateProofBasic is our initial state proof setup. using falcon keys and subset-sum hash\n */\n 'state-proof-type': number\n}\n\n/**\n * Merkle array Proof.\n *\n * Proof is used to convince a verifier about membership of leaves: h0,h1...hn\n * at indexes i0,i1...in on a tree. The verifier has a trusted value of the tree\n * root hash.\n *\n * Path is bounded by MaxNumLeaves since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxTreeDepth / 2\n *\n * Consider two different reveals for the same tree:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^\n * . hints: [a, r, z, z4]\n * . len(hints) = 4\n * ```\n * You need a to combine with b to get q, need r to combine with the computed q and get y, and so on.\n *\n * The worst case is this:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^ ^ ^ ^ ^ ^ ^ ^\n * .\n * . hints: [b, d, e, g, j, l, m, o]\n * . len(hints) = 2^4/2\n * ```\n */\nexport interface MerkleArrayProof {\n /** [hsh] The metadata of the hash factory that was used to hash the proofs */\n 'hash-factory': {\n /** [t] The type of hash https://github.com/algorand/go-algorand/blob/master/crypto/hashes.go#L42 */\n 'hash-type': number\n }\n /** [pth] Path is bounded by MaxNumLeavesOnEncodedTree since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxEncodedTreeDepth / 2\n */\n path: string[]\n /** [td] TreeDepth represents the depth of the tree that is being proven.\n * It is the number of edges from the root to a leaf.\n */\n 'tree-depth': number\n}\n\n/** Fields for an application transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionapplication */\nexport interface ApplicationTransactionResult extends Omit<ApplicationParams, 'creator' | 'global-state'> {\n /** [apat] List of accounts in addition to the sender that may be accessed from the application's approval-program and clear-state-program. */\n accounts?: string[]\n /** [apaa] transaction specific arguments accessed from the application's approval-program and clear-state-program. */\n 'application-args'?: string[]\n /** [apid] ID of the application being configured or empty if creating. */\n 'application-id': number\n /** [apfa] Lists the applications in addition to the application-id whose global states may be accessed by this application's approval-program and clear-state-program. The access is read-only. */\n 'foreign-apps'?: number[]\n /** [apas] lists the assets whose parameters may be accessed by this application's ApprovalProgram and ClearStateProgram. The access is read-only. */\n 'foreign-assets'?: number[]\n /** [apan] defines the what additional actions occur with the transaction. */\n 'on-completion': ApplicationOnComplete\n}\n\n/** Fields for asset allocation, re-configuration, and destruction.\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetconfig\n *\n * A zero value for asset-id indicates asset creation. A zero value for the params indicates asset destruction.\n */\nexport interface AssetConfigTransactionResult {\n /** [xaid] ID of the asset being configured or empty if creating. */\n 'asset-id': number\n /** [apar] the parameters for the asset. */\n params?: AssetParams\n}\n\n/** Fields for an asset freeze transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetfreeze */\nexport interface AssetFreezeTransactionResult {\n /** [fadd] Address of the account whose asset is being frozen or thawed. */\n address: string\n /** [faid] ID of the asset being frozen or thawed. */\n 'asset-id': number\n /** [afrz] The new freeze status. */\n 'new-freeze-status': boolean\n}\n\n/** Fields for an asset transfer transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassettransfer */\nexport interface AssetTransferTransactionResult {\n /** [aamt] Amount of asset to transfer. A zero amount transferred to self allocates that asset in the account's Assets map. */\n amount: number | bigint\n /** [xaid] ID of the asset being transferred. */\n 'asset-id': number\n /** Number of assets transfered to the close-to account as part of the transaction. */\n 'close-amount'?: number | bigint\n /** [aclose] Indicates that the asset should be removed from the account's Assets map, and specifies where the remaining asset holdings should be transferred. It's always valid to transfer remaining asset holdings to the creator account. */\n 'close-to'?: string\n /** [arcv] Recipient address of the transfer. */\n receiver: string\n /** [asnd] The effective sender during a clawback transactions. If this is not a zero value, the real transaction sender must be the Clawback address from the AssetParams. */\n sender?: string\n}\n\n/** Fields for a `keyreg` transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionkeyreg */\nexport interface KeyRegistrationTransactionResult {\n /** [nonpart] Mark the account as participating or non-participating. */\n 'non-participation'?: boolean\n /** [selkey] Public key used with the Verified Random Function (VRF) result during committee selection.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'selection-participation-key'?: string\n /** [selkey] Public key used with the Verified Random Function (VRF) result during committee selection.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'state-proof-key'?: string\n /** [votefst] First round this participation key is valid. */\n 'vote-first-valid'?: number\n /** [votekd] Number of subkeys in each batch of participation keys. */\n 'vote-key-dilution'?: number\n /** [votelst] Last round this participation key is valid. */\n 'vote-last-valid'?: number\n /** [votekey] Participation public key used in key registration transactions.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'vote-participation-key'?: string\n}\n\n/** Specifies both the unique identifier and the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#asset */\nexport interface AssetResult {\n /** Unique asset identifier. */\n index: number\n /** Whether or not this asset is currently deleted. */\n deleted?: boolean\n /** Round during which this asset was created. */\n 'created-at-round'?: number\n /** Round during which this asset was destroyed. */\n 'destroyed-at-round'?: number\n /** The parameters for the asset */\n params: AssetParams\n}\n\n/**\n * The result of looking up an application\n */\nexport interface ApplicationResult {\n id: number\n params: ApplicationParams\n 'created-at-round'?: number\n deleted?: boolean\n 'deleted-at-round'?: number\n}\n\n/** Validation signature associated with some data. Only one of the signatures should be provided. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignature */\nexport interface TransactionSignature {\n /** Logicsig signature */\n logicsig?: LogicTransactionSignature\n /** Multisig signature */\n multisig?: MultisigTransactionSignature\n /** [sig] Standard ed25519 signature.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n sig?: string\n}\n\n/** [lsig] Programatic transaction signature.\n *\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturelogicsig\n *\n * https://developer.algorand.org/docs/get-details/transactions/signatures/#logic-signatures\n */\nexport interface LogicTransactionSignature {\n /** [arg] Logic arguments, base64 encoded. */\n args?: string[]\n /** [l] Program signed by a signature or multi signature, or hashed to be the address of ana ccount.\n *\n * Base64 encoded TEAL program.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n logic: string\n /** The signature of the multisig the logic signature delegating the logicsig. https://developer.algorand.org/docs/get-details/dapps/smart-contracts/smartsigs/modes/#delegated-approval */\n 'multisig-signature'?: MultisigTransactionSignature\n /** [sig] Standard ed25519 signature delegating the logicsig. https://developer.algorand.org/docs/get-details/dapps/smart-contracts/smartsigs/modes/#delegated-approval\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n signature?: string\n}\n\n/** [msig] structure holding multiple subsignatures. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisig */\nexport interface MultisigTransactionSignature {\n /** [subsig] Holds pairs of public key and signatures. */\n subsignature: MultisigTransactionSubSignature[]\n /** [thr] The threshold of signatures required for the multisig */\n threshold: number\n /** [v] The version of the multisig */\n version: number\n}\n\n/** Sub-signature for a multisig signature https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisigsubsignature */\nexport interface MultisigTransactionSubSignature {\n /** [pk] The public key of the account making the signature\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'public-key': string\n /** [s] The signature\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n signature?: string\n}\n\nexport interface EvalDeltaKeyValue {\n key: string\n value: EvalDelta\n}\n\nexport interface AccountStateDelta {\n address: string\n delta: StateDelta\n}\n\nexport type StateDelta = EvalDeltaKeyValue[]\n\n/** Represents a TEAL value delta. https://developer.algorand.org/docs/rest-apis/indexer/#evaldelta */\nexport interface EvalDelta {\n /** [at] delta action. */\n action: number\n /** [bs] bytes value. */\n bytes?: string\n /** [ui] uint value. */\n uint?: number\n}\n\n/** Stores the global information associated with an application https://developer.algorand.org/docs/rest-apis/indexer/#applicationparams */\nexport interface ApplicationParams {\n /** The address that created this application. This is the address where the parameters and global state for this application can be found. */\n creator: string\n /**\n * [apap]/[approv] Logic executed for every application transaction, except when on-completion is set to \"clear\".\n *\n * It can read and write global state for the application, as well as account-specific local state.\n *\n * Approval programs may reject the transaction.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'approval-program': string\n /**\n * [apsu]/[clearp] Logic executed for application transactions with on-completion set to \"clear\".\n *\n * It can read and write global state for the application, as well as account-specific local state.\n *\n * Clear state programs cannot reject the transaction.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'clear-state-program': string\n /** [epp] the amount of extra program pages available to this app. */\n 'extra-program-pages'?: number\n /** [gs] global schema */\n 'global-state': modelsv2.TealKeyValue[]\n /** [gsch] global schema */\n 'global-state-schema'?: StateSchema\n /** [lsch] local schema */\n 'local-state-schema'?: StateSchema\n}\n\n/** Represents a [apls] local-state or [apgs] global-state schema.\n * https://developer.algorand.org/docs/rest-apis/indexer/#stateschema\n *\n * These schemas determine how much storage may be used in a local-state or global-state for an application.\n *\n * The more space used, the larger minimum balance must be maintained in the account holding the data.\n */\nexport interface StateSchema {\n /** Maximum number of TEAL byte slices that may be stored in the key/value store. */\n 'num-byte-slice': number\n /** Maximum number of TEAL uints that may be stored in the key/value store. */\n 'num-uint': number\n}\n\n/** Defines the what additional actions occur with the transaction https://developer.algorand.org/docs/rest-apis/indexer/#oncompletion */\nexport enum ApplicationOnComplete {\n noop = 'noop',\n optin = 'optin',\n closeout = 'closeout',\n clear = 'clear',\n update = 'update',\n delete = 'delete',\n}\n\n/** AssetParams specifies the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#assetparams */\nexport interface AssetParams {\n /**\n * The address that created this asset. This is the address where the parameters\n * for this asset can be found, and also the address where unwanted asset units can\n * be sent in the worst case.\n */\n creator: string\n /**\n * (dc) The number of digits to use after the decimal point when displaying this\n * asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in\n * tenths. If 2, the base unit of the asset is in hundredths, and so on. This value\n * must be between 0 and 19 (inclusive).\n */\n decimals: number | bigint\n /**\n * (t) The total number of units of this asset.\n */\n total: number | bigint\n /**\n * (c) Address of account used to clawback holdings of this asset. If empty,\n * clawback is not permitted.\n */\n clawback?: string\n /**\n * (df) Whether holdings of this asset are frozen by default.\n */\n 'default-frozen'?: boolean\n /**\n * (f) Address of account used to freeze holdings of this asset. If empty, freezing\n * is not permitted.\n */\n freeze?: string\n /**\n * (m) Address of account used to manage the keys of this asset and to destroy it.\n */\n manager?: string\n /**\n * (am) A commitment to some unspecified asset metadata. The format of this\n * metadata is up to the application.\n */\n 'metadata-hash'?: Uint8Array\n /**\n * (an) Name of this asset, as supplied by the creator. Included only when the\n * asset name is composed of printable utf-8 characters.\n */\n name?: string\n /**\n * Base64 encoded name of this asset, as supplied by the creator.\n */\n 'name-b64'?: Uint8Array\n /**\n * (r) Address of account holding reserve (non-minted) units of this asset.\n */\n reserve?: string\n /**\n * (un) Name of a unit of this asset, as supplied by the creator. Included only\n * when the name of a unit of this asset is composed of printable utf-8 characters.\n */\n 'unit-name'?: string\n /**\n * Base64 encoded name of a unit of this asset, as supplied by the creator.\n */\n 'unit-name-b64'?: Uint8Array\n /**\n * (au) URL where more information about the asset can be retrieved. Included only\n * when the URL is composed of printable utf-8 characters.\n */\n url?: string\n /**\n * Base64 encoded URL where more information about the asset can be retrieved.\n */\n 'url-b64'?: Uint8Array\n}\n\n/** Type of signature used by an account */\nexport enum SignatureType {\n /** Normal signature */\n sig = 'sig',\n /** Multisig */\n msig = 'msig',\n /** Logic signature */\n lsig = 'lsig',\n}\n\n/** Delegation status of the account */\nexport enum AccountStatus {\n /** Indicates that the associated account is delegated */\n Offline = 'Offline',\n /** Indicates that the associated account used as part of the delegation pool */\n Online = 'Online',\n /** Indicates that the associated account is neither a delegator nor a delegate */\n NotParticipating = 'NotParticipating',\n}\n\n/** AccountParticipation describes the parameters used by this account in consensus protocol. https://developer.algorand.org/docs/rest-apis/indexer/#accountparticipation */\nexport interface AccountParticipation {\n /** [sel] Selection public key (if any) currently registered for this round.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'selection-participation-key': string\n /** [stprf] Root of the state proof key (if any).\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'state-proof-key'?: string\n /** [voteFst] First round for which this participation is valid. */\n 'vote-first-valid': number\n /** [voteKD] Number of subkeys in each batch of participation keys. */\n 'vote-key-dilution': number\n /** [voteLst] Last round for which this participation is valid. */\n 'vote-last-valid': number\n /** [vote] root participation public key (if any) currently registered for this round.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'vote-participation-key': string\n}\n\n/** Stores local state associated with an application. https://developer.algorand.org/docs/rest-apis/indexer/#applicationlocalstate */\nexport interface AppLocalState {\n /** Round when account closed out of the application. */\n 'closed-out-at-round'?: number\n /** Whether or not the application local state is currently deleted from its account. */\n deleted?: boolean\n /** The application which this local state is for. */\n id: number\n /** [tkv] storage. */\n 'key-value'?: modelsv2.TealKeyValue[]\n /** Round when the account opted into the application. */\n 'opted-in-at-round'?: number\n /** [hsch] schema. */\n schema: StateSchema\n}\n\n/** Describes an asset held by an account. https://developer.algorand.org/docs/rest-apis/indexer/#assetholding */\nexport interface AssetHolding {\n /**\n * (a) number of units held.\n */\n amount: number | bigint\n /**\n * Asset ID of the holding.\n */\n 'asset-id': number\n /** Whether or not the asset holding is currently deleted from its account. */\n deleted?: boolean\n /**\n * [f] whether or not the holding is frozen.\n */\n 'is-frozen': boolean\n /** Round during which the account opted into this asset holding. */\n 'opted-in-at-round': number\n /** Round during which the account opted out of this asset holding. */\n 'opted-out-at-round': number\n}\n\n/** Describes an asset holding for an account of a known asset. https://developer.algorand.org/docs/rest-apis/indexer/#miniassetholding */\nexport interface MiniAssetHolding {\n /**\n * Address of the account that holds the asset.\n */\n address: string\n /**\n * (a) number of units held.\n */\n amount: number | bigint\n /** Whether or not the asset holding is currently deleted from its account. */\n deleted?: boolean\n /**\n * [f] whether or not the holding is frozen.\n */\n 'is-frozen': boolean\n /** Round during which the account opted into this asset holding. */\n 'opted-in-at-round'?: number\n /** Round during which the account opted out of this asset holding. */\n 'opted-out-at-round'?: number\n}\n"],"names":[],"mappings":"AA+rBA;IACY,sBAOX;AAPD,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACb,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,qBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB,CAAA;AACrB,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe,CAAA;AACf,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACjB,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;AACnB,CAAC,EAPW,qBAAqB,KAArB,qBAAqB,GAOhC,EAAA,CAAA,CAAA,CAAA;AA6ED;IACY,cAOX;AAPD,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,KAAA,CAAA,GAAA,KAAW,CAAA;;AAEX,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;;AAEb,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa,CAAA;AACf,CAAC,EAPW,aAAa,KAAb,aAAa,GAOxB,EAAA,CAAA,CAAA,CAAA;AAED;IACY,cAOX;AAPD,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;;AAEnB,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB,CAAA;;AAEjB,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC,CAAA;AACvC,CAAC,EAPW,aAAa,KAAb,aAAa,GAOxB,EAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"indexer.mjs","sources":["../../src/types/indexer.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport modelsv2 = algosdk.modelsv2\nimport TransactionType = algosdk.TransactionType\n\n/** Indexer result for a transaction search, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactions */\nexport interface TransactionSearchResults {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned transactions */\n transactions: TransactionResult[]\n}\n\n/** Indexer result for an account lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-id */\nexport interface AccountLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned account */\n account: AccountResult\n}\n\n/** Indexer result for an account's asset holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idassets */\nexport interface AssetsLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned asset holdings */\n assets: AssetHolding[]\n}\n\n/** Indexer result for an account's created assets, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-assets */\nexport interface AssetsCreatedLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned assets */\n assets: AssetResult[]\n}\n\n/** Indexer result for an account's created applications, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2accountsaccount-idcreated-applications */\nexport interface ApplicationCreatedLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The returned applications */\n applications: ApplicationResult[]\n}\n\n/** Indexer result for an asset lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-id */\nexport interface AssetLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned asset */\n asset: AssetResult\n}\n\n/** Options when looking up an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface LookupAssetHoldingsOptions {\n /** Results should have a decimal units amount less than this value. */\n currencyLessThan?: number\n /** Results should have a decimal units amount greater than this value. */\n currencyGreaterThan?: number\n /** Include all items including closed accounts and opted-out asset holdings. */\n includeAll?: boolean\n}\n\n/** Indexer result for an asset's account holdings, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2assetsasset-idbalances */\nexport interface AssetBalancesLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** Used for pagination, when making another request provide this token with the next parameter. */\n 'next-token': string\n /** The list of accounts who hold this asset with their balance */\n balances: MiniAssetHolding[]\n}\n\n/** Indexer result for a transaction lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2transactionstxid */\nexport interface TransactionLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned transaction */\n transaction: TransactionResult\n}\n\n/** Indexer result for an application lookup, https://developer.algorand.org/docs/rest-apis/indexer/#get-v2applicationsapplication-id */\nexport interface ApplicationLookupResult {\n /** Round at which the results were computed. */\n 'current-round': number\n /** The returned application */\n application: ApplicationResult\n}\n\n/** Indexer result for a transaction, https://developer.algorand.org/docs/rest-apis/indexer/#transaction */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface TransactionResult extends Record<string, any> {\n /** Transaction ID */\n id: string\n /** [type] Indicates what type of transaction this is. Different types have different fields.\n * Valid types, and where their fields are stored:\n * * [pay] payment-transaction\n * * [keyreg] keyreg-transaction\n * * [acfg] asset-config-transaction\n * * [axfer] asset-transfer-transaction\n * * [afrz] asset-freeze-transaction\n * * [appl] application-transaction\n * * [stpf] state-proof-transaction\n */\n 'tx-type': TransactionType\n /** [fee] Transaction fee. */\n fee: number\n /** [snd] Sender's address. */\n sender: string\n /** [fv] First valid round for this transaction. */\n 'first-valid': number\n /** [lv] Last valid round for this transaction. */\n 'last-valid': number\n /** Round when the transaction was confirmed. */\n 'confirmed-round'?: number\n /** [grp] Base64 encoded byte array of a sha512/256 digest.\n *\n * When present indicates that this transaction is part of a transaction group\n * and the value is the sha512/256 hash of the transactions in that group.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n group?: string\n /**\n * [note] Free form data.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n note?: string\n /** [lg] Logs for the application being executed by this transaction. */\n logs?: string[]\n /** Time when the block this transaction is in was confirmed. */\n 'round-time'?: number\n /** Offset into the round where this transaction was confirmed. */\n 'intra-round-offset'?: number\n /** Signature of the transaction */\n signature?: TransactionSignature\n /** If the transaction is an `appl` transaction this will be populated see `tx-type` */\n 'application-transaction'?: ApplicationTransactionResult\n /** If the transaction is an `appl` transaction that resulted in an application creation then this\n * specifies the application index (ID) of that application.\n */\n 'created-application-index'?: number\n /** If the transaction is an `acfg` transaction this will be populated see `tx-type` */\n 'asset-config-transaction'?: AssetConfigTransactionResult\n /** If the transaction is an `acfg` transaction that resulted in an asset creation then this\n * specifies the asset index (ID) of that asset.\n */\n 'created-asset-index'?: number\n /** If the transaction is an `afrz` transaction this will be populated see `tx-type` */\n 'asset-freeze-transaction'?: AssetFreezeTransactionResult\n /** If the transaction is an `axfer` transaction this will be populated see `tx-type` */\n 'asset-transfer-transaction'?: AssetTransferTransactionResult\n /** If the transaction is a `keyreg` transaction this will be populated see `tx-type` */\n 'keyreg-transaction'?: KeyRegistrationTransactionResult\n /** If the transaction is a `pay` transaction this will be populated see `tx-type` */\n 'payment-transaction'?: PaymentTransactionResult\n /** If the transaction is a `stpf` transaction this will be populated see `tx-type` */\n 'state-proof-transaction'?: StateProofTransactionResult\n /** [sgnr] this is included with signed transactions when the signing address does not equal the sender.\n * The backend can use this to ensure that auth addr is equal to the accounts auth addr.\n */\n 'auth-addr'?: string\n /** [ca] closing amount for transaction. */\n 'closing-amount'?: number\n /** [gh] Hash of genesis block.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'genesis-hash'?: string\n /** [gen] genesis block ID. */\n 'genesis-id'?: string\n /** Inner transactions produced by application execution. */\n 'inner-txns'?: TransactionResult[]\n /** [rekey] when included in a valid transaction, the accounts auth addr will be updated with\n * this value and future signatures must be signed with the key represented by this address.\n */\n 'rekey-to'?: string\n /** [lx] Base64 encoded 32-byte array. Lease enforces mutual exclusion of transactions.\n *\n * If this field is nonzero, then once the transaction is confirmed, it acquires the lease\n * identified by the (Sender, Lease) pair of the transaction until the LastValid round passes.\n *\n * While this transaction possesses the lease, no other transaction specifying this lease can be confirmed.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n lease?: string\n /** [ld] Local state key/value changes for the application being executed by this transaction. */\n 'local-state-delta'?: AccountStateDelta[]\n /** [gd] Global state key/value changes for the application being executed by this transaction. */\n 'global-state-delta'?: StateDelta\n /** [rr] rewards applied to receiver account. */\n 'receiver-rewards'?: number\n /** [rs] rewards applied to sender account. */\n 'sender-rewards'?: number\n /** [rc] rewards applied to close-remainder-to account. */\n 'close-rewards'?: number\n}\n\n/** Account information at a given round https://developer.algorand.org/docs/rest-apis/indexer/#account */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport interface AccountResult extends Record<string, any> {\n /** the account public key */\n address: string\n /** [algo] total number of µAlgo in the account */\n amount: number\n /** specifies the amount of µAlgo in the account, without the pending rewards. */\n 'amount-without-pending-rewards': number\n /** [appl] applications local data stored in this account.\n *\n * Note the raw object uses map[int] -> AppLocalState for this type.\n */\n 'apps-local-state'?: AppLocalState[]\n /** [teap] the sum of all extra application program pages for this account. */\n 'apps-total-extra-pages'?: number\n /** [tsch] stores the sum of all of the local schemas and global schemas in this account.\n *\n * Note: the raw account uses StateSchema for this type.\n */\n 'apps-total-schema'?: StateSchema\n /** [asset] assets held by this account.\n *\n * Note the raw object uses map[int] -> AssetHolding for this type.\n */\n assets?: AssetHolding[]\n /** [spend] the address against which signing should be checked.\n *\n * If empty, the address of the current account is used.\n *\n * This field can be updated in any transaction by setting the RekeyTo field.\n */\n 'auth-addr'?: string\n /** Round during which this account was most recently closed. */\n 'closed-at-round'?: number\n /** [appp] parameters of applications created by this account including app global data.\n *\n * Note: the raw account uses map[int] -> AppParams for this type.\n */\n 'created-apps'?: ApplicationResult[]\n /** [apar] parameters of assets created by this account.\n *\n * Note: the raw account uses map[int] -> Asset for this type.\n */\n 'created-assets'?: AssetResult[]\n /** Round during which this account first appeared in a transaction. */\n 'created-at-round'?: number\n /** Whether or not this account is currently closed. */\n deleted?: boolean\n /** If participating in consensus, the parameters used by this account in the consensus protocol. */\n participation?: AccountParticipation\n /** amount of µAlgo of pending rewards in this account. */\n 'pending-rewards': number\n /** [ebase] used as part of the rewards computation. Only applicable to accounts which are participating. */\n 'reward-base'?: number\n /** [ern] total rewards of µAlgo the account has received, including pending rewards. */\n rewards: number\n /** The round for which this information is relevant. */\n round: number\n /** Indicates what type of signature is used by this account */\n 'sig-type': SignatureType\n /** [onl] delegation status of the account's µAlgo */\n status: AccountStatus\n /** The count of all applications that have been opted in, equivalent to the count of application local data (AppLocalState objects) stored in this account. */\n 'total-apps-opted-in': number\n /** The count of all assets that have been opted in, equivalent to the count of AssetHolding objects held by this account. */\n 'total-assets-opted-in': number\n /** For app-accounts only. The total number of bytes allocated for the keys and values of boxes which belong to the associated application. */\n 'total-box-bytes': number\n /** For app-accounts only. The total number of boxes which belong to the associated application. */\n 'total-boxes': number\n /** The count of all apps (AppParams objects) created by this account. */\n 'total-created-apps': number\n /** The count of all assets (AssetParams objects) created by this account. */\n 'total-created-assets': number\n}\n\n/** Fields for a payment transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionpayment */\nexport interface PaymentTransactionResult {\n /** [amt] number of µAlgo intended to be transferred. */\n amount: number\n /** Number of µAlgo that were sent to the close-remainder-to address when closing the sender account. */\n 'close-amount'?: number\n /** [close] when set, indicates that the sending account should be closed and all remaining funds be transferred to this address. */\n 'close-remainder-to'?: string\n /** [rcv] receiver's address. */\n receiver: string\n}\n\n/** Fields for a state proof transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionstateproof.\n *\n * See also https://developer.algorand.org/docs/get-details/stateproofs/,\n * https://developer.algorand.org/docs/get-details/stateproofs/light_client/,\n * https://github.com/algorand/go-algorand/blob/master/data/transactions/stateproof.go,\n * https://github.com/algorand/go-algorand/blob/master/crypto/stateproof/structs.go,\n * https://github.com/algorand/go-algorand/blob/master/data/stateproofmsg/message.go, and\n * https://developer.algorand.org/docs/rest-apis/algod/#stateproof.\n */\nexport interface StateProofTransactionResult {\n /** [spmsg] State proof message\n *\n * Message represents the message that the state proofs are attesting to. This message can be\n * used by lightweight client and gives it the ability to verify proofs on the Algorand's state.\n *\n * In addition to that proof, this message also contains fields that\n * are needed in order to verify the next state proofs (VotersCommitment and LnProvenWeight).\n */\n message: {\n /** [b] BlockHeadersCommitment contains a commitment on all light block headers within a state proof interval. */\n 'block-headers-commitment': string\n /** [f] First round the message attests to */\n 'first-attested-round': number\n /** [l] Last round the message attests to */\n 'latest-attested-round': number\n /** [P] An integer value representing the natural log of the proven weight with 16 bits of precision. This value would be used to verify the next state proof. */\n 'ln-proven-weight': number | bigint\n /** [v] The vector commitment root of the top N accounts to sign the next StateProof.\n *\n * Pattern : \"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\" */\n 'voters-commitment': string\n }\n /** [sp] a proof on Algorand's state */\n 'state-proof': {\n /** [P] Part proofs that make up the overall proof */\n 'part-proofs': MerkleArrayProof\n /** [pr] The positions that are revealed */\n 'positions-to-reveal': number[]\n /** [r] Reveals is a sparse map from the position being revealed\n * to the corresponding elements from the sigs and participants\n * arrays.\n */\n reveals: {\n /** The position being revealed */\n position: number\n /** [p] Participant\n *\n * A Participant corresponds to an account whose AccountData.Status\n * is Online, and for which the expected sigRound satisfies\n * AccountData.VoteFirstValid <= sigRound <= AccountData.VoteLastValid.\n *\n * In the Algorand ledger, it is possible for multiple accounts to have\n * the same PK. Thus, the PK is not necessarily unique among Participants.\n * However, each account will produce a unique Participant struct, to avoid\n * potential DoS attacks where one account claims to have the same VoteID PK\n * as another account.\n */\n participant: {\n /** [p] PK is the identifier used to verify the signature for a specific participant\n *\n * Verifier is used to verify a merklesignature.Signature produced by merklesignature.Secrets.\n */\n verifier: {\n /** [cmt] Commitment represents the root of the vector commitment tree built upon the MSS keys. */\n commitment: string\n /** [lf] The lifetime of the key */\n 'key-lifetime': number\n }\n /** [w] Weight is AccountData.MicroAlgos. */\n weight: number | bigint\n }\n /** [s] A sigslotCommit is a single slot in the sigs array that forms the state proof. */\n 'sig-slot': {\n /** [l] L is the total weight of signatures in lower-numbered slots.\n * This is initialized once the builder has collected a sufficient\n * number of signatures.\n */\n 'lower-sig-weight': number | bigint\n /** [s] Sig is a signature by the participant on the expected message.\n *\n * Signature represents a signature in the Merkle signature scheme using falcon signatures as an underlying crypto scheme.\n * It consists of an ephemeral public key, a signature, a Merkle verification path and an index.\n * The Merkle signature considered valid only if the Signature is verified under the ephemeral public key and\n * the Merkle verification path verifies that the ephemeral public key is located at the given index of the tree\n * (for the root given in the long-term public key).\n * More details can be found on Algorand's spec\n */\n signature: {\n /** [sig] Signature in the Merkle signature scheme using falcon signatures */\n 'falcon-signature': string\n /** [idx] Merkle array index */\n 'merkle-array-index': number\n /** [prf] Merkle verification path */\n proof: MerkleArrayProof\n /** [vkey] Falcon verifier key */\n 'verifying-key': string\n }\n }\n }[]\n /** [v] Merkle signature salt version */\n 'salt-version': number\n /** [c] Digest of the signature commit */\n 'sig-commit': string\n /** [S] Proofs for the signature */\n 'sig-proofs': MerkleArrayProof\n /** [w] The combined weight of the signatures */\n 'signed-weight': number | bigint\n }\n /** [sptype] State proof type, per https://github.com/algorand/go-algorand/blob/master/protocol/stateproof.go#L24\n *\n * * 0: StateProofBasic is our initial state proof setup. using falcon keys and subset-sum hash\n */\n 'state-proof-type': number\n}\n\n/**\n * Merkle array Proof.\n *\n * Proof is used to convince a verifier about membership of leaves: h0,h1...hn\n * at indexes i0,i1...in on a tree. The verifier has a trusted value of the tree\n * root hash.\n *\n * Path is bounded by MaxNumLeaves since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxTreeDepth / 2\n *\n * Consider two different reveals for the same tree:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^\n * . hints: [a, r, z, z4]\n * . len(hints) = 4\n * ```\n * You need a to combine with b to get q, need r to combine with the computed q and get y, and so on.\n *\n * The worst case is this:\n * ```\n * . z5\n * . z3 z4\n * . y z z1 z2\n * . q r s t u v w x\n * . a b c d e f g h i j k l m n o p\n * . ^ ^ ^ ^ ^ ^ ^ ^\n * .\n * . hints: [b, d, e, g, j, l, m, o]\n * . len(hints) = 2^4/2\n * ```\n */\nexport interface MerkleArrayProof {\n /** [hsh] The metadata of the hash factory that was used to hash the proofs */\n 'hash-factory': {\n /** [t] The type of hash https://github.com/algorand/go-algorand/blob/master/crypto/hashes.go#L42 */\n 'hash-type': number\n }\n /** [pth] Path is bounded by MaxNumLeavesOnEncodedTree since there could be multiple reveals, and\n * given the distribution of the elt positions and the depth of the tree,\n * the path length can increase up to 2^MaxEncodedTreeDepth / 2\n */\n path: string[]\n /** [td] TreeDepth represents the depth of the tree that is being proven.\n * It is the number of edges from the root to a leaf.\n */\n 'tree-depth': number\n}\n\n/** Fields for an application transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionapplication */\nexport interface ApplicationTransactionResult extends Omit<ApplicationParams, 'creator' | 'global-state'> {\n /** [apat] List of accounts in addition to the sender that may be accessed from the application's approval-program and clear-state-program. */\n accounts?: string[]\n /** [apaa] transaction specific arguments accessed from the application's approval-program and clear-state-program. */\n 'application-args'?: string[]\n /** [apid] ID of the application being configured or empty if creating. */\n 'application-id': number\n /** [apfa] Lists the applications in addition to the application-id whose global states may be accessed by this application's approval-program and clear-state-program. The access is read-only. */\n 'foreign-apps'?: number[]\n /** [apas] lists the assets whose parameters may be accessed by this application's ApprovalProgram and ClearStateProgram. The access is read-only. */\n 'foreign-assets'?: number[]\n /** [apan] defines the what additional actions occur with the transaction. */\n 'on-completion': ApplicationOnComplete\n}\n\n/** Fields for asset allocation, re-configuration, and destruction.\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetconfig\n *\n * A zero value for asset-id indicates asset creation. A zero value for the params indicates asset destruction.\n */\nexport interface AssetConfigTransactionResult {\n /** [xaid] ID of the asset being configured or empty if creating. */\n 'asset-id': number\n /** [apar] the parameters for the asset. */\n params?: AssetParams\n}\n\n/** Fields for an asset freeze transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassetfreeze */\nexport interface AssetFreezeTransactionResult {\n /** [fadd] Address of the account whose asset is being frozen or thawed. */\n address: string\n /** [faid] ID of the asset being frozen or thawed. */\n 'asset-id': number\n /** [afrz] The new freeze status. */\n 'new-freeze-status': boolean\n}\n\n/** Fields for an asset transfer transaction. https://developer.algorand.org/docs/rest-apis/indexer/#transactionassettransfer */\nexport interface AssetTransferTransactionResult {\n /** [aamt] Amount of asset to transfer. A zero amount transferred to self allocates that asset in the account's Assets map. */\n amount: number | bigint\n /** [xaid] ID of the asset being transferred. */\n 'asset-id': number\n /** Number of assets transfered to the close-to account as part of the transaction. */\n 'close-amount'?: number | bigint\n /** [aclose] Indicates that the asset should be removed from the account's Assets map, and specifies where the remaining asset holdings should be transferred. It's always valid to transfer remaining asset holdings to the creator account. */\n 'close-to'?: string\n /** [arcv] Recipient address of the transfer. */\n receiver: string\n /** [asnd] The effective sender during a clawback transactions. If this is not a zero value, the real transaction sender must be the Clawback address from the AssetParams. */\n sender?: string\n}\n\n/** Fields for a `keyreg` transaction https://developer.algorand.org/docs/rest-apis/indexer/#transactionkeyreg */\nexport interface KeyRegistrationTransactionResult {\n /** [nonpart] Mark the account as participating or non-participating. */\n 'non-participation'?: boolean\n /** [selkey] Public key used with the Verified Random Function (VRF) result during committee selection.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'selection-participation-key'?: string\n /** [selkey] Public key used with the Verified Random Function (VRF) result during committee selection.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'state-proof-key'?: string\n /** [votefst] First round this participation key is valid. */\n 'vote-first-valid'?: number\n /** [votekd] Number of subkeys in each batch of participation keys. */\n 'vote-key-dilution'?: number\n /** [votelst] Last round this participation key is valid. */\n 'vote-last-valid'?: number\n /** [votekey] Participation public key used in key registration transactions.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'vote-participation-key'?: string\n}\n\n/** Specifies both the unique identifier and the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#asset */\nexport interface AssetResult {\n /** Unique asset identifier. */\n index: number\n /** Whether or not this asset is currently deleted. */\n deleted?: boolean\n /** Round during which this asset was created. */\n 'created-at-round'?: number\n /** Round during which this asset was destroyed. */\n 'destroyed-at-round'?: number\n /** The parameters for the asset */\n params: AssetParams\n}\n\n/**\n * The result of looking up an application\n */\nexport interface ApplicationResult {\n id: number\n params: ApplicationParams\n 'created-at-round'?: number\n deleted?: boolean\n 'deleted-at-round'?: number\n}\n\n/** Validation signature associated with some data. Only one of the signatures should be provided. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignature */\nexport interface TransactionSignature {\n /** Logicsig signature */\n logicsig?: LogicTransactionSignature\n /** Multisig signature */\n multisig?: MultisigTransactionSignature\n /** [sig] Standard ed25519 signature.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n sig?: string\n}\n\n/** [lsig] Programatic transaction signature.\n *\n * https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturelogicsig\n *\n * https://developer.algorand.org/docs/get-details/transactions/signatures/#logic-signatures\n */\nexport interface LogicTransactionSignature {\n /** [arg] Logic arguments, base64 encoded. */\n args?: string[]\n /** [l] Program signed by a signature or multi signature, or hashed to be the address of ana ccount.\n *\n * Base64 encoded TEAL program.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n logic: string\n /** The signature of the multisig the logic signature delegating the logicsig. https://developer.algorand.org/docs/get-details/dapps/smart-contracts/smartsigs/modes/#delegated-approval */\n 'multisig-signature'?: MultisigTransactionSignature\n /** [sig] Standard ed25519 signature delegating the logicsig. https://developer.algorand.org/docs/get-details/dapps/smart-contracts/smartsigs/modes/#delegated-approval\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n signature?: string\n}\n\n/** [msig] structure holding multiple subsignatures. https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisig */\nexport interface MultisigTransactionSignature {\n /** [subsig] Holds pairs of public key and signatures. */\n subsignature: MultisigTransactionSubSignature[]\n /** [thr] The threshold of signatures required for the multisig */\n threshold: number\n /** [v] The version of the multisig */\n version: number\n}\n\n/** Sub-signature for a multisig signature https://developer.algorand.org/docs/rest-apis/indexer/#transactionsignaturemultisigsubsignature */\nexport interface MultisigTransactionSubSignature {\n /** [pk] The public key of the account making the signature\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'public-key': string\n /** [s] The signature\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n signature?: string\n}\n\nexport interface EvalDeltaKeyValue {\n key: string\n value: EvalDelta\n}\n\nexport interface AccountStateDelta {\n address: string\n delta: StateDelta\n}\n\nexport type StateDelta = EvalDeltaKeyValue[]\n\n/** Represents a TEAL value delta. https://developer.algorand.org/docs/rest-apis/indexer/#evaldelta */\nexport interface EvalDelta {\n /** [at] delta action. */\n action: number\n /** [bs] bytes value. */\n bytes?: string\n /** [ui] uint value. */\n uint?: number\n}\n\n/** Stores the global information associated with an application https://developer.algorand.org/docs/rest-apis/indexer/#applicationparams */\nexport interface ApplicationParams {\n /** The address that created this application. This is the address where the parameters and global state for this application can be found. */\n creator: string\n /**\n * [apap]/[approv] Logic executed for every application transaction, except when on-completion is set to \"clear\".\n *\n * It can read and write global state for the application, as well as account-specific local state.\n *\n * Approval programs may reject the transaction.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'approval-program': string\n /**\n * [apsu]/[clearp] Logic executed for application transactions with on-completion set to \"clear\".\n *\n * It can read and write global state for the application, as well as account-specific local state.\n *\n * Clear state programs cannot reject the transaction.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'clear-state-program': string\n /** [epp] the amount of extra program pages available to this app. */\n 'extra-program-pages'?: number\n /** [gs] global schema */\n 'global-state': modelsv2.TealKeyValue[]\n /** [gsch] global schema */\n 'global-state-schema'?: StateSchema\n /** [lsch] local schema */\n 'local-state-schema'?: StateSchema\n}\n\n/** Represents a [apls] local-state or [apgs] global-state schema.\n * https://developer.algorand.org/docs/rest-apis/indexer/#stateschema\n *\n * These schemas determine how much storage may be used in a local-state or global-state for an application.\n *\n * The more space used, the larger minimum balance must be maintained in the account holding the data.\n */\nexport interface StateSchema {\n /** Maximum number of TEAL byte slices that may be stored in the key/value store. */\n 'num-byte-slice': number\n /** Maximum number of TEAL uints that may be stored in the key/value store. */\n 'num-uint': number\n}\n\n/** Defines the what additional actions occur with the transaction https://developer.algorand.org/docs/rest-apis/indexer/#oncompletion */\nexport enum ApplicationOnComplete {\n noop = 'noop',\n optin = 'optin',\n closeout = 'closeout',\n clear = 'clear',\n update = 'update',\n delete = 'delete',\n}\n\n/** AssetParams specifies the parameters for an asset. https://developer.algorand.org/docs/rest-apis/indexer/#assetparams */\nexport interface AssetParams {\n /**\n * The address that created this asset. This is the address where the parameters\n * for this asset can be found, and also the address where unwanted asset units can\n * be sent in the worst case.\n */\n creator: string\n /**\n * (dc) The number of digits to use after the decimal point when displaying this\n * asset. If 0, the asset is not divisible. If 1, the base unit of the asset is in\n * tenths. If 2, the base unit of the asset is in hundredths, and so on. This value\n * must be between 0 and 19 (inclusive).\n */\n decimals: number | bigint\n /**\n * (t) The total number of units of this asset.\n */\n total: number | bigint\n /**\n * (c) Address of account used to clawback holdings of this asset. If empty,\n * clawback is not permitted.\n */\n clawback?: string\n /**\n * (df) Whether holdings of this asset are frozen by default.\n */\n 'default-frozen'?: boolean\n /**\n * (f) Address of account used to freeze holdings of this asset. If empty, freezing\n * is not permitted.\n */\n freeze?: string\n /**\n * (m) Address of account used to manage the keys of this asset and to destroy it.\n */\n manager?: string\n /**\n * (am) A commitment to some unspecified asset metadata. The format of this\n * metadata is up to the application.\n */\n 'metadata-hash'?: Uint8Array\n /**\n * (an) Name of this asset, as supplied by the creator. Included only when the\n * asset name is composed of printable utf-8 characters.\n */\n name?: string\n /**\n * Base64 encoded name of this asset, as supplied by the creator.\n */\n 'name-b64'?: Uint8Array\n /**\n * (r) Address of account holding reserve (non-minted) units of this asset.\n */\n reserve?: string\n /**\n * (un) Name of a unit of this asset, as supplied by the creator. Included only\n * when the name of a unit of this asset is composed of printable utf-8 characters.\n */\n 'unit-name'?: string\n /**\n * Base64 encoded name of a unit of this asset, as supplied by the creator.\n */\n 'unit-name-b64'?: Uint8Array\n /**\n * (au) URL where more information about the asset can be retrieved. Included only\n * when the URL is composed of printable utf-8 characters.\n */\n url?: string\n /**\n * Base64 encoded URL where more information about the asset can be retrieved.\n */\n 'url-b64'?: Uint8Array\n}\n\n/** Type of signature used by an account */\nexport enum SignatureType {\n /** Normal signature */\n sig = 'sig',\n /** Multisig */\n msig = 'msig',\n /** Logic signature */\n lsig = 'lsig',\n}\n\n/** Delegation status of the account */\nexport enum AccountStatus {\n /** Indicates that the associated account is delegated */\n Offline = 'Offline',\n /** Indicates that the associated account used as part of the delegation pool */\n Online = 'Online',\n /** Indicates that the associated account is neither a delegator nor a delegate */\n NotParticipating = 'NotParticipating',\n}\n\n/** AccountParticipation describes the parameters used by this account in consensus protocol. https://developer.algorand.org/docs/rest-apis/indexer/#accountparticipation */\nexport interface AccountParticipation {\n /** [sel] Selection public key (if any) currently registered for this round.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'selection-participation-key': string\n /** [stprf] Root of the state proof key (if any).\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'state-proof-key'?: string\n /** [voteFst] First round for which this participation is valid. */\n 'vote-first-valid': number\n /** [voteKD] Number of subkeys in each batch of participation keys. */\n 'vote-key-dilution': number\n /** [voteLst] Last round for which this participation is valid. */\n 'vote-last-valid': number\n /** [vote] root participation public key (if any) currently registered for this round.\n *\n * *Pattern:* `\"^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==\\|[A-Za-z0-9+/]{3}=)?$\"`\n */\n 'vote-participation-key': string\n}\n\n/** Stores local state associated with an application. https://developer.algorand.org/docs/rest-apis/indexer/#applicationlocalstate */\nexport interface AppLocalState {\n /** Round when account closed out of the application. */\n 'closed-out-at-round'?: number\n /** Whether or not the application local state is currently deleted from its account. */\n deleted?: boolean\n /** The application which this local state is for. */\n id: number\n /** [tkv] storage. */\n 'key-value'?: modelsv2.TealKeyValue[]\n /** Round when the account opted into the application. */\n 'opted-in-at-round'?: number\n /** [hsch] schema. */\n schema: StateSchema\n}\n\n/** Describes an asset held by an account. https://developer.algorand.org/docs/rest-apis/indexer/#assetholding */\nexport interface AssetHolding {\n /**\n * (a) number of units held.\n */\n amount: number | bigint\n /**\n * Asset ID of the holding.\n */\n 'asset-id': number\n /** Whether or not the asset holding is currently deleted from its account. */\n deleted?: boolean\n /**\n * [f] whether or not the holding is frozen.\n */\n 'is-frozen': boolean\n /** Round during which the account opted into this asset holding. */\n 'opted-in-at-round': number\n /** Round during which the account opted out of this asset holding. */\n 'opted-out-at-round': number\n}\n\n/** Describes an asset holding for an account of a known asset. https://developer.algorand.org/docs/rest-apis/indexer/#miniassetholding */\nexport interface MiniAssetHolding {\n /**\n * Address of the account that holds the asset.\n */\n address: string\n /**\n * (a) number of units held.\n */\n amount: number | bigint\n /** Whether or not the asset holding is currently deleted from its account. */\n deleted?: boolean\n /**\n * [f] whether or not the holding is frozen.\n */\n 'is-frozen': boolean\n /** Round during which the account opted into this asset holding. */\n 'opted-in-at-round'?: number\n /** Round during which the account opted out of this asset holding. */\n 'opted-out-at-round'?: number\n}\n"],"names":[],"mappings":"AA+rBA;IACY;AAAZ,CAAA,UAAY,qBAAqB,EAAA;AAC/B,IAAA,qBAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACb,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,qBAAA,CAAA,UAAA,CAAA,GAAA,UAAqB;AACrB,IAAA,qBAAA,CAAA,OAAA,CAAA,GAAA,OAAe;AACf,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACjB,IAAA,qBAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;AACnB,CAAC,EAPW,qBAAqB,KAArB,qBAAqB,GAOhC,EAAA,CAAA,CAAA;AA6ED;IACY;AAAZ,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,KAAA,CAAA,GAAA,KAAW;;AAEX,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa;;AAEb,IAAA,aAAA,CAAA,MAAA,CAAA,GAAA,MAAa;AACf,CAAC,EAPW,aAAa,KAAb,aAAa,GAOxB,EAAA,CAAA,CAAA;AAED;IACY;AAAZ,CAAA,UAAY,aAAa,EAAA;;AAEvB,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB;;AAEnB,IAAA,aAAA,CAAA,QAAA,CAAA,GAAA,QAAiB;;AAEjB,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,kBAAqC;AACvC,CAAC,EAPW,aAAa,KAAb,aAAa,GAOxB,EAAA,CAAA,CAAA;;;;"}
@@ -131,7 +131,7 @@ class KmdAccountManager {
131
131
  config.Config.logger.info(`LocalNet account '${name}' doesn't yet exist; created account ${account.addr} with keys stored in KMD and funding with ${fundWith?.algo ?? 1000} ALGO`);
132
132
  // Fund the account from the dispenser
133
133
  const dispenser = await this.getLocalNetDispenserAccount();
134
- await new types_composer.default({
134
+ await new types_composer.TransactionComposer({
135
135
  algod: this._clientManager.algod,
136
136
  getSigner: () => dispenser.signer,
137
137
  getSuggestedParams: () => this._clientManager.algod.getTransactionParams().do(),
@@ -1 +1 @@
1
- {"version":3,"file":"kmd-account-manager.js","sources":["../../src/types/kmd-account-manager.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { Config } from '../config'\nimport { SigningAccount, TransactionSignerAccount } from './account'\nimport { AlgoAmount } from './amount'\nimport { ClientManager } from './client-manager'\nimport AlgoKitComposer from './composer'\n\n/** Provides abstractions over a [KMD](https://github.com/algorand/go-algorand/blob/master/daemon/kmd/README.md) instance\n * that makes it easier to get and manage accounts using KMD. */\nexport class KmdAccountManager {\n private _clientManager: Omit<ClientManager, 'kmd'>\n private _kmd?: algosdk.Kmd | null\n\n /**\n * Create a new KMD manager.\n * @param clientManager A ClientManager client to use for algod and kmd clients\n */\n constructor(clientManager: ClientManager) {\n this._clientManager = clientManager\n try {\n this._kmd = clientManager.kmd\n } catch {\n this._kmd = undefined\n }\n }\n\n async kmd(): Promise<algosdk.Kmd> {\n if (this._kmd === undefined) {\n if (await this._clientManager.isLocalNet()) {\n const { kmdConfig } = ClientManager.getConfigFromEnvironmentOrLocalNet()\n if (kmdConfig) {\n this._kmd = ClientManager.getKmdClient(kmdConfig)\n return this._kmd\n }\n }\n this._kmd = null\n }\n\n if (!this._kmd) {\n throw new Error('Attempt to use Kmd client in AlgoKit instance with no Kmd configured')\n }\n\n return this._kmd\n }\n\n /**\n * Returns an Algorand signing account with private key loaded from the given KMD wallet (identified by name).\n *\n * @param walletName The name of the wallet to retrieve an account from\n * @param predicate An optional filter to use to find the account (otherwise it will return a random account from the wallet)\n * @param sender The optional sender address to use this signer for (aka a rekeyed account)\n * @example Get default funded account in a LocalNet\n *\n * ```typescript\n * const defaultDispenserAccount = await kmdAccountManager.getWalletAccount(\n * 'unencrypted-default-wallet',\n * a => a.status !== 'Offline' && a.amount > 1_000_000_000\n * )\n * ```\n * @returns The signing account (with private key loaded) or undefined if no matching wallet or account was found\n */\n public async getWalletAccount(\n walletName: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n predicate?: (account: Record<string, any>) => boolean,\n sender?: string,\n ): Promise<(TransactionSignerAccount & { account: SigningAccount }) | undefined> {\n const kmd = await this.kmd()\n\n const walletsResponse = await kmd.listWallets()\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const wallet = walletsResponse.wallets.filter((w: any) => w.name === walletName)\n if (wallet.length === 0) {\n return undefined\n }\n\n const walletId = wallet[0].id\n\n const walletHandle = (await kmd.initWalletHandle(walletId, '')).wallet_handle_token\n const addresses = (await kmd.listKeys(walletHandle)).addresses\n\n let i = 0\n if (predicate) {\n for (i = 0; i < addresses.length; i++) {\n const address = addresses[i]\n const account = await this._clientManager.algod.accountInformation(address).do()\n if (predicate(account)) {\n break\n }\n }\n }\n\n if (i >= addresses.length) {\n return undefined\n }\n\n const accountKey = (await kmd.exportKey(walletHandle, '', addresses[i])).private_key\n\n const accountMnemonic = algosdk.secretKeyToMnemonic(accountKey)\n\n const account = algosdk.mnemonicToSecretKey(accountMnemonic)\n const signingAccount = new SigningAccount(account, sender)\n\n return {\n account: signingAccount,\n addr: signingAccount.addr,\n signer: signingAccount.signer,\n }\n }\n\n /**\n * Gets an account with private key loaded from a KMD wallet of the given name, or alternatively creates one with funds in it via a KMD wallet of the given name.\n *\n * This is useful to get idempotent accounts from LocalNet without having to specify the private key (which will change when resetting the LocalNet).\n *\n * This significantly speeds up local dev time and improves experience since you can write code that *just works* first go without manual config in a fresh LocalNet.\n *\n * If this is used via `mnemonicAccountFromEnvironment`, then you can even use the same code that runs on production without changes for local development!\n *\n * @param name The name of the wallet to retrieve / create\n * @param fundWith The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account\n *\n * @example\n * ```typescript\n * // Idempotently get (if exists) or crate (if it doesn't exist yet) an account by name using KMD\n * // if creating it then fund it with 2 ALGO from the default dispenser account\n * const newAccount = await kmdAccountManager.getOrCreateWalletAccount('account1', (2).algo())\n * // This will return the same account as above since the name matches\n * const existingAccount = await kmdAccountManager.getOrCreateWalletAccount('account1')\n * ```\n *\n * @returns An Algorand account with private key loaded - either one that already existed in the given KMD wallet, or a new one that is funded for you\n */\n public async getOrCreateWalletAccount(\n name: string,\n fundWith?: AlgoAmount,\n ): Promise<TransactionSignerAccount & { account: SigningAccount }> {\n // Get an existing account from the KMD wallet\n const existing = await this.getWalletAccount(name)\n if (existing) {\n return existing\n }\n\n const kmd = await this.kmd()\n\n // None existed: create the KMD wallet instead\n const walletId = (await kmd.createWallet(name, '')).wallet.id\n const walletHandle = (await kmd.initWalletHandle(walletId, '')).wallet_handle_token\n await kmd.generateKey(walletHandle)\n\n // Get the account from the new KMD wallet\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const account = (await this.getWalletAccount(name))!\n\n Config.logger.info(\n `LocalNet account '${name}' doesn't yet exist; created account ${account.addr} with keys stored in KMD and funding with ${\n fundWith?.algo ?? 1000\n } ALGO`,\n )\n\n // Fund the account from the dispenser\n const dispenser = await this.getLocalNetDispenserAccount()\n await new AlgoKitComposer({\n algod: this._clientManager.algod,\n getSigner: () => dispenser.signer,\n getSuggestedParams: () => this._clientManager.algod.getTransactionParams().do(),\n })\n .addPayment({\n amount: fundWith ?? AlgoAmount.Algo(1000),\n receiver: account.addr,\n sender: dispenser.addr,\n })\n .send()\n\n return account\n }\n\n /**\n * Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts).\n * @example\n * ```typescript\n * const dispenser = await kmdAccountManager.getLocalNetDispenserAccount()\n * ```\n * @returns The default LocalNet dispenser account\n */\n public async getLocalNetDispenserAccount() {\n if (!(await this._clientManager.isLocalNet())) {\n throw new Error(\"Can't get LocalNet dispenser account from non LocalNet network\")\n }\n\n const dispenser = await this.getWalletAccount('unencrypted-default-wallet', (a) => a.status !== 'Offline' && a.amount > 1_000_000_000)\n if (!dispenser) {\n throw new Error(\"Error retrieving LocalNet dispenser account; couldn't find the default account in KMD\")\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return dispenser\n }\n}\n"],"names":["ClientManager","SigningAccount","Config","AlgoKitComposer","AlgoAmount"],"mappings":";;;;;;;;;AAOA;AACgE;MACnD,iBAAiB,CAAA;AAI5B;;;AAGG;AACH,IAAA,WAAA,CAAY,aAA4B,EAAA;AACtC,QAAA,IAAI,CAAC,cAAc,GAAG,aAAa,CAAA;AACnC,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,GAAG,CAAA;SAC9B;AAAC,QAAA,MAAM;AACN,YAAA,IAAI,CAAC,IAAI,GAAG,SAAS,CAAA;SACtB;KACF;AAED,IAAA,MAAM,GAAG,GAAA;AACP,QAAA,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE;YAC3B,IAAI,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,EAAE;gBAC1C,MAAM,EAAE,SAAS,EAAE,GAAGA,iCAAa,CAAC,kCAAkC,EAAE,CAAA;gBACxE,IAAI,SAAS,EAAE;oBACb,IAAI,CAAC,IAAI,GAAGA,iCAAa,CAAC,YAAY,CAAC,SAAS,CAAC,CAAA;oBACjD,OAAO,IAAI,CAAC,IAAI,CAAA;iBACjB;aACF;AACD,YAAA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;SACjB;AAED,QAAA,IAAI,CAAC,IAAI,CAAC,IAAI,EAAE;AACd,YAAA,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAA;SACxF;QAED,OAAO,IAAI,CAAC,IAAI,CAAA;KACjB;AAED;;;;;;;;;;;;;;;AAeG;IACI,MAAM,gBAAgB,CAC3B,UAAkB;;AAElB,IAAA,SAAqD,EACrD,MAAe,EAAA;AAEf,Q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AA,KAAA,CAAO,CACR,CAAA;;AAGD,QAAA,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,2BAA2B,EAAE,CAAA;QAC1D,MAAM,IAAIC,sBAAe,CAAC;AACxB,YAAA,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK;AAChC,YAAA,SAAS,EAAE,MAAM,SAAS,CAAC,MAAM;AACjC,YAAA,kBAAkB,EAAE,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,oBAAoB,EAAE,CAAC,EAAE,EAAE;SAChF,CAAC;AACC,aAAA,UAAU,CAAC;YACV,MAAM,EAAE,QAAQ,IAAIC,uBAAU,CAAC,IAAI,CAAC,IAAI,CAAC;YACzC,QAAQ,EAAE,OAAO,CAAC,IAAI;YACtB,MAAM,EAAE,SAAS,CAAC,IAAI;SACvB,CAAC;AACD,aAAA,IAAI,EAAE,CAAA;AAET,QAAA,OAAO,OAAO,CAAA;KACf;AAED;;;;;;;AAOG;AACI,IAAA,MAAM,2BAA2B,GAAA;QACtC,IAAI,EAAE,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,EAAE;AAC7C,YAAA,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAA;SAClF;QAED,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,4BAA4B,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,GAAG,UAAa,CAAC,CAAA;QACtI,IAAI,CAAC,SAAS,EAAE;AACd,YAAA,MAAM,IAAI,KAAK,CAAC,uFAAuF,CAAC,CAAA;SACzG;;AAGD,QAAA,OAAO,SAAS,CAAA;KACjB;AACF;;;;"}
1
+ {"version":3,"file":"kmd-account-manager.js","sources":["../../src/types/kmd-account-manager.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { Config } from '../config'\nimport { SigningAccount, TransactionSignerAccount } from './account'\nimport { AlgoAmount } from './amount'\nimport { ClientManager } from './client-manager'\nimport { TransactionComposer } from './composer'\n\n/** Provides abstractions over a [KMD](https://github.com/algorand/go-algorand/blob/master/daemon/kmd/README.md) instance\n * that makes it easier to get and manage accounts using KMD. */\nexport class KmdAccountManager {\n private _clientManager: Omit<ClientManager, 'kmd'>\n private _kmd?: algosdk.Kmd | null\n\n /**\n * Create a new KMD manager.\n * @param clientManager A ClientManager client to use for algod and kmd clients\n */\n constructor(clientManager: ClientManager) {\n this._clientManager = clientManager\n try {\n this._kmd = clientManager.kmd\n } catch {\n this._kmd = undefined\n }\n }\n\n async kmd(): Promise<algosdk.Kmd> {\n if (this._kmd === undefined) {\n if (await this._clientManager.isLocalNet()) {\n const { kmdConfig } = ClientManager.getConfigFromEnvironmentOrLocalNet()\n if (kmdConfig) {\n this._kmd = ClientManager.getKmdClient(kmdConfig)\n return this._kmd\n }\n }\n this._kmd = null\n }\n\n if (!this._kmd) {\n throw new Error('Attempt to use Kmd client in AlgoKit instance with no Kmd configured')\n }\n\n return this._kmd\n }\n\n /**\n * Returns an Algorand signing account with private key loaded from the given KMD wallet (identified by name).\n *\n * @param walletName The name of the wallet to retrieve an account from\n * @param predicate An optional filter to use to find the account (otherwise it will return a random account from the wallet)\n * @param sender The optional sender address to use this signer for (aka a rekeyed account)\n * @example Get default funded account in a LocalNet\n *\n * ```typescript\n * const defaultDispenserAccount = await kmdAccountManager.getWalletAccount(\n * 'unencrypted-default-wallet',\n * a => a.status !== 'Offline' && a.amount > 1_000_000_000\n * )\n * ```\n * @returns The signing account (with private key loaded) or undefined if no matching wallet or account was found\n */\n public async getWalletAccount(\n walletName: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n predicate?: (account: Record<string, any>) => boolean,\n sender?: string,\n ): Promise<(TransactionSignerAccount & { account: SigningAccount }) | undefined> {\n const kmd = await this.kmd()\n\n const walletsResponse = await kmd.listWallets()\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const wallet = walletsResponse.wallets.filter((w: any) => w.name === walletName)\n if (wallet.length === 0) {\n return undefined\n }\n\n const walletId = wallet[0].id\n\n const walletHandle = (await kmd.initWalletHandle(walletId, '')).wallet_handle_token\n const addresses = (await kmd.listKeys(walletHandle)).addresses\n\n let i = 0\n if (predicate) {\n for (i = 0; i < addresses.length; i++) {\n const address = addresses[i]\n const account = await this._clientManager.algod.accountInformation(address).do()\n if (predicate(account)) {\n break\n }\n }\n }\n\n if (i >= addresses.length) {\n return undefined\n }\n\n const accountKey = (await kmd.exportKey(walletHandle, '', addresses[i])).private_key\n\n const accountMnemonic = algosdk.secretKeyToMnemonic(accountKey)\n\n const account = algosdk.mnemonicToSecretKey(accountMnemonic)\n const signingAccount = new SigningAccount(account, sender)\n\n return {\n account: signingAccount,\n addr: signingAccount.addr,\n signer: signingAccount.signer,\n }\n }\n\n /**\n * Gets an account with private key loaded from a KMD wallet of the given name, or alternatively creates one with funds in it via a KMD wallet of the given name.\n *\n * This is useful to get idempotent accounts from LocalNet without having to specify the private key (which will change when resetting the LocalNet).\n *\n * This significantly speeds up local dev time and improves experience since you can write code that *just works* first go without manual config in a fresh LocalNet.\n *\n * If this is used via `mnemonicAccountFromEnvironment`, then you can even use the same code that runs on production without changes for local development!\n *\n * @param name The name of the wallet to retrieve / create\n * @param fundWith The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account\n *\n * @example\n * ```typescript\n * // Idempotently get (if exists) or crate (if it doesn't exist yet) an account by name using KMD\n * // if creating it then fund it with 2 ALGO from the default dispenser account\n * const newAccount = await kmdAccountManager.getOrCreateWalletAccount('account1', (2).algo())\n * // This will return the same account as above since the name matches\n * const existingAccount = await kmdAccountManager.getOrCreateWalletAccount('account1')\n * ```\n *\n * @returns An Algorand account with private key loaded - either one that already existed in the given KMD wallet, or a new one that is funded for you\n */\n public async getOrCreateWalletAccount(\n name: string,\n fundWith?: AlgoAmount,\n ): Promise<TransactionSignerAccount & { account: SigningAccount }> {\n // Get an existing account from the KMD wallet\n const existing = await this.getWalletAccount(name)\n if (existing) {\n return existing\n }\n\n const kmd = await this.kmd()\n\n // None existed: create the KMD wallet instead\n const walletId = (await kmd.createWallet(name, '')).wallet.id\n const walletHandle = (await kmd.initWalletHandle(walletId, '')).wallet_handle_token\n await kmd.generateKey(walletHandle)\n\n // Get the account from the new KMD wallet\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const account = (await this.getWalletAccount(name))!\n\n Config.logger.info(\n `LocalNet account '${name}' doesn't yet exist; created account ${account.addr} with keys stored in KMD and funding with ${\n fundWith?.algo ?? 1000\n } ALGO`,\n )\n\n // Fund the account from the dispenser\n const dispenser = await this.getLocalNetDispenserAccount()\n await new TransactionComposer({\n algod: this._clientManager.algod,\n getSigner: () => dispenser.signer,\n getSuggestedParams: () => this._clientManager.algod.getTransactionParams().do(),\n })\n .addPayment({\n amount: fundWith ?? AlgoAmount.Algo(1000),\n receiver: account.addr,\n sender: dispenser.addr,\n })\n .send()\n\n return account\n }\n\n /**\n * Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts).\n * @example\n * ```typescript\n * const dispenser = await kmdAccountManager.getLocalNetDispenserAccount()\n * ```\n * @returns The default LocalNet dispenser account\n */\n public async getLocalNetDispenserAccount() {\n if (!(await this._clientManager.isLocalNet())) {\n throw new Error(\"Can't get LocalNet dispenser account from non LocalNet network\")\n }\n\n const dispenser = await this.getWalletAccount('unencrypted-default-wallet', (a) => a.status !== 'Offline' && a.amount > 1_000_000_000)\n if (!dispenser) {\n throw new Error(\"Error retrieving LocalNet dispenser account; couldn't find the default account in KMD\")\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return dispenser\n }\n}\n"],"names":["ClientManager","SigningAccount","Config","TransactionComposer","AlgoAmount"],"mappings":";;;;;;;;;AAOA;AACgE;MACnD,iBAAiB,CAAA;AAI5B;;;AAGG;AACH,IAAA,WAAA,CAAY,aAA4B,EAAA;AACtC,QAAA,IAAI,CAAC,cAAc,GAAG,aA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AC,cAAc,CAAC,UAAU,EAAE,CAAC,EAAE;AAC7C,YAAA,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC;;QAGnF,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,4BAA4B,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,GAAG,UAAa,CAAC;QACtI,IAAI,CAAC,SAAS,EAAE;AACd,YAAA,MAAM,IAAI,KAAK,CAAC,uFAAuF,CAAC;;;AAI1G,QAAA,OAAO,SAAS;;AAEnB;;;;"}
@@ -3,7 +3,7 @@ import { Config } from '../config.mjs';
3
3
  import { SigningAccount } from './account.mjs';
4
4
  import { AlgoAmount } from './amount.mjs';
5
5
  import { ClientManager } from './client-manager.mjs';
6
- import AlgoKitComposer from './composer.mjs';
6
+ import { TransactionComposer } from './composer.mjs';
7
7
 
8
8
  /** Provides abstractions over a [KMD](https://github.com/algorand/go-algorand/blob/master/daemon/kmd/README.md) instance
9
9
  * that makes it easier to get and manage accounts using KMD. */
@@ -129,7 +129,7 @@ class KmdAccountManager {
129
129
  Config.logger.info(`LocalNet account '${name}' doesn't yet exist; created account ${account.addr} with keys stored in KMD and funding with ${fundWith?.algo ?? 1000} ALGO`);
130
130
  // Fund the account from the dispenser
131
131
  const dispenser = await this.getLocalNetDispenserAccount();
132
- await new AlgoKitComposer({
132
+ await new TransactionComposer({
133
133
  algod: this._clientManager.algod,
134
134
  getSigner: () => dispenser.signer,
135
135
  getSuggestedParams: () => this._clientManager.algod.getTransactionParams().do(),
@@ -1 +1 @@
1
- {"version":3,"file":"kmd-account-manager.mjs","sources":["../../src/types/kmd-account-manager.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { Config } from '../config'\nimport { SigningAccount, TransactionSignerAccount } from './account'\nimport { AlgoAmount } from './amount'\nimport { ClientManager } from './client-manager'\nimport AlgoKitComposer from './composer'\n\n/** Provides abstractions over a [KMD](https://github.com/algorand/go-algorand/blob/master/daemon/kmd/README.md) instance\n * that makes it easier to get and manage accounts using KMD. */\nexport class KmdAccountManager {\n private _clientManager: Omit<ClientManager, 'kmd'>\n private _kmd?: algosdk.Kmd | null\n\n /**\n * Create a new KMD manager.\n * @param clientManager A ClientManager client to use for algod and kmd clients\n */\n constructor(clientManager: ClientManager) {\n this._clientManager = clientManager\n try {\n this._kmd = clientManager.kmd\n } catch {\n this._kmd = undefined\n }\n }\n\n async kmd(): Promise<algosdk.Kmd> {\n if (this._kmd === undefined) {\n if (await this._clientManager.isLocalNet()) {\n const { kmdConfig } = ClientManager.getConfigFromEnvironmentOrLocalNet()\n if (kmdConfig) {\n this._kmd = ClientManager.getKmdClient(kmdConfig)\n return this._kmd\n }\n }\n this._kmd = null\n }\n\n if (!this._kmd) {\n throw new Error('Attempt to use Kmd client in AlgoKit instance with no Kmd configured')\n }\n\n return this._kmd\n }\n\n /**\n * Returns an Algorand signing account with private key loaded from the given KMD wallet (identified by name).\n *\n * @param walletName The name of the wallet to retrieve an account from\n * @param predicate An optional filter to use to find the account (otherwise it will return a random account from the wallet)\n * @param sender The optional sender address to use this signer for (aka a rekeyed account)\n * @example Get default funded account in a LocalNet\n *\n * ```typescript\n * const defaultDispenserAccount = await kmdAccountManager.getWalletAccount(\n * 'unencrypted-default-wallet',\n * a => a.status !== 'Offline' && a.amount > 1_000_000_000\n * )\n * ```\n * @returns The signing account (with private key loaded) or undefined if no matching wallet or account was found\n */\n public async getWalletAccount(\n walletName: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n predicate?: (account: Record<string, any>) => boolean,\n sender?: string,\n ): Promise<(TransactionSignerAccount & { account: SigningAccount }) | undefined> {\n const kmd = await this.kmd()\n\n const walletsResponse = await kmd.listWallets()\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const wallet = walletsResponse.wallets.filter((w: any) => w.name === walletName)\n if (wallet.length === 0) {\n return undefined\n }\n\n const walletId = wallet[0].id\n\n const walletHandle = (await kmd.initWalletHandle(walletId, '')).wallet_handle_token\n const addresses = (await kmd.listKeys(walletHandle)).addresses\n\n let i = 0\n if (predicate) {\n for (i = 0; i < addresses.length; i++) {\n const address = addresses[i]\n const account = await this._clientManager.algod.accountInformation(address).do()\n if (predicate(account)) {\n break\n }\n }\n }\n\n if (i >= addresses.length) {\n return undefined\n }\n\n const accountKey = (await kmd.exportKey(walletHandle, '', addresses[i])).private_key\n\n const accountMnemonic = algosdk.secretKeyToMnemonic(accountKey)\n\n const account = algosdk.mnemonicToSecretKey(accountMnemonic)\n const signingAccount = new SigningAccount(account, sender)\n\n return {\n account: signingAccount,\n addr: signingAccount.addr,\n signer: signingAccount.signer,\n }\n }\n\n /**\n * Gets an account with private key loaded from a KMD wallet of the given name, or alternatively creates one with funds in it via a KMD wallet of the given name.\n *\n * This is useful to get idempotent accounts from LocalNet without having to specify the private key (which will change when resetting the LocalNet).\n *\n * This significantly speeds up local dev time and improves experience since you can write code that *just works* first go without manual config in a fresh LocalNet.\n *\n * If this is used via `mnemonicAccountFromEnvironment`, then you can even use the same code that runs on production without changes for local development!\n *\n * @param name The name of the wallet to retrieve / create\n * @param fundWith The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account\n *\n * @example\n * ```typescript\n * // Idempotently get (if exists) or crate (if it doesn't exist yet) an account by name using KMD\n * // if creating it then fund it with 2 ALGO from the default dispenser account\n * const newAccount = await kmdAccountManager.getOrCreateWalletAccount('account1', (2).algo())\n * // This will return the same account as above since the name matches\n * const existingAccount = await kmdAccountManager.getOrCreateWalletAccount('account1')\n * ```\n *\n * @returns An Algorand account with private key loaded - either one that already existed in the given KMD wallet, or a new one that is funded for you\n */\n public async getOrCreateWalletAccount(\n name: string,\n fundWith?: AlgoAmount,\n ): Promise<TransactionSignerAccount & { account: SigningAccount }> {\n // Get an existing account from the KMD wallet\n const existing = await this.getWalletAccount(name)\n if (existing) {\n return existing\n }\n\n const kmd = await this.kmd()\n\n // None existed: create the KMD wallet instead\n const walletId = (await kmd.createWallet(name, '')).wallet.id\n const walletHandle = (await kmd.initWalletHandle(walletId, '')).wallet_handle_token\n await kmd.generateKey(walletHandle)\n\n // Get the account from the new KMD wallet\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const account = (await this.getWalletAccount(name))!\n\n Config.logger.info(\n `LocalNet account '${name}' doesn't yet exist; created account ${account.addr} with keys stored in KMD and funding with ${\n fundWith?.algo ?? 1000\n } ALGO`,\n )\n\n // Fund the account from the dispenser\n const dispenser = await this.getLocalNetDispenserAccount()\n await new AlgoKitComposer({\n algod: this._clientManager.algod,\n getSigner: () => dispenser.signer,\n getSuggestedParams: () => this._clientManager.algod.getTransactionParams().do(),\n })\n .addPayment({\n amount: fundWith ?? AlgoAmount.Algo(1000),\n receiver: account.addr,\n sender: dispenser.addr,\n })\n .send()\n\n return account\n }\n\n /**\n * Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts).\n * @example\n * ```typescript\n * const dispenser = await kmdAccountManager.getLocalNetDispenserAccount()\n * ```\n * @returns The default LocalNet dispenser account\n */\n public async getLocalNetDispenserAccount() {\n if (!(await this._clientManager.isLocalNet())) {\n throw new Error(\"Can't get LocalNet dispenser account from non LocalNet network\")\n }\n\n const dispenser = await this.getWalletAccount('unencrypted-default-wallet', (a) => a.status !== 'Offline' && a.amount > 1_000_000_000)\n if (!dispenser) {\n throw new Error(\"Error retrieving LocalNet dispenser account; couldn't find the default account in KMD\")\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return dispenser\n }\n}\n"],"names":[],"mappings":";;;;;;;AAOA;AACgE;MACnD,iBAAiB,CAAA;AAI5B;;;AAGG;AACH,IAAA,WAAA,CAAY,aAA4B,EAAA;AACtC,QAAA,IAAI,CAAC,cAAc,GAAG,aAAa,CAAA;AACnC,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,GAAG,CAAA;SAC9B;AAAC,QAAA,MAAM;AACN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CAAC;AACD,aAAA,IAAI,EAAE,CAAA;AAET,QAAA,OAAO,OAAO,CAAA;KACf;AAED;;;;;;;AAOG;AACI,IAAA,MAAM,2BAA2B,GAAA;QACtC,IAAI,EAAE,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,EAAE;AAC7C,YAAA,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC,CAAA;SAClF;QAED,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,4BAA4B,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,GAAG,UAAa,CAAC,CAAA;QACtI,IAAI,CAAC,SAAS,EAAE;AACd,YAAA,MAAM,IAAI,KAAK,CAAC,uFAAuF,CAAC,CAAA;SACzG;;AAGD,QAAA,OAAO,SAAS,CAAA;KACjB;AACF;;;;"}
1
+ {"version":3,"file":"kmd-account-manager.mjs","sources":["../../src/types/kmd-account-manager.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { Config } from '../config'\nimport { SigningAccount, TransactionSignerAccount } from './account'\nimport { AlgoAmount } from './amount'\nimport { ClientManager } from './client-manager'\nimport { TransactionComposer } from './composer'\n\n/** Provides abstractions over a [KMD](https://github.com/algorand/go-algorand/blob/master/daemon/kmd/README.md) instance\n * that makes it easier to get and manage accounts using KMD. */\nexport class KmdAccountManager {\n private _clientManager: Omit<ClientManager, 'kmd'>\n private _kmd?: algosdk.Kmd | null\n\n /**\n * Create a new KMD manager.\n * @param clientManager A ClientManager client to use for algod and kmd clients\n */\n constructor(clientManager: ClientManager) {\n this._clientManager = clientManager\n try {\n this._kmd = clientManager.kmd\n } catch {\n this._kmd = undefined\n }\n }\n\n async kmd(): Promise<algosdk.Kmd> {\n if (this._kmd === undefined) {\n if (await this._clientManager.isLocalNet()) {\n const { kmdConfig } = ClientManager.getConfigFromEnvironmentOrLocalNet()\n if (kmdConfig) {\n this._kmd = ClientManager.getKmdClient(kmdConfig)\n return this._kmd\n }\n }\n this._kmd = null\n }\n\n if (!this._kmd) {\n throw new Error('Attempt to use Kmd client in AlgoKit instance with no Kmd configured')\n }\n\n return this._kmd\n }\n\n /**\n * Returns an Algorand signing account with private key loaded from the given KMD wallet (identified by name).\n *\n * @param walletName The name of the wallet to retrieve an account from\n * @param predicate An optional filter to use to find the account (otherwise it will return a random account from the wallet)\n * @param sender The optional sender address to use this signer for (aka a rekeyed account)\n * @example Get default funded account in a LocalNet\n *\n * ```typescript\n * const defaultDispenserAccount = await kmdAccountManager.getWalletAccount(\n * 'unencrypted-default-wallet',\n * a => a.status !== 'Offline' && a.amount > 1_000_000_000\n * )\n * ```\n * @returns The signing account (with private key loaded) or undefined if no matching wallet or account was found\n */\n public async getWalletAccount(\n walletName: string,\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n predicate?: (account: Record<string, any>) => boolean,\n sender?: string,\n ): Promise<(TransactionSignerAccount & { account: SigningAccount }) | undefined> {\n const kmd = await this.kmd()\n\n const walletsResponse = await kmd.listWallets()\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const wallet = walletsResponse.wallets.filter((w: any) => w.name === walletName)\n if (wallet.length === 0) {\n return undefined\n }\n\n const walletId = wallet[0].id\n\n const walletHandle = (await kmd.initWalletHandle(walletId, '')).wallet_handle_token\n const addresses = (await kmd.listKeys(walletHandle)).addresses\n\n let i = 0\n if (predicate) {\n for (i = 0; i < addresses.length; i++) {\n const address = addresses[i]\n const account = await this._clientManager.algod.accountInformation(address).do()\n if (predicate(account)) {\n break\n }\n }\n }\n\n if (i >= addresses.length) {\n return undefined\n }\n\n const accountKey = (await kmd.exportKey(walletHandle, '', addresses[i])).private_key\n\n const accountMnemonic = algosdk.secretKeyToMnemonic(accountKey)\n\n const account = algosdk.mnemonicToSecretKey(accountMnemonic)\n const signingAccount = new SigningAccount(account, sender)\n\n return {\n account: signingAccount,\n addr: signingAccount.addr,\n signer: signingAccount.signer,\n }\n }\n\n /**\n * Gets an account with private key loaded from a KMD wallet of the given name, or alternatively creates one with funds in it via a KMD wallet of the given name.\n *\n * This is useful to get idempotent accounts from LocalNet without having to specify the private key (which will change when resetting the LocalNet).\n *\n * This significantly speeds up local dev time and improves experience since you can write code that *just works* first go without manual config in a fresh LocalNet.\n *\n * If this is used via `mnemonicAccountFromEnvironment`, then you can even use the same code that runs on production without changes for local development!\n *\n * @param name The name of the wallet to retrieve / create\n * @param fundWith The number of Algo to fund the account with when it gets created, if not specified then 1000 ALGO will be funded from the dispenser account\n *\n * @example\n * ```typescript\n * // Idempotently get (if exists) or crate (if it doesn't exist yet) an account by name using KMD\n * // if creating it then fund it with 2 ALGO from the default dispenser account\n * const newAccount = await kmdAccountManager.getOrCreateWalletAccount('account1', (2).algo())\n * // This will return the same account as above since the name matches\n * const existingAccount = await kmdAccountManager.getOrCreateWalletAccount('account1')\n * ```\n *\n * @returns An Algorand account with private key loaded - either one that already existed in the given KMD wallet, or a new one that is funded for you\n */\n public async getOrCreateWalletAccount(\n name: string,\n fundWith?: AlgoAmount,\n ): Promise<TransactionSignerAccount & { account: SigningAccount }> {\n // Get an existing account from the KMD wallet\n const existing = await this.getWalletAccount(name)\n if (existing) {\n return existing\n }\n\n const kmd = await this.kmd()\n\n // None existed: create the KMD wallet instead\n const walletId = (await kmd.createWallet(name, '')).wallet.id\n const walletHandle = (await kmd.initWalletHandle(walletId, '')).wallet_handle_token\n await kmd.generateKey(walletHandle)\n\n // Get the account from the new KMD wallet\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n const account = (await this.getWalletAccount(name))!\n\n Config.logger.info(\n `LocalNet account '${name}' doesn't yet exist; created account ${account.addr} with keys stored in KMD and funding with ${\n fundWith?.algo ?? 1000\n } ALGO`,\n )\n\n // Fund the account from the dispenser\n const dispenser = await this.getLocalNetDispenserAccount()\n await new TransactionComposer({\n algod: this._clientManager.algod,\n getSigner: () => dispenser.signer,\n getSuggestedParams: () => this._clientManager.algod.getTransactionParams().do(),\n })\n .addPayment({\n amount: fundWith ?? AlgoAmount.Algo(1000),\n receiver: account.addr,\n sender: dispenser.addr,\n })\n .send()\n\n return account\n }\n\n /**\n * Returns an Algorand account with private key loaded for the default LocalNet dispenser account (that can be used to fund other accounts).\n * @example\n * ```typescript\n * const dispenser = await kmdAccountManager.getLocalNetDispenserAccount()\n * ```\n * @returns The default LocalNet dispenser account\n */\n public async getLocalNetDispenserAccount() {\n if (!(await this._clientManager.isLocalNet())) {\n throw new Error(\"Can't get LocalNet dispenser account from non LocalNet network\")\n }\n\n const dispenser = await this.getWalletAccount('unencrypted-default-wallet', (a) => a.status !== 'Offline' && a.amount > 1_000_000_000)\n if (!dispenser) {\n throw new Error(\"Error retrieving LocalNet dispenser account; couldn't find the default account in KMD\")\n }\n\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return dispenser\n }\n}\n"],"names":[],"mappings":";;;;;;;AAOA;AACgE;MACnD,iBAAiB,CAAA;AAI5B;;;AAGG;AACH,IAAA,WAAA,CAAY,aAA4B,EAAA;AACtC,QAAA,IAAI,CAAC,cAAc,GAAG,aAAa;AACnC,QAAA,IAAI;AACF,YAAA,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,GAAG;;AAC7B,QAAA,MAAM;AACN,YAAA,IAAI,CAAC,IAAI,GAAG,SAAS;;;AAIzB,IAAA,MAAM,GAAG,GAAA;AACP,QAAA,IAAI,IAAI,CAAC,IAAI,KAAK,SAAS,EAAE;YAC3B,IAAI,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,EAAE;gBAC1C,MAAM,EAAE,SAAS,EAAE,GAAG,aAAa,CAAC,kCAAkC,EAAE;gBACxE,IAAI,SAAS,EAAE;oBACb,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,YAAY,CAAC,SAAS,CAAC;oBACjD,OAAO,IAAI,CAAC,IAAI;;;AAGpB,YAAA,IAAI,CAAC,IAAI,GAAG,IAAI;;AAGlB,QAAA,IAAI,CAAC,IAAI,CAAC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3E,QAAQ,EAAE,IAAI,IAAI,IACpB,CAAA,KAAA,CAAO,CACR;;AAGD,QAAA,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,2BAA2B,EAAE;QAC1D,MAAM,IAAI,mBAAmB,CAAC;AAC5B,YAAA,KAAK,EAAE,IAAI,CAAC,cAAc,CAAC,KAAK;AAChC,YAAA,SAAS,EAAE,MAAM,SAAS,CAAC,MAAM;AACjC,YAAA,kBAAkB,EAAE,MAAM,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,oBAAoB,EAAE,CAAC,EAAE,EAAE;SAChF;AACE,aAAA,UAAU,CAAC;YACV,MAAM,EAAE,QAAQ,IAAI,UAAU,CAAC,IAAI,CAAC,IAAI,CAAC;YACzC,QAAQ,EAAE,OAAO,CAAC,IAAI;YACtB,MAAM,EAAE,SAAS,CAAC,IAAI;SACvB;AACA,aAAA,IAAI,EAAE;AAET,QAAA,OAAO,OAAO;;AAGhB;;;;;;;AAOG;AACI,IAAA,MAAM,2BAA2B,GAAA;QACtC,IAAI,EAAE,MAAM,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC,EAAE;AAC7C,YAAA,MAAM,IAAI,KAAK,CAAC,gEAAgE,CAAC;;QAGnF,MAAM,SAAS,GAAG,MAAM,IAAI,CAAC,gBAAgB,CAAC,4BAA4B,EAAE,CAAC,CAAC,KAAK,CAAC,CAAC,MAAM,KAAK,SAAS,IAAI,CAAC,CAAC,MAAM,GAAG,UAAa,CAAC;QACtI,IAAI,CAAC,SAAS,EAAE;AACd,YAAA,MAAM,IAAI,KAAK,CAAC,uFAAuF,CAAC;;;AAI1G,QAAA,OAAO,SAAS;;AAEnB;;;;"}
@@ -0,0 +1,10 @@
1
+ import { AVMTracesEventData, TealSourcesDebugEventData } from './debugging';
2
+ export declare enum EventType {
3
+ TxnGroupSimulated = "TxnGroupSimulated",
4
+ AppCompiled = "AppCompiled"
5
+ }
6
+ export type EventDataMap = {
7
+ [EventType.TxnGroupSimulated]: AVMTracesEventData;
8
+ [EventType.AppCompiled]: TealSourcesDebugEventData;
9
+ [key: string]: unknown;
10
+ };