@domino-sdk/relay 0.27.0 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/authoring.d.ts +11 -3
- package/dist/authoring.js +5 -3
- package/dist/browser.d.ts +320 -190
- package/dist/browser.js +12 -6
- package/dist/{chunk-D6AIUNSM.js → chunk-5LLU7UUV.js} +42 -10
- package/dist/{chunk-IXLY3A7B.js → chunk-BE5V6RFD.js} +8 -0
- package/dist/{chunk-M3R5V5WC.js → chunk-LAKQCIHX.js} +6 -1
- package/dist/{chunk-D6BX627V.js → chunk-MRKFRCCI.js} +43 -50
- package/dist/{chunk-RVGO2CRA.js → chunk-MVCKCDNR.js} +175 -2
- package/dist/{chunk-AKB266O5.js → chunk-YKS6P4IP.js} +13 -2
- package/dist/index.d.ts +557 -494
- package/dist/index.js +20 -8
- package/dist/portal-proxy.js +3 -3
- package/dist/react/index.d.ts +243 -58
- package/dist/react/index.js +278 -90
- package/dist/schema.d.ts +27 -1
- package/dist/schema.js +3 -1
- package/dist/{submission-input-CYyH_25w.d.ts → submission-input-C0cOmO4Q.d.ts} +15 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -72,7 +72,7 @@ import {
|
|
|
72
72
|
xPostSchema,
|
|
73
73
|
xProfileSchema,
|
|
74
74
|
xRequestSchema
|
|
75
|
-
} from "./chunk-
|
|
75
|
+
} from "./chunk-5LLU7UUV.js";
|
|
76
76
|
import {
|
|
77
77
|
defineEngagementReward,
|
|
78
78
|
defineLeaderboard,
|
|
@@ -100,6 +100,7 @@ import {
|
|
|
100
100
|
leaderboardExclusionSchema,
|
|
101
101
|
leaderboardGroupSchema,
|
|
102
102
|
leaderboardPageSchema,
|
|
103
|
+
leaderboardPlacementSchema,
|
|
103
104
|
leaderboardPreviewSchema,
|
|
104
105
|
leaderboardQuerySchema,
|
|
105
106
|
leaderboardRowSchema,
|
|
@@ -121,7 +122,7 @@ import {
|
|
|
121
122
|
referralManagementSchema,
|
|
122
123
|
referralRelationshipSchema,
|
|
123
124
|
referralSummarySchema
|
|
124
|
-
} from "./chunk-
|
|
125
|
+
} from "./chunk-YKS6P4IP.js";
|
|
125
126
|
import {
|
|
126
127
|
WALLETS_PER_CHAIN,
|
|
127
128
|
authScopeSchema,
|
|
@@ -156,7 +157,7 @@ import {
|
|
|
156
157
|
walletSignInNetworksSchema,
|
|
157
158
|
walletSignatureSchema,
|
|
158
159
|
walletUnlinkInputSchema
|
|
159
|
-
} from "./chunk-
|
|
160
|
+
} from "./chunk-LAKQCIHX.js";
|
|
160
161
|
import {
|
|
161
162
|
AVATAR_UPLOAD_LIMIT,
|
|
162
163
|
avatarProviderSchema,
|
|
@@ -167,15 +168,19 @@ import {
|
|
|
167
168
|
managedProfileSchema,
|
|
168
169
|
ownProfileSchema,
|
|
169
170
|
profileAvatarSchema,
|
|
171
|
+
profileCompletionPageSchema,
|
|
172
|
+
profileCompletionQuerySchema,
|
|
173
|
+
profileCompletionSchema,
|
|
174
|
+
profileDefaultProviderSchema,
|
|
170
175
|
profileDefaultsSchema,
|
|
171
176
|
profileModerationSchema,
|
|
177
|
+
profileReferralSchema,
|
|
172
178
|
profileSettingsInputSchema,
|
|
173
179
|
profileSettingsSchema,
|
|
174
180
|
profileSummarySchema,
|
|
175
181
|
profileUpdateSchema,
|
|
176
|
-
profileVisibilitySchema
|
|
177
|
-
|
|
178
|
-
} from "./chunk-D6BX627V.js";
|
|
182
|
+
profileVisibilitySchema
|
|
183
|
+
} from "./chunk-MRKFRCCI.js";
|
|
179
184
|
import {
|
|
180
185
|
accountConnectionSchema,
|
|
181
186
|
admittedContentSchema,
|
|
@@ -255,6 +260,7 @@ import {
|
|
|
255
260
|
questAvailabilitySchema,
|
|
256
261
|
questDescriptionSchema,
|
|
257
262
|
questPresentationSchema,
|
|
263
|
+
questProfileSchema,
|
|
258
264
|
questSettingsInputSchema,
|
|
259
265
|
quizAnswersSchema,
|
|
260
266
|
quizChoiceSchema,
|
|
@@ -333,7 +339,7 @@ import {
|
|
|
333
339
|
xContentBodySchema,
|
|
334
340
|
xPostId,
|
|
335
341
|
xTweetSchema
|
|
336
|
-
} from "./chunk-
|
|
342
|
+
} from "./chunk-BE5V6RFD.js";
|
|
337
343
|
export {
|
|
338
344
|
AVATAR_UPLOAD_LIMIT,
|
|
339
345
|
QuestUpdatedError,
|
|
@@ -468,6 +474,7 @@ export {
|
|
|
468
474
|
leaderboardExclusionSchema,
|
|
469
475
|
leaderboardGroupSchema,
|
|
470
476
|
leaderboardPageSchema,
|
|
477
|
+
leaderboardPlacementSchema,
|
|
471
478
|
leaderboardPreviewSchema,
|
|
472
479
|
leaderboardQuerySchema,
|
|
473
480
|
leaderboardRowSchema,
|
|
@@ -510,8 +517,13 @@ export {
|
|
|
510
517
|
prerequisiteSchema,
|
|
511
518
|
principalSchema,
|
|
512
519
|
profileAvatarSchema,
|
|
520
|
+
profileCompletionPageSchema,
|
|
521
|
+
profileCompletionQuerySchema,
|
|
522
|
+
profileCompletionSchema,
|
|
523
|
+
profileDefaultProviderSchema,
|
|
513
524
|
profileDefaultsSchema,
|
|
514
525
|
profileModerationSchema,
|
|
526
|
+
profileReferralSchema,
|
|
515
527
|
profileSettingsInputSchema,
|
|
516
528
|
profileSettingsSchema,
|
|
517
529
|
profileSummarySchema,
|
|
@@ -520,7 +532,6 @@ export {
|
|
|
520
532
|
projectCatalogArtifactSchema,
|
|
521
533
|
projectDeploymentSchema,
|
|
522
534
|
projectIntegrationSchema,
|
|
523
|
-
publicProfileSchema,
|
|
524
535
|
publishDeploymentSchema,
|
|
525
536
|
publishQuestDraftSchema,
|
|
526
537
|
publishedImageSchema,
|
|
@@ -540,6 +551,7 @@ export {
|
|
|
540
551
|
questInstanceSchema,
|
|
541
552
|
questInteraction,
|
|
542
553
|
questPresentationSchema,
|
|
554
|
+
questProfileSchema,
|
|
543
555
|
questPublicationPreviewSchema,
|
|
544
556
|
questRewardViewSchema,
|
|
545
557
|
questSettingsInputSchema,
|
package/dist/portal-proxy.js
CHANGED
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
exchangeResultSchema,
|
|
3
3
|
isWalletParticipantRoute,
|
|
4
4
|
isWalletSignInRoute
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-LAKQCIHX.js";
|
|
6
6
|
import {
|
|
7
7
|
isProfileParticipantRoute
|
|
8
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-MRKFRCCI.js";
|
|
9
9
|
import {
|
|
10
10
|
isContentParticipantRoute
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-BE5V6RFD.js";
|
|
12
12
|
|
|
13
13
|
// src/portal-proxy.ts
|
|
14
14
|
async function proxyParticipant(request, upstream) {
|
package/dist/react/index.d.ts
CHANGED
|
@@ -2,11 +2,12 @@ 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 { ProfileUpdate, QuestView, QuestController, ProgressObservation, questExperienceSchema, ProgressObserver, ExchangeInput, PhotoSubmission, QuizSubmission, ClaimSubmission, ValueSubmission, SubmissionDraft,
|
|
5
|
+
import { ProfileUpdate, ProfileCompletionQuery, QuestView, QuestController, ProgressObservation, questExperienceSchema, ProgressObserver, ExchangeInput, PhotoSubmission, QuizSubmission, ClaimSubmission, ValueSubmission, SubmissionDraft, ProfileCompletion, ProfileSummary, PointLedgerReference } from '../index.js';
|
|
6
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
|
|
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 AccountConnection, a2 as WalletSignInNetwork, a3 as referralSummarySchema, a4 as LeaderboardPage } from '../submission-input-C0cOmO4Q.js';
|
|
8
8
|
import { SubmitInput, ReleaseInput, beginHandoverSchema, contentPerformanceQuerySchema, TieredRewardReference } from '../schema.js';
|
|
9
|
-
import { createBrowserRelayClient, DiscoveredWallet } from '../browser.js';
|
|
9
|
+
import { createBrowserRelayClient, SignInMethods, CosmosChains, SignInOption, SignInUnavailable, SignInWallet, DiscoveredWallet } from '../browser.js';
|
|
10
|
+
export { EmailSignInOption, OAuthSignInOption, SignInIcon, WalletSignInOption } from '../browser.js';
|
|
10
11
|
|
|
11
12
|
type RelayClient = ReturnType<typeof createBrowserRelayClient>;
|
|
12
13
|
/** The participant client, for calls no hook covers. */
|
|
@@ -384,6 +385,15 @@ declare function useRelay(): {
|
|
|
384
385
|
}[];
|
|
385
386
|
nextCursor: string | null;
|
|
386
387
|
}>;
|
|
388
|
+
placement: (board: string, profile: string) => Promise<{
|
|
389
|
+
leaderboard: string;
|
|
390
|
+
title: string;
|
|
391
|
+
profile: string;
|
|
392
|
+
rank: number | null;
|
|
393
|
+
score: number | null;
|
|
394
|
+
total: number;
|
|
395
|
+
key?: string | undefined;
|
|
396
|
+
}>;
|
|
387
397
|
};
|
|
388
398
|
profiles: {
|
|
389
399
|
mine: () => Promise<{
|
|
@@ -403,7 +413,7 @@ declare function useRelay(): {
|
|
|
403
413
|
seed: string;
|
|
404
414
|
};
|
|
405
415
|
displayName: string | null;
|
|
406
|
-
avatarChoice: "default" | "account" | "
|
|
416
|
+
avatarChoice: "default" | "account" | "upload" | "generated";
|
|
407
417
|
avatarProvider: "x" | "discord" | "google" | null;
|
|
408
418
|
hidden: boolean;
|
|
409
419
|
locked: boolean;
|
|
@@ -433,7 +443,7 @@ declare function useRelay(): {
|
|
|
433
443
|
seed: string;
|
|
434
444
|
};
|
|
435
445
|
displayName: string | null;
|
|
436
|
-
avatarChoice: "default" | "account" | "
|
|
446
|
+
avatarChoice: "default" | "account" | "upload" | "generated";
|
|
437
447
|
avatarProvider: "x" | "discord" | "google" | null;
|
|
438
448
|
hidden: boolean;
|
|
439
449
|
locked: boolean;
|
|
@@ -464,7 +474,7 @@ declare function useRelay(): {
|
|
|
464
474
|
seed: string;
|
|
465
475
|
};
|
|
466
476
|
displayName: string | null;
|
|
467
|
-
avatarChoice: "default" | "account" | "
|
|
477
|
+
avatarChoice: "default" | "account" | "upload" | "generated";
|
|
468
478
|
avatarProvider: "x" | "discord" | "google" | null;
|
|
469
479
|
hidden: boolean;
|
|
470
480
|
locked: boolean;
|
|
@@ -491,36 +501,28 @@ declare function useRelay(): {
|
|
|
491
501
|
source: "generated";
|
|
492
502
|
seed: string;
|
|
493
503
|
};
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
title: string;
|
|
498
|
-
rank: number;
|
|
499
|
-
score: number;
|
|
500
|
-
total: number;
|
|
501
|
-
key?: string | undefined;
|
|
502
|
-
}[] | null;
|
|
503
|
-
quests: {
|
|
504
|
+
}>;
|
|
505
|
+
completions: (profile: string, options?: ProfileCompletionQuery) => Promise<{
|
|
506
|
+
items: {
|
|
504
507
|
quest: string;
|
|
505
508
|
title: string;
|
|
506
509
|
completions: number;
|
|
507
510
|
lastCompletedAt: number | null;
|
|
508
511
|
key?: string | undefined;
|
|
509
|
-
}[]
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
} | null;
|
|
512
|
+
}[];
|
|
513
|
+
nextCursor: string | null;
|
|
514
|
+
}>;
|
|
515
|
+
referral: (profile: string, program: string) => Promise<{
|
|
516
|
+
program: string;
|
|
517
|
+
title: string;
|
|
518
|
+
invited: number;
|
|
519
|
+
qualified: number;
|
|
520
|
+
milestones: {
|
|
521
|
+
id: string;
|
|
522
|
+
count: number;
|
|
523
|
+
reached: boolean;
|
|
524
|
+
}[];
|
|
525
|
+
key?: string | undefined;
|
|
524
526
|
}>;
|
|
525
527
|
};
|
|
526
528
|
quests: {
|
|
@@ -2336,6 +2338,9 @@ declare function useRelay(): {
|
|
|
2336
2338
|
metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
|
|
2337
2339
|
maxAgeMs: number;
|
|
2338
2340
|
} | undefined;
|
|
2341
|
+
profile?: {
|
|
2342
|
+
visible: boolean;
|
|
2343
|
+
} | undefined;
|
|
2339
2344
|
};
|
|
2340
2345
|
}[]>;
|
|
2341
2346
|
template: () => Promise<{
|
|
@@ -2539,6 +2544,9 @@ declare function useRelay(): {
|
|
|
2539
2544
|
metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
|
|
2540
2545
|
maxAgeMs: number;
|
|
2541
2546
|
} | undefined;
|
|
2547
|
+
profile?: {
|
|
2548
|
+
visible: boolean;
|
|
2549
|
+
} | undefined;
|
|
2542
2550
|
};
|
|
2543
2551
|
}>;
|
|
2544
2552
|
snapshot: () => Promise<{
|
|
@@ -2747,6 +2755,9 @@ declare function useRelay(): {
|
|
|
2747
2755
|
metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
|
|
2748
2756
|
maxAgeMs: number;
|
|
2749
2757
|
} | undefined;
|
|
2758
|
+
profile?: {
|
|
2759
|
+
visible: boolean;
|
|
2760
|
+
} | undefined;
|
|
2750
2761
|
key?: string | undefined;
|
|
2751
2762
|
origin?: {
|
|
2752
2763
|
typeVersion: string;
|
|
@@ -3130,6 +3141,9 @@ declare function useRelay(): {
|
|
|
3130
3141
|
metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
|
|
3131
3142
|
maxAgeMs: number;
|
|
3132
3143
|
} | undefined;
|
|
3144
|
+
profile?: {
|
|
3145
|
+
visible: boolean;
|
|
3146
|
+
} | undefined;
|
|
3133
3147
|
key?: string | undefined;
|
|
3134
3148
|
origin?: {
|
|
3135
3149
|
typeVersion: string;
|
|
@@ -3361,6 +3375,9 @@ declare function useRelay(): {
|
|
|
3361
3375
|
metrics: ("likes" | "replies" | "reposts" | "quotes" | "views" | "bookmarks")[];
|
|
3362
3376
|
maxAgeMs: number;
|
|
3363
3377
|
} | undefined;
|
|
3378
|
+
profile?: {
|
|
3379
|
+
visible: boolean;
|
|
3380
|
+
} | undefined;
|
|
3364
3381
|
key?: string | undefined;
|
|
3365
3382
|
origin?: {
|
|
3366
3383
|
typeVersion: string;
|
|
@@ -4573,12 +4590,6 @@ declare function progressOf(quests: QuestView[]): {
|
|
|
4573
4590
|
};
|
|
4574
4591
|
|
|
4575
4592
|
type OAuthProvider = AuthProvider;
|
|
4576
|
-
type SignInMethods = {
|
|
4577
|
-
providers: OAuthProvider[];
|
|
4578
|
-
email: boolean;
|
|
4579
|
-
/** The wallet networks this project enabled for sign-in in Console. */
|
|
4580
|
-
wallets: WalletSignInNetwork[];
|
|
4581
|
-
};
|
|
4582
4593
|
/**
|
|
4583
4594
|
* The sign-in methods participants can use here: the OAuth providers and email Domino configured
|
|
4584
4595
|
* for the platform, and the wallet sign-in this project enabled in Console.
|
|
@@ -4586,14 +4597,17 @@ type SignInMethods = {
|
|
|
4586
4597
|
declare function useSignInMethods(): SignInMethods | null;
|
|
4587
4598
|
/**
|
|
4588
4599
|
* 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
|
|
4590
|
-
*
|
|
4600
|
+
* loading: `<img src={defaultAvatar(me.avatarSeed)} />`. The seed is derived from the member and
|
|
4601
|
+
* reveals nothing about them; linking wallets or accounts does not change it.
|
|
4591
4602
|
*/
|
|
4592
4603
|
declare function useMe(): {
|
|
4593
4604
|
member: string;
|
|
4594
4605
|
avatarSeed: string;
|
|
4595
4606
|
} | null;
|
|
4596
|
-
/**
|
|
4607
|
+
/**
|
|
4608
|
+
* Email codes, OAuth consent and wallet signatures always happen in the participant's browser.
|
|
4609
|
+
* The actions keep their identity across renders, and never reject: a failure lands in `error`.
|
|
4610
|
+
*/
|
|
4597
4611
|
declare function useSignIn(): {
|
|
4598
4612
|
busy: boolean;
|
|
4599
4613
|
error: string | null;
|
|
@@ -4610,6 +4624,37 @@ declare function useSignOut(): {
|
|
|
4610
4624
|
busy: boolean;
|
|
4611
4625
|
signOut: () => Promise<void>;
|
|
4612
4626
|
};
|
|
4627
|
+
/**
|
|
4628
|
+
* Every way a participant can sign in here, as one flat list: the OAuth providers and email Domino
|
|
4629
|
+
* configured for the platform, and the installed wallets of the families this project enabled.
|
|
4630
|
+
* Each option has an `id`, a `label` ("Google", "Email", "Phantom"), a `kind` and an `icon` hint;
|
|
4631
|
+
* OAuth and wallet options sign in with `start()`, the email option with `sendCode(email)` then
|
|
4632
|
+
* `verifyCode(code)`. The options keep their identity across renders until the methods, the
|
|
4633
|
+
* installed wallets or the chains change, and their actions never reject: a failure lands in
|
|
4634
|
+
* `error`.
|
|
4635
|
+
*
|
|
4636
|
+
* Cosmos wallets sign in on the app's chains, so pass them in `cosmos`. Without them Cosmos wallets
|
|
4637
|
+
* are not offered, and `unavailable` holds `cosmos-chains-missing`; with an invalid one, such as
|
|
4638
|
+
* `"cosmoshub-4"` without `cosmos:`, it holds `cosmos-chains-invalid`. When the project takes
|
|
4639
|
+
* wallets but none is installed, `unavailable` holds `no-wallet-installed` with a message for the
|
|
4640
|
+
* participant. `options` is null until the methods are read. OAuth and email are offered at once;
|
|
4641
|
+
* installed wallets join them when discovery finishes, and a project that takes only wallets stays
|
|
4642
|
+
* null until then.
|
|
4643
|
+
*/
|
|
4644
|
+
declare function useSignInOptions(input?: {
|
|
4645
|
+
cosmos?: CosmosChains;
|
|
4646
|
+
}): {
|
|
4647
|
+
options: SignInOption[] | null;
|
|
4648
|
+
unavailable: SignInUnavailable[];
|
|
4649
|
+
/** Why the project's methods could not be read; the options are then email alone. */
|
|
4650
|
+
methodsError: string | null;
|
|
4651
|
+
busy: boolean;
|
|
4652
|
+
error: string | null;
|
|
4653
|
+
/** True once an email code was sent and the form should ask for it. */
|
|
4654
|
+
codeSent: boolean;
|
|
4655
|
+
/** Forgets the email code sent, to use another address. */
|
|
4656
|
+
startOver(): void;
|
|
4657
|
+
};
|
|
4613
4658
|
|
|
4614
4659
|
/** True when the account can be used to verify quests right now. */
|
|
4615
4660
|
declare function isConnected(accounts: AccountConnection[] | null, provider: AuthProvider): boolean;
|
|
@@ -4660,11 +4705,6 @@ declare function useWallets(): {
|
|
|
4660
4705
|
link: (signer: WalletSigner) => Promise<void>;
|
|
4661
4706
|
unlink: (wallet: Pick<LinkedWallet, "chain" | "address">) => Promise<void>;
|
|
4662
4707
|
};
|
|
4663
|
-
/**
|
|
4664
|
-
* The Cosmos SDK chains an app offers wallets on: one chain or several, each as
|
|
4665
|
-
* `{ chainId, chainInfo? }` or `"cosmos:<chain ID>"`. Relay has no chain list of its own.
|
|
4666
|
-
*/
|
|
4667
|
-
type CosmosChains = CosmosChain | CosmosNetwork | readonly (CosmosChain | CosmosNetwork)[];
|
|
4668
4708
|
/**
|
|
4669
4709
|
* The EVM, Solana and Cosmos wallets installed in this browser. Empty during
|
|
4670
4710
|
* SSR and until discovery finishes. Cosmos wallets are listed once per chain
|
|
@@ -4677,17 +4717,15 @@ declare function useWalletDiscovery(options?: {
|
|
|
4677
4717
|
solana: DiscoveredWallet[];
|
|
4678
4718
|
cosmos: DiscoveredWallet[];
|
|
4679
4719
|
};
|
|
4680
|
-
/** An installed wallet that can sign in on one of the project's enabled wallet families. */
|
|
4681
|
-
type SignInWallet = DiscoveredWallet & {
|
|
4682
|
-
network: WalletSignInNetwork;
|
|
4683
|
-
};
|
|
4684
4720
|
/**
|
|
4685
4721
|
* The wallets installed in this browser that can sign in with the families in
|
|
4686
4722
|
* `networks`, the list `useSignInMethods().wallets` returns: pass each one's
|
|
4687
4723
|
* `signer` to `useSignIn().withWallet`. Cosmos wallets need the app's chains in
|
|
4688
|
-
* `options.cosmos`; each is listed once per chain
|
|
4689
|
-
*
|
|
4690
|
-
*
|
|
4724
|
+
* `options.cosmos`; each is listed once per chain, and none when a chain is
|
|
4725
|
+
* invalid (`useSignInOptions()` reports it as `cosmos-chains-invalid`). Null
|
|
4726
|
+
* during SSR and until discovery finishes, so a page can tell "still looking"
|
|
4727
|
+
* from "no wallet installed". `useSignInOptions()` combines this with the other
|
|
4728
|
+
* methods.
|
|
4691
4729
|
*/
|
|
4692
4730
|
declare function useSignInWallets(networks: readonly WalletSignInNetwork[] | null | undefined, options?: {
|
|
4693
4731
|
cosmos?: CosmosChains;
|
|
@@ -4722,7 +4760,7 @@ declare function useMyProfile(): {
|
|
|
4722
4760
|
seed: string;
|
|
4723
4761
|
};
|
|
4724
4762
|
displayName: string | null;
|
|
4725
|
-
avatarChoice: "default" | "account" | "
|
|
4763
|
+
avatarChoice: "default" | "account" | "upload" | "generated";
|
|
4726
4764
|
avatarProvider: "x" | "discord" | "google" | null;
|
|
4727
4765
|
hidden: boolean;
|
|
4728
4766
|
locked: boolean;
|
|
@@ -4741,6 +4779,22 @@ declare function useMyProfile(): {
|
|
|
4741
4779
|
/** Uploads a JPEG, PNG or WebP of at most 5 MB as the avatar; resolves true once saved. */
|
|
4742
4780
|
uploadAvatar: (file: Blob) => Promise<boolean>;
|
|
4743
4781
|
};
|
|
4782
|
+
/**
|
|
4783
|
+
* A read keyed by a profile. `missing` is the uniform 404: a profile (or board, or program) that
|
|
4784
|
+
* is missing, hidden by its member, or not visible to this viewer, on purpose indistinguishable.
|
|
4785
|
+
*/
|
|
4786
|
+
type ProfileReadState<T> = {
|
|
4787
|
+
status: "loading";
|
|
4788
|
+
} | {
|
|
4789
|
+
status: "error";
|
|
4790
|
+
message: string;
|
|
4791
|
+
} | {
|
|
4792
|
+
status: "missing";
|
|
4793
|
+
} | {
|
|
4794
|
+
status: "ready";
|
|
4795
|
+
value: T;
|
|
4796
|
+
stale: string | null;
|
|
4797
|
+
};
|
|
4744
4798
|
type ProfileState = {
|
|
4745
4799
|
status: "loading";
|
|
4746
4800
|
} | {
|
|
@@ -4752,12 +4806,13 @@ type ProfileState = {
|
|
|
4752
4806
|
status: "missing";
|
|
4753
4807
|
} | {
|
|
4754
4808
|
status: "ready";
|
|
4755
|
-
profile:
|
|
4809
|
+
profile: ProfileSummary;
|
|
4756
4810
|
stale: string | null;
|
|
4757
4811
|
};
|
|
4758
4812
|
/**
|
|
4759
|
-
* A profile
|
|
4760
|
-
* when the participant signs in
|
|
4813
|
+
* A profile's name and avatar by its public ID (`relay.profiles.get`), read again every
|
|
4814
|
+
* `intervalMs` (default 60 seconds) while the page is visible and when the participant signs in
|
|
4815
|
+
* or out.
|
|
4761
4816
|
*/
|
|
4762
4817
|
declare function useProfile(id: string, options?: {
|
|
4763
4818
|
intervalMs?: number;
|
|
@@ -4774,9 +4829,139 @@ declare function useProfile(id: string, options?: {
|
|
|
4774
4829
|
} | {
|
|
4775
4830
|
refresh: () => Promise<void>;
|
|
4776
4831
|
status: "ready";
|
|
4777
|
-
profile:
|
|
4832
|
+
profile: ProfileSummary;
|
|
4833
|
+
stale: string | null;
|
|
4834
|
+
};
|
|
4835
|
+
/**
|
|
4836
|
+
* A profile's current rank and score on one board (`relay.leaderboards.placement`), read again
|
|
4837
|
+
* every `intervalMs` (default 30 seconds) while the page is visible. Signed-out visitors get an
|
|
4838
|
+
* error for boards without public access.
|
|
4839
|
+
*/
|
|
4840
|
+
declare function useLeaderboardPlacement(board: string, profile: string, options?: {
|
|
4841
|
+
intervalMs?: number;
|
|
4842
|
+
}): {
|
|
4843
|
+
refresh: () => Promise<void>;
|
|
4844
|
+
status: "loading";
|
|
4845
|
+
} | {
|
|
4846
|
+
refresh: () => Promise<void>;
|
|
4847
|
+
status: "error";
|
|
4848
|
+
message: string;
|
|
4849
|
+
} | {
|
|
4850
|
+
refresh: () => Promise<void>;
|
|
4851
|
+
status: "missing";
|
|
4852
|
+
} | {
|
|
4853
|
+
refresh: () => Promise<void>;
|
|
4854
|
+
status: "ready";
|
|
4855
|
+
value: {
|
|
4856
|
+
leaderboard: string;
|
|
4857
|
+
title: string;
|
|
4858
|
+
profile: string;
|
|
4859
|
+
rank: number | null;
|
|
4860
|
+
score: number | null;
|
|
4861
|
+
total: number;
|
|
4862
|
+
key?: string | undefined;
|
|
4863
|
+
};
|
|
4864
|
+
stale: string | null;
|
|
4865
|
+
};
|
|
4866
|
+
/**
|
|
4867
|
+
* A profile's progress in one referral program (`relay.profiles.referral`), read again every
|
|
4868
|
+
* `intervalMs` (default 60 seconds) while the page is visible. Needs a signed-in participant.
|
|
4869
|
+
*/
|
|
4870
|
+
declare function useProfileReferral(profile: string, program: string, options?: {
|
|
4871
|
+
intervalMs?: number;
|
|
4872
|
+
}): {
|
|
4873
|
+
refresh: () => Promise<void>;
|
|
4874
|
+
status: "loading";
|
|
4875
|
+
} | {
|
|
4876
|
+
refresh: () => Promise<void>;
|
|
4877
|
+
status: "error";
|
|
4878
|
+
message: string;
|
|
4879
|
+
} | {
|
|
4880
|
+
refresh: () => Promise<void>;
|
|
4881
|
+
status: "missing";
|
|
4882
|
+
} | {
|
|
4883
|
+
refresh: () => Promise<void>;
|
|
4884
|
+
status: "ready";
|
|
4885
|
+
value: {
|
|
4886
|
+
program: string;
|
|
4887
|
+
title: string;
|
|
4888
|
+
invited: number;
|
|
4889
|
+
qualified: number;
|
|
4890
|
+
milestones: {
|
|
4891
|
+
id: string;
|
|
4892
|
+
count: number;
|
|
4893
|
+
reached: boolean;
|
|
4894
|
+
}[];
|
|
4895
|
+
key?: string | undefined;
|
|
4896
|
+
};
|
|
4778
4897
|
stale: string | null;
|
|
4779
4898
|
};
|
|
4899
|
+
type ProfileCompletionsState = {
|
|
4900
|
+
status: "loading";
|
|
4901
|
+
} | {
|
|
4902
|
+
status: "error";
|
|
4903
|
+
message: string;
|
|
4904
|
+
} | {
|
|
4905
|
+
status: "missing";
|
|
4906
|
+
} | {
|
|
4907
|
+
status: "ready";
|
|
4908
|
+
items: ProfileCompletion[];
|
|
4909
|
+
/** More completions to load with `loadMore()`. */
|
|
4910
|
+
more: boolean;
|
|
4911
|
+
/** Loading the next page. */
|
|
4912
|
+
loading: boolean;
|
|
4913
|
+
/** Why the last `loadMore()` failed, until the next succeeds. */
|
|
4914
|
+
error: string | null;
|
|
4915
|
+
};
|
|
4916
|
+
/**
|
|
4917
|
+
* A profile's completions of quests that show on profiles (`relay.profiles.completions`), most
|
|
4918
|
+
* recently completed first, `limit` quests at a time. `loadMore()` appends the next page;
|
|
4919
|
+
* `refresh()` starts again from the first, as signing in or out and a profile change in this tab
|
|
4920
|
+
* do.
|
|
4921
|
+
*/
|
|
4922
|
+
declare function useProfileCompletions(profile: string, options?: {
|
|
4923
|
+
limit?: number;
|
|
4924
|
+
}): {
|
|
4925
|
+
refresh: () => Promise<void>;
|
|
4926
|
+
/**
|
|
4927
|
+
* Appends the next page; does nothing while one loads, while the first page reloads, or when
|
|
4928
|
+
* there is none.
|
|
4929
|
+
*/
|
|
4930
|
+
loadMore: () => Promise<void>;
|
|
4931
|
+
status: "loading";
|
|
4932
|
+
} | {
|
|
4933
|
+
refresh: () => Promise<void>;
|
|
4934
|
+
/**
|
|
4935
|
+
* Appends the next page; does nothing while one loads, while the first page reloads, or when
|
|
4936
|
+
* there is none.
|
|
4937
|
+
*/
|
|
4938
|
+
loadMore: () => Promise<void>;
|
|
4939
|
+
status: "error";
|
|
4940
|
+
message: string;
|
|
4941
|
+
} | {
|
|
4942
|
+
refresh: () => Promise<void>;
|
|
4943
|
+
/**
|
|
4944
|
+
* Appends the next page; does nothing while one loads, while the first page reloads, or when
|
|
4945
|
+
* there is none.
|
|
4946
|
+
*/
|
|
4947
|
+
loadMore: () => Promise<void>;
|
|
4948
|
+
status: "missing";
|
|
4949
|
+
} | {
|
|
4950
|
+
refresh: () => Promise<void>;
|
|
4951
|
+
/**
|
|
4952
|
+
* Appends the next page; does nothing while one loads, while the first page reloads, or when
|
|
4953
|
+
* there is none.
|
|
4954
|
+
*/
|
|
4955
|
+
loadMore: () => Promise<void>;
|
|
4956
|
+
status: "ready";
|
|
4957
|
+
items: ProfileCompletion[];
|
|
4958
|
+
/** More completions to load with `loadMore()`. */
|
|
4959
|
+
more: boolean;
|
|
4960
|
+
/** Loading the next page. */
|
|
4961
|
+
loading: boolean;
|
|
4962
|
+
/** Why the last `loadMore()` failed, until the next succeeds. */
|
|
4963
|
+
error: string | null;
|
|
4964
|
+
};
|
|
4780
4965
|
|
|
4781
4966
|
type ReferralSummary = z.infer<typeof referralSummarySchema>;
|
|
4782
4967
|
/**
|
|
@@ -5038,4 +5223,4 @@ declare function useTieredRewards(): {
|
|
|
5038
5223
|
}[];
|
|
5039
5224
|
};
|
|
5040
5225
|
|
|
5041
|
-
export { type Collection,
|
|
5226
|
+
export { type Collection, CosmosChains, DiscoveredWallet, type Experience, type Invitation, type LeaderboardState, type OAuthProvider, PENDING_POLL_MS, PROFILE_CHANGED, type PointLedgersState, type ProfileCompletionsState, type ProfileReadState, type ProfileState, type QuestInput, type QuestNotice, type QuestStatus, type QuestTone, RETRY_DELAYS_MS, type ReferencesState, type ReferralSummary, type RelayClient, RelayProvider, type RoleDelivery, type SavedSubmission, SignInMethods, SignInOption, SignInUnavailable, SignInWallet, type TieredRewardsState, canRepeat, canSubmit, captureReferralCode, completionCountLabel, completionMark, hasPending, isAutomatic, isConnected, isFinished, progressOf, questGroups, questStatus, roleDeliveryLabel, runsSilently, sanitizeDeliveries, useAccounts, useExperience, useInvitation, useLeaderboard, useLeaderboardPlacement, useMe, useMyProfile, usePointLedgers, useProfile, useProfileCompletions, useProfileReferral, useQuest, useReferralSummary, useRelay, useSignIn, useSignInMethods, useSignInOptions, useSignInWallets, useSignOut, useTieredRewards, useWalletDiscovery, useWallets, visibleQuests, watchRoleDeliveries };
|