@domino-sdk/relay 1.66.1 → 1.68.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 (72) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/dist/{accounts-_lNsiR2k.d.ts → accounts-DnpKoJCo.d.ts} +210 -3
  3. package/dist/{attempt-captures-BqPggxTU.d.ts → attempt-captures-DMNFMYFb.d.ts} +9 -1
  4. package/dist/authoring.d.ts +352 -40
  5. package/dist/authoring.js +131 -22
  6. package/dist/{automatic-outcomes-BzAvfcpd.d.ts → automatic-outcomes-CQ3vpiQl.d.ts} +2 -2
  7. package/dist/avatar.d.ts +1 -1
  8. package/dist/browser.d.ts +10 -9
  9. package/dist/browser.js +12 -12
  10. package/dist/{catalog-ByZMRS7I.d.ts → catalog-BLGie8Lh.d.ts} +60 -2
  11. package/dist/chunk-4JSPMFO2.js +427 -0
  12. package/dist/{chunk-5LD5DKOM.js → chunk-55WJVFWC.js} +2 -2
  13. package/dist/{chunk-CJDB6W6I.js → chunk-5AKD4ZF3.js} +75 -36
  14. package/dist/{chunk-7MQCQYEE.js → chunk-6UBFSMCM.js} +1 -1
  15. package/dist/{chunk-XCEGNKGH.js → chunk-6YTSRWRB.js} +1254 -700
  16. package/dist/{chunk-OWDIR7ZU.js → chunk-75KF633N.js} +9 -1
  17. package/dist/{chunk-4TC4HK5Y.js → chunk-7YSVZA7A.js} +1 -1
  18. package/dist/{chunk-7HTRIEM7.js → chunk-CZ7NQ7W7.js} +11 -68
  19. package/dist/{chunk-ANVAUOJP.js → chunk-DDJN2T5A.js} +1 -1
  20. package/dist/{chunk-M66Y5OMJ.js → chunk-DNPDR4Z7.js} +16 -9
  21. package/dist/{chunk-FU3W4IQN.js → chunk-EXZVWQOQ.js} +2 -2
  22. package/dist/{chunk-5DYS2OIP.js → chunk-HXTKI34N.js} +14 -2
  23. package/dist/{chunk-FGXLXENM.js → chunk-IW46TW3A.js} +21 -1
  24. package/dist/{chunk-2Y4EZKET.js → chunk-KKHENO57.js} +2 -2
  25. package/dist/{chunk-U66GUVSG.js → chunk-LZXDYSUH.js} +2 -0
  26. package/dist/{chunk-QYHEHMCG.js → chunk-MEUAJIVO.js} +2 -2
  27. package/dist/{chunk-BQXRCJ3N.js → chunk-P4TPW4SY.js} +1 -1
  28. package/dist/{chunk-CGUL4MRE.js → chunk-R3MNZKNJ.js} +1 -1
  29. package/dist/{chunk-R2LHIWAM.js → chunk-SD74HD75.js} +45 -9
  30. package/dist/{chunk-FUFMYKSQ.js → chunk-TYZFVL73.js} +136 -5
  31. package/dist/chunk-VAGGGB6B.js +87 -0
  32. package/dist/{chunk-2HHZV7U3.js → chunk-VRZZB7CQ.js} +1 -1
  33. package/dist/{client-Cze4lfwA.d.ts → client-BMif22WQ.d.ts} +136 -7
  34. package/dist/{dashboards-pVfclkyh.d.ts → dashboards-DMk-vL1q.d.ts} +4 -4
  35. package/dist/{deployments-Cr1tfqrr.d.ts → deployments-BCr418BX.d.ts} +582 -173
  36. package/dist/{identity-integration-Ci2vGKtX.d.ts → identity-integration-r76xaAax.d.ts} +10 -2
  37. package/dist/index.d.ts +10 -10
  38. package/dist/index.js +10 -10
  39. package/dist/internal.d.ts +155 -14
  40. package/dist/internal.js +255 -25
  41. package/dist/{limits-pE04y9O2.d.ts → limits-ByVRQePO.d.ts} +6 -1
  42. package/dist/{offers-Hw2P6tcK.d.ts → offers-xcPbYaEv.d.ts} +2 -2
  43. package/dist/portal-proxy.d.ts +5 -5
  44. package/dist/portal-proxy.js +13 -15
  45. package/dist/react/index.d.ts +38 -15
  46. package/dist/react/index.js +12 -12
  47. package/dist/{reward-deliveries-BCV8hznc.d.ts → reward-deliveries-0VvT6LMj.d.ts} +1 -1
  48. package/dist/runtime/authoring.js +1 -1
  49. package/dist/runtime/chunks/2UDZ6TPL.js +1 -0
  50. package/dist/runtime/manifest.json +3 -3
  51. package/dist/runtime/schema.js +1 -1
  52. package/dist/schema.d.ts +401 -104
  53. package/dist/schema.js +66 -8
  54. package/dist/server/index.d.ts +12 -12
  55. package/dist/server/index.js +2288 -873
  56. package/dist/{sign-in-providers-BAkGjSXo.d.ts → sign-in-providers-C5_753DZ.d.ts} +2 -2
  57. package/dist/solana.d.ts +171 -0
  58. package/dist/solana.js +364 -0
  59. package/dist/{submission-input-ChL1aYNH.d.ts → submission-input-CaL8drIh.d.ts} +2 -2
  60. package/dist/{telegram-browser-BFs4u7lC.d.ts → telegram-browser-DLtHPRBI.d.ts} +6 -108
  61. package/dist/telegram.d.ts +8 -8
  62. package/dist/telegram.js +2 -2
  63. package/dist/testing.d.ts +87 -14
  64. package/dist/testing.js +108 -11
  65. package/dist/{tracker-data-Bl-qPIvZ.d.ts → tracker-data-CAK942sx.d.ts} +300 -3
  66. package/dist/{transport-WE49Ta3A.d.ts → transport-CkidqTOk.d.ts} +5866 -1244
  67. package/dist/{wallet-B7e06v4m.d.ts → wallet-DQtJelQQ.d.ts} +418 -33
  68. package/dist/wallet-browser-dpmr22Xv.d.ts +106 -0
  69. package/package.json +18 -1
  70. package/dist/chunk-UYVJZR33.js +0 -34
  71. package/dist/chunk-UZ765UGH.js +0 -18
  72. package/dist/runtime/chunks/C5V267I7.js +0 -1
