@domino-sdk/relay 1.68.0 → 1.70.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 (78) hide show
  1. package/CHANGELOG.md +28 -0
  2. package/build.mjs +3 -0
  3. package/dist/{accounts-DnpKoJCo.d.ts → accounts-B49TGZLk.d.ts} +25 -5
  4. package/dist/{action-9Xl0StBg.d.ts → action-BDFKqGlH.d.ts} +3 -2
  5. package/dist/{attempt-captures-DMNFMYFb.d.ts → attempt-captures-Dn-oGE1o.d.ts} +4 -3
  6. package/dist/authoring.d.ts +218 -43
  7. package/dist/authoring.js +76 -18
  8. package/dist/{automatic-outcomes-CQ3vpiQl.d.ts → automatic-outcomes-DeRyox-X.d.ts} +11 -3
  9. package/dist/avatar.d.ts +2 -1
  10. package/dist/browser.d.ts +15 -14
  11. package/dist/browser.js +11 -11
  12. package/dist/{capability-error-CuI_F7yM.d.ts → capability-error-db7kO8-P.d.ts} +2 -1
  13. package/dist/{catalog-BLGie8Lh.d.ts → catalog-CR_2iacf.d.ts} +11 -3
  14. package/dist/{chunk-5AKD4ZF3.js → chunk-25WA4XYZ.js} +9 -3
  15. package/dist/{chunk-6UBFSMCM.js → chunk-2GVGZ7AN.js} +1 -1
  16. package/dist/{chunk-SD74HD75.js → chunk-3DUNFRKJ.js} +9 -9
  17. package/dist/{chunk-7YSVZA7A.js → chunk-4BBDHTBF.js} +1 -1
  18. package/dist/{chunk-6YTSRWRB.js → chunk-4VDRNYUG.js} +83 -11
  19. package/dist/{chunk-P4TPW4SY.js → chunk-5RLIPTL7.js} +1 -1
  20. package/dist/{chunk-MEUAJIVO.js → chunk-BJ2W5ZVQ.js} +2 -2
  21. package/dist/{chunk-KKHENO57.js → chunk-FHOKCBTJ.js} +2 -2
  22. package/dist/{chunk-DDJN2T5A.js → chunk-HICAGUT5.js} +1 -1
  23. package/dist/{chunk-VRZZB7CQ.js → chunk-LDO5GP7G.js} +1 -1
  24. package/dist/{chunk-TYZFVL73.js → chunk-NOQSKRSS.js} +4 -4
  25. package/dist/{chunk-75KF633N.js → chunk-OKKZPDCQ.js} +1 -1
  26. package/dist/{chunk-4JSPMFO2.js → chunk-RSZAYW3T.js} +2 -2
  27. package/dist/{chunk-HXTKI34N.js → chunk-RYUM6X2K.js} +1 -1
  28. package/dist/{chunk-EXZVWQOQ.js → chunk-SDWG7CWQ.js} +2 -2
  29. package/dist/{chunk-R3MNZKNJ.js → chunk-SELJYCYY.js} +1 -1
  30. package/dist/{chunk-DNPDR4Z7.js → chunk-UKUIE2ND.js} +6 -6
  31. package/dist/{chunk-IW46TW3A.js → chunk-VNEJH4NT.js} +26 -2
  32. package/dist/{chunk-55WJVFWC.js → chunk-XD6EUA27.js} +2 -2
  33. package/dist/{chunk-CZ7NQ7W7.js → chunk-XZCTCSDG.js} +3 -3
  34. package/dist/{client-BMif22WQ.d.ts → client-gJEheT2C.d.ts} +33 -11
  35. package/dist/{dashboards-DMk-vL1q.d.ts → dashboards-DZaB94sz.d.ts} +6 -5
  36. package/dist/{deployments-BCr418BX.d.ts → deployments-QVGxC-fT.d.ts} +530 -337
  37. package/dist/{host-environment-FN4zg3hw.d.ts → host-environment-DUw5-Cvj.d.ts} +2 -1
  38. package/dist/{identity-integration-r76xaAax.d.ts → identity-integration-BAJdzbdl.d.ts} +3 -2
  39. package/dist/index.d.ts +16 -15
  40. package/dist/index.js +10 -10
  41. package/dist/internal.d.ts +34 -19
  42. package/dist/internal.js +40 -14
  43. package/dist/{limits-ByVRQePO.d.ts → limits-UawUbr0S.d.ts} +3 -2
  44. package/dist/{offers-xcPbYaEv.d.ts → offers-0hqbnogq.d.ts} +4 -3
  45. package/dist/{participant-activity-DXRq4s6K.d.ts → participant-activity-BznrcePT.d.ts} +2 -1
  46. package/dist/{participant-rewards-BcWkBRn_.d.ts → participant-rewards-s5Gn23qb.d.ts} +23 -1
  47. package/dist/portal-proxy.d.ts +7 -4
  48. package/dist/portal-proxy.js +14 -17
  49. package/dist/profiles-CLDKZVFx.d.ts +370 -0
  50. package/dist/react/index.d.ts +50 -31
  51. package/dist/react/index.js +12 -11
  52. package/dist/{request-error-D_dUPLwo.d.ts → request-error-C24SY7n9.d.ts} +2 -1
  53. package/dist/{reward-deliveries-0VvT6LMj.d.ts → reward-deliveries-ARvt1UXb.d.ts} +3 -2
  54. package/dist/runtime/authoring.js +1 -1
  55. package/dist/runtime/chunks/447P2VLY.js +1 -0
  56. package/dist/runtime/manifest.json +3 -3
  57. package/dist/runtime/schema.js +1 -1
  58. package/dist/schema.d.ts +258 -176
  59. package/dist/schema.js +18 -8
  60. package/dist/server/index.d.ts +15 -14
  61. package/dist/server/index.js +47 -48
  62. package/dist/{sign-in-providers-C5_753DZ.d.ts → sign-in-providers-DCiufSGG.d.ts} +4 -3
  63. package/dist/solana.d.ts +142 -26
  64. package/dist/solana.js +449 -114
  65. package/dist/{streaks-0YuipsUQ.d.ts → streaks-MAqKHbHC.d.ts} +2 -1
  66. package/dist/{submission-input-CaL8drIh.d.ts → submission-input-C0DLv5Dj.d.ts} +4 -3
  67. package/dist/{telegram-browser-DLtHPRBI.d.ts → telegram-browser-yx9WuNLX.d.ts} +8 -7
  68. package/dist/telegram.d.ts +14 -12
  69. package/dist/telegram.js +2 -2
  70. package/dist/testing.d.ts +24 -15
  71. package/dist/testing.js +6 -6
  72. package/dist/{tracker-data-CAK942sx.d.ts → tracker-data-CUopgomU.d.ts} +198 -3
  73. package/dist/{transport-CkidqTOk.d.ts → transport-e0uY1R7z.d.ts} +3415 -2233
  74. package/dist/vite.d.ts +2 -1
  75. package/dist/{wallet-DQtJelQQ.d.ts → wallet-CJTULM0Q.d.ts} +54 -375
  76. package/dist/{wallet-browser-dpmr22Xv.d.ts → wallet-browser-DScvrvIj.d.ts} +3 -2
  77. package/package.json +6 -3
  78. package/dist/runtime/chunks/2UDZ6TPL.js +0 -1
