Wallets
Let members link Solana, EVM and Cosmos wallets, sign in with them, and earn rewards for holding tokens and NFTs, staking, or transactions on your contracts.
Members can connect a crypto wallet in your app. That opens up quests such as "Link your wallet", "Hold 10 USDC on Base" or "Hold 1,000 tokens for a week", and lets members sign in with a wallet instead of an email address.
What members see
A member picks their wallet, such as Phantom or MetaMask, and signs a one-time message in it. The message says it does not authorize any transaction or transfer, so linking never moves funds. Domino checks the signature and adds the wallet to the member's list for your project. Where the project enables it, members can also sign in with a wallet.
What your team sees
Each member's page in Console lists their wallets and the balances quests recorded for them. Your team can unlink a wallet, restore one, or stop a wallet from signing in, for example when its key leaks. See What operators see.
| Chain family | Wallets | Address Domino stores |
|---|---|---|
| Solana | Phantom, Solflare, Backpack, Wallet Standard | Base58 |
| EVM | MetaMask, Rabby and other injected EVM wallets, and smart-contract wallets such as Base Account | EIP-55 checksummed 0x… |
| Cosmos SDK | Keplr, Leap, Cosmostation | Lowercase bech32 with the chain's prefix (cosmos1…, osmo1…) |
An ordinary EVM wallet links once for every EVM chain: the signature proves control of the key behind the address, not of a network.
A smart-contract wallet, such as Base Account or a Privy or Dynamic smart wallet, is a contract rather than a key, so only its chain can check its signature. Domino asks the chain the wallet was on when the member signed, whether the wallet is deployed there yet or not. The wallet links as the account at its address on that chain only, because a contract at the same address on another chain can belong to someone else. Quests read its balances, NFTs, events and contract calls on that chain, tracker records name it there, and payout lists name it with that chain.
A Cosmos wallet links on a chain your app names, such as Cosmos Hub. Domino has no list of Cosmos chains, so your app can offer any of them.
Link a wallet
Find the member's wallets
@domino-sdk/relay/browser discovers installed wallets and wraps each in a signer. It has no wallet SDK dependency.
import {
createBrowserRelayClient,
discoverCosmosWallets,
discoverEvmWallets,
discoverSolanaWallets,
} from "@domino-sdk/relay/browser"
const relay = createBrowserRelayClient({ baseUrl: "/relay" })
const evm = await discoverEvmWallets()
const solana = discoverSolanaWallets()
const cosmos = discoverCosmosWallets({ chainId: "cosmoshub-4" })Each entry has a name, an optional icon, and a signer. Show them however your app likes. Cosmos wallets sign on the chain you pass, as { chainId, chainInfo? } or as its CAIP-2 ID ("cosmos:cosmoshub-4"); call discoverCosmosWallets once per chain your app offers.
Sign and link
import { createBrowserRelayClient, discoverEvmWallets } from "@domino-sdk/relay/browser"
const relay = createBrowserRelayClient({ baseUrl: "/relay" })
const [metamask] = await discoverEvmWallets()
if (metamask) {
const wallet = await relay.wallets.link(metamask.signer)
console.log(wallet.address)
}The member's wallet shows a sign-in style message for your app's domain. The message states that it does not authorize any transaction or transfer. link returns the linked wallet with its canonical address.
In React, use the hooks instead:
import { useWalletDiscovery, useWallets } from "@domino-sdk/relay/react"
function LinkWallets() {
const { evm, solana, cosmos } = useWalletDiscovery({ cosmos: { chainId: "cosmoshub-4" } })
const { data: wallets, link, unlink, actionError, isPending } = useWallets()
return (
<>
{[...evm, ...solana, ...cosmos].map((found) => (
<button key={found.id} disabled={isPending} onClick={() => link(found.signer)}>
Link {found.name}
</button>
))}
{wallets?.map((wallet) => (
<button key={wallet.address} disabled={isPending} onClick={() => unlink(wallet)}>
Unlink {wallet.address}
</button>
))}
{actionError && <p role="alert">{actionError.message}</p>}
</>
)
}useWalletDiscovery() lists Cosmos wallets only for the chains in cosmos: one chain or an array of them.
import { discoverCosmosWallets } from "@domino-sdk/relay/browser"
/** Keplr's ChainInfo for your chain: RPC and REST endpoints, bech32 prefixes, currencies. */
declare const exampleChainInfo: { chainId: "example-1" } & Record<string, unknown>
const [keplr] = discoverCosmosWallets({ chainId: "example-1", chainInfo: exampleChainInfo })Show the linked wallets
relay.wallets.list() returns the member's wallets for this project, with chain, network, address and verifiedAt, provedOn for a smart-contract wallet, and provedBy: "transaction" with proofTransaction for an account proved by transaction.
.sol names
When a member's linked Solana wallet has a primary .sol name, such as toly.sol, Domino shows it beside the wallet's address on the member's page in Console. Members, and your project's profile defaults, can also use it as the member's display name on leaderboards: see Show member profiles.
- Primary name only. The name is the domain the wallet chose as its primary in the Solana Name Service (SNS), on Solana mainnet, whichever cluster the wallet linked on. Domino shows it only while the wallet owns the domain, directly or by holding the domain's NFT. A primary domain the wallet has since sold or transferred shows nothing.
- Second-level
.solnames. A subdomain such aspay.toly.solas the primary, and other name services, show nothing. A name longer than 40 characters, or with invisible characters, shows nothing. - Every linked wallet. Wallets the member proved, sign-in wallets and wallets your organization vouched for all get names. An unlinked wallet shows none, since Domino stops reading it.
- Display only. The address stays the wallet's identity everywhere. Domino never looks a wallet up by its name, and quests, tracker records and payouts use the address.
- Up to a day old. Domino reads a newly linked wallet's name, usually within 10 minutes, then once a day: names rarely change, and each read is a few Solana RPC calls. If Solana's RPC is unavailable, Domino keeps showing the last name it read, or nothing, and never fails a page.
Mobile and Seeker
Phones have no wallet extensions. On Android, including the Solana Seeker, Solana wallet apps connect to websites through Mobile Wallet Adapter (MWA). Your app registers it, and members then see Mobile Wallet Adapter in your wallet list. Tapping it opens a wallet app installed on the phone, where the member approves the connection and signs Domino's message, as with any other wallet. Back in the browser, the wallet links or signs in like a desktop one.
The create-solana-dapp template registers MWA already. In any other web app, call Solana Mobile's registerMwa() once in client code, with your app's name, address and icon (a path relative to the address) and the clusters you support. Call it at the top level of a client module that loads with the page, not in a React effect. discoverSolanaWallets(), useWalletDiscovery() and useSignInWallets() list only the wallets registered when they run, and child components' effects run before their parents'.
import {
createDefaultAuthorizationCache,
createDefaultChainSelector,
createDefaultWalletNotFoundHandler,
registerMwa,
} from "@solana-mobile/wallet-standard-mobile"
registerMwa({
appIdentity: { name: "My app", uri: window.location.origin, icon: "icon.png" },
authorizationCache: createDefaultAuthorizationCache(),
chains: ["solana:mainnet", "solana:devnet"],
chainSelector: createDefaultChainSelector(),
onWalletNotFound: createDefaultWalletNotFoundHandler(),
})registerMwa() adds the wallet only in a secure (HTTPS) page on Android. It skips apps' built-in browsers, except the Solana Mobile Web Shell that Seeker dApp Store web apps run in. Without its optional remote settings (remoteHostAuthority or nostrRelay), desktop browsers and iPhones see no change. In a wallet app's own browser, discovery finds the wallet that browser injects, as with an extension.
To reward members for owning a Seeker, see Reward Seeker owners.
MWA's solana:signIn signs only while the wallet first connects. Once connected, it answers from the saved authorization with no signature. Domino's signers sign with solana:signMessage, so linking and signing in through them work either way. If your app calls solana:signIn itself, sign the message with solana:signMessage for the Mobile Wallet Adapter wallet instead, as the template does.
Bring your own wallet provider
Discovery finds only the wallets a browser extension injects into the page, and Mobile Wallet Adapter once your app registers it. Members who connect through WalletConnect, Reown AppKit, or an embedded wallet such as Privy's, Dynamic's or Para's need your app to hand Domino that wallet itself. Wrap the provider your wallet SDK gives you in a signer, then link or sign in with it as above.
| Your wallet SDK gives you | Wrap it with |
|---|---|
An EIP-1193 provider, such as WalletConnect's EthereumProvider, AppKit's useAppKitProvider("eip155").walletProvider or a Privy wallet's getEthereumProvider() | evmSigner(provider, { name }) |
A Solana provider with connect(), publicKey and signMessage(bytes), as Phantom injects it | solanaSigner(provider, { name }) |
| A Wallet Standard wallet | walletStandardSolanaSigner(wallet) |
| A Keplr-style Cosmos wallet | cosmosSigner(provider, chain) |
| Only a function that signs a message | Your own WalletSigner |
import {
createBrowserRelayClient,
evmSigner,
type Eip1193Provider,
} from "@domino-sdk/relay/browser"
// For example WalletConnect's: await EthereumProvider.init({ projectId, ... })
declare const provider: Eip1193Provider
const relay = createBrowserRelayClient({ baseUrl: "/relay" })
const wallet = await relay.wallets.link(evmSigner(provider, { name: "WalletConnect" }))evmSigner asks the provider for eth_requestAccounts, eth_chainId and personal_sign, and it follows accountsChanged when the provider emits it. A Solana provider whose signMessage takes only the message fits solanaSigner once you wrap it: solanaSigner({ connect: async () => ({ publicKey: provider.publicKey }), publicKey: provider.publicKey, signMessage: (message) => provider.signMessage(message) }).
Embedded wallets your app's login vouches for already count for wallet quests, but leaderboard payout lists leave them out until the member signs once. The recipes for Privy, Dynamic and Para show that step, and Reown AppKit signs members in with the wallet AppKit connects.
Smart accounts (Squads, smart wallets)
A Squads vault has no private key, so it cannot sign the link message. DAOs, funds and teams keep their assets in vaults like these. They link by proving control on chain instead: the vault executes a small transaction carrying a code from Domino, approved in Squads like any other vault transaction, and Domino links the vault once the transaction is final. The same works for any Solana account that can execute an SPL Memo instruction as a signer, such as a smart wallet.
- Request a challenge. The signed-in member asks for a challenge for the vault's address. Domino answers with a memo text and an expiry 7 days out, since a multisig approval can take days. The challenge belongs to the member, so they can finish in a later session. Asking again for the same address answers the same challenge.
- Create the vault transaction. Put one SPL Memo instruction in it, with the challenge's memo text and the vault as its signer.
- Approve and execute it in Squads, as the multisig's threshold requires.
- Submit the signature. Send the executed transaction's signature. Domino reads it on Solana mainnet, and links the vault when the transaction is finalized, succeeded, and its memo carries the challenge's text with the vault as signer. The vault links as a Solana wallet: it counts toward the five, and quests read its balances, NFTs and transactions like any Solana wallet's.
import { createBrowserRelayClient } from "@domino-sdk/relay/browser"
const relay = createBrowserRelayClient({ baseUrl: "/relay" })
const vault = "<the Squads vault address>"
// 1. The memo the vault must execute.
const challenge = await relay.wallets.transactionChallenge({ chain: "solana", address: vault })
// 2 and 3 happen in Squads. Then submit the executed transaction's signature.
const wallet = await relay.wallets.linkByTransaction({
chain: "solana",
address: vault,
signature: "<the executed transaction's signature>",
})
console.log(wallet.provedBy) // "transaction"Refusals
| Code | What happened | What to do |
|---|---|---|
transaction-not-final (409) | The transaction is not finalized yet. | Send the same signature again in a few seconds. |
transaction-not-found (404) | Solana has no transaction with this signature. | Check the signature; a transaction just sent may need a minute. |
transaction-failed (400) | The transaction failed, so it proves nothing. | Execute the memo again. |
proof-mismatch (400) | No memo in it carries one of the member's open challenges for this address with the address as signer. | Check the memo text and the signer. |
challenge-used (409) | Another transaction already linked with this challenge. | Request a new challenge. |
challenge-expired (400) | The member has no open challenge for this address, or it is over 7 days old. | Request a new challenge. |
limit-reached (409) | The member already has five wallets of the family, or five open challenges. | Unlink a wallet, or finish an open proof. |
Sending the same signature again after it linked answers the same wallet. Sign-in with a smart account is not supported; the member signs in another way and links the vault.
Limits
- Five per chain family. A member can have five Solana, five EVM and five Cosmos wallets linked to a project; the five Cosmos wallets can be on any chains. Linking a sixth fails until they unlink one. Sign-in wallets do not count.
- One wallet per address. The same Cosmos key has a different address on chains with different prefixes (
cosmos1…,osmo1…), so it links as separate wallets, each counting toward the five. Chains that share a prefix share the address: linking it again on another chain ID moves the wallet to that chain. - One member per address. An address linked by one member cannot be linked by another, even after it is unlinked.
- Linking is not sign-in. A wallet linked while signed in cannot sign in unless an operator enables it.
- Smart-contract wallets on supported chains. A smart-contract wallet links or signs in only on an EVM chain Domino reads balances on (
GET /management/v1/wallet-balance-chains); on another chain it fails with "Domino cannot check smart-wallet signatures on eip155:…". Switch the wallet to a supported chain and connect again. - A check the chain didn't answer can be retried. When the chain doesn't answer, linking or signing in fails with "Couldn't check the wallet's signature on Base. Try again." (502
unavailable), nothing links, and the same signature can be sent again for the same challenge. A wrong signer fails with "The wallet signature does not match this challenge", as for any wallet. - Ten smart-wallet checks per member. Each member, or each client when signing in, gets ten smart-wallet signature checks in 10 minutes, and a project environment 600, because each one calls the chain. Ordinary wallets do not count.
- Transaction proofs. A member holds at most five open transaction challenges at once, one per address, each open 7 days, so the rows a member keeps stay bounded. Each member gets 30 transaction reads in 10 minutes, enough to poll while a transaction finalizes, and a project environment 600, because each one calls Solana. Transaction proofs are read on Solana mainnet only.
- Accounts that sign only. 32-byte Cosmos module and contract addresses, and Ethermint-key Cosmos wallets (such as Evmos and Injective), cannot link.
- Per project and environment. Each project and environment has its own list.
Unlink a wallet
import { createBrowserRelayClient } from "@domino-sdk/relay/browser"
const relay = createBrowserRelayClient({ baseUrl: "/relay" })
const [wallet] = await relay.wallets.list()
if (wallet) {
await relay.wallets.unlink(wallet)
}The wallet leaves the project's list, and new quest attempts no longer see it. The address stays with the member, who can link it again.
Check wallets in a quest
A quest can require a linked wallet, such as a Cosmos Hub wallet, before it pays.
import { defineQuest, settings, manual, once, points, decision } from "@domino-sdk/relay/authoring"
import { community } from "./ledgers"
export default defineQuest({
key: "link-cosmos-hub-wallet",
title: "Link your Cosmos Hub wallet",
settings: settings.object({}),
trigger: manual(),
completion: once(),
rewards: [points(community, 25)],
async evaluate({ wallet }) {
const wallets = await wallet.list()
// `network` is the chain the app requested, not proof. The address is: Cosmos Hub accounts start with cosmos1.
// null when the member has linked no wallet.
return wallets?.some((linked) => linked.chain === "cosmos" && linked.address.startsWith("cosmos1"))
? decision.accept()
: decision.reject({ reason: "Link a Cosmos Hub wallet, then try again." })
},
})Publish the imported community ledger in the same project. A null list means the member has linked no wallet.
Gate a Cosmos wallet on its address, never on its network: any app can link an address under any chain ID. The bech32 prefix tells you which chains the address belongs to, and chains that share a prefix share the address. Keep your own list of the chains you accept with their prefixes, check the address against it, and read the chain itself for balances or activity.
Check token balances
Reward members for holding a token, such as 10 USDC on Base or a minimum of your community's own token. Domino reads the balance of the member's linked wallets when the quest checks it.
ctx.wallet.balance() reads a balance for the member's linked wallets on one chain:
| Chain | chain | token |
|---|---|---|
| Solana mainnet | "solana" | An SPL or Token-2022 mint, or omit it for SOL |
| Solana devnet | "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1" | An SPL or Token-2022 mint, or omit it for SOL |
| An EVM chain | Its CAIP-2 ID, such as "eip155:8453" for Base | An ERC-20 contract, or omit it for the native coin |
| A Cosmos SDK chain | Its CAIP-2 ID, such as "cosmos:cosmoshub-4" for Cosmos Hub | A bank denomination, such as "uatom"; required |
Domino reads balances on the chains /wallet-balance-chains lists. For Solana, that is mainnet and devnet: build against your devnet program first, and switch the chain to mainnet when you deploy. A linked Solana wallet reads on both. For EVM, that is the networks, mainnets and testnets alike, on the chain list of Domino's RPC provider, dRPC; a network dRPC adds later is readable only once Domino updates the list. For Cosmos, it is Cosmos Hub, Osmosis and any other Cosmos SDK chain Domino has configured. A Cosmos read covers only the wallets linked on that exact chain ID. List the supported chains, with their names, from a server or the CLI:
domino api GET /wallet-balance-chainsThe answer is { chains: [{ chain, name, testnet }] }: Solana mainnet and devnet first, then the Cosmos chains, then each EVM chain by chain ID. Only the SDK and CLI from 1.67.0 see devnet in the list. Earlier releases cannot read it, so they, and requests that don't come from the SDK or CLI, see mainnet alone. Upgrade both before you add a devnet tracker: earlier releases cannot read a project's trackers once one reads devnet. In code, call management.walletBalanceChains(); it needs read permission. An EVM or Cosmos chain that is not in the list throws a CapabilityError with code author-error.
Domino reads every balance through endpoints it chooses: you can't give it your own RPC or REST URL. If your community's Cosmos chain isn't listed, contact Domino support to add it. For a chain Domino doesn't read, or on-chain state other than a token balance, run your own indexer and send its records to a custom tracker source, keyed by wallet account; quests then read those records.
Install the snippet
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/token-holder.jsonIt adds quests/token-holder.quest.ts, which accepts when the member's linked wallets together hold at least a minimum. Its settings are the chain, the token address and the minimum, which Console shows in whole tokens. The default is 10 USDC on Base.
Or write the check yourself
import { defineQuest, settings, manual, once, points, decision, parseUnits } from "@domino-sdk/relay/authoring"
import { community } from "./ledgers"
export default defineQuest({
key: "hold-usdc-on-base",
title: "Hold 10 USDC on Base",
settings: settings.object({}),
trigger: manual(),
completion: once(),
rewards: [points(community, 50)],
async evaluate({ wallet }) {
const held = await wallet.balance({
chain: "eip155:8453",
token: "0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913",
})
// null when the member has linked no wallet of the collection's chain (here, EVM).
if (!held) {
return decision.reject({ reason: "Link an EVM wallet first." })
}
if (held.decimals === null) {
return decision.review({ reason: "The token reports no decimals." })
}
return BigInt(held.total) >= parseUnits("10", held.decimals)
? decision.accept()
: decision.reject({ reason: "Hold at least 10 USDC, then try again." })
},
})The result gives amounts as integer strings in the token's smallest unit: total across the wallets read, and each wallet's amount. parseUnits and formatUnits convert whole-token amounts.
To let operators choose the chain and the minimum, use settings.chain({ label, default }) and settings.amount({ label, default, decimals }). A chain setting holds "solana", Solana mainnet's or devnet's CAIP-2 ID, or an EVM chain ID such as "eip155:8453", and is typed as the query's chain. An amount setting holds a base-unit integer string, such as "10000000" for 10 USDC, so compare it with BigInt(held.total) >= BigInt(settings.minimum); with decimals, Console shows and edits it in whole tokens. Publication and Console edits refuse any other value.
What the read covers
- All linked wallets of the chain's family. An EVM chain reads every linked EVM wallet; Solana mainnet and devnet each read every linked Solana wallet. A Cosmos chain reads only wallets linked on that exact network. Pass
addressto read one of them. Any other address throws aCapabilityErrorwith codeauthor-errorand the message "Read only the member's linked wallets". - No wallet is not a zero balance to check. With no wallet of that family,
ctx.wallet.balance()returnsnull. Check for it to ask the member to link one. - Failures are never ineligibility. A chain Domino does not read, a malformed token identifier, a Solana account that is not a token mint, an EVM address with no contract and an NFT contract (use
ctx.wallet.nfts()for those) throw aCapabilityErrorwith codeauthor-error. A provider outage throws one with codeprovider-unavailable, which Domino retries if your code lets it through. None of them reads as a zero balance. See evaluator readers. - Balances at verification time. Each read is recorded with the attempt, so a retried verification reuses it. It is one of the evaluation's eight capability calls. It doesn't show the member kept holding: for that, see Reward holding for days.
- Token identifiers come from settings. Never take a token address or denomination from the member's input: they could point the quest at a token they created.
Use ctx.wallet.balance({ chain: "solana" }) for the total SOL balance of linked Solana wallets; pass address to select one. See wallet balances.
Reward holding for days
For "Hold 1,000 tokens for a week", Domino samples the balance of every wallet members linked once a day, at a time members can't predict. On EVM and Cosmos chains every wallet is read at one block, so tokens passed between wallets don't count twice; Solana can't read a past slot, so there each read only has to reach the slot the sample started at. Each day a member's wallet holds the minimum fills one day of a 7-day streak. Your app runs no balance job.
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/token-hold-streak.jsonThe snippet adds a wallet.balances() tracker and a streak quest on it. A day whose samples all failed has no sample and breaks the streak, since Domino never writes a balance it didn't read. See Reward holding tokens for how sampling works and what each outcome means.
For "Hold one of our NFTs for 30 days", Domino samples NFT holdings the same way: once a day, it counts how many NFTs of your collection every linked wallet of the collection's chain holds, as ctx.wallet.nfts() counts them. Each day a member's wallet holds at least the minimum fills one day of a 30-day streak.
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/nft-hold-streak.jsonThe snippet adds a wallet.nfts() tracker and a streak quest on it. Each day's sample first checks the collection, as publication checks an NFT setting, and shows a wrong one on the tracker. See Reward holding NFTs.
Check NFT holdings
Reward members for holding an NFT from your collection, on an EVM chain or on Solana. Domino counts the NFTs the member's linked wallets of that chain hold when the quest checks it.
A collection is written as a CAIP-19 asset type:
| Collection | Written as |
|---|---|
| ERC-721 | eip155:<chain ID>/erc721:<contract>, such as eip155:1/erc721:0xBC4CA0EdA7647A8aB7C2061c2E118A18a936f13D |
| One token ID of an ERC-1155 contract | eip155:<chain ID>/erc1155:<contract>/<token ID>, such as eip155:8453/erc1155:0x…/1 |
| Collection on Solana | solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/nft:<collection>: a Core collection's address, the mint of a Token Metadata collection NFT, or a Token-2022 token group's mint. A compressed NFT collection (Bubblegum) is one of the first two |
| Collection on Solana devnet | solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/nft:<collection> |
An EVM chain is one of the EVM chains /wallet-balance-chains lists. Cosmos NFTs are not read.
On Solana, Domino reads both kinds of Metaplex collection, the compressed NFTs in either, and Token-2022 token groups:
- Core collection: every Core asset in the collection that a linked Solana wallet owns counts. Only the collection's update authority or a delegate it approved can add an asset to it.
- Token Metadata collection: an NFT counts when a linked Solana wallet holds it (a token account with exactly 1 of a mint with no decimals and a supply of 1) and its Metaplex metadata names your collection with
verified: true. Only the collection's update authority or a delegate it approved can verify an NFT, so a collection field anyone else set is ignored. - Compressed NFTs (cNFTs, Metaplex Bubblegum): a cNFT a linked Solana wallet owns counts when its collection is yours and verified. Bubblegum v1 trees put cNFTs in a Token Metadata collection, and v2 trees in a Core collection. Only the collection's authority can verify a cNFT into it, so an unverified one is ignored, and a burnt one doesn't count.
- Token-2022 token group: a mint counts when a linked Solana wallet holds it (exactly 1, no decimals, a supply of 1) and the mint's own token group member extension names your group. Only the group's update authority can add a member, so a mint that merely points at the group is ignored. The Seeker Genesis Token is one: see Reward Seeker owners.
A wallet's count adds the NFTs and compressed NFTs of a Metaplex collection together: a holder is a holder, whichever kind they hold.
Install the snippet
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/nft-holder.jsonIt adds quests/nft-holder.quest.ts, which accepts when the member's linked wallets of the collection's chain together hold at least one NFT from the collection. Its setting is the collection; the default is Bored Ape Yacht Club on Ethereum, so set it to yours.
Set the collection
When you publish the quest, change the collection in Console, or unarchive the quest, Domino checks the collection on its chain. Make these changes in test; they reach live through a promotion. A wrong collection is refused there with a message that says what it is, so a typo never rejects members who hold the right NFT:
- EVM: Domino asks the contract which standard it implements. A token contract, or an ERC-1155 contract written as
erc721, is refused. - Solana: the address must be a Core collection, a Metaplex collection NFT or a Token-2022 token group on the collection's cluster, mainnet or devnet. That is also how you set a compressed NFT collection. A fungible token, a mint with neither Metaplex metadata nor a token group, a print or limited edition, a Core asset with no collection, and an NFT, token group member or Core asset that belongs to a collection (the message names the collection to use instead) are refused.
Or write the check yourself
import { defineQuest, settings, manual, once, points, decision } from "@domino-sdk/relay/authoring"
import { community } from "./ledgers"
export default defineQuest({
key: "hold-our-nft",
title: "Hold one of our NFTs",
settings: settings.object({
collection: settings.nft({
label: "NFT collection",
default: "eip155:8453/erc721:0x52908400098527886E0F7030069857D2E4169EE7",
}),
}),
trigger: manual(),
completion: once(),
rewards: [points(community, 50)],
async evaluate({ wallet, settings }) {
// Relay supplies nfts() to every evaluation; its type is optional for older test doubles.
const held = await wallet.nfts!({ collection: settings.collection })
// null when the member has linked no EVM wallet.
if (!held) {
return decision.reject({ reason: "Link an EVM wallet first." })
}
return BigInt(held.total) >= 1n
? decision.accept()
: decision.reject({ reason: "Hold one of our NFTs, then try again." })
},
})The result is { collection, chain, standard, total, wallets: [{ address, count }], at, observedAt }: total is how many the wallets read hold together, and each wallet's count its own, as integer strings. For ERC-721 that is the contract's balanceOf(owner); for ERC-1155, balanceOf(owner, id) for the collection's token ID; for a Solana collection (standard "metaplex"), the number of the collection's Core assets, verified NFTs or token group members the wallet holds, read at a slot (at.kind "slot"). A Solana result also has kind: "core", "token-metadata" or "token-group", the kind of collection read. It is an open string, so handle a value you don't know, and it is absent on EVM results. Pass address to read one linked wallet.
What the NFT read covers
- All linked wallets of the collection's chain family, or one of them. EVM wallets for an EVM collection, Solana wallets for a Solana one. Any other
addressthrows aCapabilityErrorwith codeauthor-error. - No wallet is not "holds none". With no linked wallet of that family,
ctx.wallet.nfts()returnsnull. - Failures are never ineligibility. A malformed collection, a chain Domino does not read and a contract that rejects the read throw
author-error; a provider outage throwsprovider-unavailable. None of them reads as holding none. - Counts at verification time. Each read is recorded with the attempt, so a retried verification reuses it, and it is one of the evaluation's eight capability calls. It does not prove the member keeps holding the NFT (for that, see Reward holding for days), and it counts NFTs without listing their token IDs.
Reward Seeker owners
Every Solana Mobile Seeker comes with a Seeker Genesis Token (SGT): a token in a Token-2022 token group that stays in the wallet the owner activated the phone with and can't be transferred. Rewarding SGT holders rewards Seeker owners.
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/seeker-holder.jsonIt adds quests/seeker-holder.quest.ts, which accepts when the member's linked Solana wallets hold at least one SGT. Its collection setting defaults to the SGT group, so it works as installed. Members link the wallet they activated their Seeker with, which they can do on the phone itself: see Mobile and Seeker. To reward holders of another token group, set the collection to that group's mint.
Check staking and contract state
Reward members who stake with you, hold voting power, or have a position in your vault. Pick the read by how the stake is recorded:
| How the stake is recorded | Read it with |
|---|---|
| Staking mints a receipt token, such as a liquid-staking token or ERC-4626 vault shares | Token balances: ctx.wallet.balance() on the receipt token |
A contract keeps it per address, such as stakedOf(address), getVotes(address) or userInfo(pid, address) | Contract state: ctx.wallet.call() |
| Native staking on a Cosmos SDK chain | Cosmos delegations: ctx.wallet.delegations() |
| Native staking on Solana: SOL delegated to a validator from a stake account | Solana native stake: ctx.wallet.stake() |
| A Solana Anchor program keeps it in an account derived from the wallet, such as a stake, lock or position account | Solana program accounts: ctx.wallet.programAccount() |
| Governing tokens deposited in a DAO on Realms (SPL Governance) | DAO voting power on Realms: ctx.wallet.programAccount() |
| Liquidity in a Solana pool that issues an LP token, such as a Raydium or Meteora Dynamic AMM pool | Solana liquidity: ctx.wallet.balance() on the LP token |
Read contract state
Domino calls one read-only function of your contract for each of the member's linked EVM wallets, every call at the same block, and gives you each result.
Install the snippet
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/contract-state.jsonIt adds quests/contract-state.quest.ts, which accepts when the function's values for the member's linked EVM wallets add up to at least a minimum. Its settings are the contract function and the minimum, which Console shows in whole tokens. The default is ENS voting power on Ethereum, so set it to your contract.
Set the contract function
The setting holds the contract and the function in one line: the chain, the contract address, and the function's signature, such as eip155:8453:0x… function stakedOf(address) view returns (uint256) on Base. The chain is one /wallet-balance-chains lists.
When you publish the quest, change the setting in Console, or unarchive the quest, Domino checks it. A function that can change state, or returns anything but one number, true/false value or address, is refused there, and so is a chain Domino does not read. Make these changes in test; they reach live through a promotion.
Or write the check yourself
import { defineQuest, settings, manual, once, points, decision } from "@domino-sdk/relay/authoring"
import { community } from "./ledgers"
export default defineQuest({
key: "stake-in-pool",
title: "Stake in our pool",
settings: settings.object({
staking: settings.contractCall({
label: "Staking contract",
default:
"eip155:8453:0x52908400098527886E0F7030069857D2E4169EE7 function userInfo(uint256 pid, address user) view returns (uint256)",
}),
pool: settings.integer({ label: "Pool ID", default: 0, min: 0, max: 1000 }),
minimum: settings.amount({ label: "Minimum stake", default: "1000000000000000000", decimals: 18 }),
}),
trigger: manual(),
completion: once(),
rewards: [points(community, 50)],
async evaluate({ wallet, settings }) {
// { wallet: true } is each linked EVM wallet's address.
const staked = await wallet.call?.({
call: settings.staking,
args: [settings.pool, { wallet: true }],
})
// null when the member has linked no EVM wallet.
if (!staked) {
return decision.reject({ reason: "Link an EVM wallet first." })
}
return staked.total !== null && BigInt(staked.total) >= BigInt(settings.minimum)
? decision.accept()
: decision.reject({ reason: "Stake at least the minimum, then try again." })
},
})The result is { call, chain, contract, returns, total, wallets: [{ address, value }], at, observedAt }. Each wallet's value is a whole number as a string, true or false, or an address, as the function returns it. For a number, total is the wallets' sum; for anything else it is null. at is the block every call read. Pass address to call for one linked wallet.
What the contract read covers
- The member's wallet goes in once.
{ wallet: true }stands for each linked wallet's address, in oneaddressparameter. Every other argument comes from your settings or code, never from the member's input, and must fit its parameter. - No wallet is not "has no stake". With no linked EVM wallet,
ctx.wallet.call()returnsnull. - Failures are never ineligibility. A revert throws a
CapabilityErrorwith codeauthor-errorand the contract's reason, and so do arguments that don't fit the function, an address with no contract, and data that isn't the declared type. A provider outage throwsprovider-unavailable. None of them reads as zero. - State at verification time. Each read is recorded with the attempt, so a retried verification reuses it, and it is one of the evaluation's eight capability calls. It does not prove the member keeps the stake.
Check Cosmos delegations
Domino reads what the member's wallets linked on one Cosmos SDK chain delegate to validators, all at one block, in the chain's staking denomination.
Install the snippet
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/cosmos-staker.jsonIt adds quests/cosmos-staker.quest.ts, which accepts when the member's wallets on the chain delegate at least a minimum, to any validator or to the one you set. Its settings are the chain (such as cosmos:cosmoshub-4), the validator's operator address (empty for any validator) and the minimum, which Console shows in whole tokens. The chain is one /wallet-balance-chains lists.
Or write the check yourself
import { defineQuest, settings, manual, once, points, decision } from "@domino-sdk/relay/authoring"
import { community } from "./ledgers"
export default defineQuest({
key: "delegate-to-us",
title: "Delegate to our validator",
settings: settings.object({
minimum: settings.amount({ label: "Minimum delegation", default: "1000000", decimals: 6 }),
}),
trigger: manual(),
completion: once(),
rewards: [points(community, 50)],
async evaluate({ wallet, settings }) {
const staked = await wallet.delegations!({
chain: "cosmos:cosmoshub-4",
validator: "cosmosvaloper1qyqszqgpqyqszqgpqyqszqgpqyqszqgph84tp0",
})
// null when the member has linked no wallet on this chain.
if (!staked) {
return decision.reject({ reason: "Link a Cosmos Hub wallet first." })
}
return BigInt(staked.total) >= BigInt(settings.minimum)
? decision.accept()
: decision.reject({ reason: "Delegate at least the minimum, then try again." })
},
})The result is { chain, denom, validator, total, wallets: [{ address, amount }], validators: [{ validator, amount }], at, observedAt }. denom is the chain's staking denomination, such as uatom, and every amount is a whole number of its base units as a string: total for the wallets together, each wallet's own, and each validator's. With validator, only delegations to that validator count. Pass address to read one linked wallet.
What the delegation read covers
- Wallets linked on that exact chain. A wallet linked on another Cosmos chain is not read. Any other
addressthrows aCapabilityErrorwith codeauthor-error. - No wallet is not "delegates nothing". With no wallet on the chain,
ctx.wallet.delegations()returnsnull. - Failures are never ineligibility. A chain Domino does not read and a malformed validator address throw
author-error; a provider outage throwsprovider-unavailable. - Bonded delegations at verification time. Unbonding delegations, rewards and governance votes are not counted. Each read is recorded with the attempt and is one of the evaluation's eight capability calls.
Check Solana native stake
Reward members who delegate SOL to your validator. Domino finds every stake account the member's linked Solana wallets control, as the account's staker or its withdrawer, and adds up the SOL they delegate.
Install the snippet
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/validator-stake.jsonIt adds quests/validator-stake.quest.ts, which accepts when the member's linked Solana wallets delegate at least a minimum to your validator. Its settings are your validator's vote account, the minimum, which Console shows in SOL, and whether stake that is still activating counts.
Choose whether new stake counts at once
Stake delegated this epoch becomes active at the next epoch boundary, within about two days. With Count stake that is still activating off, a member who just delegated is asked to come back then; turn it on to accept them right away.
Or write the check yourself
import { defineQuest, settings, manual, once, points, decision } from "@domino-sdk/relay/authoring"
import { community } from "./ledgers"
export default defineQuest({
key: "delegate-sol-to-us",
title: "Delegate SOL to our validator",
settings: settings.object({
minimum: settings.amount({ label: "Minimum stake", default: "1000000000", decimals: 9 }),
}),
trigger: manual(),
completion: once(),
rewards: [points(community, 50)],
async evaluate({ wallet, settings }) {
const stake = await wallet.stake!({
voteAccount: "FiijvR2ibXEHaFqB127CxrL3vSj19K2Kx1jf2RbK4BWS",
})
// null when the member has linked no Solana wallet.
if (!stake) {
return decision.reject({ reason: "Link a Solana wallet first." })
}
return BigInt(stake.total) >= BigInt(settings.minimum)
? decision.accept()
: decision.reject({ reason: "Delegate at least the minimum, then try again." })
},
})The result is { chain, voteAccount, epoch, total, activating, deactivating, wallets, voteAccounts, at, observedAt }. Every amount is lamports as a whole-number string. total is active stake: delegated before the current epoch and not deactivating. activating is stake delegated this epoch, and deactivating stake deactivated this epoch; neither is in total. wallets gives each wallet's { address, amount, activating, deactivating }, and voteAccounts the same per validator. With voteAccount, only stake delegated to that vote account counts. Pass address to read one linked wallet, and chain: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1" to read devnet.
What the stake read covers
- Accounts the wallet controls. A stake account counts when a linked wallet is its staker or its withdrawer, since either can move the stake. An account counts once, even when one linked wallet is its staker and another its withdrawer; it is then listed under the withdrawer. Across members it is not deduplicated: a withdrawer can name any address as staker, so two members can each be counted for the same account. Add a member budget when a reward has real value.
- Native stake only. Liquid-staking tokens are a token balance of the token's mint. Stake a stake pool delegates on the member's behalf is the pool's, not the member's.
- No wallet is not "delegates nothing". With no linked Solana wallet,
ctx.wallet.stake()returnsnull. A linked wallet without stake accounts reads0. - Failures are never ineligibility. A malformed vote account and an
addressthe member never linked throw aCapabilityErrorwith codeauthor-error. A provider outage, or a node that refuses the read, throwsprovider-unavailable. None of them reads as zero. - Stake at verification time. Each read is recorded with the attempt, so a retried verification reuses it, and it is one of the evaluation's eight capability calls. It does not prove the member keeps the stake: for that, see Keep SOL delegated for days.
Keep SOL delegated for days
For "Keep 10 SOL delegated to our validator for a month" and "this month's biggest stakers", Domino samples stake the way it samples balances: once a day, at a time members can't predict, it reads how much SOL every linked Solana wallet delegates, each wallet as ctx.wallet.stake({ address }) reads it. Each day a member's wallet has at least the minimum active fills one day of a 30-day streak, and each day's sample can pay points a monthly leaderboard ranks.
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/validator-stake-streak.jsonThe snippet adds a wallet.stake() tracker for your validator, the streak quest, and a quest and leaderboard that rank members by SOL delegated over the month. See Reward keeping SOL staked.
Read Solana program accounts
Many Solana programs keep each user's stake, lock or position in an account at an address derived from the user's wallet. Domino derives that address for each of the member's linked Solana wallets, reads every account at the same slot, and decodes its fields with the program's IDL.
Install the snippet
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/solana-program-state.jsonIt adds quests/solana-program-state.quest.ts, which accepts when the amounts staked by the member's linked Solana wallets add up to at least a minimum. Its settings are the program, the pool the stake accounts derive from, and the minimum, which Console shows in whole tokens. The default is JUP staked in Jupiter's locked voter. For your program, set the program and the pool, and change the account type, its seeds and the field in the code to the ones your IDL names.
Set the program and its IDL
The program is a Solana program setting, as for on-chain actions on Solana: Domino checks it when you publish the quest, change it in Console, or unarchive the quest, and stores the program's IDL. The read needs that IDL. For a program that publishes none, paste its IDL in Console under Instruction decoding; the same IDL decodes its accounts.
Or write the check yourself
import { defineQuest, settings, manual, once, points, decision } from "@domino-sdk/relay/authoring"
import { community } from "./ledgers"
export default defineQuest({
key: "stake-in-our-program",
title: "Stake in our program",
settings: settings.object({
program: settings.solanaProgram({ label: "Program", default: "voTpe3tHQ7AjQHMapgSue2HJFAh2cGsdokqN3XqmVSj" }),
minimum: settings.amount({ label: "Minimum stake", default: "1000000000", decimals: 6 }),
}),
trigger: manual(),
completion: once(),
rewards: [points(community, 50)],
async evaluate({ wallet, settings }) {
// Jupiter's voter keeps each wallet's stake in an Escrow account at ["Escrow", locker, wallet].
// { wallet: true } is each linked Solana wallet's address.
const escrows = await wallet.programAccount!({
program: settings.program,
account: "Escrow",
seeds: ["Escrow", { pubkey: "CVMdMd79no569tjc5Sq7kzz8isbfCcFyBS5TLGsrZ5dN" }, { wallet: true }],
})
// null when the member has linked no Solana wallet.
if (!escrows) {
return decision.reject({ reason: "Link a Solana wallet first." })
}
// fields is null for a wallet that has no account.
const staked = escrows.wallets.reduce(
(sum, linked) => sum + BigInt(linked.fields ? String(linked.fields.amount) : "0"),
0n
)
return staked >= BigInt(settings.minimum)
? decision.accept()
: decision.reject({ reason: "Stake at least the minimum, then try again." })
},
})The result is { program, chain, account, wallets: [{ address, pda, fields }], at, observedAt }. pda is the address each wallet's seeds derive, and fields the account's fields by the IDL's names, or null when no account exists there. Whole numbers up to 32 bits and decimals are numbers, wider whole numbers such as u64 amounts and i64 timestamps are strings, public keys are base58 strings, an empty option is null, and an enum is { Variant: fields }. at is the slot every account was read at. Pass address to read one linked wallet, and chain: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1" to read devnet.
The seeds are the ones the program's #[account(seeds = […])] constraint lists, in order:
| Seed | Write it as |
|---|---|
The user's wallet (user.key().as_ref()) | { wallet: true } |
A fixed string (b"stake") | "stake" |
Another account (pool.key().as_ref()) | { pubkey: "<address>" } |
A number (id.to_le_bytes()) | { u64: 7 }, or the number's type: u8 to u128, i8 to i128 |
What the program-account read covers
- Accounts derived from the wallet.
{ wallet: true }must appear in the seeds; every other seed comes from your settings or code, never from the member's input. Accounts a program creates at a fresh keypair, which no seeds derive, can't be read. - The named account type only. Domino checks that each account is owned by the program and carries the IDL's discriminator for the account type, so an account of another type is never decoded as yours. Shank IDLs, and Codama IDLs that declare no discriminator for the type, give none to check: then the seeds alone pick the account, and Domino decodes what it holds as the type you named.
- Anchor, Codama and Shank IDLs. The program's setting must have an IDL in one of these formats: Anchor's legacy or 0.30+ format, Codama's, or Shank's. Zero-copy accounts, which Anchor lays out as in memory rather than in Borsh, are refused when a 0.30+ IDL marks them; a legacy Anchor IDL doesn't say which accounts are zero-copy, so read only Borsh accounts with one. A Codama IDL describes each account's exact layout, so its accounts decode as it lays them out.
- The account's first 10 KiB. Fields are decoded from the start of the account; space after them is ignored.
- No wallet is not "has no stake". With no linked Solana wallet,
ctx.wallet.programAccount()returnsnull. A linked wallet without the account readsfields: null, and so does one whose address someone funded with SOL before the program created the account there. - Failures are never ineligibility. A malformed program, a program whose setting has no IDL, an account type the IDL doesn't name, seeds that don't fit (no
{ wallet: true }, more than 15 seeds, a seed over 32 bytes, a number out of its type's range), a program that is not executable on the cluster, an account owned by another program or holding another account type, and anaddressthe member never linked throw aCapabilityErrorwith codeauthor-error, naming the account where there is one. A provider outage throwsprovider-unavailable. None of them reads as zero. - State at verification time. Each read is recorded with the attempt, so a retried verification reuses it, and it is one of the evaluation's eight capability calls. It does not prove the member keeps the stake: for that, see Keep a position for days.
Keep a position for days
For "keep your position in our vault for 90 days" and "this month's biggest positions", Domino samples one number of each member's program account the way it samples balances: once a day, at a time members can't predict, it reads the account of every linked Solana wallet, each as ctx.wallet.programAccount({ address }) reads it, and keeps the field you name. A wallet without the account has no position that day. Each day a member's wallet holds at least the minimum fills one day of a 90-day streak, and each day's sample can pay points a monthly leaderboard ranks.
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/program-position-streak.jsonThe snippet adds a wallet.programAccounts() tracker of JUP staked in Jupiter's locked voter, the streak quest, and a quest and leaderboard that rank members by JUP staked over the month. The tracker has no program setting: it names the program in code, and Domino stores the program's IDL when you deploy it, or the IDL you pass as idl. See Reward keeping a position in a program.
Check DAO voting power on Realms
DAOs on Realms run on SPL Governance, which keeps each member's deposited governing tokens, their voting power, in a token owner record at an address derived from the realm, the token and the member's wallet. The realms-voter snippet reads that record with the program-account read.
Install the snippet
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/realms-voter.jsonIt adds quests/realms-voter.quest.ts, which accepts when the member's linked Solana wallets deposited at least a minimum in the realm. Its settings are the governance program, the realm, the governing token (the community token, or the council token to reward council members), the minimum, which Console shows in whole tokens, and an optional proposal. The default is Grape's realm and its GRAPE token.
Paste the governance IDL
SPL Governance publishes no IDL, so the snippet ships one: docs/snippets/realms-voter.idl.json. After you publish the quest, paste it in Console under Instruction decoding for the governance program. Until then, the check fails as an author error rather than rejecting members.
Optionally require a vote
Set Proposal to a proposal's address, the one in its Realms URL, and the quest also requires a vote on it: a vote the member's linked wallet signed in the last 30 days, for the member's own record. Set it while the proposal is open, and ask members to verify soon after they vote.
What the Realms check covers
- Tokens deposited in the realm. Realms that weigh votes with a plugin, such as VSR locked deposits or NFT voting, keep the tokens in the plugin's accounts, so the deposit reads as 0. Read those with the plugin's own accounts.
- Votes the member signed, with the quest's token. A vote counts when it was cast with the governing token the quest is set to, so set the council token for a council proposal. A vote a governance delegate cast for the member is not in the member's wallet history and does not count.
- State at verification time. Members can withdraw their deposit after the check passes, once they relinquish their votes.
Check Solana liquidity providers
Pools that issue an LP token to liquidity providers, such as Raydium's standard pools and Meteora's Dynamic AMM pools, are a token balance check on the LP token.
Install the snippet
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/solana-lp.jsonIt adds quests/solana-lp.quest.ts, which accepts when the member's linked Solana wallets hold at least a minimum of the pool's LP token. Its settings are the LP mint and the minimum, which Console shows in whole tokens. The default is the LP token of Raydium's SOL-USDC pool.
What the LP check covers
| Pool | Covered |
|---|---|
| Raydium AMM v4 and CPMM pools, Meteora Dynamic AMM pools | Yes: LP tokens in the member's wallets. |
| LP tokens locked in Meteora's lock escrow | With a program-account read of the escrow, which derives from the pool and the wallet. domino quests from-idl Eo7WjKq67rjJQSZxS6z3YkapzY3eMj6Xy8X5EQVn5UaB --account LockEscrow --field totalLockedAmount --seeds lock_escrow,pubkey:<pool>,wallet writes that quest. |
| Orca Whirlpools, Raydium CLMM, Meteora DAMM v2 | No. A position is an NFT whose account derives from the NFT's mint, not the wallet, and an NFT read counts a collection across every pool. |
| Meteora DLMM | No. Each position is an account at a fresh address no seeds derive. |
| LP tokens staked in a farm | No, unless the farm's per-wallet account derives from the wallet: then read it as a program account. |
The check reads the balance at verification time: members can withdraw or sell the LP tokens after it passes.
Check on-chain actions
The on-chain actions reference lists every option and result field of the EVM and Solana reads this section and the next use.
Reward members for doing something with your contract on an EVM chain: swapping on your pool, minting from your collection, depositing into your vault, receiving a bridge transfer or voting on your Governor. Domino reads the events your contract emitted that name one of the member's linked wallets, so you need no indexer.
An action counts only when its event names the member's wallet in an indexed argument, such as to in an ERC-20 Transfer or voter in a Governor VoteCast. A swap or deposit made through a router or aggregator, where the member is only the transaction's sender and your contract's event names the router, cannot be checked this way.
Install the snippet
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/onchain-action.jsonIt adds quests/onchain-action.quest.ts, which accepts when one of the member's linked EVM wallets took part in a new matching event, and awards points once per event. Its settings are the event, the argument that names the member, and an optional minimum amount; the default is a USDC transfer of at least 1 USDC on Base, so set it to your contract.
Set the event
The event is your contract on its chain and the event's Solidity signature, with argument names and indexed markers:
eip155:8453:0x833589fCD6eDb6E08f4c7C32D4f71b54bdA02913 Transfer(address indexed from, address indexed to, uint256 value)When you publish the quest, change the event in Console, or unarchive the quest, Domino checks it. Make these changes in test; they reach live through a promotion. An event with no indexed address argument, a chain Domino does not read, a chain with no finalized or safe block, and an address with no contract are refused there.
Or write the check yourself
import { defineQuest, settings, manual, once, points, decision } from "@domino-sdk/relay/authoring"
import { community } from "./ledgers"
export default defineQuest({
key: "vote-on-our-governor",
title: "Vote on our proposal",
settings: settings.object({
vote: settings.contractEvent({
label: "Vote event",
default:
"eip155:1:0x52908400098527886E0F7030069857D2E4169EE7 VoteCast(address indexed voter, uint256 proposalId, uint8 support, uint256 weight, string reason)",
}),
}),
trigger: manual(),
completion: once(),
rewards: [points(community, 50)],
async evaluate({ wallet, settings, now }) {
const votes = await wallet.events?.({
event: settings.vote,
account: "voter",
since: now - 7 * 24 * 60 * 60 * 1000,
where: { support: "1" },
})
// null when the member has linked no EVM wallet.
if (!votes) {
return decision.reject({ reason: "Link an EVM wallet first." })
}
return votes.logs.length
? decision.accept()
: decision.reject({ reason: "Vote for the proposal, then try again." })
},
})The result is { event, chain, contract, since, at, finality, complete, logs, observedAt }. Each log is { wallet, block, timestamp, tx, logIndex, args }, oldest first: wallet is the linked wallet the event names, timestamp the block's time in epoch milliseconds, and args every argument by name, with integers as decimal strings, addresses EIP-55 and bytes as lowercase hex. To reward each action once, key the completion on `${chain}:${tx}:${logIndex}`, as the snippet does.
where narrows the logs by other arguments: an equality (an address in any case, an integer in decimal, true or false, or hex bytes) or { gte } for an integer at least a value, such as { value: { gte: settings.minimum } }. afterActivation: true also skips events before the quest was first activated in the environment. Pass address to read one linked wallet.
What the event read covers
-
Finalized blocks only. Domino reads up to the chain's
finalizedblock, or itssafeblock on a chain that has no finality tag, so an event it counted is never undone by a reorganization. A transaction appears once its block is final, which takes about 13 minutes on Ethereum, longer on rollups such as Base, Optimism and Arbitrum that finalize after Ethereum does, and seconds to minutes on chains with fast finality. Tell members to try again later rather than reject them for good. -
At most 30 days back.
sinceearlier than 30 days before the evaluation throwsauthor-error. -
At most 3,000,000 blocks and 1,000 logs. A read over more than 3,000,000 blocks, or matching more than 1,000 logs before
wherefilters non-indexed arguments, throwsauthor-error. Passnewestto get the newest events instead, as described below. Without it, use a latersince, or awherecondition on an indexed argument. -
3,000,000 blocks is less than 30 days on fast chains. That's about 34 days of 1-second blocks. At the block times Domino measured in October 2026, it covers fewer than 30 days on these chains:
Chain Days Robinhood 3 Gravity 8 opBNB 8 Arbitrum One 9 Monad 10 Cronos 14 Plume 15 BNB Smart Chain 15 Sei 16 Telos 17 Arc 17 Tempo 19 Playnance 20 Aurora 22 Stable 24 Moca 28 Block times change, so a read near the limit can start failing. Use
newestfor a window this long. -
newestreturns a partial read instead of failing.newest: n, from 1 to 1,000, returns at most thennewest matching events. Domino reads back from the newest block and stops at the block or log cap instead of throwing.completeistruewhenlogsholds every matching event sincesince. It'sfalsewhen older matching events were left out, or when the read stopped at a cap before reachingsince. A read withoutnewestreturns all matching events withcomplete: true, or throws. Results recorded before Domino reportedcompletedon't have it. -
No wallet is not "no activity". With no linked EVM wallet,
ctx.wallet.events()returnsnull. -
Failures are never ineligibility. A malformed event, a chain Domino does not read, an
accountthat is not an indexed address argument, awhereon an unknown argument or of the wrong type, and anaddressthe member never linked throwauthor-error; a provider outage throwsprovider-unavailable. None of them reads as no activity. -
Read once per attempt. Each read is recorded with the attempt, so a retried verification reuses it, and it is one of the evaluation's eight capability calls.
Guard against farming. An event is cheap to produce: anyone can send a small transfer, or split one deposit across many wallets. Set a minimum amount (where with gte), count only events after the member linked the wallet (the snippet compares each log's timestamp with the wallet's verifiedAt), keep the window recent, and cap how often one member can earn with a member budget.
Check on-chain actions on Solana
Reward members for using your Solana program: swapping into your token on Jupiter, depositing into your vault, or calling your program at all. Solana has no event logs, so Domino reads the linked wallet's own transactions instead: the ones that succeeded, are final, and called your program. Each one comes with the programs it called and how the wallet's balances changed, so most checks need no decoding. When your program publishes an IDL (Anchor, Codama or Shank), Domino also decodes the instructions it was called with, so you can check their arguments.
| Quest | Check |
|---|---|
| Swapped into our token | The transaction called the swap program, and the wallet's token went up while another went down |
| Deposited or staked | The transaction called your program, and the wallet's token went down by at least an amount |
| Used our program at all | Any transaction that called your program |
| Staked for at least 90 days | The transaction called your program's stake instruction with a lock of 90 days or more |
Install the snippet
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/solana-action.jsonIt adds quests/solana-action.quest.ts, which accepts when one of the member's linked Solana wallets signed a new transaction that called your program, and awards points once per transaction. Its settings are the program, an optional token mint the wallet must receive in that transaction, and a minimum amount; the default is a Jupiter swap that brings the wallet at least 1 USDC, so set it to your program and token. For a deposit or stake, where the wallet gives tokens up, its README shows how to check what the wallet spent instead.
Set the program
The program is its Solana address, such as Jupiter's:
JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4When you publish the quest, change the program in Console, or unarchive the quest, Domino checks it on Solana mainnet, then on devnet when mainnet has no such program. Make these changes in test; they reach live through a promotion. An address with no account on either, and an account that is not a program (a wallet, a token mint, or an account your program owns), are refused there.
Publishing the quest or changing the program also stores the program's IDL, when it publishes one on the cluster where Domino found it: either in the Program Metadata Program's account for it, where Anchor 1.0 and later and Codama publish, or in the IDL account of earlier Anchor versions. Anchor, Codama and Shank IDLs are read. A mainnet program that publishes no IDL there takes the one it publishes on devnet, and that IDL decodes its reads on both clusters. Domino decodes the program's instructions with the stored IDL, so a later IDL upgrade on chain doesn't change a live quest until the next save. For a program without an on-chain IDL, or to use another IDL, open the quest in Console and paste its IDL under Instruction decoding: choose Paste IDL (or Replace IDL), paste the IDL's JSON, and choose Use this IDL. A pasted IDL takes precedence over the one on chain until you choose Remove pasted IDL. A program without any IDL still works; its transactions just come without decoded instructions.
To read your devnet program, pass chain: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1" to ctx.wallet.transactions(). Without chain, it reads mainnet. Linked Solana wallets read on both.
Or write the check yourself
import { defineQuest, settings, manual, once, points, decision, received, swapped } from "@domino-sdk/relay/authoring"
import { community } from "./ledgers"
const usdc = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
export default defineQuest({
key: "swap-into-usdc",
title: "Swap into USDC on Jupiter",
settings: settings.object({
program: settings.solanaProgram({
label: "Swap program",
default: "JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4",
}),
minimum: settings.amount({ label: "Minimum USDC", default: "10000000", decimals: 6 }),
}),
trigger: manual(),
completion: once(),
rewards: [points(community, 50)],
async evaluate({ wallet, settings, now }) {
const read = await wallet.transactions?.({
program: settings.program,
since: now - 7 * 24 * 60 * 60 * 1000,
})
// null when the member has linked no Solana wallet.
if (!read) {
return decision.reject({ reason: "Link a Solana wallet first." })
}
const swap = read.transactions.find(
(tx) =>
tx.signer &&
swapped(tx, { into: usdc }) &&
BigInt(received(tx, usdc)) >= BigInt(settings.minimum)
)
return swap
? decision.accept()
: decision.reject({ reason: "Swap at least 10 USDC on Jupiter, then try again." })
},
})The result is { program, chain, mint, since, at, complete, transactions, observedAt }. Each transaction is { wallet, signature, slot, timestamp, signer, programs, balanceChanges }, oldest first: wallet is the linked wallet whose history holds it, timestamp the block's time in epoch milliseconds, signer whether that wallet signed it, programs every program it called, and balanceChanges the wallet's changes as { mint, delta }, with mint "SOL" for lamports and delta a signed integer string in base units. A transaction that touched two of the member's wallets appears once for each. To reward each action once, key the completion on the transaction's signature.
Four helpers from @domino-sdk/relay/authoring read one transaction:
| Helper | Returns |
|---|---|
received(tx, mint) | How much of mint the wallet gained, as an integer string, or "0" |
spent(tx, mint) | How much of mint the wallet gave up, as an integer string, or "0" |
swapped(tx, { into?, from? }) | Whether one mint went down and a different one went up |
invoked(tx, program) | Whether the transaction called program |
Check an instruction's arguments
When the program's setting has an IDL, each transaction also has instructions: the program's instructions in it, top-level and called by other programs, in call order, each { name, args, accounts }. instruction(tx, name) from @domino-sdk/relay/authoring returns the arguments of the first one named name, or null. For "Staked for at least 90 days":
import { defineLedger, defineQuest, settings, manual, once, points, decision, instruction } from "@domino-sdk/relay/authoring"
const community = defineLedger({ key: "community", name: "Community" })
export default defineQuest({
key: "stake-90-days",
title: "Stake for at least 90 days",
settings: settings.object({
// Your Anchor staking program, whose IDL has a stake(amount, lock_days) instruction. Replace
// this placeholder with its base58 address: publication checks that the program exists.
program: settings.solanaProgram({
label: "Staking program",
default: "StakeProgram1111111111111111111111111111111",
}),
}),
trigger: manual(),
completion: once(),
rewards: [points(community, 100)],
async evaluate({ wallet, settings, now }) {
const read = await wallet.transactions?.({
program: settings.program,
since: now - 7 * 24 * 60 * 60 * 1000,
})
if (!read) {
return decision.reject({ reason: "Link a Solana wallet first." })
}
const staked = read.transactions.some(
(tx) =>
tx.signer && Number(instruction(tx, "stake")?.lock_days ?? 0) >= 90
)
return staked
? decision.accept()
: decision.reject({ reason: "Stake with a lock of at least 90 days, then try again." })
},
})Names are spelled as the IDL spells them: snake_case in an Anchor 0.30+ IDL (lock_days), camelCase in a legacy Anchor or a Codama one (lockDays); a Shank IDL usually names instructions in PascalCase (Stake) and arguments in camelCase. An instruction the IDL doesn't describe is left out, never an error. A Codama instruction's discriminator argument is left out of args, as Anchor's discriminator is.
| In the IDL | In args |
|---|---|
u8 to u32, i8 to i32, f32, f64 | A number |
u64, i64, u128, i128 | A decimal string; compare with BigInt() |
pubkey | A base58 address |
string, bool | A string, a boolean |
bytes, vec, an array, a tuple, a set | An array |
| A map | An object keyed by each key as a string |
| An option | The value, or null when absent |
| A struct | An object of its fields |
| An enum | { Variant: fields }, { Variant: {} } without fields |
accounts names each account the instruction lists, as the IDL names it, with its address: check accounts when the wallet must be the instruction's signer or owner, not only an account it touched. An optional account a Codama instruction leaves out, by passing the program in its place, is not in accounts.
Start from your program's Anchor IDL
To check one instruction of an Anchor program, have the CLI write the quest and its test:
npx domino quests from-idl <program address> --cluster devnet --instruction depositIt reads the IDL your program publishes on the cluster (mainnet unless you pass --cluster devnet), in the same two places Domino reads it. Without --instruction, it lists the program's instructions to choose from. It writes <key>.quest.ts in the folder relay.json discovers quests in, and <key>.test.ts beside it; the key defaults to the IDL's name and the instruction's, such as vault-deposit. Then run the test and publish with domino deploy.
The quest completes once for each transaction a member's linked Solana wallet signed that called the instruction, with the farming guards of the solana-action snippet: only signed transactions, only after the wallet was linked and the quest activated, one completion per transaction. Each argument of a simple type becomes a setting you can change in Console:
| Argument type | Setting | Counts a call when the argument is |
|---|---|---|
u8 to u32, i8 to i32 | A minimum, the type's smallest by default | At least the minimum |
u64, u128 | A minimum amount, 0 by default | At least the minimum |
i64, i128 | A minimum, empty by default | At least the minimum, or anything when empty |
bool | Any, true or false | The chosen value, or anything |
pubkey, string | A value, empty by default | Exactly that value, or anything when empty |
Arguments of other types, such as structs, vectors and options, are left as TODO comments where the quest compares the arguments. With the defaults, any signed call counts.
- No IDL on chain? Pass the IDL file with
--idl target/idl/<program>.json. Domino still needs the IDL to decode the program's calls: after you publish, paste it in Console under Instruction decoding. - An existing file is never overwritten unless you pass
--force. Pass--outto write the quest elsewhere. - Anchor IDLs only. A Codama or Shank IDL, an IDL naming another program, or one over 512 KiB once its whitespace is removed is refused; write the quest with
instruction()as above.
To check a program account instead, such as a stake or lock the program keeps for each wallet, pass the account type, an integer field and the seeds of the account's address:
npx domino quests from-idl voTpe3tHQ7AjQHMapgSue2HJFAh2cGsdokqN3XqmVSj --account Escrow --field amount --seeds Escrow,pubkey:CVMdMd79no569tjc5Sq7kzz8isbfCcFyBS5TLGsrZ5dN,walletThe quest accepts once when the field of the member's accounts, one per linked Solana wallet, adds up to at least a minimum you set in Console, as the program-account read reads them. List the seeds in the order of the program's #[account(seeds = […])] constraint, comma-separated:
| Seed | Write it as |
|---|---|
| The user's wallet | wallet (required) |
| Another account | pubkey:<address>, which becomes a setting with that address as its default |
| A number | u64:7, or the number's type: u8 to u128, i8 to i128 |
| A fixed string | The text itself, or string:<text> |
Without --field or --seeds in a terminal, the command asks for them. Only accounts Domino decodes are choices: zero-copy accounts a 0.30+ IDL marks are left out, and only integer fields can be compared.
Pass mint to read only the transactions that touched each wallet's associated token account for that token, usually far fewer than the wallet's whole history. afterActivation: true also skips transactions before the quest was first activated in the environment. Pass address to read one linked wallet.
What the transaction read covers
- Finalized transactions only. Domino reads at the
finalizedcommitment, so a transaction it counted is never rolled back. A transaction appears about 13 seconds after it lands. - Successful transactions only. A failed transaction is skipped, even if it called your program.
- Called anywhere in the transaction. A program called by another program, such as a pool Jupiter routes through, counts as called. Addresses loaded from lookup tables are included.
- Balance changes are the wallet's own. They come from the token accounts the wallet owns and from its SOL balance, which leaves out the fee the wallet paid but includes any rent, such as for opening a token account. A token that passed through an account the wallet doesn't own, such as an intermediate account of a route, doesn't show. A swap out of SOL usually wraps and unwraps it inside the transaction, so it shows as SOL going down; SOL the wallet keeps wrapped shows under the wrapped SOL mint,
So11111111111111111111111111111111111111112. - Transactions that touched the wallet, whoever signed them. A transfer someone else sent to the member's wallet, in a transaction that called your program, is returned too, with the tokens as received and
signerfalse. - With
mint, only the associated token account. Tokens the wallet holds in another token account aren't read. - At most 30 days back.
sinceearlier than 30 days before the evaluation throwsauthor-error. - At most 1,000 transactions per wallet. A busy wallet with more than 1,000 successful transactions since
sincereturns its newest 1,000 andcomplete: false; it doesn't throw. So does a wallet whose last 10,000 signatures, failed ones included, don't reach back tosince. Use a latersinceormintto read fewer. - No wallet is not "no activity". With no linked Solana wallet,
ctx.wallet.transactions()returnsnull. - Failures are never ineligibility. A malformed program, an account that is not a program, a
mintthat is not a token mint, and anaddressthe member never linked throwauthor-error; a provider outage throwsprovider-unavailable. None of them reads as no activity. - Read once per attempt. Each read is recorded with the attempt, decoded instructions included, so a retried verification reuses it, and it is one of the evaluation's eight capability calls.
Guard against farming. A transaction is cheap: anyone can make a tiny swap, split one deposit across many wallets, or swap and send the output to a member's wallet. Check signer for anything that rewards an action, so a transaction counts only when the member's wallet signed it; received() alone also rewards transfers someone else sent. Opening a token account costs the wallet about 0.002 SOL of rent, so a swap out of SOL needs a minimum above that, not only swapped(). Require a minimum amount (received(tx, mint) compared with a settings.amount() value), count only transactions after the member linked the wallet (compare timestamp with the wallet's verifiedAt), keep the window recent, and cap how often one member can earn with a member budget. To rank or count program use over time without an indexer, use a wallet.programActivity() tracker: it applies the signer and link-time guards for you and takes an optional minimum amount.
Complete without a check
The quest above completes when the member asks Domino to check. To complete it on its own when the member's transaction finalizes, trigger it from a wallet.programActivity() tracker instead. Domino reads every linked Solana wallet every 10 minutes and records each transaction the wallet signed that calls your program; the quest then runs for each new record, for the member who linked the wallet. Members press nothing, and the quest completes within about 10 minutes of the transaction, with its rewards and completion events as usual.
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/solana-action-automatic.jsonIt adds the tracker at trackers/solana-action-calls.ts and quests/solana-action-automatic.quest.ts, which pays once per transaction the wallet signed that received at least a minimum of a token. Set your program and token in the tracker before the first deploy, and register the tracker in relay.json as the snippet's README says. In Console, the quest's How it works shows Completes automatically within about 10 minutes of the member's transaction under its tracker.
| Checked when the member asks | Completes on its own | |
|---|---|---|
| Trigger | manual() | automatic({ tracker }) on a program activity tracker |
| How soon | Seconds after the transaction finalizes, when the member asks | Within about 10 minutes, without the member |
| Program and token | Settings operators can change in Console | Fixed in the tracker file; another program needs a new tracker |
| Guards | Your evaluator checks the signer and the link time | The tracker records only signed transactions after the link; the quest's trigger keeps those that received the minimum |
To complete within seconds with no check either, have your app's server send the transaction's signature: see Complete a quest from a signed Solana transaction.
Complete a quest from a signed Solana transaction
Let members complete a quest by signing a transaction in their wallet, such as at a booth or from a link, without signing in to your app first. Your app's server builds the transaction with the quest's memo, the member signs it, and the server sends Domino the signature. Domino reads the transaction on chain, finds the member whose linked wallet signed it, and runs the quest's check for them.
This is experimental: a minor release can change it.
Add the quest's memo to the transaction
Add an SPL Memo instruction whose text names the quest, built with solanaActionMemo() from @domino-sdk/relay/server:
import { solanaActionMemo } from "@domino-sdk/relay/server"
solanaActionMemo({ quest: "booth-check-in", reference: "north-hall" })
// "domino:quest:booth-check-in:north-hall"reference is optional: up to 64 letters, digits, _ or - that say where the member completed the quest, such as a check-in station. The wallet shows the memo to the member before they sign.
Send the signature
Once the transaction lands, send its signature from your server with a key that holds ingest, as hosted-app keys and editors do:
import { createManagementClient } from "@domino-sdk/relay/server"
const management = createManagementClient({
baseUrl: "https://api.example.com",
organization: "my-organization",
project: "community",
environment: "test",
getToken: async () => "SERVER_SIDE_MANAGEMENT_KEY",
})
// The signature of the transaction the member signed and sent.
const signature = "5VERv8NMvzbJMEkV8xnrLkEaWRtSz9CosKDYjCJjBRnbJLgp8uirBgmQpjKhoR4tjF3ZpRzrFmBV6UjKdiSZkQUW"
const attempt = await management.attempts.submitSolanaTransaction({
quest: "booth-check-in",
signature,
})It resolves with the member's queued attempt. Domino reads only finalized transactions, about 13 seconds after one lands; until then the call fails with transaction-not-final and a Retry-After header, so send the same signature again. Sending a signature that was already accepted returns the first attempt.
Check the transaction in the quest
Only a quest members submit themselves, manual() without input, takes a transaction. Its check runs as usual and reads the transaction as ctx.action: the signature, the member's wallet that signed it and the memo's reference. To complete once per station, key the completion on the reference:
import { defineQuest, settings, manual, keyed, points, decision } from "@domino-sdk/relay/authoring"
import { community } from "./ledgers"
export default defineQuest({
key: "booth-check-in",
title: "Check in at our booths",
settings: settings.object({}),
trigger: manual(),
completion: keyed((ctx) => ctx.action?.reference ?? "app"),
rewards: [points(community, 20)],
async evaluate({ action }) {
return action
? decision.accept()
: decision.reject({ reason: "Scan a booth's code with your wallet." })
},
})An attempt the member submitted in your app reads ctx.action as null. In tests, pass the transaction to runQuest(quest, { action: { wallet, reference } }).
Console shows the transaction, the signing wallet and the reference on the attempt. Erasing the member removes them.
Check-in stations
To complete the quest at the stations of an event, such as its booths or doors, list them on the quest. Domino then takes a transaction only when its memo's reference names one of the stations and that station was open when the transaction landed, and refuses the member's own submission of the quest. Your team's test-member passes and member imports are not checked against stations. With perStation(), each member completes the quest once per station.
import { defineQuest, settings, manual, perStation, points } from "@domino-sdk/relay/authoring"
import { community } from "./ledgers"
export default defineQuest({
key: "booth-check-in",
title: "Check in at our booths",
settings: settings.object({}),
trigger: manual(),
completion: perStation(),
stations: [
{ key: "north-hall", label: "North hall" },
{
key: "keynote",
label: "Keynote stage",
opensAt: Date.parse("2026-11-12T09:00:00Z"),
closesAt: Date.parse("2026-11-12T18:00:00Z"),
},
],
rewards: [points(community, 20)],
})Each station's key is the reference your app puts in its memo, solanaActionMemo({ quest: "booth-check-in", reference: "keynote" }): up to 64 letters, digits, _ or -, each used once. label is the station's name for people, up to 120 characters. opensAt and closesAt are optional times in epoch milliseconds: the station takes transactions whose block time is at or after opensAt and before closesAt. The block time is when the transaction landed on chain, so a member who signs just before closing still checks in while the transaction finalizes. A quest takes up to 200 stations. Only a quest written in code takes them: a reusable quest type (defineQuestType) with stations is refused.
Stations are part of the quest, so a deploy changes them, a promotion carries them to live, and the quest read returns them (management.quests.list()). Keep a station's key once its code is printed: to replace a code, add a station with a new key and give the old one a closesAt. To stop a leaked code at once, revoke the station in Console or with management.quests.stations.revoke(): a revocation is an operation of the environment, so it applies in live without a promotion, and a promotion never changes it.
To check members in with a printed QR code they scan with a mobile wallet, serve the stations with defineStationAction() and print the codes with domino quests stations qr: In-person quests with Solana Pay walks through it.
Stations a code proves
A station can take check-ins with a secret code instead of a transaction: give it proof: "code", as in { key: "front-desk", label: "Front desk", proof: "code" }. Leaving proof out means "transaction", as above, and one quest can have both kinds. Domino refuses every transaction that names a code station with station-proof-mismatch, because a transaction station's Solana Pay link is public and would let anyone skip the code. Members check in at a code station with its code and no wallet: see Check in with a code.
The code is not part of the quest. Each environment holds its own code for each code station, and a promotion never copies it:
- Choose a code with
management.quests.stations.setCode(quest, station, { code }): 6 to 64 letters, digits,-or_. Six characters is the shortest code staff can still type off a sign. - Let Domino make one with
management.quests.stations.generateCode(quest, station): 12 characters from an alphabet without look-alikes (no0orO, no1,Iorl). The answer shows it this once; no later read returns it. - Remove it with
management.quests.stations.clearCode(quest, station). The station takes no check-ins in that environment until it gets another.
Setting or generating a code replaces the one the station had. Each needs publish permission in the environment you change, and the audit records who changed which station, never the code. management.quests.stations.list(quest) answers each station's proof and, for a code station, whether it has a code there (codeSet). To use the same code in test and live, set it in each one. A promotion warns about each code station that has no code in live and approves anyway.
In Console, open the quest and select the environment. Its Check-in stations section shows Code: Set or Code: Not set on each code station, never the code itself. With publish permission:
- Set code, then Generate code, makes a code and shows it once, with Copy secret. Or choose Choose a code and type one in the masked field, such as the code the station has in the other environment.
- Once a station has a code, the menu reads Rotate code. Rotating asks you to confirm first, since printed QR codes for the station stop working. Clear code also asks first.
- Enter the page in your app where members check in in Scan page URL, an https address. Console remembers it in your browser for that quest and environment, apart from the App action URL of transaction stations.
- Download QR on a code station gives an SVG to print or a PNG. Domino draws it from the station's code: it links to your scan page with the quest key, station key and code added, and prints the station's label under it. Drawing it needs a code set in that environment, and
publish, because the QR code carries the code. Operators with only read permission see whether a code is set.
The code controls work in test and live alike, since codes belong to each environment. Revoke and Restore work on code stations as on transaction stations.
From the CLI, the code commands change test unless you add --environment live, as domino secrets does, while qr reads the environment the CLI is pointed at, like other commands, and says which in its result:
# Domino makes the code and prints it this once
domino quests stations code generate booth-check-in front-desk
# or choose one: the code comes from stdin, never an argument, so it stays out of shell history
printf %s "$CODE" | domino quests stations code set booth-check-in front-desk
domino quests stations code clear booth-check-in front-desk
# write a QR code per station to print
domino quests stations qr booth-check-in --page-url https://your-app.example/check-incode set refuses to read from a terminal or an empty pipe. When set or generate replaces a code, its result says so (replaced), and QR codes printed with the old one stop working. qr writes <station key>.svg for each code station that has a code in that environment and lists the others under skipped; for a quest that also has transaction stations, add --url as in Print the codes. Its output never shows a code, which exists only inside the files, so keep them private until they are printed.
Check in with a code
A member checks in at a code station by entering its code in your app. Domino checks the code against the one set for the station in the environment, then runs the quest as for a transaction, so perStation() completes it once per member and station, and the quest's evaluator reads { kind: "station-code", reference } in ctx.action, with the station's key as reference. Send the check-in one of two ways:
- From the member's browser, in an app that signs members in through Domino:
relay.quests.checkIn(quest, station, { code })checks in the signed-in member. Apps on an SDK older than this feature need to upgrade, because their portal proxy doesn't forward the route. For a scan page that a station's printed QR code opens,useStationCheckIn()from@domino-sdk/relay/react, orcheckInAtStation()from@domino-sdk/relay/browser, reads the code from the link, takes it out of the address bar, waits for sign-in and sends the check-in: see In-person check-ins with a code. - From your app's server, when it checks codes itself:
management.attempts.submitStationCode({ quest, station, code, member })with a key holdingingest, wherememberis the member your app signed in, such assignedInMember's.
import { createBrowserRelayClient } from "@domino-sdk/relay/browser"
const relay = createBrowserRelayClient({ baseUrl: "/relay" })
const attempt = await relay.quests.checkIn("booth-check-in", "front-desk", {
code: "K7MPQ2RW9XTA",
})Domino checks, in this order, that the quest has the station, that a code proves it, that it has a code in this environment, that no operator revoked it, that it is open now (a code carries no time of its own, so the window is judged when the check-in arrives), and that the code matches, letter case included. Each answer that isn't a check-in names its reason; see the table below. A repeat check-in at a station the member already completed is accepted onto the completion they have and pays nothing new.
Guessing is limited, and only wrong codes count: a member has 10 wrong codes an hour at a station, which leaves room for typos, and a station takes 600 wrong codes in 10 minutes from all members together, which keeps guessing even a six-character code above a thousand years on average while a crowd holding the right code never spends it. While either budget is spent, every check-in it covers is refused, right codes included, until its window ends. The browser route also counts toward the member's 120 submissions an hour.
Domino compares the code and keeps nothing of it: no attempt, log line or answer holds it. An attempt from a code check-in carries the station as station and no action.
In tests, runQuest(quest, { now, action: { wallet, reference } }) refuses a station the quest lacks, one a code proves, or one closed at now, with a TestSetupError, since now stands in for the block time. runQuest(quest, { now, action: { kind: "station-code", reference } }) simulates a check-in with a station's code: it refuses a station the quest lacks, one transactions prove, or one closed at now, and takes the code as right, since Domino checks it before the quest runs.
This is experimental: a minor release can change it.
What Domino refuses
| Refusal | Why |
|---|---|
transaction-not-final | Not finalized yet, or no such signature. Send it again after Retry-After. |
transaction-failed | The transaction failed on chain. |
transaction-not-for-quest | No Domino quest memo, more than one, or one that names another quest. |
wallet-not-linked | No signer is a wallet a member of the project linked. Send the member to your app to link it, then send the signature again. |
account-ambiguous | The signers are linked to different members. |
quest-not-transaction-completable | The quest takes input, staff confirm it, or it runs on its own. |
station-unknown | The quest has stations and the memo or check-in names none of them, or the quest was submitted without a check-in. |
station-proof-mismatch | The memo names a station a code proves, or a code check-in names a station transactions prove. |
station-code-not-set | The code station has no code in this environment yet. |
station-closed | The station was closed when the transaction landed, or when the code check-in arrived. |
station-revoked | An operator revoked the station. The refusal applies when the check-in reaches Domino, whenever a transaction was signed. |
station-code-invalid | The code is not the station's code. |
rate-limited | Too many wrong codes from the member at the station, or at the station. Try again after Retry-After. |
Domino never links a wallet or signs a member in from a transaction.
Serve the quest as a blink
A Solana Action lets a member complete the quest from a blink: a card in an X post, a wallet or a website, with a button that opens their wallet. defineQuestAction() from @domino-sdk/relay/server serves one quest as an Action from your app's own origin. Your code builds the transaction; the helper adds the quest's memo, and once the member signs, sends Domino the signature and shows them the result. Quests as blinks walks through the whole path: what members see, testing, hosting, and registering your domain so it unfurls on X.
This is experimental: a minor release can change it.
// app/api/actions/booth/route.ts in a Next.js app
import { defineQuestAction } from "@domino-sdk/relay/server"
import {
AccountRole,
address,
appendTransactionMessageInstruction,
createSolanaRpc,
createTransactionMessage,
pipe,
setTransactionMessageFeePayer,
setTransactionMessageLifetimeUsingBlockhash,
} from "@solana/kit"
const rpc = createSolanaRpc("https://api.devnet.solana.com")
// Your program, and the instruction the member signs.
const program = address("CheckinProgram111111111111111111111111111111")
const action = defineQuestAction({
quest: "booth-check-in",
chain: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1", // devnet; omit for mainnet
linkUrl: "/profile", // where a member links a wallet Domino doesn't know
reference: (request) => new URL(request.url).searchParams.get("station"),
async build({ account }) {
const { value: blockhash } = await rpc.getLatestBlockhash().send()
return pipe(
createTransactionMessage({ version: 0 }),
(message) => setTransactionMessageFeePayer(address(account), message),
(message) => setTransactionMessageLifetimeUsingBlockhash(blockhash, message),
(message) =>
appendTransactionMessageInstruction(
{
programAddress: program,
accounts: [{ address: address(account), role: AccountRole.WRITABLE_SIGNER }],
data: new Uint8Array([0]),
},
message
)
)
},
})
export { action as GET, action as POST, action as OPTIONS }// app/actions.json/route.ts
import { actionsJson } from "@domino-sdk/relay/server"
export const GET = actionsJson()
export const OPTIONS = GETRoute GET, POST and OPTIONS of one URL to the handler. In a Worker, call it as action(request, env). Serve actionsJson() at /actions.json on your domain's root: by default it maps every path under /api/actions/ to itself, or pass your own { pathPattern, apiPath } rules. On a *.domino.page address, the app needs transparent routing: legacy routing refuses POST, so a blink can't reach the handler.
What the member sees, step by step:
- The card. The quest's title, its instructions as the description and its image as the icon, with a Complete quest button. Set
metadatato replace any of them, to change the button'slabel, or to show several buttons with inputs (metadata.actions). A quest without an image needsmetadata.icon. When the quest is archived or paused, or isn't one members submit without input, the card shows the reason with its button disabled, and the helper refuses the transaction before the member signs. - The transaction.
build({ account, params, quest, request })returns the unsigned transaction the member's wallet signs: a@solana/kittransaction message (legacy or version 0, lookup tables included), kit's compiled transaction, or its bytes.paramsholds the button's inputs. The helper appends one SPL Memo instruction with the quest's memo and changes nothing else. It adds no instruction that moves funds and signs nothing. Thrownew QuestActionRefusal(message)to show the member a message instead; Domino is not called. - The result. After the member signs, the blink posts the signature back. The helper sends it to Domino, waits up to about 45 seconds for the transaction to finalize and the quest's check to decide, and shows the points the quest awards, the check's reason for a rejection, or "Confirming on Solana: check the quest in the app in a minute" when it took longer. A wallet no member linked gets a Link your wallet button that opens
linkUrl, and a Check again button that resends the signature once they linked it.
Award on-chain badges on Solana
Give members a soulbound badge on Solana when they complete a quest: a Token-2022 token that can't be transferred out of the wallet it was minted to, or, for large drops, a compressed NFT. Your server mints it with your own mint authority and pays the fees; Domino holds no key and mints nothing. A later quest can then reward members who hold the badge.
What happens, step by step:
- A member completes a badge quest. Domino sends your server the
completion.createdwebhook. - Your server mints one badge to the member's most recently linked Solana wallet that they proved, in one transaction that also opens their token account when they don't have one yet.
- Your server records the transaction on the completion as its
badgereceipt. Your team sees it on the completion's accepted attempt in Console, with a link to Solana Explorer, next to abadge-attempt-1receipt for the same transaction: the claim that stops a retry from minting twice.
This is experimental: a minor release can change it.
Install the snippet
pnpm dlx shadcn@4.21.0 add https://snippets.domino.run/r/solana-badge.jsonIt adds two quests: quests/solana-badge.quest.ts, which a member completes by linking a Solana wallet and which earns the badge, and quests/solana-badge-holder.quest.ts, which accepts members whose linked Solana wallets hold it. It also adds two files under docs/snippets/ for your own backend: a script that creates the badge's mint and the webhook route that awards it. Install @solana/kit 8 and @solana-program/token-2022 in that backend: @domino-sdk/relay/solana needs them, and the SDK's other entries don't. Kit's types need TypeScript 5.7 or later and the DOM lib in tsconfig.json.
Create the badge's mint
Run the setup once per badge, on devnet first. The key pair that runs it becomes the mint authority and pays the mint's rent, about 0.004 SOL.
import { readFile } from "node:fs/promises"
import { createKeyPairSignerFromBytes, createSolanaRpc } from "@solana/kit"
import { createSolanaBadgeMint } from "@domino-sdk/relay/solana"
const authority = await createKeyPairSignerFromBytes(
new Uint8Array(JSON.parse(await readFile("badge-authority.json", "utf8")))
)
const { mint } = await createSolanaBadgeMint({
authority,
rpc: createSolanaRpc("https://api.devnet.solana.com"),
name: "Quest Badge",
symbol: "QUEST",
uri: "https://example.com/badge.json", // JSON with the image wallets show
})The mint has 0 decimals, the NonTransferable extension, and its name, symbol and URI stored on the mint itself, which wallets and explorers read.
Award the badge from your webhook route
import { createKeyPairSignerFromBytes, createSolanaRpc } from "@solana/kit"
import { createManagementClient, verifyWebhook } from "@domino-sdk/relay/server"
import { awardSolanaBadge, solanaDevnet } from "@domino-sdk/relay/solana"
const management = createManagementClient({
baseUrl: "https://relay.domino.run",
organization: "your-organization",
project: "your-project",
environment: "test",
getToken: async () => process.env.DOMINO_MANAGEMENT_KEY!, // a key with points permission
})
const rpc = createSolanaRpc(process.env.SOLANA_RPC_URL!)
const authority = await createKeyPairSignerFromBytes(
new Uint8Array(JSON.parse(process.env.BADGE_AUTHORITY_KEYPAIR!))
)
export async function POST(request: Request) {
const event = await verifyWebhook({
body: await request.text(),
signature: request.headers.get("Domino-Signature") ?? "",
secret: process.env.DOMINO_WEBHOOK_SECRET!,
}).catch(() => null)
if (!event) {
return new Response("Invalid webhook", { status: 400 })
}
const result = await awardSolanaBadge({
management,
event,
mint: process.env.BADGE_MINT!,
authority,
rpc,
network: solanaDevnet,
quests: ["<quest ID>"], // from `domino quests list`; omit for every quest
whenNoWallet: "skip",
})
return Response.json({ status: result.status })
}Subscribe the route to completion.created. The result's status says what happened:
status | When | What was sent |
|---|---|---|
minted | The completion had no badge yet | One badge, and the receipt, which receipt holds |
already-minted | The completion already has a badge receipt, such as when the event is delivered again | Nothing; receipt is the stored one |
no-wallet | The member has no linked Solana wallet they proved: none, only unlinked ones, or only ones a member import added | Nothing. Linking a wallet later doesn't mint the badge, unless you mint owed badges |
deferred | The same, with whenNoWallet: "defer" | Nothing yet: awardOwedSolanaBadges mints it once the member links a wallet |
ignored | Any other event, a leaderboard prize, or a quest outside quests | Nothing |
When an earlier call's transaction for the completion may still land, the helper sends nothing and throws SolanaBadgePendingError. Let it reach your route, which answers 500, so Domino delivers the event again later.
A repeatable quest mints one badge per completion, so a wallet's balance counts its completions. Each member's first badge opens their token account, about 0.002 SOL of rent that the mint authority pays, plus the fee.
Each completion gets one badge, however often its event arrives. Domino waits 10 seconds for your route's answer and delivers the event again about 5 seconds after a timeout, so a slow mint is often still confirming when the next delivery arrives. The helper makes that safe:
- Before it sends, it records the signed transaction as the completion's
badge-attempt-1receipt, with the block height until which the transaction can land. Only one call can record that receipt; a call that finds another transaction there sends nothing. - It sends the transaction and waits for the
confirmedcommitment, then records thebadgereceipt. - A later delivery reads the attempt. It records the
badgereceipt when the transaction landed, for example after a failed receipt write. When the transaction failed, or can no longer land, it sends a new one asbadge-attempt-2. While the transaction can still land, it throwsSolanaBadgePendingError.
Each mint also carries an SPL Memo with the completion ID, domino-badge:<completion>, which explorers show.
Mint owed badges when a member links a wallet
Members often complete a quest before they link a wallet. To give them the badge anyway, pass whenNoWallet: "defer" to awardSolanaBadge, subscribe the same route to wallet.linked too, and hand that event to awardOwedSolanaBadges with the same badge settings:
import { createKeyPairSignerFromBytes, createSolanaRpc } from "@solana/kit"
import { createManagementClient, verifyWebhook } from "@domino-sdk/relay/server"
import {
awardOwedSolanaBadges,
awardSolanaBadge,
solanaDevnet,
type AwardOwedSolanaBadgesInput,
} from "@domino-sdk/relay/solana"
const badge = {
management: createManagementClient({
baseUrl: "https://relay.domino.run",
organization: "your-organization",
project: "your-project",
environment: "test",
getToken: async () => process.env.DOMINO_MANAGEMENT_KEY!, // points and read permission
}),
mint: process.env.BADGE_MINT!,
authority: await createKeyPairSignerFromBytes(
new Uint8Array(JSON.parse(process.env.BADGE_AUTHORITY_KEYPAIR!))
),
rpc: createSolanaRpc(process.env.SOLANA_RPC_URL!),
network: solanaDevnet,
quests: ["<quest ID>"],
} satisfies Omit<AwardOwedSolanaBadgesInput, "event">
export async function POST(request: Request) {
const event = await verifyWebhook({
body: await request.text(),
signature: request.headers.get("Domino-Signature") ?? "",
secret: process.env.DOMINO_WEBHOOK_SECRET!,
}).catch(() => null)
if (!event) {
return new Response("Invalid webhook", { status: 400 })
}
const result =
event.type === "wallet.linked"
? await awardOwedSolanaBadges({ ...badge, event })
: await awardSolanaBadge({ ...badge, event, whenNoWallet: "defer" })
return Response.json({ status: result.status })
}Domino sends wallet.linked when a member links a wallet they proved, by signing with it or signing in with it. A wallet a member import or an app login added sends nothing until the member proves it, and proving a wallet that is already linked sends nothing again. An operator's Relink in Console sends nothing either, so a badge deferred while the wallet was unlinked waits until the member links a wallet themselves.
For a Solana wallet, awardOwedSolanaBadges finds the member's completions of each quest in quests that count (revoked ones don't) and awards each one exactly as awardSolanaBadge does: a completion that already has its badge receipt mints nothing, so a member who completes two badge quests before linking gets both badges once, and a repeated delivery of the event mints nothing new. Its result is { status: "awarded", awards }, one entry per completion with what happened to it, or { status: "ignored" } for any other event or a wallet on another chain. It mints one completion at a time and throws on the first failure, such as SolanaBadgePendingError; let it reach your route, and Domino's next delivery picks up where it stopped.
Reward badge holders
Set Badge mint address on "Hold the badge" to your mint and publish it. The quest reads the badge like any token:
import { defineQuest, decision, manual, once, settings } from "@domino-sdk/relay/authoring"
const badgeMint = "<your badge mint>"
export default defineQuest({
key: "badge-holder",
title: "Hold the badge",
settings: settings.object({}),
trigger: manual(),
completion: once(),
rewards: [],
async evaluate(ctx) {
const held = await ctx.wallet.balance({
chain: "solana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1", // devnet; "solana" for mainnet
token: badgeMint,
})
return held && BigInt(held.total) >= 1n
? decision.accept()
: decision.reject({ reason: "Earn the badge first." })
},
})held is null for a member with no linked Solana wallet. The badge can't be transferred, so a wallet holds only the badges minted to it.
To move to mainnet, create a mint on mainnet, pass solanaMainnet and a mainnet RPC to awardSolanaBadge(), and set the quest's chain to solana.
Compressed NFT badges for large drops
Each member's first Token-2022 badge opens a token account, about 0.002 SOL of rent. For thousands of members, mint compressed NFTs (cNFTs, Metaplex Bubblegum v2) instead: you pay rent once for a Merkle tree, and then each badge costs only its transaction fee plus Bubblegum's 0.00009 SOL mint fee. The badges belong to a Core collection of yours, and quests check them with ctx.wallet.nfts().
-
Create the tree and the collection. Run this once, on devnet first. The key pair becomes the tree's delegate and the collection's update authority, so only it can mint badges, and it pays the rent:
import { readFile } from "node:fs/promises" import { createKeyPairSignerFromBytes, createSolanaRpc } from "@solana/kit" import { createSolanaBadgeTree } from "@domino-sdk/relay/solana" const authority = await createKeyPairSignerFromBytes( new Uint8Array(JSON.parse(await readFile("badge-authority.json", "utf8"))) ) const { tree, collection } = await createSolanaBadgeTree({ authority, rpc: createSolanaRpc("https://api.devnet.solana.com"), maxDepth: 14, // holds 2^14 = 16,384 badges maxBufferSize: 64, collection: { name: "Quest Badges", uri: "https://example.com/collection.json" }, }) console.log({ tree, collection })Before it sends anything, it prints the rent the tree, its config and the collection take, about 0.23 SOL for 16,384 badges. Pass
confirmRent: (rent) => booleanto check the amount yourself; answering false sends nothing and throws.maxDepthandmaxBufferSizemust be one of Bubblegum's supported pairs, such as 14 and 64; a tree holds 2^maxDepthbadges. One transaction creates all three accounts. -
Award the badge. In the webhook route from step 3, pass
badgeinstead ofmint:const result = await awardSolanaBadge({ management, event, badge: { kind: "cnft", tree: process.env.BADGE_TREE!, collection: process.env.BADGE_COLLECTION!, metadata: { name: "Quest Badge", symbol: "QUEST", uri: "https://example.com/badge.json" }, }, authority, rpc: createSolanaRpc(process.env.SOLANA_RPC_URL!), network: solanaDevnet, quests: ["<quest ID>"], whenNoWallet: "skip", })Everything else works as for a Token-2022 badge: one badge per completion however often the event arrives, the same results and
SolanaBadgePendingError, the memo with the completion ID, andawardOwedSolanaBadgeswith the samebadgefor members who link a wallet later. Thebadgereceipt's asset is the cNFT's asset ID, which explorers that read compressed NFTs show. -
Reward badge holders. Use the
nft-holdersnippet from Check NFT holdings, orctx.wallet.nfts()in your own quest, with the collection set tosolana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1/nft:<collection>on devnet (solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp/nft:<collection>on mainnet). Domino counts compressed NFTs in a Core collection through Helius's index, so a badge counts once Helius has indexed its mint.
The collection is frozen for good, so its badges are soulbound: Bubblegum refuses to transfer them, and to burn them. Pass collection: { ..., transferable: true } when members should be able to move or burn their badges.
Sign in with a wallet
A visitor signs in, or signs up, by signing a message with their wallet. A new address creates a new member; the same wallet later signs them in again. The wallet joins the member's list for the project as a sign-in wallet.
Enable wallet sign-in for the project
In Console, open Settings → Sign-in. Sign-in methods lists every sign-in method: the OAuth providers and email code Domino configures, read-only, then Wallet sign-in. Under Wallet sign-in, check the wallet families members can use: Solana, EVM or Cosmos SDK. Choose Save. Changing it needs publish permission, and each environment has its own setting. Cosmos SDK accepts a Cosmos wallet on any chain: your app names the chains it offers, and Console reminds you while Cosmos is checked.
Agents and scripts use the management API:
echo '{ "wallets": ["solana", "eip155", "cosmos"] }' > sign-in.json
domino api PUT /participant-sign-in sign-in.jsonUse only the three family codes shown above. Before upgrading to v1, replace any stored per-network Cosmos value such as cosmos:cosmoshub-4 with cosmos; v1 rejects per-network codes in this project setting.
Wallet sign-in is off until a project enables it. Wallet addresses cost nothing to create, so gate rewards with quests rather than counting sign-ups.
If your app signs members in with a wallet and the test environment has no wallet family enabled, domino stage and domino doctor --remote warn and print the command that enables one. The build still stages.
Offer the sign-in options
useSignInOptions() lists every way a member can sign in to the project from this browser, as one flat list: the configured OAuth providers, the installed wallets of the families the project enabled, and email. Each option has an id, a label ("Google", "Phantom", "Email"), a kind ("oauth", "wallet" or "email") and an icon hint. OAuth and wallet options sign in with start(); the email option sends a code with sendCode(email) and signs in with verifyCode(code). signInProviders lists the configured sign-in providers on their own, Telegram included, each signing in with start(): Telegram shows the buttons.
import { useState } from "react"
import { useSignInOptions } from "@domino-sdk/relay/react"
function SignIn() {
const signIn = useSignInOptions({ cosmos: [{ chainId: "cosmoshub-4" }] })
const [email, setEmail] = useState("")
const [code, setCode] = useState("")
if (!signIn.options) {
return <p>Loading…</p>
}
const hint = signIn.unavailable.find((entry) => entry.reason === "no-wallet-installed")
return (
<>
{signIn.options.map((option) =>
option.kind === "email" ? (
<form
key={option.id}
onSubmit={(event) => {
event.preventDefault()
void (signIn.codeSent ? option.verifyCode(code) : option.sendCode(email))
}}
>
{signIn.codeSent ? (
<input value={code} onChange={(event) => setCode(event.target.value)} />
) : (
<input type="email" value={email} onChange={(event) => setEmail(event.target.value)} />
)}
<button disabled={signIn.isPending}>{signIn.codeSent ? "Sign in" : "Email me a code"}</button>
</form>
) : (
<button key={option.id} disabled={signIn.isPending} onClick={() => void option.start()}>
Continue with {option.label}
</button>
)
)}
{hint && <p>{hint.message}</p>}
{signIn.error && <p role="alert">{signIn.error.message}</p>}
</>
)
}Cosmos wallets sign in on your app's chains: pass them as cosmos, each { chainId, chainInfo? } or "cosmos:<chain ID>", and Keplr, Leap or Cosmostation are listed once per chain. Without cosmos, the hook offers no Cosmos wallets even when the project enabled them.
unavailable says what the project enabled but this app or browser cannot offer:
reason | When | Who acts |
|---|---|---|
cosmos-chains-missing | The project takes Cosmos wallets and the app named no chains. | The developer: pass cosmos. |
cosmos-chains-invalid | The project takes Cosmos wallets and a chain in cosmos is invalid, such as "cosmoshub-4" without cosmos:. | The developer: message says what is wrong. Other methods still load. |
no-wallet-installed | The project takes wallets and none is installed. | The member: message names the wallet families to install. |
The starter apps build their sign-in on this hook, next to email and OAuth, and a project that enables only wallet sign-in can take members with them. Starters name no Cosmos chains: add yours to the useSignInOptions() call in src/components/sign-in.tsx. In development, a starter shows cosmos-chains-missing and cosmos-chains-invalid as a note; a production build never shows them to members.
When a member who signed in with an EVM wallet such as MetaMask or Rabby switches to another account in it, or locks it, the app signs them out and offers sign-in again. The page never keeps showing one account's points and quests while the wallet holds another, and the new account signs in only when the member chooses to. Picking the same account again changes nothing. Solana and Cosmos wallets are not followed this way.
Without React, signInOptions(relay, { cosmos }) from @domino-sdk/relay/browser returns the same { options, signInProviders, unavailable, methodsError? } once wallet discovery finishes, each option signing in with that client. Its actions reject when they fail, so catch them:
import { createBrowserRelayClient, signInOptions } from "@domino-sdk/relay/browser"
const relay = createBrowserRelayClient({ baseUrl: "/relay" })
const { options } = await signInOptions(relay)
const wallet = options.find((option) => option.kind === "wallet")
if (wallet?.kind === "wallet") {
await wallet.start().catch((error) => console.error(error.message))
}Apps with their own wallet UI can still pass a discovered wallet's signer to relay.auth.wallet.signIn(signer); relay.auth.providers().wallets lists the families this project enabled.
Handle refusals
| Error | Status | What to do |
|---|---|---|
| Wallet sign-in is not enabled for this project | 403 | Enable the wallet's family in Console, or hide that wallet. |
| This wallet is linked to an account but is not a sign-in method. Sign in with your original method. | 409 | The member linked this wallet while signed in. They sign in their original way. |
| Sign out before switching accounts | 409 | Sign out first. |
| Too many sign-in requests. Try again later. | 429 | Wait: every ten minutes, thirty per IP address (an IPv6 address counts by its /64), ten per wallet address from one IP address, and thirty per wallet address in the project. |
| The wallet signature does not match this challenge | 400 | Sign again with the same wallet and account. |
A challenge lasts five minutes and works once. signIn is not retried automatically: if it fails, start again.
Show a generated avatar
defaultAvatar(seed) draws a deterministic SVG avatar and returns a data URI. Seed it with the avatarSeed Domino returns for the signed-in member: Domino derives it from the member, so linking wallets does not change it, and it reveals no address.
import { defaultAvatar } from "@domino-sdk/relay/avatar"
import { useMe } from "@domino-sdk/relay/react"
function Avatar() {
const me = useMe()
return me.status === "ready" ? (
<img src={defaultAvatar(me.data.avatarSeed)} alt="" width={32} height={32} />
) : null
}Outside React, relay.me.get() returns { member, avatarSeed, email, emails, clock }. After wallet-only sign-in, email is null and emails is empty. Member profiles use the same seed for their generated avatars.
What operators see
A member's page in Console lists their linked wallets by chain family, with a Cosmos wallet's chain ID (such as Cosmos · cosmoshub-4), marked Sign-in wallet or Linked wallet. An account proved by transaction, such as a Squads vault, is also marked Proved by transaction and shows its Proof transaction signature to copy and look up in an explorer. A Solana wallet with a primary .sol name shows it before the address. Recent balance checks lists the balances quest verifications recorded for them: the amount, the token and chain, and a link to the attempt. These are saved observations, not live balances. Unlinked lists earlier wallets and who unlinked them. An operator with review permission on the project can, for a wallet in the project's list and with a reason the audit log records:
- Unlink a wallet. Unlinking does not stop a sign-in wallet from signing in. A wallet marked Imported or Vouched by that the member never signed in with or proved is released instead: it leaves the member, with nothing to relink, and its owner can link it.
- Relink an unlinked wallet. See restore a retained wallet link.
- Disable sign-in for a wallet, for example when its key leaks. It can no longer sign in to the project in that environment; sessions it already started end within 8 hours. Console warns when it is the member's only sign-in method.
- Enable sign-in for a wallet the member linked, when you are sure they control it.
Restore a retained wallet link
Under the member's Wallets, open Unlinked, choose Relink and record why its ownership is safe to restore. Review permission is required. The wallet must already belong to this member in this project and environment. Relink preserves the original proof and first-link time. It leaves wallet sign-in unchanged; use Enable sign-in or Disable sign-in separately.
Relinking also gives tracker activity that was skipped while the wallet was unlinked a fresh decision, under each quest's current history policy, and keeps attempts already admitted. See historical activity.
Send reminders from Klaviyo
Connect Klaviyo so it always knows each member's points, rewards and quests, then build a Klaviyo flow that reminds members about a reward they haven't picked up.
Build on Solana
Everything Domino does for a Solana app: start from the template or your own app, sign members in with their wallets, reward balances, NFTs and program calls, and move from devnet to mainnet.