@algorandfoundation/algokit-utils 10.0.0-alpha.23 → 10.0.0-alpha.25

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 (55) hide show
  1. package/package.json +1 -1
  2. package/packages/algod_client/src/models/block.js.map +1 -1
  3. package/packages/algod_client/src/models/block.mjs.map +1 -1
  4. package/packages/algod_client/src/models/eval-delta-key-value.js +2 -2
  5. package/packages/algod_client/src/models/eval-delta-key-value.js.map +1 -1
  6. package/packages/algod_client/src/models/eval-delta-key-value.mjs +2 -2
  7. package/packages/algod_client/src/models/eval-delta-key-value.mjs.map +1 -1
  8. package/packages/algod_client/src/models/eval-delta.js +2 -2
  9. package/packages/algod_client/src/models/eval-delta.js.map +1 -1
  10. package/packages/algod_client/src/models/eval-delta.mjs +2 -2
  11. package/packages/algod_client/src/models/eval-delta.mjs.map +1 -1
  12. package/packages/common/src/codecs/primitives/bytes-base64.js +26 -0
  13. package/packages/common/src/codecs/primitives/bytes-base64.js.map +1 -0
  14. package/packages/common/src/codecs/primitives/bytes-base64.mjs +25 -0
  15. package/packages/common/src/codecs/primitives/bytes-base64.mjs.map +1 -0
  16. package/packages/transact/src/logicsig.d.ts +36 -22
  17. package/packages/transact/src/logicsig.js +69 -52
  18. package/packages/transact/src/logicsig.js.map +1 -1
  19. package/packages/transact/src/logicsig.mjs +70 -54
  20. package/packages/transact/src/logicsig.mjs.map +1 -1
  21. package/packages/transact/src/multisig.d.ts +4 -1
  22. package/packages/transact/src/multisig.js +17 -0
  23. package/packages/transact/src/multisig.js.map +1 -1
  24. package/packages/transact/src/multisig.mjs +17 -0
  25. package/packages/transact/src/multisig.mjs.map +1 -1
  26. package/packages/transact/src/signer.js +4 -1
  27. package/packages/transact/src/signer.js.map +1 -1
  28. package/packages/transact/src/signer.mjs +4 -1
  29. package/packages/transact/src/signer.mjs.map +1 -1
  30. package/packages/transact/src/transactions/signed-transaction-meta.js +6 -6
  31. package/packages/transact/src/transactions/signed-transaction-meta.js.map +1 -1
  32. package/packages/transact/src/transactions/signed-transaction-meta.mjs +6 -6
  33. package/packages/transact/src/transactions/signed-transaction-meta.mjs.map +1 -1
  34. package/packages/transact/src/transactions/signed-transaction.d.ts +4 -4
  35. package/packages/transact/src/transactions/signed-transaction.js.map +1 -1
  36. package/packages/transact/src/transactions/signed-transaction.mjs.map +1 -1
  37. package/testing/account.js +4 -2
  38. package/testing/account.js.map +1 -1
  39. package/testing/account.mjs +4 -2
  40. package/testing/account.mjs.map +1 -1
  41. package/transact/index.d.ts +3 -3
  42. package/transact/index.js +2 -1
  43. package/transact/index.mjs +2 -2
  44. package/types/account-manager.d.ts +6 -8
  45. package/types/account-manager.js +13 -3
  46. package/types/account-manager.js.map +1 -1
  47. package/types/account-manager.mjs +13 -3
  48. package/types/account-manager.mjs.map +1 -1
  49. package/types/algorand-client-transaction-creator.d.ts +70 -70
  50. package/types/algorand-client-transaction-sender.d.ts +70 -70
  51. package/types/app-client.d.ts +83 -83
  52. package/types/app-client.js.map +1 -1
  53. package/types/app-client.mjs.map +1 -1
  54. package/types/app-factory.d.ts +48 -48
  55. package/types/testing.d.ts +2 -2
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "**"
7
7
  ],
8
8
  "name": "@algorandfoundation/algokit-utils",
9
- "version": "10.0.0-alpha.23",
9
+ "version": "10.0.0-alpha.25",
10
10
  "private": false,
11
11
  "description": "A set of core Algorand utilities written in TypeScript and released via npm that make it easier to build solutions on Algorand.",
12
12
  "author": "Algorand Foundation",
