@domino-sdk/relay 1.55.0 → 1.59.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 (65) hide show
  1. package/CHANGELOG.md +85 -0
  2. package/dist/{accounts-DRPENuZe.d.ts → accounts-CVonEkdb.d.ts} +18 -7
  3. package/dist/{attempt-captures-CxxO7DeD.d.ts → attempt-captures-DBj-rxak.d.ts} +1 -1
  4. package/dist/authoring.d.ts +306 -72
  5. package/dist/authoring.js +264 -9
  6. package/dist/{automatic-outcomes-DxW_v5Wc.d.ts → automatic-outcomes-FS9okvBP.d.ts} +1 -1
  7. package/dist/avatar.d.ts +1 -2
  8. package/dist/browser.d.ts +8 -9
  9. package/dist/browser.js +10 -10
  10. package/dist/{capability-error-DSd8EMQC.d.ts → capability-error-DDJl0LY-.d.ts} +0 -6
  11. package/dist/{chunk-IZRITLVV.js → chunk-2LKGAL63.js} +2 -2
  12. package/dist/{chunk-GL43VQ5D.js → chunk-577DG2IT.js} +38 -8
  13. package/dist/{chunk-UY6KMLQG.js → chunk-6U5WWH3W.js} +141 -100
  14. package/dist/{chunk-YCOKTQ4E.js → chunk-AWWCEP7F.js} +1403 -882
  15. package/dist/{chunk-56DBFNR2.js → chunk-EQF4ID47.js} +1 -1
  16. package/dist/{chunk-YEVD4A5X.js → chunk-IBROKMFV.js} +2 -2
  17. package/dist/{chunk-XALIFNMD.js → chunk-KBCTII6C.js} +1 -1
  18. package/dist/{chunk-WHG5WE43.js → chunk-KYUQEZZA.js} +1 -1
  19. package/dist/{chunk-WUEQOKJH.js → chunk-LDLOB2UZ.js} +4 -4
  20. package/dist/{chunk-IUF7DW76.js → chunk-M2JQPDUX.js} +39 -9
  21. package/dist/{chunk-MLIXJPKL.js → chunk-MHPKEVEW.js} +1 -0
  22. package/dist/{chunk-TLK2MD4S.js → chunk-R4S6BFOH.js} +1 -1
  23. package/dist/{chunk-VFBQVY4X.js → chunk-TZJT5CRF.js} +1 -1
  24. package/dist/{chunk-C7QZ4UBB.js → chunk-UEMLYPKJ.js} +21 -5
  25. package/dist/{chunk-F6HECAXA.js → chunk-W42KMMH5.js} +140 -101
  26. package/dist/{chunk-WHMXXHPX.js → chunk-XGXDINGM.js} +16 -3
  27. package/dist/{chunk-SABMNPF2.js → chunk-YMWRLAAP.js} +1 -1
  28. package/dist/{chunk-YE3XYB2F.js → chunk-YRSU2X2P.js} +2 -2
  29. package/dist/{client-C4zUZKpj.d.ts → client-3b9HjSzZ.d.ts} +191 -117
  30. package/dist/{deployments-B32QS1CI.d.ts → deployments-BydFVj4Q.d.ts} +798 -235
  31. package/dist/{groups-O6onGPmC.d.ts → groups-CFuTfFqG.d.ts} +15 -9
  32. package/dist/index.d.ts +9 -10
  33. package/dist/index.js +9 -9
  34. package/dist/{integrations-C6_uUh-s.d.ts → integrations-DrbKQSTD.d.ts} +42 -22
  35. package/dist/internal.d.ts +10 -10
  36. package/dist/internal.js +9 -9
  37. package/dist/{offers-BMDNcvwB.d.ts → offers-DAfe1O3_.d.ts} +211 -2
  38. package/dist/{pages-BFloMpyQ.d.ts → pages-ChDVLrgR.d.ts} +95 -10
  39. package/dist/portal-proxy.js +4 -4
  40. package/dist/react/index.d.ts +149 -72
  41. package/dist/react/index.js +65 -10
  42. package/dist/runtime/authoring.js +1 -1
  43. package/dist/runtime/chunks/BG43KQ2T.js +1 -0
  44. package/dist/runtime/chunks/EWU4OKSY.js +62 -0
  45. package/dist/runtime/manifest.json +5 -5
  46. package/dist/runtime/schema.js +1 -1
  47. package/dist/runtime/zod.js +1 -1
  48. package/dist/{schema-C4m9RhCR.d.ts → schema-BA0nRRlt.d.ts} +184 -35
  49. package/dist/schema.d.ts +1265 -697
  50. package/dist/schema.js +96 -12
  51. package/dist/server/index.d.ts +10 -10
  52. package/dist/server/index.js +1644 -1105
  53. package/dist/{submission-input-BbdawqVy.d.ts → submission-input-DxQ6RnKo.d.ts} +2 -2
  54. package/dist/{telegram-browser-CwaxROAZ.d.ts → telegram-browser-o3OIxGrJ.d.ts} +3 -3
  55. package/dist/testing.d.ts +89 -9
  56. package/dist/testing.js +215 -10
  57. package/dist/{transport-CZJOW5Sr.d.ts → transport-D_Eqf78J.d.ts} +8592 -4384
  58. package/dist/wallet-B06zvDXp.d.ts +972 -0
  59. package/dist/{x-1czZFVUW.d.ts → x-C28SNifw.d.ts} +2 -2
  60. package/package.json +2 -2
  61. package/dist/profiles-BoOK03cR.d.ts +0 -299
  62. package/dist/runtime/chunks/IDOMZWRY.js +0 -40
  63. package/dist/runtime/chunks/WKATKZXE.js +0 -1
  64. package/dist/util.d-w9f9t3ua.d.ts +0 -5
  65. package/dist/wallet-Ac7OFpOr.d.ts +0 -228
