@domino-sdk/relay 1.0.0-next.8 → 1.0.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 (59) hide show
  1. package/README.md +1 -1
  2. package/dist/activity-DeKJsRry.d.ts +9112 -0
  3. package/dist/authoring.d.ts +1135 -285
  4. package/dist/authoring.js +545 -269
  5. package/dist/automatic-outcomes-B1xrETxm.d.ts +758 -0
  6. package/dist/avatar.d.ts +2 -2
  7. package/dist/browser-DFe7sWSN.d.ts +4154 -0
  8. package/dist/browser.d.ts +11 -2528
  9. package/dist/browser.js +8 -6
  10. package/dist/capability-error-DNMwKmlL.d.ts +458 -0
  11. package/dist/{chunk-V7EZUZ3Z.js → chunk-36HTX2BM.js} +389 -169
  12. package/dist/chunk-6QJ3LADK.js +112 -0
  13. package/dist/{chunk-77H7APVD.js → chunk-BGGKNIRP.js} +1 -1
  14. package/dist/chunk-EYH5RDIE.js +496 -0
  15. package/dist/chunk-GQKYAQM6.js +84 -0
  16. package/dist/chunk-GUP7YRR4.js +42 -0
  17. package/dist/{chunk-V5R2DMGY.js → chunk-GZ6FJAXN.js} +380 -128
  18. package/dist/chunk-JON5SESL.js +2986 -0
  19. package/dist/chunk-MC6V6VMG.js +49 -0
  20. package/dist/chunk-NPGENI7K.js +37 -0
  21. package/dist/chunk-VFHHLN6A.js +284 -0
  22. package/dist/chunk-WJSSJ7AF.js +151 -0
  23. package/dist/{chunk-QBOHLT7M.js → chunk-XFMSUPNS.js} +1 -1
  24. package/dist/{chunk-6A6K5RUD.js → chunk-ZVIRG24J.js} +145 -42
  25. package/dist/{client-CK4nwt7V.d.ts → client-XiuFnug_.d.ts} +2193 -562
  26. package/dist/{submission-input-C9qm9ixd.d.ts → groups-Ck-OxzjD.d.ts} +919 -1142
  27. package/dist/identity-integration-GxAHdKR2.d.ts +58 -0
  28. package/dist/{images--vZ9U0kr.d.ts → images-Dv-P5VBw.d.ts} +2 -2
  29. package/dist/index.d.ts +13 -9
  30. package/dist/index.js +17 -6
  31. package/dist/internal.d.ts +82 -43
  32. package/dist/internal.js +58 -90
  33. package/dist/offers-Cy-e4o5x.d.ts +431 -0
  34. package/dist/{pages-BzqJuI69.d.ts → outcomes-kVB-Juzs.d.ts} +2386 -1490
  35. package/dist/pages-BBYD21IE.d.ts +359 -0
  36. package/dist/participant-rewards-3duLb8YJ.d.ts +668 -0
  37. package/dist/portal-proxy.js +22 -4
  38. package/dist/{profiles-DDMFBRKe.d.ts → profiles-D2aFcOxu.d.ts} +15 -15
  39. package/dist/react/index.d.ts +3122 -1011
  40. package/dist/react/index.js +1627 -779
  41. package/dist/request-error-DWduJCGV.d.ts +62 -0
  42. package/dist/schema-DfJzH2ci.d.ts +5644 -0
  43. package/dist/schema.d.ts +15 -4216
  44. package/dist/schema.js +322 -81
  45. package/dist/server/index.d.ts +81498 -0
  46. package/dist/server/index.js +2520 -0
  47. package/dist/{streaks-CwGReWGt.d.ts → streaks-CWyq8Px5.d.ts} +2 -4
  48. package/dist/submission-input-BZkm6ohU.d.ts +290 -0
  49. package/dist/vite.d.ts +1 -1
  50. package/dist/vite.js +1 -0
  51. package/dist/{wallet-BGOfFkG9.d.ts → wallet-YssWxGg8.d.ts} +35 -38
  52. package/package.json +8 -2
  53. package/dist/chunk-MRIURJE3.js +0 -257
  54. package/dist/chunk-VARGF4JS.js +0 -1733
  55. package/dist/chunk-ZWY3R6B3.js +0 -26
  56. package/dist/collection-BGneJ6Bk.d.ts +0 -114
  57. package/dist/integrations-C3Sp558f.d.ts +0 -1297
  58. package/dist/point-ledgers-iS00Z_v0.d.ts +0 -37
  59. package/dist/schema-pnuWqvGn.d.ts +0 -3396
