@algorandfoundation/algokit-utils 10.0.0-alpha.11 → 10.0.0-alpha.13
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.
- package/algod-client/index.d.ts +2 -3
- package/algod-client/index.js +2 -5
- package/algod-client/index.mjs +2 -2
- package/indexer-client/index.d.ts +1 -2
- package/indexer-client/index.js +0 -5
- package/indexer-client/index.mjs +1 -2
- package/kmd-client/index.d.ts +1 -2
- package/kmd-client/index.js +0 -5
- package/kmd-client/index.mjs +1 -2
- package/package.json +1 -1
- package/packages/algod_client/src/apis/api-service.js +2 -2
- package/packages/algod_client/src/apis/api-service.mjs +2 -2
- package/packages/algod_client/src/core/model-runtime.js +2 -2
- package/packages/algod_client/src/core/model-runtime.js.map +1 -1
- package/packages/algod_client/src/core/model-runtime.mjs +2 -2
- package/packages/algod_client/src/core/model-runtime.mjs.map +1 -1
- package/packages/algod_client/src/models/block.d.ts +17 -17
- package/packages/algod_client/src/models/block.js +18 -18
- package/packages/algod_client/src/models/block.js.map +1 -1
- package/packages/algod_client/src/models/block.mjs +18 -18
- package/packages/algod_client/src/models/block.mjs.map +1 -1
- package/packages/algod_client/src/models/simulate-request.js +1 -1
- package/packages/algod_client/src/models/simulate-request.mjs +1 -1
- package/packages/algod_client/src/models/simulate-response.d.ts +2 -1
- package/packages/algod_client/src/models/simulate-response.js +6 -1
- package/packages/algod_client/src/models/simulate-response.js.map +1 -1
- package/packages/algod_client/src/models/simulate-response.mjs +6 -2
- package/packages/algod_client/src/models/simulate-response.mjs.map +1 -1
- package/packages/indexer_client/src/core/model-runtime.js +0 -15
- package/packages/indexer_client/src/core/model-runtime.js.map +1 -1
- package/packages/indexer_client/src/core/model-runtime.mjs +1 -13
- package/packages/indexer_client/src/core/model-runtime.mjs.map +1 -1
- package/packages/indexer_client/src/models/block.d.ts +5 -5
- package/packages/indexer_client/src/models/block.js +5 -5
- package/packages/indexer_client/src/models/block.js.map +1 -1
- package/packages/indexer_client/src/models/block.mjs +5 -5
- package/packages/indexer_client/src/models/block.mjs.map +1 -1
- package/packages/indexer_client/src/models/participation-updates.d.ts +2 -2
- package/packages/indexer_client/src/models/participation-updates.js +2 -2
- package/packages/indexer_client/src/models/participation-updates.js.map +1 -1
- package/packages/indexer_client/src/models/participation-updates.mjs +2 -2
- package/packages/indexer_client/src/models/participation-updates.mjs.map +1 -1
- package/packages/kmd_client/src/core/model-runtime.js +2 -12
- package/packages/kmd_client/src/core/model-runtime.js.map +1 -1
- package/packages/kmd_client/src/core/model-runtime.mjs +3 -11
- package/packages/kmd_client/src/core/model-runtime.mjs.map +1 -1
- package/transactions/app-call.d.ts +1 -1
- package/transactions/app-call.js.map +1 -1
- package/transactions/app-call.mjs.map +1 -1
- package/transactions/method-call.d.ts +1 -1
- package/transactions/method-call.js.map +1 -1
- package/transactions/method-call.mjs.map +1 -1
- package/types/algorand-client-transaction-creator.d.ts +19 -19
- package/types/algorand-client-transaction-creator.js.map +1 -1
- package/types/algorand-client-transaction-creator.mjs.map +1 -1
- package/types/algorand-client-transaction-sender.d.ts +18 -18
- package/types/app-client.d.ts +65 -65
- package/types/app-client.js.map +1 -1
- package/types/app-client.mjs.map +1 -1
- package/types/app-deployer.d.ts +1 -1
- package/types/app-deployer.js.map +1 -1
- package/types/app-deployer.mjs.map +1 -1
- package/types/app-factory.d.ts +25 -25
- package/types/app-factory.js.map +1 -1
- package/types/app-factory.mjs.map +1 -1
- package/types/app.d.ts +1 -1
- package/types/app.js.map +1 -1
- package/types/app.mjs.map +1 -1
- package/types/async-event-emitter.d.ts +3 -6
- package/types/async-event-emitter.js.map +1 -1
- package/types/async-event-emitter.mjs.map +1 -1
- package/types/client-manager.d.ts +1 -1
- package/types/client-manager.js.map +1 -1
- package/types/client-manager.mjs.map +1 -1
- package/types/composer.d.ts +1 -1
- package/types/composer.js +3 -3
- package/types/composer.js.map +1 -1
- package/types/composer.mjs +3 -3
- package/types/composer.mjs.map +1 -1
- package/types/debugging.d.ts +13 -9
- package/types/debugging.js.map +1 -1
- package/types/debugging.mjs.map +1 -1
- package/types/lifecycle-events.d.ts +0 -1
- package/types/lifecycle-events.js.map +1 -1
- package/types/lifecycle-events.mjs.map +1 -1
- package/types/transaction.d.ts +1 -1
- package/packages/algod_client/src/core/model-runtime.d.ts +0 -10
- package/packages/indexer_client/src/core/model-runtime.d.ts +0 -10
- package/packages/kmd_client/src/core/model-runtime.d.ts +0 -10
- package/types/expand.d.ts +0 -9
- package/types/expand.js +0 -0
- package/types/expand.mjs +0 -0
|
@@ -194,12 +194,12 @@ const ParticipationUpdatesMeta = {
|
|
|
194
194
|
fields: [{
|
|
195
195
|
name: "expiredParticipationAccounts",
|
|
196
196
|
wireKey: "partupdrmv",
|
|
197
|
-
optional:
|
|
197
|
+
optional: false,
|
|
198
198
|
codec: addressArrayCodec
|
|
199
199
|
}, {
|
|
200
200
|
name: "absentParticipationAccounts",
|
|
201
201
|
wireKey: "partupdabs",
|
|
202
|
-
optional:
|
|
202
|
+
optional: false,
|
|
203
203
|
codec: addressArrayCodec
|
|
204
204
|
}]
|
|
205
205
|
};
|
|
@@ -234,37 +234,37 @@ const RewardStateMeta = {
|
|
|
234
234
|
{
|
|
235
235
|
name: "feeSink",
|
|
236
236
|
wireKey: "fees",
|
|
237
|
-
optional:
|
|
237
|
+
optional: false,
|
|
238
238
|
codec: addressCodec
|
|
239
239
|
},
|
|
240
240
|
{
|
|
241
241
|
name: "rewardsPool",
|
|
242
242
|
wireKey: "rwd",
|
|
243
|
-
optional:
|
|
243
|
+
optional: false,
|
|
244
244
|
codec: addressCodec
|
|
245
245
|
},
|
|
246
246
|
{
|
|
247
247
|
name: "rewardsLevel",
|
|
248
248
|
wireKey: "earn",
|
|
249
|
-
optional:
|
|
249
|
+
optional: false,
|
|
250
250
|
codec: bigIntCodec
|
|
251
251
|
},
|
|
252
252
|
{
|
|
253
253
|
name: "rewardsRate",
|
|
254
254
|
wireKey: "rate",
|
|
255
|
-
optional:
|
|
255
|
+
optional: false,
|
|
256
256
|
codec: bigIntCodec
|
|
257
257
|
},
|
|
258
258
|
{
|
|
259
259
|
name: "rewardsResidue",
|
|
260
260
|
wireKey: "frac",
|
|
261
|
-
optional:
|
|
261
|
+
optional: false,
|
|
262
262
|
codec: bigIntCodec
|
|
263
263
|
},
|
|
264
264
|
{
|
|
265
265
|
name: "rewardsRecalculationRound",
|
|
266
266
|
wireKey: "rwcalr",
|
|
267
|
-
optional:
|
|
267
|
+
optional: false,
|
|
268
268
|
codec: bigIntCodec
|
|
269
269
|
}
|
|
270
270
|
]
|
|
@@ -276,7 +276,7 @@ const UpgradeStateMeta = {
|
|
|
276
276
|
{
|
|
277
277
|
name: "currentProtocol",
|
|
278
278
|
wireKey: "proto",
|
|
279
|
-
optional:
|
|
279
|
+
optional: false,
|
|
280
280
|
codec: stringCodec
|
|
281
281
|
},
|
|
282
282
|
{
|
|
@@ -343,13 +343,13 @@ const BlockMeta = {
|
|
|
343
343
|
{
|
|
344
344
|
name: "round",
|
|
345
345
|
wireKey: "rnd",
|
|
346
|
-
optional:
|
|
346
|
+
optional: false,
|
|
347
347
|
codec: bigIntCodec
|
|
348
348
|
},
|
|
349
349
|
{
|
|
350
350
|
name: "previousBlockHash",
|
|
351
351
|
wireKey: "prev",
|
|
352
|
-
optional:
|
|
352
|
+
optional: false,
|
|
353
353
|
codec: fixedBytes32Codec
|
|
354
354
|
},
|
|
355
355
|
{
|
|
@@ -361,7 +361,7 @@ const BlockMeta = {
|
|
|
361
361
|
{
|
|
362
362
|
name: "seed",
|
|
363
363
|
wireKey: "seed",
|
|
364
|
-
optional:
|
|
364
|
+
optional: false,
|
|
365
365
|
codec: bytesCodec
|
|
366
366
|
},
|
|
367
367
|
{
|
|
@@ -373,19 +373,19 @@ const BlockMeta = {
|
|
|
373
373
|
{
|
|
374
374
|
name: "timestamp",
|
|
375
375
|
wireKey: "ts",
|
|
376
|
-
optional:
|
|
376
|
+
optional: false,
|
|
377
377
|
codec: bigIntCodec
|
|
378
378
|
},
|
|
379
379
|
{
|
|
380
380
|
name: "genesisId",
|
|
381
381
|
wireKey: "gen",
|
|
382
|
-
optional:
|
|
382
|
+
optional: false,
|
|
383
383
|
codec: stringCodec
|
|
384
384
|
},
|
|
385
385
|
{
|
|
386
386
|
name: "genesisHash",
|
|
387
387
|
wireKey: "gh",
|
|
388
|
-
optional:
|
|
388
|
+
optional: false,
|
|
389
389
|
codec: fixedBytes32Codec
|
|
390
390
|
},
|
|
391
391
|
{
|
|
@@ -427,7 +427,7 @@ const BlockMeta = {
|
|
|
427
427
|
{
|
|
428
428
|
name: "upgradeVote",
|
|
429
429
|
flattened: true,
|
|
430
|
-
optional:
|
|
430
|
+
optional: true,
|
|
431
431
|
codec: new ObjectModelCodec(UpgradeVoteMeta)
|
|
432
432
|
},
|
|
433
433
|
{
|
|
@@ -445,7 +445,7 @@ const BlockMeta = {
|
|
|
445
445
|
{
|
|
446
446
|
name: "participationUpdates",
|
|
447
447
|
flattened: true,
|
|
448
|
-
optional:
|
|
448
|
+
optional: false,
|
|
449
449
|
codec: new ObjectModelCodec(ParticipationUpdatesMeta)
|
|
450
450
|
}
|
|
451
451
|
]
|
|
@@ -453,7 +453,7 @@ const BlockMeta = {
|
|
|
453
453
|
}, {
|
|
454
454
|
name: "payset",
|
|
455
455
|
wireKey: "txns",
|
|
456
|
-
optional:
|
|
456
|
+
optional: false,
|
|
457
457
|
codec: new ArrayCodec(new ObjectModelCodec(SignedTxnInBlockMeta))
|
|
458
458
|
}]
|
|
459
459
|
};
|
|
@@ -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: true,\n codec: addressArrayCodec,\n },\n {\n name: 'absentParticipationAccounts',\n wireKey: 'partupdabs',\n optional: true,\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: true, codec: addressCodec },\n { name: 'rewardsPool', wireKey: 'rwd', optional: true, codec: addressCodec },\n { name: 'rewardsLevel', wireKey: 'earn', optional: true, codec: bigIntCodec },\n { name: 'rewardsRate', wireKey: 'rate', optional: true, codec: bigIntCodec },\n { name: 'rewardsResidue', wireKey: 'frac', optional: true, codec: bigIntCodec },\n { name: 'rewardsRecalculationRound', wireKey: 'rwcalr', optional: true, 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: true, 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: true, codec: bigIntCodec },\n { name: 'previousBlockHash', wireKey: 'prev', optional: true, codec: fixedBytes32Codec },\n { name: 'previousBlockHash512', wireKey: 'prev512', optional: true, codec: fixedBytes64Codec },\n { name: 'seed', wireKey: 'seed', optional: true, codec: bytesCodec },\n {\n name: 'txnCommitments',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(TxnCommitmentsMeta),\n },\n { name: 'timestamp', wireKey: 'ts', optional: true, codec: bigIntCodec },\n { name: 'genesisId', wireKey: 'gen', optional: true, codec: stringCodec },\n { name: 'genesisHash', wireKey: 'gh', optional: true, 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: false,\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: true,\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: true,\n codec: new ArrayCodec(new ObjectModelCodec(SignedTxnInBlockMeta)),\n },\n ],\n}\n\n/**\n * Custom codec for Block that populates genesis information on transactions after decoding.\n *\n * When blocks are returned from algod, transactions may not include the genesisId\n * and genesisHash fields even though they are required for correct transaction ID calculation.\n * The block contains `hasGenesisId` and `hasGenesisHash` flags that indicate whether these\n * fields should be populated from the block header.\n *\n * This codec automatically populates these fields after decoding to ensure transaction IDs\n * can be calculated correctly.\n */\nclass BlockCodec extends ObjectModelCodec<Block> {\n constructor() {\n super(BlockMeta)\n }\n\n protected fromEncoded(value: WireObject, format: EncodingFormat): Block {\n const block = super.fromEncoded(value, format)\n\n // Populate genesis id and hash on transactions if required to ensure tx id's are correct\n const genesisId = block.header.genesisId\n const genesisHash = block.header.genesisHash\n\n for (const txnInBlock of block.payset ?? []) {\n const txn = txnInBlock.signedTxn.signedTxn.txn\n\n if (txnInBlock.hasGenesisId && txn.genesisId === undefined) {\n txn.genesisId = genesisId\n }\n\n // The following assumes that Consensus.RequireGenesisHash is true\n // so assigns genesis hash unless explicitly set to false\n if (txnInBlock.hasGenesisHash !== false && txn.genesisHash === undefined) {\n txn.genesisHash = genesisHash\n }\n }\n\n return block\n }\n}\n\nexport const blockCodec = new BlockCodec()\n"],"mappings":";;;;;;;;;;;;;AA+BA,MAAMA,qBAA0D;CAC9D,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GAAE,MAAM;GAAU,SAAS;GAAM,UAAU;GAAO,OAAO;GAAa;EACtE;GAAE,MAAM;GAAS,SAAS;GAAM,UAAU;GAAM,OAAO;GAAY;EACnE;GAAE,MAAM;GAAQ,SAAS;GAAM,UAAU;GAAM,OAAO;GAAa;EACpE;CACF;AAkBD,MAAMC,wBAAgE;CACpE,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,SAAS,YAAY,IAAI,iBAAiB,mBAAmB,CAAC;GAC1E;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,SAAS,aAAa,IAAI,SAAS,YAAY,IAAI,iBAAiB,mBAAmB,CAAC,CAAC;GACrG;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,WAAW,IAAI,uBAAuB,oBAAoB,CAAC;GACvE;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GAAE,MAAM;GAAQ,SAAS;GAAM,UAAU;GAAM,OAA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DeltaMeta: ObjectModelMetadata<BlockAppEvalDelta>","BlockStateProofTrackingDataMeta: ObjectModelMetadata<BlockStateProofTrackingData>","ApplyDataMeta: ObjectModelMetadata<ApplyData>","SignedTxnWithADMeta: ObjectModelMetadata<SignedTxnWithAD>","SignedTxnInBlockMeta: ObjectModelMetadata<SignedTxnInBlock>","ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates>","TxnCommitmentsMeta: ObjectModelMetadata<TxnCommitments>","RewardStateMeta: ObjectModelMetadata<RewardState>","UpgradeStateMeta: ObjectModelMetadata<UpgradeState>","UpgradeVoteMeta: ObjectModelMetadata<UpgradeVote>","BlockMeta: ObjectModelMetadata<Block>"],"sources":["../../../../../packages/algod_client/src/models/block.ts"],"sourcesContent":["import {\n Address,\n ArrayCodec,\n MapCodec,\n ObjectModelCodec,\n type EncodingFormat,\n type ObjectModelMetadata,\n type WireObject,\n addressArrayCodec,\n addressCodec,\n bigIntCodec,\n booleanCodec,\n bytesArrayCodec,\n bytesCodec,\n fixedBytes32Codec,\n fixedBytes64Codec,\n numberCodec,\n stringCodec,\n} from '@algorandfoundation/algokit-common'\nimport { type SignedTransaction, SignedTransactionMeta } from '@algorandfoundation/algokit-transact'\n\n/** BlockEvalDelta represents a TEAL value delta (block/msgpack wire keys). */\nexport type BlockEvalDelta = {\n /** [at] delta action. */\n action: number\n /** [bs] bytes value. */\n bytes?: Uint8Array\n /** [ui] uint value. */\n uint?: bigint\n}\n\nconst BlockEvalDeltaMeta: ObjectModelMetadata<BlockEvalDelta> = {\n name: 'BlockEvalDelta',\n kind: 'object',\n fields: [\n { name: 'action', wireKey: 'at', optional: false, codec: numberCodec },\n { name: 'bytes', wireKey: 'bs', optional: true, codec: bytesCodec },\n { name: 'uint', wireKey: 'ui', optional: true, codec: bigIntCodec },\n ],\n}\n\n/**\n * State changes from application execution, including inner transactions and logs.\n */\nexport type BlockAppEvalDelta = {\n /** [gd] Global state delta for the application. */\n globalDelta?: Map<Uint8Array, BlockEvalDelta>\n /** [ld] Local state deltas keyed by address index. */\n localDeltas?: Map<number, Map<Uint8Array, BlockEvalDelta>>\n /** [itx] Inner transactions produced by this application execution. */\n innerTxns?: SignedTxnWithAD[]\n /** [sa] Shared accounts referenced by local deltas. */\n sharedAccounts?: Address[]\n /** [lg] Application log outputs. */\n logs?: Uint8Array[]\n}\n\nconst BlockAppEvalDeltaMeta: ObjectModelMetadata<BlockAppEvalDelta> = {\n name: 'BlockAppEvalDelta',\n kind: 'object',\n fields: [\n {\n name: 'globalDelta',\n wireKey: 'gd',\n optional: true,\n codec: new MapCodec(bytesCodec, new ObjectModelCodec(BlockEvalDeltaMeta)),\n },\n {\n name: 'localDeltas',\n wireKey: 'ld',\n optional: true,\n codec: new MapCodec(numberCodec, new MapCodec(bytesCodec, new ObjectModelCodec(BlockEvalDeltaMeta))),\n },\n {\n name: 'innerTxns',\n wireKey: 'itx',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(() => SignedTxnWithADMeta)),\n },\n {\n name: 'sharedAccounts',\n wireKey: 'sa',\n optional: true,\n codec: addressArrayCodec,\n },\n { name: 'logs', wireKey: 'lg', optional: true, codec: bytesArrayCodec },\n ],\n}\n\n/** Tracking metadata for a specific StateProofType. */\nexport type BlockStateProofTrackingData = {\n /** [v] Vector commitment root of state proof voters. */\n stateProofVotersCommitment?: Uint8Array\n /** [t] Online total weight during state proof round. */\n stateProofOnlineTotalWeight?: bigint\n /** [n] Next round for which state proofs are accepted. */\n stateProofNextRound?: bigint\n}\n\nconst BlockStateProofTrackingDataMeta: ObjectModelMetadata<BlockStateProofTrackingData> = {\n name: 'BlockStateProofTrackingData',\n kind: 'object',\n fields: [\n { name: 'stateProofVotersCommitment', wireKey: 'v', optional: true, codec: bytesCodec },\n { name: 'stateProofOnlineTotalWeight', wireKey: 't', optional: true, codec: bigIntCodec },\n { name: 'stateProofNextRound', wireKey: 'n', optional: true, codec: bigIntCodec },\n ],\n}\n\nexport type ApplyData = {\n closingAmount?: bigint\n assetClosingAmount?: bigint\n senderRewards?: bigint\n receiverRewards?: bigint\n closeRewards?: bigint\n evalDelta?: BlockAppEvalDelta\n configAsset?: bigint\n applicationId?: bigint\n}\n\nconst ApplyDataMeta: ObjectModelMetadata<ApplyData> = {\n name: 'SignedTxnInBlock',\n kind: 'object',\n fields: [\n { name: 'closingAmount', wireKey: 'ca', optional: true, codec: bigIntCodec },\n { name: 'assetClosingAmount', wireKey: 'aca', optional: true, codec: bigIntCodec },\n { name: 'senderRewards', wireKey: 'rs', optional: true, codec: bigIntCodec },\n { name: 'receiverRewards', wireKey: 'rr', optional: true, codec: bigIntCodec },\n { name: 'closeRewards', wireKey: 'rc', optional: true, codec: bigIntCodec },\n { name: 'evalDelta', wireKey: 'dt', optional: true, codec: new ObjectModelCodec(BlockAppEvalDeltaMeta) },\n { name: 'configAsset', wireKey: 'caid', optional: true, codec: bigIntCodec },\n { name: 'applicationId', wireKey: 'apid', optional: true, codec: bigIntCodec },\n ],\n}\n\n/**\n * SignedTxnWithAD is a SignedTransaction with additional ApplyData.\n */\nexport type SignedTxnWithAD = {\n /** The signed transaction. */\n signedTxn: SignedTransaction\n /** Apply data containing transaction execution information. */\n applyData?: ApplyData\n}\n\nconst SignedTxnWithADMeta: ObjectModelMetadata<SignedTxnWithAD> = {\n name: 'SignedTxnWithAD',\n kind: 'object',\n fields: [\n {\n name: 'signedTxn',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(SignedTransactionMeta),\n },\n {\n name: 'applyData',\n flattened: true,\n optional: true,\n codec: new ObjectModelCodec(ApplyDataMeta),\n },\n ],\n}\n\n/**\n * SignedTxnInBlock is a SignedTransaction with additional ApplyData and block-specific metadata.\n */\nexport type SignedTxnInBlock = {\n signedTxn: SignedTxnWithAD\n hasGenesisId?: boolean\n hasGenesisHash?: boolean\n}\n\nconst SignedTxnInBlockMeta: ObjectModelMetadata<SignedTxnInBlock> = {\n name: 'SignedTxnInBlock',\n kind: 'object',\n fields: [\n {\n name: 'signedTxn',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(SignedTxnWithADMeta),\n },\n { name: 'hasGenesisId', wireKey: 'hgi', optional: true, codec: booleanCodec },\n { name: 'hasGenesisHash', wireKey: 'hgh', optional: true, codec: booleanCodec },\n ],\n}\n\nexport type ParticipationUpdates = {\n /** [partupdrmv] Expired participation accounts. */\n expiredParticipationAccounts: string[]\n /** [partupdabs] Absent participation accounts. */\n absentParticipationAccounts: string[]\n}\n\nconst ParticipationUpdatesMeta: ObjectModelMetadata<ParticipationUpdates> = {\n name: 'ParticipationUpdates',\n kind: 'object',\n fields: [\n {\n name: 'expiredParticipationAccounts',\n wireKey: 'partupdrmv',\n optional: false,\n codec: addressArrayCodec,\n },\n {\n name: 'absentParticipationAccounts',\n wireKey: 'partupdabs',\n optional: false,\n codec: addressArrayCodec,\n },\n ],\n}\n\n/** Transaction commitment hashes for the block. */\nexport type TxnCommitments = {\n /** [txn] Root of transaction merkle tree using SHA512_256. */\n nativeSha512_256Commitment: Uint8Array\n /** [txn256] Root of transaction vector commitment using SHA256. */\n sha256Commitment?: Uint8Array\n /** [txn512] Root of transaction vector commitment using SHA512. */\n sha512Commitment?: Uint8Array\n}\n\nconst TxnCommitmentsMeta: ObjectModelMetadata<TxnCommitments> = {\n name: 'TxnCommitments',\n kind: 'object',\n fields: [\n { name: 'nativeSha512_256Commitment', wireKey: 'txn', optional: false, codec: fixedBytes32Codec },\n { name: 'sha256Commitment', wireKey: 'txn256', optional: true, codec: fixedBytes32Codec },\n { name: 'sha512Commitment', wireKey: 'txn512', optional: true, codec: fixedBytes64Codec },\n ],\n}\n\n/** Reward distribution state for the block. */\nexport type RewardState = {\n /** [fees] FeeSink address. */\n feeSink: Address\n /** [rwd] RewardsPool address. */\n rewardsPool: Address\n /** [earn] Rewards level. */\n rewardsLevel: bigint\n /** [rate] Rewards rate. */\n rewardsRate: bigint\n /** [frac] Rewards residue. */\n rewardsResidue: bigint\n /** [rwcalr] Rewards recalculation round. */\n rewardsRecalculationRound: bigint\n}\n\nconst RewardStateMeta: ObjectModelMetadata<RewardState> = {\n name: 'RewardState',\n kind: 'object',\n fields: [\n { name: 'feeSink', wireKey: 'fees', optional: false, codec: addressCodec },\n { name: 'rewardsPool', wireKey: 'rwd', optional: false, codec: addressCodec },\n { name: 'rewardsLevel', wireKey: 'earn', optional: false, codec: bigIntCodec },\n { name: 'rewardsRate', wireKey: 'rate', optional: false, codec: bigIntCodec },\n { name: 'rewardsResidue', wireKey: 'frac', optional: false, codec: bigIntCodec },\n { name: 'rewardsRecalculationRound', wireKey: 'rwcalr', optional: false, codec: bigIntCodec },\n ],\n}\n\n/** Protocol upgrade state for the block. */\nexport type UpgradeState = {\n /** [proto] Current consensus protocol. */\n currentProtocol: string\n /** [nextproto] Next proposed protocol. */\n nextProtocol?: string\n /** [nextyes] Next protocol approvals. */\n nextProtocolApprovals?: bigint\n /** [nextbefore] Next protocol vote deadline. */\n nextProtocolVoteBefore?: bigint\n /** [nextswitch] Next protocol switch round. */\n nextProtocolSwitchOn?: bigint\n}\n\nconst UpgradeStateMeta: ObjectModelMetadata<UpgradeState> = {\n name: 'UpgradeState',\n kind: 'object',\n fields: [\n { name: 'currentProtocol', wireKey: 'proto', optional: false, codec: stringCodec },\n { name: 'nextProtocol', wireKey: 'nextproto', optional: true, codec: stringCodec },\n { name: 'nextProtocolApprovals', wireKey: 'nextyes', optional: true, codec: bigIntCodec },\n { name: 'nextProtocolVoteBefore', wireKey: 'nextbefore', optional: true, codec: bigIntCodec },\n { name: 'nextProtocolSwitchOn', wireKey: 'nextswitch', optional: true, codec: bigIntCodec },\n ],\n}\n\n/** Protocol upgrade vote parameters for the block. */\nexport type UpgradeVote = {\n /** [upgradeprop] Upgrade proposal. */\n upgradePropose?: string\n /** [upgradedelay] Upgrade delay in rounds. */\n upgradeDelay?: bigint\n /** [upgradeyes] Upgrade approval flag. */\n upgradeApprove?: boolean\n}\n\nconst UpgradeVoteMeta: ObjectModelMetadata<UpgradeVote> = {\n name: 'UpgradeVote',\n kind: 'object',\n fields: [\n { name: 'upgradePropose', wireKey: 'upgradeprop', optional: true, codec: stringCodec },\n { name: 'upgradeDelay', wireKey: 'upgradedelay', optional: true, codec: bigIntCodec },\n { name: 'upgradeApprove', wireKey: 'upgradeyes', optional: true, codec: booleanCodec },\n ],\n}\n\nexport type BlockHeader = {\n /** [rnd] Round number. */\n round: bigint\n /** [prev] Previous block hash. */\n previousBlockHash: Uint8Array\n /** [prev512] Previous block hash using SHA-512. */\n previousBlockHash512?: Uint8Array\n /** [seed] Sortition seed. */\n seed: Uint8Array\n /** Authenticates the set of transactions appearing in the block. */\n txnCommitments: TxnCommitments\n /** [ts] Block timestamp in seconds since epoch. */\n timestamp: bigint\n /** [gen] Genesis ID. */\n genesisId: string\n /** [gh] Genesis hash. */\n genesisHash: Uint8Array\n /** [prp] Proposer address. */\n proposer?: Address\n /** [fc] Fees collected in this block. */\n feesCollected?: bigint\n /** [bi] Bonus incentive for block proposal. */\n bonus?: bigint\n /** [pp] Proposer payout. */\n proposerPayout?: bigint\n /** Reward distribution state. */\n rewardState: RewardState\n /** Protocol upgrade state. */\n upgradeState: UpgradeState\n /** Protocol upgrade vote parameters. */\n upgradeVote: UpgradeVote\n /** [tc] Transaction counter. */\n txnCounter?: bigint\n /** [spt] State proof tracking data keyed by state proof type. */\n stateProofTracking?: Map<number, BlockStateProofTrackingData>\n /** Represents participation account data that needs to be checked/acted on by the network */\n participationUpdates: ParticipationUpdates\n}\n\nconst BlockHeaderMeta: ObjectModelMetadata<BlockHeader> = {\n name: 'BlockHeader',\n kind: 'object',\n fields: [\n { name: 'round', wireKey: 'rnd', optional: false, codec: bigIntCodec },\n { name: 'previousBlockHash', wireKey: 'prev', optional: false, codec: fixedBytes32Codec },\n { name: 'previousBlockHash512', wireKey: 'prev512', optional: true, codec: fixedBytes64Codec },\n { name: 'seed', wireKey: 'seed', optional: false, codec: bytesCodec },\n {\n name: 'txnCommitments',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(TxnCommitmentsMeta),\n },\n { name: 'timestamp', wireKey: 'ts', optional: false, codec: bigIntCodec },\n { name: 'genesisId', wireKey: 'gen', optional: false, codec: stringCodec },\n { name: 'genesisHash', wireKey: 'gh', optional: false, codec: fixedBytes32Codec },\n { name: 'proposer', wireKey: 'prp', optional: true, codec: addressCodec },\n { name: 'feesCollected', wireKey: 'fc', optional: true, codec: bigIntCodec },\n { name: 'bonus', wireKey: 'bi', optional: true, codec: bigIntCodec },\n { name: 'proposerPayout', wireKey: 'pp', optional: true, codec: bigIntCodec },\n {\n name: 'rewardState',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(RewardStateMeta),\n },\n {\n name: 'upgradeState',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(UpgradeStateMeta),\n },\n {\n name: 'upgradeVote',\n flattened: true,\n optional: true,\n codec: new ObjectModelCodec(UpgradeVoteMeta),\n },\n { name: 'txnCounter', wireKey: 'tc', optional: true, codec: bigIntCodec },\n {\n name: 'stateProofTracking',\n wireKey: 'spt',\n optional: true,\n codec: new MapCodec(numberCodec, new ObjectModelCodec(BlockStateProofTrackingDataMeta)),\n },\n {\n name: 'participationUpdates',\n flattened: true,\n optional: false,\n codec: new ObjectModelCodec(ParticipationUpdatesMeta),\n },\n ],\n}\n\n/**\n * Block contains the BlockHeader and the list of transactions (Payset).\n */\nexport type Block = {\n /** The block information (Header) */\n header: BlockHeader\n\n /** [txns] Block transactions (Payset). */\n payset: SignedTxnInBlock[]\n}\n\nconst BlockMeta: ObjectModelMetadata<Block> = {\n name: 'Block',\n kind: 'object',\n fields: [\n { name: 'header', flattened: true, optional: false, codec: new ObjectModelCodec(BlockHeaderMeta) },\n {\n name: 'payset',\n wireKey: 'txns',\n optional: false,\n codec: new ArrayCodec(new ObjectModelCodec(SignedTxnInBlockMeta)),\n },\n ],\n}\n\n/**\n * Custom codec for Block that populates genesis information on transactions after decoding.\n *\n * When blocks are returned from algod, transactions may not include the genesisId\n * and genesisHash fields even though they are required for correct transaction ID calculation.\n * The block contains `hasGenesisId` and `hasGenesisHash` flags that indicate whether these\n * fields should be populated from the block header.\n *\n * This codec automatically populates these fields after decoding to ensure transaction IDs\n * can be calculated correctly.\n */\nclass BlockCodec extends ObjectModelCodec<Block> {\n constructor() {\n super(BlockMeta)\n }\n\n protected fromEncoded(value: WireObject, format: EncodingFormat): Block {\n const block = super.fromEncoded(value, format)\n\n // Populate genesis id and hash on transactions if required to ensure tx id's are correct\n const genesisId = block.header.genesisId\n const genesisHash = block.header.genesisHash\n\n for (const txnInBlock of block.payset ?? []) {\n const txn = txnInBlock.signedTxn.signedTxn.txn\n\n if (txnInBlock.hasGenesisId && txn.genesisId === undefined) {\n txn.genesisId = genesisId\n }\n\n // The following assumes that Consensus.RequireGenesisHash is true\n // so assigns genesis hash unless explicitly set to false\n if (txnInBlock.hasGenesisHash !== false && txn.genesisHash === undefined) {\n txn.genesisHash = genesisHash\n }\n }\n\n return block\n }\n}\n\nexport const blockCodec = new BlockCodec()\n"],"mappings":";;;;;;;;;;;;;AA+BA,MAAMA,qBAA0D;CAC9D,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GAAE,MAAM;GAAU,SAAS;GAAM,UAAU;GAAO,OAAO;GAAa;EACtE;GAAE,MAAM;GAAS,SAAS;GAAM,UAAU;GAAM,OAAO;GAAY;EACnE;GAAE,MAAM;GAAQ,SAAS;GAAM,UAAU;GAAM,OAAO;GAAa;EACpE;CACF;AAkBD,MAAMC,wBAAgE;CACpE,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,SAAS,YAAY,IAAI,iBAAiB,mBAAmB,CAAC;GAC1E;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,SAAS,aAAa,IAAI,SAAS,YAAY,IAAI,iBAAiB,mBAAmB,CAAC,CAAC;GACrG;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OA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,OAC7D,KAAI,cAAc;;AAItB,SAAO;;;AAIX,MAAa,aAAa,IAAI,YAAY"}
|
|
@@ -3,8 +3,8 @@ const require_boolean = require('../../../common/src/codecs/primitives/boolean.j
|
|
|
3
3
|
const require_number = require('../../../common/src/codecs/primitives/number.js');
|
|
4
4
|
const require_array = require('../../../common/src/codecs/composite/array.js');
|
|
5
5
|
const require_object_model = require('../../../common/src/codecs/models/object-model.js');
|
|
6
|
-
const require_simulate_request_transaction_group = require('./simulate-request-transaction-group.js');
|
|
7
6
|
const require_simulate_trace_config = require('./simulate-trace-config.js');
|
|
7
|
+
const require_simulate_request_transaction_group = require('./simulate-request-transaction-group.js');
|
|
8
8
|
|
|
9
9
|
//#region packages/algod_client/src/models/simulate-request.ts
|
|
10
10
|
const SimulateRequestMeta = {
|
|
@@ -3,8 +3,8 @@ import { booleanCodec } from "../../../common/src/codecs/primitives/boolean.mjs"
|
|
|
3
3
|
import { numberCodec } from "../../../common/src/codecs/primitives/number.mjs";
|
|
4
4
|
import { ArrayCodec } from "../../../common/src/codecs/composite/array.mjs";
|
|
5
5
|
import { ObjectModelCodec } from "../../../common/src/codecs/models/object-model.mjs";
|
|
6
|
-
import { SimulateRequestTransactionGroupMeta } from "./simulate-request-transaction-group.mjs";
|
|
7
6
|
import { SimulateTraceConfigMeta } from "./simulate-trace-config.mjs";
|
|
7
|
+
import { SimulateRequestTransactionGroupMeta } from "./simulate-request-transaction-group.mjs";
|
|
8
8
|
|
|
9
9
|
//#region packages/algod_client/src/models/simulate-request.ts
|
|
10
10
|
const SimulateRequestMeta = {
|
|
@@ -21,6 +21,7 @@ type SimulateResponse = {
|
|
|
21
21
|
execTraceConfig?: SimulateTraceConfig;
|
|
22
22
|
initialStates?: SimulateInitialStates;
|
|
23
23
|
};
|
|
24
|
+
declare function encodeSimulateResponseToJson(simulateResponse: SimulateResponse): string;
|
|
24
25
|
//#endregion
|
|
25
|
-
export { SimulateResponse };
|
|
26
|
+
export { SimulateResponse, encodeSimulateResponseToJson };
|
|
26
27
|
//# sourceMappingURL=simulate-response.d.ts.map
|
|
@@ -2,10 +2,11 @@ const require_bigint = require('../../../common/src/codecs/primitives/bigint.js'
|
|
|
2
2
|
const require_number = require('../../../common/src/codecs/primitives/number.js');
|
|
3
3
|
const require_array = require('../../../common/src/codecs/composite/array.js');
|
|
4
4
|
const require_object_model = require('../../../common/src/codecs/models/object-model.js');
|
|
5
|
+
const require_simulate_initial_states = require('./simulate-initial-states.js');
|
|
5
6
|
const require_simulate_trace_config = require('./simulate-trace-config.js');
|
|
6
7
|
const require_simulate_transaction_group_result = require('./simulate-transaction-group-result.js');
|
|
7
8
|
const require_simulation_eval_overrides = require('./simulation-eval-overrides.js');
|
|
8
|
-
const
|
|
9
|
+
const require_model_runtime = require('../core/model-runtime.js');
|
|
9
10
|
|
|
10
11
|
//#region packages/algod_client/src/models/simulate-response.ts
|
|
11
12
|
const SimulateResponseMeta = {
|
|
@@ -50,7 +51,11 @@ const SimulateResponseMeta = {
|
|
|
50
51
|
}
|
|
51
52
|
]
|
|
52
53
|
};
|
|
54
|
+
function encodeSimulateResponseToJson(simulateResponse) {
|
|
55
|
+
return require_model_runtime.encodeJson(simulateResponse, SimulateResponseMeta, 2);
|
|
56
|
+
}
|
|
53
57
|
|
|
54
58
|
//#endregion
|
|
55
59
|
exports.SimulateResponseMeta = SimulateResponseMeta;
|
|
60
|
+
exports.encodeSimulateResponseToJson = encodeSimulateResponseToJson;
|
|
56
61
|
//# sourceMappingURL=simulate-response.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulate-response.js","names":["SimulateResponseMeta: ObjectModelMetadata<SimulateResponse>","numberCodec","bigIntCodec","ArrayCodec","ObjectModelCodec","SimulateTransactionGroupResultMeta","SimulationEvalOverridesMeta","SimulateTraceConfigMeta","SimulateInitialStatesMeta"],"sources":["../../../../../packages/algod_client/src/models/simulate-response.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { numberCodec, bigIntCodec, ArrayCodec, ObjectModelCodec } from '@algorandfoundation/algokit-common'\nimport type { SimulateInitialStates } from './simulate-initial-states'\nimport { SimulateInitialStatesMeta } from './simulate-initial-states'\nimport type { SimulateTraceConfig } from './simulate-trace-config'\nimport { SimulateTraceConfigMeta } from './simulate-trace-config'\nimport type { SimulateTransactionGroupResult } from './simulate-transaction-group-result'\nimport { SimulateTransactionGroupResultMeta } from './simulate-transaction-group-result'\nimport type { SimulationEvalOverrides } from './simulation-eval-overrides'\nimport { SimulationEvalOverridesMeta } from './simulation-eval-overrides'\n\nexport type SimulateResponse = {\n /**\n * The version of this response object.\n */\n version: number\n\n /**\n * The round immediately preceding this simulation. State changes through this round were used to run this simulation.\n */\n lastRound: bigint\n\n /**\n * A result object for each transaction group that was simulated.\n */\n txnGroups: SimulateTransactionGroupResult[]\n evalOverrides?: SimulationEvalOverrides\n execTraceConfig?: SimulateTraceConfig\n initialStates?: SimulateInitialStates\n}\n\nexport const SimulateResponseMeta: ObjectModelMetadata<SimulateResponse> = {\n name: 'SimulateResponse',\n kind: 'object',\n fields: [\n {\n name: 'version',\n wireKey: 'version',\n optional: false,\n codec: numberCodec,\n },\n {\n name: 'lastRound',\n wireKey: 'last-round',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'txnGroups',\n wireKey: 'txn-groups',\n optional: false,\n codec: new ArrayCodec(new ObjectModelCodec(SimulateTransactionGroupResultMeta)),\n },\n {\n name: 'evalOverrides',\n wireKey: 'eval-overrides',\n optional: true,\n codec: new ObjectModelCodec(SimulationEvalOverridesMeta),\n },\n {\n name: 'execTraceConfig',\n wireKey: 'exec-trace-config',\n optional: true,\n codec: new ObjectModelCodec(SimulateTraceConfigMeta),\n },\n {\n name: 'initialStates',\n wireKey: 'initial-states',\n optional: true,\n codec: new ObjectModelCodec(SimulateInitialStatesMeta),\n },\n ],\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"simulate-response.js","names":["SimulateResponseMeta: ObjectModelMetadata<SimulateResponse>","numberCodec","bigIntCodec","ArrayCodec","ObjectModelCodec","SimulateTransactionGroupResultMeta","SimulationEvalOverridesMeta","SimulateTraceConfigMeta","SimulateInitialStatesMeta","encodeJson"],"sources":["../../../../../packages/algod_client/src/models/simulate-response.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { numberCodec, bigIntCodec, ArrayCodec, ObjectModelCodec } from '@algorandfoundation/algokit-common'\nimport type { SimulateInitialStates } from './simulate-initial-states'\nimport { SimulateInitialStatesMeta } from './simulate-initial-states'\nimport type { SimulateTraceConfig } from './simulate-trace-config'\nimport { SimulateTraceConfigMeta } from './simulate-trace-config'\nimport type { SimulateTransactionGroupResult } from './simulate-transaction-group-result'\nimport { SimulateTransactionGroupResultMeta } from './simulate-transaction-group-result'\nimport type { SimulationEvalOverrides } from './simulation-eval-overrides'\nimport { SimulationEvalOverridesMeta } from './simulation-eval-overrides'\nimport { encodeJson } from '../core/model-runtime'\n\nexport type SimulateResponse = {\n /**\n * The version of this response object.\n */\n version: number\n\n /**\n * The round immediately preceding this simulation. State changes through this round were used to run this simulation.\n */\n lastRound: bigint\n\n /**\n * A result object for each transaction group that was simulated.\n */\n txnGroups: SimulateTransactionGroupResult[]\n evalOverrides?: SimulationEvalOverrides\n execTraceConfig?: SimulateTraceConfig\n initialStates?: SimulateInitialStates\n}\n\nexport const SimulateResponseMeta: ObjectModelMetadata<SimulateResponse> = {\n name: 'SimulateResponse',\n kind: 'object',\n fields: [\n {\n name: 'version',\n wireKey: 'version',\n optional: false,\n codec: numberCodec,\n },\n {\n name: 'lastRound',\n wireKey: 'last-round',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'txnGroups',\n wireKey: 'txn-groups',\n optional: false,\n codec: new ArrayCodec(new ObjectModelCodec(SimulateTransactionGroupResultMeta)),\n },\n {\n name: 'evalOverrides',\n wireKey: 'eval-overrides',\n optional: true,\n codec: new ObjectModelCodec(SimulationEvalOverridesMeta),\n },\n {\n name: 'execTraceConfig',\n wireKey: 'exec-trace-config',\n optional: true,\n codec: new ObjectModelCodec(SimulateTraceConfigMeta),\n },\n {\n name: 'initialStates',\n wireKey: 'initial-states',\n optional: true,\n codec: new ObjectModelCodec(SimulateInitialStatesMeta),\n },\n ],\n}\n\nexport function encodeSimulateResponseToJson(simulateResponse: SimulateResponse): string {\n return encodeJson(simulateResponse, SimulateResponseMeta, 2)\n}\n"],"mappings":";;;;;;;;;;;AAgCA,MAAaA,uBAA8D;CACzE,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIC,yBAAW,IAAIC,sCAAiBC,6EAAmC,CAAC;GAChF;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAID,sCAAiBE,8DAA4B;GACzD;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIF,sCAAiBG,sDAAwB;GACrD;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIH,sCAAiBI,0DAA0B;GACvD;EACF;CACF;AAED,SAAgB,6BAA6B,kBAA4C;AACvF,QAAOC,iCAAW,kBAAkB,sBAAsB,EAAE"}
|
|
@@ -2,10 +2,11 @@ import { bigIntCodec } from "../../../common/src/codecs/primitives/bigint.mjs";
|
|
|
2
2
|
import { numberCodec } from "../../../common/src/codecs/primitives/number.mjs";
|
|
3
3
|
import { ArrayCodec } from "../../../common/src/codecs/composite/array.mjs";
|
|
4
4
|
import { ObjectModelCodec } from "../../../common/src/codecs/models/object-model.mjs";
|
|
5
|
+
import { SimulateInitialStatesMeta } from "./simulate-initial-states.mjs";
|
|
5
6
|
import { SimulateTraceConfigMeta } from "./simulate-trace-config.mjs";
|
|
6
7
|
import { SimulateTransactionGroupResultMeta } from "./simulate-transaction-group-result.mjs";
|
|
7
8
|
import { SimulationEvalOverridesMeta } from "./simulation-eval-overrides.mjs";
|
|
8
|
-
import {
|
|
9
|
+
import { encodeJson } from "../core/model-runtime.mjs";
|
|
9
10
|
|
|
10
11
|
//#region packages/algod_client/src/models/simulate-response.ts
|
|
11
12
|
const SimulateResponseMeta = {
|
|
@@ -50,7 +51,10 @@ const SimulateResponseMeta = {
|
|
|
50
51
|
}
|
|
51
52
|
]
|
|
52
53
|
};
|
|
54
|
+
function encodeSimulateResponseToJson(simulateResponse) {
|
|
55
|
+
return encodeJson(simulateResponse, SimulateResponseMeta, 2);
|
|
56
|
+
}
|
|
53
57
|
|
|
54
58
|
//#endregion
|
|
55
|
-
export { SimulateResponseMeta };
|
|
59
|
+
export { SimulateResponseMeta, encodeSimulateResponseToJson };
|
|
56
60
|
//# sourceMappingURL=simulate-response.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"simulate-response.mjs","names":["SimulateResponseMeta: ObjectModelMetadata<SimulateResponse>"],"sources":["../../../../../packages/algod_client/src/models/simulate-response.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { numberCodec, bigIntCodec, ArrayCodec, ObjectModelCodec } from '@algorandfoundation/algokit-common'\nimport type { SimulateInitialStates } from './simulate-initial-states'\nimport { SimulateInitialStatesMeta } from './simulate-initial-states'\nimport type { SimulateTraceConfig } from './simulate-trace-config'\nimport { SimulateTraceConfigMeta } from './simulate-trace-config'\nimport type { SimulateTransactionGroupResult } from './simulate-transaction-group-result'\nimport { SimulateTransactionGroupResultMeta } from './simulate-transaction-group-result'\nimport type { SimulationEvalOverrides } from './simulation-eval-overrides'\nimport { SimulationEvalOverridesMeta } from './simulation-eval-overrides'\n\nexport type SimulateResponse = {\n /**\n * The version of this response object.\n */\n version: number\n\n /**\n * The round immediately preceding this simulation. State changes through this round were used to run this simulation.\n */\n lastRound: bigint\n\n /**\n * A result object for each transaction group that was simulated.\n */\n txnGroups: SimulateTransactionGroupResult[]\n evalOverrides?: SimulationEvalOverrides\n execTraceConfig?: SimulateTraceConfig\n initialStates?: SimulateInitialStates\n}\n\nexport const SimulateResponseMeta: ObjectModelMetadata<SimulateResponse> = {\n name: 'SimulateResponse',\n kind: 'object',\n fields: [\n {\n name: 'version',\n wireKey: 'version',\n optional: false,\n codec: numberCodec,\n },\n {\n name: 'lastRound',\n wireKey: 'last-round',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'txnGroups',\n wireKey: 'txn-groups',\n optional: false,\n codec: new ArrayCodec(new ObjectModelCodec(SimulateTransactionGroupResultMeta)),\n },\n {\n name: 'evalOverrides',\n wireKey: 'eval-overrides',\n optional: true,\n codec: new ObjectModelCodec(SimulationEvalOverridesMeta),\n },\n {\n name: 'execTraceConfig',\n wireKey: 'exec-trace-config',\n optional: true,\n codec: new ObjectModelCodec(SimulateTraceConfigMeta),\n },\n {\n name: 'initialStates',\n wireKey: 'initial-states',\n optional: true,\n codec: new ObjectModelCodec(SimulateInitialStatesMeta),\n },\n ],\n}\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"simulate-response.mjs","names":["SimulateResponseMeta: ObjectModelMetadata<SimulateResponse>"],"sources":["../../../../../packages/algod_client/src/models/simulate-response.ts"],"sourcesContent":["import type { ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport { numberCodec, bigIntCodec, ArrayCodec, ObjectModelCodec } from '@algorandfoundation/algokit-common'\nimport type { SimulateInitialStates } from './simulate-initial-states'\nimport { SimulateInitialStatesMeta } from './simulate-initial-states'\nimport type { SimulateTraceConfig } from './simulate-trace-config'\nimport { SimulateTraceConfigMeta } from './simulate-trace-config'\nimport type { SimulateTransactionGroupResult } from './simulate-transaction-group-result'\nimport { SimulateTransactionGroupResultMeta } from './simulate-transaction-group-result'\nimport type { SimulationEvalOverrides } from './simulation-eval-overrides'\nimport { SimulationEvalOverridesMeta } from './simulation-eval-overrides'\nimport { encodeJson } from '../core/model-runtime'\n\nexport type SimulateResponse = {\n /**\n * The version of this response object.\n */\n version: number\n\n /**\n * The round immediately preceding this simulation. State changes through this round were used to run this simulation.\n */\n lastRound: bigint\n\n /**\n * A result object for each transaction group that was simulated.\n */\n txnGroups: SimulateTransactionGroupResult[]\n evalOverrides?: SimulationEvalOverrides\n execTraceConfig?: SimulateTraceConfig\n initialStates?: SimulateInitialStates\n}\n\nexport const SimulateResponseMeta: ObjectModelMetadata<SimulateResponse> = {\n name: 'SimulateResponse',\n kind: 'object',\n fields: [\n {\n name: 'version',\n wireKey: 'version',\n optional: false,\n codec: numberCodec,\n },\n {\n name: 'lastRound',\n wireKey: 'last-round',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'txnGroups',\n wireKey: 'txn-groups',\n optional: false,\n codec: new ArrayCodec(new ObjectModelCodec(SimulateTransactionGroupResultMeta)),\n },\n {\n name: 'evalOverrides',\n wireKey: 'eval-overrides',\n optional: true,\n codec: new ObjectModelCodec(SimulationEvalOverridesMeta),\n },\n {\n name: 'execTraceConfig',\n wireKey: 'exec-trace-config',\n optional: true,\n codec: new ObjectModelCodec(SimulateTraceConfigMeta),\n },\n {\n name: 'initialStates',\n wireKey: 'initial-states',\n optional: true,\n codec: new ObjectModelCodec(SimulateInitialStatesMeta),\n },\n ],\n}\n\nexport function encodeSimulateResponseToJson(simulateResponse: SimulateResponse): string {\n return encodeJson(simulateResponse, SimulateResponseMeta, 2)\n}\n"],"mappings":";;;;;;;;;;;AAgCA,MAAaA,uBAA8D;CACzE,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,WAAW,IAAI,iBAAiB,mCAAmC,CAAC;GAChF;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,iBAAiB,4BAA4B;GACzD;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,iBAAiB,wBAAwB;GACrD;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAI,iBAAiB,0BAA0B;GACvD;EACF;CACF;AAED,SAAgB,6BAA6B,kBAA4C;AACvF,QAAO,WAAW,kBAAkB,sBAAsB,EAAE"}
|
|
@@ -1,25 +1,10 @@
|
|
|
1
1
|
const require_object_model = require('../../../common/src/codecs/models/object-model.js');
|
|
2
|
-
const require_json = require('../../../common/src/json.js');
|
|
3
|
-
const require_msgpack = require('../../../common/src/msgpack.js');
|
|
4
2
|
|
|
5
3
|
//#region packages/indexer_client/src/core/model-runtime.ts
|
|
6
|
-
function encodeJson(value, meta) {
|
|
7
|
-
return require_json.stringifyJson(new require_object_model.ObjectModelCodec(meta).encode(value, "json"));
|
|
8
|
-
}
|
|
9
|
-
function encodeMsgpack(value, meta) {
|
|
10
|
-
return require_msgpack.encodeMsgpack(new require_object_model.ObjectModelCodec(meta).encode(value, "msgpack"));
|
|
11
|
-
}
|
|
12
4
|
function decodeJson(value, meta) {
|
|
13
5
|
return new require_object_model.ObjectModelCodec(meta).decode(value, "json");
|
|
14
6
|
}
|
|
15
|
-
function decodeMsgpack(value, meta) {
|
|
16
|
-
const wire = require_msgpack.decodeMsgpack(value);
|
|
17
|
-
return new require_object_model.ObjectModelCodec(meta).decode(wire, "msgpack");
|
|
18
|
-
}
|
|
19
7
|
|
|
20
8
|
//#endregion
|
|
21
9
|
exports.decodeJson = decodeJson;
|
|
22
|
-
exports.decodeMsgpack = decodeMsgpack;
|
|
23
|
-
exports.encodeJson = encodeJson;
|
|
24
|
-
exports.encodeMsgpack = encodeMsgpack;
|
|
25
10
|
//# sourceMappingURL=model-runtime.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-runtime.js","names":["
|
|
1
|
+
{"version":3,"file":"model-runtime.js","names":["ObjectModelCodec"],"sources":["../../../../../packages/indexer_client/src/core/model-runtime.ts"],"sourcesContent":["import {\n ObjectModelCodec,\n decodeMsgpack as rawDecodeMsgpack,\n encodeMsgpack as rawEncodeMsgpack,\n stringifyJson,\n type ObjectModelMetadata,\n} from '@algorandfoundation/algokit-common'\n\nexport function encodeJson<T extends Record<string, unknown>>(value: T, meta: ObjectModelMetadata<T>, space?: string | number): string {\n const wire = new ObjectModelCodec(meta).encode(value, 'json')\n return stringifyJson(wire, undefined, space)\n}\nexport function encodeMsgpack<T extends Record<string, unknown>>(value: T, meta: ObjectModelMetadata<T>): Uint8Array {\n const wire = new ObjectModelCodec(meta).encode(value, 'msgpack')\n return rawEncodeMsgpack(wire)\n}\nexport function decodeJson<T extends Record<string, unknown>>(value: Record<string, unknown>, meta: ObjectModelMetadata<T>): T {\n return new ObjectModelCodec<T>(meta).decode(value, 'json')\n}\nexport function decodeMsgpack<T extends Record<string, unknown>>(value: Uint8Array, meta: ObjectModelMetadata<T>): T {\n const wire = rawDecodeMsgpack(value)\n return new ObjectModelCodec<T>(meta).decode(wire, 'msgpack')\n}\n"],"mappings":";;;AAgBA,SAAgB,WAA8C,OAAgC,MAAiC;AAC7H,QAAO,IAAIA,sCAAoB,KAAK,CAAC,OAAO,OAAO,OAAO"}
|
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
import { ObjectModelCodec } from "../../../common/src/codecs/models/object-model.mjs";
|
|
2
|
-
import { stringifyJson } from "../../../common/src/json.mjs";
|
|
3
|
-
import { decodeMsgpack as decodeMsgpack$1, encodeMsgpack as encodeMsgpack$1 } from "../../../common/src/msgpack.mjs";
|
|
4
2
|
|
|
5
3
|
//#region packages/indexer_client/src/core/model-runtime.ts
|
|
6
|
-
function encodeJson(value, meta) {
|
|
7
|
-
return stringifyJson(new ObjectModelCodec(meta).encode(value, "json"));
|
|
8
|
-
}
|
|
9
|
-
function encodeMsgpack(value, meta) {
|
|
10
|
-
return encodeMsgpack$1(new ObjectModelCodec(meta).encode(value, "msgpack"));
|
|
11
|
-
}
|
|
12
4
|
function decodeJson(value, meta) {
|
|
13
5
|
return new ObjectModelCodec(meta).decode(value, "json");
|
|
14
6
|
}
|
|
15
|
-
function decodeMsgpack(value, meta) {
|
|
16
|
-
const wire = decodeMsgpack$1(value);
|
|
17
|
-
return new ObjectModelCodec(meta).decode(wire, "msgpack");
|
|
18
|
-
}
|
|
19
7
|
|
|
20
8
|
//#endregion
|
|
21
|
-
export { decodeJson
|
|
9
|
+
export { decodeJson };
|
|
22
10
|
//# sourceMappingURL=model-runtime.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model-runtime.mjs","names":[
|
|
1
|
+
{"version":3,"file":"model-runtime.mjs","names":[],"sources":["../../../../../packages/indexer_client/src/core/model-runtime.ts"],"sourcesContent":["import {\n ObjectModelCodec,\n decodeMsgpack as rawDecodeMsgpack,\n encodeMsgpack as rawEncodeMsgpack,\n stringifyJson,\n type ObjectModelMetadata,\n} from '@algorandfoundation/algokit-common'\n\nexport function encodeJson<T extends Record<string, unknown>>(value: T, meta: ObjectModelMetadata<T>, space?: string | number): string {\n const wire = new ObjectModelCodec(meta).encode(value, 'json')\n return stringifyJson(wire, undefined, space)\n}\nexport function encodeMsgpack<T extends Record<string, unknown>>(value: T, meta: ObjectModelMetadata<T>): Uint8Array {\n const wire = new ObjectModelCodec(meta).encode(value, 'msgpack')\n return rawEncodeMsgpack(wire)\n}\nexport function decodeJson<T extends Record<string, unknown>>(value: Record<string, unknown>, meta: ObjectModelMetadata<T>): T {\n return new ObjectModelCodec<T>(meta).decode(value, 'json')\n}\nexport function decodeMsgpack<T extends Record<string, unknown>>(value: Uint8Array, meta: ObjectModelMetadata<T>): T {\n const wire = rawDecodeMsgpack(value)\n return new ObjectModelCodec<T>(meta).decode(wire, 'msgpack')\n}\n"],"mappings":";;;AAgBA,SAAgB,WAA8C,OAAgC,MAAiC;AAC7H,QAAO,IAAI,iBAAoB,KAAK,CAAC,OAAO,OAAO,OAAO"}
|
|
@@ -47,7 +47,7 @@ type Block = {
|
|
|
47
47
|
* \[prev512\] Previous block hash, using SHA-512.
|
|
48
48
|
*/
|
|
49
49
|
previousBlockHash512?: Uint8Array;
|
|
50
|
-
rewards
|
|
50
|
+
rewards: BlockRewards;
|
|
51
51
|
/**
|
|
52
52
|
* \[rnd\] Current round on which this block was appended to the chain.
|
|
53
53
|
*/
|
|
@@ -67,7 +67,7 @@ type Block = {
|
|
|
67
67
|
/**
|
|
68
68
|
* \[txns\] list of transactions corresponding to a given round.
|
|
69
69
|
*/
|
|
70
|
-
transactions
|
|
70
|
+
transactions: Transaction[];
|
|
71
71
|
/**
|
|
72
72
|
* \[txn\] TransactionsRoot authenticates the set of transactions appearing in the block. More specifically, it's the root of a merkle tree whose leaves are the block's Txids, in lexicographic order. For the empty block, it's 0. Note that the TxnRoot does not authenticate the signatures on the transactions, only the transactions themselves. Two blocks with the same transactions but in a different order and with different signatures will have the same TxnRoot.
|
|
73
73
|
*/
|
|
@@ -75,7 +75,7 @@ type Block = {
|
|
|
75
75
|
/**
|
|
76
76
|
* \[txn256\] TransactionsRootSHA256 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA256 hash function instead of the default SHA512_256. This commitment can be used on environments where only the SHA256 function exists.
|
|
77
77
|
*/
|
|
78
|
-
transactionsRootSha256
|
|
78
|
+
transactionsRootSha256?: Uint8Array;
|
|
79
79
|
/**
|
|
80
80
|
* \[txn512\] TransactionsRootSHA512 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA512 hash function instead of the default SHA512_256.
|
|
81
81
|
*/
|
|
@@ -86,9 +86,9 @@ type Block = {
|
|
|
86
86
|
* Specifically, TxnCounter is the number of the next transaction that will be committed after this block. It is 0 when no transactions have ever been committed (since TxnCounter started being supported).
|
|
87
87
|
*/
|
|
88
88
|
txnCounter?: number;
|
|
89
|
-
upgradeState
|
|
89
|
+
upgradeState: BlockUpgradeState;
|
|
90
90
|
upgradeVote?: BlockUpgradeVote;
|
|
91
|
-
participationUpdates
|
|
91
|
+
participationUpdates: ParticipationUpdates;
|
|
92
92
|
};
|
|
93
93
|
//#endregion
|
|
94
94
|
export { Block };
|
|
@@ -68,7 +68,7 @@ const BlockMeta = {
|
|
|
68
68
|
{
|
|
69
69
|
name: "rewards",
|
|
70
70
|
wireKey: "rewards",
|
|
71
|
-
optional:
|
|
71
|
+
optional: false,
|
|
72
72
|
codec: new require_object_model.ObjectModelCodec(require_block_rewards.BlockRewardsMeta)
|
|
73
73
|
},
|
|
74
74
|
{
|
|
@@ -98,7 +98,7 @@ const BlockMeta = {
|
|
|
98
98
|
{
|
|
99
99
|
name: "transactions",
|
|
100
100
|
wireKey: "transactions",
|
|
101
|
-
optional:
|
|
101
|
+
optional: false,
|
|
102
102
|
codec: new require_array.ArrayCodec(new require_object_model.ObjectModelCodec(require_transaction.TransactionMeta))
|
|
103
103
|
},
|
|
104
104
|
{
|
|
@@ -110,7 +110,7 @@ const BlockMeta = {
|
|
|
110
110
|
{
|
|
111
111
|
name: "transactionsRootSha256",
|
|
112
112
|
wireKey: "transactions-root-sha256",
|
|
113
|
-
optional:
|
|
113
|
+
optional: true,
|
|
114
114
|
codec: require_fixed_bytes.fixedBytes32Codec
|
|
115
115
|
},
|
|
116
116
|
{
|
|
@@ -128,7 +128,7 @@ const BlockMeta = {
|
|
|
128
128
|
{
|
|
129
129
|
name: "upgradeState",
|
|
130
130
|
wireKey: "upgrade-state",
|
|
131
|
-
optional:
|
|
131
|
+
optional: false,
|
|
132
132
|
codec: new require_object_model.ObjectModelCodec(require_block_upgrade_state.BlockUpgradeStateMeta)
|
|
133
133
|
},
|
|
134
134
|
{
|
|
@@ -140,7 +140,7 @@ const BlockMeta = {
|
|
|
140
140
|
{
|
|
141
141
|
name: "participationUpdates",
|
|
142
142
|
wireKey: "participation-updates",
|
|
143
|
-
optional:
|
|
143
|
+
optional: false,
|
|
144
144
|
codec: new require_object_model.ObjectModelCodec(require_participation_updates.ParticipationUpdatesMeta)
|
|
145
145
|
}
|
|
146
146
|
]
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"block.js","names":["BlockMeta: ObjectModelMetadata<Block>","addressCodec","numberCodec","fixedBytes32Codec","stringCodec","fixedBytes64Codec","ObjectModelCodec","BlockRewardsMeta","bigIntCodec","ArrayCodec","StateProofTrackingMeta","TransactionMeta","BlockUpgradeStateMeta","BlockUpgradeVoteMeta","ParticipationUpdatesMeta"],"sources":["../../../../../packages/indexer_client/src/models/block.ts"],"sourcesContent":["import type { Address, ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport {\n stringCodec,\n numberCodec,\n bigIntCodec,\n addressCodec,\n ArrayCodec,\n ObjectModelCodec,\n fixedBytes32Codec,\n fixedBytes64Codec,\n} from '@algorandfoundation/algokit-common'\nimport type { BlockRewards } from './block-rewards'\nimport { BlockRewardsMeta } from './block-rewards'\nimport type { BlockUpgradeState } from './block-upgrade-state'\nimport { BlockUpgradeStateMeta } from './block-upgrade-state'\nimport type { BlockUpgradeVote } from './block-upgrade-vote'\nimport { BlockUpgradeVoteMeta } from './block-upgrade-vote'\nimport type { ParticipationUpdates } from './participation-updates'\nimport { ParticipationUpdatesMeta } from './participation-updates'\nimport type { StateProofTracking } from './state-proof-tracking'\nimport { StateProofTrackingMeta } from './state-proof-tracking'\nimport type { Transaction } from './transaction'\nimport { TransactionMeta } from './transaction'\n\n/**\n * Block information.\n *\n * Definition:\n * data/bookkeeping/block.go : Block\n */\nexport type Block = {\n /**\n * the proposer of this block.\n */\n proposer?: Address\n\n /**\n * the sum of all fees paid by transactions in this block.\n */\n feesCollected?: number\n\n /**\n * the potential bonus payout for this block.\n */\n bonus?: number\n\n /**\n * the actual amount transferred to the proposer from the fee sink.\n */\n proposerPayout?: number\n\n /**\n * \\[gh\\] hash to which this block belongs.\n */\n genesisHash: Uint8Array\n\n /**\n * \\[gen\\] ID to which this block belongs.\n */\n genesisId: string\n\n /**\n * \\[prev\\] Previous block hash.\n */\n previousBlockHash: Uint8Array\n\n /**\n * \\[prev512\\] Previous block hash, using SHA-512.\n */\n previousBlockHash512?: Uint8Array\n rewards
|
|
1
|
+
{"version":3,"file":"block.js","names":["BlockMeta: ObjectModelMetadata<Block>","addressCodec","numberCodec","fixedBytes32Codec","stringCodec","fixedBytes64Codec","ObjectModelCodec","BlockRewardsMeta","bigIntCodec","ArrayCodec","StateProofTrackingMeta","TransactionMeta","BlockUpgradeStateMeta","BlockUpgradeVoteMeta","ParticipationUpdatesMeta"],"sources":["../../../../../packages/indexer_client/src/models/block.ts"],"sourcesContent":["import type { Address, ObjectModelMetadata } from '@algorandfoundation/algokit-common'\nimport {\n stringCodec,\n numberCodec,\n bigIntCodec,\n addressCodec,\n ArrayCodec,\n ObjectModelCodec,\n fixedBytes32Codec,\n fixedBytes64Codec,\n} from '@algorandfoundation/algokit-common'\nimport type { BlockRewards } from './block-rewards'\nimport { BlockRewardsMeta } from './block-rewards'\nimport type { BlockUpgradeState } from './block-upgrade-state'\nimport { BlockUpgradeStateMeta } from './block-upgrade-state'\nimport type { BlockUpgradeVote } from './block-upgrade-vote'\nimport { BlockUpgradeVoteMeta } from './block-upgrade-vote'\nimport type { ParticipationUpdates } from './participation-updates'\nimport { ParticipationUpdatesMeta } from './participation-updates'\nimport type { StateProofTracking } from './state-proof-tracking'\nimport { StateProofTrackingMeta } from './state-proof-tracking'\nimport type { Transaction } from './transaction'\nimport { TransactionMeta } from './transaction'\n\n/**\n * Block information.\n *\n * Definition:\n * data/bookkeeping/block.go : Block\n */\nexport type Block = {\n /**\n * the proposer of this block.\n */\n proposer?: Address\n\n /**\n * the sum of all fees paid by transactions in this block.\n */\n feesCollected?: number\n\n /**\n * the potential bonus payout for this block.\n */\n bonus?: number\n\n /**\n * the actual amount transferred to the proposer from the fee sink.\n */\n proposerPayout?: number\n\n /**\n * \\[gh\\] hash to which this block belongs.\n */\n genesisHash: Uint8Array\n\n /**\n * \\[gen\\] ID to which this block belongs.\n */\n genesisId: string\n\n /**\n * \\[prev\\] Previous block hash.\n */\n previousBlockHash: Uint8Array\n\n /**\n * \\[prev512\\] Previous block hash, using SHA-512.\n */\n previousBlockHash512?: Uint8Array\n rewards: BlockRewards\n\n /**\n * \\[rnd\\] Current round on which this block was appended to the chain.\n */\n round: bigint\n\n /**\n * \\[seed\\] Sortition seed.\n */\n seed: Uint8Array\n\n /**\n * Tracks the status of state proofs.\n */\n stateProofTracking?: StateProofTracking[]\n\n /**\n * \\[ts\\] Block creation timestamp in seconds since epoch\n */\n timestamp: number\n\n /**\n * \\[txns\\] list of transactions corresponding to a given round.\n */\n transactions: Transaction[]\n\n /**\n * \\[txn\\] TransactionsRoot authenticates the set of transactions appearing in the block. More specifically, it's the root of a merkle tree whose leaves are the block's Txids, in lexicographic order. For the empty block, it's 0. Note that the TxnRoot does not authenticate the signatures on the transactions, only the transactions themselves. Two blocks with the same transactions but in a different order and with different signatures will have the same TxnRoot.\n */\n transactionsRoot: Uint8Array\n\n /**\n * \\[txn256\\] TransactionsRootSHA256 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA256 hash function instead of the default SHA512_256. This commitment can be used on environments where only the SHA256 function exists.\n */\n transactionsRootSha256?: Uint8Array\n\n /**\n * \\[txn512\\] TransactionsRootSHA512 is an auxiliary TransactionRoot, built using a vector commitment instead of a merkle tree, and SHA512 hash function instead of the default SHA512_256.\n */\n transactionsRootSha512?: Uint8Array\n\n /**\n * \\[tc\\] TxnCounter counts the number of transactions committed in the ledger, from the time at which support for this feature was introduced.\n *\n * Specifically, TxnCounter is the number of the next transaction that will be committed after this block. It is 0 when no transactions have ever been committed (since TxnCounter started being supported).\n */\n txnCounter?: number\n upgradeState: BlockUpgradeState\n upgradeVote?: BlockUpgradeVote\n participationUpdates: ParticipationUpdates\n}\n\nexport const BlockMeta: ObjectModelMetadata<Block> = {\n name: 'Block',\n kind: 'object',\n fields: [\n {\n name: 'proposer',\n wireKey: 'proposer',\n optional: true,\n codec: addressCodec,\n },\n {\n name: 'feesCollected',\n wireKey: 'fees-collected',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'bonus',\n wireKey: 'bonus',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'proposerPayout',\n wireKey: 'proposer-payout',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'genesisHash',\n wireKey: 'genesis-hash',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'genesisId',\n wireKey: 'genesis-id',\n optional: false,\n codec: stringCodec,\n },\n {\n name: 'previousBlockHash',\n wireKey: 'previous-block-hash',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'previousBlockHash512',\n wireKey: 'previous-block-hash-512',\n optional: true,\n codec: fixedBytes64Codec,\n },\n {\n name: 'rewards',\n wireKey: 'rewards',\n optional: false,\n codec: new ObjectModelCodec(BlockRewardsMeta),\n },\n {\n name: 'round',\n wireKey: 'round',\n optional: false,\n codec: bigIntCodec,\n },\n {\n name: 'seed',\n wireKey: 'seed',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'stateProofTracking',\n wireKey: 'state-proof-tracking',\n optional: true,\n codec: new ArrayCodec(new ObjectModelCodec(StateProofTrackingMeta)),\n },\n {\n name: 'timestamp',\n wireKey: 'timestamp',\n optional: false,\n codec: numberCodec,\n },\n {\n name: 'transactions',\n wireKey: 'transactions',\n optional: false,\n codec: new ArrayCodec(new ObjectModelCodec(TransactionMeta)),\n },\n {\n name: 'transactionsRoot',\n wireKey: 'transactions-root',\n optional: false,\n codec: fixedBytes32Codec,\n },\n {\n name: 'transactionsRootSha256',\n wireKey: 'transactions-root-sha256',\n optional: true,\n codec: fixedBytes32Codec,\n },\n {\n name: 'transactionsRootSha512',\n wireKey: 'transactions-root-sha512',\n optional: true,\n codec: fixedBytes64Codec,\n },\n {\n name: 'txnCounter',\n wireKey: 'txn-counter',\n optional: true,\n codec: numberCodec,\n },\n {\n name: 'upgradeState',\n wireKey: 'upgrade-state',\n optional: false,\n codec: new ObjectModelCodec(BlockUpgradeStateMeta),\n },\n {\n name: 'upgradeVote',\n wireKey: 'upgrade-vote',\n optional: true,\n codec: new ObjectModelCodec(BlockUpgradeVoteMeta),\n },\n {\n name: 'participationUpdates',\n wireKey: 'participation-updates',\n optional: false,\n codec: new ObjectModelCodec(ParticipationUpdatesMeta),\n },\n ],\n}\n"],"mappings":";;;;;;;;;;;;;;;AA2HA,MAAaA,YAAwC;CACnD,MAAM;CACN,MAAM;CACN,QAAQ;EACN;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOA;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOA;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOD;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOE;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIC,sCAAiBC,uCAAiB;GAC9C;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOC;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOL;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIM,yBAAW,IAAIH,sCAAiBI,oDAAuB,CAAC;GACpE;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOR;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIO,yBAAW,IAAIH,sCAAiBK,oCAAgB,CAAC;GAC7D;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOR;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOA;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOE;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAOH;GACR;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAII,sCAAiBM,kDAAsB;GACnD;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIN,sCAAiBO,gDAAqB;GAClD;EACD;GACE,MAAM;GACN,SAAS;GACT,UAAU;GACV,OAAO,IAAIP,sCAAiBQ,uDAAyB;GACtD;EACF;CACF"}
|
|
@@ -68,7 +68,7 @@ const BlockMeta = {
|
|
|
68
68
|
{
|
|
69
69
|
name: "rewards",
|
|
70
70
|
wireKey: "rewards",
|
|
71
|
-
optional:
|
|
71
|
+
optional: false,
|
|
72
72
|
codec: new ObjectModelCodec(BlockRewardsMeta)
|
|
73
73
|
},
|
|
74
74
|
{
|
|
@@ -98,7 +98,7 @@ const BlockMeta = {
|
|
|
98
98
|
{
|
|
99
99
|
name: "transactions",
|
|
100
100
|
wireKey: "transactions",
|
|
101
|
-
optional:
|
|
101
|
+
optional: false,
|
|
102
102
|
codec: new ArrayCodec(new ObjectModelCodec(TransactionMeta))
|
|
103
103
|
},
|
|
104
104
|
{
|
|
@@ -110,7 +110,7 @@ const BlockMeta = {
|
|
|
110
110
|
{
|
|
111
111
|
name: "transactionsRootSha256",
|
|
112
112
|
wireKey: "transactions-root-sha256",
|
|
113
|
-
optional:
|
|
113
|
+
optional: true,
|
|
114
114
|
codec: fixedBytes32Codec
|
|
115
115
|
},
|
|
116
116
|
{
|
|
@@ -128,7 +128,7 @@ const BlockMeta = {
|
|
|
128
128
|
{
|
|
129
129
|
name: "upgradeState",
|
|
130
130
|
wireKey: "upgrade-state",
|
|
131
|
-
optional:
|
|
131
|
+
optional: false,
|
|
132
132
|
codec: new ObjectModelCodec(BlockUpgradeStateMeta)
|
|
133
133
|
},
|
|
134
134
|
{
|
|
@@ -140,7 +140,7 @@ const BlockMeta = {
|
|
|
140
140
|
{
|
|
141
141
|
name: "participationUpdates",
|
|
142
142
|
wireKey: "participation-updates",
|
|
143
|
-
optional:
|
|
143
|
+
optional: false,
|
|
144
144
|
codec: new ObjectModelCodec(ParticipationUpdatesMeta)
|
|
145
145
|
}
|
|
146
146
|
]
|