@domino-sdk/relay 1.67.0 → 1.69.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (81) hide show
  1. package/CHANGELOG.md +65 -0
  2. package/dist/{accounts-C2O8mpB8.d.ts → accounts-DD4gAOCe.d.ts} +232 -3
  3. package/dist/{action-9Xl0StBg.d.ts → action-BDFKqGlH.d.ts} +3 -2
  4. package/dist/{attempt-captures-ClHAoo_n.d.ts → attempt-captures-CbuCmthd.d.ts} +11 -2
  5. package/dist/authoring.d.ts +534 -48
  6. package/dist/authoring.js +192 -29
  7. package/dist/{automatic-outcomes-BEnPn4Uh.d.ts → automatic-outcomes-DE3vfi8g.d.ts} +11 -3
  8. package/dist/avatar.d.ts +2 -1
  9. package/dist/browser.d.ts +15 -13
  10. package/dist/browser.js +12 -13
  11. package/dist/{capability-error-CuI_F7yM.d.ts → capability-error-db7kO8-P.d.ts} +2 -1
  12. package/dist/{catalog-CbiftcxQ.d.ts → catalog-Cf3fHDNn.d.ts} +69 -3
  13. package/dist/{chunk-5DZNMLDM.js → chunk-2A3BJ262.js} +2 -2
  14. package/dist/{chunk-BQXRCJ3N.js → chunk-5RLIPTL7.js} +1 -1
  15. package/dist/{chunk-MVQQDPQX.js → chunk-AZDZEQFK.js} +14 -2
  16. package/dist/{chunk-JK3XV2CR.js → chunk-BRROI4CH.js} +50 -8
  17. package/dist/{chunk-P33ZAJMS.js → chunk-CQVKOD3B.js} +1266 -677
  18. package/dist/{chunk-QYC3CZVD.js → chunk-CZ23KRVK.js} +2 -2
  19. package/dist/{chunk-X3FMVRMM.js → chunk-DIXYVGXO.js} +1 -1
  20. package/dist/{chunk-RDUSFUXX.js → chunk-GEVARKEV.js} +9 -1
  21. package/dist/{chunk-2HHZV7U3.js → chunk-LDO5GP7G.js} +1 -1
  22. package/dist/{chunk-Z2Z5DBNW.js → chunk-LGGD7S5T.js} +45 -9
  23. package/dist/{chunk-U66GUVSG.js → chunk-LZXDYSUH.js} +2 -0
  24. package/dist/{chunk-NRMQVK2W.js → chunk-ME2KUAVJ.js} +1 -1
  25. package/dist/{chunk-KUNPCDN6.js → chunk-ODJGTFPY.js} +16 -9
  26. package/dist/{chunk-DSJ46QLB.js → chunk-PO2ZDY27.js} +1 -1
  27. package/dist/{chunk-RWR2LOPA.js → chunk-RKTMSTT7.js} +2 -2
  28. package/dist/{chunk-5SBA6X5X.js → chunk-SWLW4VN3.js} +2 -2
  29. package/dist/{chunk-BMJHFWVT.js → chunk-TCREFRPK.js} +10 -43
  30. package/dist/{chunk-Q5QVAF7R.js → chunk-UGM6DUB2.js} +42 -25
  31. package/dist/chunk-VAGGGB6B.js +87 -0
  32. package/dist/{chunk-FGXLXENM.js → chunk-VNEJH4NT.js} +47 -3
  33. package/dist/chunk-WNEQEDMU.js +427 -0
  34. package/dist/{chunk-Q6KTTVOI.js → chunk-WVK3G2J2.js} +1 -1
  35. package/dist/{client-CZPewB9h.d.ts → client-6eSYOl8h.d.ts} +159 -11
  36. package/dist/{dashboards-jGPM3AxF.d.ts → dashboards-DCOAXL54.d.ts} +6 -5
  37. package/dist/{deployments-BVFd7ddA.d.ts → deployments-BIfdCMd5.d.ts} +911 -309
  38. package/dist/{host-environment-FN4zg3hw.d.ts → host-environment-DUw5-Cvj.d.ts} +2 -1
  39. package/dist/{identity-integration-W1Vo3Ql9.d.ts → identity-integration-BlfOn8rc.d.ts} +3 -2
  40. package/dist/index.d.ts +16 -15
  41. package/dist/index.js +10 -10
  42. package/dist/internal.d.ts +155 -17
  43. package/dist/internal.js +266 -19
  44. package/dist/{limits-C4RzrOV4.d.ts → limits-Ctaeq23J.d.ts} +8 -2
  45. package/dist/{offers-BpYenB9i.d.ts → offers-COqHGbHm.d.ts} +4 -3
  46. package/dist/{participant-activity-DXRq4s6K.d.ts → participant-activity-BznrcePT.d.ts} +2 -1
  47. package/dist/{participant-rewards-BcWkBRn_.d.ts → participant-rewards-s5Gn23qb.d.ts} +23 -1
  48. package/dist/portal-proxy.d.ts +7 -4
  49. package/dist/portal-proxy.js +14 -18
  50. package/dist/profiles-CLDKZVFx.d.ts +370 -0
  51. package/dist/react/index.d.ts +71 -30
  52. package/dist/react/index.js +12 -13
  53. package/dist/{request-error-D_dUPLwo.d.ts → request-error-C24SY7n9.d.ts} +2 -1
  54. package/dist/{reward-deliveries-BOWpMytr.d.ts → reward-deliveries-DFhYGJdx.d.ts} +3 -2
  55. package/dist/runtime/authoring.js +1 -1
  56. package/dist/runtime/chunks/HKAI5OQA.js +1 -0
  57. package/dist/runtime/manifest.json +3 -3
  58. package/dist/runtime/schema.js +1 -1
  59. package/dist/schema.d.ts +556 -180
  60. package/dist/schema.js +70 -8
  61. package/dist/server/index.d.ts +15 -14
  62. package/dist/server/index.js +2053 -893
  63. package/dist/{sign-in-providers-BRYVOSlG.d.ts → sign-in-providers-C97mRNbG.d.ts} +4 -3
  64. package/dist/solana.d.ts +287 -0
  65. package/dist/solana.js +699 -0
  66. package/dist/{streaks-0YuipsUQ.d.ts → streaks-MAqKHbHC.d.ts} +2 -1
  67. package/dist/{submission-input-C152xIdn.d.ts → submission-input-BD7nORuh.d.ts} +4 -3
  68. package/dist/{telegram-browser-657QqiQl.d.ts → telegram-browser-gRMgGs7B.d.ts} +8 -109
  69. package/dist/telegram.d.ts +14 -12
  70. package/dist/telegram.js +2 -2
  71. package/dist/testing.d.ts +99 -18
  72. package/dist/testing.js +101 -11
  73. package/dist/{tracker-data-BqY-9Vu-.d.ts → tracker-data-DQgX3FIc.d.ts} +493 -1
  74. package/dist/{transport-CthYgZXK.d.ts → transport-BLU8jrhg.d.ts} +7340 -2134
  75. package/dist/vite.d.ts +2 -1
  76. package/dist/{wallet-Btng186v.d.ts → wallet-CPAjrW4k.d.ts} +339 -308
  77. package/dist/wallet-browser-BzPt_Qb5.d.ts +107 -0
  78. package/package.json +21 -3
  79. package/dist/chunk-UWUS4OOV.js +0 -59
  80. package/dist/chunk-UYVJZR33.js +0 -34
  81. package/dist/runtime/chunks/C2MGLQXC.js +0 -1
