@domino-sdk/relay 0.23.1 → 0.25.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.
@@ -2,10 +2,11 @@ import * as react from 'react';
2
2
  import { ReactNode } from 'react';
3
3
  import * as zod from 'zod';
4
4
  import { z } from 'zod';
5
- import { QuestView, QuestController, ProgressObservation, questExperienceSchema, ProgressObserver, ExchangeInput, PhotoSubmission, QuizSubmission, ClaimSubmission, ValueSubmission, SubmissionDraft, PointLedgerReference } from '../index.js';
6
- import { t as referralAcceptSchema, L as LeaderboardQuery, w as walletChallengeInputSchema, u as walletProofSchema, v as AuthProvider, y as engagementPageQuerySchema, z as contentQualificationQuerySchema, E as contentAdmissionQuerySchema, F as contentEnrollmentInputSchema, G as contentReleaseInputSchema, H as AccountConnection, J as referralSummarySchema, K as LeaderboardPage } from '../submission-input-CK4Dy19H.js';
5
+ import { ProfileUpdate, QuestView, QuestController, ProgressObservation, questExperienceSchema, ProgressObserver, ExchangeInput, PhotoSubmission, QuizSubmission, ClaimSubmission, ValueSubmission, SubmissionDraft, PublicProfile, PointLedgerReference } from '../index.js';
6
+ export { avatarSrc, defaultAvatar, walletAvatarSeed } from '../index.js';
7
+ import { H as referralAcceptSchema, J as LeaderboardQuery, K as WalletAddressInput, M as walletSignatureSchema, L as LinkedWallet, N as WalletSigner, P as walletChallengeInputSchema, Q as walletProofSchema, R as AuthProvider, V as WalletSignature, Y as engagementPageQuerySchema, Z as contentQualificationQuerySchema, _ as contentAdmissionQuerySchema, $ as contentEnrollmentInputSchema, a0 as contentReleaseInputSchema, a1 as WalletSignInNetwork, a2 as AccountConnection, a3 as CosmosNetwork, a4 as referralSummarySchema, a5 as LeaderboardPage } from '../submission-input-Ckpb4sBv.js';
7
8
  import { SubmitInput, ReleaseInput, beginHandoverSchema, contentPerformanceQuerySchema, TieredRewardReference } from '../schema.js';
8
- import { createBrowserRelayClient } from '../browser.js';
9
+ import { createBrowserRelayClient, DiscoveredWallet } from '../browser.js';
9
10
 
10
11
  type RelayClient = ReturnType<typeof createBrowserRelayClient>;
11
12
  /** The participant client, for calls no hook covers. */
@@ -314,6 +315,23 @@ declare function useRelay(): {
314
315
  name: string;
315
316
  score: number;
316
317
  rank: number;
318
+ profile: {
319
+ id: string;
320
+ name: string;
321
+ avatar: {
322
+ source: "upload";
323
+ url: string;
324
+ seed: string;
325
+ } | {
326
+ source: "account";
327
+ provider: "x" | "discord" | "google";
328
+ url: string;
329
+ seed: string;
330
+ } | {
331
+ source: "generated";
332
+ seed: string;
333
+ };
334
+ } | null;
317
335
  member?: string | undefined;
318
336
  }[];
319
337
  me: {
@@ -321,6 +339,23 @@ declare function useRelay(): {
321
339
  name: string;
322
340
  score: number;
323
341
  rank: number;
342
+ profile: {
343
+ id: string;
344
+ name: string;
345
+ avatar: {
346
+ source: "upload";
347
+ url: string;
348
+ seed: string;
349
+ } | {
350
+ source: "account";
351
+ provider: "x" | "discord" | "google";
352
+ url: string;
353
+ seed: string;
354
+ } | {
355
+ source: "generated";
356
+ seed: string;
357
+ };
358
+ } | null;
324
359
  member?: string | undefined;
325
360
  } | null;
326
361
  nearby: {
@@ -328,11 +363,166 @@ declare function useRelay(): {
328
363
  name: string;
329
364
  score: number;
330
365
  rank: number;
366
+ profile: {
367
+ id: string;
368
+ name: string;
369
+ avatar: {
370
+ source: "upload";
371
+ url: string;
372
+ seed: string;
373
+ } | {
374
+ source: "account";
375
+ provider: "x" | "discord" | "google";
376
+ url: string;
377
+ seed: string;
378
+ } | {
379
+ source: "generated";
380
+ seed: string;
381
+ };
382
+ } | null;
331
383
  member?: string | undefined;
332
384
  }[];
333
385
  nextCursor: string | null;
334
386
  }>;
335
387
  };
