@domino-sdk/relay 1.0.0-next.9 → 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 +1027 -233
  4. package/dist/authoring.js +478 -277
  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 -2613
  9. package/dist/browser.js +8 -6
  10. package/dist/{integrations-Ba5TtqTv.d.ts → capability-error-DNMwKmlL.d.ts} +124 -76
  11. package/dist/{chunk-PHU5VDLR.js → chunk-36HTX2BM.js} +389 -169
  12. package/dist/chunk-6QJ3LADK.js +112 -0
  13. package/dist/{chunk-4LBUTHD6.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-X2F2RAR3.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-7Q4BGGT6.js → chunk-XFMSUPNS.js} +1 -1
  24. package/dist/{chunk-P6FK43GG.js → chunk-ZVIRG24J.js} +145 -42
  25. package/dist/{client-CT4-S5vc.d.ts → client-XiuFnug_.d.ts} +2161 -615
  26. package/dist/{submission-input-0OOGaq8c.d.ts → groups-Ck-OxzjD.d.ts} +916 -1139
  27. package/dist/identity-integration-GxAHdKR2.d.ts +58 -0
  28. package/dist/images-Dv-P5VBw.d.ts +234 -0
  29. package/dist/index.d.ts +13 -9
  30. package/dist/index.js +17 -6
  31. package/dist/internal.d.ts +82 -44
  32. package/dist/internal.js +43 -89
  33. package/dist/offers-Cy-e4o5x.d.ts +431 -0
  34. package/dist/{pages-D3titw5B.d.ts → outcomes-kVB-Juzs.d.ts} +2157 -1448
  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 +3038 -1029
  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 -4168
  44. package/dist/schema.js +310 -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-QR7ZA2BJ.js +0 -257
  54. package/dist/chunk-YYD4QUBO.js +0 -2348
  55. package/dist/chunk-ZWY3R6B3.js +0 -26
  56. package/dist/collection-BGneJ6Bk.d.ts +0 -114
  57. package/dist/images-BTgk6OmC.d.ts +0 -1564
  58. package/dist/point-ledgers-iS00Z_v0.d.ts +0 -37
  59. package/dist/schema-Di3aLSiK.d.ts +0 -3532
@@ -31,12 +31,10 @@ declare const quizContentSchema: z.ZodArray<z.ZodObject<{
31
31
  }, z.core.$strict>>;
32
32
  type QuizContent = z.infer<typeof quizContentSchema>;
33
33
 
34
- declare const communityTimeZoneSchema: z.ZodString;
35
34
  declare const streakPolicySchema: z.ZodObject<{
36
35
  kind: z.ZodLiteral<"streak">;
37
36
  days: z.ZodNumber;
38
- timeZone: z.ZodString;
39
- }, z.core.$strict>;
37
+ }, z.core.$strip>;
40
38
  type StreakPolicy = z.infer<typeof streakPolicySchema>;
