@plasius/economy 0.2.0 → 0.3.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/README.md +66 -5
- package/dist/index.cjs +1411 -155
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +428 -20
- package/dist/index.d.ts +428 -20
- package/dist/index.js +1378 -155
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -73,8 +73,47 @@ interface SourceLotSliceV1 {
|
|
|
73
73
|
readonly lotId: LotId;
|
|
74
74
|
readonly amount: TokenSubunitString;
|
|
75
75
|
}
|
|
76
|
+
/** Versioned mutable projection around immutable V1 source-lot provenance. */
|
|
77
|
+
interface VersionedSourceLotV1 {
|
|
78
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
79
|
+
readonly lot: SourceLotV1;
|
|
80
|
+
readonly version: number;
|
|
81
|
+
readonly updatedAt: IsoTimestamp;
|
|
82
|
+
}
|
|
83
|
+
type SourceLotMovementType = "allocate" | "boost" | "reclaim" | "spend" | "hold" | "release-hold" | "refund" | "chargeback" | "reversal";
|
|
84
|
+
/**
|
|
85
|
+
* Immutable movement applied to one source-lot projection by compare-and-swap.
|
|
86
|
+
* Signed deltas are authoritative; `resultingRefundState` is part of the same
|
|
87
|
+
* atomic version transition.
|
|
88
|
+
*/
|
|
89
|
+
interface SourceLotMovementV1 {
|
|
90
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
91
|
+
readonly movementId: string;
|
|
92
|
+
readonly transactionId: TransactionId;
|
|
93
|
+
readonly lotId: LotId;
|
|
94
|
+
readonly movementType: SourceLotMovementType;
|
|
95
|
+
readonly remainingDelta: TokenSubunitString;
|
|
96
|
+
readonly heldDelta: TokenSubunitString;
|
|
97
|
+
readonly reversedDelta: TokenSubunitString;
|
|
98
|
+
readonly expectedVersion: number;
|
|
99
|
+
readonly resultingVersion: number;
|
|
100
|
+
readonly expectedRefundState: LotRefundState;
|
|
101
|
+
readonly resultingRefundState: LotRefundState;
|
|
102
|
+
readonly occurredAt: IsoTimestamp;
|
|
103
|
+
}
|
|
76
104
|
/** Validates source-lot arithmetic, evidence, and immutable provenance fields. */
|
|
77
105
|
declare function assertSourceLot(lot: SourceLotV1): void;
|
|
106
|
+
/** Validates the optimistic projection wrapper used by V2 persistence. */
|
|
107
|
+
declare function assertVersionedSourceLot(snapshot: VersionedSourceLotV1): void;
|
|
108
|
+
/** Creates the only state accepted by the V2 append-source-lot operation. */
|
|
109
|
+
declare function createInitialSourceLotSnapshot(lot: SourceLotV1): VersionedSourceLotV1;
|
|
110
|
+
/** Validates movement shape and operation-specific delta direction. */
|
|
111
|
+
declare function assertSourceLotMovement(movement: SourceLotMovementV1): void;
|
|
112
|
+
/**
|
|
113
|
+
* Applies one immutable movement to a locked source-lot snapshot. Persistence
|
|
114
|
+
* must append the movement and compare-and-swap this result atomically.
|
|
115
|
+
*/
|
|
116
|
+
declare function applySourceLotMovement(snapshot: VersionedSourceLotV1, movement: SourceLotMovementV1): VersionedSourceLotV1;
|
|
78
117
|
/** Returns unheld, unconsumed TokenSubunits in a source lot. */
|
|
79
118
|
declare function availableSourceLotAmount(lot: SourceLotV1): bigint;
|
|
80
119
|
/** Evaluates provider/source restrictions without trusting a browser claim. */
|
|
@@ -87,6 +126,18 @@ declare function selectSourceLots(lots: readonly SourceLotV1[], requestedAmount:
|
|
|
87
126
|
|
|
88
127
|
type ActivityType = "purchase" | "subscription" | "rewarded-ad" | "offerwall" | "allocation" | "boost" | "reclaim" | "spend" | "hold" | "refund" | "chargeback" | "adjustment" | "reversal" | "event" | "competition";
|
|
89
128
|
type ActivityStatus = "pending" | "held" | "settled" | "reversed" | "failed";
|
|
129
|
+
/**
|
|
130
|
+
* States permitted on an immutable transaction accepted by the V2
|
|
131
|
+
* persistence boundary. Pending and failed work belongs to the command
|
|
132
|
+
* workflow, while a reversed presentation state is derived from an immutable
|
|
133
|
+
* compensating transaction rather than written back to the original journal
|
|
134
|
+
* row.
|
|
135
|
+
*/
|
|
136
|
+
type EconomicJournalStatus = "held" | "settled";
|
|
137
|
+
/** A journal transaction that has an immediate economic effect. */
|
|
138
|
+
type EconomicJournalTransactionV1 = Omit<LedgerTransactionV1, "status"> & {
|
|
139
|
+
readonly status: EconomicJournalStatus;
|
|
140
|
+
};
|
|
90
141
|
/** One signed side of an immutable double-entry transaction. */
|
|
91
142
|
interface LedgerPostingV1 {
|
|
92
143
|
readonly schemaVersion: EconomyContractVersion;
|
|
@@ -131,6 +182,11 @@ interface ActivityEntryV1 {
|
|
|
131
182
|
declare function assertActivityEntry(entry: ActivityEntryV1): void;
|
|
132
183
|
/** Proves the structural and arithmetic invariants of one transaction. */
|
|
133
184
|
declare function assertBalancedTransaction(transaction: LedgerTransactionV1): void;
|
|
185
|
+
/**
|
|
186
|
+
* Narrows a balanced V1 transaction to the states accepted by the V2 journal.
|
|
187
|
+
* This is additive: legacy V1 validators retain their existing status union.
|
|
188
|
+
*/
|
|
189
|
+
declare function assertEconomicJournalTransaction(transaction: LedgerTransactionV1): asserts transaction is EconomicJournalTransactionV1;
|
|
134
190
|
/**
|
|
135
191
|
* Produces deterministic UTF-8 JSON for an approved SHA-256/HSM adapter.
|
|
136
192
|
* Hashing itself deliberately remains outside this provider-neutral package.
|
|
@@ -351,11 +407,36 @@ interface EarlyBackerEvaluationV1 {
|
|
|
351
407
|
readonly contributingLotIds: readonly LotId[];
|
|
352
408
|
readonly evaluatedAt: IsoTimestamp;
|
|
353
409
|
}
|
|
410
|
+
declare const EARLY_BACKER_SETTLEMENT_POLICY_V2: "settlement-window-v2";
|
|
411
|
+
/**
|
|
412
|
+
* Additive evaluation result using settlement as the sole qualification event.
|
|
413
|
+
* Purchase and credit times remain provenance/order facts.
|
|
414
|
+
*/
|
|
415
|
+
interface EarlyBackerEvaluationV2 {
|
|
416
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
417
|
+
readonly policyVersion: typeof EARLY_BACKER_SETTLEMENT_POLICY_V2;
|
|
418
|
+
readonly qualificationEvent: "settled-at";
|
|
419
|
+
readonly cohortKey: typeof PRE_UTILITY_BACKER_COHORT;
|
|
420
|
+
readonly status: "not-qualified" | "provisional";
|
|
421
|
+
readonly payerAccountId: AccountId;
|
|
422
|
+
readonly receivingHouseholdId: HouseholdId;
|
|
423
|
+
readonly netRetainedAmount: TokenSubunitString;
|
|
424
|
+
readonly contributingLotIds: readonly LotId[];
|
|
425
|
+
readonly evaluatedAt: IsoTimestamp;
|
|
426
|
+
}
|
|
354
427
|
/**
|
|
355
428
|
* Recalculates provisional cohort basis from retained paid lots. It promises no
|
|
356
429
|
* future reward and deliberately has no permanent entitled state.
|
|
357
430
|
*/
|
|
358
431
|
declare function evaluateEarlyBacker(payerAccountId: AccountId, receivingHouseholdId: HouseholdId, paidLots: readonly PaidLotRetentionV1[], window: EarlyBackerWindowV1, evaluatedAt: IsoTimestamp): EarlyBackerEvaluationV1;
|
|
432
|
+
/**
|
|
433
|
+
* Evaluates the approved settlement-window policy. The caller owns environment
|
|
434
|
+
* and rollout classification: `publicTokensLaunchAt` and
|
|
435
|
+
* `firstPublicSpendLiveAt` must be derived from the entire public cohort, so
|
|
436
|
+
* staff, test, and closed-beta availability cannot open or close this window.
|
|
437
|
+
* The caller must also exclude non-production/test lots before evaluation.
|
|
438
|
+
*/
|
|
439
|
+
declare function evaluateEarlyBackerBySettlementV2(payerAccountId: AccountId, receivingHouseholdId: HouseholdId, paidLots: readonly PaidLotRetentionV1[], window: EarlyBackerWindowV1, evaluatedAt: IsoTimestamp): EarlyBackerEvaluationV2;
|
|
359
440
|
|
|
360
441
|
/** Stable machine-readable failures exposed by the economy domain. */
|
|
361
442
|
type EconomyErrorCode = "INVALID_AMOUNT" | "AMOUNT_OUT_OF_RANGE" | "AMOUNT_NOT_WHOLE_TOKEN" | "INVALID_CONTRACT" | "UNBALANCED_TRANSACTION" | "DUPLICATE_IDENTIFIER" | "DUPLICATE_TRANSACTION" | "INSUFFICIENT_BALANCE" | "INSUFFICIENT_ELIGIBLE_LOTS" | "SOURCE_LOT_RESTRICTED" | "REVERSAL_ALREADY_EXISTS" | "NEGATIVE_PROJECTION" | "INVALID_TIME_WINDOW";
|
|
@@ -380,6 +461,29 @@ declare function economyAssert(condition: unknown, code: EconomyErrorCode, messa
|
|
|
380
461
|
/** Creates a bounded, non-sensitive error contract for an HTTP adapter. */
|
|
381
462
|
declare function toEconomyErrorEnvelope(error: EconomyError, requestId?: string): EconomyErrorEnvelopeV1;
|
|
382
463
|
|
|
464
|
+
type JournalChainId = string;
|
|
465
|
+
/** Locked head of one canonical transaction hash chain. */
|
|
466
|
+
interface JournalChainHeadV1 {
|
|
467
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
468
|
+
readonly chainId: JournalChainId;
|
|
469
|
+
readonly version: number;
|
|
470
|
+
readonly lastTransactionId?: TransactionId;
|
|
471
|
+
readonly canonicalHash?: string;
|
|
472
|
+
readonly updatedAt: IsoTimestamp;
|
|
473
|
+
}
|
|
474
|
+
/** An effective economic transaction carrying its approved canonical hash. */
|
|
475
|
+
type ChainedEconomicJournalTransactionV1 = EconomicJournalTransactionV1 & {
|
|
476
|
+
readonly canonicalHash: string;
|
|
477
|
+
};
|
|
478
|
+
/** Validates an empty or populated journal-chain head. */
|
|
479
|
+
declare function assertJournalChainHead(head: JournalChainHeadV1): void;
|
|
480
|
+
/**
|
|
481
|
+
* Proves that a hashed transaction extends the locked head and returns the
|
|
482
|
+
* exact next head. The persistence adapter must compare-and-swap the old
|
|
483
|
+
* version inside the same serializable transaction that appends the journal.
|
|
484
|
+
*/
|
|
485
|
+
declare function advanceJournalChainHead(head: JournalChainHeadV1, transaction: ChainedEconomicJournalTransactionV1): JournalChainHeadV1;
|
|
486
|
+
|
|
383
487
|
type AdjustmentStatus = "draft" | "pending-approval" | "approved" | "rejected" | "executed" | "expired";
|
|
384
488
|
/** Dual-control request; the resulting change is always a ledger transaction. */
|
|
385
489
|
interface AdjustmentRequestV1 {
|
|
@@ -399,27 +503,14 @@ interface AdjustmentRequestV1 {
|
|
|
399
503
|
/** Proves that production adjustment approval was performed by another actor. */
|
|
400
504
|
declare function assertDistinctAdjustmentApproval(request: AdjustmentRequestV1): void;
|
|
401
505
|
|
|
402
|
-
type BalanceProjection = Readonly<Record<AccountId, TokenSubunitString>>;
|
|
403
|
-
interface BalanceProjectionSnapshotV1 {
|
|
404
|
-
readonly schemaVersion: EconomyContractVersion;
|
|
405
|
-
readonly balances: BalanceProjection;
|
|
406
|
-
readonly lastTransactionId?: TransactionId;
|
|
407
|
-
readonly rebuiltAt: IsoTimestamp;
|
|
408
|
-
}
|
|
409
|
-
/** Applies one balanced transaction without mutating the existing projection. */
|
|
410
|
-
declare function applyTransactionToProjection(current: BalanceProjection, transaction: LedgerTransactionV1): BalanceProjection;
|
|
411
|
-
/**
|
|
412
|
-
* Rebuilds balances deterministically and rejects duplicate economic envelopes.
|
|
413
|
-
*/
|
|
414
|
-
declare function rebuildBalanceProjection(transactions: readonly LedgerTransactionV1[]): BalanceProjection;
|
|
415
|
-
/** Enforces non-negative balances only for spendable/reservable accounts. */
|
|
416
|
-
declare function assertNonNegativeAccounts(projection: BalanceProjection, protectedAccountIds: readonly AccountId[]): void;
|
|
417
|
-
/** Creates a versioned snapshot after a deterministic rebuild. */
|
|
418
|
-
declare function createProjectionSnapshot(transactions: readonly LedgerTransactionV1[], rebuiltAt: IsoTimestamp): BalanceProjectionSnapshotV1;
|
|
419
|
-
|
|
420
506
|
type WalletKind = "household-treasury" | "personal" | "gameplay-allocation" | "hold" | "purchase-clearing" | "provider-clearing" | "system";
|
|
421
507
|
type WalletStatus = "active" | "restricted" | "closed";
|
|
422
508
|
type WalletOwnerType = "account" | "household" | "system";
|
|
509
|
+
/** Exact owner identity used by persistence lookups and IDOR-safe locking. */
|
|
510
|
+
interface WalletOwnerReferenceV1 {
|
|
511
|
+
readonly ownerType: WalletOwnerType;
|
|
512
|
+
readonly ownerId: AccountId | HouseholdId | "system";
|
|
513
|
+
}
|
|
423
514
|
/** Versioned authoritative wallet descriptor. */
|
|
424
515
|
interface WalletV1 {
|
|
425
516
|
readonly schemaVersion: EconomyContractVersion;
|
|
@@ -455,6 +546,8 @@ interface WalletLifetimeTotalsV1 {
|
|
|
455
546
|
readonly spent: TokenSubunitString;
|
|
456
547
|
readonly reversed: TokenSubunitString;
|
|
457
548
|
}
|
|
549
|
+
/** Validates an exact wallet owner without accepting a browser-derived role. */
|
|
550
|
+
declare function assertWalletOwnerReference(owner: WalletOwnerReferenceV1): void;
|
|
458
551
|
/** Validates wallet ownership, lifecycle, and optimistic-version facts. */
|
|
459
552
|
declare function assertWallet(wallet: WalletV1): void;
|
|
460
553
|
/** Validates non-negative server-computed wallet balance categories. */
|
|
@@ -462,7 +555,89 @@ declare function assertWalletBalanceSummary(summary: WalletBalanceSummaryV1): vo
|
|
|
462
555
|
/** Validates non-negative lifetime aggregates exposed by the profile API. */
|
|
463
556
|
declare function assertWalletLifetimeTotals(totals: WalletLifetimeTotalsV1): void;
|
|
464
557
|
|
|
465
|
-
type
|
|
558
|
+
type BalanceProjection = Readonly<Record<AccountId, TokenSubunitString>>;
|
|
559
|
+
interface BalanceProjectionSnapshotV1 {
|
|
560
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
561
|
+
readonly balances: BalanceProjection;
|
|
562
|
+
readonly lastTransactionId?: TransactionId;
|
|
563
|
+
readonly rebuiltAt: IsoTimestamp;
|
|
564
|
+
}
|
|
565
|
+
type WalletProjectionBucket = "spendable" | "reserved" | "held";
|
|
566
|
+
/** Exclusive stored buckets for one wallet; reward progress is derived. */
|
|
567
|
+
interface WalletBalanceProjectionV1 {
|
|
568
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
569
|
+
readonly walletId: WalletId;
|
|
570
|
+
readonly spendable: TokenSubunitString;
|
|
571
|
+
readonly reserved: TokenSubunitString;
|
|
572
|
+
readonly held: TokenSubunitString;
|
|
573
|
+
readonly version: number;
|
|
574
|
+
readonly lastTransactionId?: TransactionId;
|
|
575
|
+
readonly asOf: IsoTimestamp;
|
|
576
|
+
}
|
|
577
|
+
/** One atomic add operation against all exclusive buckets of a wallet. */
|
|
578
|
+
interface WalletBalanceDeltaV1 {
|
|
579
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
580
|
+
readonly walletId: WalletId;
|
|
581
|
+
readonly spendableDelta: TokenSubunitString;
|
|
582
|
+
readonly reservedDelta: TokenSubunitString;
|
|
583
|
+
readonly heldDelta: TokenSubunitString;
|
|
584
|
+
}
|
|
585
|
+
/** Authoritative mapping from a ledger account to one wallet bucket. */
|
|
586
|
+
interface WalletPostingAccountBindingV1 {
|
|
587
|
+
readonly accountId: AccountId;
|
|
588
|
+
readonly walletId: WalletId;
|
|
589
|
+
readonly bucket: WalletProjectionBucket;
|
|
590
|
+
}
|
|
591
|
+
type WalletLifetimeBucket = "bought" | "earned" | "allocated" | "reclaimed" | "spent" | "reversed";
|
|
592
|
+
/** Positive monotonic contribution to one wallet lifetime counter. */
|
|
593
|
+
interface WalletLifetimeDeltaV1 {
|
|
594
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
595
|
+
readonly walletId: WalletId;
|
|
596
|
+
readonly bucket: WalletLifetimeBucket;
|
|
597
|
+
readonly amount: TokenSubunitString;
|
|
598
|
+
}
|
|
599
|
+
/** Validates one exclusive-bucket projection. */
|
|
600
|
+
declare function assertWalletBalanceProjection(projection: WalletBalanceProjectionV1): void;
|
|
601
|
+
/** Validates one non-zero atomic wallet delta. */
|
|
602
|
+
declare function assertWalletBalanceDelta(delta: WalletBalanceDeltaV1): void;
|
|
603
|
+
/** Rejects duplicate wallet updates before one atomic persistence call. */
|
|
604
|
+
declare function assertWalletBalanceDeltaBatch(transactionId: TransactionId, deltas: readonly WalletBalanceDeltaV1[]): void;
|
|
605
|
+
/** Applies an atomic add locally for deterministic tests and rebuilds. */
|
|
606
|
+
declare function applyWalletBalanceDelta(projection: WalletBalanceProjectionV1, delta: WalletBalanceDeltaV1, transactionId: TransactionId, asOf: IsoTimestamp): WalletBalanceProjectionV1;
|
|
607
|
+
/**
|
|
608
|
+
* Converts exclusive storage buckets to the legacy display DTO. Available is
|
|
609
|
+
* independently usable whole Tokens in this wallet; rewardProgress is this
|
|
610
|
+
* wallet's sub-Token remainder and is never netted with another wallet.
|
|
611
|
+
*/
|
|
612
|
+
declare function createWalletBalanceSummary(projection: WalletBalanceProjectionV1): WalletBalanceSummaryV1;
|
|
613
|
+
/** Enforces the stronger per-wallet semantics required by V1 query adapters. */
|
|
614
|
+
declare function assertDeterministicWalletBalanceSummary(summary: WalletBalanceSummaryV1): void;
|
|
615
|
+
/**
|
|
616
|
+
* Derives a single delta per wallet from wallet-linked postings and an
|
|
617
|
+
* authoritative account-to-bucket mapping. Unlinked system postings are not
|
|
618
|
+
* wallet projections.
|
|
619
|
+
*/
|
|
620
|
+
declare function deriveWalletBalanceDeltas(transaction: EconomicJournalTransactionV1, bindings: readonly WalletPostingAccountBindingV1[]): readonly WalletBalanceDeltaV1[];
|
|
621
|
+
/**
|
|
622
|
+
* Rebuilds monotonic gross lifetime contributions from a settled transaction.
|
|
623
|
+
* Earlier bought/earned counters are never reduced by a later compensating
|
|
624
|
+
* transaction; removals accrue separately in `reversed`.
|
|
625
|
+
*/
|
|
626
|
+
declare function deriveWalletLifetimeDeltas(transaction: EconomicJournalTransactionV1): readonly WalletLifetimeDeltaV1[];
|
|
627
|
+
/** Applies positive lifetime deltas for one wallet without rewriting history. */
|
|
628
|
+
declare function applyWalletLifetimeDeltas(current: WalletLifetimeTotalsV1, walletId: WalletId, deltas: readonly WalletLifetimeDeltaV1[]): WalletLifetimeTotalsV1;
|
|
629
|
+
/** Applies one balanced transaction without mutating the existing projection. */
|
|
630
|
+
declare function applyTransactionToProjection(current: BalanceProjection, transaction: LedgerTransactionV1): BalanceProjection;
|
|
631
|
+
/**
|
|
632
|
+
* Rebuilds balances deterministically and rejects duplicate economic envelopes.
|
|
633
|
+
*/
|
|
634
|
+
declare function rebuildBalanceProjection(transactions: readonly LedgerTransactionV1[]): BalanceProjection;
|
|
635
|
+
/** Enforces non-negative balances only for spendable/reservable accounts. */
|
|
636
|
+
declare function assertNonNegativeAccounts(projection: BalanceProjection, protectedAccountIds: readonly AccountId[]): void;
|
|
637
|
+
/** Creates a versioned snapshot after a deterministic rebuild. */
|
|
638
|
+
declare function createProjectionSnapshot(transactions: readonly LedgerTransactionV1[], rebuiltAt: IsoTimestamp): BalanceProjectionSnapshotV1;
|
|
639
|
+
|
|
640
|
+
type EconomyCommandType = "credit-purchase" | "credit-subscription" | "credit-reward" | "credit-event" | "credit-competition" | "allocate" | "boost" | "reclaim" | "spend" | "hold" | "release-hold" | "refund" | "chargeback" | "reverse" | "adjust";
|
|
466
641
|
interface EconomyCommandEnvelopeV1 {
|
|
467
642
|
readonly schemaVersion: EconomyContractVersion;
|
|
468
643
|
readonly commandId: string;
|
|
@@ -477,6 +652,17 @@ interface EconomyCommandEnvelopeV1 {
|
|
|
477
652
|
readonly acceptedRegion: string;
|
|
478
653
|
readonly writerFencingToken: string;
|
|
479
654
|
}
|
|
655
|
+
type EconomyCommandWorkflowStateV1 = "accepted" | "processing" | "failed" | "completed";
|
|
656
|
+
/** Immutable workflow evidence; it is never an economic journal transaction. */
|
|
657
|
+
interface EconomyCommandWorkflowEventV1 {
|
|
658
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
659
|
+
readonly workflowEventId: string;
|
|
660
|
+
readonly commandId: string;
|
|
661
|
+
readonly state: EconomyCommandWorkflowStateV1;
|
|
662
|
+
/** Stable non-sensitive classifier; detailed failure data stays operational. */
|
|
663
|
+
readonly failureCode?: string;
|
|
664
|
+
readonly occurredAt: IsoTimestamp;
|
|
665
|
+
}
|
|
480
666
|
interface EconomyOutboxEventV1 {
|
|
481
667
|
readonly schemaVersion: EconomyContractVersion;
|
|
482
668
|
readonly eventId: string;
|
|
@@ -490,6 +676,27 @@ interface PersistedIdempotencyResultV1 {
|
|
|
490
676
|
readonly responseHash: string;
|
|
491
677
|
readonly recordedAt: IsoTimestamp;
|
|
492
678
|
}
|
|
679
|
+
/** Exact actor/subject/operation namespace for a caller-owned idempotency key. */
|
|
680
|
+
interface EconomyIdempotencyScopeV1 {
|
|
681
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
682
|
+
readonly idempotencyKey: string;
|
|
683
|
+
readonly commandType: EconomyCommandType;
|
|
684
|
+
readonly actorAccountId: AccountId;
|
|
685
|
+
readonly subjectAccountId: AccountId;
|
|
686
|
+
}
|
|
687
|
+
/** V2 replay evidence bound to one accepted command and exact scope. */
|
|
688
|
+
interface ScopedPersistedIdempotencyResultV1 extends PersistedIdempotencyResultV1 {
|
|
689
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
690
|
+
readonly commandId: string;
|
|
691
|
+
}
|
|
692
|
+
/** Validates replay evidence before it is returned across a command boundary. */
|
|
693
|
+
declare function assertScopedPersistedIdempotencyResult(result: ScopedPersistedIdempotencyResultV1): void;
|
|
694
|
+
/** Validates the namespace that prevents cross-principal replay collisions. */
|
|
695
|
+
declare function assertEconomyIdempotencyScope(scope: EconomyIdempotencyScopeV1): void;
|
|
696
|
+
/** Validates minimized accepted-command evidence before durable append. */
|
|
697
|
+
declare function assertEconomyCommandEnvelope(envelope: EconomyCommandEnvelopeV1): void;
|
|
698
|
+
/** Validates one immutable command-workflow state event. */
|
|
699
|
+
declare function assertEconomyCommandWorkflowEvent(event: EconomyCommandWorkflowEventV1): void;
|
|
493
700
|
/** Operations available only inside one serializable database transaction. */
|
|
494
701
|
interface EconomyUnitOfWork {
|
|
495
702
|
getWalletForUpdate(walletId: WalletId): Promise<WalletV1 | null>;
|
|
@@ -511,6 +718,62 @@ interface EconomyPersistencePort {
|
|
|
511
718
|
getTransaction(transactionId: TransactionId): Promise<LedgerTransactionV1 | null>;
|
|
512
719
|
rebuildProjection(): Promise<BalanceProjection>;
|
|
513
720
|
}
|
|
721
|
+
/**
|
|
722
|
+
* V2 mutation surface. Unlike `EconomyUnitOfWork`, it has no absolute balance
|
|
723
|
+
* overwrite: journal, source-lot movement, allocation state, balance/lifetime
|
|
724
|
+
* deltas, idempotency, chain head, and outbox are committed atomically.
|
|
725
|
+
*/
|
|
726
|
+
interface EconomyUnitOfWorkV2 {
|
|
727
|
+
getWalletForOwnerForUpdate(walletId: WalletId, owner: WalletOwnerReferenceV1): Promise<WalletV1 | null>;
|
|
728
|
+
listSpendableLotsForUpdate(walletId: WalletId): Promise<readonly VersionedSourceLotV1[]>;
|
|
729
|
+
findLotForUpdate(lotId: LotId): Promise<VersionedSourceLotV1 | null>;
|
|
730
|
+
getGameplayAllocationForUpdate(allocationId: AllocationId, householdId: HouseholdId, childAccountId: AccountId): Promise<GameplayAllocationV1 | null>;
|
|
731
|
+
findIdempotencyResult(scope: EconomyIdempotencyScopeV1): Promise<ScopedPersistedIdempotencyResultV1 | null>;
|
|
732
|
+
/** Locks and rejects any stale/non-active regional writer lease. */
|
|
733
|
+
lockActiveWriterFence(acceptedRegion: string, writerFencingToken: string): Promise<void>;
|
|
734
|
+
lockJournalChainHead(chainId: string): Promise<JournalChainHeadV1>;
|
|
735
|
+
appendCommandEnvelope(envelope: EconomyCommandEnvelopeV1): Promise<void>;
|
|
736
|
+
appendCommandWorkflowEvent(event: EconomyCommandWorkflowEventV1): Promise<void>;
|
|
737
|
+
appendTransaction(transaction: ChainedEconomicJournalTransactionV1): Promise<void>;
|
|
738
|
+
/** Appends `createInitialSourceLotSnapshot()` output; later changes are movements. */
|
|
739
|
+
appendSourceLot(snapshot: VersionedSourceLotV1): Promise<void>;
|
|
740
|
+
/** Appends movement evidence and applies its lot CAS as one operation. */
|
|
741
|
+
applySourceLotMovement(movement: SourceLotMovementV1): Promise<void>;
|
|
742
|
+
appendGameplayAllocation(allocation: GameplayAllocationV1): Promise<void>;
|
|
743
|
+
/**
|
|
744
|
+
* Compares `expectedVersion`, requires `allocation.version` to be exactly the
|
|
745
|
+
* next value, and never overwrites a stale row.
|
|
746
|
+
*/
|
|
747
|
+
saveGameplayAllocation(allocation: GameplayAllocationV1, expectedVersion: number): Promise<void>;
|
|
748
|
+
/**
|
|
749
|
+
* Atomically adds deltas, verifies them against the appended postings and
|
|
750
|
+
* account bindings, and records transaction-scoped application keys.
|
|
751
|
+
*/
|
|
752
|
+
applyWalletBalanceDeltas(transactionId: TransactionId, deltas: readonly WalletBalanceDeltaV1[]): Promise<void>;
|
|
753
|
+
/**
|
|
754
|
+
* Atomically increments monotonic lifetime counters after verifying the
|
|
755
|
+
* deltas against the appended transaction's deterministic classification.
|
|
756
|
+
*/
|
|
757
|
+
applyWalletLifetimeDeltas(transactionId: TransactionId, deltas: readonly WalletLifetimeDeltaV1[]): Promise<void>;
|
|
758
|
+
saveIdempotencyResult(scope: EconomyIdempotencyScopeV1, result: ScopedPersistedIdempotencyResultV1): Promise<void>;
|
|
759
|
+
appendOutboxEvent(event: EconomyOutboxEventV1): Promise<void>;
|
|
760
|
+
/** Compare-and-swaps the full locked head, including its canonical hash. */
|
|
761
|
+
advanceJournalChainHead(expected: JournalChainHeadV1, next: JournalChainHeadV1): Promise<void>;
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* Additive authoritative persistence boundary for new consumers. V1 remains
|
|
765
|
+
* exported for compatibility but must not be adapted by delegating its
|
|
766
|
+
* absolute `saveBalanceProjection` operation to this interface.
|
|
767
|
+
*/
|
|
768
|
+
interface EconomyPersistencePortV2 {
|
|
769
|
+
runSerializable<T>(operation: (unitOfWork: EconomyUnitOfWorkV2) => Promise<T>): Promise<T>;
|
|
770
|
+
getWallet(walletId: WalletId): Promise<WalletV1 | null>;
|
|
771
|
+
listWalletsByOwner(owner: WalletOwnerReferenceV1): Promise<readonly WalletV1[]>;
|
|
772
|
+
getGameplayAllocation(allocationId: AllocationId, householdId: HouseholdId, childAccountId: AccountId): Promise<GameplayAllocationV1 | null>;
|
|
773
|
+
getCommandEnvelope(commandId: string): Promise<EconomyCommandEnvelopeV1 | null>;
|
|
774
|
+
getTransaction(transactionId: TransactionId): Promise<ChainedEconomicJournalTransactionV1 | null>;
|
|
775
|
+
rebuildWalletBalanceProjections(): Promise<readonly WalletBalanceProjectionV1[]>;
|
|
776
|
+
}
|
|
514
777
|
interface EconomyClockPort {
|
|
515
778
|
now(): IsoTimestamp;
|
|
516
779
|
}
|
|
@@ -518,6 +781,151 @@ interface EconomyIdPort {
|
|
|
518
781
|
nextId(namespace: string): string;
|
|
519
782
|
}
|
|
520
783
|
|
|
784
|
+
type WalletPortfolioComponentRole = "household-treasury" | "personal" | "gameplay-allocation" | "hold";
|
|
785
|
+
/** One server-authorized component of a portfolio read. */
|
|
786
|
+
interface WalletPortfolioComponentScopeV1 {
|
|
787
|
+
readonly walletId: WalletId;
|
|
788
|
+
readonly role: WalletPortfolioComponentRole;
|
|
789
|
+
readonly beneficiaryAccountId?: AccountId;
|
|
790
|
+
}
|
|
791
|
+
/**
|
|
792
|
+
* Explicit portfolio scope assembled after authorization. It prevents a host's
|
|
793
|
+
* household treasury and same-user-only personal wallet from being silently
|
|
794
|
+
* represented as one wallet.
|
|
795
|
+
*/
|
|
796
|
+
interface WalletPortfolioReadScopeV1 {
|
|
797
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
798
|
+
readonly portfolioId: string;
|
|
799
|
+
readonly subjectAccountId: AccountId;
|
|
800
|
+
readonly components: readonly WalletPortfolioComponentScopeV1[];
|
|
801
|
+
}
|
|
802
|
+
interface WalletBalanceTotalsV1 {
|
|
803
|
+
readonly available: TokenSubunitString;
|
|
804
|
+
readonly reserved: TokenSubunitString;
|
|
805
|
+
readonly held: TokenSubunitString;
|
|
806
|
+
readonly rewardProgress: TokenSubunitString;
|
|
807
|
+
}
|
|
808
|
+
interface WalletPortfolioBalanceComponentV1 extends WalletPortfolioComponentScopeV1 {
|
|
809
|
+
readonly summary: WalletBalanceSummaryV1;
|
|
810
|
+
}
|
|
811
|
+
interface WalletPortfolioSummaryV1 {
|
|
812
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
813
|
+
readonly portfolioId: string;
|
|
814
|
+
readonly subjectAccountId: AccountId;
|
|
815
|
+
readonly components: readonly WalletPortfolioBalanceComponentV1[];
|
|
816
|
+
/**
|
|
817
|
+
* Exact column sums for display only. Progress is intentionally not promoted
|
|
818
|
+
* across wallets because their source/transfer policies may differ.
|
|
819
|
+
*/
|
|
820
|
+
readonly totals: WalletBalanceTotalsV1;
|
|
821
|
+
readonly asOf: IsoTimestamp;
|
|
822
|
+
}
|
|
823
|
+
/** Self-identifying lifetime read for one wallet. */
|
|
824
|
+
interface WalletLifetimeSnapshotV1 {
|
|
825
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
826
|
+
readonly walletId: WalletId;
|
|
827
|
+
readonly totals: WalletLifetimeTotalsV1;
|
|
828
|
+
readonly version: number;
|
|
829
|
+
readonly asOf: IsoTimestamp;
|
|
830
|
+
}
|
|
831
|
+
interface WalletPortfolioLifetimeComponentV1 extends WalletPortfolioComponentScopeV1 {
|
|
832
|
+
readonly snapshot: WalletLifetimeSnapshotV1;
|
|
833
|
+
}
|
|
834
|
+
interface WalletPortfolioLifetimeV1 {
|
|
835
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
836
|
+
readonly portfolioId: string;
|
|
837
|
+
readonly subjectAccountId: AccountId;
|
|
838
|
+
readonly components: readonly WalletPortfolioLifetimeComponentV1[];
|
|
839
|
+
readonly totals: WalletLifetimeTotalsV1;
|
|
840
|
+
readonly asOf: IsoTimestamp;
|
|
841
|
+
}
|
|
842
|
+
type EconomicActivityStatusV1 = "held" | "settled" | "reversed";
|
|
843
|
+
type WorkflowActivityStatusV1 = "pending" | "failed";
|
|
844
|
+
type WalletActivityStatusV1 = EconomicActivityStatusV1 | WorkflowActivityStatusV1;
|
|
845
|
+
interface WalletActivityBaseV1 {
|
|
846
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
847
|
+
readonly activityId: string;
|
|
848
|
+
/** Component wallet whose signed display amount this row represents. */
|
|
849
|
+
readonly walletId: WalletId;
|
|
850
|
+
readonly activityType: ActivityType;
|
|
851
|
+
readonly occurredAt: IsoTimestamp;
|
|
852
|
+
readonly amount: TokenSubunitString;
|
|
853
|
+
readonly source: TokenSource;
|
|
854
|
+
readonly beneficiaryAccountId?: AccountId;
|
|
855
|
+
readonly maskedReference?: string;
|
|
856
|
+
readonly sourceLabel: string;
|
|
857
|
+
}
|
|
858
|
+
/** Economically effective or read-model-derived reversal activity. */
|
|
859
|
+
interface EconomicWalletActivityEntryV1 extends WalletActivityBaseV1 {
|
|
860
|
+
readonly entryKind: "economic";
|
|
861
|
+
readonly transactionId: TransactionId;
|
|
862
|
+
readonly status: EconomicActivityStatusV1;
|
|
863
|
+
}
|
|
864
|
+
/**
|
|
865
|
+
* Non-economic accepted/failed work. Its amount is display context only and is
|
|
866
|
+
* excluded from balances and lifetime aggregates.
|
|
867
|
+
*/
|
|
868
|
+
interface WorkflowWalletActivityEntryV1 extends WalletActivityBaseV1 {
|
|
869
|
+
readonly entryKind: "workflow";
|
|
870
|
+
readonly commandId: string;
|
|
871
|
+
readonly status: WorkflowActivityStatusV1;
|
|
872
|
+
}
|
|
873
|
+
type WalletActivityEntryV1 = EconomicWalletActivityEntryV1 | WorkflowWalletActivityEntryV1;
|
|
874
|
+
interface WalletActivityFilterV1 {
|
|
875
|
+
readonly activityTypes?: readonly ActivityType[];
|
|
876
|
+
readonly statuses?: readonly WalletActivityStatusV1[];
|
|
877
|
+
readonly sources?: readonly TokenSource[];
|
|
878
|
+
readonly beneficiaryAccountId?: AccountId;
|
|
879
|
+
readonly fromInclusive?: IsoTimestamp;
|
|
880
|
+
readonly toExclusive?: IsoTimestamp;
|
|
881
|
+
}
|
|
882
|
+
interface WalletActivityPageRequestV1 {
|
|
883
|
+
readonly limit: number;
|
|
884
|
+
readonly cursor?: string;
|
|
885
|
+
readonly filter?: WalletActivityFilterV1;
|
|
886
|
+
}
|
|
887
|
+
interface WalletActivityPageV1 {
|
|
888
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
889
|
+
readonly entries: readonly WalletActivityEntryV1[];
|
|
890
|
+
readonly hasMore: boolean;
|
|
891
|
+
readonly nextCursor?: string;
|
|
892
|
+
}
|
|
893
|
+
/** Validates a server-created, bounded portfolio scope. */
|
|
894
|
+
declare function assertWalletPortfolioReadScope(scope: WalletPortfolioReadScopeV1): void;
|
|
895
|
+
/** Validates a self-identifying wallet lifetime read. */
|
|
896
|
+
declare function assertWalletLifetimeSnapshot(snapshot: WalletLifetimeSnapshotV1): void;
|
|
897
|
+
/**
|
|
898
|
+
* Constructs a portfolio balance without merging wallet identities or
|
|
899
|
+
* promoting sub-Token progress across policy boundaries.
|
|
900
|
+
*/
|
|
901
|
+
declare function createWalletPortfolioSummary(scope: WalletPortfolioReadScopeV1, components: readonly WalletPortfolioBalanceComponentV1[], asOf: IsoTimestamp): WalletPortfolioSummaryV1;
|
|
902
|
+
/** Validates a portfolio balance read independently of its producing adapter. */
|
|
903
|
+
declare function assertWalletPortfolioSummary(summary: WalletPortfolioSummaryV1): void;
|
|
904
|
+
/** Builds monotonic lifetime totals while retaining per-wallet components. */
|
|
905
|
+
declare function createWalletPortfolioLifetime(scope: WalletPortfolioReadScopeV1, components: readonly WalletPortfolioLifetimeComponentV1[], asOf: IsoTimestamp): WalletPortfolioLifetimeV1;
|
|
906
|
+
/** Validates a portfolio lifetime read independently of its producing adapter. */
|
|
907
|
+
declare function assertWalletPortfolioLifetime(lifetime: WalletPortfolioLifetimeV1): void;
|
|
908
|
+
/** Validates the economic/workflow activity discriminant and safe display data. */
|
|
909
|
+
declare function assertWalletActivityEntry(entry: WalletActivityEntryV1): void;
|
|
910
|
+
/** Validates bounded filters and opaque cursor input. */
|
|
911
|
+
declare function assertWalletActivityPageRequest(request: WalletActivityPageRequestV1): void;
|
|
912
|
+
/**
|
|
913
|
+
* Validates stable descending `(occurredAt, activityId)` page order and cursor
|
|
914
|
+
* presence. Cursors remain opaque to this provider-neutral package.
|
|
915
|
+
*/
|
|
916
|
+
declare function assertWalletActivityPage(page: WalletActivityPageV1): void;
|
|
917
|
+
/** Prevents an activity cursor/result from expanding an authorized portfolio. */
|
|
918
|
+
declare function assertWalletActivityPageForPortfolio(page: WalletActivityPageV1, scope: WalletPortfolioReadScopeV1): void;
|
|
919
|
+
/** Read-only adapter boundary; authorization must precede scope construction. */
|
|
920
|
+
interface EconomyQueryPortV1 {
|
|
921
|
+
getWalletSummary(walletId: WalletId): Promise<WalletBalanceSummaryV1 | null>;
|
|
922
|
+
getWalletLifetime(walletId: WalletId): Promise<WalletLifetimeSnapshotV1 | null>;
|
|
923
|
+
listWalletActivity(walletId: WalletId, request: WalletActivityPageRequestV1): Promise<WalletActivityPageV1>;
|
|
924
|
+
getPortfolioSummary(scope: WalletPortfolioReadScopeV1): Promise<WalletPortfolioSummaryV1>;
|
|
925
|
+
getPortfolioLifetime(scope: WalletPortfolioReadScopeV1): Promise<WalletPortfolioLifetimeV1>;
|
|
926
|
+
listPortfolioActivity(scope: WalletPortfolioReadScopeV1, request: WalletActivityPageRequestV1): Promise<WalletActivityPageV1>;
|
|
927
|
+
}
|
|
928
|
+
|
|
521
929
|
type RecurrenceInterval = "daily" | "weekly" | "monthly";
|
|
522
930
|
/** Provider-neutral subscription contract. Site policy controls enablement. */
|
|
523
931
|
interface TokenSubscriptionPlanV1 {
|
|
@@ -557,4 +965,4 @@ interface SpendRequestV1 {
|
|
|
557
965
|
/** Validates future child requests while creation remains policy-disabled. */
|
|
558
966
|
declare function assertSpendRequest(request: SpendRequestV1): void;
|
|
559
967
|
|
|
560
|
-
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 CreateGameplayAllocationInputV1, ECONOMY_CONTRACT_VERSION, type EarlyBackerEvaluationV1, type EarlyBackerWindowV1, type EconomyClockPort, type EconomyCommandEnvelopeV1, type EconomyCommandType, type EconomyContractVersion, EconomyError, type EconomyErrorCode, type EconomyErrorEnvelopeV1, type EconomyIdPort, type EconomyOutboxEventV1, type EconomyPersistencePort, type EconomyUnitOfWork, type FxSnapshotV1, type GameplayAllocationV1, type GameplayLimitsV1, type HouseholdId, type IsoTimestamp, type LedgerPostingV1, type LedgerTransactionV1, type LotId, type LotRefundState, type LotTransferPolicy, type LotUseContextV1, type LotUseOperation, PRE_UTILITY_BACKER_COHORT, type PaidLotRetentionV1, type PeriodicLimitWindow, type PersistedIdempotencyResultV1, type PostingId, type ProviderEventId, type PurchaseIntentStatus, type PurchaseIntentV1, type PurchaseLimitPolicyV1, type ReclaimGameplayAllocationInputV1, type RecurrenceInterval, type ReversalInputV1, type RewardActivityTransitionV1, type RewardConversionStatus, type RewardConversionV1, type RewardRateV1, 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 WalletBalanceSummaryV1, type WalletId, type WalletKind, type WalletLifetimeTotalsV1, type WalletOwnerType, type WalletStatus, type WalletV1, applyTransactionToProjection, assertActivityEntry, assertBalancedTransaction, assertDistinctAdjustmentApproval, assertEconomyIdentifier, assertFlatTokenCatalog, assertFxSnapshot, assertGameplayAllocation, assertNonNegativeAccounts, assertOpenPurchaseIntent, assertPurchaseIntentBinding, assertPurchaseLimitPolicy, assertReversalAvailable, assertRewardConversion, assertRewardRate, assertSourceLot, assertSpendRequest, assertTokenPack, assertTokenReferenceRate, assertTokenSubscriptionPlan, assertWallet, assertWalletBalanceSummary, assertWalletLifetimeTotals, availableSourceLotAmount, boostGameplayAllocation, canUseSourceLot, canonicalTransactionPayload, convertRewardPayout, createGameplayAllocation, createProjectionSnapshot, createReversalTransaction, economyAssert, evaluateEarlyBacker, isWholeTokenAmount, mapBitLabsConversionState, parseIsoTimestamp, parseTokenSubunits, rebuildBalanceProjection, reclaimGameplayAllocation, selectSourceLots, serializeTokenSubunits, sortStringRecord, subunitsToWholeTokens, sumTokenSubunits, toEconomyErrorEnvelope, wholeTokensToSubunits };
|
|
968
|
+
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 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 PaidLotRetentionV1, type PeriodicLimitWindow, type PersistedIdempotencyResultV1, type PostingId, type ProviderEventId, type PurchaseIntentStatus, type PurchaseIntentV1, type PurchaseLimitPolicyV1, type ReclaimGameplayAllocationInputV1, type RecurrenceInterval, type ReversalInputV1, type RewardActivityTransitionV1, type RewardConversionStatus, type RewardConversionV1, type RewardRateV1, 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, applySourceLotMovement, applyTransactionToProjection, applyWalletBalanceDelta, applyWalletLifetimeDeltas, assertActivityEntry, assertBalancedTransaction, assertDeterministicWalletBalanceSummary, assertDistinctAdjustmentApproval, assertEconomicJournalTransaction, assertEconomyCommandEnvelope, assertEconomyCommandWorkflowEvent, assertEconomyIdempotencyScope, assertEconomyIdentifier, assertFlatTokenCatalog, assertFxSnapshot, assertGameplayAllocation, assertJournalChainHead, assertNonNegativeAccounts, assertOpenPurchaseIntent, assertPurchaseIntentBinding, assertPurchaseLimitPolicy, assertReversalAvailable, assertRewardConversion, assertRewardRate, 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, canUseSourceLot, canonicalTransactionPayload, convertRewardPayout, createGameplayAllocation, createInitialSourceLotSnapshot, createProjectionSnapshot, createReversalTransaction, createWalletBalanceSummary, createWalletPortfolioLifetime, createWalletPortfolioSummary, deriveWalletBalanceDeltas, deriveWalletLifetimeDeltas, economyAssert, evaluateEarlyBacker, evaluateEarlyBackerBySettlementV2, isWholeTokenAmount, mapBitLabsConversionState, parseIsoTimestamp, parseTokenSubunits, rebuildBalanceProjection, reclaimGameplayAllocation, selectSourceLots, serializeTokenSubunits, sortStringRecord, subunitsToWholeTokens, sumTokenSubunits, toEconomyErrorEnvelope, wholeTokensToSubunits };
|