388
+ profiles: {
389
+ mine: () => Promise<{
390
+ id: string;
391
+ name: string;
392
+ avatar: {
393
+ source: "upload";
394
+ url: string;
395
+ seed: string;
396
+ } | {
397
+ source: "account";
398
+ provider: "x" | "discord" | "google";
399
+ url: string;
400
+ seed: string;
401
+ } | {
402
+ source: "generated";
403
+ seed: string;
404
+ };
405
+ displayName: string | null;
406
+ avatarChoice: "default" | "account" | "generated" | "upload";
407
+ avatarProvider: "x" | "discord" | "google" | null;
408
+ hidden: boolean;
409
+ locked: boolean;
410
+ visibility: "private" | "participants" | "public";
411
+ options: {
412
+ provider: "x" | "discord" | "google";
413
+ name: string | null;
414
+ imageUrl: string | null;
415
+ }[];
416
+ }>;
417
+ update: (input: ProfileUpdate, options?: {
418
+ session?: string;
419
+ }) => Promise<{
420
+ id: string;
421
+ name: string;
422
+ avatar: {
423
+ source: "upload";
424
+ url: string;
425
+ seed: string;
426
+ } | {
427
+ source: "account";
428
+ provider: "x" | "discord" | "google";
429
+ url: string;
430
+ seed: string;
431
+ } | {
432
+ source: "generated";
433
+ seed: string;
434
+ };
435
+ displayName: string | null;
436
+ avatarChoice: "default" | "account" | "generated" | "upload";
437
+ avatarProvider: "x" | "discord" | "google" | null;
438
+ hidden: boolean;
439
+ locked: boolean;
440
+ visibility: "private" | "participants" | "public";
441
+ options: {
442
+ provider: "x" | "discord" | "google";
443
+ name: string | null;
444
+ imageUrl: string | null;
445
+ }[];
446
+ }>;
447
+ uploadAvatar: (file: Blob, options?: {
448
+ uploadId?: string;
449
+ session?: string;
450
+ }) => Promise<{
451
+ id: string;
452
+ name: string;
453
+ avatar: {
454
+ source: "upload";
455
+ url: string;
456
+ seed: string;
457
+ } | {
458
+ source: "account";
459
+ provider: "x" | "discord" | "google";
460
+ url: string;
461
+ seed: string;
462
+ } | {
463
+ source: "generated";
464
+ seed: string;
465
+ };
466
+ displayName: string | null;
467
+ avatarChoice: "default" | "account" | "generated" | "upload";
468
+ avatarProvider: "x" | "discord" | "google" | null;
469
+ hidden: boolean;
470
+ locked: boolean;
471
+ visibility: "private" | "participants" | "public";
472
+ options: {
473
+ provider: "x" | "discord" | "google";
474
+ name: string | null;
475
+ imageUrl: string | null;
476
+ }[];
477
+ }>;
478
+ get: (profile: string) => Promise<{
479
+ id: string;
480
+ name: string;
481
+ avatar: {
482
+ source: "upload";
483
+ url: string;
484
+ seed: string;
485
+ } | {
486
+ source: "account";
487
+ provider: "x" | "discord" | "google";
488
+ url: string;
489
+ seed: string;
490
+ } | {
491
+ source: "generated";
492
+ seed: string;
493
+ };
494
+ self: boolean;
495
+ leaderboards: {
496
+ leaderboard: string;
497
+ title: string;
498
+ rank: number;
499
+ score: number;
500
+ total: number;
501
+ key?: string | undefined;
502
+ }[] | null;
503
+ quests: {
504
+ quest: string;
505
+ title: string;
506
+ completions: number;
507
+ lastCompletedAt: number | null;
508
+ key?: string | undefined;
509
+ }[] | null;
510
+ referrals: {
511
+ attributed: number;
512
+ programs: {
513
+ program: string;
514
+ title: string;
515
+ qualified: number;
516
+ milestones: {
517
+ id: string;
518
+ count: number;
519
+ reached: boolean;
520
+ }[];
521
+ key?: string | undefined;
522
+ }[];
523
+ } | null;
524
+ }>;
525
+ };
336
526
  quests: {
337
527
  get: (id: string) => Promise<{
338
528
  quest: string;
@@ -374,6 +564,11 @@ declare function useRelay(): {
374
564
  posts: "after-enrollment" | "since-start";
375
565
  historical: "automatic" | "claim" | "staff";
376
566
  } | undefined;
567
+ tracker?: {
568
+ tracker: string;
569
+ source: "custom" | "x-search";
570
+ beneficiary: "author" | "replied-to";
571
+ } | undefined;
377
572
  } | {
378
573
  kind: "manual";
379
574
  input: "text";
@@ -646,6 +841,11 @@ declare function useRelay(): {
646
841
  posts: "after-enrollment" | "since-start";
647
842
  historical: "automatic" | "claim" | "staff";
648
843
  } | undefined;
844
+ tracker?: {
845
+ tracker: string;
846
+ source: "custom" | "x-search";
847
+ beneficiary: "author" | "replied-to";
848
+ } | undefined;
649
849
  } | {
650
850
  kind: "manual";
651
851
  input: "text";
@@ -866,6 +1066,11 @@ declare function useRelay(): {
866
1066
  posts: "after-enrollment" | "since-start";
867
1067
  historical: "automatic" | "claim" | "staff";
868
1068
  } | undefined;
1069
+ tracker?: {
1070
+ tracker: string;
1071
+ source: "custom" | "x-search";
1072
+ beneficiary: "author" | "replied-to";
1073
+ } | undefined;
869
1074
  } | {
870
1075
  kind: "manual";
871
1076
  input: "text";
@@ -1089,6 +1294,11 @@ declare function useRelay(): {
1089
1294
  posts: "after-enrollment" | "since-start";
1090
1295
  historical: "automatic" | "claim" | "staff";
1091
1296
  } | undefined;
1297
+ tracker?: {
1298
+ tracker: string;
1299
+ source: "custom" | "x-search";
1300
+ beneficiary: "author" | "replied-to";
1301
+ } | undefined;
1092
1302
  } | {
1093
1303
  kind: "manual";
1094
1304
  input: "text";
@@ -1274,6 +1484,44 @@ declare function useRelay(): {
1274
1484
  maxBackoffMs?: number;
1275
1485
  }) => ProgressObserver;
1276
1486
  };