41
39
  declare const streakProgressSchema: z.ZodObject<{
42
40
  goal: z.ZodNumber;
@@ -70,4 +68,4 @@ declare const streakProgressSchema: z.ZodObject<{
70
68
  }, z.core.$strip>;
71
69
  type StreakProgress = z.infer<typeof streakProgressSchema>;
72
70
 
73
- export { type QuizContent as Q, type StreakProgress as S, type StreakPolicy as a, quizContentSchema as b, communityTimeZoneSchema as c, quizQuestionSchema as d, quizQuestionsSchema as e, streakProgressSchema as f, quizChoiceSchema as q, streakPolicySchema as s };
71
+ export { type QuizContent as Q, type StreakProgress as S, type StreakPolicy as a, quizContentSchema as b, quizQuestionSchema as c, quizQuestionsSchema as d, streakProgressSchema as e, quizChoiceSchema as q, streakPolicySchema as s };
@@ -0,0 +1,290 @@
1
+ import { z } from 'zod';
2
+ import { cH as LedgerReference, cG as QuestHandle } from './schema-DfJzH2ci.js';
3
+ import { p as ProjectGroupReference } from './groups-Ck-OxzjD.js';
4
+
5
+ /** A Discord message as `ctx.discord.message()` reads it, from the project's Discord server. */
6
+ declare const discordMessageSchema: z.ZodObject<{
7
+ guildId: z.ZodString;
8
+ channelId: z.ZodString;
9
+ messageId: z.ZodString;
10
+ userId: z.ZodString;
11
+ content: z.ZodNullable<z.ZodString>;
12
+ replyTo: z.ZodNullable<z.ZodString>;
13
+ publishedAt: z.ZodNumber;
14
+ }, z.core.$strict>;
15
+ type DiscordMessage = z.infer<typeof discordMessageSchema>;
16
+ /**
17
+ * Messages posted in the project's Discord server, written by the Discord gateway. The record's
18
+ * `author` is the message author's Discord account. Message text is stored only with `text: true`.
19
+ * Edits update stored text. Deleting a message, or turning text off, removes retained text.
20
+ */
21
+ declare const discordMessagesSourceSchema: z.ZodObject<{
22
+ kind: z.ZodLiteral<"discord-messages">;
23
+ /** Store each message's text in `data.text`. Off unless set. */
24
+ text: z.ZodOptional<z.ZodBoolean>;
25
+ }, z.core.$strict>;
26
+ /**
27
+ * Reactions added in the project's Discord server, written by the Discord gateway. The record's
28
+ * `author` is the reactor's Discord account and its `messageAuthor` account is the message's
29
+ * author, when Discord could name it.
30
+ */
31
+ declare const discordReactionsSourceSchema: z.ZodObject<{
32
+ kind: z.ZodLiteral<"discord-reactions">;
33
+ }, z.core.$strict>;
34
+ /** The `data` of a `discord.messages()` record. IDs are Discord snowflakes. */
35
+ declare const discordMessageDataSchema: z.ZodObject<{
36
+ guildId: z.ZodString;
37
+ channelId: z.ZodString;
38
+ messageId: z.ZodString;
39
+ replyTo: z.ZodNullable<z.ZodString>;
40
+ publishedAt: z.ZodNumber;
41
+ }, z.core.$strip>;
42
+ type DiscordMessageData = z.infer<typeof discordMessageDataSchema>;
43
+ /**
44
+ * The `data` of a `discord.messages({ text: true })` record. `text` is null when the platform's
45
+ * bot does not receive message content.
46
+ */
47
+ declare const discordMessageTextDataSchema: z.ZodObject<{
48
+ guildId: z.ZodString;
49
+ channelId: z.ZodString;
50
+ messageId: z.ZodString;
51
+ replyTo: z.ZodNullable<z.ZodString>;
52
+ publishedAt: z.ZodNumber;
53
+ text: z.ZodNullable<z.ZodString>;
54
+ }, z.core.$strip>;
55
+ type DiscordMessageTextData = z.infer<typeof discordMessageTextDataSchema>;
56
+ /** The `data` of a `discord.reactions()` record. IDs are Discord snowflakes. */
57
+ declare const discordReactionDataSchema: z.ZodObject<{
58
+ guildId: z.ZodString;
59
+ channelId: z.ZodString;
60
+ messageId: z.ZodString;
61
+ emoji: z.ZodObject<{
62
+ id: z.ZodNullable<z.ZodString>;
63
+ name: z.ZodString;
64
+ }, z.core.$strip>;
65
+ reactorRoles: z.ZodArray<z.ZodString>;
66
+ messagePublishedAt: z.ZodNumber;
67
+ }, z.core.$strip>;
68
+ type DiscordReactionData = z.infer<typeof discordReactionDataSchema>;
69
+ /** Rewards and resource selectors supported by the Discord integration. */
70
+ declare const discordRewardSchema: z.ZodObject<{
71
+ kind: z.ZodLiteral<"integration">;
72
+ provider: z.ZodLiteral<"discord">;
73
+ action: z.ZodLiteral<"grant-role">;
74
+ roleId: z.ZodString;
75
+ }, z.core.$strict>;
76
+ declare const discordResourceSourceSchema: z.ZodUnion<readonly [z.ZodObject<{
77
+ provider: z.ZodLiteral<"discord">;
78
+ resource: z.ZodLiteral<"channel">;
79
+ types: z.ZodArray<z.ZodEnum<{
80
+ text: "text";
81
+ announcement: "announcement";
82
+ }>>;
83
+ }, z.core.$strict>, z.ZodObject<{
84
+ provider: z.ZodLiteral<"discord">;
85
+ resource: z.ZodLiteral<"role">;
86
+ assignable: z.ZodDefault<z.ZodBoolean>;
87
+ }, z.core.$strict>]>;
88
+
89
+ declare const completionPrerequisiteSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
90
+ kind: z.ZodLiteral<"completion">;
91
+ quest: z.ZodString;
92
+ scope: z.ZodLiteral<"ever">;
93
+ }, z.core.$strict>, z.ZodObject<{
94
+ kind: z.ZodLiteral<"completion">;
95
+ quest: z.ZodString;
96
+ scope: z.ZodLiteral<"period">;
97
+ period: z.ZodEnum<{
98
+ day: "day";
99
+ week: "week";
100
+ month: "month";
101
+ }>;
102
+ }, z.core.$strict>], "scope">;
103
+ declare const balancePrerequisiteSchema: z.ZodObject<{
104
+ kind: z.ZodLiteral<"balance">;
105
+ balance: z.ZodString;
106
+ minimum: z.ZodNumber;
107
+ }, z.core.$strict>;
108
+ declare const groupPrerequisiteSchema: z.ZodObject<{
109
+ kind: z.ZodLiteral<"group">;
110
+ group: z.ZodString;
111
+ title: z.ZodString;
112
+ }, z.core.$strict>;
113
+ declare const prerequisiteSchema: z.ZodDiscriminatedUnion<[z.ZodDiscriminatedUnion<[z.ZodObject<{
114
+ kind: z.ZodLiteral<"completion">;
115
+ quest: z.ZodString;
116
+ scope: z.ZodLiteral<"ever">;
117
+ }, z.core.$strict>, z.ZodObject<{
118
+ kind: z.ZodLiteral<"completion">;
119
+ quest: z.ZodString;
120
+ scope: z.ZodLiteral<"period">;
121
+ period: z.ZodEnum<{
122
+ day: "day";
123
+ week: "week";
124
+ month: "month";
125
+ }>;
126
+ }, z.core.$strict>], "scope">, z.ZodObject<{
127
+ kind: z.ZodLiteral<"balance">;
128
+ balance: z.ZodString;
129
+ minimum: z.ZodNumber;
130
+ }, z.core.$strict>, z.ZodObject<{
131
+ kind: z.ZodLiteral<"group">;
132
+ group: z.ZodString;
133
+ title: z.ZodString;
134
+ }, z.core.$strict>], "kind">;
135
+ type Prerequisite = z.infer<typeof prerequisiteSchema>;
136
+ declare const missingPrerequisiteSchema: z.ZodUnion<readonly [z.ZodObject<{
137
+ kind: z.ZodLiteral<"completion">;
138
+ quest: z.ZodString;
139
+ title: z.ZodString;
140
+ scope: z.ZodLiteral<"ever">;
141
+ }, z.core.$strip>, z.ZodObject<{
142
+ kind: z.ZodLiteral<"completion">;
143
+ quest: z.ZodString;
144
+ title: z.ZodString;
145
+ scope: z.ZodLiteral<"period">;
146
+ period: z.ZodEnum<{
147
+ day: "day";
148
+ week: "week";
149
+ month: "month";
150
+ }>;
151
+ resetsAt: z.ZodNumber;
152
+ }, z.core.$strip>, z.ZodObject<{
153
+ kind: z.ZodLiteral<"balance">;
154
+ balance: z.ZodString;
155
+ title: z.ZodString;
156
+ minimum: z.ZodNumber;
157
+ current: z.ZodNumber;
158
+ }, z.core.$strip>, z.ZodObject<{
159
+ kind: z.ZodLiteral<"group">;
160
+ group: z.ZodString;
161
+ title: z.ZodString;
162
+ }, z.core.$strip>]>;
163
+ type MissingPrerequisite = z.infer<typeof missingPrerequisiteSchema>;
164
+ declare function completed(quest: QuestHandle, options?: {
165
+ scope?: "ever";
166
+ } | {
167
+ scope: "period";
168
+ period: "day" | "week" | "month";
169
+ }): {
170
+ kind: "completion";
171
+ quest: string;
172
+ scope: "ever";
173
+ } | {
174
+ kind: "completion";
175
+ quest: string;
176
+ scope: "period";
177
+ period: "day" | "week" | "month";
178
+ };
179
+ declare function balanceAtLeast(balance: LedgerReference, minimum: number): {
180
+ kind: "balance";
181
+ balance: string;
182
+ minimum: number;
183
+ };
184
+ declare function inGroup(group: ProjectGroupReference): {
185
+ kind: "group";
186
+ group: string;
187
+ title: string;
188
+ };
189
+
190
+ declare const authProviderSchema: z.ZodEnum<{
191
+ discord: "discord";
192
+ google: "google";
193
+ apple: "apple";
194
+ x: "x";
195
+ }>;
196
+ type AuthProvider = z.infer<typeof authProviderSchema>;
197
+ declare const accountConnectionSchema: z.ZodObject<{
198
+ provider: z.ZodEnum<{
199
+ discord: "discord";
200
+ google: "google";
201
+ apple: "apple";
202
+ x: "x";
203
+ }>;
204
+ configured: z.ZodBoolean;
205
+ status: z.ZodEnum<{
206
+ disconnected: "disconnected";
207
+ connected: "connected";
208
+ reconnect: "reconnect";
209
+ }>;
210
+ subject: z.ZodNullable<z.ZodString>;
211
+ revision: z.ZodNumber;
212
+ }, z.core.$strip>;
213
+ type AccountConnection = z.infer<typeof accountConnectionSchema>;
214
+ declare const discordMemberInputSchema: z.ZodObject<{}, z.core.$strict>;
215
+ declare const discordMessageInputSchema: z.ZodObject<{
216
+ channelId: z.ZodString;
217
+ messageId: z.ZodString;
218
+ }, z.core.$strict>;
219
+ declare const discordMemberSchema: z.ZodObject<{
220
+ userId: z.ZodDefault<z.ZodNullable<z.ZodString>>;
221
+ nickname: z.ZodDefault<z.ZodNullable<z.ZodString>>;
222
+ displayName: z.ZodDefault<z.ZodNullable<z.ZodString>>;
223
+ boostingSince: z.ZodDefault<z.ZodNullable<z.ZodString>>;
224
+ roles: z.ZodArray<z.ZodString>;
225
+ joinedAt: z.ZodNullable<z.ZodString>;
226
+ pending: z.ZodBoolean;
227
+ }, z.core.$strip>;
228
+ type DiscordMember = z.infer<typeof discordMemberSchema>;
229
+ /**
230
+ * Reads the project's connected Discord server for the member's linked Discord account. The
231
+ * account and the integration are pinned at the attempt's first Discord read: later links and
232
+ * unlinks do not change the attempt. Provider failures, and an integration that is not ready,
233
+ * throw `CapabilityError` with code `"provider-unavailable"`.
234
+ */
235
+ interface DiscordReader {
236
+ /** The member's server membership; null when they are not in the server or have not linked Discord. */
237
+ member(): Promise<DiscordMember | null>;
238
+ /**
239
+ * A message in the connected server; null when it does not exist. The bot reads it, so the
240
+ * member needs no linked Discord account. A channel outside the connected server, or one the
241
+ * bot cannot see, throws
242
+ * `CapabilityError` with code `"author-error"`.
243
+ */
244
+ message(input: {
245
+ channelId: string;
246
+ messageId: string;
247
+ }): Promise<DiscordMessage | null>;
248
+ }
249
+
250
+ declare const textOptionsSchema: z.ZodObject<{
251
+ required: z.ZodDefault<z.ZodBoolean>;
252
+ minLength: z.ZodDefault<z.ZodNumber>;
253
+ maxLength: z.ZodDefault<z.ZodNumber>;
254
+ }, z.core.$strict>;
255
+ declare const urlOptionsSchema: z.ZodObject<{
256
+ required: z.ZodDefault<z.ZodBoolean>;
257
+ allowedHosts: z.ZodOptional<z.ZodArray<z.ZodString>>;
258
+ }, z.core.$strict>;
259
+ type TextOptions = z.input<typeof textOptionsSchema>;
260
+ type UrlOptions = z.input<typeof urlOptionsSchema>;
261
+ declare const textEvidenceSchema: z.ZodObject<{
262
+ kind: z.ZodLiteral<"text">;
263
+ value: z.ZodString;
264
+ }, z.core.$strict>;
265
+ declare const urlEvidenceSchema: z.ZodObject<{
266
+ kind: z.ZodLiteral<"url">;
267
+ value: z.ZodString;
268
+ }, z.core.$strict>;
269
+ declare const valueEvidenceSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
270
+ kind: z.ZodLiteral<"text">;
271
+ value: z.ZodString;
272
+ }, z.core.$strict>, z.ZodObject<{
273
+ kind: z.ZodLiteral<"url">;
274
+ value: z.ZodString;
275
+ }, z.core.$strict>], "kind">;
276
+ type TextEvidence = z.infer<typeof textEvidenceSchema>;
277
+ type UrlEvidence = z.infer<typeof urlEvidenceSchema>;
278
+ type ValueEvidence = z.infer<typeof valueEvidenceSchema>;
279
+ /** Validates a claim without fetching it or changing the captured value. */
280
+ declare function validateSubmissionValue(input: ValueEvidence, contract: {
281
+ input: "text";
282
+ constraints: z.output<typeof textOptionsSchema>;
283
+ } | {
284
+ input: "url";
285
+ constraints: z.output<typeof urlOptionsSchema>;
286
+ }): string | null;
287
+ /** Extract an ID only. The URL and its author name are untrusted claims. */
288
+ declare function xPostId(value: string): string | null;
289
+
290
+ export { type AccountConnection as A, inGroup as B, missingPrerequisiteSchema as C, type DiscordMember as D, prerequisiteSchema as E, textEvidenceSchema as F, textOptionsSchema as G, urlEvidenceSchema as H, urlOptionsSchema as I, validateSubmissionValue as J, valueEvidenceSchema as K, xPostId as L, type MissingPrerequisite as M, type Prerequisite as P, type TextEvidence as T, type UrlEvidence as U, type ValueEvidence as V, type AuthProvider as a, type TextOptions as b, type UrlOptions as c, type DiscordMessage as d, type DiscordMessageData as e, type DiscordMessageTextData as f, type DiscordReactionData as g, type DiscordReader as h, accountConnectionSchema as i, authProviderSchema as j, balanceAtLeast as k, balancePrerequisiteSchema as l, completed as m, completionPrerequisiteSchema as n, discordMemberInputSchema as o, discordMemberSchema as p, discordMessageDataSchema as q, discordMessageInputSchema as r, discordMessageSchema as s, discordMessageTextDataSchema as t, discordMessagesSourceSchema as u, discordReactionDataSchema as v, discordReactionsSourceSchema as w, discordResourceSourceSchema as x, discordRewardSchema as y, groupPrerequisiteSchema as z };
package/dist/vite.d.ts CHANGED
@@ -10,7 +10,7 @@ type ResolveContext = {
10
10
  };
