{"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   * @example\n   * ```typescript\n   * const transactionCreator = new AlgorandClientTransactionCreator(() => new TransactionComposer())\n   * ```\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   * await algorand.createTransaction.payment({\n   *   sender: 'SENDERADDRESS',\n   *   receiver: 'RECEIVERADDRESS',\n   *   amount: (4).algo(),\n   * })\n   * ```\n   * @example Advanced example\n   * ```typescript\n   * await algorand.createTransaction.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   * @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 (without creator, will be retrieved from algod)\n   * ```typescript\n   * await algorand.createTransaction.assetOptOut({ sender: \"SENDERADDRESS\", assetId: 123456n, ensureZeroBalance: true })\n   * ```\n   * @example Basic example (with creator)\n   * ```typescript\n   * await algorand.createTransaction.assetOptOut({ sender: \"SENDERADDRESS\", creator: \"CREATORADDRESS\", assetId: 123456n, ensureZeroBalance: true })\n   * ```\n   * @example Advanced example\n   * ```typescript\n   * await algorand.createTransaction.assetOptOut({\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   * await algorand.createTransaction.appCreate({ sender: 'CREATORADDRESS', approvalProgram: 'TEALCODE', clearStateProgram: 'TEALCODE' })\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   *  accessReferences: [{ appId: 1234n }]\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   *  rejectVersion: 1,\n   *})\n   * ```\n   * @returns The application create transaction\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   *  accessReferences: [{ appId: 1234n }]\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   *  rejectVersion: 1,\n   *})\n   * ```\n   * @returns The application update transaction\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   *  accessReferences: [{ appId: 1234n }]\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   *  rejectVersion: 1,\n   *})\n   * ```\n   * @returns The application delete transaction\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   *  accessReferences: [{ appId: 1234n }]\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   *  rejectVersion: 1,\n   *})\n   * ```\n   * @returns The application call transaction\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   * await algorand.createTransaction.appCreateMethodCall({ 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.appCreateMethodCall({\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   *  accessReferences: [{ appId: 1234n }]\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   *  rejectVersion: 1,\n   *})\n   * ```\n   * @returns The application ABI method create transaction\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   *  accessReferences: [{ appId: 1234n }]\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   *  rejectVersion: 1,\n   *})\n   * ```\n   * @returns The application ABI method update transaction\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   *  accessReferences: [{ appId: 1234n }]\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   *  rejectVersion: 1,\n   *})\n   * ```\n   * @returns The application ABI method delete transaction\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   *  accessReferences: [{ appId: 1234n }]\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   *  rejectVersion: 1,\n   *})\n   * ```\n   * @returns The application ABI method call transaction\n   */\n  appCallMethodCall = this._transactions((c) => c.addAppCallMethodCall)\n  /**\n   * Create an online key registration transaction.\n   * @param params The parameters for the key registration transaction\n   * @example Basic example\n   * ```typescript\n   * await algorand.createTransaction.onlineKeyRegistration({\n   *   sender: 'SENDERADDRESS',\n   *   voteKey: Uint8Array.from(Buffer.from(\"voteKeyBase64\", 'base64')),\n   *   selectionKey: Uint8Array.from(Buffer.from(\"selectionKeyBase64\", 'base64')),\n   *   stateProofKey: Uint8Array.from(Buffer.from(\"stateProofKeyBase64\", 'base64')),\n   *   voteFirst: 1n,\n   *   voteLast: 1000n,\n   *   voteKeyDilution: 1n,\n   * })\n   * ```\n   * @example Advanced example\n   * ```typescript\n   * await algorand.createTransaction.onlineKeyRegistration({\n   *   sender: 'SENDERADDRESS',\n   *   voteKey: Uint8Array.from(Buffer.from(\"voteKeyBase64\", 'base64')),\n   *   selectionKey: Uint8Array.from(Buffer.from(\"selectionKeyBase64\", 'base64')),\n   *   stateProofKey: Uint8Array.from(Buffer.from(\"stateProofKeyBase64\", 'base64')),\n   *   voteFirst: 1n,\n   *   voteLast: 1000n,\n   *   voteKeyDilution: 1n,\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   * @returns The online key registration transaction\n   */\n  onlineKeyRegistration = this._transaction((c) => c.addOnlineKeyRegistration)\n  /**\n   * Create an offline key registration transaction.\n   * @param params The parameters for the key registration transaction\n   * @example Basic example\n   * ```typescript\n   * await algorand.createTransaction.offlineKeyRegistration({\n   *   sender: 'SENDERADDRESS',\n   * })\n   * ```\n   * @example Advanced example\n   * ```typescript\n   * await algorand.createTransaction.offlineKeyRegistration({\n   *   sender: 'SENDERADDRESS',\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   * @returns The offline key registration transaction\n   */\n  offlineKeyRegistration = this._transaction((c) => c.addOfflineKeyRegistration)\n}\n"],"names":[],"mappings":"AAMA;MACa,gCAAgC,CAAA;AAG3C;;;;;;;AAOG;AACH,IAAA,WAAA,CAAY,QAAmC,EAAA;AAqB/C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiCG;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;;;;;;;;;;;;;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