1487
+ wallets: {
1488
+ list: () => Promise<{
1489
+ chain: "solana" | "eip155" | "cosmos";
1490
+ network: "cosmos:pio-mainnet-1" | "cosmos:pio-testnet-1" | null;
1491
+ address: string;
1492
+ verifiedAt: number;
1493
+ revision: number;
1494
+ signIn: boolean;
1495
+ }[]>;
1496
+ challenge: (input: WalletAddressInput, session: string) => Promise<{
1497
+ id: string;
1498
+ purpose: "link" | "sign-in";
1499
+ chain: "solana" | "eip155" | "cosmos";
1500
+ network: "cosmos:pio-mainnet-1" | "cosmos:pio-testnet-1" | null;
1501
+ address: string;
1502
+ message: string;
1503
+ expiresAt: number;
1504
+ }>;
1505
+ verify: (input: zod.input<typeof walletSignatureSchema>, session: string) => Promise<{
1506
+ chain: "solana" | "eip155" | "cosmos";
1507
+ network: "cosmos:pio-mainnet-1" | "cosmos:pio-testnet-1" | null;
1508
+ address: string;
1509
+ verifiedAt: number;
1510
+ revision: number;
1511
+ signIn: boolean;
1512
+ }>;
1513
+ unlink: (wallet: Pick<LinkedWallet, "chain" | "address">) => Promise<{
1514
+ ok: true;
1515
+ }>;
1516
+ link: (signer: WalletSigner) => Promise<{
1517
+ chain: "solana" | "eip155" | "cosmos";
1518
+ network: "cosmos:pio-mainnet-1" | "cosmos:pio-testnet-1" | null;
1519
+ address: string;
1520
+ verifiedAt: number;
1521
+ revision: number;
1522
+ signIn: boolean;
1523
+ }>;
1524
+ };
1277
1525
  wallet: {
1278
1526
  connection: () => Promise<{
1279
1527
  chain: "solana";
@@ -1302,6 +1550,7 @@ declare function useRelay(): {
1302
1550
  configured: boolean;
1303
1551
  }[];
1304
1552
  email: boolean;
1553
+ wallets: ("solana" | "eip155" | "cosmos:pio-mainnet-1" | "cosmos:pio-testnet-1")[];
1305
1554
  demo: boolean;
1306
1555
  }>;
1307
1556
  start: (provider: AuthProvider, mode: "sign-in" | "connect") => Promise<{
@@ -1327,6 +1576,51 @@ declare function useRelay(): {
1327
1576
  };
1328
1577
  expiresAt: number;
1329
1578
  }>;
1579
+ wallet: {
1580
+ start: (input: WalletAddressInput) => Promise<{
1581
+ id: string;
1582
+ purpose: "link" | "sign-in";
1583
+ chain: "solana" | "eip155" | "cosmos";
1584
+ network: "cosmos:pio-mainnet-1" | "cosmos:pio-testnet-1" | null;
1585
+ address: string;
1586
+ message: string;
1587
+ expiresAt: number;
1588
+ }>;
1589
+ verify: (proof: WalletSignature) => Promise<{
1590
+ organization: string;
1591
+ project: string;
1592
+ environment: "test" | "live";
1593
+ id: string;
1594
+ principal: {
1595
+ kind: "member";
1596
+ member: string;
1597
+ } | {
1598
+ kind: "staff";
1599
+ subject: string;
1600
+ } | {
1601
+ kind: "operator";
1602
+ subject: string;
1603
+ };
1604
+ expiresAt: number;
1605
+ }>;
1606
+ signIn: (signer: WalletSigner) => Promise<{
1607
+ organization: string;
1608
+ project: string;
1609
+ environment: "test" | "live";
1610
+ id: string;
1611
+ principal: {
1612
+ kind: "member";
1613
+ member: string;
1614
+ } | {
1615
+ kind: "staff";
1616
+ subject: string;
1617
+ } | {
1618
+ kind: "operator";
1619
+ subject: string;
1620
+ };
1621
+ expiresAt: number;
1622
+ }>;
1623
+ };
1330
1624
  accounts: () => Promise<{
1331
1625
  provider: "x" | "discord" | "google" | "apple";
1332
1626
  configured: boolean;
@@ -1384,6 +1678,10 @@ declare function useRelay(): {
1384
1678
  }>;
1385
1679
  };
1386
1680
  me: {
1681
+ get: () => Promise<{
1682
+ member: string;
1683
+ avatarSeed: string;
1684
+ }>;
1387
1685
  observeProgress: (listener: (value: ProgressObservation) => void, options?: {
1388
1686
  intervalMs?: number;
1389
1687
  maxBackoffMs?: number;
@@ -1514,6 +1812,11 @@ declare function useRelay(): {
1514
1812
  posts: "after-enrollment" | "since-start";
1515
1813
  historical: "automatic" | "claim" | "staff";
1516
1814
  } | undefined;
1815
+ tracker?: {
1816
+ tracker: string;
1817
+ source: "custom" | "x-search";
1818
+ beneficiary: "author" | "replied-to";
1819
+ } | undefined;
1517
1820
  } | {
1518
1821
  kind: "manual";
1519
1822
  input: "text";
@@ -1979,6 +2282,11 @@ declare function useRelay(): {
1979
2282
  posts: "after-enrollment" | "since-start";
1980
2283
  historical: "automatic" | "claim" | "staff";
1981
2284
  } | undefined;
2285
+ tracker?: {
2286
+ tracker: string;
2287
+ source: "custom" | "x-search";
2288
+ beneficiary: "author" | "replied-to";
2289
+ } | undefined;
1982
2290
  } | {
1983
2291
  kind: "manual";
1984
2292
  input: "text";
@@ -2018,7 +2326,7 @@ declare function useRelay(): {
2018
2326
  budgets: {
2019
2327
  id: string;
2020
2328
  scope: "member" | "project";
2021
- period: "day" | "lifetime";
2329
+ period: "day" | "lifetime" | "week";
2022
2330
  limit: number;
2023
2331
  cost: number | {
2024
2332
  balance: string;
@@ -2177,6 +2485,11 @@ declare function useRelay(): {
2177
2485
  posts: "after-enrollment" | "since-start";
2178
2486
  historical: "automatic" | "claim" | "staff";
2179
2487
  } | undefined;
2488
+ tracker?: {
2489
+ tracker: string;
2490
+ source: "custom" | "x-search";
2491
+ beneficiary: "author" | "replied-to";
2492
+ } | undefined;
2180
2493
  } | {
2181
2494
  kind: "manual";
2182
2495
  input: "text";
@@ -2216,7 +2529,7 @@ declare function useRelay(): {
2216
2529
  budgets: {
2217
2530
  id: string;
2218
2531
  scope: "member" | "project";
2219
- period: "day" | "lifetime";
2532
+ period: "day" | "lifetime" | "week";
2220
2533
  limit: number;
2221
2534
  cost: number | {
2222
2535
  balance: string;
@@ -2374,6 +2687,11 @@ declare function useRelay(): {
2374
2687
  posts: "after-enrollment" | "since-start";
2375
2688
  historical: "automatic" | "claim" | "staff";
2376
2689
  } | undefined;
2690
+ tracker?: {
2691
+ tracker: string;
2692
+ source: "custom" | "x-search";
2693
+ beneficiary: "author" | "replied-to";
2694
+ } | undefined;
2377
2695
  } | {
2378
2696
  kind: "manual";
2379
2697
  input: "text";
@@ -2413,7 +2731,7 @@ declare function useRelay(): {
2413
2731
  budgets: {
2414
2732
  id: string;
2415
2733
  scope: "member" | "project";
2416
- period: "day" | "lifetime";
2734
+ period: "day" | "lifetime" | "week";
2417
2735
  limit: number;
2418
2736
  cost: number | {
2419
2737
  balance: string;
@@ -2752,6 +3070,11 @@ declare function useRelay(): {
2752
3070
  posts: "after-enrollment" | "since-start";
2753
3071
  historical: "automatic" | "claim" | "staff";
2754
3072
  } | undefined;
3073
+ tracker?: {
3074
+ tracker: string;
3075
+ source: "custom" | "x-search";
3076
+ beneficiary: "author" | "replied-to";
3077
+ } | undefined;
2755
3078
  } | {
2756
3079
  kind: "manual";
2757
3080
  input: "text";
@@ -2791,7 +3114,7 @@ declare function useRelay(): {
2791
3114
  budgets: {
2792
3115
  id: string;
2793
3116
  scope: "member" | "project";
2794
- period: "day" | "lifetime";
3117
+ period: "day" | "lifetime" | "week";
2795
3118
  limit: number;
2796
3119
  cost: number | {
2797
3120
  balance: string;
@@ -2978,6 +3301,11 @@ declare function useRelay(): {
2978
3301
  posts: "after-enrollment" | "since-start";
2979
3302
  historical: "automatic" | "claim" | "staff";
2980
3303
  } | undefined;
3304
+ tracker?: {
3305
+ tracker: string;
3306
+ source: "custom" | "x-search";
3307
+ beneficiary: "author" | "replied-to";
3308
+ } | undefined;
2981
3309
  } | {
2982
3310
  kind: "manual";
2983
3311
  input: "text";
@@ -3017,7 +3345,7 @@ declare function useRelay(): {
3017
3345
  budgets: {
3018
3346
  id: string;
3019
3347
  scope: "member" | "project";
3020
- period: "day" | "lifetime";
3348
+ period: "day" | "lifetime" | "week";
3021
3349
  limit: number;
3022
3350
  cost: number | {
3023
3351
  balance: string;
@@ -3101,6 +3429,11 @@ declare function useRelay(): {
3101
3429
  posts: "after-enrollment" | "since-start";
3102
3430
  historical: "automatic" | "claim" | "staff";
3103
3431
  } | undefined;
3432
+ tracker?: {
3433
+ tracker: string;
3434
+ source: "custom" | "x-search";
3435
+ beneficiary: "author" | "replied-to";
3436
+ } | undefined;
3104
3437
  } | {
3105
3438
  kind: "manual";
3106
3439
  input: "text";
@@ -3646,7 +3979,7 @@ declare function useRelay(): {
3646
3979
  quest: string;
3647
3980
  content: string;
3648
3981
  release: string;
3649
- state: "pending" | "admitted" | "excluded";
3982
+ state: "admitted" | "pending" | "excluded";
3650
3983
  reason: string | null;
3651
3984
  attempt: string | null;
3652
3985
  }[];
@@ -3661,7 +3994,7 @@ declare function useRelay(): {
3661
3994
  quest: string;
3662
3995
  content: string;
3663
3996
  release: string;
3664
- state: "pending" | "admitted" | "excluded";
3997
+ state: "admitted" | "pending" | "excluded";
3665
3998
  reason: string | null;
3666
3999
  attempt: string | null;
3667
4000
  }>;
@@ -3996,6 +4329,11 @@ declare function useQuest(observed: QuestView): {
3996
4329
  posts: "after-enrollment" | "since-start";
3997
4330
  historical: "automatic" | "claim" | "staff";
3998
4331
  } | undefined;
4332
+ tracker?: {
4333
+ tracker: string;
4334
+ source: "custom" | "x-search";
4335
+ beneficiary: "author" | "replied-to";
4336
+ } | undefined;
3999
4337
  } | {
4000
4338
  kind: "manual";
4001
4339
  input: "text";
@@ -4238,10 +4576,24 @@ type OAuthProvider = AuthProvider;
4238
4576
  type SignInMethods = {
4239
4577
  providers: OAuthProvider[];
4240
4578
  email: boolean;
4579
+ /** The wallet networks this project enabled for sign-in in Console. */
4580
+ wallets: WalletSignInNetwork[];
4241
4581
  };
4242
- /** Sign-in methods this project has configured in Console. */
4582
+ /**
4583
+ * The sign-in methods participants can use here: the OAuth providers and email Domino configured
4584
+ * for the platform, and the wallet sign-in this project enabled in Console.
4585
+ */
4243
4586
  declare function useSignInMethods(): SignInMethods | null;
4244
- /** Email codes and OAuth consent always happen in the participant's browser. */
4587
+ /**
4588
+ * The signed-in member and the seed of their generated avatar, or null while signed out or
4589
+ * loading: `<img src={defaultAvatar(me.avatarSeed)} />`. The seed comes from the member's first
4590
+ * linked wallet without revealing it, so it is read again after a wallet is linked in this tab.
4591
+ */
4592
+ declare function useMe(): {
4593
+ member: string;
4594
+ avatarSeed: string;
4595
+ } | null;
4596
+ /** Email codes, OAuth consent and wallet signatures always happen in the participant's browser. */
4245
4597
  declare function useSignIn(): {
4246
4598
  busy: boolean;
4247
4599
  error: string | null;
@@ -4251,6 +4603,8 @@ declare function useSignIn(): {
4251
4603
  verifyCode: (code: string) => Promise<void>;
4252
4604
  startOver: () => void;
4253
4605
  withProvider: (provider: OAuthProvider) => Promise<void>;
4606
+ /** Signs in, or signs up, with a wallet; the wallet asks the participant to sign a message. */
4607
+ withWallet: (signer: WalletSigner) => Promise<void>;
4254
4608
  };
4255
4609
  declare function useSignOut(): {
4256
4610
  busy: boolean;
@@ -4283,6 +4637,137 @@ declare function useAccounts(): {
4283
4637
  disconnect: (provider: AuthProvider) => Promise<void>;
4284
4638
  };
4285
4639
 
4640
+ /**
4641
+ * The signed-in participant's linked Solana, EVM and Cosmos wallets.
4642
+ *
4643
+ * Linking asks the wallet to sign a one-time message. The list is read again
4644
+ * when the window regains focus and after any link or unlink in this tab, so
4645
+ * every component using it stays in step.
4646
+ */
4647
+ declare function useWallets(): {
4648
+ /** Null until read, and while nobody is signed in. */
4649
+ wallets: {
4650
+ chain: "solana" | "eip155" | "cosmos";
4651
+ network: "cosmos:pio-mainnet-1" | "cosmos:pio-testnet-1" | null;
4652
+ address: string;
4653
+ verifiedAt: number;
4654
+ revision: number;
4655
+ signIn: boolean;
4656
+ }[] | null;
4657
+ error: string | null;
4658
+ busy: boolean;
4659
+ refresh: () => Promise<void>;
4660
+ link: (signer: WalletSigner) => Promise<void>;
4661
+ unlink: (wallet: Pick<LinkedWallet, "chain" | "address">) => Promise<void>;
4662
+ };
4663
+ /**
4664
+ * The EVM, Solana and Cosmos wallets installed in this browser. Empty during
4665
+ * SSR and until discovery finishes; `cosmos` defaults to Provenance mainnet.
4666
+ */
4667
+ declare function useWalletDiscovery(options?: {
4668
+ cosmos?: CosmosNetwork[];
4669
+ }): {
4670
+ evm: DiscoveredWallet[];
4671
+ solana: DiscoveredWallet[];
4672
+ cosmos: DiscoveredWallet[];
4673
+ };
4674
+ /** An installed wallet that can sign in on one of the project's enabled networks. */
4675
+ type SignInWallet = DiscoveredWallet & {
4676
+ network: WalletSignInNetwork;
4677
+ };
4678
+ /**
4679
+ * The wallets installed in this browser that can sign in on `networks`, the list
4680
+ * `useSignInMethods().wallets` returns: pass each one's `signer` to
4681
+ * `useSignIn().withWallet`. Null during SSR and until discovery finishes, so a
4682
+ * page can tell "still looking" from "no wallet installed".
4683
+ */
4684
+ declare function useSignInWallets(networks: readonly WalletSignInNetwork[] | null | undefined): SignInWallet[] | null;
4685
+
4686
+ /** Dispatched on `window` after the member changes their profile in this tab. */
4687
+ declare const PROFILE_CHANGED = "relay-profile-changed";
4688
+ /**
4689
+ * The signed-in member's own profile, and changes to it: the name, the avatar (an uploaded
4690
+ * picture, an account's picture or the generated one) and whether others see it.
4691
+ *
4692
+ * Read again when the window regains focus and after any change in this tab, so every component
4693
+ * using it stays in step. Each change is bound to the session it was read with: a session that
4694
+ * changed in between is refused rather than applied to another member.
4695
+ */
4696
+ declare function useMyProfile(): {
4697
+ /** Null until read, and while nobody is signed in. */
4698
+ profile: {
4699
+ id: string;
4700
+ name: string;
4701
+ avatar: {
4702
+ source: "upload";
4703
+ url: string;
4704
+ seed: string;
4705
+ } | {
4706
+ source: "account";
4707
+ provider: "x" | "discord" | "google";
4708
+ url: string;
4709
+ seed: string;
4710
+ } | {
4711
+ source: "generated";
4712
+ seed: string;
4713
+ };
4714
+ displayName: string | null;
4715
+ avatarChoice: "default" | "account" | "generated" | "upload";
4716
+ avatarProvider: "x" | "discord" | "google" | null;
4717
+ hidden: boolean;
4718
+ locked: boolean;
4719
+ visibility: "private" | "participants" | "public";
4720
+ options: {
4721
+ provider: "x" | "discord" | "google";
4722
+ name: string | null;
4723
+ imageUrl: string | null;
4724
+ }[];
4725
+ } | null;
4726
+ error: string | null;
4727
+ busy: boolean;
4728
+ refresh: () => Promise<void>;
4729
+ /** Resolves true once saved; a failure sets `error`. */
4730
+ update: (input: ProfileUpdate) => Promise<boolean>;
4731
+ /** Uploads a JPEG, PNG or WebP of at most 5 MB as the avatar; resolves true once saved. */
4732
+ uploadAvatar: (file: Blob) => Promise<boolean>;
4733
+ };
4734
+ type ProfileState = {
4735
+ status: "loading";
4736
+ } | {
4737
+ status: "error";
4738
+ message: string;
4739
+ }
4740
+ /** Missing, hidden by its member, or not visible to this viewer: indistinguishable on purpose. */
4741
+ | {
4742
+ status: "missing";
4743
+ } | {
4744
+ status: "ready";
4745
+ profile: PublicProfile;
4746
+ stale: string | null;
4747
+ };
4748
+ /**
4749
+ * A profile page by its public ID, read again every `intervalMs` while the page is visible and
4750
+ * when the participant signs in or out.
4751
+ */
4752
+ declare function useProfile(id: string, options?: {
4753
+ intervalMs?: number;
4754
+ }): {
4755
+ refresh: () => Promise<void>;
4756
+ status: "loading";
4757
+ } | {
4758
+ refresh: () => Promise<void>;
4759
+ status: "error";
4760
+ message: string;
4761
+ } | {
4762
+ refresh: () => Promise<void>;
4763
+ status: "missing";
4764
+ } | {
4765
+ refresh: () => Promise<void>;
4766
+ status: "ready";
4767
+ profile: PublicProfile;
4768
+ stale: string | null;
4769
+ };
4770
+
4286
4771
  type ReferralSummary = z.infer<typeof referralSummarySchema>;
4287
4772
  /**
4288
4773
  * Keeps an invitation code from the landing URL (`?ref=CODE` by default)
@@ -4543,4 +5028,4 @@ declare function useTieredRewards(): {
4543
5028
  }[];
4544
5029
  };
4545
5030
 
4546
- export { type Collection, type Experience, type Invitation, type LeaderboardState, type OAuthProvider, PENDING_POLL_MS, type PointLedgersState, type QuestInput, type QuestNotice, type QuestStatus, type QuestTone, RETRY_DELAYS_MS, type ReferencesState, type ReferralSummary, type RelayClient, RelayProvider, type RoleDelivery, type SavedSubmission, type TieredRewardsState, canRepeat, canSubmit, captureReferralCode, completionCountLabel, completionMark, hasPending, isAutomatic, isConnected, isFinished, progressOf, questGroups, questStatus, roleDeliveryLabel, runsSilently, sanitizeDeliveries, useAccounts, useExperience, useInvitation, useLeaderboard, usePointLedgers, useQuest, useReferralSummary, useRelay, useSignIn, useSignInMethods, useSignOut, useTieredRewards, visibleQuests, watchRoleDeliveries };
5031
+ export { type Collection, DiscoveredWallet, type Experience, type Invitation, type LeaderboardState, type OAuthProvider, PENDING_POLL_MS, PROFILE_CHANGED, type PointLedgersState, type ProfileState, type QuestInput, type QuestNotice, type QuestStatus, type QuestTone, RETRY_DELAYS_MS, type ReferencesState, type ReferralSummary, type RelayClient, RelayProvider, type RoleDelivery, type SavedSubmission, type SignInWallet, type TieredRewardsState, canRepeat, canSubmit, captureReferralCode, completionCountLabel, completionMark, hasPending, isAutomatic, isConnected, isFinished, progressOf, questGroups, questStatus, roleDeliveryLabel, runsSilently, sanitizeDeliveries, useAccounts, useExperience, useInvitation, useLeaderboard, useMe, useMyProfile, usePointLedgers, useProfile, useQuest, useReferralSummary, useRelay, useSignIn, useSignInMethods, useSignInWallets, useSignOut, useTieredRewards, useWalletDiscovery, useWallets, visibleQuests, watchRoleDeliveries };