@algorandfoundation/algokit-utils 10.0.0-alpha.13 → 10.0.0-alpha.15

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 (38) hide show
  1. package/package.json +1 -1
  2. package/packages/algod_client/src/models/block.d.ts +1 -1
  3. package/packages/algod_client/src/models/block.js.map +1 -1
  4. package/packages/algod_client/src/models/block.mjs.map +1 -1
  5. package/packages/transact/src/transactions/app-call.d.ts +1 -6
  6. package/packages/transact/src/transactions/asset-config.d.ts +1 -6
  7. package/packages/transact/src/transactions/asset-config.js.map +1 -1
  8. package/packages/transact/src/transactions/asset-config.mjs.map +1 -1
  9. package/packages/transact/src/transactions/asset-freeze.d.ts +1 -6
  10. package/packages/transact/src/transactions/asset-transfer.d.ts +1 -6
  11. package/packages/transact/src/transactions/key-registration.d.ts +1 -8
  12. package/packages/transact/src/transactions/signed-transaction.d.ts +5 -1
  13. package/packages/transact/src/transactions/signed-transaction.js +1 -1
  14. package/packages/transact/src/transactions/signed-transaction.js.map +1 -1
  15. package/packages/transact/src/transactions/signed-transaction.mjs +1 -2
  16. package/packages/transact/src/transactions/signed-transaction.mjs.map +1 -1
  17. package/packages/transact/src/transactions/transaction.d.ts +5 -1
  18. package/packages/transact/src/transactions/transaction.js +0 -1
  19. package/packages/transact/src/transactions/transaction.js.map +1 -1
  20. package/packages/transact/src/transactions/transaction.mjs +0 -1
  21. package/packages/transact/src/transactions/transaction.mjs.map +1 -1
  22. package/transact/index.d.ts +9 -9
  23. package/transact/index.js +3 -10
  24. package/transact/index.mjs +5 -9
  25. package/transactions/key-registration.d.ts +1 -1
  26. package/transactions/key-registration.js.map +1 -1
  27. package/transactions/key-registration.mjs.map +1 -1
  28. package/types/account-manager.js +1 -1
  29. package/types/account-manager.mjs +1 -1
  30. package/types/algorand-client-transaction-creator.d.ts +27 -27
  31. package/types/algorand-client-transaction-sender.d.ts +28 -28
  32. package/types/app-client.d.ts +93 -93
  33. package/types/app-factory.d.ts +43 -43
  34. package/types/composer.js +9 -2
  35. package/types/composer.js.map +1 -1
  36. package/types/composer.mjs +11 -4
  37. package/types/composer.mjs.map +1 -1
  38. package/packages/transact/src/transactions/common.d.ts +0 -37
package/package.json CHANGED
@@ -6,7 +6,7 @@
6
6
  "**"
7
7
  ],
8
8
  "name": "@algorandfoundation/algokit-utils",
