@domino-sdk/relay 1.56.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.
- package/CHANGELOG.md +74 -0
- package/dist/{accounts-DRPENuZe.d.ts → accounts-CVonEkdb.d.ts} +18 -7
- package/dist/{attempt-captures-CxxO7DeD.d.ts → attempt-captures-DBj-rxak.d.ts} +1 -1
- package/dist/authoring.d.ts +180 -28
- package/dist/authoring.js +236 -11
- package/dist/{automatic-outcomes-DxW_v5Wc.d.ts → automatic-outcomes-FS9okvBP.d.ts} +1 -1
- package/dist/avatar.d.ts +1 -2
- package/dist/browser.d.ts +8 -9
- package/dist/browser.js +10 -10
- package/dist/{capability-error-DSd8EMQC.d.ts → capability-error-DDJl0LY-.d.ts} +0 -6
- package/dist/{chunk-OTITLABX.js → chunk-2LKGAL63.js} +2 -2
- package/dist/{chunk-NK6EER33.js → chunk-577DG2IT.js} +8 -8
- package/dist/{chunk-RBPMT53S.js → chunk-6U5WWH3W.js} +19 -4
- package/dist/{chunk-BHHUSBSD.js → chunk-AWWCEP7F.js} +1402 -881
- package/dist/{chunk-QNQNKIAA.js → chunk-EQF4ID47.js} +1 -1
- package/dist/{chunk-CK7HO32Z.js → chunk-IBROKMFV.js} +2 -2
- package/dist/{chunk-MNU6UPXY.js → chunk-KBCTII6C.js} +1 -1
- package/dist/{chunk-INSWI2VZ.js → chunk-KYUQEZZA.js} +1 -1
- package/dist/{chunk-G6XVBYH7.js → chunk-LDLOB2UZ.js} +4 -4
- package/dist/{chunk-CXKXPB7K.js → chunk-M2JQPDUX.js} +34 -9
- package/dist/{chunk-KBVH4XZC.js → chunk-R4S6BFOH.js} +1 -1
- package/dist/{chunk-ABJ4G47X.js → chunk-TZJT5CRF.js} +1 -1
- package/dist/{chunk-BJYMTCWG.js → chunk-UEMLYPKJ.js} +7 -4
- package/dist/{chunk-ULQU7KC4.js → chunk-W42KMMH5.js} +1 -5
- package/dist/{chunk-VSHV7FEA.js → chunk-XGXDINGM.js} +16 -3
- package/dist/{chunk-H2MD6E7Z.js → chunk-YMWRLAAP.js} +1 -1
- package/dist/{chunk-W5U2WXG3.js → chunk-YRSU2X2P.js} +2 -2
- package/dist/{client-bX3oTpRu.d.ts → client-3b9HjSzZ.d.ts} +115 -116
- package/dist/{deployments-D3lxfQMB.d.ts → deployments-BydFVj4Q.d.ts} +314 -175
- package/dist/{groups-DPE004_V.d.ts → groups-CFuTfFqG.d.ts} +11 -7
- package/dist/index.d.ts +9 -10
- package/dist/index.js +9 -9
- package/dist/{integrations-CcD5NPEA.d.ts → integrations-DrbKQSTD.d.ts} +3 -32
- package/dist/internal.d.ts +10 -10
- package/dist/internal.js +8 -8
- package/dist/{offers-CtzMeB7O.d.ts → offers-DAfe1O3_.d.ts} +6 -2
- package/dist/{pages-BlLqB8ZQ.d.ts → pages-ChDVLrgR.d.ts} +39 -10
- package/dist/portal-proxy.js +3 -3
- package/dist/react/index.d.ts +71 -72
- package/dist/react/index.js +10 -10
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/BG43KQ2T.js +1 -0
- package/dist/runtime/chunks/EWU4OKSY.js +62 -0
- package/dist/runtime/manifest.json +5 -5
- package/dist/runtime/schema.js +1 -1
- package/dist/runtime/zod.js +1 -1
- package/dist/{schema-C4m9RhCR.d.ts → schema-BA0nRRlt.d.ts} +184 -35
- package/dist/schema.d.ts +754 -432
- package/dist/schema.js +77 -13
- package/dist/server/index.d.ts +10 -10
- package/dist/server/index.js +434 -55
- package/dist/{submission-input-wTiYGdgA.d.ts → submission-input-DxQ6RnKo.d.ts} +2 -2
- package/dist/{telegram-browser-Bh3i0HiH.d.ts → telegram-browser-o3OIxGrJ.d.ts} +3 -3
- package/dist/testing.d.ts +89 -9
- package/dist/testing.js +215 -10
- package/dist/{transport-CnKA-_RL.d.ts → transport-D_Eqf78J.d.ts} +3997 -2030
- package/dist/wallet-B06zvDXp.d.ts +972 -0
- package/dist/{x-1czZFVUW.d.ts → x-C28SNifw.d.ts} +2 -2
- package/package.json +2 -2
- package/dist/profiles-BoOK03cR.d.ts +0 -299
- package/dist/runtime/chunks/IDOMZWRY.js +0 -40
- package/dist/runtime/chunks/NDB42VFF.js +0 -1
- package/dist/util.d-w9f9t3ua.d.ts +0 -5
- package/dist/wallet-Ac7OFpOr.d.ts +0 -228
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,79 @@
|
|
|
1
1
|
# @domino-sdk/relay
|
|
2
2
|
|
|
3
|
+
## 1.59.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 1d5a195: `management.attempts.acceptAnyway({ attempt, reason })` (`POST /attempts/<id>/accept-anyway`, `review` permission) accepts a rejected attempt anyway, for any member, reversing a reviewer's or an evaluator's rejection. The acceptance pays as a reviewer's approval would, with the normal `completion.created` webhook; the rejection stays in the attempt's events beside a `staff-decision` with `decision: "accept-anyway"` and the reason, and the retry cooldown ends. Only the member's latest attempt on a quest that isn't archived qualifies (409 `attempt-superseded`, `quest-archived`), and a cap the acceptance would break refuses it instead of rejecting it again (409 `completion-cooldown`, `budget-exhausted`, `completion-revoked`, `already-completed`). `management.attempts.get` answers `supersededBy`, the member's newer attempt on the quest, or null. The CLI adds `domino attempts accept-anyway ATTEMPT --reason TEXT`.
|
|
8
|
+
- a0c77e4: Archiving or unarchiving a group, pausing or resuming a tracker, and changing the project's schedule state take an optional reason, which the audit log records: `management.groups.archive(group, { reason })` and `unarchive(group, { reason })`, `management.trackers.pause(reference, { actionId, reason })` and `resume`, and `management.schedules.setState(state, { reason })`. A reason is a trimmed string of 1–500 characters, like the other lifecycle reasons; leaving it out works as before. The CLI adds `--reason TEXT` to `domino groups archive|unarchive`, `domino trackers pause|resume` and `domino schedules pause|archive|resume`. Console asks for a reason in a dialog for each of these, and the project schedule menu no longer applies a state as soon as you pick it.
|
|
9
|
+
- 424863f: Operators can restore an entitlement they voided. `management.entitlements.restore(entitlement, { revision, reason })` (`POST /management/v1/entitlements/<id>/restore`, `review` permission) and `domino entitlements restore <id> --revision <n> --reason <text>` make a `void` entitlement `available` again at the tier an accepted completion still earns, and bring back any referral review the void settled. Restoring is refused with 409 `entitlement-status` when a completion revocation voided the entitlement or no accepted completion still earns it (the body names the `completion` to restore instead), when canceling an offer redemption voided it, or when a referral reward was voided before voids kept their reviews. Console Rewards and member detail offer **Restore reward** on a voided reward, and Audit history lists each restore with its reason.
|
|
10
|
+
- 790aa5d: Operators can restore a completion they revoked by mistake. `management.completions.restore({ completion, reason })` (`POST /management/v1/completions/<id>/restore`, `review` permission) and `domino completions restore <completion> --reason <text>` re-apply what the revocation recorded, not a fresh reward evaluation: the points it reversed are awarded again (points it could not reverse are not), its badges, group memberships, tiered rewards, Discord role grants, referral qualifications and streak milestone come back, and budgets stay spent. The result (`CompletionRestoration`) lists what came back. Restoring is refused with 409 `completion-not-revoked` when the completion isn't revoked, and with 409 `occurrence-taken` (naming the `completion` that holds it) when the revocation freed the occurrence and the member completed it again. `members.get(id).revokedCompletions` lists up to 25 revoked completions, each with its revoke's reason and result. Console member detail and attempt detail offer **Restore completion**, and the attempt history and Audit history show the restore beside the revoke.
|
|
11
|
+
- 850a252: `settlementPayoutCsv(exported)` turns the result of `management.leaderboards.settlementExport(id)` into the payout list as CSV, with the columns `member,score,rank,share,amount,unit,wallets`. `domino leaderboard-settlements export` now prints it through this helper, unchanged, and Console's prize settlement panel offers **Download payout list (CSV)** for any pool that is not points, with the same content.
|
|
12
|
+
- 7ac13ef: Solana transactions from `ctx.wallet.transactions()` now carry `signer`: whether the linked wallet signed the transaction. It is `false` for a transfer someone else sent into the wallet, and for results captured before it existed. Check it before rewarding an action. The new `solana-action` snippet completes a quest once per transaction a linked wallet signed that called your program, optionally receiving at least an amount of a token.
|
|
13
|
+
- 5b94440: Anchor instruction decoding for `ctx.wallet.transactions()`. Saving a `settings.solanaProgram()` setting now stores the program's Anchor IDL (legacy or 0.30+), read from its on-chain IDL account, in the published release's new optional `solanaIdls` (`SolanaProgramIdl`: `{ program, source, idl }`, by setting key). For a program without an on-chain IDL, an operator pastes one in Console or sends the new optional `solanaIdls: { [settingKey]: idl | null }` with `quests.updateSettings()` (`anchorIdlSchema`, `AnchorIdl`). With an IDL, each transaction gains optional `instructions`: the program's top-level and inner instructions in call order, decoded as `{ name, args, accounts }` (`WalletInstruction`). An instruction the IDL does not describe is skipped. The new `instruction(tx, name)` helper in `@domino-sdk/relay/authoring` returns the first matching instruction's args, or `null`. The testing kit's `facts.wallet.transactions` accepts `instructions`.
|
|
14
|
+
- 95cb8d8: On-chain action checks on Solana. `ctx.wallet.transactions({ program, since, afterActivation?, mint?, address? })` reads the successful, finalized transactions of the member's linked Solana wallets since `since` that invoked `program` in a top-level or inner instruction, oldest first. It returns `{ program, chain, mint, since, at, complete, transactions: [{ wallet, signature, slot, timestamp, programs, balanceChanges: [{ mint, delta }] }], observedAt }` (`WalletTransactions`, `WalletTransaction`, `WalletBalanceChange`, `walletTransactionsSchema`), with `mint` `"SOL"` for lamports (rent included, the fee the wallet paid left out) and `delta` a signed integer string, or null when the member has no linked Solana wallet, and follows `ctx.wallet.balance()`'s capture, `author-error` and `provider-unavailable` rules. With `mint`, only each wallet's associated token account for that mint is read. `since` may be at most 30 days before the evaluation (`maxWalletTransactionLookback`); each wallet's read fetches at most 1,000 transactions (`maxWalletTransactions`), and a wallet with more returns its newest ones with `complete: false` instead of throwing. `WalletReader.transactions` is optional in the type so that existing test doubles compile; Relay supplies it to every evaluation.
|
|
15
|
+
|
|
16
|
+
The program comes from the new `settings.solanaProgram({ label, default })` setting, a base58 address (`SolanaProgram`, `isSolanaProgram`) stored as a text setting with `picker: "solana-program"`. Publication, Console settings edits and unarchiving check that the account exists on Solana mainnet and is executable.
|
|
17
|
+
|
|
18
|
+
New pure helpers in `@domino-sdk/relay/authoring` read one transaction: `received(tx, mint)` and `spent(tx, mint)` return the wallet's gain or loss as an integer string, or `"0"`; `swapped(tx, { into?, from? })` checks that one mint went down and a different one went up; `invoked(tx, program)`. The testing kit answers `ctx.wallet.transactions()` from `facts.wallet.transactions`.
|
|
19
|
+
|
|
20
|
+
### Patch Changes
|
|
21
|
+
|
|
22
|
+
- aaa07ad: The SDK and CLI depend on Zod 4.6.5, whose schemas keep their methods on a shared prototype instead of binding about 7 KB of them to every schema instance. Importing the SDK takes far less memory: a Relay backend process that loads the server entry starts with about half the heap. Quest `settings.datetime()` values, member-import times and X post `createdAt` values (including hand-written testing fixtures) still accept minute-precision instants such as `2026-11-01T00:00Z`, which Zod 4.6 alone rejects. An X post read without a `media` field still gives an empty list.
|
|
23
|
+
|
|
24
|
+
One tracker data schema change after a rebuild: a field declared as `z.number().min(0).int()` now stores `minimum: 0`, so Relay refuses negative values at ingestion that the app's own schema already refused. Zod 4.3 stored the safe-integer minimum for that order of checks.
|
|
25
|
+
|
|
26
|
+
## 1.58.0
|
|
27
|
+
|
|
28
|
+
### Minor Changes
|
|
29
|
+
|
|
30
|
+
- 321763b: `management.discordRoles.list()` lists every Discord role the project's reward deliveries have granted in the environment, with the quests that requested it and its deliveries counted by status (`pending`, `delivered`, `failed`). It reads the whole delivery history, so a role granted only before the newest page of `management.rewardDeliveries` still appears. The response schema is `discordRoleRewardsSchema`.
|
|
31
|
+
|
|
32
|
+
### Patch Changes
|
|
33
|
+
|
|
34
|
+
- a2318dd: `stagingPathSchema` refuses paths with control characters and accepts only a path that resolves on the staging host. Browsers drop tab and newline from a URL, so a path such as `/<tab>/example.com` used to pass and open another site after a staging sign-in.
|
|
35
|
+
|
|
36
|
+
## 1.57.0
|
|
37
|
+
|
|
38
|
+
### Minor Changes
|
|
39
|
+
|
|
40
|
+
- 7012d1c: Contract state and Cosmos staking reads in quest evaluators.
|
|
41
|
+
|
|
42
|
+
`ctx.wallet.call({ call, args?, address? })` calls one `view` or `pure` EVM contract function once per linked EVM wallet, every call at one block, through dRPC on the chains `management.walletBalanceChains()` lists: state a contract keeps per address, such as `stakedOf(address)`, `getVotes(address)` or `userInfo(uint256, address)`. `{ wallet: true }` in `args` stands for each wallet's address. It returns `{ call, chain, contract, returns, total, wallets: [{ address, value }], at, observedAt }` (`WalletCall`, `walletCallSchema`), with integers as decimal strings and `total` their sum (null for `bool` and `address` returns), or null when the member has no linked EVM wallet. A revert is an `author-error` carrying the contract's reason. The call comes from the new `settings.contractCall({ label, default })` setting (`picker: "contract-call"`): the contract's CAIP-10 ID and a human-readable signature, such as `eip155:8453:0x… function stakedOf(address) view returns (uint256)` (`ContractCall`, `isContractCall`, `parseContractCall`, `parseContractFunction`). Only `view` or `pure` functions with elementary parameters that return one `uint`, `int`, `bool` or `address` are accepted; publication, Console settings edits and unarchiving also check the chain.
|
|
43
|
+
|
|
44
|
+
`ctx.wallet.delegations({ chain, validator?, address? })` reads the native staking delegations of the member's wallets linked on a Cosmos SDK chain Relay lists, at one block, in base units of the chain's staking denomination: `{ chain, denom, validator, total, wallets, validators, at, observedAt }` (`WalletDelegations`, `walletDelegationsSchema`), optionally only to one validator, or null when the member has no wallet on that chain.
|
|
45
|
+
|
|
46
|
+
Both follow `ctx.wallet.balance()`'s capture, `author-error` and `provider-unavailable` rules. `WalletReader.call` and `WalletReader.delegations` are optional in the type so that existing test doubles compile; Relay supplies them to every evaluation, and the testing kit answers them from `facts.wallet.call` and `facts.wallet.delegations`. New `contract-state` and `cosmos-staker` snippets accept members whose view call reaches a minimum, or who delegate at least a minimum, optionally to a configured validator.
|
|
47
|
+
|
|
48
|
+
- 59a01d8: On-chain action checks on EVM chains. `ctx.wallet.events({ event, account, since, afterActivation?, where?, address? })` reads the events of one contract whose indexed address argument `account` is one of the member's linked EVM wallets, from `since` to the chain's finalized block (its safe block on a chain without finality), through dRPC `eth_getLogs` on the chains `management.walletBalanceChains()` lists. It returns `{ event, chain, contract, since, at, finality, logs: [{ wallet, block, timestamp, tx, logIndex, args }], observedAt }` (`WalletEvents`, `walletEventsSchema`) with decoded arguments, or null when the member has no linked EVM wallet, and follows `ctx.wallet.balance()`'s capture, `author-error` and `provider-unavailable` rules. `where` holds equality or `{ gte }` conditions on other arguments (`WalletEventCondition`); `afterActivation` skips events before the quest's activation. `since` may be at most 30 days before the evaluation (`maxWalletEventLookback`), and a read over more than 3,000,000 blocks or 1,000 logs (`maxWalletEventLogs`) throws `author-error`. `WalletReader.events` is optional in the type so that existing test doubles compile; Relay supplies it to every evaluation.
|
|
49
|
+
|
|
50
|
+
The event comes from the new `settings.contractEvent({ label, default })` setting: a CAIP-10 contract, a space and the event's Solidity signature with argument names and `indexed` markers, such as `eip155:8453:0x… Transfer(address indexed from, address indexed to, uint256 value)` (`ContractEvent`, `isContractEvent`, `parseContractEvent`, `ContractEventParts`), stored as a text setting with `picker: "contract-event"`. An event without an indexed address argument is refused. Publication, Console settings edits and unarchiving also check that the chain reports a finalized or safe block and that the address holds a contract.
|
|
51
|
+
|
|
52
|
+
The testing kit answers `ctx.wallet.events()` from `facts.wallet.events`. A new `onchain-action` snippet rewards each new matching event since the later of the quest's activation and the wallet's link, with an optional minimum amount, keyed on `chain:tx:logIndex`.
|
|
53
|
+
|
|
54
|
+
- 956b721: NFT holding checks on EVM chains and Solana. `ctx.wallet.nfts({ collection, address? })` counts the NFTs of one collection the member's linked wallets of its family hold: on EVM, an ERC-721 contract's `balanceOf(owner)`, or one ERC-1155 token ID's `balanceOf(owner, id)`, through dRPC on the chains `management.walletBalanceChains()` lists; on Solana mainnet, the NFTs whose Metaplex metadata names the collection with `verified: true` (SPL Token and Token-2022 accounts holding exactly 1 of a 0-decimal, supply-1 mint; compressed NFTs and Metaplex Core assets are not counted). It returns `{ collection, chain, standard, total, wallets: [{ address, count }], at, observedAt }` (`WalletNfts`, `walletNftsSchema`; `standard` is `"erc721"`, `"erc1155"` or `"metaplex"`), or null when the member has no linked wallet of that family, and follows `ctx.wallet.balance()`'s capture, `author-error` and `provider-unavailable` rules. `WalletReader.nfts` is optional in the type so that existing test doubles compile; Relay supplies it to every evaluation.
|
|
55
|
+
|
|
56
|
+
The collection comes from the new `settings.nft({ label, default })` setting, a CAIP-19 asset type such as `eip155:1/erc721:0x…`, `eip155:8453/erc1155:0x…/1` or `solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/nft:<collection mint>` (`NftCollection`, `isNftCollection`, `parseNftCollection`, `NftCollectionParts`), stored as a text setting with `picker: "nft"`. Publication and Console settings edits check it: an EVM chain and that the contract reports the standard through ERC-165 `supportsInterface`, so a token contract or the wrong standard is refused when it is set; a Solana mint must be a Metaplex collection NFT, so a fungible mint, a mint without Metaplex metadata, a print edition or a member NFT is refused. Unarchiving checks it too, and a platform without its dRPC key refuses every EVM collection. `ctx.wallet.balance()` pointed at an ERC-721 or ERC-1155 contract now throws `author-error` naming `ctx.wallet.nfts()` instead of reading a token count; it asks ERC-165 alongside `decimals()` on every token read.
|
|
57
|
+
|
|
58
|
+
The testing kit answers `ctx.wallet.nfts()` from `facts.wallet.nfts`. A new `nft-holder` snippet accepts members whose linked wallets hold at least one NFT from the configured collection, on EVM or Solana.
|
|
59
|
+
|
|
60
|
+
- 1770ada: A seventh starter, `loyalty`: members join a campaign, earn points from its steps, join a members' group through a quest's group membership reward, and spend points on offers, one of them limited to the group with `inGroup`. Console offers it and `domino create --template loyalty` creates it.
|
|
61
|
+
|
|
62
|
+
Starters are now an open list, so adding one no longer changes the SDK's types. `starters` lists every starter as a `Starter` with a plain string `id`, `offeredStarterSchema` checks an ID against it, and `projectCreateInputSchema` and `repositoryCreateSchema` accept any offered starter; `management.createProject` uses the first. `starterTemplates`, `StarterTemplate`, `StarterId`, `starterIdSchema`, `projectInputSchema` and `createRepositorySchema` are deprecated: they keep the first six starters and are removed in 2.0.0. To upgrade, replace `starterTemplates` with `starters` and `starterIdSchema` with `offeredStarterSchema`, and type a starter ID as `string`.
|
|
63
|
+
|
|
64
|
+
- cec850f: Create and change a tracker of every managed source without a deployment, not only X search. `management.trackers.create` and `management.trackers.update` (`POST /trackers`, `POST /trackers/:tracker/update`) take a `source`: `{ kind: "x-search", query }`, `{ kind: "discord-messages", text? }`, `{ kind: "discord-reactions" }`, `{ kind: "telegram-messages" }`, `{ kind: "telegram-reactions" }`, `{ kind: "youtube-shorts" }` or `{ kind: "tiktok-videos" }`. Each is stored as the source its builder makes, such as `telegram.reactions()`, so quests read a data tracker as they read the same tracker in code. `query` alone still creates an X search tracker; create takes exactly one of `query` or `source`. An update's `source` replaces the source's settings but never its kind, which is refused with 422 `validation-failed`. Turning Discord message text off erases the text already stored. `managedTrackerCreateSchema` validates the new input, while `trackerCreateSchema` keeps its X-only shape. `managedTrackerSource(source)` reads a published source by these names, and `managedTrackerSourceKinds` lists them.
|
|
65
|
+
|
|
66
|
+
`domino trackers create KEY --source <kind>` creates one from the CLI, with `--text on` for Discord messages; `domino trackers update TRACKER --text on|off` turns message text on or off. Console **Trackers → New tracker** offers every source.
|
|
67
|
+
|
|
68
|
+
- 94726d8: Organization automation keys (`dak_`): a credential for CI and headless coding agents that no person owns. An organization administrator creates one in Console Settings → API keys for every project or a chosen list, with chosen permissions and an optional permission to create projects. It works as `RELAY_MANAGEMENT_TOKEN`, with `domino login --token-stdin` and the Git credential helper, in the test environment only: live writes, administration and minting other credentials are refused.
|
|
69
|
+
|
|
70
|
+
The management client adds `automationKeys` (`list`, `create`, `addSecret`, `revokeSecret`, `revoke`) with `automationKeyInputSchema`, `automationKeySchema`, `issuedAutomationKeySchema` and `automationKeyPermissionSchema`. `accessSchema` gains an optional `credential` that `/access` and `domino whoami --json` fill for an automation key with its kind and scope.
|
|
71
|
+
|
|
72
|
+
- 6d9f0de: `telegram.messages()` is a tracker source of the messages members post in the project's connected Telegram groups and supergroups, one record per message with the poster's Telegram account as `author`. `data` is `TelegramMessageData`: `chatId`, `chatType`, `messageId`, `replyToMessageId` and `threadId`, never the text. Bots', service and channel messages are not recorded. In SDK 1.x it is a custom source on the reserved namespace `telegram-messages`, which Relay alone writes. The new `telegram-contribution` snippet rewards posting once per member per day.
|
|
73
|
+
- 8d11f64: `wallet.balances({ chain, token })` is a tracker source of daily balance samples that Relay writes itself. Once per project-calendar day, at a time members can't predict, Relay reads one token's balance in every wallet linked by a member who joined the project, every wallet of a run at one pinned EVM block or Cosmos height (on Solana, every read must reach the run's pinned slot). `chain` and `token` are those of `ctx.wallet.balance()`. Each record is one wallet, keyed by its CAIP-10 account on the sampled chain, which is also its `author`; each sample is a new observation whose `occurredAt` is the sample time and whose `data` is `WalletBalanceSample` (`amount` in base units, `decimals`, `block`). A provider outage retries the same block later that day and never writes a zero, so a day with no successful sample breaks a `streak({ days })`. Reward holding for days with `automatic({ tracker, where: { path: "amount", gte: { setting: "threshold" } } })` and `streak({ days })`. In SDK 1.x it is a custom source on the reserved namespace `wallet-balances`, with the chain and token in the new optional `balance` field of custom sources (`walletBalanceSourceSchema`); ingestion refuses the namespace, and a project and environment can have at most 5 such trackers (`limit-reached`).
|
|
74
|
+
|
|
75
|
+
`management.trackers.create` and Console **New tracker** take `{ kind: "wallet-balances", chain, token }` (`managedTrackerSourceSchema`), and `domino trackers create --source wallet-balances` takes `--chain` and `--token`. The new `token-hold-streak` snippet rewards holding a token for 7 days in a row.
|
|
76
|
+
|
|
3
77
|
## 1.56.0
|
|
4
78
|
|
|
5
79
|
### Minor Changes
|
|
@@ -18,7 +18,6 @@ type DiscordMessage = z.infer<typeof discordMessageSchema>;
|
|
|
18
18
|
*/
|
|
19
19
|
declare const discordMessagesSourceSchema: z.ZodObject<{
|
|
20
20
|
kind: z.ZodLiteral<"discord-messages">;
|
|
21
|
-
/** Store each message's text in `data.text`. Off unless set. */
|
|
22
21
|
text: z.ZodOptional<z.ZodBoolean>;
|
|
23
22
|
}, z.core.$strict>;
|
|
24
23
|
/**
|
|
@@ -206,11 +205,7 @@ interface TelegramReader {
|
|
|
206
205
|
chat: string;
|
|
207
206
|
}): Promise<TelegramChatMember | null>;
|
|
208
207
|
}
|
|
209
|
-
|
|
210
|
-
* The namespace of the tracker source `telegram.reactions()` makes. Relay alone writes its
|
|
211
|
-
* records; ingestion into it is refused.
|
|
212
|
-
*/
|
|
213
|
-
declare const telegramReactionsNamespace = "telegram-reactions";
|
|
208
|
+
|
|
214
209
|
/**
|
|
215
210
|
* One reaction a Telegram user added to a message, as a `telegram.reactions()` record's `data`.
|
|
216
211
|
* Every field is a scalar, so a trigger's `where` can select on it.
|
|
@@ -229,6 +224,22 @@ declare const telegramReactionDataSchema: z.ZodObject<{
|
|
|
229
224
|
}, z.core.$strip>;
|
|
230
225
|
type TelegramReactionData = z.infer<typeof telegramReactionDataSchema>;
|
|
231
226
|
|
|
227
|
+
/**
|
|
228
|
+
* One message a Telegram user posted in a connected group, as a `telegram.messages()` record's
|
|
229
|
+
* `data`. It names the message and never holds its text. Every field is a scalar, so a trigger's
|
|
230
|
+
* `where` can select on it.
|
|
231
|
+
*
|
|
232
|
+
* @compat output
|
|
233
|
+
*/
|
|
234
|
+
declare const telegramMessageDataSchema: z.ZodObject<{
|
|
235
|
+
chatId: z.ZodString;
|
|
236
|
+
chatType: z.ZodString;
|
|
237
|
+
messageId: z.ZodNumber;
|
|
238
|
+
replyToMessageId: z.ZodNullable<z.ZodNumber>;
|
|
239
|
+
threadId: z.ZodNullable<z.ZodNumber>;
|
|
240
|
+
}, z.core.$strip>;
|
|
241
|
+
type TelegramMessageData = z.infer<typeof telegramMessageDataSchema>;
|
|
242
|
+
|
|
232
243
|
declare const authProviderSchema: z.ZodEnum<{
|
|
233
244
|
discord: "discord";
|
|
234
245
|
google: "google";
|
|
@@ -289,4 +300,4 @@ interface DiscordReader {
|
|
|
289
300
|
}): Promise<DiscordMessage | null>;
|
|
290
301
|
}
|
|
291
302
|
|
|
292
|
-
export { type AccountConnection as A,
|
|
303
|
+
export { type AccountConnection as A, discordResourceSourceSchema as B, discordRewardSchema as C, type DiscordMessageData as D, telegramAccountConnectionSchema as E, telegramChatConnectionSchema as F, telegramChatIdSchema as G, telegramChatMemberSchema as H, telegramChatSchema as I, telegramChatsSchema as J, telegramInitDataSchema as K, telegramMemberInputSchema as L, telegramMessageDataSchema as M, telegramMiniAppSignInSchema as N, telegramReactionDataSchema as O, telegramSignInMethodsSchema as P, type TelegramAccountConnection as T, type AuthProvider as a, type TelegramSignInMethods as b, type DiscordMessageTextData as c, discordMessagesSourceSchema as d, discordReactionsSourceSchema as e, type DiscordReactionData as f, type TelegramReader as g, type DiscordReader as h, type TelegramChatMember as i, type TelegramChatMemberStatus as j, type TelegramMessageData as k, type TelegramReactionData as l, type DiscordMember as m, type DiscordMessage as n, type TelegramChat as o, type TelegramChatConnection as p, type TelegramChats as q, accountConnectionSchema as r, authProviderSchema as s, discordMemberInputSchema as t, discordMemberSchema as u, discordMessageDataSchema as v, discordMessageInputSchema as w, discordMessageSchema as x, discordMessageTextDataSchema as y, discordReactionDataSchema as z };
|
package/dist/authoring.d.ts
CHANGED
|
@@ -1,24 +1,23 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export { aj as LedgerSetting, ak as TrackerPage, al as TrackerReadQuery, am as trackerDataSchema, an as trackerTriggerContextSchema } from './schema-
|
|
3
|
-
import { M as MemberCompletion, B as Budget } from './capability-error-
|
|
4
|
-
export { C as CapabilityError, a as CapabilityErrorCode, c as capabilityErrorCodes } from './capability-error-
|
|
5
|
-
import {
|
|
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-
|
|
9
|
-
export { g as defineOffer } from './offers-
|
|
10
|
-
import { E as EngagementBudget,
|
|
11
|
-
export { n as defineCampaign, o as defineGroup } from './groups-
|
|
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-
|
|
13
|
-
export { i as TelegramChatMember, j as TelegramChatMemberStatus, k as TelegramReactionData } from './accounts-
|
|
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-
|
|
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-
|
|
17
|
-
import { P as Prerequisite, T as TextEvidence, U as UrlEvidence, a as TextOptions, b as UrlOptions } from './submission-input-
|
|
18
|
-
export { c as balanceAtLeast, d as completed, i as inGroup } from './submission-input-
|
|
19
|
-
import { I as ImageReader, X as XReader } from './x-
|
|
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
|
|
|
@@ -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
|
|
471
|
-
*
|
|
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?: ("
|
|
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;
|
|
@@ -509,12 +537,16 @@ declare const youtube: {
|
|
|
509
537
|
shorts(): {
|
|
510
538
|
kind: "custom";
|
|
511
539
|
namespace: string;
|
|
512
|
-
identities?: ("
|
|
540
|
+
identities?: ("discord" | "member" | "wallet" | "x" | `app:${string}`)[] | undefined;
|
|
513
541
|
accounts?: string[] | undefined;
|
|
514
542
|
data?: TrackerDataSchema | undefined;
|
|
515
543
|
content?: {
|
|
516
544
|
metrics: string[];
|
|
517
545
|
} | undefined;
|
|
546
|
+
balance?: {
|
|
547
|
+
chain: string;
|
|
548
|
+
token: string | null;
|
|
549
|
+
} | undefined;
|
|
518
550
|
} & WithRecordData<ContentData<{
|
|
519
551
|
title: string;
|
|
520
552
|
description: string;
|
|
@@ -547,12 +579,16 @@ declare const tiktok: {
|
|
|
547
579
|
videos(): {
|
|
548
580
|
kind: "custom";
|
|
549
581
|
namespace: string;
|
|
550
|
-
identities?: ("
|
|
582
|
+
identities?: ("discord" | "member" | "wallet" | "x" | `app:${string}`)[] | undefined;
|
|
551
583
|
accounts?: string[] | undefined;
|
|
552
584
|
data?: TrackerDataSchema | undefined;
|
|
553
585
|
content?: {
|
|
554
586
|
metrics: string[];
|
|
555
587
|
} | undefined;
|
|
588
|
+
balance?: {
|
|
589
|
+
chain: string;
|
|
590
|
+
token: string | null;
|
|
591
|
+
} | undefined;
|
|
556
592
|
} & WithRecordData<ContentData<{
|
|
557
593
|
title: string;
|
|
558
594
|
description: string;
|
|
@@ -573,6 +609,49 @@ declare const tiktok: {
|
|
|
573
609
|
isAigc: boolean;
|
|
574
610
|
}, "likes" | "views" | "comments" | "shares"> & WithAccountRoles<"author">;
|
|
575
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
|
+
};
|
|
576
655
|
declare const pointLedgers: () => ResourceSource;
|
|
577
656
|
type Label = {
|
|
578
657
|
label: string;
|
|
@@ -630,6 +709,50 @@ declare const settings: {
|
|
|
630
709
|
chain(options: Label & {
|
|
631
710
|
default: BalanceChain;
|
|
632
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>>>>;
|
|
633
756
|
integer(options: Label & {
|
|
634
757
|
default: number;
|
|
635
758
|
min: number;
|
|
@@ -646,6 +769,35 @@ declare const settings: {
|
|
|
646
769
|
object<T extends Record<string, Setting>>(shape: T): z.ZodObject<{ -readonly [P in keyof T]: T[P]; }, z.core.$strict>;
|
|
647
770
|
};
|
|
648
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
|
+
|
|
649
801
|
declare const badge: (definition: BadgeHandle & Pick<Badge, "name">) => {
|
|
650
802
|
reward: {
|
|
651
803
|
badge: string;
|
|
@@ -1402,7 +1554,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
|
|
|
1402
1554
|
imageAlt?: string | undefined;
|
|
1403
1555
|
requirements?: ({
|
|
1404
1556
|
kind: "account";
|
|
1405
|
-
provider: "
|
|
1557
|
+
provider: "discord" | "x" | "google" | "apple";
|
|
1406
1558
|
} | {
|
|
1407
1559
|
kind: "wallet";
|
|
1408
1560
|
chain?: "solana" | "eip155" | "cosmos" | undefined;
|
|
@@ -1426,7 +1578,7 @@ declare const defineQuest: <T extends Record<string, Setting>, const G extends T
|
|
|
1426
1578
|
} | undefined;
|
|
1427
1579
|
} | undefined;
|
|
1428
1580
|
};
|
|
1429
|
-
integrations: ("
|
|
1581
|
+
integrations: ("discord" | "x")[];
|
|
1430
1582
|
fields: Record<string, {
|
|
1431
1583
|
kind: "point-ledger";
|
|
1432
1584
|
default: string;
|
|
@@ -1852,7 +2004,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
|
|
|
1852
2004
|
imageAlt?: string | undefined;
|
|
1853
2005
|
requirements?: ({
|
|
1854
2006
|
kind: "account";
|
|
1855
|
-
provider: "
|
|
2007
|
+
provider: "discord" | "x" | "google" | "apple";
|
|
1856
2008
|
} | {
|
|
1857
2009
|
kind: "wallet";
|
|
1858
2010
|
chain?: "solana" | "eip155" | "cosmos" | undefined;
|
|
@@ -1876,7 +2028,7 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
|
|
|
1876
2028
|
} | undefined;
|
|
1877
2029
|
} | undefined;
|
|
1878
2030
|
};
|
|
1879
|
-
integrations: ("
|
|
2031
|
+
integrations: ("discord" | "x")[];
|
|
1880
2032
|
fields: Record<string, {
|
|
1881
2033
|
kind: "point-ledger";
|
|
1882
2034
|
default: string;
|
|
@@ -2192,4 +2344,4 @@ declare const defineQuestType: <T extends Record<string, Setting>, const G exten
|
|
|
2192
2344
|
}): Promise<Decision>;
|
|
2193
2345
|
} & ResourceHandle<"quest">;
|
|
2194
2346
|
|
|
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 };
|
|
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 };
|