package/dist/solana.d.ts CHANGED
@@ -1,26 +1,115 @@
1
- import { TransactionSigner, Rpc, GetAccountInfoApi, GetBlockHeightApi, GetLatestBlockhashApi, GetMinimumBalanceForRentExemptionApi, GetSignatureStatusesApi, SendTransactionApi, KeyPairSigner, Address, Signature } from '@solana/kit';
2
- import { S as SolanaNetwork } from './wallet-DQtJelQQ.js';
3
- export { s as solanaDevnet, t as solanaMainnet } from './wallet-DQtJelQQ.js';
4
- import { M as ManagementClient, W as WebhookEvent, C as CompletionReceipt } from './transport-CkidqTOk.js';
1
+ import { Rpc, GetAccountInfoApi, GetBlockHeightApi, GetLatestBlockhashApi, GetMinimumBalanceForRentExemptionApi, GetSignatureStatusesApi, SendTransactionApi, GetTransactionApi, TransactionSigner, KeyPairSigner, Address, Signature } from '@solana/kit';
2
+ import { l as SolanaNetwork } from './wallet-CJTULM0Q.js';
3
+ export { s as solanaDevnet, m as solanaMainnet } from './wallet-CJTULM0Q.js';
4
+ import { ManagementClient, WebhookEvent, CompletionReceipt } from './server/index.js';
5
5
  import 'zod';
