@domino-sdk/relay 1.67.0 → 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.
- package/CHANGELOG.md +43 -0
- package/dist/{accounts-C2O8mpB8.d.ts → accounts-DnpKoJCo.d.ts} +210 -3
- package/dist/{attempt-captures-ClHAoo_n.d.ts → attempt-captures-DMNFMYFb.d.ts} +9 -1
- package/dist/authoring.d.ts +349 -38
- package/dist/authoring.js +125 -18
- package/dist/{automatic-outcomes-BEnPn4Uh.d.ts → automatic-outcomes-CQ3vpiQl.d.ts} +2 -2
- package/dist/avatar.d.ts +1 -1
- package/dist/browser.d.ts +10 -9
- package/dist/browser.js +12 -13
- package/dist/{catalog-CbiftcxQ.d.ts → catalog-BLGie8Lh.d.ts} +60 -2
- package/dist/chunk-4JSPMFO2.js +427 -0
- package/dist/{chunk-5DZNMLDM.js → chunk-55WJVFWC.js} +2 -2
- package/dist/{chunk-Q5QVAF7R.js → chunk-5AKD4ZF3.js} +37 -25
- package/dist/{chunk-DSJ46QLB.js → chunk-6UBFSMCM.js} +1 -1
- package/dist/{chunk-P33ZAJMS.js → chunk-6YTSRWRB.js} +1199 -677
- package/dist/{chunk-RDUSFUXX.js → chunk-75KF633N.js} +9 -1
- package/dist/{chunk-Q6KTTVOI.js → chunk-7YSVZA7A.js} +1 -1
- package/dist/{chunk-BMJHFWVT.js → chunk-CZ7NQ7W7.js} +10 -43
- package/dist/{chunk-X3FMVRMM.js → chunk-DDJN2T5A.js} +1 -1
- package/dist/{chunk-KUNPCDN6.js → chunk-DNPDR4Z7.js} +16 -9
- package/dist/{chunk-RWR2LOPA.js → chunk-EXZVWQOQ.js} +2 -2
- package/dist/{chunk-MVQQDPQX.js → chunk-HXTKI34N.js} +14 -2
- package/dist/{chunk-FGXLXENM.js → chunk-IW46TW3A.js} +21 -1
- package/dist/{chunk-5SBA6X5X.js → chunk-KKHENO57.js} +2 -2
- package/dist/{chunk-U66GUVSG.js → chunk-LZXDYSUH.js} +2 -0
- package/dist/{chunk-QYC3CZVD.js → chunk-MEUAJIVO.js} +2 -2
- package/dist/{chunk-BQXRCJ3N.js → chunk-P4TPW4SY.js} +1 -1
- package/dist/{chunk-NRMQVK2W.js → chunk-R3MNZKNJ.js} +1 -1
- package/dist/{chunk-Z2Z5DBNW.js → chunk-SD74HD75.js} +45 -9
- package/dist/{chunk-JK3XV2CR.js → chunk-TYZFVL73.js} +50 -8
- package/dist/chunk-VAGGGB6B.js +87 -0
- package/dist/{chunk-2HHZV7U3.js → chunk-VRZZB7CQ.js} +1 -1
- package/dist/{client-CZPewB9h.d.ts → client-BMif22WQ.d.ts} +133 -7
- package/dist/{dashboards-jGPM3AxF.d.ts → dashboards-DMk-vL1q.d.ts} +4 -4
- package/dist/{deployments-BVFd7ddA.d.ts → deployments-BCr418BX.d.ts} +582 -173
- package/dist/{identity-integration-W1Vo3Ql9.d.ts → identity-integration-r76xaAax.d.ts} +1 -1
- package/dist/index.d.ts +10 -10
- package/dist/index.js +10 -10
- package/dist/internal.d.ts +137 -14
- package/dist/internal.js +240 -19
- package/dist/{limits-C4RzrOV4.d.ts → limits-ByVRQePO.d.ts} +6 -1
- package/dist/{offers-BpYenB9i.d.ts → offers-xcPbYaEv.d.ts} +2 -2
- package/dist/portal-proxy.d.ts +2 -2
- package/dist/portal-proxy.js +11 -11
- package/dist/react/index.d.ts +37 -15
- package/dist/react/index.js +12 -13
- package/dist/{reward-deliveries-BOWpMytr.d.ts → reward-deliveries-0VvT6LMj.d.ts} +1 -1
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/2UDZ6TPL.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/schema.d.ts +398 -104
- package/dist/schema.js +62 -8
- package/dist/server/index.d.ts +12 -12
- package/dist/server/index.js +2046 -886
- package/dist/{sign-in-providers-BRYVOSlG.d.ts → sign-in-providers-C5_753DZ.d.ts} +2 -2
- package/dist/solana.d.ts +171 -0
- package/dist/solana.js +364 -0
- package/dist/{submission-input-C152xIdn.d.ts → submission-input-CaL8drIh.d.ts} +2 -2
- package/dist/{telegram-browser-657QqiQl.d.ts → telegram-browser-DLtHPRBI.d.ts} +6 -108
- package/dist/telegram.d.ts +8 -8
- package/dist/telegram.js +2 -2
- package/dist/testing.d.ts +85 -13
- package/dist/testing.js +101 -11
- package/dist/{tracker-data-BqY-9Vu-.d.ts → tracker-data-CAK942sx.d.ts} +298 -1
- package/dist/{transport-CthYgZXK.d.ts → transport-CkidqTOk.d.ts} +5250 -1226
- package/dist/{wallet-Btng186v.d.ts → wallet-DQtJelQQ.d.ts} +367 -13
- package/dist/wallet-browser-dpmr22Xv.d.ts +106 -0
- package/package.json +16 -1
- package/dist/chunk-UWUS4OOV.js +0 -59
- package/dist/chunk-UYVJZR33.js +0 -34
- package/dist/runtime/chunks/C2MGLQXC.js +0 -1
package/dist/telegram.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import { k as RelayRequestOptions, R as RelayClient } from './client-
|
|
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-
|
|
3
|
+
import './accounts-DnpKoJCo.js';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import './tracker-data-
|
|
6
|
-
import './wallet-
|
|
7
|
-
import './submission-input-
|
|
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-
|
|
10
|
-
import './catalog-
|
|
9
|
+
import './reward-deliveries-0VvT6LMj.js';
|
|
10
|
+
import './catalog-BLGie8Lh.js';
|
|
11
11
|
import './action-9Xl0StBg.js';
|
|
12
|
-
import './sign-in-providers-
|
|
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-
|
|
7
|
-
import "./chunk-
|
|
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 {
|
|
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, aR as profileReferralSchema, aH as linkedWalletSchema, b0 as walletBalanceSchema, b6 as walletNftsSchema, Q as WalletCallArgument, b1 as walletCallSchema, b3 as walletDelegationsSchema, V as WalletEventCondition, b4 as walletEventsSchema, bb as walletTransactionsSchema, w as WalletReader } from './wallet-Btng186v.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-
|
|
7
|
-
export { L as Limits, l as limits } from './limits-
|
|
8
|
-
import {
|
|
9
|
-
import { C as telegramConnectionSchema, y as telegramChatMemberSchema, e as TelegramReader } from './submission-input-
|
|
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-
|
|
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-
|
|
14
|
-
import { b as QuestView, q as questExperienceSchema } from './catalog-
|
|
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-
|
|
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`. */
|
|
@@ -275,6 +275,24 @@ declare const walletTransactionsRequestSchema: z.ZodObject<{
|
|
|
275
275
|
address: z.ZodNullable<z.ZodString>;
|
|
276
276
|
}, z.core.$strict>;
|
|
277
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>;
|
|
278
296
|
/**
|
|
279
297
|
* `ctx.wallet.call()`'s and `ctx.wallet.delegations()`'s requests. Like NFT reads, they stay out of
|
|
280
298
|
* the closed `CapabilityRequest`: the kit answers and numbers them, but lists them only in a run's `capabilityCalls`, not in the deprecated `calls`.
|
|
@@ -325,7 +343,7 @@ declare const memberStateRequestSchemas: {
|
|
|
325
343
|
};
|
|
326
344
|
type MemberStateRequest = z.output<(typeof memberStateRequestSchemas)[keyof typeof memberStateRequestSchemas]>;
|
|
327
345
|
/** Every request the kit answers: the public `CapabilityRequest` kinds, Telegram's, NFT, contract call and delegation reads, and the member's state. */
|
|
328
|
-
type KitRequest = CapabilityRequest | TelegramRequest | WalletNftsRequest | WalletCallRequest | WalletDelegationsRequest | WalletEventsRequest | WalletTransactionsRequest | MemberStateRequest;
|
|
346
|
+
type KitRequest = CapabilityRequest | TelegramRequest | WalletNftsRequest | WalletCallRequest | WalletDelegationsRequest | WalletEventsRequest | WalletTransactionsRequest | WalletProgramAccountRequest | WalletStakeRequest | MemberStateRequest;
|
|
329
347
|
/**
|
|
330
348
|
* The capability kinds this release of the kit knows, one per reader method family.
|
|
331
349
|
*
|
|
@@ -406,6 +424,26 @@ type WalletTransactionsQueryRequest = {
|
|
|
406
424
|
mint: string | null;
|
|
407
425
|
address: string | null;
|
|
408
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
|
+
};
|
|
409
447
|
/** A tracker read as Relay receives it: defaults applied, and `asOf` set (`eligibleAt` unless given). */
|
|
410
448
|
type TrackerReadRequest = z.output<typeof trackerQuerySchema> & {
|
|
411
449
|
asOf: number;
|
|
@@ -428,7 +466,7 @@ type TrackerFacts = {
|
|
|
428
466
|
*
|
|
429
467
|
* Reads of the member's own accounts default to a member who has linked nothing:
|
|
430
468
|
* `member.identities()`, `wallet.list()`, `wallet.balance()`, `wallet.nfts()`, `wallet.call()`,
|
|
431
|
-
* `wallet.delegations()`, `x.connection()`, `x.profile()`,
|
|
469
|
+
* `wallet.delegations()`, `wallet.events()`, `wallet.transactions()`, `wallet.programAccount()`, `wallet.stake()`, `x.connection()`, `x.profile()`,
|
|
432
470
|
* `x.follows()`, `x.reposted()`, `discord.member()`, `telegram.connection()` and `telegram.member()` resolve to null. Once the test links an
|
|
433
471
|
* account (`wallet.list` or `x.connection` set to a value), supply every read of it the quest
|
|
434
472
|
* makes. Every other read (the member's balances, completions, groups, campaigns and referrals, an
|
|
@@ -510,11 +548,30 @@ type TestFacts = {
|
|
|
510
548
|
* `ctx.wallet.transactions({ program, since })`. Like `balance`, it reads null while the
|
|
511
549
|
* member has no linked Solana wallet. The kit does not apply `program`, `since` or `mint`:
|
|
512
550
|
* answer with the transactions Relay would return, with `instructions` when the program's
|
|
513
|
-
* setting has an
|
|
551
|
+
* setting has an IDL. A run's `capabilityCalls` lists these calls; the deprecated `calls` does not.
|
|
514
552
|
*/
|
|
515
553
|
transactions?: FakeAnswer<[
|
|
516
554
|
query: WalletTransactionsQueryRequest
|
|
517
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>;
|
|
518
575
|
};
|
|
519
576
|
x?: {
|
|
520
577
|
connection?: FakeAnswer<[], Result<typeof xConnectionSchema> | null>;
|
|
@@ -670,6 +727,21 @@ type RunQuestOptions<Q extends TestableQuest = TestableQuest> = {
|
|
|
670
727
|
* `trackerObservation(tracker, { data })`.
|
|
671
728
|
*/
|
|
672
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
|
+
};
|
|
673
745
|
/** A content quest's performance stage: the metric sample to evaluate. */
|
|
674
746
|
performance?: {
|
|
675
747
|
metrics: Record<string, number>;
|
package/dist/testing.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attemptCaptureSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-75KF633N.js";
|
|
4
4
|
import {
|
|
5
5
|
parseImageResult
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-EXZVWQOQ.js";
|
|
7
7
|
import {
|
|
8
8
|
isParticipantRoute
|
|
9
|
-
} from "./chunk-
|
|
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-
|
|
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-
|
|
25
|
+
} from "./chunk-6UBFSMCM.js";
|
|
26
26
|
import {
|
|
27
27
|
badgeCatalogSchema,
|
|
28
28
|
badgeSchema,
|
|
@@ -44,6 +44,7 @@ import {
|
|
|
44
44
|
leaderboardPageSchema,
|
|
45
45
|
limits,
|
|
46
46
|
linkedWalletSchema,
|
|
47
|
+
maxSolanaSeeds,
|
|
47
48
|
memberCompletionSchema,
|
|
48
49
|
memberIdentitySchema,
|
|
49
50
|
photoResultSchema,
|
|
@@ -52,11 +53,15 @@ import {
|
|
|
52
53
|
pointHistoryPageSchema,
|
|
53
54
|
pointLedgerReferenceSchema,
|
|
54
55
|
profileReferralSchema,
|
|
56
|
+
questStationsSchema,
|
|
55
57
|
quizEvidenceSchema,
|
|
56
58
|
rewardKey,
|
|
57
59
|
solanaAddressSchema,
|
|
58
60
|
solanaDevnet,
|
|
59
61
|
solanaMainnet,
|
|
62
|
+
solanaSeedSchema,
|
|
63
|
+
stationRefusal,
|
|
64
|
+
takesSolanaTransaction,
|
|
60
65
|
telegramChatMemberSchema,
|
|
61
66
|
telegramConnectionInputSchema,
|
|
62
67
|
telegramConnectionSchema,
|
|
@@ -78,11 +83,13 @@ import {
|
|
|
78
83
|
walletDelegationsSchema,
|
|
79
84
|
walletEventsSchema,
|
|
80
85
|
walletNftsSchema,
|
|
86
|
+
walletProgramAccountSchema,
|
|
87
|
+
walletStakeSchema,
|
|
81
88
|
walletTransactionsSchema
|
|
82
|
-
} from "./chunk-
|
|
89
|
+
} from "./chunk-6YTSRWRB.js";
|
|
83
90
|
import {
|
|
84
91
|
RelayErrorCode
|
|
85
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-IW46TW3A.js";
|
|
86
93
|
|
|
87
94
|
// src/testing/run.ts
|
|
88
95
|
import * as z3 from "zod";
|
|
@@ -256,6 +263,22 @@ var walletTransactionsRequestSchema = /* @__PURE__ */ (() => z.strictObject({
|
|
|
256
263
|
mint: solanaAddressSchema.nullable(),
|
|
257
264
|
address: z.string().min(1).max(100).nullable()
|
|
258
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
|
+
}))();
|
|
259
282
|
var walletCallRequestSchema = /* @__PURE__ */ (() => z.strictObject({
|
|
260
283
|
kind: z.literal("wallet-call"),
|
|
261
284
|
call: z.string().max(400).refine(isContractCall),
|
|
@@ -300,7 +323,7 @@ var memberStateRequestSchemas = /* @__PURE__ */ (() => ({
|
|
|
300
323
|
})
|
|
301
324
|
}))();
|
|
302
325
|
function unlistedRequest(request) {
|
|
303
|
-
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";
|
|
304
327
|
}
|
|
305
328
|
var capabilityRequestSchema = /* @__PURE__ */ (() => z.discriminatedUnion("kind", [
|
|
306
329
|
capabilityRequestSchemas["wallet-balance"],
|
|
@@ -320,6 +343,8 @@ var capabilityRequestSchema = /* @__PURE__ */ (() => z.discriminatedUnion("kind"
|
|
|
320
343
|
walletDelegationsRequestSchema,
|
|
321
344
|
walletEventsRequestSchema,
|
|
322
345
|
walletTransactionsRequestSchema,
|
|
346
|
+
walletProgramAccountRequestSchema,
|
|
347
|
+
walletStakeRequestSchema,
|
|
323
348
|
memberStateRequestSchemas["member-balance"],
|
|
324
349
|
memberStateRequestSchemas["member-completions"],
|
|
325
350
|
memberStateRequestSchemas["member-groups"],
|
|
@@ -378,6 +403,10 @@ function parseCapabilityResult(request, value) {
|
|
|
378
403
|
return walletEventsSchema.nullable().parse(value);
|
|
379
404
|
case "wallet-transactions":
|
|
380
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);
|
|
381
410
|
case "member-balance":
|
|
382
411
|
return pointBalanceSchema.parse(value);
|
|
383
412
|
case "member-completions":
|
|
@@ -434,6 +463,7 @@ function capabilityEvidence(request) {
|
|
|
434
463
|
(image) => "evidence" in image ? [image.evidence] : []
|
|
435
464
|
);
|
|
436
465
|
}
|
|
466
|
+
var solanaCluster = (chain) => chain === void 0 || chain === "solana" || chain === solanaMainnet ? {} : { chain };
|
|
437
467
|
var readerFactories = {
|
|
438
468
|
member: (call, input) => {
|
|
439
469
|
const key = (reference) => typeof reference === "string" ? reference : reference.key;
|
|
@@ -544,12 +574,25 @@ var readerFactories = {
|
|
|
544
574
|
transactions: (query) => call({
|
|
545
575
|
kind: "wallet-transactions",
|
|
546
576
|
program: query.program,
|
|
547
|
-
|
|
548
|
-
...query.chain === void 0 || query.chain === "solana" || query.chain === solanaMainnet ? {} : { chain: query.chain },
|
|
577
|
+
...solanaCluster(query.chain),
|
|
549
578
|
since: query.since,
|
|
550
579
|
afterActivation: query.afterActivation ?? false,
|
|
551
580
|
mint: query.mint ?? null,
|
|
552
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
|
|
553
596
|
})
|
|
554
597
|
})
|
|
555
598
|
};
|
|
@@ -827,6 +870,22 @@ function fakeFor(facts, request) {
|
|
|
827
870
|
args: [query]
|
|
828
871
|
};
|
|
829
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
|
+
}
|
|
830
889
|
case "x": {
|
|
831
890
|
const { operation, ...input } = request.input;
|
|
832
891
|
return {
|
|
@@ -1109,11 +1168,19 @@ function factsAnswerer(facts) {
|
|
|
1109
1168
|
return wallets.length ? ask(fake) : { value: null };
|
|
1110
1169
|
}
|
|
1111
1170
|
case "wallet-events":
|
|
1112
|
-
case "wallet-transactions":
|
|
1171
|
+
case "wallet-transactions":
|
|
1172
|
+
case "wallet-program-account":
|
|
1173
|
+
case "wallet-stake": {
|
|
1113
1174
|
const pinned = await pin(walletList);
|
|
1114
1175
|
if ("error" in pinned) {
|
|
1115
1176
|
return pinned;
|
|
1116
1177
|
}
|
|
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
|
+
}
|
|
1117
1184
|
const chain = request.kind === "wallet-events" ? request.event.split(":").slice(0, 2).join(":") : request.chain ?? solanaMainnet;
|
|
1118
1185
|
const wallets = (pinned.value ?? []).filter(
|
|
1119
1186
|
(wallet) => covers(wallet, chain)
|
|
@@ -1216,6 +1283,7 @@ function rewardSelectionIssue(selected, published) {
|
|
|
1216
1283
|
var defaultNow = /* @__PURE__ */ (() => Date.UTC(2026, 0, 1))();
|
|
1217
1284
|
var defaultMember = "member_test";
|
|
1218
1285
|
var defaultSeed = "attempt_test";
|
|
1286
|
+
var defaultSignature = /* @__PURE__ */ (() => "1".repeat(64))();
|
|
1219
1287
|
var maxCapabilityCalls = 8;
|
|
1220
1288
|
var evaluationTimeoutMs = 15e3;
|
|
1221
1289
|
var time = (value) => value instanceof Date ? value.getTime() : value;
|
|
@@ -1292,6 +1360,23 @@ function hostedRun(quest, options) {
|
|
|
1292
1360
|
trigger,
|
|
1293
1361
|
options.input
|
|
1294
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;
|
|
1295
1380
|
const performance = options.performance ? contentPerformanceSnapshotSchema.parse({
|
|
1296
1381
|
contentAttempt: "attempt_content",
|
|
1297
1382
|
observation: "observation_test",
|
|
@@ -1309,6 +1394,7 @@ function hostedRun(quest, options) {
|
|
|
1309
1394
|
member,
|
|
1310
1395
|
input,
|
|
1311
1396
|
tracker,
|
|
1397
|
+
action,
|
|
1312
1398
|
eligibleAt,
|
|
1313
1399
|
segments: options.calendar ?? (options.timeZone ? [{ effectiveAt: 0, timeZone: options.timeZone }] : []),
|
|
1314
1400
|
...performance ? { performance } : {},
|
|
@@ -1318,6 +1404,7 @@ function hostedRun(quest, options) {
|
|
|
1318
1404
|
}
|
|
1319
1405
|
function hostContext(run, answer) {
|
|
1320
1406
|
const { release, member, input, tracker, eligibleAt, performance, now } = run;
|
|
1407
|
+
const action = run.action ?? null;
|
|
1321
1408
|
const evidence = typeof input.evidence === "string" ? input.evidence : void 0;
|
|
1322
1409
|
const calendar = evaluationCalendar({ segments: run.segments }, eligibleAt);
|
|
1323
1410
|
const calls = [];
|
|
@@ -1412,6 +1499,7 @@ function hostContext(run, answer) {
|
|
|
1412
1499
|
humanReview: release.humanReview,
|
|
1413
1500
|
input,
|
|
1414
1501
|
tracker,
|
|
1502
|
+
action,
|
|
1415
1503
|
eligibleAt,
|
|
1416
1504
|
calendar,
|
|
1417
1505
|
now,
|
|
@@ -1848,6 +1936,8 @@ async function replayAttempt(quest, capture, options = {}) {
|
|
|
1848
1936
|
member: context.member,
|
|
1849
1937
|
input: context.input,
|
|
1850
1938
|
tracker: context.tracker,
|
|
1939
|
+
// Relay records only Solana transaction actions so far.
|
|
1940
|
+
action: context.action ?? null,
|
|
1851
1941
|
eligibleAt: context.eligibleAt,
|
|
1852
1942
|
segments: context.calendar.segments,
|
|
1853
1943
|
...context.performance ? { performance: context.performance } : {},
|