@plasius/economy 0.3.2 → 0.4.0

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/dist/index.d.cts CHANGED
@@ -26,7 +26,12 @@ type EconomyContractVersion = typeof ECONOMY_CONTRACT_VERSION;
26
26
  type AccountId = string;
27
27
  type AllocationId = string;
28
28
  type HouseholdId = string;
29
+ type LearningEntitlementId = string;
30
+ type LearningModuleVersionId = string;
29
31
  type LotId = string;
32
+ type ModuleAllowanceId = string;
33
+ type ModuleSpendHoldId = string;
34
+ type ModuleSpendQuoteId = string;
30
35
  type PostingId = string;
31
36
  type ProviderEventId = string;
32
37
  type TransactionId = string;
@@ -484,6 +489,204 @@ declare function assertJournalChainHead(head: JournalChainHeadV1): void;
484
489
  */
485
490
  declare function advanceJournalChainHead(head: JournalChainHeadV1, transaction: ChainedEconomicJournalTransactionV1): JournalChainHeadV1;
486
491
 
492
+ declare const MODULE_ALLOWANCE_PURPOSE: "junior-coder-module-entitlement";
493
+ type ModuleAllowanceStatusV1 = "active" | "closed";
494
+ /** Guardian-funded value that can only purchase modules for one child. */
495
+ interface ModuleAllowanceV1 {
496
+ readonly schemaVersion: EconomyContractVersion;
497
+ readonly purpose: typeof MODULE_ALLOWANCE_PURPOSE;
498
+ readonly allowanceId: ModuleAllowanceId;
499
+ readonly householdId: HouseholdId;
500
+ readonly hostWalletId: WalletId;
501
+ readonly allowanceWalletId: WalletId;
502
+ readonly childAccountId: AccountId;
503
+ readonly status: ModuleAllowanceStatusV1;
504
+ readonly allocatedAmount: TokenSubunitString;
505
+ readonly availableAmount: TokenSubunitString;
506
+ readonly heldAmount: TokenSubunitString;
507
+ readonly spentAmount: TokenSubunitString;
508
+ readonly reclaimedAmount: TokenSubunitString;
509
+ readonly fundingSlices: readonly SourceLotSliceV1[];
510
+ readonly reclaimedSlices: readonly SourceLotSliceV1[];
511
+ readonly version: number;
512
+ readonly createdAt: IsoTimestamp;
513
+ readonly updatedAt: IsoTimestamp;
514
+ }
515
+ interface CreateModuleAllowanceInputV1 {
516
+ readonly allowanceId: ModuleAllowanceId;
517
+ readonly householdId: HouseholdId;
518
+ readonly hostWalletId: WalletId;
519
+ readonly allowanceWalletId: WalletId;
520
+ readonly childAccountId: AccountId;
521
+ readonly amount: TokenSubunitString;
522
+ readonly fundingSlices: readonly SourceLotSliceV1[];
523
+ readonly occurredAt: IsoTimestamp;
524
+ }
525
+ interface FundModuleAllowanceInputV1 {
526
+ readonly amount: TokenSubunitString;
527
+ readonly fundingSlices: readonly SourceLotSliceV1[];
528
+ readonly expectedVersion: number;
529
+ readonly occurredAt: IsoTimestamp;
530
+ }
531
+ interface ReclaimModuleAllowanceInputV1 {
532
+ readonly amount: TokenSubunitString;
533
+ readonly sourceSlices: readonly SourceLotSliceV1[];
534
+ readonly expectedVersion: number;
535
+ readonly occurredAt: IsoTimestamp;
536
+ }
537
+ interface CloseModuleAllowanceInputV1 {
538
+ readonly expectedVersion: number;
539
+ readonly occurredAt: IsoTimestamp;
540
+ }
541
+ /** Immutable Guardian-approved module price and requirements evidence. */
542
+ interface ModuleSpendQuoteV1 {
543
+ readonly schemaVersion: EconomyContractVersion;
544
+ readonly quoteId: ModuleSpendQuoteId;
545
+ readonly allowanceId: ModuleAllowanceId;
546
+ readonly householdId: HouseholdId;
547
+ readonly guardianAccountId: AccountId;
548
+ readonly childAccountId: AccountId;
549
+ readonly moduleVersionId: LearningModuleVersionId;
550
+ readonly catalogVersion: string;
551
+ readonly amount: TokenSubunitString;
552
+ readonly requirementsManifestVersion: string;
553
+ readonly requirementsManifestHash: string;
554
+ readonly requirementsAcknowledgedAt: IsoTimestamp;
555
+ readonly issuedAt: IsoTimestamp;
556
+ readonly expiresAt: IsoTimestamp;
557
+ }
558
+ type CreateModuleSpendQuoteInputV1 = Omit<ModuleSpendQuoteV1, "schemaVersion">;
559
+ type ModuleSpendHoldStatusV1 = "held" | "settled" | "released";
560
+ /** Versioned projection for one quote-bound allowance hold. */
561
+ interface ModuleSpendHoldV1 {
562
+ readonly schemaVersion: EconomyContractVersion;
563
+ readonly holdId: ModuleSpendHoldId;
564
+ readonly quoteId: ModuleSpendQuoteId;
565
+ readonly allowanceId: ModuleAllowanceId;
566
+ readonly householdId: HouseholdId;
567
+ readonly guardianAccountId: AccountId;
568
+ readonly childAccountId: AccountId;
569
+ readonly moduleVersionId: LearningModuleVersionId;
570
+ readonly amount: TokenSubunitString;
571
+ readonly requirementsManifestVersion: string;
572
+ readonly requirementsManifestHash: string;
573
+ readonly sourceSlices: readonly SourceLotSliceV1[];
574
+ readonly status: ModuleSpendHoldStatusV1;
575
+ readonly holdIdempotencyKey: string;
576
+ readonly settlementIdempotencyKey?: string;
577
+ readonly releaseIdempotencyKey?: string;
578
+ readonly entitlementId?: LearningEntitlementId;
579
+ readonly settlementTransactionId?: TransactionId;
580
+ readonly releaseTransactionId?: TransactionId;
581
+ readonly version: number;
582
+ readonly createdAt: IsoTimestamp;
583
+ readonly expiresAt: IsoTimestamp;
584
+ readonly updatedAt: IsoTimestamp;
585
+ }
586
+ interface CreateModuleSpendHoldInputV1 {
587
+ readonly holdId: ModuleSpendHoldId;
588
+ readonly idempotencyKey: string;
589
+ readonly sourceSlices: readonly SourceLotSliceV1[];
590
+ readonly expectedAllowanceVersion: number;
591
+ readonly occurredAt: IsoTimestamp;
592
+ }
593
+ interface SettleModuleSpendHoldInputV1 {
594
+ readonly entitlementId: LearningEntitlementId;
595
+ readonly settlementTransactionId: TransactionId;
596
+ readonly idempotencyKey: string;
597
+ readonly expectedAllowanceVersion: number;
598
+ readonly expectedHoldVersion: number;
599
+ readonly occurredAt: IsoTimestamp;
600
+ }
601
+ interface ReleaseModuleSpendHoldInputV1 {
602
+ readonly releaseTransactionId: TransactionId;
603
+ readonly idempotencyKey: string;
604
+ readonly expectedAllowanceVersion: number;
605
+ readonly expectedHoldVersion: number;
606
+ readonly occurredAt: IsoTimestamp;
607
+ }
608
+ interface ModuleSpendTransitionResultV1 {
609
+ readonly allowance: ModuleAllowanceV1;
610
+ readonly hold: ModuleSpendHoldV1;
611
+ }
612
+ /** Durable economic receipt for an activated learning entitlement. */
613
+ interface ModulePurchaseReceiptV1 {
614
+ readonly schemaVersion: EconomyContractVersion;
615
+ readonly receiptId: string;
616
+ readonly quoteId: ModuleSpendQuoteId;
617
+ readonly holdId: ModuleSpendHoldId;
618
+ readonly allowanceId: ModuleAllowanceId;
619
+ readonly householdId: HouseholdId;
620
+ readonly guardianAccountId: AccountId;
621
+ readonly childAccountId: AccountId;
622
+ readonly moduleVersionId: LearningModuleVersionId;
623
+ readonly entitlementId: LearningEntitlementId;
624
+ readonly amount: TokenSubunitString;
625
+ readonly requirementsManifestVersion: string;
626
+ readonly requirementsManifestHash: string;
627
+ readonly settlementTransactionId: TransactionId;
628
+ readonly issuedAt: IsoTimestamp;
629
+ }
630
+ interface CreateModulePurchaseReceiptInputV1 {
631
+ readonly receiptId: string;
632
+ readonly issuedAt: IsoTimestamp;
633
+ }
634
+ type ModulePurchaseFinancialStateV1 = "missing" | "held" | "settled" | "released";
635
+ type ModulePurchaseEntitlementStateV1 = "missing" | "pending" | "active" | "cancelled";
636
+ /** Privacy-minimized observation used by an authoritative reconciler. */
637
+ interface ModulePurchaseReconciliationObservationV1 {
638
+ readonly schemaVersion: EconomyContractVersion;
639
+ readonly quoteId: ModuleSpendQuoteId;
640
+ readonly holdId: ModuleSpendHoldId;
641
+ readonly childAccountId: AccountId;
642
+ readonly moduleVersionId: LearningModuleVersionId;
643
+ readonly financialState: ModulePurchaseFinancialStateV1;
644
+ readonly entitlementState: ModulePurchaseEntitlementStateV1;
645
+ readonly receiptPresent: boolean;
646
+ readonly observedAt: IsoTimestamp;
647
+ }
648
+ type ModulePurchaseReconciliationActionV1 = "none" | "resume-settlement" | "release-hold" | "activate-entitlement" | "issue-receipt" | "cancel-pending-entitlement" | "manual-review";
649
+ interface ModulePurchaseReconciliationResultV1 {
650
+ readonly schemaVersion: EconomyContractVersion;
651
+ readonly action: ModulePurchaseReconciliationActionV1;
652
+ readonly blocking: boolean;
653
+ readonly consistent: boolean;
654
+ readonly reasonCode: string;
655
+ }
656
+ /** Validates exact arithmetic and source-lot provenance for an allowance. */
657
+ declare function assertModuleAllowance(allowance: ModuleAllowanceV1): void;
658
+ /** Creates a child-specific Module Allowance from locked source-lot slices. */
659
+ declare function createModuleAllowance(input: CreateModuleAllowanceInputV1): ModuleAllowanceV1;
660
+ /** Adds Guardian-selected source-lot value without replacing prior history. */
661
+ declare function fundModuleAllowance(allowance: ModuleAllowanceV1, input: FundModuleAllowanceInputV1): ModuleAllowanceV1;
662
+ /** Returns unused value to its source lots without changing spent history. */
663
+ declare function reclaimModuleAllowance(allowance: ModuleAllowanceV1, input: ReclaimModuleAllowanceInputV1): ModuleAllowanceV1;
664
+ /** Closes an empty allowance; funding later requires a new allowance. */
665
+ declare function closeModuleAllowance(allowance: ModuleAllowanceV1, input: CloseModuleAllowanceInputV1): ModuleAllowanceV1;
666
+ /** Validates immutable price, Guardian acknowledgement, and manifest evidence. */
667
+ declare function assertModuleSpendQuote(quote: ModuleSpendQuoteV1): void;
668
+ /** Creates immutable quote evidence from server-derived catalog facts. */
669
+ declare function createModuleSpendQuote(input: CreateModuleSpendQuoteInputV1): ModuleSpendQuoteV1;
670
+ /** Validates one quote-bound hold lifecycle projection. */
671
+ declare function assertModuleSpendHold(hold: ModuleSpendHoldV1): void;
672
+ /** Moves quoted value from available to held after all bindings are checked. */
673
+ declare function createModuleSpendHold(allowance: ModuleAllowanceV1, quote: ModuleSpendQuoteV1, input: CreateModuleSpendHoldInputV1): ModuleSpendTransitionResultV1;
674
+ /** Settles a hold only when the pending learning entitlement is identified. */
675
+ declare function settleModuleSpendHold(allowance: ModuleAllowanceV1, hold: ModuleSpendHoldV1, input: SettleModuleSpendHoldInputV1): ModuleSpendTransitionResultV1;
676
+ /** Releases failed or expired held value back to the same allowance. */
677
+ declare function releaseModuleSpendHold(allowance: ModuleAllowanceV1, hold: ModuleSpendHoldV1, input: ReleaseModuleSpendHoldInputV1): ModuleSpendTransitionResultV1;
678
+ /** Validates a durable receipt against settled economic evidence. */
679
+ declare function assertModulePurchaseReceipt(receipt: ModulePurchaseReceiptV1): void;
680
+ /** Creates a receipt only when quote and settled hold evidence match exactly. */
681
+ declare function createModulePurchaseReceipt(quote: ModuleSpendQuoteV1, hold: ModuleSpendHoldV1, input: CreateModulePurchaseReceiptInputV1): ModulePurchaseReceiptV1;
682
+ /** Validates privacy-minimized cross-service reconciliation evidence. */
683
+ declare function assertModulePurchaseReconciliationObservation(observation: ModulePurchaseReconciliationObservationV1): void;
684
+ /**
685
+ * Returns one forward-safe action. Callers must reload and lock authoritative
686
+ * state before carrying it out; `manual-review` never authorizes a mutation.
687
+ */
688
+ declare function reconcileModulePurchase(observation: ModulePurchaseReconciliationObservationV1): ModulePurchaseReconciliationResultV1;
689
+
487
690
  type AdjustmentStatus = "draft" | "pending-approval" | "approved" | "rejected" | "executed" | "expired";
