@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":"account.mjs","sources":["../../src/types/account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AlgoAmount } from './amount'\nimport ApplicationLocalState = algosdk.modelsv2.ApplicationLocalState\nimport ApplicationStateSchema = algosdk.modelsv2.ApplicationStateSchema\nimport AssetHolding = algosdk.modelsv2.AssetHolding\nimport Application = algosdk.modelsv2.Application\nimport Asset = algosdk.modelsv2.Asset\nimport AccountParticipation = algosdk.modelsv2.AccountParticipation\nimport Account = algosdk.Account\nimport MultisigMetadata = algosdk.MultisigMetadata\nimport Transaction = algosdk.Transaction\nimport TransactionSigner = algosdk.TransactionSigner\n\n/**\n * The account name identifier used for fund dispensing in test environments\n */\nexport const DISPENSER_ACCOUNT = 'DISPENSER'\n\n/** Account wrapper that supports partial or full multisig signing. */\nexport class MultisigAccount {\n _params: algosdk.MultisigMetadata\n _signingAccounts: (algosdk.Account | SigningAccount)[]\n _addr: string\n _signer: TransactionSigner\n\n /** The parameters for the multisig account */\n get params(): Readonly<algosdk.MultisigMetadata> {\n return this._params\n }\n\n /** The list of accounts that are present to sign */\n get signingAccounts(): Readonly<(algosdk.Account | SigningAccount)[]> {\n return this._signingAccounts\n }\n\n /** The address of the multisig account */\n get addr(): Readonly<string> {\n return this._addr\n }\n\n get signer(): TransactionSigner {\n return this._signer\n }\n\n constructor(multisigParams: MultisigMetadata, signingAccounts: (Account | SigningAccount)[]) {\n this._params = multisigParams\n this._signingAccounts = signingAccounts\n this._addr = algosdk.multisigAddress(multisigParams)\n this._signer = algosdk.makeMultiSigAccountTransactionSigner(\n multisigParams,\n signingAccounts.map((a) => a.sk),\n )\n }\n\n /**\n * Sign the given transaction\n * @param transaction Either a transaction object or a raw, partially signed transaction\n * @returns The transaction signed by the present signers\n */\n public sign(transaction: Transaction | Uint8Array): Uint8Array {\n let signedTxn = 'from' in transaction ? undefined : transaction\n for (const signer of this._signingAccounts) {\n if (signedTxn) {\n signedTxn = algosdk.appendSignMultisigTransaction(signedTxn, this._params, signer.sk).blob\n } else {\n signedTxn = algosdk.signMultisigTransaction(transaction as Transaction, this._params, signer.sk).blob\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return signedTxn!\n }\n}\n\n/** Account wrapper that supports a rekeyed account */\nexport class SigningAccount implements Account {\n private _account: Account\n private _signer: TransactionSigner\n private _sender: string\n\n /**\n * Algorand address of the sender\n */\n get addr(): Readonly<string> {\n return this._sender\n }\n\n /**\n * Secret key belonging to the signer\n */\n get sk(): Readonly<Uint8Array> {\n return this._account.sk\n }\n\n /**\n * Transaction signer for the underlying signing account\n */\n get signer(): TransactionSigner {\n return this._signer\n }\n\n /**\n * Algorand account of the sender address and signer private key\n */\n get sender(): Account {\n return {\n addr: this._sender,\n sk: this._account.sk,\n }\n }\n\n constructor(account: Account, sender: string | undefined) {\n this._account = account\n this._sender = sender ?? account.addr\n this._signer = algosdk.makeBasicAccountTransactionSigner(account)\n }\n}\n\n/** A wrapper around `TransactionSigner` that also has the sender address. */\nexport interface TransactionSignerAccount {\n addr: Readonly<string>\n signer: TransactionSigner\n}\n\n/** Account information at a given round. */\nexport type AccountInformation = {\n /**\n * The account public key\n */\n address: string\n\n /** The balance of Algo currently held by the account. */\n balance: AlgoAmount\n\n /**\n * The amount of Algo in the account, without the pending rewards.\n */\n amountWithoutPendingRewards: AlgoAmount\n\n /**\n * Algo balance required to be held by the account.\n *\n * The requirement grows based on asset and application usage.\n */\n minBalance: AlgoAmount\n /**\n * Amount of Algo of pending rewards in this account.\n */\n pendingRewards: AlgoAmount\n\n /**\n * Total rewards of Algo the account has received, including pending\n * rewards.\n */\n rewards: AlgoAmount\n\n /**\n * The round number for which this information is relevant.\n */\n validAsOfRound: bigint\n\n /**\n * Delegation status of the account's Algo:\n * * Offline - indicates that the associated account is delegated.\n * * Online - indicates that the associated account used as part of the delegation pool.\n * * NotParticipating - indicates that the associated account is neither a delegator nor a delegate.\n */\n status: string\n\n /**\n * The count of all applications that have been opted in, equivalent to the count\n * of application local data (AppLocalState objects) stored in this account.\n */\n totalAppsOptedIn: number\n\n /**\n * The count of all assets that have been opted in, equivalent to the count of\n * AssetHolding objects held by this account.\n */\n totalAssetsOptedIn: number\n\n /**\n * The count of all apps (AppParams objects) created by this account.\n */\n totalCreatedApps: number\n\n /**\n * The count of all assets (AssetParams objects) created by this account.\n */\n totalCreatedAssets: number\n\n /**\n * Applications local data stored in this account.\n */\n appsLocalState?: ApplicationLocalState[]\n\n /**\n * The sum of all extra application program pages for this account.\n */\n appsTotalExtraPages?: number\n /**\n * (tsch) stores the sum of all of the local schemas and global schemas in this\n * account.\n * Note: the raw account uses `StateSchema` for this type.\n */\n appsTotalSchema?: ApplicationStateSchema\n\n /**\n * Assets held by this account.\n */\n assets?: AssetHolding[]\n\n /**\n * The address against which signing should be checked. If empty, the\n * address of the current account is used. This field can be updated in any\n * transaction by setting the `RekeyTo` field.\n */\n authAddr?: string\n\n /**\n * Parameters of applications created by this account including app global data.\n */\n createdApps?: Application[]\n\n /**\n * (apar) parameters of assets created by this account.\n * Note: the raw account uses `map[int] -> Asset` for this type.\n */\n createdAssets?: Asset[]\n\n /**\n * AccountParticipation describes the parameters used by this account in consensus\n * protocol.\n */\n participation?: AccountParticipation\n\n /**\n * Used as part of the rewards computation. Only applicable to accounts\n * which are participating.\n */\n rewardBase?: number\n\n /**\n * Indicates what type of signature is used by this account, must be one of:\n * * sig\n * * msig\n * * lsig\n */\n sigType?: string\n\n /**\n * The total number of bytes used by this account's app's box keys and\n * values.\n */\n totalBoxBytes?: number\n\n /**\n * The number of existing boxes created by this account's app.\n */\n totalBoxes?: number\n}\n\n/** Account asset holding information at a given round. */\nexport type AccountAssetInformation = {\n /** The ID of the asset held. */\n assetId: bigint\n /** The current balance of that asset holding. */\n balance: bigint\n /** Whether or not the asset is frozen for the account. */\n frozen: boolean\n /** The round as at which the holding was correct. */\n round: bigint\n}\n\n/**\n * @deprecated The methods that use this can be achieved using `AccountManager` instead.\n * Config for an account config */\nexport interface AccountConfig {\n /** Mnemonic for an account */\n accountMnemonic: string\n /** Address of a rekeyed account */\n senderAddress?: string\n /** Account name used to retrieve config */\n accountName: string\n\n /** @deprecated Renamed to senderAddress in 2.3.1 */\n senderMnemonic?: string\n}\n"],"names":[],"mappings":";;AAaA;;AAEG;AACI,MAAM,iBAAiB,GAAG,YAAW;AAE5C;MACa,eAAe,CAAA;;AAO1B,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;KACpB;;AAGD,IAAA,IAAI,eAAe,GAAA;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAA;KAC7B;;AAGD,IAAA,IAAI,IAAI,GAAA;QACN,OAAO,IAAI,CAAC,KAAK,CAAA;KAClB;AAED,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,OAAO,CAAA;KACpB;IAED,WAAY,CAAA,cAAgC,EAAE,eAA6C,EAAA;AACzF,QAAA,IAAI,CAAC,OAAO,GAAG,cAAc,CAAA;AAC7B,QAAA,IAAI,CAAC,gBAAgB,GAAG,eAAe,CAAA;QACvC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,eAAe,CAAC,cAAc,CAAC,CAAA;QACpD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,oCAAoC,CACzD,cAAc,EACd,eAAe,CAAC,GAAG,CAAC,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C,OAAO,GAAG,OAAO,CAAC,iCAAiC,CAAC,OAAO,CAAC,CAAA;KAClE;AACF;;;;"}
1
+ {"version":3,"file":"account.mjs","sources":["../../src/types/account.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { AlgoAmount } from './amount'\nimport ApplicationLocalState = algosdk.modelsv2.ApplicationLocalState\nimport ApplicationStateSchema = algosdk.modelsv2.ApplicationStateSchema\nimport AssetHolding = algosdk.modelsv2.AssetHolding\nimport Application = algosdk.modelsv2.Application\nimport Asset = algosdk.modelsv2.Asset\nimport AccountParticipation = algosdk.modelsv2.AccountParticipation\nimport Account = algosdk.Account\nimport MultisigMetadata = algosdk.MultisigMetadata\nimport Transaction = algosdk.Transaction\nimport TransactionSigner = algosdk.TransactionSigner\n\n/**\n * The account name identifier used for fund dispensing in test environments\n */\nexport const DISPENSER_ACCOUNT = 'DISPENSER'\n\n/** Account wrapper that supports partial or full multisig signing. */\nexport class MultisigAccount {\n _params: algosdk.MultisigMetadata\n _signingAccounts: (algosdk.Account | SigningAccount)[]\n _addr: string\n _signer: TransactionSigner\n\n /** The parameters for the multisig account */\n get params(): Readonly<algosdk.MultisigMetadata> {\n return this._params\n }\n\n /** The list of accounts that are present to sign */\n get signingAccounts(): Readonly<(algosdk.Account | SigningAccount)[]> {\n return this._signingAccounts\n }\n\n /** The address of the multisig account */\n get addr(): Readonly<string> {\n return this._addr\n }\n\n get signer(): TransactionSigner {\n return this._signer\n }\n\n constructor(multisigParams: MultisigMetadata, signingAccounts: (Account | SigningAccount)[]) {\n this._params = multisigParams\n this._signingAccounts = signingAccounts\n this._addr = algosdk.multisigAddress(multisigParams)\n this._signer = algosdk.makeMultiSigAccountTransactionSigner(\n multisigParams,\n signingAccounts.map((a) => a.sk),\n )\n }\n\n /**\n * Sign the given transaction\n * @param transaction Either a transaction object or a raw, partially signed transaction\n * @returns The transaction signed by the present signers\n */\n public sign(transaction: Transaction | Uint8Array): Uint8Array {\n let signedTxn = 'from' in transaction ? undefined : transaction\n for (const signer of this._signingAccounts) {\n if (signedTxn) {\n signedTxn = algosdk.appendSignMultisigTransaction(signedTxn, this._params, signer.sk).blob\n } else {\n signedTxn = algosdk.signMultisigTransaction(transaction as Transaction, this._params, signer.sk).blob\n }\n }\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return signedTxn!\n }\n}\n\n/** Account wrapper that supports a rekeyed account */\nexport class SigningAccount implements Account {\n private _account: Account\n private _signer: TransactionSigner\n private _sender: string\n\n /**\n * Algorand address of the sender\n */\n get addr(): Readonly<string> {\n return this._sender\n }\n\n /**\n * Secret key belonging to the signer\n */\n get sk(): Readonly<Uint8Array> {\n return this._account.sk\n }\n\n /**\n * Transaction signer for the underlying signing account\n */\n get signer(): TransactionSigner {\n return this._signer\n }\n\n /**\n * Algorand account of the sender address and signer private key\n */\n get sender(): Account {\n return {\n addr: this._sender,\n sk: this._account.sk,\n }\n }\n\n constructor(account: Account, sender: string | undefined) {\n this._account = account\n this._sender = sender ?? account.addr\n this._signer = algosdk.makeBasicAccountTransactionSigner(account)\n }\n}\n\n/** A wrapper around `TransactionSigner` that also has the sender address. */\nexport interface TransactionSignerAccount {\n addr: Readonly<string>\n signer: TransactionSigner\n}\n\n/** Account information at a given round. */\nexport type AccountInformation = {\n /**\n * The account public key\n */\n address: string\n\n /** The balance of Algo currently held by the account. */\n balance: AlgoAmount\n\n /**\n * The amount of Algo in the account, without the pending rewards.\n */\n amountWithoutPendingRewards: AlgoAmount\n\n /**\n * Algo balance required to be held by the account.\n *\n * The requirement grows based on asset and application usage.\n */\n minBalance: AlgoAmount\n /**\n * Amount of Algo of pending rewards in this account.\n */\n pendingRewards: AlgoAmount\n\n /**\n * Total rewards of Algo the account has received, including pending\n * rewards.\n */\n rewards: AlgoAmount\n\n /**\n * The round number for which this information is relevant.\n */\n validAsOfRound: bigint\n\n /**\n * Delegation status of the account's Algo:\n * * Offline - indicates that the associated account is delegated.\n * * Online - indicates that the associated account used as part of the delegation pool.\n * * NotParticipating - indicates that the associated account is neither a delegator nor a delegate.\n */\n status: string\n\n /**\n * The count of all applications that have been opted in, equivalent to the count\n * of application local data (AppLocalState objects) stored in this account.\n */\n totalAppsOptedIn: number\n\n /**\n * The count of all assets that have been opted in, equivalent to the count of\n * AssetHolding objects held by this account.\n */\n totalAssetsOptedIn: number\n\n /**\n * The count of all apps (AppParams objects) created by this account.\n */\n totalCreatedApps: number\n\n /**\n * The count of all assets (AssetParams objects) created by this account.\n */\n totalCreatedAssets: number\n\n /**\n * Applications local data stored in this account.\n */\n appsLocalState?: ApplicationLocalState[]\n\n /**\n * The sum of all extra application program pages for this account.\n */\n appsTotalExtraPages?: number\n /**\n * (tsch) stores the sum of all of the local schemas and global schemas in this\n * account.\n * Note: the raw account uses `StateSchema` for this type.\n */\n appsTotalSchema?: ApplicationStateSchema\n\n /**\n * Assets held by this account.\n */\n assets?: AssetHolding[]\n\n /**\n * The address against which signing should be checked. If empty, the\n * address of the current account is used. This field can be updated in any\n * transaction by setting the `RekeyTo` field.\n */\n authAddr?: string\n\n /**\n * Parameters of applications created by this account including app global data.\n */\n createdApps?: Application[]\n\n /**\n * (apar) parameters of assets created by this account.\n * Note: the raw account uses `map[int] -> Asset` for this type.\n */\n createdAssets?: Asset[]\n\n /**\n * AccountParticipation describes the parameters used by this account in consensus\n * protocol.\n */\n participation?: AccountParticipation\n\n /**\n * Used as part of the rewards computation. Only applicable to accounts\n * which are participating.\n */\n rewardBase?: number\n\n /**\n * Indicates what type of signature is used by this account, must be one of:\n * * sig\n * * msig\n * * lsig\n */\n sigType?: string\n\n /**\n * The total number of bytes used by this account's app's box keys and\n * values.\n */\n totalBoxBytes?: number\n\n /**\n * The number of existing boxes created by this account's app.\n */\n totalBoxes?: number\n\n /**\n * The round in which this account last went online, or explicitly renewed their\n * online status.\n */\n lastHeartbeatRound?: bigint\n\n /**\n * The round in which this account last proposed the block.\n */\n lastProposedRound?: bigint\n}\n\n/** Account asset holding information at a given round. */\nexport type AccountAssetInformation = {\n /** The ID of the asset held. */\n assetId: bigint\n /** The current balance of that asset holding. */\n balance: bigint\n /** Whether or not the asset is frozen for the account. */\n frozen: boolean\n /** The round as at which the holding was correct. */\n round: bigint\n}\n\n/**\n * @deprecated The methods that use this can be achieved using `AccountManager` instead.\n * Config for an account config */\nexport interface AccountConfig {\n /** Mnemonic for an account */\n accountMnemonic: string\n /** Address of a rekeyed account */\n senderAddress?: string\n /** Account name used to retrieve config */\n accountName: string\n\n /** @deprecated Renamed to senderAddress in 2.3.1 */\n senderMnemonic?: string\n}\n"],"names":[],"mappings":";;AAaA;;AAEG;AACI,MAAM,iBAAiB,GAAG;AAEjC;MACa,eAAe,CAAA;;AAO1B,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,OAAO;;;AAIrB,IAAA,IAAI,eAAe,GAAA;QACjB,OAAO,IAAI,CAAC,gBAAgB;;;AAI9B,IAAA,IAAI,IAAI,GAAA;QACN,OAAO,IAAI,CAAC,KAAK;;AAGnB,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,OAAO;;IAGrB,WAAY,CAAA,cAAgC,EAAE,eAA6C,EAAA;AACzF,QAAA,IAAI,CAAC,OAAO,GAAG,cAAc;AAC7B,QAAA,IAAI,CAAC,gBAAgB,GAAG,eAAe;QACvC,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,eAAe,CAAC,cAAc,CAAC;QACpD,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,oCAAoC,CACzD,cAAc,EACd,eAAe,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CACjC;;AAGH;;;;AAIG;AACI,IAAA,IAAI,CAAC,WAAqC,EAAA;AAC/C,QAAA,IAAI,SAAS,GAAG,MAAM,IAAI,WAAW,GAAG,SAAS,GAAG,WAAW;AAC/D,QAAA,KAAK,MAAM,MAAM,IAAI,IAAI,CAAC,gBAAgB,EAAE;YAC1C,IAAI,SAAS,EAAE;AACb,gBAAA,SAAS,GAAG,OAAO,CAAC,6BAA6B,CAAC,SAAS,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI;;iBACrF;AACL,gBAAA,SAAS,GAAG,OAAO,CAAC,uBAAuB,CAAC,WAA0B,EAAE,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI;;;;AAIzG,QAAA,OAAO,SAAU;;AAEpB;AAED;MACa,cAAc,CAAA;AAKzB;;AAEG;AACH,IAAA,IAAI,IAAI,GAAA;QACN,OAAO,IAAI,CAAC,OAAO;;AAGrB;;AAEG;AACH,IAAA,IAAI,EAAE,GAAA;AACJ,QAAA,OAAO,IAAI,CAAC,QAAQ,CAAC,EAAE;;AAGzB;;AAEG;AACH,IAAA,IAAI,MAAM,GAAA;QACR,OAAO,IAAI,CAAC,OAAO;;AAGrB;;AAEG;AACH,IAAA,IAAI,MAAM,GAAA;QACR,OAAO;YACL,IAAI,EAAE,IAAI,CAAC,OAAO;AAClB,YAAA,EAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,EAAE;SACrB;;IAGH,WAAY,CAAA,OAAgB,EAAE,MAA0B,EAAA;AACtD,QAAA,IAAI,CAAC,QAAQ,GAAG,OAAO;QACvB,IAAI,CAAC,OAAO,GAAG,MAAM,IAAI,OAAO,CAAC,IAAI;QACrC,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC,iCAAiC,CAAC,OAAO,CAAC;;AAEpE;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"algo-http-client-with-retry.js","sources":["../../src/types/algo-http-client-with-retry.ts"],"sourcesContent":["import type { BaseHTTPClientResponse, Query } from 'algosdk/dist/types/client/baseHTTPClient'\nimport { Config } from '../config'\nimport { URLTokenBaseHTTPClient } from './urlTokenBaseHTTPClient'\n\n/** A HTTP Client that wraps the Algorand SDK HTTP Client with retries */\nexport class AlgoHttpClientWithRetry extends URLTokenBaseHTTPClient {\n private static readonly MAX_TRIES = 5\n private static readonly MAX_BACKOFF_MS = 10000\n\n // These lists come from https://visionmedia.github.io/superagent/#retrying-requests\n // which is the underlying library used by algosdk - but the CloudFlare specific 52X status codes have been removed\n private static readonly RETRY_STATUS_CODES = [408, 413, 429, 500, 502, 503, 504]\n private static readonly RETRY_ERROR_CODES = [\n 'ETIMEDOUT',\n 'ECONNRESET',\n 'EADDRINUSE',\n 'ECONNREFUSED',\n 'EPIPE',\n 'ENOTFOUND',\n 'ENETUNREACH',\n 'EAI_AGAIN',\n 'EPROTO', // We get this intermittently with AlgoNode API\n ]\n\n private async callWithRetry(func: () => Promise<BaseHTTPClientResponse>): Promise<BaseHTTPClientResponse> {\n let response: BaseHTTPClientResponse | undefined\n let numTries = 1\n do {\n try {\n response = await func()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (err: any) {\n if (numTries >= AlgoHttpClientWithRetry.MAX_TRIES) {\n throw err\n }\n // Only retry for one of the hardcoded conditions\n if (\n !(\n AlgoHttpClientWithRetry.RETRY_ERROR_CODES.includes(err.code) ||\n AlgoHttpClientWithRetry.RETRY_STATUS_CODES.includes(Number(err.status)) ||\n ('response' in err && AlgoHttpClientWithRetry.RETRY_STATUS_CODES.includes(Number(err.response.status)))\n )\n ) {\n throw err\n }\n // Retry immediately the first time, then exponentially backoff.\n const delayTimeMs = numTries == 1 ? 0 : Math.min(1000 * Math.pow(2, numTries - 1), AlgoHttpClientWithRetry.MAX_BACKOFF_MS)\n if (delayTimeMs > 0) {\n await new Promise((r) => setTimeout(r, delayTimeMs))\n }\n Config.logger.warn(`algosdk request failed ${numTries} times. Retrying in ${delayTimeMs}ms: ${err}`)\n }\n } while (!response && ++numTries <= AlgoHttpClientWithRetry.MAX_TRIES)\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return response!\n }\n\n async get(relativePath: string, query?: Query<string>, requestHeaders: Record<string, string> = {}): Promise<BaseHTTPClientResponse> {\n return await this.callWithRetry(() => super.get(relativePath, query, requestHeaders))\n }\n\n async post(\n relativePath: string,\n data: Uint8Array,\n query?: Query<string>,\n requestHeaders: Record<string, string> = {},\n ): Promise<BaseHTTPClientResponse> {\n return await this.callWithRetry(() => super.post(relativePath, data, query, requestHeaders))\n }\n\n async delete(\n relativePath: string,\n data: Uint8Array,\n query?: Query<string>,\n requestHeaders: Record<string, string> = {},\n ): Promise<BaseHTTPClientResponse> {\n return await this.callWithRetry(() => super.delete(relativePath, data, query, requestHeaders))\n }\n}\n"],"names":["URLTokenBaseHTTPClient","Config"],"mappings":";;;;;AAIA;AACM,MAAO,uBAAwB,SAAQA,mDAAsB,CAAA;IAmBzD,MAAM,aAAa,CAAC,IAA2C,EAAA;AACrE,QAAA,IAAI,QAA4C,CAAA;QAChD,IAAI,QAAQ,GAAG,CAAC,CAAA;AAChB,QAAA,GAAG;AACD,YAAA,IAAI;AACF,gBAAA,QAAQ,GAAG,MAAM,IAAI,EAAE,CAAA;;aAExB;YAAC,OAAO,GAAQ,EAAE;AACjB,gBAAA,IAAI,QAAQ,IAAI,uBAAuB,CAAC,SAAS,EAAE;AACjD,oBAAA,MAAM,GAAG,CAAA;iBACV;;gBAED,IACE,EACE,uBAAuB,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;oBAC5D,uBAAuB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;qBACtE,UAAU,IAAI,GAAG,IAAI,uBAAuB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC,CACxG,EACD;AACA,oBAAA,MAAM,GAAG,CAAA;iBACV;;AAED,gBAAA,MAAM,WAAW,GAAG,QAAQ,IAAI,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,QAAQ,GAAG,CAAC,CAAC,EAAE,uBAA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,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAA;AACxD,uBAAA,CAAA,iBAAiB,GAAG;IAC1C,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,OAAO;IACP,WAAW;IACX,aAAa;IACb,WAAW;AACX,IAAA,QAAQ;CACT;;;;"}
1
+ {"version":3,"file":"algo-http-client-with-retry.js","sources":["../../src/types/algo-http-client-with-retry.ts"],"sourcesContent":["import type { BaseHTTPClientResponse, Query } from 'algosdk/dist/types/client/baseHTTPClient'\nimport { Config } from '../config'\nimport { URLTokenBaseHTTPClient } from './urlTokenBaseHTTPClient'\n\n/** A HTTP Client that wraps the Algorand SDK HTTP Client with retries */\nexport class AlgoHttpClientWithRetry extends URLTokenBaseHTTPClient {\n private static readonly MAX_TRIES = 5\n private static readonly MAX_BACKOFF_MS = 10000\n\n // These lists come from https://visionmedia.github.io/superagent/#retrying-requests\n // which is the underlying library used by algosdk - but the CloudFlare specific 52X status codes have been removed\n private static readonly RETRY_STATUS_CODES = [408, 413, 429, 500, 502, 503, 504]\n private static readonly RETRY_ERROR_CODES = [\n 'ETIMEDOUT',\n 'ECONNRESET',\n 'EADDRINUSE',\n 'ECONNREFUSED',\n 'EPIPE',\n 'ENOTFOUND',\n 'ENETUNREACH',\n 'EAI_AGAIN',\n 'EPROTO', // We get this intermittently with AlgoNode API\n ]\n\n private async callWithRetry(func: () => Promise<BaseHTTPClientResponse>): Promise<BaseHTTPClientResponse> {\n let response: BaseHTTPClientResponse | undefined\n let numTries = 1\n do {\n try {\n response = await func()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (err: any) {\n if (numTries >= AlgoHttpClientWithRetry.MAX_TRIES) {\n throw err\n }\n // Only retry for one of the hardcoded conditions\n if (\n !(\n AlgoHttpClientWithRetry.RETRY_ERROR_CODES.includes(err.code) ||\n AlgoHttpClientWithRetry.RETRY_STATUS_CODES.includes(Number(err.status)) ||\n ('response' in err && AlgoHttpClientWithRetry.RETRY_STATUS_CODES.includes(Number(err.response.status)))\n )\n ) {\n throw err\n }\n // Retry immediately the first time, then exponentially backoff.\n const delayTimeMs = numTries == 1 ? 0 : Math.min(1000 * Math.pow(2, numTries - 1), AlgoHttpClientWithRetry.MAX_BACKOFF_MS)\n if (delayTimeMs > 0) {\n await new Promise((r) => setTimeout(r, delayTimeMs))\n }\n Config.logger.warn(`algosdk request failed ${numTries} times. Retrying in ${delayTimeMs}ms: ${err}`)\n }\n } while (!response && ++numTries <= AlgoHttpClientWithRetry.MAX_TRIES)\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return response!\n }\n\n async get(relativePath: string, query?: Query<string>, requestHeaders: Record<string, string> = {}): Promise<BaseHTTPClientResponse> {\n return await this.callWithRetry(() => super.get(relativePath, query, requestHeaders))\n }\n\n async post(\n relativePath: string,\n data: Uint8Array,\n query?: Query<string>,\n requestHeaders: Record<string, string> = {},\n ): Promise<BaseHTTPClientResponse> {\n return await this.callWithRetry(() => super.post(relativePath, data, query, requestHeaders))\n }\n\n async delete(\n relativePath: string,\n data: Uint8Array,\n query?: Query<string>,\n requestHeaders: Record<string, string> = {},\n ): Promise<BaseHTTPClientResponse> {\n return await this.callWithRetry(() => super.delete(relativePath, data, query, requestHeaders))\n }\n}\n"],"names":["URLTokenBaseHTTPClient","Config"],"mappings":";;;;;AAIA;AACM,MAAO,uBAAwB,SAAQA,mDAAsB,CAAA;IAmBzD,MAAM,aAAa,CAAC,IAA2C,EAAA;AACrE,QAAA,IAAI,QAA4C;QAChD,IAAI,QAAQ,GAAG,CAAC;AAChB,QAAA,GAAG;AACD,YAAA,IAAI;AACF,gBAAA,QAAQ,GAAG,MAAM,IAAI,EAAE;;;YAEvB,OAAO,GAAQ,EAAE;AACjB,gBAAA,IAAI,QAAQ,IAAI,uBAAuB,CAAC,SAAS,EAAE;AACjD,oBAAA,MAAM,GAAG;;;gBAG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AM,IAAI,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;;IAG9F,MAAM,MAAM,CACV,YAAoB,EACpB,IAAgB,EAChB,KAAqB,EACrB,cAAA,GAAyC,EAAE,EAAA;QAE3C,OAAO,MAAM,IAAI,CAAC,aAAa,CAAC,MAAM,KAAK,CAAC,MAAM,CAAC,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;;;AAtExE,uBAAS,CAAA,SAAA,GAAG,CAAC;AACb,uBAAc,CAAA,cAAA,GAAG,KAAK;AAE9C;AACA;AACwB,uBAAA,CAAA,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AACxD,uBAAA,CAAA,iBAAiB,GAAG;IAC1C,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,OAAO;IACP,WAAW;IACX,aAAa;IACb,WAAW;AACX,IAAA,QAAQ;CACT;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"algo-http-client-with-retry.mjs","sources":["../../src/types/algo-http-client-with-retry.ts"],"sourcesContent":["import type { BaseHTTPClientResponse, Query } from 'algosdk/dist/types/client/baseHTTPClient'\nimport { Config } from '../config'\nimport { URLTokenBaseHTTPClient } from './urlTokenBaseHTTPClient'\n\n/** A HTTP Client that wraps the Algorand SDK HTTP Client with retries */\nexport class AlgoHttpClientWithRetry extends URLTokenBaseHTTPClient {\n private static readonly MAX_TRIES = 5\n private static readonly MAX_BACKOFF_MS = 10000\n\n // These lists come from https://visionmedia.github.io/superagent/#retrying-requests\n // which is the underlying library used by algosdk - but the CloudFlare specific 52X status codes have been removed\n private static readonly RETRY_STATUS_CODES = [408, 413, 429, 500, 502, 503, 504]\n private static readonly RETRY_ERROR_CODES = [\n 'ETIMEDOUT',\n 'ECONNRESET',\n 'EADDRINUSE',\n 'ECONNREFUSED',\n 'EPIPE',\n 'ENOTFOUND',\n 'ENETUNREACH',\n 'EAI_AGAIN',\n 'EPROTO', // We get this intermittently with AlgoNode API\n ]\n\n private async callWithRetry(func: () => Promise<BaseHTTPClientResponse>): Promise<BaseHTTPClientResponse> {\n let response: BaseHTTPClientResponse | undefined\n let numTries = 1\n do {\n try {\n response = await func()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (err: any) {\n if (numTries >= AlgoHttpClientWithRetry.MAX_TRIES) {\n throw err\n }\n // Only retry for one of the hardcoded conditions\n if (\n !(\n AlgoHttpClientWithRetry.RETRY_ERROR_CODES.includes(err.code) ||\n AlgoHttpClientWithRetry.RETRY_STATUS_CODES.includes(Number(err.status)) ||\n ('response' in err && AlgoHttpClientWithRetry.RETRY_STATUS_CODES.includes(Number(err.response.status)))\n )\n ) {\n throw err\n }\n // Retry immediately the first time, then exponentially backoff.\n const delayTimeMs = numTries == 1 ? 0 : Math.min(1000 * Math.pow(2, numTries - 1), AlgoHttpClientWithRetry.MAX_BACKOFF_MS)\n if (delayTimeMs > 0) {\n await new Promise((r) => setTimeout(r, delayTimeMs))\n }\n Config.logger.warn(`algosdk request failed ${numTries} times. Retrying in ${delayTimeMs}ms: ${err}`)\n }\n } while (!response && ++numTries <= AlgoHttpClientWithRetry.MAX_TRIES)\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return response!\n }\n\n async get(relativePath: string, query?: Query<string>, requestHeaders: Record<string, string> = {}): Promise<BaseHTTPClientResponse> {\n return await this.callWithRetry(() => super.get(relativePath, query, requestHeaders))\n }\n\n async post(\n relativePath: string,\n data: Uint8Array,\n query?: Query<string>,\n requestHeaders: Record<string, string> = {},\n ): Promise<BaseHTTPClientResponse> {\n return await this.callWithRetry(() => super.post(relativePath, data, query, requestHeaders))\n }\n\n async delete(\n relativePath: string,\n data: Uint8Array,\n query?: Query<string>,\n requestHeaders: Record<string, string> = {},\n ): Promise<BaseHTT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AQ;CACT;;;;"}
1
+ {"version":3,"file":"algo-http-client-with-retry.mjs","sources":["../../src/types/algo-http-client-with-retry.ts"],"sourcesContent":["import type { BaseHTTPClientResponse, Query } from 'algosdk/dist/types/client/baseHTTPClient'\nimport { Config } from '../config'\nimport { URLTokenBaseHTTPClient } from './urlTokenBaseHTTPClient'\n\n/** A HTTP Client that wraps the Algorand SDK HTTP Client with retries */\nexport class AlgoHttpClientWithRetry extends URLTokenBaseHTTPClient {\n private static readonly MAX_TRIES = 5\n private static readonly MAX_BACKOFF_MS = 10000\n\n // These lists come from https://visionmedia.github.io/superagent/#retrying-requests\n // which is the underlying library used by algosdk - but the CloudFlare specific 52X status codes have been removed\n private static readonly RETRY_STATUS_CODES = [408, 413, 429, 500, 502, 503, 504]\n private static readonly RETRY_ERROR_CODES = [\n 'ETIMEDOUT',\n 'ECONNRESET',\n 'EADDRINUSE',\n 'ECONNREFUSED',\n 'EPIPE',\n 'ENOTFOUND',\n 'ENETUNREACH',\n 'EAI_AGAIN',\n 'EPROTO', // We get this intermittently with AlgoNode API\n ]\n\n private async callWithRetry(func: () => Promise<BaseHTTPClientResponse>): Promise<BaseHTTPClientResponse> {\n let response: BaseHTTPClientResponse | undefined\n let numTries = 1\n do {\n try {\n response = await func()\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n } catch (err: any) {\n if (numTries >= AlgoHttpClientWithRetry.MAX_TRIES) {\n throw err\n }\n // Only retry for one of the hardcoded conditions\n if (\n !(\n AlgoHttpClientWithRetry.RETRY_ERROR_CODES.includes(err.code) ||\n AlgoHttpClientWithRetry.RETRY_STATUS_CODES.includes(Number(err.status)) ||\n ('response' in err && AlgoHttpClientWithRetry.RETRY_STATUS_CODES.includes(Number(err.response.status)))\n )\n ) {\n throw err\n }\n // Retry immediately the first time, then exponentially backoff.\n const delayTimeMs = numTries == 1 ? 0 : Math.min(1000 * Math.pow(2, numTries - 1), AlgoHttpClientWithRetry.MAX_BACKOFF_MS)\n if (delayTimeMs > 0) {\n await new Promise((r) => setTimeout(r, delayTimeMs))\n }\n Config.logger.warn(`algosdk request failed ${numTries} times. Retrying in ${delayTimeMs}ms: ${err}`)\n }\n } while (!response && ++numTries <= AlgoHttpClientWithRetry.MAX_TRIES)\n // eslint-disable-next-line @typescript-eslint/no-non-null-assertion\n return response!\n }\n\n async get(relativePath: string, query?: Query<string>, requestHeaders: Record<string, string> = {}): Promise<BaseHTTPClientResponse> {\n return await this.callWithRetry(() => super.get(relativePath, query, requestHeaders))\n }\n\n async post(\n relativePath: string,\n data: Uint8Array,\n query?: Query<string>,\n requestHeaders: Record<string, string> = {},\n ): Promise<BaseHTTPClientResponse> {\n return await this.callWithRetry(() => super.post(relativePath, data, query, requestHeaders))\n }\n\n async delete(\n relativePath: string,\n data: Uint8Array,\n query?: Query<string>,\n requestHeaders: Record<string, string> = {},\n ): Promise<BaseHTTPClientResponse> {\n return await this.callWithRetry(() => super.delete(relativePath, data, query, requestHeaders))\n }\n}\n"],"names":[],"mappings":";;;AAIA;AACM,MAAO,uBAAwB,SAAQ,sBAAsB,CAAA;IAmBzD,MAAM,aAAa,CAAC,IAA2C,EAAA;AACrE,QAAA,IAAI,QAA4C;QAChD,IAAI,QAAQ,GAAG,CAAC;AAChB,QAAA,GAAG;AACD,YAAA,IAAI;AACF,gBAAA,QAAQ,GAAG,MAAM,IAAI,EAAE;;;YAEvB,OAAO,GAAQ,EAAE;AACjB,gBAAA,IAAI,QAAQ,IAAI,uBAAuB,CAAC,SAAS,EAAE;AACjD,oBAAA,MAAM,GAAG;;;gBAGX,IACE,EACE,uBAAuB,CAAC,iBAAiB,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC;oBAC5D,uBAAuB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,CAAC,CAAC;qBACtE,UAAU,IAAI,GAAG,IAAI,uBAAuB,CAAC,kBAAkB,CAAC,QAAQ,CAAC,MAAM,CAAC,GAAG,CAAC,QAA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C,YAAY,EAAE,IAAI,EAAE,KAAK,EAAE,cAAc,CAAC,CAAC;;;AAtExE,uBAAS,CAAA,SAAA,GAAG,CAAC;AACb,uBAAc,CAAA,cAAA,GAAG,KAAK;AAE9C;AACA;AACwB,uBAAA,CAAA,kBAAkB,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC;AACxD,uBAAA,CAAA,iBAAiB,GAAG;IAC1C,WAAW;IACX,YAAY;IACZ,YAAY;IACZ,cAAc;IACd,OAAO;IACP,WAAW;IACX,aAAa;IACb,WAAW;AACX,IAAA,QAAQ;CACT;;;;"}
@@ -3,7 +3,7 @@ import { AlgorandClientTransactionCreator } from './algorand-client-transaction-
3
3
  import { AlgorandClientTransactionSender } from './algorand-client-transaction-sender';
4
4
  import { AppDeployer } from './app-deployer';
5
5
  import { AppManager } from './app-manager';
6
- import AlgoKitComposer from './composer';
6
+ import { TransactionComposer } from './composer';
7
7
  import { NetworkDetails } from './network-client';
8
8
  import Algodv2 = algosdk.Algodv2;
9
9
  import Indexer = algosdk.Indexer;
@@ -16,7 +16,7 @@ export interface AlgorandClientInterface {
16
16
  appDeployer: AppDeployer;
17
17
  send: AlgorandClientTransactionSender;
18
18
  createTransaction: AlgorandClientTransactionCreator;
19
- newGroup(): AlgoKitComposer;
19
+ newGroup(): TransactionComposer;
20
20
  client: {
21
21
  algod: Algodv2;
22
22
  indexer?: Indexer;
@@ -1,5 +1,5 @@
1
1
  import algosdk from 'algosdk';
2
- import AlgoKitComposer, { BuiltTransactions } from './composer';
2
+ import { BuiltTransactions, TransactionComposer } from './composer';
3
3
  import { Expand } from './expand';
4
4
  import Transaction = algosdk.Transaction;
5
5
  /** Orchestrates creating transactions for `AlgorandClient`. */
@@ -7,9 +7,9 @@ export declare class AlgorandClientTransactionCreator {
7
7
  private _newGroup;
8
8
  /**
9
9
  * Creates a new `AlgorandClientTransactionCreator`
10
- * @param newGroup A lambda that starts a new `AlgoKitComposer` transaction group
10
+ * @param newGroup A lambda that starts a new `TransactionComposer` transaction group
11
11
  */
12
- constructor(newGroup: () => AlgoKitComposer);
12
+ constructor(newGroup: () => TransactionComposer);
13
13
  private _transaction;
14
14
  private _transactions;
15
15
  /**
@@ -715,4 +715,6 @@ export declare class AlgorandClientTransactionCreator {
715
715
  appCallMethodCall: (params: import("./composer").AppCallMethodCall) => Promise<Expand<BuiltTransactions>>;
716
716
  /** Create an online key registration transaction. */
717
717
  onlineKeyRegistration: (params: import("./composer").OnlineKeyRegistrationParams) => Promise<Transaction>;
718
+ /** Create an offline key registration transaction. */
719
+ offlineKeyRegistration: (params: import("./composer").OfflineKeyRegistrationParams) => Promise<Transaction>;
718
720
  }
@@ -4,7 +4,7 @@
4
4
  class AlgorandClientTransactionCreator {
5
5
  /**
6
6
  * Creates a new `AlgorandClientTransactionCreator`
7
- * @param newGroup A lambda that starts a new `AlgoKitComposer` transaction group
7
+ * @param newGroup A lambda that starts a new `TransactionComposer` transaction group
8
8
  */
9
9
  constructor(newGroup) {
10
10
  /**
@@ -662,6 +662,8 @@ class AlgorandClientTransactionCreator {
662
662
  this.appCallMethodCall = this._transactions((c) => c.addAppCallMethodCall);
663
663
  /** Create an online key registration transaction. */
664
664
  this.onlineKeyRegistration = this._transaction((c) => c.addOnlineKeyRegistration);
665
+ /** Create an offline key registration transaction. */
666
+ this.offlineKeyRegistration = this._transaction((c) => c.addOfflineKeyRegistration);
665
667
  this._newGroup = newGroup;
666
668
  }
667
669
  _transaction(c) {
@@ -1 +1 @@
1
- {"version":3,"file":"algorand-client-transaction-creator.js","sources":["../../src/types/algorand-client-transaction-creator.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport AlgoKitComposer, { BuiltTransactions } from './composer'\nimport { Expand } from './expand'\n\nimport Transaction = algosdk.Transaction\n\n/** Orchestrates creating transactions for `AlgorandClient`. */\nexport class AlgorandClientTransactionCreator {\n private _newGroup: () => AlgoKitComposer\n\n /**\n * Creates a new `AlgorandClientTransactionCreator`\n * @param newGroup A lambda that starts a new `AlgoKitComposer` transaction group\n */\n constructor(newGroup: () => AlgoKitComposer) {\n this._newGroup = newGroup\n }\n\n private _transaction<T>(c: (c: AlgoKitComposer) => (params: T) => AlgoKitComposer): (params: T) => Promise<Transaction> {\n return async (params: T) => {\n const composer = this._newGroup()\n const result = await c(composer).apply(composer, [params]).buildTransactions()\n return result.transactions.at(-1)!\n }\n }\n\n private _transactions<T>(c: (c: AlgoKitComposer) => (params: T) => AlgoKitComposer): (params: T) => Promise<Expand<BuiltTransactions>> {\n return async (params: T) => {\n const composer = this._newGroup()\n return await c(composer).apply(composer, [params]).buildTransactions()\n }\n }\n\n /**\n * Create a payment transaction to transfer Algo between accounts.\n * @param params The parameters for the payment transaction\n * @example Basic example\n * ```typescript\n * const result = await algorand.send.payment({\n * sender: 'SENDERADDRESS',\n * receiver: 'RECEIVERADDRESS',\n * amount: (4).algo(),\n * })\n * ```\n * @example Advanced example\n * ```typescript\n * const result = await algorand.send.payment({\n * amount: (4).algo(),\n * receiver: 'RECEIVERADDRESS',\n * sender: 'SENDERADDRESS',\n * closeRemainderTo: 'CLOSEREMAINDERTOADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // Use this with caution, it's generally better to use algorand.account.rekeyAccount\n * rekeyTo: 'REKEYTOADDRESS',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n *\n * @returns The payment transaction\n */\n payment = this._transaction((c) => c.addPayment)\n /** Create a create Algorand Standard Asset transaction.\n *\n * The account that sends this transaction will automatically be\n * opted in to the asset and will hold all units after creation.\n *\n * @param params The parameters for the asset creation transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetCreate({sender: \"CREATORADDRESS\", total: 100n})\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetCreate({\n * sender: 'CREATORADDRESS',\n * total: 100n,\n * decimals: 2,\n * assetName: 'asset',\n * unitName: 'unit',\n * url: 'url',\n * metadataHash: 'metadataHash',\n * defaultFrozen: false,\n * manager: 'MANAGERADDRESS',\n * reserve: 'RESERVEADDRESS',\n * freeze: 'FREEZEADDRESS',\n * clawback: 'CLAWBACKADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset create transaction\n */\n assetCreate = this._transaction((c) => c.addAssetCreate)\n /** Create an asset config transaction to reconfigure an existing Algorand Standard Asset.\n *\n * **Note:** The manager, reserve, freeze, and clawback addresses\n * are immutably empty if they are not set. If manager is not set then\n * all fields are immutable from that point forward.\n *\n * @param params The parameters for the asset config transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetConfig({sender: \"MANAGERADDRESS\", assetId: 123456n, manager: \"MANAGERADDRESS\" })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetConfig({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * manager: 'MANAGERADDRESS',\n * reserve: 'RESERVEADDRESS',\n * freeze: 'FREEZEADDRESS',\n * clawback: 'CLAWBACKADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset config transaction\n */\n assetConfig = this._transaction((c) => c.addAssetConfig)\n /** Create an Algorand Standard Asset freeze transaction.\n *\n * @param params The parameters for the asset freeze transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetFreeze({sender: \"MANAGERADDRESS\", assetId: 123456n, account: \"ACCOUNTADDRESS\", frozen: true })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetFreeze({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * account: 'ACCOUNTADDRESS',\n * frozen: true,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset freeze transaction\n */\n assetFreeze = this._transaction((c) => c.addAssetFreeze)\n /** Create an Algorand Standard Asset destroy transaction.\n *\n * Created assets can be destroyed only by the asset manager account.\n * All of the assets must be owned by the creator of the asset before\n * the asset can be deleted.\n *\n * @param params The parameters for the asset destroy transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetDestroy({sender: \"MANAGERADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetDestroy({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset destroy transaction\n */\n assetDestroy = this._transaction((c) => c.addAssetDestroy)\n /** Create an Algorand Standard Asset transfer transaction.\n *\n * @param params The parameters for the asset transfer transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetTransfer({sender: \"HOLDERADDRESS\", assetId: 123456n, amount: 1n, receiver: \"RECEIVERADDRESS\" })\n * ```\n * @example Advanced example (with clawback)\n * ```typescript\n * await algorand.createTransaction.assetTransfer({\n * sender: 'CLAWBACKADDRESS',\n * assetId: 123456n,\n * amount: 1n,\n * receiver: 'RECEIVERADDRESS',\n * clawbackTarget: 'HOLDERADDRESS',\n * // This field needs to be used with caution\n * closeAssetTo: 'ADDRESSTOCLOSETO'\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The result of the asset transfer transaction\n */\n assetTransfer = this._transaction((c) => c.addAssetTransfer)\n /** Create an Algorand Standard Asset opt-in transaction.\n *\n * @param params The parameters for the asset opt-in transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetOptIn({sender: \"SENDERADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetOptIn({\n * sender: 'SENDERADDRESS',\n * assetId: 123456n,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset opt-in transaction\n */\n assetOptIn = this._transaction((c) => c.addAssetOptIn)\n /** Create an asset opt-out transaction.\n *\n * *Note:* If the account has a balance of the asset,\n * it will lose those assets\n *\n * @param params The parameters for the asset opt-out transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetOptOut({sender: \"SENDERADDRESS\", creator: \"CREATORADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetOptIn({\n * sender: 'SENDERADDRESS',\n * assetId: 123456n,\n * creator: 'CREATORADDRESS',\n * ensureZeroBalance: true,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset opt-out transaction\n */\n assetOptOut = this._transaction((c) => c.addAssetOptOut)\n /** Create an application create transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app creation transaction\n * @example Basic example\n * ```typescript\n * const result = await algorand.createTransaction.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\n * const createdAppId = result.appId\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.appCreate({\n * sender: 'CREATORADDRESS',\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * schema: {\n * globalInts: 1,\n * globalByteSlices: 2,\n * localInts: 3,\n * localByteSlices: 4\n * },\n * extraProgramPages: 1,\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCreate = this._transaction((c) => c.addAppCreate)\n /** Create an application update transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app update transaction\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.appUpdate({\n * sender: 'CREATORADDRESS',\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appUpdate = this._transaction((c) => c.addAppUpdate)\n /** Create an application delete transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app deletion transaction\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.appDelete({ sender: 'CREATORADDRESS' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.appDelete({\n * sender: 'CREATORADDRESS',\n * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appDelete = this._transaction((c) => c.addAppDelete)\n /** Create an application call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app call transaction\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.appCall({ sender: 'CREATORADDRESS' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.appCall({\n * sender: 'CREATORADDRESS',\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCall = this._transaction((c) => c.addAppCall)\n /** Create an application create call with ABI method call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app creation transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * const result = await algorand.createTransaction.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: [\"arg1_value\"] })\n * const createdAppId = result.appId\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appCreate({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * schema: {\n * globalInts: 1,\n * globalByteSlices: 2,\n * localInts: 3,\n * localByteSlices: 4\n * },\n * extraProgramPages: 1,\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCreateMethodCall = this._transactions((c) => c.addAppCreateMethodCall)\n /** Create an application update call with ABI method call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app update transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appUpdateMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appUpdateMethodCall = this._transactions((c) => c.addAppUpdateMethodCall)\n /** Create an application delete call with ABI method call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app deletion transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appDeleteMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appDeleteMethodCall = this._transactions((c) => c.addAppDeleteMethodCall)\n /** Create an application call with ABI method call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app call transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appCallMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCallMethodCall = this._transactions((c) => c.addAppCallMethodCall)\n /** Create an online key registration transaction. */\n onlineKeyRegistration = this._transaction((c) => c.addOnlineKeyRegistration)\n}\n"],"names":[],"mappings":";;AAMA;MACa,gCAAgC,CAAA;AAG3C;;;AAGG;AACH,IAAA,WAAA,CAAY,QAA+B,EAAA;AAmB3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAA;AAChD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAA;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAA;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG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CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAA;YAC9E,OAAO,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE,CAAA;AACpC,SAAC,CAAA;KACF;AAEO,IAAA,aAAa,CAAI,CAAyD,EAAA;AAChF,QAAA,OAAO,OAAO,MAAS,KAAI;AACzB,YAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE,CAAA;AACjC,YAAA,OAAO,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,EAAE,CAAA;AACxE,SAAC,CAAA;KACF;AAipBF;;;;"}
1
+ {"version":3,"file":"algorand-client-transaction-creator.js","sources":["../../src/types/algorand-client-transaction-creator.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { BuiltTransactions, TransactionComposer } from './composer'\nimport { Expand } from './expand'\n\nimport Transaction = algosdk.Transaction\n\n/** Orchestrates creating transactions for `AlgorandClient`. */\nexport class AlgorandClientTransactionCreator {\n private _newGroup: () => TransactionComposer\n\n /**\n * Creates a new `AlgorandClientTransactionCreator`\n * @param newGroup A lambda that starts a new `TransactionComposer` transaction group\n */\n constructor(newGroup: () => TransactionComposer) {\n this._newGroup = newGroup\n }\n\n private _transaction<T>(c: (c: TransactionComposer) => (params: T) => TransactionComposer): (params: T) => Promise<Transaction> {\n return async (params: T) => {\n const composer = this._newGroup()\n const result = await c(composer).apply(composer, [params]).buildTransactions()\n return result.transactions.at(-1)!\n }\n }\n\n private _transactions<T>(\n c: (c: TransactionComposer) => (params: T) => TransactionComposer,\n ): (params: T) => Promise<Expand<BuiltTransactions>> {\n return async (params: T) => {\n const composer = this._newGroup()\n return await c(composer).apply(composer, [params]).buildTransactions()\n }\n }\n\n /**\n * Create a payment transaction to transfer Algo between accounts.\n * @param params The parameters for the payment transaction\n * @example Basic example\n * ```typescript\n * const result = await algorand.send.payment({\n * sender: 'SENDERADDRESS',\n * receiver: 'RECEIVERADDRESS',\n * amount: (4).algo(),\n * })\n * ```\n * @example Advanced example\n * ```typescript\n * const result = await algorand.send.payment({\n * amount: (4).algo(),\n * receiver: 'RECEIVERADDRESS',\n * sender: 'SENDERADDRESS',\n * closeRemainderTo: 'CLOSEREMAINDERTOADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // Use this with caution, it's generally better to use algorand.account.rekeyAccount\n * rekeyTo: 'REKEYTOADDRESS',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n *\n * @returns The payment transaction\n */\n payment = this._transaction((c) => c.addPayment)\n /** Create a create Algorand Standard Asset transaction.\n *\n * The account that sends this transaction will automatically be\n * opted in to the asset and will hold all units after creation.\n *\n * @param params The parameters for the asset creation transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetCreate({sender: \"CREATORADDRESS\", total: 100n})\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetCreate({\n * sender: 'CREATORADDRESS',\n * total: 100n,\n * decimals: 2,\n * assetName: 'asset',\n * unitName: 'unit',\n * url: 'url',\n * metadataHash: 'metadataHash',\n * defaultFrozen: false,\n * manager: 'MANAGERADDRESS',\n * reserve: 'RESERVEADDRESS',\n * freeze: 'FREEZEADDRESS',\n * clawback: 'CLAWBACKADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset create transaction\n */\n assetCreate = this._transaction((c) => c.addAssetCreate)\n /** Create an asset config transaction to reconfigure an existing Algorand Standard Asset.\n *\n * **Note:** The manager, reserve, freeze, and clawback addresses\n * are immutably empty if they are not set. If manager is not set then\n * all fields are immutable from that point forward.\n *\n * @param params The parameters for the asset config transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetConfig({sender: \"MANAGERADDRESS\", assetId: 123456n, manager: \"MANAGERADDRESS\" })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetConfig({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * manager: 'MANAGERADDRESS',\n * reserve: 'RESERVEADDRESS',\n * freeze: 'FREEZEADDRESS',\n * clawback: 'CLAWBACKADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset config transaction\n */\n assetConfig = this._transaction((c) => c.addAssetConfig)\n /** Create an Algorand Standard Asset freeze transaction.\n *\n * @param params The parameters for the asset freeze transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetFreeze({sender: \"MANAGERADDRESS\", assetId: 123456n, account: \"ACCOUNTADDRESS\", frozen: true })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetFreeze({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * account: 'ACCOUNTADDRESS',\n * frozen: true,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset freeze transaction\n */\n assetFreeze = this._transaction((c) => c.addAssetFreeze)\n /** Create an Algorand Standard Asset destroy transaction.\n *\n * Created assets can be destroyed only by the asset manager account.\n * All of the assets must be owned by the creator of the asset before\n * the asset can be deleted.\n *\n * @param params The parameters for the asset destroy transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetDestroy({sender: \"MANAGERADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetDestroy({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset destroy transaction\n */\n assetDestroy = this._transaction((c) => c.addAssetDestroy)\n /** Create an Algorand Standard Asset transfer transaction.\n *\n * @param params The parameters for the asset transfer transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetTransfer({sender: \"HOLDERADDRESS\", assetId: 123456n, amount: 1n, receiver: \"RECEIVERADDRESS\" })\n * ```\n * @example Advanced example (with clawback)\n * ```typescript\n * await algorand.createTransaction.assetTransfer({\n * sender: 'CLAWBACKADDRESS',\n * assetId: 123456n,\n * amount: 1n,\n * receiver: 'RECEIVERADDRESS',\n * clawbackTarget: 'HOLDERADDRESS',\n * // This field needs to be used with caution\n * closeAssetTo: 'ADDRESSTOCLOSETO'\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The result of the asset transfer transaction\n */\n assetTransfer = this._transaction((c) => c.addAssetTransfer)\n /** Create an Algorand Standard Asset opt-in transaction.\n *\n * @param params The parameters for the asset opt-in transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetOptIn({sender: \"SENDERADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetOptIn({\n * sender: 'SENDERADDRESS',\n * assetId: 123456n,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset opt-in transaction\n */\n assetOptIn = this._transaction((c) => c.addAssetOptIn)\n /** Create an asset opt-out transaction.\n *\n * *Note:* If the account has a balance of the asset,\n * it will lose those assets\n *\n * @param params The parameters for the asset opt-out transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetOptOut({sender: \"SENDERADDRESS\", creator: \"CREATORADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetOptIn({\n * sender: 'SENDERADDRESS',\n * assetId: 123456n,\n * creator: 'CREATORADDRESS',\n * ensureZeroBalance: true,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset opt-out transaction\n */\n assetOptOut = this._transaction((c) => c.addAssetOptOut)\n /** Create an application create transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app creation transaction\n * @example Basic example\n * ```typescript\n * const result = await algorand.createTransaction.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\n * const createdAppId = result.appId\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.appCreate({\n * sender: 'CREATORADDRESS',\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * schema: {\n * globalInts: 1,\n * globalByteSlices: 2,\n * localInts: 3,\n * localByteSlices: 4\n * },\n * extraProgramPages: 1,\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCreate = this._transaction((c) => c.addAppCreate)\n /** Create an application update transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app update transaction\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.appUpdate({\n * sender: 'CREATORADDRESS',\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appUpdate = this._transaction((c) => c.addAppUpdate)\n /** Create an application delete transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app deletion transaction\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.appDelete({ sender: 'CREATORADDRESS' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.appDelete({\n * sender: 'CREATORADDRESS',\n * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appDelete = this._transaction((c) => c.addAppDelete)\n /** Create an application call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app call transaction\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.appCall({ sender: 'CREATORADDRESS' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.appCall({\n * sender: 'CREATORADDRESS',\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCall = this._transaction((c) => c.addAppCall)\n /** Create an application create call with ABI method call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app creation transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * const result = await algorand.createTransaction.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: [\"arg1_value\"] })\n * const createdAppId = result.appId\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appCreate({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * schema: {\n * globalInts: 1,\n * globalByteSlices: 2,\n * localInts: 3,\n * localByteSlices: 4\n * },\n * extraProgramPages: 1,\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCreateMethodCall = this._transactions((c) => c.addAppCreateMethodCall)\n /** Create an application update call with ABI method call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app update transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appUpdateMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appUpdateMethodCall = this._transactions((c) => c.addAppUpdateMethodCall)\n /** Create an application delete call with ABI method call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app deletion transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appDeleteMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appDeleteMethodCall = this._transactions((c) => c.addAppDeleteMethodCall)\n /** Create an application call with ABI method call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app call transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appCallMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCallMethodCall = this._transactions((c) => c.addAppCallMethodCall)\n /** Create an online key registration transaction. */\n onlineKeyRegistration = this._transaction((c) => c.addOnlineKeyRegistration)\n /** Create an offline key registration transaction. */\n offlineKeyRegistration = this._transaction((c) => c.addOfflineKeyRegistration)\n}\n"],"names":[],"mappings":";;AAMA;MACa,gCAAgC,CAAA;AAG3C;;;AAGG;AACH,IAAA,WAAA,CAAY,QAAmC,EAAA;AAqB/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;AAChD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACH,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC;AAC1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;AACH,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC;AAC5D;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;AACH,QAAA,IAAA,CAAA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AACxE,SAAC;;AAopBJ;;;;"}
@@ -2,7 +2,7 @@
2
2
  class AlgorandClientTransactionCreator {
3
3
  /**
4
4
  * Creates a new `AlgorandClientTransactionCreator`
5
- * @param newGroup A lambda that starts a new `AlgoKitComposer` transaction group
5
+ * @param newGroup A lambda that starts a new `TransactionComposer` transaction group
6
6
  */
7
7
  constructor(newGroup) {
8
8
  /**
@@ -660,6 +660,8 @@ class AlgorandClientTransactionCreator {
660
660
  this.appCallMethodCall = this._transactions((c) => c.addAppCallMethodCall);
661
661
  /** Create an online key registration transaction. */
662
662
  this.onlineKeyRegistration = this._transaction((c) => c.addOnlineKeyRegistration);
663
+ /** Create an offline key registration transaction. */
664
+ this.offlineKeyRegistration = this._transaction((c) => c.addOfflineKeyRegistration);
663
665
  this._newGroup = newGroup;
664
666
  }
665
667
  _transaction(c) {
@@ -1 +1 @@
1
- {"version":3,"file":"algorand-client-transaction-creator.mjs","sources":["../../src/types/algorand-client-transaction-creator.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport AlgoKitComposer, { BuiltTransactions } from './composer'\nimport { Expand } from './expand'\n\nimport Transaction = algosdk.Transaction\n\n/** Orchestrates creating transactions for `AlgorandClient`. */\nexport class AlgorandClientTransactionCreator {\n private _newGroup: () => AlgoKitComposer\n\n /**\n * Creates a new `AlgorandClientTransactionCreator`\n * @param newGroup A lambda that starts a new `AlgoKitComposer` transaction group\n */\n constructor(newGroup: () => AlgoKitComposer) {\n this._newGroup = newGroup\n }\n\n private _transaction<T>(c: (c: AlgoKitComposer) => (params: T) => AlgoKitComposer): (params: T) => Promise<Transaction> {\n return async (params: T) => {\n const composer = this._newGroup()\n const result = await c(composer).apply(composer, [params]).buildTransactions()\n return result.transactions.at(-1)!\n }\n }\n\n private _transactions<T>(c: (c: AlgoKitComposer) => (params: T) => AlgoKitComposer): (params: T) => Promise<Expand<BuiltTransactions>> {\n return async (params: T) => {\n const composer = this._newGroup()\n return await c(composer).apply(composer, [params]).buildTransactions()\n }\n }\n\n /**\n * Create a payment transaction to transfer Algo between accounts.\n * @param params The parameters for the payment transaction\n * @example Basic example\n * ```typescript\n * const result = await algorand.send.payment({\n * sender: 'SENDERADDRESS',\n * receiver: 'RECEIVERADDRESS',\n * amount: (4).algo(),\n * })\n * ```\n * @example Advanced example\n * ```typescript\n * const result = await algorand.send.payment({\n * amount: (4).algo(),\n * receiver: 'RECEIVERADDRESS',\n * sender: 'SENDERADDRESS',\n * closeRemainderTo: 'CLOSEREMAINDERTOADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // Use this with caution, it's generally better to use algorand.account.rekeyAccount\n * rekeyTo: 'REKEYTOADDRESS',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n *\n * @returns The payment transaction\n */\n payment = this._transaction((c) => c.addPayment)\n /** Create a create Algorand Standard Asset transaction.\n *\n * The account that sends this transaction will automatically be\n * opted in to the asset and will hold all units after creation.\n *\n * @param params The parameters for the asset creation transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetCreate({sender: \"CREATORADDRESS\", total: 100n})\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetCreate({\n * sender: 'CREATORADDRESS',\n * total: 100n,\n * decimals: 2,\n * assetName: 'asset',\n * unitName: 'unit',\n * url: 'url',\n * metadataHash: 'metadataHash',\n * defaultFrozen: false,\n * manager: 'MANAGERADDRESS',\n * reserve: 'RESERVEADDRESS',\n * freeze: 'FREEZEADDRESS',\n * clawback: 'CLAWBACKADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset create transaction\n */\n assetCreate = this._transaction((c) => c.addAssetCreate)\n /** Create an asset config transaction to reconfigure an existing Algorand Standard Asset.\n *\n * **Note:** The manager, reserve, freeze, and clawback addresses\n * are immutably empty if they are not set. If manager is not set then\n * all fields are immutable from that point forward.\n *\n * @param params The parameters for the asset config transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetConfig({sender: \"MANAGERADDRESS\", assetId: 123456n, manager: \"MANAGERADDRESS\" })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetConfig({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * manager: 'MANAGERADDRESS',\n * reserve: 'RESERVEADDRESS',\n * freeze: 'FREEZEADDRESS',\n * clawback: 'CLAWBACKADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset config transaction\n */\n assetConfig = this._transaction((c) => c.addAssetConfig)\n /** Create an Algorand Standard Asset freeze transaction.\n *\n * @param params The parameters for the asset freeze transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetFreeze({sender: \"MANAGERADDRESS\", assetId: 123456n, account: \"ACCOUNTADDRESS\", frozen: true })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetFreeze({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * account: 'ACCOUNTADDRESS',\n * frozen: true,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset freeze transaction\n */\n assetFreeze = this._transaction((c) => c.addAssetFreeze)\n /** Create an Algorand Standard Asset destroy transaction.\n *\n * Created assets can be destroyed only by the asset manager account.\n * All of the assets must be owned by the creator of the asset before\n * the asset can be deleted.\n *\n * @param params The parameters for the asset destroy transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetDestroy({sender: \"MANAGERADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetDestroy({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset destroy transaction\n */\n assetDestroy = this._transaction((c) => c.addAssetDestroy)\n /** Create an Algorand Standard Asset transfer transaction.\n *\n * @param params The parameters for the asset transfer transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetTransfer({sender: \"HOLDERADDRESS\", assetId: 123456n, amount: 1n, receiver: \"RECEIVERADDRESS\" })\n * ```\n * @example Advanced example (with clawback)\n * ```typescript\n * await algorand.createTransaction.assetTransfer({\n * sender: 'CLAWBACKADDRESS',\n * assetId: 123456n,\n * amount: 1n,\n * receiver: 'RECEIVERADDRESS',\n * clawbackTarget: 'HOLDERADDRESS',\n * // This field needs to be used with caution\n * closeAssetTo: 'ADDRESSTOCLOSETO'\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The result of the asset transfer transaction\n */\n assetTransfer = this._transaction((c) => c.addAssetTransfer)\n /** Create an Algorand Standard Asset opt-in transaction.\n *\n * @param params The parameters for the asset opt-in transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetOptIn({sender: \"SENDERADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetOptIn({\n * sender: 'SENDERADDRESS',\n * assetId: 123456n,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset opt-in transaction\n */\n assetOptIn = this._transaction((c) => c.addAssetOptIn)\n /** Create an asset opt-out transaction.\n *\n * *Note:* If the account has a balance of the asset,\n * it will lose those assets\n *\n * @param params The parameters for the asset opt-out transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetOptOut({sender: \"SENDERADDRESS\", creator: \"CREATORADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetOptIn({\n * sender: 'SENDERADDRESS',\n * assetId: 123456n,\n * creator: 'CREATORADDRESS',\n * ensureZeroBalance: true,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset opt-out transaction\n */\n assetOptOut = this._transaction((c) => c.addAssetOptOut)\n /** Create an application create transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app creation transaction\n * @example Basic example\n * ```typescript\n * const result = await algorand.createTransaction.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\n * const createdAppId = result.appId\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.appCreate({\n * sender: 'CREATORADDRESS',\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * schema: {\n * globalInts: 1,\n * globalByteSlices: 2,\n * localInts: 3,\n * localByteSlices: 4\n * },\n * extraProgramPages: 1,\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCreate = this._transaction((c) => c.addAppCreate)\n /** Create an application update transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app update transaction\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.appUpdate({\n * sender: 'CREATORADDRESS',\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appUpdate = this._transaction((c) => c.addAppUpdate)\n /** Create an application delete transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app deletion transaction\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.appDelete({ sender: 'CREATORADDRESS' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.appDelete({\n * sender: 'CREATORADDRESS',\n * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appDelete = this._transaction((c) => c.addAppDelete)\n /** Create an application call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app call transaction\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.appCall({ sender: 'CREATORADDRESS' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.appCall({\n * sender: 'CREATORADDRESS',\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCall = this._transaction((c) => c.addAppCall)\n /** Create an application create call with ABI method call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app creation transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * const result = await algorand.createTransaction.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: [\"arg1_value\"] })\n * const createdAppId = result.appId\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appCreate({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * schema: {\n * globalInts: 1,\n * globalByteSlices: 2,\n * localInts: 3,\n * localByteSlices: 4\n * },\n * extraProgramPages: 1,\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCreateMethodCall = this._transactions((c) => c.addAppCreateMethodCall)\n /** Create an application update call with ABI method call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app update transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appUpdateMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appUpdateMethodCall = this._transactions((c) => c.addAppUpdateMethodCall)\n /** Create an application delete call with ABI method call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app deletion transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appDeleteMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appDeleteMethodCall = this._transactions((c) => c.addAppDeleteMethodCall)\n /** Create an application call with ABI method call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app call transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appCallMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCallMethodCall = this._transactions((c) => c.addAppCallMethodCall)\n /** Create an online key registration transaction. */\n onlineKeyRegistration = this._transaction((c) => c.addOnlineKeyRegistration)\n}\n"],"names":[],"mappings":"AAMA;MACa,gCAAgC,CAAA;AAG3C;;;AAGG;AACH,IAAA,WAAA,CAAY,QAA+B,EAAA;AAmB3C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC,CAAA;AAChD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAuCG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAA;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAA;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4BG;AACH,QAAA,IAAA,CAAA,WAAW,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,cAAc,CAAC,CAAA;AACxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8BG;AACH,QAAA,IAAA,CAAA,YAAY,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,CAAA;AAC1D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA+BG;AACH,QAAA,IAAA,CAAA,aAAa,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,gBAAgB,CAAC,CAAA;AAC5D;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BG;AAC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,CAAC,iBAAiB,EAAE,CAAA;AACxE,SAAC,CAAA;KACF;AAipBF;;;;"}
1
+ {"version":3,"file":"algorand-client-transaction-creator.mjs","sources":["../../src/types/algorand-client-transaction-creator.ts"],"sourcesContent":["import algosdk from 'algosdk'\nimport { BuiltTransactions, TransactionComposer } from './composer'\nimport { Expand } from './expand'\n\nimport Transaction = algosdk.Transaction\n\n/** Orchestrates creating transactions for `AlgorandClient`. */\nexport class AlgorandClientTransactionCreator {\n private _newGroup: () => TransactionComposer\n\n /**\n * Creates a new `AlgorandClientTransactionCreator`\n * @param newGroup A lambda that starts a new `TransactionComposer` transaction group\n */\n constructor(newGroup: () => TransactionComposer) {\n this._newGroup = newGroup\n }\n\n private _transaction<T>(c: (c: TransactionComposer) => (params: T) => TransactionComposer): (params: T) => Promise<Transaction> {\n return async (params: T) => {\n const composer = this._newGroup()\n const result = await c(composer).apply(composer, [params]).buildTransactions()\n return result.transactions.at(-1)!\n }\n }\n\n private _transactions<T>(\n c: (c: TransactionComposer) => (params: T) => TransactionComposer,\n ): (params: T) => Promise<Expand<BuiltTransactions>> {\n return async (params: T) => {\n const composer = this._newGroup()\n return await c(composer).apply(composer, [params]).buildTransactions()\n }\n }\n\n /**\n * Create a payment transaction to transfer Algo between accounts.\n * @param params The parameters for the payment transaction\n * @example Basic example\n * ```typescript\n * const result = await algorand.send.payment({\n * sender: 'SENDERADDRESS',\n * receiver: 'RECEIVERADDRESS',\n * amount: (4).algo(),\n * })\n * ```\n * @example Advanced example\n * ```typescript\n * const result = await algorand.send.payment({\n * amount: (4).algo(),\n * receiver: 'RECEIVERADDRESS',\n * sender: 'SENDERADDRESS',\n * closeRemainderTo: 'CLOSEREMAINDERTOADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // Use this with caution, it's generally better to use algorand.account.rekeyAccount\n * rekeyTo: 'REKEYTOADDRESS',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n *\n * @returns The payment transaction\n */\n payment = this._transaction((c) => c.addPayment)\n /** Create a create Algorand Standard Asset transaction.\n *\n * The account that sends this transaction will automatically be\n * opted in to the asset and will hold all units after creation.\n *\n * @param params The parameters for the asset creation transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetCreate({sender: \"CREATORADDRESS\", total: 100n})\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetCreate({\n * sender: 'CREATORADDRESS',\n * total: 100n,\n * decimals: 2,\n * assetName: 'asset',\n * unitName: 'unit',\n * url: 'url',\n * metadataHash: 'metadataHash',\n * defaultFrozen: false,\n * manager: 'MANAGERADDRESS',\n * reserve: 'RESERVEADDRESS',\n * freeze: 'FREEZEADDRESS',\n * clawback: 'CLAWBACKADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset create transaction\n */\n assetCreate = this._transaction((c) => c.addAssetCreate)\n /** Create an asset config transaction to reconfigure an existing Algorand Standard Asset.\n *\n * **Note:** The manager, reserve, freeze, and clawback addresses\n * are immutably empty if they are not set. If manager is not set then\n * all fields are immutable from that point forward.\n *\n * @param params The parameters for the asset config transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetConfig({sender: \"MANAGERADDRESS\", assetId: 123456n, manager: \"MANAGERADDRESS\" })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetConfig({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * manager: 'MANAGERADDRESS',\n * reserve: 'RESERVEADDRESS',\n * freeze: 'FREEZEADDRESS',\n * clawback: 'CLAWBACKADDRESS',\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset config transaction\n */\n assetConfig = this._transaction((c) => c.addAssetConfig)\n /** Create an Algorand Standard Asset freeze transaction.\n *\n * @param params The parameters for the asset freeze transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetFreeze({sender: \"MANAGERADDRESS\", assetId: 123456n, account: \"ACCOUNTADDRESS\", frozen: true })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetFreeze({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * account: 'ACCOUNTADDRESS',\n * frozen: true,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset freeze transaction\n */\n assetFreeze = this._transaction((c) => c.addAssetFreeze)\n /** Create an Algorand Standard Asset destroy transaction.\n *\n * Created assets can be destroyed only by the asset manager account.\n * All of the assets must be owned by the creator of the asset before\n * the asset can be deleted.\n *\n * @param params The parameters for the asset destroy transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetDestroy({sender: \"MANAGERADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetDestroy({\n * sender: 'MANAGERADDRESS',\n * assetId: 123456n,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset destroy transaction\n */\n assetDestroy = this._transaction((c) => c.addAssetDestroy)\n /** Create an Algorand Standard Asset transfer transaction.\n *\n * @param params The parameters for the asset transfer transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetTransfer({sender: \"HOLDERADDRESS\", assetId: 123456n, amount: 1n, receiver: \"RECEIVERADDRESS\" })\n * ```\n * @example Advanced example (with clawback)\n * ```typescript\n * await algorand.createTransaction.assetTransfer({\n * sender: 'CLAWBACKADDRESS',\n * assetId: 123456n,\n * amount: 1n,\n * receiver: 'RECEIVERADDRESS',\n * clawbackTarget: 'HOLDERADDRESS',\n * // This field needs to be used with caution\n * closeAssetTo: 'ADDRESSTOCLOSETO'\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The result of the asset transfer transaction\n */\n assetTransfer = this._transaction((c) => c.addAssetTransfer)\n /** Create an Algorand Standard Asset opt-in transaction.\n *\n * @param params The parameters for the asset opt-in transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetOptIn({sender: \"SENDERADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetOptIn({\n * sender: 'SENDERADDRESS',\n * assetId: 123456n,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset opt-in transaction\n */\n assetOptIn = this._transaction((c) => c.addAssetOptIn)\n /** Create an asset opt-out transaction.\n *\n * *Note:* If the account has a balance of the asset,\n * it will lose those assets\n *\n * @param params The parameters for the asset opt-out transaction\n *\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.assetOptOut({sender: \"SENDERADDRESS\", creator: \"CREATORADDRESS\", assetId: 123456n })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.assetOptIn({\n * sender: 'SENDERADDRESS',\n * assetId: 123456n,\n * creator: 'CREATORADDRESS',\n * ensureZeroBalance: true,\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * })\n * ```\n * @returns The asset opt-out transaction\n */\n assetOptOut = this._transaction((c) => c.addAssetOptOut)\n /** Create an application create transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app creation transaction\n * @example Basic example\n * ```typescript\n * const result = await algorand.createTransaction.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\n * const createdAppId = result.appId\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.appCreate({\n * sender: 'CREATORADDRESS',\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * schema: {\n * globalInts: 1,\n * globalByteSlices: 2,\n * localInts: 3,\n * localByteSlices: 4\n * },\n * extraProgramPages: 1,\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCreate = this._transaction((c) => c.addAppCreate)\n /** Create an application update transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app update transaction\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.appUpdate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.appUpdate({\n * sender: 'CREATORADDRESS',\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appUpdate = this._transaction((c) => c.addAppUpdate)\n /** Create an application delete transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app deletion transaction\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.appDelete({ sender: 'CREATORADDRESS' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.appDelete({\n * sender: 'CREATORADDRESS',\n * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appDelete = this._transaction((c) => c.addAppDelete)\n /** Create an application call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app call transaction\n * @example Basic example\n * ```typescript\n * await algorand.createTransaction.appCall({ sender: 'CREATORADDRESS' })\n * ```\n * @example Advanced example\n * ```typescript\n * await algorand.createTransaction.appCall({\n * sender: 'CREATORADDRESS',\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCall = this._transaction((c) => c.addAppCall)\n /** Create an application create call with ABI method call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app creation transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * const result = await algorand.createTransaction.appCreateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: [\"arg1_value\"] })\n * const createdAppId = result.appId\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appCreate({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * schema: {\n * globalInts: 1,\n * globalByteSlices: 2,\n * localInts: 3,\n * localByteSlices: 4\n * },\n * extraProgramPages: 1,\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCreateMethodCall = this._transactions((c) => c.addAppCreateMethodCall)\n /** Create an application update call with ABI method call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app update transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appUpdateMethodCall({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appUpdateMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * approvalProgram: \"TEALCODE\",\n * clearStateProgram: \"TEALCODE\",\n * onComplete: algosdk.OnApplicationComplete.UpdateApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appUpdateMethodCall = this._transactions((c) => c.addAppUpdateMethodCall)\n /** Create an application delete call with ABI method call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app deletion transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appDeleteMethodCall({ sender: 'CREATORADDRESS', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appDeleteMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * onComplete: algosdk.OnApplicationComplete.DeleteApplicationOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appDeleteMethodCall = this._transactions((c) => c.addAppDeleteMethodCall)\n /** Create an application call with ABI method call transaction.\n *\n * Note: you may prefer to use `algorand.client` to get an app client for more advanced functionality.\n *\n * @param params The parameters for the app call transaction\n * @example Basic example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appCallMethodCall({ sender: 'CREATORADDRESS', method: method, args: [\"arg1_value\"] })\n * ```\n * @example Advanced example\n * ```typescript\n * const method = new ABIMethod({\n * name: 'method',\n * args: [{ name: 'arg1', type: 'string' }],\n * returns: { type: 'string' },\n * })\n * await algorand.createTransaction.appCallMethodCall({\n * sender: 'CREATORADDRESS',\n * method: method,\n * args: [\"arg1_value\"],\n * onComplete: algosdk.OnApplicationComplete.OptInOC,\n * args: [new Uint8Array(1, 2, 3, 4)]\n * accountReferences: [\"ACCOUNT_1\"]\n * appReferences: [123n, 1234n]\n * assetReferences: [12345n]\n * boxReferences: [\"box1\", {appId: 1234n, name: \"box2\"}]\n * lease: 'lease',\n * note: 'note',\n * // You wouldn't normally set this field\n * firstValidRound: 1000n,\n * validityWindow: 10,\n * extraFee: (1000).microAlgo(),\n * staticFee: (1000).microAlgo(),\n * // Max fee doesn't make sense with extraFee AND staticFee\n * // already specified, but here for completeness\n * maxFee: (3000).microAlgo(),\n * // Signer only needed if you want to provide one,\n * // generally you'd register it with AlgorandClient\n * // against the sender and not need to pass it in\n * signer: transactionSigner,\n * maxRoundsToWaitForConfirmation: 5,\n * suppressLog: true,\n *})\n * ```\n */\n appCallMethodCall = this._transactions((c) => c.addAppCallMethodCall)\n /** Create an online key registration transaction. */\n onlineKeyRegistration = this._transaction((c) => c.addOnlineKeyRegistration)\n /** Create an offline key registration transaction. */\n offlineKeyRegistration = this._transaction((c) => c.addOfflineKeyRegistration)\n}\n"],"names":[],"mappings":"AAMA;MACa,gCAAgC,CAAA;AAG3C;;;AAGG;AACH,IAAA,WAAA,CAAY,QAAmC,EAAA;AAqB/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAkCG;AACH,QAAA,IAAA,CAAA,OAAO,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,UAAU,CAAC;AAChD;;;;;;;;;;;;;;;;;;;;;;;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CAAC,KAAK,CAAC,CAAC,wBAAwB,CAAC;;AAE5E,QAAA,IAAA,CAAA,sBAAsB,GAAG,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,yBAAyB,CAAC;AApqB5E,QAAA,IAAI,CAAC,SAAS,GAAG,QAAQ;;AAGnB,IAAA,YAAY,CAAI,CAAiE,EAAA;AACvF,QAAA,OAAO,OAAO,MAAS,KAAI;AACzB,YAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE;AACjC,YAAA,MAAM,MAAM,GAAG,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,EAAE;YAC9E,OAAO,MAAM,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC,CAAE;AACpC,SAAC;;AAGK,IAAA,aAAa,CACnB,CAAiE,EAAA;AAEjE,QAAA,OAAO,OAAO,MAAS,KAAI;AACzB,YAAA,MAAM,QAAQ,GAAG,IAAI,CAAC,SAAS,EAAE;AACjC,YAAA,OAAO,MAAM,CAAC,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAC,MAAM,CAAC,CAAC,CAAC,iBAAiB,EAAE;AACxE,SAAC;;AAopBJ;;;;"}
@@ -2,7 +2,7 @@ import algosdk from 'algosdk';
2
2
  import { SendAppCreateTransactionResult, SendAppTransactionResult, SendAppUpdateTransactionResult } from './app';
3
3
  import { AppManager } from './app-manager';
4
4
  import { AssetManager } from './asset-manager';
5
- import AlgoKitComposer, { AssetCreateParams, AssetOptOutParams } from './composer';
5
+ import { AssetCreateParams, AssetOptOutParams, TransactionComposer } from './composer';
6
6
  import { SendParams, SendSingleTransactionResult } from './transaction';
7
7
  /** Orchestrates sending transactions for `AlgorandClient`. */
8
8
  export declare class AlgorandClientTransactionSender {
@@ -11,11 +11,11 @@ export declare class AlgorandClientTransactionSender {
11
11
  private _appManager;
12
12
  /**
13
13
  * Creates a new `AlgorandClientSender`
14
- * @param newGroup A lambda that starts a new `AlgoKitComposer` transaction group
14
+ * @param newGroup A lambda that starts a new `TransactionComposer` transaction group
15
15
  * @param assetManager An `AssetManager` instance
16
16
  */
17
- constructor(newGroup: () => AlgoKitComposer, assetManager: AssetManager, appManager: AppManager);
18
- newGroup(): AlgoKitComposer;
17
+ constructor(newGroup: () => TransactionComposer, assetManager: AssetManager, appManager: AppManager);
18
+ newGroup(): TransactionComposer;
19
19
  private _send;
20
20
  private _sendAppCall;
21
21
  private _sendAppUpdateCall;
@@ -777,7 +777,7 @@ export declare class AlgorandClientTransactionSender {
777
777
  boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
778
778
  approvalProgram: string | Uint8Array;
779
779
  clearStateProgram: string | Uint8Array;
780
- }> | import("./composer").AppMethodCall<import("./composer").AppMethodCallParams>)[] | undefined;
780
+ }> | import("./composer").AppMethodCall<import("./composer").AppMethodCallParams> | undefined)[] | undefined;
781
781
  } & SendParams) => Promise<SendAppCreateTransactionResult>;
782
782
  /**
783
783
  * Update a smart contract via an ABI method.
@@ -902,7 +902,7 @@ export declare class AlgorandClientTransactionSender {
902
902
  boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
903
903
  approvalProgram: string | Uint8Array;
904
904
  clearStateProgram: string | Uint8Array;
905
- }> | import("./composer").AppMethodCall<import("./composer").AppMethodCallParams>)[] | undefined;
905
+ }> | import("./composer").AppMethodCall<import("./composer").AppMethodCallParams> | undefined)[] | undefined;
906
906
  } & SendParams) => Promise<SendAppUpdateTransactionResult>;
907
907
  /**
908
908
  * Delete a smart contract via an ABI method.
@@ -1023,7 +1023,7 @@ export declare class AlgorandClientTransactionSender {
1023
1023
  boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1024
1024
  approvalProgram: string | Uint8Array;
1025
1025
  clearStateProgram: string | Uint8Array;
1026
- }> | import("./composer").AppMethodCall<import("./composer").AppMethodCallParams>)[] | undefined;
1026
+ }> | import("./composer").AppMethodCall<import("./composer").AppMethodCallParams> | undefined)[] | undefined;
1027
1027
  } & SendParams) => Promise<SendAppTransactionResult>;
1028
1028
  /**
1029
1029
  * Call a smart contract via an ABI method.
@@ -1144,7 +1144,7 @@ export declare class AlgorandClientTransactionSender {
1144
1144
  boxReferences?: (import("./app-manager").BoxIdentifier | import("./app-manager").BoxReference)[] | undefined;
1145
1145
  approvalProgram: string | Uint8Array;
1146
1146
  clearStateProgram: string | Uint8Array;
1147
- }> | import("./composer").AppMethodCall<import("./composer").AppMethodCallParams>)[] | undefined;
1147
+ }> | import("./composer").AppMethodCall<import("./composer").AppMethodCallParams> | undefined)[] | undefined;
1148
1148
  } & SendParams) => Promise<SendAppTransactionResult>;
1149
1149
  /** Register an online key. */
1150
1150
  onlineKeyRegistration: (params: import("./composer").CommonTransactionParams & {
@@ -1155,4 +1155,8 @@ export declare class AlgorandClientTransactionSender {
1155
1155
  voteKeyDilution: bigint;
1156
1156
  stateProofKey?: Uint8Array | undefined;
1157
1157
  } & SendParams) => Promise<SendSingleTransactionResult>;
1158
+ /** Register an offline key. */
1159
+ offlineKeyRegistration: (params: import("./composer").CommonTransactionParams & {
1160
+ preventAccountFromEverParticipatingAgain?: boolean | undefined;
1161
+ } & SendParams) => Promise<SendSingleTransactionResult>;
1158
1162
  }
@@ -6,13 +6,13 @@ var config = require('../config.js');
6
6
  var types_appManager = require('./app-manager.js');
7
7
 
8
8
  const getMethodCallForLog = ({ method, args }) => {
9
- return `${method.name}(${(args ?? []).map((a) => (typeof a === 'object' ? JSON.stringify(a, (_, v) => (typeof v === 'bigint' ? Number(v) : v)) : a))})`;
9
+ return `${method.name}(${(args ?? []).map((a) => (typeof a === 'object' ? JSON.stringify(a, (_, v) => (typeof v === 'bigint' ? Number(v) : v instanceof Uint8Array ? buffer.Buffer.from(v).toString('base64') : v)) : a))})`;
10
10
  };
11
11
  /** Orchestrates sending transactions for `AlgorandClient`. */
12
12
  class AlgorandClientTransactionSender {
13
13
  /**
14
14
  * Creates a new `AlgorandClientSender`
15
- * @param newGroup A lambda that starts a new `AlgoKitComposer` transaction group
15
+ * @param newGroup A lambda that starts a new `TransactionComposer` transaction group
16
16
  * @param assetManager An `AssetManager` instance
17
17
  */
18
18
  constructor(newGroup, assetManager, appManager) {
@@ -792,6 +792,10 @@ class AlgorandClientTransactionSender {
792
792
  this.onlineKeyRegistration = this._send((c) => c.addOnlineKeyRegistration, {
793
793
  preLog: (params, transaction) => `Registering online key for ${params.sender} via transaction ${transaction.txID()}`,
794
794
  });
795
+ /** Register an offline key. */
796
+ this.offlineKeyRegistration = this._send((c) => c.addOfflineKeyRegistration, {
797
+ preLog: (params, transaction) => `Registering offline key for ${params.sender} via transaction ${transaction.txID()}`,
798
+ });
795
799
  this._newGroup = newGroup;
796
800
  this._assetManager = assetManager;
797
801
  this._appManager = appManager;