@domino-sdk/relay 1.67.0 → 1.69.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 +65 -0
- package/dist/{accounts-C2O8mpB8.d.ts → accounts-DD4gAOCe.d.ts} +232 -3
- package/dist/{action-9Xl0StBg.d.ts → action-BDFKqGlH.d.ts} +3 -2
- package/dist/{attempt-captures-ClHAoo_n.d.ts → attempt-captures-CbuCmthd.d.ts} +11 -2
- package/dist/authoring.d.ts +534 -48
- package/dist/authoring.js +192 -29
- package/dist/{automatic-outcomes-BEnPn4Uh.d.ts → automatic-outcomes-DE3vfi8g.d.ts} +11 -3
- package/dist/avatar.d.ts +2 -1
- package/dist/browser.d.ts +15 -13
- package/dist/browser.js +12 -13
- package/dist/{capability-error-CuI_F7yM.d.ts → capability-error-db7kO8-P.d.ts} +2 -1
- package/dist/{catalog-CbiftcxQ.d.ts → catalog-Cf3fHDNn.d.ts} +69 -3
- package/dist/{chunk-5DZNMLDM.js → chunk-2A3BJ262.js} +2 -2
- package/dist/{chunk-BQXRCJ3N.js → chunk-5RLIPTL7.js} +1 -1
- package/dist/{chunk-MVQQDPQX.js → chunk-AZDZEQFK.js} +14 -2
- package/dist/{chunk-JK3XV2CR.js → chunk-BRROI4CH.js} +50 -8
- package/dist/{chunk-P33ZAJMS.js → chunk-CQVKOD3B.js} +1266 -677
- package/dist/{chunk-QYC3CZVD.js → chunk-CZ23KRVK.js} +2 -2
- package/dist/{chunk-X3FMVRMM.js → chunk-DIXYVGXO.js} +1 -1
- package/dist/{chunk-RDUSFUXX.js → chunk-GEVARKEV.js} +9 -1
- package/dist/{chunk-2HHZV7U3.js → chunk-LDO5GP7G.js} +1 -1
- package/dist/{chunk-Z2Z5DBNW.js → chunk-LGGD7S5T.js} +45 -9
- package/dist/{chunk-U66GUVSG.js → chunk-LZXDYSUH.js} +2 -0
- package/dist/{chunk-NRMQVK2W.js → chunk-ME2KUAVJ.js} +1 -1
- package/dist/{chunk-KUNPCDN6.js → chunk-ODJGTFPY.js} +16 -9
- package/dist/{chunk-DSJ46QLB.js → chunk-PO2ZDY27.js} +1 -1
- package/dist/{chunk-RWR2LOPA.js → chunk-RKTMSTT7.js} +2 -2
- package/dist/{chunk-5SBA6X5X.js → chunk-SWLW4VN3.js} +2 -2
- package/dist/{chunk-BMJHFWVT.js → chunk-TCREFRPK.js} +10 -43
- package/dist/{chunk-Q5QVAF7R.js → chunk-UGM6DUB2.js} +42 -25
- package/dist/chunk-VAGGGB6B.js +87 -0
- package/dist/{chunk-FGXLXENM.js → chunk-VNEJH4NT.js} +47 -3
- package/dist/chunk-WNEQEDMU.js +427 -0
- package/dist/{chunk-Q6KTTVOI.js → chunk-WVK3G2J2.js} +1 -1
- package/dist/{client-CZPewB9h.d.ts → client-6eSYOl8h.d.ts} +159 -11
- package/dist/{dashboards-jGPM3AxF.d.ts → dashboards-DCOAXL54.d.ts} +6 -5
- package/dist/{deployments-BVFd7ddA.d.ts → deployments-BIfdCMd5.d.ts} +911 -309
- package/dist/{host-environment-FN4zg3hw.d.ts → host-environment-DUw5-Cvj.d.ts} +2 -1
- package/dist/{identity-integration-W1Vo3Ql9.d.ts → identity-integration-BlfOn8rc.d.ts} +3 -2
- package/dist/index.d.ts +16 -15
- package/dist/index.js +10 -10
- package/dist/internal.d.ts +155 -17
- package/dist/internal.js +266 -19
- package/dist/{limits-C4RzrOV4.d.ts → limits-Ctaeq23J.d.ts} +8 -2
- package/dist/{offers-BpYenB9i.d.ts → offers-COqHGbHm.d.ts} +4 -3
- package/dist/{participant-activity-DXRq4s6K.d.ts → participant-activity-BznrcePT.d.ts} +2 -1
- package/dist/{participant-rewards-BcWkBRn_.d.ts → participant-rewards-s5Gn23qb.d.ts} +23 -1
- package/dist/portal-proxy.d.ts +7 -4
- package/dist/portal-proxy.js +14 -18
- package/dist/profiles-CLDKZVFx.d.ts +370 -0
- package/dist/react/index.d.ts +71 -30
- package/dist/react/index.js +12 -13
- package/dist/{request-error-D_dUPLwo.d.ts → request-error-C24SY7n9.d.ts} +2 -1
- package/dist/{reward-deliveries-BOWpMytr.d.ts → reward-deliveries-DFhYGJdx.d.ts} +3 -2
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/HKAI5OQA.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/schema.d.ts +556 -180
- package/dist/schema.js +70 -8
- package/dist/server/index.d.ts +15 -14
- package/dist/server/index.js +2053 -893
- package/dist/{sign-in-providers-BRYVOSlG.d.ts → sign-in-providers-C97mRNbG.d.ts} +4 -3
- package/dist/solana.d.ts +287 -0
- package/dist/solana.js +699 -0
- package/dist/{streaks-0YuipsUQ.d.ts → streaks-MAqKHbHC.d.ts} +2 -1
- package/dist/{submission-input-C152xIdn.d.ts → submission-input-BD7nORuh.d.ts} +4 -3
- package/dist/{telegram-browser-657QqiQl.d.ts → telegram-browser-gRMgGs7B.d.ts} +8 -109
- package/dist/telegram.d.ts +14 -12
- package/dist/telegram.js +2 -2
- package/dist/testing.d.ts +99 -18
- package/dist/testing.js +101 -11
- package/dist/{tracker-data-BqY-9Vu-.d.ts → tracker-data-DQgX3FIc.d.ts} +493 -1
- package/dist/{transport-CthYgZXK.d.ts → transport-BLU8jrhg.d.ts} +7340 -2134
- package/dist/vite.d.ts +2 -1
- package/dist/{wallet-Btng186v.d.ts → wallet-CPAjrW4k.d.ts} +339 -308
- package/dist/wallet-browser-BzPt_Qb5.d.ts +107 -0
- package/package.json +21 -3
- package/dist/chunk-UWUS4OOV.js +0 -59
- package/dist/chunk-UYVJZR33.js +0 -34
- package/dist/runtime/chunks/C2MGLQXC.js +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import * as z from 'zod';
|
|
2
|
-
import { L as LedgerReference, Q as QuestHandle } from './tracker-data-
|
|
3
|
-
import { B as ProjectGroupReference } from './accounts-
|
|
2
|
+
import { L as LedgerReference, Q as QuestHandle } from './tracker-data-DQgX3FIc.js';
|
|
3
|
+
import { B as ProjectGroupReference } from './accounts-DD4gAOCe.js';
|
|
4
4
|
|
|
5
5
|
declare const completionPrerequisiteSchema: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
6
6
|
kind: z.ZodLiteral<"completion">;
|
|
@@ -340,4 +340,5 @@ declare function validateSubmissionValue(input: ValueEvidence, contract: {
|
|
|
340
340
|
/** Extract an ID only. The URL and its author name are untrusted claims. */
|
|
341
341
|
declare function xPostId(value: string): string | null;
|
|
342
342
|
|
|
343
|
-
export { telegramChatsSchema as A, telegramConnectionInputSchema as B, telegramConnectionSchema as C, telegramInitDataSchema as D, telegramMemberInputSchema as E, telegramMessageDataSchema as F, telegramMiniAppSignInSchema as G, telegramReactionDataSchema as H, telegramSignInMethodsSchema as I, textEvidenceSchema as J, textOptionsSchema as K, urlEvidenceSchema as L,
|
|
343
|
+
export { telegramChatsSchema as A, telegramConnectionInputSchema as B, telegramConnectionSchema as C, telegramInitDataSchema as D, telegramMemberInputSchema as E, telegramMessageDataSchema as F, telegramMiniAppSignInSchema as G, telegramReactionDataSchema as H, telegramSignInMethodsSchema as I, textEvidenceSchema as J, textOptionsSchema as K, urlEvidenceSchema as L, urlOptionsSchema as N, validateSubmissionValue as O, valueEvidenceSchema as Q, xPostId as R, balanceAtLeast as k, completed as l, inGroup as m, balancePrerequisiteSchema as q, completionPrerequisiteSchema as r, groupPrerequisiteSchema as s, missingPrerequisiteSchema as t, prerequisiteSchema as u, telegramAccountConnectionSchema as v, telegramChatConnectionSchema as w, telegramChatIdSchema as x, telegramChatMemberSchema as y, telegramChatSchema as z };
|
|
344
|
+
export type { MissingPrerequisite as M, Prerequisite as P, TelegramAccountConnection as T, UrlEvidence as U, ValueEvidence as V, TelegramSignInMethods as a, TextEvidence as b, TextOptions as c, UrlOptions as d, TelegramReader as e, TelegramChatMember as f, TelegramChatMemberStatus as g, TelegramConnection as h, TelegramMessageData as i, TelegramReactionData as j, TelegramChat as n, TelegramChatConnection as o, TelegramChats as p };
|
|
@@ -1,111 +1,9 @@
|
|
|
1
|
-
import { c as AuthProvider, J as SignInProvider } from './accounts-
|
|
2
|
-
import { p as createRelayClient, k as RelayRequestOptions, g as RelayError } from './client-
|
|
3
|
-
import { a as TelegramSignInMethods } from './submission-input-
|
|
4
|
-
import { b as ParticipantSession } from './participant-activity-
|
|
5
|
-
import {
|
|
6
|
-
|
|
7
|
-
/** An EIP-1193 provider, such as `window.ethereum` or an EIP-6963 announcement's provider. */
|
|
8
|
-
type Eip1193Provider = {
|
|
9
|
-
request(args: {
|
|
10
|
-
method: string;
|
|
11
|
-
params?: unknown[] | object;
|
|
12
|
-
}): Promise<unknown>;
|
|
13
|
-
/** Subscribes to a provider event such as `accountsChanged`; wallets without events leave it out. */
|
|
14
|
-
on?(event: string, listener: (...args: unknown[]) => void): unknown;
|
|
15
|
-
removeListener?(event: string, listener: (...args: unknown[]) => void): unknown;
|
|
16
|
-
};
|
|
17
|
-
/** The legacy injected Solana shape Phantom, Solflare and Backpack expose. */
|
|
18
|
-
type SolanaInjectedProvider = {
|
|
19
|
-
connect(): Promise<unknown>;
|
|
20
|
-
publicKey?: {
|
|
21
|
-
toBase58(): string;
|
|
22
|
-
} | null;
|
|
23
|
-
signMessage(message: Uint8Array, display?: "utf8"): Promise<{
|
|
24
|
-
signature: Uint8Array;
|
|
25
|
-
} | Uint8Array>;
|
|
26
|
-
};
|
|
27
|
-
/** The part of a Wallet Standard account Relay uses. */
|
|
28
|
-
type StandardWalletAccount = {
|
|
29
|
-
readonly address: string;
|
|
30
|
-
readonly chains: readonly string[];
|
|
31
|
-
};
|
|
32
|
-
/** The part of a Wallet Standard wallet Relay uses; any conforming wallet object fits. */
|
|
33
|
-
type StandardWallet = {
|
|
34
|
-
readonly name: string;
|
|
35
|
-
readonly icon?: string;
|
|
36
|
-
readonly chains: readonly string[];
|
|
37
|
-
readonly accounts: readonly StandardWalletAccount[];
|
|
38
|
-
readonly features: Readonly<Record<string, unknown>>;
|
|
39
|
-
};
|
|
40
|
-
/** Keplr's API, which Leap and Cosmostation also implement. */
|
|
41
|
-
type KeplrLike = {
|
|
42
|
-
enable(chainId: string | string[]): Promise<void>;
|
|
43
|
-
getKey(chainId: string): Promise<{
|
|
44
|
-
bech32Address: string;
|
|
45
|
-
}>;
|
|
46
|
-
signArbitrary(chainId: string, signer: string, data: string): Promise<{
|
|
47
|
-
signature: string;
|
|
48
|
-
pub_key: {
|
|
49
|
-
type: string;
|
|
50
|
-
value: string;
|
|
51
|
-
};
|
|
52
|
-
}>;
|
|
53
|
-
/** Adds a chain the wallet does not know, after the user approves it. */
|
|
54
|
-
experimentalSuggestChain?(chainInfo: CosmosChain["chainInfo"]): Promise<void>;
|
|
55
|
-
};
|
|
56
|
-
/** A wallet found in the page, ready to pass to `relay.wallets.link`. */
|
|
57
|
-
type DiscoveredWallet = {
|
|
58
|
-
id: string;
|
|
59
|
-
name: string;
|
|
60
|
-
icon?: string;
|
|
61
|
-
signer: WalletSigner;
|
|
62
|
-
};
|
|
63
|
-
/** Signs with an EIP-1193 provider through `personal_sign`. */
|
|
64
|
-
declare function evmSigner(provider: Eip1193Provider, info?: {
|
|
65
|
-
name?: string;
|
|
66
|
-
}): WalletSigner;
|
|
67
|
-
/** Signs with a legacy injected Solana provider, such as `window.phantom.solana`. */
|
|
68
|
-
declare function solanaSigner(provider: SolanaInjectedProvider, info?: {
|
|
69
|
-
name?: string;
|
|
70
|
-
}): WalletSigner;
|
|
71
|
-
/** Signs with a Wallet Standard wallet's `solana:signMessage` feature. */
|
|
72
|
-
declare function walletStandardSolanaSigner(wallet: StandardWallet): WalletSigner;
|
|
73
|
-
/**
|
|
74
|
-
* Signs an ADR-36 message with Keplr or a wallet that implements its API, on the app's chain:
|
|
75
|
-
* `{ chainId, chainInfo? }` or `"cosmos:<chain ID>"`. When the wallet does not know the chain and
|
|
76
|
-
* `chainInfo` is given, it suggests the chain to the wallet (`experimentalSuggestChain`) and tries
|
|
77
|
-
* again; without `chainInfo`, or with a wallet that cannot add chains, it throws an error that
|
|
78
|
-
* names the chain. Other failures, such as a rejected request, pass through.
|
|
79
|
-
*/
|
|
80
|
-
declare function cosmosSigner(provider: KeplrLike, chain: CosmosChain | CosmosNetwork, info?: {
|
|
81
|
-
name?: string;
|
|
82
|
-
}): WalletSigner;
|
|
83
|
-
/** EIP-6963 wallets, or `window.ethereum` when none announce themselves within `timeoutMs`. */
|
|
84
|
-
declare function discoverEvmWallets(timeoutMs?: number): Promise<DiscoveredWallet[]>;
|
|
85
|
-
/** Wallet Standard wallets that can sign Solana messages, then legacy injected providers. */
|
|
86
|
-
declare function discoverSolanaWallets(): DiscoveredWallet[];
|
|
87
|
-
/**
|
|
88
|
-
* Keplr, Leap and Cosmostation, each signing on the app's chain (see `cosmosSigner`). IDs end with
|
|
89
|
-
* the chain ID.
|
|
90
|
-
*/
|
|
91
|
-
declare function discoverCosmosWallets(chain: CosmosChain | CosmosNetwork): DiscoveredWallet[];
|
|
92
|
-
/**
|
|
93
|
-
* The Cosmos SDK chains an app offers wallets on: one chain or several, each as
|
|
94
|
-
* `{ chainId, chainInfo? }` or `"cosmos:<chain ID>"`. Relay has no chain list of its own.
|
|
95
|
-
*/
|
|
96
|
-
type CosmosChains = CosmosChain | CosmosNetwork | readonly (CosmosChain | CosmosNetwork)[];
|
|
97
|
-
/** The chains in `CosmosChains`, as a list. */
|
|
98
|
-
declare function cosmosChainList(chains: CosmosChains | undefined): (CosmosChain | CosmosNetwork)[];
|
|
99
|
-
/** An installed wallet that can sign in on one of the project's enabled wallet families. */
|
|
100
|
-
type SignInWallet = DiscoveredWallet & {
|
|
101
|
-
network: WalletSignInNetwork;
|
|
102
|
-
};
|
|
103
|
-
/**
|
|
104
|
-
* The wallets installed in this browser that can sign in with `families`: EVM wallets first, then
|
|
105
|
-
* Solana wallets, then Cosmos wallets once per chain in `cosmos`. Without `cosmos` there are no
|
|
106
|
-
* Cosmos wallets. Empty during SSR.
|
|
107
|
-
*/
|
|
108
|
-
declare function discoverSignInWallets(families: readonly WalletSignInNetwork[], cosmos?: CosmosChains): Promise<SignInWallet[]>;
|
|
1
|
+
import { c as AuthProvider, J as SignInProvider } from './accounts-DD4gAOCe.js';
|
|
2
|
+
import { p as createRelayClient, k as RelayRequestOptions, g as RelayError } from './client-6eSYOl8h.js';
|
|
3
|
+
import { a as TelegramSignInMethods } from './submission-input-BD7nORuh.js';
|
|
4
|
+
import { b as ParticipantSession } from './participant-activity-BznrcePT.js';
|
|
5
|
+
import { e as WalletSignInNetwork, g as WalletSigner } from './wallet-CPAjrW4k.js';
|
|
6
|
+
import { C as CosmosChains } from './wallet-browser-BzPt_Qb5.js';
|
|
109
7
|
|
|
110
8
|
type Auth = ReturnType<typeof createRelayClient>["auth"];
|
|
111
9
|
/**
|
|
@@ -286,4 +184,5 @@ declare function signInOptions(relay: SignInClient, input?: {
|
|
|
286
184
|
*/
|
|
287
185
|
declare function telegramMiniAppInitData(): string | null;
|
|
288
186
|
|
|
289
|
-
export {
|
|
187
|
+
export { signInOptions as s, telegramMiniAppInitData as t };
|
|
188
|
+
export type { EmailSignInOption as E, OAuthSignInOption as O, ProviderSignInOption as P, SignInClient as S, TelegramSignInOption as T, WalletSignInOption as W, SignInIcon as a, SignInMethods as b, SignInOption as c, SignInOptions as d, SignInUnavailable as e };
|
package/dist/telegram.d.ts
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import './accounts-
|
|
1
|
+
import { RelayRequestOptions, RelayClient } from './index.js';
|
|
2
|
+
import { ParticipantSession } from './index.js';
|
|
3
|
+
import './accounts-DD4gAOCe.js';
|
|
4
4
|
import 'zod';
|
|
5
|
-
import './tracker-data-
|
|
6
|
-
import './wallet-
|
|
7
|
-
import './submission-input-
|
|
8
|
-
import './request-error-
|
|
9
|
-
import './reward-deliveries-
|
|
10
|
-
import './catalog-
|
|
11
|
-
import './action-
|
|
12
|
-
import './sign-in-providers-
|
|
5
|
+
import './tracker-data-DQgX3FIc.js';
|
|
6
|
+
import './wallet-CPAjrW4k.js';
|
|
7
|
+
import './submission-input-BD7nORuh.js';
|
|
8
|
+
import './request-error-C24SY7n9.js';
|
|
9
|
+
import './reward-deliveries-DFhYGJdx.js';
|
|
10
|
+
import './catalog-Cf3fHDNn.js';
|
|
11
|
+
import './action-BDFKqGlH.js';
|
|
12
|
+
import './sign-in-providers-C97mRNbG.js';
|
|
13
|
+
import './profiles-CLDKZVFx.js';
|
|
13
14
|
|
|
14
15
|
/**
|
|
15
16
|
* A plugin's own sign-in method, such as Telegram's Mini App sign-in: the app passes the vendor's
|
|
@@ -61,4 +62,5 @@ declare function withTelegram<Client extends RelayClient>(relay: Client): Client
|
|
|
61
62
|
*/
|
|
62
63
|
declare function telegramMiniAppInitData(): string | null;
|
|
63
64
|
|
|
64
|
-
export {
|
|
65
|
+
export { telegramMiniAppInitData, withTelegram };
|
|
66
|
+
export type { PluginSignInMethod, TelegramClient };
|
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-LDO5GP7G.js";
|
|
7
|
+
import "./chunk-VNEJH4NT.js";
|
|
8
8
|
|
|
9
9
|
// src/plugins/telegram.generated.ts
|
|
10
10
|
function withTelegram(relay) {
|
package/dist/testing.d.ts
CHANGED
|
@@ -1,19 +1,27 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ae as Decision } from './accounts-DD4gAOCe.js';
|
|
2
|
+
import { PointBalance } from './authoring.js';
|
|
3
|
+
import { Reward, PointLedgerReference, PointEntry, LeaderboardPage } from './index.js';
|
|
4
|
+
import { pointBalanceSchema, discordMemberSchema, discordMessageSchema, photoResultSchema, TextReviewInput } from './schema.js';
|
|
5
|
+
import { NftCollection, SolanaSeed, WalletCallArgument, WalletEventCondition, WalletReader } from './authoring.js';
|
|
6
|
+
import { linkedWalletSchema, walletBalanceSchema, walletNftsSchema, walletCallSchema, walletDelegationsSchema, walletEventsSchema, walletTransactionsSchema, walletProgramAccountSchema, walletStakeSchema, SolanaNetwork } from './schema.js';
|
|
2
7
|
import * as z from 'zod';
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { CapabilityFailure, memberCompletionSchema } from './schema.js';
|
|
9
|
+
export { C as CapabilityError } from './capability-error-db7kO8-P.js';
|
|
10
|
+
import { xConnectionSchema, xProfileSchema, xPostSchema, ImageReference, imageInspectionSchema, imageComparisonSchema, imageSightingsSchema } from './schema.js';
|
|
11
|
+
export { L as Limits, l as limits } from './limits-Ctaeq23J.js';
|
|
12
|
+
import { Tracker, TrackerData, ContentBody, TrackerTriggerContext, TrackerPage } from './authoring.js';
|
|
13
|
+
import { memberIdentitySchema, trackerQuerySchema, trackerPageSchema, trackerSummarySchema, TrackerContentQuery, trackerContentSchema, TrackerAttribution } from './schema.js';
|
|
14
|
+
import { TelegramReader } from './authoring.js';
|
|
15
|
+
import { telegramConnectionSchema, telegramChatMemberSchema } from './schema.js';
|
|
16
|
+
import { profileReferralSchema } from './schema.js';
|
|
10
17
|
import { EvaluationMember } from './authoring.js';
|
|
11
|
-
export { A as AttemptCapture, C as CapturedFact } from './attempt-captures-
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import './
|
|
16
|
-
import './
|
|
18
|
+
export { A as AttemptCapture, C as CapturedFact } from './attempt-captures-CbuCmthd.js';
|
|
19
|
+
import { ParticipantSession, RelayEvent } from './index.js';
|
|
20
|
+
import { Badge } from './index.js';
|
|
21
|
+
import { QuestView } from './index.js';
|
|
22
|
+
import { questExperienceSchema } from './schema.js';
|
|
23
|
+
import './streaks-MAqKHbHC.js';
|
|
24
|
+
import './dashboards-DCOAXL54.js';
|
|
17
25
|
import './units-CwgsPB_r.js';
|
|
18
26
|
|
|
19
27
|
/** One project time-zone change: from `effectiveAt` on, days are counted in `timeZone`. */
|
|
@@ -275,6 +283,24 @@ declare const walletTransactionsRequestSchema: z.ZodObject<{
|
|
|
275
283
|
address: z.ZodNullable<z.ZodString>;
|
|
276
284
|
}, z.core.$strict>;
|
|
277
285
|
type WalletTransactionsRequest = z.output<typeof walletTransactionsRequestSchema>;
|
|
286
|
+
/** `ctx.wallet.programAccount()`'s request: answered and numbered like transaction reads, and unlisted the same way. */
|
|
287
|
+
declare const walletProgramAccountRequestSchema: z.ZodObject<{
|
|
288
|
+
kind: z.ZodLiteral<"wallet-program-account">;
|
|
289
|
+
program: z.ZodString & z.ZodType<string, string, z.core.$ZodTypeInternals<string, string>>;
|
|
290
|
+
chain: z.ZodOptional<z.ZodLiteral<"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1">>;
|
|
291
|
+
account: z.ZodString;
|
|
292
|
+
seeds: z.ZodArray<z.ZodType<SolanaSeed, unknown, z.core.$ZodTypeInternals<SolanaSeed, unknown>>>;
|
|
293
|
+
address: z.ZodNullable<z.ZodString>;
|
|
294
|
+
}, z.core.$strict>;
|
|
295
|
+
type WalletProgramAccountRequest = z.output<typeof walletProgramAccountRequestSchema>;
|
|
296
|
+
/** `ctx.wallet.stake()`'s request: answered and numbered like transaction reads, and unlisted the same way. */
|
|
297
|
+
declare const walletStakeRequestSchema: z.ZodObject<{
|
|
298
|
+
kind: z.ZodLiteral<"wallet-stake">;
|
|
299
|
+
chain: z.ZodOptional<z.ZodLiteral<"solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1">>;
|
|
300
|
+
voteAccount: z.ZodNullable<z.ZodString>;
|
|
301
|
+
address: z.ZodNullable<z.ZodString>;
|
|
302
|
+
}, z.core.$strict>;
|
|
303
|
+
type WalletStakeRequest = z.output<typeof walletStakeRequestSchema>;
|
|
278
304
|
/**
|
|
279
305
|
* `ctx.wallet.call()`'s and `ctx.wallet.delegations()`'s requests. Like NFT reads, they stay out of
|
|
280
306
|
* 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 +351,7 @@ declare const memberStateRequestSchemas: {
|
|
|
325
351
|
};
|
|
326
352
|
type MemberStateRequest = z.output<(typeof memberStateRequestSchemas)[keyof typeof memberStateRequestSchemas]>;
|
|
327
353
|
/** 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;
|
|
354
|
+
type KitRequest = CapabilityRequest | TelegramRequest | WalletNftsRequest | WalletCallRequest | WalletDelegationsRequest | WalletEventsRequest | WalletTransactionsRequest | WalletProgramAccountRequest | WalletStakeRequest | MemberStateRequest;
|
|
329
355
|
/**
|
|
330
356
|
* The capability kinds this release of the kit knows, one per reader method family.
|
|
331
357
|
*
|
|
@@ -406,6 +432,26 @@ type WalletTransactionsQueryRequest = {
|
|
|
406
432
|
mint: string | null;
|
|
407
433
|
address: string | null;
|
|
408
434
|
};
|
|
435
|
+
/**
|
|
436
|
+
* A program-account read as Relay receives it: `chain` only for devnet, and `address` null when
|
|
437
|
+
* the quest leaves it out.
|
|
438
|
+
*/
|
|
439
|
+
type WalletProgramAccountQueryRequest = {
|
|
440
|
+
program: string;
|
|
441
|
+
chain?: string;
|
|
442
|
+
account: string;
|
|
443
|
+
seeds: SolanaSeed[];
|
|
444
|
+
address: string | null;
|
|
445
|
+
};
|
|
446
|
+
/**
|
|
447
|
+
* A stake read as Relay receives it: `chain` only for devnet, and `voteAccount` and `address` null
|
|
448
|
+
* when the quest leaves them out.
|
|
449
|
+
*/
|
|
450
|
+
type WalletStakeQueryRequest = {
|
|
451
|
+
chain?: string;
|
|
452
|
+
voteAccount: string | null;
|
|
453
|
+
address: string | null;
|
|
454
|
+
};
|
|
409
455
|
/** A tracker read as Relay receives it: defaults applied, and `asOf` set (`eligibleAt` unless given). */
|
|
410
456
|
type TrackerReadRequest = z.output<typeof trackerQuerySchema> & {
|
|
411
457
|
asOf: number;
|
|
@@ -428,7 +474,7 @@ type TrackerFacts = {
|
|
|
428
474
|
*
|
|
429
475
|
* Reads of the member's own accounts default to a member who has linked nothing:
|
|
430
476
|
* `member.identities()`, `wallet.list()`, `wallet.balance()`, `wallet.nfts()`, `wallet.call()`,
|
|
431
|
-
* `wallet.delegations()`, `x.connection()`, `x.profile()`,
|
|
477
|
+
* `wallet.delegations()`, `wallet.events()`, `wallet.transactions()`, `wallet.programAccount()`, `wallet.stake()`, `x.connection()`, `x.profile()`,
|
|
432
478
|
* `x.follows()`, `x.reposted()`, `discord.member()`, `telegram.connection()` and `telegram.member()` resolve to null. Once the test links an
|
|
433
479
|
* account (`wallet.list` or `x.connection` set to a value), supply every read of it the quest
|
|
434
480
|
* makes. Every other read (the member's balances, completions, groups, campaigns and referrals, an
|
|
@@ -510,11 +556,30 @@ type TestFacts = {
|
|
|
510
556
|
* `ctx.wallet.transactions({ program, since })`. Like `balance`, it reads null while the
|
|
511
557
|
* member has no linked Solana wallet. The kit does not apply `program`, `since` or `mint`:
|
|
512
558
|
* answer with the transactions Relay would return, with `instructions` when the program's
|
|
513
|
-
* setting has an
|
|
559
|
+
* setting has an IDL. A run's `capabilityCalls` lists these calls; the deprecated `calls` does not.
|
|
514
560
|
*/
|
|
515
561
|
transactions?: FakeAnswer<[
|
|
516
562
|
query: WalletTransactionsQueryRequest
|
|
517
563
|
], Result<typeof walletTransactionsSchema> | null>;
|
|
564
|
+
/**
|
|
565
|
+
* `ctx.wallet.programAccount({ program, account, seeds })`. Like `balance`, it reads null
|
|
566
|
+
* while the member has no linked Solana wallet. The kit does not derive or decode accounts:
|
|
567
|
+
* answer with the decoded fields Relay would return per wallet, `fields: null` for a wallet
|
|
568
|
+
* without the account. A run's `capabilityCalls` lists these calls; the deprecated `calls`
|
|
569
|
+
* does not.
|
|
570
|
+
*/
|
|
571
|
+
programAccount?: FakeAnswer<[
|
|
572
|
+
query: WalletProgramAccountQueryRequest
|
|
573
|
+
], Result<typeof walletProgramAccountSchema> | null>;
|
|
574
|
+
/**
|
|
575
|
+
* `ctx.wallet.stake({ voteAccount })`. Like `balance`, it reads null while the member has no
|
|
576
|
+
* linked Solana wallet. The kit does not classify stake accounts: answer with the amounts
|
|
577
|
+
* Relay would return. A run's `capabilityCalls` lists these calls; the deprecated `calls`
|
|
578
|
+
* does not.
|
|
579
|
+
*/
|
|
580
|
+
stake?: FakeAnswer<[
|
|
581
|
+
query: WalletStakeQueryRequest
|
|
582
|
+
], Result<typeof walletStakeSchema> | null>;
|
|
518
583
|
};
|
|
519
584
|
x?: {
|
|
520
585
|
connection?: FakeAnswer<[], Result<typeof xConnectionSchema> | null>;
|
|
@@ -670,6 +735,21 @@ type RunQuestOptions<Q extends TestableQuest = TestableQuest> = {
|
|
|
670
735
|
* `trackerObservation(tracker, { data })`.
|
|
671
736
|
*/
|
|
672
737
|
tracker?: unknown;
|
|
738
|
+
/**
|
|
739
|
+
* The signed Solana transaction that started the attempt, `ctx.action`: the member's `wallet`
|
|
740
|
+
* that signed it and the memo's `reference`. As in Relay, only a member-submitted `manual()`
|
|
741
|
+
* quest without input takes one. `signature` and `chain` (mainnet) have defaults. On a quest with
|
|
742
|
+
* `stations`, the reference must name a station open at `now`, which stands in for the
|
|
743
|
+
* transaction's block time, and a run without an action is refused, as Relay refuses them.
|
|
744
|
+
*
|
|
745
|
+
* @experimental A minor release can change quest actions.
|
|
746
|
+
*/
|
|
747
|
+
action?: {
|
|
748
|
+
wallet: string;
|
|
749
|
+
reference?: string | null;
|
|
750
|
+
signature?: string;
|
|
751
|
+
chain?: SolanaNetwork;
|
|
752
|
+
};
|
|
673
753
|
/** A content quest's performance stage: the metric sample to evaluate. */
|
|
674
754
|
performance?: {
|
|
675
755
|
metrics: Record<string, number>;
|
|
@@ -1103,4 +1183,5 @@ type FakeRelay = {
|
|
|
1103
1183
|
*/
|
|
1104
1184
|
declare function createFakeRelay(options?: FakeRelayOptions): FakeRelay;
|
|
1105
1185
|
|
|
1106
|
-
export {
|
|
1186
|
+
export { Decision, DecisionAssertionError, EvaluatorError, TestSetupError, createFakeRelay, createTestContext, defaultMember, defaultNow, defaultSeed, expectAccept, expectDefer, expectProgress, expectReject, expectReview, fakeEvaluationMember, fakeTelegramReader, fakeWalletReader, maxCapabilityCalls, replayAttempt, runQuest, trackerObservation, trackerPage };
|
|
1187
|
+
export type { AttemptReplay, CalendarSegment, CapabilityCall, CapabilityCallRecord, CapabilityCallRequest, CapabilityDivergence, CapabilityOutcome, CapabilityRequest, FakeAnswer, FakeRelay, FakeRelayOptions, FakeRelayRequest, KnownCapabilityKind, KnownDivergenceReason, QuestDiagnostic, QuestHostContext, QuestInputOf, QuestRun, ReplayDivergence, ReplayOptions, RunQuestOptions, TestContext, TestFacts, TestRelease, TestableQuest, TrackerFacts, TrackerObservationInput, TrackerReadRequest, TrackerRecordInput, WalletBalanceRequest };
|
package/dist/testing.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
2
|
attemptCaptureSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GEVARKEV.js";
|
|
4
4
|
import {
|
|
5
5
|
parseImageResult
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-RKTMSTT7.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-DIXYVGXO.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-PO2ZDY27.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-CQVKOD3B.js";
|
|
83
90
|
import {
|
|
84
91
|
RelayErrorCode
|
|
85
|
-
} from "./chunk-
|
|
92
|
+
} from "./chunk-VNEJH4NT.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 } : {},
|