9
- "version": "10.0.0-alpha.13",
9
+ "version": "10.0.0-alpha.15",
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",
@@ -144,7 +144,7 @@ type BlockHeader = {
144
144
  /** Protocol upgrade state. */
145
145
  upgradeState: UpgradeState;
146
146
  /** Protocol upgrade vote parameters. */
147
- upgradeVote: UpgradeVote;
147
+ upgradeVote?: UpgradeVote;
148
148
  /** [tc] Transaction counter. */
149
149
  txnCounter?: bigint;
150
150
  /** [spt] State proof tracking data keyed by state proof type. */
@@ -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 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,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,oBAAoB,CAAC;GACvE;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOE;GACR;EACD;GAAE,MAAM;GAAQ,SAAS;GAAM,UAAU;GAAM,OAAOC;GAAiB;EACxE;CACF;AAYD,MAAMC,kCAAoF;CACxF,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GAAE,MAAM;GAA8B,SAAS;GAAK,UAAU;GAAM,OAAOR;GAAY;EACvF;GAAE,MAAM;GAA+B,SAAS;GAAK,UAAU;GAAM,OAAOC;GAAa;EACzF;GAAE,MAAM;GAA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AAM;KACN,WAAW;KACX,UAAU;KACV,OAAO,IAAIA,sCAAiB,iBAAiB;KAC9C;IACD;KACE,MAAM;KACN,WAAW;KACX,UAAU;KACV,OAAO,IAAIA,sCAAiB,gBAAgB;KAC7C;IACD;KAAE,MAAM;KAAc,SAAS;KAAM,UAAU;KAAM,OAAOH;KAAa;IACzE;KACE,MAAM;KACN,SAAS;KACT,UAAU;KACV,OAAO,IAAIE,qBAASJ,4BAAa,IAAIK,sCAAiB,gCAAgC,CAAC;KACxF;IACD;KACE,MAAM;KACN,WAAW;KACX,UAAU;KACV,OAAO,IAAIA,sCAAiB,yBAAyB;KACtD;IACF;GACF,CAiBmG;EAAE,EAClG;EACE,MAAM;EACN,SAAS;EACT,UAAU;EACV,OAAO,IAAIC,yBAAW,IAAID,sCAAiB,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
+ {"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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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 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,M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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 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,OAAO;GAAa;EACtE;GAAE,MAAM;GAAS,SAAS;GAAM,UAAU;GAAM,OA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;;;;;;;;;;;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,5 +1,4 @@
1
1
  import { Address } from "../../../common/src/address.js";
2
- import { TransactionValidationError } from "./common.js";
3
2
 
4
3
  //#region packages/transact/src/transactions/app-call.d.ts
5
4
 
@@ -200,10 +199,6 @@ type LocalsReference = {
200
199
  /** The address of the account holding the local state */
201
200
  address: Address;
202
201
  };
203
- /**
204
- * Validate app call transaction fields
205
- */
206
- declare function validateAppCallTransaction(appCall: AppCallTransactionFields): TransactionValidationError[];
207
202
  //#endregion
208
- export { AppCallTransactionFields, BoxReference, HoldingReference, LocalsReference, OnApplicationComplete, ResourceReference, StateSchema, validateAppCallTransaction };
203
+ export { AppCallTransactionFields, BoxReference, HoldingReference, LocalsReference, OnApplicationComplete, ResourceReference, StateSchema };
209
204
  //# sourceMappingURL=app-call.d.ts.map
@@ -1,5 +1,4 @@
1
1
  import { Address } from "../../../common/src/address.js";
2
- import { TransactionValidationError } from "./common.js";
3
2
 
4
3
  //#region packages/transact/src/transactions/asset-config.d.ts
5
4
 
@@ -122,10 +121,6 @@ type AssetConfigTransactionFields = {
122
121
  */
123
122
  clawback?: Address;
124
123
  };
125
- /**
126
- * Validate asset configuration transaction fields
127
- */
128
- declare function validateAssetConfigTransaction(assetConfig: AssetConfigTransactionFields): TransactionValidationError[];
129
124
  //#endregion
130
- export { AssetConfigTransactionFields, validateAssetConfigTransaction };
125
+ export { AssetConfigTransactionFields };
131
126
  //# sourceMappingURL=asset-config.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"asset-config.js","names":["TransactionValidationErrorType","MAX_ASSET_DECIMALS","MAX_ASSET_UNIT_NAME_LENGTH","MAX_ASSET_NAME_LENGTH","MAX_ASSET_URL_LENGTH"],"sources":["../../../../../packages/transact/src/transactions/asset-config.ts"],"sourcesContent":["import {\n MAX_ASSET_DECIMALS,\n MAX_ASSET_NAME_LENGTH,\n MAX_ASSET_UNIT_NAME_LENGTH,\n MAX_ASSET_URL_LENGTH,\n Address,\n} from '@algorandfoundation/algokit-common'\nimport { TransactionValidationError, TransactionValidationErrorType } from './common'\n\n/**\n * Represents an asset configuration transaction that creates, reconfigures, or destroys assets.\n */\nexport type AssetConfigTransactionFields = {\n /**\n * ID of the asset to operate on.\n *\n * For asset creation, this must be 0.\n * For asset reconfiguration this is the ID of the existing asset to be reconfigured,\n * For asset destroy this is the ID of the existing asset to be destroyed.\n */\n assetId: bigint\n\n /**\n * The total amount of the smallest divisible (decimal) unit to create.\n *\n * Required when creating a new asset.\n * For example, if creating a asset with 2 decimals and wanting a total supply of 100 units, this value should be 10000.\n *\n * This field can only be specified upon asset creation.\n */\n total?: bigint\n\n /**\n * The amount of decimal places the asset should have.\n *\n * If unspecified then the asset will be in whole units (i.e. `0`).\n * * If 0, the asset is not divisible;\n * * If 1, the base unit of the asset is in tenths;\n * * If 2, the base unit of the asset is in hundredths;\n * * If 3, the base unit of the asset is in thousandths;\n *\n * and so on up to 19 decimal places.\n *\n * This field can only be specified upon asset creation.\n */\n decimals?: number\n\n /**\n * Whether the asset is frozen by default for all accounts.\n * Defaults to `false`.\n *\n * If `true` then for anyone apart from the creator to hold the\n * asset it needs to be unfrozen per account using an asset freeze\n * transaction from the `freeze` account, which must be set on creation.\n *\n * This field can only be specified upon asset creation.\n */\n defaultFrozen?: boolean\n\n /**\n * The optional name of the asset.\n *\n * Max size is 32 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n assetName?: string\n\n /**\n * The optional name of the unit of this asset (e.g. ticker name).\n *\n * Max size is 8 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n unitName?: string\n\n /**\n * Specifies an optional URL where more information about the asset can be retrieved (e.g. metadata).\n *\n * Max size is 96 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n url?: string\n\n /**\n * 32-byte hash of some metadata that is relevant to your asset and/or asset holders.\n *\n * The format of this metadata is up to the application.\n *\n * This field can only be specified upon asset creation.\n */\n metadataHash?: Uint8Array\n\n /**\n * The address of the optional account that can manage the configuration of the asset and destroy it.\n *\n * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.\n *\n * If not set or set to the Zero address the asset becomes permanently immutable.\n */\n manager?: Address\n\n /**\n * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.\n *\n * This address has no specific authority in the protocol itself and is informational only.\n *\n * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)\n * rely on this field to hold meaningful data.\n *\n * It can be used in the case where you want to signal to holders of your asset that the uncirculated units\n * of the asset reside in an account that is different from the default creator account.\n *\n * If not set or set to the Zero address the field is permanently empty.\n */\n reserve?: Address\n\n /**\n * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.\n *\n * If empty, freezing is not permitted.\n *\n * If not set or set to the Zero address the field is permanently empty.\n */\n freeze?: Address\n\n /**\n * The address of the optional account that can clawback holdings of this asset from any account.\n *\n * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.\n *\n * If empty, clawback is not permitted.\n *\n * If not set or set to the Zero address the field is permanently empty.\n */\n clawback?: Address\n}\n\n/**\n * Validate asset configuration transaction fields\n */\nexport function validateAssetConfigTransaction(assetConfig: AssetConfigTransactionFields): TransactionValidationError[] {\n const errors = new Array<TransactionValidationError>()\n\n if (assetConfig.assetId === 0n) {\n // Asset creation\n errors.push(...validateAssetCreation(assetConfig))\n } else {\n // Asset configuration or destruction\n errors.push(...validateAssetConfiguration(assetConfig))\n }\n\n return errors\n}\n\n/**\n * Validate asset creation fields\n */\nfunction validateAssetCreation(assetConfig: AssetConfigTransactionFields): TransactionValidationError[] {\n const errors = new Array<TransactionValidationError>()\n\n if (assetConfig.total === undefined) {\n errors.push({\n type: TransactionValidationErrorType.RequiredField,\n data: 'Total',\n })\n }\n\n if (assetConfig.decimals !== undefined && assetConfig.decimals > MAX_ASSET_DECIMALS) {\n errors.push({\n type: TransactionValidationErrorType.FieldTooLong,\n data: {\n field: 'Decimals',\n actual: assetConfig.decimals,\n max: MAX_ASSET_DECIMALS,\n unit: 'decimal places',\n },\n })\n }\n\n if (assetConfig.unitName && assetConfig.unitName.length > MAX_ASSET_UNIT_NAME_LENGTH) {\n errors.push({\n type: TransactionValidationErrorType.FieldTooLong,\n data: {\n field: 'Unit name',\n actual: assetConfig.unitName.length,\n max: MAX_ASSET_UNIT_NAME_LENGTH,\n unit: 'bytes',\n },\n })\n }\n\n if (assetConfig.assetName && assetConfig.assetName.length > MAX_ASSET_NAME_LENGTH) {\n errors.push({\n type: TransactionValidationErrorType.FieldTooLong,\n data: {\n field: 'Asset name',\n actual: assetConfig.assetName.length,\n max: MAX_ASSET_NAME_LENGTH,\n unit: 'bytes',\n },\n })\n }\n\n if (assetConfig.url && assetConfig.url.length > MAX_ASSET_URL_LENGTH) {\n errors.push({\n type: TransactionValidationErrorType.FieldTooLong,\n data: {\n field: 'Url',\n actual: assetConfig.url.length,\n max: MAX_ASSET_URL_LENGTH,\n unit: 'bytes',\n },\n })\n }\n\n return errors\n}\n\n/**\n * Validate asset configuration fields\n */\nfunction validateAssetConfiguration(assetConfig: AssetConfigTransactionFields): TransactionValidationError[] {\n const errors = new Array<TransactionValidationError>()\n\n const hasAssetParams =\n assetConfig.total !== undefined ||\n assetConfig.decimals !== undefined ||\n assetConfig.defaultFrozen !== undefined ||\n assetConfig.assetName !== undefined ||\n assetConfig.unitName !== undefined ||\n assetConfig.url !== undefined ||\n assetConfig.metadataHash !== undefined ||\n assetConfig.manager !== undefined ||\n assetConfig.reserve !== undefined ||\n assetConfig.freeze !== undefined ||\n assetConfig.clawback !== undefined\n\n if (hasAssetParams) {\n // These fields are immutable after creation\n if (assetConfig.total !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Total',\n })\n }\n if (assetConfig.decimals !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Decimals',\n })\n }\n if (assetConfig.defaultFrozen !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Default frozen',\n })\n }\n if (assetConfig.assetName !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Asset name',\n })\n }\n if (assetConfig.unitName !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Unit name',\n })\n }\n if (assetConfig.url !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Url',\n })\n }\n if (assetConfig.metadataHash !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Metadata hash',\n })\n }\n }\n\n return errors\n}\n"],"mappings":";;;;;;;AA+IA,SAAgB,+BAA+B,aAAyE;CACtH,MAAM,SAAS,IAAI,OAAmC;AAEtD,KAAI,YAAY,YAAY,GAE1B,QAAO,KAAK,GAAG,sBAAsB,YAAY,CAAC;KAGlD,QAAO,KAAK,GAAG,2BAA2B,YAAY,CAAC;AAGzD,QAAO;;;;;AAMT,SAAS,sBAAsB,aAAyE;CACtG,MAAM,SAAS,IAAI,OAAmC;AAEtD,KAAI,YAAY,UAAU,OACxB,QAAO,KAAK;EACV,MAAMA,8CAA+B;EACrC,MAAM;EACP,CAAC;AAGJ,KAAI,YAAY,aAAa,UAAa,YAAY,WAAWC,qCAC/D,QAAO,KAAK;EACV,MAAMD,8CAA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ACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,aAAa,OAC3B,QAAO,KAAK;GACV,MAAMA,8CAA+B;GACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,QAAQ,OACtB,QAAO,KAAK;GACV,MAAMA,8CAA+B;GACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,iBAAiB,OAC/B,QAAO,KAAK;GACV,MAAMA,8CAA+B;GACrC,MAAM;GACP,CAAC;;AAIN,QAAO"}
1
+ {"version":3,"file":"asset-config.js","names":["TransactionValidationErrorType","MAX_ASSET_DECIMALS","MAX_ASSET_UNIT_NAME_LENGTH","MAX_ASSET_NAME_LENGTH","MAX_ASSET_URL_LENGTH"],"sources":["../../../../../packages/transact/src/transactions/asset-config.ts"],"sourcesContent":["import {\n Address,\n MAX_ASSET_DECIMALS,\n MAX_ASSET_NAME_LENGTH,\n MAX_ASSET_UNIT_NAME_LENGTH,\n MAX_ASSET_URL_LENGTH,\n} from '@algorandfoundation/algokit-common'\nimport { TransactionValidationError, TransactionValidationErrorType } from './common'\n\n/**\n * Represents an asset configuration transaction that creates, reconfigures, or destroys assets.\n */\nexport type AssetConfigTransactionFields = {\n /**\n * ID of the asset to operate on.\n *\n * For asset creation, this must be 0.\n * For asset reconfiguration this is the ID of the existing asset to be reconfigured,\n * For asset destroy this is the ID of the existing asset to be destroyed.\n */\n assetId: bigint\n\n /**\n * The total amount of the smallest divisible (decimal) unit to create.\n *\n * Required when creating a new asset.\n * For example, if creating a asset with 2 decimals and wanting a total supply of 100 units, this value should be 10000.\n *\n * This field can only be specified upon asset creation.\n */\n total?: bigint\n\n /**\n * The amount of decimal places the asset should have.\n *\n * If unspecified then the asset will be in whole units (i.e. `0`).\n * * If 0, the asset is not divisible;\n * * If 1, the base unit of the asset is in tenths;\n * * If 2, the base unit of the asset is in hundredths;\n * * If 3, the base unit of the asset is in thousandths;\n *\n * and so on up to 19 decimal places.\n *\n * This field can only be specified upon asset creation.\n */\n decimals?: number\n\n /**\n * Whether the asset is frozen by default for all accounts.\n * Defaults to `false`.\n *\n * If `true` then for anyone apart from the creator to hold the\n * asset it needs to be unfrozen per account using an asset freeze\n * transaction from the `freeze` account, which must be set on creation.\n *\n * This field can only be specified upon asset creation.\n */\n defaultFrozen?: boolean\n\n /**\n * The optional name of the asset.\n *\n * Max size is 32 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n assetName?: string\n\n /**\n * The optional name of the unit of this asset (e.g. ticker name).\n *\n * Max size is 8 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n unitName?: string\n\n /**\n * Specifies an optional URL where more information about the asset can be retrieved (e.g. metadata).\n *\n * Max size is 96 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n url?: string\n\n /**\n * 32-byte hash of some metadata that is relevant to your asset and/or asset holders.\n *\n * The format of this metadata is up to the application.\n *\n * This field can only be specified upon asset creation.\n */\n metadataHash?: Uint8Array\n\n /**\n * The address of the optional account that can manage the configuration of the asset and destroy it.\n *\n * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.\n *\n * If not set or set to the Zero address the asset becomes permanently immutable.\n */\n manager?: Address\n\n /**\n * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.\n *\n * This address has no specific authority in the protocol itself and is informational only.\n *\n * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)\n * rely on this field to hold meaningful data.\n *\n * It can be used in the case where you want to signal to holders of your asset that the uncirculated units\n * of the asset reside in an account that is different from the default creator account.\n *\n * If not set or set to the Zero address the field is permanently empty.\n */\n reserve?: Address\n\n /**\n * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.\n *\n * If empty, freezing is not permitted.\n *\n * If not set or set to the Zero address the field is permanently empty.\n */\n freeze?: Address\n\n /**\n * The address of the optional account that can clawback holdings of this asset from any account.\n *\n * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.\n *\n * If empty, clawback is not permitted.\n *\n * If not set or set to the Zero address the field is permanently empty.\n */\n clawback?: Address\n}\n\n/**\n * Validate asset configuration transaction fields\n */\nexport function validateAssetConfigTransaction(assetConfig: AssetConfigTransactionFields): TransactionValidationError[] {\n const errors = new Array<TransactionValidationError>()\n\n if (assetConfig.assetId === 0n) {\n // Asset creation\n errors.push(...validateAssetCreation(assetConfig))\n } else {\n // Asset configuration or destruction\n errors.push(...validateAssetConfiguration(assetConfig))\n }\n\n return errors\n}\n\n/**\n * Validate asset creation fields\n */\nfunction validateAssetCreation(assetConfig: AssetConfigTransactionFields): TransactionValidationError[] {\n const errors = new Array<TransactionValidationError>()\n\n if (assetConfig.total === undefined) {\n errors.push({\n type: TransactionValidationErrorType.RequiredField,\n data: 'Total',\n })\n }\n\n if (assetConfig.decimals !== undefined && assetConfig.decimals > MAX_ASSET_DECIMALS) {\n errors.push({\n type: TransactionValidationErrorType.FieldTooLong,\n data: {\n field: 'Decimals',\n actual: assetConfig.decimals,\n max: MAX_ASSET_DECIMALS,\n unit: 'decimal places',\n },\n })\n }\n\n if (assetConfig.unitName && assetConfig.unitName.length > MAX_ASSET_UNIT_NAME_LENGTH) {\n errors.push({\n type: TransactionValidationErrorType.FieldTooLong,\n data: {\n field: 'Unit name',\n actual: assetConfig.unitName.length,\n max: MAX_ASSET_UNIT_NAME_LENGTH,\n unit: 'bytes',\n },\n })\n }\n\n if (assetConfig.assetName && assetConfig.assetName.length > MAX_ASSET_NAME_LENGTH) {\n errors.push({\n type: TransactionValidationErrorType.FieldTooLong,\n data: {\n field: 'Asset name',\n actual: assetConfig.assetName.length,\n max: MAX_ASSET_NAME_LENGTH,\n unit: 'bytes',\n },\n })\n }\n\n if (assetConfig.url && assetConfig.url.length > MAX_ASSET_URL_LENGTH) {\n errors.push({\n type: TransactionValidationErrorType.FieldTooLong,\n data: {\n field: 'Url',\n actual: assetConfig.url.length,\n max: MAX_ASSET_URL_LENGTH,\n unit: 'bytes',\n },\n })\n }\n\n return errors\n}\n\n/**\n * Validate asset configuration fields\n */\nfunction validateAssetConfiguration(assetConfig: AssetConfigTransactionFields): TransactionValidationError[] {\n const errors = new Array<TransactionValidationError>()\n\n const hasAssetParams =\n assetConfig.total !== undefined ||\n assetConfig.decimals !== undefined ||\n assetConfig.defaultFrozen !== undefined ||\n assetConfig.assetName !== undefined ||\n assetConfig.unitName !== undefined ||\n assetConfig.url !== undefined ||\n assetConfig.metadataHash !== undefined ||\n assetConfig.manager !== undefined ||\n assetConfig.reserve !== undefined ||\n assetConfig.freeze !== undefined ||\n assetConfig.clawback !== undefined\n\n if (hasAssetParams) {\n // These fields are immutable after creation\n if (assetConfig.total !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Total',\n })\n }\n if (assetConfig.decimals !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Decimals',\n })\n }\n if (assetConfig.defaultFrozen !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Default frozen',\n })\n }\n if (assetConfig.assetName !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Asset name',\n })\n }\n if (assetConfig.unitName !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Unit name',\n })\n }\n if (assetConfig.url !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Url',\n })\n }\n if (assetConfig.metadataHash !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Metadata hash',\n })\n }\n }\n\n return errors\n}\n"],"mappings":";;;;;;;AA+IA,SAAgB,+BAA+B,aAAyE;CACtH,MAAM,SAAS,IAAI,OAAmC;AAEtD,KAAI,YAAY,YAAY,GAE1B,QAAO,KAAK,GAAG,sBAAsB,YAAY,CAAC;KAGlD,QAAO,KAAK,GAAG,2BAA2B,YAAY,CAAC;AAGzD,QAAO;;;;;AAMT,SAAS,sBAAsB,aAAyE;CACtG,MAAM,SAAS,IAAI,OAAmC;AAEtD,KAAI,Y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AEJ,MAAI,YAAY,kBAAkB,OAChC,QAAO,KAAK;GACV,MAAMA,8CAA+B;GACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,cAAc,OAC5B,QAAO,KAAK;GACV,MAAMA,8CAA+B;GACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,aAAa,OAC3B,QAAO,KAAK;GACV,MAAMA,8CAA+B;GACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,QAAQ,OACtB,QAAO,KAAK;GACV,MAAMA,8CAA+B;GACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,iBAAiB,OAC/B,QAAO,KAAK;GACV,MAAMA,8CAA+B;GACrC,MAAM;GACP,CAAC;;AAIN,QAAO"}
@@ -1 +1 @@
1
- {"version":3,"file":"asset-config.mjs","names":[],"sources":["../../../../../packages/transact/src/transactions/asset-config.ts"],"sourcesContent":["import {\n MAX_ASSET_DECIMALS,\n MAX_ASSET_NAME_LENGTH,\n MAX_ASSET_UNIT_NAME_LENGTH,\n MAX_ASSET_URL_LENGTH,\n Address,\n} from '@algorandfoundation/algokit-common'\nimport { TransactionValidationError, TransactionValidationErrorType } from './common'\n\n/**\n * Represents an asset configuration transaction that creates, reconfigures, or destroys assets.\n */\nexport type AssetConfigTransactionFields = {\n /**\n * ID of the asset to operate on.\n *\n * For asset creation, this must be 0.\n * For asset reconfiguration this is the ID of the existing asset to be reconfigured,\n * For asset destroy this is the ID of the existing asset to be destroyed.\n */\n assetId: bigint\n\n /**\n * The total amount of the smallest divisible (decimal) unit to create.\n *\n * Required when creating a new asset.\n * For example, if creating a asset with 2 decimals and wanting a total supply of 100 units, this value should be 10000.\n *\n * This field can only be specified upon asset creation.\n */\n total?: bigint\n\n /**\n * The amount of decimal places the asset should have.\n *\n * If unspecified then the asset will be in whole units (i.e. `0`).\n * * If 0, the asset is not divisible;\n * * If 1, the base unit of the asset is in tenths;\n * * If 2, the base unit of the asset is in hundredths;\n * * If 3, the base unit of the asset is in thousandths;\n *\n * and so on up to 19 decimal places.\n *\n * This field can only be specified upon asset creation.\n */\n decimals?: number\n\n /**\n * Whether the asset is frozen by default for all accounts.\n * Defaults to `false`.\n *\n * If `true` then for anyone apart from the creator to hold the\n * asset it needs to be unfrozen per account using an asset freeze\n * transaction from the `freeze` account, which must be set on creation.\n *\n * This field can only be specified upon asset creation.\n */\n defaultFrozen?: boolean\n\n /**\n * The optional name of the asset.\n *\n * Max size is 32 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n assetName?: string\n\n /**\n * The optional name of the unit of this asset (e.g. ticker name).\n *\n * Max size is 8 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n unitName?: string\n\n /**\n * Specifies an optional URL where more information about the asset can be retrieved (e.g. metadata).\n *\n * Max size is 96 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n url?: string\n\n /**\n * 32-byte hash of some metadata that is relevant to your asset and/or asset holders.\n *\n * The format of this metadata is up to the application.\n *\n * This field can only be specified upon asset creation.\n */\n metadataHash?: Uint8Array\n\n /**\n * The address of the optional account that can manage the configuration of the asset and destroy it.\n *\n * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.\n *\n * If not set or set to the Zero address the asset becomes permanently immutable.\n */\n manager?: Address\n\n /**\n * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.\n *\n * This address has no specific authority in the protocol itself and is informational only.\n *\n * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)\n * rely on this field to hold meaningful data.\n *\n * It can be used in the case where you want to signal to holders of your asset that the uncirculated units\n * of the asset reside in an account that is different from the default creator account.\n *\n * If not set or set to the Zero address the field is permanently empty.\n */\n reserve?: Address\n\n /**\n * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.\n *\n * If empty, freezing is not permitted.\n *\n * If not set or set to the Zero address the field is permanently empty.\n */\n freeze?: Address\n\n /**\n * The address of the optional account that can clawback holdings of this asset from any account.\n *\n * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.\n *\n * If empty, clawback is not permitted.\n *\n * If not set or set to the Zero address the field is permanently empty.\n */\n clawback?: Address\n}\n\n/**\n * Validate asset configuration transaction fields\n */\nexport function validateAssetConfigTransaction(assetConfig: AssetConfigTransactionFields): TransactionValidationError[] {\n const errors = new Array<TransactionValidationError>()\n\n if (assetConfig.assetId === 0n) {\n // Asset creation\n errors.push(...validateAssetCreation(assetConfig))\n } else {\n // Asset configuration or destruction\n errors.push(...validateAssetConfiguration(assetConfig))\n }\n\n return errors\n}\n\n/**\n * Validate asset creation fields\n */\nfunction validateAssetCreation(assetConfig: AssetConfigTransactionFields): TransactionValidationError[] {\n const errors = new Array<TransactionValidationError>()\n\n if (assetConfig.total === undefined) {\n errors.push({\n type: TransactionValidationErrorType.RequiredField,\n data: 'Total',\n })\n }\n\n if (assetConfig.decimals !== undefined && assetConfig.decimals > MAX_ASSET_DECIMALS) {\n errors.push({\n type: TransactionValidationErrorType.FieldTooLong,\n data: {\n field: 'Decimals',\n actual: assetConfig.decimals,\n max: MAX_ASSET_DECIMALS,\n unit: 'decimal places',\n },\n })\n }\n\n if (assetConfig.unitName && assetConfig.unitName.length > MAX_ASSET_UNIT_NAME_LENGTH) {\n errors.push({\n type: TransactionValidationErrorType.FieldTooLong,\n data: {\n field: 'Unit name',\n actual: assetConfig.unitName.length,\n max: MAX_ASSET_UNIT_NAME_LENGTH,\n unit: 'bytes',\n },\n })\n }\n\n if (assetConfig.assetName && assetConfig.assetName.length > MAX_ASSET_NAME_LENGTH) {\n errors.push({\n type: TransactionValidationErrorType.FieldTooLong,\n data: {\n field: 'Asset name',\n actual: assetConfig.assetName.length,\n max: MAX_ASSET_NAME_LENGTH,\n unit: 'bytes',\n },\n })\n }\n\n if (assetConfig.url && assetConfig.url.length > MAX_ASSET_URL_LENGTH) {\n errors.push({\n type: TransactionValidationErrorType.FieldTooLong,\n data: {\n field: 'Url',\n actual: assetConfig.url.length,\n max: MAX_ASSET_URL_LENGTH,\n unit: 'bytes',\n },\n })\n }\n\n return errors\n}\n\n/**\n * Validate asset configuration fields\n */\nfunction validateAssetConfiguration(assetConfig: AssetConfigTransactionFields): TransactionValidationError[] {\n const errors = new Array<TransactionValidationError>()\n\n const hasAssetParams =\n assetConfig.total !== undefined ||\n assetConfig.decimals !== undefined ||\n assetConfig.defaultFrozen !== undefined ||\n assetConfig.assetName !== undefined ||\n assetConfig.unitName !== undefined ||\n assetConfig.url !== undefined ||\n assetConfig.metadataHash !== undefined ||\n assetConfig.manager !== undefined ||\n assetConfig.reserve !== undefined ||\n assetConfig.freeze !== undefined ||\n assetConfig.clawback !== undefined\n\n if (hasAssetParams) {\n // These fields are immutable after creation\n if (assetConfig.total !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Total',\n })\n }\n if (assetConfig.decimals !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Decimals',\n })\n }\n if (assetConfig.defaultFrozen !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Default frozen',\n })\n }\n if (assetConfig.assetName !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Asset name',\n })\n }\n if (assetConfig.unitName !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Unit name',\n })\n }\n if (assetConfig.url !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Url',\n })\n }\n if (assetConfig.metadataHash !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Metadata hash',\n })\n }\n }\n\n return errors\n}\n"],"mappings":";;;;;;;AA+IA,SAAgB,+BAA+B,aAAyE;CACtH,MAAM,SAAS,IAAI,OAAmC;AAEtD,KAAI,YAAY,YAAY,GAE1B,QAAO,KAAK,GAAG,sBAAsB,YAAY,CAAC;KAGlD,QAAO,KAAK,GAAG,2BAA2B,YAAY,CAAC;AAGzD,QAAO;;;;;AAMT,SAAS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K;GACV,MAAM,+BAA+B;GACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,kBAAkB,OAChC,QAAO,KAAK;GACV,MAAM,+BAA+B;GACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,cAAc,OAC5B,QAAO,KAAK;GACV,MAAM,+BAA+B;GACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,aAAa,OAC3B,QAAO,KAAK;GACV,MAAM,+BAA+B;GACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,QAAQ,OACtB,QAAO,KAAK;GACV,MAAM,+BAA+B;GACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,iBAAiB,OAC/B,QAAO,KAAK;GACV,MAAM,+BAA+B;GACrC,MAAM;GACP,CAAC;;AAIN,QAAO"}
1
+ {"version":3,"file":"asset-config.mjs","names":[],"sources":["../../../../../packages/transact/src/transactions/asset-config.ts"],"sourcesContent":["import {\n Address,\n MAX_ASSET_DECIMALS,\n MAX_ASSET_NAME_LENGTH,\n MAX_ASSET_UNIT_NAME_LENGTH,\n MAX_ASSET_URL_LENGTH,\n} from '@algorandfoundation/algokit-common'\nimport { TransactionValidationError, TransactionValidationErrorType } from './common'\n\n/**\n * Represents an asset configuration transaction that creates, reconfigures, or destroys assets.\n */\nexport type AssetConfigTransactionFields = {\n /**\n * ID of the asset to operate on.\n *\n * For asset creation, this must be 0.\n * For asset reconfiguration this is the ID of the existing asset to be reconfigured,\n * For asset destroy this is the ID of the existing asset to be destroyed.\n */\n assetId: bigint\n\n /**\n * The total amount of the smallest divisible (decimal) unit to create.\n *\n * Required when creating a new asset.\n * For example, if creating a asset with 2 decimals and wanting a total supply of 100 units, this value should be 10000.\n *\n * This field can only be specified upon asset creation.\n */\n total?: bigint\n\n /**\n * The amount of decimal places the asset should have.\n *\n * If unspecified then the asset will be in whole units (i.e. `0`).\n * * If 0, the asset is not divisible;\n * * If 1, the base unit of the asset is in tenths;\n * * If 2, the base unit of the asset is in hundredths;\n * * If 3, the base unit of the asset is in thousandths;\n *\n * and so on up to 19 decimal places.\n *\n * This field can only be specified upon asset creation.\n */\n decimals?: number\n\n /**\n * Whether the asset is frozen by default for all accounts.\n * Defaults to `false`.\n *\n * If `true` then for anyone apart from the creator to hold the\n * asset it needs to be unfrozen per account using an asset freeze\n * transaction from the `freeze` account, which must be set on creation.\n *\n * This field can only be specified upon asset creation.\n */\n defaultFrozen?: boolean\n\n /**\n * The optional name of the asset.\n *\n * Max size is 32 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n assetName?: string\n\n /**\n * The optional name of the unit of this asset (e.g. ticker name).\n *\n * Max size is 8 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n unitName?: string\n\n /**\n * Specifies an optional URL where more information about the asset can be retrieved (e.g. metadata).\n *\n * Max size is 96 bytes.\n *\n * This field can only be specified upon asset creation.\n */\n url?: string\n\n /**\n * 32-byte hash of some metadata that is relevant to your asset and/or asset holders.\n *\n * The format of this metadata is up to the application.\n *\n * This field can only be specified upon asset creation.\n */\n metadataHash?: Uint8Array\n\n /**\n * The address of the optional account that can manage the configuration of the asset and destroy it.\n *\n * The configuration fields it can change are `manager`, `reserve`, `clawback`, and `freeze`.\n *\n * If not set or set to the Zero address the asset becomes permanently immutable.\n */\n manager?: Address\n\n /**\n * The address of the optional account that holds the reserve (uncirculated supply) units of the asset.\n *\n * This address has no specific authority in the protocol itself and is informational only.\n *\n * Some standards like [ARC-19](https://github.com/algorandfoundation/ARCs/blob/main/ARCs/arc-0019.md)\n * rely on this field to hold meaningful data.\n *\n * It can be used in the case where you want to signal to holders of your asset that the uncirculated units\n * of the asset reside in an account that is different from the default creator account.\n *\n * If not set or set to the Zero address the field is permanently empty.\n */\n reserve?: Address\n\n /**\n * The address of the optional account that can be used to freeze or unfreeze holdings of this asset for any account.\n *\n * If empty, freezing is not permitted.\n *\n * If not set or set to the Zero address the field is permanently empty.\n */\n freeze?: Address\n\n /**\n * The address of the optional account that can clawback holdings of this asset from any account.\n *\n * **This field should be used with caution** as the clawback account has the ability to **unconditionally take assets from any account**.\n *\n * If empty, clawback is not permitted.\n *\n * If not set or set to the Zero address the field is permanently empty.\n */\n clawback?: Address\n}\n\n/**\n * Validate asset configuration transaction fields\n */\nexport function validateAssetConfigTransaction(assetConfig: AssetConfigTransactionFields): TransactionValidationError[] {\n const errors = new Array<TransactionValidationError>()\n\n if (assetConfig.assetId === 0n) {\n // Asset creation\n errors.push(...validateAssetCreation(assetConfig))\n } else {\n // Asset configuration or destruction\n errors.push(...validateAssetConfiguration(assetConfig))\n }\n\n return errors\n}\n\n/**\n * Validate asset creation fields\n */\nfunction validateAssetCreation(assetConfig: AssetConfigTransactionFields): TransactionValidationError[] {\n const errors = new Array<TransactionValidationError>()\n\n if (assetConfig.total === undefined) {\n errors.push({\n type: TransactionValidationErrorType.RequiredField,\n data: 'Total',\n })\n }\n\n if (assetConfig.decimals !== undefined && assetConfig.decimals > MAX_ASSET_DECIMALS) {\n errors.push({\n type: TransactionValidationErrorType.FieldTooLong,\n data: {\n field: 'Decimals',\n actual: assetConfig.decimals,\n max: MAX_ASSET_DECIMALS,\n unit: 'decimal places',\n },\n })\n }\n\n if (assetConfig.unitName && assetConfig.unitName.length > MAX_ASSET_UNIT_NAME_LENGTH) {\n errors.push({\n type: TransactionValidationErrorType.FieldTooLong,\n data: {\n field: 'Unit name',\n actual: assetConfig.unitName.length,\n max: MAX_ASSET_UNIT_NAME_LENGTH,\n unit: 'bytes',\n },\n })\n }\n\n if (assetConfig.assetName && assetConfig.assetName.length > MAX_ASSET_NAME_LENGTH) {\n errors.push({\n type: TransactionValidationErrorType.FieldTooLong,\n data: {\n field: 'Asset name',\n actual: assetConfig.assetName.length,\n max: MAX_ASSET_NAME_LENGTH,\n unit: 'bytes',\n },\n })\n }\n\n if (assetConfig.url && assetConfig.url.length > MAX_ASSET_URL_LENGTH) {\n errors.push({\n type: TransactionValidationErrorType.FieldTooLong,\n data: {\n field: 'Url',\n actual: assetConfig.url.length,\n max: MAX_ASSET_URL_LENGTH,\n unit: 'bytes',\n },\n })\n }\n\n return errors\n}\n\n/**\n * Validate asset configuration fields\n */\nfunction validateAssetConfiguration(assetConfig: AssetConfigTransactionFields): TransactionValidationError[] {\n const errors = new Array<TransactionValidationError>()\n\n const hasAssetParams =\n assetConfig.total !== undefined ||\n assetConfig.decimals !== undefined ||\n assetConfig.defaultFrozen !== undefined ||\n assetConfig.assetName !== undefined ||\n assetConfig.unitName !== undefined ||\n assetConfig.url !== undefined ||\n assetConfig.metadataHash !== undefined ||\n assetConfig.manager !== undefined ||\n assetConfig.reserve !== undefined ||\n assetConfig.freeze !== undefined ||\n assetConfig.clawback !== undefined\n\n if (hasAssetParams) {\n // These fields are immutable after creation\n if (assetConfig.total !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Total',\n })\n }\n if (assetConfig.decimals !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Decimals',\n })\n }\n if (assetConfig.defaultFrozen !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Default frozen',\n })\n }\n if (assetConfig.assetName !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Asset name',\n })\n }\n if (assetConfig.unitName !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Unit name',\n })\n }\n if (assetConfig.url !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Url',\n })\n }\n if (assetConfig.metadataHash !== undefined) {\n errors.push({\n type: TransactionValidationErrorType.ImmutableField,\n data: 'Metadata hash',\n })\n }\n }\n\n return errors\n}\n"],"mappings":";;;;;;;AA+IA,SAAgB,+BAA+B,aAAyE;CACtH,MAAM,SAAS,IAAI,OAAmC;AAEtD,KAAI,YAAY,YAAY,GAE1B,QAAO,KAAK,GAAG,sBAAsB,YAAY,CAAC;KAGlD,QAAO,KAAK,GAAG,2BAA2B,YAAY,CAAC;AA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AY,aAAa,OAC3B,QAAO,KAAK;GACV,MAAM,+BAA+B;GACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,kBAAkB,OAChC,QAAO,KAAK;GACV,MAAM,+BAA+B;GACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,cAAc,OAC5B,QAAO,KAAK;GACV,MAAM,+BAA+B;GACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,aAAa,OAC3B,QAAO,KAAK;GACV,MAAM,+BAA+B;GACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,QAAQ,OACtB,QAAO,KAAK;GACV,MAAM,+BAA+B;GACrC,MAAM;GACP,CAAC;AAEJ,MAAI,YAAY,iBAAiB,OAC/B,QAAO,KAAK;GACV,MAAM,+BAA+B;GACrC,MAAM;GACP,CAAC;;AAIN,QAAO"}
@@ -1,5 +1,4 @@
1
1
  import { Address } from "../../../common/src/address.js";
2
- import { TransactionValidationError } from "./common.js";
3
2
 
4
3
  //#region packages/transact/src/transactions/asset-freeze.d.ts
5
4
 
@@ -26,10 +25,6 @@ type AssetFreezeTransactionFields = {
26
25
  */
27
26
  frozen: boolean;
28
27
  };
29
- /**
30
- * Validate asset freeze transaction fields
31
- */
32
- declare function validateAssetFreezeTransaction(assetFreeze: AssetFreezeTransactionFields): TransactionValidationError[];
33
28
  //#endregion
34
- export { AssetFreezeTransactionFields, validateAssetFreezeTransaction };
29
+ export { AssetFreezeTransactionFields };
35
30
  //# sourceMappingURL=asset-freeze.d.ts.map
@@ -1,5 +1,4 @@
1
1
  import { Address } from "../../../common/src/address.js";
2
- import { TransactionValidationError } from "./common.js";
3
2
 
4
3
  //#region packages/transact/src/transactions/asset-transfer.d.ts
5
4
 
@@ -47,10 +46,6 @@ type AssetTransferTransactionFields = {
47
46
  */
48
47
  closeRemainderTo?: Address;
49
48
  };
50
- /**
51
- * Validate asset transfer transaction fields
52
- */
53
- declare function validateAssetTransferTransaction(assetTransfer: AssetTransferTransactionFields): TransactionValidationError[];
54
49
  //#endregion
55
- export { AssetTransferTransactionFields, validateAssetTransferTransaction };
50
+ export { AssetTransferTransactionFields };
56
51
  //# sourceMappingURL=asset-transfer.d.ts.map
@@ -1,7 +1,4 @@
1
- import { TransactionValidationError } from "./common.js";
2
-
3
1
  //#region packages/transact/src/transactions/key-registration.d.ts
4
-
5
2
  /**
6
3
  * Represents a key registration transaction that registers an account online or offline
7
4
  * for participation in Algorand consensus.
@@ -36,10 +33,6 @@ type KeyRegistrationTransactionFields = {
36
33
  */
37
34
  nonParticipation?: boolean;
38
35
  };
39
- /**
40
- * Validate key registration transaction fields
41
- */
42
- declare function validateKeyRegistrationTransaction(keyReg: KeyRegistrationTransactionFields): TransactionValidationError[];
43
36
  //#endregion
44
- export { KeyRegistrationTransactionFields, validateKeyRegistrationTransaction };
37
+ export { KeyRegistrationTransactionFields };
45
38
  //# sourceMappingURL=key-registration.d.ts.map
@@ -121,6 +121,10 @@ declare function decodeSignedTransaction(encodedSignedTransaction: Uint8Array):
121
121
  * @returns A collection of decoded signed transactions or an error if decoding fails.
122
122
  */
123
123
  declare function decodeSignedTransactions(encodedSignedTransactions: Uint8Array[]): SignedTransaction[];
124
+ /**
125
+ * Validate a signed transaction structure
126
+ */
127
+ declare function validateSignedTransaction(signedTransaction: SignedTransaction): void;
124
128
  //#endregion
125
- export { LogicSignature, MultisigSignature, MultisigSubsignature, SignedTransaction, decodeSignedTransaction, decodeSignedTransactions, encodeSignedTransaction, encodeSignedTransactions };
129
+ export { LogicSignature, MultisigSignature, MultisigSubsignature, SignedTransaction, decodeSignedTransaction, decodeSignedTransactions, encodeSignedTransaction, encodeSignedTransactions, validateSignedTransaction };
126
130
  //# sourceMappingURL=signed-transaction.d.ts.map
@@ -12,7 +12,6 @@ const require_signed_transaction_meta = require('./signed-transaction-meta.js');
12
12
  * @returns The MsgPack encoded bytes or an error if encoding fails.
13
13
  */
14
14
  function encodeSignedTransaction(signedTransaction) {
15
- validateSignedTransaction(signedTransaction);
16
15
  return require_msgpack.encodeMsgpack(require_signed_transaction_meta.signedTransactionCodec.encode(signedTransaction, "msgpack"));
17
16
  }
18
17
  /**
@@ -64,4 +63,5 @@ exports.decodeSignedTransaction = decodeSignedTransaction;
64
63
  exports.decodeSignedTransactions = decodeSignedTransactions;
65
64
  exports.encodeSignedTransaction = encodeSignedTransaction;
66
65
  exports.encodeSignedTransactions = encodeSignedTransactions;
66
+ exports.validateSignedTransaction = validateSignedTransaction;
67
67
  //# sourceMappingURL=signed-transaction.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"signed-transaction.js","names":["encodeMsgpack","signedTransactionCodec","decodeMsgpack"],"sources":["../../../../../packages/transact/src/transactions/signed-transaction.ts"],"sourcesContent":["import type { Address } from '@algorandfoundation/algokit-common'\nimport { decodeMsgpack, encodeMsgpack } from '@algorandfoundation/algokit-common'\nimport { signedTransactionCodec } from './signed-transaction-meta'\nimport { Transaction, validateTransaction } from './transaction'\n\n/**\n * Represents a signed Algorand transaction\n */\nexport type SignedTransaction = {\n /**\n * The transaction that has been signed.\n */\n txn: Transaction\n\n /**\n * Optional Ed25519 signature authorizing the transaction.\n */\n sig?: Uint8Array\n\n /**\n * Optional multisignature signature for the transaction.\n */\n msig?: MultisigSignature\n\n /**\n * Optional logic signature for the transaction.\n */\n lsig?: LogicSignature\n\n /**\n * Optional auth address applicable if the transaction sender is a rekeyed account.\n */\n authAddress?: Address\n}\n\n/**\n * Represents a single subsignature in a multisignature transaction.\n *\n * Each subsignature contains the public key of a participant and an optional signature.\n */\nexport type MultisigSubsignature = {\n /**\n * Public key of a keypair account participant that is sub-signing a multisignature transaction.\n */\n publicKey: Uint8Array\n\n /**\n * Optional Ed25519 signature for the transaction.\n */\n sig?: Uint8Array\n}\n\n/**\n * Represents an Algorand multisignature signature.\n *\n * A multisignature signature is defined by a version, a threshold, and a list of participating addresses.\n * The version indicates the multisig protocol version, while the threshold specifies the minimum number of signatures required to authorize a transaction.\n * While technically this accepts `Address` types, it is expected that these will be the addresses of Ed25519 public keys.\n */\nexport type MultisigSignature = {\n /**\n * Multisig version.\n */\n version: number\n\n /**\n * Minimum number of signatures required.\n */\n threshold: number\n\n /**\n * Array of subsignatures\n */\n subsigs: Array<MultisigSubsignature>\n}\n\n/**\n * Logic signature structure\n */\nexport type LogicSignature = {\n /**\n * Logic signature program\n */\n logic: Uint8Array\n\n /**\n * Logic signature arguments\n */\n args?: Uint8Array[]\n\n /**\n * Signature for delegated logic sig\n */\n sig?: Uint8Array\n\n /**\n * Legacy multisig for delegated logic sig\n */\n msig?: MultisigSignature\n\n /**\n * Multisig for delegated logic sig\n */\n lmsig?: MultisigSignature\n}\n\n/**\n * Encode signed transactions to MsgPack for sending on the network.\n *\n * This method performs canonical encoding. No domain separation prefix is applicable.\n *\n * @param signedTransaction - The signed transaction to encode\n * @returns The MsgPack encoded bytes or an error if encoding fails.\n */\nexport function encodeSignedTransaction(signedTransaction: SignedTransaction): Uint8Array {\n validateSignedTransaction(signedTransaction)\n const encodingData = signedTransactionCodec.encode(signedTransaction, 'msgpack')\n return encodeMsgpack(encodingData)\n}\n\n/**\n * Encode signed transactions to MsgPack for sending on the network.\n *\n * This method performs canonical encoding. No domain separation prefix is applicable.\n *\n * @param signedTransactions - A collection of signed transactions to encode\n * @returns A collection of MsgPack encoded bytes or an error if encoding fails.\n */\nexport function encodeSignedTransactions(signedTransactions: SignedTransaction[]): Uint8Array[] {\n return signedTransactions.map((st) => encodeSignedTransaction(st))\n}\n\n/**\n * Decodes MsgPack bytes into a signed transaction.\n *\n * @param encodedSignedTransaction - The MsgPack encoded signed transaction bytes\n * @returns The decoded SignedTransaction or an error if decoding fails.\n */\nexport function decodeSignedTransaction(encodedSignedTransaction: Uint8Array): SignedTransaction {\n const decodedData = decodeMsgpack(encodedSignedTransaction)\n return signedTransactionCodec.decode(decodedData, 'msgpack')\n}\n\n/**\n * Decodes a collection of MsgPack bytes into a signed transaction collection.\n *\n * @param encodedSignedTransactions - A collection of MsgPack encoded bytes, each representing a signed transaction.\n * @returns A collection of decoded signed transactions or an error if decoding fails.\n */\nexport function decodeSignedTransactions(encodedSignedTransactions: Uint8Array[]): SignedTransaction[] {\n return encodedSignedTransactions.map((est) => decodeSignedTransaction(est))\n}\n\n/**\n * Validate a signed transaction structure\n */\nfunction validateSignedTransaction(signedTransaction: SignedTransaction): void {\n validateTransaction(signedTransaction.txn)\n\n // Validate that only one signature type is set\n const sigTypes = [signedTransaction.sig, signedTransaction.msig, signedTransaction.lsig]\n const setSigCount = sigTypes.filter((sig) => sig !== undefined).length\n\n if (setSigCount > 1) {\n throw new Error(`Only one signature type can be set, found ${setSigCount}`)\n }\n\n // Validate signature lengths\n if (signedTransaction.sig && signedTransaction.sig.length !== 64) {\n throw new Error('Signature must be 64 bytes')\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAkHA,SAAgB,wBAAwB,mBAAkD;AACxF,2BAA0B,kBAAkB;AAE5C,QAAOA,8BADcC,uDAAuB,OAAO,mBAAmB,UAAU,CAC9C;;;;;;;;;;AAWpC,SAAgB,yBAAyB,oBAAuD;AAC9F,QAAO,mBAAmB,KAAK,OAAO,wBAAwB,GAAG,CAAC;;;;;;;;AASpE,SAAgB,wBAAwB,0BAAyD;CAC/F,MAAM,cAAcC,8BAAc,yBAAyB;AAC3D,QAAOD,uDAAuB,OAAO,aAAa,UAAU;;;;;;;;AAS9D,SAAgB,yBAAyB,2BAA8D;AACrG,QAAO,0BAA0B,KAAK,QAAQ,wBAAwB,IAAI,CAAC;;;;;AAM7E,SAAS,0BAA0B,mBAA4C;AAC7E,yCAAoB,kBAAkB,IAAI;CAI1C,MAAM,cADW;EAAC,kBAAkB;EAAK,kBAAkB;EAAM,kBAAkB;EAAK,CAC3D,QAAQ,QAAQ,QAAQ,OAAU,CAAC;AAEhE,KAAI,cAAc,EAChB,OAAM,IAAI,MAAM,6CAA6C,cAAc;AAI7E,KAAI,kBAAkB,OAAO,kBAAkB,IAAI,WAAW,GAC5D,OAAM,IAAI,MAAM,6BAA6B"}
1
+ {"version":3,"file":"signed-transaction.js","names":["encodeMsgpack","signedTransactionCodec","decodeMsgpack"],"sources":["../../../../../packages/transact/src/transactions/signed-transaction.ts"],"sourcesContent":["import type { Address } from '@algorandfoundation/algokit-common'\nimport { decodeMsgpack, encodeMsgpack } from '@algorandfoundation/algokit-common'\nimport { signedTransactionCodec } from './signed-transaction-meta'\nimport { Transaction, validateTransaction } from './transaction'\n\n/**\n * Represents a signed Algorand transaction\n */\nexport type SignedTransaction = {\n /**\n * The transaction that has been signed.\n */\n txn: Transaction\n\n /**\n * Optional Ed25519 signature authorizing the transaction.\n */\n sig?: Uint8Array\n\n /**\n * Optional multisignature signature for the transaction.\n */\n msig?: MultisigSignature\n\n /**\n * Optional logic signature for the transaction.\n */\n lsig?: LogicSignature\n\n /**\n * Optional auth address applicable if the transaction sender is a rekeyed account.\n */\n authAddress?: Address\n}\n\n/**\n * Represents a single subsignature in a multisignature transaction.\n *\n * Each subsignature contains the public key of a participant and an optional signature.\n */\nexport type MultisigSubsignature = {\n /**\n * Public key of a keypair account participant that is sub-signing a multisignature transaction.\n */\n publicKey: Uint8Array\n\n /**\n * Optional Ed25519 signature for the transaction.\n */\n sig?: Uint8Array\n}\n\n/**\n * Represents an Algorand multisignature signature.\n *\n * A multisignature signature is defined by a version, a threshold, and a list of participating addresses.\n * The version indicates the multisig protocol version, while the threshold specifies the minimum number of signatures required to authorize a transaction.\n * While technically this accepts `Address` types, it is expected that these will be the addresses of Ed25519 public keys.\n */\nexport type MultisigSignature = {\n /**\n * Multisig version.\n */\n version: number\n\n /**\n * Minimum number of signatures required.\n */\n threshold: number\n\n /**\n * Array of subsignatures\n */\n subsigs: Array<MultisigSubsignature>\n}\n\n/**\n * Logic signature structure\n */\nexport type LogicSignature = {\n /**\n * Logic signature program\n */\n logic: Uint8Array\n\n /**\n * Logic signature arguments\n */\n args?: Uint8Array[]\n\n /**\n * Signature for delegated logic sig\n */\n sig?: Uint8Array\n\n /**\n * Legacy multisig for delegated logic sig\n */\n msig?: MultisigSignature\n\n /**\n * Multisig for delegated logic sig\n */\n lmsig?: MultisigSignature\n}\n\n/**\n * Encode signed transactions to MsgPack for sending on the network.\n *\n * This method performs canonical encoding. No domain separation prefix is applicable.\n *\n * @param signedTransaction - The signed transaction to encode\n * @returns The MsgPack encoded bytes or an error if encoding fails.\n */\nexport function encodeSignedTransaction(signedTransaction: SignedTransaction): Uint8Array {\n const encodingData = signedTransactionCodec.encode(signedTransaction, 'msgpack')\n return encodeMsgpack(encodingData)\n}\n\n/**\n * Encode signed transactions to MsgPack for sending on the network.\n *\n * This method performs canonical encoding. No domain separation prefix is applicable.\n *\n * @param signedTransactions - A collection of signed transactions to encode\n * @returns A collection of MsgPack encoded bytes or an error if encoding fails.\n */\nexport function encodeSignedTransactions(signedTransactions: SignedTransaction[]): Uint8Array[] {\n return signedTransactions.map((st) => encodeSignedTransaction(st))\n}\n\n/**\n * Decodes MsgPack bytes into a signed transaction.\n *\n * @param encodedSignedTransaction - The MsgPack encoded signed transaction bytes\n * @returns The decoded SignedTransaction or an error if decoding fails.\n */\nexport function decodeSignedTransaction(encodedSignedTransaction: Uint8Array): SignedTransaction {\n const decodedData = decodeMsgpack(encodedSignedTransaction)\n return signedTransactionCodec.decode(decodedData, 'msgpack')\n}\n\n/**\n * Decodes a collection of MsgPack bytes into a signed transaction collection.\n *\n * @param encodedSignedTransactions - A collection of MsgPack encoded bytes, each representing a signed transaction.\n * @returns A collection of decoded signed transactions or an error if decoding fails.\n */\nexport function decodeSignedTransactions(encodedSignedTransactions: Uint8Array[]): SignedTransaction[] {\n return encodedSignedTransactions.map((est) => decodeSignedTransaction(est))\n}\n\n/**\n * Validate a signed transaction structure\n */\nexport function validateSignedTransaction(signedTransaction: SignedTransaction): void {\n validateTransaction(signedTransaction.txn)\n\n // Validate that only one signature type is set\n const sigTypes = [signedTransaction.sig, signedTransaction.msig, signedTransaction.lsig]\n const setSigCount = sigTypes.filter((sig) => sig !== undefined).length\n\n if (setSigCount > 1) {\n throw new Error(`Only one signature type can be set, found ${setSigCount}`)\n }\n\n // Validate signature lengths\n if (signedTransaction.sig && signedTransaction.sig.length !== 64) {\n throw new Error('Signature must be 64 bytes')\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAkHA,SAAgB,wBAAwB,mBAAkD;AAExF,QAAOA,8BADcC,uDAAuB,OAAO,mBAAmB,UAAU,CAC9C;;;;;;;;;;AAWpC,SAAgB,yBAAyB,oBAAuD;AAC9F,QAAO,mBAAmB,KAAK,OAAO,wBAAwB,GAAG,CAAC;;;;;;;;AASpE,SAAgB,wBAAwB,0BAAyD;CAC/F,MAAM,cAAcC,8BAAc,yBAAyB;AAC3D,QAAOD,uDAAuB,OAAO,aAAa,UAAU;;;;;;;;AAS9D,SAAgB,yBAAyB,2BAA8D;AACrG,QAAO,0BAA0B,KAAK,QAAQ,wBAAwB,IAAI,CAAC;;;;;AAM7E,SAAgB,0BAA0B,mBAA4C;AACpF,yCAAoB,kBAAkB,IAAI;CAI1C,MAAM,cADW;EAAC,kBAAkB;EAAK,kBAAkB;EAAM,kBAAkB;EAAK,CAC3D,QAAQ,QAAQ,QAAQ,OAAU,CAAC;AAEhE,KAAI,cAAc,EAChB,OAAM,IAAI,MAAM,6CAA6C,cAAc;AAI7E,KAAI,kBAAkB,OAAO,kBAAkB,IAAI,WAAW,GAC5D,OAAM,IAAI,MAAM,6BAA6B"}
@@ -12,7 +12,6 @@ import { signedTransactionCodec } from "./signed-transaction-meta.mjs";
12
12
  * @returns The MsgPack encoded bytes or an error if encoding fails.
13
13
  */
14
14
  function encodeSignedTransaction(signedTransaction) {
15
- validateSignedTransaction(signedTransaction);
16
15
  return encodeMsgpack(signedTransactionCodec.encode(signedTransaction, "msgpack"));
17
16
  }
18
17
  /**
@@ -60,5 +59,5 @@ function validateSignedTransaction(signedTransaction) {
60
59
  }
61
60
 
62
61
  //#endregion
63
- export { decodeSignedTransaction, decodeSignedTransactions, encodeSignedTransaction, encodeSignedTransactions };
62
+ export { decodeSignedTransaction, decodeSignedTransactions, encodeSignedTransaction, encodeSignedTransactions, validateSignedTransaction };
64
63
  //# sourceMappingURL=signed-transaction.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"signed-transaction.mjs","names":[],"sources":["../../../../../packages/transact/src/transactions/signed-transaction.ts"],"sourcesContent":["import type { Address } from '@algorandfoundation/algokit-common'\nimport { decodeMsgpack, encodeMsgpack } from '@algorandfoundation/algokit-common'\nimport { signedTransactionCodec } from './signed-transaction-meta'\nimport { Transaction, validateTransaction } from './transaction'\n\n/**\n * Represents a signed Algorand transaction\n */\nexport type SignedTransaction = {\n /**\n * The transaction that has been signed.\n */\n txn: Transaction\n\n /**\n * Optional Ed25519 signature authorizing the transaction.\n */\n sig?: Uint8Array\n\n /**\n * Optional multisignature signature for the transaction.\n */\n msig?: MultisigSignature\n\n /**\n * Optional logic signature for the transaction.\n */\n lsig?: LogicSignature\n\n /**\n * Optional auth address applicable if the transaction sender is a rekeyed account.\n */\n authAddress?: Address\n}\n\n/**\n * Represents a single subsignature in a multisignature transaction.\n *\n * Each subsignature contains the public key of a participant and an optional signature.\n */\nexport type MultisigSubsignature = {\n /**\n * Public key of a keypair account participant that is sub-signing a multisignature transaction.\n */\n publicKey: Uint8Array\n\n /**\n * Optional Ed25519 signature for the transaction.\n */\n sig?: Uint8Array\n}\n\n/**\n * Represents an Algorand multisignature signature.\n *\n * A multisignature signature is defined by a version, a threshold, and a list of participating addresses.\n * The version indicates the multisig protocol version, while the threshold specifies the minimum number of signatures required to authorize a transaction.\n * While technically this accepts `Address` types, it is expected that these will be the addresses of Ed25519 public keys.\n */\nexport type MultisigSignature = {\n /**\n * Multisig version.\n */\n version: number\n\n /**\n * Minimum number of signatures required.\n */\n threshold: number\n\n /**\n * Array of subsignatures\n */\n subsigs: Array<MultisigSubsignature>\n}\n\n/**\n * Logic signature structure\n */\nexport type LogicSignature = {\n /**\n * Logic signature program\n */\n logic: Uint8Array\n\n /**\n * Logic signature arguments\n */\n args?: Uint8Array[]\n\n /**\n * Signature for delegated logic sig\n */\n sig?: Uint8Array\n\n /**\n * Legacy multisig for delegated logic sig\n */\n msig?: MultisigSignature\n\n /**\n * Multisig for delegated logic sig\n */\n lmsig?: MultisigSignature\n}\n\n/**\n * Encode signed transactions to MsgPack for sending on the network.\n *\n * This method performs canonical encoding. No domain separation prefix is applicable.\n *\n * @param signedTransaction - The signed transaction to encode\n * @returns The MsgPack encoded bytes or an error if encoding fails.\n */\nexport function encodeSignedTransaction(signedTransaction: SignedTransaction): Uint8Array {\n validateSignedTransaction(signedTransaction)\n const encodingData = signedTransactionCodec.encode(signedTransaction, 'msgpack')\n return encodeMsgpack(encodingData)\n}\n\n/**\n * Encode signed transactions to MsgPack for sending on the network.\n *\n * This method performs canonical encoding. No domain separation prefix is applicable.\n *\n * @param signedTransactions - A collection of signed transactions to encode\n * @returns A collection of MsgPack encoded bytes or an error if encoding fails.\n */\nexport function encodeSignedTransactions(signedTransactions: SignedTransaction[]): Uint8Array[] {\n return signedTransactions.map((st) => encodeSignedTransaction(st))\n}\n\n/**\n * Decodes MsgPack bytes into a signed transaction.\n *\n * @param encodedSignedTransaction - The MsgPack encoded signed transaction bytes\n * @returns The decoded SignedTransaction or an error if decoding fails.\n */\nexport function decodeSignedTransaction(encodedSignedTransaction: Uint8Array): SignedTransaction {\n const decodedData = decodeMsgpack(encodedSignedTransaction)\n return signedTransactionCodec.decode(decodedData, 'msgpack')\n}\n\n/**\n * Decodes a collection of MsgPack bytes into a signed transaction collection.\n *\n * @param encodedSignedTransactions - A collection of MsgPack encoded bytes, each representing a signed transaction.\n * @returns A collection of decoded signed transactions or an error if decoding fails.\n */\nexport function decodeSignedTransactions(encodedSignedTransactions: Uint8Array[]): SignedTransaction[] {\n return encodedSignedTransactions.map((est) => decodeSignedTransaction(est))\n}\n\n/**\n * Validate a signed transaction structure\n */\nfunction validateSignedTransaction(signedTransaction: SignedTransaction): void {\n validateTransaction(signedTransaction.txn)\n\n // Validate that only one signature type is set\n const sigTypes = [signedTransaction.sig, signedTransaction.msig, signedTransaction.lsig]\n const setSigCount = sigTypes.filter((sig) => sig !== undefined).length\n\n if (setSigCount > 1) {\n throw new Error(`Only one signature type can be set, found ${setSigCount}`)\n }\n\n // Validate signature lengths\n if (signedTransaction.sig && signedTransaction.sig.length !== 64) {\n throw new Error('Signature must be 64 bytes')\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAkHA,SAAgB,wBAAwB,mBAAkD;AACxF,2BAA0B,kBAAkB;AAE5C,QAAO,cADc,uBAAuB,OAAO,mBAAmB,UAAU,CAC9C;;;;;;;;;;AAWpC,SAAgB,yBAAyB,oBAAuD;AAC9F,QAAO,mBAAmB,KAAK,OAAO,wBAAwB,GAAG,CAAC;;;;;;;;AASpE,SAAgB,wBAAwB,0BAAyD;CAC/F,MAAM,cAAc,cAAc,yBAAyB;AAC3D,QAAO,uBAAuB,OAAO,aAAa,UAAU;;;;;;;;AAS9D,SAAgB,yBAAyB,2BAA8D;AACrG,QAAO,0BAA0B,KAAK,QAAQ,wBAAwB,IAAI,CAAC;;;;;AAM7E,SAAS,0BAA0B,mBAA4C;AAC7E,qBAAoB,kBAAkB,IAAI;CAI1C,MAAM,cADW;EAAC,kBAAkB;EAAK,kBAAkB;EAAM,kBAAkB;EAAK,CAC3D,QAAQ,QAAQ,QAAQ,OAAU,CAAC;AAEhE,KAAI,cAAc,EAChB,OAAM,IAAI,MAAM,6CAA6C,cAAc;AAI7E,KAAI,kBAAkB,OAAO,kBAAkB,IAAI,WAAW,GAC5D,OAAM,IAAI,MAAM,6BAA6B"}
1
+ {"version":3,"file":"signed-transaction.mjs","names":[],"sources":["../../../../../packages/transact/src/transactions/signed-transaction.ts"],"sourcesContent":["import type { Address } from '@algorandfoundation/algokit-common'\nimport { decodeMsgpack, encodeMsgpack } from '@algorandfoundation/algokit-common'\nimport { signedTransactionCodec } from './signed-transaction-meta'\nimport { Transaction, validateTransaction } from './transaction'\n\n/**\n * Represents a signed Algorand transaction\n */\nexport type SignedTransaction = {\n /**\n * The transaction that has been signed.\n */\n txn: Transaction\n\n /**\n * Optional Ed25519 signature authorizing the transaction.\n */\n sig?: Uint8Array\n\n /**\n * Optional multisignature signature for the transaction.\n */\n msig?: MultisigSignature\n\n /**\n * Optional logic signature for the transaction.\n */\n lsig?: LogicSignature\n\n /**\n * Optional auth address applicable if the transaction sender is a rekeyed account.\n */\n authAddress?: Address\n}\n\n/**\n * Represents a single subsignature in a multisignature transaction.\n *\n * Each subsignature contains the public key of a participant and an optional signature.\n */\nexport type MultisigSubsignature = {\n /**\n * Public key of a keypair account participant that is sub-signing a multisignature transaction.\n */\n publicKey: Uint8Array\n\n /**\n * Optional Ed25519 signature for the transaction.\n */\n sig?: Uint8Array\n}\n\n/**\n * Represents an Algorand multisignature signature.\n *\n * A multisignature signature is defined by a version, a threshold, and a list of participating addresses.\n * The version indicates the multisig protocol version, while the threshold specifies the minimum number of signatures required to authorize a transaction.\n * While technically this accepts `Address` types, it is expected that these will be the addresses of Ed25519 public keys.\n */\nexport type MultisigSignature = {\n /**\n * Multisig version.\n */\n version: number\n\n /**\n * Minimum number of signatures required.\n */\n threshold: number\n\n /**\n * Array of subsignatures\n */\n subsigs: Array<MultisigSubsignature>\n}\n\n/**\n * Logic signature structure\n */\nexport type LogicSignature = {\n /**\n * Logic signature program\n */\n logic: Uint8Array\n\n /**\n * Logic signature arguments\n */\n args?: Uint8Array[]\n\n /**\n * Signature for delegated logic sig\n */\n sig?: Uint8Array\n\n /**\n * Legacy multisig for delegated logic sig\n */\n msig?: MultisigSignature\n\n /**\n * Multisig for delegated logic sig\n */\n lmsig?: MultisigSignature\n}\n\n/**\n * Encode signed transactions to MsgPack for sending on the network.\n *\n * This method performs canonical encoding. No domain separation prefix is applicable.\n *\n * @param signedTransaction - The signed transaction to encode\n * @returns The MsgPack encoded bytes or an error if encoding fails.\n */\nexport function encodeSignedTransaction(signedTransaction: SignedTransaction): Uint8Array {\n const encodingData = signedTransactionCodec.encode(signedTransaction, 'msgpack')\n return encodeMsgpack(encodingData)\n}\n\n/**\n * Encode signed transactions to MsgPack for sending on the network.\n *\n * This method performs canonical encoding. No domain separation prefix is applicable.\n *\n * @param signedTransactions - A collection of signed transactions to encode\n * @returns A collection of MsgPack encoded bytes or an error if encoding fails.\n */\nexport function encodeSignedTransactions(signedTransactions: SignedTransaction[]): Uint8Array[] {\n return signedTransactions.map((st) => encodeSignedTransaction(st))\n}\n\n/**\n * Decodes MsgPack bytes into a signed transaction.\n *\n * @param encodedSignedTransaction - The MsgPack encoded signed transaction bytes\n * @returns The decoded SignedTransaction or an error if decoding fails.\n */\nexport function decodeSignedTransaction(encodedSignedTransaction: Uint8Array): SignedTransaction {\n const decodedData = decodeMsgpack(encodedSignedTransaction)\n return signedTransactionCodec.decode(decodedData, 'msgpack')\n}\n\n/**\n * Decodes a collection of MsgPack bytes into a signed transaction collection.\n *\n * @param encodedSignedTransactions - A collection of MsgPack encoded bytes, each representing a signed transaction.\n * @returns A collection of decoded signed transactions or an error if decoding fails.\n */\nexport function decodeSignedTransactions(encodedSignedTransactions: Uint8Array[]): SignedTransaction[] {\n return encodedSignedTransactions.map((est) => decodeSignedTransaction(est))\n}\n\n/**\n * Validate a signed transaction structure\n */\nexport function validateSignedTransaction(signedTransaction: SignedTransaction): void {\n validateTransaction(signedTransaction.txn)\n\n // Validate that only one signature type is set\n const sigTypes = [signedTransaction.sig, signedTransaction.msig, signedTransaction.lsig]\n const setSigCount = sigTypes.filter((sig) => sig !== undefined).length\n\n if (setSigCount > 1) {\n throw new Error(`Only one signature type can be set, found ${setSigCount}`)\n }\n\n // Validate signature lengths\n if (signedTransaction.sig && signedTransaction.sig.length !== 64) {\n throw new Error('Signature must be 64 bytes')\n }\n}\n"],"mappings":";;;;;;;;;;;;;AAkHA,SAAgB,wBAAwB,mBAAkD;AAExF,QAAO,cADc,uBAAuB,OAAO,mBAAmB,UAAU,CAC9C;;;;;;;;;;AAWpC,SAAgB,yBAAyB,oBAAuD;AAC9F,QAAO,mBAAmB,KAAK,OAAO,wBAAwB,GAAG,CAAC;;;;;;;;AASpE,SAAgB,wBAAwB,0BAAyD;CAC/F,MAAM,cAAc,cAAc,yBAAyB;AAC3D,QAAO,uBAAuB,OAAO,aAAa,UAAU;;;;;;;;AAS9D,SAAgB,yBAAyB,2BAA8D;AACrG,QAAO,0BAA0B,KAAK,QAAQ,wBAAwB,IAAI,CAAC;;;;;AAM7E,SAAgB,0BAA0B,mBAA4C;AACpF,qBAAoB,kBAAkB,IAAI;CAI1C,MAAM,cADW;EAAC,kBAAkB;EAAK,kBAAkB;EAAM,kBAAkB;EAAK,CAC3D,QAAQ,QAAQ,QAAQ,OAAU,CAAC;AAEhE,KAAI,cAAc,EAChB,OAAM,IAAI,MAAM,6CAA6C,cAAc;AAI7E,KAAI,kBAAkB,OAAO,kBAAkB,IAAI,WAAW,GAC5D,OAAM,IAAI,MAAM,6BAA6B"}
@@ -271,6 +271,10 @@ declare function encodeTransaction(transaction: Transaction): Uint8Array;
271
271
  * @returns A collection of MsgPack encoded bytes or an error if encoding fails.
272
272
  */
273
273
  declare function encodeTransactions(transactions: Transaction[]): Uint8Array[];
274
+ /**
275
+ * Validate a transaction
276
+ */
277
+ declare function validateTransaction(transaction: Transaction): void;
274
278
  /**
275
279
  * Encode the transaction without the domain separation (e.g. "TX") prefix
276
280
  * This is useful for encoding the transaction for signing with tools that automatically add "TX" prefix to the transaction bytes.
@@ -308,5 +312,5 @@ declare function groupTransactions(transactions: Transaction[]): Transaction[];
308
312
  declare function assignFee(transaction: Transaction, feeParams: FeeParams): Transaction;
309
313
  declare function calculateFee(transaction: Transaction, feeParams: FeeParams): bigint;
310
314
  //#endregion
311
- export { Transaction, TransactionParams, assignFee, calculateFee, decodeTransaction, decodeTransactions, encodeTransaction, encodeTransactionRaw, encodeTransactions, estimateTransactionSize, getEncodedTransactionType, groupTransactions, transactionCodec };
315
+ export { Transaction, TransactionParams, assignFee, calculateFee, decodeTransaction, decodeTransactions, encodeTransaction, encodeTransactionRaw, encodeTransactions, estimateTransactionSize, getEncodedTransactionType, groupTransactions, transactionCodec, validateTransaction };
312
316
  //# sourceMappingURL=transaction.d.ts.map
@@ -253,7 +253,6 @@ function validateTransaction(transaction) {
253
253
  * This is useful for encoding the transaction for signing with tools that automatically add "TX" prefix to the transaction bytes.
254
254
  */
255
255
  function encodeTransactionRaw(transaction) {
256
- validateTransaction(transaction);
257
256
  return require_msgpack.encodeMsgpack(transactionCodec.encode(transaction, "msgpack"));
258
257
  }
259
258
  /**