@@ -1,24 +1,23 @@
1
- import { x as xContentBodySchema, I as IdentityKind, y as customSourceSchema, W as WithRecordData, z as WithContent, B as WithAccountRoles, C as ResourceHandle, D as QuestHandle, L as LedgerReference, G as GroupHandle, F as pointLedgerDeclarationSchema, H as TrackerSource, J as trackerDefinitionSchema, N as Tracker, U as TrackerData, V as SourceRoles, X as LedgerHandle, Y as TrackerDataSchema, Z as xSearchSourceSchema, _ as XTweet, $ as XContentMetric, a0 as TrackerTriggerPolicy, a1 as Where, a2 as MemberIdentity, P as PointBalance, a3 as ReferralHandle, a4 as TrackerTriggerContext, a5 as TrackerReader, a6 as TextReviewInput, a7 as TextResult, a8 as PhotoResult, a9 as Decision, aa as rewardSchema, ab as TrackerTriggerMode, ac as RoleOf, ad as WhereSetting, ae as ContentBody, af as BadgeHandle, ag as ContentMetricName, ah as triggerSchema, k as QuestPresentation, l as QuestProfile, m as QuizEvidence, ai as TieredRewardDefinition } from './schema-C4m9RhCR.js';
2
- export { aj as LedgerSetting, ak as TrackerPage, al as TrackerReadQuery, am as trackerDataSchema, an as trackerTriggerContextSchema } from './schema-C4m9RhCR.js';
3
- import { M as MemberCompletion, B as Budget } from './capability-error-DSd8EMQC.js';
4
- export { C as CapabilityError, a as CapabilityErrorCode, c as capabilityErrorCodes } from './capability-error-DSd8EMQC.js';
5
- import { d as ProfileReferral } from './profiles-BoOK03cR.js';
1
+ import { B as xContentBodySchema, I as IdentityKind, C as customSourceSchema, W as WithRecordData, D as WithContent, F as WithAccountRoles, y as ResourceHandle, x as QuestHandle, L as LedgerReference, G as GroupHandle, H as pointLedgerDeclarationSchema, J as TrackerSource, N as trackerDefinitionSchema, U as Tracker, V as TrackerData, X as SourceRoles, Y as LedgerHandle, Z as TrackerDataSchema, _ as xSearchSourceSchema, $ as XTweet, a0 as XContentMetric, a1 as TrackerTriggerPolicy, a2 as Where, a3 as MemberIdentity, P as PointBalance, a4 as ReferralHandle, a5 as TrackerTriggerContext, a6 as TrackerReader, a7 as TextReviewInput, a8 as TextResult, z as PhotoResult, a9 as Decision, aa as rewardSchema, ab as TrackerTriggerMode, ac as RoleOf, ad as WhereSetting, ae as ContentBody, af as BadgeHandle, ag as ContentMetricName, ah as triggerSchema, k as QuestPresentation, l as QuestProfile, m as QuizEvidence, ai as TieredRewardDefinition } from './schema-BA0nRRlt.js';
2
+ export { aj as LedgerSetting, ak as TrackerPage, al as TrackerReadQuery, am as trackerDataSchema, an as trackerTriggerContextSchema } from './schema-BA0nRRlt.js';
3
+ import { M as MemberCompletion, B as Budget } from './capability-error-DDJl0LY-.js';
4
+ export { C as CapabilityError, a as CapabilityErrorCode, c as capabilityErrorCodes } from './capability-error-DDJl0LY-.js';
5
+ import { N as NftCollection, o as ContractCall, p as ContractEvent, S as SolanaProgram, q as WalletBalanceSourceQuery, r as WalletTransaction, s as WalletInstruction, e as ProfileReferral, t as WalletReader } from './wallet-B06zvDXp.js';
6
+ export { u as ContractCallParts, v as ContractCallReturnType, w as ContractEventInput, x as ContractEventParts, y as ContractFunction, z as CosmosDenom, a as CosmosNetwork, E as EvmChainId, B as NftCollectionParts, D as NftStandard, F as WalletBalance, G as WalletBalanceChange, H as WalletBalanceQuery, I as WalletBalanceSample, J as WalletCall, K as WalletCallArgument, M as WalletCallQuery, Q as WalletDelegations, R as WalletDelegationsQuery, T as WalletEventCondition, U as WalletEventValue, V as WalletEvents, X as WalletEventsQuery, Y as WalletNfts, Z as WalletNftsQuery, _ as WalletTransactions, $ as WalletTransactionsQuery, a0 as cosmosDenomSchema, a1 as cosmosNetworkSchema, a2 as isContractCall, a3 as isContractEvent, a4 as isEvmChainId, a5 as isNftCollection, a6 as isSolanaProgram, a7 as maxWalletEventLogs, a8 as maxWalletEventLookback, a9 as maxWalletTransactionLookback, aa as maxWalletTransactions, ab as parseContractCall, ac as parseContractEvent, ad as parseContractFunction, ae as parseNftCollection } from './wallet-B06zvDXp.js';
6
7
  import * as z from 'zod';