@@ -1,15 +1,15 @@
1
- import { k as RelayRequestOptions, R as RelayClient } from './client-Cze4lfwA.js';
1
+ import { k as RelayRequestOptions, R as RelayClient } from './client-BMif22WQ.js';
2
2
  import { b as ParticipantSession } from './participant-activity-DXRq4s6K.js';
3
- import './accounts-_lNsiR2k.js';
3
+ import './accounts-DnpKoJCo.js';
4
4
  import 'zod';
5
- import './tracker-data-Bl-qPIvZ.js';
6
- import './wallet-B7e06v4m.js';
7
- import './submission-input-ChL1aYNH.js';
5
+ import './tracker-data-CAK942sx.js';
6
+ import './wallet-DQtJelQQ.js';
7
+ import './submission-input-CaL8drIh.js';
8
8
  import './request-error-D_dUPLwo.js';
9
- import './reward-deliveries-BCV8hznc.js';
10
- import './catalog-ByZMRS7I.js';
9
+ import './reward-deliveries-0VvT6LMj.js';
10
+ import './catalog-BLGie8Lh.js';
11
11
  import './action-9Xl0StBg.js';
12
- import './sign-in-providers-BAkGjSXo.js';
12
+ import './sign-in-providers-C5_753DZ.js';
13
13
 
