@domino-sdk/relay 1.56.0 → 1.60.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (65) hide show
  1. package/CHANGELOG.md +100 -0
  2. package/dist/{accounts-DRPENuZe.d.ts → accounts-DoabriBX.d.ts} +21 -7
  3. package/dist/{attempt-captures-CxxO7DeD.d.ts → attempt-captures-W2dgzGqE.d.ts} +1 -1
  4. package/dist/authoring.d.ts +323 -39
  5. package/dist/authoring.js +312 -18
  6. package/dist/{automatic-outcomes-DxW_v5Wc.d.ts → automatic-outcomes-Cmou89IS.d.ts} +1 -1
  7. package/dist/avatar.d.ts +1 -2
  8. package/dist/browser.d.ts +19 -11
  9. package/dist/browser.js +12 -10
  10. package/dist/{capability-error-DSd8EMQC.d.ts → capability-error-DufwG3G0.d.ts} +21 -7
  11. package/dist/{chunk-OTITLABX.js → chunk-2FHNY52R.js} +8 -2
  12. package/dist/{chunk-QNQNKIAA.js → chunk-422J3QRW.js} +12 -2
  13. package/dist/{chunk-INSWI2VZ.js → chunk-4OFH4BNX.js} +1 -1
  14. package/dist/{chunk-KBVH4XZC.js → chunk-6ZG7WNYX.js} +1 -1
  15. package/dist/{chunk-BHHUSBSD.js → chunk-GBSDAD3N.js} +1627 -887
  16. package/dist/{chunk-W5U2WXG3.js → chunk-KUPVQXUJ.js} +2 -2
  17. package/dist/{chunk-G6XVBYH7.js → chunk-KWFY7L7X.js} +4 -4
  18. package/dist/{chunk-BJYMTCWG.js → chunk-MJEJQH5A.js} +18 -6
  19. package/dist/{chunk-ULQU7KC4.js → chunk-N3LJ6GFK.js} +1 -5
  20. package/dist/{chunk-ABJ4G47X.js → chunk-N7YOS4ZU.js} +1 -1
  21. package/dist/{chunk-MNU6UPXY.js → chunk-OTEUP2SG.js} +1 -1
  22. package/dist/{chunk-NK6EER33.js → chunk-VVRQQRMQ.js} +12 -12
  23. package/dist/{chunk-H2MD6E7Z.js → chunk-VWMIA2TT.js} +8 -2
  24. package/dist/{chunk-RBPMT53S.js → chunk-XQKUJL7H.js} +25 -5
  25. package/dist/{chunk-CXKXPB7K.js → chunk-Y2IGFLD2.js} +36 -11
  26. package/dist/{chunk-VSHV7FEA.js → chunk-YNW2ZUUP.js} +56 -153
  27. package/dist/{chunk-CK7HO32Z.js → chunk-YOAPPIWN.js} +2 -2
  28. package/dist/{client-bX3oTpRu.d.ts → client-Cw1pB5sv.d.ts} +121 -117
  29. package/dist/{deployments-D3lxfQMB.d.ts → deployments-DI-W7fBq.d.ts} +1105 -182
  30. package/dist/{groups-DPE004_V.d.ts → groups-9Jm3peq3.d.ts} +14 -7
  31. package/dist/index.d.ts +10 -11
  32. package/dist/index.js +9 -9
  33. package/dist/{integrations-CcD5NPEA.d.ts → integrations-CmIkP1Gi.d.ts} +48 -32
  34. package/dist/internal.d.ts +10 -10
  35. package/dist/internal.js +8 -8
  36. package/dist/{offers-CtzMeB7O.d.ts → offers-CqXfMIxq.d.ts} +7 -2
  37. package/dist/{pages-BlLqB8ZQ.d.ts → pages-Bti7g5mX.d.ts} +184 -10
  38. package/dist/{participant-activity-iciCEs_8.d.ts → participant-activity-DHL8QYks.d.ts} +4 -0
  39. package/dist/portal-proxy.js +3 -3
  40. package/dist/react/index.d.ts +74 -74
  41. package/dist/react/index.js +10 -10
  42. package/dist/runtime/authoring.js +1 -1
  43. package/dist/runtime/chunks/ADUMK6CR.js +1 -0
  44. package/dist/runtime/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-CwbRkmlr.d.ts} +324 -35
  49. package/dist/schema.d.ts +854 -437
  50. package/dist/schema.js +103 -25
  51. package/dist/server/index.d.ts +10 -10
  52. package/dist/server/index.js +711 -81
  53. package/dist/{submission-input-wTiYGdgA.d.ts → submission-input-D9EGH_yb.d.ts} +2 -2
  54. package/dist/{telegram-browser-Bh3i0HiH.d.ts → telegram-browser-CTJh4Ro_.d.ts} +4 -4
  55. package/dist/testing.d.ts +89 -9
  56. package/dist/testing.js +218 -13
  57. package/dist/{transport-CnKA-_RL.d.ts → transport-B8Ss5lcz.d.ts} +9189 -2009
  58. package/dist/wallet-DZWL7lJH.d.ts +972 -0
  59. package/dist/{x-1czZFVUW.d.ts → x-KFJD2x8y.d.ts} +3 -3
  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/NDB42VFF.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-CwbRkmlr.js';