@@ -0,0 +1,4154 @@
1
+ import { b as QuestEnrollmentInput, Q as QuestClaimInput, f as QuestOutcomeQuery, i as QuestView, P as questExperienceSchema, n as RewardDeliveryAction, A as contentQualificationQuerySchema } from './outcomes-kVB-Juzs.js';
2
+ import { aG as referralAcceptSchema, g as LeaderboardQuery, b as CampaignEnrollmentInput, d as CampaignWithdrawalInput, m as PointHistoryQuery, k as PointEntryKind, V as engagementPageQuerySchema } from './groups-Ck-OxzjD.js';
3
+ import { n as createRelayClient, g as RelayError, m as SubmissionStore, k as RelayRequestOptions, c as QuestController, a as ProgressObservation, b as ProgressObserver, P as PhotoSubmission, e as QuizSubmission, C as ClaimSubmission, V as ValueSubmission } from './client-XiuFnug_.js';
4
+ import { a as PageQuery, g as exchangeSchema, R as RelayEvent, b as ParticipantActivity } from './pages-BBYD21IE.js';
5
+ import { a as AuthProvider } from './submission-input-BZkm6ohU.js';
6
+ import { C as CosmosChain, a as CosmosNetwork, f as WalletSigner, d as WalletSignInNetwork, y as walletAddressInputSchema, I as walletSignatureSchema, L as LinkedWallet } from './wallet-YssWxGg8.js';
7
+ import { a as AttemptStatus, h as TrackerSkipCode, bI as submitSchema, aI as contentPerformanceQuerySchema } from './schema-DfJzH2ci.js';
8
+ import { F as profileUpdateSchema, c as ProfileCompletionQuery } from './profiles-D2aFcOxu.js';
9
+ import * as zod from 'zod';
10
+
11
+ type JSONType = string | number | boolean | null | JSONType[] | {
12
+ [key: string]: JSONType;
13
+ };
14
+
15
+ /** An EIP-1193 provider, such as `window.ethereum` or an EIP-6963 announcement's provider. */
16
+ type Eip1193Provider = {
17
+ request(args: {
18
+ method: string;
19
+ params?: unknown[] | object;
20
+ }): Promise<unknown>;
21
+ };
22
+ /** The legacy injected Solana shape Phantom, Solflare and Backpack expose. */
23
+ type SolanaInjectedProvider = {
24
+ connect(): Promise<unknown>;
25
+ publicKey?: {
26
+ toBase58(): string;
27
+ } | null;
28
+ signMessage(message: Uint8Array, display?: "utf8"): Promise<{
29
+ signature: Uint8Array;
30
+ } | Uint8Array>;
31
+ };
32
+ /** The part of a Wallet Standard account Relay uses. */
33
+ type StandardWalletAccount = {
34
+ readonly address: string;
35
+ readonly chains: readonly string[];
36
+ };
37
+ /** The part of a Wallet Standard wallet Relay uses; any conforming wallet object fits. */
38
+ type StandardWallet = {
39
+ readonly name: string;
40
+ readonly icon?: string;
41
+ readonly chains: readonly string[];
42
+ readonly accounts: readonly StandardWalletAccount[];
43
+ readonly features: Readonly<Record<string, unknown>>;
44
+ };
45
+ /** Keplr's API, which Leap and Cosmostation also implement. */
46
+ type KeplrLike = {
47
+ enable(chainId: string | string[]): Promise<void>;
48
+ getKey(chainId: string): Promise<{
49
+ bech32Address: string;
50
+ }>;
51
+ signArbitrary(chainId: string, signer: string, data: string): Promise<{
52
+ signature: string;
53
+ pub_key: {
54
+ type: string;
55
+ value: string;
56
+ };
57
+ }>;
58
+ /** Adds a chain the wallet does not know, after the user approves it. */
59
+ experimentalSuggestChain?(chainInfo: CosmosChain["chainInfo"]): Promise<void>;
60
+ };
61
+ /** A wallet found in the page, ready to pass to `relay.wallets.link`. */
62
+ type DiscoveredWallet = {
63
+ id: string;
64
+ name: string;
65
+ icon?: string;
66
+ signer: WalletSigner;
67
+ };
68
+ /** Signs with an EIP-1193 provider through `personal_sign`. */
69
+ declare function evmSigner(provider: Eip1193Provider, info?: {
70
+ name?: string;
71
+ }): WalletSigner;
72
+ /** Signs with a legacy injected Solana provider, such as `window.phantom.solana`. */
73
+ declare function solanaSigner(provider: SolanaInjectedProvider, info?: {
74
+ name?: string;
75
+ }): WalletSigner;
76
+ /** Signs with a Wallet Standard wallet's `solana:signMessage` feature. */
77
+ declare function walletStandardSolanaSigner(wallet: StandardWallet): WalletSigner;
78
+ /**
79
+ * Signs an ADR-36 message with Keplr or a wallet that implements its API, on the app's chain:
80
+ * `{ chainId, chainInfo? }` or `"cosmos:<chain ID>"`. When the wallet does not know the chain and
81
+ * `chainInfo` is given, it suggests the chain to the wallet (`experimentalSuggestChain`) and tries
82
+ * again; without `chainInfo`, or with a wallet that cannot add chains, it throws an error that
83
+ * names the chain. Other failures, such as a rejected request, pass through.
84
+ */
85
+ declare function cosmosSigner(provider: KeplrLike, chain: CosmosChain | CosmosNetwork, info?: {
86
+ name?: string;
87
+ }): WalletSigner;
88
+ /** EIP-6963 wallets, or `window.ethereum` when none announce themselves within `timeoutMs`. */
89
+ declare function discoverEvmWallets(timeoutMs?: number): Promise<DiscoveredWallet[]>;
90
+ /** Wallet Standard wallets that can sign Solana messages, then legacy injected providers. */
91
+ declare function discoverSolanaWallets(): DiscoveredWallet[];
92
+ /**
93
+ * Keplr, Leap and Cosmostation, each signing on the app's chain (see `cosmosSigner`). IDs end with
94
+ * the chain ID.
95
+ */
96
+ declare function discoverCosmosWallets(chain: CosmosChain | CosmosNetwork): DiscoveredWallet[];
97
+ /**
98
+ * The Cosmos SDK chains an app offers wallets on: one chain or several, each as
99
+ * `{ chainId, chainInfo? }` or `"cosmos:<chain ID>"`. Relay has no chain list of its own.
100
+ */
101
+ type CosmosChains = CosmosChain | CosmosNetwork | readonly (CosmosChain | CosmosNetwork)[];
102
+ /** The chains in `CosmosChains`, as a list. */
103
+ declare function cosmosChainList(chains: CosmosChains | undefined): (CosmosChain | CosmosNetwork)[];
104
+ /** An installed wallet that can sign in on one of the project's enabled wallet families. */
105
+ type SignInWallet = DiscoveredWallet & {
106
+ network: WalletSignInNetwork;
107
+ };
108
+ /**
109
+ * The wallets installed in this browser that can sign in with `families`: EVM wallets first, then
110
+ * Solana wallets, then Cosmos wallets once per chain in `cosmos`. Without `cosmos` there are no
111
+ * Cosmos wallets. Empty during SSR.
112
+ */
113
+ declare function discoverSignInWallets(families: readonly WalletSignInNetwork[], cosmos?: CosmosChains): Promise<SignInWallet[]>;
114
+
115
+ type Auth = ReturnType<typeof createRelayClient>["auth"];
116
+ /** The part of a Relay client sign-in options use. */
117
+ type SignInClient = {
118
+ auth: Pick<Auth, "providers" | "start" | "emailStart" | "emailVerify"> & {
119
+ wallet: Pick<Auth["wallet"], "signIn">;
120
+ };
121
+ };
122
+ /** The sign-in methods a project takes: the platform's OAuth providers and email, and its wallet families. */
123
+ type SignInMethods = {
124
+ providers: AuthProvider[];
125
+ email: boolean;
126
+ /** The wallet families this project enabled for sign-in in Console. */
127
+ wallets: WalletSignInNetwork[];
128
+ /**
129
+ * Set when the methods could not be read, such as when the network failed: they are then email
130
+ * alone, and the server has the final say when the participant uses it.
131
+ */
132
+ error?: RelayError;
133
+ };
134
+ /** Which icon to draw: an OAuth provider's logo, a mail icon, or a generic wallet icon. */
135
+ type SignInIcon = AuthProvider | "email" | "wallet";
136
+ type OAuthSignInOption = {
137
+ kind: "oauth";
138
+ /** The provider, such as `"google"`. */
139
+ id: AuthProvider;
140
+ /** The provider's name, such as "Google". */
141
+ label: string;
142
+ icon: AuthProvider;
143
+ /** Leaves the page for the provider's consent screen. See `SignInOption` for failures. */
144
+ start(): Promise<void>;
145
+ };
146
+ type EmailSignInOption = {
147
+ kind: "email";
148
+ id: "email";
149
+ label: string;
150
+ icon: "email";
151
+ /** Emails a one-time code to the address. */
152
+ sendCode(email: string): Promise<void>;
153
+ /** Signs in with the code sent last. */
154
+ verifyCode(code: string): Promise<void>;
155
+ };
156
+ type WalletSignInOption = {
157
+ kind: "wallet";
158
+ /** Unique among the options, such as `"wallet:eip155:io.metamask"`. */
159
+ id: string;
160
+ /** The wallet's name, with its family or chain when another installed wallet has the same name. */
161
+ label: string;
162
+ icon: "wallet";
163
+ /** The wallet's own icon, a data or HTTPS URL, when it announces one. */
164
+ iconUrl?: string;
165
+ /** The wallet family it signs in with. */
166
+ family: WalletSignInNetwork;
167
+ /** The signer, for `useWallets().link` or `relay.wallets.link`. */
168
+ signer: WalletSigner;
169
+ /** Asks the wallet to sign a message, then signs in, or signs up. See `SignInOption` for failures. */
170
+ start(): Promise<void>;
171
+ };
172
+ /**
173
+ * One way to sign in that this project takes and this browser can use. From `useSignInOptions()`
174
+ * its actions never reject: a failure lands in the hook's `error`. From `signInOptions()` they
175
+ * reject with the failure.
176
+ */
177
+ type SignInOption = OAuthSignInOption | EmailSignInOption | WalletSignInOption;
178
+ /**
179
+ * A sign-in method the project enabled that is not offered, and why:
180
+ * - `cosmos-chains-missing`: the project takes Cosmos wallets but the app named no Cosmos chains.
181
+ * For the app's developer; pass `cosmos` to offer them.
182
+ * - `cosmos-chains-invalid`: the project takes Cosmos wallets but a chain in `cosmos` is not one,
183
+ * such as `"cosmoshub-4"` without the `cosmos:` prefix. For the app's developer; `message` says
184
+ * what is wrong.
185
+ * - `no-wallet-installed`: the project takes wallets but this browser has none for its families.
186
+ * For the participant; `message` says which to install.
187
+ */
188
+ type SignInUnavailable = {
189
+ reason: "cosmos-chains-missing" | "cosmos-chains-invalid" | "no-wallet-installed";
190
+ families: WalletSignInNetwork[];
191
+ message: string;
192
+ };
193
+ type SignInOptions = {
194
+ /** OAuth providers first, then installed wallets, then email. */
195
+ options: SignInOption[];
196
+ unavailable: SignInUnavailable[];
197
+ /** Why the project's methods could not be read; the options are then email alone. */
198
+ methodsError?: RelayError;
199
+ };
200
+ /**
201
+ * Every way a participant can sign in to this project from this browser, for apps without React:
202
+ * the OAuth providers and email the platform configured, and the installed wallets of the families
203
+ * the project enabled. Cosmos wallets need the app's chains in `cosmos`; without them, or when one
204
+ * is invalid, they are not offered and `unavailable` says so. Each option signs in with this
205
+ * client: OAuth leaves the page, email sends a code and then verifies it, a wallet signs a
206
+ * message. The actions reject when they fail.
207
+ */
208
+ declare function signInOptions(relay: SignInClient, input?: {
209
+ cosmos?: CosmosChains;
210
+ }): Promise<SignInOptions>;
211
+
212
+ /** Browser client with durable submission recovery; safe to construct during SSR. */
213
+ declare function createBrowserRelayClient(options: Parameters<typeof createRelayClient>[0]): {
214
+ offers: {
215
+ list: (requestOptions?: RelayRequestOptions) => Promise<{
216
+ id: string;
217
+ title: string;
218
+ price: {
219
+ kind: "points";
220
+ balance: string;
221
+ amount: number;
222
+ };
223
+ reward: {
224
+ kind: "tier";
225
+ reward: {
226
+ id: string;
227
+ title: string;
228
+ tiers: {
229
+ id: string;
230
+ title: string;
231
+ }[];
232
+ inventory: {
233
+ kind: "untracked";
234
+ };
235
+ fulfillment: {
236
+ kind: "staff-handover";
237
+ } | {
238
+ kind: "automatic";
239
+ };
240
+ };
241
+ tier: string;
242
+ };
243
+ stock: number;
244
+ limit: {
245
+ perMember: number;
246
+ };
247
+ enabled: boolean;
248
+ revision: number;
249
+ available: number;
250
+ redeemed: number;
251
+ availability: {
252
+ kind: "available";
253
+ remaining: number;
254
+ } | {
255
+ kind: "out-of-stock";
256
+ } | {
257
+ kind: "limit-reached";
258
+ } | {
259
+ kind: "paused";
260
+ };
261
+ key?: string | undefined;
262
+ }[]>;
263
+ redeem: (offer: string, input?: {
264
+ actionId?: string;
265
+ }, requestOptions?: RelayRequestOptions) => Promise<{
266
+ status: "fulfilled";
267
+ id: string;
268
+ offer: string;
269
+ member: string;
270
+ reservation: string;
271
+ price: {
272
+ kind: "points";
273
+ balance: string;
274
+ amount: number;
275
+ };
276
+ reward: {
277
+ kind: "tier";
278
+ reward: {
279
+ id: string;
280
+ title: string;
281
+ tiers: {
282
+ id: string;
283
+ title: string;
284
+ }[];
285
+ inventory: {
286
+ kind: "untracked";
287
+ };
288
+ fulfillment: {
289
+ kind: "staff-handover";
290
+ } | {
291
+ kind: "automatic";
292
+ };
293
+ };
294
+ tier: string;
295
+ };
296
+ entitlement: string;
297
+ revision: number;
298
+ redeemedAt: number;
299
+ } | {
300
+ status: "canceled";
301
+ canceledAt: number;
302
+ reason: string;
303
+ id: string;
304
+ offer: string;
305
+ member: string;
306
+ reservation: string;
307
+ price: {
308
+ kind: "points";
309
+ balance: string;
310
+ amount: number;
311
+ };
312
+ reward: {
313
+ kind: "tier";
314
+ reward: {
315
+ id: string;
316
+ title: string;
317
+ tiers: {
318
+ id: string;
319
+ title: string;
320
+ }[];
321
+ inventory: {
322
+ kind: "untracked";
323
+ };
324
+ fulfillment: {
325
+ kind: "staff-handover";
326
+ } | {
327
+ kind: "automatic";
328
+ };
329
+ };
330
+ tier: string;
331
+ };
332
+ entitlement: string;
333
+ revision: number;
334
+ redeemedAt: number;
335
+ }>;
336
+ };
337
+ referrals: {
338
+ list: (requestOptions?: RelayRequestOptions) => Promise<{
339
+ id: string;
340
+ title: string;
341
+ enabled: boolean;
342
+ qualification: {
343
+ kind: "signup";
344
+ } | {
345
+ kind: "quest";
346
+ quest: string;
347
+ } | {
348
+ kind: "external";
349
+ };
350
+ rewards: {
351
+ inviter: ({
352
+ kind: "tier";
353
+ reward: {
354
+ id: string;
355
+ title: string;
356
+ tiers: {
357
+ id: string;
358
+ title: string;
359
+ }[];
360
+ inventory: {
361
+ kind: "untracked";
362
+ };
363
+ fulfillment: {
364
+ kind: "staff-handover";
365
+ } | {
366
+ kind: "automatic";
367
+ };
368
+ };
369
+ tier: string;
370
+ } | {
371
+ kind: "points";
372
+ balance: string;
373
+ amount: number;
374
+ })[];
375
+ invitee: ({
376
+ kind: "tier";
377
+ reward: {
378
+ id: string;
379
+ title: string;
380
+ tiers: {
381
+ id: string;
382
+ title: string;
383
+ }[];
384
+ inventory: {
385
+ kind: "untracked";
386
+ };
387
+ fulfillment: {
388
+ kind: "staff-handover";
389
+ } | {
390
+ kind: "automatic";
391
+ };
392
+ };
393
+ tier: string;
394
+ } | {
395
+ kind: "points";
396
+ balance: string;
397
+ amount: number;
398
+ })[];
399
+ };
400
+ milestones: {
401
+ id: string;
402
+ count: number;
403
+ rewards: ({
404
+ kind: "tier";
405
+ reward: {
406
+ id: string;
407
+ title: string;
408
+ tiers: {
409
+ id: string;
410
+ title: string;
411
+ }[];
412
+ inventory: {
413
+ kind: "untracked";
414
+ };
415
+ fulfillment: {
416
+ kind: "staff-handover";
417
+ } | {
418
+ kind: "automatic";
419
+ };
420
+ };
421
+ tier: string;
422
+ } | {
423
+ kind: "points";
424
+ balance: string;
425
+ amount: number;
426
+ })[];
427
+ }[];
428
+ bonuses: {
429
+ id: string;
430
+ balance: string;
431
+ basisPoints: number;
432
+ external: boolean;
433
+ quests?: string[] | undefined;
434
+ durationDays?: number | undefined;
435
+ maxPoints?: number | undefined;
436
+ }[];
437
+ key?: string | undefined;
438
+ inviterGroup?: string | undefined;
439
+ }[]>;
440
+ summary: (requestOptions?: RelayRequestOptions) => Promise<{
441
+ code: string;
442
+ attributed: number;
443
+ programs: {
444
+ definition: {
445
+ id: string;
446
+ title: string;
447
+ enabled: boolean;
448
+ qualification: {
449
+ kind: "signup";
450
+ } | {
451
+ kind: "quest";
452
+ quest: string;
453
+ } | {
454
+ kind: "external";
455
+ };
456
+ rewards: {
457
+ inviter: ({
458
+ kind: "tier";
459
+ reward: {
460
+ id: string;
461
+ title: string;
462
+ tiers: {
463
+ id: string;
464
+ title: string;
465
+ }[];
466
+ inventory: {
467
+ kind: "untracked";
468
+ };
469
+ fulfillment: {
470
+ kind: "staff-handover";
471
+ } | {
472
+ kind: "automatic";
473
+ };
474
+ };
475
+ tier: string;
476
+ } | {
477
+ kind: "points";
478
+ balance: string;
479
+ amount: number;
480
+ })[];
481
+ invitee: ({
482
+ kind: "tier";
483
+ reward: {
484
+ id: string;
485
+ title: string;
486
+ tiers: {
487
+ id: string;
488
+ title: string;
489
+ }[];
490
+ inventory: {
491
+ kind: "untracked";
492
+ };
493
+ fulfillment: {
494
+ kind: "staff-handover";
495
+ } | {
496
+ kind: "automatic";
497
+ };
498
+ };
499
+ tier: string;
500
+ } | {
501
+ kind: "points";
502
+ balance: string;
503
+ amount: number;
504
+ })[];
505
+ };
506
+ milestones: {
507
+ id: string;
508
+ count: number;
509
+ rewards: ({
510
+ kind: "tier";
511
+ reward: {
512
+ id: string;
513
+ title: string;
514
+ tiers: {
515
+ id: string;
516
+ title: string;
517
+ }[];
518
+ inventory: {
519
+ kind: "untracked";
520
+ };
521
+ fulfillment: {
522
+ kind: "staff-handover";
523
+ } | {
524
+ kind: "automatic";
525
+ };
526
+ };
527
+ tier: string;
528
+ } | {
529
+ kind: "points";
530
+ balance: string;
531
+ amount: number;
532
+ })[];
533
+ }[];
534
+ bonuses: {
535
+ id: string;
536
+ balance: string;
537
+ basisPoints: number;
538
+ external: boolean;
539
+ quests?: string[] | undefined;
540
+ durationDays?: number | undefined;
541
+ maxPoints?: number | undefined;
542
+ }[];
543
+ key?: string | undefined;
544
+ inviterGroup?: string | undefined;
545
+ };
546
+ qualified: number;
547
+ milestones: {
548
+ id: string;
549
+ count: number;
550
+ reached: boolean;
551
+ }[];
552
+ }[];
553
+ accounts: {
554
+ id: string;
555
+ program: string;
556
+ kind: "fixed" | "milestone" | "bonus";
557
+ balance: string;
558
+ earned: number;
559
+ settled: number;
560
+ outstanding: number;
561
+ }[];
562
+ }>;
563
+ history: (query?: PageQuery, requestOptions?: RelayRequestOptions) => Promise<{
564
+ items: {
565
+ id: number;
566
+ program: string;
567
+ balance: string;
568
+ amount: number;
569
+ at: number;
570
+ reason: string;
571
+ }[];
572
+ nextCursor: string | null;
573
+ }>;
574
+ accept: (value: zod.input<typeof referralAcceptSchema>, requestOptions?: RelayRequestOptions) => Promise<{
575
+ ok: true;
576
+ }>;
577
+ };
578
+ rewards: {
579
+ entitlements: (options?: RelayRequestOptions) => Promise<{
580
+ items: ({
581
+ [x: string]: unknown;
582
+ status: "available";
583
+ id: string;
584
+ member: string;
585
+ reward: {
586
+ [x: string]: unknown;
587
+ id: string;
588
+ title: string;
589
+ tiers: {
590
+ [x: string]: unknown;
591
+ id: string;
592
+ title: string;
593
+ }[];
594
+ inventory: {
595
+ [x: string]: unknown;
596
+ kind: string;
597
+ };
598
+ fulfillment: {
599
+ [x: string]: unknown;
600
+ kind: string;
601
+ };
602
+ };
603
+ earnedTier: string;
604
+ tier: string;
605
+ revision: number;
606
+ } | {
607
+ [x: string]: unknown;
608
+ status: "handing-over";
609
+ handover: string;
610
+ startedAt: number;
611
+ id: string;
612
+ member: string;
613
+ reward: {
614
+ [x: string]: unknown;
615
+ id: string;
616
+ title: string;
617
+ tiers: {
618
+ [x: string]: unknown;
619
+ id: string;
620
+ title: string;
621
+ }[];
622
+ inventory: {
623
+ [x: string]: unknown;
624
+ kind: string;
625
+ };
626
+ fulfillment: {
627
+ [x: string]: unknown;
628
+ kind: string;
629
+ };
630
+ };
631
+ earnedTier: string;
632
+ tier: string;
633
+ revision: number;
634
+ allocation?: {
635
+ [x: string]: unknown;
636
+ item: string;
637
+ label: string;
638
+ } | undefined;
639
+ } | {
640
+ [x: string]: unknown;
641
+ status: "collected";
642
+ handover: string;
643
+ startedAt: number;
644
+ collectedAt: number;
645
+ id: string;
646
+ member: string;
647
+ reward: {
648
+ [x: string]: unknown;
649
+ id: string;
650
+ title: string;
651
+ tiers: {
652
+ [x: string]: unknown;
653
+ id: string;
654
+ title: string;
655
+ }[];
656
+ inventory: {
657
+ [x: string]: unknown;
658
+ kind: string;
659
+ };
660
+ fulfillment: {
661
+ [x: string]: unknown;
662
+ kind: string;
663
+ };
664
+ };
665
+ earnedTier: string;
666
+ tier: string;
667
+ revision: number;
668
+ allocation?: {
669
+ [x: string]: unknown;
670
+ item: string;
671
+ label: string;
672
+ } | undefined;
673
+ recovery?: {
674
+ completion: string;
675
+ reason: string;
676
+ flaggedAt: number;
677
+ remainingTier: string | null;
678
+ } | undefined;
679
+ } | {
680
+ [x: string]: unknown;
681
+ status: "void";
682
+ voidedAt: number;
683
+ id: string;
684
+ member: string;
685
+ reward: {
686
+ [x: string]: unknown;
687
+ id: string;
688
+ title: string;
689
+ tiers: {
690
+ [x: string]: unknown;
691
+ id: string;
692
+ title: string;
693
+ }[];
694
+ inventory: {
695
+ [x: string]: unknown;
696
+ kind: string;
697
+ };
698
+ fulfillment: {
699
+ [x: string]: unknown;
700
+ kind: string;
701
+ };
702
+ };
703
+ earnedTier: string;
704
+ tier: string;
705
+ revision: number;
706
+ } | {
707
+ status: "unsupported";
708
+ reportedStatus: string;
709
+ id: string;
710
+ member: string;
711
+ reward: {
712
+ [x: string]: unknown;
713
+ id: string;
714
+ title: string;
715
+ tiers: {
716
+ [x: string]: unknown;
717
+ id: string;
718
+ title: string;
719
+ }[];
720
+ inventory: {
721
+ [x: string]: unknown;
722
+ kind: string;
723
+ };
724
+ fulfillment: {
725
+ [x: string]: unknown;
726
+ kind: string;
727
+ };
728
+ };
729
+ earnedTier: string;
730
+ tier: string;
731
+ revision: number;
732
+ })[];
733
+ }>;
734
+ deliveries: (options?: RelayRequestOptions) => Promise<{
735
+ items: ({
736
+ [x: string]: JSONType;
737
+ kind: "points";
738
+ ledger: {
739
+ id: string;
740
+ key: string | null;
741
+ name: string;
742
+ };
743
+ amount: number;
744
+ reversed: number;
745
+ id: string;
746
+ status: string;
747
+ at: number | null;
748
+ quest: string | null;
749
+ completion: string | null;
750
+ } | {
751
+ [x: string]: unknown;
752
+ kind: "tier";
753
+ entitlement: {
754
+ [x: string]: unknown;
755
+ status: "available";
756
+ id: string;
757
+ member: string;
758
+ reward: {
759
+ [x: string]: unknown;
760
+ id: string;
761
+ title: string;
762
+ tiers: {
763
+ [x: string]: unknown;
764
+ id: string;
765
+ title: string;
766
+ }[];
767
+ inventory: {
768
+ [x: string]: unknown;
769
+ kind: string;
770
+ };
771
+ fulfillment: {
772
+ [x: string]: unknown;
773
+ kind: string;
774
+ };
775
+ };
776
+ earnedTier: string;
777
+ tier: string;
778
+ revision: number;
779
+ } | {
780
+ [x: string]: unknown;
781
+ status: "handing-over";
782
+ handover: string;
783
+ startedAt: number;
784
+ id: string;
785
+ member: string;
786
+ reward: {
787
+ [x: string]: unknown;
788
+ id: string;
789
+ title: string;
790
+ tiers: {
791
+ [x: string]: unknown;
792
+ id: string;
793
+ title: string;
794
+ }[];
795
+ inventory: {
796
+ [x: string]: unknown;
797
+ kind: string;
798
+ };
799
+ fulfillment: {
800
+ [x: string]: unknown;
801
+ kind: string;
802
+ };
803
+ };
804
+ earnedTier: string;
805
+ tier: string;
806
+ revision: number;
807
+ allocation?: {
808
+ [x: string]: unknown;
809
+ item: string;
810
+ label: string;
811
+ } | undefined;
812
+ } | {
813
+ [x: string]: unknown;
814
+ status: "collected";
815
+ handover: string;
816
+ startedAt: number;
817
+ collectedAt: number;
818
+ id: string;
819
+ member: string;
820
+ reward: {
821
+ [x: string]: unknown;
822
+ id: string;
823
+ title: string;
824
+ tiers: {
825
+ [x: string]: unknown;
826
+ id: string;
827
+ title: string;
828
+ }[];
829
+ inventory: {
830
+ [x: string]: unknown;
831
+ kind: string;
832
+ };
833
+ fulfillment: {
834
+ [x: string]: unknown;
835
+ kind: string;
836
+ };
837
+ };
838
+ earnedTier: string;
839
+ tier: string;
840
+ revision: number;
841
+ allocation?: {
842
+ [x: string]: unknown;
843
+ item: string;
844
+ label: string;
845
+ } | undefined;
846
+ recovery?: {
847
+ completion: string;
848
+ reason: string;
849
+ flaggedAt: number;
850
+ remainingTier: string | null;
851
+ } | undefined;
852
+ } | {
853
+ [x: string]: unknown;
854
+ status: "void";
855
+ voidedAt: number;
856
+ id: string;
857
+ member: string;
858
+ reward: {
859
+ [x: string]: unknown;
860
+ id: string;
861
+ title: string;
862
+ tiers: {
863
+ [x: string]: unknown;
864
+ id: string;
865
+ title: string;
866
+ }[];
867
+ inventory: {
868
+ [x: string]: unknown;
869
+ kind: string;
870
+ };
871
+ fulfillment: {
872
+ [x: string]: unknown;
873
+ kind: string;
874
+ };
875
+ };
876
+ earnedTier: string;
877
+ tier: string;
878
+ revision: number;
879
+ } | {
880
+ status: "unsupported";
881
+ reportedStatus: string;
882
+ id: string;
883
+ member: string;
884
+ reward: {
885
+ [x: string]: unknown;
886
+ id: string;
887
+ title: string;
888
+ tiers: {
889
+ [x: string]: unknown;
890
+ id: string;
891
+ title: string;
892
+ }[];
893
+ inventory: {
894
+ [x: string]: unknown;
895
+ kind: string;
896
+ };
897
+ fulfillment: {
898
+ [x: string]: unknown;
899
+ kind: string;
900
+ };
901
+ };
902
+ earnedTier: string;
903
+ tier: string;
904
+ revision: number;
905
+ };
906
+ id: string;
907
+ status: string;
908
+ at: number | null;
909
+ quest: string | null;
910
+ completion: string | null;
911
+ } | {
912
+ [x: string]: JSONType | undefined;
913
+ kind: "integration";
914
+ provider: string;
915
+ action: string;
916
+ deliveredAt: number | null;
917
+ revokedAt: number | null;
918
+ reconciliation: {
919
+ [x: string]: JSONType;
920
+ status: string;
921
+ ownership: string;
922
+ at: number;
923
+ } | null;
924
+ id: string;
925
+ status: string;
926
+ at: number | null;
927
+ quest: string | null;
928
+ completion: string | null;
929
+ roleId?: string | undefined;
930
+ } | {
931
+ kind: "unknown";
932
+ reportedKind: string;
933
+ id: string;
934
+ status: string;
935
+ at: number | null;
936
+ quest: string | null;
937
+ completion: string | null;
938
+ })[];
939
+ }>;
940
+ };
941
+ tieredRewards: {
942
+ list: (requestOptions?: RelayRequestOptions) => Promise<{
943
+ id: string;
944
+ key: string | null;
945
+ }[]>;
946
+ };
947
+ pointLedgers: {
948
+ list: (requestOptions?: RelayRequestOptions) => Promise<{
949
+ id: string;
950
+ key: string | null;
951
+ name: string;
952
+ }[]>;
953
+ };
954
+ leaderboards: {
955
+ list: (requestOptions?: RelayRequestOptions) => Promise<{
956
+ id: string;
957
+ title: string;
958
+ balance: string;
959
+ score: {
960
+ kind: "balance";
961
+ } | {
962
+ window: {
963
+ kind: "fixed";
964
+ start: number;
965
+ end: number;
966
+ } | {
967
+ kind: "all-time";
968
+ } | {
969
+ kind: "rolling";
970
+ days: number;
971
+ } | {
972
+ kind: "calendar";
973
+ period: "day" | "week" | "month";
974
+ };
975
+ kind: "earned";
976
+ quests?: string[] | undefined;
977
+ } | {
978
+ kind: "net";
979
+ window: {
980
+ kind: "fixed";
981
+ start: number;
982
+ end: number;
983
+ } | {
984
+ kind: "all-time";
985
+ } | {
986
+ kind: "rolling";
987
+ days: number;
988
+ } | {
989
+ kind: "calendar";
990
+ period: "day" | "week" | "month";
991
+ };
992
+ };
993
+ access: "participants" | "public";
994
+ key?: string | undefined;
995
+ group?: string | undefined;
996
+ settle?: {
997
+ at: "window-end";
998
+ ties: "shared" | "earliest";
999
+ prizes: {
1000
+ ranks: [number, number];
1001
+ rewards: ({
1002
+ kind: "tier";
1003
+ reward: {
1004
+ id: string;
1005
+ title: string;
1006
+ tiers: {
1007
+ id: string;
1008
+ title: string;
1009
+ }[];
1010
+ inventory: {
1011
+ kind: "untracked";
1012
+ };
1013
+ fulfillment: {
1014
+ kind: "staff-handover";
1015
+ } | {
1016
+ kind: "automatic";
1017
+ };
1018
+ };
1019
+ tier: string;
1020
+ } | {
1021
+ kind: "points";
1022
+ balance: string;
1023
+ amount: number;
1024
+ })[];
1025
+ }[];
1026
+ } | undefined;
1027
+ }[]>;
1028
+ standings: (board: string, query?: LeaderboardQuery, requestOptions?: RelayRequestOptions) => Promise<{
1029
+ leaderboard: string;
1030
+ title: string;
1031
+ version: string;
1032
+ calculation: "balance" | "earned" | "net";
1033
+ period: {
1034
+ start: number | null;
1035
+ end: number | null;
1036
+ };
1037
+ calculatedAt: number;
1038
+ lastEntryAt: number | null;
1039
+ total: number;
1040
+ items: {
1041
+ participant: string;
1042
+ name: string;
1043
+ score: number;
1044
+ rank: number;
1045
+ profile: {
1046
+ id: string;
1047
+ name: string;
1048
+ avatar: {
1049
+ source: "upload";
1050
+ url: string;
1051
+ seed: string;
1052
+ } | {
1053
+ source: "account";
1054
+ provider: "discord" | "x" | "google";
1055
+ url: string;
1056
+ seed: string;
1057
+ } | {
1058
+ source: "generated";
1059
+ seed: string;
1060
+ };
1061
+ } | null;
1062
+ member?: string | undefined;
1063
+ }[];
1064
+ me: {
1065
+ participant: string;
1066
+ name: string;
1067
+ score: number;
1068
+ rank: number;
1069
+ profile: {
1070
+ id: string;
1071
+ name: string;
1072
+ avatar: {
1073
+ source: "upload";
1074
+ url: string;
1075
+ seed: string;
1076
+ } | {
1077
+ source: "account";
1078
+ provider: "discord" | "x" | "google";
1079
+ url: string;
1080
+ seed: string;
1081
+ } | {
1082
+ source: "generated";
1083
+ seed: string;
1084
+ };
1085
+ } | null;
1086
+ member?: string | undefined;
1087
+ } | null;
1088
+ nearby: {
1089
+ participant: string;
1090
+ name: string;
1091
+ score: number;
1092
+ rank: number;
1093
+ profile: {
1094
+ id: string;
1095
+ name: string;
1096
+ avatar: {
1097
+ source: "upload";
1098
+ url: string;
1099
+ seed: string;
1100
+ } | {
1101
+ source: "account";
1102
+ provider: "discord" | "x" | "google";
1103
+ url: string;
1104
+ seed: string;
1105
+ } | {
1106
+ source: "generated";
1107
+ seed: string;
1108
+ };
1109
+ } | null;
1110
+ member?: string | undefined;
1111
+ }[];
1112
+ nextCursor: string | null;
1113
+ }>;
1114
+ placement: (board: string, profile: string, requestOptions?: RelayRequestOptions) => Promise<{
1115
+ leaderboard: string;
1116
+ title: string;
1117
+ profile: string;
1118
+ rank: number | null;
1119
+ score: number | null;
1120
+ total: number;
1121
+ key?: string | undefined;
1122
+ }>;
1123
+ };
1124
+ profiles: {
1125
+ mine: (requestOptions?: RelayRequestOptions) => Promise<{
1126
+ id: string;
1127
+ name: string;
1128
+ avatar: {
1129
+ source: "upload";
1130
+ url: string;
1131
+ seed: string;
1132
+ } | {
1133
+ source: "account";
1134
+ provider: "discord" | "x" | "google";
1135
+ url: string;
1136
+ seed: string;
1137
+ } | {
1138
+ source: "generated";
1139
+ seed: string;
1140
+ };
1141
+ displayName: string | null;
1142
+ avatarChoice: "default" | "account" | "upload" | "generated";
1143
+ avatarProvider: "discord" | "x" | "google" | null;
1144
+ hidden: boolean;
1145
+ locked: boolean;
1146
+ visibility: "private" | "participants" | "public";
1147
+ options: {
1148
+ provider: "discord" | "x" | "google";
1149
+ name: string | null;
1150
+ imageUrl: string | null;
1151
+ }[];
1152
+ }>;
1153
+ update: (value: zod.input<typeof profileUpdateSchema>, requestOptions?: RelayRequestOptions) => Promise<{
1154
+ id: string;
1155
+ name: string;
1156
+ avatar: {
1157
+ source: "upload";
1158
+ url: string;
1159
+ seed: string;
1160
+ } | {
1161
+ source: "account";
1162
+ provider: "discord" | "x" | "google";
1163
+ url: string;
1164
+ seed: string;
1165
+ } | {
1166
+ source: "generated";
1167
+ seed: string;
1168
+ };
1169
+ displayName: string | null;
1170
+ avatarChoice: "default" | "account" | "upload" | "generated";
1171
+ avatarProvider: "discord" | "x" | "google" | null;
1172
+ hidden: boolean;
1173
+ locked: boolean;
1174
+ visibility: "private" | "participants" | "public";
1175
+ options: {
1176
+ provider: "discord" | "x" | "google";
1177
+ name: string | null;
1178
+ imageUrl: string | null;
1179
+ }[];
1180
+ }>;
1181
+ uploadAvatar: (file: Blob, requestOptions?: RelayRequestOptions & {
1182
+ uploadId?: string;
1183
+ }) => Promise<{
1184
+ id: string;
1185
+ name: string;
1186
+ avatar: {
1187
+ source: "upload";
1188
+ url: string;
1189
+ seed: string;
1190
+ } | {
1191
+ source: "account";
1192
+ provider: "discord" | "x" | "google";
1193
+ url: string;
1194
+ seed: string;
1195
+ } | {
1196
+ source: "generated";
1197
+ seed: string;
1198
+ };
1199
+ displayName: string | null;
1200
+ avatarChoice: "default" | "account" | "upload" | "generated";
1201
+ avatarProvider: "discord" | "x" | "google" | null;
1202
+ hidden: boolean;
1203
+ locked: boolean;
1204
+ visibility: "private" | "participants" | "public";
1205
+ options: {
1206
+ provider: "discord" | "x" | "google";
1207
+ name: string | null;
1208
+ imageUrl: string | null;
1209
+ }[];
1210
+ }>;
1211
+ get: (profile: string, requestOptions?: RelayRequestOptions) => Promise<{
1212
+ id: string;
1213
+ name: string;
1214
+ avatar: {
1215
+ source: "upload";
1216
+ url: string;
1217
+ seed: string;
1218
+ } | {
1219
+ source: "account";
1220
+ provider: "discord" | "x" | "google";
1221
+ url: string;
1222
+ seed: string;
1223
+ } | {
1224
+ source: "generated";
1225
+ seed: string;
1226
+ };
1227
+ }>;
1228
+ completions: (profile: string, query?: ProfileCompletionQuery, requestOptions?: RelayRequestOptions) => Promise<{
1229
+ items: {
1230
+ quest: string;
1231
+ title: string;
1232
+ completions: number;
1233
+ lastCompletedAt: number | null;
1234
+ key?: string | undefined;
1235
+ }[];
1236
+ nextCursor: string | null;
1237
+ }>;
1238
+ referral: (profile: string, program: string, requestOptions?: RelayRequestOptions) => Promise<{
1239
+ program: string;
1240
+ title: string;
1241
+ invited: number;
1242
+ qualified: number;
1243
+ milestones: {
1244
+ id: string;
1245
+ count: number;
1246
+ reached: boolean;
1247
+ }[];
1248
+ key?: string | undefined;
1249
+ }>;
1250
+ };
1251
+ quests: {
1252
+ get: (id: string, requestOptions?: RelayRequestOptions) => Promise<{
1253
+ quest: string;
1254
+ title: string;
1255
+ presentation: {
1256
+ quiz?: {
1257
+ id: string;
1258
+ prompt: string;
1259
+ choices: {
1260
+ id: string;
1261
+ label: string;
1262
+ }[];
1263
+ }[] | undefined;
1264
+ instructions?: string | undefined;
1265
+ video?: {
1266
+ url: string;
1267
+ poster?: string | undefined;
1268
+ captions?: {
1269
+ url: string;
1270
+ language: string;
1271
+ label: string;
1272
+ } | undefined;
1273
+ } | undefined;
1274
+ };
1275
+ connections: ("discord" | "x" | "google" | "apple")[];
1276
+ trigger: {
1277
+ kind: "manual";
1278
+ input: "text";
1279
+ constraints: {
1280
+ required: boolean;
1281
+ minLength: number;
1282
+ maxLength: number;
1283
+ };
1284
+ actor?: "staff" | "member" | undefined;
1285
+ } | {
1286
+ kind: "manual";
1287
+ input: "url";
1288
+ constraints: {
1289
+ required: boolean;
1290
+ allowedHosts?: string[] | undefined;
1291
+ };
1292
+ actor?: "staff" | "member" | undefined;
1293
+ } | {
1294
+ kind: "manual";
1295
+ input: "photo" | "quiz" | "none";
1296
+ actor?: "staff" | "member" | undefined;
1297
+ } | {
1298
+ kind: "automatic";
1299
+ tracker?: {
1300
+ tracker: string;
1301
+ source: string;
1302
+ on: "new-record" | "new-observation" | "data-changed";
1303
+ beneficiary: string;
1304
+ where?: {
1305
+ path: string;
1306
+ gt?: number | {
1307
+ setting: string;
1308
+ } | undefined;
1309
+ gte?: number | {
1310
+ setting: string;
1311
+ } | undefined;
1312
+ lt?: number | {
1313
+ setting: string;
1314
+ } | undefined;
1315
+ lte?: number | {
1316
+ setting: string;
1317
+ } | undefined;
1318
+ } | {
1319
+ path: string;
1320
+ equals: string | number | boolean;
1321
+ } | ({
1322
+ path: string;
1323
+ gt?: number | {
1324
+ setting: string;
1325
+ } | undefined;
1326
+ gte?: number | {
1327
+ setting: string;
1328
+ } | undefined;
1329
+ lt?: number | {
1330
+ setting: string;
1331
+ } | undefined;
1332
+ lte?: number | {
1333
+ setting: string;
1334
+ } | undefined;
1335
+ } | {
1336
+ path: string;
1337
+ equals: string | number | boolean;
1338
+ })[] | undefined;
1339
+ enrollment?: "required" | "none" | undefined;
1340
+ since?: "activation" | "window" | "enrollment" | undefined;
1341
+ historical?: "automatic" | "staff" | "claim" | undefined;
1342
+ content?: true | undefined;
1343
+ } | undefined;
1344
+ };
1345
+ availability: {
1346
+ kind: "available";
1347
+ input: "text" | "url" | "photo" | "quiz" | "none";
1348
+ } | {
1349
+ kind: "completed";
1350
+ } | {
1351
+ kind: "locked";
1352
+ missing: ({
1353
+ kind: "completion";
1354
+ quest: string;
1355
+ title: string;
1356
+ scope: "ever";
1357
+ } | {
1358
+ kind: "completion";
1359
+ quest: string;
1360
+ title: string;
1361
+ scope: "period";
1362
+ period: "day" | "week" | "month";
1363
+ resetsAt: number;
1364
+ } | {
1365
+ kind: "balance";
1366
+ balance: string;
1367
+ title: string;
1368
+ minimum: number;
1369
+ current: number;
1370
+ } | {
1371
+ kind: "group";
1372
+ group: string;
1373
+ title: string;
1374
+ })[];
1375
+ } | {
1376
+ kind: "blocked";
1377
+ reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
1378
+ resetsAt?: number | undefined;
1379
+ } | {
1380
+ kind: "staff-required";
1381
+ } | {
1382
+ kind: "automatic";
1383
+ } | {
1384
+ kind: "checking";
1385
+ attempt: string;
1386
+ } | {
1387
+ kind: "needs-review";
1388
+ attempt: string;
1389
+ } | {
1390
+ kind: "retryable";
1391
+ attempt: string;
1392
+ };
1393
+ completed: boolean;
1394
+ completion: {
1395
+ kind: "streak";
1396
+ days: number;
1397
+ } | {
1398
+ kind: "progress";
1399
+ goal: {
1400
+ kind: "count";
1401
+ count: number;
1402
+ };
1403
+ window: {
1404
+ kind: "lifetime";
1405
+ } | {
1406
+ kind: "calendar";
1407
+ period: "day" | "week" | "month";
1408
+ latenessMs: number;
1409
+ } | {
1410
+ kind: "rolling";
1411
+ durationMs: number;
1412
+ };
1413
+ repeat: "repeat" | "once";
1414
+ } | {
1415
+ kind: "once";
1416
+ } | {
1417
+ kind: "keyed";
1418
+ };
1419
+ progress: {
1420
+ current: number;
1421
+ target: number;
1422
+ reason: string;
1423
+ } | null;
1424
+ completionCount: number;
1425
+ visibility: "visible" | "hidden";
1426
+ missing: ({
1427
+ kind: "completion";
1428
+ quest: string;
1429
+ title: string;
1430
+ scope: "ever";
1431
+ } | {
1432
+ kind: "completion";
1433
+ quest: string;
1434
+ title: string;
1435
+ scope: "period";
1436
+ period: "day" | "week" | "month";
1437
+ resetsAt: number;
1438
+ } | {
1439
+ kind: "balance";
1440
+ balance: string;
1441
+ title: string;
1442
+ minimum: number;
1443
+ current: number;
1444
+ } | {
1445
+ kind: "group";
1446
+ group: string;
1447
+ title: string;
1448
+ })[];
1449
+ campaign: {
1450
+ key: string;
1451
+ title: string;
1452
+ enrollment: "required" | "none";
1453
+ enrolledAt: number | null;
1454
+ withdrawnAt: number | null;
1455
+ withdrawalReason: string | null;
1456
+ window?: {
1457
+ from: number;
1458
+ until: number;
1459
+ } | undefined;
1460
+ } | null;
1461
+ window: {
1462
+ from: number;
1463
+ until: number;
1464
+ } | null;
1465
+ budgets: {
1466
+ id: string;
1467
+ scope: "member" | "project";
1468
+ period: "lifetime" | "day" | "week" | "month";
1469
+ remaining: number;
1470
+ resetsAt: number | null;
1471
+ }[];
1472
+ attempt: {
1473
+ id: string;
1474
+ release: string;
1475
+ quest: string;
1476
+ member: string;
1477
+ evidence: string | null;
1478
+ status: AttemptStatus;
1479
+ reason: string | null;
1480
+ retries: number;
1481
+ generation: number;
1482
+ completion: string | null;
1483
+ reviewRewards: ({
1484
+ kind: "tier";
1485
+ reward: {
1486
+ id: string;
1487
+ title: string;
1488
+ tiers: {
1489
+ id: string;
1490
+ title: string;
1491
+ }[];
1492
+ inventory: {
1493
+ kind: "untracked";
1494
+ };
1495
+ fulfillment: {
1496
+ kind: "staff-handover";
1497
+ } | {
1498
+ kind: "automatic";
1499
+ };
1500
+ };
1501
+ tier: string;
1502
+ } | {
1503
+ kind: "points";
1504
+ balance: string;
1505
+ amount: number;
1506
+ } | {
1507
+ kind: "integration";
1508
+ provider: "discord";
1509
+ action: "grant-role";
1510
+ roleId: string;
1511
+ })[] | null;
1512
+ evaluationRun: number;
1513
+ deferCount: number;
1514
+ deferUntil: number | null;
1515
+ nextEvaluationAt: number | null;
1516
+ code: string | null;
1517
+ progress: {
1518
+ current: number;
1519
+ target: number;
1520
+ reason: string;
1521
+ } | null;
1522
+ requestedReview: boolean;
1523
+ createdAt: number;
1524
+ input?: {
1525
+ kind: "quiz";
1526
+ answers: {
1527
+ [k: string]: string;
1528
+ };
1529
+ release?: string | undefined;
1530
+ } | {
1531
+ kind: "text";
1532
+ value: string;
1533
+ } | {
1534
+ kind: "url";
1535
+ value: string;
1536
+ } | undefined;
1537
+ } | null;
1538
+ release: string;
1539
+ interaction: "automatic" | "text" | "url" | "staff" | "photo" | "quiz" | "claim";
1540
+ lifecycle: "paused" | "active" | "archived";
1541
+ rewards: ({
1542
+ kind: "points";
1543
+ label: string;
1544
+ amount: number;
1545
+ ledger: {
1546
+ id: string;
1547
+ key: string | null;
1548
+ name: string;
1549
+ };
1550
+ } | {
1551
+ kind: "tier";
1552
+ label: string;
1553
+ reward: {
1554
+ id: string;
1555
+ key: string | null;
1556
+ title: string;
1557
+ };
1558
+ tier: string;
1559
+ } | {
1560
+ kind: "integration";
1561
+ label: string;
1562
+ })[];
1563
+ key?: string | undefined;
1564
+ streak?: {
1565
+ goal: number;
1566
+ current: number;
1567
+ best: number;
1568
+ today: string;
1569
+ todayQualified: boolean;
1570
+ timeZone: string;
1571
+ nextBoundary: number;
1572
+ pendingTimeZone: {
1573
+ timeZone: string;
1574
+ effectiveAt: number;
1575
+ } | null;
1576
+ days: {
1577
+ day: number;
1578
+ date: string;
1579
+ timeZone: string;
1580
+ occurredAt: number;
1581
+ }[];
1582
+ milestone: {
1583
+ status: "pending";
1584
+ } | {
1585
+ status: "awarded";
1586
+ completion: string;
1587
+ achievedAt: number;
1588
+ } | {
1589
+ status: "budget-exhausted";
1590
+ budget: string;
1591
+ achievedAt: number;
1592
+ };
1593
+ } | null | undefined;
1594
+ counter?: {
1595
+ goal: number;
1596
+ current: number;
1597
+ window: {
1598
+ key: string;
1599
+ start: number | null;
1600
+ end: number | null;
1601
+ };
1602
+ repeat: "repeat" | "once";
1603
+ settled: number;
1604
+ latest: {
1605
+ id: string;
1606
+ ordinal: number;
1607
+ achievedAt: number;
1608
+ window: string;
1609
+ status: "revoked";
1610
+ completion: string;
1611
+ revokedAt: number;
1612
+ } | {
1613
+ id: string;
1614
+ ordinal: number;
1615
+ achievedAt: number;
1616
+ window: string;
1617
+ status: "awarded";
1618
+ completion: string;
1619
+ } | {
1620
+ id: string;
1621
+ ordinal: number;
1622
+ achievedAt: number;
1623
+ window: string;
1624
+ status: "budget-exhausted";
1625
+ budget: string;
1626
+ } | null;
1627
+ } | null | undefined;
1628
+ }>;
1629
+ enroll: (value: QuestEnrollmentInput, requestOptions?: RelayRequestOptions) => Promise<{
1630
+ quest: string;
1631
+ member: string;
1632
+ enrolledAt: number;
1633
+ }>;
1634
+ claim: (value: QuestClaimInput, requestOptions?: RelayRequestOptions) => Promise<{
1635
+ quest: string;
1636
+ tracker: string | null;
1637
+ record: string | null;
1638
+ observedAt: number | null;
1639
+ state: "admitted" | "skipped";
1640
+ code: TrackerSkipCode | null;
1641
+ reason: string | null;
1642
+ attempt: string | null;
1643
+ claimable: boolean;
1644
+ createdAt: number;
1645
+ updatedAt: number;
1646
+ automatic?: string | undefined;
1647
+ }>;
1648
+ outcomes: (query?: QuestOutcomeQuery, requestOptions?: RelayRequestOptions) => Promise<{
1649
+ items: {
1650
+ quest: string;
1651
+ tracker: string | null;
1652
+ record: string | null;
1653
+ observedAt: number | null;
1654
+ state: "admitted" | "skipped";
1655
+ code: TrackerSkipCode | null;
1656
+ reason: string | null;
1657
+ attempt: string | null;
1658
+ claimable: boolean;
1659
+ createdAt: number;
1660
+ updatedAt: number;
1661
+ automatic?: string | undefined;
1662
+ }[];
1663
+ nextCursor: string | null;
1664
+ }>;
1665
+ retry: (view: QuestView, requestOptions?: RelayRequestOptions) => Promise<{
1666
+ id: string;
1667
+ release: string;
1668
+ quest: string;
1669
+ member: string;
1670
+ evidence: string | null;
1671
+ status: AttemptStatus;
1672
+ reason: string | null;
1673
+ retries: number;
1674
+ generation: number;
1675
+ completion: string | null;
1676
+ reviewRewards: ({
1677
+ kind: "tier";
1678
+ reward: {
1679
+ id: string;
1680
+ title: string;
1681
+ tiers: {
1682
+ id: string;
1683
+ title: string;
1684
+ }[];
1685
+ inventory: {
1686
+ kind: "untracked";
1687
+ };
1688
+ fulfillment: {
1689
+ kind: "staff-handover";
1690
+ } | {
1691
+ kind: "automatic";
1692
+ };
1693
+ };
1694
+ tier: string;
1695
+ } | {
1696
+ kind: "points";
1697
+ balance: string;
1698
+ amount: number;
1699
+ } | {
1700
+ kind: "integration";
1701
+ provider: "discord";
1702
+ action: "grant-role";
1703
+ roleId: string;
1704
+ })[] | null;
1705
+ evaluationRun: number;
1706
+ deferCount: number;
1707
+ deferUntil: number | null;
1708
+ nextEvaluationAt: number | null;
1709
+ code: string | null;
1710
+ progress: {
1711
+ current: number;
1712
+ target: number;
1713
+ reason: string;
1714
+ } | null;
1715
+ requestedReview: boolean;
1716
+ createdAt: number;
1717
+ input?: {
1718
+ kind: "quiz";
1719
+ answers: {
1720
+ [k: string]: string;
1721
+ };
1722
+ release?: string | undefined;
1723
+ } | {
1724
+ kind: "text";
1725
+ value: string;
1726
+ } | {
1727
+ kind: "url";
1728
+ value: string;
1729
+ } | undefined;
1730
+ }>;
1731
+ experience: (requestOptions?: RelayRequestOptions) => Promise<{
1732
+ entitlements: ({
1733
+ [x: string]: unknown;
1734
+ status: "available";
1735
+ id: string;
1736
+ member: string;
1737
+ reward: {
1738
+ [x: string]: unknown;
1739
+ id: string;
1740
+ title: string;
1741
+ tiers: {
1742
+ [x: string]: unknown;
1743
+ id: string;
1744
+ title: string;
1745
+ }[];
1746
+ inventory: {
1747
+ [x: string]: unknown;
1748
+ kind: string;
1749
+ };
1750
+ fulfillment: {
1751
+ [x: string]: unknown;
1752
+ kind: string;
1753
+ };
1754
+ };
1755
+ earnedTier: string;
1756
+ tier: string;
1757
+ revision: number;
1758
+ } | {
1759
+ [x: string]: unknown;
1760
+ status: "handing-over";
1761
+ handover: string;
1762
+ startedAt: number;
1763
+ id: string;
1764
+ member: string;
1765
+ reward: {
1766
+ [x: string]: unknown;
1767
+ id: string;
1768
+ title: string;
1769
+ tiers: {
1770
+ [x: string]: unknown;
1771
+ id: string;
1772
+ title: string;
1773
+ }[];
1774
+ inventory: {
1775
+ [x: string]: unknown;
1776
+ kind: string;
1777
+ };
1778
+ fulfillment: {
1779
+ [x: string]: unknown;
1780
+ kind: string;
1781
+ };
1782
+ };
1783
+ earnedTier: string;
1784
+ tier: string;
1785
+ revision: number;
1786
+ allocation?: {
1787
+ [x: string]: unknown;
1788
+ item: string;
1789
+ label: string;
1790
+ } | undefined;
1791
+ } | {
1792
+ [x: string]: unknown;
1793
+ status: "collected";
1794
+ handover: string;
1795
+ startedAt: number;
1796
+ collectedAt: number;
1797
+ id: string;
1798
+ member: string;
1799
+ reward: {
1800
+ [x: string]: unknown;
1801
+ id: string;
1802
+ title: string;
1803
+ tiers: {
1804
+ [x: string]: unknown;
1805
+ id: string;
1806
+ title: string;
1807
+ }[];
1808
+ inventory: {
1809
+ [x: string]: unknown;
1810
+ kind: string;
1811
+ };
1812
+ fulfillment: {
1813
+ [x: string]: unknown;
1814
+ kind: string;
1815
+ };
1816
+ };
1817
+ earnedTier: string;
1818
+ tier: string;
1819
+ revision: number;
1820
+ allocation?: {
1821
+ [x: string]: unknown;
1822
+ item: string;
1823
+ label: string;
1824
+ } | undefined;
1825
+ recovery?: {
1826
+ completion: string;
1827
+ reason: string;
1828
+ flaggedAt: number;
1829
+ remainingTier: string | null;
1830
+ } | undefined;
1831
+ } | {
1832
+ [x: string]: unknown;
1833
+ status: "void";
1834
+ voidedAt: number;
1835
+ id: string;
1836
+ member: string;
1837
+ reward: {
1838
+ [x: string]: unknown;
1839
+ id: string;
1840
+ title: string;
1841
+ tiers: {
1842
+ [x: string]: unknown;
1843
+ id: string;
1844
+ title: string;
1845
+ }[];
1846
+ inventory: {
1847
+ [x: string]: unknown;
1848
+ kind: string;
1849
+ };
1850
+ fulfillment: {
1851
+ [x: string]: unknown;
1852
+ kind: string;
1853
+ };
1854
+ };
1855
+ earnedTier: string;
1856
+ tier: string;
1857
+ revision: number;
1858
+ } | {
1859
+ status: "unsupported";
1860
+ reportedStatus: string;
1861
+ id: string;
1862
+ member: string;
1863
+ reward: {
1864
+ [x: string]: unknown;
1865
+ id: string;
1866
+ title: string;
1867
+ tiers: {
1868
+ [x: string]: unknown;
1869
+ id: string;
1870
+ title: string;
1871
+ }[];
1872
+ inventory: {
1873
+ [x: string]: unknown;
1874
+ kind: string;
1875
+ };
1876
+ fulfillment: {
1877
+ [x: string]: unknown;
1878
+ kind: string;
1879
+ };
1880
+ };
1881
+ earnedTier: string;
1882
+ tier: string;
1883
+ revision: number;
1884
+ })[];
1885
+ member: string;
1886
+ quests: {
1887
+ quest: string;
1888
+ title: string;
1889
+ presentation: {
1890
+ quiz?: {
1891
+ id: string;
1892
+ prompt: string;
1893
+ choices: {
1894
+ id: string;
1895
+ label: string;
1896
+ }[];
1897
+ }[] | undefined;
1898
+ instructions?: string | undefined;
1899
+ video?: {
1900
+ url: string;
1901
+ poster?: string | undefined;
1902
+ captions?: {
1903
+ url: string;
1904
+ language: string;
1905
+ label: string;
1906
+ } | undefined;
1907
+ } | undefined;
1908
+ };
1909
+ connections: ("discord" | "x" | "google" | "apple")[];
1910
+ trigger: {
1911
+ kind: "manual";
1912
+ input: "text";
1913
+ constraints: {
1914
+ required: boolean;
1915
+ minLength: number;
1916
+ maxLength: number;
1917
+ };
1918
+ actor?: "staff" | "member" | undefined;
1919
+ } | {
1920
+ kind: "manual";
1921
+ input: "url";
1922
+ constraints: {
1923
+ required: boolean;
1924
+ allowedHosts?: string[] | undefined;
1925
+ };
1926
+ actor?: "staff" | "member" | undefined;
1927
+ } | {
1928
+ kind: "manual";
1929
+ input: "photo" | "quiz" | "none";
1930
+ actor?: "staff" | "member" | undefined;
1931
+ } | {
1932
+ kind: "automatic";
1933
+ tracker?: {
1934
+ tracker: string;
1935
+ source: string;
1936
+ on: "new-record" | "new-observation" | "data-changed";
1937
+ beneficiary: string;
1938
+ where?: {
1939
+ path: string;
1940
+ gt?: number | {
1941
+ setting: string;
1942
+ } | undefined;
1943
+ gte?: number | {
1944
+ setting: string;
1945
+ } | undefined;
1946
+ lt?: number | {
1947
+ setting: string;
1948
+ } | undefined;
1949
+ lte?: number | {
1950
+ setting: string;
1951
+ } | undefined;
1952
+ } | {
1953
+ path: string;
1954
+ equals: string | number | boolean;
1955
+ } | ({
1956
+ path: string;
1957
+ gt?: number | {
1958
+ setting: string;
1959
+ } | undefined;
1960
+ gte?: number | {
1961
+ setting: string;
1962
+ } | undefined;
1963
+ lt?: number | {
1964
+ setting: string;
1965
+ } | undefined;
1966
+ lte?: number | {
1967
+ setting: string;
1968
+ } | undefined;
1969
+ } | {
1970
+ path: string;
1971
+ equals: string | number | boolean;
1972
+ })[] | undefined;
1973
+ enrollment?: "required" | "none" | undefined;
1974
+ since?: "activation" | "window" | "enrollment" | undefined;
1975
+ historical?: "automatic" | "staff" | "claim" | undefined;
1976
+ content?: true | undefined;
1977
+ } | undefined;
1978
+ };
1979
+ availability: {
1980
+ kind: "available";
1981
+ input: "text" | "url" | "photo" | "quiz" | "none";
1982
+ } | {
1983
+ kind: "completed";
1984
+ } | {
1985
+ kind: "locked";
1986
+ missing: ({
1987
+ kind: "completion";
1988
+ quest: string;
1989
+ title: string;
1990
+ scope: "ever";
1991
+ } | {
1992
+ kind: "completion";
1993
+ quest: string;
1994
+ title: string;
1995
+ scope: "period";
1996
+ period: "day" | "week" | "month";
1997
+ resetsAt: number;
1998
+ } | {
1999
+ kind: "balance";
2000
+ balance: string;
2001
+ title: string;
2002
+ minimum: number;
2003
+ current: number;
2004
+ } | {
2005
+ kind: "group";
2006
+ group: string;
2007
+ title: string;
2008
+ })[];
2009
+ } | {
2010
+ kind: "blocked";
2011
+ reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
2012
+ resetsAt?: number | undefined;
2013
+ } | {
2014
+ kind: "staff-required";
2015
+ } | {
2016
+ kind: "automatic";
2017
+ } | {
2018
+ kind: "checking";
2019
+ attempt: string;
2020
+ } | {
2021
+ kind: "needs-review";
2022
+ attempt: string;
2023
+ } | {
2024
+ kind: "retryable";
2025
+ attempt: string;
2026
+ };
2027
+ completed: boolean;
2028
+ completion: {
2029
+ kind: "streak";
2030
+ days: number;
2031
+ } | {
2032
+ kind: "progress";
2033
+ goal: {
2034
+ kind: "count";
2035
+ count: number;
2036
+ };
2037
+ window: {
2038
+ kind: "lifetime";
2039
+ } | {
2040
+ kind: "calendar";
2041
+ period: "day" | "week" | "month";
2042
+ latenessMs: number;
2043
+ } | {
2044
+ kind: "rolling";
2045
+ durationMs: number;
2046
+ };
2047
+ repeat: "repeat" | "once";
2048
+ } | {
2049
+ kind: "once";
2050
+ } | {
2051
+ kind: "keyed";
2052
+ };
2053
+ progress: {
2054
+ current: number;
2055
+ target: number;
2056
+ reason: string;
2057
+ } | null;
2058
+ completionCount: number;
2059
+ visibility: "visible" | "hidden";
2060
+ missing: ({
2061
+ kind: "completion";
2062
+ quest: string;
2063
+ title: string;
2064
+ scope: "ever";
2065
+ } | {
2066
+ kind: "completion";
2067
+ quest: string;
2068
+ title: string;
2069
+ scope: "period";
2070
+ period: "day" | "week" | "month";
2071
+ resetsAt: number;
2072
+ } | {
2073
+ kind: "balance";
2074
+ balance: string;
2075
+ title: string;
2076
+ minimum: number;
2077
+ current: number;
2078
+ } | {
2079
+ kind: "group";
2080
+ group: string;
2081
+ title: string;
2082
+ })[];
2083
+ campaign: {
2084
+ key: string;
2085
+ title: string;
2086
+ enrollment: "required" | "none";
2087
+ enrolledAt: number | null;
2088
+ withdrawnAt: number | null;
2089
+ withdrawalReason: string | null;
2090
+ window?: {
2091
+ from: number;
2092
+ until: number;
2093
+ } | undefined;
2094
+ } | null;
2095
+ window: {
2096
+ from: number;
2097
+ until: number;
2098
+ } | null;
2099
+ budgets: {
2100
+ id: string;
2101
+ scope: "member" | "project";
2102
+ period: "lifetime" | "day" | "week" | "month";
2103
+ remaining: number;
2104
+ resetsAt: number | null;
2105
+ }[];
2106
+ attempt: {
2107
+ id: string;
2108
+ release: string;
2109
+ quest: string;
2110
+ member: string;
2111
+ evidence: string | null;
2112
+ status: AttemptStatus;
2113
+ reason: string | null;
2114
+ retries: number;
2115
+ generation: number;
2116
+ completion: string | null;
2117
+ reviewRewards: ({
2118
+ kind: "tier";
2119
+ reward: {
2120
+ id: string;
2121
+ title: string;
2122
+ tiers: {
2123
+ id: string;
2124
+ title: string;
2125
+ }[];
2126
+ inventory: {
2127
+ kind: "untracked";
2128
+ };
2129
+ fulfillment: {
2130
+ kind: "staff-handover";
2131
+ } | {
2132
+ kind: "automatic";
2133
+ };
2134
+ };
2135
+ tier: string;
2136
+ } | {
2137
+ kind: "points";
2138
+ balance: string;
2139
+ amount: number;
2140
+ } | {
2141
+ kind: "integration";
2142
+ provider: "discord";
2143
+ action: "grant-role";
2144
+ roleId: string;
2145
+ })[] | null;
2146
+ evaluationRun: number;
2147
+ deferCount: number;
2148
+ deferUntil: number | null;
2149
+ nextEvaluationAt: number | null;
2150
+ code: string | null;
2151
+ progress: {
2152
+ current: number;
2153
+ target: number;
2154
+ reason: string;
2155
+ } | null;
2156
+ requestedReview: boolean;
2157
+ createdAt: number;
2158
+ input?: {
2159
+ kind: "quiz";
2160
+ answers: {
2161
+ [k: string]: string;
2162
+ };
2163
+ release?: string | undefined;
2164
+ } | {
2165
+ kind: "text";
2166
+ value: string;
2167
+ } | {
2168
+ kind: "url";
2169
+ value: string;
2170
+ } | undefined;
2171
+ } | null;
2172
+ release: string;
2173
+ interaction: "automatic" | "text" | "url" | "staff" | "photo" | "quiz" | "claim";
2174
+ lifecycle: "paused" | "active" | "archived";
2175
+ rewards: ({
2176
+ kind: "points";
2177
+ label: string;
2178
+ amount: number;
2179
+ ledger: {
2180
+ id: string;
2181
+ key: string | null;
2182
+ name: string;
2183
+ };
2184
+ } | {
2185
+ kind: "tier";
2186
+ label: string;
2187
+ reward: {
2188
+ id: string;
2189
+ key: string | null;
2190
+ title: string;
2191
+ };
2192
+ tier: string;
2193
+ } | {
2194
+ kind: "integration";
2195
+ label: string;
2196
+ })[];
2197
+ key?: string | undefined;
2198
+ streak?: {
2199
+ goal: number;
2200
+ current: number;
2201
+ best: number;
2202
+ today: string;
2203
+ todayQualified: boolean;
2204
+ timeZone: string;
2205
+ nextBoundary: number;
2206
+ pendingTimeZone: {
2207
+ timeZone: string;
2208
+ effectiveAt: number;
2209
+ } | null;
2210
+ days: {
2211
+ day: number;
2212
+ date: string;
2213
+ timeZone: string;
2214
+ occurredAt: number;
2215
+ }[];
2216
+ milestone: {
2217
+ status: "pending";
2218
+ } | {
2219
+ status: "awarded";
2220
+ completion: string;
2221
+ achievedAt: number;
2222
+ } | {
2223
+ status: "budget-exhausted";
2224
+ budget: string;
2225
+ achievedAt: number;
2226
+ };
2227
+ } | null | undefined;
2228
+ counter?: {
2229
+ goal: number;
2230
+ current: number;
2231
+ window: {
2232
+ key: string;
2233
+ start: number | null;
2234
+ end: number | null;
2235
+ };
2236
+ repeat: "repeat" | "once";
2237
+ settled: number;
2238
+ latest: {
2239
+ id: string;
2240
+ ordinal: number;
2241
+ achievedAt: number;
2242
+ window: string;
2243
+ status: "revoked";
2244
+ completion: string;
2245
+ revokedAt: number;
2246
+ } | {
2247
+ id: string;
2248
+ ordinal: number;
2249
+ achievedAt: number;
2250
+ window: string;
2251
+ status: "awarded";
2252
+ completion: string;
2253
+ } | {
2254
+ id: string;
2255
+ ordinal: number;
2256
+ achievedAt: number;
2257
+ window: string;
2258
+ status: "budget-exhausted";
2259
+ budget: string;
2260
+ } | null;
2261
+ } | null | undefined;
2262
+ }[];
2263
+ collections: {
2264
+ id: string;
2265
+ title: string;
2266
+ quests: {
2267
+ quest: string;
2268
+ title: string;
2269
+ presentation: {
2270
+ quiz?: {
2271
+ id: string;
2272
+ prompt: string;
2273
+ choices: {
2274
+ id: string;
2275
+ label: string;
2276
+ }[];
2277
+ }[] | undefined;
2278
+ instructions?: string | undefined;
2279
+ video?: {
2280
+ url: string;
2281
+ poster?: string | undefined;
2282
+ captions?: {
2283
+ url: string;
2284
+ language: string;
2285
+ label: string;
2286
+ } | undefined;
2287
+ } | undefined;
2288
+ };
2289
+ connections: ("discord" | "x" | "google" | "apple")[];
2290
+ trigger: {
2291
+ kind: "manual";
2292
+ input: "text";
2293
+ constraints: {
2294
+ required: boolean;
2295
+ minLength: number;
2296
+ maxLength: number;
2297
+ };
2298
+ actor?: "staff" | "member" | undefined;
2299
+ } | {
2300
+ kind: "manual";
2301
+ input: "url";
2302
+ constraints: {
2303
+ required: boolean;
2304
+ allowedHosts?: string[] | undefined;
2305
+ };
2306
+ actor?: "staff" | "member" | undefined;
2307
+ } | {
2308
+ kind: "manual";
2309
+ input: "photo" | "quiz" | "none";
2310
+ actor?: "staff" | "member" | undefined;
2311
+ } | {
2312
+ kind: "automatic";
2313
+ tracker?: {
2314
+ tracker: string;
2315
+ source: string;
2316
+ on: "new-record" | "new-observation" | "data-changed";
2317
+ beneficiary: string;
2318
+ where?: {
2319
+ path: string;
2320
+ gt?: number | {
2321
+ setting: string;
2322
+ } | undefined;
2323
+ gte?: number | {
2324
+ setting: string;
2325
+ } | undefined;
2326
+ lt?: number | {
2327
+ setting: string;
2328
+ } | undefined;
2329
+ lte?: number | {
2330
+ setting: string;
2331
+ } | undefined;
2332
+ } | {
2333
+ path: string;
2334
+ equals: string | number | boolean;
2335
+ } | ({
2336
+ path: string;
2337
+ gt?: number | {
2338
+ setting: string;
2339
+ } | undefined;
2340
+ gte?: number | {
2341
+ setting: string;
2342
+ } | undefined;
2343
+ lt?: number | {
2344
+ setting: string;
2345
+ } | undefined;
2346
+ lte?: number | {
2347
+ setting: string;
2348
+ } | undefined;
2349
+ } | {
2350
+ path: string;
2351
+ equals: string | number | boolean;
2352
+ })[] | undefined;
2353
+ enrollment?: "required" | "none" | undefined;
2354
+ since?: "activation" | "window" | "enrollment" | undefined;
2355
+ historical?: "automatic" | "staff" | "claim" | undefined;
2356
+ content?: true | undefined;
2357
+ } | undefined;
2358
+ };
2359
+ availability: {
2360
+ kind: "available";
2361
+ input: "text" | "url" | "photo" | "quiz" | "none";
2362
+ } | {
2363
+ kind: "completed";
2364
+ } | {
2365
+ kind: "locked";
2366
+ missing: ({
2367
+ kind: "completion";
2368
+ quest: string;
2369
+ title: string;
2370
+ scope: "ever";
2371
+ } | {
2372
+ kind: "completion";
2373
+ quest: string;
2374
+ title: string;
2375
+ scope: "period";
2376
+ period: "day" | "week" | "month";
2377
+ resetsAt: number;
2378
+ } | {
2379
+ kind: "balance";
2380
+ balance: string;
2381
+ title: string;
2382
+ minimum: number;
2383
+ current: number;
2384
+ } | {
2385
+ kind: "group";
2386
+ group: string;
2387
+ title: string;
2388
+ })[];
2389
+ } | {
2390
+ kind: "blocked";
2391
+ reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
2392
+ resetsAt?: number | undefined;
2393
+ } | {
2394
+ kind: "staff-required";
2395
+ } | {
2396
+ kind: "automatic";
2397
+ } | {
2398
+ kind: "checking";
2399
+ attempt: string;
2400
+ } | {
2401
+ kind: "needs-review";
2402
+ attempt: string;
2403
+ } | {
2404
+ kind: "retryable";
2405
+ attempt: string;
2406
+ };
2407
+ completed: boolean;
2408
+ completion: {
2409
+ kind: "streak";
2410
+ days: number;
2411
+ } | {
2412
+ kind: "progress";
2413
+ goal: {
2414
+ kind: "count";
2415
+ count: number;
2416
+ };
2417
+ window: {
2418
+ kind: "lifetime";
2419
+ } | {
2420
+ kind: "calendar";
2421
+ period: "day" | "week" | "month";
2422
+ latenessMs: number;
2423
+ } | {
2424
+ kind: "rolling";
2425
+ durationMs: number;
2426
+ };
2427
+ repeat: "repeat" | "once";
2428
+ } | {
2429
+ kind: "once";
2430
+ } | {
2431
+ kind: "keyed";
2432
+ };
2433
+ progress: {
2434
+ current: number;
2435
+ target: number;
2436
+ reason: string;
2437
+ } | null;
2438
+ completionCount: number;
2439
+ visibility: "visible" | "hidden";
2440
+ missing: ({
2441
+ kind: "completion";
2442
+ quest: string;
2443
+ title: string;
2444
+ scope: "ever";
2445
+ } | {
2446
+ kind: "completion";
2447
+ quest: string;
2448
+ title: string;
2449
+ scope: "period";
2450
+ period: "day" | "week" | "month";
2451
+ resetsAt: number;
2452
+ } | {
2453
+ kind: "balance";
2454
+ balance: string;
2455
+ title: string;
2456
+ minimum: number;
2457
+ current: number;
2458
+ } | {
2459
+ kind: "group";
2460
+ group: string;
2461
+ title: string;
2462
+ })[];
2463
+ campaign: {
2464
+ key: string;
2465
+ title: string;
2466
+ enrollment: "required" | "none";
2467
+ enrolledAt: number | null;
2468
+ withdrawnAt: number | null;
2469
+ withdrawalReason: string | null;
2470
+ window?: {
2471
+ from: number;
2472
+ until: number;
2473
+ } | undefined;
2474
+ } | null;
2475
+ window: {
2476
+ from: number;
2477
+ until: number;
2478
+ } | null;
2479
+ budgets: {
2480
+ id: string;
2481
+ scope: "member" | "project";
2482
+ period: "lifetime" | "day" | "week" | "month";
2483
+ remaining: number;
2484
+ resetsAt: number | null;
2485
+ }[];
2486
+ attempt: {
2487
+ id: string;
2488
+ release: string;
2489
+ quest: string;
2490
+ member: string;
2491
+ evidence: string | null;
2492
+ status: AttemptStatus;
2493
+ reason: string | null;
2494
+ retries: number;
2495
+ generation: number;
2496
+ completion: string | null;
2497
+ reviewRewards: ({
2498
+ kind: "tier";
2499
+ reward: {
2500
+ id: string;
2501
+ title: string;
2502
+ tiers: {
2503
+ id: string;
2504
+ title: string;
2505
+ }[];
2506
+ inventory: {
2507
+ kind: "untracked";
2508
+ };
2509
+ fulfillment: {
2510
+ kind: "staff-handover";
2511
+ } | {
2512
+ kind: "automatic";
2513
+ };
2514
+ };
2515
+ tier: string;
2516
+ } | {
2517
+ kind: "points";
2518
+ balance: string;
2519
+ amount: number;
2520
+ } | {
2521
+ kind: "integration";
2522
+ provider: "discord";
2523
+ action: "grant-role";
2524
+ roleId: string;
2525
+ })[] | null;
2526
+ evaluationRun: number;
2527
+ deferCount: number;
2528
+ deferUntil: number | null;
2529
+ nextEvaluationAt: number | null;
2530
+ code: string | null;
2531
+ progress: {
2532
+ current: number;
2533
+ target: number;
2534
+ reason: string;
2535
+ } | null;
2536
+ requestedReview: boolean;
2537
+ createdAt: number;
2538
+ input?: {
2539
+ kind: "quiz";
2540
+ answers: {
2541
+ [k: string]: string;
2542
+ };
2543
+ release?: string | undefined;
2544
+ } | {
2545
+ kind: "text";
2546
+ value: string;
2547
+ } | {
2548
+ kind: "url";
2549
+ value: string;
2550
+ } | undefined;
2551
+ } | null;
2552
+ release: string;
2553
+ interaction: "automatic" | "text" | "url" | "staff" | "photo" | "quiz" | "claim";
2554
+ lifecycle: "paused" | "active" | "archived";
2555
+ rewards: ({
2556
+ kind: "points";
2557
+ label: string;
2558
+ amount: number;
2559
+ ledger: {
2560
+ id: string;
2561
+ key: string | null;
2562
+ name: string;
2563
+ };
2564
+ } | {
2565
+ kind: "tier";
2566
+ label: string;
2567
+ reward: {
2568
+ id: string;
2569
+ key: string | null;
2570
+ title: string;
2571
+ };
2572
+ tier: string;
2573
+ } | {
2574
+ kind: "integration";
2575
+ label: string;
2576
+ })[];
2577
+ key?: string | undefined;
2578
+ streak?: {
2579
+ goal: number;
2580
+ current: number;
2581
+ best: number;
2582
+ today: string;
2583
+ todayQualified: boolean;
2584
+ timeZone: string;
2585
+ nextBoundary: number;
2586
+ pendingTimeZone: {
2587
+ timeZone: string;
2588
+ effectiveAt: number;
2589
+ } | null;
2590
+ days: {
2591
+ day: number;
2592
+ date: string;
2593
+ timeZone: string;
2594
+ occurredAt: number;
2595
+ }[];
2596
+ milestone: {
2597
+ status: "pending";
2598
+ } | {
2599
+ status: "awarded";
2600
+ completion: string;
2601
+ achievedAt: number;
2602
+ } | {
2603
+ status: "budget-exhausted";
2604
+ budget: string;
2605
+ achievedAt: number;
2606
+ };
2607
+ } | null | undefined;
2608
+ counter?: {
2609
+ goal: number;
2610
+ current: number;
2611
+ window: {
2612
+ key: string;
2613
+ start: number | null;
2614
+ end: number | null;
2615
+ };
2616
+ repeat: "repeat" | "once";
2617
+ settled: number;
2618
+ latest: {
2619
+ id: string;
2620
+ ordinal: number;
2621
+ achievedAt: number;
2622
+ window: string;
2623
+ status: "revoked";
2624
+ completion: string;
2625
+ revokedAt: number;
2626
+ } | {
2627
+ id: string;
2628
+ ordinal: number;
2629
+ achievedAt: number;
2630
+ window: string;
2631
+ status: "awarded";
2632
+ completion: string;
2633
+ } | {
2634
+ id: string;
2635
+ ordinal: number;
2636
+ achievedAt: number;
2637
+ window: string;
2638
+ status: "budget-exhausted";
2639
+ budget: string;
2640
+ } | null;
2641
+ } | null | undefined;
2642
+ }[];
2643
+ key?: string | undefined;
2644
+ }[];
2645
+ }>;
2646
+ collection: (id: string, requestOptions?: RelayRequestOptions) => Promise<{
2647
+ id: string;
2648
+ title: string;
2649
+ quests: {
2650
+ quest: string;
2651
+ title: string;
2652
+ presentation: {
2653
+ quiz?: {
2654
+ id: string;
2655
+ prompt: string;
2656
+ choices: {
2657
+ id: string;
2658
+ label: string;
2659
+ }[];
2660
+ }[] | undefined;
2661
+ instructions?: string | undefined;
2662
+ video?: {
2663
+ url: string;
2664
+ poster?: string | undefined;
2665
+ captions?: {
2666
+ url: string;
2667
+ language: string;
2668
+ label: string;
2669
+ } | undefined;
2670
+ } | undefined;
2671
+ };
2672
+ connections: ("discord" | "x" | "google" | "apple")[];
2673
+ trigger: {
2674
+ kind: "manual";
2675
+ input: "text";
2676
+ constraints: {
2677
+ required: boolean;
2678
+ minLength: number;
2679
+ maxLength: number;
2680
+ };
2681
+ actor?: "staff" | "member" | undefined;
2682
+ } | {
2683
+ kind: "manual";
2684
+ input: "url";
2685
+ constraints: {
2686
+ required: boolean;
2687
+ allowedHosts?: string[] | undefined;
2688
+ };
2689
+ actor?: "staff" | "member" | undefined;
2690
+ } | {
2691
+ kind: "manual";
2692
+ input: "photo" | "quiz" | "none";
2693
+ actor?: "staff" | "member" | undefined;
2694
+ } | {
2695
+ kind: "automatic";
2696
+ tracker?: {
2697
+ tracker: string;
2698
+ source: string;
2699
+ on: "new-record" | "new-observation" | "data-changed";
2700
+ beneficiary: string;
2701
+ where?: {
2702
+ path: string;
2703
+ gt?: number | {
2704
+ setting: string;
2705
+ } | undefined;
2706
+ gte?: number | {
2707
+ setting: string;
2708
+ } | undefined;
2709
+ lt?: number | {
2710
+ setting: string;
2711
+ } | undefined;
2712
+ lte?: number | {
2713
+ setting: string;
2714
+ } | undefined;
2715
+ } | {
2716
+ path: string;
2717
+ equals: string | number | boolean;
2718
+ } | ({
2719
+ path: string;
2720
+ gt?: number | {
2721
+ setting: string;
2722
+ } | undefined;
2723
+ gte?: number | {
2724
+ setting: string;
2725
+ } | undefined;
2726
+ lt?: number | {
2727
+ setting: string;
2728
+ } | undefined;
2729
+ lte?: number | {
2730
+ setting: string;
2731
+ } | undefined;
2732
+ } | {
2733
+ path: string;
2734
+ equals: string | number | boolean;
2735
+ })[] | undefined;
2736
+ enrollment?: "required" | "none" | undefined;
2737
+ since?: "activation" | "window" | "enrollment" | undefined;
2738
+ historical?: "automatic" | "staff" | "claim" | undefined;
2739
+ content?: true | undefined;
2740
+ } | undefined;
2741
+ };
2742
+ availability: {
2743
+ kind: "available";
2744
+ input: "text" | "url" | "photo" | "quiz" | "none";
2745
+ } | {
2746
+ kind: "completed";
2747
+ } | {
2748
+ kind: "locked";
2749
+ missing: ({
2750
+ kind: "completion";
2751
+ quest: string;
2752
+ title: string;
2753
+ scope: "ever";
2754
+ } | {
2755
+ kind: "completion";
2756
+ quest: string;
2757
+ title: string;
2758
+ scope: "period";
2759
+ period: "day" | "week" | "month";
2760
+ resetsAt: number;
2761
+ } | {
2762
+ kind: "balance";
2763
+ balance: string;
2764
+ title: string;
2765
+ minimum: number;
2766
+ current: number;
2767
+ } | {
2768
+ kind: "group";
2769
+ group: string;
2770
+ title: string;
2771
+ })[];
2772
+ } | {
2773
+ kind: "blocked";
2774
+ reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
2775
+ resetsAt?: number | undefined;
2776
+ } | {
2777
+ kind: "staff-required";
2778
+ } | {
2779
+ kind: "automatic";
2780
+ } | {
2781
+ kind: "checking";
2782
+ attempt: string;
2783
+ } | {
2784
+ kind: "needs-review";
2785
+ attempt: string;
2786
+ } | {
2787
+ kind: "retryable";
2788
+ attempt: string;
2789
+ };
2790
+ completed: boolean;
2791
+ completion: {
2792
+ kind: "streak";
2793
+ days: number;
2794
+ } | {
2795
+ kind: "progress";
2796
+ goal: {
2797
+ kind: "count";
2798
+ count: number;
2799
+ };
2800
+ window: {
2801
+ kind: "lifetime";
2802
+ } | {
2803
+ kind: "calendar";
2804
+ period: "day" | "week" | "month";
2805
+ latenessMs: number;
2806
+ } | {
2807
+ kind: "rolling";
2808
+ durationMs: number;
2809
+ };
2810
+ repeat: "repeat" | "once";
2811
+ } | {
2812
+ kind: "once";
2813
+ } | {
2814
+ kind: "keyed";
2815
+ };
2816
+ progress: {
2817
+ current: number;
2818
+ target: number;
2819
+ reason: string;
2820
+ } | null;
2821
+ completionCount: number;
2822
+ visibility: "visible" | "hidden";
2823
+ missing: ({
2824
+ kind: "completion";
2825
+ quest: string;
2826
+ title: string;
2827
+ scope: "ever";
2828
+ } | {
2829
+ kind: "completion";
2830
+ quest: string;
2831
+ title: string;
2832
+ scope: "period";
2833
+ period: "day" | "week" | "month";
2834
+ resetsAt: number;
2835
+ } | {
2836
+ kind: "balance";
2837
+ balance: string;
2838
+ title: string;
2839
+ minimum: number;
2840
+ current: number;
2841
+ } | {
2842
+ kind: "group";
2843
+ group: string;
2844
+ title: string;
2845
+ })[];
2846
+ campaign: {
2847
+ key: string;
2848
+ title: string;
2849
+ enrollment: "required" | "none";
2850
+ enrolledAt: number | null;
2851
+ withdrawnAt: number | null;
2852
+ withdrawalReason: string | null;
2853
+ window?: {
2854
+ from: number;
2855
+ until: number;
2856
+ } | undefined;
2857
+ } | null;
2858
+ window: {
2859
+ from: number;
2860
+ until: number;
2861
+ } | null;
2862
+ budgets: {
2863
+ id: string;
2864
+ scope: "member" | "project";
2865
+ period: "lifetime" | "day" | "week" | "month";
2866
+ remaining: number;
2867
+ resetsAt: number | null;
2868
+ }[];
2869
+ attempt: {
2870
+ id: string;
2871
+ release: string;
2872
+ quest: string;
2873
+ member: string;
2874
+ evidence: string | null;
2875
+ status: AttemptStatus;
2876
+ reason: string | null;
2877
+ retries: number;
2878
+ generation: number;
2879
+ completion: string | null;
2880
+ reviewRewards: ({
2881
+ kind: "tier";
2882
+ reward: {
2883
+ id: string;
2884
+ title: string;
2885
+ tiers: {
2886
+ id: string;
2887
+ title: string;
2888
+ }[];
2889
+ inventory: {
2890
+ kind: "untracked";
2891
+ };
2892
+ fulfillment: {
2893
+ kind: "staff-handover";
2894
+ } | {
2895
+ kind: "automatic";
2896
+ };
2897
+ };
2898
+ tier: string;
2899
+ } | {
2900
+ kind: "points";
2901
+ balance: string;
2902
+ amount: number;
2903
+ } | {
2904
+ kind: "integration";
2905
+ provider: "discord";
2906
+ action: "grant-role";
2907
+ roleId: string;
2908
+ })[] | null;
2909
+ evaluationRun: number;
2910
+ deferCount: number;
2911
+ deferUntil: number | null;
2912
+ nextEvaluationAt: number | null;
2913
+ code: string | null;
2914
+ progress: {
2915
+ current: number;
2916
+ target: number;
2917
+ reason: string;
2918
+ } | null;
2919
+ requestedReview: boolean;
2920
+ createdAt: number;
2921
+ input?: {
2922
+ kind: "quiz";
2923
+ answers: {
2924
+ [k: string]: string;
2925
+ };
2926
+ release?: string | undefined;
2927
+ } | {
2928
+ kind: "text";
2929
+ value: string;
2930
+ } | {
2931
+ kind: "url";
2932
+ value: string;
2933
+ } | undefined;
2934
+ } | null;
2935
+ release: string;
2936
+ interaction: "automatic" | "text" | "url" | "staff" | "photo" | "quiz" | "claim";
2937
+ lifecycle: "paused" | "active" | "archived";
2938
+ rewards: ({
2939
+ kind: "points";
2940
+ label: string;
2941
+ amount: number;
2942
+ ledger: {
2943
+ id: string;
2944
+ key: string | null;
2945
+ name: string;
2946
+ };
2947
+ } | {
2948
+ kind: "tier";
2949
+ label: string;
2950
+ reward: {
2951
+ id: string;
2952
+ key: string | null;
2953
+ title: string;
2954
+ };
2955
+ tier: string;
2956
+ } | {
2957
+ kind: "integration";
2958
+ label: string;
2959
+ })[];
2960
+ key?: string | undefined;
2961
+ streak?: {
2962
+ goal: number;
2963
+ current: number;
2964
+ best: number;
2965
+ today: string;
2966
+ todayQualified: boolean;
2967
+ timeZone: string;
2968
+ nextBoundary: number;
2969
+ pendingTimeZone: {
2970
+ timeZone: string;
2971
+ effectiveAt: number;
2972
+ } | null;
2973
+ days: {
2974
+ day: number;
2975
+ date: string;
2976
+ timeZone: string;
2977
+ occurredAt: number;
2978
+ }[];
2979
+ milestone: {
2980
+ status: "pending";
2981
+ } | {
2982
+ status: "awarded";
2983
+ completion: string;
2984
+ achievedAt: number;
2985
+ } | {
2986
+ status: "budget-exhausted";
2987
+ budget: string;
2988
+ achievedAt: number;
2989
+ };
2990
+ } | null | undefined;
2991
+ counter?: {
2992
+ goal: number;
2993
+ current: number;
2994
+ window: {
2995
+ key: string;
2996
+ start: number | null;
2997
+ end: number | null;
2998
+ };
2999
+ repeat: "repeat" | "once";
3000
+ settled: number;
3001
+ latest: {
3002
+ id: string;
3003
+ ordinal: number;
3004
+ achievedAt: number;
3005
+ window: string;
3006
+ status: "revoked";
3007
+ completion: string;
3008
+ revokedAt: number;
3009
+ } | {
3010
+ id: string;
3011
+ ordinal: number;
3012
+ achievedAt: number;
3013
+ window: string;
3014
+ status: "awarded";
3015
+ completion: string;
3016
+ } | {
3017
+ id: string;
3018
+ ordinal: number;
3019
+ achievedAt: number;
3020
+ window: string;
3021
+ status: "budget-exhausted";
3022
+ budget: string;
3023
+ } | null;
3024
+ } | null | undefined;
3025
+ }[];
3026
+ key?: string | undefined;
3027
+ }>;
3028
+ open: (view: QuestView) => Promise<QuestController>;
3029
+ observe: (listener: (value: ProgressObservation<zod.infer<typeof questExperienceSchema>>) => void, observeOptions?: {
3030
+ intervalMs?: number;
3031
+ maxBackoffMs?: number;
3032
+ }) => ProgressObserver;
3033
+ };
3034
+ campaigns: {
3035
+ enroll: (value: CampaignEnrollmentInput, requestOptions?: RelayRequestOptions) => Promise<{
3036
+ campaign: string;
3037
+ member: string;
3038
+ enrolledAt: number;
3039
+ withdrawnAt: number | null;
3040
+ withdrawalReason: string | null;
3041
+ }>;
3042
+ withdraw: (value: CampaignWithdrawalInput, requestOptions?: RelayRequestOptions) => Promise<{
3043
+ campaign: string;
3044
+ member: string;
3045
+ enrolledAt: number;
3046
+ withdrawnAt: number | null;
3047
+ withdrawalReason: string | null;
3048
+ }>;
3049
+ };
3050
+ wallets: {
3051
+ list: (requestOptions?: RelayRequestOptions) => Promise<{
3052
+ chain: "solana" | "eip155" | "cosmos";
3053
+ network: `cosmos:${string}` | null;
3054
+ address: string;
3055
+ verifiedAt: number;
3056
+ revision: number;
3057
+ signIn: boolean;
3058
+ }[]>;
3059
+ challenge: (value: zod.input<typeof walletAddressInputSchema>, requestOptions?: RelayRequestOptions) => Promise<{
3060
+ id: string;
3061
+ purpose: "link" | "sign-in";
3062
+ chain: "solana" | "eip155" | "cosmos";
3063
+ network: `cosmos:${string}` | null;
3064
+ address: string;
3065
+ message: string;
3066
+ expiresAt: number;
3067
+ }>;
3068
+ verify: (value: zod.input<typeof walletSignatureSchema>, requestOptions?: RelayRequestOptions) => Promise<{
3069
+ chain: "solana" | "eip155" | "cosmos";
3070
+ network: `cosmos:${string}` | null;
3071
+ address: string;
3072
+ verifiedAt: number;
3073
+ revision: number;
3074
+ signIn: boolean;
3075
+ }>;
3076
+ unlink: (wallet: Pick<LinkedWallet, "chain" | "address">, requestOptions?: RelayRequestOptions) => Promise<{
3077
+ ok: true;
3078
+ }>;
3079
+ link: (signer: WalletSigner, requestOptions?: RelayRequestOptions) => Promise<{
3080
+ chain: "solana" | "eip155" | "cosmos";
3081
+ network: `cosmos:${string}` | null;
3082
+ address: string;
3083
+ verifiedAt: number;
3084
+ revision: number;
3085
+ signIn: boolean;
3086
+ }>;
3087
+ };
3088
+ auth: {
3089
+ providers: (requestOptions?: RelayRequestOptions) => Promise<{
3090
+ providers: {
3091
+ provider: "discord" | "x" | "google" | "apple";
3092
+ configured: boolean;
3093
+ }[];
3094
+ email: boolean;
3095
+ wallets: ("solana" | "eip155" | "cosmos")[];
3096
+ demo: boolean;
3097
+ }>;
3098
+ start: (provider: AuthProvider, mode: "sign-in" | "connect", requestOptions?: RelayRequestOptions) => Promise<{
3099
+ url: string;
3100
+ }>;
3101
+ emailStart: (email: string, requestOptions?: RelayRequestOptions) => Promise<{
3102
+ challenge: string;
3103
+ }>;
3104
+ emailVerify: (challenge: string, code: string, requestOptions?: RelayRequestOptions) => Promise<{
3105
+ id: string;
3106
+ principal: {
3107
+ kind: "member";
3108
+ member: string;
3109
+ } | {
3110
+ kind: "staff";
3111
+ subject: string;
3112
+ } | {
3113
+ kind: "operator";
3114
+ subject: string;
3115
+ } | {
3116
+ kind: string;
3117
+ };
3118
+ expiresAt: number;
3119
+ organization: string;
3120
+ project: string;
3121
+ environment: "test" | "live";
3122
+ }>;
3123
+ wallet: {
3124
+ start: (value: zod.input<typeof walletAddressInputSchema>, requestOptions?: RelayRequestOptions) => Promise<{
3125
+ id: string;
3126
+ purpose: "link" | "sign-in";
3127
+ chain: "solana" | "eip155" | "cosmos";
3128
+ network: `cosmos:${string}` | null;
3129
+ address: string;
3130
+ message: string;
3131
+ expiresAt: number;
3132
+ }>;
3133
+ verify: (proof: zod.input<typeof walletSignatureSchema>, requestOptions?: RelayRequestOptions) => Promise<{
3134
+ id: string;
3135
+ principal: {
3136
+ kind: "member";
3137
+ member: string;
3138
+ } | {
3139
+ kind: "staff";
3140
+ subject: string;
3141
+ } | {
3142
+ kind: "operator";
3143
+ subject: string;
3144
+ } | {
3145
+ kind: string;
3146
+ };
3147
+ expiresAt: number;
3148
+ organization: string;
3149
+ project: string;
3150
+ environment: "test" | "live";
3151
+ }>;
3152
+ signIn: (signer: WalletSigner, requestOptions?: RelayRequestOptions) => Promise<{
3153
+ id: string;
3154
+ principal: {
3155
+ kind: "member";
3156
+ member: string;
3157
+ } | {
3158
+ kind: "staff";
3159
+ subject: string;
3160
+ } | {
3161
+ kind: "operator";
3162
+ subject: string;
3163
+ } | {
3164
+ kind: string;
3165
+ };
3166
+ expiresAt: number;
3167
+ organization: string;
3168
+ project: string;
3169
+ environment: "test" | "live";
3170
+ }>;
3171
+ };
3172
+ accounts: (requestOptions?: RelayRequestOptions) => Promise<{
3173
+ provider: "discord" | "x" | "google" | "apple";
3174
+ configured: boolean;
3175
+ status: "disconnected" | "connected" | "reconnect";
3176
+ subject: string | null;
3177
+ revision: number;
3178
+ }[]>;
3179
+ disconnect: (provider: AuthProvider, requestOptions?: RelayRequestOptions) => Promise<{
3180
+ ok: boolean;
3181
+ }>;
3182
+ session: (requestOptions?: RelayRequestOptions) => Promise<{
3183
+ id: string;
3184
+ principal: {
3185
+ kind: "member";
3186
+ member: string;
3187
+ } | {
3188
+ kind: "staff";
3189
+ subject: string;
3190
+ } | {
3191
+ kind: "operator";
3192
+ subject: string;
3193
+ } | {
3194
+ kind: string;
3195
+ };
3196
+ expiresAt: number;
3197
+ organization: string;
3198
+ project: string;
3199
+ environment: "test" | "live";
3200
+ } | null>;
3201
+ signOut: (requestOptions?: RelayRequestOptions) => Promise<{
3202
+ ok: boolean;
3203
+ }>;
3204
+ exchange: (value: zod.input<typeof exchangeSchema>, requestOptions?: RelayRequestOptions) => Promise<{
3205
+ token: string;
3206
+ session: {
3207
+ id: string;
3208
+ principal: {
3209
+ kind: "member";
3210
+ member: string;
3211
+ } | {
3212
+ kind: "staff";
3213
+ subject: string;
3214
+ } | {
3215
+ kind: "operator";
3216
+ subject: string;
3217
+ };
3218
+ expiresAt: number;
3219
+ organization: string;
3220
+ project: string;
3221
+ environment: "test" | "live";
3222
+ };
3223
+ }>;
3224
+ };
3225
+ me: {
3226
+ activity: {
3227
+ list: (query?: {
3228
+ cursor?: string;
3229
+ limit?: number;
3230
+ }, options?: RelayRequestOptions) => Promise<{
3231
+ member: string;
3232
+ items: ({
3233
+ kind: "attempt.accepted";
3234
+ quest: string;
3235
+ attempt: string;
3236
+ completion: string | null;
3237
+ id: string;
3238
+ at: number;
3239
+ } | {
3240
+ kind: "attempt.rejected";
3241
+ quest: string;
3242
+ attempt: string;
3243
+ completion: string | null;
3244
+ id: string;
3245
+ at: number;
3246
+ } | {
3247
+ kind: "attempt.review";
3248
+ quest: string;
3249
+ attempt: string;
3250
+ completion: string | null;
3251
+ id: string;
3252
+ at: number;
3253
+ } | {
3254
+ kind: "points.awarded";
3255
+ entry: string;
3256
+ ledger: string;
3257
+ amount: number;
3258
+ quest: string | null;
3259
+ completion: string | null;
3260
+ id: string;
3261
+ at: number;
3262
+ } | {
3263
+ kind: "entitlement.granted";
3264
+ entitlement: string;
3265
+ tier: string;
3266
+ status: string;
3267
+ id: string;
3268
+ at: number;
3269
+ } | {
3270
+ kind: "entitlement.collected";
3271
+ entitlement: string;
3272
+ id: string;
3273
+ at: number;
3274
+ } | {
3275
+ kind: "delivery.updated";
3276
+ delivery: string;
3277
+ quest: string;
3278
+ completion: string;
3279
+ status: string;
3280
+ id: string;
3281
+ at: number;
3282
+ } | {
3283
+ kind: "referral.qualified";
3284
+ program: string;
3285
+ id: string;
3286
+ at: number;
3287
+ } | {
3288
+ kind: "unknown";
3289
+ reportedKind: string;
3290
+ id: string;
3291
+ at: number;
3292
+ })[];
3293
+ nextCursor: string;
3294
+ }>;
3295
+ observe: (listener: (event: RelayEvent) => void, options?: {
3296
+ cursor?: string;
3297
+ intervalMs?: number;
3298
+ maxBackoffMs?: number;
3299
+ onState?: (state: ProgressObservation<ParticipantActivity>) => void;
3300
+ }) => ProgressObserver;
3301
+ };
3302
+ get: (requestOptions?: RelayRequestOptions) => Promise<{
3303
+ member: string;
3304
+ avatarSeed: string;
3305
+ }>;
3306
+ observeProgress: (listener: (value: ProgressObservation) => void, observeOptions?: {
3307
+ intervalMs?: number;
3308
+ maxBackoffMs?: number;
3309
+ }) => ProgressObserver;
3310
+ submission: {
3311
+ (quest: string, options?: {
3312
+ input: "photo";
3313
+ release?: string;
3314
+ recoverPrevious?: boolean;
3315
+ repeatable?: boolean;
3316
+ }): Promise<PhotoSubmission>;
3317
+ (quest: string, options: {
3318
+ input: "quiz";
3319
+ release?: string;
3320
+ recoverPrevious?: boolean;
3321
+ repeatable?: boolean;
3322
+ }): Promise<QuizSubmission>;
3323
+ (quest: string, options: {
3324
+ input: "none";
3325
+ release?: string;
3326
+ recoverPrevious?: boolean;
3327
+ repeatable?: boolean;
3328
+ }): Promise<ClaimSubmission>;
3329
+ (quest: string, options: {
3330
+ input: "text" | "url";
3331
+ release?: string;
3332
+ recoverPrevious?: boolean;
3333
+ repeatable?: boolean;
3334
+ }): Promise<ValueSubmission>;
3335
+ };
3336
+ collectionPass: (entitlement: string, requestOptions?: RelayRequestOptions) => Promise<{
3337
+ code: string;
3338
+ expiresAt: number;
3339
+ entitlement: string;
3340
+ }>;
3341
+ progress: (requestOptions?: RelayRequestOptions) => Promise<{
3342
+ member: string;
3343
+ quests: {
3344
+ quest: string;
3345
+ title: string;
3346
+ presentation: {
3347
+ quiz?: {
3348
+ id: string;
3349
+ prompt: string;
3350
+ choices: {
3351
+ id: string;
3352
+ label: string;
3353
+ }[];
3354
+ }[] | undefined;
3355
+ instructions?: string | undefined;
3356
+ video?: {
3357
+ url: string;
3358
+ poster?: string | undefined;
3359
+ captions?: {
3360
+ url: string;
3361
+ language: string;
3362
+ label: string;
3363
+ } | undefined;
3364
+ } | undefined;
3365
+ };
3366
+ connections: ("discord" | "x" | "google" | "apple")[];
3367
+ trigger: {
3368
+ kind: "manual";
3369
+ input: "text";
3370
+ constraints: {
3371
+ required: boolean;
3372
+ minLength: number;
3373
+ maxLength: number;
3374
+ };
3375
+ actor?: "staff" | "member" | undefined;
3376
+ } | {
3377
+ kind: "manual";
3378
+ input: "url";
3379
+ constraints: {
3380
+ required: boolean;
3381
+ allowedHosts?: string[] | undefined;
3382
+ };
3383
+ actor?: "staff" | "member" | undefined;
3384
+ } | {
3385
+ kind: "manual";
3386
+ input: "photo" | "quiz" | "none";
3387
+ actor?: "staff" | "member" | undefined;
3388
+ } | {
3389
+ kind: "automatic";
3390
+ tracker?: {
3391
+ tracker: string;
3392
+ source: string;
3393
+ on: "new-record" | "new-observation" | "data-changed";
3394
+ beneficiary: string;
3395
+ where?: {
3396
+ path: string;
3397
+ gt?: number | {
3398
+ setting: string;
3399
+ } | undefined;
3400
+ gte?: number | {
3401
+ setting: string;
3402
+ } | undefined;
3403
+ lt?: number | {
3404
+ setting: string;
3405
+ } | undefined;
3406
+ lte?: number | {
3407
+ setting: string;
3408
+ } | undefined;
3409
+ } | {
3410
+ path: string;
3411
+ equals: string | number | boolean;
3412
+ } | ({
3413
+ path: string;
3414
+ gt?: number | {
3415
+ setting: string;
3416
+ } | undefined;
3417
+ gte?: number | {
3418
+ setting: string;
3419
+ } | undefined;
3420
+ lt?: number | {
3421
+ setting: string;
3422
+ } | undefined;
3423
+ lte?: number | {
3424
+ setting: string;
3425
+ } | undefined;
3426
+ } | {
3427
+ path: string;
3428
+ equals: string | number | boolean;
3429
+ })[] | undefined;
3430
+ enrollment?: "required" | "none" | undefined;
3431
+ since?: "activation" | "window" | "enrollment" | undefined;
3432
+ historical?: "automatic" | "staff" | "claim" | undefined;
3433
+ content?: true | undefined;
3434
+ } | undefined;
3435
+ };
3436
+ availability: {
3437
+ kind: "available";
3438
+ input: "text" | "url" | "photo" | "quiz" | "none";
3439
+ } | {
3440
+ kind: "completed";
3441
+ } | {
3442
+ kind: "locked";
3443
+ missing: ({
3444
+ kind: "completion";
3445
+ quest: string;
3446
+ title: string;
3447
+ scope: "ever";
3448
+ } | {
3449
+ kind: "completion";
3450
+ quest: string;
3451
+ title: string;
3452
+ scope: "period";
3453
+ period: "day" | "week" | "month";
3454
+ resetsAt: number;
3455
+ } | {
3456
+ kind: "balance";
3457
+ balance: string;
3458
+ title: string;
3459
+ minimum: number;
3460
+ current: number;
3461
+ } | {
3462
+ kind: "group";
3463
+ group: string;
3464
+ title: string;
3465
+ })[];
3466
+ } | {
3467
+ kind: "blocked";
3468
+ reason: "paused" | "outside-window" | "budget-exhausted" | "connection-required" | "wallet-required" | "enrollment-required";
3469
+ resetsAt?: number | undefined;
3470
+ } | {
3471
+ kind: "staff-required";
3472
+ } | {
3473
+ kind: "automatic";
3474
+ } | {
3475
+ kind: "checking";
3476
+ attempt: string;
3477
+ } | {
3478
+ kind: "needs-review";
3479
+ attempt: string;
3480
+ } | {
3481
+ kind: "retryable";
3482
+ attempt: string;
3483
+ };
3484
+ completed: boolean;
3485
+ completion: {
3486
+ kind: "streak";
3487
+ days: number;
3488
+ } | {
3489
+ kind: "progress";
3490
+ goal: {
3491
+ kind: "count";
3492
+ count: number;
3493
+ };
3494
+ window: {
3495
+ kind: "lifetime";
3496
+ } | {
3497
+ kind: "calendar";
3498
+ period: "day" | "week" | "month";
3499
+ latenessMs: number;
3500
+ } | {
3501
+ kind: "rolling";
3502
+ durationMs: number;
3503
+ };
3504
+ repeat: "repeat" | "once";
3505
+ } | {
3506
+ kind: "once";
3507
+ } | {
3508
+ kind: "keyed";
3509
+ };
3510
+ progress: {
3511
+ current: number;
3512
+ target: number;
3513
+ reason: string;
3514
+ } | null;
3515
+ completionCount: number;
3516
+ visibility: "visible" | "hidden";
3517
+ missing: ({
3518
+ kind: "completion";
3519
+ quest: string;
3520
+ title: string;
3521
+ scope: "ever";
3522
+ } | {
3523
+ kind: "completion";
3524
+ quest: string;
3525
+ title: string;
3526
+ scope: "period";
3527
+ period: "day" | "week" | "month";
3528
+ resetsAt: number;
3529
+ } | {
3530
+ kind: "balance";
3531
+ balance: string;
3532
+ title: string;
3533
+ minimum: number;
3534
+ current: number;
3535
+ } | {
3536
+ kind: "group";
3537
+ group: string;
3538
+ title: string;
3539
+ })[];
3540
+ campaign: {
3541
+ key: string;
3542
+ title: string;
3543
+ enrollment: "required" | "none";
3544
+ enrolledAt: number | null;
3545
+ withdrawnAt: number | null;
3546
+ withdrawalReason: string | null;
3547
+ window?: {
3548
+ from: number;
3549
+ until: number;
3550
+ } | undefined;
3551
+ } | null;
3552
+ window: {
3553
+ from: number;
3554
+ until: number;
3555
+ } | null;
3556
+ budgets: {
3557
+ id: string;
3558
+ scope: "member" | "project";
3559
+ period: "lifetime" | "day" | "week" | "month";
3560
+ remaining: number;
3561
+ resetsAt: number | null;
3562
+ }[];
3563
+ attempt: {
3564
+ id: string;
3565
+ release: string;
3566
+ quest: string;
3567
+ member: string;
3568
+ evidence: string | null;
3569
+ status: AttemptStatus;
3570
+ reason: string | null;
3571
+ retries: number;
3572
+ generation: number;
3573
+ completion: string | null;
3574
+ reviewRewards: ({
3575
+ kind: "tier";
3576
+ reward: {
3577
+ id: string;
3578
+ title: string;
3579
+ tiers: {
3580
+ id: string;
3581
+ title: string;
3582
+ }[];
3583
+ inventory: {
3584
+ kind: "untracked";
3585
+ };
3586
+ fulfillment: {
3587
+ kind: "staff-handover";
3588
+ } | {
3589
+ kind: "automatic";
3590
+ };
3591
+ };
3592
+ tier: string;
3593
+ } | {
3594
+ kind: "points";
3595
+ balance: string;
3596
+ amount: number;
3597
+ } | {
3598
+ kind: "integration";
3599
+ provider: "discord";
3600
+ action: "grant-role";
3601
+ roleId: string;
3602
+ })[] | null;
3603
+ evaluationRun: number;
3604
+ deferCount: number;
3605
+ deferUntil: number | null;
3606
+ nextEvaluationAt: number | null;
3607
+ code: string | null;
3608
+ progress: {
3609
+ current: number;
3610
+ target: number;
3611
+ reason: string;
3612
+ } | null;
3613
+ requestedReview: boolean;
3614
+ createdAt: number;
3615
+ input?: {
3616
+ kind: "quiz";
3617
+ answers: {
3618
+ [k: string]: string;
3619
+ };
3620
+ release?: string | undefined;
3621
+ } | {
3622
+ kind: "text";
3623
+ value: string;
3624
+ } | {
3625
+ kind: "url";
3626
+ value: string;
3627
+ } | undefined;
3628
+ } | null;
3629
+ key?: string | undefined;
3630
+ release?: string | undefined;
3631
+ streak?: {
3632
+ goal: number;
3633
+ current: number;
3634
+ best: number;
3635
+ today: string;
3636
+ todayQualified: boolean;
3637
+ timeZone: string;
3638
+ nextBoundary: number;
3639
+ pendingTimeZone: {
3640
+ timeZone: string;
3641
+ effectiveAt: number;
3642
+ } | null;
3643
+ days: {
3644
+ day: number;
3645
+ date: string;
3646
+ timeZone: string;
3647
+ occurredAt: number;
3648
+ }[];
3649
+ milestone: {
3650
+ status: "pending";
3651
+ } | {
3652
+ status: "awarded";
3653
+ completion: string;
3654
+ achievedAt: number;
3655
+ } | {
3656
+ status: "budget-exhausted";
3657
+ budget: string;
3658
+ achievedAt: number;
3659
+ };
3660
+ } | null | undefined;
3661
+ counter?: {
3662
+ goal: number;
3663
+ current: number;
3664
+ window: {
3665
+ key: string;
3666
+ start: number | null;
3667
+ end: number | null;
3668
+ };
3669
+ repeat: "repeat" | "once";
3670
+ settled: number;
3671
+ latest: {
3672
+ id: string;
3673
+ ordinal: number;
3674
+ achievedAt: number;
3675
+ window: string;
3676
+ status: "revoked";
3677
+ completion: string;
3678
+ revokedAt: number;
3679
+ } | {
3680
+ id: string;
3681
+ ordinal: number;
3682
+ achievedAt: number;
3683
+ window: string;
3684
+ status: "awarded";
3685
+ completion: string;
3686
+ } | {
3687
+ id: string;
3688
+ ordinal: number;
3689
+ achievedAt: number;
3690
+ window: string;
3691
+ status: "budget-exhausted";
3692
+ budget: string;
3693
+ } | null;
3694
+ } | null | undefined;
3695
+ }[];
3696
+ entitlements: ({
3697
+ [x: string]: unknown;
3698
+ status: "available";
3699
+ id: string;
3700
+ member: string;
3701
+ reward: {
3702
+ [x: string]: unknown;
3703
+ id: string;
3704
+ title: string;
3705
+ tiers: {
3706
+ [x: string]: unknown;
3707
+ id: string;
3708
+ title: string;
3709
+ }[];
3710
+ inventory: {
3711
+ [x: string]: unknown;
3712
+ kind: string;
3713
+ };
3714
+ fulfillment: {
3715
+ [x: string]: unknown;
3716
+ kind: string;
3717
+ };
3718
+ };
3719
+ earnedTier: string;
3720
+ tier: string;
3721
+ revision: number;
3722
+ } | {
3723
+ [x: string]: unknown;
3724
+ status: "handing-over";
3725
+ handover: string;
3726
+ startedAt: number;
3727
+ id: string;
3728
+ member: string;
3729
+ reward: {
3730
+ [x: string]: unknown;
3731
+ id: string;
3732
+ title: string;
3733
+ tiers: {
3734
+ [x: string]: unknown;
3735
+ id: string;
3736
+ title: string;
3737
+ }[];
3738
+ inventory: {
3739
+ [x: string]: unknown;
3740
+ kind: string;
3741
+ };
3742
+ fulfillment: {
3743
+ [x: string]: unknown;
3744
+ kind: string;
3745
+ };
3746
+ };
3747
+ earnedTier: string;
3748
+ tier: string;
3749
+ revision: number;
3750
+ allocation?: {
3751
+ [x: string]: unknown;
3752
+ item: string;
3753
+ label: string;
3754
+ } | undefined;
3755
+ } | {
3756
+ [x: string]: unknown;
3757
+ status: "collected";
3758
+ handover: string;
3759
+ startedAt: number;
3760
+ collectedAt: number;
3761
+ id: string;
3762
+ member: string;
3763
+ reward: {
3764
+ [x: string]: unknown;
3765
+ id: string;
3766
+ title: string;
3767
+ tiers: {
3768
+ [x: string]: unknown;
3769
+ id: string;
3770
+ title: string;
3771
+ }[];
3772
+ inventory: {
3773
+ [x: string]: unknown;
3774
+ kind: string;
3775
+ };
3776
+ fulfillment: {
3777
+ [x: string]: unknown;
3778
+ kind: string;
3779
+ };
3780
+ };
3781
+ earnedTier: string;
3782
+ tier: string;
3783
+ revision: number;
3784
+ allocation?: {
3785
+ [x: string]: unknown;
3786
+ item: string;
3787
+ label: string;
3788
+ } | undefined;
3789
+ recovery?: {
3790
+ completion: string;
3791
+ reason: string;
3792
+ flaggedAt: number;
3793
+ remainingTier: string | null;
3794
+ } | undefined;
3795
+ } | {
3796
+ [x: string]: unknown;
3797
+ status: "void";
3798
+ voidedAt: number;
3799
+ id: string;
3800
+ member: string;
3801
+ reward: {
3802
+ [x: string]: unknown;
3803
+ id: string;
3804
+ title: string;
3805
+ tiers: {
3806
+ [x: string]: unknown;
3807
+ id: string;
3808
+ title: string;
3809
+ }[];
3810
+ inventory: {
3811
+ [x: string]: unknown;
3812
+ kind: string;
3813
+ };
3814
+ fulfillment: {
3815
+ [x: string]: unknown;
3816
+ kind: string;
3817
+ };
3818
+ };
3819
+ earnedTier: string;
3820
+ tier: string;
3821
+ revision: number;
3822
+ } | {
3823
+ status: "unsupported";
3824
+ reportedStatus: string;
3825
+ id: string;
3826
+ member: string;
3827
+ reward: {
3828
+ [x: string]: unknown;
3829
+ id: string;
3830
+ title: string;
3831
+ tiers: {
3832
+ [x: string]: unknown;
3833
+ id: string;
3834
+ title: string;
3835
+ }[];
3836
+ inventory: {
3837
+ [x: string]: unknown;
3838
+ kind: string;
3839
+ };
3840
+ fulfillment: {
3841
+ [x: string]: unknown;
3842
+ kind: string;
3843
+ };
3844
+ };
3845
+ earnedTier: string;
3846
+ tier: string;
3847
+ revision: number;
3848
+ })[];
3849
+ }>;
3850
+ rewardDeliveries: (requestOptions?: RelayRequestOptions) => Promise<{
3851
+ deliveries: ({
3852
+ [x: string]: JSONType | undefined;
3853
+ id: string;
3854
+ quest: string;
3855
+ completion: string;
3856
+ member: string;
3857
+ action: RewardDeliveryAction;
3858
+ attempts: number;
3859
+ nextAt: number;
3860
+ lastError: string | null;
3861
+ createdAt: number;
3862
+ deliveredAt: number | null;
3863
+ provider: string;
3864
+ status: string;
3865
+ dispatchedAt?: number | null | undefined;
3866
+ revokedAt?: number | null | undefined;
3867
+ roleId?: string | undefined;
3868
+ reconciliation?: {
3869
+ [x: string]: JSONType;
3870
+ status: string;
3871
+ ownership: string;
3872
+ at: number;
3873
+ reason: string | null;
3874
+ } | null | undefined;
3875
+ } | {
3876
+ [x: string]: JSONType | undefined;
3877
+ id: string;
3878
+ quest: string;
3879
+ completion: string;
3880
+ member: string;
3881
+ provider: "discord";
3882
+ action: RewardDeliveryAction;
3883
+ roleId: string;
3884
+ status: "pending" | "failed" | "delivered";
3885
+ attempts: number;
3886
+ nextAt: number;
3887
+ lastError: string | null;
3888
+ createdAt: number;
3889
+ deliveredAt: number | null;
3890
+ dispatchedAt?: number | null | undefined;
3891
+ revokedAt?: number | null | undefined;
3892
+ reconciliation?: {
3893
+ status: "removed" | "pending" | "failed" | "preserved" | "granted";
3894
+ ownership: "external" | "unclaimed" | "relay";
3895
+ at: number;
3896
+ reason: string | null;
3897
+ } | null | undefined;
3898
+ })[];
3899
+ }>;
3900
+ balances: (requestOptions?: RelayRequestOptions) => Promise<{
3901
+ items: {
3902
+ ledger: {
3903
+ id: string;
3904
+ key: string | null;
3905
+ name: string;
3906
+ };
3907
+ balance: number;
3908
+ available: number;
3909
+ }[];
3910
+ }>;
3911
+ pointHistory: (query: PointHistoryQuery, requestOptions?: RelayRequestOptions) => Promise<{
3912
+ items: {
3913
+ id: string;
3914
+ amount: number;
3915
+ kind: PointEntryKind;
3916
+ at: number;
3917
+ quest: string | null;
3918
+ reverses: string | null;
3919
+ }[];
3920
+ nextCursor: string | null;
3921
+ }>;
3922
+ claim: (value: Omit<zod.input<typeof submitSchema>, "member">, requestOptions?: RelayRequestOptions) => Promise<{
3923
+ id: string;
3924
+ release: string;
3925
+ quest: string;
3926
+ member: string;
3927
+ evidence: string | null;
3928
+ status: AttemptStatus;
3929
+ reason: string | null;
3930
+ retries: number;
3931
+ generation: number;
3932
+ completion: string | null;
3933
+ reviewRewards: ({
3934
+ kind: "tier";
3935
+ reward: {
3936
+ id: string;
3937
+ title: string;
3938
+ tiers: {
3939
+ id: string;
3940
+ title: string;
3941
+ }[];
3942
+ inventory: {
3943
+ kind: "untracked";
3944
+ };
3945
+ fulfillment: {
3946
+ kind: "staff-handover";
3947
+ } | {
3948
+ kind: "automatic";
3949
+ };
3950
+ };
3951
+ tier: string;
3952
+ } | {
3953
+ kind: "points";
3954
+ balance: string;
3955
+ amount: number;
3956
+ } | {
3957
+ kind: "integration";
3958
+ provider: "discord";
3959
+ action: "grant-role";
3960
+ roleId: string;
3961
+ })[] | null;
3962
+ evaluationRun: number;
3963
+ deferCount: number;
3964
+ deferUntil: number | null;
3965
+ nextEvaluationAt: number | null;
3966
+ code: string | null;
3967
+ progress: {
3968
+ current: number;
3969
+ target: number;
3970
+ reason: string;
3971
+ } | null;
3972
+ requestedReview: boolean;
3973
+ createdAt: number;
3974
+ input?: {
3975
+ kind: "quiz";
3976
+ answers: {
3977
+ [k: string]: string;
3978
+ };
3979
+ release?: string | undefined;
3980
+ } | {
3981
+ kind: "text";
3982
+ value: string;
3983
+ } | {
3984
+ kind: "url";
3985
+ value: string;
3986
+ } | undefined;
3987
+ }>;
3988
+ upload: (file: Blob, requestOptions?: RelayRequestOptions) => Promise<{
3989
+ id: string;
3990
+ member: string;
3991
+ type: "image/jpeg" | "image/png";
3992
+ size: number;
3993
+ }>;
3994
+ };
3995
+ evidence: {
3996
+ download(id: string, requestOptions?: RelayRequestOptions): Promise<Blob>;
3997
+ };
3998
+ engagement: {
3999
+ page: (query: zod.input<typeof engagementPageQuerySchema>, requestOptions?: RelayRequestOptions) => Promise<{
4000
+ rule: {
4001
+ version: string;
4002
+ definition: {
4003
+ key: string;
4004
+ qualifiedBy: string;
4005
+ balance: string;
4006
+ metrics: string[];
4007
+ baseline: "historical";
4008
+ maxAgeMs: number;
4009
+ budgets: {
4010
+ scope: "member" | "project";
4011
+ period: "lifetime" | "day" | "week" | "month";
4012
+ limit: number;
4013
+ }[];
4014
+ };
4015
+ publishedAt: number;
4016
+ };
4017
+ account: {
4018
+ member: string;
4019
+ earned: number;
4020
+ accounted: number;
4021
+ paid: number;
4022
+ excluded: number;
4023
+ pending: number;
4024
+ counters: Record<string, number>;
4025
+ baseline: Record<string, number>;
4026
+ observation: string | null;
4027
+ nextSettlementAt: number | null;
4028
+ reason: string | null;
4029
+ } | null;
4030
+ items: {
4031
+ id: string;
4032
+ day: string;
4033
+ observation: string;
4034
+ qualification: string;
4035
+ earned: number;
4036
+ growth: number;
4037
+ paid: number;
4038
+ excluded: number;
4039
+ entry: string | null;
4040
+ createdAt: number;
4041
+ }[];
4042
+ nextCursor: string | null;
4043
+ }>;
4044
+ boundaries: (query: zod.input<typeof engagementPageQuerySchema>, requestOptions?: RelayRequestOptions) => Promise<{
4045
+ current: {
4046
+ version: string;
4047
+ definition: {
4048
+ key: string;
4049
+ qualifiedBy: string;
4050
+ balance: string;
4051
+ metrics: string[];
4052
+ baseline: "historical";
4053
+ maxAgeMs: number;
4054
+ budgets: {
4055
+ scope: "member" | "project";
4056
+ period: "lifetime" | "day" | "week" | "month";
4057
+ limit: number;
4058
+ }[];
4059
+ };
4060
+ publishedAt: number;
4061
+ } | null;
4062
+ requested: {
4063
+ version: string;
4064
+ definition: {
4065
+ key: string;
4066
+ qualifiedBy: string;
4067
+ balance: string;
4068
+ metrics: string[];
4069
+ baseline: "historical";
4070
+ maxAgeMs: number;
4071
+ budgets: {
4072
+ scope: "member" | "project";
4073
+ period: "lifetime" | "day" | "week" | "month";
4074
+ limit: number;
4075
+ }[];
4076
+ };
4077
+ publishedAt: number;
4078
+ };
4079
+ items: {
4080
+ from: string;
4081
+ to: string;
4082
+ baseline: Record<string, number>;
4083
+ observedAt: number;
4084
+ settlement: {
4085
+ id: string;
4086
+ day: string;
4087
+ observation: string;
4088
+ qualification: string;
4089
+ earned: number;
4090
+ growth: number;
4091
+ paid: number;
4092
+ excluded: number;
4093
+ entry: string | null;
4094
+ createdAt: number;
4095
+ };
4096
+ }[];
4097
+ nextCursor: string | null;
4098
+ }>;
4099
+ };
4100
+ content: {
4101
+ performance: (query: zod.input<typeof contentPerformanceQuerySchema>, requestOptions?: RelayRequestOptions) => Promise<{
4102
+ current: {
4103
+ state: "superseded" | "pending" | "qualified" | "unqualified" | "needs-review" | "failed" | "content-pending" | "content-unqualified" | "waiting";
4104
+ reason: string | null;
4105
+ contentAttempt: string;
4106
+ attempt: string | null;
4107
+ reward: {
4108
+ attempt: string | null;
4109
+ completion: string | null;
4110
+ state: "excluded" | "unresolved" | "awarded";
4111
+ };
4112
+ };
4113
+ items: {
4114
+ attempt: string;
4115
+ contentAttempt: string;
4116
+ observation: string;
4117
+ observedAt: number;
4118
+ metrics: Record<string, number>;
4119
+ state: "superseded" | "pending" | "qualified" | "unqualified" | "needs-review" | "failed";
4120
+ reason: string | null;
4121
+ }[];
4122
+ nextCursor: string | null;
4123
+ }>;
4124
+ qualifications: (query: zod.input<typeof contentQualificationQuerySchema>, requestOptions?: RelayRequestOptions) => Promise<{
4125
+ items: {
4126
+ quest: string;
4127
+ content: string;
4128
+ member: string;
4129
+ release: string;
4130
+ attempt: string;
4131
+ revision: string;
4132
+ observation: string;
4133
+ current: boolean;
4134
+ state: "superseded" | "pending" | "qualified" | "unqualified" | "needs-review" | "failed" | "stale" | "blocked" | "unavailable";
4135
+ reason: string | null;
4136
+ reward: {
4137
+ attempt: string | null;
4138
+ completion: string | null;
4139
+ state: "excluded" | "unresolved" | "awarded";
4140
+ };
4141
+ }[];
4142
+ nextCursor: string | null;
4143
+ }>;
4144
+ };
4145
+ };
4146
+ /**
4147
+ * IndexedDB-backed store with Web Locks. A failed or blocked open is never remembered: the next
4148
+ * call opens again, and a connection the browser or another tab closes is replaced on demand.
4149
+ * Failures reject, never read as "nothing saved", so a caller cannot start a new claim over a
4150
+ * saved one it could not see.
4151
+ */
4152
+ declare function browserSubmissionStore(): SubmissionStore;
4153
+
4154
+ export { type CosmosChains as C, type DiscoveredWallet as D, type EmailSignInOption as E, type JSONType as J, type KeplrLike as K, type OAuthSignInOption as O, type SignInMethods as S, type WalletSignInOption as W, type SignInOption as a, type SignInUnavailable as b, createBrowserRelayClient as c, type SignInWallet as d, type SignInIcon as e, type Eip1193Provider as f, type SignInClient as g, type SignInOptions as h, type SolanaInjectedProvider as i, type StandardWallet as j, type StandardWalletAccount as k, browserSubmissionStore as l, cosmosChainList as m, cosmosSigner as n, discoverCosmosWallets as o, discoverEvmWallets as p, discoverSignInWallets as q, discoverSolanaWallets as r, evmSigner as s, signInOptions as t, solanaSigner as u, walletStandardSolanaSigner as w };