488
691
  /** Dual-control request; the resulting change is always a ledger transaction. */
489
692
  interface AdjustmentRequestV1 {
@@ -1204,4 +1407,4 @@ interface SpendRequestV1 {
1204
1407
  /** Validates future child requests while creation remains policy-disabled. */
1205
1408
  declare function assertSpendRequest(request: SpendRequestV1): void;
1206
1409
 
1207
- export { type AccountId, type ActivityEntryV1, type ActivityStatus, type ActivityType, type AdjustmentRequestV1, type AdjustmentStatus, type AllocationId, type AllocationStatus, BASELINE_GBP_CATALOG_VERSION, BASELINE_GBP_REFERENCE_RATE, BASELINE_GBP_TOKEN_PACKS, BASELINE_MONTHLY_SUBSCRIPTION_PLAN, BASELINE_PURCHASE_LIMIT_POLICY, type BalanceProjection, type BalanceProjectionSnapshotV1, type BitLabsConversionState, type BoostGameplayAllocationInputV1, type ChainedEconomicJournalTransactionV1, type CreateGameplayAllocationInputV1, EARLY_BACKER_SETTLEMENT_POLICY_V2, ECONOMY_CONTRACT_VERSION, type EarlyBackerEvaluationV1, type EarlyBackerEvaluationV2, type EarlyBackerWindowV1, type EconomicActivityStatusV1, type EconomicJournalStatus, type EconomicJournalTransactionV1, type EconomicWalletActivityEntryV1, type EconomyClockPort, type EconomyCommandEnvelopeV1, type EconomyCommandType, type EconomyCommandWorkflowEventV1, type EconomyCommandWorkflowStateV1, type EconomyContractVersion, EconomyError, type EconomyErrorCode, type EconomyErrorEnvelopeV1, type EconomyIdPort, type EconomyIdempotencyScopeV1, type EconomyOutboxEventV1, type EconomyPersistencePort, type EconomyPersistencePortV2, type EconomyQueryPortV1, type EconomyUnitOfWork, type EconomyUnitOfWorkV2, type FxSnapshotV1, type GameplayAllocationV1, type GameplayLimitsV1, type GbpMinorUnitString, type HouseholdId, type IsoTimestamp, type JournalChainHeadV1, type JournalChainId, type LedgerPostingV1, type LedgerTransactionV1, type LotId, type LotRefundState, type LotTransferPolicy, type LotUseContextV1, type LotUseOperation, PRE_UTILITY_BACKER_COHORT, type PaidLotLifecycleArithmeticV1, type PaidLotLifecycleEventTypeV1, type PaidLotLifecycleEventV1, type PaidLotLifecycleMutationResultV1, type PaidLotLifecycleReceiptV1, type PaidLotLifecycleStatusV1, type PaidLotLifecycleV1, type PaidLotPurchaseProvenanceV1, type PaidLotRetentionV1, type PeriodicLimitWindow, type PersistedIdempotencyResultV1, type PostingId, type ProviderEventId, type PurchaseCapMutationResultV1, type PurchaseCapReservationStatusV1, type PurchaseCapReservationTransitionReceiptV1, type PurchaseCapReservationTransitionTypeV1, type PurchaseCapReservationTransitionV1, type PurchaseCapReservationV1, type PurchaseCapScopeTypeV1, type PurchaseCreditInstructionV1, type PurchaseIntentDisputeDispositionV1, type PurchaseIntentLifecycleV1, type PurchaseIntentReductionV1, type PurchaseIntentStatus, type PurchaseIntentTransitionReceiptV1, type PurchaseIntentTransitionResultV1, type PurchaseIntentTransitionTypeV1, type PurchaseIntentTransitionV1, type PurchaseIntentV1, type PurchaseLimitPolicyV1, type ReclaimGameplayAllocationInputV1, type RecurrenceInterval, type ReservePurchaseCapsCommandV1, type ReversalInputV1, type RewardActivityTransitionV1, type RewardConversionStatus, type RewardConversionV1, type RewardRateV1, type RollingPurchaseCapStateV1, type ScopedPersistedIdempotencyResultV1, type SourceLotMovementType, type SourceLotMovementV1, type SourceLotSliceV1, type SourceLotV1, type SpendRequestPurpose, type SpendRequestStatus, type SpendRequestV1, TOKEN_SUBUNITS_MAX, TOKEN_SUBUNITS_MIN, TOKEN_SUBUNITS_PER_TOKEN, type TokenPackV1, type TokenReferenceRateV1, type TokenSource, type TokenSubscriptionPlanV1, type TokenSubunitString, type TransactionId, type VersionedSourceLotV1, type WalletActivityEntryV1, type WalletActivityFilterV1, type WalletActivityPageRequestV1, type WalletActivityPageV1, type WalletActivityStatusV1, type WalletBalanceDeltaV1, type WalletBalanceProjectionV1, type WalletBalanceSummaryV1, type WalletBalanceTotalsV1, type WalletId, type WalletKind, type WalletLifetimeBucket, type WalletLifetimeDeltaV1, type WalletLifetimeSnapshotV1, type WalletLifetimeTotalsV1, type WalletOwnerReferenceV1, type WalletOwnerType, type WalletPortfolioBalanceComponentV1, type WalletPortfolioComponentRole, type WalletPortfolioComponentScopeV1, type WalletPortfolioLifetimeComponentV1, type WalletPortfolioLifetimeV1, type WalletPortfolioReadScopeV1, type WalletPortfolioSummaryV1, type WalletPostingAccountBindingV1, type WalletProjectionBucket, type WalletStatus, type WalletV1, type WorkflowActivityStatusV1, type WorkflowWalletActivityEntryV1, advanceJournalChainHead, applyPaidLotLifecycleEvent, applyPurchaseIntentTransition, applySourceLotMovement, applyTransactionToProjection, applyWalletBalanceDelta, applyWalletLifetimeDeltas, assertActivityEntry, assertBalancedTransaction, assertDeterministicWalletBalanceSummary, assertDistinctAdjustmentApproval, assertEconomicJournalTransaction, assertEconomyCommandEnvelope, assertEconomyCommandWorkflowEvent, assertEconomyIdempotencyScope, assertEconomyIdentifier, assertFlatTokenCatalog, assertFxSnapshot, assertGameplayAllocation, assertJournalChainHead, assertNonNegativeAccounts, assertOpenPurchaseIntent, assertPaidLotLifecycle, assertPaidLotLifecycleEvent, assertPaidLotPurchaseProvenance, assertPurchaseCapReservation, assertPurchaseCapReservationTransition, assertPurchaseIntentBinding, assertPurchaseIntentLifecycle, assertPurchaseIntentTransition, assertPurchaseLimitPolicy, assertReversalAvailable, assertRewardConversion, assertRewardRate, assertRollingPurchaseCapState, assertScopedPersistedIdempotencyResult, assertSourceLot, assertSourceLotMovement, assertSpendRequest, assertTokenPack, assertTokenReferenceRate, assertTokenSubscriptionPlan, assertVersionedSourceLot, assertWallet, assertWalletActivityEntry, assertWalletActivityPage, assertWalletActivityPageForPortfolio, assertWalletActivityPageRequest, assertWalletBalanceDelta, assertWalletBalanceDeltaBatch, assertWalletBalanceProjection, assertWalletBalanceSummary, assertWalletLifetimeSnapshot, assertWalletLifetimeTotals, assertWalletOwnerReference, assertWalletPortfolioLifetime, assertWalletPortfolioReadScope, assertWalletPortfolioSummary, availableSourceLotAmount, boostGameplayAllocation, calculateRollingPurchaseCapUsage, canUseSourceLot, canonicalTransactionPayload, convertRewardPayout, createEarlyBackerRetentionFromPaidLot, createGameplayAllocation, createInitialSourceLotSnapshot, createPaidLotLifecycle, createProjectionSnapshot, createPurchaseIntentLifecycle, createReversalTransaction, createRollingPurchaseCapState, createWalletBalanceSummary, createWalletPortfolioLifetime, createWalletPortfolioSummary, deriveWalletBalanceDeltas, deriveWalletLifetimeDeltas, economyAssert, evaluateEarlyBacker, evaluateEarlyBackerBySettlementV2, isWholeTokenAmount, mapBitLabsConversionState, parseGbpMinorUnits, parseIsoTimestamp, parseTokenSubunits, rebuildBalanceProjection, reclaimGameplayAllocation, reducePaidLotLifecycleEvents, reducePurchaseIntentTransitions, reserveRollingPurchaseCaps, selectSourceLots, serializeGbpMinorUnits, serializeTokenSubunits, sortStringRecord, subunitsToWholeTokens, sumTokenSubunits, toEconomyErrorEnvelope, transitionRollingPurchaseCapReservation, wholeTokensToSubunits };
1410
+ export { type AccountId, type ActivityEntryV1, type ActivityStatus, type ActivityType, type AdjustmentRequestV1, type AdjustmentStatus, type AllocationId, type AllocationStatus, BASELINE_GBP_CATALOG_VERSION, BASELINE_GBP_REFERENCE_RATE, BASELINE_GBP_TOKEN_PACKS, BASELINE_MONTHLY_SUBSCRIPTION_PLAN, BASELINE_PURCHASE_LIMIT_POLICY, type BalanceProjection, type BalanceProjectionSnapshotV1, type BitLabsConversionState, type BoostGameplayAllocationInputV1, type ChainedEconomicJournalTransactionV1, type CloseModuleAllowanceInputV1, type CreateGameplayAllocationInputV1, type CreateModuleAllowanceInputV1, type CreateModulePurchaseReceiptInputV1, type CreateModuleSpendHoldInputV1, type CreateModuleSpendQuoteInputV1, EARLY_BACKER_SETTLEMENT_POLICY_V2, ECONOMY_CONTRACT_VERSION, type EarlyBackerEvaluationV1, type EarlyBackerEvaluationV2, type EarlyBackerWindowV1, type EconomicActivityStatusV1, type EconomicJournalStatus, type EconomicJournalTransactionV1, type EconomicWalletActivityEntryV1, type EconomyClockPort, type EconomyCommandEnvelopeV1, type EconomyCommandType, type EconomyCommandWorkflowEventV1, type EconomyCommandWorkflowStateV1, type EconomyContractVersion, EconomyError, type EconomyErrorCode, type EconomyErrorEnvelopeV1, type EconomyIdPort, type EconomyIdempotencyScopeV1, type EconomyOutboxEventV1, type EconomyPersistencePort, type EconomyPersistencePortV2, type EconomyQueryPortV1, type EconomyUnitOfWork, type EconomyUnitOfWorkV2, type FundModuleAllowanceInputV1, type FxSnapshotV1, type GameplayAllocationV1, type GameplayLimitsV1, type GbpMinorUnitString, type HouseholdId, type IsoTimestamp, type JournalChainHeadV1, type JournalChainId, type LearningEntitlementId, type LearningModuleVersionId, type LedgerPostingV1, type LedgerTransactionV1, type LotId, type LotRefundState, type LotTransferPolicy, type LotUseContextV1, type LotUseOperation, MODULE_ALLOWANCE_PURPOSE, type ModuleAllowanceId, type ModuleAllowanceStatusV1, type ModuleAllowanceV1, type ModulePurchaseEntitlementStateV1, type ModulePurchaseFinancialStateV1, type ModulePurchaseReceiptV1, type ModulePurchaseReconciliationActionV1, type ModulePurchaseReconciliationObservationV1, type ModulePurchaseReconciliationResultV1, type ModuleSpendHoldId, type ModuleSpendHoldStatusV1, type ModuleSpendHoldV1, type ModuleSpendQuoteId, type ModuleSpendQuoteV1, type ModuleSpendTransitionResultV1, PRE_UTILITY_BACKER_COHORT, type PaidLotLifecycleArithmeticV1, type PaidLotLifecycleEventTypeV1, type PaidLotLifecycleEventV1, type PaidLotLifecycleMutationResultV1, type PaidLotLifecycleReceiptV1, type PaidLotLifecycleStatusV1, type PaidLotLifecycleV1, type PaidLotPurchaseProvenanceV1, type PaidLotRetentionV1, type PeriodicLimitWindow, type PersistedIdempotencyResultV1, type PostingId, type ProviderEventId, type PurchaseCapMutationResultV1, type PurchaseCapReservationStatusV1, type PurchaseCapReservationTransitionReceiptV1, type PurchaseCapReservationTransitionTypeV1, type PurchaseCapReservationTransitionV1, type PurchaseCapReservationV1, type PurchaseCapScopeTypeV1, type PurchaseCreditInstructionV1, type PurchaseIntentDisputeDispositionV1, type PurchaseIntentLifecycleV1, type PurchaseIntentReductionV1, type PurchaseIntentStatus, type PurchaseIntentTransitionReceiptV1, type PurchaseIntentTransitionResultV1, type PurchaseIntentTransitionTypeV1, type PurchaseIntentTransitionV1, type PurchaseIntentV1, type PurchaseLimitPolicyV1, type ReclaimGameplayAllocationInputV1, type ReclaimModuleAllowanceInputV1, type RecurrenceInterval, type ReleaseModuleSpendHoldInputV1, type ReservePurchaseCapsCommandV1, type ReversalInputV1, type RewardActivityTransitionV1, type RewardConversionStatus, type RewardConversionV1, type RewardRateV1, type RollingPurchaseCapStateV1, type ScopedPersistedIdempotencyResultV1, type SettleModuleSpendHoldInputV1, type SourceLotMovementType, type SourceLotMovementV1, type SourceLotSliceV1, type SourceLotV1, type SpendRequestPurpose, type SpendRequestStatus, type SpendRequestV1, TOKEN_SUBUNITS_MAX, TOKEN_SUBUNITS_MIN, TOKEN_SUBUNITS_PER_TOKEN, type TokenPackV1, type TokenReferenceRateV1, type TokenSource, type TokenSubscriptionPlanV1, type TokenSubunitString, type TransactionId, type VersionedSourceLotV1, type WalletActivityEntryV1, type WalletActivityFilterV1, type WalletActivityPageRequestV1, type WalletActivityPageV1, type WalletActivityStatusV1, type WalletBalanceDeltaV1, type WalletBalanceProjectionV1, type WalletBalanceSummaryV1, type WalletBalanceTotalsV1, type WalletId, type WalletKind, type WalletLifetimeBucket, type WalletLifetimeDeltaV1, type WalletLifetimeSnapshotV1, type WalletLifetimeTotalsV1, type WalletOwnerReferenceV1, type WalletOwnerType, type WalletPortfolioBalanceComponentV1, type WalletPortfolioComponentRole, type WalletPortfolioComponentScopeV1, type WalletPortfolioLifetimeComponentV1, type WalletPortfolioLifetimeV1, type WalletPortfolioReadScopeV1, type WalletPortfolioSummaryV1, type WalletPostingAccountBindingV1, type WalletProjectionBucket, type WalletStatus, type WalletV1, type WorkflowActivityStatusV1, type WorkflowWalletActivityEntryV1, advanceJournalChainHead, applyPaidLotLifecycleEvent, applyPurchaseIntentTransition, applySourceLotMovement, applyTransactionToProjection, applyWalletBalanceDelta, applyWalletLifetimeDeltas, assertActivityEntry, assertBalancedTransaction, assertDeterministicWalletBalanceSummary, assertDistinctAdjustmentApproval, assertEconomicJournalTransaction, assertEconomyCommandEnvelope, assertEconomyCommandWorkflowEvent, assertEconomyIdempotencyScope, assertEconomyIdentifier, assertFlatTokenCatalog, assertFxSnapshot, assertGameplayAllocation, assertJournalChainHead, assertModuleAllowance, assertModulePurchaseReceipt, assertModulePurchaseReconciliationObservation, assertModuleSpendHold, assertModuleSpendQuote, assertNonNegativeAccounts, assertOpenPurchaseIntent, assertPaidLotLifecycle, assertPaidLotLifecycleEvent, assertPaidLotPurchaseProvenance, assertPurchaseCapReservation, assertPurchaseCapReservationTransition, assertPurchaseIntentBinding, assertPurchaseIntentLifecycle, assertPurchaseIntentTransition, assertPurchaseLimitPolicy, assertReversalAvailable, assertRewardConversion, assertRewardRate, assertRollingPurchaseCapState, assertScopedPersistedIdempotencyResult, assertSourceLot, assertSourceLotMovement, assertSpendRequest, assertTokenPack, assertTokenReferenceRate, assertTokenSubscriptionPlan, assertVersionedSourceLot, assertWallet, assertWalletActivityEntry, assertWalletActivityPage, assertWalletActivityPageForPortfolio, assertWalletActivityPageRequest, assertWalletBalanceDelta, assertWalletBalanceDeltaBatch, assertWalletBalanceProjection, assertWalletBalanceSummary, assertWalletLifetimeSnapshot, assertWalletLifetimeTotals, assertWalletOwnerReference, assertWalletPortfolioLifetime, assertWalletPortfolioReadScope, assertWalletPortfolioSummary, availableSourceLotAmount, boostGameplayAllocation, calculateRollingPurchaseCapUsage, canUseSourceLot, canonicalTransactionPayload, closeModuleAllowance, convertRewardPayout, createEarlyBackerRetentionFromPaidLot, createGameplayAllocation, createInitialSourceLotSnapshot, createModuleAllowance, createModulePurchaseReceipt, createModuleSpendHold, createModuleSpendQuote, createPaidLotLifecycle, createProjectionSnapshot, createPurchaseIntentLifecycle, createReversalTransaction, createRollingPurchaseCapState, createWalletBalanceSummary, createWalletPortfolioLifetime, createWalletPortfolioSummary, deriveWalletBalanceDeltas, deriveWalletLifetimeDeltas, economyAssert, evaluateEarlyBacker, evaluateEarlyBackerBySettlementV2, fundModuleAllowance, isWholeTokenAmount, mapBitLabsConversionState, parseGbpMinorUnits, parseIsoTimestamp, parseTokenSubunits, rebuildBalanceProjection, reclaimGameplayAllocation, reclaimModuleAllowance, reconcileModulePurchase, reducePaidLotLifecycleEvents, reducePurchaseIntentTransitions, releaseModuleSpendHold, reserveRollingPurchaseCaps, selectSourceLots, serializeGbpMinorUnits, serializeTokenSubunits, settleModuleSpendHold, sortStringRecord, subunitsToWholeTokens, sumTokenSubunits, toEconomyErrorEnvelope, transitionRollingPurchaseCapReservation, wholeTokensToSubunits };
package/dist/index.d.ts CHANGED
@@ -26,7 +26,12 @@ type EconomyContractVersion = typeof ECONOMY_CONTRACT_VERSION;
26
26
  type AccountId = string;
27
27
  type AllocationId = string;
28
28
  type HouseholdId = string;
29
+ type LearningEntitlementId = string;
30
+ type LearningModuleVersionId = string;
29
31
  type LotId = string;
32
+ type ModuleAllowanceId = string;
33
+ type ModuleSpendHoldId = string;
34
+ type ModuleSpendQuoteId = string;
30
35
  type PostingId = string;
31
36
  type ProviderEventId = string;
32
37
  type TransactionId = string;
@@ -484,6 +489,204 @@ declare function assertJournalChainHead(head: JournalChainHeadV1): void;
484
489
  */
485
490
  declare function advanceJournalChainHead(head: JournalChainHeadV1, transaction: ChainedEconomicJournalTransactionV1): JournalChainHeadV1;
486
491
 
492
+ declare const MODULE_ALLOWANCE_PURPOSE: "junior-coder-module-entitlement";
493
+ type ModuleAllowanceStatusV1 = "active" | "closed";
494
+ /** Guardian-funded value that can only purchase modules for one child. */
495
+ interface ModuleAllowanceV1 {
496
+ readonly schemaVersion: EconomyContractVersion;
497
+ readonly purpose: typeof MODULE_ALLOWANCE_PURPOSE;
498
+ readonly allowanceId: ModuleAllowanceId;
499
+ readonly householdId: HouseholdId;
500
+ readonly hostWalletId: WalletId;
501
+ readonly allowanceWalletId: WalletId;
502
+ readonly childAccountId: AccountId;
503
+ readonly status: ModuleAllowanceStatusV1;
504
+ readonly allocatedAmount: TokenSubunitString;
505
+ readonly availableAmount: TokenSubunitString;
506
+ readonly heldAmount: TokenSubunitString;
507
+ readonly spentAmount: TokenSubunitString;
508
+ readonly reclaimedAmount: TokenSubunitString;
509
+ readonly fundingSlices: readonly SourceLotSliceV1[];
510
+ readonly reclaimedSlices: readonly SourceLotSliceV1[];
511
+ readonly version: number;
512
+ readonly createdAt: IsoTimestamp;
513
+ readonly updatedAt: IsoTimestamp;
514
+ }
515
+ interface CreateModuleAllowanceInputV1 {
516
+ readonly allowanceId: ModuleAllowanceId;
517
+ readonly householdId: HouseholdId;
518
+ readonly hostWalletId: WalletId;
519
+ readonly allowanceWalletId: WalletId;
520
+ readonly childAccountId: AccountId;
521
+ readonly amount: TokenSubunitString;
522
+ readonly fundingSlices: readonly SourceLotSliceV1[];
523
+ readonly occurredAt: IsoTimestamp;
524
+ }
525
+ interface FundModuleAllowanceInputV1 {
526
+ readonly amount: TokenSubunitString;
527
+ readonly fundingSlices: readonly SourceLotSliceV1[];
528
+ readonly expectedVersion: number;
529
+ readonly occurredAt: IsoTimestamp;
530
+ }
531
+ interface ReclaimModuleAllowanceInputV1 {
532
+ readonly amount: TokenSubunitString;
533
+ readonly sourceSlices: readonly SourceLotSliceV1[];
534
+ readonly expectedVersion: number;
535
+ readonly occurredAt: IsoTimestamp;
536
+ }
537
+ interface CloseModuleAllowanceInputV1 {
538
+ readonly expectedVersion: number;
539
+ readonly occurredAt: IsoTimestamp;
540
+ }
541
+ /** Immutable Guardian-approved module price and requirements evidence. */
542
+ interface ModuleSpendQuoteV1 {
543
+ readonly schemaVersion: EconomyContractVersion;
544
+ readonly quoteId: ModuleSpendQuoteId;
545
+ readonly allowanceId: ModuleAllowanceId;
546
+ readonly householdId: HouseholdId;
547
+ readonly guardianAccountId: AccountId;
548
+ readonly childAccountId: AccountId;
549
+ readonly moduleVersionId: LearningModuleVersionId;
550
+ readonly catalogVersion: string;
551
+ readonly amount: TokenSubunitString;
552
+ readonly requirementsManifestVersion: string;
553
+ readonly requirementsManifestHash: string;
554
+ readonly requirementsAcknowledgedAt: IsoTimestamp;
555
+ readonly issuedAt: IsoTimestamp;
556
+ readonly expiresAt: IsoTimestamp;
557
+ }
558
+ type CreateModuleSpendQuoteInputV1 = Omit<ModuleSpendQuoteV1, "schemaVersion">;
559
+ type ModuleSpendHoldStatusV1 = "held" | "settled" | "released";
560
+ /** Versioned projection for one quote-bound allowance hold. */
561
+ interface ModuleSpendHoldV1 {
562
+ readonly schemaVersion: EconomyContractVersion;
563
+ readonly holdId: ModuleSpendHoldId;
564
+ readonly quoteId: ModuleSpendQuoteId;
565
+ readonly allowanceId: ModuleAllowanceId;
566
+ readonly householdId: HouseholdId;
567
+ readonly guardianAccountId: AccountId;
568
+ readonly childAccountId: AccountId;
569
+ readonly moduleVersionId: LearningModuleVersionId;
570
+ readonly amount: TokenSubunitString;
571
+ readonly requirementsManifestVersion: string;
572
+ readonly requirementsManifestHash: string;
573
+ readonly sourceSlices: readonly SourceLotSliceV1[];
574
+ readonly status: ModuleSpendHoldStatusV1;
575
+ readonly holdIdempotencyKey: string;
576
+ readonly settlementIdempotencyKey?: string;
577
+ readonly releaseIdempotencyKey?: string;
578
+ readonly entitlementId?: LearningEntitlementId;
579
+ readonly settlementTransactionId?: TransactionId;
580
+ readonly releaseTransactionId?: TransactionId;
581
+ readonly version: number;
582
+ readonly createdAt: IsoTimestamp;
583
+ readonly expiresAt: IsoTimestamp;
584
+ readonly updatedAt: IsoTimestamp;
585
+ }
586
+ interface CreateModuleSpendHoldInputV1 {
587
+ readonly holdId: ModuleSpendHoldId;
588
+ readonly idempotencyKey: string;
589
+ readonly sourceSlices: readonly SourceLotSliceV1[];
590
+ readonly expectedAllowanceVersion: number;
591
+ readonly occurredAt: IsoTimestamp;
592
+ }
593
+ interface SettleModuleSpendHoldInputV1 {
594
+ readonly entitlementId: LearningEntitlementId;
595
+ readonly settlementTransactionId: TransactionId;
596
+ readonly idempotencyKey: string;
597
+ readonly expectedAllowanceVersion: number;
598
+ readonly expectedHoldVersion: number;
599
+ readonly occurredAt: IsoTimestamp;
600
+ }
601
+ interface ReleaseModuleSpendHoldInputV1 {
602
+ readonly releaseTransactionId: TransactionId;
603
+ readonly idempotencyKey: string;
604
+ readonly expectedAllowanceVersion: number;
605
+ readonly expectedHoldVersion: number;
606
+ readonly occurredAt: IsoTimestamp;
607
+ }
608
+ interface ModuleSpendTransitionResultV1 {
609
+ readonly allowance: ModuleAllowanceV1;
610
+ readonly hold: ModuleSpendHoldV1;
611
+ }
612
+ /** Durable economic receipt for an activated learning entitlement. */
613
+ interface ModulePurchaseReceiptV1 {
614
+ readonly schemaVersion: EconomyContractVersion;
615
+ readonly receiptId: string;
616
+ readonly quoteId: ModuleSpendQuoteId;
617
+ readonly holdId: ModuleSpendHoldId;
618
+ readonly allowanceId: ModuleAllowanceId;
619
+ readonly householdId: HouseholdId;
620
+ readonly guardianAccountId: AccountId;
621
+ readonly childAccountId: AccountId;
622
+ readonly moduleVersionId: LearningModuleVersionId;
623
+ readonly entitlementId: LearningEntitlementId;
624
+ readonly amount: TokenSubunitString;
625
+ readonly requirementsManifestVersion: string;
626
+ readonly requirementsManifestHash: string;
627
+ readonly settlementTransactionId: TransactionId;
628
+ readonly issuedAt: IsoTimestamp;
629
+ }
630
+ interface CreateModulePurchaseReceiptInputV1 {
631
+ readonly receiptId: string;
632
+ readonly issuedAt: IsoTimestamp;
633
+ }
634
+ type ModulePurchaseFinancialStateV1 = "missing" | "held" | "settled" | "released";
635
+ type ModulePurchaseEntitlementStateV1 = "missing" | "pending" | "active" | "cancelled";
636
+ /** Privacy-minimized observation used by an authoritative reconciler. */
637
+ interface ModulePurchaseReconciliationObservationV1 {
638
+ readonly schemaVersion: EconomyContractVersion;
639
+ readonly quoteId: ModuleSpendQuoteId;
640
+ readonly holdId: ModuleSpendHoldId;
641
+ readonly childAccountId: AccountId;
642
+ readonly moduleVersionId: LearningModuleVersionId;
643
+ readonly financialState: ModulePurchaseFinancialStateV1;
644
+ readonly entitlementState: ModulePurchaseEntitlementStateV1;
645
+ readonly receiptPresent: boolean;
646
+ readonly observedAt: IsoTimestamp;
647
+ }
648
+ type ModulePurchaseReconciliationActionV1 = "none" | "resume-settlement" | "release-hold" | "activate-entitlement" | "issue-receipt" | "cancel-pending-entitlement" | "manual-review";
649
+ interface ModulePurchaseReconciliationResultV1 {
650
+ readonly schemaVersion: EconomyContractVersion;
651
+ readonly action: ModulePurchaseReconciliationActionV1;
652
+ readonly blocking: boolean;
653
+ readonly consistent: boolean;
654
+ readonly reasonCode: string;
655
+ }
656
+ /** Validates exact arithmetic and source-lot provenance for an allowance. */
657
+ declare function assertModuleAllowance(allowance: ModuleAllowanceV1): void;
658
+ /** Creates a child-specific Module Allowance from locked source-lot slices. */
659
+ declare function createModuleAllowance(input: CreateModuleAllowanceInputV1): ModuleAllowanceV1;
660
+ /** Adds Guardian-selected source-lot value without replacing prior history. */
661
+ declare function fundModuleAllowance(allowance: ModuleAllowanceV1, input: FundModuleAllowanceInputV1): ModuleAllowanceV1;
662
+ /** Returns unused value to its source lots without changing spent history. */
663
+ declare function reclaimModuleAllowance(allowance: ModuleAllowanceV1, input: ReclaimModuleAllowanceInputV1): ModuleAllowanceV1;
664
+ /** Closes an empty allowance; funding later requires a new allowance. */
665
+ declare function closeModuleAllowance(allowance: ModuleAllowanceV1, input: CloseModuleAllowanceInputV1): ModuleAllowanceV1;
666
+ /** Validates immutable price, Guardian acknowledgement, and manifest evidence. */
667
+ declare function assertModuleSpendQuote(quote: ModuleSpendQuoteV1): void;
668
+ /** Creates immutable quote evidence from server-derived catalog facts. */
669
+ declare function createModuleSpendQuote(input: CreateModuleSpendQuoteInputV1): ModuleSpendQuoteV1;
670
+ /** Validates one quote-bound hold lifecycle projection. */
671
+ declare function assertModuleSpendHold(hold: ModuleSpendHoldV1): void;
672
+ /** Moves quoted value from available to held after all bindings are checked. */
673
+ declare function createModuleSpendHold(allowance: ModuleAllowanceV1, quote: ModuleSpendQuoteV1, input: CreateModuleSpendHoldInputV1): ModuleSpendTransitionResultV1;
674
+ /** Settles a hold only when the pending learning entitlement is identified. */
675
+ declare function settleModuleSpendHold(allowance: ModuleAllowanceV1, hold: ModuleSpendHoldV1, input: SettleModuleSpendHoldInputV1): ModuleSpendTransitionResultV1;
676
+ /** Releases failed or expired held value back to the same allowance. */
677
+ declare function releaseModuleSpendHold(allowance: ModuleAllowanceV1, hold: ModuleSpendHoldV1, input: ReleaseModuleSpendHoldInputV1): ModuleSpendTransitionResultV1;
678
+ /** Validates a durable receipt against settled economic evidence. */
679
+ declare function assertModulePurchaseReceipt(receipt: ModulePurchaseReceiptV1): void;
680
+ /** Creates a receipt only when quote and settled hold evidence match exactly. */
681
+ declare function createModulePurchaseReceipt(quote: ModuleSpendQuoteV1, hold: ModuleSpendHoldV1, input: CreateModulePurchaseReceiptInputV1): ModulePurchaseReceiptV1;
682
+ /** Validates privacy-minimized cross-service reconciliation evidence. */
683
+ declare function assertModulePurchaseReconciliationObservation(observation: ModulePurchaseReconciliationObservationV1): void;
684
+ /**
685
+ * Returns one forward-safe action. Callers must reload and lock authoritative
686
+ * state before carrying it out; `manual-review` never authorizes a mutation.
687
+ */
688
+ declare function reconcileModulePurchase(observation: ModulePurchaseReconciliationObservationV1): ModulePurchaseReconciliationResultV1;
689
+
487
690
  type AdjustmentStatus = "draft" | "pending-approval" | "approved" | "rejected" | "executed" | "expired";
488
691
  /** Dual-control request; the resulting change is always a ledger transaction. */
489
692
  interface AdjustmentRequestV1 {
@@ -1204,4 +1407,4 @@ interface SpendRequestV1 {
1204
1407
  /** Validates future child requests while creation remains policy-disabled. */
1205
1408
  declare function assertSpendRequest(request: SpendRequestV1): void;
1206
1409
 
1207
- export { type AccountId, type ActivityEntryV1, type ActivityStatus, type ActivityType, type AdjustmentRequestV1, type AdjustmentStatus, type AllocationId, type AllocationStatus, BASELINE_GBP_CATALOG_VERSION, BASELINE_GBP_REFERENCE_RATE, BASELINE_GBP_TOKEN_PACKS, BASELINE_MONTHLY_SUBSCRIPTION_PLAN, BASELINE_PURCHASE_LIMIT_POLICY, type BalanceProjection, type BalanceProjectionSnapshotV1, type BitLabsConversionState, type BoostGameplayAllocationInputV1, type ChainedEconomicJournalTransactionV1, type CreateGameplayAllocationInputV1, EARLY_BACKER_SETTLEMENT_POLICY_V2, ECONOMY_CONTRACT_VERSION, type EarlyBackerEvaluationV1, type EarlyBackerEvaluationV2, type EarlyBackerWindowV1, type EconomicActivityStatusV1, type EconomicJournalStatus, type EconomicJournalTransactionV1, type EconomicWalletActivityEntryV1, type EconomyClockPort, type EconomyCommandEnvelopeV1, type EconomyCommandType, type EconomyCommandWorkflowEventV1, type EconomyCommandWorkflowStateV1, type EconomyContractVersion, EconomyError, type EconomyErrorCode, type EconomyErrorEnvelopeV1, type EconomyIdPort, type EconomyIdempotencyScopeV1, type EconomyOutboxEventV1, type EconomyPersistencePort, type EconomyPersistencePortV2, type EconomyQueryPortV1, type EconomyUnitOfWork, type EconomyUnitOfWorkV2, type FxSnapshotV1, type GameplayAllocationV1, type GameplayLimitsV1, type GbpMinorUnitString, type HouseholdId, type IsoTimestamp, type JournalChainHeadV1, type JournalChainId, type LedgerPostingV1, type LedgerTransactionV1, type LotId, type LotRefundState, type LotTransferPolicy, type LotUseContextV1, type LotUseOperation, PRE_UTILITY_BACKER_COHORT, type PaidLotLifecycleArithmeticV1, type PaidLotLifecycleEventTypeV1, type PaidLotLifecycleEventV1, type PaidLotLifecycleMutationResultV1, type PaidLotLifecycleReceiptV1, type PaidLotLifecycleStatusV1, type PaidLotLifecycleV1, type PaidLotPurchaseProvenanceV1, type PaidLotRetentionV1, type PeriodicLimitWindow, type PersistedIdempotencyResultV1, type PostingId, type ProviderEventId, type PurchaseCapMutationResultV1, type PurchaseCapReservationStatusV1, type PurchaseCapReservationTransitionReceiptV1, type PurchaseCapReservationTransitionTypeV1, type PurchaseCapReservationTransitionV1, type PurchaseCapReservationV1, type PurchaseCapScopeTypeV1, type PurchaseCreditInstructionV1, type PurchaseIntentDisputeDispositionV1, type PurchaseIntentLifecycleV1, type PurchaseIntentReductionV1, type PurchaseIntentStatus, type PurchaseIntentTransitionReceiptV1, type PurchaseIntentTransitionResultV1, type PurchaseIntentTransitionTypeV1, type PurchaseIntentTransitionV1, type PurchaseIntentV1, type PurchaseLimitPolicyV1, type ReclaimGameplayAllocationInputV1, type RecurrenceInterval, type ReservePurchaseCapsCommandV1, type ReversalInputV1, type RewardActivityTransitionV1, type RewardConversionStatus, type RewardConversionV1, type RewardRateV1, type RollingPurchaseCapStateV1, type ScopedPersistedIdempotencyResultV1, type SourceLotMovementType, type SourceLotMovementV1, type SourceLotSliceV1, type SourceLotV1, type SpendRequestPurpose, type SpendRequestStatus, type SpendRequestV1, TOKEN_SUBUNITS_MAX, TOKEN_SUBUNITS_MIN, TOKEN_SUBUNITS_PER_TOKEN, type TokenPackV1, type TokenReferenceRateV1, type TokenSource, type TokenSubscriptionPlanV1, type TokenSubunitString, type TransactionId, type VersionedSourceLotV1, type WalletActivityEntryV1, type WalletActivityFilterV1, type WalletActivityPageRequestV1, type WalletActivityPageV1, type WalletActivityStatusV1, type WalletBalanceDeltaV1, type WalletBalanceProjectionV1, type WalletBalanceSummaryV1, type WalletBalanceTotalsV1, type WalletId, type WalletKind, type WalletLifetimeBucket, type WalletLifetimeDeltaV1, type WalletLifetimeSnapshotV1, type WalletLifetimeTotalsV1, type WalletOwnerReferenceV1, type WalletOwnerType, type WalletPortfolioBalanceComponentV1, type WalletPortfolioComponentRole, type WalletPortfolioComponentScopeV1, type WalletPortfolioLifetimeComponentV1, type WalletPortfolioLifetimeV1, type WalletPortfolioReadScopeV1, type WalletPortfolioSummaryV1, type WalletPostingAccountBindingV1, type WalletProjectionBucket, type WalletStatus, type WalletV1, type WorkflowActivityStatusV1, type WorkflowWalletActivityEntryV1, advanceJournalChainHead, applyPaidLotLifecycleEvent, applyPurchaseIntentTransition, applySourceLotMovement, applyTransactionToProjection, applyWalletBalanceDelta, applyWalletLifetimeDeltas, assertActivityEntry, assertBalancedTransaction, assertDeterministicWalletBalanceSummary, assertDistinctAdjustmentApproval, assertEconomicJournalTransaction, assertEconomyCommandEnvelope, assertEconomyCommandWorkflowEvent, assertEconomyIdempotencyScope, assertEconomyIdentifier, assertFlatTokenCatalog, assertFxSnapshot, assertGameplayAllocation, assertJournalChainHead, assertNonNegativeAccounts, assertOpenPurchaseIntent, assertPaidLotLifecycle, assertPaidLotLifecycleEvent, assertPaidLotPurchaseProvenance, assertPurchaseCapReservation, assertPurchaseCapReservationTransition, assertPurchaseIntentBinding, assertPurchaseIntentLifecycle, assertPurchaseIntentTransition, assertPurchaseLimitPolicy, assertReversalAvailable, assertRewardConversion, assertRewardRate, assertRollingPurchaseCapState, assertScopedPersistedIdempotencyResult, assertSourceLot, assertSourceLotMovement, assertSpendRequest, assertTokenPack, assertTokenReferenceRate, assertTokenSubscriptionPlan, assertVersionedSourceLot, assertWallet, assertWalletActivityEntry, assertWalletActivityPage, assertWalletActivityPageForPortfolio, assertWalletActivityPageRequest, assertWalletBalanceDelta, assertWalletBalanceDeltaBatch, assertWalletBalanceProjection, assertWalletBalanceSummary, assertWalletLifetimeSnapshot, assertWalletLifetimeTotals, assertWalletOwnerReference, assertWalletPortfolioLifetime, assertWalletPortfolioReadScope, assertWalletPortfolioSummary, availableSourceLotAmount, boostGameplayAllocation, calculateRollingPurchaseCapUsage, canUseSourceLot, canonicalTransactionPayload, convertRewardPayout, createEarlyBackerRetentionFromPaidLot, createGameplayAllocation, createInitialSourceLotSnapshot, createPaidLotLifecycle, createProjectionSnapshot, createPurchaseIntentLifecycle, createReversalTransaction, createRollingPurchaseCapState, createWalletBalanceSummary, createWalletPortfolioLifetime, createWalletPortfolioSummary, deriveWalletBalanceDeltas, deriveWalletLifetimeDeltas, economyAssert, evaluateEarlyBacker, evaluateEarlyBackerBySettlementV2, isWholeTokenAmount, mapBitLabsConversionState, parseGbpMinorUnits, parseIsoTimestamp, parseTokenSubunits, rebuildBalanceProjection, reclaimGameplayAllocation, reducePaidLotLifecycleEvents, reducePurchaseIntentTransitions, reserveRollingPurchaseCaps, selectSourceLots, serializeGbpMinorUnits, serializeTokenSubunits, sortStringRecord, subunitsToWholeTokens, sumTokenSubunits, toEconomyErrorEnvelope, transitionRollingPurchaseCapReservation, wholeTokensToSubunits };
1410
+ export { type AccountId, type ActivityEntryV1, type ActivityStatus, type ActivityType, type AdjustmentRequestV1, type AdjustmentStatus, type AllocationId, type AllocationStatus, BASELINE_GBP_CATALOG_VERSION, BASELINE_GBP_REFERENCE_RATE, BASELINE_GBP_TOKEN_PACKS, BASELINE_MONTHLY_SUBSCRIPTION_PLAN, BASELINE_PURCHASE_LIMIT_POLICY, type BalanceProjection, type BalanceProjectionSnapshotV1, type BitLabsConversionState, type BoostGameplayAllocationInputV1, type ChainedEconomicJournalTransactionV1, type CloseModuleAllowanceInputV1, type CreateGameplayAllocationInputV1, type CreateModuleAllowanceInputV1, type CreateModulePurchaseReceiptInputV1, type CreateModuleSpendHoldInputV1, type CreateModuleSpendQuoteInputV1, EARLY_BACKER_SETTLEMENT_POLICY_V2, ECONOMY_CONTRACT_VERSION, type EarlyBackerEvaluationV1, type EarlyBackerEvaluationV2, type EarlyBackerWindowV1, type EconomicActivityStatusV1, type EconomicJournalStatus, type EconomicJournalTransactionV1, type EconomicWalletActivityEntryV1, type EconomyClockPort, type EconomyCommandEnvelopeV1, type EconomyCommandType, type EconomyCommandWorkflowEventV1, type EconomyCommandWorkflowStateV1, type EconomyContractVersion, EconomyError, type EconomyErrorCode, type EconomyErrorEnvelopeV1, type EconomyIdPort, type EconomyIdempotencyScopeV1, type EconomyOutboxEventV1, type EconomyPersistencePort, type EconomyPersistencePortV2, type EconomyQueryPortV1, type EconomyUnitOfWork, type EconomyUnitOfWorkV2, type FundModuleAllowanceInputV1, type FxSnapshotV1, type GameplayAllocationV1, type GameplayLimitsV1, type GbpMinorUnitString, type HouseholdId, type IsoTimestamp, type JournalChainHeadV1, type JournalChainId, type LearningEntitlementId, type LearningModuleVersionId, type LedgerPostingV1, type LedgerTransactionV1, type LotId, type LotRefundState, type LotTransferPolicy, type LotUseContextV1, type LotUseOperation, MODULE_ALLOWANCE_PURPOSE, type ModuleAllowanceId, type ModuleAllowanceStatusV1, type ModuleAllowanceV1, type ModulePurchaseEntitlementStateV1, type ModulePurchaseFinancialStateV1, type ModulePurchaseReceiptV1, type ModulePurchaseReconciliationActionV1, type ModulePurchaseReconciliationObservationV1, type ModulePurchaseReconciliationResultV1, type ModuleSpendHoldId, type ModuleSpendHoldStatusV1, type ModuleSpendHoldV1, type ModuleSpendQuoteId, type ModuleSpendQuoteV1, type ModuleSpendTransitionResultV1, PRE_UTILITY_BACKER_COHORT, type PaidLotLifecycleArithmeticV1, type PaidLotLifecycleEventTypeV1, type PaidLotLifecycleEventV1, type PaidLotLifecycleMutationResultV1, type PaidLotLifecycleReceiptV1, type PaidLotLifecycleStatusV1, type PaidLotLifecycleV1, type PaidLotPurchaseProvenanceV1, type PaidLotRetentionV1, type PeriodicLimitWindow, type PersistedIdempotencyResultV1, type PostingId, type ProviderEventId, type PurchaseCapMutationResultV1, type PurchaseCapReservationStatusV1, type PurchaseCapReservationTransitionReceiptV1, type PurchaseCapReservationTransitionTypeV1, type PurchaseCapReservationTransitionV1, type PurchaseCapReservationV1, type PurchaseCapScopeTypeV1, type PurchaseCreditInstructionV1, type PurchaseIntentDisputeDispositionV1, type PurchaseIntentLifecycleV1, type PurchaseIntentReductionV1, type PurchaseIntentStatus, type PurchaseIntentTransitionReceiptV1, type PurchaseIntentTransitionResultV1, type PurchaseIntentTransitionTypeV1, type PurchaseIntentTransitionV1, type PurchaseIntentV1, type PurchaseLimitPolicyV1, type ReclaimGameplayAllocationInputV1, type ReclaimModuleAllowanceInputV1, type RecurrenceInterval, type ReleaseModuleSpendHoldInputV1, type ReservePurchaseCapsCommandV1, type ReversalInputV1, type RewardActivityTransitionV1, type RewardConversionStatus, type RewardConversionV1, type RewardRateV1, type RollingPurchaseCapStateV1, type ScopedPersistedIdempotencyResultV1, type SettleModuleSpendHoldInputV1, type SourceLotMovementType, type SourceLotMovementV1, type SourceLotSliceV1, type SourceLotV1, type SpendRequestPurpose, type SpendRequestStatus, type SpendRequestV1, TOKEN_SUBUNITS_MAX, TOKEN_SUBUNITS_MIN, TOKEN_SUBUNITS_PER_TOKEN, type TokenPackV1, type TokenReferenceRateV1, type TokenSource, type TokenSubscriptionPlanV1, type TokenSubunitString, type TransactionId, type VersionedSourceLotV1, type WalletActivityEntryV1, type WalletActivityFilterV1, type WalletActivityPageRequestV1, type WalletActivityPageV1, type WalletActivityStatusV1, type WalletBalanceDeltaV1, type WalletBalanceProjectionV1, type WalletBalanceSummaryV1, type WalletBalanceTotalsV1, type WalletId, type WalletKind, type WalletLifetimeBucket, type WalletLifetimeDeltaV1, type WalletLifetimeSnapshotV1, type WalletLifetimeTotalsV1, type WalletOwnerReferenceV1, type WalletOwnerType, type WalletPortfolioBalanceComponentV1, type WalletPortfolioComponentRole, type WalletPortfolioComponentScopeV1, type WalletPortfolioLifetimeComponentV1, type WalletPortfolioLifetimeV1, type WalletPortfolioReadScopeV1, type WalletPortfolioSummaryV1, type WalletPostingAccountBindingV1, type WalletProjectionBucket, type WalletStatus, type WalletV1, type WorkflowActivityStatusV1, type WorkflowWalletActivityEntryV1, advanceJournalChainHead, applyPaidLotLifecycleEvent, applyPurchaseIntentTransition, applySourceLotMovement, applyTransactionToProjection, applyWalletBalanceDelta, applyWalletLifetimeDeltas, assertActivityEntry, assertBalancedTransaction, assertDeterministicWalletBalanceSummary, assertDistinctAdjustmentApproval, assertEconomicJournalTransaction, assertEconomyCommandEnvelope, assertEconomyCommandWorkflowEvent, assertEconomyIdempotencyScope, assertEconomyIdentifier, assertFlatTokenCatalog, assertFxSnapshot, assertGameplayAllocation, assertJournalChainHead, assertModuleAllowance, assertModulePurchaseReceipt, assertModulePurchaseReconciliationObservation, assertModuleSpendHold, assertModuleSpendQuote, assertNonNegativeAccounts, assertOpenPurchaseIntent, assertPaidLotLifecycle, assertPaidLotLifecycleEvent, assertPaidLotPurchaseProvenance, assertPurchaseCapReservation, assertPurchaseCapReservationTransition, assertPurchaseIntentBinding, assertPurchaseIntentLifecycle, assertPurchaseIntentTransition, assertPurchaseLimitPolicy, assertReversalAvailable, assertRewardConversion, assertRewardRate, assertRollingPurchaseCapState, assertScopedPersistedIdempotencyResult, assertSourceLot, assertSourceLotMovement, assertSpendRequest, assertTokenPack, assertTokenReferenceRate, assertTokenSubscriptionPlan, assertVersionedSourceLot, assertWallet, assertWalletActivityEntry, assertWalletActivityPage, assertWalletActivityPageForPortfolio, assertWalletActivityPageRequest, assertWalletBalanceDelta, assertWalletBalanceDeltaBatch, assertWalletBalanceProjection, assertWalletBalanceSummary, assertWalletLifetimeSnapshot, assertWalletLifetimeTotals, assertWalletOwnerReference, assertWalletPortfolioLifetime, assertWalletPortfolioReadScope, assertWalletPortfolioSummary, availableSourceLotAmount, boostGameplayAllocation, calculateRollingPurchaseCapUsage, canUseSourceLot, canonicalTransactionPayload, closeModuleAllowance, convertRewardPayout, createEarlyBackerRetentionFromPaidLot, createGameplayAllocation, createInitialSourceLotSnapshot, createModuleAllowance, createModulePurchaseReceipt, createModuleSpendHold, createModuleSpendQuote, createPaidLotLifecycle, createProjectionSnapshot, createPurchaseIntentLifecycle, createReversalTransaction, createRollingPurchaseCapState, createWalletBalanceSummary, createWalletPortfolioLifetime, createWalletPortfolioSummary, deriveWalletBalanceDeltas, deriveWalletLifetimeDeltas, economyAssert, evaluateEarlyBacker, evaluateEarlyBackerBySettlementV2, fundModuleAllowance, isWholeTokenAmount, mapBitLabsConversionState, parseGbpMinorUnits, parseIsoTimestamp, parseTokenSubunits, rebuildBalanceProjection, reclaimGameplayAllocation, reclaimModuleAllowance, reconcileModulePurchase, reducePaidLotLifecycleEvents, reducePurchaseIntentTransitions, releaseModuleSpendHold, reserveRollingPurchaseCaps, selectSourceLots, serializeGbpMinorUnits, serializeTokenSubunits, settleModuleSpendHold, sortStringRecord, subunitsToWholeTokens, sumTokenSubunits, toEconomyErrorEnvelope, transitionRollingPurchaseCapReservation, wholeTokensToSubunits };