@plasius/economy 0.3.2 → 0.5.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 +190 -11
- package/dist/index.cjs +6793 -2603
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1221 -266
- package/dist/index.d.ts +1221 -266
- package/dist/index.js +6709 -2603
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
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;
|
|
@@ -379,88 +384,6 @@ interface ReclaimGameplayAllocationInputV1 {
|
|
|
379
384
|
/** Reclaims unused whole Tokens without changing spent history. */
|
|
380
385
|
declare function reclaimGameplayAllocation(allocation: GameplayAllocationV1, input: ReclaimGameplayAllocationInputV1): GameplayAllocationV1;
|
|
381
386
|
|
|
382
|
-
declare const PRE_UTILITY_BACKER_COHORT: "pre_utility_backer_v1";
|
|
383
|
-
interface EarlyBackerWindowV1 {
|
|
384
|
-
readonly publicTokensLaunchAt: IsoTimestamp;
|
|
385
|
-
readonly firstPublicSpendLiveAt?: IsoTimestamp;
|
|
386
|
-
}
|
|
387
|
-
/** Paid-lot facts required to recalculate retained early-backer basis. */
|
|
388
|
-
interface PaidLotRetentionV1 {
|
|
389
|
-
readonly schemaVersion: EconomyContractVersion;
|
|
390
|
-
readonly lotId: LotId;
|
|
391
|
-
readonly payerAccountId: AccountId;
|
|
392
|
-
readonly receivingHouseholdId: HouseholdId;
|
|
393
|
-
readonly purchaseId: string;
|
|
394
|
-
readonly catalogVersion: string;
|
|
395
|
-
readonly purchasedAt: IsoTimestamp;
|
|
396
|
-
readonly settledAt: IsoTimestamp;
|
|
397
|
-
readonly creditedAt: IsoTimestamp;
|
|
398
|
-
readonly retainedAmount: TokenSubunitString;
|
|
399
|
-
}
|
|
400
|
-
interface EarlyBackerEvaluationV1 {
|
|
401
|
-
readonly schemaVersion: EconomyContractVersion;
|
|
402
|
-
readonly cohortKey: typeof PRE_UTILITY_BACKER_COHORT;
|
|
403
|
-
readonly status: "not-qualified" | "provisional";
|
|
404
|
-
readonly payerAccountId: AccountId;
|
|
405
|
-
readonly receivingHouseholdId: HouseholdId;
|
|
406
|
-
readonly netRetainedAmount: TokenSubunitString;
|
|
407
|
-
readonly contributingLotIds: readonly LotId[];
|
|
408
|
-
readonly evaluatedAt: IsoTimestamp;
|
|
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
|
-
}
|
|
427
|
-
/**
|
|
428
|
-
* Recalculates provisional cohort basis from retained paid lots. It promises no
|
|
429
|
-
* future reward and deliberately has no permanent entitled state.
|
|
430
|
-
*/
|
|
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;
|
|
440
|
-
|
|
441
|
-
/** Stable machine-readable failures exposed by the economy domain. */
|
|
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";
|
|
443
|
-
interface EconomyErrorEnvelopeV1 {
|
|
444
|
-
readonly schemaVersion: "1";
|
|
445
|
-
readonly error: {
|
|
446
|
-
readonly code: EconomyErrorCode;
|
|
447
|
-
readonly message: string;
|
|
448
|
-
readonly requestId?: string;
|
|
449
|
-
};
|
|
450
|
-
}
|
|
451
|
-
/**
|
|
452
|
-
* Domain error with a stable code and deliberately non-sensitive message.
|
|
453
|
-
* Provider evidence, identities, and payment details must not be included.
|
|
454
|
-
*/
|
|
455
|
-
declare class EconomyError extends Error {
|
|
456
|
-
readonly code: EconomyErrorCode;
|
|
457
|
-
constructor(code: EconomyErrorCode, message: string);
|
|
458
|
-
}
|
|
459
|
-
/** Throws a stable economy error when a domain assertion fails. */
|
|
460
|
-
declare function economyAssert(condition: unknown, code: EconomyErrorCode, message: string): asserts condition;
|
|
461
|
-
/** Creates a bounded, non-sensitive error contract for an HTTP adapter. */
|
|
462
|
-
declare function toEconomyErrorEnvelope(error: EconomyError, requestId?: string): EconomyErrorEnvelopeV1;
|
|
463
|
-
|
|
464
387
|
type JournalChainId = string;
|
|
465
388
|
/** Locked head of one canonical transaction hash chain. */
|
|
466
389
|
interface JournalChainHeadV1 {
|
|
@@ -475,6 +398,18 @@ interface JournalChainHeadV1 {
|
|
|
475
398
|
type ChainedEconomicJournalTransactionV1 = EconomicJournalTransactionV1 & {
|
|
476
399
|
readonly canonicalHash: string;
|
|
477
400
|
};
|
|
401
|
+
type JournalChainVerificationFailureCodeV1 = "duplicate-transaction" | "invalid-transaction" | "previous-hash-mismatch" | "canonical-hash-mismatch" | "end-head-mismatch";
|
|
402
|
+
/** Deterministic result of verifying one ordered canonical-chain segment. */
|
|
403
|
+
interface JournalChainVerificationResultV1 {
|
|
404
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
405
|
+
readonly valid: boolean;
|
|
406
|
+
readonly checkedTransactions: number;
|
|
407
|
+
readonly observedHead: JournalChainHeadV1;
|
|
408
|
+
readonly failureCode?: JournalChainVerificationFailureCodeV1;
|
|
409
|
+
readonly firstInvalidTransactionId?: TransactionId;
|
|
410
|
+
}
|
|
411
|
+
/** Approved infrastructure adapter that hashes exact canonical UTF-8 bytes. */
|
|
412
|
+
type CanonicalPayloadHashFunctionV1 = (payload: string) => string;
|
|
478
413
|
/** Validates an empty or populated journal-chain head. */
|
|
479
414
|
declare function assertJournalChainHead(head: JournalChainHeadV1): void;
|
|
480
415
|
/**
|
|
@@ -483,107 +418,162 @@ declare function assertJournalChainHead(head: JournalChainHeadV1): void;
|
|
|
483
418
|
* version inside the same serializable transaction that appends the journal.
|
|
484
419
|
*/
|
|
485
420
|
declare function advanceJournalChainHead(head: JournalChainHeadV1, transaction: ChainedEconomicJournalTransactionV1): JournalChainHeadV1;
|
|
421
|
+
/**
|
|
422
|
+
* Recomputes an ordered journal segment without implementing cryptography.
|
|
423
|
+
*
|
|
424
|
+
* The caller supplies an approved SHA-256 adapter. Malformed transactions are
|
|
425
|
+
* reported as integrity failures, while an invalid hash-adapter result is a
|
|
426
|
+
* contract error and fails closed.
|
|
427
|
+
*/
|
|
428
|
+
declare function verifyJournalChainSegment(startHead: JournalChainHeadV1, transactions: readonly ChainedEconomicJournalTransactionV1[], expectedEndHead: JournalChainHeadV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): JournalChainVerificationResultV1;
|
|
486
429
|
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
430
|
+
/** Application ceiling below Cosmos DB's 100-operation transactional limit. */
|
|
431
|
+
declare const ECONOMY_AUTHORITY_MAX_BATCH_OPERATIONS = 80;
|
|
432
|
+
/** Commit-manifest create plus authority-head conditional replacement. */
|
|
433
|
+
declare const ECONOMY_AUTHORITY_COMMIT_OVERHEAD_OPERATIONS = 2;
|
|
434
|
+
/** Maximum referenced record writes within one 80-operation authority batch. */
|
|
435
|
+
declare const ECONOMY_AUTHORITY_MAX_RECORD_REFERENCES: number;
|
|
436
|
+
/** Application ceiling below Cosmos DB's 2 MiB transactional-batch limit. */
|
|
437
|
+
declare const ECONOMY_AUTHORITY_MAX_BATCH_BYTES = 1572864;
|
|
438
|
+
/** Validates adapter-measured transactional operation and byte counts. */
|
|
439
|
+
declare function assertEconomyAuthorityBatchLimits(operationCount: number, serializedBytes: number): void;
|
|
440
|
+
type EconomyAuthorityStateV1 = "open" | "acquisition-closed" | "closed" | "rebuilding";
|
|
441
|
+
type EconomyAuthorityCommitKindV1 = "genesis" | "first-party-command" | "provider-acceptance" | "provider-result" | "integrity-verification" | "state-transition" | "writer-fence-transition" | "reconstruction";
|
|
442
|
+
type EconomyAuthorityRecordKindV1 = "command-envelope" | "provider-evidence-manifest" | "provider-evidence" | "operational-handle-binding" | "workflow-event" | "accepted-receipt" | "result-receipt" | "journal-transaction" | "source-lot" | "source-lot-movement" | "gameplay-allocation" | "balance-projection" | "lifetime-projection" | "idempotency-result" | "outbox-event" | "work-item" | "dead-letter" | "integrity-receipt" | "integrity-anchor";
|
|
443
|
+
type EconomyAuthorityWriteKindV1 = "create" | "conditional-replace";
|
|
444
|
+
/**
|
|
445
|
+
* Canonical reference to one record created or conditionally replaced by an
|
|
446
|
+
* authority commit. Conditional replacements bind the previous content and a
|
|
447
|
+
* hash of the adapter's optimistic-concurrency token; unconditional replacement
|
|
448
|
+
* has no representation.
|
|
449
|
+
*/
|
|
450
|
+
interface EconomyAuthorityRecordReferenceV1 {
|
|
490
451
|
readonly schemaVersion: EconomyContractVersion;
|
|
491
|
-
readonly
|
|
492
|
-
readonly
|
|
493
|
-
readonly
|
|
494
|
-
readonly
|
|
495
|
-
readonly
|
|
496
|
-
readonly
|
|
497
|
-
readonly initiatedByAccountId: AccountId;
|
|
498
|
-
readonly initiatedAt: IsoTimestamp;
|
|
499
|
-
readonly approvedByAccountId?: AccountId;
|
|
500
|
-
readonly approvedAt?: IsoTimestamp;
|
|
501
|
-
readonly resultingTransactionId?: TransactionId;
|
|
452
|
+
readonly recordKind: EconomyAuthorityRecordKindV1;
|
|
453
|
+
readonly recordId: string;
|
|
454
|
+
readonly writeKind: EconomyAuthorityWriteKindV1;
|
|
455
|
+
readonly contentHash: string;
|
|
456
|
+
readonly previousContentHash?: string;
|
|
457
|
+
readonly expectedConcurrencyTokenHash?: string;
|
|
502
458
|
}
|
|
503
|
-
/**
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
459
|
+
/**
|
|
460
|
+
* Immutable, hash-linked record of one authoritative atomic boundary.
|
|
461
|
+
*
|
|
462
|
+
* First-party commands carry acceptance and terminal effects in one manifest.
|
|
463
|
+
* Provider commands use a provider-acceptance manifest followed by a
|
|
464
|
+
* provider-result manifest after external reconciliation.
|
|
465
|
+
*/
|
|
466
|
+
interface EconomyAuthorityCommitManifestV1 {
|
|
510
467
|
readonly schemaVersion: EconomyContractVersion;
|
|
511
|
-
readonly
|
|
512
|
-
readonly
|
|
513
|
-
readonly
|
|
468
|
+
readonly commitId: string;
|
|
469
|
+
readonly authorityId: string;
|
|
470
|
+
readonly sequence: string;
|
|
471
|
+
readonly commitKind: EconomyAuthorityCommitKindV1;
|
|
472
|
+
readonly previousCommitHash?: string;
|
|
473
|
+
readonly commandId?: string;
|
|
474
|
+
readonly correlationId?: string;
|
|
475
|
+
readonly authorityStateBefore: EconomyAuthorityStateV1;
|
|
476
|
+
readonly authorityStateAfter: EconomyAuthorityStateV1;
|
|
477
|
+
readonly stateReasonCode?: string;
|
|
478
|
+
readonly recoveryVerificationReceiptId?: string;
|
|
479
|
+
readonly recoveryVerificationReceiptHash?: string;
|
|
480
|
+
readonly dualApprovalEvidenceHash?: string;
|
|
481
|
+
readonly writerRegion: string;
|
|
482
|
+
readonly writerFencingToken: string;
|
|
483
|
+
readonly recordReferences: readonly EconomyAuthorityRecordReferenceV1[];
|
|
484
|
+
readonly committedAt: IsoTimestamp;
|
|
514
485
|
}
|
|
515
|
-
/**
|
|
516
|
-
interface
|
|
486
|
+
/** Compare-and-swap projection for the singleton authority head. */
|
|
487
|
+
interface EconomyAuthorityHeadV1 {
|
|
517
488
|
readonly schemaVersion: EconomyContractVersion;
|
|
518
|
-
readonly
|
|
519
|
-
readonly
|
|
520
|
-
readonly
|
|
521
|
-
readonly
|
|
522
|
-
readonly
|
|
489
|
+
readonly authorityId: string;
|
|
490
|
+
readonly version: string;
|
|
491
|
+
readonly state: EconomyAuthorityStateV1;
|
|
492
|
+
readonly lastCommitId?: string;
|
|
493
|
+
readonly lastCommitHash?: string;
|
|
494
|
+
readonly writerRegion: string;
|
|
495
|
+
readonly writerFencingToken: string;
|
|
496
|
+
readonly updatedAt: IsoTimestamp;
|
|
523
497
|
}
|
|
524
|
-
|
|
498
|
+
/** Manifest plus the canonical hash calculated by an approved adapter. */
|
|
499
|
+
interface HashedEconomyAuthorityCommitManifestV1 {
|
|
525
500
|
readonly schemaVersion: EconomyContractVersion;
|
|
526
|
-
readonly
|
|
501
|
+
readonly manifest: EconomyAuthorityCommitManifestV1;
|
|
502
|
+
readonly canonicalHash: string;
|
|
503
|
+
}
|
|
504
|
+
type EconomyIntegrityVerificationStatusV1 = "valid" | "invalid";
|
|
505
|
+
type EconomyIntegrityFailureCodeV1 = "authority-head-mismatch" | "commit-hash-mismatch" | "commit-link-mismatch" | "record-hash-mismatch" | "journal-head-mismatch" | "projection-mismatch";
|
|
506
|
+
/** Immutable, privacy-safe evidence of one bounded integrity verification. */
|
|
507
|
+
interface EconomyIntegrityVerificationReceiptV1 {
|
|
508
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
509
|
+
readonly verificationId: string;
|
|
510
|
+
readonly authorityId: string;
|
|
511
|
+
readonly status: EconomyIntegrityVerificationStatusV1;
|
|
512
|
+
readonly checkedThroughSequence: string;
|
|
513
|
+
readonly checkedCommits: string;
|
|
514
|
+
readonly checkedRecords: string;
|
|
515
|
+
readonly expectedAuthorityHeadHash: string;
|
|
516
|
+
readonly observedAuthorityHeadHash: string;
|
|
517
|
+
readonly expectedJournalHeadHash?: string;
|
|
518
|
+
readonly observedJournalHeadHash?: string;
|
|
519
|
+
readonly expectedProjectionSetHash?: string;
|
|
520
|
+
readonly observedProjectionSetHash?: string;
|
|
521
|
+
readonly anchorManifestHash?: string;
|
|
522
|
+
readonly failureCode?: EconomyIntegrityFailureCodeV1;
|
|
523
|
+
readonly firstInvalidCommitId?: string;
|
|
524
|
+
readonly firstInvalidRecordId?: string;
|
|
525
|
+
readonly verifiedAt: IsoTimestamp;
|
|
527
526
|
}
|
|
528
527
|
/**
|
|
529
|
-
*
|
|
530
|
-
*
|
|
528
|
+
* Canonical hourly Merkle-root manifest. Signing and storage are deliberately
|
|
529
|
+
* infrastructure responsibilities; this contract contains no private key,
|
|
530
|
+
* signature, storage URI, or administrator-proof claim.
|
|
531
531
|
*/
|
|
532
|
-
interface
|
|
532
|
+
interface EconomyIntegrityAnchorManifestV1 {
|
|
533
533
|
readonly schemaVersion: EconomyContractVersion;
|
|
534
|
-
readonly
|
|
535
|
-
readonly
|
|
536
|
-
readonly
|
|
537
|
-
readonly
|
|
538
|
-
readonly
|
|
539
|
-
readonly
|
|
540
|
-
readonly
|
|
541
|
-
readonly
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
readonly status: PaidLotLifecycleStatusV1;
|
|
550
|
-
readonly version: number;
|
|
551
|
-
readonly receipts: readonly PaidLotLifecycleReceiptV1[];
|
|
552
|
-
readonly effectiveEventIds: readonly string[];
|
|
553
|
-
}
|
|
554
|
-
/** Exact signed projection deltas produced when one receipt is appended. */
|
|
555
|
-
interface PaidLotLifecycleArithmeticV1 {
|
|
556
|
-
readonly retainedDelta: TokenSubunitString;
|
|
557
|
-
readonly heldDelta: TokenSubunitString;
|
|
558
|
-
readonly reversedDelta: TokenSubunitString;
|
|
559
|
-
readonly refundedDelta: TokenSubunitString;
|
|
560
|
-
readonly chargebackDelta: TokenSubunitString;
|
|
561
|
-
readonly oneTimeReversalDelta: TokenSubunitString;
|
|
562
|
-
}
|
|
563
|
-
interface PaidLotLifecycleMutationResultV1 {
|
|
564
|
-
readonly lifecycle: PaidLotLifecycleV1;
|
|
565
|
-
/** False only for an exact event-ID replay already recorded. */
|
|
566
|
-
readonly applied: boolean;
|
|
567
|
-
readonly stateChanged: boolean;
|
|
568
|
-
readonly arithmetic: PaidLotLifecycleArithmeticV1;
|
|
569
|
-
}
|
|
570
|
-
/** Validates the paid purchase facts paired with a source lot. */
|
|
571
|
-
declare function assertPaidLotPurchaseProvenance(provenance: PaidLotPurchaseProvenanceV1): void;
|
|
572
|
-
/** Validates one provider-neutral paid-lot lifecycle event. */
|
|
573
|
-
declare function assertPaidLotLifecycleEvent(event: PaidLotLifecycleEventV1): void;
|
|
574
|
-
/** Validates and deterministically rebuilds retained paid-lot arithmetic. */
|
|
575
|
-
declare function assertPaidLotLifecycle(lifecycle: PaidLotLifecycleV1): void;
|
|
576
|
-
/** Creates the retained projection for one newly credited paid source lot. */
|
|
577
|
-
declare function createPaidLotLifecycle(lot: SourceLotV1, provenance: PaidLotPurchaseProvenanceV1): PaidLotLifecycleV1;
|
|
534
|
+
readonly anchorId: string;
|
|
535
|
+
readonly authorityId: string;
|
|
536
|
+
readonly firstCommitSequence: string;
|
|
537
|
+
readonly lastCommitSequence: string;
|
|
538
|
+
readonly leafCount: string;
|
|
539
|
+
readonly merkleRootHash: string;
|
|
540
|
+
readonly authorityHeadHash: string;
|
|
541
|
+
readonly producedAt: IsoTimestamp;
|
|
542
|
+
}
|
|
543
|
+
/** Validates one create-only or optimistic conditional-replace reference. */
|
|
544
|
+
declare function assertEconomyAuthorityRecordReference(reference: EconomyAuthorityRecordReferenceV1): void;
|
|
545
|
+
/** Validates one immutable authority commit manifest. */
|
|
546
|
+
declare function assertEconomyAuthorityCommitManifest(manifest: EconomyAuthorityCommitManifestV1): void;
|
|
547
|
+
/** Validates an empty or populated singleton authority head. */
|
|
548
|
+
declare function assertEconomyAuthorityHead(head: EconomyAuthorityHeadV1): void;
|
|
578
549
|
/**
|
|
579
|
-
*
|
|
580
|
-
*
|
|
550
|
+
* Proves that a canonical manifest advances the locked singleton authority
|
|
551
|
+
* head by exactly one sequence and returns the compare-and-swap replacement.
|
|
581
552
|
*/
|
|
582
|
-
declare function
|
|
583
|
-
/**
|
|
584
|
-
declare function
|
|
585
|
-
/**
|
|
586
|
-
declare function
|
|
553
|
+
declare function advanceEconomyAuthorityHead(head: EconomyAuthorityHeadV1, manifest: EconomyAuthorityCommitManifestV1, manifestCanonicalHash: string): EconomyAuthorityHeadV1;
|
|
554
|
+
/** Validates one append-only result from a bounded integrity check. */
|
|
555
|
+
declare function assertEconomyIntegrityVerificationReceipt(receipt: EconomyIntegrityVerificationReceiptV1): void;
|
|
556
|
+
/** Validates one canonical hourly Merkle-root manifest. */
|
|
557
|
+
declare function assertEconomyIntegrityAnchorManifest(manifest: EconomyIntegrityAnchorManifestV1): void;
|
|
558
|
+
/** Produces deterministic UTF-8 JSON for a singleton authority head. */
|
|
559
|
+
declare function canonicalEconomyAuthorityHeadPayload(head: EconomyAuthorityHeadV1): string;
|
|
560
|
+
/** Produces deterministic UTF-8 JSON for an authority commit manifest. */
|
|
561
|
+
declare function canonicalEconomyAuthorityCommitManifestPayload(manifest: EconomyAuthorityCommitManifestV1): string;
|
|
562
|
+
/** Produces deterministic UTF-8 JSON for an integrity-verification receipt. */
|
|
563
|
+
declare function canonicalEconomyIntegrityVerificationReceiptPayload(receipt: EconomyIntegrityVerificationReceiptV1): string;
|
|
564
|
+
/** Produces deterministic UTF-8 JSON for an hourly integrity anchor. */
|
|
565
|
+
declare function canonicalEconomyIntegrityAnchorManifestPayload(manifest: EconomyIntegrityAnchorManifestV1): string;
|
|
566
|
+
/**
|
|
567
|
+
* Proves that a reopening manifest binds a successful verification receipt.
|
|
568
|
+
* The consuming service remains responsible for its maximum allowed age.
|
|
569
|
+
*/
|
|
570
|
+
declare function assertEconomyAuthorityRecoveryEvidence(manifest: EconomyAuthorityCommitManifestV1, receipt: EconomyIntegrityVerificationReceiptV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): void;
|
|
571
|
+
/**
|
|
572
|
+
* Returns a copy in the canonical record-reference order expected by manifests.
|
|
573
|
+
* Construction helpers may use this before validation; canonicalization itself
|
|
574
|
+
* never silently reorders a malformed manifest.
|
|
575
|
+
*/
|
|
576
|
+
declare function sortEconomyAuthorityRecordReferences(references: readonly EconomyAuthorityRecordReferenceV1[]): readonly EconomyAuthorityRecordReferenceV1[];
|
|
587
577
|
|
|
588
578
|
type WalletKind = "household-treasury" | "personal" | "gameplay-allocation" | "hold" | "purchase-clearing" | "provider-clearing" | "system";
|
|
589
579
|
type WalletStatus = "active" | "restricted" | "closed";
|
|
@@ -753,115 +743,808 @@ interface EconomyOutboxEventV1 {
|
|
|
753
743
|
readonly payloadHash: string;
|
|
754
744
|
readonly occurredAt: IsoTimestamp;
|
|
755
745
|
}
|
|
756
|
-
interface PersistedIdempotencyResultV1 {
|
|
757
|
-
readonly transactionId: TransactionId;
|
|
758
|
-
readonly responseHash: string;
|
|
759
|
-
readonly recordedAt: IsoTimestamp;
|
|
746
|
+
interface PersistedIdempotencyResultV1 {
|
|
747
|
+
readonly transactionId: TransactionId;
|
|
748
|
+
readonly responseHash: string;
|
|
749
|
+
readonly recordedAt: IsoTimestamp;
|
|
750
|
+
}
|
|
751
|
+
/** Exact actor/subject/operation namespace for a caller-owned idempotency key. */
|
|
752
|
+
interface EconomyIdempotencyScopeV1 {
|
|
753
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
754
|
+
readonly idempotencyKey: string;
|
|
755
|
+
readonly commandType: EconomyCommandType;
|
|
756
|
+
readonly actorAccountId: AccountId;
|
|
757
|
+
readonly subjectAccountId: AccountId;
|
|
758
|
+
}
|
|
759
|
+
/** V2 replay evidence bound to one accepted command and exact scope. */
|
|
760
|
+
interface ScopedPersistedIdempotencyResultV1 extends PersistedIdempotencyResultV1 {
|
|
761
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
762
|
+
readonly commandId: string;
|
|
763
|
+
}
|
|
764
|
+
/** Validates replay evidence before it is returned across a command boundary. */
|
|
765
|
+
declare function assertScopedPersistedIdempotencyResult(result: ScopedPersistedIdempotencyResultV1): void;
|
|
766
|
+
/** Validates the namespace that prevents cross-principal replay collisions. */
|
|
767
|
+
declare function assertEconomyIdempotencyScope(scope: EconomyIdempotencyScopeV1): void;
|
|
768
|
+
/** Validates minimized accepted-command evidence before durable append. */
|
|
769
|
+
declare function assertEconomyCommandEnvelope(envelope: EconomyCommandEnvelopeV1): void;
|
|
770
|
+
/** Validates one immutable command-workflow state event. */
|
|
771
|
+
declare function assertEconomyCommandWorkflowEvent(event: EconomyCommandWorkflowEventV1): void;
|
|
772
|
+
/** Operations available only inside one serializable database transaction. */
|
|
773
|
+
interface EconomyUnitOfWork {
|
|
774
|
+
getWalletForUpdate(walletId: WalletId): Promise<WalletV1 | null>;
|
|
775
|
+
listSpendableLotsForUpdate(walletId: WalletId): Promise<readonly SourceLotV1[]>;
|
|
776
|
+
findLotForUpdate(lotId: LotId): Promise<SourceLotV1 | null>;
|
|
777
|
+
findIdempotencyResult(idempotencyKey: string): Promise<PersistedIdempotencyResultV1 | null>;
|
|
778
|
+
appendTransaction(transaction: LedgerTransactionV1): Promise<void>;
|
|
779
|
+
appendSourceLot(lot: SourceLotV1): Promise<void>;
|
|
780
|
+
updateSourceLotProjection(lotId: LotId, remainingAmount: TokenSubunitString, heldAmount: TokenSubunitString, reversedAmount: TokenSubunitString): Promise<void>;
|
|
781
|
+
saveBalanceProjection(projection: BalanceProjection, transactionId: TransactionId): Promise<void>;
|
|
782
|
+
saveIdempotencyResult(idempotencyKey: string, result: PersistedIdempotencyResultV1): Promise<void>;
|
|
783
|
+
appendOutboxEvent(event: EconomyOutboxEventV1): Promise<void>;
|
|
784
|
+
}
|
|
785
|
+
/** Adapter boundary for serializable, ACID economy mutations. */
|
|
786
|
+
interface EconomyPersistencePort {
|
|
787
|
+
runSerializable<T>(operation: (unitOfWork: EconomyUnitOfWork) => Promise<T>): Promise<T>;
|
|
788
|
+
getWallet(walletId: WalletId): Promise<WalletV1 | null>;
|
|
789
|
+
getBalanceProjection(walletId: WalletId): Promise<BalanceProjectionSnapshotV1 | null>;
|
|
790
|
+
getTransaction(transactionId: TransactionId): Promise<LedgerTransactionV1 | null>;
|
|
791
|
+
rebuildProjection(): Promise<BalanceProjection>;
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
* V2 mutation surface. Unlike `EconomyUnitOfWork`, it has no absolute balance
|
|
795
|
+
* overwrite: journal, source-lot movement, allocation state, balance/lifetime
|
|
796
|
+
* deltas, idempotency, chain head, and outbox are committed atomically.
|
|
797
|
+
*/
|
|
798
|
+
interface EconomyUnitOfWorkV2 {
|
|
799
|
+
getWalletForOwnerForUpdate(walletId: WalletId, owner: WalletOwnerReferenceV1): Promise<WalletV1 | null>;
|
|
800
|
+
listSpendableLotsForUpdate(walletId: WalletId): Promise<readonly VersionedSourceLotV1[]>;
|
|
801
|
+
findLotForUpdate(lotId: LotId): Promise<VersionedSourceLotV1 | null>;
|
|
802
|
+
getGameplayAllocationForUpdate(allocationId: AllocationId, householdId: HouseholdId, childAccountId: AccountId): Promise<GameplayAllocationV1 | null>;
|
|
803
|
+
findIdempotencyResult(scope: EconomyIdempotencyScopeV1): Promise<ScopedPersistedIdempotencyResultV1 | null>;
|
|
804
|
+
/** Locks and rejects any stale/non-active regional writer lease. */
|
|
805
|
+
lockActiveWriterFence(acceptedRegion: string, writerFencingToken: string): Promise<void>;
|
|
806
|
+
lockJournalChainHead(chainId: string): Promise<JournalChainHeadV1>;
|
|
807
|
+
appendCommandEnvelope(envelope: EconomyCommandEnvelopeV1): Promise<void>;
|
|
808
|
+
appendCommandWorkflowEvent(event: EconomyCommandWorkflowEventV1): Promise<void>;
|
|
809
|
+
appendTransaction(transaction: ChainedEconomicJournalTransactionV1): Promise<void>;
|
|
810
|
+
/** Appends `createInitialSourceLotSnapshot()` output; later changes are movements. */
|
|
811
|
+
appendSourceLot(snapshot: VersionedSourceLotV1): Promise<void>;
|
|
812
|
+
/** Appends movement evidence and applies its lot CAS as one operation. */
|
|
813
|
+
applySourceLotMovement(movement: SourceLotMovementV1): Promise<void>;
|
|
814
|
+
appendGameplayAllocation(allocation: GameplayAllocationV1): Promise<void>;
|
|
815
|
+
/**
|
|
816
|
+
* Compares `expectedVersion`, requires `allocation.version` to be exactly the
|
|
817
|
+
* next value, and never overwrites a stale row.
|
|
818
|
+
*/
|
|
819
|
+
saveGameplayAllocation(allocation: GameplayAllocationV1, expectedVersion: number): Promise<void>;
|
|
820
|
+
/**
|
|
821
|
+
* Atomically adds deltas, verifies them against the appended postings and
|
|
822
|
+
* account bindings, and records transaction-scoped application keys.
|
|
823
|
+
*/
|
|
824
|
+
applyWalletBalanceDeltas(transactionId: TransactionId, deltas: readonly WalletBalanceDeltaV1[]): Promise<void>;
|
|
825
|
+
/**
|
|
826
|
+
* Atomically increments monotonic lifetime counters after verifying the
|
|
827
|
+
* deltas against the appended transaction's deterministic classification.
|
|
828
|
+
*/
|
|
829
|
+
applyWalletLifetimeDeltas(transactionId: TransactionId, deltas: readonly WalletLifetimeDeltaV1[]): Promise<void>;
|
|
830
|
+
saveIdempotencyResult(scope: EconomyIdempotencyScopeV1, result: ScopedPersistedIdempotencyResultV1): Promise<void>;
|
|
831
|
+
appendOutboxEvent(event: EconomyOutboxEventV1): Promise<void>;
|
|
832
|
+
/** Compare-and-swaps the full locked head, including its canonical hash. */
|
|
833
|
+
advanceJournalChainHead(expected: JournalChainHeadV1, next: JournalChainHeadV1): Promise<void>;
|
|
834
|
+
}
|
|
835
|
+
/**
|
|
836
|
+
* Additive authoritative persistence boundary for new consumers. V1 remains
|
|
837
|
+
* exported for compatibility but must not be adapted by delegating its
|
|
838
|
+
* absolute `saveBalanceProjection` operation to this interface.
|
|
839
|
+
*/
|
|
840
|
+
interface EconomyPersistencePortV2 {
|
|
841
|
+
runSerializable<T>(operation: (unitOfWork: EconomyUnitOfWorkV2) => Promise<T>): Promise<T>;
|
|
842
|
+
getWallet(walletId: WalletId): Promise<WalletV1 | null>;
|
|
843
|
+
listWalletsByOwner(owner: WalletOwnerReferenceV1): Promise<readonly WalletV1[]>;
|
|
844
|
+
getGameplayAllocation(allocationId: AllocationId, householdId: HouseholdId, childAccountId: AccountId): Promise<GameplayAllocationV1 | null>;
|
|
845
|
+
getCommandEnvelope(commandId: string): Promise<EconomyCommandEnvelopeV1 | null>;
|
|
846
|
+
getTransaction(transactionId: TransactionId): Promise<ChainedEconomicJournalTransactionV1 | null>;
|
|
847
|
+
rebuildWalletBalanceProjections(): Promise<readonly WalletBalanceProjectionV1[]>;
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* V3 journal transaction whose legacy canonical `idempotencyKey` slot carries
|
|
851
|
+
* the HMAC digest, never the raw HTTP Idempotency-Key. The wire field remains
|
|
852
|
+
* unchanged so published transaction canonical bytes stay compatible.
|
|
853
|
+
*/
|
|
854
|
+
type AuditedChainedEconomicJournalTransactionV1 = Omit<ChainedEconomicJournalTransactionV1, "idempotencyKey"> & {
|
|
855
|
+
readonly idempotencyKey: EconomyHmacSha256DigestV1;
|
|
856
|
+
};
|
|
857
|
+
/**
|
|
858
|
+
* Additive audit-capable mutation surface.
|
|
859
|
+
*
|
|
860
|
+
* First-party commands append acceptance, economic result, projections,
|
|
861
|
+
* idempotency result, outbox, authority manifest, and authority-head CAS in one
|
|
862
|
+
* serializable unit. Provider workflows use one unit for verified durable
|
|
863
|
+
* acceptance and a second unit for the reconciled economic result.
|
|
864
|
+
*/
|
|
865
|
+
type EconomyUnitOfWorkV3 = Omit<EconomyUnitOfWorkV2, "appendCommandEnvelope" | "findIdempotencyResult" | "saveIdempotencyResult" | "appendTransaction"> & {
|
|
866
|
+
findAuditedIdempotencyResult(scope: EconomyAuditedIdempotencyScopeV1): Promise<EconomyAuditedIdempotencyResultV1 | null>;
|
|
867
|
+
lockAuthorityHead(authorityId: string): Promise<EconomyAuthorityHeadV1>;
|
|
868
|
+
appendCommandEnvelope(envelope: AuditedEconomyCommandEnvelopeV1): Promise<void>;
|
|
869
|
+
appendProviderEvidenceManifest(manifest: EconomyProviderEvidenceManifestV1): Promise<void>;
|
|
870
|
+
appendProviderEvidence(evidence: EconomyProviderEvidenceHashV1): Promise<void>;
|
|
871
|
+
appendEncryptedOperationalHandleBinding(binding: EconomyEncryptedOperationalHandleBindingV1): Promise<void>;
|
|
872
|
+
appendAcceptedCommandReceipt(receipt: EconomyAcceptedCommandReceiptV1): Promise<void>;
|
|
873
|
+
appendCommandResultReceipt(receipt: EconomyCommandResultReceiptV1): Promise<void>;
|
|
874
|
+
appendTransaction(transaction: AuditedChainedEconomicJournalTransactionV1): Promise<void>;
|
|
875
|
+
saveAuditedIdempotencyResult(scope: EconomyAuditedIdempotencyScopeV1, result: EconomyAuditedIdempotencyResultV1): Promise<void>;
|
|
876
|
+
appendAuthorityCommitManifest(manifest: EconomyAuthorityCommitManifestV1): Promise<void>;
|
|
877
|
+
advanceAuthorityHead(expected: EconomyAuthorityHeadV1, next: EconomyAuthorityHeadV1): Promise<void>;
|
|
878
|
+
appendIntegrityVerificationReceipt(receipt: EconomyIntegrityVerificationReceiptV1): Promise<void>;
|
|
879
|
+
appendIntegrityAnchorManifest(manifest: EconomyIntegrityAnchorManifestV1): Promise<void>;
|
|
880
|
+
};
|
|
881
|
+
/**
|
|
882
|
+
* V3 preserves every V2 economic primitive while making the audit records
|
|
883
|
+
* mandatory capabilities of an authoritative adapter. V1 and V2 remain
|
|
884
|
+
* exported unchanged for existing consumers.
|
|
885
|
+
*/
|
|
886
|
+
type EconomyPersistencePortV3 = Omit<EconomyPersistencePortV2, "runSerializable" | "getCommandEnvelope" | "getTransaction"> & {
|
|
887
|
+
runSerializable<T>(operation: (unitOfWork: EconomyUnitOfWorkV3) => Promise<T>): Promise<T>;
|
|
888
|
+
getCommandEnvelope(commandId: string): Promise<AuditedEconomyCommandEnvelopeV1 | null>;
|
|
889
|
+
getTransaction(transactionId: TransactionId): Promise<AuditedChainedEconomicJournalTransactionV1 | null>;
|
|
890
|
+
getAcceptedCommandReceipt(commandId: string): Promise<EconomyAcceptedCommandReceiptV1 | null>;
|
|
891
|
+
getCommandResultReceipt(commandId: string): Promise<EconomyCommandResultReceiptV1 | null>;
|
|
892
|
+
listProviderEvidence(commandId: string): Promise<readonly EconomyProviderEvidenceHashV1[]>;
|
|
893
|
+
getProviderEvidenceManifest(commandId: string): Promise<EconomyProviderEvidenceManifestV1 | null>;
|
|
894
|
+
listEncryptedOperationalHandleBindings(commandId: string): Promise<readonly EconomyEncryptedOperationalHandleBindingV1[]>;
|
|
895
|
+
getAuthorityHead(authorityId: string): Promise<EconomyAuthorityHeadV1 | null>;
|
|
896
|
+
getAuthorityCommitManifest(commitId: string): Promise<EconomyAuthorityCommitManifestV1 | null>;
|
|
897
|
+
getIntegrityVerificationReceipt(verificationId: string): Promise<EconomyIntegrityVerificationReceiptV1 | null>;
|
|
898
|
+
getIntegrityAnchorManifest(anchorId: string): Promise<EconomyIntegrityAnchorManifestV1 | null>;
|
|
899
|
+
};
|
|
900
|
+
interface EconomyClockPort {
|
|
901
|
+
now(): IsoTimestamp;
|
|
902
|
+
}
|
|
903
|
+
interface EconomyIdPort {
|
|
904
|
+
nextId(namespace: string): string;
|
|
905
|
+
}
|
|
906
|
+
|
|
907
|
+
type EconomyCommandSourceV1 = "browser" | "shopify" | "ayet" | "bitlabs" | "operator" | "system";
|
|
908
|
+
type EconomyCommandProcessingModeV1 = "initial" | "replay";
|
|
909
|
+
type EconomyPrincipalTypeV1 = "account" | "delegated-child" | "service" | "operator";
|
|
910
|
+
type EconomyCausationKindV1 = "provider-event" | "economy-command" | "ledger-transaction" | "workflow-event" | "authority-commit";
|
|
911
|
+
/** One privacy-safe edge in an economy audit correlation graph. */
|
|
912
|
+
interface EconomyCausationReferenceV1 {
|
|
913
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
914
|
+
readonly kind: EconomyCausationKindV1;
|
|
915
|
+
readonly causationId: string;
|
|
916
|
+
}
|
|
917
|
+
type EconomyHmacFingerprintDomainV1 = "economy.idempotency-key.v1" | "economy.provider-event-key.v1" | "economy.provider-object-key.v1" | "economy.provider-payload.v1" | "economy.provider-reconciliation.v1";
|
|
918
|
+
type EconomyHmacSha256DigestV1 = `hmac-sha256:${string}`;
|
|
919
|
+
/**
|
|
920
|
+
* A versioned, domain-separated HMAC fingerprint produced by an approved
|
|
921
|
+
* infrastructure adapter. It is a correlation token, not reversible evidence.
|
|
922
|
+
*/
|
|
923
|
+
interface EconomyHmacFingerprintV1 {
|
|
924
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
925
|
+
readonly fingerprintVersion: "1";
|
|
926
|
+
readonly algorithm: "hmac-sha256";
|
|
927
|
+
readonly domain: EconomyHmacFingerprintDomainV1;
|
|
928
|
+
readonly keyVersion: string;
|
|
929
|
+
readonly digest: EconomyHmacSha256DigestV1;
|
|
930
|
+
}
|
|
931
|
+
/**
|
|
932
|
+
* Hashes of sanitized authorization-decision manifests. The manifests must
|
|
933
|
+
* contain no raw tokens, capability payloads, session IDs, or personal data.
|
|
934
|
+
*/
|
|
935
|
+
interface EconomyAuthorizationEvidenceV1 {
|
|
936
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
937
|
+
readonly capabilityEvidenceHash: string;
|
|
938
|
+
readonly featureFlagEvidenceHash: string;
|
|
939
|
+
readonly assuranceEvidenceHash: string;
|
|
940
|
+
readonly authenticatedAt: IsoTimestamp;
|
|
941
|
+
readonly authorizedAt: IsoTimestamp;
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* Privacy-minimized command facts for the authoritative V3 boundary.
|
|
945
|
+
*
|
|
946
|
+
* This is deliberately standalone rather than extending
|
|
947
|
+
* `EconomyCommandEnvelopeV1`: the published legacy envelope contains a raw
|
|
948
|
+
* caller idempotency key, which must never enter new audit storage.
|
|
949
|
+
*/
|
|
950
|
+
interface AuditedEconomyCommandEnvelopeV1 {
|
|
951
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
952
|
+
readonly commandId: string;
|
|
953
|
+
readonly commandType: EconomyCommandType;
|
|
954
|
+
readonly commandSource: EconomyCommandSourceV1;
|
|
955
|
+
readonly idempotencyFingerprint: EconomyHmacFingerprintV1;
|
|
956
|
+
readonly actorAccountId: AccountId;
|
|
957
|
+
readonly subjectAccountId: AccountId;
|
|
958
|
+
readonly principalType: EconomyPrincipalTypeV1;
|
|
959
|
+
readonly relationshipId?: string;
|
|
960
|
+
readonly authorizationVersion?: number;
|
|
961
|
+
readonly authorizationEvidence: EconomyAuthorizationEvidenceV1;
|
|
962
|
+
readonly routeId: string;
|
|
963
|
+
readonly buildId: string;
|
|
964
|
+
readonly correlationId: string;
|
|
965
|
+
readonly causation?: EconomyCausationReferenceV1;
|
|
966
|
+
/**
|
|
967
|
+
* SHA-256 of the canonical, already-sanitized semantic command payload.
|
|
968
|
+
* Provider callback bytes use an HMAC fingerprint instead.
|
|
969
|
+
*/
|
|
970
|
+
readonly payloadHash: string;
|
|
971
|
+
readonly providerEvidenceManifestHash?: string;
|
|
972
|
+
readonly acceptedAt: IsoTimestamp;
|
|
973
|
+
readonly acceptedRegion: string;
|
|
974
|
+
readonly writerFencingToken: string;
|
|
975
|
+
}
|
|
976
|
+
type EconomyAcquisitionProviderV1 = "shopify" | "ayet" | "bitlabs";
|
|
977
|
+
/**
|
|
978
|
+
* Privacy-minimized verified provider evidence. Every value derived from a raw
|
|
979
|
+
* provider identifier or callback body is represented by a domain-separated
|
|
980
|
+
* HMAC fingerprint. Signatures and payment data have no storage field.
|
|
981
|
+
*/
|
|
982
|
+
interface EconomyProviderEvidenceHashV1 {
|
|
983
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
984
|
+
/** Opaque internal identifier; never the provider's event identifier. */
|
|
985
|
+
readonly providerEventId: ProviderEventId;
|
|
986
|
+
readonly commandId: string;
|
|
987
|
+
readonly provider: EconomyAcquisitionProviderV1;
|
|
988
|
+
readonly providerObjectKeyFingerprint?: EconomyHmacFingerprintV1;
|
|
989
|
+
readonly providerEventKeyFingerprint: EconomyHmacFingerprintV1;
|
|
990
|
+
readonly eventType: string;
|
|
991
|
+
readonly payloadFingerprint: EconomyHmacFingerprintV1;
|
|
992
|
+
readonly reconciliationEvidenceFingerprint?: EconomyHmacFingerprintV1;
|
|
993
|
+
readonly signatureScheme: string;
|
|
994
|
+
readonly signatureVerifiedAt: IsoTimestamp;
|
|
995
|
+
readonly providerOccurredAt?: IsoTimestamp;
|
|
996
|
+
readonly receivedAt: IsoTimestamp;
|
|
997
|
+
readonly operationalHandleBindingId?: string;
|
|
998
|
+
}
|
|
999
|
+
type EconomyOperationalHandlePurposeV1 = "reconciliation" | "refund" | "dispute";
|
|
1000
|
+
/**
|
|
1001
|
+
* Ledger-side binding for a provider handle encrypted and retained by the
|
|
1002
|
+
* consuming site. The ciphertext, nonce, authentication tag, and key URI are
|
|
1003
|
+
* not package fields; only hashes and non-secret cryptographic metadata bind
|
|
1004
|
+
* the external sealed record.
|
|
1005
|
+
*/
|
|
1006
|
+
interface EconomyEncryptedOperationalHandleBindingV1 {
|
|
1007
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1008
|
+
readonly handleBindingId: string;
|
|
1009
|
+
readonly commandId: string;
|
|
1010
|
+
readonly provider: EconomyAcquisitionProviderV1;
|
|
1011
|
+
readonly purpose: EconomyOperationalHandlePurposeV1;
|
|
1012
|
+
readonly cipherSuite: "AES-256-GCM";
|
|
1013
|
+
readonly keyVersion: string;
|
|
1014
|
+
readonly ciphertextContentHash: string;
|
|
1015
|
+
readonly encryptionContextHash: string;
|
|
1016
|
+
readonly createdAt: IsoTimestamp;
|
|
1017
|
+
}
|
|
1018
|
+
/** One canonical content reference inside a sanitized evidence manifest. */
|
|
1019
|
+
interface EconomyEvidenceRecordReferenceV1 {
|
|
1020
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1021
|
+
readonly recordId: string;
|
|
1022
|
+
readonly contentHash: string;
|
|
1023
|
+
}
|
|
1024
|
+
/**
|
|
1025
|
+
* Sanitized manifest bound by an audited provider command. Its referenced
|
|
1026
|
+
* records contain HMAC fingerprints, never raw provider material.
|
|
1027
|
+
*/
|
|
1028
|
+
interface EconomyProviderEvidenceManifestV1 {
|
|
1029
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1030
|
+
readonly evidenceManifestId: string;
|
|
1031
|
+
readonly commandId: string;
|
|
1032
|
+
readonly provider: EconomyAcquisitionProviderV1;
|
|
1033
|
+
readonly evidenceReferences: readonly EconomyEvidenceRecordReferenceV1[];
|
|
1034
|
+
readonly operationalHandleReferences: readonly EconomyEvidenceRecordReferenceV1[];
|
|
1035
|
+
readonly createdAt: IsoTimestamp;
|
|
1036
|
+
}
|
|
1037
|
+
/** Privacy-safe acknowledgement returned after durable command acceptance. */
|
|
1038
|
+
interface EconomyAcceptedCommandReceiptV1 {
|
|
1039
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1040
|
+
readonly receiptId: string;
|
|
1041
|
+
readonly commandId: string;
|
|
1042
|
+
readonly correlationId: string;
|
|
1043
|
+
readonly commandEnvelopeHash: string;
|
|
1044
|
+
readonly acceptedAt: IsoTimestamp;
|
|
1045
|
+
}
|
|
1046
|
+
type EconomyCommandResultOutcomeV1 = "completed" | "failed" | "no-op";
|
|
1047
|
+
/**
|
|
1048
|
+
* Immutable terminal receipt. A completed result binds one journal
|
|
1049
|
+
* transaction, a failed result binds one safe failure code, and a no-op binds
|
|
1050
|
+
* one safe reason proving that no economic transaction was required.
|
|
1051
|
+
*/
|
|
1052
|
+
interface EconomyCommandResultReceiptV1 {
|
|
1053
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1054
|
+
readonly receiptId: string;
|
|
1055
|
+
readonly commandId: string;
|
|
1056
|
+
readonly correlationId: string;
|
|
1057
|
+
readonly acceptedReceiptId: string;
|
|
1058
|
+
readonly commandEnvelopeHash: string;
|
|
1059
|
+
readonly outcome: EconomyCommandResultOutcomeV1;
|
|
1060
|
+
readonly resultHash: string;
|
|
1061
|
+
readonly transactionId?: TransactionId;
|
|
1062
|
+
readonly transactionCanonicalHash?: string;
|
|
1063
|
+
readonly failureCode?: string;
|
|
1064
|
+
readonly noOpCode?: string;
|
|
1065
|
+
readonly recordedAt: IsoTimestamp;
|
|
1066
|
+
}
|
|
1067
|
+
/** Raw-key-free actor/subject namespace used by authoritative V3 replay. */
|
|
1068
|
+
interface EconomyAuditedIdempotencyScopeV1 {
|
|
1069
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1070
|
+
readonly idempotencyFingerprint: EconomyHmacFingerprintV1;
|
|
1071
|
+
readonly commandType: EconomyCommandType;
|
|
1072
|
+
readonly actorAccountId: AccountId;
|
|
1073
|
+
readonly subjectAccountId: AccountId;
|
|
1074
|
+
readonly principalType: EconomyPrincipalTypeV1;
|
|
1075
|
+
readonly relationshipId?: string;
|
|
1076
|
+
readonly authorizationVersion?: number;
|
|
1077
|
+
}
|
|
1078
|
+
type EconomyAuditedIdempotencyStateV1 = "accepted" | EconomyCommandResultOutcomeV1;
|
|
1079
|
+
/**
|
|
1080
|
+
* Persisted V3 replay result. The adapter returns this record for an exact
|
|
1081
|
+
* canonical scope match; a fingerprint collision with different canonical
|
|
1082
|
+
* command bytes is a security conflict, never a replay.
|
|
1083
|
+
*/
|
|
1084
|
+
interface EconomyAuditedIdempotencyResultV1 {
|
|
1085
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1086
|
+
readonly commandId: string;
|
|
1087
|
+
readonly commandEnvelopeHash: string;
|
|
1088
|
+
readonly acceptedReceiptId: string;
|
|
1089
|
+
readonly resultReceiptId?: string;
|
|
1090
|
+
readonly state: EconomyAuditedIdempotencyStateV1;
|
|
1091
|
+
readonly responseHash: string;
|
|
1092
|
+
readonly recordedAt: IsoTimestamp;
|
|
1093
|
+
}
|
|
1094
|
+
type EconomyCommandProcessingDispositionV1 = {
|
|
1095
|
+
readonly mode: "initial";
|
|
1096
|
+
} | {
|
|
1097
|
+
readonly mode: "replay";
|
|
1098
|
+
readonly result: EconomyAuditedIdempotencyResultV1;
|
|
1099
|
+
};
|
|
1100
|
+
/** Validates a domain-separated HMAC fingerprint and its expected domain. */
|
|
1101
|
+
declare function assertEconomyHmacFingerprint(fingerprint: EconomyHmacFingerprintV1, expectedDomain?: EconomyHmacFingerprintDomainV1): void;
|
|
1102
|
+
/** Validates hashes of a sanitized, server-derived authorization decision. */
|
|
1103
|
+
declare function assertEconomyAuthorizationEvidence(evidence: EconomyAuthorizationEvidenceV1): void;
|
|
1104
|
+
/** Validates a fingerprint-only, server-derived authoritative command. */
|
|
1105
|
+
declare function assertAuditedEconomyCommandEnvelope(envelope: AuditedEconomyCommandEnvelopeV1): void;
|
|
1106
|
+
/** Validates privacy-minimized provider evidence before immutable append. */
|
|
1107
|
+
declare function assertEconomyProviderEvidenceHash(evidence: EconomyProviderEvidenceHashV1): void;
|
|
1108
|
+
/** Validates a ledger binding for site-owned encrypted provider state. */
|
|
1109
|
+
declare function assertEconomyEncryptedOperationalHandleBinding(binding: EconomyEncryptedOperationalHandleBindingV1): void;
|
|
1110
|
+
/** Validates a canonical sanitized provider-evidence manifest. */
|
|
1111
|
+
declare function assertEconomyProviderEvidenceManifest(manifest: EconomyProviderEvidenceManifestV1): void;
|
|
1112
|
+
/** Validates a client-safe durable-acceptance receipt. */
|
|
1113
|
+
declare function assertEconomyAcceptedCommandReceipt(receipt: EconomyAcceptedCommandReceiptV1): void;
|
|
1114
|
+
/** Validates the exclusive completed, failed, and no-op result shapes. */
|
|
1115
|
+
declare function assertEconomyCommandResultReceipt(receipt: EconomyCommandResultReceiptV1): void;
|
|
1116
|
+
/** Validates the raw-key-free idempotency namespace used by V3. */
|
|
1117
|
+
declare function assertEconomyAuditedIdempotencyScope(scope: EconomyAuditedIdempotencyScopeV1): void;
|
|
1118
|
+
/** Validates an exact accepted or terminal V3 replay result. */
|
|
1119
|
+
declare function assertEconomyAuditedIdempotencyResult(result: EconomyAuditedIdempotencyResultV1): void;
|
|
1120
|
+
/**
|
|
1121
|
+
* Produces deterministic UTF-8 JSON for an audited-command hash adapter.
|
|
1122
|
+
* The legacy transaction canonical payload remains a separate stable format.
|
|
1123
|
+
*/
|
|
1124
|
+
declare function canonicalAuditedEconomyCommandEnvelopePayload(envelope: AuditedEconomyCommandEnvelopeV1): string;
|
|
1125
|
+
/** Produces deterministic UTF-8 JSON for privacy-minimized provider evidence. */
|
|
1126
|
+
declare function canonicalEconomyProviderEvidenceHashPayload(evidence: EconomyProviderEvidenceHashV1): string;
|
|
1127
|
+
/** Produces deterministic UTF-8 JSON for an encrypted-handle binding. */
|
|
1128
|
+
declare function canonicalEconomyEncryptedOperationalHandleBindingPayload(binding: EconomyEncryptedOperationalHandleBindingV1): string;
|
|
1129
|
+
/** Produces deterministic UTF-8 JSON for a sanitized evidence manifest. */
|
|
1130
|
+
declare function canonicalEconomyProviderEvidenceManifestPayload(manifest: EconomyProviderEvidenceManifestV1): string;
|
|
1131
|
+
/** Produces deterministic UTF-8 JSON for a privacy-safe accepted receipt. */
|
|
1132
|
+
declare function canonicalEconomyAcceptedCommandReceiptPayload(receipt: EconomyAcceptedCommandReceiptV1): string;
|
|
1133
|
+
/** Produces deterministic UTF-8 JSON for a terminal command receipt. */
|
|
1134
|
+
declare function canonicalEconomyCommandResultReceiptPayload(receipt: EconomyCommandResultReceiptV1): string;
|
|
1135
|
+
/**
|
|
1136
|
+
* Rejects a replay candidate unless every canonical accepted-command byte
|
|
1137
|
+
* matches. Processing mode is intentionally external to the envelope, so the
|
|
1138
|
+
* original command source remains unchanged on replay.
|
|
1139
|
+
*/
|
|
1140
|
+
declare function assertExactAuditedEconomyCommandReplay(existing: AuditedEconomyCommandEnvelopeV1, candidate: AuditedEconomyCommandEnvelopeV1): void;
|
|
1141
|
+
|
|
1142
|
+
/** Complete bounded record graph for one accepted authoritative command. */
|
|
1143
|
+
interface EconomyAuditGraphV1 {
|
|
1144
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1145
|
+
readonly commandEnvelope: AuditedEconomyCommandEnvelopeV1;
|
|
1146
|
+
readonly commandEnvelopeHash: string;
|
|
1147
|
+
readonly providerEvidenceManifest?: EconomyProviderEvidenceManifestV1;
|
|
1148
|
+
readonly providerEvidence: readonly EconomyProviderEvidenceHashV1[];
|
|
1149
|
+
readonly operationalHandleBindings: readonly EconomyEncryptedOperationalHandleBindingV1[];
|
|
1150
|
+
readonly acceptedReceipt: EconomyAcceptedCommandReceiptV1;
|
|
1151
|
+
readonly resultReceipt?: EconomyCommandResultReceiptV1;
|
|
1152
|
+
readonly transaction?: EconomicJournalTransactionV1 & {
|
|
1153
|
+
readonly canonicalHash: string;
|
|
1154
|
+
};
|
|
1155
|
+
readonly startAuthorityHead: EconomyAuthorityHeadV1;
|
|
1156
|
+
readonly commits: readonly HashedEconomyAuthorityCommitManifestV1[];
|
|
1157
|
+
readonly expectedAuthorityHead: EconomyAuthorityHeadV1;
|
|
1158
|
+
}
|
|
1159
|
+
/**
|
|
1160
|
+
* Validates every actor/subject, evidence, receipt, transaction, record, and
|
|
1161
|
+
* authority-chain edge for one bounded command graph.
|
|
1162
|
+
*
|
|
1163
|
+
* The callback must hash exact canonical UTF-8 bytes using approved SHA-256.
|
|
1164
|
+
* Raw provider data and idempotency keys are neither accepted nor reconstructed.
|
|
1165
|
+
*/
|
|
1166
|
+
declare function assertEconomyAuditGraph(graph: EconomyAuditGraphV1, hash: CanonicalPayloadHashFunctionV1): void;
|
|
1167
|
+
|
|
1168
|
+
declare const PRE_UTILITY_BACKER_COHORT: "pre_utility_backer_v1";
|
|
1169
|
+
interface EarlyBackerWindowV1 {
|
|
1170
|
+
readonly publicTokensLaunchAt: IsoTimestamp;
|
|
1171
|
+
readonly firstPublicSpendLiveAt?: IsoTimestamp;
|
|
1172
|
+
}
|
|
1173
|
+
/** Paid-lot facts required to recalculate retained early-backer basis. */
|
|
1174
|
+
interface PaidLotRetentionV1 {
|
|
1175
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1176
|
+
readonly lotId: LotId;
|
|
1177
|
+
readonly payerAccountId: AccountId;
|
|
1178
|
+
readonly receivingHouseholdId: HouseholdId;
|
|
1179
|
+
readonly purchaseId: string;
|
|
1180
|
+
readonly catalogVersion: string;
|
|
1181
|
+
readonly purchasedAt: IsoTimestamp;
|
|
1182
|
+
readonly settledAt: IsoTimestamp;
|
|
1183
|
+
readonly creditedAt: IsoTimestamp;
|
|
1184
|
+
readonly retainedAmount: TokenSubunitString;
|
|
1185
|
+
}
|
|
1186
|
+
interface EarlyBackerEvaluationV1 {
|
|
1187
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1188
|
+
readonly cohortKey: typeof PRE_UTILITY_BACKER_COHORT;
|
|
1189
|
+
readonly status: "not-qualified" | "provisional";
|
|
1190
|
+
readonly payerAccountId: AccountId;
|
|
1191
|
+
readonly receivingHouseholdId: HouseholdId;
|
|
1192
|
+
readonly netRetainedAmount: TokenSubunitString;
|
|
1193
|
+
readonly contributingLotIds: readonly LotId[];
|
|
1194
|
+
readonly evaluatedAt: IsoTimestamp;
|
|
1195
|
+
}
|
|
1196
|
+
declare const EARLY_BACKER_SETTLEMENT_POLICY_V2: "settlement-window-v2";
|
|
1197
|
+
/**
|
|
1198
|
+
* Additive evaluation result using settlement as the sole qualification event.
|
|
1199
|
+
* Purchase and credit times remain provenance/order facts.
|
|
1200
|
+
*/
|
|
1201
|
+
interface EarlyBackerEvaluationV2 {
|
|
1202
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1203
|
+
readonly policyVersion: typeof EARLY_BACKER_SETTLEMENT_POLICY_V2;
|
|
1204
|
+
readonly qualificationEvent: "settled-at";
|
|
1205
|
+
readonly cohortKey: typeof PRE_UTILITY_BACKER_COHORT;
|
|
1206
|
+
readonly status: "not-qualified" | "provisional";
|
|
1207
|
+
readonly payerAccountId: AccountId;
|
|
1208
|
+
readonly receivingHouseholdId: HouseholdId;
|
|
1209
|
+
readonly netRetainedAmount: TokenSubunitString;
|
|
1210
|
+
readonly contributingLotIds: readonly LotId[];
|
|
1211
|
+
readonly evaluatedAt: IsoTimestamp;
|
|
1212
|
+
}
|
|
1213
|
+
/**
|
|
1214
|
+
* Recalculates provisional cohort basis from retained paid lots. It promises no
|
|
1215
|
+
* future reward and deliberately has no permanent entitled state.
|
|
1216
|
+
*/
|
|
1217
|
+
declare function evaluateEarlyBacker(payerAccountId: AccountId, receivingHouseholdId: HouseholdId, paidLots: readonly PaidLotRetentionV1[], window: EarlyBackerWindowV1, evaluatedAt: IsoTimestamp): EarlyBackerEvaluationV1;
|
|
1218
|
+
/**
|
|
1219
|
+
* Evaluates the approved settlement-window policy. The caller owns environment
|
|
1220
|
+
* and rollout classification: `publicTokensLaunchAt` and
|
|
1221
|
+
* `firstPublicSpendLiveAt` must be derived from the entire public cohort, so
|
|
1222
|
+
* staff, test, and closed-beta availability cannot open or close this window.
|
|
1223
|
+
* The caller must also exclude non-production/test lots before evaluation.
|
|
1224
|
+
*/
|
|
1225
|
+
declare function evaluateEarlyBackerBySettlementV2(payerAccountId: AccountId, receivingHouseholdId: HouseholdId, paidLots: readonly PaidLotRetentionV1[], window: EarlyBackerWindowV1, evaluatedAt: IsoTimestamp): EarlyBackerEvaluationV2;
|
|
1226
|
+
|
|
1227
|
+
/** Stable machine-readable failures exposed by the economy domain. */
|
|
1228
|
+
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";
|
|
1229
|
+
interface EconomyErrorEnvelopeV1 {
|
|
1230
|
+
readonly schemaVersion: "1";
|
|
1231
|
+
readonly error: {
|
|
1232
|
+
readonly code: EconomyErrorCode;
|
|
1233
|
+
readonly message: string;
|
|
1234
|
+
readonly requestId?: string;
|
|
1235
|
+
};
|
|
1236
|
+
}
|
|
1237
|
+
/**
|
|
1238
|
+
* Domain error with a stable code and deliberately non-sensitive message.
|
|
1239
|
+
* Provider evidence, identities, and payment details must not be included.
|
|
1240
|
+
*/
|
|
1241
|
+
declare class EconomyError extends Error {
|
|
1242
|
+
readonly code: EconomyErrorCode;
|
|
1243
|
+
constructor(code: EconomyErrorCode, message: string);
|
|
1244
|
+
}
|
|
1245
|
+
/** Throws a stable economy error when a domain assertion fails. */
|
|
1246
|
+
declare function economyAssert(condition: unknown, code: EconomyErrorCode, message: string): asserts condition;
|
|
1247
|
+
/** Creates a bounded, non-sensitive error contract for an HTTP adapter. */
|
|
1248
|
+
declare function toEconomyErrorEnvelope(error: EconomyError, requestId?: string): EconomyErrorEnvelopeV1;
|
|
1249
|
+
|
|
1250
|
+
declare const MODULE_ALLOWANCE_PURPOSE: "junior-coder-module-entitlement";
|
|
1251
|
+
type ModuleAllowanceStatusV1 = "active" | "closed";
|
|
1252
|
+
/** Guardian-funded value that can only purchase modules for one child. */
|
|
1253
|
+
interface ModuleAllowanceV1 {
|
|
1254
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1255
|
+
readonly purpose: typeof MODULE_ALLOWANCE_PURPOSE;
|
|
1256
|
+
readonly allowanceId: ModuleAllowanceId;
|
|
1257
|
+
readonly householdId: HouseholdId;
|
|
1258
|
+
readonly hostWalletId: WalletId;
|
|
1259
|
+
readonly allowanceWalletId: WalletId;
|
|
1260
|
+
readonly childAccountId: AccountId;
|
|
1261
|
+
readonly status: ModuleAllowanceStatusV1;
|
|
1262
|
+
readonly allocatedAmount: TokenSubunitString;
|
|
1263
|
+
readonly availableAmount: TokenSubunitString;
|
|
1264
|
+
readonly heldAmount: TokenSubunitString;
|
|
1265
|
+
readonly spentAmount: TokenSubunitString;
|
|
1266
|
+
readonly reclaimedAmount: TokenSubunitString;
|
|
1267
|
+
readonly fundingSlices: readonly SourceLotSliceV1[];
|
|
1268
|
+
readonly reclaimedSlices: readonly SourceLotSliceV1[];
|
|
1269
|
+
readonly version: number;
|
|
1270
|
+
readonly createdAt: IsoTimestamp;
|
|
1271
|
+
readonly updatedAt: IsoTimestamp;
|
|
1272
|
+
}
|
|
1273
|
+
interface CreateModuleAllowanceInputV1 {
|
|
1274
|
+
readonly allowanceId: ModuleAllowanceId;
|
|
1275
|
+
readonly householdId: HouseholdId;
|
|
1276
|
+
readonly hostWalletId: WalletId;
|
|
1277
|
+
readonly allowanceWalletId: WalletId;
|
|
1278
|
+
readonly childAccountId: AccountId;
|
|
1279
|
+
readonly amount: TokenSubunitString;
|
|
1280
|
+
readonly fundingSlices: readonly SourceLotSliceV1[];
|
|
1281
|
+
readonly occurredAt: IsoTimestamp;
|
|
1282
|
+
}
|
|
1283
|
+
interface FundModuleAllowanceInputV1 {
|
|
1284
|
+
readonly amount: TokenSubunitString;
|
|
1285
|
+
readonly fundingSlices: readonly SourceLotSliceV1[];
|
|
1286
|
+
readonly expectedVersion: number;
|
|
1287
|
+
readonly occurredAt: IsoTimestamp;
|
|
1288
|
+
}
|
|
1289
|
+
interface ReclaimModuleAllowanceInputV1 {
|
|
1290
|
+
readonly amount: TokenSubunitString;
|
|
1291
|
+
readonly sourceSlices: readonly SourceLotSliceV1[];
|
|
1292
|
+
readonly expectedVersion: number;
|
|
1293
|
+
readonly occurredAt: IsoTimestamp;
|
|
1294
|
+
}
|
|
1295
|
+
interface CloseModuleAllowanceInputV1 {
|
|
1296
|
+
readonly expectedVersion: number;
|
|
1297
|
+
readonly occurredAt: IsoTimestamp;
|
|
1298
|
+
}
|
|
1299
|
+
/** Immutable Guardian-approved module price and requirements evidence. */
|
|
1300
|
+
interface ModuleSpendQuoteV1 {
|
|
1301
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1302
|
+
readonly quoteId: ModuleSpendQuoteId;
|
|
1303
|
+
readonly allowanceId: ModuleAllowanceId;
|
|
1304
|
+
readonly householdId: HouseholdId;
|
|
1305
|
+
readonly guardianAccountId: AccountId;
|
|
1306
|
+
readonly childAccountId: AccountId;
|
|
1307
|
+
readonly moduleVersionId: LearningModuleVersionId;
|
|
1308
|
+
readonly catalogVersion: string;
|
|
1309
|
+
readonly amount: TokenSubunitString;
|
|
1310
|
+
readonly requirementsManifestVersion: string;
|
|
1311
|
+
readonly requirementsManifestHash: string;
|
|
1312
|
+
readonly requirementsAcknowledgedAt: IsoTimestamp;
|
|
1313
|
+
readonly issuedAt: IsoTimestamp;
|
|
1314
|
+
readonly expiresAt: IsoTimestamp;
|
|
1315
|
+
}
|
|
1316
|
+
type CreateModuleSpendQuoteInputV1 = Omit<ModuleSpendQuoteV1, "schemaVersion">;
|
|
1317
|
+
type ModuleSpendHoldStatusV1 = "held" | "settled" | "released";
|
|
1318
|
+
/** Versioned projection for one quote-bound allowance hold. */
|
|
1319
|
+
interface ModuleSpendHoldV1 {
|
|
1320
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1321
|
+
readonly holdId: ModuleSpendHoldId;
|
|
1322
|
+
readonly quoteId: ModuleSpendQuoteId;
|
|
1323
|
+
readonly allowanceId: ModuleAllowanceId;
|
|
1324
|
+
readonly householdId: HouseholdId;
|
|
1325
|
+
readonly guardianAccountId: AccountId;
|
|
1326
|
+
readonly childAccountId: AccountId;
|
|
1327
|
+
readonly moduleVersionId: LearningModuleVersionId;
|
|
1328
|
+
readonly amount: TokenSubunitString;
|
|
1329
|
+
readonly requirementsManifestVersion: string;
|
|
1330
|
+
readonly requirementsManifestHash: string;
|
|
1331
|
+
readonly sourceSlices: readonly SourceLotSliceV1[];
|
|
1332
|
+
readonly status: ModuleSpendHoldStatusV1;
|
|
1333
|
+
readonly holdIdempotencyKey: string;
|
|
1334
|
+
readonly settlementIdempotencyKey?: string;
|
|
1335
|
+
readonly releaseIdempotencyKey?: string;
|
|
1336
|
+
readonly entitlementId?: LearningEntitlementId;
|
|
1337
|
+
readonly settlementTransactionId?: TransactionId;
|
|
1338
|
+
readonly releaseTransactionId?: TransactionId;
|
|
1339
|
+
readonly version: number;
|
|
1340
|
+
readonly createdAt: IsoTimestamp;
|
|
1341
|
+
readonly expiresAt: IsoTimestamp;
|
|
1342
|
+
readonly updatedAt: IsoTimestamp;
|
|
1343
|
+
}
|
|
1344
|
+
interface CreateModuleSpendHoldInputV1 {
|
|
1345
|
+
readonly holdId: ModuleSpendHoldId;
|
|
1346
|
+
readonly idempotencyKey: string;
|
|
1347
|
+
readonly sourceSlices: readonly SourceLotSliceV1[];
|
|
1348
|
+
readonly expectedAllowanceVersion: number;
|
|
1349
|
+
readonly occurredAt: IsoTimestamp;
|
|
1350
|
+
}
|
|
1351
|
+
interface SettleModuleSpendHoldInputV1 {
|
|
1352
|
+
readonly entitlementId: LearningEntitlementId;
|
|
1353
|
+
readonly settlementTransactionId: TransactionId;
|
|
1354
|
+
readonly idempotencyKey: string;
|
|
1355
|
+
readonly expectedAllowanceVersion: number;
|
|
1356
|
+
readonly expectedHoldVersion: number;
|
|
1357
|
+
readonly occurredAt: IsoTimestamp;
|
|
760
1358
|
}
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
readonly schemaVersion: EconomyContractVersion;
|
|
1359
|
+
interface ReleaseModuleSpendHoldInputV1 {
|
|
1360
|
+
readonly releaseTransactionId: TransactionId;
|
|
764
1361
|
readonly idempotencyKey: string;
|
|
765
|
-
readonly
|
|
766
|
-
readonly
|
|
767
|
-
readonly
|
|
1362
|
+
readonly expectedAllowanceVersion: number;
|
|
1363
|
+
readonly expectedHoldVersion: number;
|
|
1364
|
+
readonly occurredAt: IsoTimestamp;
|
|
768
1365
|
}
|
|
769
|
-
|
|
770
|
-
|
|
1366
|
+
interface ModuleSpendTransitionResultV1 {
|
|
1367
|
+
readonly allowance: ModuleAllowanceV1;
|
|
1368
|
+
readonly hold: ModuleSpendHoldV1;
|
|
1369
|
+
}
|
|
1370
|
+
/** Durable economic receipt for an activated learning entitlement. */
|
|
1371
|
+
interface ModulePurchaseReceiptV1 {
|
|
771
1372
|
readonly schemaVersion: EconomyContractVersion;
|
|
772
|
-
readonly
|
|
1373
|
+
readonly receiptId: string;
|
|
1374
|
+
readonly quoteId: ModuleSpendQuoteId;
|
|
1375
|
+
readonly holdId: ModuleSpendHoldId;
|
|
1376
|
+
readonly allowanceId: ModuleAllowanceId;
|
|
1377
|
+
readonly householdId: HouseholdId;
|
|
1378
|
+
readonly guardianAccountId: AccountId;
|
|
1379
|
+
readonly childAccountId: AccountId;
|
|
1380
|
+
readonly moduleVersionId: LearningModuleVersionId;
|
|
1381
|
+
readonly entitlementId: LearningEntitlementId;
|
|
1382
|
+
readonly amount: TokenSubunitString;
|
|
1383
|
+
readonly requirementsManifestVersion: string;
|
|
1384
|
+
readonly requirementsManifestHash: string;
|
|
1385
|
+
readonly settlementTransactionId: TransactionId;
|
|
1386
|
+
readonly issuedAt: IsoTimestamp;
|
|
1387
|
+
}
|
|
1388
|
+
interface CreateModulePurchaseReceiptInputV1 {
|
|
1389
|
+
readonly receiptId: string;
|
|
1390
|
+
readonly issuedAt: IsoTimestamp;
|
|
1391
|
+
}
|
|
1392
|
+
type ModulePurchaseFinancialStateV1 = "missing" | "held" | "settled" | "released";
|
|
1393
|
+
type ModulePurchaseEntitlementStateV1 = "missing" | "pending" | "active" | "cancelled";
|
|
1394
|
+
/** Privacy-minimized observation used by an authoritative reconciler. */
|
|
1395
|
+
interface ModulePurchaseReconciliationObservationV1 {
|
|
1396
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1397
|
+
readonly quoteId: ModuleSpendQuoteId;
|
|
1398
|
+
readonly holdId: ModuleSpendHoldId;
|
|
1399
|
+
readonly childAccountId: AccountId;
|
|
1400
|
+
readonly moduleVersionId: LearningModuleVersionId;
|
|
1401
|
+
readonly financialState: ModulePurchaseFinancialStateV1;
|
|
1402
|
+
readonly entitlementState: ModulePurchaseEntitlementStateV1;
|
|
1403
|
+
readonly receiptPresent: boolean;
|
|
1404
|
+
readonly observedAt: IsoTimestamp;
|
|
1405
|
+
}
|
|
1406
|
+
type ModulePurchaseReconciliationActionV1 = "none" | "resume-settlement" | "release-hold" | "activate-entitlement" | "issue-receipt" | "cancel-pending-entitlement" | "manual-review";
|
|
1407
|
+
interface ModulePurchaseReconciliationResultV1 {
|
|
1408
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1409
|
+
readonly action: ModulePurchaseReconciliationActionV1;
|
|
1410
|
+
readonly blocking: boolean;
|
|
1411
|
+
readonly consistent: boolean;
|
|
1412
|
+
readonly reasonCode: string;
|
|
1413
|
+
}
|
|
1414
|
+
/** Validates exact arithmetic and source-lot provenance for an allowance. */
|
|
1415
|
+
declare function assertModuleAllowance(allowance: ModuleAllowanceV1): void;
|
|
1416
|
+
/** Creates a child-specific Module Allowance from locked source-lot slices. */
|
|
1417
|
+
declare function createModuleAllowance(input: CreateModuleAllowanceInputV1): ModuleAllowanceV1;
|
|
1418
|
+
/** Adds Guardian-selected source-lot value without replacing prior history. */
|
|
1419
|
+
declare function fundModuleAllowance(allowance: ModuleAllowanceV1, input: FundModuleAllowanceInputV1): ModuleAllowanceV1;
|
|
1420
|
+
/** Returns unused value to its source lots without changing spent history. */
|
|
1421
|
+
declare function reclaimModuleAllowance(allowance: ModuleAllowanceV1, input: ReclaimModuleAllowanceInputV1): ModuleAllowanceV1;
|
|
1422
|
+
/** Closes an empty allowance; funding later requires a new allowance. */
|
|
1423
|
+
declare function closeModuleAllowance(allowance: ModuleAllowanceV1, input: CloseModuleAllowanceInputV1): ModuleAllowanceV1;
|
|
1424
|
+
/** Validates immutable price, Guardian acknowledgement, and manifest evidence. */
|
|
1425
|
+
declare function assertModuleSpendQuote(quote: ModuleSpendQuoteV1): void;
|
|
1426
|
+
/** Creates immutable quote evidence from server-derived catalog facts. */
|
|
1427
|
+
declare function createModuleSpendQuote(input: CreateModuleSpendQuoteInputV1): ModuleSpendQuoteV1;
|
|
1428
|
+
/** Validates one quote-bound hold lifecycle projection. */
|
|
1429
|
+
declare function assertModuleSpendHold(hold: ModuleSpendHoldV1): void;
|
|
1430
|
+
/** Moves quoted value from available to held after all bindings are checked. */
|
|
1431
|
+
declare function createModuleSpendHold(allowance: ModuleAllowanceV1, quote: ModuleSpendQuoteV1, input: CreateModuleSpendHoldInputV1): ModuleSpendTransitionResultV1;
|
|
1432
|
+
/** Settles a hold only when the pending learning entitlement is identified. */
|
|
1433
|
+
declare function settleModuleSpendHold(allowance: ModuleAllowanceV1, hold: ModuleSpendHoldV1, input: SettleModuleSpendHoldInputV1): ModuleSpendTransitionResultV1;
|
|
1434
|
+
/** Releases failed or expired held value back to the same allowance. */
|
|
1435
|
+
declare function releaseModuleSpendHold(allowance: ModuleAllowanceV1, hold: ModuleSpendHoldV1, input: ReleaseModuleSpendHoldInputV1): ModuleSpendTransitionResultV1;
|
|
1436
|
+
/** Validates a durable receipt against settled economic evidence. */
|
|
1437
|
+
declare function assertModulePurchaseReceipt(receipt: ModulePurchaseReceiptV1): void;
|
|
1438
|
+
/** Creates a receipt only when quote and settled hold evidence match exactly. */
|
|
1439
|
+
declare function createModulePurchaseReceipt(quote: ModuleSpendQuoteV1, hold: ModuleSpendHoldV1, input: CreateModulePurchaseReceiptInputV1): ModulePurchaseReceiptV1;
|
|
1440
|
+
/** Validates privacy-minimized cross-service reconciliation evidence. */
|
|
1441
|
+
declare function assertModulePurchaseReconciliationObservation(observation: ModulePurchaseReconciliationObservationV1): void;
|
|
1442
|
+
/**
|
|
1443
|
+
* Returns one forward-safe action. Callers must reload and lock authoritative
|
|
1444
|
+
* state before carrying it out; `manual-review` never authorizes a mutation.
|
|
1445
|
+
*/
|
|
1446
|
+
declare function reconcileModulePurchase(observation: ModulePurchaseReconciliationObservationV1): ModulePurchaseReconciliationResultV1;
|
|
1447
|
+
|
|
1448
|
+
type AdjustmentStatus = "draft" | "pending-approval" | "approved" | "rejected" | "executed" | "expired";
|
|
1449
|
+
/** Dual-control request; the resulting change is always a ledger transaction. */
|
|
1450
|
+
interface AdjustmentRequestV1 {
|
|
1451
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1452
|
+
readonly adjustmentId: string;
|
|
1453
|
+
readonly walletId: WalletId;
|
|
1454
|
+
readonly amount: TokenSubunitString;
|
|
1455
|
+
readonly reason: string;
|
|
1456
|
+
readonly ticketReference: string;
|
|
1457
|
+
readonly status: AdjustmentStatus;
|
|
1458
|
+
readonly initiatedByAccountId: AccountId;
|
|
1459
|
+
readonly initiatedAt: IsoTimestamp;
|
|
1460
|
+
readonly approvedByAccountId?: AccountId;
|
|
1461
|
+
readonly approvedAt?: IsoTimestamp;
|
|
1462
|
+
readonly resultingTransactionId?: TransactionId;
|
|
773
1463
|
}
|
|
774
|
-
/**
|
|
775
|
-
declare function
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
listSpendableLotsForUpdate(walletId: WalletId): Promise<readonly SourceLotV1[]>;
|
|
786
|
-
findLotForUpdate(lotId: LotId): Promise<SourceLotV1 | null>;
|
|
787
|
-
findIdempotencyResult(idempotencyKey: string): Promise<PersistedIdempotencyResultV1 | null>;
|
|
788
|
-
appendTransaction(transaction: LedgerTransactionV1): Promise<void>;
|
|
789
|
-
appendSourceLot(lot: SourceLotV1): Promise<void>;
|
|
790
|
-
updateSourceLotProjection(lotId: LotId, remainingAmount: TokenSubunitString, heldAmount: TokenSubunitString, reversedAmount: TokenSubunitString): Promise<void>;
|
|
791
|
-
saveBalanceProjection(projection: BalanceProjection, transactionId: TransactionId): Promise<void>;
|
|
792
|
-
saveIdempotencyResult(idempotencyKey: string, result: PersistedIdempotencyResultV1): Promise<void>;
|
|
793
|
-
appendOutboxEvent(event: EconomyOutboxEventV1): Promise<void>;
|
|
1464
|
+
/** Proves that production adjustment approval was performed by another actor. */
|
|
1465
|
+
declare function assertDistinctAdjustmentApproval(request: AdjustmentRequestV1): void;
|
|
1466
|
+
|
|
1467
|
+
type PaidLotLifecycleStatusV1 = "clear" | "partially-reversed" | "disputed" | "fully-reversed" | "chargeback-lost";
|
|
1468
|
+
type PaidLotLifecycleEventTypeV1 = "refund" | "dispute-hold" | "dispute-won" | "dispute-lost" | "chargeback" | "reversal";
|
|
1469
|
+
/** Paid-purchase facts not already carried by the source lot. */
|
|
1470
|
+
interface PaidLotPurchaseProvenanceV1 {
|
|
1471
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1472
|
+
readonly purchaseId: string;
|
|
1473
|
+
readonly catalogVersion: string;
|
|
1474
|
+
readonly purchasedAt: IsoTimestamp;
|
|
794
1475
|
}
|
|
795
|
-
/**
|
|
796
|
-
interface
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
1476
|
+
/** Provider-neutral refund/dispute evidence for a paid source lot. */
|
|
1477
|
+
interface PaidLotLifecycleEventV1 {
|
|
1478
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1479
|
+
readonly eventId: string;
|
|
1480
|
+
readonly lotId: LotId;
|
|
1481
|
+
readonly eventType: PaidLotLifecycleEventTypeV1;
|
|
1482
|
+
readonly amount: TokenSubunitString;
|
|
1483
|
+
readonly occurredAt: IsoTimestamp;
|
|
802
1484
|
}
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
* deltas, idempotency, chain head, and outbox are committed atomically.
|
|
807
|
-
*/
|
|
808
|
-
interface EconomyUnitOfWorkV2 {
|
|
809
|
-
getWalletForOwnerForUpdate(walletId: WalletId, owner: WalletOwnerReferenceV1): Promise<WalletV1 | null>;
|
|
810
|
-
listSpendableLotsForUpdate(walletId: WalletId): Promise<readonly VersionedSourceLotV1[]>;
|
|
811
|
-
findLotForUpdate(lotId: LotId): Promise<VersionedSourceLotV1 | null>;
|
|
812
|
-
getGameplayAllocationForUpdate(allocationId: AllocationId, householdId: HouseholdId, childAccountId: AccountId): Promise<GameplayAllocationV1 | null>;
|
|
813
|
-
findIdempotencyResult(scope: EconomyIdempotencyScopeV1): Promise<ScopedPersistedIdempotencyResultV1 | null>;
|
|
814
|
-
/** Locks and rejects any stale/non-active regional writer lease. */
|
|
815
|
-
lockActiveWriterFence(acceptedRegion: string, writerFencingToken: string): Promise<void>;
|
|
816
|
-
lockJournalChainHead(chainId: string): Promise<JournalChainHeadV1>;
|
|
817
|
-
appendCommandEnvelope(envelope: EconomyCommandEnvelopeV1): Promise<void>;
|
|
818
|
-
appendCommandWorkflowEvent(event: EconomyCommandWorkflowEventV1): Promise<void>;
|
|
819
|
-
appendTransaction(transaction: ChainedEconomicJournalTransactionV1): Promise<void>;
|
|
820
|
-
/** Appends `createInitialSourceLotSnapshot()` output; later changes are movements. */
|
|
821
|
-
appendSourceLot(snapshot: VersionedSourceLotV1): Promise<void>;
|
|
822
|
-
/** Appends movement evidence and applies its lot CAS as one operation. */
|
|
823
|
-
applySourceLotMovement(movement: SourceLotMovementV1): Promise<void>;
|
|
824
|
-
appendGameplayAllocation(allocation: GameplayAllocationV1): Promise<void>;
|
|
825
|
-
/**
|
|
826
|
-
* Compares `expectedVersion`, requires `allocation.version` to be exactly the
|
|
827
|
-
* next value, and never overwrites a stale row.
|
|
828
|
-
*/
|
|
829
|
-
saveGameplayAllocation(allocation: GameplayAllocationV1, expectedVersion: number): Promise<void>;
|
|
830
|
-
/**
|
|
831
|
-
* Atomically adds deltas, verifies them against the appended postings and
|
|
832
|
-
* account bindings, and records transaction-scoped application keys.
|
|
833
|
-
*/
|
|
834
|
-
applyWalletBalanceDeltas(transactionId: TransactionId, deltas: readonly WalletBalanceDeltaV1[]): Promise<void>;
|
|
835
|
-
/**
|
|
836
|
-
* Atomically increments monotonic lifetime counters after verifying the
|
|
837
|
-
* deltas against the appended transaction's deterministic classification.
|
|
838
|
-
*/
|
|
839
|
-
applyWalletLifetimeDeltas(transactionId: TransactionId, deltas: readonly WalletLifetimeDeltaV1[]): Promise<void>;
|
|
840
|
-
saveIdempotencyResult(scope: EconomyIdempotencyScopeV1, result: ScopedPersistedIdempotencyResultV1): Promise<void>;
|
|
841
|
-
appendOutboxEvent(event: EconomyOutboxEventV1): Promise<void>;
|
|
842
|
-
/** Compare-and-swaps the full locked head, including its canonical hash. */
|
|
843
|
-
advanceJournalChainHead(expected: JournalChainHeadV1, next: JournalChainHeadV1): Promise<void>;
|
|
1485
|
+
interface PaidLotLifecycleReceiptV1 {
|
|
1486
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1487
|
+
readonly event: PaidLotLifecycleEventV1;
|
|
844
1488
|
}
|
|
845
1489
|
/**
|
|
846
|
-
*
|
|
847
|
-
*
|
|
848
|
-
* absolute `saveBalanceProjection` operation to this interface.
|
|
1490
|
+
* Retained paid-lot projection. Immutable purchase/original facts plus every
|
|
1491
|
+
* receipt are sufficient to rebuild all derived amounts in occurrence order.
|
|
849
1492
|
*/
|
|
850
|
-
interface
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
1493
|
+
interface PaidLotLifecycleV1 {
|
|
1494
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1495
|
+
readonly lotId: LotId;
|
|
1496
|
+
readonly payerAccountId: AccountId;
|
|
1497
|
+
readonly receivingHouseholdId: HouseholdId;
|
|
1498
|
+
readonly purchaseId: string;
|
|
1499
|
+
readonly catalogVersion: string;
|
|
1500
|
+
readonly purchasedAt: IsoTimestamp;
|
|
1501
|
+
readonly settledAt: IsoTimestamp;
|
|
1502
|
+
readonly creditedAt: IsoTimestamp;
|
|
1503
|
+
readonly originalAmount: TokenSubunitString;
|
|
1504
|
+
readonly retainedAmount: TokenSubunitString;
|
|
1505
|
+
readonly heldAmount: TokenSubunitString;
|
|
1506
|
+
readonly reversedAmount: TokenSubunitString;
|
|
1507
|
+
readonly refundedAmount: TokenSubunitString;
|
|
1508
|
+
readonly chargebackAmount: TokenSubunitString;
|
|
1509
|
+
readonly oneTimeReversalAmount: TokenSubunitString;
|
|
1510
|
+
readonly status: PaidLotLifecycleStatusV1;
|
|
1511
|
+
readonly version: number;
|
|
1512
|
+
readonly receipts: readonly PaidLotLifecycleReceiptV1[];
|
|
1513
|
+
readonly effectiveEventIds: readonly string[];
|
|
858
1514
|
}
|
|
859
|
-
|
|
860
|
-
|
|
1515
|
+
/** Exact signed projection deltas produced when one receipt is appended. */
|
|
1516
|
+
interface PaidLotLifecycleArithmeticV1 {
|
|
1517
|
+
readonly retainedDelta: TokenSubunitString;
|
|
1518
|
+
readonly heldDelta: TokenSubunitString;
|
|
1519
|
+
readonly reversedDelta: TokenSubunitString;
|
|
1520
|
+
readonly refundedDelta: TokenSubunitString;
|
|
1521
|
+
readonly chargebackDelta: TokenSubunitString;
|
|
1522
|
+
readonly oneTimeReversalDelta: TokenSubunitString;
|
|
861
1523
|
}
|
|
862
|
-
interface
|
|
863
|
-
|
|
1524
|
+
interface PaidLotLifecycleMutationResultV1 {
|
|
1525
|
+
readonly lifecycle: PaidLotLifecycleV1;
|
|
1526
|
+
/** False only for an exact event-ID replay already recorded. */
|
|
1527
|
+
readonly applied: boolean;
|
|
1528
|
+
readonly stateChanged: boolean;
|
|
1529
|
+
readonly arithmetic: PaidLotLifecycleArithmeticV1;
|
|
864
1530
|
}
|
|
1531
|
+
/** Validates the paid purchase facts paired with a source lot. */
|
|
1532
|
+
declare function assertPaidLotPurchaseProvenance(provenance: PaidLotPurchaseProvenanceV1): void;
|
|
1533
|
+
/** Validates one provider-neutral paid-lot lifecycle event. */
|
|
1534
|
+
declare function assertPaidLotLifecycleEvent(event: PaidLotLifecycleEventV1): void;
|
|
1535
|
+
/** Validates and deterministically rebuilds retained paid-lot arithmetic. */
|
|
1536
|
+
declare function assertPaidLotLifecycle(lifecycle: PaidLotLifecycleV1): void;
|
|
1537
|
+
/** Creates the retained projection for one newly credited paid source lot. */
|
|
1538
|
+
declare function createPaidLotLifecycle(lot: SourceLotV1, provenance: PaidLotPurchaseProvenanceV1): PaidLotLifecycleV1;
|
|
1539
|
+
/**
|
|
1540
|
+
* Appends one event then rebuilds every receipt in authoritative occurrence
|
|
1541
|
+
* order. Exact retries succeed before stale-version validation.
|
|
1542
|
+
*/
|
|
1543
|
+
declare function applyPaidLotLifecycleEvent(lifecycle: PaidLotLifecycleV1, event: PaidLotLifecycleEventV1, expectedVersion: number): PaidLotLifecycleMutationResultV1;
|
|
1544
|
+
/** Reduces unordered/retried lifecycle evidence in canonical event order. */
|
|
1545
|
+
declare function reducePaidLotLifecycleEvents(initial: PaidLotLifecycleV1, events: readonly PaidLotLifecycleEventV1[]): PaidLotLifecycleV1;
|
|
1546
|
+
/** Creates the exact retained-basis input used by early-backer evaluators. */
|
|
1547
|
+
declare function createEarlyBackerRetentionFromPaidLot(lifecycle: PaidLotLifecycleV1): PaidLotRetentionV1;
|
|
865
1548
|
|
|
866
1549
|
type WalletPortfolioComponentRole = "household-treasury" | "personal" | "gameplay-allocation" | "hold";
|
|
867
1550
|
/** One server-authorized component of a portfolio read. */
|
|
@@ -1183,6 +1866,278 @@ declare const BASELINE_MONTHLY_SUBSCRIPTION_PLAN: TokenSubscriptionPlanV1;
|
|
|
1183
1866
|
/** Validates future provider-neutral recurrence without enabling it. */
|
|
1184
1867
|
declare function assertTokenSubscriptionPlan(plan: TokenSubscriptionPlanV1): void;
|
|
1185
1868
|
|
|
1869
|
+
declare const ECONOMY_RECOVERY_PROTOCOL_VERSION: "1";
|
|
1870
|
+
type EconomyRecoveryProtocolVersion = typeof ECONOMY_RECOVERY_PROTOCOL_VERSION;
|
|
1871
|
+
type EconomyRecoveryRecordKindV1 = "acceptance" | "committed-result";
|
|
1872
|
+
type EconomyRecoveryDirectionV1 = "credit" | "debit";
|
|
1873
|
+
type EconomyEvidenceSignatureAlgorithmV1 = "ed25519" | "ecdsa-p256-sha256" | "rsa-pss-sha256";
|
|
1874
|
+
/** Public, non-secret metadata selected before detached signing. */
|
|
1875
|
+
interface EconomyEvidenceSignatureMetadataV1 {
|
|
1876
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1877
|
+
readonly signatureVersion: "1";
|
|
1878
|
+
readonly algorithm: EconomyEvidenceSignatureAlgorithmV1;
|
|
1879
|
+
readonly keyId: string;
|
|
1880
|
+
readonly signedAt: IsoTimestamp;
|
|
1881
|
+
}
|
|
1882
|
+
/** Public metadata plus the final detached signature value. */
|
|
1883
|
+
interface EconomyEvidenceSignatureV1 extends EconomyEvidenceSignatureMetadataV1 {
|
|
1884
|
+
readonly value: string;
|
|
1885
|
+
}
|
|
1886
|
+
/** Deterministic signing request safe to pass to an external key adapter. */
|
|
1887
|
+
interface EconomyPreparedEvidenceSignatureV1 {
|
|
1888
|
+
readonly contentAddressedId: string;
|
|
1889
|
+
readonly canonicalPayload: string;
|
|
1890
|
+
}
|
|
1891
|
+
/**
|
|
1892
|
+
* Encrypted reconstruction bytes stored outside the live authority.
|
|
1893
|
+
*
|
|
1894
|
+
* The plaintext must contain only the already-approved, privacy-minimized
|
|
1895
|
+
* authority records. Raw provider callbacks, signatures, payment data,
|
|
1896
|
+
* idempotency keys, email addresses, and exact birth data are forbidden.
|
|
1897
|
+
*/
|
|
1898
|
+
interface EconomySealedRecoveryPayloadV1 {
|
|
1899
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1900
|
+
readonly payloadVersion: "1";
|
|
1901
|
+
readonly cipherSuite: "AES-256-GCM";
|
|
1902
|
+
readonly encoding: "base64url";
|
|
1903
|
+
readonly keyVersion: string;
|
|
1904
|
+
readonly nonce: string;
|
|
1905
|
+
readonly ciphertext: string;
|
|
1906
|
+
readonly authenticationTag: string;
|
|
1907
|
+
readonly plaintextContentHash: string;
|
|
1908
|
+
readonly encryptionContextHash: string;
|
|
1909
|
+
}
|
|
1910
|
+
/** Content-addressed body written identically to every evidence region. */
|
|
1911
|
+
interface EconomyRecoveryAcceptanceBodyV1 {
|
|
1912
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1913
|
+
readonly recoveryVersion: EconomyRecoveryProtocolVersion;
|
|
1914
|
+
readonly recordType: "economy-recovery-acceptance";
|
|
1915
|
+
readonly authorityId: string;
|
|
1916
|
+
readonly commandId: string;
|
|
1917
|
+
readonly correlationId: string;
|
|
1918
|
+
readonly idempotencyFingerprint: EconomyHmacFingerprintV1;
|
|
1919
|
+
readonly commandEnvelopeHash: string;
|
|
1920
|
+
readonly acceptedReceiptId: string;
|
|
1921
|
+
readonly acceptedReceiptHash: string;
|
|
1922
|
+
readonly sealedPayload: EconomySealedRecoveryPayloadV1;
|
|
1923
|
+
readonly preparedAt: IsoTimestamp;
|
|
1924
|
+
readonly acceptedAt: IsoTimestamp;
|
|
1925
|
+
}
|
|
1926
|
+
/**
|
|
1927
|
+
* Provider-neutral durable acceptance. The ID is SHA-256-addressed from the
|
|
1928
|
+
* canonical body and therefore remains identical in all evidence regions.
|
|
1929
|
+
*/
|
|
1930
|
+
interface EconomyRecoveryAcceptanceEnvelopeV1 extends EconomyRecoveryAcceptanceBodyV1 {
|
|
1931
|
+
readonly acceptanceEnvelopeId: string;
|
|
1932
|
+
}
|
|
1933
|
+
/** Content-addressed result body written after the authority commit. */
|
|
1934
|
+
interface EconomyRecoveryCommittedResultBodyV1 {
|
|
1935
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1936
|
+
readonly recoveryVersion: EconomyRecoveryProtocolVersion;
|
|
1937
|
+
readonly recordType: "economy-recovery-committed-result";
|
|
1938
|
+
readonly authorityId: string;
|
|
1939
|
+
readonly commandId: string;
|
|
1940
|
+
readonly correlationId: string;
|
|
1941
|
+
readonly acceptanceEnvelopeId: string;
|
|
1942
|
+
readonly acceptanceEnvelopeHash: string;
|
|
1943
|
+
readonly resultReceiptId: string;
|
|
1944
|
+
readonly resultReceiptHash: string;
|
|
1945
|
+
readonly outcome: EconomyCommandResultOutcomeV1;
|
|
1946
|
+
readonly authorityCommitId: string;
|
|
1947
|
+
readonly authorityCommitHash: string;
|
|
1948
|
+
readonly authoritySequence: string;
|
|
1949
|
+
readonly authorityHeadHashAfter: string;
|
|
1950
|
+
readonly transactionId?: TransactionId;
|
|
1951
|
+
readonly transactionCanonicalHash?: string;
|
|
1952
|
+
readonly sealedPayload: EconomySealedRecoveryPayloadV1;
|
|
1953
|
+
readonly committedAt: IsoTimestamp;
|
|
1954
|
+
}
|
|
1955
|
+
/**
|
|
1956
|
+
* Immutable reconstruction result for one command. Failed and no-op commands
|
|
1957
|
+
* are retained as facts but cannot carry transaction identity or value.
|
|
1958
|
+
*/
|
|
1959
|
+
interface EconomyRecoveryCommittedResultV1 extends EconomyRecoveryCommittedResultBodyV1 {
|
|
1960
|
+
readonly committedResultId: string;
|
|
1961
|
+
}
|
|
1962
|
+
/** Region-specific body proving one recovery record was durably retained. */
|
|
1963
|
+
interface EconomyRegionalEvidenceReceiptBodyV1 {
|
|
1964
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1965
|
+
readonly recoveryVersion: EconomyRecoveryProtocolVersion;
|
|
1966
|
+
readonly recordType: "economy-regional-evidence-receipt";
|
|
1967
|
+
readonly journalId: string;
|
|
1968
|
+
readonly region: string;
|
|
1969
|
+
readonly sequence: string;
|
|
1970
|
+
readonly previousReceiptHash?: string;
|
|
1971
|
+
readonly authorityId: string;
|
|
1972
|
+
readonly commandId: string;
|
|
1973
|
+
readonly recoveryRecordKind: EconomyRecoveryRecordKindV1;
|
|
1974
|
+
readonly recoveryRecordId: string;
|
|
1975
|
+
readonly recoveryRecordContentHash: string;
|
|
1976
|
+
readonly storedAt: IsoTimestamp;
|
|
1977
|
+
readonly retentionUntil: IsoTimestamp;
|
|
1978
|
+
}
|
|
1979
|
+
/**
|
|
1980
|
+
* Signed, content-addressed evidence-region acknowledgement.
|
|
1981
|
+
*
|
|
1982
|
+
* Its ID addresses the unsigned storage fact. Its detached signature covers
|
|
1983
|
+
* that ID, the exact canonical body, and the public signature metadata.
|
|
1984
|
+
*/
|
|
1985
|
+
interface EconomyRegionalEvidenceReceiptV1 extends EconomyRegionalEvidenceReceiptBodyV1 {
|
|
1986
|
+
readonly evidenceReceiptId: string;
|
|
1987
|
+
readonly signature: EconomyEvidenceSignatureV1;
|
|
1988
|
+
}
|
|
1989
|
+
/** One sibling in a duplicate-last, binary SHA-256 Merkle proof. */
|
|
1990
|
+
interface EconomyMerkleProofStepV1 {
|
|
1991
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1992
|
+
readonly side: "left" | "right";
|
|
1993
|
+
readonly hash: string;
|
|
1994
|
+
}
|
|
1995
|
+
/** Portable proof that an authority commit is covered by an hourly anchor. */
|
|
1996
|
+
interface EconomyMerkleInclusionProofV1 {
|
|
1997
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
1998
|
+
readonly proofVersion: "1";
|
|
1999
|
+
readonly algorithm: "duplicate-last-sha256-v1";
|
|
2000
|
+
readonly anchorId: string;
|
|
2001
|
+
readonly anchorManifestHash: string;
|
|
2002
|
+
readonly leafHash: string;
|
|
2003
|
+
readonly leafIndex: string;
|
|
2004
|
+
readonly leafCount: string;
|
|
2005
|
+
readonly siblings: readonly EconomyMerkleProofStepV1[];
|
|
2006
|
+
}
|
|
2007
|
+
/** Privacy-safe link from a customer receipt to one regional evidence fact. */
|
|
2008
|
+
interface EconomyPortableEvidenceReferenceV1 {
|
|
2009
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
2010
|
+
readonly region: string;
|
|
2011
|
+
readonly evidenceReceiptId: string;
|
|
2012
|
+
readonly evidenceReceiptHash: string;
|
|
2013
|
+
}
|
|
2014
|
+
/** Content-addressed customer-facing receipt body. */
|
|
2015
|
+
interface EconomyPortableCustomerReceiptBodyV1 {
|
|
2016
|
+
readonly schemaVersion: EconomyContractVersion;
|
|
2017
|
+
readonly recoveryVersion: EconomyRecoveryProtocolVersion;
|
|
2018
|
+
readonly recordType: "economy-portable-customer-receipt";
|
|
2019
|
+
readonly authorityId: string;
|
|
2020
|
+
readonly commandId: string;
|
|
2021
|
+
readonly activityType: ActivityType;
|
|
2022
|
+
readonly direction: EconomyRecoveryDirectionV1;
|
|
2023
|
+
readonly tokenAmount: TokenSubunitString;
|
|
2024
|
+
readonly transactionId: TransactionId;
|
|
2025
|
+
readonly transactionCanonicalHash: string;
|
|
2026
|
+
readonly resultReceiptId: string;
|
|
2027
|
+
readonly resultReceiptHash: string;
|
|
2028
|
+
readonly committedResultId: string;
|
|
2029
|
+
readonly committedResultContentHash: string;
|
|
2030
|
+
readonly authorityCommitId: string;
|
|
2031
|
+
readonly authorityCommitHash: string;
|
|
2032
|
+
readonly authoritySequence: string;
|
|
2033
|
+
readonly regionalEvidence: readonly EconomyPortableEvidenceReferenceV1[];
|
|
2034
|
+
readonly merkleInclusionProof?: EconomyMerkleInclusionProofV1;
|
|
2035
|
+
readonly tokenTermsVersion: string;
|
|
2036
|
+
readonly cashRedemptionAllowed: false;
|
|
2037
|
+
readonly committedAt: IsoTimestamp;
|
|
2038
|
+
readonly issuedAt: IsoTimestamp;
|
|
2039
|
+
}
|
|
2040
|
+
/**
|
|
2041
|
+
* Downloadable signed receipt containing no payer, household, provider,
|
|
2042
|
+
* payment, email, session, or exact-age data.
|
|
2043
|
+
*/
|
|
2044
|
+
interface EconomyPortableCustomerReceiptV1 extends EconomyPortableCustomerReceiptBodyV1 {
|
|
2045
|
+
readonly portableReceiptId: string;
|
|
2046
|
+
readonly signature: EconomyEvidenceSignatureV1;
|
|
2047
|
+
}
|
|
2048
|
+
/** Infrastructure-supplied signature verifier; this package owns no keys. */
|
|
2049
|
+
interface EconomyEvidenceSignatureVerificationInputV1 {
|
|
2050
|
+
readonly algorithm: EconomyEvidenceSignatureAlgorithmV1;
|
|
2051
|
+
readonly keyId: string;
|
|
2052
|
+
readonly signedAt: IsoTimestamp;
|
|
2053
|
+
readonly signature: string;
|
|
2054
|
+
readonly canonicalPayload: string;
|
|
2055
|
+
}
|
|
2056
|
+
type EconomyEvidenceSignatureVerifierV1 = (input: EconomyEvidenceSignatureVerificationInputV1) => boolean;
|
|
2057
|
+
/** Validates a bounded AES-GCM envelope without implementing cryptography. */
|
|
2058
|
+
declare function assertEconomySealedRecoveryPayload(payload: EconomySealedRecoveryPayloadV1): void;
|
|
2059
|
+
/** Canonical body bytes used to derive an acceptance-envelope ID. */
|
|
2060
|
+
declare function canonicalEconomyRecoveryAcceptanceBodyPayload(body: EconomyRecoveryAcceptanceBodyV1): string;
|
|
2061
|
+
/** Creates an acceptance record whose ID addresses its exact canonical body. */
|
|
2062
|
+
declare function createEconomyRecoveryAcceptanceEnvelope(body: EconomyRecoveryAcceptanceBodyV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): EconomyRecoveryAcceptanceEnvelopeV1;
|
|
2063
|
+
/** Validates schema, privacy shape, and the acceptance content address. */
|
|
2064
|
+
declare function assertEconomyRecoveryAcceptanceEnvelope(envelope: EconomyRecoveryAcceptanceEnvelopeV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): void;
|
|
2065
|
+
/** Canonical complete acceptance bytes written create-only in each region. */
|
|
2066
|
+
declare function canonicalEconomyRecoveryAcceptanceEnvelopePayload(envelope: EconomyRecoveryAcceptanceEnvelopeV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): string;
|
|
2067
|
+
/** Canonical body bytes used to derive a committed-result ID. */
|
|
2068
|
+
declare function canonicalEconomyRecoveryCommittedResultBodyPayload(body: EconomyRecoveryCommittedResultBodyV1): string;
|
|
2069
|
+
/** Creates a result record whose ID addresses its exact canonical body. */
|
|
2070
|
+
declare function createEconomyRecoveryCommittedResult(body: EconomyRecoveryCommittedResultBodyV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): EconomyRecoveryCommittedResultV1;
|
|
2071
|
+
/** Validates schema, privacy shape, and the committed-result content address. */
|
|
2072
|
+
declare function assertEconomyRecoveryCommittedResult(result: EconomyRecoveryCommittedResultV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): void;
|
|
2073
|
+
/** Canonical complete result bytes written create-only in each region. */
|
|
2074
|
+
declare function canonicalEconomyRecoveryCommittedResultPayload(result: EconomyRecoveryCommittedResultV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): string;
|
|
2075
|
+
/**
|
|
2076
|
+
* Proves that a committed result is the terminal recovery record for the exact
|
|
2077
|
+
* accepted command. It also recomputes the acceptance record hash.
|
|
2078
|
+
*/
|
|
2079
|
+
declare function assertEconomyRecoveryResultLink(acceptance: EconomyRecoveryAcceptanceEnvelopeV1, result: EconomyRecoveryCommittedResultV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): void;
|
|
2080
|
+
/** Validates a detached evidence signature without owning signing keys. */
|
|
2081
|
+
declare function assertEconomyEvidenceSignatureMetadata(signature: EconomyEvidenceSignatureMetadataV1): void;
|
|
2082
|
+
/** Validates a detached evidence signature without owning signing keys. */
|
|
2083
|
+
declare function assertEconomyEvidenceSignature(signature: EconomyEvidenceSignatureV1): void;
|
|
2084
|
+
/** Canonical body bytes used to derive a regional evidence-receipt ID. */
|
|
2085
|
+
declare function canonicalEconomyRegionalEvidenceReceiptBodyPayload(body: EconomyRegionalEvidenceReceiptBodyV1): string;
|
|
2086
|
+
/** Creates a signed region receipt after the adapter has produced a signature. */
|
|
2087
|
+
declare function createEconomyRegionalEvidenceReceipt(body: EconomyRegionalEvidenceReceiptBodyV1, signature: EconomyEvidenceSignatureV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): EconomyRegionalEvidenceReceiptV1;
|
|
2088
|
+
/** Validates a region receipt and its content-addressed unsigned body. */
|
|
2089
|
+
declare function assertEconomyRegionalEvidenceReceipt(receipt: EconomyRegionalEvidenceReceiptV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): void;
|
|
2090
|
+
/**
|
|
2091
|
+
* Prepares the regional content address and exact bytes for an external signer.
|
|
2092
|
+
* No placeholder signature value is required or returned.
|
|
2093
|
+
*/
|
|
2094
|
+
declare function prepareEconomyRegionalEvidenceReceiptSignature(body: EconomyRegionalEvidenceReceiptBodyV1, signature: EconomyEvidenceSignatureMetadataV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): EconomyPreparedEvidenceSignatureV1;
|
|
2095
|
+
/** Exact bytes covered by a regional receipt's detached signature. */
|
|
2096
|
+
declare function canonicalEconomyRegionalEvidenceReceiptSigningPayload(receipt: EconomyRegionalEvidenceReceiptV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): string;
|
|
2097
|
+
/** Canonical complete region-receipt bytes, including its signature. */
|
|
2098
|
+
declare function canonicalEconomyRegionalEvidenceReceiptPayload(receipt: EconomyRegionalEvidenceReceiptV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): string;
|
|
2099
|
+
/** Verifies one region receipt through an infrastructure-supplied key adapter. */
|
|
2100
|
+
declare function assertEconomyRegionalEvidenceReceiptSignature(receipt: EconomyRegionalEvidenceReceiptV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1, verifySignature: EconomyEvidenceSignatureVerifierV1): void;
|
|
2101
|
+
/**
|
|
2102
|
+
* Verifies an ordered regional hash-chain segment. Segments beginning after
|
|
2103
|
+
* sequence one must supply the trusted preceding receipt hash.
|
|
2104
|
+
*/
|
|
2105
|
+
declare function assertEconomyRegionalEvidenceChain(receipts: readonly EconomyRegionalEvidenceReceiptV1[], expectedPreviousReceiptHash: string | undefined, hashCanonicalPayload: CanonicalPayloadHashFunctionV1, verifySignature: EconomyEvidenceSignatureVerifierV1): void;
|
|
2106
|
+
/**
|
|
2107
|
+
* Proves that at least two distinct regions retained byte-identical recovery
|
|
2108
|
+
* content. Region-specific receipt metadata and signatures may differ.
|
|
2109
|
+
*/
|
|
2110
|
+
declare function assertEconomyRegionalEvidenceEquality(receipts: readonly EconomyRegionalEvidenceReceiptV1[], expectedRegions: readonly string[], hashCanonicalPayload: CanonicalPayloadHashFunctionV1): void;
|
|
2111
|
+
/** Validates the exact portable Merkle-proof shape. */
|
|
2112
|
+
declare function assertEconomyMerkleInclusionProof(proof: EconomyMerkleInclusionProofV1): void;
|
|
2113
|
+
/**
|
|
2114
|
+
* Recomputes duplicate-last Merkle inclusion against a canonical hourly anchor.
|
|
2115
|
+
* The hash adapter receives only domain-separated canonical node bytes.
|
|
2116
|
+
*/
|
|
2117
|
+
declare function assertEconomyMerkleInclusion(proof: EconomyMerkleInclusionProofV1, anchor: EconomyIntegrityAnchorManifestV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): void;
|
|
2118
|
+
/** Canonical body bytes used to derive a portable receipt ID. */
|
|
2119
|
+
declare function canonicalEconomyPortableCustomerReceiptBodyPayload(body: EconomyPortableCustomerReceiptBodyV1): string;
|
|
2120
|
+
/** Creates a signed portable receipt from a canonical content-addressed body. */
|
|
2121
|
+
declare function createEconomyPortableCustomerReceipt(body: EconomyPortableCustomerReceiptBodyV1, signature: EconomyEvidenceSignatureV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): EconomyPortableCustomerReceiptV1;
|
|
2122
|
+
/** Validates schema, privacy shape, signature shape, and content address. */
|
|
2123
|
+
declare function assertEconomyPortableCustomerReceipt(receipt: EconomyPortableCustomerReceiptV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): void;
|
|
2124
|
+
/**
|
|
2125
|
+
* Prepares the portable content address and exact bytes for an external signer.
|
|
2126
|
+
* No placeholder signature value is required or returned.
|
|
2127
|
+
*/
|
|
2128
|
+
declare function prepareEconomyPortableCustomerReceiptSignature(body: EconomyPortableCustomerReceiptBodyV1, signature: EconomyEvidenceSignatureMetadataV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): EconomyPreparedEvidenceSignatureV1;
|
|
2129
|
+
/** Exact bytes covered by a portable receipt's detached signature. */
|
|
2130
|
+
declare function canonicalEconomyPortableCustomerReceiptSigningPayload(receipt: EconomyPortableCustomerReceiptV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): string;
|
|
2131
|
+
/** Canonical complete portable-receipt bytes, including its signature. */
|
|
2132
|
+
declare function canonicalEconomyPortableCustomerReceiptPayload(receipt: EconomyPortableCustomerReceiptV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1): string;
|
|
2133
|
+
/** Verifies a portable receipt through an infrastructure-supplied key adapter. */
|
|
2134
|
+
declare function assertEconomyPortableCustomerReceiptSignature(receipt: EconomyPortableCustomerReceiptV1, hashCanonicalPayload: CanonicalPayloadHashFunctionV1, verifySignature: EconomyEvidenceSignatureVerifierV1): void;
|
|
2135
|
+
/**
|
|
2136
|
+
* Cross-validates the complete portable proof graph without storage, identity,
|
|
2137
|
+
* key-vault, or cloud-SDK dependencies.
|
|
2138
|
+
*/
|
|
2139
|
+
declare function assertEconomyPortableCustomerReceiptEvidence(receipt: EconomyPortableCustomerReceiptV1, regionalReceipts: readonly EconomyRegionalEvidenceReceiptV1[], expectedRegions: readonly string[], anchor: EconomyIntegrityAnchorManifestV1 | undefined, hashCanonicalPayload: CanonicalPayloadHashFunctionV1, verifySignature: EconomyEvidenceSignatureVerifierV1): void;
|
|
2140
|
+
|
|
1186
2141
|
type SpendRequestPurpose = "gameplay-conversion" | "non-gameplay";
|
|
1187
2142
|
type SpendRequestStatus = "requested" | "approved" | "rejected" | "expired" | "executed" | "cancelled";
|
|
1188
2143
|
/** Future child request; baseline adapters must reject creation while disabled. */
|
|
@@ -1204,4 +2159,4 @@ interface SpendRequestV1 {
|
|
|
1204
2159
|
/** Validates future child requests while creation remains policy-disabled. */
|
|
1205
2160
|
declare function assertSpendRequest(request: SpendRequestV1): void;
|
|
1206
2161
|
|
|
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 };
|
|
2162
|
+
export { type AccountId, type ActivityEntryV1, type ActivityStatus, type ActivityType, type AdjustmentRequestV1, type AdjustmentStatus, type AllocationId, type AllocationStatus, type AuditedChainedEconomicJournalTransactionV1, type AuditedEconomyCommandEnvelopeV1, 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 CanonicalPayloadHashFunctionV1, type ChainedEconomicJournalTransactionV1, type CloseModuleAllowanceInputV1, type CreateGameplayAllocationInputV1, type CreateModuleAllowanceInputV1, type CreateModulePurchaseReceiptInputV1, type CreateModuleSpendHoldInputV1, type CreateModuleSpendQuoteInputV1, EARLY_BACKER_SETTLEMENT_POLICY_V2, ECONOMY_AUTHORITY_COMMIT_OVERHEAD_OPERATIONS, ECONOMY_AUTHORITY_MAX_BATCH_BYTES, ECONOMY_AUTHORITY_MAX_BATCH_OPERATIONS, ECONOMY_AUTHORITY_MAX_RECORD_REFERENCES, ECONOMY_CONTRACT_VERSION, ECONOMY_RECOVERY_PROTOCOL_VERSION, type EarlyBackerEvaluationV1, type EarlyBackerEvaluationV2, type EarlyBackerWindowV1, type EconomicActivityStatusV1, type EconomicJournalStatus, type EconomicJournalTransactionV1, type EconomicWalletActivityEntryV1, type EconomyAcceptedCommandReceiptV1, type EconomyAcquisitionProviderV1, type EconomyAuditGraphV1, type EconomyAuditedIdempotencyResultV1, type EconomyAuditedIdempotencyScopeV1, type EconomyAuditedIdempotencyStateV1, type EconomyAuthorityCommitKindV1, type EconomyAuthorityCommitManifestV1, type EconomyAuthorityHeadV1, type EconomyAuthorityRecordKindV1, type EconomyAuthorityRecordReferenceV1, type EconomyAuthorityStateV1, type EconomyAuthorityWriteKindV1, type EconomyAuthorizationEvidenceV1, type EconomyCausationKindV1, type EconomyCausationReferenceV1, type EconomyClockPort, type EconomyCommandEnvelopeV1, type EconomyCommandProcessingDispositionV1, type EconomyCommandProcessingModeV1, type EconomyCommandResultOutcomeV1, type EconomyCommandResultReceiptV1, type EconomyCommandSourceV1, type EconomyCommandType, type EconomyCommandWorkflowEventV1, type EconomyCommandWorkflowStateV1, type EconomyContractVersion, type EconomyEncryptedOperationalHandleBindingV1, EconomyError, type EconomyErrorCode, type EconomyErrorEnvelopeV1, type EconomyEvidenceRecordReferenceV1, type EconomyEvidenceSignatureAlgorithmV1, type EconomyEvidenceSignatureMetadataV1, type EconomyEvidenceSignatureV1, type EconomyEvidenceSignatureVerificationInputV1, type EconomyEvidenceSignatureVerifierV1, type EconomyHmacFingerprintDomainV1, type EconomyHmacFingerprintV1, type EconomyHmacSha256DigestV1, type EconomyIdPort, type EconomyIdempotencyScopeV1, type EconomyIntegrityAnchorManifestV1, type EconomyIntegrityFailureCodeV1, type EconomyIntegrityVerificationReceiptV1, type EconomyIntegrityVerificationStatusV1, type EconomyMerkleInclusionProofV1, type EconomyMerkleProofStepV1, type EconomyOperationalHandlePurposeV1, type EconomyOutboxEventV1, type EconomyPersistencePort, type EconomyPersistencePortV2, type EconomyPersistencePortV3, type EconomyPortableCustomerReceiptBodyV1, type EconomyPortableCustomerReceiptV1, type EconomyPortableEvidenceReferenceV1, type EconomyPreparedEvidenceSignatureV1, type EconomyPrincipalTypeV1, type EconomyProviderEvidenceHashV1, type EconomyProviderEvidenceManifestV1, type EconomyQueryPortV1, type EconomyRecoveryAcceptanceBodyV1, type EconomyRecoveryAcceptanceEnvelopeV1, type EconomyRecoveryCommittedResultBodyV1, type EconomyRecoveryCommittedResultV1, type EconomyRecoveryDirectionV1, type EconomyRecoveryProtocolVersion, type EconomyRecoveryRecordKindV1, type EconomyRegionalEvidenceReceiptBodyV1, type EconomyRegionalEvidenceReceiptV1, type EconomySealedRecoveryPayloadV1, type EconomyUnitOfWork, type EconomyUnitOfWorkV2, type EconomyUnitOfWorkV3, type FundModuleAllowanceInputV1, type FxSnapshotV1, type GameplayAllocationV1, type GameplayLimitsV1, type GbpMinorUnitString, type HashedEconomyAuthorityCommitManifestV1, type HouseholdId, type IsoTimestamp, type JournalChainHeadV1, type JournalChainId, type JournalChainVerificationFailureCodeV1, type JournalChainVerificationResultV1, 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, advanceEconomyAuthorityHead, advanceJournalChainHead, applyPaidLotLifecycleEvent, applyPurchaseIntentTransition, applySourceLotMovement, applyTransactionToProjection, applyWalletBalanceDelta, applyWalletLifetimeDeltas, assertActivityEntry, assertAuditedEconomyCommandEnvelope, assertBalancedTransaction, assertDeterministicWalletBalanceSummary, assertDistinctAdjustmentApproval, assertEconomicJournalTransaction, assertEconomyAcceptedCommandReceipt, assertEconomyAuditGraph, assertEconomyAuditedIdempotencyResult, assertEconomyAuditedIdempotencyScope, assertEconomyAuthorityBatchLimits, assertEconomyAuthorityCommitManifest, assertEconomyAuthorityHead, assertEconomyAuthorityRecordReference, assertEconomyAuthorityRecoveryEvidence, assertEconomyAuthorizationEvidence, assertEconomyCommandEnvelope, assertEconomyCommandResultReceipt, assertEconomyCommandWorkflowEvent, assertEconomyEncryptedOperationalHandleBinding, assertEconomyEvidenceSignature, assertEconomyEvidenceSignatureMetadata, assertEconomyHmacFingerprint, assertEconomyIdempotencyScope, assertEconomyIdentifier, assertEconomyIntegrityAnchorManifest, assertEconomyIntegrityVerificationReceipt, assertEconomyMerkleInclusion, assertEconomyMerkleInclusionProof, assertEconomyPortableCustomerReceipt, assertEconomyPortableCustomerReceiptEvidence, assertEconomyPortableCustomerReceiptSignature, assertEconomyProviderEvidenceHash, assertEconomyProviderEvidenceManifest, assertEconomyRecoveryAcceptanceEnvelope, assertEconomyRecoveryCommittedResult, assertEconomyRecoveryResultLink, assertEconomyRegionalEvidenceChain, assertEconomyRegionalEvidenceEquality, assertEconomyRegionalEvidenceReceipt, assertEconomyRegionalEvidenceReceiptSignature, assertEconomySealedRecoveryPayload, assertExactAuditedEconomyCommandReplay, 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, canonicalAuditedEconomyCommandEnvelopePayload, canonicalEconomyAcceptedCommandReceiptPayload, canonicalEconomyAuthorityCommitManifestPayload, canonicalEconomyAuthorityHeadPayload, canonicalEconomyCommandResultReceiptPayload, canonicalEconomyEncryptedOperationalHandleBindingPayload, canonicalEconomyIntegrityAnchorManifestPayload, canonicalEconomyIntegrityVerificationReceiptPayload, canonicalEconomyPortableCustomerReceiptBodyPayload, canonicalEconomyPortableCustomerReceiptPayload, canonicalEconomyPortableCustomerReceiptSigningPayload, canonicalEconomyProviderEvidenceHashPayload, canonicalEconomyProviderEvidenceManifestPayload, canonicalEconomyRecoveryAcceptanceBodyPayload, canonicalEconomyRecoveryAcceptanceEnvelopePayload, canonicalEconomyRecoveryCommittedResultBodyPayload, canonicalEconomyRecoveryCommittedResultPayload, canonicalEconomyRegionalEvidenceReceiptBodyPayload, canonicalEconomyRegionalEvidenceReceiptPayload, canonicalEconomyRegionalEvidenceReceiptSigningPayload, canonicalTransactionPayload, closeModuleAllowance, convertRewardPayout, createEarlyBackerRetentionFromPaidLot, createEconomyPortableCustomerReceipt, createEconomyRecoveryAcceptanceEnvelope, createEconomyRecoveryCommittedResult, createEconomyRegionalEvidenceReceipt, 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, prepareEconomyPortableCustomerReceiptSignature, prepareEconomyRegionalEvidenceReceiptSignature, rebuildBalanceProjection, reclaimGameplayAllocation, reclaimModuleAllowance, reconcileModulePurchase, reducePaidLotLifecycleEvents, reducePurchaseIntentTransitions, releaseModuleSpendHold, reserveRollingPurchaseCaps, selectSourceLots, serializeGbpMinorUnits, serializeTokenSubunits, settleModuleSpendHold, sortEconomyAuthorityRecordReferences, sortStringRecord, subunitsToWholeTokens, sumTokenSubunits, toEconomyErrorEnvelope, transitionRollingPurchaseCapReservation, verifyJournalChainSegment, wholeTokensToSubunits };
|