@algorandfoundation/algokit-utils 10.0.0-alpha.10 → 10.0.0-alpha.12

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 (41) hide show
  1. package/package.json +1 -1
  2. package/packages/abi/src/abi-type.js +2 -1
  3. package/packages/abi/src/abi-type.js.map +1 -1
  4. package/packages/abi/src/abi-type.mjs +2 -1
  5. package/packages/abi/src/abi-type.mjs.map +1 -1
  6. package/packages/algod_client/src/models/block.d.ts +17 -17
  7. package/packages/algod_client/src/models/block.js +18 -18
  8. package/packages/algod_client/src/models/block.js.map +1 -1
  9. package/packages/algod_client/src/models/block.mjs +18 -18
  10. package/packages/algod_client/src/models/block.mjs.map +1 -1
  11. package/packages/common/src/json.mjs +2 -2
  12. package/packages/common/src/json.mjs.map +1 -1
  13. package/packages/indexer_client/src/models/block.d.ts +5 -5
  14. package/packages/indexer_client/src/models/block.js +5 -5
  15. package/packages/indexer_client/src/models/block.js.map +1 -1
  16. package/packages/indexer_client/src/models/block.mjs +5 -5
  17. package/packages/indexer_client/src/models/block.mjs.map +1 -1
  18. package/packages/indexer_client/src/models/participation-updates.d.ts +2 -2
  19. package/packages/indexer_client/src/models/participation-updates.js +2 -2
  20. package/packages/indexer_client/src/models/participation-updates.js.map +1 -1
  21. package/packages/indexer_client/src/models/participation-updates.mjs +2 -2
  22. package/packages/indexer_client/src/models/participation-updates.mjs.map +1 -1
  23. package/packages/sdk/src/utils/utils.mjs +2 -2
  24. package/packages/sdk/src/utils/utils.mjs.map +1 -1
  25. package/testing/account.js +2 -5
  26. package/testing/account.js.map +1 -1
  27. package/testing/account.mjs +2 -5
  28. package/testing/account.mjs.map +1 -1
  29. package/transactions/method-call.js +66 -74
  30. package/transactions/method-call.js.map +1 -1
  31. package/transactions/method-call.mjs +66 -74
  32. package/transactions/method-call.mjs.map +1 -1
  33. package/types/account-manager.d.ts +1 -1
  34. package/types/account-manager.js +1 -1
  35. package/types/account-manager.js.map +1 -1
  36. package/types/account-manager.mjs +1 -1
  37. package/types/account-manager.mjs.map +1 -1
  38. package/types/algorand-client-transaction-creator.d.ts +42 -42
  39. package/types/algorand-client-transaction-sender.d.ts +44 -44
  40. package/types/app-client.d.ts +108 -108
  41. package/types/app-factory.d.ts +45 -45