7
8
  export { z } from 'zod';
8
- import { f as badgeDeclarationSchema, B as Badge } from './offers-BMDNcvwB.js';
9
- export { g as defineOffer } from './offers-BMDNcvwB.js';
10
- import { E as EngagementBudget, l as leaderboardDefinitionSchema, m as AuthoringIdentity, r as referralAuthoringSchema, C as CampaignDefinition, A as AvailabilityWindow } from './groups-O6onGPmC.js';
11
- export { n as defineCampaign, o as defineGroup } from './groups-O6onGPmC.js';
12
- import { d as discordMessagesSourceSchema, D as DiscordMessageData, c as DiscordMessageTextData, e as discordReactionsSourceSchema, f as DiscordReactionData, g as TelegramReader, h as DiscordReader } from './accounts-DRPENuZe.js';
13
- export { i as TelegramChatMember, j as TelegramChatMemberStatus, k as TelegramReactionData } from './accounts-DRPENuZe.js';
9
+ import { f as badgeDeclarationSchema, B as Badge } from './offers-DAfe1O3_.js';
10
+ export { g as defineOffer } from './offers-DAfe1O3_.js';
11
+ import { E as EngagementBudget, m as leaderboardDefinitionSchema, l as AuthoringIdentity, r as referralAuthoringSchema, C as CampaignDefinition, A as AvailabilityWindow } from './groups-CFuTfFqG.js';
12
+ export { n as defineCampaign, o as defineGroup } from './groups-CFuTfFqG.js';
13
+ import { d as discordMessagesSourceSchema, D as DiscordMessageData, c as DiscordMessageTextData, e as discordReactionsSourceSchema, f as DiscordReactionData, g as TelegramReader, h as DiscordReader } from './accounts-CVonEkdb.js';
14
+ export { i as TelegramChatMember, j as TelegramChatMemberStatus, k as TelegramMessageData, l as TelegramReactionData } from './accounts-CVonEkdb.js';
14
15
  import { a as StreakPolicy, Q as QuizContent } from './streaks-0YuipsUQ.js';
15
- import { R as ResourceSource, S as Setting, A as AmountSetting, B as BalanceChain, I as IntegrationModule, a as BoundSettings } from './integrations-C6_uUh-s.js';
16
- export { D as DashboardInput, b as DashboardPanelInput, d as defineDashboard } from './integrations-C6_uUh-s.js';
17
- import { P as Prerequisite, T as TextEvidence, U as UrlEvidence, a as TextOptions, b as UrlOptions } from './submission-input-BbdawqVy.js';
18
- export { c as balanceAtLeast, d as completed, i as inGroup } from './submission-input-BbdawqVy.js';
19
- import { I as ImageReader, X as XReader } from './x-1czZFVUW.js';
20
- import { h as WalletReader } from './wallet-Ac7OFpOr.js';
21
- export { i as CosmosDenom, a as CosmosNetwork, E as EvmChainId, j as WalletBalance, k as WalletBalanceQuery, l as cosmosDenomSchema, m as cosmosNetworkSchema, n as isEvmChainId } from './wallet-Ac7OFpOr.js';
16
+ import { R as ResourceSource, S as Setting, A as AmountSetting, B as BalanceChain, I as IntegrationModule, a as BoundSettings } from './integrations-DrbKQSTD.js';
17
+ export { D as DashboardInput, b as DashboardPanelInput, T as TikTokVideoBody, c as TikTokVideoMetric, Y as YouTubeShortBody, d as YouTubeShortMetric, e as defineDashboard } from './integrations-DrbKQSTD.js';
18
+ import { P as Prerequisite, T as TextEvidence, U as UrlEvidence, a as TextOptions, b as UrlOptions } from './submission-input-DxQ6RnKo.js';
19
+ export { c as balanceAtLeast, d as completed, i as inGroup } from './submission-input-DxQ6RnKo.js';
20
+ import { I as ImageReader, X as XReader } from './x-C28SNifw.js';
22
21
  export { f as formatUnits, p as parseUnits } from './units-CwgsPB_r.js';
23
22
  import './analytics-URV-mxjH.js';
24
23
 
@@ -183,6 +182,15 @@ declare function defineReferral(input: Omit<ReferralInput, "qualification" | "in
183
182
  amount: number;
184
183
  })[];
185
184
  };
185
+ qualification: {
186
+ kind: "signup";
187
+ } | {
188
+ kind: "quest";
189
+ quest: string;
190
+ } | {
191
+ kind: "external";
192
+ };
193
+ enabled: boolean;
186
194
  milestones: {
187
195
  id: string;
188
196
  count: number;
@@ -213,15 +221,6 @@ declare function defineReferral(input: Omit<ReferralInput, "qualification" | "in
213
221
  amount: number;
214
222
  })[];
215
223
  }[];
216
- qualification: {
217
- kind: "signup";
218
- } | {
219
- kind: "quest";
220
- quest: string;
221
- } | {
222
- kind: "external";
223
- };
224
- enabled: boolean;
225
224
  bonuses: {
226
225
  id: string;
227
226
  balance: string;
@@ -275,8 +274,8 @@ declare function defineLeaderboard(input: Omit<LeaderboardInput, "key" | "id" |
275
274
  };
276
275
  };