11
11
  /**
12
12
  * Fails the build when browser code imports server-only code: the management
13
- * client (`@domino-sdk/relay-cli`), the participant proxy, or anything under
13
+ * client (`@domino-sdk/relay/server`), the CLI, the participant proxy, or anything under
14
14
  * the app's `server/` directory. Management credentials and app secrets live
15
15
  * in the Worker; this keeps them from ever reaching a browser bundle.
16
16
  *
package/dist/vite.js CHANGED
@@ -1,5 +1,6 @@
1
1
  // src/vite.ts
2
2
  var SERVER_ONLY = [
3
+ /^@domino-sdk\/relay\/server$/,
3
4
  /^@domino-sdk\/relay-cli(?:\/|$)/,
4
5
  /^@domino-sdk\/relay\/portal-proxy$/
5
6
  ];
@@ -1,36 +1,6 @@
1
1
  import { z } from 'zod';
2
2
 
3
3
  declare const solanaAddressSchema: z.ZodString;
4
- declare const walletConnectionSchema: z.ZodObject<{
5
- chain: z.ZodLiteral<"solana">;
6
- address: z.ZodString;
7
- verifiedAt: z.ZodNumber;
8
- revision: z.ZodNumber;
9
- }, z.core.$strict>;
10
- type WalletConnection = z.infer<typeof walletConnectionSchema>;
11
- declare const walletChallengeInputSchema: z.ZodObject<{
12
- chain: z.ZodLiteral<"solana">;
13
- address: z.ZodString;
14
- }, z.core.$strict>;
15
- declare const walletChallengeSchema: z.ZodObject<{
16
- chain: z.ZodLiteral<"solana">;
17
- address: z.ZodString;
18
- id: z.ZodString;
19
- message: z.ZodString;
20
- expiresAt: z.ZodNumber;
21
- }, z.core.$strict>;
22
- declare const walletProofSchema: z.ZodObject<{
23
- challenge: z.ZodString;
24
- signature: z.ZodString;
25
- }, z.core.$strict>;
26
- declare const solanaBalanceSchema: z.ZodObject<{
27
- address: z.ZodString;
28
- network: z.ZodLiteral<"mainnet-beta">;
29
- lamports: z.ZodString;
30
- slot: z.ZodNumber;
31
- observedAt: z.ZodNumber;
32
- }, z.core.$strict>;
33
- type SolanaBalance = z.infer<typeof solanaBalanceSchema>;
34
4
  /** A wallet's chain family: its CAIP-2 namespace. */