2
+ export { aj as LedgerSetting, ak as TrackerPage, al as TrackerReadQuery, am as trackerDataSchema, an as trackerTriggerContextSchema } from './schema-CwbRkmlr.js';
3
+ import { M as MemberCompletion, B as Budget, A as AuthorBudget } from './capability-error-DufwG3G0.js';
4
+ export { C as CapabilityError, a as CapabilityErrorCode, c as capabilityErrorCodes } from './capability-error-DufwG3G0.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-DZWL7lJH.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-DZWL7lJH.js';
6
7
  import * as z from 'zod';
7
8
  export { z } from 'zod';
8
- import { f as badgeDeclarationSchema, B as Badge } from './offers-CtzMeB7O.js';
9
- export { g as defineOffer } from './offers-CtzMeB7O.js';
10
- import { E as EngagementBudget, l as leaderboardDefinitionSchema, m as AuthoringIdentity, r as referralAuthoringSchema, C as CampaignDefinition, A as AvailabilityWindow } from './groups-DPE004_V.js';
11
- export { n as defineCampaign, o as defineGroup } from './groups-DPE004_V.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-CqXfMIxq.js';
10
+ export { g as defineOffer } from './offers-CqXfMIxq.js';
11
+ import { E as EngagementBudget, m as leaderboardDefinitionSchema, l as AuthoringIdentity, r as referralAuthoringSchema, C as CampaignDefinition, A as AvailabilityWindow } from './groups-9Jm3peq3.js';
12
+ export { n as defineCampaign, o as defineGroup } from './groups-9Jm3peq3.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-DoabriBX.js';
14
+ export { i as TelegramChatMember, j as TelegramChatMemberStatus, k as TelegramMessageData, l as TelegramReactionData } from './accounts-DoabriBX.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-CcD5NPEA.js';
16
- export { D as DashboardInput, b as DashboardPanelInput, T as TikTokVideoBody, c as TikTokVideoMetric, Y as YouTubeShortBody, d as YouTubeShortMetric, e as defineDashboard } from './integrations-CcD5NPEA.js';
17
- import { P as Prerequisite, T as TextEvidence, U as UrlEvidence, a as TextOptions, b as UrlOptions } from './submission-input-wTiYGdgA.js';
18
- export { c as balanceAtLeast, d as completed, i as inGroup } from './submission-input-wTiYGdgA.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, b as Announcement } from './integrations-CmIkP1Gi.js';
17
+ export { D as DashboardInput, c as DashboardPanelInput, T as TikTokVideoBody, d as TikTokVideoMetric, Y as YouTubeShortBody, e as YouTubeShortMetric, f as defineDashboard } from './integrations-CmIkP1Gi.js';
18
+ import { P as Prerequisite, T as TextEvidence, U as UrlEvidence, a as TextOptions, b as UrlOptions } from './submission-input-D9EGH_yb.js';
19
+ export { c as balanceAtLeast, d as completed, i as inGroup } from './submission-input-D9EGH_yb.js';
20
+ import { I as ImageReader, X as XReader } from './x-KFJD2x8y.js';
22
21
  export { f as formatUnits, p as parseUnits } from './units-CwgsPB_r.js';