277
276
  }): {
278
- balance: string;
279
277
  title: string;
278
+ balance: string;
280
279
  access: "participants" | "public";
281
280
  score: {
282
281
  kind: "balance";
@@ -459,6 +458,11 @@ declare const discord: {
459
458
  /**
460
459
  * Telegram, through Domino's bot in the chats a project connects in Console.
461
460
  *
461
+ * - `telegram.messages()`: a tracker source of the messages members post in those groups and
462
+ * supergroups. Each record is one message, keyed by chat and message ID: its `author` is the
463
+ * poster's Telegram account. `data` is `TelegramMessageData`, which names the chat, the message,
464
+ * and the reply target and topic thread, never the text. Bots', service and channel messages
465
+ * are not recorded, and an edit is the same message.
462
466
  * - `telegram.reactions()`: a tracker source of the reactions members add to messages in those
463
467
  * groups and supergroups. Each record is one added reaction: its `author` is the reactor and
464
468
  * its `messageAuthor` account is the message's author, both Telegram accounts. `data` is
@@ -467,19 +471,43 @@ declare const discord: {
467
471
  * - Quests read membership with `ctx.telegram.member({ chat })`, naming the chat with
468
472
  * `settings.telegramChat()`.
469
473
  *
470
- * In SDK 1.x the reactions source is a custom source whose namespace Relay reserves: only Relay
471
- * writes its records, and the accounts on them are Telegram accounts whatever `identities` says.
474
+ * In SDK 1.x both sources are custom sources whose namespaces Relay reserves: only Relay writes
475
+ * their records, and the accounts on them are Telegram accounts whatever `identities` says.
472
476
  */
473
477
  declare const telegram: {
478
+ messages(): {
479
+ kind: "custom";
480
+ namespace: string;
481
+ identities?: ("discord" | "member" | "wallet" | "x" | `app:${string}`)[] | undefined;
482
+ accounts?: string[] | undefined;
483
+ data?: TrackerDataSchema | undefined;
484
+ content?: {
485
+ metrics: string[];
486
+ } | undefined;
487
+ balance?: {
488
+ chain: string;
489
+ token: string | null;
490
+ } | undefined;
491
+ } & WithRecordData<{
492
+ chatId: string;
493
+ chatType: string;
494
+ messageId: number;
495
+ replyToMessageId: number | null;
496
+ threadId: number | null;
497
+ }> & WithAccountRoles<"author">;
474
498
  reactions(): {
475
499
  kind: "custom";
476
500
  namespace: string;
477
- identities?: ("discord" | "wallet" | "x" | "member" | `app:${string}`)[] | undefined;
501
+ identities?: ("discord" | "member" | "wallet" | "x" | `app:${string}`)[] | undefined;
478
502
  accounts?: string[] | undefined;
479
503
  data?: TrackerDataSchema | undefined;
480
504
  content?: {
481
505
  metrics: string[];
482
506
  } | undefined;
507
+ balance?: {
508
+ chain: string;
509
+ token: string | null;
510
+ } | undefined;
483
511
  } & WithRecordData<{
484
512
  chatId: string;
485
513
  chatType: string;
@@ -491,6 +519,139 @@ declare const telegram: {
491
519
  reactorIsAdmin: boolean;
492
520
  }> & WithAccountRoles<"author" | "messageAuthor">;
493
521
  };
522
+ /**
523
+ * YouTube, read through the channels members link as creator accounts.
524
+ *
525
+ * - `youtube.shorts()`: a tracker source of the Shorts members publish on their linked channels.
526
+ * Each record is one Short, keyed by its video ID: its `author` is the channel, attributed to the
527
+ * member who linked it, and `occurredAt` is when it was published. Its content is
528
+ * `YouTubeShortBody`, measured by `views`, `likes` and `comments`, so `content()` quests,
529
+ * `performance` and engagement rules work on it. Relay looks for new Shorts and refreshes the
530
+ * counters every `refreshSeconds` of the tracker. A video that is deleted or made private is a
531
+ * content removal.
532
+ *
533
+ * In SDK 1.x the source is a custom source whose namespace Relay reserves: only Relay writes its
534
+ * records, and their accounts are YouTube channels whatever `identities` says.
535
+ */
536
+ declare const youtube: {
537
+ shorts(): {
538
+ kind: "custom";
539
+ namespace: string;
540
+ identities?: ("discord" | "member" | "wallet" | "x" | `app:${string}`)[] | undefined;
541
+ accounts?: string[] | undefined;
542
+ data?: TrackerDataSchema | undefined;
543
+ content?: {
544
+ metrics: string[];
545
+ } | undefined;
546
+ balance?: {
547
+ chain: string;
548
+ token: string | null;
549
+ } | undefined;
550
+ } & WithRecordData<ContentData<{
551
+ title: string;
552
+ description: string;
553
+ tags: string[];
554
+ durationSeconds: number;
555
+ publishedAt: number;
556
+ }, "likes" | "views" | "comments">> & WithContent<{
557
+ title: string;
558
+ description: string;
559
+ tags: string[];
560
+ durationSeconds: number;
561
+ publishedAt: number;
562
+ }, "likes" | "views" | "comments"> & WithAccountRoles<"author">;
563
+ };
564
+ /**
565
+ * TikTok, read through the accounts members link as creator accounts.
566
+ *
567
+ * - `tiktok.videos()`: a tracker source of the public videos members post on their linked TikTok
568
+ * accounts, read with each member's own token. Each record is one video, keyed by its video ID:
569
+ * its `author` is the account's `open_id`, attributed to the member who linked it, and
570
+ * `occurredAt` is when it was posted. Its content is `TikTokVideoBody`, measured by `views`,
571
+ * `likes`, `comments` and `shares`, so `content()` quests, `performance` and engagement rules
572
+ * work on it. Relay looks for new videos and refreshes the counters every `refreshSeconds` of the
573
+ * tracker. A video its owner's account no longer returns is a content removal.
574
+ *
575
+ * In SDK 1.x the source is a custom source whose namespace Relay reserves: only Relay writes its
576
+ * records, and their accounts are TikTok accounts whatever `identities` says.
577
+ */
578
+ declare const tiktok: {
579
+ videos(): {
580
+ kind: "custom";
581
+ namespace: string;
582
+ identities?: ("discord" | "member" | "wallet" | "x" | `app:${string}`)[] | undefined;
583
+ accounts?: string[] | undefined;
584
+ data?: TrackerDataSchema | undefined;
585
+ content?: {
586
+ metrics: string[];
587
+ } | undefined;
588
+ balance?: {
589
+ chain: string;
590
+ token: string | null;
591
+ } | undefined;
592
+ } & WithRecordData<ContentData<{
593
+ title: string;
594
+ description: string;
595
+ durationSeconds: number;
596
+ width: number;
597
+ height: number;
598
+ createdAt: number;
599
+ shareUrl: string;
600
+ isAigc: boolean;
601
+ }, "likes" | "views" | "comments" | "shares">> & WithContent<{
602
+ title: string;
603
+ description: string;
604
+ durationSeconds: number;
605
+ width: number;
606
+ height: number;
607
+ createdAt: number;
608
+ shareUrl: string;
609
+ isAigc: boolean;
610
+ }, "likes" | "views" | "comments" | "shares"> & WithAccountRoles<"author">;
611
+ };
612
+ /**
613
+ * Members' linked wallets, sampled by Relay.
614
+ *
615
+ * - `wallet.balances({ chain, token })`: a tracker source of daily balance samples. Once per
616
+ * project-calendar day, at a time members can't predict, Relay reads the balance of every
617
+ * wallet of that chain's family linked by a member who joined the project, every wallet at one
618
+ * pinned EVM block or Cosmos height (Solana can't read a past slot: each read reaches at least
619
+ * the pinned slot). Each record is one wallet, keyed by its CAIP-10 account on `chain`, which is also
620
+ * its `author`; each sample is a new observation whose `occurredAt` is the sample time and whose
621
+ * `data` is `WalletBalanceSample`. `chain` and `token` are those of `ctx.wallet.balance()`: an
622
+ * EVM chain with its native coin or an ERC-20, Solana with SOL or an SPL or Token-2022 mint, or a
623
+ * Cosmos chain with a bank denomination. A day whose reads all fail has no sample: Relay never
624
+ * writes a balance it didn't read. Reward holding for days with
625
+ * `automatic({ tracker, where: { path: "amount", gte: ... } })` and `streak({ days })`.
626
+ *
627
+ * In SDK 1.x the source is a custom source whose namespace Relay reserves: only Relay writes its
628
+ * records. A project and environment can have at most 5 of them.
629
+ */
630
+ declare const wallet: {
631
+ balances(query: WalletBalanceSourceQuery): ({
632
+ kind: "custom";
633
+ namespace: string;
634
+ identities?: ("discord" | "member" | "wallet" | "x" | `app:${string}`)[] | undefined;
635
+ accounts?: string[] | undefined;
636
+ data?: TrackerDataSchema | undefined;
637
+ content?: {
638
+ metrics: string[];
639
+ } | undefined;
640
+ balance?: {
641
+ chain: string;
642
+ token: string | null;
643
+ } | undefined;
644
+ } & WithRecordData<{
645
+ amount: string;
646
+ decimals: number | null;
647
+ block: string;
648
+ }> & WithAccountRoles<"author">) & {
649
+ balance: {
650
+ chain: string;
651
+ token: string | null;
652
+ };
653
+ };
654
+ };
494
655
  declare const pointLedgers: () => ResourceSource;
495
656
  type Label = {
496
657
  label: string;
@@ -548,6 +709,50 @@ declare const settings: {
548
709
  chain(options: Label & {
549
710
  default: BalanceChain;
550
711
  }): Setting<"text", z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<"solana" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp" | `eip155:${number}`, string>>>>;
712
+ /**
713
+ * An NFT collection `ctx.wallet.nfts()` reads, as a CAIP-19 asset type: an EVM chain, the
714
+ * standard and the contract, such as `"eip155:1/erc721:0x…"`, or `"eip155:8453/erc1155:0x…/1"` for
715
+ * one ERC-1155 token ID; or a Metaplex collection NFT's mint on Solana mainnet,
716
+ * `"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/nft:<mint>"`. Relay checks it when the collection is
717
+ * published or edited: an EVM chain must be one `ctx.wallet.balance()` reads and the contract
718
+ * must report the standard through ERC-165 `supportsInterface`; a Solana mint must be a Metaplex
719
+ * collection NFT. Typed as the query's collection, so it passes to
720
+ * `ctx.wallet.nfts({ collection })` as it is.
721
+ */
722
+ nft(options: Label & {
723
+ default: NftCollection;
724
+ }): Setting<"text", z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<`eip155:${number}/erc721:0x${string}` | `eip155:${number}/erc1155:0x${string}/${string}` | `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/nft:${string}`, string>>>>;
725
+ /**
726
+ * A contract function `ctx.wallet.call()` reads: the contract's CAIP-10 account ID on an EVM
727
+ * chain, a space, and the function's human-readable signature, such as
728
+ * `"eip155:8453:0x… function stakedOf(address) view returns (uint256)"`. Only `view` and `pure`
729
+ * functions with elementary parameters that return one `uint`, `int`, `bool` or `address` are
730
+ * accepted; publication and Console edits also check that Relay reads the chain. Typed as the
731
+ * query's call, so it passes to `ctx.wallet.call({ call })` as it is.
732
+ */
733
+ contractCall(options: Label & {
734
+ default: ContractCall;
735
+ }): Setting<"text", z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<`eip155:${number}:0x${string} function ${string}`, string>>>>;
736
+ /**
737
+ * An EVM contract event `ctx.wallet.events()` reads: the contract as a CAIP-10 account ID and
738
+ * the event's Solidity signature, with argument names and `indexed` markers, such as
739
+ * `"eip155:8453:0x… Transfer(address indexed from, address indexed to, uint256 value)"`. The event
740
+ * needs an indexed `address` argument, the one matched against the member's wallets. Relay checks
741
+ * it when the event is published or edited: the chain must be one `ctx.wallet.balance()` reads
742
+ * and report a finalized or safe block, and the address must hold a contract. Typed as the query's
743
+ * event, so it passes to `ctx.wallet.events({ event })` as it is.
744
+ */
745
+ contractEvent(options: Label & {
746
+ default: ContractEvent;
747
+ }): Setting<"text", z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<`eip155:${number}:0x${string} ${string}`, string>>>>;
748
+ /**
749
+ * A Solana mainnet program `ctx.wallet.transactions()` reads: its base58 address, such as
750
+ * Jupiter's `"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"`. Relay checks it when it is published
751
+ * or edited: the account must exist and be an executable program.
752
+ */
753
+ solanaProgram(options: Label & {
754
+ default: SolanaProgram;
755
+ }): Setting<"text", z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
551
756
  integer(options: Label & {
552
757
  default: number;
553
758
  min: number;
@@ -564,6 +769,35 @@ declare const settings: {
564
769
  object<T extends Record<string, Setting>>(shape: T): z.ZodObject<{ -readonly [P in keyof T]: T[P]; }, z.core.$strict>;
565
770
  };
566
771
 
772
+ /**
773
+ * How much of `mint` (`"SOL"` for lamports) the wallet gained in `tx`, in base units, or `"0"`
774
+ * when it gained none.
775
+ */
776
+ declare function received(tx: WalletTransaction, mint: string): string;
777
+ /**
778
+ * How much of `mint` (`"SOL"` for lamports, rent included, the fee not) the wallet gave up in `tx`, in base
779
+ * units, or `"0"` when it gave up none.
780
+ */
781
+ declare function spent(tx: WalletTransaction, mint: string): string;
782
+ /**
783
+ * Whether the wallet swapped in `tx`: one mint went down and a different one went up. `into` names
784
+ * the mint that must have gone up, `from` the one that must have gone down; `"SOL"` stands for
785
+ * lamports. The fee is left out of SOL, but rent is not: a transaction that opens a token account
786
+ * for the wallet lowers its SOL by the rent, so check a swap out of SOL with `spent(tx, "SOL")`
787
+ * against a minimum above it.
788
+ */
789
+ declare function swapped(tx: WalletTransaction, options?: {
790
+ into?: string;
791
+ from?: string;
792
+ }): boolean;
793
+ /** Whether `tx` invoked `program`, in a top-level or inner instruction. */
794
+ declare function invoked(tx: WalletTransaction, program: string): boolean;
795
+ /**
796
+ * The arguments of the first instruction of the program in `tx` named `name`, as the program's
797
+ * Anchor IDL spells it, or `null` when there is none, or the program's setting has no IDL.
798
+ */
799
+ declare function instruction(tx: WalletTransaction, name: string): WalletInstruction["args"] | null;
800
+
567
801
  declare const badge: (definition: BadgeHandle & Pick<Badge, "name">) => {
568
802
  reward: {
569
803
  badge: string;
@@ -587,10 +821,10 @@ declare const badge: (definition: BadgeHandle & Pick<Badge, "name">) => {
587
821
  tier: string;
588
822
  };
589
823
  /**
590
- * A reward that adds the member to a group when the completion's rewards are delivered. The
591
- * group must exist, unarchived, where the quest publishes; operators create it in Console
592
- * **Groups**. Revoking the completion removes the membership unless an operator's add or another
593
- * unrevoked completion also backs it.
824
+ * A reward that adds the member to a group when the completion's rewards are delivered. Publishing
825
+ * the quest creates the group, with no members, where it is missing; an archived group refuses.
826
+ * Revoking the completion removes the membership unless an operator's add or another unrevoked
827
+ * completion also backs it.
594
828
  */
595
829
  declare const groupMembership: (group: GroupHandle) => {
596
830
  reward: {
@@ -1276,15 +1510,15 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1276
1510
  group?: string | undefined;
1277
1511
  };
1278
1512
  tier: string;
1279
- } | {
1280
- kind: "points";
1281
- balance: string;
1282
- amount: number;
1283
1513
  } | {
1284
1514
  kind: "integration";
1285
1515
  provider: "discord";
1286
1516
  action: "grant-role";
1287
1517
  roleId: string;
1518
+ } | {
1519
+ kind: "points";
1520
+ balance: string;
1521
+ amount: number;
1288
1522
  })[] | ((ctx: {
1289
1523
  settings: z.core.$InferObjectOutput<T, {}>;
1290
1524
  }) => Reward[]);
@@ -1359,9 +1593,6 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1359
1593
  kind: "resource";
1360
1594
  default: string;
1361
1595
  source: {
1362
- provider: "domino";
1363
- resource: "point-ledger";
1364
- } | {
1365
1596
  provider: "discord";
1366
1597
  resource: "channel";
1367
1598
  types: ("text" | "announcement")[];
@@ -1369,6 +1600,9 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1369
1600
  provider: "discord";
1370
1601
  resource: "role";
1371
1602
  assignable: boolean;
1603
+ } | {
1604
+ provider: "domino";
1605
+ resource: "point-ledger";
1372
1606
  };
1373
1607
  label: string;
1374
1608
  description?: string | undefined;
@@ -1444,15 +1678,15 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1444
1678
  group?: string | undefined;
1445
1679
  };
1446
1680
  tier: string;
1447
- } | {
1448
- kind: "points";
1449
- balance: string;
1450
- amount: number;
1451
1681
  } | {
1452
1682
  kind: "integration";
1453
1683
  provider: "discord";
1454
1684
  action: "grant-role";
1455
1685
  roleId: string;
1686
+ } | {
1687
+ kind: "points";
1688
+ balance: string;
1689
+ amount: number;
1456
1690
  })[];
1457
1691
  humanReview: boolean;
1458
1692
  trigger: {
@@ -1474,7 +1708,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1474
1708
  actor?: "staff" | "member" | undefined;
1475
1709
  } | {
1476
1710
  kind: "manual";
1477
- input: "photo" | "quiz" | "none";
1711
+ input: "none" | "quiz" | "photo";
1478
1712
  actor?: "staff" | "member" | undefined;
1479
1713
  } | {
1480
1714
  kind: "automatic";
@@ -1518,9 +1752,9 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1518
1752
  path: string;
1519
1753
  equals: string | number | boolean;
1520
1754
  })[] | undefined;
1521
- enrollment?: "required" | "none" | undefined;
1755
+ enrollment?: "none" | "required" | undefined;
1522
1756
  since?: "activation" | "window" | "enrollment" | undefined;
1523
- historical?: "automatic" | "staff" | "claim" | undefined;
1757
+ historical?: "staff" | "claim" | "automatic" | undefined;
1524
1758
  content?: true | undefined;
1525
1759
  } | undefined;
1526
1760
  };
@@ -1543,9 +1777,6 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1543
1777
  title: string;
1544
1778
  })[];
1545
1779
  completion: {
1546
- kind: "streak";
1547
- days: number;
1548
- } | {
1549
1780
  kind: "progress";
1550
1781
  goal: {
1551
1782
  kind: "count";
@@ -1562,6 +1793,9 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1562
1793
  durationMs: number;
1563
1794
  };
1564
1795
  repeat: "repeat" | "once";
1796
+ } | {
1797
+ kind: "streak";
1798
+ days: number;
1565
1799
  } | {
1566
1800
  kind: "once";
1567
1801
  } | {
@@ -1587,7 +1821,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1587
1821
  campaign?: {
1588
1822
  key: string;
1589
1823
  title: string;
1590
- enrollment: "required" | "none";
1824
+ enrollment: "none" | "required";
1591
1825
  window?: {
1592
1826
  from: number;
1593
1827
  until: number;
@@ -1726,15 +1960,15 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1726
1960
  group?: string | undefined;
1727
1961
  };
1728
1962
  tier: string;
1729
- } | {
1730
- kind: "points";
1731
- balance: string;
1732
- amount: number;
1733
1963
  } | {
1734
1964
  kind: "integration";
1735
1965
  provider: "discord";
1736
1966
  action: "grant-role";
1737
1967
  roleId: string;
1968
+ } | {
1969
+ kind: "points";
1970
+ balance: string;
1971
+ amount: number;
1738
1972
  })[] | ((ctx: {
1739
1973
  settings: z.core.$InferObjectOutput<T, {}>;
1740
1974
  }) => Reward[]);
@@ -1809,9 +2043,6 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1809
2043
  kind: "resource";
1810
2044
  default: string;
1811
2045
  source: {
1812
- provider: "domino";
1813
- resource: "point-ledger";
1814
- } | {
1815
2046
  provider: "discord";
1816
2047
  resource: "channel";
1817
2048
  types: ("text" | "announcement")[];
@@ -1819,6 +2050,9 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1819
2050
  provider: "discord";
1820
2051
  resource: "role";
1821
2052
  assignable: boolean;
2053
+ } | {
2054
+ provider: "domino";
2055
+ resource: "point-ledger";
1822
2056
  };
1823
2057
  label: string;
1824
2058
  description?: string | undefined;
@@ -1894,15 +2128,15 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1894
2128
  group?: string | undefined;
1895
2129
  };