35
5
  declare const walletChainSchema: z.ZodEnum<{
36
6
  solana: "solana";
@@ -44,6 +14,9 @@ type WalletChain = z.infer<typeof walletChainSchema>;
44
14
  */
45
15
  type CosmosNetwork = `cosmos:${string}`;
46
16
  declare const cosmosNetworkSchema: z.ZodCustom<`cosmos:${string}`, `cosmos:${string}`>;
17
+ /** A Cosmos SDK bank denomination: 3–128 characters in the SDK's canonical denom syntax. */
18
+ type CosmosDenom = string;
19
+ declare const cosmosDenomSchema: z.ZodString;
47
20
  /**
48
21
  * A Cosmos SDK chain an app works with. Pass `chainInfo` (Keplr's `ChainInfo` shape) for a chain
49
22
  * wallets may not know: the adapters suggest it to the wallet (`experimentalSuggestChain`).
@@ -155,21 +128,20 @@ declare const WALLETS_PER_CHAIN = 5;
155
128
  declare const walletSignInFamilies: readonly ["solana", "eip155", "cosmos"];
156
129
  /**
157
130
  * What a project enables wallet sign-in for: a chain family. A Cosmos wallet signs in on any
158
- * Cosmos SDK chain the app offers. Off unless the project enables it. The per-network values of
159
- * SDK 0.25 and 0.26 (`cosmos:<chain ID>`) read as `cosmos`.
131
+ * Cosmos SDK chain the app offers. Off unless the project enables it.
160
132
  */
161
- declare const walletSignInNetworkSchema: z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
133
+ declare const walletSignInNetworkSchema: z.ZodEnum<{
162
134
  solana: "solana";
163
135
  eip155: "eip155";
164
136
  cosmos: "cosmos";
165
- }>, z.ZodString]>, z.ZodTransform<"solana" | "eip155" | "cosmos", string>>;
137
+ }>;
166
138
  type WalletSignInNetwork = (typeof walletSignInFamilies)[number];
