@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.
- package/CHANGELOG.md +65 -0
- package/dist/{accounts-C2O8mpB8.d.ts → accounts-DD4gAOCe.d.ts} +232 -3
- package/dist/{action-9Xl0StBg.d.ts → action-BDFKqGlH.d.ts} +3 -2
- package/dist/{attempt-captures-ClHAoo_n.d.ts → attempt-captures-CbuCmthd.d.ts} +11 -2
- package/dist/authoring.d.ts +534 -48
- package/dist/authoring.js +192 -29
- package/dist/{automatic-outcomes-BEnPn4Uh.d.ts → automatic-outcomes-DE3vfi8g.d.ts} +11 -3
- package/dist/avatar.d.ts +2 -1
- package/dist/browser.d.ts +15 -13
- package/dist/browser.js +12 -13
- package/dist/{capability-error-CuI_F7yM.d.ts → capability-error-db7kO8-P.d.ts} +2 -1
- package/dist/{catalog-CbiftcxQ.d.ts → catalog-Cf3fHDNn.d.ts} +69 -3
- package/dist/{chunk-5DZNMLDM.js → chunk-2A3BJ262.js} +2 -2
- package/dist/{chunk-BQXRCJ3N.js → chunk-5RLIPTL7.js} +1 -1
- package/dist/{chunk-MVQQDPQX.js → chunk-AZDZEQFK.js} +14 -2
- package/dist/{chunk-JK3XV2CR.js → chunk-BRROI4CH.js} +50 -8
- package/dist/{chunk-P33ZAJMS.js → chunk-CQVKOD3B.js} +1266 -677
- package/dist/{chunk-QYC3CZVD.js → chunk-CZ23KRVK.js} +2 -2
- package/dist/{chunk-X3FMVRMM.js → chunk-DIXYVGXO.js} +1 -1
- package/dist/{chunk-RDUSFUXX.js → chunk-GEVARKEV.js} +9 -1
- package/dist/{chunk-2HHZV7U3.js → chunk-LDO5GP7G.js} +1 -1
- package/dist/{chunk-Z2Z5DBNW.js → chunk-LGGD7S5T.js} +45 -9
- package/dist/{chunk-U66GUVSG.js → chunk-LZXDYSUH.js} +2 -0
- package/dist/{chunk-NRMQVK2W.js → chunk-ME2KUAVJ.js} +1 -1
- package/dist/{chunk-KUNPCDN6.js → chunk-ODJGTFPY.js} +16 -9
- package/dist/{chunk-DSJ46QLB.js → chunk-PO2ZDY27.js} +1 -1
- package/dist/{chunk-RWR2LOPA.js → chunk-RKTMSTT7.js} +2 -2
- package/dist/{chunk-5SBA6X5X.js → chunk-SWLW4VN3.js} +2 -2
- package/dist/{chunk-BMJHFWVT.js → chunk-TCREFRPK.js} +10 -43
- package/dist/{chunk-Q5QVAF7R.js → chunk-UGM6DUB2.js} +42 -25
- package/dist/chunk-VAGGGB6B.js +87 -0
- package/dist/{chunk-FGXLXENM.js → chunk-VNEJH4NT.js} +47 -3
- package/dist/chunk-WNEQEDMU.js +427 -0
- package/dist/{chunk-Q6KTTVOI.js → chunk-WVK3G2J2.js} +1 -1
- package/dist/{client-CZPewB9h.d.ts → client-6eSYOl8h.d.ts} +159 -11
- package/dist/{dashboards-jGPM3AxF.d.ts → dashboards-DCOAXL54.d.ts} +6 -5
- package/dist/{deployments-BVFd7ddA.d.ts → deployments-BIfdCMd5.d.ts} +911 -309
- package/dist/{host-environment-FN4zg3hw.d.ts → host-environment-DUw5-Cvj.d.ts} +2 -1
- package/dist/{identity-integration-W1Vo3Ql9.d.ts → identity-integration-BlfOn8rc.d.ts} +3 -2
- package/dist/index.d.ts +16 -15
- package/dist/index.js +10 -10
- package/dist/internal.d.ts +155 -17
- package/dist/internal.js +266 -19
- package/dist/{limits-C4RzrOV4.d.ts → limits-Ctaeq23J.d.ts} +8 -2
- package/dist/{offers-BpYenB9i.d.ts → offers-COqHGbHm.d.ts} +4 -3
- package/dist/{participant-activity-DXRq4s6K.d.ts → participant-activity-BznrcePT.d.ts} +2 -1
- package/dist/{participant-rewards-BcWkBRn_.d.ts → participant-rewards-s5Gn23qb.d.ts} +23 -1
- package/dist/portal-proxy.d.ts +7 -4
- package/dist/portal-proxy.js +14 -18
- package/dist/profiles-CLDKZVFx.d.ts +370 -0
- package/dist/react/index.d.ts +71 -30
- package/dist/react/index.js +12 -13
- package/dist/{request-error-D_dUPLwo.d.ts → request-error-C24SY7n9.d.ts} +2 -1
- package/dist/{reward-deliveries-BOWpMytr.d.ts → reward-deliveries-DFhYGJdx.d.ts} +3 -2
- package/dist/runtime/authoring.js +1 -1
- package/dist/runtime/chunks/HKAI5OQA.js +1 -0
- package/dist/runtime/manifest.json +3 -3
- package/dist/runtime/schema.js +1 -1
- package/dist/schema.d.ts +556 -180
- package/dist/schema.js +70 -8
- package/dist/server/index.d.ts +15 -14
- package/dist/server/index.js +2053 -893
- package/dist/{sign-in-providers-BRYVOSlG.d.ts → sign-in-providers-C97mRNbG.d.ts} +4 -3
- package/dist/solana.d.ts +287 -0
- package/dist/solana.js +699 -0
- package/dist/{streaks-0YuipsUQ.d.ts → streaks-MAqKHbHC.d.ts} +2 -1
- package/dist/{submission-input-C152xIdn.d.ts → submission-input-BD7nORuh.d.ts} +4 -3
- package/dist/{telegram-browser-657QqiQl.d.ts → telegram-browser-gRMgGs7B.d.ts} +8 -109
- package/dist/telegram.d.ts +14 -12
- package/dist/telegram.js +2 -2
- package/dist/testing.d.ts +99 -18
- package/dist/testing.js +101 -11
- package/dist/{tracker-data-BqY-9Vu-.d.ts → tracker-data-DQgX3FIc.d.ts} +493 -1
- package/dist/{transport-CthYgZXK.d.ts → transport-BLU8jrhg.d.ts} +7340 -2134
- package/dist/vite.d.ts +2 -1
- package/dist/{wallet-Btng186v.d.ts → wallet-CPAjrW4k.d.ts} +339 -308
- package/dist/wallet-browser-BzPt_Qb5.d.ts +107 -0
- package/package.json +21 -3
- package/dist/chunk-UWUS4OOV.js +0 -59
- package/dist/chunk-UYVJZR33.js +0 -34
- package/dist/runtime/chunks/C2MGLQXC.js +0 -1
|
@@ -3,10 +3,10 @@ import {
|
|
|
3
3
|
limits,
|
|
4
4
|
resourceHandle,
|
|
5
5
|
responseShape
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-CQVKOD3B.js";
|
|
7
7
|
import {
|
|
8
8
|
parseDefinition
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VNEJH4NT.js";
|
|
10
10
|
|
|
11
11
|
// src/server/analytics.ts
|
|
12
12
|
import * as z from "zod";
|
|
@@ -2,13 +2,14 @@ import {
|
|
|
2
2
|
capabilityFailureSchema
|
|
3
3
|
} from "./chunk-MWMCQLCG.js";
|
|
4
4
|
import {
|
|
5
|
+
attemptActionSchema,
|
|
5
6
|
contentPerformanceSnapshotSchema,
|
|
6
7
|
decisionSchema,
|
|
7
8
|
identifier,
|
|
8
9
|
rewardBundleSchema,
|
|
9
10
|
settingsValuesSchema,
|
|
10
11
|
trackerTriggerContextSchema
|
|
11
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CQVKOD3B.js";
|
|
12
13
|
|
|
13
14
|
// src/server/attempt-captures.ts
|
|
14
15
|
import * as z from "zod";
|
|
@@ -57,6 +58,13 @@ var attemptCaptureSchema = /* @__PURE__ */ (() => z.object({
|
|
|
57
58
|
member: identifier,
|
|
58
59
|
input: z.record(z.string(), z.json()),
|
|
59
60
|
tracker: trackerTriggerContextSchema.nullable(),
|
|
61
|
+
/**
|
|
62
|
+
* The action that started the attempt, `ctx.action`. Absent from captures Relay made before it
|
|
63
|
+
* recorded actions.
|
|
64
|
+
*
|
|
65
|
+
* @experimental A minor release can change quest actions.
|
|
66
|
+
*/
|
|
67
|
+
action: attemptActionSchema.nullable().optional(),
|
|
60
68
|
eligibleAt: timestamp,
|
|
61
69
|
calendar: z.object({
|
|
62
70
|
segments: z.array(
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRelayAction,
|
|
3
3
|
withActionId
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-5RLIPTL7.js";
|
|
5
5
|
import {
|
|
6
6
|
setPluginTransport
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-LDO5GP7G.js";
|
|
8
8
|
import {
|
|
9
9
|
createHttpExchange,
|
|
10
10
|
untilAborted,
|
|
11
11
|
withQuery
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-WVK3G2J2.js";
|
|
13
13
|
import {
|
|
14
14
|
PARTICIPANT_TIMEOUT,
|
|
15
15
|
lifetime,
|
|
16
16
|
retrying,
|
|
17
17
|
validTimeout
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-SWLW4VN3.js";
|
|
19
19
|
import {
|
|
20
20
|
authProvidersSchema,
|
|
21
21
|
collectionPassSchema,
|
|
@@ -34,7 +34,7 @@ import {
|
|
|
34
34
|
questOutcomeSchema,
|
|
35
35
|
rewardDeliveriesSchema,
|
|
36
36
|
rewardDeliveryQuerySchema
|
|
37
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-ME2KUAVJ.js";
|
|
38
38
|
import {
|
|
39
39
|
exchangeResultSchema,
|
|
40
40
|
exchangeSchema,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
participantSessionSchema,
|
|
45
45
|
questExperienceSchema,
|
|
46
46
|
sessionMember
|
|
47
|
-
} from "./chunk-
|
|
47
|
+
} from "./chunk-PO2ZDY27.js";
|
|
48
48
|
import {
|
|
49
49
|
engagementBoundaryPageSchema,
|
|
50
50
|
engagementPageQuerySchema,
|
|
@@ -55,7 +55,7 @@ import {
|
|
|
55
55
|
referralDefinitionSchema,
|
|
56
56
|
referralHistorySchema,
|
|
57
57
|
referralSummarySchema
|
|
58
|
-
} from "./chunk-
|
|
58
|
+
} from "./chunk-2A3BJ262.js";
|
|
59
59
|
import {
|
|
60
60
|
AVATAR_UPLOAD_LIMIT,
|
|
61
61
|
accountConnectionSchema,
|
|
@@ -110,8 +110,10 @@ import {
|
|
|
110
110
|
walletAddressInputSchema,
|
|
111
111
|
walletMessageChallengeSchema,
|
|
112
112
|
walletSignatureSchema,
|
|
113
|
+
walletTransactionChallengeSchema,
|
|
114
|
+
walletTransactionProofSchema,
|
|
113
115
|
walletUnlinkInputSchema
|
|
114
|
-
} from "./chunk-
|
|
116
|
+
} from "./chunk-CQVKOD3B.js";
|
|
115
117
|
import {
|
|
116
118
|
RelayError,
|
|
117
119
|
RelayErrorCode,
|
|
@@ -119,7 +121,7 @@ import {
|
|
|
119
121
|
isRelayError,
|
|
120
122
|
isRequestError,
|
|
121
123
|
parseInput
|
|
122
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-VNEJH4NT.js";
|
|
123
125
|
|
|
124
126
|
// src/legacy-submissions.ts
|
|
125
127
|
import * as z from "zod";
|
|
@@ -1820,6 +1822,40 @@ function relayClient(options) {
|
|
|
1820
1822
|
replaySafe: unusedChallengeExpires
|
|
1821
1823
|
}),
|
|
1822
1824
|
verify: async (value, requestOptions) => linkVerify(value, await bound(requestOptions)),
|
|
1825
|
+
/**
|
|
1826
|
+
* A challenge for linking a Solana account that cannot sign messages, such as a Squads vault:
|
|
1827
|
+
* the account executes a transaction with an SPL Memo instruction that carries `memo` and lists
|
|
1828
|
+
* the account, then `linkByTransaction` submits its signature. The challenge belongs to the
|
|
1829
|
+
* member, not the session, and lasts 7 days, since a multisig approval can take that long. A
|
|
1830
|
+
* repeat for the same address answers the open challenge.
|
|
1831
|
+
*
|
|
1832
|
+
* @experimental A minor release can change linking by transaction.
|
|
1833
|
+
*/
|
|
1834
|
+
transactionChallenge: async (value, requestOptions) => request(
|
|
1835
|
+
"/v1/me/wallets/transaction-challenge",
|
|
1836
|
+
walletTransactionChallengeSchema,
|
|
1837
|
+
{
|
|
1838
|
+
json: parseInput(walletAddressInputSchema, value),
|
|
1839
|
+
options: await bound(requestOptions),
|
|
1840
|
+
replaySafe: true
|
|
1841
|
+
}
|
|
1842
|
+
),
|
|
1843
|
+
/**
|
|
1844
|
+
* Links the account a finalized Solana mainnet transaction proves: it succeeded, and an SPL
|
|
1845
|
+
* Memo instruction in it, top-level or inner, carries an open challenge's `memo` and lists
|
|
1846
|
+
* the account. A transaction that is not final yet is refused with `transaction-not-final`;
|
|
1847
|
+
* try again shortly. Retrying the same signature answers the same wallet.
|
|
1848
|
+
*
|
|
1849
|
+
* @experimental A minor release can change linking by transaction.
|
|
1850
|
+
*/
|
|
1851
|
+
linkByTransaction: async (value, requestOptions) => {
|
|
1852
|
+
const proof = parseInput(walletTransactionProofSchema, value);
|
|
1853
|
+
return request("/v1/me/wallets/link-transaction", linkedWalletSchema, {
|
|
1854
|
+
json: proof,
|
|
1855
|
+
options: await bound(requestOptions),
|
|
1856
|
+
operationId: proof.signature
|
|
1857
|
+
});
|
|
1858
|
+
},
|
|
1823
1859
|
/** The address stays bound to this member: another member still cannot link it. */
|
|
1824
1860
|
unlink: async (wallet, requestOptions) => request("/v1/me/wallets/unlink", ok, {
|
|
1825
1861
|
json: parseInput(walletUnlinkInputSchema, {
|
|
@@ -48,6 +48,8 @@ var participantRoutes = [
|
|
|
48
48
|
{ method: "GET", path: "/v1/me/wallets" },
|
|
49
49
|
{ method: "POST", path: "/v1/me/wallets/challenge" },
|
|
50
50
|
{ method: "POST", path: "/v1/me/wallets/verify" },
|
|
51
|
+
{ method: "POST", path: "/v1/me/wallets/transaction-challenge" },
|
|
52
|
+
{ method: "POST", path: "/v1/me/wallets/link-transaction" },
|
|
51
53
|
{ method: "POST", path: "/v1/me/wallets/unlink" },
|
|
52
54
|
// Profiles: the member's own, and the reads keyed by a public profile ID.
|
|
53
55
|
{ method: "GET", path: "/v1/me/profile" },
|
|
@@ -6,13 +6,13 @@ import {
|
|
|
6
6
|
imageSightingsSchema,
|
|
7
7
|
imageUploadsSchema,
|
|
8
8
|
publishedImageSchema
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-DIXYVGXO.js";
|
|
10
10
|
import {
|
|
11
11
|
dashboardArtifactSchema,
|
|
12
12
|
dashboardIssue,
|
|
13
13
|
dashboardPreviewSchema,
|
|
14
14
|
normalizeDashboard
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-CZ23KRVK.js";
|
|
16
16
|
import {
|
|
17
17
|
authProvidersSchema,
|
|
18
18
|
collectionPassSchema,
|
|
@@ -23,7 +23,7 @@ import {
|
|
|
23
23
|
questOutcomePageSchema,
|
|
24
24
|
questOutcomeSchema,
|
|
25
25
|
rewardDeliveriesSchema
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-ME2KUAVJ.js";
|
|
27
27
|
import {
|
|
28
28
|
catalogDeploymentSchema,
|
|
29
29
|
collectionViewSchema,
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
questExperienceSchema,
|
|
38
38
|
questTypeVersionSchema,
|
|
39
39
|
questViewSchema
|
|
40
|
-
} from "./chunk-
|
|
40
|
+
} from "./chunk-PO2ZDY27.js";
|
|
41
41
|
import {
|
|
42
42
|
engagementArtifactSchema,
|
|
43
43
|
engagementBoundaryPageSchema,
|
|
@@ -52,7 +52,7 @@ import {
|
|
|
52
52
|
referralDefinitionSchema,
|
|
53
53
|
referralHistorySchema,
|
|
54
54
|
referralSummarySchema
|
|
55
|
-
} from "./chunk-
|
|
55
|
+
} from "./chunk-2A3BJ262.js";
|
|
56
56
|
import {
|
|
57
57
|
accountConnectionSchema,
|
|
58
58
|
attemptSchema,
|
|
@@ -114,10 +114,13 @@ import {
|
|
|
114
114
|
walletEventsSchema,
|
|
115
115
|
walletMessageChallengeSchema,
|
|
116
116
|
walletNftsSchema,
|
|
117
|
+
walletProgramAccountSchema,
|
|
117
118
|
walletSignInNetworksSchema,
|
|
119
|
+
walletStakeSchema,
|
|
120
|
+
walletTransactionChallengeSchema,
|
|
118
121
|
walletTransactionsSchema,
|
|
119
122
|
whereSettings
|
|
120
|
-
} from "./chunk-
|
|
123
|
+
} from "./chunk-CQVKOD3B.js";
|
|
121
124
|
|
|
122
125
|
// src/deployments.ts
|
|
123
126
|
import * as z from "zod";
|
|
@@ -288,7 +291,9 @@ var capabilityResponseTables = /* @__PURE__ */ (() => responseTables({
|
|
|
288
291
|
walletCallSchema: () => walletCallSchema,
|
|
289
292
|
walletDelegationsSchema: () => walletDelegationsSchema,
|
|
290
293
|
walletEventsSchema: () => walletEventsSchema,
|
|
291
|
-
walletTransactionsSchema: () => walletTransactionsSchema
|
|
294
|
+
walletTransactionsSchema: () => walletTransactionsSchema,
|
|
295
|
+
walletProgramAccountSchema: () => walletProgramAccountSchema,
|
|
296
|
+
walletStakeSchema: () => walletStakeSchema
|
|
292
297
|
}))();
|
|
293
298
|
var capabilityResponseSchemas = capabilityResponseTables.known;
|
|
294
299
|
var capabilityResponses = capabilityResponseTables.tolerant;
|
|
@@ -304,7 +309,8 @@ var activityTypes = {
|
|
|
304
309
|
reviewPending: "review.pending",
|
|
305
310
|
rewardDeliveryFailed: "reward.delivery.failed",
|
|
306
311
|
entitlementCollected: "entitlement.collected",
|
|
307
|
-
referralQualified: "referral.qualified"
|
|
312
|
+
referralQualified: "referral.qualified",
|
|
313
|
+
walletLinked: "wallet.linked"
|
|
308
314
|
};
|
|
309
315
|
var activityTypeSchema = /* @__PURE__ */ (() => z2.string().min(1).max(100))();
|
|
310
316
|
|
|
@@ -511,7 +517,8 @@ var participantResponseTables = /* @__PURE__ */ (() => responseTables({
|
|
|
511
517
|
rewardDeliveriesSchema: () => rewardDeliveriesSchema,
|
|
512
518
|
tieredRewardReferenceSchema: () => tieredRewardReferenceSchema,
|
|
513
519
|
walletMessageChallengeSchema: () => walletMessageChallengeSchema,
|
|
514
|
-
walletSignInNetworksSchema: () => walletSignInNetworksSchema
|
|
520
|
+
walletSignInNetworksSchema: () => walletSignInNetworksSchema,
|
|
521
|
+
walletTransactionChallengeSchema: () => walletTransactionChallengeSchema
|
|
515
522
|
}))();
|
|
516
523
|
var participantResponseSchemas = participantResponseTables.known;
|
|
517
524
|
var participantResponses = participantResponseTables.tolerant;
|
|
@@ -4,10 +4,10 @@ import {
|
|
|
4
4
|
imageFieldsSchema,
|
|
5
5
|
imageInspectionSchema,
|
|
6
6
|
imageSightingsSchema
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-DIXYVGXO.js";
|
|
8
8
|
import {
|
|
9
9
|
photoResultSchema
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-CQVKOD3B.js";
|
|
11
11
|
|
|
12
12
|
// src/image-results.ts
|
|
13
13
|
import * as z from "zod";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
isRequestError
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-VNEJH4NT.js";
|
|
4
4
|
|
|
5
5
|
// package.json
|
|
6
6
|
var name = "@domino-sdk/relay";
|
|
7
|
-
var version = "1.
|
|
7
|
+
var version = "1.69.0";
|
|
8
8
|
|
|
9
9
|
// src/client-identity.ts
|
|
10
10
|
function clientIdentity() {
|
|
@@ -1,17 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createRelayClient
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-LGGD7S5T.js";
|
|
4
4
|
import {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
connectSolanaAccount,
|
|
6
|
+
noAccount,
|
|
7
|
+
registeredWallets
|
|
8
|
+
} from "./chunk-VAGGGB6B.js";
|
|
7
9
|
import {
|
|
10
|
+
base58,
|
|
8
11
|
cosmosChain
|
|
9
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-CQVKOD3B.js";
|
|
10
13
|
import {
|
|
11
14
|
RelayErrorCode,
|
|
12
15
|
asRelayError,
|
|
13
16
|
clientError
|
|
14
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-VNEJH4NT.js";
|
|
15
18
|
|
|
16
19
|
// src/wallet-browser.ts
|
|
17
20
|
function injected() {
|
|
@@ -27,7 +30,6 @@ function utf8Hex(message) {
|
|
|
27
30
|
}
|
|
28
31
|
return hex;
|
|
29
32
|
}
|
|
30
|
-
var noAccount = "The wallet didn't share an account. Unlock it and try again.";
|
|
31
33
|
function evmSigner(provider, info = {}) {
|
|
32
34
|
return {
|
|
33
35
|
chain: "eip155",
|
|
@@ -128,14 +130,7 @@ function walletStandardSolanaSigner(wallet) {
|
|
|
128
130
|
chain: "solana",
|
|
129
131
|
name: wallet.name,
|
|
130
132
|
async address() {
|
|
131
|
-
|
|
132
|
-
const available = accounts.length ? accounts : wallet.accounts;
|
|
133
|
-
connected = available.find(
|
|
134
|
-
(account) => account.chains.some((chain) => chain.startsWith("solana:"))
|
|
135
|
-
) ?? available[0];
|
|
136
|
-
if (!connected) {
|
|
137
|
-
throw new Error(noAccount);
|
|
138
|
-
}
|
|
133
|
+
connected = await connectSolanaAccount(wallet);
|
|
139
134
|
return connected.address;
|
|
140
135
|
},
|
|
141
136
|
async sign(message, address) {
|
|
@@ -251,35 +246,7 @@ function discoverSolanaWallets() {
|
|
|
251
246
|
if (!target) {
|
|
252
247
|
return [];
|
|
253
248
|
}
|
|
254
|
-
const standard =
|
|
255
|
-
const api = {
|
|
256
|
-
register(...wallets2) {
|
|
257
|
-
for (const wallet of wallets2) {
|
|
258
|
-
if (!standard.includes(wallet)) {
|
|
259
|
-
standard.push(wallet);
|
|
260
|
-
}
|
|
261
|
-
}
|
|
262
|
-
return () => {
|
|
263
|
-
};
|
|
264
|
-
}
|
|
265
|
-
};
|
|
266
|
-
const registered = (event) => {
|
|
267
|
-
const callback = event.detail;
|
|
268
|
-
if (typeof callback === "function") {
|
|
269
|
-
try {
|
|
270
|
-
callback(api);
|
|
271
|
-
} catch {
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
target.addEventListener("wallet-standard:register-wallet", registered);
|
|
276
|
-
try {
|
|
277
|
-
target.dispatchEvent(
|
|
278
|
-
new CustomEvent("wallet-standard:app-ready", { detail: api })
|
|
279
|
-
);
|
|
280
|
-
} finally {
|
|
281
|
-
target.removeEventListener("wallet-standard:register-wallet", registered);
|
|
282
|
-
}
|
|
249
|
+
const standard = registeredWallets(target);
|
|
283
250
|
const wallets = [];
|
|
284
251
|
const seen = /* @__PURE__ */ new Set();
|
|
285
252
|
function add(name, signer, icon) {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
imageAssetArtifactSchema
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-DIXYVGXO.js";
|
|
4
4
|
import {
|
|
5
5
|
authScopeSchema,
|
|
6
6
|
exchangeResultSchema
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PO2ZDY27.js";
|
|
8
8
|
import {
|
|
9
9
|
appIdentityKindSchema,
|
|
10
10
|
cosmosAddressSchema,
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
openIdentityKindSchema,
|
|
18
18
|
pageCursorSchema,
|
|
19
19
|
solanaAddressSchema
|
|
20
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-CQVKOD3B.js";
|
|
21
21
|
|
|
22
22
|
// src/credential-secrets.ts
|
|
23
23
|
import * as z from "zod";
|
|
@@ -418,6 +418,34 @@ var memberImportListQuerySchema = /* @__PURE__ */ (() => z2.object({
|
|
|
418
418
|
// src/server/schedules.ts
|
|
419
419
|
import * as z3 from "zod";
|
|
420
420
|
import { Cron } from "croner";
|
|
421
|
+
|
|
422
|
+
// src/server/request-body.ts
|
|
423
|
+
async function boundedBodyText(body, limit) {
|
|
424
|
+
const reader = body.getReader();
|
|
425
|
+
let text = "";
|
|
426
|
+
let size = 0;
|
|
427
|
+
const decoder = new TextDecoder();
|
|
428
|
+
try {
|
|
429
|
+
for (; ; ) {
|
|
430
|
+
const chunk = await reader.read();
|
|
431
|
+
if (chunk.done) {
|
|
432
|
+
break;
|
|
433
|
+
}
|
|
434
|
+
size += chunk.value.byteLength;
|
|
435
|
+
if (size > limit) {
|
|
436
|
+
void reader.cancel().catch(() => {
|
|
437
|
+
});
|
|
438
|
+
return null;
|
|
439
|
+
}
|
|
440
|
+
text += decoder.decode(chunk.value, { stream: true });
|
|
441
|
+
}
|
|
442
|
+
return text + decoder.decode();
|
|
443
|
+
} catch {
|
|
444
|
+
return null;
|
|
445
|
+
}
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
// src/server/schedules.ts
|
|
421
449
|
var APP_SCHEDULE_LIMIT = 10;
|
|
422
450
|
var APP_SCHEDULE_MIN_INTERVAL = 3e5;
|
|
423
451
|
var APP_SCHEDULE_TIMEOUT = 3e4;
|
|
@@ -564,29 +592,12 @@ async function verifyScheduledRequest(request, key) {
|
|
|
564
592
|
if (request.method !== "POST" || url.search !== "" || url.hash !== "" || !key || !signature || !/^[a-f0-9]{64}$/.test(signature)) {
|
|
565
593
|
return null;
|
|
566
594
|
}
|
|
567
|
-
const
|
|
568
|
-
if (!
|
|
595
|
+
const stream = request.clone().body;
|
|
596
|
+
if (!stream) {
|
|
569
597
|
return null;
|
|
570
598
|
}
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
const decoder = new TextDecoder();
|
|
574
|
-
try {
|
|
575
|
-
for (; ; ) {
|
|
576
|
-
const chunk = await reader.read();
|
|
577
|
-
if (chunk.done) {
|
|
578
|
-
break;
|
|
579
|
-
}
|
|
580
|
-
size += chunk.value.byteLength;
|
|
581
|
-
if (size > 4096) {
|
|
582
|
-
void reader.cancel().catch(() => {
|
|
583
|
-
});
|
|
584
|
-
return null;
|
|
585
|
-
}
|
|
586
|
-
body += decoder.decode(chunk.value, { stream: true });
|
|
587
|
-
}
|
|
588
|
-
body += decoder.decode();
|
|
589
|
-
} catch {
|
|
599
|
+
const body = await boundedBodyText(stream, 4096);
|
|
600
|
+
if (body === null) {
|
|
590
601
|
return null;
|
|
591
602
|
}
|
|
592
603
|
const secret = await crypto.subtle.importKey(
|
|
@@ -626,7 +637,7 @@ var starters = [
|
|
|
626
637
|
{
|
|
627
638
|
id: "campaign",
|
|
628
639
|
title: "Campaign tour",
|
|
629
|
-
summary: "A
|
|
640
|
+
summary: "A quest app with a guided tour of every quest kind, in a clean default look to rebrand. The blank canvas for anything."
|
|
630
641
|
},
|
|
631
642
|
{
|
|
632
643
|
id: "classic",
|
|
@@ -653,6 +664,11 @@ var starters = [
|
|
|
653
664
|
title: "Loyalty program",
|
|
654
665
|
summary: "Members earn points in a campaign, qualify into a members' group, and spend points on offers, some for members only."
|
|
655
666
|
},
|
|
667
|
+
{
|
|
668
|
+
id: "badge",
|
|
669
|
+
title: "Breakpoint badge game",
|
|
670
|
+
summary: "A game for the Breakpoint 2026 badge in Lua, played in the browser on the badge's own firmware, with points and a leaderboard for every round."
|
|
671
|
+
},
|
|
656
672
|
{
|
|
657
673
|
id: "api",
|
|
658
674
|
title: "API",
|
|
@@ -1430,6 +1446,7 @@ export {
|
|
|
1430
1446
|
memberImportSchema,
|
|
1431
1447
|
memberImportPageSchema,
|
|
1432
1448
|
memberImportListQuerySchema,
|
|
1449
|
+
boundedBodyText,
|
|
1433
1450
|
APP_SCHEDULE_LIMIT,
|
|
1434
1451
|
APP_SCHEDULE_MIN_INTERVAL,
|
|
1435
1452
|
APP_SCHEDULE_TIMEOUT,
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
// src/wallet-standard.ts
|
|
2
|
+
var noAccount = "The wallet didn't share an account. Unlock it and try again.";
|
|
3
|
+
function registeredWallets(target) {
|
|
4
|
+
const standard = [];
|
|
5
|
+
const api = {
|
|
6
|
+
register(...wallets) {
|
|
7
|
+
for (const wallet of wallets) {
|
|
8
|
+
if (!standard.includes(wallet)) {
|
|
9
|
+
standard.push(wallet);
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
return () => {
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const registered = (event) => {
|
|
17
|
+
const callback = event.detail;
|
|
18
|
+
if (typeof callback === "function") {
|
|
19
|
+
try {
|
|
20
|
+
callback(api);
|
|
21
|
+
} catch {
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
};
|
|
25
|
+
target.addEventListener("wallet-standard:register-wallet", registered);
|
|
26
|
+
try {
|
|
27
|
+
target.dispatchEvent(
|
|
28
|
+
new CustomEvent("wallet-standard:app-ready", { detail: api })
|
|
29
|
+
);
|
|
30
|
+
} finally {
|
|
31
|
+
target.removeEventListener("wallet-standard:register-wallet", registered);
|
|
32
|
+
}
|
|
33
|
+
return standard;
|
|
34
|
+
}
|
|
35
|
+
async function connectSolanaAccount(wallet) {
|
|
36
|
+
const connect = wallet.features["standard:connect"];
|
|
37
|
+
if (!connect) {
|
|
38
|
+
throw new Error(`${wallet.name} doesn't support standard:connect.`);
|
|
39
|
+
}
|
|
40
|
+
const { accounts } = await connect.connect();
|
|
41
|
+
const available = accounts.length ? accounts : wallet.accounts;
|
|
42
|
+
const account = available.find(
|
|
43
|
+
(candidate) => candidate.chains.some((chain) => chain.startsWith("solana:"))
|
|
44
|
+
) ?? available[0];
|
|
45
|
+
if (!account) {
|
|
46
|
+
throw new Error(noAccount);
|
|
47
|
+
}
|
|
48
|
+
return account;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// src/host-environment.ts
|
|
52
|
+
import * as z from "zod";
|
|
53
|
+
var hostEnvironmentPath = "/__domino/environment";
|
|
54
|
+
var hostEnvironmentSchema = /* @__PURE__ */ (() => z.object({
|
|
55
|
+
environment: z.enum(["test", "live"]),
|
|
56
|
+
kind: z.enum(["staging", "preview", "live"])
|
|
57
|
+
}))();
|
|
58
|
+
var pending;
|
|
59
|
+
async function readHostEnvironment() {
|
|
60
|
+
try {
|
|
61
|
+
const response = await fetch(hostEnvironmentPath, {
|
|
62
|
+
headers: { Accept: "application/json" }
|
|
63
|
+
});
|
|
64
|
+
if (response.status !== 200) {
|
|
65
|
+
return null;
|
|
66
|
+
}
|
|
67
|
+
const parsed = hostEnvironmentSchema.safeParse(await response.json());
|
|
68
|
+
return parsed.success ? parsed.data : null;
|
|
69
|
+
} catch {
|
|
70
|
+
return null;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
function getHostEnvironment() {
|
|
74
|
+
if (!globalThis.location) {
|
|
75
|
+
return Promise.resolve(null);
|
|
76
|
+
}
|
|
77
|
+
return pending ??= readHostEnvironment();
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export {
|
|
81
|
+
noAccount,
|
|
82
|
+
registeredWallets,
|
|
83
|
+
connectSolanaAccount,
|
|
84
|
+
hostEnvironmentPath,
|
|
85
|
+
hostEnvironmentSchema,
|
|
86
|
+
getHostEnvironment
|
|
87
|
+
};
|
|
@@ -47,8 +47,30 @@ function parseDefinition(kind, schema, input) {
|
|
|
47
47
|
return parsed.data;
|
|
48
48
|
}
|
|
49
49
|
const key = typeof input === "object" && input !== null && "key" in input && typeof input.key === "string" ? ` "${input.key}"` : "";
|
|
50
|
-
|
|
51
|
-
|
|
50
|
+
throw namedSchemaFailure(kind + key, parsed.error);
|
|
51
|
+
}
|
|
52
|
+
var isSchemaFailure = (error) => error instanceof Error && Array.isArray(error.issues);
|
|
53
|
+
function namedSchemaFailure(name, error) {
|
|
54
|
+
if (isSchemaFailure(error)) {
|
|
55
|
+
Object.defineProperty(error, "message", {
|
|
56
|
+
value: `${name} is invalid: ${issueText(error.issues)}`,
|
|
57
|
+
configurable: true,
|
|
58
|
+
writable: true
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
return error;
|
|
62
|
+
}
|
|
63
|
+
function parseField(field, parse) {
|
|
64
|
+
try {
|
|
65
|
+
return parse();
|
|
66
|
+
} catch (error) {
|
|
67
|
+
if (isSchemaFailure(error)) {
|
|
68
|
+
for (const issue of error.issues) {
|
|
69
|
+
issue.path.unshift(field);
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
throw error;
|
|
73
|
+
}
|
|
52
74
|
}
|
|
53
75
|
|
|
54
76
|
// src/errors.ts
|
|
@@ -156,7 +178,27 @@ var RelayErrorCode = {
|
|
|
156
178
|
/** The wallet sign-in challenge expired, was used or changed; start sign-in again. */
|
|
157
179
|
ChallengeExpired: "challenge-expired",
|
|
158
180
|
/** Too many requests; `retryAfter` says how long to wait when Relay knows. */
|
|
159
|
-
RateLimited: "rate-limited"
|
|
181
|
+
RateLimited: "rate-limited",
|
|
182
|
+
/**
|
|
183
|
+
* `wallets.linkByTransaction`: the transaction is not finalized yet. Send the same signature
|
|
184
|
+
* again in a few seconds.
|
|
185
|
+
*
|
|
186
|
+
* @experimental A minor release can change linking by transaction.
|
|
187
|
+
*/
|
|
188
|
+
TransactionNotFinal: "transaction-not-final",
|
|
189
|
+
/** `wallets.linkByTransaction`: Solana mainnet has no transaction with this signature. @experimental */
|
|
190
|
+
TransactionNotFound: "transaction-not-found",
|
|
191
|
+
/** `wallets.linkByTransaction`: the transaction failed, so it proves nothing. @experimental */
|
|
192
|
+
TransactionFailed: "transaction-failed",
|
|
193
|
+
/**
|
|
194
|
+
* `wallets.linkByTransaction`: no memo in the transaction carries one of the member's open
|
|
195
|
+
* challenges for the address, with the address as signer.
|
|
196
|
+
*
|
|
197
|
+
* @experimental A minor release can change linking by transaction.
|
|
198
|
+
*/
|
|
199
|
+
ProofMismatch: "proof-mismatch",
|
|
200
|
+
/** `wallets.linkByTransaction`: another transaction already used the challenge. @experimental */
|
|
201
|
+
ChallengeUsed: "challenge-used"
|
|
160
202
|
};
|
|
161
203
|
var relayErrorBrand = /* @__PURE__ */ (() => /* @__PURE__ */ Symbol.for("@domino-sdk/relay.RelayError"))();
|
|
162
204
|
function isRelayError(value) {
|
|
@@ -210,6 +252,8 @@ export {
|
|
|
210
252
|
RequestError,
|
|
211
253
|
issueText,
|
|
212
254
|
parseDefinition,
|
|
255
|
+
namedSchemaFailure,
|
|
256
|
+
parseField,
|
|
213
257
|
RelayErrorCode,
|
|
214
258
|
isRelayError,
|
|
215
259
|
RelayError,
|