@@ -1 +1 @@
1
- {"version":3,"file":"block.js","names":["BlockMeta: ObjectModelMetadata<Block>","addressCodec","numberCodec","fixedBytes32Codec","stringCodec","fixedBytes64Codec","ObjectModelCodec","BlockRewardsMeta","bigIntCodec","ArrayCodec","StateProofTrackingMeta","TransactionMeta","BlockUpgradeStateMeta","BlockUpgradeVoteMeta","ParticipationUpdatesMeta"],"sources":["../../../../../packages/indexer_client/src/models/block.ts"],"sourcesContent":["import type { Address, ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport {\n stringCodec,\n numberCodec,\n bigIntCodec,\n addressCodec,\n ArrayCodec,\n ObjectModelCodec,\n fixedBytes32Codec,\n fixedBytes64Codec,\n} from '@algorandfoundation/algokit-common'\nimport type { BlockRewards } from './block-rewards'\nimport { BlockRewardsMeta } from './block-rewards'\nimport type { BlockUpgradeState } from './block-upgrade-state'\nimport { BlockUpgradeStateMeta } from './block-upgrade-state'\nimport type { BlockUpgradeVote } from './block-upgrade-vote'\nimport { BlockUpgradeVoteMeta } from './block-upgrade-vote'\nimport type { ParticipationUpdates } from './participation-updates'\nimport { ParticipationUpdatesMeta } from './participation-updates'\nimport type { StateProofTracking } from './state-proof-tracking'\nimport { StateProofTrackingMeta } from './state-proof-tracking'\nimport type { Transaction } from './transaction'\nimport { TransactionMeta } from './transaction'\n\n/**\n * Block information.\n *\n * Definition:\n * data/bookkeeping/block.go : Block\n */\nexport type Block = {\n /**\n * the proposer of this block.\n */\n proposer?: Address\n\n /**\n * the sum of all fees paid by transactions in this block.\n */\n feesCollected?: number\n\n /**\n * the potential bonus payout for this block.\n */\n bonus?: number\n\n /**\n * the actual amount transferred to the proposer from the fee sink.\n */\n proposerPayout?: number\n\n /**\n * \\[gh\\] hash to which this block belongs.\n */\n genesisHash: Uint8Array\n\n /**\n * \\[gen\\] ID to which this block belongs.\n */\n genesisId: string\n\n /**\n * \\[prev\\] Previous block hash.\n */\n previousBlockHash: Uint8Array\n\n /**\n * \\[prev512\\] Previous block hash, using SHA-512.\n */\n previousBlockHash512?: Uint8Array\n rewards?: BlockRewards\n\n /**\n * \\[rnd\\] Current round on which this block was appended to the chain.\n */\n round: bigint\n\n /**\n * \\[seed\\] Sortition seed.\n */\n seed: Uint8Array\n\n /**\n * Tracks the status of state proofs.\n */\n stateProofTracking?: StateProofTracking[]\n\n /**\n * \\[ts\\] Block creation timestamp in seconds since epoch\n */\n timestamp: number\n\n /**\n * \\[txns\\] list of transactions corresponding to a given round.\n */\n transactions?: Transaction[]\n\n /**\n * \\[txn\\] TransactionsRoot authenticates the set of transactions appearing in the block. More specifically, it's the root of a merkle tree whose leaves are the block's Txids, in lexicographic order. For the empty block, it's 0. Note that the TxnRoot does not authenticate the signatures on the transactions, only the transactions themselves. Two blocks with the same transactions but in a different order and with different signatures will have the same TxnRoot.\n */\n transactionsRoot: Uint8Array\n\n /**\n * \\[txn256\\] TransactionsRootSHA256 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA256 hash function instead of the default SHA512_256. This commitment can be used on environments where only the SHA256 function exists.\n */\n transactionsRootSha256: Uint8Array\n\n /**\n * \\[txn512\\] TransactionsRootSHA512 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA512 hash function instead of the default SHA512_256.\n */\n transactionsRootSha512?: Uint8Array\n\n /**\n * \\[tc\\] TxnCounter counts the number of transactions committed in the ledger, from the time at which support for this feature was introduced.\n *\n * Specifically, TxnCounter is the number of the next transaction that will be committed after this block. It is 0 when no transactions have ever been committed (since TxnCounter started being supported).\n */\n txnCounter?: number\n upgradeState?: BlockUpgradeState\n upgradeVote?: BlockUpgradeVote\n participationUpdates?: ParticipationUpdates\n}\n\nexport const BlockMeta: ObjectModelMetadata<Block> = {\n name: 'Block',\n kind: 'object',\n fields: [\n {\n name: 'proposer',\n wireKey: 'proposer',\n optional: true,\n codec: addressCodec,\n },\n {\n name: 'feesCollected',\n wireKey: 'fees-collected',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'bonus',\n wireKey: 'bonus',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'proposerPayout',\n wireKey: 'proposer-payout',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'genesisHash',\n wireKey: 'genesis-hash',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'genesisId',\n wireKey: 'genesis-id',\n optional: false,\n codec: stringCodec,\n },\n {\n name: 'previousBlockHash',\n wireKey: 'previous-block-hash',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'previousBlockHash512',\n wireKey: 'previous-block-hash-512',\n optional: true,\n codec: fixedBytes64Codec,\n },\n {\n name: 'rewards',\n wireKey: 'rewards',\n optional: true,\n codec: new ObjectModelCodec(BlockRewardsMeta),\n },\n {\n name: 'round',\n wireKey: 'round',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'seed',\n wireKey: 'seed',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'stateProofTracking',\n wireKey: 'state-proof-tracking',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(StateProofTrackingMeta)),\n },\n {\n name: 'timestamp',\n wireKey: 'timestamp',\n optional: false,\n codec: numberCodec,\n },\n {\n name: 'transactions',\n wireKey: 'transactions',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(TransactionMeta)),\n },\n {\n name: 'transactionsRoot',\n wireKey: 'transactions-root',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'transactionsRootSha256',\n wireKey: 'transactions-root-sha256',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'transactionsRootSha512',\n wireKey: 'transactions-root-sha512',\n optional: true,\n codec: fixedBytes64Codec,\n },\n {\n name: 'txnCounter',\n wireKey: 'txn-counter',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'upgradeState',\n wireKey: 'upgrade-state',\n optional: true,\n codec: new ObjectModelCodec(BlockUpgradeStateMeta),\n },\n {\n name: 'upgradeVote',\n wireKey: 'upgrade-vote',\n optional: true,\n codec: new ObjectModelCodec(BlockUpgradeVoteMeta),\n },\n {\n name: 'participationUpdates',\n wireKey: 'participation-updates',\n optional: true,\n codec: new ObjectModelCodec(ParticipationUpdatesMeta),\n },\n ],\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2HA,MAAaA,YAAwC;CACnD,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOA;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOA;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOD;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOE;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIC,sCAAiBC,uCAAiB;GAC9C;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOL;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIM,yBAAW,IAAIH,sCAAiBI,oDAAuB,CAAC;GACpE;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOR;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIO,yBAAW,IAAIH,sCAAiBK,oCAAgB,CAAC;GAC7D;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOR;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOA;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOE;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOH;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAII,sCAAiBM,kDAAsB;GACnD;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIN,sCAAiBO,gDAAqB;GAClD;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIP,sCAAiBQ,uDAAyB;GACtD;EACF;CACF"}
1
+ {"version":3,"file":"block.js","names":["BlockMeta: ObjectModelMetadata<Block>","addressCodec","numberCodec","fixedBytes32Codec","stringCodec","fixedBytes64Codec","ObjectModelCodec","BlockRewardsMeta","bigIntCodec","ArrayCodec","StateProofTrackingMeta","TransactionMeta","BlockUpgradeStateMeta","BlockUpgradeVoteMeta","ParticipationUpdatesMeta"],"sources":["../../../../../packages/indexer_client/src/models/block.ts"],"sourcesContent":["import type { Address, ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport {\n stringCodec,\n numberCodec,\n bigIntCodec,\n addressCodec,\n ArrayCodec,\n ObjectModelCodec,\n fixedBytes32Codec,\n fixedBytes64Codec,\n} from '@algorandfoundation/algokit-common'\nimport type { BlockRewards } from './block-rewards'\nimport { BlockRewardsMeta } from './block-rewards'\nimport type { BlockUpgradeState } from './block-upgrade-state'\nimport { BlockUpgradeStateMeta } from './block-upgrade-state'\nimport type { BlockUpgradeVote } from './block-upgrade-vote'\nimport { BlockUpgradeVoteMeta } from './block-upgrade-vote'\nimport type { ParticipationUpdates } from './participation-updates'\nimport { ParticipationUpdatesMeta } from './participation-updates'\nimport type { StateProofTracking } from './state-proof-tracking'\nimport { StateProofTrackingMeta } from './state-proof-tracking'\nimport type { Transaction } from './transaction'\nimport { TransactionMeta } from './transaction'\n\n/**\n * Block information.\n *\n * Definition:\n * data/bookkeeping/block.go : Block\n */\nexport type Block = {\n /**\n * the proposer of this block.\n */\n proposer?: Address\n\n /**\n * the sum of all fees paid by transactions in this block.\n */\n feesCollected?: number\n\n /**\n * the potential bonus payout for this block.\n */\n bonus?: number\n\n /**\n * the actual amount transferred to the proposer from the fee sink.\n */\n proposerPayout?: number\n\n /**\n * \\[gh\\] hash to which this block belongs.\n */\n genesisHash: Uint8Array\n\n /**\n * \\[gen\\] ID to which this block belongs.\n */\n genesisId: string\n\n /**\n * \\[prev\\] Previous block hash.\n */\n previousBlockHash: Uint8Array\n\n /**\n * \\[prev512\\] Previous block hash, using SHA-512.\n */\n previousBlockHash512?: Uint8Array\n rewards: BlockRewards\n\n /**\n * \\[rnd\\] Current round on which this block was appended to the chain.\n */\n round: bigint\n\n /**\n * \\[seed\\] Sortition seed.\n */\n seed: Uint8Array\n\n /**\n * Tracks the status of state proofs.\n */\n stateProofTracking?: StateProofTracking[]\n\n /**\n * \\[ts\\] Block creation timestamp in seconds since epoch\n */\n timestamp: number\n\n /**\n * \\[txns\\] list of transactions corresponding to a given round.\n */\n transactions: Transaction[]\n\n /**\n * \\[txn\\] TransactionsRoot authenticates the set of transactions appearing in the block. More specifically, it's the root of a merkle tree whose leaves are the block's Txids, in lexicographic order. For the empty block, it's 0. Note that the TxnRoot does not authenticate the signatures on the transactions, only the transactions themselves. Two blocks with the same transactions but in a different order and with different signatures will have the same TxnRoot.\n */\n transactionsRoot: Uint8Array\n\n /**\n * \\[txn256\\] TransactionsRootSHA256 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA256 hash function instead of the default SHA512_256. This commitment can be used on environments where only the SHA256 function exists.\n */\n transactionsRootSha256?: Uint8Array\n\n /**\n * \\[txn512\\] TransactionsRootSHA512 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA512 hash function instead of the default SHA512_256.\n */\n transactionsRootSha512?: Uint8Array\n\n /**\n * \\[tc\\] TxnCounter counts the number of transactions committed in the ledger, from the time at which support for this feature was introduced.\n *\n * Specifically, TxnCounter is the number of the next transaction that will be committed after this block. It is 0 when no transactions have ever been committed (since TxnCounter started being supported).\n */\n txnCounter?: number\n upgradeState: BlockUpgradeState\n upgradeVote?: BlockUpgradeVote\n participationUpdates: ParticipationUpdates\n}\n\nexport const BlockMeta: ObjectModelMetadata<Block> = {\n name: 'Block',\n kind: 'object',\n fields: [\n {\n name: 'proposer',\n wireKey: 'proposer',\n optional: true,\n codec: addressCodec,\n },\n {\n name: 'feesCollected',\n wireKey: 'fees-collected',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'bonus',\n wireKey: 'bonus',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'proposerPayout',\n wireKey: 'proposer-payout',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'genesisHash',\n wireKey: 'genesis-hash',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'genesisId',\n wireKey: 'genesis-id',\n optional: false,\n codec: stringCodec,\n },\n {\n name: 'previousBlockHash',\n wireKey: 'previous-block-hash',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'previousBlockHash512',\n wireKey: 'previous-block-hash-512',\n optional: true,\n codec: fixedBytes64Codec,\n },\n {\n name: 'rewards',\n wireKey: 'rewards',\n optional: false,\n codec: new ObjectModelCodec(BlockRewardsMeta),\n },\n {\n name: 'round',\n wireKey: 'round',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'seed',\n wireKey: 'seed',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'stateProofTracking',\n wireKey: 'state-proof-tracking',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(StateProofTrackingMeta)),\n },\n {\n name: 'timestamp',\n wireKey: 'timestamp',\n optional: false,\n codec: numberCodec,\n },\n {\n name: 'transactions',\n wireKey: 'transactions',\n optional: false,\n codec: new ArrayCodec(new ObjectModelCodec(TransactionMeta)),\n },\n {\n name: 'transactionsRoot',\n wireKey: 'transactions-root',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'transactionsRootSha256',\n wireKey: 'transactions-root-sha256',\n optional: true,\n codec: fixedBytes32Codec,\n },\n {\n name: 'transactionsRootSha512',\n wireKey: 'transactions-root-sha512',\n optional: true,\n codec: fixedBytes64Codec,\n },\n {\n name: 'txnCounter',\n wireKey: 'txn-counter',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'upgradeState',\n wireKey: 'upgrade-state',\n optional: false,\n codec: new ObjectModelCodec(BlockUpgradeStateMeta),\n },\n {\n name: 'upgradeVote',\n wireKey: 'upgrade-vote',\n optional: true,\n codec: new ObjectModelCodec(BlockUpgradeVoteMeta),\n },\n {\n name: 'participationUpdates',\n wireKey: 'participation-updates',\n optional: false,\n codec: new ObjectModelCodec(ParticipationUpdatesMeta),\n },\n ],\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2HA,MAAaA,YAAwC;CACnD,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOA;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOA;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOD;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOE;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIC,sCAAiBC,uCAAiB;GAC9C;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOL;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIM,yBAAW,IAAIH,sCAAiBI,oDAAuB,CAAC;GACpE;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOR;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIO,yBAAW,IAAIH,sCAAiBK,oCAAgB,CAAC;GAC7D;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOR;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOA;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOE;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOH;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAII,sCAAiBM,kDAAsB;GACnD;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIN,sCAAiBO,gDAAqB;GAClD;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIP,sCAAiBQ,uDAAyB;GACtD;EACF;CACF"}
@@ -68,7 +68,7 @@ const BlockMeta = {
68
68
  {
69
69
  name: "rewards",
70
70
  wireKey: "rewards",
71
- optional: true,
71
+ optional: false,
72
72
  codec: new ObjectModelCodec(BlockRewardsMeta)
73
73
  },
74
74
  {
@@ -98,7 +98,7 @@ const BlockMeta = {
98
98
  {
99
99
  name: "transactions",
100
100
  wireKey: "transactions",
101
- optional: true,
101
+ optional: false,
102
102
  codec: new ArrayCodec(new ObjectModelCodec(TransactionMeta))
103
103
  },
104
104
  {
@@ -110,7 +110,7 @@ const BlockMeta = {
110
110
  {
111
111
  name: "transactionsRootSha256",
112
112
  wireKey: "transactions-root-sha256",
113
- optional: false,
113
+ optional: true,
114
114
  codec: fixedBytes32Codec
115
115
  },
116
116
  {
@@ -128,7 +128,7 @@ const BlockMeta = {
128
128
  {
129
129
  name: "upgradeState",
130
130
  wireKey: "upgrade-state",
131
- optional: true,
131
+ optional: false,
132
132
  codec: new ObjectModelCodec(BlockUpgradeStateMeta)
133
133
  },
134
134
  {
@@ -140,7 +140,7 @@ const BlockMeta = {
140
140
  {
141
141
  name: "participationUpdates",
142
142
  wireKey: "participation-updates",
143
- optional: true,
143
+ optional: false,
144
144
  codec: new ObjectModelCodec(ParticipationUpdatesMeta)
145
145
  }
146
146
  ]
@@ -1 +1 @@
1
- {"version":3,"file":"block.mjs","names":["BlockMeta: ObjectModelMetadata<Block>"],"sources":["../../../../../packages/indexer_client/src/models/block.ts"],"sourcesContent":["import type { Address, ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport {\n stringCodec,\n numberCodec,\n bigIntCodec,\n addressCodec,\n ArrayCodec,\n ObjectModelCodec,\n fixedBytes32Codec,\n fixedBytes64Codec,\n} from '@algorandfoundation/algokit-common'\nimport type { BlockRewards } from './block-rewards'\nimport { BlockRewardsMeta } from './block-rewards'\nimport type { BlockUpgradeState } from './block-upgrade-state'\nimport { BlockUpgradeStateMeta } from './block-upgrade-state'\nimport type { BlockUpgradeVote } from './block-upgrade-vote'\nimport { BlockUpgradeVoteMeta } from './block-upgrade-vote'\nimport type { ParticipationUpdates } from './participation-updates'\nimport { ParticipationUpdatesMeta } from './participation-updates'\nimport type { StateProofTracking } from './state-proof-tracking'\nimport { StateProofTrackingMeta } from './state-proof-tracking'\nimport type { Transaction } from './transaction'\nimport { TransactionMeta } from './transaction'\n\n/**\n * Block information.\n *\n * Definition:\n * data/bookkeeping/block.go : Block\n */\nexport type Block = {\n /**\n * the proposer of this block.\n */\n proposer?: Address\n\n /**\n * the sum of all fees paid by transactions in this block.\n */\n feesCollected?: number\n\n /**\n * the potential bonus payout for this block.\n */\n bonus?: number\n\n /**\n * the actual amount transferred to the proposer from the fee sink.\n */\n proposerPayout?: number\n\n /**\n * \\[gh\\] hash to which this block belongs.\n */\n genesisHash: Uint8Array\n\n /**\n * \\[gen\\] ID to which this block belongs.\n */\n genesisId: string\n\n /**\n * \\[prev\\] Previous block hash.\n */\n previousBlockHash: Uint8Array\n\n /**\n * \\[prev512\\] Previous block hash, using SHA-512.\n */\n previousBlockHash512?: Uint8Array\n rewards?: BlockRewards\n\n /**\n * \\[rnd\\] Current round on which this block was appended to the chain.\n */\n round: bigint\n\n /**\n * \\[seed\\] Sortition seed.\n */\n seed: Uint8Array\n\n /**\n * Tracks the status of state proofs.\n */\n stateProofTracking?: StateProofTracking[]\n\n /**\n * \\[ts\\] Block creation timestamp in seconds since epoch\n */\n timestamp: number\n\n /**\n * \\[txns\\] list of transactions corresponding to a given round.\n */\n transactions?: Transaction[]\n\n /**\n * \\[txn\\] TransactionsRoot authenticates the set of transactions appearing in the block. More specifically, it's the root of a merkle tree whose leaves are the block's Txids, in lexicographic order. For the empty block, it's 0. Note that the TxnRoot does not authenticate the signatures on the transactions, only the transactions themselves. Two blocks with the same transactions but in a different order and with different signatures will have the same TxnRoot.\n */\n transactionsRoot: Uint8Array\n\n /**\n * \\[txn256\\] TransactionsRootSHA256 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA256 hash function instead of the default SHA512_256. This commitment can be used on environments where only the SHA256 function exists.\n */\n transactionsRootSha256: Uint8Array\n\n /**\n * \\[txn512\\] TransactionsRootSHA512 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA512 hash function instead of the default SHA512_256.\n */\n transactionsRootSha512?: Uint8Array\n\n /**\n * \\[tc\\] TxnCounter counts the number of transactions committed in the ledger, from the time at which support for this feature was introduced.\n *\n * Specifically, TxnCounter is the number of the next transaction that will be committed after this block. It is 0 when no transactions have ever been committed (since TxnCounter started being supported).\n */\n txnCounter?: number\n upgradeState?: BlockUpgradeState\n upgradeVote?: BlockUpgradeVote\n participationUpdates?: ParticipationUpdates\n}\n\nexport const BlockMeta: ObjectModelMetadata<Block> = {\n name: 'Block',\n kind: 'object',\n fields: [\n {\n name: 'proposer',\n wireKey: 'proposer',\n optional: true,\n codec: addressCodec,\n },\n {\n name: 'feesCollected',\n wireKey: 'fees-collected',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'bonus',\n wireKey: 'bonus',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'proposerPayout',\n wireKey: 'proposer-payout',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'genesisHash',\n wireKey: 'genesis-hash',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'genesisId',\n wireKey: 'genesis-id',\n optional: false,\n codec: stringCodec,\n },\n {\n name: 'previousBlockHash',\n wireKey: 'previous-block-hash',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'previousBlockHash512',\n wireKey: 'previous-block-hash-512',\n optional: true,\n codec: fixedBytes64Codec,\n },\n {\n name: 'rewards',\n wireKey: 'rewards',\n optional: true,\n codec: new ObjectModelCodec(BlockRewardsMeta),\n },\n {\n name: 'round',\n wireKey: 'round',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'seed',\n wireKey: 'seed',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'stateProofTracking',\n wireKey: 'state-proof-tracking',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(StateProofTrackingMeta)),\n },\n {\n name: 'timestamp',\n wireKey: 'timestamp',\n optional: false,\n codec: numberCodec,\n },\n {\n name: 'transactions',\n wireKey: 'transactions',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(TransactionMeta)),\n },\n {\n name: 'transactionsRoot',\n wireKey: 'transactions-root',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'transactionsRootSha256',\n wireKey: 'transactions-root-sha256',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'transactionsRootSha512',\n wireKey: 'transactions-root-sha512',\n optional: true,\n codec: fixedBytes64Codec,\n },\n {\n name: 'txnCounter',\n wireKey: 'txn-counter',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'upgradeState',\n wireKey: 'upgrade-state',\n optional: true,\n codec: new ObjectModelCodec(BlockUpgradeStateMeta),\n },\n {\n name: 'upgradeVote',\n wireKey: 'upgrade-vote',\n optional: true,\n codec: new ObjectModelCodec(BlockUpgradeVoteMeta),\n },\n {\n name: 'participationUpdates',\n wireKey: 'participation-updates',\n optional: true,\n codec: new ObjectModelCodec(ParticipationUpdatesMeta),\n },\n ],\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2HA,MAAaA,YAAwC;CACnD,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,iBAAiB,iBAAiB;GAC9C;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,WAAW,IAAI,iBAAiB,uBAAuB,CAAC;GACpE;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,WAAW,IAAI,iBAAiB,gBAAgB,CAAC;GAC7D;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,iBAAiB,sBAAsB;GACnD;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,iBAAiB,qBAAqB;GAClD;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,iBAAiB,yBAAyB;GACtD;EACF;CACF"}
1
+ {"version":3,"file":"block.mjs","names":["BlockMeta: ObjectModelMetadata<Block>"],"sources":["../../../../../packages/indexer_client/src/models/block.ts"],"sourcesContent":["import type { Address, ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport {\n stringCodec,\n numberCodec,\n bigIntCodec,\n addressCodec,\n ArrayCodec,\n ObjectModelCodec,\n fixedBytes32Codec,\n fixedBytes64Codec,\n} from '@algorandfoundation/algokit-common'\nimport type { BlockRewards } from './block-rewards'\nimport { BlockRewardsMeta } from './block-rewards'\nimport type { BlockUpgradeState } from './block-upgrade-state'\nimport { BlockUpgradeStateMeta } from './block-upgrade-state'\nimport type { BlockUpgradeVote } from './block-upgrade-vote'\nimport { BlockUpgradeVoteMeta } from './block-upgrade-vote'\nimport type { ParticipationUpdates } from './participation-updates'\nimport { ParticipationUpdatesMeta } from './participation-updates'\nimport type { StateProofTracking } from './state-proof-tracking'\nimport { StateProofTrackingMeta } from './state-proof-tracking'\nimport type { Transaction } from './transaction'\nimport { TransactionMeta } from './transaction'\n\n/**\n * Block information.\n *\n * Definition:\n * data/bookkeeping/block.go : Block\n */\nexport type Block = {\n /**\n * the proposer of this block.\n */\n proposer?: Address\n\n /**\n * the sum of all fees paid by transactions in this block.\n */\n feesCollected?: number\n\n /**\n * the potential bonus payout for this block.\n */\n bonus?: number\n\n /**\n * the actual amount transferred to the proposer from the fee sink.\n */\n proposerPayout?: number\n\n /**\n * \\[gh\\] hash to which this block belongs.\n */\n genesisHash: Uint8Array\n\n /**\n * \\[gen\\] ID to which this block belongs.\n */\n genesisId: string\n\n /**\n * \\[prev\\] Previous block hash.\n */\n previousBlockHash: Uint8Array\n\n /**\n * \\[prev512\\] Previous block hash, using SHA-512.\n */\n previousBlockHash512?: Uint8Array\n rewards: BlockRewards\n\n /**\n * \\[rnd\\] Current round on which this block was appended to the chain.\n */\n round: bigint\n\n /**\n * \\[seed\\] Sortition seed.\n */\n seed: Uint8Array\n\n /**\n * Tracks the status of state proofs.\n */\n stateProofTracking?: StateProofTracking[]\n\n /**\n * \\[ts\\] Block creation timestamp in seconds since epoch\n */\n timestamp: number\n\n /**\n * \\[txns\\] list of transactions corresponding to a given round.\n */\n transactions: Transaction[]\n\n /**\n * \\[txn\\] TransactionsRoot authenticates the set of transactions appearing in the block. More specifically, it's the root of a merkle tree whose leaves are the block's Txids, in lexicographic order. For the empty block, it's 0. Note that the TxnRoot does not authenticate the signatures on the transactions, only the transactions themselves. Two blocks with the same transactions but in a different order and with different signatures will have the same TxnRoot.\n */\n transactionsRoot: Uint8Array\n\n /**\n * \\[txn256\\] TransactionsRootSHA256 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA256 hash function instead of the default SHA512_256. This commitment can be used on environments where only the SHA256 function exists.\n */\n transactionsRootSha256?: Uint8Array\n\n /**\n * \\[txn512\\] TransactionsRootSHA512 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA512 hash function instead of the default SHA512_256.\n */\n transactionsRootSha512?: Uint8Array\n\n /**\n * \\[tc\\] TxnCounter counts the number of transactions committed in the ledger, from the time at which support for this feature was introduced.\n *\n * Specifically, TxnCounter is the number of the next transaction that will be committed after this block. It is 0 when no transactions have ever been committed (since TxnCounter started being supported).\n */\n txnCounter?: number\n upgradeState: BlockUpgradeState\n upgradeVote?: BlockUpgradeVote\n participationUpdates: ParticipationUpdates\n}\n\nexport const BlockMeta: ObjectModelMetadata<Block> = {\n name: 'Block',\n kind: 'object',\n fields: [\n {\n name: 'proposer',\n wireKey: 'proposer',\n optional: true,\n codec: addressCodec,\n },\n {\n name: 'feesCollected',\n wireKey: 'fees-collected',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'bonus',\n wireKey: 'bonus',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'proposerPayout',\n wireKey: 'proposer-payout',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'genesisHash',\n wireKey: 'genesis-hash',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'genesisId',\n wireKey: 'genesis-id',\n optional: false,\n codec: stringCodec,\n },\n {\n name: 'previousBlockHash',\n wireKey: 'previous-block-hash',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'previousBlockHash512',\n wireKey: 'previous-block-hash-512',\n optional: true,\n codec: fixedBytes64Codec,\n },\n {\n name: 'rewards',\n wireKey: 'rewards',\n optional: false,\n codec: new ObjectModelCodec(BlockRewardsMeta),\n },\n {\n name: 'round',\n wireKey: 'round',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'seed',\n wireKey: 'seed',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'stateProofTracking',\n wireKey: 'state-proof-tracking',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(StateProofTrackingMeta)),\n },\n {\n name: 'timestamp',\n wireKey: 'timestamp',\n optional: false,\n codec: numberCodec,\n },\n {\n name: 'transactions',\n wireKey: 'transactions',\n optional: false,\n codec: new ArrayCodec(new ObjectModelCodec(TransactionMeta)),\n },\n {\n name: 'transactionsRoot',\n wireKey: 'transactions-root',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'transactionsRootSha256',\n wireKey: 'transactions-root-sha256',\n optional: true,\n codec: fixedBytes32Codec,\n },\n {\n name: 'transactionsRootSha512',\n wireKey: 'transactions-root-sha512',\n optional: true,\n codec: fixedBytes64Codec,\n },\n {\n name: 'txnCounter',\n wireKey: 'txn-counter',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'upgradeState',\n wireKey: 'upgrade-state',\n optional: false,\n codec: new ObjectModelCodec(BlockUpgradeStateMeta),\n },\n {\n name: 'upgradeVote',\n wireKey: 'upgrade-vote',\n optional: true,\n codec: new ObjectModelCodec(BlockUpgradeVoteMeta),\n },\n {\n name: 'participationUpdates',\n wireKey: 'participation-updates',\n optional: false,\n codec: new ObjectModelCodec(ParticipationUpdatesMeta),\n },\n ],\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2HA,MAAaA,YAAwC;CACnD,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,iBAAiB,iBAAiB;GAC9C;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,WAAW,IAAI,iBAAiB,uBAAuB,CAAC;GACpE;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,WAAW,IAAI,iBAAiB,gBAAgB,CAAC;GAC7D;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,iBAAiB,sBAAsB;GACnD;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,iBAAiB,qBAAqB;GAClD;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,iBAAiB,yBAAyB;GACtD;EACF;CACF"}
@@ -6,11 +6,11 @@ type ParticipationUpdates = {
6
6
  /**
7
7
  * \[partupdrmv\] a list of online accounts that needs to be converted to offline since their participation key expired.
8
8
  */
9
- expiredParticipationAccounts?: string[];
9
+ expiredParticipationAccounts: string[];
10
10
  /**
11
11
  * \[partupabs\] a list of online accounts that need to be suspended.
12
12
  */
13
- absentParticipationAccounts?: string[];
13
+ absentParticipationAccounts: string[];
14
14
  };
15
15
  //#endregion
16
16
  export { ParticipationUpdates };
@@ -7,12 +7,12 @@ const ParticipationUpdatesMeta = {
7
7
  fields: [{
8
8
  name: "expiredParticipationAccounts",
9
9
  wireKey: "expired-participation-accounts",
10
- optional: true,
10
+ optional: false,
11
11
  codec: require_array.stringArrayCodec
12
12
  }, {
13
13
  name: "absentParticipationAccounts",
14
14
  wireKey: "absent-participation-accounts",
15
- optional: true,
15
+ optional: false,
16
16
  codec: require_array.stringArrayCodec
17
17
  }]
18
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"participation-updates.js","names":["ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates>","stringArrayCodec"],"sources":["../../../../../packages/indexer_client/src/models/participation-updates.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { stringArrayCodec } from '@algorandfoundation/algokit-common'\n\n/**\n * Participation account data that needs to be checked/acted on by the network.\n */\nexport type ParticipationUpdates = {\n /**\n * \\[partupdrmv\\] a list of online accounts that needs to be converted to offline since their participation key expired.\n */\n expiredParticipationAccounts?: string[]\n\n /**\n * \\[partupabs\\] a list of online accounts that need to be suspended.\n */\n absentParticipationAccounts?: string[]\n}\n\nexport const ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates> = {\n name: 'ParticipationUpdates',\n kind: 'object',\n fields: [\n {\n name: 'expiredParticipationAccounts',\n wireKey: 'expired-participation-accounts',\n optional: true,\n codec: stringArrayCodec,\n },\n {\n name: 'absentParticipationAccounts',\n wireKey: 'absent-participation-accounts',\n optional: true,\n codec: stringArrayCodec,\n },\n ],\n}\n"],"mappings":";;;AAkBA,MAAaA,2BAAsE;CACjF,MAAM;CACN,MAAM;CACN,QAAQ,CACN;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAOC;EACR,EACD;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAOA;EACR,CACF;CACF"}
1
+ {"version":3,"file":"participation-updates.js","names":["ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates>","stringArrayCodec"],"sources":["../../../../../packages/indexer_client/src/models/participation-updates.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { stringArrayCodec } from '@algorandfoundation/algokit-common'\n\n/**\n * Participation account data that needs to be checked/acted on by the network.\n */\nexport type ParticipationUpdates = {\n /**\n * \\[partupdrmv\\] a list of online accounts that needs to be converted to offline since their participation key expired.\n */\n expiredParticipationAccounts: string[]\n\n /**\n * \\[partupabs\\] a list of online accounts that need to be suspended.\n */\n absentParticipationAccounts: string[]\n}\n\nexport const ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates> = {\n name: 'ParticipationUpdates',\n kind: 'object',\n fields: [\n {\n name: 'expiredParticipationAccounts',\n wireKey: 'expired-participation-accounts',\n optional: false,\n codec: stringArrayCodec,\n },\n {\n name: 'absentParticipationAccounts',\n wireKey: 'absent-participation-accounts',\n optional: false,\n codec: stringArrayCodec,\n },\n ],\n}\n"],"mappings":";;;AAkBA,MAAaA,2BAAsE;CACjF,MAAM;CACN,MAAM;CACN,QAAQ,CACN;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAOC;EACR,EACD;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAOA;EACR,CACF;CACF"}
@@ -7,12 +7,12 @@ const ParticipationUpdatesMeta = {
7
7
  fields: [{
8
8
  name: "expiredParticipationAccounts",
9
9
  wireKey: "expired-participation-accounts",
10
- optional: true,
10
+ optional: false,
11
11
  codec: stringArrayCodec
12
12
  }, {
13
13
  name: "absentParticipationAccounts",
14
14
  wireKey: "absent-participation-accounts",
15
- optional: true,
15
+ optional: false,
16
16
  codec: stringArrayCodec
17
17
  }]
18
18
  };
@@ -1 +1 @@
1
- {"version":3,"file":"participation-updates.mjs","names":["ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates>"],"sources":["../../../../../packages/indexer_client/src/models/participation-updates.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { stringArrayCodec } from '@algorandfoundation/algokit-common'\n\n/**\n * Participation account data that needs to be checked/acted on by the network.\n */\nexport type ParticipationUpdates = {\n /**\n * \\[partupdrmv\\] a list of online accounts that needs to be converted to offline since their participation key expired.\n */\n expiredParticipationAccounts?: string[]\n\n /**\n * \\[partupabs\\] a list of online accounts that need to be suspended.\n */\n absentParticipationAccounts?: string[]\n}\n\nexport const ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates> = {\n name: 'ParticipationUpdates',\n kind: 'object',\n fields: [\n {\n name: 'expiredParticipationAccounts',\n wireKey: 'expired-participation-accounts',\n optional: true,\n codec: stringArrayCodec,\n },\n {\n name: 'absentParticipationAccounts',\n wireKey: 'absent-participation-accounts',\n optional: true,\n codec: stringArrayCodec,\n },\n ],\n}\n"],"mappings":";;;AAkBA,MAAaA,2BAAsE;CACjF,MAAM;CACN,MAAM;CACN,QAAQ,CACN;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAO;EACR,EACD;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAO;EACR,CACF;CACF"}
1
+ {"version":3,"file":"participation-updates.mjs","names":["ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates>"],"sources":["../../../../../packages/indexer_client/src/models/participation-updates.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { stringArrayCodec } from '@algorandfoundation/algokit-common'\n\n/**\n * Participation account data that needs to be checked/acted on by the network.\n */\nexport type ParticipationUpdates = {\n /**\n * \\[partupdrmv\\] a list of online accounts that needs to be converted to offline since their participation key expired.\n */\n expiredParticipationAccounts: string[]\n\n /**\n * \\[partupabs\\] a list of online accounts that need to be suspended.\n */\n absentParticipationAccounts: string[]\n}\n\nexport const ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates> = {\n name: 'ParticipationUpdates',\n kind: 'object',\n fields: [\n {\n name: 'expiredParticipationAccounts',\n wireKey: 'expired-participation-accounts',\n optional: false,\n codec: stringArrayCodec,\n },\n {\n name: 'absentParticipationAccounts',\n wireKey: 'absent-participation-accounts',\n optional: false,\n codec: stringArrayCodec,\n },\n ],\n}\n"],"mappings":";;;AAkBA,MAAaA,2BAAsE;CACjF,MAAM;CACN,MAAM;CACN,QAAQ,CACN;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAO;EACR,EACD;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAO;EACR,CACF;CACF"}
@@ -1,8 +1,8 @@
1
1
  import intDecoding_default from "../types/intDecoding.mjs";
2
- import JSONbigFactory from "json-bigint";
2
+ import JSONbigWithoutConfig from "json-bigint";
3
3
 
4
4
  //#region packages/sdk/src/utils/utils.ts
5
- const JSONbig = JSONbigFactory({
5
+ const JSONbig = JSONbigWithoutConfig({
6
6
  useNativeBigInt: true,
7
7
  strict: true
8
8
  });
@@ -1 +1 @@
1
- {"version":3,"file":"utils.mjs","names":["JSONbigWithoutConfig","IntDecoding"],"sources":["../../../../../packages/sdk/src/utils/utils.ts"],"sourcesContent":["import JSONbigWithoutConfig from 'json-bigint'\nimport IntDecoding from '../types/intDecoding.js'\n\nconst JSONbig = JSONbigWithoutConfig({\n useNativeBigInt: true,\n strict: true,\n})\n\nexport interface ParseJSONOptions {\n intDecoding: IntDecoding\n}\n\n/**\n * Parse JSON with additional options.\n * @param str - The JSON string to parse.\n * @param options - Configures how integers in this JSON string will be decoded. See the\n * `IntDecoding` enum for more details.\n */\nexport function parseJSON(str: string, { intDecoding }: ParseJSONOptions) {\n if (\n intDecoding !== IntDecoding.SAFE &&\n intDecoding !== IntDecoding.UNSAFE &&\n intDecoding !== IntDecoding.BIGINT &&\n intDecoding !== IntDecoding.MIXED\n ) {\n throw new Error(`Invalid intDecoding option: ${intDecoding}`)\n }\n return JSONbig.parse(str, (_: string, value: any): any => {\n if (value != null && typeof value === 'object' && Object.getPrototypeOf(value) == null) {\n // JSONbig.parse objects are created with Object.create(null) and thus have a null prototype\n // let us remedy that\n Object.setPrototypeOf(value, Object.prototype)\n }\n\n if (typeof value === 'bigint') {\n if (intDecoding === IntDecoding.SAFE && value > Number.MAX_SAFE_INTEGER) {\n throw new Error(`Integer exceeds maximum safe integer: ${value.toString()}. Try parsing with a different intDecoding option.`)\n }\n if (intDecoding === IntDecoding.BIGINT || (intDecoding === IntDecoding.MIXED && value > Number.MAX_SAFE_INTEGER)) {\n return value\n }\n // JSONbig.parse converts number to BigInts if they are >= 10**15. This is smaller than\n // Number.MAX_SAFE_INTEGER, so we can convert some BigInts back to normal numbers.\n return Number(value)\n }\n\n if (typeof value === 'number') {\n if (intDecoding === IntDecoding.BIGINT && Number.isInteger(value)) {\n return BigInt(value)\n }\n }\n\n return value\n })\n}\n\n/**\n * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\n *\n * This functions differs from the built-in JSON.stringify in that it supports serializing BigInts.\n *\n * This function takes the same arguments as the built-in JSON.stringify function.\n *\n * @param value - A JavaScript value, usually an object or array, to be converted.\n * @param replacer - A function that transforms the results.\n * @param space - Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\n */\nexport function stringifyJSON(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string {\n return JSONbig.stringify(value, replacer, space)\n}\n\n/**\n * ArrayEqual takes two arrays and return true if equal, false otherwise\n */\nexport function arrayEqual<T>(a: ArrayLike<T>, b: ArrayLike<T>): boolean {\n if (a.length !== b.length) {\n return false\n }\n return Array.from(a).every((val, i) => val === b[i])\n}\n\n/**\n * ConcatArrays takes n number arrays and returns a joint Uint8Array\n * @param arrs - An arbitrary number of n array-like number list arguments\n * @returns [a,b]\n */\nexport function concatArrays(...arrs: ArrayLike<number>[]) {\n const size = arrs.reduce((sum, arr) => sum + arr.length, 0)\n const c = new Uint8Array(size)\n\n let offset = 0\n for (let i = 0; i < arrs.length; i++) {\n c.set(arrs[i], offset)\n offset += arrs[i].length\n }\n\n return c\n}\n\n/**\n * Remove undefined properties from an object\n * @param obj - An object, preferably one with some undefined properties\n * @returns A copy of the object with undefined properties removed\n */\nexport function removeUndefinedProperties(obj: Record<string | number | symbol, any>) {\n const mutableCopy = { ...obj }\n Object.keys(mutableCopy).forEach((key) => {\n if (typeof mutableCopy[key] === 'undefined') delete mutableCopy[key]\n })\n return mutableCopy\n}\n\n/**\n * Check whether the environment is Node.js (as opposed to the browser)\n * @returns True if Node.js environment, false otherwise\n */\nexport function isNode() {\n return (\n // @ts-ignore\n typeof process === 'object' &&\n // @ts-ignore\n typeof process.versions === 'object' &&\n // @ts-ignore\n typeof process.versions.node !== 'undefined'\n )\n}\n\n/**\n * Check whether the environment is ReactNative\n * @returns True if ReactNative, false otherwise\n */\nexport function isReactNative() {\n const { navigator } = globalThis as { navigator?: { product?: string } }\n if (typeof navigator === 'object' && navigator.product === 'ReactNative') {\n return true\n }\n return false\n}\n\nexport function ensureSafeInteger(value: unknown): number {\n if (typeof value === 'undefined') {\n throw new Error('Value is undefined')\n }\n if (typeof value === 'bigint') {\n if (value > BigInt(Number.MAX_SAFE_INTEGER) || value < BigInt(Number.MIN_SAFE_INTEGER)) {\n throw new Error(`BigInt value ${value} is not a safe integer`)\n }\n return Number(value)\n }\n if (typeof value === 'number') {\n if (Number.isSafeInteger(value)) {\n return value\n }\n throw new Error(`Value ${value} is not a safe integer`)\n }\n throw new Error(`Unexpected type ${typeof value}, ${value}`)\n}\n\nexport function ensureSafeUnsignedInteger(value: unknown): number {\n const intValue = ensureSafeInteger(value)\n if (intValue < 0) {\n throw new Error(`Value ${intValue} is negative`)\n }\n return intValue\n}\n\nexport function ensureBigInt(value: unknown): bigint {\n if (typeof value === 'undefined') {\n throw new Error('Value is undefined')\n }\n if (typeof value === 'bigint') {\n return value\n }\n if (typeof value === 'number') {\n if (!Number.isSafeInteger(value)) {\n throw new Error(`Value ${value} is not a safe integer`)\n }\n return BigInt(value)\n }\n throw new Error(`Unexpected type ${typeof value}, ${value}`)\n}\n\nexport function ensureUint64(value: unknown): bigint {\n const bigIntValue = ensureBigInt(value)\n if (bigIntValue < 0 || bigIntValue > BigInt('0xffffffffffffffff')) {\n throw new Error(`Value ${bigIntValue} is not a uint64`)\n }\n return bigIntValue\n}\n"],"mappings":"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"}
1
+ {"version":3,"file":"utils.mjs","names":["IntDecoding"],"sources":["../../../../../packages/sdk/src/utils/utils.ts"],"sourcesContent":["import JSONbigWithoutConfig from 'json-bigint'\nimport IntDecoding from '../types/intDecoding.js'\n\nconst JSONbig = JSONbigWithoutConfig({\n useNativeBigInt: true,\n strict: true,\n})\n\nexport interface ParseJSONOptions {\n intDecoding: IntDecoding\n}\n\n/**\n * Parse JSON with additional options.\n * @param str - The JSON string to parse.\n * @param options - Configures how integers in this JSON string will be decoded. See the\n * `IntDecoding` enum for more details.\n */\nexport function parseJSON(str: string, { intDecoding }: ParseJSONOptions) {\n if (\n intDecoding !== IntDecoding.SAFE &&\n intDecoding !== IntDecoding.UNSAFE &&\n intDecoding !== IntDecoding.BIGINT &&\n intDecoding !== IntDecoding.MIXED\n ) {\n throw new Error(`Invalid intDecoding option: ${intDecoding}`)\n }\n return JSONbig.parse(str, (_: string, value: any): any => {\n if (value != null && typeof value === 'object' && Object.getPrototypeOf(value) == null) {\n // JSONbig.parse objects are created with Object.create(null) and thus have a null prototype\n // let us remedy that\n Object.setPrototypeOf(value, Object.prototype)\n }\n\n if (typeof value === 'bigint') {\n if (intDecoding === IntDecoding.SAFE && value > Number.MAX_SAFE_INTEGER) {\n throw new Error(`Integer exceeds maximum safe integer: ${value.toString()}. Try parsing with a different intDecoding option.`)\n }\n if (intDecoding === IntDecoding.BIGINT || (intDecoding === IntDecoding.MIXED && value > Number.MAX_SAFE_INTEGER)) {\n return value\n }\n // JSONbig.parse converts number to BigInts if they are >= 10**15. This is smaller than\n // Number.MAX_SAFE_INTEGER, so we can convert some BigInts back to normal numbers.\n return Number(value)\n }\n\n if (typeof value === 'number') {\n if (intDecoding === IntDecoding.BIGINT && Number.isInteger(value)) {\n return BigInt(value)\n }\n }\n\n return value\n })\n}\n\n/**\n * Converts a JavaScript value to a JavaScript Object Notation (JSON) string.\n *\n * This functions differs from the built-in JSON.stringify in that it supports serializing BigInts.\n *\n * This function takes the same arguments as the built-in JSON.stringify function.\n *\n * @param value - A JavaScript value, usually an object or array, to be converted.\n * @param replacer - A function that transforms the results.\n * @param space - Adds indentation, white space, and line break characters to the return-value JSON text to make it easier to read.\n */\nexport function stringifyJSON(value: any, replacer?: (this: any, key: string, value: any) => any, space?: string | number): string {\n return JSONbig.stringify(value, replacer, space)\n}\n\n/**\n * ArrayEqual takes two arrays and return true if equal, false otherwise\n */\nexport function arrayEqual<T>(a: ArrayLike<T>, b: ArrayLike<T>): boolean {\n if (a.length !== b.length) {\n return false\n }\n return Array.from(a).every((val, i) => val === b[i])\n}\n\n/**\n * ConcatArrays takes n number arrays and returns a joint Uint8Array\n * @param arrs - An arbitrary number of n array-like number list arguments\n * @returns [a,b]\n */\nexport function concatArrays(...arrs: ArrayLike<number>[]) {\n const size = arrs.reduce((sum, arr) => sum + arr.length, 0)\n const c = new Uint8Array(size)\n\n let offset = 0\n for (let i = 0; i < arrs.length; i++) {\n c.set(arrs[i], offset)\n offset += arrs[i].length\n }\n\n return c\n}\n\n/**\n * Remove undefined properties from an object\n * @param obj - An object, preferably one with some undefined properties\n * @returns A copy of the object with undefined properties removed\n */\nexport function removeUndefinedProperties(obj: Record<string | number | symbol, any>) {\n const mutableCopy = { ...obj }\n Object.keys(mutableCopy).forEach((key) => {\n if (typeof mutableCopy[key] === 'undefined') delete mutableCopy[key]\n })\n return mutableCopy\n}\n\n/**\n * Check whether the environment is Node.js (as opposed to the browser)\n * @returns True if Node.js environment, false otherwise\n */\nexport function isNode() {\n return (\n // @ts-ignore\n typeof process === 'object' &&\n // @ts-ignore\n typeof process.versions === 'object' &&\n // @ts-ignore\n typeof process.versions.node !== 'undefined'\n )\n}\n\n/**\n * Check whether the environment is ReactNative\n * @returns True if ReactNative, false otherwise\n */\nexport function isReactNative() {\n const { navigator } = globalThis as { navigator?: { product?: string } }\n if (typeof navigator === 'object' && navigator.product === 'ReactNative') {\n return true\n }\n return false\n}\n\nexport function ensureSafeInteger(value: unknown): number {\n if (typeof value === 'undefined') {\n throw new Error('Value is undefined')\n }\n if (typeof value === 'bigint') {\n if (value > BigInt(Number.MAX_SAFE_INTEGER) || value < BigInt(Number.MIN_SAFE_INTEGER)) {\n throw new Error(`BigInt value ${value} is not a safe integer`)\n }\n return Number(value)\n }\n if (typeof value === 'number') {\n if (Number.isSafeInteger(value)) {\n return value\n }\n throw new Error(`Value ${value} is not a safe integer`)\n }\n throw new Error(`Unexpected type ${typeof value}, ${value}`)\n}\n\nexport function ensureSafeUnsignedInteger(value: unknown): number {\n const intValue = ensureSafeInteger(value)\n if (intValue < 0) {\n throw new Error(`Value ${intValue} is negative`)\n }\n return intValue\n}\n\nexport function ensureBigInt(value: unknown): bigint {\n if (typeof value === 'undefined') {\n throw new Error('Value is undefined')\n }\n if (typeof value === 'bigint') {\n return value\n }\n if (typeof value === 'number') {\n if (!Number.isSafeInteger(value)) {\n throw new Error(`Value ${value} is not a safe integer`)\n }\n return BigInt(value)\n }\n throw new Error(`Unexpected type ${typeof value}, ${value}`)\n}\n\nexport function ensureUint64(value: unknown): bigint {\n const bigIntValue = ensureBigInt(value)\n if (bigIntValue < 0 || bigIntValue > BigInt('0xffffffffffffffff')) {\n throw new Error(`Value ${bigIntValue} is not a uint64`)\n }\n return bigIntValue\n}\n"],"mappings":"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"}
@@ -8,7 +8,7 @@ async function getTestAccount({ suppressLog, initialFunds, accountGetter }, algo
8
8
  algod: algodOrAlgorandClient,
9
9
  kmd
10
10
  });
11
- const account = accountGetter ? await accountGetter(algorand) : algorand.account.random();
11
+ const account = accountGetter ? await accountGetter(algorand) : algorand.account.random().account;
12
12
  require_config.Config.getLogger(suppressLog).info(`New test account created with address '${account.addr}'.`);
13
13
  const dispenser = await algorand.account.dispenserFromEnvironment();
14
14
  await algorand.send.payment({
@@ -21,10 +21,7 @@ async function getTestAccount({ suppressLog, initialFunds, accountGetter }, algo
21
21
  const accountInfo = await algorand.account.getInformation(account.addr);
22
22
  require_config.Config.getLogger(suppressLog).info("Test account funded; account balance: %d µALGO", accountInfo.balance.microAlgo);
23
23
  algorand.setSignerFromAccount(account);
24
- const address = require_address.Address.fromString(account.addr.toString());
25
- address.addr = account.addr;
26
- address.signer = algorand.account.getSigner(address);
27
- return address;
24
+ return Object.assign(require_address.Address.fromString(account.addr.toString()), account);
28
25
  }
29
26
 
30
27
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"account.js","names":["AlgorandClient","Address"],"sources":["../../src/testing/account.ts"],"sourcesContent":["import { AlgodClient } from '@algorandfoundation/algokit-algod-client'\nimport { Address } from '@algorandfoundation/algokit-common'\nimport { AddressWithSigners, AddressWithTransactionSigner } from '@algorandfoundation/algokit-transact'\nimport { KmdClient } from '@algorandfoundation/algokit-kmd-client'\nimport { AlgorandClient, Config } from '../'\nimport { GetTestAccountParams } from '../types/testing'\n\n/**\n * @deprecated Use `getTestAccount(params, algorandClient)` instead. The `algorandClient` object can be created using `AlgorandClient.fromClients({ algod, kmd })`.\n *\n * Creates an ephemeral Algorand account for the purposes of testing.\n * Returns a newly created random test account that is funded from the dispenser\n * DO NOT USE THIS TO CREATE A MAINNET ACCOUNT!\n * Note: By default this will log the mnemonic of the account.\n * @param params The config for the test account to generate\n * @param algod An algod client\n * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables and if not found fallback to the default LocalNet KMD client\n * @returns The account, with private key loaded\n */\nexport async function getTestAccount(\n params: GetTestAccountParams,\n algod: AlgodClient,\n kmd?: KmdClient,\n): Promise<Address & AddressWithTransactionSigner>\n/**\n * Creates an ephemeral Algorand account for the purposes of testing.\n * Returns a newly created random test account that is funded from the dispenser\n * DO NOT USE THIS TO CREATE A MAINNET ACCOUNT!\n * Note: By default this will log the mnemonic of the account.\n * @param params The config for the test account to generate\n * @param algorand An AlgorandClient client\n * @returns The account, with private key loaded\n */\nexport async function getTestAccount(params: GetTestAccountParams, algorand: AlgorandClient): Promise<Address & AddressWithSigners>\nexport async function getTestAccount(\n { suppressLog, initialFunds, accountGetter }: GetTestAccountParams,\n algodOrAlgorandClient: AlgodClient | AlgorandClient,\n kmd?: KmdClient,\n): Promise<Address & AddressWithTransactionSigner> {\n const algorand =\n algodOrAlgorandClient instanceof AlgorandClient\n ? algodOrAlgorandClient\n : AlgorandClient.fromClients({\n algod: algodOrAlgorandClient,\n kmd,\n })\n\n const account = accountGetter ? await accountGetter(algorand) : algorand.account.random()\n\n Config.getLogger(suppressLog).info(`New test account created with address '${account.addr}'.`)\n\n const dispenser = await algorand.account.dispenserFromEnvironment()\n\n await algorand.send.payment({\n sender: dispenser,\n receiver: account.addr,\n amount: initialFunds,\n note: 'Funding test account',\n suppressLog,\n })\n\n const accountInfo = await algorand.account.getInformation(account.addr)\n\n Config.getLogger(suppressLog).info('Test account funded; account balance: %d µALGO', accountInfo.balance.microAlgo)\n\n algorand.setSignerFromAccount(account)\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const address = Address.fromString(account.addr.toString()) as any\n address.addr = account.addr\n address.signer = algorand.account.getSigner(address)\n\n return address\n}\n"],"mappings":";;;;;AAkCA,eAAsB,eACpB,EAAE,aAAa,cAAc,iBAC7B,uBACA,KACiD;CACjD,MAAM,WACJ,iCAAiCA,yCAC7B,wBACAA,uCAAe,YAAY;EACzB,OAAO;EACP;EACD,CAAC;CAER,MAAM,UAAU,gBAAgB,MAAM,cAAc,SAAS,GAAG,SAAS,QAAQ,QAAQ;AAEzF,uBAAO,UAAU,YAAY,CAAC,KAAK,0CAA0C,QAAQ,KAAK,IAAI;CAE9F,MAAM,YAAY,MAAM,SAAS,QAAQ,0BAA0B;AAEnE,OAAM,SAAS,KAAK,QAAQ;EAC1B,QAAQ;EACR,UAAU,QAAQ;EAClB,QAAQ;EACR,MAAM;EACN;EACD,CAAC;CAEF,MAAM,cAAc,MAAM,SAAS,QAAQ,eAAe,QAAQ,KAAK;AAEvE,uBAAO,UAAU,YAAY,CAAC,KAAK,kDAAkD,YAAY,QAAQ,UAAU;AAEnH,UAAS,qBAAqB,QAAQ;CAGtC,MAAM,UAAUC,wBAAQ,WAAW,QAAQ,KAAK,UAAU,CAAC;AAC3D,SAAQ,OAAO,QAAQ;AACvB,SAAQ,SAAS,SAAS,QAAQ,UAAU,QAAQ;AAEpD,QAAO"}
1
+ {"version":3,"file":"account.js","names":["AlgorandClient","Address"],"sources":["../../src/testing/account.ts"],"sourcesContent":["import { AlgodClient } from '@algorandfoundation/algokit-algod-client'\nimport { Address } from '@algorandfoundation/algokit-common'\nimport { KmdClient } from '@algorandfoundation/algokit-kmd-client'\nimport { AddressWithSigners, AddressWithTransactionSigner } from '@algorandfoundation/algokit-transact'\nimport { AlgorandClient, Config } from '../'\nimport { GetTestAccountParams } from '../types/testing'\n\n/**\n * @deprecated Use `getTestAccount(params, algorandClient)` instead. The `algorandClient` object can be created using `AlgorandClient.fromClients({ algod, kmd })`.\n *\n * Creates an ephemeral Algorand account for the purposes of testing.\n * Returns a newly created random test account that is funded from the dispenser\n * DO NOT USE THIS TO CREATE A MAINNET ACCOUNT!\n * Note: By default this will log the mnemonic of the account.\n * @param params The config for the test account to generate\n * @param algod An algod client\n * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables and if not found fallback to the default LocalNet KMD client\n * @returns The account, with private key loaded\n */\nexport async function getTestAccount(\n params: GetTestAccountParams,\n algod: AlgodClient,\n kmd?: KmdClient,\n): Promise<Address & AddressWithTransactionSigner>\n/**\n * Creates an ephemeral Algorand account for the purposes of testing.\n * Returns a newly created random test account that is funded from the dispenser\n * DO NOT USE THIS TO CREATE A MAINNET ACCOUNT!\n * Note: By default this will log the mnemonic of the account.\n * @param params The config for the test account to generate\n * @param algorand An AlgorandClient client\n * @returns The account, with private key loaded\n */\nexport async function getTestAccount(params: GetTestAccountParams, algorand: AlgorandClient): Promise<Address & AddressWithSigners>\nexport async function getTestAccount(\n { suppressLog, initialFunds, accountGetter }: GetTestAccountParams,\n algodOrAlgorandClient: AlgodClient | AlgorandClient,\n kmd?: KmdClient,\n): Promise<Address & AddressWithTransactionSigner> {\n const algorand =\n algodOrAlgorandClient instanceof AlgorandClient\n ? algodOrAlgorandClient\n : AlgorandClient.fromClients({\n algod: algodOrAlgorandClient,\n kmd,\n })\n\n const account = accountGetter ? await accountGetter(algorand) : algorand.account.random().account\n\n Config.getLogger(suppressLog).info(`New test account created with address '${account.addr}'.`)\n\n const dispenser = await algorand.account.dispenserFromEnvironment()\n\n await algorand.send.payment({\n sender: dispenser,\n receiver: account.addr,\n amount: initialFunds,\n note: 'Funding test account',\n suppressLog,\n })\n\n const accountInfo = await algorand.account.getInformation(account.addr)\n\n Config.getLogger(suppressLog).info('Test account funded; account balance: %d µALGO', accountInfo.balance.microAlgo)\n\n algorand.setSignerFromAccount(account)\n\n return Object.assign(Address.fromString(account.addr.toString()), account)\n}\n"],"mappings":";;;;;AAkCA,eAAsB,eACpB,EAAE,aAAa,cAAc,iBAC7B,uBACA,KACiD;CACjD,MAAM,WACJ,iCAAiCA,yCAC7B,wBACAA,uCAAe,YAAY;EACzB,OAAO;EACP;EACD,CAAC;CAER,MAAM,UAAU,gBAAgB,MAAM,cAAc,SAAS,GAAG,SAAS,QAAQ,QAAQ,CAAC;AAE1F,uBAAO,UAAU,YAAY,CAAC,KAAK,0CAA0C,QAAQ,KAAK,IAAI;CAE9F,MAAM,YAAY,MAAM,SAAS,QAAQ,0BAA0B;AAEnE,OAAM,SAAS,KAAK,QAAQ;EAC1B,QAAQ;EACR,UAAU,QAAQ;EAClB,QAAQ;EACR,MAAM;EACN;EACD,CAAC;CAEF,MAAM,cAAc,MAAM,SAAS,QAAQ,eAAe,QAAQ,KAAK;AAEvE,uBAAO,UAAU,YAAY,CAAC,KAAK,kDAAkD,YAAY,QAAQ,UAAU;AAEnH,UAAS,qBAAqB,QAAQ;AAEtC,QAAO,OAAO,OAAOC,wBAAQ,WAAW,QAAQ,KAAK,UAAU,CAAC,EAAE,QAAQ"}
@@ -8,7 +8,7 @@ async function getTestAccount({ suppressLog, initialFunds, accountGetter }, algo
8
8
  algod: algodOrAlgorandClient,
9
9
  kmd
10
10
  });
11
- const account = accountGetter ? await accountGetter(algorand) : algorand.account.random();
11
+ const account = accountGetter ? await accountGetter(algorand) : algorand.account.random().account;
12
12
  Config.getLogger(suppressLog).info(`New test account created with address '${account.addr}'.`);
13
13
  const dispenser = await algorand.account.dispenserFromEnvironment();
14
14
  await algorand.send.payment({
@@ -21,10 +21,7 @@ async function getTestAccount({ suppressLog, initialFunds, accountGetter }, algo
21
21
  const accountInfo = await algorand.account.getInformation(account.addr);
22
22
  Config.getLogger(suppressLog).info("Test account funded; account balance: %d µALGO", accountInfo.balance.microAlgo);
23
23
  algorand.setSignerFromAccount(account);
24
- const address = Address.fromString(account.addr.toString());
25
- address.addr = account.addr;
26
- address.signer = algorand.account.getSigner(address);
27
- return address;
24
+ return Object.assign(Address.fromString(account.addr.toString()), account);
28
25
  }
29
26
 
30
27
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"account.mjs","names":[],"sources":["../../src/testing/account.ts"],"sourcesContent":["import { AlgodClient } from '@algorandfoundation/algokit-algod-client'\nimport { Address } from '@algorandfoundation/algokit-common'\nimport { AddressWithSigners, AddressWithTransactionSigner } from '@algorandfoundation/algokit-transact'\nimport { KmdClient } from '@algorandfoundation/algokit-kmd-client'\nimport { AlgorandClient, Config } from '../'\nimport { GetTestAccountParams } from '../types/testing'\n\n/**\n * @deprecated Use `getTestAccount(params, algorandClient)` instead. The `algorandClient` object can be created using `AlgorandClient.fromClients({ algod, kmd })`.\n *\n * Creates an ephemeral Algorand account for the purposes of testing.\n * Returns a newly created random test account that is funded from the dispenser\n * DO NOT USE THIS TO CREATE A MAINNET ACCOUNT!\n * Note: By default this will log the mnemonic of the account.\n * @param params The config for the test account to generate\n * @param algod An algod client\n * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables and if not found fallback to the default LocalNet KMD client\n * @returns The account, with private key loaded\n */\nexport async function getTestAccount(\n params: GetTestAccountParams,\n algod: AlgodClient,\n kmd?: KmdClient,\n): Promise<Address & AddressWithTransactionSigner>\n/**\n * Creates an ephemeral Algorand account for the purposes of testing.\n * Returns a newly created random test account that is funded from the dispenser\n * DO NOT USE THIS TO CREATE A MAINNET ACCOUNT!\n * Note: By default this will log the mnemonic of the account.\n * @param params The config for the test account to generate\n * @param algorand An AlgorandClient client\n * @returns The account, with private key loaded\n */\nexport async function getTestAccount(params: GetTestAccountParams, algorand: AlgorandClient): Promise<Address & AddressWithSigners>\nexport async function getTestAccount(\n { suppressLog, initialFunds, accountGetter }: GetTestAccountParams,\n algodOrAlgorandClient: AlgodClient | AlgorandClient,\n kmd?: KmdClient,\n): Promise<Address & AddressWithTransactionSigner> {\n const algorand =\n algodOrAlgorandClient instanceof AlgorandClient\n ? algodOrAlgorandClient\n : AlgorandClient.fromClients({\n algod: algodOrAlgorandClient,\n kmd,\n })\n\n const account = accountGetter ? await accountGetter(algorand) : algorand.account.random()\n\n Config.getLogger(suppressLog).info(`New test account created with address '${account.addr}'.`)\n\n const dispenser = await algorand.account.dispenserFromEnvironment()\n\n await algorand.send.payment({\n sender: dispenser,\n receiver: account.addr,\n amount: initialFunds,\n note: 'Funding test account',\n suppressLog,\n })\n\n const accountInfo = await algorand.account.getInformation(account.addr)\n\n Config.getLogger(suppressLog).info('Test account funded; account balance: %d µALGO', accountInfo.balance.microAlgo)\n\n algorand.setSignerFromAccount(account)\n\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n const address = Address.fromString(account.addr.toString()) as any\n address.addr = account.addr\n address.signer = algorand.account.getSigner(address)\n\n return address\n}\n"],"mappings":";;;;;AAkCA,eAAsB,eACpB,EAAE,aAAa,cAAc,iBAC7B,uBACA,KACiD;CACjD,MAAM,WACJ,iCAAiC,iBAC7B,wBACA,eAAe,YAAY;EACzB,OAAO;EACP;EACD,CAAC;CAER,MAAM,UAAU,gBAAgB,MAAM,cAAc,SAAS,GAAG,SAAS,QAAQ,QAAQ;AAEzF,QAAO,UAAU,YAAY,CAAC,KAAK,0CAA0C,QAAQ,KAAK,IAAI;CAE9F,MAAM,YAAY,MAAM,SAAS,QAAQ,0BAA0B;AAEnE,OAAM,SAAS,KAAK,QAAQ;EAC1B,QAAQ;EACR,UAAU,QAAQ;EAClB,QAAQ;EACR,MAAM;EACN;EACD,CAAC;CAEF,MAAM,cAAc,MAAM,SAAS,QAAQ,eAAe,QAAQ,KAAK;AAEvE,QAAO,UAAU,YAAY,CAAC,KAAK,kDAAkD,YAAY,QAAQ,UAAU;AAEnH,UAAS,qBAAqB,QAAQ;CAGtC,MAAM,UAAU,QAAQ,WAAW,QAAQ,KAAK,UAAU,CAAC;AAC3D,SAAQ,OAAO,QAAQ;AACvB,SAAQ,SAAS,SAAS,QAAQ,UAAU,QAAQ;AAEpD,QAAO"}
1
+ {"version":3,"file":"account.mjs","names":[],"sources":["../../src/testing/account.ts"],"sourcesContent":["import { AlgodClient } from '@algorandfoundation/algokit-algod-client'\nimport { Address } from '@algorandfoundation/algokit-common'\nimport { KmdClient } from '@algorandfoundation/algokit-kmd-client'\nimport { AddressWithSigners, AddressWithTransactionSigner } from '@algorandfoundation/algokit-transact'\nimport { AlgorandClient, Config } from '../'\nimport { GetTestAccountParams } from '../types/testing'\n\n/**\n * @deprecated Use `getTestAccount(params, algorandClient)` instead. The `algorandClient` object can be created using `AlgorandClient.fromClients({ algod, kmd })`.\n *\n * Creates an ephemeral Algorand account for the purposes of testing.\n * Returns a newly created random test account that is funded from the dispenser\n * DO NOT USE THIS TO CREATE A MAINNET ACCOUNT!\n * Note: By default this will log the mnemonic of the account.\n * @param params The config for the test account to generate\n * @param algod An algod client\n * @param kmd A KMD client, if not specified then a default KMD client will be loaded from environment variables and if not found fallback to the default LocalNet KMD client\n * @returns The account, with private key loaded\n */\nexport async function getTestAccount(\n params: GetTestAccountParams,\n algod: AlgodClient,\n kmd?: KmdClient,\n): Promise<Address & AddressWithTransactionSigner>\n/**\n * Creates an ephemeral Algorand account for the purposes of testing.\n * Returns a newly created random test account that is funded from the dispenser\n * DO NOT USE THIS TO CREATE A MAINNET ACCOUNT!\n * Note: By default this will log the mnemonic of the account.\n * @param params The config for the test account to generate\n * @param algorand An AlgorandClient client\n * @returns The account, with private key loaded\n */\nexport async function getTestAccount(params: GetTestAccountParams, algorand: AlgorandClient): Promise<Address & AddressWithSigners>\nexport async function getTestAccount(\n { suppressLog, initialFunds, accountGetter }: GetTestAccountParams,\n algodOrAlgorandClient: AlgodClient | AlgorandClient,\n kmd?: KmdClient,\n): Promise<Address & AddressWithTransactionSigner> {\n const algorand =\n algodOrAlgorandClient instanceof AlgorandClient\n ? algodOrAlgorandClient\n : AlgorandClient.fromClients({\n algod: algodOrAlgorandClient,\n kmd,\n })\n\n const account = accountGetter ? await accountGetter(algorand) : algorand.account.random().account\n\n Config.getLogger(suppressLog).info(`New test account created with address '${account.addr}'.`)\n\n const dispenser = await algorand.account.dispenserFromEnvironment()\n\n await algorand.send.payment({\n sender: dispenser,\n receiver: account.addr,\n amount: initialFunds,\n note: 'Funding test account',\n suppressLog,\n })\n\n const accountInfo = await algorand.account.getInformation(account.addr)\n\n Config.getLogger(suppressLog).info('Test account funded; account balance: %d µALGO', accountInfo.balance.microAlgo)\n\n algorand.setSignerFromAccount(account)\n\n return Object.assign(Address.fromString(account.addr.toString()), account)\n}\n"],"mappings":";;;;;AAkCA,eAAsB,eACpB,EAAE,aAAa,cAAc,iBAC7B,uBACA,KACiD;CACjD,MAAM,WACJ,iCAAiC,iBAC7B,wBACA,eAAe,YAAY;EACzB,OAAO;EACP;EACD,CAAC;CAER,MAAM,UAAU,gBAAgB,MAAM,cAAc,SAAS,GAAG,SAAS,QAAQ,QAAQ,CAAC;AAE1F,QAAO,UAAU,YAAY,CAAC,KAAK,0CAA0C,QAAQ,KAAK,IAAI;CAE9F,MAAM,YAAY,MAAM,SAAS,QAAQ,0BAA0B;AAEnE,OAAM,SAAS,KAAK,QAAQ;EAC1B,QAAQ;EACR,UAAU,QAAQ;EAClB,QAAQ;EACR,MAAM;EACN;EACD,CAAC;CAEF,MAAM,cAAc,MAAM,SAAS,QAAQ,eAAe,QAAQ,KAAK;AAEvE,QAAO,UAAU,YAAY,CAAC,KAAK,kDAAkD,YAAY,QAAQ,UAAU;AAEnH,UAAS,qBAAqB,QAAQ;AAEtC,QAAO,OAAO,OAAO,QAAQ,WAAW,QAAQ,KAAK,UAAU,CAAC,EAAE,QAAQ"}
@@ -82,68 +82,58 @@ const isAbiValue = (x) => {
82
82
  return typeof x === "bigint" || typeof x === "boolean" || typeof x === "number" || typeof x === "string" || x instanceof Uint8Array || x instanceof require_address.Address;
83
83
  };
84
84
  /**
85
- * Populate reference arrays from processed ABI method call arguments
85
+ * Prepares method arguments for ABI encoding by building reference arrays and
86
+ * replacing reference-type arguments (account, asset, application) with their indices.
86
87
  */
87
- function populateMethodArgsIntoReferenceArrays(sender, appId, method, methodArgs, accountReferences, appReferences, assetReferences) {
88
+ function prepareArgsForEncoding(sender, appId, method, methodArgs, accountReferences, appReferences, assetReferences) {
88
89
  const accounts = [...accountReferences ?? []];
89
90
  const assets = [...assetReferences ?? []];
90
91
  const apps = [...appReferences ?? []];
91
- methodArgs.forEach((arg, i) => {
92
- const argType = method.args[i].type;
93
- if (require_abi_method.argTypeIsReference(argType)) switch (argType) {
94
- case "account":
95
- if (typeof arg === "string" && arg !== sender.toString() && !accounts.some((a) => a.toString() === arg)) accounts.push(require_address.getAddress(arg));
96
- break;
97
- case "asset":
98
- if (typeof arg === "bigint" && !assets.includes(arg)) assets.push(arg);
99
- break;
100
- case "application":
101
- if (typeof arg === "bigint" && arg !== appId && !apps.includes(arg)) apps.push(arg);
102
- break;
103
- }
104
- });
105
92
  return {
106
93
  accountReferences: accounts,
107
94
  appReferences: apps,
108
- assetReferences: assets
109
- };
110
- }
111
- /**
112
- * Calculate array index for ABI reference values
113
- */
114
- function calculateMethodArgReferenceArrayIndex(refValue, referenceType, sender, appId, accountReferences, appReferences, assetReferences) {
115
- switch (referenceType) {
116
- case "account":
117
- if (typeof refValue === "string") {
118
- if (refValue === sender.toString()) return 0;
119
- const index = accountReferences.findIndex((a) => a.toString() === refValue);
120
- if (index === -1) throw new Error(`Account ${refValue} not found in reference array`);
121
- return index + 1;
122
- }
123
- throw new Error("Account reference must be a string");
124
- case "asset":
125
- if (typeof refValue === "bigint") {
126
- const index = assetReferences.indexOf(refValue);
127
- if (index === -1) throw new Error(`Asset ${refValue} not found in reference array`);
128
- return index;
95
+ assetReferences: assets,
96
+ updatedArgs: methodArgs.map((arg, i) => {
97
+ const argType = method.args[i].type;
98
+ if (!require_abi_method.argTypeIsReference(argType)) return arg;
99
+ switch (argType) {
100
+ case "account": {
101
+ let addr;
102
+ if (typeof arg === "string") addr = require_address.getAddress(arg);
103
+ else if (arg instanceof Uint8Array) addr = new require_address.Address(arg);
104
+ else throw new Error("Invalid value for account");
105
+ if (sender.equals(addr)) return 0;
106
+ const existing = accounts.findIndex((a) => a.equals(addr)) + 1;
107
+ if (existing) return existing;
108
+ accounts.push(addr);
109
+ return accounts.length;
110
+ }
111
+ case "asset": {
112
+ if (typeof arg !== "bigint") throw new Error("Invalid value for asset");
113
+ const existing = assets.findIndex((a) => a === arg);
114
+ if (existing === -1) {
115
+ assets.push(arg);
116
+ return assets.length - 1;
117
+ }
118
+ return existing;
119
+ }
120
+ case "application": {
121
+ if (typeof arg !== "bigint") throw new Error("Invalid value for application");
122
+ if (arg === appId) return 0;
123
+ const existing = apps.findIndex((a) => a === arg) + 1;
124
+ if (existing) return existing;
125
+ apps.push(arg);
126
+ return apps.length;
127
+ }
129
128
  }
130
- throw new Error("Asset reference must be a bigint");
131
- case "application":
132
- if (typeof refValue === "bigint") {
133
- if (refValue === appId) return 0;
134
- const index = appReferences.indexOf(refValue);
135
- if (index === -1) throw new Error(`Application ${refValue} not found in reference array`);
136
- return index + 1;
137
- }
138
- throw new Error("Application reference must be a bigint");
139
- default: throw new Error(`Unknown reference type: ${referenceType}`);
140
- }
129
+ })
130
+ };
141
131
  }
142
132
  /**
143
133
  * Encode ABI method arguments with tuple packing support
144
134
  * Ports the logic from the Rust encode_method_arguments function
145
135
  */
146
- function encodeMethodArguments(method, args, sender, appId, accountReferences, appReferences, assetReferences) {
136
+ function encodeMethodArguments(method, args) {
147
137
  const encodedArgs = new Array();
148
138
  encodedArgs.push(method.getSelector());
149
139
  const abiTypes = new Array();
@@ -153,10 +143,9 @@ function encodeMethodArguments(method, args, sender, appId, accountReferences, a
153
143
  const argValue = args[i];
154
144
  if (require_abi_method.argTypeIsTransaction(methodArg.type)) {} else if (require_abi_method.argTypeIsReference(methodArg.type)) {
155
145
  const referenceType = methodArg.type;
156
- if (typeof argValue === "string" || typeof argValue === "bigint") {
157
- const foreignIndex = calculateMethodArgReferenceArrayIndex(argValue, referenceType, sender, appId, accountReferences, appReferences, assetReferences);
146
+ if (typeof argValue === "number") {
158
147
  abiTypes.push(new require_abi_type.ABIUintType(8));
159
- abiValues.push(foreignIndex);
148
+ abiValues.push(argValue);
160
149
  } else throw new Error(`Invalid reference value for ${referenceType}: ${argValue}`);
161
150
  } else if (argValue !== void 0) {
162
151
  abiTypes.push(methodArg.type);
@@ -198,12 +187,12 @@ function encodeArgsWithTuplePacking(abiTypes, abiValues) {
198
187
  return encodedArgs;
199
188
  }
200
189
  /**
201
- * Common method call building logic
190
+ * Builds encoded ABI method arguments and resolves reference arrays
202
191
  */
203
- function buildMethodCallCommon(params, commonData) {
204
- const { accountReferences, appReferences, assetReferences } = populateMethodArgsIntoReferenceArrays(commonData.sender, params.appId, params.method, params.args ?? [], params.accountReferences, params.appReferences, params.assetReferences);
192
+ function buildMethodCallArgsAndReferences(params) {
193
+ const { accountReferences, appReferences, assetReferences, updatedArgs } = prepareArgsForEncoding(params.sender, params.appId, params.method, params.args ?? [], params.accountReferences, params.appReferences, params.assetReferences);
205
194
  return {
206
- args: encodeMethodArguments(params.method, params.args, commonData.sender, params.appId, accountReferences, appReferences, assetReferences),
195
+ args: encodeMethodArguments(params.method, updatedArgs),
207
196
  accountReferences,
208
197
  appReferences,
209
198
  assetReferences
@@ -223,14 +212,15 @@ const buildAppCreateMethodCall = async (params, appManager, suggestedParams, def
223
212
  } : void 0;
224
213
  const extraProgramPages = params.extraProgramPages !== void 0 ? params.extraProgramPages : require_util.calculateExtraProgramPages(approvalProgram, clearStateProgram);
225
214
  const accountReferences = params.accountReferences?.map((a) => require_address.getAddress(a));
226
- const common = buildMethodCallCommon({
215
+ const argsAndReferences = buildMethodCallArgsAndReferences({
216
+ sender: commonData.sender,
227
217
  appId: 0n,
228
218
  method: params.method,
229
219
  args: params.args ?? [],
230
220
  accountReferences,
231
221
  appReferences: params.appReferences,
232
222
  assetReferences: params.assetReferences
233
- }, commonData);
223
+ });
234
224
  const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0;
235
225
  return new require_transaction.Transaction({
236
226
  ...commonData,
@@ -243,11 +233,11 @@ const buildAppCreateMethodCall = async (params, appManager, suggestedParams, def
243
233
  globalStateSchema,
244
234
  localStateSchema,
245
235
  extraProgramPages,
246
- args: common.args,
236
+ args: argsAndReferences.args,
247
237
  ...hasAccessReferences ? { accessReferences: params.accessReferences } : {
248
- accountReferences: common.accountReferences,
249
- appReferences: common.appReferences,
250
- assetReferences: common.assetReferences,
238
+ accountReferences: argsAndReferences.accountReferences,
239
+ appReferences: argsAndReferences.appReferences,
240
+ assetReferences: argsAndReferences.assetReferences,
251
241
  boxReferences: params.boxReferences?.map(require_app_manager.AppManager.getBoxReference)
252
242
  },
253
243
  rejectVersion: params.rejectVersion
@@ -259,14 +249,15 @@ const buildAppUpdateMethodCall = async (params, appManager, suggestedParams, def
259
249
  const approvalProgram = typeof params.approvalProgram === "string" ? (await appManager.compileTeal(params.approvalProgram)).compiledBase64ToBytes : params.approvalProgram;
260
250
  const clearStateProgram = typeof params.clearStateProgram === "string" ? (await appManager.compileTeal(params.clearStateProgram)).compiledBase64ToBytes : params.clearStateProgram;
261
251
  const accountReferences = params.accountReferences?.map((a) => require_address.getAddress(a));
262
- const common = buildMethodCallCommon({
252
+ const argsAndReferences = buildMethodCallArgsAndReferences({
253
+ sender: commonData.sender,
263
254
  appId: params.appId,
264
255
  method: params.method,
265
256
  args: params.args ?? [],
266
257
  accountReferences,
267
258
  appReferences: params.appReferences,
268
259
  assetReferences: params.assetReferences
269
- }, commonData);
260
+ });
270
261
  const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0;
271
262
  return new require_transaction.Transaction({
272
263
  ...commonData,
@@ -276,11 +267,11 @@ const buildAppUpdateMethodCall = async (params, appManager, suggestedParams, def
276
267
  onComplete: require_app_call.OnApplicationComplete.UpdateApplication,
277
268
  approvalProgram,
278
269
  clearStateProgram,
279
- args: common.args,
270
+ args: argsAndReferences.args,
280
271
  ...hasAccessReferences ? { accessReferences: params.accessReferences } : {
281
- accountReferences: common.accountReferences,
282
- appReferences: common.appReferences,
283
- assetReferences: common.assetReferences,
272
+ accountReferences: argsAndReferences.accountReferences,
273
+ appReferences: argsAndReferences.appReferences,
274
+ assetReferences: argsAndReferences.assetReferences,
284
275
  boxReferences: params.boxReferences?.map(require_app_manager.AppManager.getBoxReference)
285
276
  },
286
277
  rejectVersion: params.rejectVersion
@@ -290,14 +281,15 @@ const buildAppUpdateMethodCall = async (params, appManager, suggestedParams, def
290
281
  const buildAppCallMethodCall = async (params, suggestedParams, defaultValidityWindow) => {
291
282
  const commonData = require_common.buildTransactionCommonData(params, suggestedParams, defaultValidityWindow);
292
283
  const accountReferences = params.accountReferences?.map((a) => require_address.getAddress(a));
293
- const common = buildMethodCallCommon({
284
+ const argsAndReferences = buildMethodCallArgsAndReferences({
285
+ sender: commonData.sender,
294
286
  appId: params.appId,
295
287
  method: params.method,
296
288
  args: params.args ?? [],
297
289
  accountReferences,
298
290
  appReferences: params.appReferences,
299
291
  assetReferences: params.assetReferences
300
- }, commonData);
292
+ });
301
293
  const hasAccessReferences = params.accessReferences && params.accessReferences.length > 0;
302
294
  return new require_transaction.Transaction({
303
295
  ...commonData,
@@ -305,11 +297,11 @@ const buildAppCallMethodCall = async (params, suggestedParams, defaultValidityWi
305
297
  appCall: {
306
298
  appId: params.appId,
307
299
  onComplete: params.onComplete ?? require_app_call.OnApplicationComplete.NoOp,
308
- args: common.args,
300
+ args: argsAndReferences.args,
309
301
  ...hasAccessReferences ? { accessReferences: params.accessReferences } : {
310
- accountReferences: common.accountReferences,
311
- appReferences: common.appReferences,
312
- assetReferences: common.assetReferences,
302
+ accountReferences: argsAndReferences.accountReferences,
303
+ appReferences: argsAndReferences.appReferences,
304
+ assetReferences: argsAndReferences.assetReferences,
313
305
  boxReferences: params.boxReferences?.map(require_app_manager.AppManager.getBoxReference)
314
306
  },
315
307
  rejectVersion: params.rejectVersion