167
139
  /** Enabled wallet families, once each, in their stored order. */
168
- declare const walletSignInNetworksSchema: z.ZodPipe<z.ZodArray<z.ZodPipe<z.ZodUnion<readonly [z.ZodEnum<{
140
+ declare const walletSignInNetworksSchema: z.ZodPipe<z.ZodArray<z.ZodEnum<{
169
141
  solana: "solana";
170
142
  eip155: "eip155";
171
143
  cosmos: "cosmos";
172
- }>, z.ZodString]>, z.ZodTransform<"solana" | "eip155" | "cosmos", string>>>, z.ZodTransform<("solana" | "eip155" | "cosmos")[], ("solana" | "eip155" | "cosmos")[]>>;
144
+ }>>, z.ZodTransform<("solana" | "eip155" | "cosmos")[], ("solana" | "eip155" | "cosmos")[]>>;
173
145
  /** The sign-in setting a wallet account falls under: its chain family. */
174
146
  declare function walletSignInNetwork(wallet: Pick<LinkedWallet, "chain" | "network">): WalletSignInNetwork;
175
147
  /**
@@ -188,7 +160,7 @@ type EvmChainId = `eip155:${number}`;
188
160
  declare function isEvmChainId(value: string): value is EvmChainId;
189
161
  /** {@link isEvmChainId} as a schema. */