14
14
  /**
15
15
  * A plugin's own sign-in method, such as Telegram's Mini App sign-in: the app passes the vendor's
package/dist/telegram.js CHANGED
@@ -3,8 +3,8 @@ import {
3
3
  } from "./chunk-FWLQ5XCS.js";
4
4
  import {
5
5
  withPluginNamespace
6
- } from "./chunk-2HHZV7U3.js";
7
- import "./chunk-FGXLXENM.js";
6
+ } from "./chunk-VRZZB7CQ.js";
7
+ import "./chunk-IW46TW3A.js";
8
8
 
9
9
  // src/plugins/telegram.generated.ts
10
10
  function withTelegram(relay) {
package/dist/testing.d.ts CHANGED
@@ -1,19 +1,19 @@
1
- import { d5 as pointBalanceSchema, bD as discordMemberSchema, bG as discordMessageSchema, c$ as photoResultSchema, a8 as TextReviewInput, H as Reward, ac as Decision, P as PointBalance, y as PointLedgerReference, u as PointEntry, o as LeaderboardPage } from './accounts-_lNsiR2k.js';
1
+ import { de as pointBalanceSchema, bM as discordMemberSchema, bP as discordMessageSchema, d8 as photoResultSchema, aa as TextReviewInput, H as Reward, ae as Decision, P as PointBalance, y as PointLedgerReference, u as PointEntry, o as LeaderboardPage } from './accounts-DnpKoJCo.js';
2
+ import { N as NftCollection, X as SolanaSeed, bl as profileReferralSchema, b8 as linkedWalletSchema, by as walletBalanceSchema, bE as walletNftsSchema, a1 as WalletCallArgument, bz as walletCallSchema, bB as walletDelegationsSchema, a5 as WalletEventCondition, bC as walletEventsSchema, bN as walletTransactionsSchema, bF as walletProgramAccountSchema, bL as walletStakeSchema, S as SolanaNetwork, H as WalletReader } from './wallet-DQtJelQQ.js';
2
3
  import * as z from 'zod';
3
- import { N as NftCollection, aO as profileReferralSchema, aE as linkedWalletSchema, aY as walletBalanceSchema, b2 as walletNftsSchema, M as WalletCallArgument, aZ as walletCallSchema, a$ as walletDelegationsSchema, U as WalletEventCondition, b0 as walletEventsSchema, b7 as walletTransactionsSchema, v as WalletReader } from './wallet-B7e06v4m.js';
4
4
  import { f as CapabilityFailure, q as memberCompletionSchema } from './capability-error-CuI_F7yM.js';
5
5
  export { C as CapabilityError } from './capability-error-CuI_F7yM.js';
6
- import { C as xConnectionSchema, G as xProfileSchema, F as xPostSchema, g as ImageReference, u as imageInspectionSchema, q as imageComparisonSchema, x as imageSightingsSchema } from './limits-pE04y9O2.js';
7
- export { L as Limits, l as limits } from './limits-pE04y9O2.js';
8
- import { aM as memberIdentitySchema, bf as trackerQuerySchema, ba as trackerPageSchema, bo as trackerSummarySchema, ac as TrackerContentQuery, aX as trackerContentSchema, a8 as TrackerAttribution, o as Tracker, p as TrackerData, H as ContentBody, B as TrackerTriggerContext, U as TrackerPage } from './tracker-data-Bl-qPIvZ.js';
9
- import { C as telegramConnectionSchema, y as telegramChatMemberSchema, e as TelegramReader } from './submission-input-ChL1aYNH.js';
6
+ import { C as xConnectionSchema, G as xProfileSchema, F as xPostSchema, g as ImageReference, u as imageInspectionSchema, q as imageComparisonSchema, x as imageSightingsSchema } from './limits-ByVRQePO.js';
7
+ export { L as Limits, l as limits } from './limits-ByVRQePO.js';
8
+ import { aS as memberIdentitySchema, bo as trackerQuerySchema, bj as trackerPageSchema, bx as trackerSummarySchema, af as TrackerContentQuery, b4 as trackerContentSchema, ab as TrackerAttribution, g as Tracker, h as TrackerData, C as ContentBody, p as TrackerTriggerContext, y as TrackerPage } from './tracker-data-CAK942sx.js';
9
+ import { C as telegramConnectionSchema, y as telegramChatMemberSchema, e as TelegramReader } from './submission-input-CaL8drIh.js';
10
10
  import { EvaluationMember } from './authoring.js';
11
- export { A as AttemptCapture, C as CapturedFact } from './attempt-captures-BqPggxTU.js';
11
+ export { A as AttemptCapture, C as CapturedFact } from './attempt-captures-DMNFMYFb.js';
12
12
  import { b as ParticipantSession, R as RelayEvent } from './participant-activity-DXRq4s6K.js';
13
- import { B as Badge } from './offers-Hw2P6tcK.js';
14
- import { b as QuestView, q as questExperienceSchema } from './catalog-ByZMRS7I.js';
13
+ import { B as Badge } from './offers-xcPbYaEv.js';
14
+ import { b as QuestView, q as questExperienceSchema } from './catalog-BLGie8Lh.js';
15
15
  import './streaks-0YuipsUQ.js';
16
- import './dashboards-pVfclkyh.js';
16
+ import './dashboards-DMk-vL1q.js';
17
17
  import './units-CwgsPB_r.js';
18
18
 
19
19
  /** One project time-zone change: from `effectiveAt` on, days are counted in `timeZone`. */
