@voltro/plugin-economy 0.0.0-stage → 0.88.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.
Files changed (177) hide show
  1. package/CHANGELOG.md +24492 -0
  2. package/LICENSE +61 -0
  3. package/README.md +2719 -2
  4. package/SECURITY.md +56 -0
  5. package/THIRD-PARTY-NOTICES.md +9841 -0
  6. package/dist/amount.js +20 -0
  7. package/dist/appleIap.server.js +262 -0
  8. package/dist/appleIapNotifications.server.js +162 -0
  9. package/dist/appleIapTrust.server.js +30 -0
  10. package/dist/bundleValue.server.js +112 -0
  11. package/dist/canonicalDataJson.js +10 -0
  12. package/dist/capture.js +53 -0
  13. package/dist/codePort.fixture.js +123 -0
  14. package/dist/codeStore.server.js +439 -0
  15. package/dist/codeTables.entity.js +43 -0
  16. package/dist/codes.d.ts +150 -0
  17. package/dist/codes.js +82 -0
  18. package/dist/components.d.ts +397 -0
  19. package/dist/components.js +283 -0
  20. package/dist/consistency.server.js +115 -0
  21. package/dist/containerStore.server.js +687 -0
  22. package/dist/containerStore.testFixtures.js +75 -0
  23. package/dist/containerTables.entity.js +45 -0
  24. package/dist/containers.d.ts +311 -0
  25. package/dist/containers.fixture.js +128 -0
  26. package/dist/containers.js +214 -0
  27. package/dist/containers.server.js +39 -0
  28. package/dist/containersPort.fixture.js +74 -0
  29. package/dist/currency.js +32 -0
  30. package/dist/declarationFixtures.js +61 -0
  31. package/dist/economy-app/events/economy.refundReversed.event.ts +1 -0
  32. package/dist/economy-app/events/economy.refunded.event.ts +1 -0
  33. package/dist/economyPort.fixture.js +124 -0
  34. package/dist/errors.d.ts +14 -0
  35. package/dist/errors.js +21 -0
  36. package/dist/events.d.ts +46 -0
  37. package/dist/events.js +1 -0
  38. package/dist/googleIap.server.js +391 -0
  39. package/dist/googleIapNotifications.server.js +130 -0
  40. package/dist/googleIapSubscription.server.js +183 -0
  41. package/dist/iap.d.ts +309 -0
  42. package/dist/iap.js +303 -0
  43. package/dist/iap.testFixtures.js +144 -0
  44. package/dist/iapAccountTables.entity.js +39 -0
  45. package/dist/iapAccounts.server.js +200 -0
  46. package/dist/iapBinding.server.js +523 -0
  47. package/dist/iapCheckout.server.js +97 -0
  48. package/dist/iapCompletion.server.js +55 -0
  49. package/dist/iapCurrentState.server.js +107 -0
  50. package/dist/iapCurrentState.testFixtures.js +22 -0
  51. package/dist/iapCurrentStatePort.fixture.js +63 -0
  52. package/dist/iapEntitlements.d.ts +79 -0
  53. package/dist/iapEntitlements.js +57 -0
  54. package/dist/iapEntitlements.server.js +48 -0
  55. package/dist/iapEntitlementsBinding.server.js +105 -0
  56. package/dist/iapEntitlementsPort.fixture.js +80 -0
  57. package/dist/iapInstalledEntitlements.testFixtures.js +75 -0
  58. package/dist/iapInstalledNotifications.testFixtures.js +93 -0
  59. package/dist/iapInventoryRefunds.server.js +261 -0
  60. package/dist/iapNotificationCustodyPort.fixture.js +67 -0
  61. package/dist/iapNotificationPort.fixture.js +73 -0
  62. package/dist/iapNotificationProcessor.server.js +134 -0
  63. package/dist/iapNotificationProcessor.testFixtures.js +63 -0
  64. package/dist/iapNotificationProcessorPort.fixture.js +55 -0
  65. package/dist/iapNotificationSchedule.server.js +69 -0
  66. package/dist/iapNotificationStore.server.js +352 -0
  67. package/dist/iapNotificationStore.testFixtures.js +31 -0
  68. package/dist/iapNotificationTables.entity.js +48 -0
  69. package/dist/iapNotificationTarget.server.js +36 -0
  70. package/dist/iapNotificationTarget.testFixtures.js +29 -0
  71. package/dist/iapNotifications.d.ts +644 -0
  72. package/dist/iapNotifications.js +6 -0
  73. package/dist/iapNotifications.server.js +95 -0
  74. package/dist/iapNotificationsBinding.server.js +232 -0
  75. package/dist/iapNotificationsSystemPort.fixture.js +50 -0
  76. package/dist/iapPlugin.testFixtures.js +59 -0
  77. package/dist/iapPort.fixture.js +74 -0
  78. package/dist/iapProviderCapture.server.js +17 -0
  79. package/dist/iapRecovery.d.ts +146 -0
  80. package/dist/iapRecovery.js +89 -0
  81. package/dist/iapRefundEventDelivery.server.js +82 -0
  82. package/dist/iapRefundEvents.js +44 -0
  83. package/dist/iapRefundEventsPort.fixture.js +59 -0
  84. package/dist/iapRefundPort.fixture.js +54 -0
  85. package/dist/iapRefundTables.entity.js +55 -0
  86. package/dist/iapRefunds.d.ts +755 -0
  87. package/dist/iapRefunds.js +6 -0
  88. package/dist/iapRefunds.server.js +553 -0
  89. package/dist/iapRefunds.testFixtures.js +64 -0
  90. package/dist/iapSpendAdmission.server.js +98 -0
  91. package/dist/iapStore.server.js +740 -0
  92. package/dist/iapStore.testFixtures.js +127 -0
  93. package/dist/iapTables.entity.js +80 -0
  94. package/dist/iapVerification.server.js +120 -0
  95. package/dist/index.d.ts +2984 -0
  96. package/dist/index.js +15 -0
  97. package/dist/intentionRecovery.js +133 -0
  98. package/dist/ledger.js +77 -0
  99. package/dist/loyalty.d.ts +274 -0
  100. package/dist/loyalty.fixture.js +92 -0
  101. package/dist/loyalty.js +311 -0
  102. package/dist/loyaltyBinding.server.js +203 -0
  103. package/dist/loyaltyPort.fixture.js +86 -0
  104. package/dist/loyaltyShopSource.server.js +90 -0
  105. package/dist/loyaltyStore.server.js +552 -0
  106. package/dist/loyaltyStore.testFixtures.js +82 -0
  107. package/dist/loyaltyTables.entity.js +49 -0
  108. package/dist/offerMerchandising.fixture.js +114 -0
  109. package/dist/offerMerchandising.js +282 -0
  110. package/dist/offerPolicies.d.ts +441 -0
  111. package/dist/offerPolicies.fixture.js +53 -0
  112. package/dist/offerPolicies.js +267 -0
  113. package/dist/piggyBanks.d.ts +272 -0
  114. package/dist/piggyBanks.fixture.js +70 -0
  115. package/dist/piggyBanks.js +200 -0
  116. package/dist/piggyBinding.server.js +204 -0
  117. package/dist/piggyPort.fixture.js +72 -0
  118. package/dist/piggyStore.server.js +610 -0
  119. package/dist/piggyStore.testFixtures.js +97 -0
  120. package/dist/piggyTables.entity.js +40 -0
  121. package/dist/plugin.js +1047 -0
  122. package/dist/port.js +12 -0
  123. package/dist/price.d.ts +99 -0
  124. package/dist/price.js +143 -0
  125. package/dist/purchaseRecovery.js +55 -0
  126. package/dist/reports.server.js +114 -0
  127. package/dist/rpc.d.ts +3201 -0
  128. package/dist/rpc.js +1200 -0
  129. package/dist/sanctionsTradeAuthority.server.js +79 -0
  130. package/dist/server.d.ts +3856 -0
  131. package/dist/server.js +43 -0
  132. package/dist/shop.d.ts +279 -0
  133. package/dist/shop.js +195 -0
  134. package/dist/shop.testFixtures.js +113 -0
  135. package/dist/shopPort.fixture.js +71 -0
  136. package/dist/shopPresentation.js +67 -0
  137. package/dist/shopStore.server.js +623 -0
  138. package/dist/shopTables.entity.js +62 -0
  139. package/dist/shopUiCopy.js +56 -0
  140. package/dist/spendLimits.d.ts +140 -0
  141. package/dist/spendLimits.fixture.js +52 -0
  142. package/dist/spendLimits.js +154 -0
  143. package/dist/spendLimitsPort.fixture.js +119 -0
  144. package/dist/subscriptionBinding.server.js +210 -0
  145. package/dist/subscriptionStore.server.js +642 -0
  146. package/dist/subscriptionStore.testFixtures.js +71 -0
  147. package/dist/subscriptionTables.entity.js +36 -0
  148. package/dist/subscriptions.d.ts +394 -0
  149. package/dist/subscriptions.fixture.js +96 -0
  150. package/dist/subscriptions.js +212 -0
  151. package/dist/subscriptionsPort.fixture.js +75 -0
  152. package/dist/systemFixtures.js +88 -0
  153. package/dist/tables.entity.js +82 -0
  154. package/dist/testing.d.ts +4615 -0
  155. package/dist/testing.js +29 -0
  156. package/dist/tradeAuthority.server.js +171 -0
  157. package/dist/tradeBinding.server.js +200 -0
  158. package/dist/tradeComponents.js +341 -0
  159. package/dist/tradeEscrow.server.js +231 -0
  160. package/dist/tradeEscrow.testFixtures.js +132 -0
  161. package/dist/tradeExpiry.server.js +42 -0
  162. package/dist/tradeRecovery.js +47 -0
  163. package/dist/tradeStore.server.js +749 -0
  164. package/dist/tradeStore.testFixtures.js +72 -0
  165. package/dist/tradeTables.entity.js +65 -0
  166. package/dist/tradeUiCopy.js +78 -0
  167. package/dist/trades.d.ts +246 -0
  168. package/dist/trades.fixture.js +102 -0
  169. package/dist/trades.js +288 -0
  170. package/dist/tradesPort.fixture.js +93 -0
  171. package/dist/walletEscrow.js +105 -0
  172. package/dist/walletEscrow.server.js +375 -0
  173. package/dist/walletKeys.server.js +4 -0
  174. package/dist/walletStore.js +570 -0
  175. package/dist/web.d.ts +2257 -0
  176. package/dist/web.js +8 -0
  177. package/package.json +161 -4