190
162
  declare const evmChainIdSchema: z.ZodCustom<`eip155:${number}`, `eip155:${number}`>;
191
- /** What `ctx.wallet.balance()` reads. Omit `token` for the chain's native coin. */
163
+ /** What `ctx.wallet.balance()` reads. Omit `token` for a Solana or EVM native coin. */
192
164
  type WalletBalanceQuery = {
193
165
  /** Solana mainnet: `"solana"` or its CAIP-2 ID. */
194
166
  chain: "solana" | typeof solanaMainnet;
@@ -206,6 +178,13 @@ type WalletBalanceQuery = {
206
178
  token?: `0x${string}`;
207
179
  /** One of the member's linked EVM wallets; omit to read all of them. */
208
180
  address?: string;
181
+ } | {
182
+ /** A Cosmos SDK chain's CAIP-2 ID. Relay reads the chains its management API lists. */
183
+ chain: CosmosNetwork;
184
+ /** The bank denomination to read, such as `uatom` or `uosmo`. */
185
+ token: CosmosDenom;
186
+ /** One of the member's wallets linked on this exact Cosmos network; omit to read all. */
187
+ address?: string;
209
188
  };
210
189
  /** A balance read for the member's pinned linked wallets, in raw integer units. */
211
190
  declare const walletBalanceSchema: z.ZodObject<{
@@ -227,5 +206,23 @@ declare const walletBalanceSchema: z.ZodObject<{
227
206
  observedAt: z.ZodNumber;
228
207
  }, z.core.$strict>;
229
208
  type WalletBalance = z.infer<typeof walletBalanceSchema>;
209
+ /**
210
+ * Reads the wallets the member has linked to this project. They are pinned once per attempt, at
211
+ * its first wallet read: later links and unlinks do not change the attempt. Every method resolves
212
+ * to `null` when the member has no linked wallet it can read, so a non-null list is never empty
213
+ * and a non-null balance covers at least one wallet. Provider failures throw `CapabilityError`
214
+ * with code `"provider-unavailable"`; they never read as a zero balance.
215
+ */
216
+ interface WalletReader {
217
+ /** Every wallet the member has linked to this project, newest first within each chain. */
218
+ list(): Promise<LinkedWallet[] | null>;
219
+ /**
220
+ * The native or token balance of the member's linked wallets on one chain: all wallets of that
221
+ * family (or exact Cosmos network), or `address`. Null when the member has no linked wallet it
222
+ * can read. A chain Relay does not read, a malformed token, and an `address` the member never
223
+ * linked throw `CapabilityError` with code `"author-error"`.
224
+ */
225
+ balance(query: WalletBalanceQuery): Promise<WalletBalance | null>;
226
+ }
230
227
 
231
- export { walletChainSchema as A, walletChallengeInputSchema as B, type CosmosChain as C, walletChallengeSchema as D, type EvmChainId as E, walletConnectionSchema as F, walletMessageChallengeSchema as G, walletProofSchema as H, walletSignInFamilies as I, walletSignInNetwork as J, walletSignInNetworkSchema as K, type LinkedWallet as L, walletSignInNetworksSchema as M, walletUnlinkInputSchema as N, type SolanaBalance as S, type WalletAddressInput as W, type CosmosNetwork as a, type WalletChain as b, type WalletMessageChallenge as c, type WalletSignInNetwork as d, type WalletSignature as e, type WalletSigner as f, type WalletUnlinkInput as g, type WalletConnection as h, type WalletBalanceQuery as i, type WalletBalance as j, isEvmChainId as k, walletSignatureSchema as l, WALLETS_PER_CHAIN as m, caip10 as n, cosmosAddressSchema as o, cosmosChain as p, cosmosNetworkSchema as q, evmAddressSchema as r, evmChainIdSchema as s, linkedWalletSchema as t, solanaAddressSchema as u, solanaBalanceSchema as v, walletAddressInputSchema as w, solanaMainnet as x, walletAddressInput as y, walletBalanceSchema as z };
228
+ export { walletChainSchema as A, walletMessageChallengeSchema as B, type CosmosChain as C, walletSignInFamilies as D, type EvmChainId as E, walletSignInNetwork as F, walletSignInNetworkSchema as G, walletSignInNetworksSchema as H, walletSignatureSchema as I, walletUnlinkInputSchema as J, type LinkedWallet as L, type WalletAddressInput as W, type CosmosNetwork as a, type WalletChain as b, type WalletMessageChallenge as c, type WalletSignInNetwork as d, type WalletSignature as e, type WalletSigner as f, type WalletUnlinkInput as g, type CosmosDenom as h, WALLETS_PER_CHAIN as i, type WalletBalance as j, type WalletBalanceQuery as k, type WalletReader as l, caip10 as m, cosmosAddressSchema as n, cosmosChain as o, cosmosDenomSchema as p, cosmosNetworkSchema as q, evmAddressSchema as r, evmChainIdSchema as s, isEvmChainId as t, linkedWalletSchema as u, solanaAddressSchema as v, solanaMainnet as w, walletAddressInput as x, walletAddressInputSchema as y, walletBalanceSchema as z };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@domino-sdk/relay",
3
- "version": "1.0.0-next.9",
3
+ "version": "1.0.0",
4
4
  "type": "module",
5
5
  "exports": {
6
6
  ".": {
@@ -42,6 +42,10 @@
42
42
  "./internal": {
43
43
  "types": "./dist/internal.d.ts",
44
44
  "default": "./dist/internal.js"
45
+ },
46
+ "./server": {
47
+ "types": "./dist/server/index.d.ts",
48
+ "default": "./dist/server/index.js"
45
49
  }
46
50
  },
47
51
  "sideEffects": false,
@@ -64,8 +68,10 @@
64
68
  },
65
69
  "devDependencies": {
66
70
  "@types/react": "19.3.0",
71
+ "esbuild": "0.25.12",
72
+ "jsdom": "30.0.1",
67
73
  "react": "19.3.0",
68
- "esbuild": "0.25.12"
74
+ "react-dom": "19.3.0"
69
75
  },
70
76
  "license": "UNLICENSED",
71
77
  "repository": {