23
22
  import './analytics-URV-mxjH.js';
24
23
 
@@ -447,18 +446,46 @@ declare const discord: {
447
446
  action: "grant-role";
448
447
  roleId: string;
449
448
  };
449
+ /**
450
+ * An announcement Domino's bot posts in a channel of the project's Discord server when a
451
+ * completion pays, such as `"{beneficiary} got +{points} XP from {author}"`. Placeholders are
452
+ * `announcementPlaceholders`; `{beneficiary}` and `{author}` mention linked Discord accounts.
453
+ * Pass it in the quest's `announcements`, and declare the `discord` integration.
454
+ */
455
+ postMessage(options: {
456
+ channel: string;
457
+ text: string;
458
+ replyToTriggeringMessage?: boolean;
459
+ }): {
460
+ action: "post-message";
461
+ text: string;
462
+ provider: "discord";
463
+ channel: string;
464
+ replyToTriggeringMessage?: boolean | undefined;
465
+ };
450
466
  messages: typeof messages;
451
467
  reactions: typeof reactions;
452
468
  roles(options?: {
453
469
  assignable?: boolean;
454
470
  }): ResourceSource;
471
+ /**
472
+ * A channel of the project's Discord server, for a resource setting. With `postable: true`,
473
+ * Console lists channels Domino's bot cannot post in as unavailable, as an announcement's
474
+ * channel needs.
475
+ */
455
476
  channels(options?: {
456
477
  types?: ChannelTypes;
478
+ postable?: boolean;
457
479
  }): ResourceSource;
458
480
  };
459
481
  /**
460
482
  * Telegram, through Domino's bot in the chats a project connects in Console.
461
483
  *
484
+ * - `telegram.messages()`: a tracker source of the messages members post in those groups and
485
+ * supergroups. Each record is one message, keyed by chat and message ID: its `author` is the
486
+ * poster's Telegram account. `data` is `TelegramMessageData`, which names the chat, the message,
487
+ * and the reply target and topic thread, never the text. Bots', service and channel messages
488
+ * are not recorded, and an edit is the same message.
462
489
  * - `telegram.reactions()`: a tracker source of the reactions members add to messages in those
463
490
  * groups and supergroups. Each record is one added reaction: its `author` is the reactor and
464
491
  * its `messageAuthor` account is the message's author, both Telegram accounts. `data` is
@@ -466,20 +493,63 @@ declare const discord: {
466
493
  * Pay the message's author with `automatic({ tracker, beneficiary: "messageAuthor" })`.
467
494
  * - Quests read membership with `ctx.telegram.member({ chat })`, naming the chat with
468
495
  * `settings.telegramChat()`.
496
+ * - `telegram.postMessage({ chat, text })`: an announcement the bot posts in a connected chat
497
+ * when a completion pays, listed in the quest's `announcements`.
469
498
  *
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.
499
+ * In SDK 1.x both sources are custom sources whose namespaces Relay reserves: only Relay writes
500
+ * their records, and the accounts on them are Telegram accounts whatever `identities` says.
472
501
  */