package/dist/web.d.ts ADDED
@@ -0,0 +1,2257 @@
1
+ import { ActionProcedureDescriptor } from '@voltro/protocol';
2
+ import { ActionState } from '@voltro/client';
3
+ import { QueryProcedureDescriptor } from '@voltro/protocol';
4
+ import { Schema } from 'effect';
5
+ import { SubscriptionIdle } from '@voltro/client';
6
+ import { SubscriptionState } from '@voltro/client';
7
+ import { YieldableError } from 'effect/Cause';
8
+
9
+ /** Explicit browser capabilities; missing Web Locks/storage never falls back to memory. */
10
+ export declare const browserShopPurchaseJournal: (storage: Pick<Storage, "getItem" | "setItem" | "removeItem">, locks: Pick<LockManager, "request">) => ShopPurchaseJournal;
11
+
12
+ export declare const browserTradeIntentionJournal: (storage: Pick<Storage, "getItem" | "setItem" | "removeItem">, locks: Pick<LockManager, "request">) => TradeIntentionJournal;
13
+
14
+ /** Store only explicit intentions under stable app+authenticated account scope; no credentials/state. */
15
+ export declare const captureTradeIntention: (input: unknown) => TradeIntention;
16
+
17
+ /** Pure detached wire shape only. New admission must still validate actual
18
+ * currencies and rules; originals compare before current declarations. */
19
+ declare const captureTradeProposeIntention: (input: TradeProposeInput) => Readonly<{
20
+ toId: string | null;
21
+ offered: TradeLeg;
22
+ requested: TradeLeg;
23
+ durationMs: number;
24
+ requestId: string;
25
+ }>;
26
+
27
+ declare const codesRedeemDescriptor: ActionProcedureDescriptor<"economy.redeem", Schema.Struct<{
28
+ readonly code: Schema.String;
29
+ readonly requestId: Schema.String;
30
+ }>, Schema.Struct<{
31
+ readonly operationId: Schema.String;
32
+ readonly codeId: Schema.String;
33
+ readonly version: Schema.String;
34
+ readonly campaign: Schema.String;
35
+ readonly at: Schema.Number;
36
+ readonly transfers: Schema.$Array<Schema.Struct<{
37
+ readonly txId: Schema.String;
38
+ readonly currency: Schema.String;
39
+ readonly amount: Schema.String;
40
+ readonly at: Schema.Number;
41
+ }>>;
42
+ readonly grants: Schema.$Array<Schema.Struct<{
43
+ readonly operationId: Schema.String;
44
+ readonly kind: Schema.Literal<"grant">;
45
+ readonly changes: Schema.$Array<Schema.Struct<{
46
+ readonly instanceId: Schema.String;
47
+ readonly delta: Schema.Number;
48
+ }>>;
49
+ readonly at: Schema.Number;
50
+ }>>;
51
+ }>, typeof EconomyError>;
52
+
53
+ declare const containerOpenDescriptor: ActionProcedureDescriptor<"economy.openContainer", Schema.Struct<{
54
+ readonly containerId: Schema.String;
55
+ readonly containerVersion: Schema.String;
56
+ readonly containerDigest: Schema.String;
57
+ readonly disclosureDigest: Schema.String;
58
+ readonly requestId: Schema.String;
59
+ readonly currency: Schema.optional<Schema.String>;
60
+ }>, Schema.Struct<{
61
+ readonly operationId: Schema.String;
62
+ readonly containerId: Schema.String;
63
+ readonly containerVersion: Schema.String;
64
+ readonly containerDigest: Schema.String;
65
+ readonly dropId: Schema.String;
66
+ readonly rarity: Schema.String;
67
+ readonly previousMisses: Schema.Number;
68
+ readonly misses: Schema.Number;
69
+ readonly sequence: Schema.Number;
70
+ readonly at: Schema.Number;
71
+ readonly distribution: Schema.Struct<{
72
+ readonly entries: Schema.$Array<Schema.Struct<{
73
+ readonly dropId: Schema.String;
74
+ readonly weight: Schema.String;
75
+ }>>;
76
+ readonly total: Schema.String;
77
+ readonly guaranteed: Schema.Boolean;
78
+ }>;
79
+ readonly pricePaid: Schema.Union<readonly [Schema.Struct<{
80
+ readonly kind: Schema.Literal<"free">;
81
+ }>, Schema.Struct<{
82
+ readonly kind: Schema.Literal<"virtual">;
83
+ readonly currency: Schema.String;
84
+ readonly amount: Schema.String;
85
+ }>]>;
86
+ readonly transfers: Schema.$Array<Schema.Struct<{
87
+ readonly txId: Schema.String;
88
+ readonly currency: Schema.String;
89
+ readonly amount: Schema.String;
90
+ readonly at: Schema.Number;
91
+ }>>;
92
+ readonly grants: Schema.$Array<Schema.Struct<{
93
+ readonly operationId: Schema.String;
94
+ readonly kind: Schema.Literal<"grant">;
95
+ readonly changes: Schema.$Array<Schema.Struct<{
96
+ readonly instanceId: Schema.String;
97
+ readonly delta: Schema.Number;
98
+ }>>;
99
+ readonly at: Schema.Number;
100
+ }>>;
101
+ }>, typeof EconomyError>;
102
+
103
+ /** Transport is the installed Shop buy action (e.g. useShopBuy().run). No new runtime. */
104
+ export declare const createShopPurchaseRecovery: (journal: ShopPurchaseJournal, buy: (input: ShopBuyInput) => Promise<ShopOrderReceipt>) => ShopPurchaseRecovery;
105
+
106
+ /** Callers connect the three installed action hooks. Retry stays explicit and keeps the Web Lock through settlement. */
107
+ export declare const createTradeRecovery: (journal: TradeIntentionJournal, input: TradeIntentionTransport) => TradeRecovery;
108
+
109
+ declare type EconomyAmountInput = string | number | bigint;
110
+
111
+ /** Redacted codes; never carries owners, amounts or provider payloads. */
112
+ declare class EconomyError extends EconomyError_base {
113
+ }
114
+
115
+ declare const EconomyError_base: Schema.Class<EconomyError, Schema.TaggedStruct<"EconomyError", {
116
+ readonly code: Schema.Literals<readonly ["invalid_currency", "invalid_amount", "overflow", "invalid_price", "real_money_disabled", "invalid_input", "invalid_record", "currency_cap_reached", "insufficient_funds", "conflict", "forbidden", "unavailable", "not_found", "erased", "limit_exceeded", "already_redeemed"]>;
117
+ }>, YieldableError>;
118
+
119
+ declare const iapEntitledDescriptor: QueryProcedureDescriptor<"economy.iap.entitled", Schema.Struct<{
120
+ readonly offerId: Schema.String;
121
+ }>, Schema.Struct<{
122
+ readonly offerId: Schema.String;
123
+ readonly entitled: Schema.Boolean;
124
+ readonly expiresAt: Schema.NullOr<Schema.Number>;
125
+ readonly observedAt: Schema.Number;
126
+ }>, typeof EconomyError>;
127
+
128
+ declare const iapReceiptDescriptor: QueryProcedureDescriptor<"economy.iap.receipt", Schema.Struct<{
129
+ readonly receiptDigest: Schema.String;
130
+ readonly channel: Schema.Literals<readonly ["ios", "android", "steam", "web"]>;
131
+ readonly offerId: Schema.String;
132
+ readonly offerVersion: Schema.String;
133
+ readonly requestId: Schema.String;
134
+ }>, Schema.Union<readonly [Schema.Struct<{
135
+ readonly requestId: Schema.String;
136
+ readonly state: Schema.Literals<readonly ["not-observed", "pending"]>;
137
+ }>, Schema.Struct<{
138
+ readonly requestId: Schema.String;
139
+ readonly state: Schema.Literal<"fulfilled">;
140
+ readonly receipt: Schema.Struct<{
141
+ readonly orderId: Schema.String;
142
+ readonly offerId: Schema.String;
143
+ readonly offerVersion: Schema.String;
144
+ readonly quantity: Schema.Number;
145
+ readonly at: Schema.Number;
146
+ readonly pricePaid: Schema.NullOr<Schema.Struct<{
147
+ readonly currency: Schema.String;
148
+ readonly units: Schema.String;
149
+ readonly scale: Schema.Number;
150
+ }>>;
151
+ readonly transfers: Schema.$Array<Schema.Struct<{
152
+ readonly txId: Schema.String;
153
+ readonly currency: Schema.String;
154
+ readonly amount: Schema.String;
155
+ readonly at: Schema.Number;
156
+ }>>;
157
+ readonly grants: Schema.$Array<Schema.Struct<{
158
+ readonly operationId: Schema.String;
159
+ readonly kind: Schema.Literal<"grant">;
160
+ readonly changes: Schema.$Array<Schema.Struct<{
161
+ readonly instanceId: Schema.String;
162
+ readonly delta: Schema.Number;
163
+ }>>;
164
+ readonly at: Schema.Number;
165
+ }>>;
166
+ }>;
167
+ readonly refund: Schema.optional<Schema.Struct<{
168
+ readonly sequence: Schema.Number;
169
+ readonly state: Schema.Literals<readonly ["active", "partially-refunded", "revoked"]>;
170
+ readonly refundNumerator: Schema.Number;
171
+ readonly refundDenominator: Schema.Number;
172
+ readonly observedAt: Schema.Number;
173
+ }>>;
174
+ }>, Schema.Struct<{
175
+ readonly requestId: Schema.String;
176
+ readonly state: Schema.Literals<readonly ["partially-refunded", "refunded"]>;
177
+ readonly receipt: Schema.Struct<{
178
+ readonly orderId: Schema.String;
179
+ readonly offerId: Schema.String;
180
+ readonly offerVersion: Schema.String;
181
+ readonly quantity: Schema.Number;
182
+ readonly at: Schema.Number;
183
+ readonly pricePaid: Schema.NullOr<Schema.Struct<{
184
+ readonly currency: Schema.String;
185
+ readonly units: Schema.String;
186
+ readonly scale: Schema.Number;
187
+ }>>;
188
+ readonly transfers: Schema.$Array<Schema.Struct<{
189
+ readonly txId: Schema.String;
190
+ readonly currency: Schema.String;
191
+ readonly amount: Schema.String;
192
+ readonly at: Schema.Number;
193
+ }>>;
194
+ readonly grants: Schema.$Array<Schema.Struct<{
195
+ readonly operationId: Schema.String;
196
+ readonly kind: Schema.Literal<"grant">;
197
+ readonly changes: Schema.$Array<Schema.Struct<{
198
+ readonly instanceId: Schema.String;
199
+ readonly delta: Schema.Number;
200
+ }>>;
201
+ readonly at: Schema.Number;
202
+ }>>;
203
+ }>;
204
+ readonly refund: Schema.Struct<{
205
+ readonly sequence: Schema.Number;
206
+ readonly state: Schema.Literals<readonly ["active", "partially-refunded", "revoked"]>;
207
+ readonly refundNumerator: Schema.Number;
208
+ readonly refundDenominator: Schema.Number;
209
+ readonly observedAt: Schema.Number;
210
+ }>;
211
+ }>]>, typeof EconomyError>;
212
+
213
+ declare const loyaltyMineDescriptor: QueryProcedureDescriptor<"economy.loyalty.mine", Schema.Struct<{
214
+ readonly loyaltyId: Schema.String;
215
+ }>, Schema.Struct<{
216
+ readonly loyalty: Schema.Struct<{
217
+ readonly id: Schema.String;
218
+ readonly version: Schema.String;
219
+ readonly titleKey: Schema.String;
220
+ readonly decay: Schema.Literals<readonly ["none", "seasonal"]>;
221
+ readonly pointsFrom: Schema.$Array<Schema.Struct<{
222
+ readonly id: Schema.String;
223
+ readonly kind: Schema.Literals<readonly ["purchase.real", "purchase.virtual"]>;
224
+ readonly currency: Schema.String;
225
+ readonly numerator: Schema.String;
226
+ readonly denominator: Schema.String;
227
+ }>>;
228
+ readonly tiers: Schema.$Array<Schema.Struct<{
229
+ readonly id: Schema.String;
230
+ readonly at: Schema.String;
231
+ readonly perks: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
232
+ readonly id: Schema.String;
233
+ readonly kind: Schema.Literals<readonly ["xpMultiplier", "discount"]>;
234
+ readonly bps: Schema.Number;
235
+ }>, Schema.Struct<{
236
+ readonly id: Schema.String;
237
+ readonly kind: Schema.Literal<"chatBadge">;
238
+ readonly badgeId: Schema.String;
239
+ }>, Schema.Struct<{
240
+ readonly id: Schema.String;
241
+ readonly kind: Schema.Literal<"inboxGift">;
242
+ readonly items: Schema.$Array<Schema.Struct<{
243
+ readonly itemId: Schema.String;
244
+ readonly qty: Schema.Number;
245
+ }>>;
246
+ readonly currencies: Schema.$Array<Schema.Struct<{
247
+ readonly currency: Schema.String;
248
+ readonly amount: Schema.String;
249
+ }>>;
250
+ }>]>>;
251
+ }>>;
252
+ }>;
253
+ readonly rulesVersion: Schema.String;
254
+ readonly seasonId: Schema.NullOr<Schema.String>;
255
+ readonly points: Schema.String;
256
+ readonly tierId: Schema.String;
257
+ readonly perks: Schema.$Array<Schema.Union<readonly [Schema.Struct<{
258
+ readonly id: Schema.String;
259
+ readonly kind: Schema.Literals<readonly ["xpMultiplier", "discount"]>;
260
+ readonly bps: Schema.Number;
261
+ }>, Schema.Struct<{
262
+ readonly id: Schema.String;
263
+ readonly kind: Schema.Literal<"chatBadge">;
264
+ readonly badgeId: Schema.String;
265
+ }>, Schema.Struct<{
266
+ readonly id: Schema.String;
267
+ readonly kind: Schema.Literal<"inboxGift">;
268
+ readonly items: Schema.$Array<Schema.Struct<{
269
+ readonly itemId: Schema.String;
270
+ readonly qty: Schema.Number;
271
+ }>>;
272
+ readonly currencies: Schema.$Array<Schema.Struct<{
273
+ readonly currency: Schema.String;
274
+ readonly amount: Schema.String;
275
+ }>>;
276
+ }>]>>;
277
+ }>, typeof EconomyError>;
278
+
279
+ declare const loyaltyReceiptDescriptor: QueryProcedureDescriptor<"economy.loyalty.receipt", Schema.Struct<{
280
+ readonly requestId: Schema.String;
281
+ }>, Schema.Union<readonly [Schema.Struct<{
282
+ readonly requestId: Schema.String;
283
+ readonly state: Schema.Literal<"not-observed">;
284
+ }>, Schema.Struct<{
285
+ readonly requestId: Schema.String;
286
+ readonly state: Schema.Literal<"fulfilled">;
287
+ readonly receipt: Schema.Struct<{
288
+ readonly operationId: Schema.String;
289
+ readonly requestId: Schema.String;
290
+ readonly loyaltyId: Schema.String;
291
+ readonly entry: Schema.Union<readonly [Schema.Struct<{
292
+ readonly kind: Schema.Literal<"credit">;
293
+ readonly sourceId: Schema.String;
294
+ readonly purchaseId: Schema.String;
295
+ readonly purchaseAmount: Schema.String;
296
+ readonly numerator: Schema.String;
297
+ readonly denominator: Schema.String;
298
+ readonly id: Schema.String;
299
+ readonly sequence: Schema.Number;
300
+ readonly at: Schema.Number;
301
+ readonly seasonId: Schema.NullOr<Schema.String>;
302
+ readonly delta: Schema.String;
303
+ }>, Schema.Struct<{
304
+ readonly kind: Schema.Literal<"reverse">;
305
+ readonly originalId: Schema.String;
306
+ readonly refundId: Schema.String;
307
+ readonly totalRefunded: Schema.String;
308
+ readonly id: Schema.String;
309
+ readonly sequence: Schema.Number;
310
+ readonly at: Schema.Number;
311
+ readonly seasonId: Schema.NullOr<Schema.String>;
312
+ readonly delta: Schema.String;
313
+ }>]>;
314
+ readonly points: Schema.String;
315
+ }>;
316
+ }>]>, typeof EconomyError>;
317
+
318
+ declare const piggyReceiptDescriptor: QueryProcedureDescriptor<"economy.piggyBanks.receipt", Schema.Struct<{
319
+ readonly requestId: Schema.String;
320
+ }>, Schema.Union<readonly [Schema.Struct<{
321
+ readonly requestId: Schema.String;
322
+ readonly state: Schema.Literal<"not-observed">;
323
+ }>, Schema.Struct<{
324
+ readonly requestId: Schema.String;
325
+ readonly state: Schema.Literal<"fulfilled">;
326
+ readonly receipt: Schema.Union<readonly [Schema.Struct<{
327
+ readonly event: Schema.Struct<{
328
+ readonly kind: Schema.Literal<"fill">;
329
+ readonly authorityId: Schema.String;
330
+ readonly eventId: Schema.String;
331
+ readonly sourceId: Schema.String;
332
+ readonly acceptedAmount: Schema.String;
333
+ readonly delta: Schema.String;
334
+ readonly id: Schema.String;
335
+ readonly sequence: Schema.Number;
336
+ readonly at: Schema.Number;
337
+ }>;
338
+ readonly operationId: Schema.String;
339
+ readonly requestId: Schema.String;
340
+ readonly bankId: Schema.String;
341
+ readonly available: Schema.String;
342
+ }>, Schema.Struct<{
343
+ readonly event: Schema.Struct<{
344
+ readonly kind: Schema.Literal<"unlock">;
345
+ readonly amount: Schema.String;
346
+ readonly remaining: Schema.String;
347
+ readonly id: Schema.String;
348
+ readonly sequence: Schema.Number;
349
+ readonly at: Schema.Number;
350
+ }>;
351
+ readonly value: Schema.Struct<{
352
+ readonly orderId: Schema.String;
353
+ readonly offerId: Schema.String;
354
+ readonly offerVersion: Schema.String;
355
+ readonly offerDigest: Schema.String;
356
+ readonly quantity: Schema.Number;
357
+ readonly at: Schema.Number;
358
+ readonly pricePaid: Schema.Union<readonly [Schema.Struct<{
359
+ readonly kind: Schema.Literal<"free">;
360
+ }>, Schema.Struct<{
361
+ readonly kind: Schema.Literal<"virtual">;
362
+ readonly currency: Schema.String;
363
+ readonly amount: Schema.String;
364
+ }>]>;
365
+ readonly transfers: Schema.$Array<Schema.Struct<{
366
+ readonly txId: Schema.String;
367
+ readonly currency: Schema.String;
368
+ readonly amount: Schema.String;
369
+ readonly at: Schema.Number;
370
+ }>>;
371
+ readonly grants: Schema.$Array<Schema.Struct<{
372
+ readonly operationId: Schema.String;
373
+ readonly kind: Schema.Literal<"grant">;
374
+ readonly changes: Schema.$Array<Schema.Struct<{
375
+ readonly instanceId: Schema.String;
376
+ readonly delta: Schema.Number;
377
+ }>>;
378
+ readonly at: Schema.Number;
379
+ }>>;
380
+ }>;
381
+ readonly operationId: Schema.String;
382
+ readonly requestId: Schema.String;
383
+ readonly bankId: Schema.String;
384
+ readonly available: Schema.String;
385
+ }>]>;
386
+ }>]>, typeof EconomyError>;
387
+
388
+ declare const shopBuyDescriptor: ActionProcedureDescriptor<"shop.buy", Schema.Struct<{
389
+ readonly offerId: Schema.String;
390
+ readonly offerVersion: Schema.String;
391
+ readonly offerDigest: Schema.String;
392
+ readonly requestId: Schema.String;
393
+ readonly currency: Schema.optional<Schema.String>;
394
+ readonly qty: Schema.optional<Schema.Number>;
395
+ }>, Schema.Struct<{
396
+ readonly orderId: Schema.String;
397
+ readonly offerId: Schema.String;
398
+ readonly offerVersion: Schema.String;
399
+ readonly offerDigest: Schema.String;
400
+ readonly quantity: Schema.Number;
401
+ readonly at: Schema.Number;
402
+ readonly pricePaid: Schema.Union<readonly [Schema.Struct<{
403
+ readonly kind: Schema.Literal<"free">;
404
+ }>, Schema.Struct<{
405
+ readonly kind: Schema.Literal<"virtual">;
406
+ readonly currency: Schema.String;
407
+ readonly amount: Schema.String;
408
+ }>]>;
409
+ readonly transfers: Schema.$Array<Schema.Struct<{
410
+ readonly txId: Schema.String;
411
+ readonly currency: Schema.String;
412
+ readonly amount: Schema.String;
413
+ readonly at: Schema.Number;
414
+ }>>;
415
+ readonly grants: Schema.$Array<Schema.Struct<{
416
+ readonly operationId: Schema.String;
417
+ readonly kind: Schema.Literal<"grant">;
418
+ readonly changes: Schema.$Array<Schema.Struct<{
419
+ readonly instanceId: Schema.String;
420
+ readonly delta: Schema.Number;
421
+ }>>;
422
+ readonly at: Schema.Number;
423
+ }>>;
424
+ }>, typeof EconomyError>;
425
+
426
+ declare interface ShopBuyInput {
427
+ readonly offerId: string;
428
+ readonly offerVersion: string;
429
+ readonly offerDigest: string;
430
+ readonly requestId: string;
431
+ readonly currency?: string | undefined;
432
+ readonly qty?: number | undefined;
433
+ }
434
+
435
+ declare interface ShopOrderReceipt {
436
+ readonly orderId: string;
437
+ readonly offerId: string;
438
+ readonly offerVersion: string;
439
+ readonly offerDigest: string;
440
+ readonly quantity: number;
441
+ readonly at: number;
442
+ readonly pricePaid: {
443
+ readonly kind: 'free';
444
+ } | {
445
+ readonly kind: 'virtual';
446
+ readonly currency: string;
447
+ readonly amount: string;
448
+ };
449
+ readonly transfers: readonly {
450
+ readonly txId: string;
451
+ readonly currency: string;
452
+ readonly amount: string;
453
+ readonly at: number;
454
+ }[];
455
+ readonly grants: readonly {
456
+ readonly operationId: string;
457
+ readonly kind: 'grant';
458
+ readonly changes: readonly {
459
+ readonly instanceId: string;
460
+ readonly delta: number;
461
+ }[];
462
+ readonly at: number;
463
+ }[];
464
+ }
465
+
466
+ /** The implementation must hold one cross-tab lock through the entire callback. */
467
+ export declare interface ShopPurchaseJournal {
468
+ readonly withLocked: <A>(scope: string, work: (slot: ShopPurchaseSlot) => Promise<A>) => Promise<A>;
469
+ }
470
+
471
+ /** Nonterminal observations never authorize a new request identity or prove that no purchase can commit. */
472
+ declare type ShopPurchaseObservation = {
473
+ readonly requestId: string;
474
+ readonly state: 'not-observed' | 'pending';
475
+ } | {
476
+ readonly requestId: string;
477
+ readonly state: 'fulfilled';
478
+ readonly receipt: ShopOrderReceipt;
479
+ };
480
+
481
+ export declare interface ShopPurchaseRecovery {
482
+ /** Every call invalidates queued/in-flight continuations, even away then back. */
483
+ readonly selectScope: (scope: string | undefined) => void;
484
+ readonly pending: () => Promise<ShopPurchaseReference | undefined>;
485
+ /** A user selects an intention; durably acknowledge it before any transport. */
486
+ readonly begin: (input: ShopBuyInput) => Promise<ShopPurchaseReference>;
487
+ /** Explicit retry of the saved intention; never automatic replay or a fresh ID. */
488
+ readonly retry: (original: ShopBuyInput) => Promise<ShopOrderReceipt>;
489
+ readonly observe: (input: ShopPurchaseObservation) => Promise<ShopPurchaseReference | undefined>;
490
+ }
491
+
492
+ export declare interface ShopPurchaseReference {
493
+ readonly version: 1;
494
+ /** Stable app + authenticated account/tenant scope; no endpoint credentials. */
495
+ readonly scope: string;
496
+ readonly request: ShopBuyInput;
497
+ }
498
+
499
+ export declare interface ShopPurchaseSlot {
500
+ readonly read: () => ShopPurchaseReference | undefined;
501
+ readonly write: (reference: ShopPurchaseReference) => void;
502
+ readonly clear: (reference: ShopPurchaseReference) => void;
503
+ }
504
+
505
+ declare const subscriptionReceiptDescriptor: QueryProcedureDescriptor<"economy.subscriptions.receipt", Schema.Union<readonly [Schema.Struct<{
506
+ readonly kind: Schema.Literal<"start">;
507
+ readonly intent: Schema.Struct<{
508
+ readonly subscriptionId: Schema.String;
509
+ readonly subscriptionVersion: Schema.String;
510
+ readonly subscriptionDigest: Schema.String;
511
+ readonly requestId: Schema.String;
512
+ readonly currency: Schema.optional<Schema.String>;
513
+ }>;
514
+ }>, Schema.Struct<{
515
+ readonly kind: Schema.Literals<readonly ["renew", "daily", "cancel"]>;
516
+ readonly intent: Schema.Struct<{
517
+ readonly entitlementId: Schema.String;
518
+ readonly requestId: Schema.String;
519
+ }>;
520
+ }>]>, Schema.Union<readonly [Schema.Struct<{
521
+ readonly requestId: Schema.String;
522
+ readonly state: Schema.Literal<"not-observed">;
523
+ }>, Schema.Struct<{
524
+ readonly requestId: Schema.String;
525
+ readonly state: Schema.Literal<"fulfilled">;
526
+ readonly receipt: Schema.Union<readonly [Schema.Struct<{
527
+ readonly operationId: Schema.String;
528
+ readonly entitlementId: Schema.String;
529
+ readonly kind: Schema.Literals<readonly ["start", "renew", "daily"]>;
530
+ readonly at: Schema.Number;
531
+ readonly periodIndex: Schema.Number;
532
+ readonly day: Schema.NullOr<Schema.Number>;
533
+ readonly window: Schema.Struct<{
534
+ readonly startsAt: Schema.Number;
535
+ readonly expiresAt: Schema.Number;
536
+ readonly graceUntil: Schema.Number;
537
+ readonly state: Schema.Literals<readonly ["active", "grace", "expired"]>;
538
+ }>;
539
+ readonly value: Schema.Struct<{
540
+ readonly orderId: Schema.String;
541
+ readonly offerId: Schema.String;
542
+ readonly offerVersion: Schema.String;
543
+ readonly offerDigest: Schema.String;
544
+ readonly quantity: Schema.Number;
545
+ readonly at: Schema.Number;
546
+ readonly pricePaid: Schema.Union<readonly [Schema.Struct<{
547
+ readonly kind: Schema.Literal<"free">;
548
+ }>, Schema.Struct<{
549
+ readonly kind: Schema.Literal<"virtual">;
550
+ readonly currency: Schema.String;
551
+ readonly amount: Schema.String;
552
+ }>]>;
553
+ readonly transfers: Schema.$Array<Schema.Struct<{
554
+ readonly txId: Schema.String;
555
+ readonly currency: Schema.String;
556
+ readonly amount: Schema.String;
557
+ readonly at: Schema.Number;
558
+ }>>;
559
+ readonly grants: Schema.$Array<Schema.Struct<{
560
+ readonly operationId: Schema.String;
561
+ readonly kind: Schema.Literal<"grant">;
562
+ readonly changes: Schema.$Array<Schema.Struct<{
563
+ readonly instanceId: Schema.String;
564
+ readonly delta: Schema.Number;
565
+ }>>;
566
+ readonly at: Schema.Number;
567
+ }>>;
568
+ }>;
569
+ }>, Schema.Struct<{
570
+ readonly operationId: Schema.String;
571
+ readonly entitlementId: Schema.String;
572
+ readonly at: Schema.Number;
573
+ readonly renews: Schema.Literal<false>;
574
+ }>]>;
575
+ }>]>, typeof EconomyError>;
576
+
577
+ declare interface TradeAcceptInput {
578
+ readonly tradeId: string;
579
+ readonly tradeDigest: string;
580
+ readonly requestId: string;
581
+ }
582
+
583
+ declare interface TradeCurrencyIntention {
584
+ readonly currency: string;
585
+ readonly amount: EconomyAmountInput;
586
+ }
587
+
588
+ export declare type TradeIntention = {
589
+ readonly kind: 'propose';
590
+ readonly input: TradeProposeInput;
591
+ } | {
592
+ readonly kind: 'accept';
593
+ readonly input: TradeAcceptInput;
594
+ } | {
595
+ readonly kind: 'cancel';
596
+ readonly input: {
597
+ readonly tradeId: string;
598
+ readonly requestId: string;
599
+ };
600
+ };
601
+
602
+ export declare interface TradeIntentionJournal {
603
+ readonly withLocked: <A>(scope: string, work: (slot: TradeIntentionSlot) => Promise<A>) => Promise<A>;
604
+ }
605
+
606
+ export declare interface TradeIntentionReference {
607
+ readonly version: 1;
608
+ readonly scope: string;
609
+ readonly request: TradeIntention;
610
+ }
611
+
612
+ export declare interface TradeIntentionSlot {
613
+ readonly read: () => TradeIntentionReference | undefined;
614
+ readonly write: (reference: TradeIntentionReference) => void;
615
+ readonly clear: (reference: TradeIntentionReference) => void;
616
+ }
617
+
618
+ export declare interface TradeIntentionTransport {
619
+ readonly propose: (input: ReturnType<typeof captureTradeProposeIntention>) => Promise<TradeReceipt>;
620
+ readonly accept: (input: TradeAcceptInput) => Promise<TradeReceipt>;
621
+ readonly cancel: (input: {
622
+ readonly tradeId: string;
623
+ readonly requestId: string;
624
+ }) => Promise<TradeReceipt>;
625
+ }
626
+
627
+ declare interface TradeItemIntention {
628
+ readonly instanceId: string;
629
+ readonly qty: number;
630
+ }
631
+
632
+ declare interface TradeLeg {
633
+ readonly items: readonly TradeItemIntention[];
634
+ readonly currencies: readonly {
635
+ readonly currency: string;
636
+ readonly amount: string;
637
+ }[];
638
+ }
639
+
640
+ declare interface TradeLegDefinition {
641
+ readonly items: readonly TradeItemIntention[];
642
+ readonly currencies: readonly TradeCurrencyIntention[];
643
+ }
644
+
645
+ declare type TradeObservation = {
646
+ readonly requestId: string;
647
+ readonly state: 'not-observed';
648
+ } | {
649
+ readonly requestId: string;
650
+ readonly state: 'fulfilled';
651
+ readonly receipt: TradeReceipt;
652
+ };
653
+
654
+ declare interface TradeProposeInput {
655
+ readonly toId: string | null;
656
+ readonly offered: TradeLegDefinition;
657
+ readonly requested: TradeLegDefinition;
658
+ readonly durationMs: number;
659
+ readonly requestId: string;
660
+ }
661
+
662
+ declare interface TradeReceipt {
663
+ readonly operationId: string;
664
+ readonly requestId: string;
665
+ readonly trade: TradeView;
666
+ }
667
+
668
+ declare const tradeReceiptDescriptor: QueryProcedureDescriptor<"economy.trades.receipt", Schema.Struct<{
669
+ readonly requestId: Schema.String;
670
+ }>, Schema.Union<readonly [Schema.Struct<{
671
+ readonly requestId: Schema.String;
672
+ readonly state: Schema.Literal<"not-observed">;
673
+ }>, Schema.Struct<{
674
+ readonly requestId: Schema.String;
675
+ readonly state: Schema.Literal<"fulfilled">;
676
+ readonly receipt: Schema.Struct<{
677
+ readonly operationId: Schema.String;
678
+ readonly requestId: Schema.String;
679
+ readonly trade: Schema.Struct<{
680
+ readonly tradeId: Schema.String;
681
+ readonly tradeDigest: Schema.String;
682
+ readonly proposerId: Schema.String;
683
+ readonly toId: Schema.NullOr<Schema.String>;
684
+ readonly offered: Schema.Struct<{
685
+ readonly items: Schema.$Array<Schema.Struct<{
686
+ readonly instanceId: Schema.String;
687
+ readonly qty: Schema.Number;
688
+ }>>;
689
+ readonly currencies: Schema.$Array<Schema.Struct<{
690
+ readonly currency: Schema.String;
691
+ readonly amount: Schema.String;
692
+ }>>;
693
+ }>;
694
+ readonly requested: Schema.Struct<{
695
+ readonly items: Schema.$Array<Schema.Struct<{
696
+ readonly instanceId: Schema.String;
697
+ readonly qty: Schema.Number;
698
+ }>>;
699
+ readonly currencies: Schema.$Array<Schema.Struct<{
700
+ readonly currency: Schema.String;
701
+ readonly amount: Schema.String;
702
+ }>>;
703
+ }>;
704
+ readonly createdAt: Schema.Number;
705
+ readonly expiresAt: Schema.Number;
706
+ readonly state: Schema.Literals<readonly ["proposed", "accepted", "cancelled", "expired"]>;
707
+ readonly accepterId: Schema.NullOr<Schema.String>;
708
+ readonly rulesVersion: Schema.String;
709
+ readonly taxes: Schema.$Array<Schema.Struct<{
710
+ readonly leg: Schema.Literals<readonly ["offered", "requested"]>;
711
+ readonly currency: Schema.String;
712
+ readonly gross: Schema.String;
713
+ readonly net: Schema.String;
714
+ readonly tax: Schema.String;
715
+ }>>;
716
+ }>;
717
+ }>;
718
+ }>]>, typeof EconomyError>;
719
+
720
+ export declare interface TradeRecovery {
721
+ readonly selectScope: (scope: string | undefined) => void;
722
+ readonly pending: () => Promise<TradeIntentionReference | undefined>;
723
+ readonly begin: (intention: TradeIntention) => Promise<TradeIntentionReference>;
724
+ readonly retry: (original: TradeIntention) => Promise<TradeReceipt>;
725
+ readonly observe: (observation: TradeObservation) => Promise<TradeIntentionReference | undefined>;
726
+ }
727
+
728
+ declare interface TradeTaxView {
729
+ readonly leg: 'offered' | 'requested';
730
+ readonly currency: string;
731
+ readonly gross: string;
732
+ readonly net: string;
733
+ readonly tax: string;
734
+ }
735
+
736
+ declare interface TradeView {
737
+ readonly tradeId: string;
738
+ readonly tradeDigest: string;
739
+ readonly proposerId: string;
740
+ readonly toId: string | null;
741
+ readonly offered: TradeLeg;
742
+ readonly requested: TradeLeg;
743
+ readonly createdAt: number;
744
+ readonly expiresAt: number;
745
+ readonly state: 'proposed' | 'accepted' | 'cancelled' | 'expired';
746
+ readonly accepterId: string | null;
747
+ readonly rulesVersion: string;
748
+ readonly taxes: readonly TradeTaxView[];
749
+ }
750
+
751
+ export declare const useAcceptTrade: (apiName?: string) => ActionState<{
752
+ readonly tradeId: string;
753
+ readonly tradeDigest: string;
754
+ readonly requestId: string;
755
+ }, {
756
+ readonly operationId: string;
757
+ readonly requestId: string;
758
+ readonly trade: {
759
+ readonly tradeId: string;
760
+ readonly tradeDigest: string;
761
+ readonly proposerId: string;
762
+ readonly toId: string | null;
763
+ readonly offered: {
764
+ readonly items: readonly {
765
+ readonly instanceId: string;
766
+ readonly qty: number;
767
+ }[];
768
+ readonly currencies: readonly {
769
+ readonly currency: string;
770
+ readonly amount: string;
771
+ }[];
772
+ };
773
+ readonly requested: {
774
+ readonly items: readonly {
775
+ readonly instanceId: string;
776
+ readonly qty: number;
777
+ }[];
778
+ readonly currencies: readonly {
779
+ readonly currency: string;
780
+ readonly amount: string;
781
+ }[];
782
+ };
783
+ readonly createdAt: number;
784
+ readonly expiresAt: number;
785
+ readonly state: "expired" | "cancelled" | "accepted" | "proposed";
786
+ readonly accepterId: string | null;
787
+ readonly rulesVersion: string;
788
+ readonly taxes: readonly {
789
+ readonly leg: "requested" | "offered";
790
+ readonly currency: string;
791
+ readonly gross: string;
792
+ readonly net: string;
793
+ readonly tax: string;
794
+ }[];
795
+ };
796
+ }>;
797
+
798
+ export declare const useActiveSubscriptions: (apiName?: string) => SubscriptionState<readonly {
799
+ readonly entitlementId: string;
800
+ readonly subscription: {
801
+ readonly id: string;
802
+ readonly version: string;
803
+ readonly titleKey: string;
804
+ readonly price: {
805
+ readonly kind: "free";
806
+ } | {
807
+ readonly kind: "virtual";
808
+ readonly options: readonly {
809
+ readonly currency: string;
810
+ readonly amount: string;
811
+ }[];
812
+ } | {
813
+ readonly prices: {
814
+ readonly [x: string]: number;
815
+ };
816
+ readonly storeProductIds: {
817
+ readonly [x: string]: string;
818
+ };
819
+ readonly kind: "real";
820
+ } | {
821
+ readonly kind: "mixed";
822
+ readonly real: {
823
+ readonly prices: {
824
+ readonly [x: string]: number;
825
+ };
826
+ readonly storeProductIds: {
827
+ readonly [x: string]: string;
828
+ };
829
+ };
830
+ readonly virtual: readonly {
831
+ readonly currency: string;
832
+ readonly amount: string;
833
+ }[];
834
+ };
835
+ readonly period: {
836
+ readonly unit: "day" | "week" | "month";
837
+ readonly count: number;
838
+ };
839
+ readonly grants: {
840
+ readonly onPurchase: {
841
+ readonly items: readonly {
842
+ readonly itemId: string;
843
+ readonly qty: number;
844
+ }[];
845
+ readonly currencies: readonly {
846
+ readonly currency: string;
847
+ readonly amount: string;
848
+ }[];
849
+ };
850
+ readonly daily: {
851
+ readonly items: readonly {
852
+ readonly itemId: string;
853
+ readonly qty: number;
854
+ }[];
855
+ readonly currencies: readonly {
856
+ readonly currency: string;
857
+ readonly amount: string;
858
+ }[];
859
+ };
860
+ };
861
+ readonly graceDays: number;
862
+ readonly coolingOff: {
863
+ readonly days: number;
864
+ readonly overrideReason: string | null;
865
+ };
866
+ readonly disclosure: {
867
+ readonly durationKey: string;
868
+ readonly renewalKey: string;
869
+ readonly cancellationPath: string;
870
+ };
871
+ };
872
+ readonly subscriptionDigest: string;
873
+ readonly originAt: number;
874
+ readonly periodIndex: number;
875
+ readonly window: {
876
+ readonly startsAt: number;
877
+ readonly expiresAt: number;
878
+ readonly graceUntil: number;
879
+ readonly state: "expired" | "active" | "grace";
880
+ };
881
+ readonly currency: string | null;
882
+ readonly renews: boolean;
883
+ readonly cancelledAt: number | null;
884
+ }[]>;
885
+
886
+ export declare const useCancelSubscription: (apiName?: string) => ActionState<{
887
+ readonly entitlementId: string;
888
+ readonly requestId: string;
889
+ }, {
890
+ readonly operationId: string;
891
+ readonly entitlementId: string;
892
+ readonly at: number;
893
+ readonly renews: false;
894
+ }>;
895
+
896
+ export declare const useCancelTrade: (apiName?: string) => ActionState<{
897
+ readonly tradeId: string;
898
+ readonly requestId: string;
899
+ }, {
900
+ readonly operationId: string;
901
+ readonly requestId: string;
902
+ readonly trade: {
903
+ readonly tradeId: string;
904
+ readonly tradeDigest: string;
905
+ readonly proposerId: string;
906
+ readonly toId: string | null;
907
+ readonly offered: {
908
+ readonly items: readonly {
909
+ readonly instanceId: string;
910
+ readonly qty: number;
911
+ }[];
912
+ readonly currencies: readonly {
913
+ readonly currency: string;
914
+ readonly amount: string;
915
+ }[];
916
+ };
917
+ readonly requested: {
918
+ readonly items: readonly {
919
+ readonly instanceId: string;
920
+ readonly qty: number;
921
+ }[];
922
+ readonly currencies: readonly {
923
+ readonly currency: string;
924
+ readonly amount: string;
925
+ }[];
926
+ };
927
+ readonly createdAt: number;
928
+ readonly expiresAt: number;
929
+ readonly state: "expired" | "cancelled" | "accepted" | "proposed";
930
+ readonly accepterId: string | null;
931
+ readonly rulesVersion: string;
932
+ readonly taxes: readonly {
933
+ readonly leg: "requested" | "offered";
934
+ readonly currency: string;
935
+ readonly gross: string;
936
+ readonly net: string;
937
+ readonly tax: string;
938
+ }[];
939
+ };
940
+ }>;
941
+
942
+ /** Explicit fresh server read, including after the observed expiry deadline. */
943
+ export declare const useCheckIapEntitlement: (apiName?: string) => ActionState<{
944
+ readonly offerId: string;
945
+ }, {
946
+ readonly offerId: string;
947
+ readonly entitled: boolean;
948
+ readonly expiresAt: number | null;
949
+ readonly observedAt: number;
950
+ }>;
951
+
952
+ export declare const useClaimSubscriptionDaily: (apiName?: string) => ActionState<{
953
+ readonly entitlementId: string;
954
+ readonly requestId: string;
955
+ }, {
956
+ readonly operationId: string;
957
+ readonly entitlementId: string;
958
+ readonly kind: "start" | "daily" | "renew";
959
+ readonly at: number;
960
+ readonly periodIndex: number;
961
+ readonly day: number | null;
962
+ readonly window: {
963
+ readonly startsAt: number;
964
+ readonly expiresAt: number;
965
+ readonly graceUntil: number;
966
+ readonly state: "expired" | "active" | "grace";
967
+ };
968
+ readonly value: {
969
+ readonly orderId: string;
970
+ readonly offerId: string;
971
+ readonly offerVersion: string;
972
+ readonly offerDigest: string;
973
+ readonly quantity: number;
974
+ readonly at: number;
975
+ readonly pricePaid: {
976
+ readonly kind: "free";
977
+ } | {
978
+ readonly kind: "virtual";
979
+ readonly currency: string;
980
+ readonly amount: string;
981
+ };
982
+ readonly transfers: readonly {
983
+ readonly txId: string;
984
+ readonly currency: string;
985
+ readonly amount: string;
986
+ readonly at: number;
987
+ }[];
988
+ readonly grants: readonly {
989
+ readonly operationId: string;
990
+ readonly kind: "grant";
991
+ readonly changes: readonly {
992
+ readonly instanceId: string;
993
+ readonly delta: number;
994
+ }[];
995
+ readonly at: number;
996
+ }[];
997
+ };
998
+ }>;
999
+
1000
+ /** Keep the original request until a fulfilled receipt is observed. This hook
1001
+ * does not persist code values or create a durable browser recovery journal. */
1002
+ export declare const useCodeReceipt: (input: typeof codesRedeemDescriptor.input.Type | undefined, apiName?: string) => SubscriptionIdle | SubscriptionState<{
1003
+ readonly requestId: string;
1004
+ readonly state: "pending" | "not-observed";
1005
+ } | {
1006
+ readonly requestId: string;
1007
+ readonly state: "fulfilled";
1008
+ readonly receipt: {
1009
+ readonly operationId: string;
1010
+ readonly codeId: string;
1011
+ readonly version: string;
1012
+ readonly campaign: string;
1013
+ readonly at: number;
1014
+ readonly transfers: readonly {
1015
+ readonly txId: string;
1016
+ readonly currency: string;
1017
+ readonly amount: string;
1018
+ readonly at: number;
1019
+ }[];
1020
+ readonly grants: readonly {
1021
+ readonly operationId: string;
1022
+ readonly kind: "grant";
1023
+ readonly changes: readonly {
1024
+ readonly instanceId: string;
1025
+ readonly delta: number;
1026
+ }[];
1027
+ readonly at: number;
1028
+ }[];
1029
+ };
1030
+ }>;
1031
+
1032
+ /** Explicit original-intention retry. Availability follows the configured channel completion authority. */
1033
+ export declare const useCompleteIap: (apiName?: string) => ActionState<{
1034
+ readonly receipt: string;
1035
+ readonly channel: "web" | "ios" | "android" | "steam";
1036
+ readonly offerId: string;
1037
+ readonly offerVersion: string;
1038
+ readonly requestId: string;
1039
+ }, {
1040
+ readonly orderId: string;
1041
+ readonly channel: "web" | "ios" | "android" | "steam";
1042
+ readonly operation: "finish" | "finalize" | "acknowledge" | "consume";
1043
+ readonly observedAt: number;
1044
+ }>;
1045
+
1046
+ export declare const useContainerReceipt: (input: typeof containerOpenDescriptor.input.Type | undefined, apiName?: string) => SubscriptionIdle | SubscriptionState<{
1047
+ readonly requestId: string;
1048
+ readonly state: "pending" | "not-observed";
1049
+ } | {
1050
+ readonly requestId: string;
1051
+ readonly state: "fulfilled";
1052
+ readonly receipt: {
1053
+ readonly operationId: string;
1054
+ readonly containerId: string;
1055
+ readonly containerVersion: string;
1056
+ readonly containerDigest: string;
1057
+ readonly dropId: string;
1058
+ readonly rarity: string;
1059
+ readonly previousMisses: number;
1060
+ readonly misses: number;
1061
+ readonly sequence: number;
1062
+ readonly at: number;
1063
+ readonly distribution: {
1064
+ readonly entries: readonly {
1065
+ readonly dropId: string;
1066
+ readonly weight: string;
1067
+ }[];
1068
+ readonly total: string;
1069
+ readonly guaranteed: boolean;
1070
+ };
1071
+ readonly pricePaid: {
1072
+ readonly kind: "free";
1073
+ } | {
1074
+ readonly kind: "virtual";
1075
+ readonly currency: string;
1076
+ readonly amount: string;
1077
+ };
1078
+ readonly transfers: readonly {
1079
+ readonly txId: string;
1080
+ readonly currency: string;
1081
+ readonly amount: string;
1082
+ readonly at: number;
1083
+ }[];
1084
+ readonly grants: readonly {
1085
+ readonly operationId: string;
1086
+ readonly kind: "grant";
1087
+ readonly changes: readonly {
1088
+ readonly instanceId: string;
1089
+ readonly delta: number;
1090
+ }[];
1091
+ readonly at: number;
1092
+ }[];
1093
+ };
1094
+ }>;
1095
+
1096
+ export declare const useContainers: (apiName?: string) => SubscriptionState<readonly {
1097
+ readonly container: {
1098
+ readonly id: string;
1099
+ readonly version: string;
1100
+ readonly group: string;
1101
+ readonly price: {
1102
+ readonly kind: "free";
1103
+ } | {
1104
+ readonly kind: "virtual";
1105
+ readonly options: readonly {
1106
+ readonly currency: string;
1107
+ readonly amount: string;
1108
+ }[];
1109
+ } | {
1110
+ readonly prices: {
1111
+ readonly [x: string]: number;
1112
+ };
1113
+ readonly storeProductIds: {
1114
+ readonly [x: string]: string;
1115
+ };
1116
+ readonly kind: "real";
1117
+ } | {
1118
+ readonly kind: "mixed";
1119
+ readonly real: {
1120
+ readonly prices: {
1121
+ readonly [x: string]: number;
1122
+ };
1123
+ readonly storeProductIds: {
1124
+ readonly [x: string]: string;
1125
+ };
1126
+ };
1127
+ readonly virtual: readonly {
1128
+ readonly currency: string;
1129
+ readonly amount: string;
1130
+ }[];
1131
+ };
1132
+ readonly countries: readonly string[];
1133
+ readonly drops: readonly {
1134
+ readonly id: string;
1135
+ readonly rarity: string;
1136
+ readonly weight: string;
1137
+ readonly items: readonly {
1138
+ readonly itemId: string;
1139
+ readonly qty: number;
1140
+ }[];
1141
+ readonly currencies: readonly {
1142
+ readonly currency: string;
1143
+ readonly amount: string;
1144
+ }[];
1145
+ }[];
1146
+ readonly pity: {
1147
+ readonly guaranteed: string;
1148
+ readonly after: number;
1149
+ readonly softFrom: number | null;
1150
+ readonly softRampBps: number;
1151
+ } | null;
1152
+ };
1153
+ readonly containerDigest: string;
1154
+ readonly disclosureDigest: string;
1155
+ readonly misses: number;
1156
+ readonly price: {
1157
+ readonly kind: "free";
1158
+ } | {
1159
+ readonly kind: "virtual";
1160
+ readonly options: readonly {
1161
+ readonly currency: string;
1162
+ readonly amount: string;
1163
+ }[];
1164
+ } | {
1165
+ readonly prices: {
1166
+ readonly [x: string]: number;
1167
+ };
1168
+ readonly storeProductIds: {
1169
+ readonly [x: string]: string;
1170
+ };
1171
+ readonly kind: "real";
1172
+ } | {
1173
+ readonly kind: "mixed";
1174
+ readonly real: {
1175
+ readonly prices: {
1176
+ readonly [x: string]: number;
1177
+ };
1178
+ readonly storeProductIds: {
1179
+ readonly [x: string]: string;
1180
+ };
1181
+ };
1182
+ readonly virtual: readonly {
1183
+ readonly currency: string;
1184
+ readonly amount: string;
1185
+ }[];
1186
+ };
1187
+ readonly disclosure: {
1188
+ readonly guaranteed: boolean;
1189
+ readonly probabilities: readonly {
1190
+ readonly dropId: string;
1191
+ readonly numerator: string;
1192
+ readonly denominator: string;
1193
+ }[];
1194
+ };
1195
+ }[]>;
1196
+
1197
+ export declare const useIapAccount: (apiName?: string) => ActionState<{
1198
+ readonly channel: "web" | "ios" | "android" | "steam";
1199
+ }, string>;
1200
+
1201
+ /** SQL changes invalidate this observation; a clock deadline alone does not. */
1202
+ export declare const useIapEntitlement: (input: typeof iapEntitledDescriptor.input.Type | undefined, apiName?: string) => SubscriptionIdle | SubscriptionState<{
1203
+ readonly offerId: string;
1204
+ readonly entitled: boolean;
1205
+ readonly expiresAt: number | null;
1206
+ readonly observedAt: number;
1207
+ }>;
1208
+
1209
+ /** Hash-only observation; no raw receipt, automatic retry or browser journal. */
1210
+ export declare const useIapReceipt: (input: typeof iapReceiptDescriptor.input.Type | undefined, apiName?: string) => SubscriptionIdle | SubscriptionState<{
1211
+ readonly requestId: string;
1212
+ readonly state: "pending" | "not-observed";
1213
+ } | {
1214
+ readonly state: "fulfilled";
1215
+ readonly requestId: string;
1216
+ readonly receipt: {
1217
+ readonly orderId: string;
1218
+ readonly offerId: string;
1219
+ readonly offerVersion: string;
1220
+ readonly quantity: number;
1221
+ readonly at: number;
1222
+ readonly pricePaid: {
1223
+ readonly currency: string;
1224
+ readonly units: string;
1225
+ readonly scale: number;
1226
+ } | null;
1227
+ readonly transfers: readonly {
1228
+ readonly txId: string;
1229
+ readonly currency: string;
1230
+ readonly amount: string;
1231
+ readonly at: number;
1232
+ }[];
1233
+ readonly grants: readonly {
1234
+ readonly operationId: string;
1235
+ readonly kind: "grant";
1236
+ readonly changes: readonly {
1237
+ readonly instanceId: string;
1238
+ readonly delta: number;
1239
+ }[];
1240
+ readonly at: number;
1241
+ }[];
1242
+ };
1243
+ readonly refund?: {
1244
+ readonly sequence: number;
1245
+ readonly state: "revoked" | "active" | "partially-refunded";
1246
+ readonly refundNumerator: number;
1247
+ readonly refundDenominator: number;
1248
+ readonly observedAt: number;
1249
+ } | undefined;
1250
+ } | {
1251
+ readonly requestId: string;
1252
+ readonly state: "partially-refunded" | "refunded";
1253
+ readonly receipt: {
1254
+ readonly orderId: string;
1255
+ readonly offerId: string;
1256
+ readonly offerVersion: string;
1257
+ readonly quantity: number;
1258
+ readonly at: number;
1259
+ readonly pricePaid: {
1260
+ readonly currency: string;
1261
+ readonly units: string;
1262
+ readonly scale: number;
1263
+ } | null;
1264
+ readonly transfers: readonly {
1265
+ readonly txId: string;
1266
+ readonly currency: string;
1267
+ readonly amount: string;
1268
+ readonly at: number;
1269
+ }[];
1270
+ readonly grants: readonly {
1271
+ readonly operationId: string;
1272
+ readonly kind: "grant";
1273
+ readonly changes: readonly {
1274
+ readonly instanceId: string;
1275
+ readonly delta: number;
1276
+ }[];
1277
+ readonly at: number;
1278
+ }[];
1279
+ };
1280
+ readonly refund: {
1281
+ readonly sequence: number;
1282
+ readonly state: "revoked" | "active" | "partially-refunded";
1283
+ readonly refundNumerator: number;
1284
+ readonly refundDenominator: number;
1285
+ readonly observedAt: number;
1286
+ };
1287
+ }>;
1288
+
1289
+ export declare const useLoyalty: (input: typeof loyaltyMineDescriptor.input.Type | undefined, apiName?: string) => SubscriptionIdle | SubscriptionState<{
1290
+ readonly loyalty: {
1291
+ readonly id: string;
1292
+ readonly version: string;
1293
+ readonly titleKey: string;
1294
+ readonly decay: "none" | "seasonal";
1295
+ readonly pointsFrom: readonly {
1296
+ readonly id: string;
1297
+ readonly kind: "purchase.real" | "purchase.virtual";
1298
+ readonly currency: string;
1299
+ readonly numerator: string;
1300
+ readonly denominator: string;
1301
+ }[];
1302
+ readonly tiers: readonly {
1303
+ readonly id: string;
1304
+ readonly at: string;
1305
+ readonly perks: readonly ({
1306
+ readonly id: string;
1307
+ readonly kind: "xpMultiplier" | "discount";
1308
+ readonly bps: number;
1309
+ } | {
1310
+ readonly id: string;
1311
+ readonly kind: "chatBadge";
1312
+ readonly badgeId: string;
1313
+ } | {
1314
+ readonly id: string;
1315
+ readonly kind: "inboxGift";
1316
+ readonly items: readonly {
1317
+ readonly itemId: string;
1318
+ readonly qty: number;
1319
+ }[];
1320
+ readonly currencies: readonly {
1321
+ readonly currency: string;
1322
+ readonly amount: string;
1323
+ }[];
1324
+ })[];
1325
+ }[];
1326
+ };
1327
+ readonly rulesVersion: string;
1328
+ readonly seasonId: string | null;
1329
+ readonly points: string;
1330
+ readonly tierId: string;
1331
+ readonly perks: readonly ({
1332
+ readonly id: string;
1333
+ readonly kind: "xpMultiplier" | "discount";
1334
+ readonly bps: number;
1335
+ } | {
1336
+ readonly id: string;
1337
+ readonly kind: "chatBadge";
1338
+ readonly badgeId: string;
1339
+ } | {
1340
+ readonly id: string;
1341
+ readonly kind: "inboxGift";
1342
+ readonly items: readonly {
1343
+ readonly itemId: string;
1344
+ readonly qty: number;
1345
+ }[];
1346
+ readonly currencies: readonly {
1347
+ readonly currency: string;
1348
+ readonly amount: string;
1349
+ }[];
1350
+ })[];
1351
+ }>;
1352
+
1353
+ export declare const useLoyaltyPrograms: (apiName?: string) => SubscriptionState<readonly {
1354
+ readonly id: string;
1355
+ readonly version: string;
1356
+ readonly titleKey: string;
1357
+ readonly decay: "none" | "seasonal";
1358
+ readonly pointsFrom: readonly {
1359
+ readonly id: string;
1360
+ readonly kind: "purchase.real" | "purchase.virtual";
1361
+ readonly currency: string;
1362
+ readonly numerator: string;
1363
+ readonly denominator: string;
1364
+ }[];
1365
+ readonly tiers: readonly {
1366
+ readonly id: string;
1367
+ readonly at: string;
1368
+ readonly perks: readonly ({
1369
+ readonly id: string;
1370
+ readonly kind: "xpMultiplier" | "discount";
1371
+ readonly bps: number;
1372
+ } | {
1373
+ readonly id: string;
1374
+ readonly kind: "chatBadge";
1375
+ readonly badgeId: string;
1376
+ } | {
1377
+ readonly id: string;
1378
+ readonly kind: "inboxGift";
1379
+ readonly items: readonly {
1380
+ readonly itemId: string;
1381
+ readonly qty: number;
1382
+ }[];
1383
+ readonly currencies: readonly {
1384
+ readonly currency: string;
1385
+ readonly amount: string;
1386
+ }[];
1387
+ })[];
1388
+ }[];
1389
+ }[]>;
1390
+
1391
+ export declare const useLoyaltyReceipt: (input: typeof loyaltyReceiptDescriptor.input.Type | undefined, apiName?: string) => SubscriptionIdle | SubscriptionState<{
1392
+ readonly requestId: string;
1393
+ readonly state: "not-observed";
1394
+ } | {
1395
+ readonly requestId: string;
1396
+ readonly state: "fulfilled";
1397
+ readonly receipt: {
1398
+ readonly operationId: string;
1399
+ readonly requestId: string;
1400
+ readonly loyaltyId: string;
1401
+ readonly entry: {
1402
+ readonly kind: "credit";
1403
+ readonly sourceId: string;
1404
+ readonly purchaseId: string;
1405
+ readonly purchaseAmount: string;
1406
+ readonly numerator: string;
1407
+ readonly denominator: string;
1408
+ readonly id: string;
1409
+ readonly sequence: number;
1410
+ readonly at: number;
1411
+ readonly seasonId: string | null;
1412
+ readonly delta: string;
1413
+ } | {
1414
+ readonly kind: "reverse";
1415
+ readonly originalId: string;
1416
+ readonly refundId: string;
1417
+ readonly totalRefunded: string;
1418
+ readonly id: string;
1419
+ readonly sequence: number;
1420
+ readonly at: number;
1421
+ readonly seasonId: string | null;
1422
+ readonly delta: string;
1423
+ };
1424
+ readonly points: string;
1425
+ };
1426
+ }>;
1427
+
1428
+ export declare const useOpenContainer: (apiName?: string) => ActionState<{
1429
+ readonly requestId: string;
1430
+ readonly containerDigest: string;
1431
+ readonly disclosureDigest: string;
1432
+ readonly containerId: string;
1433
+ readonly containerVersion: string;
1434
+ readonly currency?: string | undefined;
1435
+ }, {
1436
+ readonly operationId: string;
1437
+ readonly containerId: string;
1438
+ readonly containerVersion: string;
1439
+ readonly containerDigest: string;
1440
+ readonly dropId: string;
1441
+ readonly rarity: string;
1442
+ readonly previousMisses: number;
1443
+ readonly misses: number;
1444
+ readonly sequence: number;
1445
+ readonly at: number;
1446
+ readonly distribution: {
1447
+ readonly entries: readonly {
1448
+ readonly dropId: string;
1449
+ readonly weight: string;
1450
+ }[];
1451
+ readonly total: string;
1452
+ readonly guaranteed: boolean;
1453
+ };
1454
+ readonly pricePaid: {
1455
+ readonly kind: "free";
1456
+ } | {
1457
+ readonly kind: "virtual";
1458
+ readonly currency: string;
1459
+ readonly amount: string;
1460
+ };
1461
+ readonly transfers: readonly {
1462
+ readonly txId: string;
1463
+ readonly currency: string;
1464
+ readonly amount: string;
1465
+ readonly at: number;
1466
+ }[];
1467
+ readonly grants: readonly {
1468
+ readonly operationId: string;
1469
+ readonly kind: "grant";
1470
+ readonly changes: readonly {
1471
+ readonly instanceId: string;
1472
+ readonly delta: number;
1473
+ }[];
1474
+ readonly at: number;
1475
+ }[];
1476
+ }>;
1477
+
1478
+ /** Opens the payment provider's page where the player cancels a subscription or changes the card; send them to `url`. */
1479
+ export declare const useOpenIapManagement: (apiName?: string) => ActionState<{
1480
+ readonly channel: "web" | "ios" | "android" | "steam";
1481
+ readonly returnUrl: string;
1482
+ }, {
1483
+ readonly url: string;
1484
+ }>;
1485
+
1486
+ export declare const usePiggyBankReceipt: (input: typeof piggyReceiptDescriptor.input.Type | undefined, apiName?: string) => SubscriptionIdle | SubscriptionState<{
1487
+ readonly requestId: string;
1488
+ readonly state: "not-observed";
1489
+ } | {
1490
+ readonly requestId: string;
1491
+ readonly state: "fulfilled";
1492
+ readonly receipt: {
1493
+ readonly event: {
1494
+ readonly kind: "fill";
1495
+ readonly authorityId: string;
1496
+ readonly eventId: string;
1497
+ readonly sourceId: string;
1498
+ readonly acceptedAmount: string;
1499
+ readonly delta: string;
1500
+ readonly id: string;
1501
+ readonly sequence: number;
1502
+ readonly at: number;
1503
+ };
1504
+ readonly operationId: string;
1505
+ readonly requestId: string;
1506
+ readonly bankId: string;
1507
+ readonly available: string;
1508
+ } | {
1509
+ readonly event: {
1510
+ readonly kind: "unlock";
1511
+ readonly amount: string;
1512
+ readonly remaining: string;
1513
+ readonly id: string;
1514
+ readonly sequence: number;
1515
+ readonly at: number;
1516
+ };
1517
+ readonly value: {
1518
+ readonly orderId: string;
1519
+ readonly offerId: string;
1520
+ readonly offerVersion: string;
1521
+ readonly offerDigest: string;
1522
+ readonly quantity: number;
1523
+ readonly at: number;
1524
+ readonly pricePaid: {
1525
+ readonly kind: "free";
1526
+ } | {
1527
+ readonly kind: "virtual";
1528
+ readonly currency: string;
1529
+ readonly amount: string;
1530
+ };
1531
+ readonly transfers: readonly {
1532
+ readonly txId: string;
1533
+ readonly currency: string;
1534
+ readonly amount: string;
1535
+ readonly at: number;
1536
+ }[];
1537
+ readonly grants: readonly {
1538
+ readonly operationId: string;
1539
+ readonly kind: "grant";
1540
+ readonly changes: readonly {
1541
+ readonly instanceId: string;
1542
+ readonly delta: number;
1543
+ }[];
1544
+ readonly at: number;
1545
+ }[];
1546
+ };
1547
+ readonly operationId: string;
1548
+ readonly requestId: string;
1549
+ readonly bankId: string;
1550
+ readonly available: string;
1551
+ };
1552
+ }>;
1553
+
1554
+ export declare const usePiggyBanks: (apiName?: string) => SubscriptionState<readonly {
1555
+ readonly bank: {
1556
+ readonly id: string;
1557
+ readonly version: string;
1558
+ readonly titleKey: string;
1559
+ readonly currency: string;
1560
+ readonly cap: string;
1561
+ readonly unlock: {
1562
+ readonly kind: "free";
1563
+ } | {
1564
+ readonly kind: "virtual";
1565
+ readonly options: readonly {
1566
+ readonly currency: string;
1567
+ readonly amount: string;
1568
+ }[];
1569
+ } | {
1570
+ readonly prices: {
1571
+ readonly [x: string]: number;
1572
+ };
1573
+ readonly storeProductIds: {
1574
+ readonly [x: string]: string;
1575
+ };
1576
+ readonly kind: "real";
1577
+ } | {
1578
+ readonly kind: "mixed";
1579
+ readonly real: {
1580
+ readonly prices: {
1581
+ readonly [x: string]: number;
1582
+ };
1583
+ readonly storeProductIds: {
1584
+ readonly [x: string]: string;
1585
+ };
1586
+ };
1587
+ readonly virtual: readonly {
1588
+ readonly currency: string;
1589
+ readonly amount: string;
1590
+ }[];
1591
+ };
1592
+ readonly fillFrom: readonly string[];
1593
+ readonly reset: "onUnlock";
1594
+ };
1595
+ readonly bankDigest: string;
1596
+ readonly available: string;
1597
+ readonly cycles: number;
1598
+ }[]>;
1599
+
1600
+ export declare const useProposeTrade: (apiName?: string) => ActionState<{
1601
+ readonly toId: string | null;
1602
+ readonly offered: {
1603
+ readonly items: readonly {
1604
+ readonly instanceId: string;
1605
+ readonly qty: number;
1606
+ }[];
1607
+ readonly currencies: readonly {
1608
+ readonly currency: string;
1609
+ readonly amount: string;
1610
+ }[];
1611
+ };
1612
+ readonly requested: {
1613
+ readonly items: readonly {
1614
+ readonly instanceId: string;
1615
+ readonly qty: number;
1616
+ }[];
1617
+ readonly currencies: readonly {
1618
+ readonly currency: string;
1619
+ readonly amount: string;
1620
+ }[];
1621
+ };
1622
+ readonly durationMs: number;
1623
+ readonly requestId: string;
1624
+ }, {
1625
+ readonly operationId: string;
1626
+ readonly requestId: string;
1627
+ readonly trade: {
1628
+ readonly tradeId: string;
1629
+ readonly tradeDigest: string;
1630
+ readonly proposerId: string;
1631
+ readonly toId: string | null;
1632
+ readonly offered: {
1633
+ readonly items: readonly {
1634
+ readonly instanceId: string;
1635
+ readonly qty: number;
1636
+ }[];
1637
+ readonly currencies: readonly {
1638
+ readonly currency: string;
1639
+ readonly amount: string;
1640
+ }[];
1641
+ };
1642
+ readonly requested: {
1643
+ readonly items: readonly {
1644
+ readonly instanceId: string;
1645
+ readonly qty: number;
1646
+ }[];
1647
+ readonly currencies: readonly {
1648
+ readonly currency: string;
1649
+ readonly amount: string;
1650
+ }[];
1651
+ };
1652
+ readonly createdAt: number;
1653
+ readonly expiresAt: number;
1654
+ readonly state: "expired" | "cancelled" | "accepted" | "proposed";
1655
+ readonly accepterId: string | null;
1656
+ readonly rulesVersion: string;
1657
+ readonly taxes: readonly {
1658
+ readonly leg: "requested" | "offered";
1659
+ readonly currency: string;
1660
+ readonly gross: string;
1661
+ readonly net: string;
1662
+ readonly tax: string;
1663
+ }[];
1664
+ };
1665
+ }>;
1666
+
1667
+ export declare const useRedeemCode: (apiName?: string) => ActionState<{
1668
+ readonly code: string;
1669
+ readonly requestId: string;
1670
+ }, {
1671
+ readonly operationId: string;
1672
+ readonly codeId: string;
1673
+ readonly version: string;
1674
+ readonly campaign: string;
1675
+ readonly at: number;
1676
+ readonly transfers: readonly {
1677
+ readonly txId: string;
1678
+ readonly currency: string;
1679
+ readonly amount: string;
1680
+ readonly at: number;
1681
+ }[];
1682
+ readonly grants: readonly {
1683
+ readonly operationId: string;
1684
+ readonly kind: "grant";
1685
+ readonly changes: readonly {
1686
+ readonly instanceId: string;
1687
+ readonly delta: number;
1688
+ }[];
1689
+ readonly at: number;
1690
+ }[];
1691
+ }>;
1692
+
1693
+ export declare const useRedeemIap: (apiName?: string) => ActionState<{
1694
+ readonly receipt: string;
1695
+ readonly channel: "web" | "ios" | "android" | "steam";
1696
+ readonly offerId: string;
1697
+ readonly offerVersion: string;
1698
+ readonly requestId: string;
1699
+ }, {
1700
+ readonly orderId: string;
1701
+ readonly offerId: string;
1702
+ readonly offerVersion: string;
1703
+ readonly quantity: number;
1704
+ readonly at: number;
1705
+ readonly pricePaid: {
1706
+ readonly currency: string;
1707
+ readonly units: string;
1708
+ readonly scale: number;
1709
+ } | null;
1710
+ readonly transfers: readonly {
1711
+ readonly txId: string;
1712
+ readonly currency: string;
1713
+ readonly amount: string;
1714
+ readonly at: number;
1715
+ }[];
1716
+ readonly grants: readonly {
1717
+ readonly operationId: string;
1718
+ readonly kind: "grant";
1719
+ readonly changes: readonly {
1720
+ readonly instanceId: string;
1721
+ readonly delta: number;
1722
+ }[];
1723
+ readonly at: number;
1724
+ }[];
1725
+ }>;
1726
+
1727
+ export declare const useShopBuy: (apiName?: string) => ActionState<{
1728
+ readonly requestId: string;
1729
+ readonly offerId: string;
1730
+ readonly offerVersion: string;
1731
+ readonly offerDigest: string;
1732
+ readonly currency?: string | undefined;
1733
+ readonly qty?: number | undefined;
1734
+ }, {
1735
+ readonly orderId: string;
1736
+ readonly offerId: string;
1737
+ readonly offerVersion: string;
1738
+ readonly offerDigest: string;
1739
+ readonly quantity: number;
1740
+ readonly at: number;
1741
+ readonly pricePaid: {
1742
+ readonly kind: "free";
1743
+ } | {
1744
+ readonly kind: "virtual";
1745
+ readonly currency: string;
1746
+ readonly amount: string;
1747
+ };
1748
+ readonly transfers: readonly {
1749
+ readonly txId: string;
1750
+ readonly currency: string;
1751
+ readonly amount: string;
1752
+ readonly at: number;
1753
+ }[];
1754
+ readonly grants: readonly {
1755
+ readonly operationId: string;
1756
+ readonly kind: "grant";
1757
+ readonly changes: readonly {
1758
+ readonly instanceId: string;
1759
+ readonly delta: number;
1760
+ }[];
1761
+ readonly at: number;
1762
+ }[];
1763
+ }>;
1764
+
1765
+ export declare const useShopOffers: (apiName?: string) => SubscriptionState<readonly {
1766
+ readonly offerDigest: string;
1767
+ readonly offer: {
1768
+ readonly id: string;
1769
+ readonly version: string;
1770
+ readonly titleKey: string;
1771
+ readonly price: {
1772
+ readonly kind: "free";
1773
+ } | {
1774
+ readonly kind: "virtual";
1775
+ readonly options: readonly {
1776
+ readonly currency: string;
1777
+ readonly amount: string;
1778
+ }[];
1779
+ } | {
1780
+ readonly prices: {
1781
+ readonly [x: string]: number;
1782
+ };
1783
+ readonly storeProductIds: {
1784
+ readonly [x: string]: string;
1785
+ };
1786
+ readonly kind: "real";
1787
+ } | {
1788
+ readonly kind: "mixed";
1789
+ readonly real: {
1790
+ readonly prices: {
1791
+ readonly [x: string]: number;
1792
+ };
1793
+ readonly storeProductIds: {
1794
+ readonly [x: string]: string;
1795
+ };
1796
+ };
1797
+ readonly virtual: readonly {
1798
+ readonly currency: string;
1799
+ readonly amount: string;
1800
+ }[];
1801
+ };
1802
+ readonly items: readonly {
1803
+ readonly itemId: string;
1804
+ readonly qty: number;
1805
+ }[];
1806
+ readonly currencies: readonly {
1807
+ readonly currency: string;
1808
+ readonly amount: string;
1809
+ }[];
1810
+ readonly from: number | null;
1811
+ readonly until: number | null;
1812
+ readonly segment: string | null;
1813
+ readonly flag: string | null;
1814
+ readonly countries: readonly string[];
1815
+ readonly limits: {
1816
+ readonly perPlayer: number | null;
1817
+ readonly perDay: number | null;
1818
+ readonly global: number | null;
1819
+ };
1820
+ readonly oneTime: boolean;
1821
+ readonly maxQuantity: number;
1822
+ };
1823
+ readonly price: {
1824
+ readonly kind: "free";
1825
+ } | {
1826
+ readonly kind: "virtual";
1827
+ readonly options: readonly {
1828
+ readonly currency: string;
1829
+ readonly amount: string;
1830
+ }[];
1831
+ } | {
1832
+ readonly prices: {
1833
+ readonly [x: string]: number;
1834
+ };
1835
+ readonly storeProductIds: {
1836
+ readonly [x: string]: string;
1837
+ };
1838
+ readonly kind: "real";
1839
+ } | {
1840
+ readonly kind: "mixed";
1841
+ readonly real: {
1842
+ readonly prices: {
1843
+ readonly [x: string]: number;
1844
+ };
1845
+ readonly storeProductIds: {
1846
+ readonly [x: string]: string;
1847
+ };
1848
+ };
1849
+ readonly virtual: readonly {
1850
+ readonly currency: string;
1851
+ readonly amount: string;
1852
+ }[];
1853
+ };
1854
+ }[]>;
1855
+
1856
+ /** Subscribe using the original saved intention; nonterminal observations must keep that identity. */
1857
+ export declare const useShopReceipt: (input: typeof shopBuyDescriptor.input.Type | undefined, apiName?: string) => SubscriptionIdle | SubscriptionState<{
1858
+ readonly requestId: string;
1859
+ readonly state: "pending" | "not-observed";
1860
+ } | {
1861
+ readonly requestId: string;
1862
+ readonly state: "fulfilled";
1863
+ readonly receipt: {
1864
+ readonly orderId: string;
1865
+ readonly offerId: string;
1866
+ readonly offerVersion: string;
1867
+ readonly offerDigest: string;
1868
+ readonly quantity: number;
1869
+ readonly at: number;
1870
+ readonly pricePaid: {
1871
+ readonly kind: "free";
1872
+ } | {
1873
+ readonly kind: "virtual";
1874
+ readonly currency: string;
1875
+ readonly amount: string;
1876
+ };
1877
+ readonly transfers: readonly {
1878
+ readonly txId: string;
1879
+ readonly currency: string;
1880
+ readonly amount: string;
1881
+ readonly at: number;
1882
+ }[];
1883
+ readonly grants: readonly {
1884
+ readonly operationId: string;
1885
+ readonly kind: "grant";
1886
+ readonly changes: readonly {
1887
+ readonly instanceId: string;
1888
+ readonly delta: number;
1889
+ }[];
1890
+ readonly at: number;
1891
+ }[];
1892
+ };
1893
+ }>;
1894
+
1895
+ /** Starts a web checkout; send the player to `redirectUrl`, then redeem `checkoutId` as the receipt. */
1896
+ export declare const useStartIapCheckout: (apiName?: string) => ActionState<{
1897
+ readonly returnUrl: string;
1898
+ readonly channel: "web" | "ios" | "android" | "steam";
1899
+ readonly offerId: string;
1900
+ readonly offerVersion: string;
1901
+ readonly requestId: string;
1902
+ }, {
1903
+ readonly checkoutId: string;
1904
+ readonly redirectUrl: string;
1905
+ readonly expiresAt: number;
1906
+ }>;
1907
+
1908
+ export declare const useStartSubscription: (apiName?: string) => ActionState<{
1909
+ readonly requestId: string;
1910
+ readonly subscriptionDigest: string;
1911
+ readonly subscriptionId: string;
1912
+ readonly subscriptionVersion: string;
1913
+ readonly currency?: string | undefined;
1914
+ }, {
1915
+ readonly operationId: string;
1916
+ readonly entitlementId: string;
1917
+ readonly kind: "start" | "daily" | "renew";
1918
+ readonly at: number;
1919
+ readonly periodIndex: number;
1920
+ readonly day: number | null;
1921
+ readonly window: {
1922
+ readonly startsAt: number;
1923
+ readonly expiresAt: number;
1924
+ readonly graceUntil: number;
1925
+ readonly state: "expired" | "active" | "grace";
1926
+ };
1927
+ readonly value: {
1928
+ readonly orderId: string;
1929
+ readonly offerId: string;
1930
+ readonly offerVersion: string;
1931
+ readonly offerDigest: string;
1932
+ readonly quantity: number;
1933
+ readonly at: number;
1934
+ readonly pricePaid: {
1935
+ readonly kind: "free";
1936
+ } | {
1937
+ readonly kind: "virtual";
1938
+ readonly currency: string;
1939
+ readonly amount: string;
1940
+ };
1941
+ readonly transfers: readonly {
1942
+ readonly txId: string;
1943
+ readonly currency: string;
1944
+ readonly amount: string;
1945
+ readonly at: number;
1946
+ }[];
1947
+ readonly grants: readonly {
1948
+ readonly operationId: string;
1949
+ readonly kind: "grant";
1950
+ readonly changes: readonly {
1951
+ readonly instanceId: string;
1952
+ readonly delta: number;
1953
+ }[];
1954
+ readonly at: number;
1955
+ }[];
1956
+ };
1957
+ }>;
1958
+
1959
+ /** Observation only; callers retain the saved original until terminal evidence.
1960
+ * No durable browser journal, automatic retry or provider authority is supplied. */
1961
+ export declare const useSubscriptionReceipt: (input: typeof subscriptionReceiptDescriptor.input.Type | undefined, apiName?: string) => SubscriptionIdle | SubscriptionState<{
1962
+ readonly requestId: string;
1963
+ readonly state: "not-observed";
1964
+ } | {
1965
+ readonly requestId: string;
1966
+ readonly state: "fulfilled";
1967
+ readonly receipt: {
1968
+ readonly operationId: string;
1969
+ readonly entitlementId: string;
1970
+ readonly kind: "start" | "daily" | "renew";
1971
+ readonly at: number;
1972
+ readonly periodIndex: number;
1973
+ readonly day: number | null;
1974
+ readonly window: {
1975
+ readonly startsAt: number;
1976
+ readonly expiresAt: number;
1977
+ readonly graceUntil: number;
1978
+ readonly state: "expired" | "active" | "grace";
1979
+ };
1980
+ readonly value: {
1981
+ readonly orderId: string;
1982
+ readonly offerId: string;
1983
+ readonly offerVersion: string;
1984
+ readonly offerDigest: string;
1985
+ readonly quantity: number;
1986
+ readonly at: number;
1987
+ readonly pricePaid: {
1988
+ readonly kind: "free";
1989
+ } | {
1990
+ readonly kind: "virtual";
1991
+ readonly currency: string;
1992
+ readonly amount: string;
1993
+ };
1994
+ readonly transfers: readonly {
1995
+ readonly txId: string;
1996
+ readonly currency: string;
1997
+ readonly amount: string;
1998
+ readonly at: number;
1999
+ }[];
2000
+ readonly grants: readonly {
2001
+ readonly operationId: string;
2002
+ readonly kind: "grant";
2003
+ readonly changes: readonly {
2004
+ readonly instanceId: string;
2005
+ readonly delta: number;
2006
+ }[];
2007
+ readonly at: number;
2008
+ }[];
2009
+ };
2010
+ } | {
2011
+ readonly operationId: string;
2012
+ readonly entitlementId: string;
2013
+ readonly at: number;
2014
+ readonly renews: false;
2015
+ };
2016
+ }>;
2017
+
2018
+ export declare const useSubscriptions: (apiName?: string) => SubscriptionState<readonly {
2019
+ readonly subscription: {
2020
+ readonly id: string;
2021
+ readonly version: string;
2022
+ readonly titleKey: string;
2023
+ readonly price: {
2024
+ readonly kind: "free";
2025
+ } | {
2026
+ readonly kind: "virtual";
2027
+ readonly options: readonly {
2028
+ readonly currency: string;
2029
+ readonly amount: string;
2030
+ }[];
2031
+ } | {
2032
+ readonly prices: {
2033
+ readonly [x: string]: number;
2034
+ };
2035
+ readonly storeProductIds: {
2036
+ readonly [x: string]: string;
2037
+ };
2038
+ readonly kind: "real";
2039
+ } | {
2040
+ readonly kind: "mixed";
2041
+ readonly real: {
2042
+ readonly prices: {
2043
+ readonly [x: string]: number;
2044
+ };
2045
+ readonly storeProductIds: {
2046
+ readonly [x: string]: string;
2047
+ };
2048
+ };
2049
+ readonly virtual: readonly {
2050
+ readonly currency: string;
2051
+ readonly amount: string;
2052
+ }[];
2053
+ };
2054
+ readonly period: {
2055
+ readonly unit: "day" | "week" | "month";
2056
+ readonly count: number;
2057
+ };
2058
+ readonly grants: {
2059
+ readonly onPurchase: {
2060
+ readonly items: readonly {
2061
+ readonly itemId: string;
2062
+ readonly qty: number;
2063
+ }[];
2064
+ readonly currencies: readonly {
2065
+ readonly currency: string;
2066
+ readonly amount: string;
2067
+ }[];
2068
+ };
2069
+ readonly daily: {
2070
+ readonly items: readonly {
2071
+ readonly itemId: string;
2072
+ readonly qty: number;
2073
+ }[];
2074
+ readonly currencies: readonly {
2075
+ readonly currency: string;
2076
+ readonly amount: string;
2077
+ }[];
2078
+ };
2079
+ };
2080
+ readonly graceDays: number;
2081
+ readonly coolingOff: {
2082
+ readonly days: number;
2083
+ readonly overrideReason: string | null;
2084
+ };
2085
+ readonly disclosure: {
2086
+ readonly durationKey: string;
2087
+ readonly renewalKey: string;
2088
+ readonly cancellationPath: string;
2089
+ };
2090
+ };
2091
+ readonly subscriptionDigest: string;
2092
+ }[]>;
2093
+
2094
+ /** Original receipt observation only; no durable journal or automatic retry. */
2095
+ export declare const useTradeReceipt: (input: typeof tradeReceiptDescriptor.input.Type | undefined, apiName?: string) => SubscriptionIdle | SubscriptionState<{
2096
+ readonly requestId: string;
2097
+ readonly state: "not-observed";
2098
+ } | {
2099
+ readonly requestId: string;
2100
+ readonly state: "fulfilled";
2101
+ readonly receipt: {
2102
+ readonly operationId: string;
2103
+ readonly requestId: string;
2104
+ readonly trade: {
2105
+ readonly tradeId: string;
2106
+ readonly tradeDigest: string;
2107
+ readonly proposerId: string;
2108
+ readonly toId: string | null;
2109
+ readonly offered: {
2110
+ readonly items: readonly {
2111
+ readonly instanceId: string;
2112
+ readonly qty: number;
2113
+ }[];
2114
+ readonly currencies: readonly {
2115
+ readonly currency: string;
2116
+ readonly amount: string;
2117
+ }[];
2118
+ };
2119
+ readonly requested: {
2120
+ readonly items: readonly {
2121
+ readonly instanceId: string;
2122
+ readonly qty: number;
2123
+ }[];
2124
+ readonly currencies: readonly {
2125
+ readonly currency: string;
2126
+ readonly amount: string;
2127
+ }[];
2128
+ };
2129
+ readonly createdAt: number;
2130
+ readonly expiresAt: number;
2131
+ readonly state: "expired" | "cancelled" | "accepted" | "proposed";
2132
+ readonly accepterId: string | null;
2133
+ readonly rulesVersion: string;
2134
+ readonly taxes: readonly {
2135
+ readonly leg: "requested" | "offered";
2136
+ readonly currency: string;
2137
+ readonly gross: string;
2138
+ readonly net: string;
2139
+ readonly tax: string;
2140
+ }[];
2141
+ };
2142
+ };
2143
+ }>;
2144
+
2145
+ export declare const useTrades: (apiName?: string) => SubscriptionState<readonly {
2146
+ readonly tradeId: string;
2147
+ readonly tradeDigest: string;
2148
+ readonly proposerId: string;
2149
+ readonly toId: string | null;
2150
+ readonly offered: {
2151
+ readonly items: readonly {
2152
+ readonly instanceId: string;
2153
+ readonly qty: number;
2154
+ }[];
2155
+ readonly currencies: readonly {
2156
+ readonly currency: string;
2157
+ readonly amount: string;
2158
+ }[];
2159
+ };
2160
+ readonly requested: {
2161
+ readonly items: readonly {
2162
+ readonly instanceId: string;
2163
+ readonly qty: number;
2164
+ }[];
2165
+ readonly currencies: readonly {
2166
+ readonly currency: string;
2167
+ readonly amount: string;
2168
+ }[];
2169
+ };
2170
+ readonly createdAt: number;
2171
+ readonly expiresAt: number;
2172
+ readonly state: "expired" | "cancelled" | "accepted" | "proposed";
2173
+ readonly accepterId: string | null;
2174
+ readonly rulesVersion: string;
2175
+ readonly taxes: readonly {
2176
+ readonly leg: "requested" | "offered";
2177
+ readonly currency: string;
2178
+ readonly gross: string;
2179
+ readonly net: string;
2180
+ readonly tax: string;
2181
+ }[];
2182
+ }[]>;
2183
+
2184
+ export declare const useUnlockPiggyBank: (apiName?: string) => ActionState<{
2185
+ readonly requestId: string;
2186
+ readonly bankDigest: string;
2187
+ readonly bankId: string;
2188
+ readonly bankVersion: string;
2189
+ readonly currency?: string | undefined;
2190
+ }, {
2191
+ readonly event: {
2192
+ readonly kind: "fill";
2193
+ readonly authorityId: string;
2194
+ readonly eventId: string;
2195
+ readonly sourceId: string;
2196
+ readonly acceptedAmount: string;
2197
+ readonly delta: string;
2198
+ readonly id: string;
2199
+ readonly sequence: number;
2200
+ readonly at: number;
2201
+ };
2202
+ readonly operationId: string;
2203
+ readonly requestId: string;
2204
+ readonly bankId: string;
2205
+ readonly available: string;
2206
+ } | {
2207
+ readonly event: {
2208
+ readonly kind: "unlock";
2209
+ readonly amount: string;
2210
+ readonly remaining: string;
2211
+ readonly id: string;
2212
+ readonly sequence: number;
2213
+ readonly at: number;
2214
+ };
2215
+ readonly value: {
2216
+ readonly orderId: string;
2217
+ readonly offerId: string;
2218
+ readonly offerVersion: string;
2219
+ readonly offerDigest: string;
2220
+ readonly quantity: number;
2221
+ readonly at: number;
2222
+ readonly pricePaid: {
2223
+ readonly kind: "free";
2224
+ } | {
2225
+ readonly kind: "virtual";
2226
+ readonly currency: string;
2227
+ readonly amount: string;
2228
+ };
2229
+ readonly transfers: readonly {
2230
+ readonly txId: string;
2231
+ readonly currency: string;
2232
+ readonly amount: string;
2233
+ readonly at: number;
2234
+ }[];
2235
+ readonly grants: readonly {
2236
+ readonly operationId: string;
2237
+ readonly kind: "grant";
2238
+ readonly changes: readonly {
2239
+ readonly instanceId: string;
2240
+ readonly delta: number;
2241
+ }[];
2242
+ readonly at: number;
2243
+ }[];
2244
+ };
2245
+ readonly operationId: string;
2246
+ readonly requestId: string;
2247
+ readonly bankId: string;
2248
+ readonly available: string;
2249
+ }>;
2250
+
2251
+ export declare const useWallets: (apiName?: string) => SubscriptionState<readonly {
2252
+ readonly currency: string;
2253
+ readonly balance: string;
2254
+ readonly updatedAt: number | null;
2255
+ }[]>;
2256
+
2257
+ export { }