1896
2130
  tier: string;
1897
- } | {
1898
- kind: "points";
1899
- balance: string;
1900
- amount: number;
1901
2131
  } | {
1902
2132
  kind: "integration";
1903
2133
  provider: "discord";
1904
2134
  action: "grant-role";
1905
2135
  roleId: string;
2136
+ } | {
2137
+ kind: "points";
2138
+ balance: string;
2139
+ amount: number;
1906
2140
  })[];
1907
2141
  humanReview: boolean;
1908
2142
  trigger: {
@@ -1924,7 +2158,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1924
2158
  actor?: "staff" | "member" | undefined;
1925
2159
  } | {
1926
2160
  kind: "manual";
1927
- input: "photo" | "quiz" | "none";
2161
+ input: "none" | "quiz" | "photo";
1928
2162
  actor?: "staff" | "member" | undefined;
1929
2163
  } | {
1930
2164
  kind: "automatic";
@@ -1968,9 +2202,9 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1968
2202
  path: string;
1969
2203
  equals: string | number | boolean;
1970
2204
  })[] | undefined;
1971
- enrollment?: "required" | "none" | undefined;
2205
+ enrollment?: "none" | "required" | undefined;
1972
2206
  since?: "activation" | "window" | "enrollment" | undefined;
1973
- historical?: "automatic" | "staff" | "claim" | undefined;
2207
+ historical?: "staff" | "claim" | "automatic" | undefined;
1974
2208
  content?: true | undefined;