473
502
  declare const telegram: {
503
+ /**
504
+ * An announcement Domino's bot posts in a connected chat when a completion pays, such as
505
+ * `"{beneficiary} got +{points} XP from {author}"`. Name the chat with `settings.telegramChat()`.
506
+ * Placeholders are `announcementPlaceholders`; `{beneficiary}` and `{author}` mention Telegram
507
+ * accounts. Pass it in the quest's `announcements`.
508
+ */
509
+ postMessage(options: {
510
+ chat: string;
511
+ text: string;
512
+ replyToTriggeringMessage?: boolean;
513
+ }): {
514
+ action: "post-message";
515
+ text: string;
516
+ provider: "telegram";
517
+ chat: string;
518
+ replyToTriggeringMessage?: boolean | undefined;
519
+ };
520
+ messages(): {
521
+ kind: "custom";
522
+ namespace: string;
523
+ identities?: ("discord" | "member" | "wallet" | "x" | `app:${string}`)[] | undefined;
524
+ accounts?: string[] | undefined;
525
+ data?: TrackerDataSchema | undefined;
526
+ content?: {
527
+ metrics: string[];
528
+ } | undefined;
529
+ balance?: {
530
+ chain: string;
531
+ token: string | null;
532
+ } | undefined;
533
+ } & WithRecordData<{
534
+ chatId: string;
535
+ chatType: string;
536
+ messageId: number;
537
+ replyToMessageId: number | null;
538
+ threadId: number | null;
539
+ }> & WithAccountRoles<"author">;
474
540
  reactions(): {
475
541
  kind: "custom";
476
542
  namespace: string;
477
- identities?: ("x" | "discord" | "member" | "wallet" | `app:${string}`)[] | undefined;
543
+ identities?: ("discord" | "member" | "wallet" | "x" | `app:${string}`)[] | undefined;
478
544
  accounts?: string[] | undefined;
479
545
  data?: TrackerDataSchema | undefined;
480
546
  content?: {
481
547
  metrics: string[];
482
548
  } | undefined;
549
+ balance?: {
550
+ chain: string;
551
+ token: string | null;
552
+ } | undefined;
483
553
  } & WithRecordData<{
484
554
  chatId: string;
485
555
  chatType: string;
@@ -509,12 +579,16 @@ declare const youtube: {
509
579
  shorts(): {
510
580
  kind: "custom";
511
581
  namespace: string;
512
- identities?: ("x" | "discord" | "member" | "wallet" | `app:${string}`)[] | undefined;
582
+ identities?: ("discord" | "member" | "wallet" | "x" | `app:${string}`)[] | undefined;
513
583
  accounts?: string[] | undefined;
514
584
  data?: TrackerDataSchema | undefined;
515
585
  content?: {
516
586
  metrics: string[];
517
587
  } | undefined;
588
+ balance?: {
589
+ chain: string;
590
+ token: string | null;
591
+ } | undefined;
518
592
  } & WithRecordData<ContentData<{
519
593
  title: string;
520
594
  description: string;
@@ -547,12 +621,16 @@ declare const tiktok: {
547
621
  videos(): {
548
622
  kind: "custom";
549
623
  namespace: string;
550
- identities?: ("x" | "discord" | "member" | "wallet" | `app:${string}`)[] | undefined;
624
+ identities?: ("discord" | "member" | "wallet" | "x" | `app:${string}`)[] | undefined;
551
625
  accounts?: string[] | undefined;
552
626
  data?: TrackerDataSchema | undefined;
553
627
  content?: {
554
628
  metrics: string[];
555
629
  } | undefined;
630
+ balance?: {
631
+ chain: string;
632
+ token: string | null;
633
+ } | undefined;
556
634
  } & WithRecordData<ContentData<{
557
635
  title: string;
558
636
  description: string;
@@ -573,6 +651,49 @@ declare const tiktok: {
573
651
  isAigc: boolean;
574
652
  }, "likes" | "views" | "comments" | "shares"> & WithAccountRoles<"author">;
575
653
  };
654
+ /**
655
+ * Members' linked wallets, sampled by Relay.
656
+ *
657
+ * - `wallet.balances({ chain, token })`: a tracker source of daily balance samples. Once per
658
+ * project-calendar day, at a time members can't predict, Relay reads the balance of every
659
+ * wallet of that chain's family linked by a member who joined the project, every wallet at one
660
+ * pinned EVM block or Cosmos height (Solana can't read a past slot: each read reaches at least
661
+ * the pinned slot). Each record is one wallet, keyed by its CAIP-10 account on `chain`, which is also
662
+ * its `author`; each sample is a new observation whose `occurredAt` is the sample time and whose
663
+ * `data` is `WalletBalanceSample`. `chain` and `token` are those of `ctx.wallet.balance()`: an
664
+ * EVM chain with its native coin or an ERC-20, Solana with SOL or an SPL or Token-2022 mint, or a
665
+ * Cosmos chain with a bank denomination. A day whose reads all fail has no sample: Relay never
666
+ * writes a balance it didn't read. Reward holding for days with
667
+ * `automatic({ tracker, where: { path: "amount", gte: ... } })` and `streak({ days })`.
668
+ *
669
+ * In SDK 1.x the source is a custom source whose namespace Relay reserves: only Relay writes its
670
+ * records. A project and environment can have at most 5 of them.
671
+ */
672
+ declare const wallet: {
673
+ balances(query: WalletBalanceSourceQuery): ({
674
+ kind: "custom";
675
+ namespace: string;
676
+ identities?: ("discord" | "member" | "wallet" | "x" | `app:${string}`)[] | undefined;
677
+ accounts?: string[] | undefined;
678
+ data?: TrackerDataSchema | undefined;
679
+ content?: {
680
+ metrics: string[];
681
+ } | undefined;
682
+ balance?: {
683
+ chain: string;
684
+ token: string | null;
685
+ } | undefined;
686
+ } & WithRecordData<{
687
+ amount: string;
688
+ decimals: number | null;
689
+ block: string;
690
+ }> & WithAccountRoles<"author">) & {
691
+ balance: {
692
+ chain: string;
693
+ token: string | null;
694
+ };
695
+ };
696
+ };
576
697
  declare const pointLedgers: () => ResourceSource;
577
698
  type Label = {
578
699
  label: string;
@@ -630,6 +751,50 @@ declare const settings: {
630
751
  chain(options: Label & {
631
752
  default: BalanceChain;
632
753
  }): Setting<"text", z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<"solana" | "solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp" | `eip155:${number}`, string>>>>;
754
+ /**
755
+ * An NFT collection `ctx.wallet.nfts()` reads, as a CAIP-19 asset type: an EVM chain, the
756
+ * standard and the contract, such as `"eip155:1/erc721:0x…"`, or `"eip155:8453/erc1155:0x…/1"` for
757
+ * one ERC-1155 token ID; or a Metaplex collection NFT's mint on Solana mainnet,
758
+ * `"solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/nft:<mint>"`. Relay checks it when the collection is
759
+ * published or edited: an EVM chain must be one `ctx.wallet.balance()` reads and the contract
760
+ * must report the standard through ERC-165 `supportsInterface`; a Solana mint must be a Metaplex
761
+ * collection NFT. Typed as the query's collection, so it passes to
762
+ * `ctx.wallet.nfts({ collection })` as it is.
763
+ */
764
+ nft(options: Label & {
765
+ default: NftCollection;
766
+ }): 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>>>>;
767
+ /**
768
+ * A contract function `ctx.wallet.call()` reads: the contract's CAIP-10 account ID on an EVM
769
+ * chain, a space, and the function's human-readable signature, such as
770
+ * `"eip155:8453:0x… function stakedOf(address) view returns (uint256)"`. Only `view` and `pure`
771
+ * functions with elementary parameters that return one `uint`, `int`, `bool` or `address` are
772
+ * accepted; publication and Console edits also check that Relay reads the chain. Typed as the
773
+ * query's call, so it passes to `ctx.wallet.call({ call })` as it is.
774
+ */
775
+ contractCall(options: Label & {
776
+ default: ContractCall;
777
+ }): Setting<"text", z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<`eip155:${number}:0x${string} function ${string}`, string>>>>;
778
+ /**
779
+ * An EVM contract event `ctx.wallet.events()` reads: the contract as a CAIP-10 account ID and
780
+ * the event's Solidity signature, with argument names and `indexed` markers, such as
781
+ * `"eip155:8453:0x… Transfer(address indexed from, address indexed to, uint256 value)"`. The event
782
+ * needs an indexed `address` argument, the one matched against the member's wallets. Relay checks
783
+ * it when the event is published or edited: the chain must be one `ctx.wallet.balance()` reads
784
+ * and report a finalized or safe block, and the address must hold a contract. Typed as the query's
785
+ * event, so it passes to `ctx.wallet.events({ event })` as it is.
786
+ */
787
+ contractEvent(options: Label & {
788
+ default: ContractEvent;
789
+ }): Setting<"text", z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<`eip155:${number}:0x${string} ${string}`, string>>>>;
790
+ /**
791
+ * A Solana mainnet program `ctx.wallet.transactions()` reads: its base58 address, such as
792
+ * Jupiter's `"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4"`. Relay checks it when it is published
793
+ * or edited: the account must exist and be an executable program.
794
+ */
795
+ solanaProgram(options: Label & {
796
+ default: SolanaProgram;
797
+ }): Setting<"text", z.ZodDefault<z.ZodPipe<z.ZodString, z.ZodTransform<string, string>>>>;
633
798
  integer(options: Label & {
634
799
  default: number;
635
800
  min: number;
@@ -646,6 +811,35 @@ declare const settings: {
646
811
  object<T extends Record<string, Setting>>(shape: T): z.ZodObject<{ -readonly [P in keyof T]: T[P]; }, z.core.$strict>;
647
812
  };
648
813
 
814
+ /**
815
+ * How much of `mint` (`"SOL"` for lamports) the wallet gained in `tx`, in base units, or `"0"`
816
+ * when it gained none.
817
+ */
818
+ declare function received(tx: WalletTransaction, mint: string): string;
819
+ /**
820
+ * How much of `mint` (`"SOL"` for lamports, rent included, the fee not) the wallet gave up in `tx`, in base
821
+ * units, or `"0"` when it gave up none.
822
+ */
823
+ declare function spent(tx: WalletTransaction, mint: string): string;
824
+ /**
825
+ * Whether the wallet swapped in `tx`: one mint went down and a different one went up. `into` names
826
+ * the mint that must have gone up, `from` the one that must have gone down; `"SOL"` stands for
827
+ * lamports. The fee is left out of SOL, but rent is not: a transaction that opens a token account
828
+ * for the wallet lowers its SOL by the rent, so check a swap out of SOL with `spent(tx, "SOL")`
829
+ * against a minimum above it.
830
+ */
831
+ declare function swapped(tx: WalletTransaction, options?: {
832
+ into?: string;
833
+ from?: string;
834
+ }): boolean;
835
+ /** Whether `tx` invoked `program`, in a top-level or inner instruction. */
836
+ declare function invoked(tx: WalletTransaction, program: string): boolean;
837
+ /**
838
+ * The arguments of the first instruction of the program in `tx` named `name`, as the program's
839
+ * Anchor IDL spells it, or `null` when there is none, or the program's setting has no IDL.
840
+ */
841
+ declare function instruction(tx: WalletTransaction, name: string): WalletInstruction["args"] | null;
842
+
649
843
  declare const badge: (definition: BadgeHandle & Pick<Badge, "name">) => {
650
844
  reward: {
651
845
  badge: string;
@@ -916,19 +1110,21 @@ type QuestKeyedContext<S, G> = Omit<KeyedContext, "tracker"> & {
916
1110
  /** The pinned tracker observation: non-null and typed for a tracker trigger, null for others. */
917
1111
  tracker: ContextTracker<G>;
918
1112
  };
919
- declare const budget: (definition: Omit<Budget, "id" | "cost"> & {
1113
+ type BudgetDefinition<B extends Budget | AuthorBudget> = Omit<B, "id" | "cost"> & {
920
1114
  key: string;
921
1115
  cost: number | {
922
1116
  ledger: LedgerReference;
923
1117
  };
924
- }) => {
925
- id: string;
926
- scope: "member" | "project";
927
- period: "lifetime" | "day" | "week" | "month";
928
- limit: number;
929
- cost: number | {
930
- balance: string;
931
- };
1118
+ };
1119
+ /**
1120
+ * A named cap on a quest's completions or awarded points, per member (`scope: "member"`), for
1121
+ * everyone together (`"project"`), or per tracker record author (`"author"`): the account that
1122
+ * caused the record, such as a reaction's reactor, whether or not a member linked it. An author
1123
+ * budget caps what one person gives when the quest pays someone else, and needs a tracker trigger.
1124
+ */
1125
+ declare const budget: {
1126
+ (definition: BudgetDefinition<Budget>): Budget;
1127
+ (definition: BudgetDefinition<AuthorBudget>): AuthorBudget;
932
1128
  };
933
1129
  declare const keyed: (key: (ctx: KeyedContext) => string) => {
934
1130
  kind: "keyed";
@@ -1312,7 +1508,8 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1312
1508
  * (`relay.profiles.completions`). Hidden by default.
1313
1509
  */
1314
1510
  profile?: QuestProfile;
1315
- budgets?: Budget[];
1511
+ /** Its {@link budget}s; an author budget needs a tracker trigger. */
1512
+ budgets?: (Budget | AuthorBudget)[];
1316
1513
  /**
1317
1514
  * Milliseconds a member waits after an attempt is rejected, by the evaluator or a
1318
1515
  * reviewer, before submitting again: `300_000` lets a quiz be retried every five minutes.
@@ -1370,6 +1567,26 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1370
1567
  })[] | ((ctx: {
1371
1568
  settings: z.core.$InferObjectOutput<T, {}>;
1372
1569
  }) => Reward[]);
1570
+ /**
1571
+ * Messages Relay posts when a completion pays, after its rewards commit, such as
1572
+ * `telegram.postMessage({ chat, text: "{beneficiary} got +{points} XP from {author}" })`.
1573
+ * At most three. Return none while a setting they need is empty.
1574
+ */
1575
+ announcements?: ({
1576
+ action: "post-message";
1577
+ text: string;
1578
+ provider: "telegram";
1579
+ chat: string;
1580
+ replyToTriggeringMessage?: boolean | undefined;
1581
+ } | {
1582
+ action: "post-message";
1583
+ text: string;
1584
+ provider: "discord";
1585
+ channel: string;
1586
+ replyToTriggeringMessage?: boolean | undefined;
1587
+ })[] | ((ctx: {
1588
+ settings: z.core.$InferObjectOutput<T, {}>;
1589
+ }) => Announcement[]) | undefined;
1373
1590
  evaluate?: Evaluator<z.core.$InferObjectOutput<T, {}>, QuestInput<G>, NoInfer<G>, NoInfer<D>> | undefined;
1374
1591
  /**
1375
1592
  * A content quest's performance stage: once content evaluation accepts an item, each later
@@ -1402,7 +1619,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1402
1619
  imageAlt?: string | undefined;
1403
1620
  requirements?: ({
1404
1621
  kind: "account";
1405
- provider: "x" | "discord" | "google" | "apple";
1622
+ provider: "discord" | "x" | "google" | "apple";
1406
1623
  } | {
1407
1624
  kind: "wallet";
1408
1625
  chain?: "solana" | "eip155" | "cosmos" | undefined;
@@ -1426,7 +1643,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1426
1643
  } | undefined;
1427
1644
  } | undefined;
1428
1645
  };
1429
- integrations: ("x" | "discord")[];
1646
+ integrations: ("discord" | "x")[];
1430
1647
  fields: Record<string, {
1431
1648
  kind: "point-ledger";
1432
1649
  default: string;
@@ -1444,6 +1661,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1444
1661
  provider: "discord";
1445
1662
  resource: "channel";
1446
1663
  types: ("text" | "announcement")[];
1664
+ postable?: true | undefined;
1447
1665
  } | {
1448
1666
  provider: "discord";
1449
1667
  resource: "role";
@@ -1662,6 +1880,19 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1662
1880
  balance: string;
1663
1881
  };
1664
1882
  }[];
1883
+ announcements?: ({
1884
+ action: "post-message";
1885
+ text: string;
1886
+ provider: "telegram";
1887
+ chat: string;
1888
+ replyToTriggeringMessage?: boolean | undefined;
1889
+ } | {
1890
+ action: "post-message";
1891
+ text: string;
1892
+ provider: "discord";
1893
+ channel: string;
1894
+ replyToTriggeringMessage?: boolean | undefined;
1895
+ })[] | undefined;
1665
1896
  performance?: {
1666
1897
  metrics: string[];
1667
1898
  maxAgeMs: number;
@@ -1679,6 +1910,15 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
1679
1910
  from: number;
1680
1911
  until: number;
1681
1912
  } | undefined;
1913
+ authorBudgets?: {
1914
+ id: string;
1915
+ period: "lifetime" | "day" | "week" | "month";
1916
+ limit: number;
1917
+ cost: number | {
1918
+ balance: string;
1919
+ };
1920
+ scope: "author";
1921
+ }[] | undefined;
1682
1922
  retryCooldownMs?: number | undefined;
1683
1923
  completionCooldownMs?: number | undefined;
1684
1924
  };
@@ -1762,7 +2002,8 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1762
2002
  * (`relay.profiles.completions`). Hidden by default.
1763
2003
  */
1764
2004
  profile?: QuestProfile;
1765
- budgets?: Budget[];
2005
+ /** Its {@link budget}s; an author budget needs a tracker trigger. */
2006
+ budgets?: (Budget | AuthorBudget)[];
1766
2007
  /**
1767
2008
  * Milliseconds a member waits after an attempt is rejected, by the evaluator or a
1768
2009
  * reviewer, before submitting again: `300_000` lets a quiz be retried every five minutes.
@@ -1820,6 +2061,26 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1820
2061
  })[] | ((ctx: {
1821
2062
  settings: z.core.$InferObjectOutput<T, {}>;
1822
2063
  }) => Reward[]);
2064
+ /**
2065
+ * Messages Relay posts when a completion pays, after its rewards commit, such as
2066
+ * `telegram.postMessage({ chat, text: "{beneficiary} got +{points} XP from {author}" })`.
2067
+ * At most three. Return none while a setting they need is empty.
2068
+ */
2069
+ announcements?: ({
2070
+ action: "post-message";
2071
+ text: string;
2072
+ provider: "telegram";
2073
+ chat: string;
2074
+ replyToTriggeringMessage?: boolean | undefined;
2075
+ } | {
2076
+ action: "post-message";
2077
+ text: string;
2078
+ provider: "discord";
2079
+ channel: string;
2080
+ replyToTriggeringMessage?: boolean | undefined;
2081
+ })[] | ((ctx: {
2082
+ settings: z.core.$InferObjectOutput<T, {}>;
2083
+ }) => Announcement[]) | undefined;
1823
2084
  evaluate?: Evaluator<z.core.$InferObjectOutput<T, {}>, QuestInput<G>, NoInfer<G>, NoInfer<D>> | undefined;
1824
2085
  /**
1825
2086
  * A content quest's performance stage: once content evaluation accepts an item, each later
@@ -1852,7 +2113,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1852
2113
  imageAlt?: string | undefined;
1853
2114
  requirements?: ({
1854
2115
  kind: "account";
1855
- provider: "x" | "discord" | "google" | "apple";
2116
+ provider: "discord" | "x" | "google" | "apple";
1856
2117
  } | {
1857
2118
  kind: "wallet";
1858
2119
  chain?: "solana" | "eip155" | "cosmos" | undefined;
@@ -1876,7 +2137,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1876
2137
  } | undefined;
1877
2138
  } | undefined;
1878
2139
  };
1879
- integrations: ("x" | "discord")[];
2140
+ integrations: ("discord" | "x")[];
1880
2141
  fields: Record<string, {
1881
2142
  kind: "point-ledger";
1882
2143
  default: string;
@@ -1894,6 +2155,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
1894
2155
  provider: "discord";
1895
2156
  resource: "channel";
1896
2157
  types: ("text" | "announcement")[];
2158
+ postable?: true | undefined;
1897
2159
  } | {
1898
2160
  provider: "discord";
1899
2161
  resource: "role";
@@ -2112,6 +2374,19 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
2112
2374
  balance: string;
2113
2375
  };
2114
2376
  }[];
2377
+ announcements?: ({
2378
+ action: "post-message";
2379
+ text: string;
2380
+ provider: "telegram";
2381
+ chat: string;
2382
+ replyToTriggeringMessage?: boolean | undefined;
2383
+ } | {
2384
+ action: "post-message";
2385
+ text: string;
2386
+ provider: "discord";
2387
+ channel: string;
2388
+ replyToTriggeringMessage?: boolean | undefined;
2389
+ })[] | undefined;
2115
2390
  performance?: {
2116
2391
  metrics: string[];
2117
2392
  maxAgeMs: number;
@@ -2129,6 +2404,15 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
2129
2404
  from: number;
2130
2405
  until: number;
2131
2406
  } | undefined;
2407
+ authorBudgets?: {
2408
+ id: string;
2409
+ period: "lifetime" | "day" | "week" | "month";
2410
+ limit: number;
2411
+ cost: number | {
2412
+ balance: string;
2413
+ };
2414
+ scope: "author";
2415
+ }[] | undefined;
2132
2416
  retryCooldownMs?: number | undefined;
2133
2417
  completionCooldownMs?: number | undefined;
2134
2418
  };
@@ -2192,4 +2476,4 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
2192
2476
  }): Promise<Decision>;
2193
2477
  } & ResourceHandle<"quest">;
2194
2478
 
2195
- 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, tiktok, untracked, x, youtube };
2479
+ 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 };