@domino-sdk/relay 1.59.0 → 1.60.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 (60) hide show
  1. package/CHANGELOG.md +26 -0
  2. package/dist/{accounts-CVonEkdb.d.ts → accounts-DoabriBX.d.ts} +4 -1
  3. package/dist/{attempt-captures-DBj-rxak.d.ts → attempt-captures-W2dgzGqE.d.ts} +1 -1
  4. package/dist/authoring.d.ts +160 -28
  5. package/dist/authoring.js +83 -14
  6. package/dist/{automatic-outcomes-FS9okvBP.d.ts → automatic-outcomes-Cmou89IS.d.ts} +1 -1
  7. package/dist/avatar.d.ts +1 -1
  8. package/dist/browser.d.ts +19 -10
  9. package/dist/browser.js +12 -10
  10. package/dist/{capability-error-DDJl0LY-.d.ts → capability-error-DufwG3G0.d.ts} +21 -1
  11. package/dist/{chunk-2LKGAL63.js → chunk-2FHNY52R.js} +8 -2
  12. package/dist/{chunk-EQF4ID47.js → chunk-422J3QRW.js} +12 -2
  13. package/dist/{chunk-KYUQEZZA.js → chunk-4OFH4BNX.js} +1 -1
  14. package/dist/{chunk-R4S6BFOH.js → chunk-6ZG7WNYX.js} +1 -1
  15. package/dist/{chunk-AWWCEP7F.js → chunk-GBSDAD3N.js} +811 -592
  16. package/dist/{chunk-YRSU2X2P.js → chunk-KUPVQXUJ.js} +2 -2
  17. package/dist/{chunk-LDLOB2UZ.js → chunk-KWFY7L7X.js} +4 -4
  18. package/dist/{chunk-UEMLYPKJ.js → chunk-MJEJQH5A.js} +13 -4
  19. package/dist/{chunk-W42KMMH5.js → chunk-N3LJ6GFK.js} +1 -1
  20. package/dist/{chunk-TZJT5CRF.js → chunk-N7YOS4ZU.js} +1 -1
  21. package/dist/{chunk-KBCTII6C.js → chunk-OTEUP2SG.js} +1 -1
  22. package/dist/{chunk-577DG2IT.js → chunk-VVRQQRMQ.js} +12 -12
  23. package/dist/{chunk-YMWRLAAP.js → chunk-VWMIA2TT.js} +8 -2
  24. package/dist/{chunk-6U5WWH3W.js → chunk-XQKUJL7H.js} +9 -4
  25. package/dist/{chunk-M2JQPDUX.js → chunk-Y2IGFLD2.js} +9 -9
  26. package/dist/chunk-YNW2ZUUP.js +247 -0
  27. package/dist/{chunk-IBROKMFV.js → chunk-YOAPPIWN.js} +1 -1
  28. package/dist/{client-3b9HjSzZ.d.ts → client-Cw1pB5sv.d.ts} +12 -7
  29. package/dist/{deployments-BydFVj4Q.d.ts → deployments-DI-W7fBq.d.ts} +786 -2
  30. package/dist/{groups-CFuTfFqG.d.ts → groups-9Jm3peq3.d.ts} +4 -1
  31. package/dist/index.d.ts +10 -10
  32. package/dist/index.js +9 -9
  33. package/dist/{integrations-DrbKQSTD.d.ts → integrations-CmIkP1Gi.d.ts} +48 -3
  34. package/dist/internal.d.ts +10 -10
  35. package/dist/internal.js +8 -8
  36. package/dist/{offers-DAfe1O3_.d.ts → offers-CqXfMIxq.d.ts} +3 -2
  37. package/dist/{pages-ChDVLrgR.d.ts → pages-Bti7g5mX.d.ts} +147 -2
  38. package/dist/{participant-activity-iciCEs_8.d.ts → participant-activity-DHL8QYks.d.ts} +4 -0
  39. package/dist/portal-proxy.js +3 -3
  40. package/dist/react/index.d.ts +15 -14
  41. package/dist/react/index.js +10 -10
  42. package/dist/runtime/authoring.js +1 -1
  43. package/dist/runtime/chunks/ADUMK6CR.js +1 -0
  44. package/dist/runtime/manifest.json +3 -3
  45. package/dist/runtime/schema.js +1 -1
  46. package/dist/{schema-BA0nRRlt.d.ts → schema-CwbRkmlr.d.ts} +142 -2
  47. package/dist/schema.d.ts +112 -17
  48. package/dist/schema.js +35 -21
  49. package/dist/server/index.d.ts +10 -10
  50. package/dist/server/index.js +292 -41
  51. package/dist/{submission-input-DxQ6RnKo.d.ts → submission-input-D9EGH_yb.d.ts} +2 -2
  52. package/dist/{telegram-browser-o3OIxGrJ.d.ts → telegram-browser-CTJh4Ro_.d.ts} +4 -4
  53. package/dist/testing.d.ts +7 -7
  54. package/dist/testing.js +8 -8
  55. package/dist/{transport-D_Eqf78J.d.ts → transport-B8Ss5lcz.d.ts} +5331 -118
  56. package/dist/{wallet-B06zvDXp.d.ts → wallet-DZWL7lJH.d.ts} +1 -1
  57. package/dist/{x-C28SNifw.d.ts → x-KFJD2x8y.d.ts} +2 -2
  58. package/package.json +1 -1
  59. package/dist/chunk-XGXDINGM.js +0 -357
  60. package/dist/runtime/chunks/BG43KQ2T.js +0 -1