6
- import './accounts-DnpKoJCo.js';
7
- import './tracker-data-CAK942sx.js';
8
- import './identity-integration-r76xaAax.js';
9
- import './reward-deliveries-0VvT6LMj.js';
10
- import './request-error-D_dUPLwo.js';
11
- import './action-9Xl0StBg.js';
12
- import './limits-ByVRQePO.js';
13
- import './automatic-outcomes-CQ3vpiQl.js';
14
- import './deployments-BCr418BX.js';
15
- import './offers-xcPbYaEv.js';
16
- import './catalog-BLGie8Lh.js';
17
- import './attempt-captures-DMNFMYFb.js';
6
+ import './accounts-B49TGZLk.js';
7
+ import './tracker-data-CUopgomU.js';
8
+ import './identity-integration-BAJdzbdl.js';
9
+ import './reward-deliveries-ARvt1UXb.js';
10
+ import './request-error-C24SY7n9.js';
11
+ import './action-BDFKqGlH.js';
12
+ import './limits-UawUbr0S.js';
13
+ import './automatic-outcomes-DeRyox-X.js';
14
+ import './profiles-CLDKZVFx.js';
15
+ import './deployments-QVGxC-fT.js';
16
+ import './offers-0hqbnogq.js';
17
+ import './catalog-CR_2iacf.js';
18
+ import './attempt-captures-Dn-oGE1o.js';
18
19
 
19
20
  /**
20
21
  * The RPC methods the badge helpers call. `createSolanaRpc(url)` from `@solana/kit` answers all of
21
22
  * them.
22
23
  */
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
+
24
113
  /** The receipt key `awardSolanaBadge` records a badge under. */
25
114
  declare const solanaBadgeReceiptKey = "badge";
26
115
  /**
@@ -45,8 +134,31 @@ type SolanaBadgeAward = {
45
134
  } | {
46
135
  status: "ignored";
47
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
+ };
48
160
  /** @experimental A minor release can change the Solana badge helpers. */
49
- type AwardSolanaBadgeInput = {
161
+ type SolanaBadgeOptions = {
50
162
  /**
51
163
  * A management client with `points` and `read` permission: it reads the member's wallets and
52
164
  * completions and records the receipt.
@@ -54,9 +166,10 @@ type AwardSolanaBadgeInput = {
54
166
  management: Pick<ManagementClient, "completions" | "members">;
55
167
  /** A delivery `verifyWebhook` verified. Events other than a quest's `completion.created` are ignored. */
56
168
  event: WebhookEvent;
57
- /** The badge's Token-2022 mint, as `createSolanaBadgeMint` created it. */
58
- mint: string;
59
- /** The mint authority. It signs the mint and pays the fee and the member's token account rent. */
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
+ */
60
173
  authority: TransactionSigner;
61
174
  rpc: SolanaBadgeRpc;
62
175
  /** The cluster `rpc` serves, recorded on the receipt: `solanaMainnet` or `solanaDevnet`. */
@@ -73,10 +186,12 @@ type AwardSolanaBadgeInput = {
73
186
  label?: string;
74
187
  };
75
188
  /**
76
- * Mints one unit of a non-transferable Token-2022 badge to the member's most recently linked
77
- * proven Solana wallet for a quest's `completion.created` event, and records the transaction as
78
- * the completion's `badge` receipt. Call it from your webhook handler; your server holds the mint
79
- * authority and pays the fees.
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.
80
195
  *
81
196
  * Exactly once per completion, whatever the deliveries and retries. Before sending, it records the
82
197
  * signed transaction as a `badge-attempt-<n>` receipt, which only one call can record, and only
@@ -113,7 +228,7 @@ type OwedSolanaBadges = {
113
228
  *
114
229
  * @experimental A minor release can change the Solana badge helpers.
115
230
  */
116
- type AwardOwedSolanaBadgesInput = Omit<AwardSolanaBadgeInput, "whenNoWallet">;
231
+ type AwardOwedSolanaBadgesInput = Omit<SolanaBadgeOptions, "whenNoWallet"> & SolanaBadgeKind;
117
232
  /**
118
233
  * Mints the badges a member is owed once they link a Solana wallet: call it from your webhook
119
234
  * handler for `wallet.linked`, next to `awardSolanaBadge` with `whenNoWallet: "defer"` for
@@ -168,4 +283,5 @@ declare function createSolanaBadgeMint(input: CreateSolanaBadgeMintInput): Promi
168
283
  /** The SPL Memo `awardSolanaBadge` attaches to a completion's mint. */
169
284
  declare const solanaBadgeMemo: (completion: string) => string;
170
285
 
171
- export { type AwardOwedSolanaBadgesInput, type AwardSolanaBadgeInput, type CreateSolanaBadgeMintInput, type OwedSolanaBadges, type SolanaBadgeAward, SolanaBadgePendingError, type SolanaBadgeRpc, SolanaNetwork, awardOwedSolanaBadges, awardSolanaBadge, createSolanaBadgeMint, solanaBadgeMemo, solanaBadgeReceiptKey };
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 };