@@ -26,7 +26,7 @@ type CalendarSegment = {
26
26
  declare const capabilityRequestSchemas: {
27
27
  "wallet-balance": z.ZodObject<{
28
28
  kind: z.ZodLiteral<"wallet-balance">;
29
- chain: z.ZodUnion<readonly [z.ZodLiteral<"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp">, z.ZodCustom<`eip155:${number}`, `eip155:${number}`>, z.ZodCustom<`cosmos:${string}`, `cosmos:${string}`>]>;
29
+ chain: z.ZodUnion<readonly [z.ZodLiteral<"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp">, z.ZodLiteral<"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1">, z.ZodCustom<`eip155:${number}`, `eip155:${number}`>, z.ZodCustom<`cosmos:${string}`, `cosmos:${string}`>]>;
30
30
  token: z.ZodNullable<z.ZodString>;
31
31
  address: z.ZodNullable<z.ZodString>;
32
32
  }, z.core.$strict>;
@@ -268,12 +268,31 @@ type WalletEventsRequest = z.output<typeof walletEventsRequestSchema>;
268
268
  declare const walletTransactionsRequestSchema: z.ZodObject<{
269
269
  kind: z.ZodLiteral<"wallet-transactions">;
270
270
  program: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
271
+ chain: z.ZodOptional<z.ZodLiteral<"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1">>;
271
272
  since: z.ZodNumber;
272
273
  afterActivation: z.ZodBoolean;
273
274
  mint: z.ZodNullable<z.ZodString>;
274
275
  address: z.ZodNullable<z.ZodString>;
275
276
  }, z.core.$strict>;
276
277
  type WalletTransactionsRequest = z.output<typeof walletTransactionsRequestSchema>;
278
+ /** `ctx.wallet.programAccount()`'s request: answered and numbered like transaction reads, and unlisted the same way. */
279
+ declare const walletProgramAccountRequestSchema: z.ZodObject<{
280
+ kind: z.ZodLiteral<"wallet-program-account">;
281
+ program: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
282
+ chain: z.ZodOptional<z.ZodLiteral<"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1">>;
283
+ account: z.ZodString;
284
+ seeds: z.ZodArray<z.ZodType<SolanaSeed, unknown, z.core.$ZodTypeInternals<SolanaSeed, unknown>>>;
285
+ address: z.ZodNullable<z.ZodString>;
286
+ }, z.core.$strict>;
287
+ type WalletProgramAccountRequest = z.output<typeof walletProgramAccountRequestSchema>;
288
+ /** `ctx.wallet.stake()`'s request: answered and numbered like transaction reads, and unlisted the same way. */
289
+ declare const walletStakeRequestSchema: z.ZodObject<{
290
+ kind: z.ZodLiteral<"wallet-stake">;
291
+ chain: z.ZodOptional<z.ZodLiteral<"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1">>;
292
+ voteAccount: z.ZodNullable<z.ZodString>;
293
+ address: z.ZodNullable<z.ZodString>;
294
+ }, z.core.$strict>;
295
+ type WalletStakeRequest = z.output<typeof walletStakeRequestSchema>;
277
296
  /**
278
297
  * `ctx.wallet.call()`'s and `ctx.wallet.delegations()`'s requests. Like NFT reads, they stay out of
279
298
  * the closed `CapabilityRequest`: the kit answers and numbers them, but lists them only in a run's `capabilityCalls`, not in the deprecated `calls`.
@@ -324,7 +343,7 @@ declare const memberStateRequestSchemas: {
324
343
  };
325
344
  type MemberStateRequest = z.output<(typeof memberStateRequestSchemas)[keyof typeof memberStateRequestSchemas]>;
326
345
  /** Every request the kit answers: the public `CapabilityRequest` kinds, Telegram's, NFT, contract call and delegation reads, and the member's state. */
327
- type KitRequest = CapabilityRequest | TelegramRequest | WalletNftsRequest | WalletCallRequest | WalletDelegationsRequest | WalletEventsRequest | WalletTransactionsRequest | MemberStateRequest;
346
+ type KitRequest = CapabilityRequest | TelegramRequest | WalletNftsRequest | WalletCallRequest | WalletDelegationsRequest | WalletEventsRequest | WalletTransactionsRequest | WalletProgramAccountRequest | WalletStakeRequest | MemberStateRequest;
328
347
  /**
329
348
  * The capability kinds this release of the kit knows, one per reader method family.
330
349
  *
@@ -405,6 +424,26 @@ type WalletTransactionsQueryRequest = {
405
424
  mint: string | null;
406
425
  address: string | null;
407
426
  };
427
+ /**
428
+ * A program-account read as Relay receives it: `chain` only for devnet, and `address` null when
429
+ * the quest leaves it out.
430
+ */
431
+ type WalletProgramAccountQueryRequest = {
432
+ program: string;
433
+ chain?: string;
434
+ account: string;
435
+ seeds: SolanaSeed[];
436
+ address: string | null;
437
+ };
438
+ /**
439
+ * A stake read as Relay receives it: `chain` only for devnet, and `voteAccount` and `address` null
440
+ * when the quest leaves them out.
441
+ */
442
+ type WalletStakeQueryRequest = {
443
+ chain?: string;
444
+ voteAccount: string | null;
445
+ address: string | null;
446
+ };
408
447
  /** A tracker read as Relay receives it: defaults applied, and `asOf` set (`eligibleAt` unless given). */
409
448
  type TrackerReadRequest = z.output<typeof trackerQuerySchema> & {
410
449
  asOf: number;
@@ -427,7 +466,7 @@ type TrackerFacts = {
427
466
  *
428
467
  * Reads of the member's own accounts default to a member who has linked nothing:
429
468
  * `member.identities()`, `wallet.list()`, `wallet.balance()`, `wallet.nfts()`, `wallet.call()`,
430
- * `wallet.delegations()`, `x.connection()`, `x.profile()`,
469
+ * `wallet.delegations()`, `wallet.events()`, `wallet.transactions()`, `wallet.programAccount()`, `wallet.stake()`, `x.connection()`, `x.profile()`,
431
470
  * `x.follows()`, `x.reposted()`, `discord.member()`, `telegram.connection()` and `telegram.member()` resolve to null. Once the test links an
432
471
  * account (`wallet.list` or `x.connection` set to a value), supply every read of it the quest
433
472
  * makes. Every other read (the member's balances, completions, groups, campaigns and referrals, an
@@ -509,11 +548,30 @@ type TestFacts = {
509
548
  * `ctx.wallet.transactions({ program, since })`. Like `balance`, it reads null while the
510
549
  * member has no linked Solana wallet. The kit does not apply `program`, `since` or `mint`:
511
550
  * answer with the transactions Relay would return, with `instructions` when the program's
512
- * setting has an Anchor IDL. A run's `capabilityCalls` lists these calls; the deprecated `calls` does not.
551
+ * setting has an IDL. A run's `capabilityCalls` lists these calls; the deprecated `calls` does not.
513
552
  */
514
553
  transactions?: FakeAnswer<[
515
554
  query: WalletTransactionsQueryRequest
516
555
  ], Result<typeof walletTransactionsSchema> | null>;
556
+ /**
557
+ * `ctx.wallet.programAccount({ program, account, seeds })`. Like `balance`, it reads null
558
+ * while the member has no linked Solana wallet. The kit does not derive or decode accounts:
559
+ * answer with the decoded fields Relay would return per wallet, `fields: null` for a wallet
560
+ * without the account. A run's `capabilityCalls` lists these calls; the deprecated `calls`
561
+ * does not.
562
+ */
563
+ programAccount?: FakeAnswer<[
564
+ query: WalletProgramAccountQueryRequest
565
+ ], Result<typeof walletProgramAccountSchema> | null>;
566
+ /**
567
+ * `ctx.wallet.stake({ voteAccount })`. Like `balance`, it reads null while the member has no
568
+ * linked Solana wallet. The kit does not classify stake accounts: answer with the amounts
569
+ * Relay would return. A run's `capabilityCalls` lists these calls; the deprecated `calls`
570
+ * does not.
571
+ */
572
+ stake?: FakeAnswer<[
573
+ query: WalletStakeQueryRequest
574
+ ], Result<typeof walletStakeSchema> | null>;
517
575
  };
518
576
  x?: {
519
577
  connection?: FakeAnswer<[], Result<typeof xConnectionSchema> | null>;
@@ -669,6 +727,21 @@ type RunQuestOptions<Q extends TestableQuest = TestableQuest> = {
669
727
  * `trackerObservation(tracker, { data })`.
670
728
  */
671
729
  tracker?: unknown;
730
+ /**
731
+ * The signed Solana transaction that started the attempt, `ctx.action`: the member's `wallet`
732
+ * that signed it and the memo's `reference`. As in Relay, only a member-submitted `manual()`
733
+ * quest without input takes one. `signature` and `chain` (mainnet) have defaults. On a quest with
734
+ * `stations`, the reference must name a station open at `now`, which stands in for the
735
+ * transaction's block time, and a run without an action is refused, as Relay refuses them.
736
+ *
737
+ * @experimental A minor release can change quest actions.
738
+ */
739
+ action?: {
740
+ wallet: string;
741
+ reference?: string | null;
742
+ signature?: string;
743
+ chain?: SolanaNetwork;
744
+ };
672
745
  /** A content quest's performance stage: the metric sample to evaluate. */
673
746
  performance?: {
674
747
  metrics: Record<string, number>;
package/dist/testing.js CHANGED
@@ -1,19 +1,19 @@
1
1
  import {
2
2
  attemptCaptureSchema
3
- } from "./chunk-OWDIR7ZU.js";
3
+ } from "./chunk-75KF633N.js";
4
4
  import {
5
5
  parseImageResult
6
- } from "./chunk-FU3W4IQN.js";
6
+ } from "./chunk-EXZVWQOQ.js";
7
7
  import {
8
8
  isParticipantRoute
9
- } from "./chunk-U66GUVSG.js";
9
+ } from "./chunk-LZXDYSUH.js";
10
10
  import {
11
11
  imageRequestSchema,
12
12
  xConnectionSchema,
13
13
  xPostSchema,
14
14
  xProfileSchema,
15
15
  xRequestSchema
16
- } from "./chunk-ANVAUOJP.js";
16
+ } from "./chunk-DDJN2T5A.js";
17
17
  import {
18
18
  CapabilityError
19
19
  } from "./chunk-MWMCQLCG.js";
@@ -22,7 +22,7 @@ import {
22
22
  participantActivitySchema,
23
23
  participantSessionSchema,
24
24
  questExperienceSchema
25
- } from "./chunk-7MQCQYEE.js";
25
+ } from "./chunk-6UBFSMCM.js";
26
26
  import {
27
27
  badgeCatalogSchema,
28
28
  badgeSchema,
@@ -34,6 +34,7 @@ import {
34
34
  discordMessageInputSchema,
35
35
  discordMessageSchema,
36
36
  evmChainIdSchema,
37
+ evmWalletOn,
37
38
  identifier,
38
39
  isContractCall,
39
40
  isContractEvent,
@@ -43,6 +44,7 @@ import {
43
44
  leaderboardPageSchema,
44
45
  limits,
45
46
  linkedWalletSchema,
47
+ maxSolanaSeeds,
46
48
  memberCompletionSchema,
47
49
  memberIdentitySchema,
48
50
  photoResultSchema,
@@ -51,10 +53,15 @@ import {
51
53
  pointHistoryPageSchema,
52
54
  pointLedgerReferenceSchema,
53
55
  profileReferralSchema,
56
+ questStationsSchema,
54
57
  quizEvidenceSchema,
55
58
  rewardKey,
56
59
  solanaAddressSchema,
60
+ solanaDevnet,
57
61
  solanaMainnet,
62
+ solanaSeedSchema,
63
+ stationRefusal,
64
+ takesSolanaTransaction,
58
65
  telegramChatMemberSchema,
59
66
  telegramConnectionInputSchema,
60
67
  telegramConnectionSchema,
@@ -76,11 +83,13 @@ import {
76
83
  walletDelegationsSchema,
77
84
  walletEventsSchema,
78
85
  walletNftsSchema,
86
+ walletProgramAccountSchema,
87
+ walletStakeSchema,
79
88
  walletTransactionsSchema
80
- } from "./chunk-XCEGNKGH.js";
89
+ } from "./chunk-6YTSRWRB.js";
81
90
  import {
82
91
  RelayErrorCode
83
- } from "./chunk-FGXLXENM.js";
92
+ } from "./chunk-IW46TW3A.js";
84
93
 
85
94
  // src/testing/run.ts
86
95
  import * as z3 from "zod";
@@ -180,6 +189,7 @@ var capabilityRequestSchemas = /* @__PURE__ */ (() => ({
180
189
  kind: z.literal("wallet-balance"),
181
190
  chain: z.union([
182
191
  z.literal(solanaMainnet),
192
+ z.literal(solanaDevnet),
183
193
  evmChainIdSchema,
184
194
  cosmosNetworkSchema
185
195
  ]),
@@ -246,11 +256,29 @@ var walletEventsRequestSchema = /* @__PURE__ */ (() => z.strictObject({
246
256
  var walletTransactionsRequestSchema = /* @__PURE__ */ (() => z.strictObject({
247
257
  kind: z.literal("wallet-transactions"),
248
258
  program: z.string().max(44).refine(isSolanaProgram),
259
+ /** Solana devnet; absent for mainnet, as Relay's request has it. */
260
+ chain: z.literal(solanaDevnet).optional(),
249
261
  since: z.number().int().nonnegative().safe(),
250
262
  afterActivation: z.boolean(),
251
263
  mint: solanaAddressSchema.nullable(),
252
264
  address: z.string().min(1).max(100).nullable()
253
265
  }))();
266
+ var walletProgramAccountRequestSchema = /* @__PURE__ */ (() => z.strictObject({
267
+ kind: z.literal("wallet-program-account"),
268
+ program: z.string().max(44).refine(isSolanaProgram),
269
+ /** Solana devnet; absent for mainnet, as Relay's request has it. */
270
+ chain: z.literal(solanaDevnet).optional(),
271
+ account: z.string().min(1).max(200),
272
+ seeds: z.array(solanaSeedSchema).max(maxSolanaSeeds),
273
+ address: z.string().min(1).max(100).nullable()
274
+ }))();
275
+ var walletStakeRequestSchema = /* @__PURE__ */ (() => z.strictObject({
276
+ kind: z.literal("wallet-stake"),
277
+ /** Solana devnet; absent for mainnet, as Relay's request has it. */
278
+ chain: z.literal(solanaDevnet).optional(),
279
+ voteAccount: z.string().min(1).max(100).nullable(),
280
+ address: z.string().min(1).max(100).nullable()
281
+ }))();
254
282
  var walletCallRequestSchema = /* @__PURE__ */ (() => z.strictObject({
255
283
  kind: z.literal("wallet-call"),
256
284
  call: z.string().max(400).refine(isContractCall),
@@ -295,7 +323,7 @@ var memberStateRequestSchemas = /* @__PURE__ */ (() => ({
295
323
  })
296
324
  }))();
297
325
  function unlistedRequest(request) {
298
- return request.kind === "telegram" || request.kind === "wallet-nfts" || request.kind === "wallet-call" || request.kind === "wallet-delegations" || request.kind === "wallet-events" || request.kind === "wallet-transactions" || request.kind === "member-balance" || request.kind === "member-completions" || request.kind === "member-groups" || request.kind === "member-enrolled" || request.kind === "member-referrals";
326
+ return request.kind === "telegram" || request.kind === "wallet-nfts" || request.kind === "wallet-call" || request.kind === "wallet-delegations" || request.kind === "wallet-events" || request.kind === "wallet-transactions" || request.kind === "wallet-program-account" || request.kind === "wallet-stake" || request.kind === "member-balance" || request.kind === "member-completions" || request.kind === "member-groups" || request.kind === "member-enrolled" || request.kind === "member-referrals";
299
327
  }
300
328
  var capabilityRequestSchema = /* @__PURE__ */ (() => z.discriminatedUnion("kind", [
301
329
  capabilityRequestSchemas["wallet-balance"],
@@ -315,6 +343,8 @@ var capabilityRequestSchema = /* @__PURE__ */ (() => z.discriminatedUnion("kind"
315
343
  walletDelegationsRequestSchema,
316
344
  walletEventsRequestSchema,
317
345
  walletTransactionsRequestSchema,
346
+ walletProgramAccountRequestSchema,
347
+ walletStakeRequestSchema,
318
348
  memberStateRequestSchemas["member-balance"],
319
349
  memberStateRequestSchemas["member-completions"],
320
350
  memberStateRequestSchemas["member-groups"],
@@ -373,6 +403,10 @@ function parseCapabilityResult(request, value) {
373
403
  return walletEventsSchema.nullable().parse(value);
374
404
  case "wallet-transactions":
375
405
  return walletTransactionsSchema.nullable().parse(value);
406
+ case "wallet-program-account":
407
+ return walletProgramAccountSchema.nullable().parse(value);
408
+ case "wallet-stake":
409
+ return walletStakeSchema.nullable().parse(value);
376
410
  case "member-balance":
377
411
  return pointBalanceSchema.parse(value);
378
412
  case "member-completions":
@@ -429,6 +463,7 @@ function capabilityEvidence(request) {
429
463
  (image) => "evidence" in image ? [image.evidence] : []
430
464
  );
431
465
  }
466
+ var solanaCluster = (chain) => chain === void 0 || chain === "solana" || chain === solanaMainnet ? {} : { chain };
432
467
  var readerFactories = {
433
468
  member: (call, input) => {
434
469
  const key = (reference) => typeof reference === "string" ? reference : reference.key;
@@ -539,10 +574,25 @@ var readerFactories = {
539
574
  transactions: (query) => call({
540
575
  kind: "wallet-transactions",
541
576
  program: query.program,
577
+ ...solanaCluster(query.chain),
542
578
  since: query.since,
543
579
  afterActivation: query.afterActivation ?? false,
544
580
  mint: query.mint ?? null,
545
581
  address: query.address ?? null
582
+ }),
583
+ programAccount: (query) => call({
584
+ kind: "wallet-program-account",
585
+ program: query.program,
586
+ ...solanaCluster(query.chain),
587
+ account: query.account,
588
+ seeds: query.seeds,
589
+ address: query.address ?? null
590
+ }),
591
+ stake: (query) => call({
592
+ kind: "wallet-stake",
593
+ ...solanaCluster(query.chain),
594
+ voteAccount: query.voteAccount ?? null,
595
+ address: query.address ?? null
546
596
  })
547
597
  })
548
598
  };
@@ -820,6 +870,22 @@ function fakeFor(facts, request) {
820
870
  args: [query]
821
871
  };
822
872
  }
873
+ case "wallet-program-account": {
874
+ const { kind: _, ...query } = request;
875
+ return {
876
+ name: "wallet.programAccount",
877
+ answer: facts.wallet?.programAccount,
878
+ args: [query]
879
+ };
880
+ }
881
+ case "wallet-stake": {
882
+ const { kind: _, ...query } = request;
883
+ return {
884
+ name: "wallet.stake",
885
+ answer: facts.wallet?.stake,
886
+ args: [query]
887
+ };
888
+ }
823
889
  case "x": {
824
890
  const { operation, ...input } = request.input;
825
891
  return {
@@ -903,7 +969,7 @@ function covers(wallet, chain) {
903
969
  return wallet.chain === "solana";
904
970
  }
905
971
  if (chain.startsWith("eip155:")) {
906
- return wallet.chain === "eip155";
972
+ return evmWalletOn(wallet, chain);
907
973
  }
908
974
  return wallet.chain === "cosmos" && wallet.network === chain;
909
975
  }
@@ -1102,12 +1168,20 @@ function factsAnswerer(facts) {
1102
1168
  return wallets.length ? ask(fake) : { value: null };
1103
1169
  }
1104
1170
  case "wallet-events":
1105
- case "wallet-transactions": {
1171
+ case "wallet-transactions":
1172
+ case "wallet-program-account":
1173
+ case "wallet-stake": {
1106
1174
  const pinned = await pin(walletList);
1107
1175
  if ("error" in pinned) {
1108
1176
  return pinned;
1109
1177
  }
1110
- const chain = request.kind === "wallet-events" ? request.event.split(":").slice(0, 2).join(":") : solanaMainnet;
1178
+ if (request.kind === "wallet-stake" && request.voteAccount !== null && !solanaAddressSchema.safeParse(request.voteAccount).success) {
1179
+ return failure(
1180
+ "author-error",
1181
+ `${request.voteAccount} is not a Solana vote account address`
1182
+ );
1183
+ }
1184
+ const chain = request.kind === "wallet-events" ? request.event.split(":").slice(0, 2).join(":") : request.chain ?? solanaMainnet;
1111
1185
  const wallets = (pinned.value ?? []).filter(
1112
1186
  (wallet) => covers(wallet, chain)
1113
1187
  );
@@ -1209,6 +1283,7 @@ function rewardSelectionIssue(selected, published) {
1209
1283
  var defaultNow = /* @__PURE__ */ (() => Date.UTC(2026, 0, 1))();
1210
1284
  var defaultMember = "member_test";
1211
1285
  var defaultSeed = "attempt_test";
1286
+ var defaultSignature = /* @__PURE__ */ (() => "1".repeat(64))();
1212
1287
  var maxCapabilityCalls = 8;
1213
1288
  var evaluationTimeoutMs = 15e3;
1214
1289
  var time = (value) => value instanceof Date ? value.getTime() : value;
@@ -1285,6 +1360,23 @@ function hostedRun(quest, options) {
1285
1360
  trigger,
1286
1361
  options.input
1287
1362
  );
1363
+ if (options.action && !takesSolanaTransaction(trigger)) {
1364
+ throw new TestSetupError(
1365
+ `Quest "${quest.key}" takes no Solana transaction: Relay accepts one only for a member-submitted manual() quest without input`
1366
+ );
1367
+ }
1368
+ const stations = questStationsSchema.optional().parse(release.stations);
1369
+ const station = stations && stationRefusal(stations, options.action?.reference ?? null, now);
1370
+ if (station) {
1371
+ throw new TestSetupError(`${station.message} (${station.code})`);
1372
+ }
1373
+ const action = options.action ? {
1374
+ kind: "solana-transaction",
1375
+ chain: options.action.chain ?? solanaMainnet,
1376
+ signature: options.action.signature ?? defaultSignature,
1377
+ wallet: options.action.wallet,
1378
+ reference: options.action.reference ?? null
1379
+ } : null;
1288
1380
  const performance = options.performance ? contentPerformanceSnapshotSchema.parse({
1289
1381
  contentAttempt: "attempt_content",
1290
1382
  observation: "observation_test",
@@ -1302,6 +1394,7 @@ function hostedRun(quest, options) {
1302
1394
  member,
1303
1395
  input,
1304
1396
  tracker,
1397
+ action,
1305
1398
  eligibleAt,
1306
1399
  segments: options.calendar ?? (options.timeZone ? [{ effectiveAt: 0, timeZone: options.timeZone }] : []),
1307
1400
  ...performance ? { performance } : {},
@@ -1311,6 +1404,7 @@ function hostedRun(quest, options) {
1311
1404
  }
1312
1405
  function hostContext(run, answer) {
1313
1406
  const { release, member, input, tracker, eligibleAt, performance, now } = run;
1407
+ const action = run.action ?? null;
1314
1408
  const evidence = typeof input.evidence === "string" ? input.evidence : void 0;
1315
1409
  const calendar = evaluationCalendar({ segments: run.segments }, eligibleAt);
1316
1410
  const calls = [];
@@ -1405,6 +1499,7 @@ function hostContext(run, answer) {
1405
1499
  humanReview: release.humanReview,
1406
1500
  input,
1407
1501
  tracker,
1502
+ action,
1408
1503
  eligibleAt,
1409
1504
  calendar,
1410
1505
  now,
@@ -1841,6 +1936,8 @@ async function replayAttempt(quest, capture, options = {}) {
1841
1936
  member: context.member,
1842
1937
  input: context.input,
1843
1938
  tracker: context.tracker,
1939
+ // Relay records only Solana transaction actions so far.
1940
+ action: context.action ?? null,
1844
1941
  eligibleAt: context.eligibleAt,
1845
1942
  segments: context.calendar.segments,
1846
1943
  ...context.performance ? { performance: context.performance } : {},