package/dist/browser.d.ts CHANGED
@@ -1,15 +1,24 @@
1
- import { o as SubmissionStore, f as RelayClientOptions, R as RelayClient } from './client-3b9HjSzZ.js';
2
- export { C as CosmosChains, D as DiscoveredWallet, E as Eip1193Provider, a as EmailSignInOption, K as KeplrLike, O as OAuthSignInOption, S as SignInClient, b as SignInIcon, c as SignInMethods, d as SignInOption, e as SignInOptions, f as SignInUnavailable, g as SignInWallet, h as SolanaInjectedProvider, i as StandardWallet, j as StandardWalletAccount, T as TelegramSignInOption, W as WalletSignInOption, k as cosmosChainList, l as cosmosSigner, m as discoverCosmosWallets, n as discoverEvmWallets, o as discoverSignInWallets, p as discoverSolanaWallets, q as evmSigner, s as signInOptions, r as solanaSigner, t as telegramMiniAppInitData, w as walletStandardSolanaSigner } from './telegram-browser-o3OIxGrJ.js';
1
+ import { o as SubmissionStore, f as RelayClientOptions, R as RelayClient } from './client-Cw1pB5sv.js';
2
+ export { C as CosmosChains, D as DiscoveredWallet, E as Eip1193Provider, a as EmailSignInOption, K as KeplrLike, O as OAuthSignInOption, S as SignInClient, b as SignInIcon, c as SignInMethods, d as SignInOption, e as SignInOptions, f as SignInUnavailable, g as SignInWallet, h as SolanaInjectedProvider, i as StandardWallet, j as StandardWalletAccount, T as TelegramSignInOption, W as WalletSignInOption, k as cosmosChainList, l as cosmosSigner, m as discoverCosmosWallets, n as discoverEvmWallets, o as discoverSignInWallets, p as discoverSolanaWallets, q as evmSigner, s as signInOptions, r as solanaSigner, t as telegramMiniAppInitData, w as walletStandardSolanaSigner } from './telegram-browser-CTJh4Ro_.js';
3
3
  export { H as HostEnvironment, g as getHostEnvironment } from './host-environment-FN4zg3hw.js';
4
- import './schema-BA0nRRlt.js';
4
+ import { M as MemberSummary } from './participant-activity-DHL8QYks.js';
5
+ import './schema-CwbRkmlr.js';
5
6
  import 'zod';
6
- import './wallet-B06zvDXp.js';
7
- import './pages-ChDVLrgR.js';
8
- import './submission-input-DxQ6RnKo.js';
9
- import './groups-CFuTfFqG.js';
7
+ import './wallet-DZWL7lJH.js';
8
+ import './pages-Bti7g5mX.js';
9
+ import './submission-input-D9EGH_yb.js';
10
+ import './groups-9Jm3peq3.js';
10
11
  import './action-DBzILFx9.js';