1975
2209
  } | undefined;
1976
2210
  };
@@ -1993,9 +2227,6 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1993
2227
  title: string;
1994
2228
  })[];
1995
2229
  completion: {
1996
- kind: "streak";
1997
- days: number;
1998
- } | {
1999
2230
  kind: "progress";
2000
2231
  goal: {
2001
2232
  kind: "count";
@@ -2012,6 +2243,9 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
2012
2243
  durationMs: number;
2013
2244
  };
2014
2245
  repeat: "repeat" | "once";
2246
+ } | {
2247
+ kind: "streak";
2248
+ days: number;
2015
2249
  } | {
2016
2250
  kind: "once";
2017
2251
  } | {
@@ -2037,7 +2271,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
2037
2271
  campaign?: {
2038
2272
  key: string;
2039
2273
  title: string;
2040
- enrollment: "required" | "none";
2274
+ enrollment: "none" | "required";
2041
2275
  window?: {
2042
2276
  from: number;
2043
2277
  until: number;
@@ -2110,4 +2344,4 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
2110
2344
  }): Promise<Decision>;
2111
2345
  } & ResourceHandle<"quest">;
2112
2346
 
2113
- export { AmountSetting, BalanceChain, ContentBody, type ContentData, ContentMetricName, type ContentTrigger, type ContentTriggerInput, DiscordMessageData, DiscordMessageTextData, DiscordReactionData, DiscordReader, type EvaluationCalendar, type EvaluationCalendarDay, type EvaluationContext, type EvaluationMember, GroupHandle, IdentityKind, ImageReader, IntegrationModule, type KeyedContext, LedgerHandle, LedgerReference, MemberCompletion, type MemberCompletionQuery, MemberIdentity, type Outcome, type PerformanceContext, type PerformanceOutcome, PointBalance, ProfileReferral, QuestHandle, type QuestKeyedContext, ReferralHandle, RoleOf, Setting, TelegramReader, Tracker, TrackerData, TrackerDataSchema, TrackerReader, type TrackerTrigger, TrackerTriggerContext, type TrackerTriggerInput, type TriggerAdmission, WalletReader, Where, type XContentBody, XReader, automatic, automaticFulfillment, badge, budget, calendar, content, count, customSource, decision, defineBadge, defineEngagementReward, defineLeaderboard, defineLedger, defineQuest, defineQuestType, defineReferral, defineTieredReward, defineTracker, discord, earned, evaluators, evidence, groupMembership, keyed, manual, once, pointLedgers, points, progress, questCompleted, rolling, settings, staffHandover, streak, telegram, untracked, x };
2347
+ export { AmountSetting, BalanceChain, ContentBody, type ContentData, ContentMetricName, type ContentTrigger, type ContentTriggerInput, ContractCall, ContractEvent, DiscordMessageData, DiscordMessageTextData, DiscordReactionData, DiscordReader, type EvaluationCalendar, type EvaluationCalendarDay, type EvaluationContext, type EvaluationMember, GroupHandle, IdentityKind, ImageReader, IntegrationModule, type KeyedContext, LedgerHandle, LedgerReference, MemberCompletion, type MemberCompletionQuery, MemberIdentity, NftCollection, type Outcome, type PerformanceContext, type PerformanceOutcome, PointBalance, ProfileReferral, QuestHandle, type QuestKeyedContext, ReferralHandle, RoleOf, Setting, SolanaProgram, TelegramReader, Tracker, TrackerData, TrackerDataSchema, TrackerReader, type TrackerTrigger, TrackerTriggerContext, type TrackerTriggerInput, type TriggerAdmission, WalletBalanceSourceQuery, WalletInstruction, WalletReader, WalletTransaction, Where, type XContentBody, XReader, automatic, automaticFulfillment, badge, budget, calendar, content, count, customSource, decision, defineBadge, defineEngagementReward, defineLeaderboard, defineLedger, defineQuest, defineQuestType, defineReferral, defineTieredReward, defineTracker, discord, earned, evaluators, evidence, groupMembership, instruction, invoked, keyed, manual, once, pointLedgers, points, progress, questCompleted, received, rolling, settings, spent, staffHandover, streak, swapped, telegram, tiktok, untracked, wallet, x, youtube };