@@ -1 +1 @@
1
- {"version":3,"file":"block.js","names":["BlockEvalDeltaMeta: ObjectModelMetadata<BlockEvalDelta>","numberCodec","bytesCodec","bigIntCodec","BlockAppEvalDeltaMeta: ObjectModelMetadata<BlockAppEvalDelta>","MapCodec","ObjectModelCodec","ArrayCodec","addressArrayCodec","bytesArrayCodec","BlockStateProofTrackingDataMeta: ObjectModelMetadata<BlockStateProofTrackingData>","ApplyDataMeta: ObjectModelMetadata<ApplyData>","SignedTxnWithADMeta: ObjectModelMetadata<SignedTxnWithAD>","SignedTransactionMeta","SignedTxnInBlockMeta: ObjectModelMetadata<SignedTxnInBlock>","booleanCodec","ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates>","TxnCommitmentsMeta: ObjectModelMetadata<TxnCommitments>","fixedBytes32Codec","fixedBytes64Codec","RewardStateMeta: ObjectModelMetadata<RewardState>","addressCodec","UpgradeStateMeta: ObjectModelMetadata<UpgradeState>","stringCodec","UpgradeVoteMeta: ObjectModelMetadata<UpgradeVote>","BlockMeta: ObjectModelMetadata<Block>"],"sources":["../../../../../packages/algod_client/src/models/block.ts"],"sourcesContent":["import {\n Address,\n ArrayCodec,\n type EncodingFormat,\n MapCodec,\n ObjectModelCodec,\n type ObjectModelMetadata,\n type WireObject,\n addressArrayCodec,\n addressCodec,\n bigIntCodec,\n booleanCodec,\n bytesArrayCodec,\n bytesCodec,\n fixedBytes32Codec,\n fixedBytes64Codec,\n numberCodec,\n stringCodec,\n} from '@algorandfoundation/algokit-common'\nimport { type SignedTransaction, SignedTransactionMeta } from '@algorandfoundation/algokit-transact'\n\n/** BlockEvalDelta represents a TEAL value delta (block/msgpack wire keys). */\nexport type BlockEvalDelta = {\n /** [at] delta action. */\n action: number\n /** [bs] bytes value. */\n bytes?: Uint8Array\n /** [ui] uint value. */\n uint?: bigint\n}\n\nconst BlockEvalDeltaMeta: ObjectModelMetadata<BlockEvalDelta> = {\n name: 'BlockEvalDelta',\n kind: 'object',\n fields: [\n { name: 'action', wireKey: 'at', optional: false, codec: numberCodec },\n { name: 'bytes', wireKey: 'bs', optional: true, codec: bytesCodec },\n { name: 'uint', wireKey: 'ui', optional: true, codec: bigIntCodec },\n ],\n}\n\n/**\n * State changes from application execution, including inner transactions and logs.\n */\nexport type BlockAppEvalDelta = {\n /** [gd] Global state delta for the application. */\n globalDelta?: Map<Uint8Array, BlockEvalDelta>\n /** [ld] Local state deltas keyed by address index. */\n localDeltas?: Map<number, Map<Uint8Array, BlockEvalDelta>>\n /** [itx] Inner transactions produced by this application execution. */\n innerTxns?: SignedTxnWithAD[]\n /** [sa] Shared accounts referenced by local deltas. */\n sharedAccounts?: Address[]\n /** [lg] Application log outputs. */\n logs?: Uint8Array[]\n}\n\nconst BlockAppEvalDeltaMeta: ObjectModelMetadata<BlockAppEvalDelta> = {\n name: 'BlockAppEvalDelta',\n kind: 'object',\n fields: [\n {\n name: 'globalDelta',\n wireKey: 'gd',\n optional: true,\n codec: new MapCodec(bytesCodec, new ObjectModelCodec(BlockEvalDeltaMeta)),\n },\n {\n name: 'localDeltas',\n wireKey: 'ld',\n optional: true,\n codec: new MapCodec(numberCodec, new MapCodec(bytesCodec, new ObjectModelCodec(BlockEvalDeltaMeta))),\n },\n {\n name: 'innerTxns',\n wireKey: 'itx',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(() => SignedTxnWithADMeta)),\n },\n {\n name: 'sharedAccounts',\n wireKey: 'sa',\n optional: true,\n codec: addressArrayCodec,\n },\n { name: 'logs', wireKey: 'lg', optional: true, codec: bytesArrayCodec },\n ],\n}\n\n/** Tracking metadata for a specific StateProofType. */\nexport type BlockStateProofTrackingData = {\n /** [v] Vector commitment root of state proof voters. */\n stateProofVotersCommitment?: Uint8Array\n /** [t] Online total weight during state proof round. */\n stateProofOnlineTotalWeight?: bigint\n /** [n] Next round for which state proofs are accepted. */\n stateProofNextRound?: bigint\n}\n\nconst BlockStateProofTrackingDataMeta: ObjectModelMetadata<BlockStateProofTrackingData> = {\n name: 'BlockStateProofTrackingData',\n kind: 'object',\n fields: [\n { name: 'stateProofVotersCommitment', wireKey: 'v', optional: true, codec: bytesCodec },\n { name: 'stateProofOnlineTotalWeight', wireKey: 't', optional: true, codec: bigIntCodec },\n { name: 'stateProofNextRound', wireKey: 'n', optional: true, codec: bigIntCodec },\n ],\n}\n\nexport type ApplyData = {\n closingAmount?: bigint\n assetClosingAmount?: bigint\n senderRewards?: bigint\n receiverRewards?: bigint\n closeRewards?: bigint\n evalDelta?: BlockAppEvalDelta\n configAsset?: bigint\n applicationId?: bigint\n}\n\nconst ApplyDataMeta: ObjectModelMetadata<ApplyData> = {\n name: 'SignedTxnInBlock',\n kind: 'object',\n fields: [\n { name: 'closingAmount', wireKey: 'ca', optional: true, codec: bigIntCodec },\n { name: 'assetClosingAmount', wireKey: 'aca', optional: true, codec: bigIntCodec },\n { name: 'senderRewards', wireKey: 'rs', optional: true, codec: bigIntCodec },\n { name: 'receiverRewards', wireKey: 'rr', optional: true, codec: bigIntCodec },\n { name: 'closeRewards', wireKey: 'rc', optional: true, codec: bigIntCodec },\n { name: 'evalDelta', wireKey: 'dt', optional: true, codec: new ObjectModelCodec(BlockAppEvalDeltaMeta) },\n { name: 'configAsset', wireKey: 'caid', optional: true, codec: bigIntCodec },\n { name: 'applicationId', wireKey: 'apid', optional: true, codec: bigIntCodec },\n ],\n}\n\n/**\n * SignedTxnWithAD is a SignedTransaction with additional ApplyData.\n */\nexport type SignedTxnWithAD = {\n /** The signed transaction. */\n signedTxn: SignedTransaction\n /** Apply data containing transaction execution information. */\n applyData?: ApplyData\n}\n\nconst SignedTxnWithADMeta: ObjectModelMetadata<SignedTxnWithAD> = {\n name: 'SignedTxnWithAD',\n kind: 'object',\n fields: [\n {\n name: 'signedTxn',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(SignedTransactionMeta),\n },\n {\n name: 'applyData',\n flattened: true,\n optional: true,\n codec: new ObjectModelCodec(ApplyDataMeta),\n },\n ],\n}\n\n/**\n * SignedTxnInBlock is a SignedTransaction with additional ApplyData and block-specific metadata.\n */\nexport type SignedTxnInBlock = {\n signedTxn: SignedTxnWithAD\n hasGenesisId?: boolean\n hasGenesisHash?: boolean\n}\n\nconst SignedTxnInBlockMeta: ObjectModelMetadata<SignedTxnInBlock> = {\n name: 'SignedTxnInBlock',\n kind: 'object',\n fields: [\n {\n name: 'signedTxn',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(SignedTxnWithADMeta),\n },\n { name: 'hasGenesisId', wireKey: 'hgi', optional: true, codec: booleanCodec },\n { name: 'hasGenesisHash', wireKey: 'hgh', optional: true, codec: booleanCodec },\n ],\n}\n\nexport type ParticipationUpdates = {\n /** [partupdrmv] Expired participation accounts. */\n expiredParticipationAccounts: string[]\n /** [partupdabs] Absent participation accounts. */\n absentParticipationAccounts: string[]\n}\n\nconst ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates> = {\n name: 'ParticipationUpdates',\n kind: 'object',\n fields: [\n {\n name: 'expiredParticipationAccounts',\n wireKey: 'partupdrmv',\n optional: false,\n codec: addressArrayCodec,\n },\n {\n name: 'absentParticipationAccounts',\n wireKey: 'partupdabs',\n optional: false,\n codec: addressArrayCodec,\n },\n ],\n}\n\n/** Transaction commitment hashes for the block. */\nexport type TxnCommitments = {\n /** [txn] Root of transaction merkle tree using SHA512_256. */\n nativeSha512_256Commitment: Uint8Array\n /** [txn256] Root of transaction vector commitment using SHA256. */\n sha256Commitment?: Uint8Array\n /** [txn512] Root of transaction vector commitment using SHA512. */\n sha512Commitment?: Uint8Array\n}\n\nconst TxnCommitmentsMeta: ObjectModelMetadata<TxnCommitments> = {\n name: 'TxnCommitments',\n kind: 'object',\n fields: [\n { name: 'nativeSha512_256Commitment', wireKey: 'txn', optional: false, codec: fixedBytes32Codec },\n { name: 'sha256Commitment', wireKey: 'txn256', optional: true, codec: fixedBytes32Codec },\n { name: 'sha512Commitment', wireKey: 'txn512', optional: true, codec: fixedBytes64Codec },\n ],\n}\n\n/** Reward distribution state for the block. */\nexport type RewardState = {\n /** [fees] FeeSink address. */\n feeSink: Address\n /** [rwd] RewardsPool address. */\n rewardsPool: Address\n /** [earn] Rewards level. */\n rewardsLevel: bigint\n /** [rate] Rewards rate. */\n rewardsRate: bigint\n /** [frac] Rewards residue. */\n rewardsResidue: bigint\n /** [rwcalr] Rewards recalculation round. */\n rewardsRecalculationRound: bigint\n}\n\nconst RewardStateMeta: ObjectModelMetadata<RewardState> = {\n name: 'RewardState',\n kind: 'object',\n fields: [\n { name: 'feeSink', wireKey: 'fees', optional: false, codec: addressCodec },\n { name: 'rewardsPool', wireKey: 'rwd', optional: false, codec: addressCodec },\n { name: 'rewardsLevel', wireKey: 'earn', optional: false, codec: bigIntCodec },\n { name: 'rewardsRate', wireKey: 'rate', optional: false, codec: bigIntCodec },\n { name: 'rewardsResidue', wireKey: 'frac', optional: false, codec: bigIntCodec },\n { name: 'rewardsRecalculationRound', wireKey: 'rwcalr', optional: false, codec: bigIntCodec },\n ],\n}\n\n/** Protocol upgrade state for the block. */\nexport type UpgradeState = {\n /** [proto] Current consensus protocol. */\n currentProtocol: string\n /** [nextproto] Next proposed protocol. */\n nextProtocol?: string\n /** [nextyes] Next protocol approvals. */\n nextProtocolApprovals?: bigint\n /** [nextbefore] Next protocol vote deadline. */\n nextProtocolVoteBefore?: bigint\n /** [nextswitch] Next protocol switch round. */\n nextProtocolSwitchOn?: bigint\n}\n\nconst UpgradeStateMeta: ObjectModelMetadata<UpgradeState> = {\n name: 'UpgradeState',\n kind: 'object',\n fields: [\n { name: 'currentProtocol', wireKey: 'proto', optional: false, codec: stringCodec },\n { name: 'nextProtocol', wireKey: 'nextproto', optional: true, codec: stringCodec },\n { name: 'nextProtocolApprovals', wireKey: 'nextyes', optional: true, codec: bigIntCodec },\n { name: 'nextProtocolVoteBefore', wireKey: 'nextbefore', optional: true, codec: bigIntCodec },\n { name: 'nextProtocolSwitchOn', wireKey: 'nextswitch', optional: true, codec: bigIntCodec },\n ],\n}\n\n/** Protocol upgrade vote parameters for the block. */\nexport type UpgradeVote = {\n /** [upgradeprop] Upgrade proposal. */\n upgradePropose?: string\n /** [upgradedelay] Upgrade delay in rounds. */\n upgradeDelay?: bigint\n /** [upgradeyes] Upgrade approval flag. */\n upgradeApprove?: boolean\n}\n\nconst UpgradeVoteMeta: ObjectModelMetadata<UpgradeVote> = {\n name: 'UpgradeVote',\n kind: 'object',\n fields: [\n { name: 'upgradePropose', wireKey: 'upgradeprop', optional: true, codec: stringCodec },\n { name: 'upgradeDelay', wireKey: 'upgradedelay', optional: true, codec: bigIntCodec },\n { name: 'upgradeApprove', wireKey: 'upgradeyes', optional: true, codec: booleanCodec },\n ],\n}\n\nexport type BlockHeader = {\n /** [rnd] Round number. */\n round: bigint\n /** [prev] Previous block hash. */\n previousBlockHash: Uint8Array\n /** [prev512] Previous block hash using SHA-512. */\n previousBlockHash512?: Uint8Array\n /** [seed] Sortition seed. */\n seed: Uint8Array\n /** Authenticates the set of transactions appearing in the block. */\n txnCommitments: TxnCommitments\n /** [ts] Block timestamp in seconds since epoch. */\n timestamp: bigint\n /** [gen] Genesis ID. */\n genesisId: string\n /** [gh] Genesis hash. */\n genesisHash: Uint8Array\n /** [prp] Proposer address. */\n proposer?: Address\n /** [fc] Fees collected in this block. */\n feesCollected?: bigint\n /** [bi] Bonus incentive for block proposal. */\n bonus?: bigint\n /** [pp] Proposer payout. */\n proposerPayout?: bigint\n /** Reward distribution state. */\n rewardState: RewardState\n /** Protocol upgrade state. */\n upgradeState: UpgradeState\n /** Protocol upgrade vote parameters. */\n upgradeVote?: UpgradeVote\n /** [tc] Transaction counter. */\n txnCounter?: bigint\n /** [spt] State proof tracking data keyed by state proof type. */\n stateProofTracking?: Map<number, BlockStateProofTrackingData>\n /** Represents participation account data that needs to be checked/acted on by the network */\n participationUpdates: ParticipationUpdates\n}\n\nconst BlockHeaderMeta: ObjectModelMetadata<BlockHeader> = {\n name: 'BlockHeader',\n kind: 'object',\n fields: [\n { name: 'round', wireKey: 'rnd', optional: false, codec: bigIntCodec },\n { name: 'previousBlockHash', wireKey: 'prev', optional: false, codec: fixedBytes32Codec },\n { name: 'previousBlockHash512', wireKey: 'prev512', optional: true, codec: fixedBytes64Codec },\n { name: 'seed', wireKey: 'seed', optional: false, codec: bytesCodec },\n {\n name: 'txnCommitments',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(TxnCommitmentsMeta),\n },\n { name: 'timestamp', wireKey: 'ts', optional: false, codec: bigIntCodec },\n { name: 'genesisId', wireKey: 'gen', optional: false, codec: stringCodec },\n { name: 'genesisHash', wireKey: 'gh', optional: false, codec: fixedBytes32Codec },\n { name: 'proposer', wireKey: 'prp', optional: true, codec: addressCodec },\n { name: 'feesCollected', wireKey: 'fc', optional: true, codec: bigIntCodec },\n { name: 'bonus', wireKey: 'bi', optional: true, codec: bigIntCodec },\n { name: 'proposerPayout', wireKey: 'pp', optional: true, codec: bigIntCodec },\n {\n name: 'rewardState',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(RewardStateMeta),\n },\n {\n name: 'upgradeState',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(UpgradeStateMeta),\n },\n {\n name: 'upgradeVote',\n flattened: true,\n optional: true,\n codec: new ObjectModelCodec(UpgradeVoteMeta),\n },\n { name: 'txnCounter', wireKey: 'tc', optional: true, codec: bigIntCodec },\n {\n name: 'stateProofTracking',\n wireKey: 'spt',\n optional: true,\n codec: new MapCodec(numberCodec, new ObjectModelCodec(BlockStateProofTrackingDataMeta)),\n },\n {\n name: 'participationUpdates',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(ParticipationUpdatesMeta),\n },\n ],\n}\n\n/**\n * Block contains the BlockHeader and the list of transactions (Payset).\n */\nexport type Block = {\n /** The block information (Header) */\n header: BlockHeader\n\n /** [txns] Block transactions (Payset). */\n payset: SignedTxnInBlock[]\n}\n\nconst BlockMeta: ObjectModelMetadata<Block> = {\n name: 'Block',\n kind: 'object',\n fields: [\n { name: 'header', flattened: true, optional: false, codec: new ObjectModelCodec(BlockHeaderMeta) },\n {\n name: 'payset',\n wireKey: 'txns',\n optional: false,\n codec: new ArrayCodec(new ObjectModelCodec(SignedTxnInBlockMeta)),\n },\n ],\n}\n\n/**\n * Custom codec for Block that populates genesis information on transactions after decoding.\n *\n * When blocks are returned from algod, transactions may not include the genesisId\n * and genesisHash fields even though they are required for correct transaction ID calculation.\n * The block contains `hasGenesisId` and `hasGenesisHash` flags that indicate whether these\n * fields should be populated from the block header.\n *\n * This codec automatically populates these fields after decoding to ensure transaction IDs\n * can be calculated correctly.\n */\nclass BlockCodec extends ObjectModelCodec<Block> {\n constructor() {\n super(BlockMeta)\n }\n\n protected fromEncoded(value: WireObject, format: EncodingFormat): Block {\n const block = super.fromEncoded(value, format)\n\n // Populate genesis id and hash on transactions if required to ensure tx id's are correct\n const genesisId = block.header.genesisId\n const genesisHash = block.header.genesisHash\n\n for (const txnInBlock of block.payset ?? []) {\n const txn = txnInBlock.signedTxn.signedTxn.txn\n\n if (txnInBlock.hasGenesisId && txn.genesisId === undefined) {\n txn.genesisId = genesisId\n }\n\n // The following assumes that Consensus.RequireGenesisHash is true\n // so assigns genesis hash unless explicitly set to false\n if (txnInBlock.hasGenesisHash !== false && txn.genesisHash === undefined) {\n txn.genesisHash = genesisHash\n }\n }\n\n return block\n }\n}\n\nexport const blockCodec = new BlockCodec()\n"],"mappings":";;;;;;;;;;;;;AA+BA,MAAMA,qBAA0D;CAC9D,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GAAE,MAAM;GAAU,SAAS;GAAM,UAAU;GAAO,OAAOC;GAAa;EACtE;GAAE,MAAM;GAAS,SAAS;GAAM,UAAU;GAAM,OAAOC;GAAY;EACnE;GAAE,MAAM;GAAQ,SAAS;GAAM,UAAU;GAAM,OAAOC;GAAa;EACpE;CACF;AAkBD,MAAMC,wBAAgE;CACpE,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIC,qBAASH,0BAAY,IAAII,sCAAiB,mBAAmB,CAAC;GAC1E;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAID,qBAASJ,4BAAa,IAAII,qBAASH,0BAAY,IAAII,sCAAiB,mBAAmB,CAAC,CAAC;GACrG;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIC,yBAAW,IAAID,4CAAuB,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AAI,YAAY;AAKlB,OAAI,WAAW,mBAAmB,SAAS,IAAI,gBAAgB,OAC7D,KAAI,cAAc;;AAItB,SAAO;;;AAIX,MAAa,aAAa,IAAI,YAAY"}
1
+ {"version":3,"file":"block.js","names":["BlockEvalDeltaMeta: ObjectModelMetadata<BlockEvalDelta>","numberCodec","bytesCodec","bigIntCodec","BlockAppEvalDeltaMeta: ObjectModelMetadata<BlockAppEvalDelta>","MapCodec","ObjectModelCodec","ArrayCodec","addressArrayCodec","bytesArrayCodec","BlockStateProofTrackingDataMeta: ObjectModelMetadata<BlockStateProofTrackingData>","ApplyDataMeta: ObjectModelMetadata<ApplyData>","SignedTxnWithADMeta: ObjectModelMetadata<SignedTxnWithAD>","SignedTransactionMeta","SignedTxnInBlockMeta: ObjectModelMetadata<SignedTxnInBlock>","booleanCodec","ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates>","TxnCommitmentsMeta: ObjectModelMetadata<TxnCommitments>","fixedBytes32Codec","fixedBytes64Codec","RewardStateMeta: ObjectModelMetadata<RewardState>","addressCodec","UpgradeStateMeta: ObjectModelMetadata<UpgradeState>","stringCodec","UpgradeVoteMeta: ObjectModelMetadata<UpgradeVote>","BlockMeta: ObjectModelMetadata<Block>"],"sources":["../../../../../packages/algod_client/src/models/block.ts"],"sourcesContent":["import {\n Address,\n ArrayCodec,\n MapCodec,\n ObjectModelCodec,\n type EncodingFormat,\n type ObjectModelMetadata,\n type WireObject,\n addressArrayCodec,\n addressCodec,\n bigIntCodec,\n booleanCodec,\n bytesArrayCodec,\n bytesCodec,\n fixedBytes32Codec,\n fixedBytes64Codec,\n numberCodec,\n stringCodec,\n} from '@algorandfoundation/algokit-common'\nimport { type SignedTransaction, SignedTransactionMeta } from '@algorandfoundation/algokit-transact'\n\n/** BlockEvalDelta represents a TEAL value delta (block/msgpack wire keys). */\nexport type BlockEvalDelta = {\n /** [at] delta action. */\n action: number\n /** [bs] bytes value. */\n bytes?: Uint8Array\n /** [ui] uint value. */\n uint?: bigint\n}\n\nconst BlockEvalDeltaMeta: ObjectModelMetadata<BlockEvalDelta> = {\n name: 'BlockEvalDelta',\n kind: 'object',\n fields: [\n { name: 'action', wireKey: 'at', optional: false, codec: numberCodec },\n { name: 'bytes', wireKey: 'bs', optional: true, codec: bytesCodec },\n { name: 'uint', wireKey: 'ui', optional: true, codec: bigIntCodec },\n ],\n}\n\n/**\n * State changes from application execution, including inner transactions and logs.\n */\nexport type BlockAppEvalDelta = {\n /** [gd] Global state delta for the application. */\n globalDelta?: Map<Uint8Array, BlockEvalDelta>\n /** [ld] Local state deltas keyed by address index. */\n localDeltas?: Map<number, Map<Uint8Array, BlockEvalDelta>>\n /** [itx] Inner transactions produced by this application execution. */\n innerTxns?: SignedTxnWithAD[]\n /** [sa] Shared accounts referenced by local deltas. */\n sharedAccounts?: Address[]\n /** [lg] Application log outputs. */\n logs?: Uint8Array[]\n}\n\nconst BlockAppEvalDeltaMeta: ObjectModelMetadata<BlockAppEvalDelta> = {\n name: 'BlockAppEvalDelta',\n kind: 'object',\n fields: [\n {\n name: 'globalDelta',\n wireKey: 'gd',\n optional: true,\n codec: new MapCodec(bytesCodec, new ObjectModelCodec(BlockEvalDeltaMeta)),\n },\n {\n name: 'localDeltas',\n wireKey: 'ld',\n optional: true,\n codec: new MapCodec(numberCodec, new MapCodec(bytesCodec, new ObjectModelCodec(BlockEvalDeltaMeta))),\n },\n {\n name: 'innerTxns',\n wireKey: 'itx',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(() => SignedTxnWithADMeta)),\n },\n {\n name: 'sharedAccounts',\n wireKey: 'sa',\n optional: true,\n codec: addressArrayCodec,\n },\n { name: 'logs', wireKey: 'lg', optional: true, codec: bytesArrayCodec },\n ],\n}\n\n/** Tracking metadata for a specific StateProofType. */\nexport type BlockStateProofTrackingData = {\n /** [v] Vector commitment root of state proof voters. */\n stateProofVotersCommitment?: Uint8Array\n /** [t] Online total weight during state proof round. */\n stateProofOnlineTotalWeight?: bigint\n /** [n] Next round for which state proofs are accepted. */\n stateProofNextRound?: bigint\n}\n\nconst BlockStateProofTrackingDataMeta: ObjectModelMetadata<BlockStateProofTrackingData> = {\n name: 'BlockStateProofTrackingData',\n kind: 'object',\n fields: [\n { name: 'stateProofVotersCommitment', wireKey: 'v', optional: true, codec: bytesCodec },\n { name: 'stateProofOnlineTotalWeight', wireKey: 't', optional: true, codec: bigIntCodec },\n { name: 'stateProofNextRound', wireKey: 'n', optional: true, codec: bigIntCodec },\n ],\n}\n\nexport type ApplyData = {\n closingAmount?: bigint\n assetClosingAmount?: bigint\n senderRewards?: bigint\n receiverRewards?: bigint\n closeRewards?: bigint\n evalDelta?: BlockAppEvalDelta\n configAsset?: bigint\n applicationId?: bigint\n}\n\nconst ApplyDataMeta: ObjectModelMetadata<ApplyData> = {\n name: 'SignedTxnInBlock',\n kind: 'object',\n fields: [\n { name: 'closingAmount', wireKey: 'ca', optional: true, codec: bigIntCodec },\n { name: 'assetClosingAmount', wireKey: 'aca', optional: true, codec: bigIntCodec },\n { name: 'senderRewards', wireKey: 'rs', optional: true, codec: bigIntCodec },\n { name: 'receiverRewards', wireKey: 'rr', optional: true, codec: bigIntCodec },\n { name: 'closeRewards', wireKey: 'rc', optional: true, codec: bigIntCodec },\n { name: 'evalDelta', wireKey: 'dt', optional: true, codec: new ObjectModelCodec(BlockAppEvalDeltaMeta) },\n { name: 'configAsset', wireKey: 'caid', optional: true, codec: bigIntCodec },\n { name: 'applicationId', wireKey: 'apid', optional: true, codec: bigIntCodec },\n ],\n}\n\n/**\n * SignedTxnWithAD is a SignedTransaction with additional ApplyData.\n */\nexport type SignedTxnWithAD = {\n /** The signed transaction. */\n signedTxn: SignedTransaction\n /** Apply data containing transaction execution information. */\n applyData?: ApplyData\n}\n\nconst SignedTxnWithADMeta: ObjectModelMetadata<SignedTxnWithAD> = {\n name: 'SignedTxnWithAD',\n kind: 'object',\n fields: [\n {\n name: 'signedTxn',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(SignedTransactionMeta),\n },\n {\n name: 'applyData',\n flattened: true,\n optional: true,\n codec: new ObjectModelCodec(ApplyDataMeta),\n },\n ],\n}\n\n/**\n * SignedTxnInBlock is a SignedTransaction with additional ApplyData and block-specific metadata.\n */\nexport type SignedTxnInBlock = {\n signedTxn: SignedTxnWithAD\n hasGenesisId?: boolean\n hasGenesisHash?: boolean\n}\n\nconst SignedTxnInBlockMeta: ObjectModelMetadata<SignedTxnInBlock> = {\n name: 'SignedTxnInBlock',\n kind: 'object',\n fields: [\n {\n name: 'signedTxn',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(SignedTxnWithADMeta),\n },\n { name: 'hasGenesisId', wireKey: 'hgi', optional: true, codec: booleanCodec },\n { name: 'hasGenesisHash', wireKey: 'hgh', optional: true, codec: booleanCodec },\n ],\n}\n\nexport type ParticipationUpdates = {\n /** [partupdrmv] Expired participation accounts. */\n expiredParticipationAccounts: string[]\n /** [partupdabs] Absent participation accounts. */\n absentParticipationAccounts: string[]\n}\n\nconst ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates> = {\n name: 'ParticipationUpdates',\n kind: 'object',\n fields: [\n {\n name: 'expiredParticipationAccounts',\n wireKey: 'partupdrmv',\n optional: false,\n codec: addressArrayCodec,\n },\n {\n name: 'absentParticipationAccounts',\n wireKey: 'partupdabs',\n optional: false,\n codec: addressArrayCodec,\n },\n ],\n}\n\n/** Transaction commitment hashes for the block. */\nexport type TxnCommitments = {\n /** [txn] Root of transaction merkle tree using SHA512_256. */\n nativeSha512_256Commitment: Uint8Array\n /** [txn256] Root of transaction vector commitment using SHA256. */\n sha256Commitment?: Uint8Array\n /** [txn512] Root of transaction vector commitment using SHA512. */\n sha512Commitment?: Uint8Array\n}\n\nconst TxnCommitmentsMeta: ObjectModelMetadata<TxnCommitments> = {\n name: 'TxnCommitments',\n kind: 'object',\n fields: [\n { name: 'nativeSha512_256Commitment', wireKey: 'txn', optional: false, codec: fixedBytes32Codec },\n { name: 'sha256Commitment', wireKey: 'txn256', optional: true, codec: fixedBytes32Codec },\n { name: 'sha512Commitment', wireKey: 'txn512', optional: true, codec: fixedBytes64Codec },\n ],\n}\n\n/** Reward distribution state for the block. */\nexport type RewardState = {\n /** [fees] FeeSink address. */\n feeSink: Address\n /** [rwd] RewardsPool address. */\n rewardsPool: Address\n /** [earn] Rewards level. */\n rewardsLevel: bigint\n /** [rate] Rewards rate. */\n rewardsRate: bigint\n /** [frac] Rewards residue. */\n rewardsResidue: bigint\n /** [rwcalr] Rewards recalculation round. */\n rewardsRecalculationRound: bigint\n}\n\nconst RewardStateMeta: ObjectModelMetadata<RewardState> = {\n name: 'RewardState',\n kind: 'object',\n fields: [\n { name: 'feeSink', wireKey: 'fees', optional: false, codec: addressCodec },\n { name: 'rewardsPool', wireKey: 'rwd', optional: false, codec: addressCodec },\n { name: 'rewardsLevel', wireKey: 'earn', optional: false, codec: bigIntCodec },\n { name: 'rewardsRate', wireKey: 'rate', optional: false, codec: bigIntCodec },\n { name: 'rewardsResidue', wireKey: 'frac', optional: false, codec: bigIntCodec },\n { name: 'rewardsRecalculationRound', wireKey: 'rwcalr', optional: false, codec: bigIntCodec },\n ],\n}\n\n/** Protocol upgrade state for the block. */\nexport type UpgradeState = {\n /** [proto] Current consensus protocol. */\n currentProtocol: string\n /** [nextproto] Next proposed protocol. */\n nextProtocol?: string\n /** [nextyes] Next protocol approvals. */\n nextProtocolApprovals?: bigint\n /** [nextbefore] Next protocol vote deadline. */\n nextProtocolVoteBefore?: bigint\n /** [nextswitch] Next protocol switch round. */\n nextProtocolSwitchOn?: bigint\n}\n\nconst UpgradeStateMeta: ObjectModelMetadata<UpgradeState> = {\n name: 'UpgradeState',\n kind: 'object',\n fields: [\n { name: 'currentProtocol', wireKey: 'proto', optional: false, codec: stringCodec },\n { name: 'nextProtocol', wireKey: 'nextproto', optional: true, codec: stringCodec },\n { name: 'nextProtocolApprovals', wireKey: 'nextyes', optional: true, codec: bigIntCodec },\n { name: 'nextProtocolVoteBefore', wireKey: 'nextbefore', optional: true, codec: bigIntCodec },\n { name: 'nextProtocolSwitchOn', wireKey: 'nextswitch', optional: true, codec: bigIntCodec },\n ],\n}\n\n/** Protocol upgrade vote parameters for the block. */\nexport type UpgradeVote = {\n /** [upgradeprop] Upgrade proposal. */\n upgradePropose?: string\n /** [upgradedelay] Upgrade delay in rounds. */\n upgradeDelay?: bigint\n /** [upgradeyes] Upgrade approval flag. */\n upgradeApprove?: boolean\n}\n\nconst UpgradeVoteMeta: ObjectModelMetadata<UpgradeVote> = {\n name: 'UpgradeVote',\n kind: 'object',\n fields: [\n { name: 'upgradePropose', wireKey: 'upgradeprop', optional: true, codec: stringCodec },\n { name: 'upgradeDelay', wireKey: 'upgradedelay', optional: true, codec: bigIntCodec },\n { name: 'upgradeApprove', wireKey: 'upgradeyes', optional: true, codec: booleanCodec },\n ],\n}\n\nexport type BlockHeader = {\n /** [rnd] Round number. */\n round: bigint\n /** [prev] Previous block hash. */\n previousBlockHash: Uint8Array\n /** [prev512] Previous block hash using SHA-512. */\n previousBlockHash512?: Uint8Array\n /** [seed] Sortition seed. */\n seed: Uint8Array\n /** Authenticates the set of transactions appearing in the block. */\n txnCommitments: TxnCommitments\n /** [ts] Block timestamp in seconds since epoch. */\n timestamp: bigint\n /** [gen] Genesis ID. */\n genesisId: string\n /** [gh] Genesis hash. */\n genesisHash: Uint8Array\n /** [prp] Proposer address. */\n proposer?: Address\n /** [fc] Fees collected in this block. */\n feesCollected?: bigint\n /** [bi] Bonus incentive for block proposal. */\n bonus?: bigint\n /** [pp] Proposer payout. */\n proposerPayout?: bigint\n /** Reward distribution state. */\n rewardState: RewardState\n /** Protocol upgrade state. */\n upgradeState: UpgradeState\n /** Protocol upgrade vote parameters. */\n upgradeVote?: UpgradeVote\n /** [tc] Transaction counter. */\n txnCounter?: bigint\n /** [spt] State proof tracking data keyed by state proof type. */\n stateProofTracking?: Map<number, BlockStateProofTrackingData>\n /** Represents participation account data that needs to be checked/acted on by the network */\n participationUpdates: ParticipationUpdates\n}\n\nconst BlockHeaderMeta: ObjectModelMetadata<BlockHeader> = {\n name: 'BlockHeader',\n kind: 'object',\n fields: [\n { name: 'round', wireKey: 'rnd', optional: false, codec: bigIntCodec },\n { name: 'previousBlockHash', wireKey: 'prev', optional: false, codec: fixedBytes32Codec },\n { name: 'previousBlockHash512', wireKey: 'prev512', optional: true, codec: fixedBytes64Codec },\n { name: 'seed', wireKey: 'seed', optional: false, codec: bytesCodec },\n {\n name: 'txnCommitments',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(TxnCommitmentsMeta),\n },\n { name: 'timestamp', wireKey: 'ts', optional: false, codec: bigIntCodec },\n { name: 'genesisId', wireKey: 'gen', optional: false, codec: stringCodec },\n { name: 'genesisHash', wireKey: 'gh', optional: false, codec: fixedBytes32Codec },\n { name: 'proposer', wireKey: 'prp', optional: true, codec: addressCodec },\n { name: 'feesCollected', wireKey: 'fc', optional: true, codec: bigIntCodec },\n { name: 'bonus', wireKey: 'bi', optional: true, codec: bigIntCodec },\n { name: 'proposerPayout', wireKey: 'pp', optional: true, codec: bigIntCodec },\n {\n name: 'rewardState',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(RewardStateMeta),\n },\n {\n name: 'upgradeState',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(UpgradeStateMeta),\n },\n {\n name: 'upgradeVote',\n flattened: true,\n optional: true,\n codec: new ObjectModelCodec(UpgradeVoteMeta),\n },\n { name: 'txnCounter', wireKey: 'tc', optional: true, codec: bigIntCodec },\n {\n name: 'stateProofTracking',\n wireKey: 'spt',\n optional: true,\n codec: new MapCodec(numberCodec, new ObjectModelCodec(BlockStateProofTrackingDataMeta)),\n },\n {\n name: 'participationUpdates',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(ParticipationUpdatesMeta),\n },\n ],\n}\n\n/**\n * Block contains the BlockHeader and the list of transactions (Payset).\n */\nexport type Block = {\n /** The block information (Header) */\n header: BlockHeader\n\n /** [txns] Block transactions (Payset). */\n payset: SignedTxnInBlock[]\n}\n\nconst BlockMeta: ObjectModelMetadata<Block> = {\n name: 'Block',\n kind: 'object',\n fields: [\n { name: 'header', flattened: true, optional: false, codec: new ObjectModelCodec(BlockHeaderMeta) },\n {\n name: 'payset',\n wireKey: 'txns',\n optional: false,\n codec: new ArrayCodec(new ObjectModelCodec(SignedTxnInBlockMeta)),\n },\n ],\n}\n\n/**\n * Custom codec for Block that populates genesis information on transactions after decoding.\n *\n * When blocks are returned from algod, transactions may not include the genesisId\n * and genesisHash fields even though they are required for correct transaction ID calculation.\n * The block contains `hasGenesisId` and `hasGenesisHash` flags that indicate whether these\n * fields should be populated from the block header.\n *\n * This codec automatically populates these fields after decoding to ensure transaction IDs\n * can be calculated correctly.\n */\nclass BlockCodec extends ObjectModelCodec<Block> {\n constructor() {\n super(BlockMeta)\n }\n\n protected fromEncoded(value: WireObject, format: EncodingFormat): Block {\n const block = super.fromEncoded(value, format)\n\n // Populate genesis id and hash on transactions if required to ensure tx id's are correct\n const genesisId = block.header.genesisId\n const genesisHash = block.header.genesisHash\n\n for (const txnInBlock of block.payset ?? []) {\n const txn = txnInBlock.signedTxn.signedTxn.txn\n\n if (txnInBlock.hasGenesisId && txn.genesisId === undefined) {\n txn.genesisId = genesisId\n }\n\n // The following assumes that Consensus.RequireGenesisHash is true\n // so assigns genesis hash unless explicitly set to false\n if (txnInBlock.hasGenesisHash !== false && txn.genesisHash === undefined) {\n txn.genesisHash = genesisHash\n }\n }\n\n return block\n }\n}\n\nexport const blockCodec = new BlockCodec()\n"],"mappings":";;;;;;;;;;;;;AA+BA,MAAMA,qBAA0D;CAC9D,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GAAE,MAAM;GAAU,SAAS;GAAM,UAAU;GAAO,OAAOC;GAAa;EACtE;GAAE,MAAM;GAAS,SAAS;GAAM,UAAU;GAAM,OAAOC;GAAY;EACnE;GAAE,MAAM;GAAQ,SAAS;GAAM,UAAU;GAAM,OAAO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AAiB,qBAAqB,CAAC;EAClE,CACF;CACF;;;;;;;;;;;;AAaD,IAAM,aAAN,cAAyBA,sCAAwB;CAC/C,cAAc;AACZ,QAAM,UAAU;;CAGlB,AAAU,YAAY,OAAmB,QAA+B;EACtE,MAAM,QAAQ,MAAM,YAAY,OAAO,OAAO;EAG9C,MAAM,YAAY,MAAM,OAAO;EAC/B,MAAM,cAAc,MAAM,OAAO;AAEjC,OAAK,MAAM,cAAc,MAAM,UAAU,EAAE,EAAE;GAC3C,MAAM,MAAM,WAAW,UAAU,UAAU;AAE3C,OAAI,WAAW,gBAAgB,IAAI,cAAc,OAC/C,KAAI,YAAY;AAKlB,OAAI,WAAW,mBAAmB,SAAS,IAAI,gBAAgB,OAC7D,KAAI,cAAc;;AAItB,SAAO;;;AAIX,MAAa,aAAa,IAAI,YAAY"}
@@ -1 +1 @@
1
- {"version":3,"file":"block.mjs","names":["BlockEvalDeltaMeta: ObjectModelMetadata<BlockEvalDelta>","BlockAppEvalDeltaMeta: ObjectModelMetadata<BlockAppEvalDelta>","BlockStateProofTrackingDataMeta: ObjectModelMetadata<BlockStateProofTrackingData>","ApplyDataMeta: ObjectModelMetadata<ApplyData>","SignedTxnWithADMeta: ObjectModelMetadata<SignedTxnWithAD>","SignedTxnInBlockMeta: ObjectModelMetadata<SignedTxnInBlock>","ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates>","TxnCommitmentsMeta: ObjectModelMetadata<TxnCommitments>","RewardStateMeta: ObjectModelMetadata<RewardState>","UpgradeStateMeta: ObjectModelMetadata<UpgradeState>","UpgradeVoteMeta: ObjectModelMetadata<UpgradeVote>","BlockMeta: ObjectModelMetadata<Block>"],"sources":["../../../../../packages/algod_client/src/models/block.ts"],"sourcesContent":["import {\n Address,\n ArrayCodec,\n type EncodingFormat,\n MapCodec,\n ObjectModelCodec,\n type ObjectModelMetadata,\n type WireObject,\n addressArrayCodec,\n addressCodec,\n bigIntCodec,\n booleanCodec,\n bytesArrayCodec,\n bytesCodec,\n fixedBytes32Codec,\n fixedBytes64Codec,\n numberCodec,\n stringCodec,\n} from '@algorandfoundation/algokit-common'\nimport { type SignedTransaction, SignedTransactionMeta } from '@algorandfoundation/algokit-transact'\n\n/** BlockEvalDelta represents a TEAL value delta (block/msgpack wire keys). */\nexport type BlockEvalDelta = {\n /** [at] delta action. */\n action: number\n /** [bs] bytes value. */\n bytes?: Uint8Array\n /** [ui] uint value. */\n uint?: bigint\n}\n\nconst BlockEvalDeltaMeta: ObjectModelMetadata<BlockEvalDelta> = {\n name: 'BlockEvalDelta',\n kind: 'object',\n fields: [\n { name: 'action', wireKey: 'at', optional: false, codec: numberCodec },\n { name: 'bytes', wireKey: 'bs', optional: true, codec: bytesCodec },\n { name: 'uint', wireKey: 'ui', optional: true, codec: bigIntCodec },\n ],\n}\n\n/**\n * State changes from application execution, including inner transactions and logs.\n */\nexport type BlockAppEvalDelta = {\n /** [gd] Global state delta for the application. */\n globalDelta?: Map<Uint8Array, BlockEvalDelta>\n /** [ld] Local state deltas keyed by address index. */\n localDeltas?: Map<number, Map<Uint8Array, BlockEvalDelta>>\n /** [itx] Inner transactions produced by this application execution. */\n innerTxns?: SignedTxnWithAD[]\n /** [sa] Shared accounts referenced by local deltas. */\n sharedAccounts?: Address[]\n /** [lg] Application log outputs. */\n logs?: Uint8Array[]\n}\n\nconst BlockAppEvalDeltaMeta: ObjectModelMetadata<BlockAppEvalDelta> = {\n name: 'BlockAppEvalDelta',\n kind: 'object',\n fields: [\n {\n name: 'globalDelta',\n wireKey: 'gd',\n optional: true,\n codec: new MapCodec(bytesCodec, new ObjectModelCodec(BlockEvalDeltaMeta)),\n },\n {\n name: 'localDeltas',\n wireKey: 'ld',\n optional: true,\n codec: new MapCodec(numberCodec, new MapCodec(bytesCodec, new ObjectModelCodec(BlockEvalDeltaMeta))),\n },\n {\n name: 'innerTxns',\n wireKey: 'itx',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(() => SignedTxnWithADMeta)),\n },\n {\n name: 'sharedAccounts',\n wireKey: 'sa',\n optional: true,\n codec: addressArrayCodec,\n },\n { name: 'logs', wireKey: 'lg', optional: true, codec: bytesArrayCodec },\n ],\n}\n\n/** Tracking metadata for a specific StateProofType. */\nexport type BlockStateProofTrackingData = {\n /** [v] Vector commitment root of state proof voters. */\n stateProofVotersCommitment?: Uint8Array\n /** [t] Online total weight during state proof round. */\n stateProofOnlineTotalWeight?: bigint\n /** [n] Next round for which state proofs are accepted. */\n stateProofNextRound?: bigint\n}\n\nconst BlockStateProofTrackingDataMeta: ObjectModelMetadata<BlockStateProofTrackingData> = {\n name: 'BlockStateProofTrackingData',\n kind: 'object',\n fields: [\n { name: 'stateProofVotersCommitment', wireKey: 'v', optional: true, codec: bytesCodec },\n { name: 'stateProofOnlineTotalWeight', wireKey: 't', optional: true, codec: bigIntCodec },\n { name: 'stateProofNextRound', wireKey: 'n', optional: true, codec: bigIntCodec },\n ],\n}\n\nexport type ApplyData = {\n closingAmount?: bigint\n assetClosingAmount?: bigint\n senderRewards?: bigint\n receiverRewards?: bigint\n closeRewards?: bigint\n evalDelta?: BlockAppEvalDelta\n configAsset?: bigint\n applicationId?: bigint\n}\n\nconst ApplyDataMeta: ObjectModelMetadata<ApplyData> = {\n name: 'SignedTxnInBlock',\n kind: 'object',\n fields: [\n { name: 'closingAmount', wireKey: 'ca', optional: true, codec: bigIntCodec },\n { name: 'assetClosingAmount', wireKey: 'aca', optional: true, codec: bigIntCodec },\n { name: 'senderRewards', wireKey: 'rs', optional: true, codec: bigIntCodec },\n { name: 'receiverRewards', wireKey: 'rr', optional: true, codec: bigIntCodec },\n { name: 'closeRewards', wireKey: 'rc', optional: true, codec: bigIntCodec },\n { name: 'evalDelta', wireKey: 'dt', optional: true, codec: new ObjectModelCodec(BlockAppEvalDeltaMeta) },\n { name: 'configAsset', wireKey: 'caid', optional: true, codec: bigIntCodec },\n { name: 'applicationId', wireKey: 'apid', optional: true, codec: bigIntCodec },\n ],\n}\n\n/**\n * SignedTxnWithAD is a SignedTransaction with additional ApplyData.\n */\nexport type SignedTxnWithAD = {\n /** The signed transaction. */\n signedTxn: SignedTransaction\n /** Apply data containing transaction execution information. */\n applyData?: ApplyData\n}\n\nconst SignedTxnWithADMeta: ObjectModelMetadata<SignedTxnWithAD> = {\n name: 'SignedTxnWithAD',\n kind: 'object',\n fields: [\n {\n name: 'signedTxn',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(SignedTransactionMeta),\n },\n {\n name: 'applyData',\n flattened: true,\n optional: true,\n codec: new ObjectModelCodec(ApplyDataMeta),\n },\n ],\n}\n\n/**\n * SignedTxnInBlock is a SignedTransaction with additional ApplyData and block-specific metadata.\n */\nexport type SignedTxnInBlock = {\n signedTxn: SignedTxnWithAD\n hasGenesisId?: boolean\n hasGenesisHash?: boolean\n}\n\nconst SignedTxnInBlockMeta: ObjectModelMetadata<SignedTxnInBlock> = {\n name: 'SignedTxnInBlock',\n kind: 'object',\n fields: [\n {\n name: 'signedTxn',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(SignedTxnWithADMeta),\n },\n { name: 'hasGenesisId', wireKey: 'hgi', optional: true, codec: booleanCodec },\n { name: 'hasGenesisHash', wireKey: 'hgh', optional: true, codec: booleanCodec },\n ],\n}\n\nexport type ParticipationUpdates = {\n /** [partupdrmv] Expired participation accounts. */\n expiredParticipationAccounts: string[]\n /** [partupdabs] Absent participation accounts. */\n absentParticipationAccounts: string[]\n}\n\nconst ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates> = {\n name: 'ParticipationUpdates',\n kind: 'object',\n fields: [\n {\n name: 'expiredParticipationAccounts',\n wireKey: 'partupdrmv',\n optional: false,\n codec: addressArrayCodec,\n },\n {\n name: 'absentParticipationAccounts',\n wireKey: 'partupdabs',\n optional: false,\n codec: addressArrayCodec,\n },\n ],\n}\n\n/** Transaction commitment hashes for the block. */\nexport type TxnCommitments = {\n /** [txn] Root of transaction merkle tree using SHA512_256. */\n nativeSha512_256Commitment: Uint8Array\n /** [txn256] Root of transaction vector commitment using SHA256. */\n sha256Commitment?: Uint8Array\n /** [txn512] Root of transaction vector commitment using SHA512. */\n sha512Commitment?: Uint8Array\n}\n\nconst TxnCommitmentsMeta: ObjectModelMetadata<TxnCommitments> = {\n name: 'TxnCommitments',\n kind: 'object',\n fields: [\n { name: 'nativeSha512_256Commitment', wireKey: 'txn', optional: false, codec: fixedBytes32Codec },\n { name: 'sha256Commitment', wireKey: 'txn256', optional: true, codec: fixedBytes32Codec },\n { name: 'sha512Commitment', wireKey: 'txn512', optional: true, codec: fixedBytes64Codec },\n ],\n}\n\n/** Reward distribution state for the block. */\nexport type RewardState = {\n /** [fees] FeeSink address. */\n feeSink: Address\n /** [rwd] RewardsPool address. */\n rewardsPool: Address\n /** [earn] Rewards level. */\n rewardsLevel: bigint\n /** [rate] Rewards rate. */\n rewardsRate: bigint\n /** [frac] Rewards residue. */\n rewardsResidue: bigint\n /** [rwcalr] Rewards recalculation round. */\n rewardsRecalculationRound: bigint\n}\n\nconst RewardStateMeta: ObjectModelMetadata<RewardState> = {\n name: 'RewardState',\n kind: 'object',\n fields: [\n { name: 'feeSink', wireKey: 'fees', optional: false, codec: addressCodec },\n { name: 'rewardsPool', wireKey: 'rwd', optional: false, codec: addressCodec },\n { name: 'rewardsLevel', wireKey: 'earn', optional: false, codec: bigIntCodec },\n { name: 'rewardsRate', wireKey: 'rate', optional: false, codec: bigIntCodec },\n { name: 'rewardsResidue', wireKey: 'frac', optional: false, codec: bigIntCodec },\n { name: 'rewardsRecalculationRound', wireKey: 'rwcalr', optional: false, codec: bigIntCodec },\n ],\n}\n\n/** Protocol upgrade state for the block. */\nexport type UpgradeState = {\n /** [proto] Current consensus protocol. */\n currentProtocol: string\n /** [nextproto] Next proposed protocol. */\n nextProtocol?: string\n /** [nextyes] Next protocol approvals. */\n nextProtocolApprovals?: bigint\n /** [nextbefore] Next protocol vote deadline. */\n nextProtocolVoteBefore?: bigint\n /** [nextswitch] Next protocol switch round. */\n nextProtocolSwitchOn?: bigint\n}\n\nconst UpgradeStateMeta: ObjectModelMetadata<UpgradeState> = {\n name: 'UpgradeState',\n kind: 'object',\n fields: [\n { name: 'currentProtocol', wireKey: 'proto', optional: false, codec: stringCodec },\n { name: 'nextProtocol', wireKey: 'nextproto', optional: true, codec: stringCodec },\n { name: 'nextProtocolApprovals', wireKey: 'nextyes', optional: true, codec: bigIntCodec },\n { name: 'nextProtocolVoteBefore', wireKey: 'nextbefore', optional: true, codec: bigIntCodec },\n { name: 'nextProtocolSwitchOn', wireKey: 'nextswitch', optional: true, codec: bigIntCodec },\n ],\n}\n\n/** Protocol upgrade vote parameters for the block. */\nexport type UpgradeVote = {\n /** [upgradeprop] Upgrade proposal. */\n upgradePropose?: string\n /** [upgradedelay] Upgrade delay in rounds. */\n upgradeDelay?: bigint\n /** [upgradeyes] Upgrade approval flag. */\n upgradeApprove?: boolean\n}\n\nconst UpgradeVoteMeta: ObjectModelMetadata<UpgradeVote> = {\n name: 'UpgradeVote',\n kind: 'object',\n fields: [\n { name: 'upgradePropose', wireKey: 'upgradeprop', optional: true, codec: stringCodec },\n { name: 'upgradeDelay', wireKey: 'upgradedelay', optional: true, codec: bigIntCodec },\n { name: 'upgradeApprove', wireKey: 'upgradeyes', optional: true, codec: booleanCodec },\n ],\n}\n\nexport type BlockHeader = {\n /** [rnd] Round number. */\n round: bigint\n /** [prev] Previous block hash. */\n previousBlockHash: Uint8Array\n /** [prev512] Previous block hash using SHA-512. */\n previousBlockHash512?: Uint8Array\n /** [seed] Sortition seed. */\n seed: Uint8Array\n /** Authenticates the set of transactions appearing in the block. */\n txnCommitments: TxnCommitments\n /** [ts] Block timestamp in seconds since epoch. */\n timestamp: bigint\n /** [gen] Genesis ID. */\n genesisId: string\n /** [gh] Genesis hash. */\n genesisHash: Uint8Array\n /** [prp] Proposer address. */\n proposer?: Address\n /** [fc] Fees collected in this block. */\n feesCollected?: bigint\n /** [bi] Bonus incentive for block proposal. */\n bonus?: bigint\n /** [pp] Proposer payout. */\n proposerPayout?: bigint\n /** Reward distribution state. */\n rewardState: RewardState\n /** Protocol upgrade state. */\n upgradeState: UpgradeState\n /** Protocol upgrade vote parameters. */\n upgradeVote?: UpgradeVote\n /** [tc] Transaction counter. */\n txnCounter?: bigint\n /** [spt] State proof tracking data keyed by state proof type. */\n stateProofTracking?: Map<number, BlockStateProofTrackingData>\n /** Represents participation account data that needs to be checked/acted on by the network */\n participationUpdates: ParticipationUpdates\n}\n\nconst BlockHeaderMeta: ObjectModelMetadata<BlockHeader> = {\n name: 'BlockHeader',\n kind: 'object',\n fields: [\n { name: 'round', wireKey: 'rnd', optional: false, codec: bigIntCodec },\n { name: 'previousBlockHash', wireKey: 'prev', optional: false, codec: fixedBytes32Codec },\n { name: 'previousBlockHash512', wireKey: 'prev512', optional: true, codec: fixedBytes64Codec },\n { name: 'seed', wireKey: 'seed', optional: false, codec: bytesCodec },\n {\n name: 'txnCommitments',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(TxnCommitmentsMeta),\n },\n { name: 'timestamp', wireKey: 'ts', optional: false, codec: bigIntCodec },\n { name: 'genesisId', wireKey: 'gen', optional: false, codec: stringCodec },\n { name: 'genesisHash', wireKey: 'gh', optional: false, codec: fixedBytes32Codec },\n { name: 'proposer', wireKey: 'prp', optional: true, codec: addressCodec },\n { name: 'feesCollected', wireKey: 'fc', optional: true, codec: bigIntCodec },\n { name: 'bonus', wireKey: 'bi', optional: true, codec: bigIntCodec },\n { name: 'proposerPayout', wireKey: 'pp', optional: true, codec: bigIntCodec },\n {\n name: 'rewardState',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(RewardStateMeta),\n },\n {\n name: 'upgradeState',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(UpgradeStateMeta),\n },\n {\n name: 'upgradeVote',\n flattened: true,\n optional: true,\n codec: new ObjectModelCodec(UpgradeVoteMeta),\n },\n { name: 'txnCounter', wireKey: 'tc', optional: true, codec: bigIntCodec },\n {\n name: 'stateProofTracking',\n wireKey: 'spt',\n optional: true,\n codec: new MapCodec(numberCodec, new ObjectModelCodec(BlockStateProofTrackingDataMeta)),\n },\n {\n name: 'participationUpdates',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(ParticipationUpdatesMeta),\n },\n ],\n}\n\n/**\n * Block contains the BlockHeader and the list of transactions (Payset).\n */\nexport type Block = {\n /** The block information (Header) */\n header: BlockHeader\n\n /** [txns] Block transactions (Payset). */\n payset: SignedTxnInBlock[]\n}\n\nconst BlockMeta: ObjectModelMetadata<Block> = {\n name: 'Block',\n kind: 'object',\n fields: [\n { name: 'header', flattened: true, optional: false, codec: new ObjectModelCodec(BlockHeaderMeta) },\n {\n name: 'payset',\n wireKey: 'txns',\n optional: false,\n codec: new ArrayCodec(new ObjectModelCodec(SignedTxnInBlockMeta)),\n },\n ],\n}\n\n/**\n * Custom codec for Block that populates genesis information on transactions after decoding.\n *\n * When blocks are returned from algod, transactions may not include the genesisId\n * and genesisHash fields even though they are required for correct transaction ID calculation.\n * The block contains `hasGenesisId` and `hasGenesisHash` flags that indicate whether these\n * fields should be populated from the block header.\n *\n * This codec automatically populates these fields after decoding to ensure transaction IDs\n * can be calculated correctly.\n */\nclass BlockCodec extends ObjectModelCodec<Block> {\n constructor() {\n super(BlockMeta)\n }\n\n protected fromEncoded(value: WireObject, format: EncodingFormat): Block {\n const block = super.fromEncoded(value, format)\n\n // Populate genesis id and hash on transactions if required to ensure tx id's are correct\n const genesisId = block.header.genesisId\n const genesisHash = block.header.genesisHash\n\n for (const txnInBlock of block.payset ?? []) {\n const txn = txnInBlock.signedTxn.signedTxn.txn\n\n if (txnInBlock.hasGenesisId && txn.genesisId === undefined) {\n txn.genesisId = genesisId\n }\n\n // The following assumes that Consensus.RequireGenesisHash is true\n // so assigns genesis hash unless explicitly set to false\n if (txnInBlock.hasGenesisHash !== false && txn.genesisHash === undefined) {\n txn.genesisHash = genesisHash\n }\n }\n\n return block\n }\n}\n\nexport const blockCodec = new Bl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ACE,MAAM;KACN,WAAW;KACX,UAAU;KACV,OAAO,IAAI,iBAAiB,yBAAyB;KACtD;IACF;GACF,CAiBmG;EAAE,EAClG;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAO,IAAI,WAAW,IAAI,iBAAiB,qBAAqB,CAAC;EAClE,CACF;CACF;;;;;;;;;;;;AAaD,IAAM,aAAN,cAAyB,iBAAwB;CAC/C,cAAc;AACZ,QAAM,UAAU;;CAGlB,AAAU,YAAY,OAAmB,QAA+B;EACtE,MAAM,QAAQ,MAAM,YAAY,OAAO,OAAO;EAG9C,MAAM,YAAY,MAAM,OAAO;EAC/B,MAAM,cAAc,MAAM,OAAO;AAEjC,OAAK,MAAM,cAAc,MAAM,UAAU,EAAE,EAAE;GAC3C,MAAM,MAAM,WAAW,UAAU,UAAU;AAE3C,OAAI,WAAW,gBAAgB,IAAI,cAAc,OAC/C,KAAI,YAAY;AAKlB,OAAI,WAAW,mBAAmB,SAAS,IAAI,gBAAgB,OAC7D,KAAI,cAAc;;AAItB,SAAO;;;AAIX,MAAa,aAAa,IAAI,YAAY"}
1
+ {"version":3,"file":"block.mjs","names":["BlockEvalDeltaMeta: ObjectModelMetadata<BlockEvalDelta>","BlockAppEvalDeltaMeta: ObjectModelMetadata<BlockAppEvalDelta>","BlockStateProofTrackingDataMeta: ObjectModelMetadata<BlockStateProofTrackingData>","ApplyDataMeta: ObjectModelMetadata<ApplyData>","SignedTxnWithADMeta: ObjectModelMetadata<SignedTxnWithAD>","SignedTxnInBlockMeta: ObjectModelMetadata<SignedTxnInBlock>","ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates>","TxnCommitmentsMeta: ObjectModelMetadata<TxnCommitments>","RewardStateMeta: ObjectModelMetadata<RewardState>","UpgradeStateMeta: ObjectModelMetadata<UpgradeState>","UpgradeVoteMeta: ObjectModelMetadata<UpgradeVote>","BlockMeta: ObjectModelMetadata<Block>"],"sources":["../../../../../packages/algod_client/src/models/block.ts"],"sourcesContent":["import {\n Address,\n ArrayCodec,\n MapCodec,\n ObjectModelCodec,\n type EncodingFormat,\n type ObjectModelMetadata,\n type WireObject,\n addressArrayCodec,\n addressCodec,\n bigIntCodec,\n booleanCodec,\n bytesArrayCodec,\n bytesCodec,\n fixedBytes32Codec,\n fixedBytes64Codec,\n numberCodec,\n stringCodec,\n} from '@algorandfoundation/algokit-common'\nimport { type SignedTransaction, SignedTransactionMeta } from '@algorandfoundation/algokit-transact'\n\n/** BlockEvalDelta represents a TEAL value delta (block/msgpack wire keys). */\nexport type BlockEvalDelta = {\n /** [at] delta action. */\n action: number\n /** [bs] bytes value. */\n bytes?: Uint8Array\n /** [ui] uint value. */\n uint?: bigint\n}\n\nconst BlockEvalDeltaMeta: ObjectModelMetadata<BlockEvalDelta> = {\n name: 'BlockEvalDelta',\n kind: 'object',\n fields: [\n { name: 'action', wireKey: 'at', optional: false, codec: numberCodec },\n { name: 'bytes', wireKey: 'bs', optional: true, codec: bytesCodec },\n { name: 'uint', wireKey: 'ui', optional: true, codec: bigIntCodec },\n ],\n}\n\n/**\n * State changes from application execution, including inner transactions and logs.\n */\nexport type BlockAppEvalDelta = {\n /** [gd] Global state delta for the application. */\n globalDelta?: Map<Uint8Array, BlockEvalDelta>\n /** [ld] Local state deltas keyed by address index. */\n localDeltas?: Map<number, Map<Uint8Array, BlockEvalDelta>>\n /** [itx] Inner transactions produced by this application execution. */\n innerTxns?: SignedTxnWithAD[]\n /** [sa] Shared accounts referenced by local deltas. */\n sharedAccounts?: Address[]\n /** [lg] Application log outputs. */\n logs?: Uint8Array[]\n}\n\nconst BlockAppEvalDeltaMeta: ObjectModelMetadata<BlockAppEvalDelta> = {\n name: 'BlockAppEvalDelta',\n kind: 'object',\n fields: [\n {\n name: 'globalDelta',\n wireKey: 'gd',\n optional: true,\n codec: new MapCodec(bytesCodec, new ObjectModelCodec(BlockEvalDeltaMeta)),\n },\n {\n name: 'localDeltas',\n wireKey: 'ld',\n optional: true,\n codec: new MapCodec(numberCodec, new MapCodec(bytesCodec, new ObjectModelCodec(BlockEvalDeltaMeta))),\n },\n {\n name: 'innerTxns',\n wireKey: 'itx',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(() => SignedTxnWithADMeta)),\n },\n {\n name: 'sharedAccounts',\n wireKey: 'sa',\n optional: true,\n codec: addressArrayCodec,\n },\n { name: 'logs', wireKey: 'lg', optional: true, codec: bytesArrayCodec },\n ],\n}\n\n/** Tracking metadata for a specific StateProofType. */\nexport type BlockStateProofTrackingData = {\n /** [v] Vector commitment root of state proof voters. */\n stateProofVotersCommitment?: Uint8Array\n /** [t] Online total weight during state proof round. */\n stateProofOnlineTotalWeight?: bigint\n /** [n] Next round for which state proofs are accepted. */\n stateProofNextRound?: bigint\n}\n\nconst BlockStateProofTrackingDataMeta: ObjectModelMetadata<BlockStateProofTrackingData> = {\n name: 'BlockStateProofTrackingData',\n kind: 'object',\n fields: [\n { name: 'stateProofVotersCommitment', wireKey: 'v', optional: true, codec: bytesCodec },\n { name: 'stateProofOnlineTotalWeight', wireKey: 't', optional: true, codec: bigIntCodec },\n { name: 'stateProofNextRound', wireKey: 'n', optional: true, codec: bigIntCodec },\n ],\n}\n\nexport type ApplyData = {\n closingAmount?: bigint\n assetClosingAmount?: bigint\n senderRewards?: bigint\n receiverRewards?: bigint\n closeRewards?: bigint\n evalDelta?: BlockAppEvalDelta\n configAsset?: bigint\n applicationId?: bigint\n}\n\nconst ApplyDataMeta: ObjectModelMetadata<ApplyData> = {\n name: 'SignedTxnInBlock',\n kind: 'object',\n fields: [\n { name: 'closingAmount', wireKey: 'ca', optional: true, codec: bigIntCodec },\n { name: 'assetClosingAmount', wireKey: 'aca', optional: true, codec: bigIntCodec },\n { name: 'senderRewards', wireKey: 'rs', optional: true, codec: bigIntCodec },\n { name: 'receiverRewards', wireKey: 'rr', optional: true, codec: bigIntCodec },\n { name: 'closeRewards', wireKey: 'rc', optional: true, codec: bigIntCodec },\n { name: 'evalDelta', wireKey: 'dt', optional: true, codec: new ObjectModelCodec(BlockAppEvalDeltaMeta) },\n { name: 'configAsset', wireKey: 'caid', optional: true, codec: bigIntCodec },\n { name: 'applicationId', wireKey: 'apid', optional: true, codec: bigIntCodec },\n ],\n}\n\n/**\n * SignedTxnWithAD is a SignedTransaction with additional ApplyData.\n */\nexport type SignedTxnWithAD = {\n /** The signed transaction. */\n signedTxn: SignedTransaction\n /** Apply data containing transaction execution information. */\n applyData?: ApplyData\n}\n\nconst SignedTxnWithADMeta: ObjectModelMetadata<SignedTxnWithAD> = {\n name: 'SignedTxnWithAD',\n kind: 'object',\n fields: [\n {\n name: 'signedTxn',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(SignedTransactionMeta),\n },\n {\n name: 'applyData',\n flattened: true,\n optional: true,\n codec: new ObjectModelCodec(ApplyDataMeta),\n },\n ],\n}\n\n/**\n * SignedTxnInBlock is a SignedTransaction with additional ApplyData and block-specific metadata.\n */\nexport type SignedTxnInBlock = {\n signedTxn: SignedTxnWithAD\n hasGenesisId?: boolean\n hasGenesisHash?: boolean\n}\n\nconst SignedTxnInBlockMeta: ObjectModelMetadata<SignedTxnInBlock> = {\n name: 'SignedTxnInBlock',\n kind: 'object',\n fields: [\n {\n name: 'signedTxn',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(SignedTxnWithADMeta),\n },\n { name: 'hasGenesisId', wireKey: 'hgi', optional: true, codec: booleanCodec },\n { name: 'hasGenesisHash', wireKey: 'hgh', optional: true, codec: booleanCodec },\n ],\n}\n\nexport type ParticipationUpdates = {\n /** [partupdrmv] Expired participation accounts. */\n expiredParticipationAccounts: string[]\n /** [partupdabs] Absent participation accounts. */\n absentParticipationAccounts: string[]\n}\n\nconst ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates> = {\n name: 'ParticipationUpdates',\n kind: 'object',\n fields: [\n {\n name: 'expiredParticipationAccounts',\n wireKey: 'partupdrmv',\n optional: false,\n codec: addressArrayCodec,\n },\n {\n name: 'absentParticipationAccounts',\n wireKey: 'partupdabs',\n optional: false,\n codec: addressArrayCodec,\n },\n ],\n}\n\n/** Transaction commitment hashes for the block. */\nexport type TxnCommitments = {\n /** [txn] Root of transaction merkle tree using SHA512_256. */\n nativeSha512_256Commitment: Uint8Array\n /** [txn256] Root of transaction vector commitment using SHA256. */\n sha256Commitment?: Uint8Array\n /** [txn512] Root of transaction vector commitment using SHA512. */\n sha512Commitment?: Uint8Array\n}\n\nconst TxnCommitmentsMeta: ObjectModelMetadata<TxnCommitments> = {\n name: 'TxnCommitments',\n kind: 'object',\n fields: [\n { name: 'nativeSha512_256Commitment', wireKey: 'txn', optional: false, codec: fixedBytes32Codec },\n { name: 'sha256Commitment', wireKey: 'txn256', optional: true, codec: fixedBytes32Codec },\n { name: 'sha512Commitment', wireKey: 'txn512', optional: true, codec: fixedBytes64Codec },\n ],\n}\n\n/** Reward distribution state for the block. */\nexport type RewardState = {\n /** [fees] FeeSink address. */\n feeSink: Address\n /** [rwd] RewardsPool address. */\n rewardsPool: Address\n /** [earn] Rewards level. */\n rewardsLevel: bigint\n /** [rate] Rewards rate. */\n rewardsRate: bigint\n /** [frac] Rewards residue. */\n rewardsResidue: bigint\n /** [rwcalr] Rewards recalculation round. */\n rewardsRecalculationRound: bigint\n}\n\nconst RewardStateMeta: ObjectModelMetadata<RewardState> = {\n name: 'RewardState',\n kind: 'object',\n fields: [\n { name: 'feeSink', wireKey: 'fees', optional: false, codec: addressCodec },\n { name: 'rewardsPool', wireKey: 'rwd', optional: false, codec: addressCodec },\n { name: 'rewardsLevel', wireKey: 'earn', optional: false, codec: bigIntCodec },\n { name: 'rewardsRate', wireKey: 'rate', optional: false, codec: bigIntCodec },\n { name: 'rewardsResidue', wireKey: 'frac', optional: false, codec: bigIntCodec },\n { name: 'rewardsRecalculationRound', wireKey: 'rwcalr', optional: false, codec: bigIntCodec },\n ],\n}\n\n/** Protocol upgrade state for the block. */\nexport type UpgradeState = {\n /** [proto] Current consensus protocol. */\n currentProtocol: string\n /** [nextproto] Next proposed protocol. */\n nextProtocol?: string\n /** [nextyes] Next protocol approvals. */\n nextProtocolApprovals?: bigint\n /** [nextbefore] Next protocol vote deadline. */\n nextProtocolVoteBefore?: bigint\n /** [nextswitch] Next protocol switch round. */\n nextProtocolSwitchOn?: bigint\n}\n\nconst UpgradeStateMeta: ObjectModelMetadata<UpgradeState> = {\n name: 'UpgradeState',\n kind: 'object',\n fields: [\n { name: 'currentProtocol', wireKey: 'proto', optional: false, codec: stringCodec },\n { name: 'nextProtocol', wireKey: 'nextproto', optional: true, codec: stringCodec },\n { name: 'nextProtocolApprovals', wireKey: 'nextyes', optional: true, codec: bigIntCodec },\n { name: 'nextProtocolVoteBefore', wireKey: 'nextbefore', optional: true, codec: bigIntCodec },\n { name: 'nextProtocolSwitchOn', wireKey: 'nextswitch', optional: true, codec: bigIntCodec },\n ],\n}\n\n/** Protocol upgrade vote parameters for the block. */\nexport type UpgradeVote = {\n /** [upgradeprop] Upgrade proposal. */\n upgradePropose?: string\n /** [upgradedelay] Upgrade delay in rounds. */\n upgradeDelay?: bigint\n /** [upgradeyes] Upgrade approval flag. */\n upgradeApprove?: boolean\n}\n\nconst UpgradeVoteMeta: ObjectModelMetadata<UpgradeVote> = {\n name: 'UpgradeVote',\n kind: 'object',\n fields: [\n { name: 'upgradePropose', wireKey: 'upgradeprop', optional: true, codec: stringCodec },\n { name: 'upgradeDelay', wireKey: 'upgradedelay', optional: true, codec: bigIntCodec },\n { name: 'upgradeApprove', wireKey: 'upgradeyes', optional: true, codec: booleanCodec },\n ],\n}\n\nexport type BlockHeader = {\n /** [rnd] Round number. */\n round: bigint\n /** [prev] Previous block hash. */\n previousBlockHash: Uint8Array\n /** [prev512] Previous block hash using SHA-512. */\n previousBlockHash512?: Uint8Array\n /** [seed] Sortition seed. */\n seed: Uint8Array\n /** Authenticates the set of transactions appearing in the block. */\n txnCommitments: TxnCommitments\n /** [ts] Block timestamp in seconds since epoch. */\n timestamp: bigint\n /** [gen] Genesis ID. */\n genesisId: string\n /** [gh] Genesis hash. */\n genesisHash: Uint8Array\n /** [prp] Proposer address. */\n proposer?: Address\n /** [fc] Fees collected in this block. */\n feesCollected?: bigint\n /** [bi] Bonus incentive for block proposal. */\n bonus?: bigint\n /** [pp] Proposer payout. */\n proposerPayout?: bigint\n /** Reward distribution state. */\n rewardState: RewardState\n /** Protocol upgrade state. */\n upgradeState: UpgradeState\n /** Protocol upgrade vote parameters. */\n upgradeVote?: UpgradeVote\n /** [tc] Transaction counter. */\n txnCounter?: bigint\n /** [spt] State proof tracking data keyed by state proof type. */\n stateProofTracking?: Map<number, BlockStateProofTrackingData>\n /** Represents participation account data that needs to be checked/acted on by the network */\n participationUpdates: ParticipationUpdates\n}\n\nconst BlockHeaderMeta: ObjectModelMetadata<BlockHeader> = {\n name: 'BlockHeader',\n kind: 'object',\n fields: [\n { name: 'round', wireKey: 'rnd', optional: false, codec: bigIntCodec },\n { name: 'previousBlockHash', wireKey: 'prev', optional: false, codec: fixedBytes32Codec },\n { name: 'previousBlockHash512', wireKey: 'prev512', optional: true, codec: fixedBytes64Codec },\n { name: 'seed', wireKey: 'seed', optional: false, codec: bytesCodec },\n {\n name: 'txnCommitments',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(TxnCommitmentsMeta),\n },\n { name: 'timestamp', wireKey: 'ts', optional: false, codec: bigIntCodec },\n { name: 'genesisId', wireKey: 'gen', optional: false, codec: stringCodec },\n { name: 'genesisHash', wireKey: 'gh', optional: false, codec: fixedBytes32Codec },\n { name: 'proposer', wireKey: 'prp', optional: true, codec: addressCodec },\n { name: 'feesCollected', wireKey: 'fc', optional: true, codec: bigIntCodec },\n { name: 'bonus', wireKey: 'bi', optional: true, codec: bigIntCodec },\n { name: 'proposerPayout', wireKey: 'pp', optional: true, codec: bigIntCodec },\n {\n name: 'rewardState',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(RewardStateMeta),\n },\n {\n name: 'upgradeState',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(UpgradeStateMeta),\n },\n {\n name: 'upgradeVote',\n flattened: true,\n optional: true,\n codec: new ObjectModelCodec(UpgradeVoteMeta),\n },\n { name: 'txnCounter', wireKey: 'tc', optional: true, codec: bigIntCodec },\n {\n name: 'stateProofTracking',\n wireKey: 'spt',\n optional: true,\n codec: new MapCodec(numberCodec, new ObjectModelCodec(BlockStateProofTrackingDataMeta)),\n },\n {\n name: 'participationUpdates',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(ParticipationUpdatesMeta),\n },\n ],\n}\n\n/**\n * Block contains the BlockHeader and the list of transactions (Payset).\n */\nexport type Block = {\n /** The block information (Header) */\n header: BlockHeader\n\n /** [txns] Block transactions (Payset). */\n payset: SignedTxnInBlock[]\n}\n\nconst BlockMeta: ObjectModelMetadata<Block> = {\n name: 'Block',\n kind: 'object',\n fields: [\n { name: 'header', flattened: true, optional: false, codec: new ObjectModelCodec(BlockHeaderMeta) },\n {\n name: 'payset',\n wireKey: 'txns',\n optional: false,\n codec: new ArrayCodec(new ObjectModelCodec(SignedTxnInBlockMeta)),\n },\n ],\n}\n\n/**\n * Custom codec for Block that populates genesis information on transactions after decoding.\n *\n * When blocks are returned from algod, transactions may not include the genesisId\n * and genesisHash fields even though they are required for correct transaction ID calculation.\n * The block contains `hasGenesisId` and `hasGenesisHash` flags that indicate whether these\n * fields should be populated from the block header.\n *\n * This codec automatically populates these fields after decoding to ensure transaction IDs\n * can be calculated correctly.\n */\nclass BlockCodec extends ObjectModelCodec<Block> {\n constructor() {\n super(BlockMeta)\n }\n\n protected fromEncoded(value: WireObject, format: EncodingFormat): Block {\n const block = super.fromEncoded(value, format)\n\n // Populate genesis id and hash on transactions if required to ensure tx id's are correct\n const genesisId = block.header.genesisId\n const genesisHash = block.header.genesisHash\n\n for (const txnInBlock of block.payset ?? []) {\n const txn = txnInBlock.signedTxn.signedTxn.txn\n\n if (txnInBlock.hasGenesisId && txn.genesisId === undefined) {\n txn.genesisId = genesisId\n }\n\n // The following assumes that Consensus.RequireGenesisHash is true\n // so assigns genesis hash unless explicitly set to false\n if (txnInBlock.hasGenesisHash !== false && txn.genesisHash === undefined) {\n txn.genesisHash = genesisHash\n }\n }\n\n return block\n }\n}\n\nexport const blockCodec = new BlockCodec()\n"],"mappings":";;;;;;;;;;;;;AA+BA,MAAMA,qBAA0D;CAC9D,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GAAE,MAAM;GAAU,SAAS;GAAM,UAAU;GAAO,OAAO;GAAa;EACtE;GAAE,MAAM;GAAS,SAAS;GAAM,UAAU;GAAM,OAAO;GAAY;EACnE;GAAE,MAAM;GAAQ,SAAS;GAAM,UAAU;GAAM,OAAO;GAAa;EACpE;CACF;AAkBD,MAAMC,wBAAgE;CACpE,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,SAAS,YAAY,IAAI,iBAAiB,mBAAmB,CAAC;GAC1E;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,SAAS,aAAa,IAAI,SAAS,YAAY,IAAI,iBAAiB,mBAAmB,CAAC,CAAC;GACrG;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,WAAW,IAAI,uBAAuB,oBAAoB,CAAC;GACvE;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GAAE,MAAM;GAAQ,SAAS;GAAM,UAAU;GAAM,OAAO;GAAiB;EACxE;CACF;AAYD,MAAMC,kCAAoF;CACxF,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GAAE,MAAM;GAA8B,SAAS;GAAK,UAAU;GAAM,OAAO;GAAY;EACvF;GAAE,MAAM;GAA+B,SAAS;GAAK,UAAU;GAAM,OAAO;GAAa;EACzF;GAAE,MAAM;GAAuB,SAAS;GAAK,UAAU;GAAM,OAAO;GAAa;EAClF;CACF;AAaD,MAAMC,gBAAgD;CACpD,MAAM;CACN,MAAM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KAAc,SAAS;KAAM,UAAU;KAAM,OAAO;KAAa;IACzE;KACE,MAAM;KACN,SAAS;KACT,UAAU;KACV,OAAO,IAAI,SAAS,aAAa,IAAI,iBAAiB,gCAAgC,CAAC;KACxF;IACD;KACE,MAAM;KACN,WAAW;KACX,UAAU;KACV,OAAO,IAAI,iBAAiB,yBAAyB;KACtD;IACF;GACF,CAiBmG;EAAE,EAClG;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAO,IAAI,WAAW,IAAI,iBAAiB,qBAAqB,CAAC;EAClE,CACF;CACF;;;;;;;;;;;;AAaD,IAAM,aAAN,cAAyB,iBAAwB;CAC/C,cAAc;AACZ,QAAM,UAAU;;CAGlB,AAAU,YAAY,OAAmB,QAA+B;EACtE,MAAM,QAAQ,MAAM,YAAY,OAAO,OAAO;EAG9C,MAAM,YAAY,MAAM,OAAO;EAC/B,MAAM,cAAc,MAAM,OAAO;AAEjC,OAAK,MAAM,cAAc,MAAM,UAAU,EAAE,EAAE;GAC3C,MAAM,MAAM,WAAW,UAAU,UAAU;AAE3C,OAAI,WAAW,gBAAgB,IAAI,cAAc,OAC/C,KAAI,YAAY;AAKlB,OAAI,WAAW,mBAAmB,SAAS,IAAI,gBAAgB,OAC7D,KAAI,cAAc;;AAItB,SAAO;;;AAIX,MAAa,aAAa,IAAI,YAAY"}
@@ -1,4 +1,4 @@
1
- const require_bytes = require('../../../common/src/codecs/primitives/bytes.js');
1
+ const require_bytes_base64 = require('../../../common/src/codecs/primitives/bytes-base64.js');
2
2
  const require_object_model = require('../../../common/src/codecs/models/object-model.js');
3
3
  const require_eval_delta = require('./eval-delta.js');
4
4
 
@@ -10,7 +10,7 @@ const EvalDeltaKeyValueMeta = {
10
10
  name: "key",
11
11
  wireKey: "key",
12
12
  optional: false,
13
- codec: require_bytes.bytesCodec
13
+ codec: require_bytes_base64.bytesBase64Codec
14
14
  }, {
15
15
  name: "value",
16
16
  wireKey: "value",
@@ -1 +1 @@
1
- {"version":3,"file":"eval-delta-key-value.js","names":["EvalDeltaKeyValueMeta: ObjectModelMetadata<EvalDeltaKeyValue>","bytesCodec","ObjectModelCodec","EvalDeltaMeta"],"sources":["../../../../../packages/algod_client/src/models/eval-delta-key-value.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { bytesCodec, ObjectModelCodec } from '@algorandfoundation/algokit-common'\nimport type { EvalDelta } from './eval-delta'\nimport { EvalDeltaMeta } from './eval-delta'\n\n/**\n * Key-value pairs for StateDelta.\n */\nexport type EvalDeltaKeyValue = {\n key: Uint8Array\n value: EvalDelta\n}\n\nexport const EvalDeltaKeyValueMeta: ObjectModelMetadata<EvalDeltaKeyValue> = {\n name: 'EvalDeltaKeyValue',\n kind: 'object',\n fields: [\n {\n name: 'key',\n wireKey: 'key',\n optional: false,\n codec: bytesCodec,\n },\n {\n name: 'value',\n wireKey: 'value',\n optional: false,\n codec: new ObjectModelCodec(EvalDeltaMeta),\n },\n ],\n}\n"],"mappings":";;;;;AAaA,MAAaA,wBAAgE;CAC3E,MAAM;CACN,MAAM;CACN,QAAQ,CACN;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAOC;EACR,EACD;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAO,IAAIC,sCAAiBC,iCAAc;EAC3C,CACF;CACF"}
1
+ {"version":3,"file":"eval-delta-key-value.js","names":["EvalDeltaKeyValueMeta: ObjectModelMetadata<EvalDeltaKeyValue>","bytesBase64Codec","ObjectModelCodec","EvalDeltaMeta"],"sources":["../../../../../packages/algod_client/src/models/eval-delta-key-value.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { bytesBase64Codec, ObjectModelCodec } from '@algorandfoundation/algokit-common'\nimport type { EvalDelta } from './eval-delta'\nimport { EvalDeltaMeta } from './eval-delta'\n\n/**\n * Key-value pairs for StateDelta.\n */\nexport type EvalDeltaKeyValue = {\n key: Uint8Array\n value: EvalDelta\n}\n\nexport const EvalDeltaKeyValueMeta: ObjectModelMetadata<EvalDeltaKeyValue> = {\n name: 'EvalDeltaKeyValue',\n kind: 'object',\n fields: [\n {\n name: 'key',\n wireKey: 'key',\n optional: false,\n codec: bytesBase64Codec,\n },\n {\n name: 'value',\n wireKey: 'value',\n optional: false,\n codec: new ObjectModelCodec(EvalDeltaMeta),\n },\n ],\n}\n"],"mappings":";;;;;AAaA,MAAaA,wBAAgE;CAC3E,MAAM;CACN,MAAM;CACN,QAAQ,CACN;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAOC;EACR,EACD;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAO,IAAIC,sCAAiBC,iCAAc;EAC3C,CACF;CACF"}
@@ -1,4 +1,4 @@
1
- import { bytesCodec } from "../../../common/src/codecs/primitives/bytes.mjs";
1
+ import { bytesBase64Codec } from "../../../common/src/codecs/primitives/bytes-base64.mjs";
2
2
  import { ObjectModelCodec } from "../../../common/src/codecs/models/object-model.mjs";
3
3
  import { EvalDeltaMeta } from "./eval-delta.mjs";
4
4
 
@@ -10,7 +10,7 @@ const EvalDeltaKeyValueMeta = {
10
10
  name: "key",
11
11
  wireKey: "key",
12
12
  optional: false,
13
- codec: bytesCodec
13
+ codec: bytesBase64Codec
14
14
  }, {
15
15
  name: "value",
16
16
  wireKey: "value",
@@ -1 +1 @@
1
- {"version":3,"file":"eval-delta-key-value.mjs","names":["EvalDeltaKeyValueMeta: ObjectModelMetadata<EvalDeltaKeyValue>"],"sources":["../../../../../packages/algod_client/src/models/eval-delta-key-value.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { bytesCodec, ObjectModelCodec } from '@algorandfoundation/algokit-common'\nimport type { EvalDelta } from './eval-delta'\nimport { EvalDeltaMeta } from './eval-delta'\n\n/**\n * Key-value pairs for StateDelta.\n */\nexport type EvalDeltaKeyValue = {\n key: Uint8Array\n value: EvalDelta\n}\n\nexport const EvalDeltaKeyValueMeta: ObjectModelMetadata<EvalDeltaKeyValue> = {\n name: 'EvalDeltaKeyValue',\n kind: 'object',\n fields: [\n {\n name: 'key',\n wireKey: 'key',\n optional: false,\n codec: bytesCodec,\n },\n {\n name: 'value',\n wireKey: 'value',\n optional: false,\n codec: new ObjectModelCodec(EvalDeltaMeta),\n },\n ],\n}\n"],"mappings":";;;;;AAaA,MAAaA,wBAAgE;CAC3E,MAAM;CACN,MAAM;CACN,QAAQ,CACN;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAO;EACR,EACD;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAO,IAAI,iBAAiB,cAAc;EAC3C,CACF;CACF"}
1
+ {"version":3,"file":"eval-delta-key-value.mjs","names":["EvalDeltaKeyValueMeta: ObjectModelMetadata<EvalDeltaKeyValue>"],"sources":["../../../../../packages/algod_client/src/models/eval-delta-key-value.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { bytesBase64Codec, ObjectModelCodec } from '@algorandfoundation/algokit-common'\nimport type { EvalDelta } from './eval-delta'\nimport { EvalDeltaMeta } from './eval-delta'\n\n/**\n * Key-value pairs for StateDelta.\n */\nexport type EvalDeltaKeyValue = {\n key: Uint8Array\n value: EvalDelta\n}\n\nexport const EvalDeltaKeyValueMeta: ObjectModelMetadata<EvalDeltaKeyValue> = {\n name: 'EvalDeltaKeyValue',\n kind: 'object',\n fields: [\n {\n name: 'key',\n wireKey: 'key',\n optional: false,\n codec: bytesBase64Codec,\n },\n {\n name: 'value',\n wireKey: 'value',\n optional: false,\n codec: new ObjectModelCodec(EvalDeltaMeta),\n },\n ],\n}\n"],"mappings":";;;;;AAaA,MAAaA,wBAAgE;CAC3E,MAAM;CACN,MAAM;CACN,QAAQ,CACN;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAO;EACR,EACD;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAO,IAAI,iBAAiB,cAAc;EAC3C,CACF;CACF"}
@@ -1,5 +1,5 @@
1
1
  const require_bigint = require('../../../common/src/codecs/primitives/bigint.js');
2
- const require_bytes = require('../../../common/src/codecs/primitives/bytes.js');
2
+ const require_bytes_base64 = require('../../../common/src/codecs/primitives/bytes-base64.js');
3
3
  const require_number = require('../../../common/src/codecs/primitives/number.js');
4
4
 
5
5
  //#region packages/algod_client/src/models/eval-delta.ts
@@ -17,7 +17,7 @@ const EvalDeltaMeta = {
17
17
  name: "bytes",
18
18
  wireKey: "bytes",
19
19
  optional: true,
20
- codec: require_bytes.bytesCodec
20
+ codec: require_bytes_base64.bytesBase64Codec
21
21
  },
22
22
  {
23
23
  name: "uint",
@@ -1 +1 @@
1
- {"version":3,"file":"eval-delta.js","names":["EvalDeltaMeta: ObjectModelMetadata<EvalDelta>","numberCodec","bytesCodec","bigIntCodec"],"sources":["../../../../../packages/algod_client/src/models/eval-delta.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { numberCodec, bigIntCodec, bytesCodec } from '@algorandfoundation/algokit-common'\n\n/**\n * Represents a TEAL value delta.\n */\nexport type EvalDelta = {\n /**\n * \\[at\\] delta action.\n */\n action: number\n\n /**\n * \\[bs\\] bytes value.\n */\n bytes?: Uint8Array\n\n /**\n * \\[ui\\] uint value.\n */\n uint?: bigint\n}\n\nexport const EvalDeltaMeta: ObjectModelMetadata<EvalDelta> = {\n name: 'EvalDelta',\n kind: 'object',\n fields: [\n {\n name: 'action',\n wireKey: 'action',\n optional: false,\n codec: numberCodec,\n },\n {\n name: 'bytes',\n wireKey: 'bytes',\n optional: true,\n codec: bytesCodec,\n },\n {\n name: 'uint',\n wireKey: 'uint',\n optional: true,\n codec: bigIntCodec,\n },\n ],\n}\n"],"mappings":";;;;;AAuBA,MAAaA,gBAAgD;CAC3D,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,OAAOC;GACR;EACF;CACF"}
1
+ {"version":3,"file":"eval-delta.js","names":["EvalDeltaMeta: ObjectModelMetadata<EvalDelta>","numberCodec","bytesBase64Codec","bigIntCodec"],"sources":["../../../../../packages/algod_client/src/models/eval-delta.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { numberCodec, bigIntCodec, bytesBase64Codec } from '@algorandfoundation/algokit-common'\n\n/**\n * Represents a TEAL value delta.\n */\nexport type EvalDelta = {\n /**\n * \\[at\\] delta action.\n */\n action: number\n\n /**\n * \\[bs\\] bytes value.\n */\n bytes?: Uint8Array\n\n /**\n * \\[ui\\] uint value.\n */\n uint?: bigint\n}\n\nexport const EvalDeltaMeta: ObjectModelMetadata<EvalDelta> = {\n name: 'EvalDelta',\n kind: 'object',\n fields: [\n {\n name: 'action',\n wireKey: 'action',\n optional: false,\n codec: numberCodec,\n },\n {\n name: 'bytes',\n wireKey: 'bytes',\n optional: true,\n codec: bytesBase64Codec,\n },\n {\n name: 'uint',\n wireKey: 'uint',\n optional: true,\n codec: bigIntCodec,\n },\n ],\n}\n"],"mappings":";;;;;AAuBA,MAAaA,gBAAgD;CAC3D,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,OAAOC;GACR;EACF;CACF"}
@@ -1,5 +1,5 @@
1
1
  import { bigIntCodec } from "../../../common/src/codecs/primitives/bigint.mjs";
2
- import { bytesCodec } from "../../../common/src/codecs/primitives/bytes.mjs";
2
+ import { bytesBase64Codec } from "../../../common/src/codecs/primitives/bytes-base64.mjs";
3
3
  import { numberCodec } from "../../../common/src/codecs/primitives/number.mjs";
4
4
 
5
5
  //#region packages/algod_client/src/models/eval-delta.ts
@@ -17,7 +17,7 @@ const EvalDeltaMeta = {
17
17
  name: "bytes",
18
18
  wireKey: "bytes",
19
19
  optional: true,
20
- codec: bytesCodec
20
+ codec: bytesBase64Codec
21
21
  },
22
22
  {
23
23
  name: "uint",
@@ -1 +1 @@
1
- {"version":3,"file":"eval-delta.mjs","names":["EvalDeltaMeta: ObjectModelMetadata<EvalDelta>"],"sources":["../../../../../packages/algod_client/src/models/eval-delta.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { numberCodec, bigIntCodec, bytesCodec } from '@algorandfoundation/algokit-common'\n\n/**\n * Represents a TEAL value delta.\n */\nexport type EvalDelta = {\n /**\n * \\[at\\] delta action.\n */\n action: number\n\n /**\n * \\[bs\\] bytes value.\n */\n bytes?: Uint8Array\n\n /**\n * \\[ui\\] uint value.\n */\n uint?: bigint\n}\n\nexport const EvalDeltaMeta: ObjectModelMetadata<EvalDelta> = {\n name: 'EvalDelta',\n kind: 'object',\n fields: [\n {\n name: 'action',\n wireKey: 'action',\n optional: false,\n codec: numberCodec,\n },\n {\n name: 'bytes',\n wireKey: 'bytes',\n optional: true,\n codec: bytesCodec,\n },\n {\n name: 'uint',\n wireKey: 'uint',\n optional: true,\n codec: bigIntCodec,\n },\n ],\n}\n"],"mappings":";;;;;AAuBA,MAAaA,gBAAgD;CAC3D,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;EACF;CACF"}
1
+ {"version":3,"file":"eval-delta.mjs","names":["EvalDeltaMeta: ObjectModelMetadata<EvalDelta>"],"sources":["../../../../../packages/algod_client/src/models/eval-delta.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { numberCodec, bigIntCodec, bytesBase64Codec } from '@algorandfoundation/algokit-common'\n\n/**\n * Represents a TEAL value delta.\n */\nexport type EvalDelta = {\n /**\n * \\[at\\] delta action.\n */\n action: number\n\n /**\n * \\[bs\\] bytes value.\n */\n bytes?: Uint8Array\n\n /**\n * \\[ui\\] uint value.\n */\n uint?: bigint\n}\n\nexport const EvalDeltaMeta: ObjectModelMetadata<EvalDelta> = {\n name: 'EvalDelta',\n kind: 'object',\n fields: [\n {\n name: 'action',\n wireKey: 'action',\n optional: false,\n codec: numberCodec,\n },\n {\n name: 'bytes',\n wireKey: 'bytes',\n optional: true,\n codec: bytesBase64Codec,\n },\n {\n name: 'uint',\n wireKey: 'uint',\n optional: true,\n codec: bigIntCodec,\n },\n ],\n}\n"],"mappings":";;;;;AAuBA,MAAaA,gBAAgD;CAC3D,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;EACF;CACF"}
@@ -0,0 +1,26 @@
1
+ const require_rolldown_runtime = require('../../../../../_virtual/rolldown_runtime.js');
2
+ const require_codec = require('../codec.js');
3
+ let buffer = require("buffer");
4
+
5
+ //#region packages/common/src/codecs/primitives/bytes-base64.ts
6
+ var BytesBase64Codec = class extends require_codec.Codec {
7
+ defaultValue() {
8
+ return new Uint8Array();
9
+ }
10
+ toEncoded(value, _format) {
11
+ return buffer.Buffer.from(value).toString("base64");
12
+ }
13
+ fromEncoded(value, _format) {
14
+ if (value instanceof Uint8Array) return new Uint8Array(buffer.Buffer.from(buffer.Buffer.from(value).toString("utf-8"), "base64"));
15
+ if (typeof value === "string") return new Uint8Array(buffer.Buffer.from(value, "base64"));
16
+ throw new Error(`Cannot decode bytes from ${typeof value}`);
17
+ }
18
+ isDefaultValue(value) {
19
+ return value.byteLength === 0;
20
+ }
21
+ };
22
+ const bytesBase64Codec = new BytesBase64Codec();
23
+
24
+ //#endregion
25
+ exports.bytesBase64Codec = bytesBase64Codec;
26
+ //# sourceMappingURL=bytes-base64.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bytes-base64.js","names":["Codec","Buffer"],"sources":["../../../../../../packages/common/src/codecs/primitives/bytes-base64.ts"],"sourcesContent":["import { Buffer } from 'buffer'\nimport { Codec } from '../codec'\nimport type { EncodingFormat } from '../types'\nimport { WireString } from '../wire'\n\n// Some fields in the msgpack encoded models are base64 encoded strings representing bytes values.\n// This is a deviation from the general pattern of using raw byte arrays for bytes fields in the wire format.\n// This codec explicitly handles encoding/decoding of base64 string encoded bytes fields.\nclass BytesBase64Codec extends Codec<Uint8Array, WireString> {\n public defaultValue(): Uint8Array {\n return new Uint8Array()\n }\n\n protected toEncoded(value: Uint8Array, _format: EncodingFormat): WireString {\n return Buffer.from(value).toString('base64')\n }\n\n protected fromEncoded(value: WireString, _format: EncodingFormat): Uint8Array {\n if (value instanceof Uint8Array) {\n return new Uint8Array(Buffer.from(Buffer.from(value).toString('utf-8'), 'base64'))\n }\n if (typeof value === 'string') {\n return new Uint8Array(Buffer.from(value, 'base64'))\n }\n throw new Error(`Cannot decode bytes from ${typeof value}`)\n }\n\n public isDefaultValue(value: Uint8Array): boolean {\n return value.byteLength === 0\n }\n}\n\nexport const bytesBase64Codec = new BytesBase64Codec()\n"],"mappings":";;;;;AAQA,IAAM,mBAAN,cAA+BA,oBAA8B;CAC3D,AAAO,eAA2B;AAChC,SAAO,IAAI,YAAY;;CAGzB,AAAU,UAAU,OAAmB,SAAqC;AAC1E,SAAOC,cAAO,KAAK,MAAM,CAAC,SAAS,SAAS;;CAG9C,AAAU,YAAY,OAAmB,SAAqC;AAC5E,MAAI,iBAAiB,WACnB,QAAO,IAAI,WAAWA,cAAO,KAAKA,cAAO,KAAK,MAAM,CAAC,SAAS,QAAQ,EAAE,SAAS,CAAC;AAEpF,MAAI,OAAO,UAAU,SACnB,QAAO,IAAI,WAAWA,cAAO,KAAK,OAAO,SAAS,CAAC;AAErD,QAAM,IAAI,MAAM,4BAA4B,OAAO,QAAQ;;CAG7D,AAAO,eAAe,OAA4B;AAChD,SAAO,MAAM,eAAe;;;AAIhC,MAAa,mBAAmB,IAAI,kBAAkB"}
@@ -0,0 +1,25 @@
1
+ import { Codec } from "../codec.mjs";
2
+ import { Buffer } from "buffer";
3
+
4
+ //#region packages/common/src/codecs/primitives/bytes-base64.ts
5
+ var BytesBase64Codec = class extends Codec {
6
+ defaultValue() {
7
+ return new Uint8Array();
8
+ }
9
+ toEncoded(value, _format) {
10
+ return Buffer.from(value).toString("base64");
11
+ }
12
+ fromEncoded(value, _format) {
13
+ if (value instanceof Uint8Array) return new Uint8Array(Buffer.from(Buffer.from(value).toString("utf-8"), "base64"));
14
+ if (typeof value === "string") return new Uint8Array(Buffer.from(value, "base64"));
15
+ throw new Error(`Cannot decode bytes from ${typeof value}`);
16
+ }
17
+ isDefaultValue(value) {
18
+ return value.byteLength === 0;
19
+ }
20
+ };
21
+ const bytesBase64Codec = new BytesBase64Codec();
22
+
23
+ //#endregion
24
+ export { bytesBase64Codec };
25
+ //# sourceMappingURL=bytes-base64.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"bytes-base64.mjs","names":[],"sources":["../../../../../../packages/common/src/codecs/primitives/bytes-base64.ts"],"sourcesContent":["import { Buffer } from 'buffer'\nimport { Codec } from '../codec'\nimport type { EncodingFormat } from '../types'\nimport { WireString } from '../wire'\n\n// Some fields in the msgpack encoded models are base64 encoded strings representing bytes values.\n// This is a deviation from the general pattern of using raw byte arrays for bytes fields in the wire format.\n// This codec explicitly handles encoding/decoding of base64 string encoded bytes fields.\nclass BytesBase64Codec extends Codec<Uint8Array, WireString> {\n public defaultValue(): Uint8Array {\n return new Uint8Array()\n }\n\n protected toEncoded(value: Uint8Array, _format: EncodingFormat): WireString {\n return Buffer.from(value).toString('base64')\n }\n\n protected fromEncoded(value: WireString, _format: EncodingFormat): Uint8Array {\n if (value instanceof Uint8Array) {\n return new Uint8Array(Buffer.from(Buffer.from(value).toString('utf-8'), 'base64'))\n }\n if (typeof value === 'string') {\n return new Uint8Array(Buffer.from(value, 'base64'))\n }\n throw new Error(`Cannot decode bytes from ${typeof value}`)\n }\n\n public isDefaultValue(value: Uint8Array): boolean {\n return value.byteLength === 0\n }\n}\n\nexport const bytesBase64Codec = new BytesBase64Codec()\n"],"mappings":";;;;AAQA,IAAM,mBAAN,cAA+B,MAA8B;CAC3D,AAAO,eAA2B;AAChC,SAAO,IAAI,YAAY;;CAGzB,AAAU,UAAU,OAAmB,SAAqC;AAC1E,SAAO,OAAO,KAAK,MAAM,CAAC,SAAS,SAAS;;CAG9C,AAAU,YAAY,OAAmB,SAAqC;AAC5E,MAAI,iBAAiB,WACnB,QAAO,IAAI,WAAW,OAAO,KAAK,OAAO,KAAK,MAAM,CAAC,SAAS,QAAQ,EAAE,SAAS,CAAC;AAEpF,MAAI,OAAO,UAAU,SACnB,QAAO,IAAI,WAAW,OAAO,KAAK,OAAO,SAAS,CAAC;AAErD,QAAM,IAAI,MAAM,4BAA4B,OAAO,QAAQ;;CAG7D,AAAO,eAAe,OAA4B;AAChD,SAAO,MAAM,eAAe;;;AAIhC,MAAa,mBAAmB,IAAI,kBAAkB"}
@@ -1,35 +1,49 @@
1
- import { Address } from "../../common/src/address.js";
2
- import { LogicSignature, MultisigSignature } from "./transactions/signed-transaction.js";
1
+ import { Address, Addressable } from "../../common/src/address.js";
2
+ import { LogicSigSignature, MultisigSignature } from "./transactions/signed-transaction.js";
3
3
  import { MultisigAccount } from "./multisig.js";
4
- import { TransactionSigner } from "./signer.js";
4
+ import { AddressWithDelegatedLsigSigner, TransactionSigner } from "./signer.js";
5
5
 
6
6
  //#region packages/transact/src/logicsig.d.ts
7
- /** Function for signing logic signatures for delegation */
8
- type DelegatedLsigSigner = (lsig: LogicSigAccount, msig?: MultisigAccount) => Promise<Uint8Array>;
7
+
8
+ /** Function for signing logic signatures for delegation
9
+ * @param lsig - The logic signature that is being signed for delegation
10
+ * @param msig - Optional multisig account that should be set when a public key is signing as a subsigner of a multisig
11
+ * @returns The address of the delegator
12
+ * */
13
+ type DelegatedLsigSigner = (lsig: LogicSigAccount, msig?: MultisigAccount) => Promise<{
14
+ addr: Address;
15
+ } & ({
16
+ sig?: Uint8Array;
17
+ } | {
18
+ lmsig?: MultisigSignature;
19
+ })>;
9
20
  /** Function for signing program data for a logic signature */
10
- type ProgramDataSigner = (data: Uint8Array, lsig: LogicSigAccount) => Promise<Uint8Array>;
11
- declare class LogicSigAccount {
21
+ type ProgramDataSigner = (data: Uint8Array, lsig: LogicSig) => Promise<Uint8Array>;
22
+ declare class LogicSig implements Addressable {
12
23
  logic: Uint8Array;
13
24
  args: Uint8Array[];
14
- sig?: Uint8Array;
15
- msig?: MultisigSignature;
16
- lmsig?: MultisigSignature;
17
- static fromSignature(signature: LogicSignature): LogicSigAccount;
18
- static fromBytes(encodedLsig: Uint8Array): LogicSigAccount;
19
- constructor(program: Uint8Array, programArgs?: Array<Uint8Array> | null);
20
- get signer(): TransactionSigner;
21
- get addr(): Address;
22
- /**
23
- * Compute hash of the logic sig program (that is the same as escrow account address) as string address
24
- * @returns String representation of the address
25
- */
25
+ protected _addr: Address;
26
+ constructor(program: Uint8Array, programArgs?: Array<Uint8Array>);
27
+ static fromSignature(signature: LogicSigSignature): LogicSig;
28
+ static fromBytes(encodedLsig: Uint8Array): LogicSig;
26
29
  address(): Address;
27
- delegate(signer: DelegatedLsigSigner): Promise<void>;
28
- delegateMultisig(msig: MultisigAccount): Promise<void>;
30
+ get addr(): Address;
29
31
  bytesToSignForDelegation(msig?: MultisigAccount): Uint8Array;
30
32
  signProgramData(data: Uint8Array, signer: ProgramDataSigner): Promise<Uint8Array>;
31
33
  programDataToSign(data: Uint8Array): Uint8Array;
34
+ account(): LogicSigAccount;
35
+ delegatedAccount(delegator: Address): LogicSigAccount;
36
+ }
37
+ declare class LogicSigAccount extends LogicSig {
38
+ sig?: Uint8Array;
39
+ msig?: MultisigSignature;
40
+ lmsig?: MultisigSignature;
41
+ static fromSignature(signature: LogicSigSignature, delegator?: Address): LogicSigAccount;
42
+ static fromBytes(encodedLsig: Uint8Array, delegator?: Address): LogicSigAccount;
43
+ constructor(program: Uint8Array, programArgs?: Array<Uint8Array> | null, delegator?: Address);
44
+ get signer(): TransactionSigner;
45
+ signForDelegation(delegator: AddressWithDelegatedLsigSigner): Promise<void>;
32
46
  }
33
47
  //#endregion
34
- export { DelegatedLsigSigner, LogicSigAccount, ProgramDataSigner };
48
+ export { DelegatedLsigSigner, LogicSig, LogicSigAccount, ProgramDataSigner };
35
49
  //# sourceMappingURL=logicsig.d.ts.map