11
- import './participant-activity-iciCEs_8.js';
12
- import './accounts-CVonEkdb.js';
12
+ import './accounts-DoabriBX.js';
13
+
14
+ /**
15
+ * The member's time at the real instant `at` (default now), in epoch milliseconds: what an app
16
+ * compares campaign phases and quest dates against, so it shows what Relay judges on. Applies
17
+ * `me.clock.offsetMs` from `GET /v1/me`, which moves when the staging toolbar moves a test member's
18
+ * clock; read `/v1/me` again on `domino:test-state-changed`. Without `clock` (a Relay older than
19
+ * it) the member's time is real time.
20
+ */
21
+ declare function memberTime(me: Pick<MemberSummary, "clock">, at?: number): number;
13
22
 
14
23
  /** Browser client with durable submission recovery; safe to construct during SSR. */
15
24
  declare function createBrowserRelayClient(options: RelayClientOptions): RelayClient;
@@ -21,4 +30,4 @@ declare function createBrowserRelayClient(options: RelayClientOptions): RelayCli
21
30
  */
22
31
  declare function browserSubmissionStore(): SubmissionStore;
23
32
 
24
- export { browserSubmissionStore, createBrowserRelayClient };
33
+ export { browserSubmissionStore, createBrowserRelayClient, memberTime };
package/dist/browser.js CHANGED
@@ -8,23 +8,24 @@ import {
8
8
  discoverSignInWallets,
9
9
  discoverSolanaWallets,
10
10
  evmSigner,
11
+ memberTime,
11
12
  signInOptions,
12
13
  solanaSigner,
13
14
  telegramMiniAppInitData,
14
15
  walletStandardSolanaSigner
15
- } from "./chunk-2LKGAL63.js";
16
- import "./chunk-577DG2IT.js";
17
- import "./chunk-KYUQEZZA.js";
18
- import "./chunk-6U5WWH3W.js";
19
- import "./chunk-UEMLYPKJ.js";
20
- import "./chunk-XGXDINGM.js";
16
+ } from "./chunk-2FHNY52R.js";
17
+ import "./chunk-VVRQQRMQ.js";
18
+ import "./chunk-4OFH4BNX.js";
19
+ import "./chunk-XQKUJL7H.js";
20
+ import "./chunk-MJEJQH5A.js";
21
+ import "./chunk-YNW2ZUUP.js";
21
22
  import {
22
23
  getHostEnvironment
23
24
  } from "./chunk-KDR2VAJP.js";
24
- import "./chunk-R4S6BFOH.js";
25
- import "./chunk-TZJT5CRF.js";
26
- import "./chunk-EQF4ID47.js";
27
- import "./chunk-AWWCEP7F.js";
25
+ import "./chunk-6ZG7WNYX.js";
26
+ import "./chunk-N7YOS4ZU.js";
27
+ import "./chunk-422J3QRW.js";
28
+ import "./chunk-GBSDAD3N.js";
28
29
  export {
29
30
  browserSubmissionStore,
30
31
  cosmosChainList,
@@ -36,6 +37,7 @@ export {
36
37
  discoverSolanaWallets,
37
38
  evmSigner,
38
39
  getHostEnvironment,
40
+ memberTime,
39
41
  signInOptions,
40
42
  solanaSigner,
41
43
  telegramMiniAppInitData,
@@ -51,6 +51,26 @@ declare const budgetSchema: z.ZodObject<{
51
51
  }, z.core.$strict>]>;
52
52
  }, z.core.$strict>;
53
53
  type Budget = z.infer<typeof budgetSchema>;
