@domino-sdk/relay 1.0.0-next.6 → 1.0.0-next.7
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/README.md +13 -1
- package/build.mjs +18 -1
- package/dist/authoring.d.ts +316 -14
- package/dist/authoring.js +177 -23
- package/dist/avatar.d.ts +29 -0
- package/dist/avatar.js +21 -0
- package/dist/browser.d.ts +168 -165
- package/dist/browser.js +6 -6
- package/dist/catalog-C09gnPYT.d.ts +3948 -0
- package/dist/chunk-7HSTFBMO.js +24 -0
- package/dist/{chunk-5IIWKDFX.js → chunk-ADSP377G.js} +1 -1
- package/dist/{chunk-RTHN22KO.js → chunk-AWLLGCKU.js} +2 -2
- package/dist/chunk-DJZB5RY5.js +901 -0
- package/dist/chunk-SKETUPST.js +171 -0
- package/dist/chunk-UFXBQ6FN.js +257 -0
- package/dist/{chunk-BRESOTKV.js → chunk-UW6R2QGT.js} +604 -723
- package/dist/chunk-V7UKZLHA.js +35 -0
- package/dist/{chunk-ERBVT7GE.js → chunk-X6FJIPXR.js} +166 -724
- package/dist/client-BufGakEt.d.ts +4577 -0
- package/dist/collection-BGneJ6Bk.d.ts +114 -0
- package/dist/images-e6FW9QSx.d.ts +234 -0
- package/dist/index.d.ts +11 -13132
- package/dist/index.js +11 -693
- package/dist/integrations-C3Sp558f.d.ts +1297 -0
- package/dist/internal.d.ts +109 -0
- package/dist/internal.js +104 -0
- package/dist/point-ledgers-iS00Z_v0.d.ts +37 -0
- package/dist/portal-proxy.js +5 -6
- package/dist/profiles-BtOXMGcC.d.ts +297 -0
- package/dist/react/index.d.ts +37 -34
- package/dist/react/index.js +7 -13
- package/dist/schema-DCapSPHz.d.ts +3396 -0
- package/dist/schema.d.ts +3194 -2372
- package/dist/schema.js +539 -3
- package/dist/streaks-CwGReWGt.d.ts +73 -0
- package/dist/submission-input-Bter6XiI.d.ts +2672 -0
- package/dist/units-CwgsPB_r.d.ts +9 -0
- package/dist/wallet-Bu6sqJvQ.d.ts +231 -0
- package/package.json +17 -4
- package/dist/chunk-XEQDW7FM.js +0 -373
- package/dist/chunk-ZKJBCQNI.js +0 -624
- package/dist/submission-input-CZDukyb3.d.ts +0 -4998
|
@@ -0,0 +1,901 @@
|
|
|
1
|
+
import {
|
|
2
|
+
contentMetricSchema,
|
|
3
|
+
contentMetricsSchema,
|
|
4
|
+
identifier,
|
|
5
|
+
pointsRewardSchema,
|
|
6
|
+
tierRewardSchema
|
|
7
|
+
} from "./chunk-UW6R2QGT.js";
|
|
8
|
+
|
|
9
|
+
// src/authoring-identity.ts
|
|
10
|
+
import { z } from "zod";
|
|
11
|
+
var authoringIdentityShape = {
|
|
12
|
+
key: identifier.optional(),
|
|
13
|
+
id: identifier.optional()
|
|
14
|
+
};
|
|
15
|
+
function validateAuthoringIdentity(value, ctx) {
|
|
16
|
+
if (!value.key && !value.id) {
|
|
17
|
+
ctx.addIssue({
|
|
18
|
+
code: "custom",
|
|
19
|
+
path: ["key"],
|
|
20
|
+
message: "Provide an authoring key. Legacy id is also accepted."
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
if (value.key && value.id && value.key !== value.id) {
|
|
24
|
+
ctx.addIssue({
|
|
25
|
+
code: "custom",
|
|
26
|
+
path: ["key"],
|
|
27
|
+
message: "id and key must match. Keep the existing authoring name to preserve identity."
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
function normalizeAuthoringIdentity(value) {
|
|
32
|
+
const { id, key, ...properties } = value;
|
|
33
|
+
return { ...properties, key: identifier.parse(key ?? id) };
|
|
34
|
+
}
|
|
35
|
+
var identitySchema = z.object(authoringIdentityShape).superRefine(validateAuthoringIdentity).transform(normalizeAuthoringIdentity);
|
|
36
|
+
var authoringKey = (input) => identitySchema.parse(input).key;
|
|
37
|
+
|
|
38
|
+
// src/engagement.ts
|
|
39
|
+
import { z as z2 } from "zod";
|
|
40
|
+
var amount = z2.number().int().safe().nonnegative();
|
|
41
|
+
var engagementDefinitionSchema = z2.strictObject({
|
|
42
|
+
key: identifier,
|
|
43
|
+
qualifiedBy: identifier,
|
|
44
|
+
balance: identifier,
|
|
45
|
+
metrics: z2.array(contentMetricSchema).min(1).max(6).refine(
|
|
46
|
+
(metrics) => new Set(metrics).size === metrics.length,
|
|
47
|
+
"Metrics must be unique"
|
|
48
|
+
),
|
|
49
|
+
baseline: z2.literal("historical"),
|
|
50
|
+
maxAgeMs: z2.number().int().positive().max(864e5).default(36e5),
|
|
51
|
+
budget: z2.strictObject({
|
|
52
|
+
projectDaily: amount.optional(),
|
|
53
|
+
memberDaily: amount.optional(),
|
|
54
|
+
projectLifetime: amount.optional()
|
|
55
|
+
}).default({})
|
|
56
|
+
});
|
|
57
|
+
var engagementScoreInputSchema = z2.strictObject({
|
|
58
|
+
metrics: contentMetricsSchema,
|
|
59
|
+
baseline: contentMetricsSchema
|
|
60
|
+
});
|
|
61
|
+
var engagementScoreSchema = z2.strictObject({
|
|
62
|
+
target: amount,
|
|
63
|
+
baseline: amount
|
|
64
|
+
});
|
|
65
|
+
var engagementPublishSchema = z2.strictObject({
|
|
66
|
+
actionId: identifier,
|
|
67
|
+
code: z2.string().min(1).max(1e6)
|
|
68
|
+
});
|
|
69
|
+
var engagementRuleSchema = z2.strictObject({
|
|
70
|
+
version: identifier,
|
|
71
|
+
definition: engagementDefinitionSchema,
|
|
72
|
+
publishedAt: amount
|
|
73
|
+
});
|
|
74
|
+
var engagementPageQuerySchema = z2.strictObject({
|
|
75
|
+
rule: identifier,
|
|
76
|
+
content: z2.string().min(1).max(256),
|
|
77
|
+
member: identifier.optional(),
|
|
78
|
+
before: z2.coerce.number().int().positive().safe().optional()
|
|
79
|
+
});
|
|
80
|
+
var engagementSettlementSchema = z2.strictObject({
|
|
81
|
+
id: identifier,
|
|
82
|
+
day: z2.string(),
|
|
83
|
+
observation: identifier,
|
|
84
|
+
qualification: identifier,
|
|
85
|
+
earned: amount,
|
|
86
|
+
growth: amount,
|
|
87
|
+
paid: amount,
|
|
88
|
+
excluded: amount,
|
|
89
|
+
entry: identifier.nullable(),
|
|
90
|
+
createdAt: amount
|
|
91
|
+
});
|
|
92
|
+
var engagementPageSchema = z2.strictObject({
|
|
93
|
+
rule: engagementRuleSchema,
|
|
94
|
+
account: z2.strictObject({
|
|
95
|
+
member: identifier,
|
|
96
|
+
earned: amount,
|
|
97
|
+
accounted: amount,
|
|
98
|
+
paid: amount,
|
|
99
|
+
excluded: amount,
|
|
100
|
+
pending: amount,
|
|
101
|
+
counters: contentMetricsSchema,
|
|
102
|
+
baseline: contentMetricsSchema,
|
|
103
|
+
observation: identifier.nullable(),
|
|
104
|
+
nextSettlementAt: amount.nullable(),
|
|
105
|
+
reason: z2.string().nullable()
|
|
106
|
+
}).nullable(),
|
|
107
|
+
items: z2.array(engagementSettlementSchema),
|
|
108
|
+
next: amount.nullable()
|
|
109
|
+
});
|
|
110
|
+
var engagementChangePreviewInputSchema = z2.strictObject({
|
|
111
|
+
code: z2.string().min(1).max(1e6)
|
|
112
|
+
});
|
|
113
|
+
var engagementChangeSchema = engagementPublishSchema.extend({
|
|
114
|
+
expectedVersion: identifier,
|
|
115
|
+
previewHash: identifier
|
|
116
|
+
});
|
|
117
|
+
var total = z2.string().regex(/^(0|[1-9][0-9]*)$/);
|
|
118
|
+
var engagementChangePreviewSchema = z2.strictObject({
|
|
119
|
+
rule: identifier,
|
|
120
|
+
fromVersion: identifier,
|
|
121
|
+
toVersion: identifier,
|
|
122
|
+
previewHash: identifier,
|
|
123
|
+
definition: engagementDefinitionSchema,
|
|
124
|
+
boundary: z2.literal("available-eligible-observation"),
|
|
125
|
+
settlement: z2.literal("deferred"),
|
|
126
|
+
summary: z2.strictObject({
|
|
127
|
+
knownAdmissions: amount,
|
|
128
|
+
accounts: amount,
|
|
129
|
+
uninitialized: amount,
|
|
130
|
+
pendingTransitions: amount,
|
|
131
|
+
earned: total,
|
|
132
|
+
paid: total,
|
|
133
|
+
excluded: total,
|
|
134
|
+
pending: total
|
|
135
|
+
})
|
|
136
|
+
});
|
|
137
|
+
var engagementVersionPageSchema = z2.strictObject({
|
|
138
|
+
items: z2.array(
|
|
139
|
+
engagementRuleSchema.extend({ previousVersion: identifier.nullable() })
|
|
140
|
+
),
|
|
141
|
+
next: amount.nullable()
|
|
142
|
+
});
|
|
143
|
+
var engagementVersionQuerySchema = z2.strictObject({
|
|
144
|
+
rule: identifier,
|
|
145
|
+
before: z2.coerce.number().int().positive().safe().optional()
|
|
146
|
+
});
|
|
147
|
+
var engagementBoundaryPageSchema = z2.strictObject({
|
|
148
|
+
current: engagementRuleSchema.nullable(),
|
|
149
|
+
requested: engagementRuleSchema,
|
|
150
|
+
items: z2.array(
|
|
151
|
+
z2.strictObject({
|
|
152
|
+
from: identifier,
|
|
153
|
+
to: identifier,
|
|
154
|
+
baseline: contentMetricsSchema,
|
|
155
|
+
observedAt: amount,
|
|
156
|
+
settlement: engagementSettlementSchema
|
|
157
|
+
})
|
|
158
|
+
),
|
|
159
|
+
next: amount.nullable()
|
|
160
|
+
});
|
|
161
|
+
var engagementArtifactSchema = engagementPublishSchema.omit({
|
|
162
|
+
actionId: true
|
|
163
|
+
});
|
|
164
|
+
var deploymentEntry = engagementArtifactSchema.extend({
|
|
165
|
+
rule: engagementRuleSchema
|
|
166
|
+
});
|
|
167
|
+
var engagementDeploymentEntrySchema = z2.discriminatedUnion("kind", [
|
|
168
|
+
deploymentEntry.extend({ kind: z2.literal("create") }),
|
|
169
|
+
deploymentEntry.extend({ kind: z2.literal("unchanged") }),
|
|
170
|
+
deploymentEntry.extend({
|
|
171
|
+
kind: z2.literal("change"),
|
|
172
|
+
change: engagementChangePreviewSchema
|
|
173
|
+
})
|
|
174
|
+
]);
|
|
175
|
+
|
|
176
|
+
// src/profiles.ts
|
|
177
|
+
import { z as z3 } from "zod";
|
|
178
|
+
var count = z3.number().int().nonnegative().safe();
|
|
179
|
+
var profileVisibilitySchema = z3.enum([
|
|
180
|
+
"private",
|
|
181
|
+
"participants",
|
|
182
|
+
"public"
|
|
183
|
+
]);
|
|
184
|
+
var avatarProviderSchema = z3.enum(["x", "discord", "google"]);
|
|
185
|
+
var profileDefaultProviderSchema = z3.enum(["x", "discord"]);
|
|
186
|
+
var profileDefaultsSchema = z3.array(profileDefaultProviderSchema).max(profileDefaultProviderSchema.options.length).refine(
|
|
187
|
+
(providers) => new Set(providers).size === providers.length,
|
|
188
|
+
"List each provider once"
|
|
189
|
+
);
|
|
190
|
+
var avatarSeedSchema = z3.string().min(1).max(100);
|
|
191
|
+
var profileAvatarSchema = z3.discriminatedUnion("source", [
|
|
192
|
+
z3.object({
|
|
193
|
+
source: z3.literal("upload"),
|
|
194
|
+
url: z3.string().url(),
|
|
195
|
+
seed: avatarSeedSchema
|
|
196
|
+
}),
|
|
197
|
+
z3.object({
|
|
198
|
+
source: z3.literal("account"),
|
|
199
|
+
provider: avatarProviderSchema,
|
|
200
|
+
url: z3.string().url(),
|
|
201
|
+
seed: avatarSeedSchema
|
|
202
|
+
}),
|
|
203
|
+
z3.object({ source: z3.literal("generated"), seed: avatarSeedSchema })
|
|
204
|
+
]);
|
|
205
|
+
var profileSummarySchema = z3.object({
|
|
206
|
+
id: identifier,
|
|
207
|
+
name: z3.string(),
|
|
208
|
+
avatar: profileAvatarSchema
|
|
209
|
+
});
|
|
210
|
+
var invisible = /[\p{Cc}----]/u;
|
|
211
|
+
var displayNameSchema = z3.string().max(200).transform((value) => value.normalize("NFC").replace(/\s+/g, " ").trim()).pipe(
|
|
212
|
+
z3.string().min(1, "Enter a name").max(40, "Use at most 40 characters").refine((value) => !invisible.test(value), "Use visible characters only")
|
|
213
|
+
);
|
|
214
|
+
var profileUpdateSchema = z3.object({
|
|
215
|
+
displayName: displayNameSchema.nullable().optional(),
|
|
216
|
+
avatar: z3.discriminatedUnion("source", [
|
|
217
|
+
z3.object({
|
|
218
|
+
source: z3.literal("account"),
|
|
219
|
+
provider: avatarProviderSchema
|
|
220
|
+
}).strict(),
|
|
221
|
+
z3.object({ source: z3.literal("generated") }).strict()
|
|
222
|
+
]).nullable().optional(),
|
|
223
|
+
hidden: z3.boolean().optional()
|
|
224
|
+
}).strict().refine(
|
|
225
|
+
(value) => Object.values(value).some((field) => field !== void 0),
|
|
226
|
+
"Change at least one field"
|
|
227
|
+
);
|
|
228
|
+
var ownProfileSchema = profileSummarySchema.extend({
|
|
229
|
+
/** The name the member chose, or null for the default. */
|
|
230
|
+
displayName: z3.string().nullable(),
|
|
231
|
+
/** The avatar the member chose: `default` follows the project's defaults. */
|
|
232
|
+
avatarChoice: z3.enum(["default", "upload", "account", "generated"]),
|
|
233
|
+
/** The account of an `account` choice. */
|
|
234
|
+
avatarProvider: avatarProviderSchema.nullable(),
|
|
235
|
+
hidden: z3.boolean(),
|
|
236
|
+
/** An operator locked the name and avatar; the member can still hide the profile. */
|
|
237
|
+
locked: z3.boolean(),
|
|
238
|
+
/** Who can see profiles in this project, so the app can explain it. */
|
|
239
|
+
visibility: profileVisibilitySchema,
|
|
240
|
+
/** The member's connected accounts a picture or name can come from. */
|
|
241
|
+
options: z3.array(
|
|
242
|
+
z3.object({
|
|
243
|
+
provider: avatarProviderSchema,
|
|
244
|
+
name: z3.string().nullable(),
|
|
245
|
+
imageUrl: z3.string().url().nullable()
|
|
246
|
+
})
|
|
247
|
+
)
|
|
248
|
+
});
|
|
249
|
+
var cursor = z3.string().min(1).max(512);
|
|
250
|
+
var profileCompletionQuerySchema = z3.object({
|
|
251
|
+
limit: z3.coerce.number().int().min(1).max(100).default(20),
|
|
252
|
+
cursor: cursor.optional()
|
|
253
|
+
}).strict();
|
|
254
|
+
var profileCompletionSchema = z3.object({
|
|
255
|
+
quest: identifier,
|
|
256
|
+
key: identifier.optional(),
|
|
257
|
+
title: z3.string(),
|
|
258
|
+
completions: count.positive(),
|
|
259
|
+
/** Null for completions recorded before completion times were. */
|
|
260
|
+
lastCompletedAt: count.nullable()
|
|
261
|
+
});
|
|
262
|
+
var profileCompletionPageSchema = z3.object({
|
|
263
|
+
items: z3.array(profileCompletionSchema),
|
|
264
|
+
nextCursor: cursor.nullable()
|
|
265
|
+
});
|
|
266
|
+
var profileReferralSchema = z3.object({
|
|
267
|
+
program: identifier,
|
|
268
|
+
key: identifier.optional(),
|
|
269
|
+
title: z3.string(),
|
|
270
|
+
/** Members this member invited. Invitations are shared by every program. */
|
|
271
|
+
invited: count,
|
|
272
|
+
/** Invited members who qualified in this program. */
|
|
273
|
+
qualified: count,
|
|
274
|
+
milestones: z3.array(
|
|
275
|
+
z3.object({ id: identifier, count, reached: z3.boolean() })
|
|
276
|
+
)
|
|
277
|
+
});
|
|
278
|
+
var profileSettingsSchema = z3.object({
|
|
279
|
+
visibility: profileVisibilitySchema,
|
|
280
|
+
defaults: profileDefaultsSchema,
|
|
281
|
+
revision: count,
|
|
282
|
+
actor: z3.string().nullable(),
|
|
283
|
+
updatedAt: count.nullable()
|
|
284
|
+
});
|
|
285
|
+
var profileSettingsInputSchema = profileSettingsSchema.omit({ revision: true, actor: true, updatedAt: true }).extend({
|
|
286
|
+
actionId: identifier,
|
|
287
|
+
/** The revision the change was made against; a newer one is a 409. */
|
|
288
|
+
expectedRevision: count,
|
|
289
|
+
reason: z3.string().trim().min(1).max(500)
|
|
290
|
+
}).strict();
|
|
291
|
+
var profileModerationSchema = z3.object({
|
|
292
|
+
actionId: identifier,
|
|
293
|
+
resetName: z3.boolean().default(false),
|
|
294
|
+
removeAvatar: z3.boolean().default(false),
|
|
295
|
+
/** True locks the name and avatar, false unlocks them. */
|
|
296
|
+
lock: z3.boolean().optional(),
|
|
297
|
+
reason: z3.string().trim().min(1).max(1e3)
|
|
298
|
+
}).strict().refine(
|
|
299
|
+
(value) => value.resetName || value.removeAvatar || value.lock !== void 0,
|
|
300
|
+
"Choose an action"
|
|
301
|
+
);
|
|
302
|
+
var managedProfileSchema = ownProfileSchema.omit({ options: true }).extend({
|
|
303
|
+
member: identifier,
|
|
304
|
+
lockedAt: count.nullable(),
|
|
305
|
+
lockedBy: z3.string().nullable(),
|
|
306
|
+
lockedReason: z3.string().nullable(),
|
|
307
|
+
updatedAt: count
|
|
308
|
+
});
|
|
309
|
+
var AVATAR_UPLOAD_LIMIT = 5 * 1024 * 1024;
|
|
310
|
+
var avatarUploadTypes = ["image/jpeg", "image/png", "image/webp"];
|
|
311
|
+
|
|
312
|
+
// src/leaderboards.ts
|
|
313
|
+
import { z as z4 } from "zod";
|
|
314
|
+
var integer = z4.number().int().safe();
|
|
315
|
+
var timestamp = integer.nonnegative().max(864e13);
|
|
316
|
+
var leaderboardWindowSchema = z4.discriminatedUnion("kind", [
|
|
317
|
+
z4.object({ kind: z4.literal("all-time") }).strict(),
|
|
318
|
+
z4.object({ kind: z4.literal("fixed"), start: timestamp, end: timestamp }).strict().refine((w) => w.end > w.start, "Window end must follow its start"),
|
|
319
|
+
z4.object({ kind: z4.literal("rolling"), days: integer.min(1).max(3660) }).strict(),
|
|
320
|
+
z4.object({
|
|
321
|
+
kind: z4.literal("calendar"),
|
|
322
|
+
period: z4.enum(["day", "week", "month"]),
|
|
323
|
+
timeZone: z4.string().min(1).max(100).refine((zone) => {
|
|
324
|
+
try {
|
|
325
|
+
new Intl.DateTimeFormat("en", { timeZone: zone });
|
|
326
|
+
return true;
|
|
327
|
+
} catch {
|
|
328
|
+
return false;
|
|
329
|
+
}
|
|
330
|
+
}, "Use an IANA timezone")
|
|
331
|
+
}).strict()
|
|
332
|
+
]);
|
|
333
|
+
var periodScore = {
|
|
334
|
+
window: leaderboardWindowSchema.default({ kind: "all-time" }),
|
|
335
|
+
quests: z4.array(identifier).min(1).max(100).optional()
|
|
336
|
+
};
|
|
337
|
+
var leaderboardDefinitionSchema = z4.object({
|
|
338
|
+
id: identifier,
|
|
339
|
+
key: identifier.optional(),
|
|
340
|
+
title: z4.string().trim().min(1).max(120),
|
|
341
|
+
balance: identifier,
|
|
342
|
+
score: z4.discriminatedUnion("kind", [
|
|
343
|
+
z4.object({ kind: z4.literal("balance") }).strict(),
|
|
344
|
+
z4.object({ kind: z4.literal("earned"), ...periodScore }).strict(),
|
|
345
|
+
z4.object({
|
|
346
|
+
kind: z4.literal("net"),
|
|
347
|
+
window: leaderboardWindowSchema.default({ kind: "all-time" })
|
|
348
|
+
}).strict()
|
|
349
|
+
]).default({ kind: "balance" }),
|
|
350
|
+
access: z4.enum(["participants", "public"]).default("participants"),
|
|
351
|
+
group: identifier.optional()
|
|
352
|
+
}).strict();
|
|
353
|
+
var leaderboardAuthoringSchema = leaderboardDefinitionSchema.omit({ id: true }).extend(authoringIdentityShape).strict().superRefine(validateAuthoringIdentity).transform(normalizeAuthoringIdentity);
|
|
354
|
+
var leaderboardArtifactSchema = z4.union([
|
|
355
|
+
leaderboardAuthoringSchema,
|
|
356
|
+
z4.object({ code: z4.string().min(1).max(2e6) }).strict()
|
|
357
|
+
]);
|
|
358
|
+
var publishedLeaderboardSchema = z4.object({
|
|
359
|
+
version: identifier,
|
|
360
|
+
definition: leaderboardDefinitionSchema,
|
|
361
|
+
publishedAt: timestamp,
|
|
362
|
+
actor: z4.string().nullable()
|
|
363
|
+
});
|
|
364
|
+
var leaderboardQuerySchema = z4.object({
|
|
365
|
+
limit: z4.coerce.number().int().min(1).max(100).default(25),
|
|
366
|
+
cursor: z4.string().max(4096).optional()
|
|
367
|
+
}).strict();
|
|
368
|
+
var leaderboardRowSchema = z4.object({
|
|
369
|
+
/** The row's stable key: a pseudonym per board and member. */
|
|
370
|
+
participant: identifier,
|
|
371
|
+
member: identifier.optional(),
|
|
372
|
+
/** The profile's name where the viewer can see it, otherwise the pseudonym's. */
|
|
373
|
+
name: z4.string(),
|
|
374
|
+
score: integer,
|
|
375
|
+
rank: integer.positive(),
|
|
376
|
+
/**
|
|
377
|
+
* The member's profile, where the project shows profiles to this viewer and the member has not
|
|
378
|
+
* hidden theirs. Older servers omit it.
|
|
379
|
+
*/
|
|
380
|
+
profile: profileSummarySchema.nullable().default(null)
|
|
381
|
+
});
|
|
382
|
+
var leaderboardPageSchema = z4.object({
|
|
383
|
+
leaderboard: identifier,
|
|
384
|
+
title: z4.string(),
|
|
385
|
+
version: identifier,
|
|
386
|
+
calculation: z4.enum(["balance", "earned", "net"]),
|
|
387
|
+
period: z4.object({ start: timestamp.nullable(), end: timestamp.nullable() }),
|
|
388
|
+
calculatedAt: timestamp,
|
|
389
|
+
lastEntryAt: timestamp.nullable(),
|
|
390
|
+
total: integer.nonnegative(),
|
|
391
|
+
items: z4.array(leaderboardRowSchema),
|
|
392
|
+
me: leaderboardRowSchema.nullable(),
|
|
393
|
+
nearby: z4.array(leaderboardRowSchema),
|
|
394
|
+
nextCursor: z4.string().nullable()
|
|
395
|
+
});
|
|
396
|
+
var leaderboardPlacementSchema = z4.object({
|
|
397
|
+
leaderboard: identifier,
|
|
398
|
+
key: identifier.optional(),
|
|
399
|
+
title: z4.string(),
|
|
400
|
+
profile: identifier,
|
|
401
|
+
rank: integer.positive().nullable(),
|
|
402
|
+
score: integer.nullable(),
|
|
403
|
+
/** Ranked participants on the board. */
|
|
404
|
+
total: integer.nonnegative()
|
|
405
|
+
});
|
|
406
|
+
var leaderboardPreviewSchema = z4.object({
|
|
407
|
+
published: publishedLeaderboardSchema,
|
|
408
|
+
before: leaderboardPageSchema.nullable(),
|
|
409
|
+
after: leaderboardPageSchema
|
|
410
|
+
});
|
|
411
|
+
var mutationBase = {
|
|
412
|
+
actionId: identifier,
|
|
413
|
+
member: identifier,
|
|
414
|
+
balance: identifier,
|
|
415
|
+
reason: z4.string().trim().min(1).max(1e3)
|
|
416
|
+
};
|
|
417
|
+
var datedMutation = { ...mutationBase, effectiveAt: timestamp.optional() };
|
|
418
|
+
var pointsMutationSchema = z4.discriminatedUnion("kind", [
|
|
419
|
+
z4.object({
|
|
420
|
+
...datedMutation,
|
|
421
|
+
kind: z4.literal("award"),
|
|
422
|
+
referralEligible: z4.boolean().optional(),
|
|
423
|
+
amount: integer.positive()
|
|
424
|
+
}).strict(),
|
|
425
|
+
z4.object({
|
|
426
|
+
...datedMutation,
|
|
427
|
+
kind: z4.literal("spend"),
|
|
428
|
+
amount: integer.positive()
|
|
429
|
+
}).strict(),
|
|
430
|
+
z4.object({
|
|
431
|
+
...datedMutation,
|
|
432
|
+
kind: z4.literal("adjust"),
|
|
433
|
+
amount: integer.refine((n) => n !== 0)
|
|
434
|
+
}).strict(),
|
|
435
|
+
z4.object({
|
|
436
|
+
...datedMutation,
|
|
437
|
+
kind: z4.literal("set"),
|
|
438
|
+
total: integer.nonnegative(),
|
|
439
|
+
expectedTotal: integer.nonnegative(),
|
|
440
|
+
classification: z4.enum(["earned", "spend"])
|
|
441
|
+
}).strict(),
|
|
442
|
+
z4.object({
|
|
443
|
+
...mutationBase,
|
|
444
|
+
kind: z4.literal("reverse"),
|
|
445
|
+
entry: identifier,
|
|
446
|
+
amount: integer.positive()
|
|
447
|
+
}).strict()
|
|
448
|
+
]);
|
|
449
|
+
var pointsEntrySchema = z4.object({
|
|
450
|
+
id: identifier,
|
|
451
|
+
completion: z4.string().nullable(),
|
|
452
|
+
member: identifier,
|
|
453
|
+
balance: identifier,
|
|
454
|
+
amount: integer,
|
|
455
|
+
kind: z4.enum(["award", "spend", "adjust", "reverse"]),
|
|
456
|
+
effectiveAt: timestamp,
|
|
457
|
+
receivedAt: timestamp,
|
|
458
|
+
quest: identifier.nullable(),
|
|
459
|
+
original: identifier.nullable(),
|
|
460
|
+
reason: z4.string(),
|
|
461
|
+
actor: z4.string().nullable()
|
|
462
|
+
});
|
|
463
|
+
var pointsResultSchema = z4.object({
|
|
464
|
+
entry: pointsEntrySchema,
|
|
465
|
+
total: integer.nonnegative()
|
|
466
|
+
});
|
|
467
|
+
var pointsAccountSchema = z4.object({
|
|
468
|
+
member: identifier,
|
|
469
|
+
balance: identifier,
|
|
470
|
+
total: integer.nonnegative(),
|
|
471
|
+
held: integer.nonnegative()
|
|
472
|
+
});
|
|
473
|
+
var leaderboardExclusionSchema = z4.object({
|
|
474
|
+
actionId: identifier,
|
|
475
|
+
member: identifier,
|
|
476
|
+
excluded: z4.boolean(),
|
|
477
|
+
reason: z4.string().trim().min(1).max(1e3)
|
|
478
|
+
}).strict();
|
|
479
|
+
var leaderboardGroupSchema = z4.object({
|
|
480
|
+
actionId: identifier,
|
|
481
|
+
member: identifier,
|
|
482
|
+
included: z4.boolean(),
|
|
483
|
+
reason: z4.string().trim().min(1).max(1e3)
|
|
484
|
+
}).strict();
|
|
485
|
+
|
|
486
|
+
// src/referrals.ts
|
|
487
|
+
import { z as z5 } from "zod";
|
|
488
|
+
var rewardSchema = z5.union([pointsRewardSchema, tierRewardSchema]);
|
|
489
|
+
var amount2 = z5.number().int().safe().nonnegative();
|
|
490
|
+
var reason = z5.string().trim().min(1).max(1e3);
|
|
491
|
+
var referralDefinitionSchema = z5.object({
|
|
492
|
+
id: identifier,
|
|
493
|
+
key: identifier.optional(),
|
|
494
|
+
title: z5.string().trim().min(1).max(120),
|
|
495
|
+
enabled: z5.boolean().default(true),
|
|
496
|
+
qualification: z5.discriminatedUnion("kind", [
|
|
497
|
+
z5.object({ kind: z5.literal("signup") }).strict(),
|
|
498
|
+
z5.object({ kind: z5.literal("quest"), quest: identifier }).strict(),
|
|
499
|
+
z5.object({ kind: z5.literal("external") }).strict()
|
|
500
|
+
]),
|
|
501
|
+
inviterGroup: identifier.optional(),
|
|
502
|
+
rewards: z5.object({
|
|
503
|
+
inviter: z5.array(rewardSchema).max(10).default([]),
|
|
504
|
+
invitee: z5.array(rewardSchema).max(10).default([])
|
|
505
|
+
}).strict().default({ inviter: [], invitee: [] }),
|
|
506
|
+
milestones: z5.array(
|
|
507
|
+
z5.object({
|
|
508
|
+
id: identifier,
|
|
509
|
+
count: amount2.min(1),
|
|
510
|
+
rewards: z5.array(rewardSchema).min(1).max(10)
|
|
511
|
+
}).strict()
|
|
512
|
+
).max(30).default([]),
|
|
513
|
+
bonuses: z5.array(
|
|
514
|
+
z5.object({
|
|
515
|
+
id: identifier,
|
|
516
|
+
balance: identifier,
|
|
517
|
+
basisPoints: amount2.min(1).max(1e4),
|
|
518
|
+
quests: z5.array(identifier).min(1).max(100).optional(),
|
|
519
|
+
external: z5.boolean().default(false),
|
|
520
|
+
durationDays: amount2.min(1).max(36500).optional(),
|
|
521
|
+
maxPoints: amount2.min(1).optional()
|
|
522
|
+
}).strict()
|
|
523
|
+
).max(20).default([])
|
|
524
|
+
}).strict().superRefine((value, ctx) => {
|
|
525
|
+
for (const entries of [value.milestones, value.bonuses]) {
|
|
526
|
+
if (new Set(entries.map((e) => e.id)).size !== entries.length) {
|
|
527
|
+
ctx.addIssue({ code: "custom", message: "Rule IDs must be unique" });
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
});
|
|
531
|
+
var referralAuthoringSchema = z5.object(referralDefinitionSchema.shape).omit({ id: true }).extend(authoringIdentityShape).strict().superRefine(validateAuthoringIdentity).superRefine((value, ctx) => {
|
|
532
|
+
for (const entries of [value.milestones, value.bonuses]) {
|
|
533
|
+
if (new Set(entries.map((entry) => entry.id)).size !== entries.length) {
|
|
534
|
+
ctx.addIssue({ code: "custom", message: "Rule keys must be unique" });
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
}).transform(normalizeAuthoringIdentity);
|
|
538
|
+
var referralArtifactSchema = z5.union([
|
|
539
|
+
referralAuthoringSchema,
|
|
540
|
+
z5.object({ code: z5.string().min(1).max(2e6) }).strict()
|
|
541
|
+
]);
|
|
542
|
+
var publishedReferralSchema = z5.object({
|
|
543
|
+
version: identifier,
|
|
544
|
+
definition: referralDefinitionSchema,
|
|
545
|
+
publishedAt: amount2,
|
|
546
|
+
actor: z5.string().nullable()
|
|
547
|
+
});
|
|
548
|
+
var referralAcceptSchema = z5.object({ actionId: identifier, code: identifier }).strict();
|
|
549
|
+
var referralControlSchema = z5.discriminatedUnion("kind", [
|
|
550
|
+
z5.object({
|
|
551
|
+
kind: z5.literal("suspend"),
|
|
552
|
+
actionId: identifier,
|
|
553
|
+
member: identifier,
|
|
554
|
+
suspended: z5.boolean(),
|
|
555
|
+
reason
|
|
556
|
+
}).strict(),
|
|
557
|
+
z5.object({
|
|
558
|
+
kind: z5.literal("qualify"),
|
|
559
|
+
actionId: identifier,
|
|
560
|
+
member: identifier,
|
|
561
|
+
program: identifier,
|
|
562
|
+
qualified: z5.boolean(),
|
|
563
|
+
reason
|
|
564
|
+
}).strict(),
|
|
565
|
+
z5.object({
|
|
566
|
+
kind: z5.literal("resolve-reward"),
|
|
567
|
+
actionId: identifier,
|
|
568
|
+
entitlement: identifier,
|
|
569
|
+
reason
|
|
570
|
+
}).strict()
|
|
571
|
+
]);
|
|
572
|
+
var referralRelationshipSchema = z5.object({
|
|
573
|
+
member: identifier,
|
|
574
|
+
inviter: identifier,
|
|
575
|
+
acceptedAt: amount2,
|
|
576
|
+
suspended: z5.boolean()
|
|
577
|
+
});
|
|
578
|
+
var referralAccountSchema = z5.object({
|
|
579
|
+
id: identifier,
|
|
580
|
+
program: identifier,
|
|
581
|
+
kind: z5.enum(["bonus", "fixed", "milestone"]),
|
|
582
|
+
balance: identifier,
|
|
583
|
+
earned: amount2,
|
|
584
|
+
settled: amount2,
|
|
585
|
+
outstanding: amount2
|
|
586
|
+
});
|
|
587
|
+
var referralSummarySchema = z5.object({
|
|
588
|
+
code: identifier,
|
|
589
|
+
attributed: amount2,
|
|
590
|
+
programs: z5.array(
|
|
591
|
+
z5.object({
|
|
592
|
+
definition: referralDefinitionSchema,
|
|
593
|
+
qualified: amount2,
|
|
594
|
+
milestones: z5.array(
|
|
595
|
+
z5.object({ id: identifier, count: amount2, reached: z5.boolean() })
|
|
596
|
+
)
|
|
597
|
+
})
|
|
598
|
+
),
|
|
599
|
+
accounts: z5.array(referralAccountSchema)
|
|
600
|
+
});
|
|
601
|
+
var referralHistorySchema = z5.object({
|
|
602
|
+
items: z5.array(
|
|
603
|
+
z5.object({
|
|
604
|
+
id: amount2,
|
|
605
|
+
program: identifier,
|
|
606
|
+
balance: identifier,
|
|
607
|
+
amount: z5.number().int().safe(),
|
|
608
|
+
at: amount2,
|
|
609
|
+
reason: z5.string()
|
|
610
|
+
})
|
|
611
|
+
),
|
|
612
|
+
next: amount2.nullable()
|
|
613
|
+
});
|
|
614
|
+
var referralManagementSchema = z5.object({
|
|
615
|
+
relationships: z5.array(referralRelationshipSchema),
|
|
616
|
+
qualifications: z5.array(
|
|
617
|
+
z5.object({
|
|
618
|
+
member: identifier,
|
|
619
|
+
program: identifier,
|
|
620
|
+
qualified: z5.boolean(),
|
|
621
|
+
qualifiedAt: amount2
|
|
622
|
+
})
|
|
623
|
+
),
|
|
624
|
+
accounts: z5.array(
|
|
625
|
+
referralAccountSchema.extend({ member: identifier, invitee: z5.string() })
|
|
626
|
+
),
|
|
627
|
+
reviews: z5.array(
|
|
628
|
+
z5.object({
|
|
629
|
+
entitlement: identifier,
|
|
630
|
+
member: identifier,
|
|
631
|
+
program: identifier,
|
|
632
|
+
reason: z5.string()
|
|
633
|
+
})
|
|
634
|
+
),
|
|
635
|
+
next: amount2.nullable()
|
|
636
|
+
});
|
|
637
|
+
|
|
638
|
+
// src/wallet.ts
|
|
639
|
+
import { z as z6 } from "zod";
|
|
640
|
+
var solanaAddressSchema = z6.string().min(32).max(44).regex(/^[1-9A-HJ-NP-Za-km-z]+$/);
|
|
641
|
+
var walletConnectionSchema = z6.object({
|
|
642
|
+
chain: z6.literal("solana"),
|
|
643
|
+
address: solanaAddressSchema,
|
|
644
|
+
verifiedAt: z6.number().int().nonnegative(),
|
|
645
|
+
revision: z6.number().int().positive()
|
|
646
|
+
}).strict();
|
|
647
|
+
var walletChallengeInputSchema = z6.object({
|
|
648
|
+
chain: z6.literal("solana"),
|
|
649
|
+
address: solanaAddressSchema
|
|
650
|
+
}).strict();
|
|
651
|
+
var walletChallengeSchema = walletChallengeInputSchema.extend({
|
|
652
|
+
id: z6.string().uuid(),
|
|
653
|
+
message: z6.string(),
|
|
654
|
+
expiresAt: z6.number()
|
|
655
|
+
});
|
|
656
|
+
var walletProofSchema = z6.object({
|
|
657
|
+
challenge: z6.string().uuid(),
|
|
658
|
+
signature: z6.string().min(64).max(88).regex(/^[1-9A-HJ-NP-Za-km-z]+$/)
|
|
659
|
+
}).strict();
|
|
660
|
+
var solanaBalanceSchema = z6.object({
|
|
661
|
+
address: solanaAddressSchema,
|
|
662
|
+
network: z6.literal("mainnet-beta"),
|
|
663
|
+
lamports: z6.string().regex(/^(0|[1-9][0-9]*)$/),
|
|
664
|
+
slot: z6.number().int().nonnegative().safe(),
|
|
665
|
+
observedAt: z6.number().int().nonnegative()
|
|
666
|
+
}).strict();
|
|
667
|
+
var walletChainSchema = z6.enum(["solana", "eip155", "cosmos"]);
|
|
668
|
+
var cosmosNetworkPattern = /^cosmos:[-_a-zA-Z0-9]{1,32}$/;
|
|
669
|
+
var cosmosNetworkSchema = z6.custom(
|
|
670
|
+
(value) => typeof value === "string" && cosmosNetworkPattern.test(value),
|
|
671
|
+
"Use a Cosmos network: cosmos:<chain ID>"
|
|
672
|
+
);
|
|
673
|
+
function cosmosChain(chain) {
|
|
674
|
+
if (typeof chain === "string" && !chain.startsWith("cosmos:")) {
|
|
675
|
+
throw new Error('Use a Cosmos network such as "cosmos:cosmoshub-4"');
|
|
676
|
+
}
|
|
677
|
+
const value = typeof chain === "string" ? { chainId: chain.slice("cosmos:".length) } : chain;
|
|
678
|
+
if (typeof value?.chainId !== "string") {
|
|
679
|
+
throw new Error(
|
|
680
|
+
'Pass a Cosmos chain as { chainId } or a network such as "cosmos:cosmoshub-4"'
|
|
681
|
+
);
|
|
682
|
+
}
|
|
683
|
+
const network = `cosmos:${value.chainId}`;
|
|
684
|
+
if (!cosmosNetworkPattern.test(network)) {
|
|
685
|
+
throw new Error(
|
|
686
|
+
"A Cosmos chain ID has 1 to 32 letters, digits, hyphens or underscores"
|
|
687
|
+
);
|
|
688
|
+
}
|
|
689
|
+
if (value.chainInfo && value.chainInfo.chainId !== value.chainId) {
|
|
690
|
+
throw new Error("The chain info describes another chain ID");
|
|
691
|
+
}
|
|
692
|
+
return { ...value, network };
|
|
693
|
+
}
|
|
694
|
+
var solanaMainnet = "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp";
|
|
695
|
+
var evmAddressSchema = z6.string().regex(/^0x[0-9a-fA-F]{40}$/);
|
|
696
|
+
var cosmosAddressSchema = z6.string().min(8).max(90).regex(
|
|
697
|
+
/^(?:[a-z][a-z0-9]{0,82}1[02-9ac-hj-np-z]{38,}|[A-Z][A-Z0-9]{0,82}1[02-9AC-HJ-NP-Z]{38,})$/
|
|
698
|
+
);
|
|
699
|
+
var walletAddressInputSchema = z6.discriminatedUnion("chain", [
|
|
700
|
+
z6.object({ chain: z6.literal("solana"), address: solanaAddressSchema }).strict(),
|
|
701
|
+
z6.object({
|
|
702
|
+
chain: z6.literal("eip155"),
|
|
703
|
+
address: evmAddressSchema,
|
|
704
|
+
/** Shown in the sign-in message's Chain ID line only: links are chain-agnostic. Defaults to 1. */
|
|
705
|
+
chainId: z6.number().int().positive().safe().optional()
|
|
706
|
+
}).strict(),
|
|
707
|
+
z6.object({
|
|
708
|
+
chain: z6.literal("cosmos"),
|
|
709
|
+
network: cosmosNetworkSchema,
|
|
710
|
+
address: cosmosAddressSchema
|
|
711
|
+
}).strict()
|
|
712
|
+
]);
|
|
713
|
+
var walletMessageChallengeSchema = z6.object({
|
|
714
|
+
id: z6.string().min(1).max(200),
|
|
715
|
+
purpose: z6.enum(["link", "sign-in"]),
|
|
716
|
+
chain: walletChainSchema,
|
|
717
|
+
network: cosmosNetworkSchema.nullable(),
|
|
718
|
+
/** Canonical (base58, EIP-55 or lowercase bech32). The signer must sign with this address. */
|
|
719
|
+
address: z6.string(),
|
|
720
|
+
message: z6.string().max(4096),
|
|
721
|
+
expiresAt: z6.number().int()
|
|
722
|
+
});
|
|
723
|
+
var walletSignatureSchema = z6.object({
|
|
724
|
+
challenge: z6.string().min(1).max(200),
|
|
725
|
+
/** solana: base58, 64 bytes · eip155: 0x and 130 hex digits (65 bytes) · cosmos: base64, 64 bytes (r‖s) */
|
|
726
|
+
signature: z6.string().min(1).max(256),
|
|
727
|
+
/** cosmos only: the base64 33-byte compressed secp256k1 key from signArbitrary's pub_key.value */
|
|
728
|
+
publicKey: z6.string().max(128).optional()
|
|
729
|
+
}).strict();
|
|
730
|
+
var linkedWalletSchema = z6.object({
|
|
731
|
+
chain: walletChainSchema,
|
|
732
|
+
network: cosmosNetworkSchema.nullable(),
|
|
733
|
+
address: z6.string(),
|
|
734
|
+
verifiedAt: z6.number().int().nonnegative(),
|
|
735
|
+
revision: z6.number().int().positive(),
|
|
736
|
+
/** True when this wallet can sign in: it was first used through wallet sign-in. Linking never enables sign-in. */
|
|
737
|
+
signIn: z6.boolean()
|
|
738
|
+
});
|
|
739
|
+
var walletUnlinkInputSchema = z6.object({ chain: walletChainSchema, address: z6.string().min(1).max(100) }).strict();
|
|
740
|
+
async function walletAddressInput(signer) {
|
|
741
|
+
const address = await signer.address();
|
|
742
|
+
switch (signer.chain) {
|
|
743
|
+
case "solana":
|
|
744
|
+
return { chain: "solana", address };
|
|
745
|
+
case "eip155":
|
|
746
|
+
return {
|
|
747
|
+
chain: "eip155",
|
|
748
|
+
address,
|
|
749
|
+
...signer.chainId ? { chainId: await signer.chainId() } : {}
|
|
750
|
+
};
|
|
751
|
+
case "cosmos":
|
|
752
|
+
if (!signer.network) {
|
|
753
|
+
throw new Error("Choose the Cosmos chain for this wallet");
|
|
754
|
+
}
|
|
755
|
+
return { chain: "cosmos", network: signer.network, address };
|
|
756
|
+
}
|
|
757
|
+
}
|
|
758
|
+
var WALLETS_PER_CHAIN = 5;
|
|
759
|
+
var walletSignInFamilies = ["solana", "eip155", "cosmos"];
|
|
760
|
+
var walletSignInNetworkSchema = z6.union([z6.enum(walletSignInFamilies), z6.string().regex(cosmosNetworkPattern)]).transform(
|
|
761
|
+
(value) => value.startsWith("cosmos:") ? "cosmos" : value
|
|
762
|
+
);
|
|
763
|
+
var walletSignInNetworksSchema = z6.array(walletSignInNetworkSchema).transform(
|
|
764
|
+
(values) => walletSignInFamilies.filter((family) => values.includes(family))
|
|
765
|
+
);
|
|
766
|
+
function walletSignInNetwork(wallet) {
|
|
767
|
+
return wallet.chain;
|
|
768
|
+
}
|
|
769
|
+
function caip10(wallet, network) {
|
|
770
|
+
if (wallet.chain === "cosmos") {
|
|
771
|
+
if (!wallet.network || network && network !== wallet.network) {
|
|
772
|
+
throw new Error("A Cosmos wallet belongs to its own network");
|
|
773
|
+
}
|
|
774
|
+
return `${wallet.network}:${wallet.address}`;
|
|
775
|
+
}
|
|
776
|
+
const selected = network ?? (wallet.chain === "solana" ? solanaMainnet : "eip155:1");
|
|
777
|
+
const valid = wallet.chain === "solana" ? /^solana:[1-9A-HJ-NP-Za-km-z]{32}$/.test(selected) : isEvmChainId(selected);
|
|
778
|
+
if (!valid) {
|
|
779
|
+
throw new Error(`Use a ${wallet.chain} network for this wallet`);
|
|
780
|
+
}
|
|
781
|
+
return `${selected}:${wallet.address}`;
|
|
782
|
+
}
|
|
783
|
+
function isEvmChainId(value) {
|
|
784
|
+
return /^eip155:[1-9][0-9]{0,15}$/.test(value);
|
|
785
|
+
}
|
|
786
|
+
var evmChainIdSchema = z6.custom(
|
|
787
|
+
(value) => typeof value === "string" && isEvmChainId(value),
|
|
788
|
+
'Use an EVM chain ID such as "eip155:8453"'
|
|
789
|
+
);
|
|
790
|
+
var units = z6.string().regex(/^(0|[1-9][0-9]*)$/);
|
|
791
|
+
var walletBalanceSchema = z6.object({
|
|
792
|
+
/** Canonical CAIP-2 ID: `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp` or `eip155:<chain ID>`. */
|
|
793
|
+
chain: z6.string(),
|
|
794
|
+
/** The canonical mint (base58) or EIP-55 contract address; null for the native coin. */
|
|
795
|
+
token: z6.string().nullable(),
|
|
796
|
+
/** Null only for an ERC-20 contract without `decimals()`. */
|
|
797
|
+
decimals: z6.number().int().min(0).max(255).nullable(),
|
|
798
|
+
/** The sum over `wallets`. */
|
|
799
|
+
total: units,
|
|
800
|
+
wallets: z6.array(z6.object({ address: z6.string(), amount: units }).strict()),
|
|
801
|
+
/** Solana: the lowest slot the reads saw. EVM: the latest block when the read started (approximate). */
|
|
802
|
+
at: z6.object({ kind: z6.enum(["slot", "block"]), number: units }).strict(),
|
|
803
|
+
observedAt: z6.number().int().nonnegative()
|
|
804
|
+
}).strict();
|
|
805
|
+
|
|
806
|
+
export {
|
|
807
|
+
authoringIdentityShape,
|
|
808
|
+
validateAuthoringIdentity,
|
|
809
|
+
normalizeAuthoringIdentity,
|
|
810
|
+
authoringKey,
|
|
811
|
+
engagementDefinitionSchema,
|
|
812
|
+
engagementScoreInputSchema,
|
|
813
|
+
engagementScoreSchema,
|
|
814
|
+
engagementPublishSchema,
|
|
815
|
+
engagementRuleSchema,
|
|
816
|
+
engagementPageQuerySchema,
|
|
817
|
+
engagementSettlementSchema,
|
|
818
|
+
engagementPageSchema,
|
|
819
|
+
engagementChangePreviewInputSchema,
|
|
820
|
+
engagementChangeSchema,
|
|
821
|
+
engagementChangePreviewSchema,
|
|
822
|
+
engagementVersionPageSchema,
|
|
823
|
+
engagementVersionQuerySchema,
|
|
824
|
+
engagementBoundaryPageSchema,
|
|
825
|
+
engagementArtifactSchema,
|
|
826
|
+
engagementDeploymentEntrySchema,
|
|
827
|
+
profileVisibilitySchema,
|
|
828
|
+
avatarProviderSchema,
|
|
829
|
+
profileDefaultProviderSchema,
|
|
830
|
+
profileDefaultsSchema,
|
|
831
|
+
avatarSeedSchema,
|
|
832
|
+
profileAvatarSchema,
|
|
833
|
+
profileSummarySchema,
|
|
834
|
+
displayNameSchema,
|
|
835
|
+
profileUpdateSchema,
|
|
836
|
+
ownProfileSchema,
|
|
837
|
+
profileCompletionQuerySchema,
|
|
838
|
+
profileCompletionSchema,
|
|
839
|
+
profileCompletionPageSchema,
|
|
840
|
+
profileReferralSchema,
|
|
841
|
+
profileSettingsSchema,
|
|
842
|
+
profileSettingsInputSchema,
|
|
843
|
+
profileModerationSchema,
|
|
844
|
+
managedProfileSchema,
|
|
845
|
+
AVATAR_UPLOAD_LIMIT,
|
|
846
|
+
avatarUploadTypes,
|
|
847
|
+
leaderboardWindowSchema,
|
|
848
|
+
leaderboardDefinitionSchema,
|
|
849
|
+
leaderboardAuthoringSchema,
|
|
850
|
+
leaderboardArtifactSchema,
|
|
851
|
+
publishedLeaderboardSchema,
|
|
852
|
+
leaderboardQuerySchema,
|
|
853
|
+
leaderboardRowSchema,
|
|
854
|
+
leaderboardPageSchema,
|
|
855
|
+
leaderboardPlacementSchema,
|
|
856
|
+
leaderboardPreviewSchema,
|
|
857
|
+
pointsMutationSchema,
|
|
858
|
+
pointsEntrySchema,
|
|
859
|
+
pointsResultSchema,
|
|
860
|
+
pointsAccountSchema,
|
|
861
|
+
leaderboardExclusionSchema,
|
|
862
|
+
leaderboardGroupSchema,
|
|
863
|
+
referralDefinitionSchema,
|
|
864
|
+
referralAuthoringSchema,
|
|
865
|
+
referralArtifactSchema,
|
|
866
|
+
publishedReferralSchema,
|
|
867
|
+
referralAcceptSchema,
|
|
868
|
+
referralControlSchema,
|
|
869
|
+
referralRelationshipSchema,
|
|
870
|
+
referralAccountSchema,
|
|
871
|
+
referralSummarySchema,
|
|
872
|
+
referralHistorySchema,
|
|
873
|
+
referralManagementSchema,
|
|
874
|
+
solanaAddressSchema,
|
|
875
|
+
walletConnectionSchema,
|
|
876
|
+
walletChallengeInputSchema,
|
|
877
|
+
walletChallengeSchema,
|
|
878
|
+
walletProofSchema,
|
|
879
|
+
solanaBalanceSchema,
|
|
880
|
+
walletChainSchema,
|
|
881
|
+
cosmosNetworkSchema,
|
|
882
|
+
cosmosChain,
|
|
883
|
+
solanaMainnet,
|
|
884
|
+
evmAddressSchema,
|
|
885
|
+
cosmosAddressSchema,
|
|
886
|
+
walletAddressInputSchema,
|
|
887
|
+
walletMessageChallengeSchema,
|
|
888
|
+
walletSignatureSchema,
|
|
889
|
+
linkedWalletSchema,
|
|
890
|
+
walletUnlinkInputSchema,
|
|
891
|
+
walletAddressInput,
|
|
892
|
+
WALLETS_PER_CHAIN,
|
|
893
|
+
walletSignInFamilies,
|
|
894
|
+
walletSignInNetworkSchema,
|
|
895
|
+
walletSignInNetworksSchema,
|
|
896
|
+
walletSignInNetwork,
|
|
897
|
+
caip10,
|
|
898
|
+
isEvmChainId,
|
|
899
|
+
evmChainIdSchema,
|
|
900
|
+
walletBalanceSchema
|
|
901
|
+
};
|