@@ -1,6 +1,6 @@
1
- import { J as SignInProvider } from './accounts-C2O8mpB8.js';
1
+ import { J as SignInProvider } from './accounts-DD4gAOCe.js';
2
2
  import * as z from 'zod';
3
- import { a as TelegramSignInMethods } from './submission-input-C152xIdn.js';
3
+ import { a as TelegramSignInMethods } from './submission-input-BD7nORuh.js';
4
4
 
5
5
  /**
6
6
  * `GET /v1/auth/providers`, as `relay.auth.providers()` reads it. Exported as a schema only, for the
@@ -41,4 +41,5 @@ type AuthProviders = Omit<z.infer<typeof authProvidersSchema>, "telegram"> & {
41
41
  telegram?: TelegramSignInMethods;
42
42
  };
43
43
 
44
- export { type AuthProviders as A, authProvidersSchema as a };
44
+ export { authProvidersSchema as a };
45
+ export type { AuthProviders as A };
@@ -0,0 +1,287 @@
1
+ import { Rpc, GetAccountInfoApi, GetBlockHeightApi, GetLatestBlockhashApi, GetMinimumBalanceForRentExemptionApi, GetSignatureStatusesApi, SendTransactionApi, GetTransactionApi, TransactionSigner, KeyPairSigner, Address, Signature } from '@solana/kit';
2
+ import { l as SolanaNetwork } from './wallet-CPAjrW4k.js';
3
+ export { s as solanaDevnet, m as solanaMainnet } from './wallet-CPAjrW4k.js';
4
+ import { ManagementClient, WebhookEvent, CompletionReceipt } from './server/index.js';
5
+ import 'zod';
6
+ import './accounts-DD4gAOCe.js';
7
+ import './tracker-data-DQgX3FIc.js';
8
+ import './identity-integration-BlfOn8rc.js';
9
+ import './reward-deliveries-DFhYGJdx.js';
10
+ import './request-error-C24SY7n9.js';
11
+ import './action-BDFKqGlH.js';
12
+ import './limits-Ctaeq23J.js';
13
+ import './automatic-outcomes-DE3vfi8g.js';
14
+ import './profiles-CLDKZVFx.js';
15
+ import './deployments-BIfdCMd5.js';
16
+ import './offers-COqHGbHm.js';
17
+ import './catalog-Cf3fHDNn.js';
18
+ import './attempt-captures-CbuCmthd.js';
19
+
20
+ /**
21
+ * The RPC methods the badge helpers call. `createSolanaRpc(url)` from `@solana/kit` answers all of
22
+ * them.
23
+ */
24
+ type SolanaBadgeRpc = Rpc<GetAccountInfoApi & GetBlockHeightApi & GetLatestBlockhashApi & GetMinimumBalanceForRentExemptionApi & GetSignatureStatusesApi & SendTransactionApi>;
25
+
26
+ /**
27
+ * The RPC methods a compressed badge needs: `SolanaBadgeRpc`'s, and `getTransaction`, which reads
28
+ * the asset ID a mint created. `createSolanaRpc(url)` from `@solana/kit` answers all of them.
29
+ *
30
+ * @experimental A minor release can change the Solana badge helpers.
31
+ */
32
+ type SolanaCompressedBadgeRpc = SolanaBadgeRpc & Rpc<GetTransactionApi>;
33
+ /**
34
+ * A compressed NFT badge: each completion mints one cNFT into `tree`, in the Core `collection`,
35
+ * as `createSolanaBadgeTree` created them. `metadata` is each badge's on-chain name, symbol and
36
+ * metadata JSON URI.
37
+ *
38
+ * @experimental A minor release can change the Solana badge helpers.
39
+ */
40
+ type SolanaCompressedBadge = {
41
+ kind: "cnft";
42
+ tree: string;
43
+ collection: string;
44
+ metadata: {
45
+ name: string;
46
+ symbol?: string;
47
+ uri: string;
48
+ };
49
+ };
50
+ /** @experimental A minor release can change the Solana badge helpers. */
51
+ type CreateSolanaBadgeTreeInput = {
52
+ /**
53
+ * Becomes the tree's creator and delegate and the collection's update authority, so it alone
54
+ * can mint badges, and pays the rent.
55
+ */
56
+ authority: TransactionSigner;
57
+ rpc: SolanaBadgeRpc;
58
+ /**
59
+ * The tree's depth and change-log buffer: it holds 2^maxDepth badges, and `maxBufferSize` mints
60
+ * can land in the same block. One of Bubblegum's supported pairs, such as 14 and 64 (16,384
61
+ * badges).
62
+ */
63
+ maxDepth: number;
64
+ maxBufferSize: number;
65
+ /** The Core collection the badges belong to, which quests gate on with `ctx.wallet.nfts()`. */
66
+ collection: {
67
+ name: string;
68
+ uri: string;
69
+ /**
70
+ * Let members move and burn their badges. Omitted or false, the collection is permanently
71
+ * frozen, so its cNFTs can never be transferred or burned (soulbound).
72
+ */
73
+ transferable?: boolean;
74
+ };
75
+ /**
76
+ * Called with what the new accounts cost before anything is sent; answering false sends nothing
77
+ * and throws. Omit to print the rent with `console.info` and go ahead.
78
+ */
79
+ confirmRent?: (rent: SolanaBadgeTreeRent) => boolean | Promise<boolean>;
80
+ /** The new tree's and collection's key pairs. Omit to generate them. */
81
+ tree?: KeyPairSigner;
82
+ collectionKey?: KeyPairSigner;
83
+ };
84
+ /**
85
+ * What `createSolanaBadgeTree` pays: rent-exempt lamports for the tree, its config and the
86
+ * collection, and how many badges the tree holds. Rent comes back only if the accounts are closed.
87
+ *
88
+ * @experimental A minor release can change the Solana badge helpers.
89
+ */
90
+ type SolanaBadgeTreeRent = {
91
+ lamports: bigint;
92
+ /** `lamports` in SOL, as a decimal string. */
93
+ sol: string;
94
+ capacity: number;
95
+ treeBytes: number;
96
+ };
97
+ /**
98
+ * Creates a Bubblegum v2 Merkle tree and a Core collection for compressed badges
99
+ * (`awardSolanaBadge` with `badge: { kind: "cnft", tree, collection, metadata }`), in one
100
+ * transaction, after stating the rent it costs. The collection has the `BubblegumV2` plugin, and
101
+ * unless `collection.transferable`, a `PermanentFreezeDelegate` that freezes it with no authority
102
+ * to thaw it, so its badges are soulbound. The tree is private: only `authority` mints into it.
103
+ * Run it once, for example from a setup script, and keep both addresses.
104
+ *
105
+ * @experimental A minor release can change the Solana badge helpers.
106
+ */
107
+ declare function createSolanaBadgeTree(input: CreateSolanaBadgeTreeInput): Promise<{
108
+ tree: Address;
109
+ collection: Address;
110
+ signature: Signature;
111
+ }>;
112
+
113
+ /** The receipt key `awardSolanaBadge` records a badge under. */
114
+ declare const solanaBadgeReceiptKey = "badge";
115
+ /**
116
+ * What `awardSolanaBadge` did. `minted` and `already-minted` carry the completion's badge
117
+ * receipt; `no-wallet` means the member has no proven Solana wallet, and nothing was sent;
118
+ * `deferred` is `no-wallet` under `whenNoWallet: "defer"`, so `awardOwedSolanaBadges` mints the
119
+ * badge once the member links one; `ignored` means the event is not a quest completion, or its
120
+ * quest is outside `quests`.
121
+ *
122
+ * @experimental A minor release can change the Solana badge helpers.
123
+ */
124
+ type SolanaBadgeAward = {
125
+ status: "minted";
126
+ receipt: CompletionReceipt;
127
+ } | {
128
+ status: "already-minted";
129
+ receipt: CompletionReceipt;
130
+ } | {
131
+ status: "no-wallet";
132
+ } | {
133
+ status: "deferred";
134
+ } | {
135
+ status: "ignored";
136
+ };
137
+ /**
138
+ * `awardSolanaBadge`'s input: the badge (a Token-2022 `mint`, or a compressed `badge`), its
139
+ * authority and RPC, and which completions to award.
140
+ *
141
+ * @experimental A minor release can change the Solana badge helpers.
142
+ */
143
+ type AwardSolanaBadgeInput = SolanaBadgeOptions & SolanaBadgeKind;
144
+ /**
145
+ * The badge `awardSolanaBadge` mints: one unit of a Token-2022 `mint`, or a compressed NFT
146
+ * (`badge`, whose `rpc` also answers `getTransaction`).
147
+ *
148
+ * @experimental A minor release can change the Solana badge helpers.
149
+ */
150
+ type SolanaBadgeKind = {
151
+ /** The badge's Token-2022 mint, as `createSolanaBadgeMint` created it. */
152
+ mint: string;
153
+ badge?: never;
154
+ } | {
155
+ /** A compressed NFT badge in the tree and collection `createSolanaBadgeTree` created. */
156
+ badge: SolanaCompressedBadge;
157
+ mint?: never;
158
+ rpc: SolanaCompressedBadgeRpc;
159
+ };
160
+ /** @experimental A minor release can change the Solana badge helpers. */
161
+ type SolanaBadgeOptions = {
162
+ /**
163
+ * A management client with `points` and `read` permission: it reads the member's wallets and
164
+ * completions and records the receipt.
165
+ */
166
+ management: Pick<ManagementClient, "completions" | "members">;
167
+ /** A delivery `verifyWebhook` verified. Events other than a quest's `completion.created` are ignored. */
168
+ event: WebhookEvent;
169
+ /**
170
+ * The mint authority, or for a compressed badge the tree's delegate and the collection's update
171
+ * authority. It signs the mint and pays the fees and any rent.
172
+ */
173
+ authority: TransactionSigner;
174
+ rpc: SolanaBadgeRpc;
175
+ /** The cluster `rpc` serves, recorded on the receipt: `solanaMainnet` or `solanaDevnet`. */
176
+ network: SolanaNetwork;
177
+ /** Award only completions of these quest IDs. Omit to award every quest's completions. */
178
+ quests?: readonly string[];
179
+ /**
180
+ * What happens when the member has no proven Solana wallet. Both send nothing: `skip` (the
181
+ * default) answers `no-wallet`, and `defer` answers `deferred`, for a server that also calls
182
+ * `awardOwedSolanaBadges` on `wallet.linked` to mint the badge once the member links a wallet.
183
+ */
184
+ whenNoWallet?: "skip" | "defer";
185
+ /** Receipt `label` Console shows beside it. */
186
+ label?: string;
187
+ };
188
+ /**
189
+ * Mints a badge to the member's most recently linked proven Solana wallet for a quest's
190
+ * `completion.created` event, and records the transaction as the completion's `badge` receipt:
191
+ * one unit of a non-transferable Token-2022 `mint` (receipt `asset`: the mint), or with
192
+ * `badge: { kind: "cnft", tree, collection, metadata }` one compressed NFT, minted with Bubblegum
193
+ * v2's `mint_v2` into the tree and collection (receipt `asset`: the cNFT's asset ID). Call it from
194
+ * your webhook handler; your server holds the authority and pays the fees.
195
+ *
196
+ * Exactly once per completion, whatever the deliveries and retries. Before sending, it records the
197
+ * signed transaction as a `badge-attempt-<n>` receipt, which only one call can record, and only
198
+ * then sends it. A call that finds an earlier attempt records it as the badge once it landed,
199
+ * sends a new attempt once it failed or its blockhash expired, and otherwise throws
200
+ * `SolanaBadgePendingError` without sending, so the delivery is retried later. It waits for the
201
+ * `confirmed` commitment.
202
+ *
203
+ * Requires the optional peer dependencies `@solana/kit` and `@solana-program/token-2022`.
204
+ *
205
+ * @experimental A minor release can change the Solana badge helpers.
206
+ */
207
+ declare function awardSolanaBadge(input: AwardSolanaBadgeInput): Promise<SolanaBadgeAward>;
208
+ /**
209
+ * What `awardOwedSolanaBadges` did: `awarded` with each owed completion and what
210
+ * `awardSolanaBadge` did for it (`minted`, `already-minted`, or `no-wallet` when the member has
211
+ * unlinked the wallet since), or `ignored` when the event is not a Solana `wallet.linked`.
212
+ *
213
+ * @experimental A minor release can change the Solana badge helpers.
214
+ */
215
+ type OwedSolanaBadges = {
216
+ status: "awarded";
217
+ awards: {
218
+ completion: string;
219
+ quest: string;
220
+ award: SolanaBadgeAward;
221
+ }[];
222
+ } | {
223
+ status: "ignored";
224
+ };
225
+ /**
226
+ * `awardSolanaBadge`'s input for a `wallet.linked` event: the same badge, mint authority and
227
+ * `quests`.
228
+ *
229
+ * @experimental A minor release can change the Solana badge helpers.
230
+ */
231
+ type AwardOwedSolanaBadgesInput = Omit<SolanaBadgeOptions, "whenNoWallet"> & SolanaBadgeKind;
232
+ /**
233
+ * Mints the badges a member is owed once they link a Solana wallet: call it from your webhook
234
+ * handler for `wallet.linked`, next to `awardSolanaBadge` with `whenNoWallet: "defer"` for
235
+ * `completion.created`. For a Solana wallet, it lists the member's completions that count (not
236
+ * revoked) of each quest in `quests` (every quest when omitted) and awards each one exactly as
237
+ * `awardSolanaBadge` does, so a completion that has its `badge` receipt mints nothing and a
238
+ * redelivered event mints nothing new. Other events and chains are `ignored`.
239
+ *
240
+ * It mints one completion at a time and throws on the first failure, such as
241
+ * `SolanaBadgePendingError`: fail the delivery so Domino retries it, and the retry skips the badges
242
+ * already minted.
243
+ *
244
+ * @experimental A minor release can change the Solana badge helpers.
245
+ */
246
+ declare function awardOwedSolanaBadges(input: AwardOwedSolanaBadgesInput): Promise<OwedSolanaBadges>;
247
+ /**
248
+ * An earlier call's badge transaction for this completion has not landed yet, and its blockhash
249
+ * is still valid. Nothing was sent; call again later, for example by failing the webhook delivery
250
+ * so Domino retries it.
251
+ *
252
+ * @experimental A minor release can change the Solana badge helpers.
253
+ */
254
+ declare class SolanaBadgePendingError extends Error {
255
+ readonly signature: string;
256
+ readonly code = "badge-pending";
257
+ constructor(signature: string);
258
+ }
259
+ /** @experimental A minor release can change the Solana badge helpers. */
260
+ type CreateSolanaBadgeMintInput = {
261
+ /** Becomes the mint and metadata authority, and pays for the mint account. */
262
+ authority: TransactionSigner;
263
+ rpc: SolanaBadgeRpc;
264
+ /** The badge's on-chain name, symbol and metadata JSON URI, which wallets and explorers show. */
265
+ name: string;
266
+ symbol: string;
267
+ uri: string;
268
+ /** The new mint's key pair. Omit to generate one. */
269
+ mint?: KeyPairSigner;
270
+ };
271
+ /**
272
+ * Creates a badge mint for `awardSolanaBadge`: a Token-2022 mint with 0 decimals, the
273
+ * NonTransferable extension, so its tokens can't move from the wallet they were minted to, and
274
+ * on-mint metadata (the metadata pointer and token metadata extensions). Run it once per badge,
275
+ * for example from a setup script, and keep the mint address.
276
+ *
277
+ * @experimental A minor release can change the Solana badge helpers.
278
+ */
279
+ declare function createSolanaBadgeMint(input: CreateSolanaBadgeMintInput): Promise<{
280
+ mint: Address;
281
+ signature: Signature;
282
+ }>;
283
+ /** The SPL Memo `awardSolanaBadge` attaches to a completion's mint. */
284
+ declare const solanaBadgeMemo: (completion: string) => string;
285
+
286
+ export { SolanaBadgePendingError, SolanaNetwork, awardOwedSolanaBadges, awardSolanaBadge, createSolanaBadgeMint, createSolanaBadgeTree, solanaBadgeMemo, solanaBadgeReceiptKey };
287
+ export type { AwardOwedSolanaBadgesInput, AwardSolanaBadgeInput, CreateSolanaBadgeMintInput, CreateSolanaBadgeTreeInput, OwedSolanaBadges, SolanaBadgeAward, SolanaBadgeKind, SolanaBadgeOptions, SolanaBadgeRpc, SolanaBadgeTreeRent, SolanaCompressedBadge, SolanaCompressedBadgeRpc };