54
+ /**
55
+ * A budget counted per tracker record author: the account that caused the record, such as a
56
+ * reaction's reactor, whether or not it belongs to a member. It caps what one person gives when a
57
+ * quest pays someone else. Only quests with a tracker trigger take one, in their `authorBudgets`.
58
+ */
59
+ declare const authorBudgetSchema: z.ZodObject<{
60
+ id: z.ZodString;
61
+ period: z.ZodEnum<{
62
+ lifetime: "lifetime";
63
+ day: "day";
64
+ week: "week";
65
+ month: "month";
66
+ }>;
67
+ limit: z.ZodNumber;
68
+ cost: z.ZodUnion<readonly [z.ZodNumber, z.ZodObject<{
69
+ balance: z.ZodString;
70
+ }, z.core.$strict>]>;
71
+ scope: z.ZodLiteral<"author">;
72
+ }, z.core.$strict>;
73
+ type AuthorBudget = z.infer<typeof authorBudgetSchema>;
54
74
  /**
55
75
  * One of the member's accepted, unrevoked quest completions, as `ctx.member.completions()` reads
56
76
  * it. `quest` is the quest's key and `key` the completion key. `completedAt` is when it was
@@ -136,4 +156,4 @@ declare class CapabilityError extends Error {
136
156
  static from(failure: CapabilityFailure): CapabilityError;
137
157
  }
138
158
 
139
- export { type Budget as B, CapabilityError as C, type KnownCapabilityErrorCode as K, type MemberCompletion as M, type CapabilityErrorCode as a, type CapabilityFailure as b, capabilityErrorCodes as c, budgetSchema as d, capabilityFailureSchema as e, completionKeySchema as f, completionPolicySchema as g, memberCompletionSchema as h, maxMemberCompletions as m };
159
+ export { type AuthorBudget as A, type Budget as B, CapabilityError as C, type KnownCapabilityErrorCode as K, type MemberCompletion as M, type CapabilityErrorCode as a, type CapabilityFailure as b, capabilityErrorCodes as c, authorBudgetSchema as d, budgetSchema as e, capabilityFailureSchema as f, completionKeySchema as g, completionPolicySchema as h, maxMemberCompletions as i, memberCompletionSchema as m };
@@ -1,12 +1,12 @@
1
1
  import {
2
2
  createRelayClient
3
- } from "./chunk-577DG2IT.js";
3
+ } from "./chunk-VVRQQRMQ.js";
4
4
  import {
5
5
  RelayErrorCode,
6
6
  asRelayError,
7
7
  clientError,
8
8
  cosmosChain
9
- } from "./chunk-AWWCEP7F.js";
9
+ } from "./chunk-GBSDAD3N.js";
10
10
 
11
11
  // src/base58.ts
12
12
  var alphabet = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
@@ -520,6 +520,11 @@ function telegramMiniAppInitData() {
520
520
  return new URLSearchParams(hash.replace(/^#/, "")).get("tgWebAppData") || null;
521
521
  }
522
522
 
523
+ // src/member-time.ts
524
+ function memberTime(me, at = Date.now()) {
525
+ return at + (me.clock?.offsetMs ?? 0);
526
+ }
527
+
523
528
  // src/browser.ts
524
529
  function createBrowserRelayClient(options) {
525
530
  return createRelayClient({
@@ -699,6 +704,7 @@ export {
699
704
  readSignInMethods,
700
705
  signInOptions,
701
706
  telegramMiniAppInitData,
707
+ memberTime,
702
708
  createBrowserRelayClient,
703
709
  browserSubmissionStore
704
710
  };
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  identifier
3
- } from "./chunk-AWWCEP7F.js";
3
+ } from "./chunk-GBSDAD3N.js";
4
4
 
5
5
  // src/auth.ts
6
6
  import * as z from "zod";
@@ -52,7 +52,17 @@ var memberSummarySchema = z.object({
52
52
  * only for activity are left out. Empty when there are none. Absent from a Relay older than
53
53
  * this field.
54
54
  */
55
- emails: z.array(z.string().min(1)).optional()
55
+ emails: z.array(z.string().min(1)).optional(),
56
+ /**
57
+ * The member's clock, which Relay judges their activity on. `now` is their current time in epoch
58
+ * milliseconds and `offsetMs` how far it runs ahead of real time: a test member's clock moves
59
+ * when the staging toolbar or `domino test-members advance` moves it, and every other member's
60
+ * offset is 0. `memberTime()` keeps it ticking. Absent from a Relay older than this field.
61
+ */
62
+ clock: z.object({
63
+ now: z.number().int().nonnegative(),
64
+ offsetMs: z.number().int()
65
+ }).optional()
56
66
  });
57
67
  var exchangeSchema = authScopeSchema.extend({
58
68
  identity: z.object({ issuer: identifier, subject: z.string().min(1).max(200) }).strict(),
@@ -2,7 +2,7 @@ import {
2
2
  RelayErrorCode,
3
3
  clientError,
4
4
  isRequestError
5
- } from "./chunk-AWWCEP7F.js";
5
+ } from "./chunk-GBSDAD3N.js";
6
6
 
7
7
  // src/action.ts
8
8
  function withActionId(value) {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  isRequestError
3
- } from "./chunk-AWWCEP7F.js";
3
+ } from "./chunk-GBSDAD3N.js";
4
4
 
5
5
  // src/request-lifetime.ts
6
6
  var PARTICIPANT_TIMEOUT = 15e3;