@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
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { b as AttemptStatus, W as AttemptCodeSource, V as KnownAttemptActionKind, X as IntegrationModuleProvider, Y as RewardType, Z as questDescriptionSchema } from './accounts-DD4gAOCe.js';
|
|
2
|
+
import { S as SolanaIdlSource } from './wallet-CPAjrW4k.js';
|
|
3
3
|
import * as z from 'zod';
|
|
4
4
|
|
|
5
5
|
/**
|
|
@@ -395,6 +395,12 @@ declare const questTypeVersionSchema: z.ZodObject<{
|
|
|
395
395
|
}, z.core.$strict>>>;
|
|
396
396
|
retryCooldownMs: z.ZodOptional<z.ZodNumber>;
|
|
397
397
|
completionCooldownMs: z.ZodOptional<z.ZodNumber>;
|
|
398
|
+
stations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
399
|
+
key: z.ZodString;
|
|
400
|
+
label: z.ZodString;
|
|
401
|
+
opensAt: z.ZodOptional<z.ZodNumber>;
|
|
402
|
+
closesAt: z.ZodOptional<z.ZodNumber>;
|
|
403
|
+
}, z.core.$strict>>>;
|
|
398
404
|
completion: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
399
405
|
kind: z.ZodLiteral<"streak">;
|
|
400
406
|
days: z.ZodNumber;
|
|
@@ -1184,6 +1190,12 @@ declare const questCatalogSchema: z.ZodObject<{
|
|
|
1184
1190
|
}, z.core.$strict>>>;
|
|
1185
1191
|
retryCooldownMs: z.ZodOptional<z.ZodNumber>;
|
|
1186
1192
|
completionCooldownMs: z.ZodOptional<z.ZodNumber>;
|
|
1193
|
+
stations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1194
|
+
key: z.ZodString;
|
|
1195
|
+
label: z.ZodString;
|
|
1196
|
+
opensAt: z.ZodOptional<z.ZodNumber>;
|
|
1197
|
+
closesAt: z.ZodOptional<z.ZodNumber>;
|
|
1198
|
+
}, z.core.$strict>>>;
|
|
1187
1199
|
completion: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1188
1200
|
kind: z.ZodLiteral<"streak">;
|
|
1189
1201
|
days: z.ZodNumber;
|
|
@@ -1855,6 +1867,12 @@ declare const questCatalogSchema: z.ZodObject<{
|
|
|
1855
1867
|
}, z.core.$strict>>>;
|
|
1856
1868
|
retryCooldownMs: z.ZodOptional<z.ZodNumber>;
|
|
1857
1869
|
completionCooldownMs: z.ZodOptional<z.ZodNumber>;
|
|
1870
|
+
stations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
1871
|
+
key: z.ZodString;
|
|
1872
|
+
label: z.ZodString;
|
|
1873
|
+
opensAt: z.ZodOptional<z.ZodNumber>;
|
|
1874
|
+
closesAt: z.ZodOptional<z.ZodNumber>;
|
|
1875
|
+
}, z.core.$strict>>>;
|
|
1858
1876
|
completion: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
1859
1877
|
kind: z.ZodLiteral<"streak">;
|
|
1860
1878
|
days: z.ZodNumber;
|
|
@@ -2415,6 +2433,12 @@ declare const catalogDeploymentPreviewSchema: z.ZodObject<{
|
|
|
2415
2433
|
}, z.core.$strict>>>;
|
|
2416
2434
|
retryCooldownMs: z.ZodOptional<z.ZodNumber>;
|
|
2417
2435
|
completionCooldownMs: z.ZodOptional<z.ZodNumber>;
|
|
2436
|
+
stations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
2437
|
+
key: z.ZodString;
|
|
2438
|
+
label: z.ZodString;
|
|
2439
|
+
opensAt: z.ZodOptional<z.ZodNumber>;
|
|
2440
|
+
closesAt: z.ZodOptional<z.ZodNumber>;
|
|
2441
|
+
}, z.core.$strict>>>;
|
|
2418
2442
|
completion: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
2419
2443
|
kind: z.ZodLiteral<"streak">;
|
|
2420
2444
|
days: z.ZodNumber;
|
|
@@ -3074,6 +3098,13 @@ declare const questViewSchema: z.ZodObject<{
|
|
|
3074
3098
|
}, z.core.$strip>>>;
|
|
3075
3099
|
requestedReview: z.ZodDefault<z.ZodBoolean>;
|
|
3076
3100
|
createdAt: z.ZodNumber;
|
|
3101
|
+
action: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
3102
|
+
kind: z.ZodType<KnownAttemptActionKind | (string & {})>;
|
|
3103
|
+
chain: z.ZodString;
|
|
3104
|
+
signature: z.ZodString;
|
|
3105
|
+
wallet: z.ZodString;
|
|
3106
|
+
reference: z.ZodNullable<z.ZodString>;
|
|
3107
|
+
}, z.core.$strip>>>;
|
|
3077
3108
|
}, z.core.$strip>>;
|
|
3078
3109
|
release: z.ZodString;
|
|
3079
3110
|
interaction: z.ZodEnum<{
|
|
@@ -3596,6 +3627,13 @@ declare const collectionViewSchema: z.ZodObject<{
|
|
|
3596
3627
|
}, z.core.$strip>>>;
|
|
3597
3628
|
requestedReview: z.ZodDefault<z.ZodBoolean>;
|
|
3598
3629
|
createdAt: z.ZodNumber;
|
|
3630
|
+
action: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
3631
|
+
kind: z.ZodType<KnownAttemptActionKind | (string & {})>;
|
|
3632
|
+
chain: z.ZodString;
|
|
3633
|
+
signature: z.ZodString;
|
|
3634
|
+
wallet: z.ZodString;
|
|
3635
|
+
reference: z.ZodNullable<z.ZodString>;
|
|
3636
|
+
}, z.core.$strip>>>;
|
|
3599
3637
|
}, z.core.$strip>>;
|
|
3600
3638
|
release: z.ZodString;
|
|
3601
3639
|
interaction: z.ZodEnum<{
|
|
@@ -3665,6 +3703,7 @@ declare const questExperienceSchema: z.ZodObject<{
|
|
|
3665
3703
|
fulfillment: z.ZodObject<{
|
|
3666
3704
|
kind: z.ZodString;
|
|
3667
3705
|
}, z.core.$loose>;
|
|
3706
|
+
key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3668
3707
|
}, z.core.$loose>;
|
|
3669
3708
|
earnedTier: z.ZodString;
|
|
3670
3709
|
tier: z.ZodString;
|
|
@@ -3692,6 +3731,7 @@ declare const questExperienceSchema: z.ZodObject<{
|
|
|
3692
3731
|
fulfillment: z.ZodObject<{
|
|
3693
3732
|
kind: z.ZodString;
|
|
3694
3733
|
}, z.core.$loose>;
|
|
3734
|
+
key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3695
3735
|
}, z.core.$loose>;
|
|
3696
3736
|
earnedTier: z.ZodString;
|
|
3697
3737
|
tier: z.ZodString;
|
|
@@ -3726,6 +3766,7 @@ declare const questExperienceSchema: z.ZodObject<{
|
|
|
3726
3766
|
fulfillment: z.ZodObject<{
|
|
3727
3767
|
kind: z.ZodString;
|
|
3728
3768
|
}, z.core.$loose>;
|
|
3769
|
+
key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3729
3770
|
}, z.core.$loose>;
|
|
3730
3771
|
earnedTier: z.ZodString;
|
|
3731
3772
|
tier: z.ZodString;
|
|
@@ -3748,6 +3789,7 @@ declare const questExperienceSchema: z.ZodObject<{
|
|
|
3748
3789
|
fulfillment: z.ZodObject<{
|
|
3749
3790
|
kind: z.ZodString;
|
|
3750
3791
|
}, z.core.$loose>;
|
|
3792
|
+
key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3751
3793
|
}, z.core.$loose>;
|
|
3752
3794
|
earnedTier: z.ZodString;
|
|
3753
3795
|
tier: z.ZodString;
|
|
@@ -3769,6 +3811,7 @@ declare const questExperienceSchema: z.ZodObject<{
|
|
|
3769
3811
|
fulfillment: z.ZodObject<{
|
|
3770
3812
|
kind: z.ZodString;
|
|
3771
3813
|
}, z.core.$loose>;
|
|
3814
|
+
key: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
3772
3815
|
}, z.core.$loose>;
|
|
3773
3816
|
earnedTier: z.ZodString;
|
|
3774
3817
|
tier: z.ZodString;
|
|
@@ -3795,6 +3838,7 @@ declare const questExperienceSchema: z.ZodObject<{
|
|
|
3795
3838
|
[x: string]: unknown;
|
|
3796
3839
|
kind: string;
|
|
3797
3840
|
};
|
|
3841
|
+
key?: string | null | undefined;
|
|
3798
3842
|
};
|
|
3799
3843
|
earnedTier: string;
|
|
3800
3844
|
tier: string;
|
|
@@ -3821,6 +3865,7 @@ declare const questExperienceSchema: z.ZodObject<{
|
|
|
3821
3865
|
[x: string]: unknown;
|
|
3822
3866
|
kind: string;
|
|
3823
3867
|
};
|
|
3868
|
+
key?: string | null | undefined;
|
|
3824
3869
|
};
|
|
3825
3870
|
earnedTier: string;
|
|
3826
3871
|
tier: string;
|
|
@@ -4292,6 +4337,13 @@ declare const questExperienceSchema: z.ZodObject<{
|
|
|
4292
4337
|
}, z.core.$strip>>>;
|
|
4293
4338
|
requestedReview: z.ZodDefault<z.ZodBoolean>;
|
|
4294
4339
|
createdAt: z.ZodNumber;
|
|
4340
|
+
action: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
4341
|
+
kind: z.ZodType<KnownAttemptActionKind | (string & {})>;
|
|
4342
|
+
chain: z.ZodString;
|
|
4343
|
+
signature: z.ZodString;
|
|
4344
|
+
wallet: z.ZodString;
|
|
4345
|
+
reference: z.ZodNullable<z.ZodString>;
|
|
4346
|
+
}, z.core.$strip>>>;
|
|
4295
4347
|
}, z.core.$strip>>;
|
|
4296
4348
|
release: z.ZodString;
|
|
4297
4349
|
interaction: z.ZodEnum<{
|
|
@@ -4814,6 +4866,13 @@ declare const questExperienceSchema: z.ZodObject<{
|
|
|
4814
4866
|
}, z.core.$strip>>>;
|
|
4815
4867
|
requestedReview: z.ZodDefault<z.ZodBoolean>;
|
|
4816
4868
|
createdAt: z.ZodNumber;
|
|
4869
|
+
action: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
4870
|
+
kind: z.ZodType<KnownAttemptActionKind | (string & {})>;
|
|
4871
|
+
chain: z.ZodString;
|
|
4872
|
+
signature: z.ZodString;
|
|
4873
|
+
wallet: z.ZodString;
|
|
4874
|
+
reference: z.ZodNullable<z.ZodString>;
|
|
4875
|
+
}, z.core.$strip>>>;
|
|
4817
4876
|
}, z.core.$strip>>;
|
|
4818
4877
|
release: z.ZodString;
|
|
4819
4878
|
interaction: z.ZodEnum<{
|
|
@@ -5418,6 +5477,12 @@ declare const questPublicationPreviewSchema: z.ZodObject<{
|
|
|
5418
5477
|
}, z.core.$strict>>>;
|
|
5419
5478
|
retryCooldownMs: z.ZodOptional<z.ZodNumber>;
|
|
5420
5479
|
completionCooldownMs: z.ZodOptional<z.ZodNumber>;
|
|
5480
|
+
stations: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
5481
|
+
key: z.ZodString;
|
|
5482
|
+
label: z.ZodString;
|
|
5483
|
+
opensAt: z.ZodOptional<z.ZodNumber>;
|
|
5484
|
+
closesAt: z.ZodOptional<z.ZodNumber>;
|
|
5485
|
+
}, z.core.$strict>>>;
|
|
5421
5486
|
completion: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
5422
5487
|
kind: z.ZodLiteral<"streak">;
|
|
5423
5488
|
days: z.ZodNumber;
|
|
@@ -5582,4 +5647,5 @@ declare const allocatedQuestSchema: z.ZodObject<{
|
|
|
5582
5647
|
id: z.ZodString;
|
|
5583
5648
|
}, z.core.$strip>;
|
|
5584
5649
|
|
|
5585
|
-
export {
|
|
5650
|
+
export { allocateQuestSchema as f, allocatedQuestSchema as g, catalogDeploymentPreviewSchema as h, catalogDeploymentSchema as i, collectionSlotDeclarationSchema as j, collectionSlotSchema as k, collectionViewSchema as l, interactionSchema as m, questCatalogSchema as n, questCollectionSchema as o, publishQuestDraftSchema as p, questExperienceSchema as q, questDraftChangesSchema as r, questDraftSchema as s, questInstanceSchema as t, questInteraction as u, questPublicationPreviewSchema as v, questRewardViewSchema as w, questTypeVersionSchema as x, questViewSchema as y, saveQuestDraftSchema as z };
|
|
5651
|
+
export type { QuestInteraction as Q, QuestRewardView as a, QuestView as b, QuestCatalog as c, QuestDraft as d, QuestInstance as e };
|
|
@@ -12,10 +12,10 @@ import {
|
|
|
12
12
|
resourceHandle,
|
|
13
13
|
responseShape,
|
|
14
14
|
tierRewardSchema
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-CQVKOD3B.js";
|
|
16
16
|
import {
|
|
17
17
|
parseDefinition
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-VNEJH4NT.js";
|
|
19
19
|
|
|
20
20
|
// src/engagement.ts
|
|
21
21
|
import * as z from "zod";
|
|
@@ -3,9 +3,10 @@ import {
|
|
|
3
3
|
discordMessageTextDataSchema,
|
|
4
4
|
discordReactionDataSchema,
|
|
5
5
|
isKnownTrackerSource,
|
|
6
|
+
takesSolanaTransaction,
|
|
6
7
|
trackerDataSchema,
|
|
7
8
|
xAccountRoles
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-CQVKOD3B.js";
|
|
9
10
|
|
|
10
11
|
// src/quest-shape.ts
|
|
11
12
|
function validateQuestShape(description, options = {}) {
|
|
@@ -16,7 +17,8 @@ function validateQuestShape(description, options = {}) {
|
|
|
16
17
|
performance,
|
|
17
18
|
retryCooldownMs,
|
|
18
19
|
completionCooldownMs,
|
|
19
|
-
authorBudgets = []
|
|
20
|
+
authorBudgets = [],
|
|
21
|
+
stations
|
|
20
22
|
} = description;
|
|
21
23
|
const tracker = trigger.kind === "automatic" ? trigger.tracker : void 0;
|
|
22
24
|
const content = tracker?.content === true;
|
|
@@ -55,6 +57,16 @@ function validateQuestShape(description, options = {}) {
|
|
|
55
57
|
);
|
|
56
58
|
}
|
|
57
59
|
}
|
|
60
|
+
if (stations && options.template) {
|
|
61
|
+
throw new Error(
|
|
62
|
+
"Reusable quest types cannot declare check-in stations: declare them on a quest written in code"
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
if (stations && !takesSolanaTransaction(trigger)) {
|
|
66
|
+
throw new Error(
|
|
67
|
+
"Stations are for quests a signed Solana transaction completes: a member-submitted manual() quest without input"
|
|
68
|
+
);
|
|
69
|
+
}
|
|
58
70
|
if (trigger.kind === "automatic" && !tracker) {
|
|
59
71
|
if (!options.template && requires.length === 0) {
|
|
60
72
|
throw new Error("Automatic quests need at least one prerequisite");
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import {
|
|
2
|
-
base58Bytes
|
|
3
|
-
} from "./chunk-UWUS4OOV.js";
|
|
4
1
|
import {
|
|
5
2
|
createHttpExchange,
|
|
6
3
|
uncertainStatuses
|
|
7
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-WVK3G2J2.js";
|
|
8
5
|
import {
|
|
9
6
|
MANAGEMENT_TIMEOUT,
|
|
10
7
|
lifetime,
|
|
11
8
|
retrying,
|
|
12
9
|
validTimeout
|
|
13
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-SWLW4VN3.js";
|
|
14
11
|
import {
|
|
12
|
+
base58Bytes,
|
|
15
13
|
evmAddressSchema,
|
|
16
|
-
knownResponse
|
|
17
|
-
|
|
14
|
+
knownResponse,
|
|
15
|
+
solanaDevnet,
|
|
16
|
+
solanaMainnet
|
|
17
|
+
} from "./chunk-CQVKOD3B.js";
|
|
18
18
|
import {
|
|
19
19
|
RequestError,
|
|
20
20
|
isRequestError
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-VNEJH4NT.js";
|
|
22
22
|
|
|
23
23
|
// src/configuration.ts
|
|
24
24
|
function questConfiguration(release) {
|
|
@@ -116,6 +116,45 @@ async function walletSignatureValid(input) {
|
|
|
116
116
|
}
|
|
117
117
|
}
|
|
118
118
|
|
|
119
|
+
// src/solana-rpc.ts
|
|
120
|
+
var solanaPublicEndpoints = {
|
|
121
|
+
[solanaMainnet]: "https://api.mainnet-beta.solana.com",
|
|
122
|
+
[solanaDevnet]: "https://api.devnet.solana.com"
|
|
123
|
+
};
|
|
124
|
+
async function solanaRpc(url, method, params) {
|
|
125
|
+
const response = await fetch(url, {
|
|
126
|
+
method: "POST",
|
|
127
|
+
headers: { "Content-Type": "application/json" },
|
|
128
|
+
body: JSON.stringify({ jsonrpc: "2.0", id: 1, method, params }),
|
|
129
|
+
signal: AbortSignal.timeout(3e4)
|
|
130
|
+
});
|
|
131
|
+
const answer = await response.json();
|
|
132
|
+
if (answer.error) {
|
|
133
|
+
throw new Error(answer.error.message ?? JSON.stringify(answer.error));
|
|
134
|
+
}
|
|
135
|
+
return answer.result;
|
|
136
|
+
}
|
|
137
|
+
async function confirmedSignature(url, signature, lastValidBlockHeight) {
|
|
138
|
+
for (; ; ) {
|
|
139
|
+
const {
|
|
140
|
+
value: [status]
|
|
141
|
+
} = await solanaRpc(url, "getSignatureStatuses", [[signature]]);
|
|
142
|
+
if (status?.err) {
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
if (status?.confirmationStatus === "confirmed" || status?.confirmationStatus === "finalized") {
|
|
146
|
+
return true;
|
|
147
|
+
}
|
|
148
|
+
const height = await solanaRpc(url, "getBlockHeight", [
|
|
149
|
+
{ commitment: "confirmed" }
|
|
150
|
+
]);
|
|
151
|
+
if (height > lastValidBlockHeight) {
|
|
152
|
+
return false;
|
|
153
|
+
}
|
|
154
|
+
await new Promise((resolve) => setTimeout(resolve, 2e3));
|
|
155
|
+
}
|
|
156
|
+
}
|
|
157
|
+
|
|
119
158
|
// src/server/errors.ts
|
|
120
159
|
import * as z from "zod";
|
|
121
160
|
var ManagementErrorCode = {
|
|
@@ -403,6 +442,9 @@ export {
|
|
|
403
442
|
hex,
|
|
404
443
|
canonicalWalletAddress,
|
|
405
444
|
walletSignatureValid,
|
|
445
|
+
solanaPublicEndpoints,
|
|
446
|
+
solanaRpc,
|
|
447
|
+
confirmedSignature,
|
|
406
448
|
ManagementErrorCode,
|
|
407
449
|
managementErrorSchema,
|
|
408
450
|
isManagementError,
|