@farcaster/frame-core 0.0.0-canary-20250430150627
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/LICENSE +21 -0
- package/README.md +13 -0
- package/dist/actions/AddFrame.d.ts +36 -0
- package/dist/actions/AddFrame.js +57 -0
- package/dist/actions/ComposeCast.d.ts +32 -0
- package/dist/actions/ComposeCast.js +2 -0
- package/dist/actions/Ready.d.ts +13 -0
- package/dist/actions/Ready.js +6 -0
- package/dist/actions/SendToken.d.ts +48 -0
- package/dist/actions/SendToken.js +2 -0
- package/dist/actions/SignIn.d.ts +41 -0
- package/dist/actions/SignIn.js +47 -0
- package/dist/actions/SwapToken.d.ts +46 -0
- package/dist/actions/SwapToken.js +2 -0
- package/dist/actions/ViewProfile.d.ts +4 -0
- package/dist/actions/ViewProfile.js +2 -0
- package/dist/actions/ViewToken.d.ts +4 -0
- package/dist/actions/ViewToken.js +2 -0
- package/dist/actions/index.d.ts +8 -0
- package/dist/actions/index.js +44 -0
- package/dist/context.d.ts +72 -0
- package/dist/context.js +2 -0
- package/dist/errors.d.ts +13 -0
- package/dist/errors.js +12 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.js +46 -0
- package/dist/internal/types.d.ts +8 -0
- package/dist/internal/types.js +2 -0
- package/dist/manifest.d.ts +101 -0
- package/dist/manifest.js +2 -0
- package/dist/schemas/embeds.d.ts +243 -0
- package/dist/schemas/embeds.js +32 -0
- package/dist/schemas/events.d.ts +131 -0
- package/dist/schemas/events.js +25 -0
- package/dist/schemas/index.d.ts +5 -0
- package/dist/schemas/index.js +21 -0
- package/dist/schemas/manifest.d.ts +208 -0
- package/dist/schemas/manifest.js +61 -0
- package/dist/schemas/notifications.d.ts +60 -0
- package/dist/schemas/notifications.js +23 -0
- package/dist/schemas/shared.d.ts +39 -0
- package/dist/schemas/shared.js +58 -0
- package/dist/types.d.ts +60 -0
- package/dist/types.js +21 -0
- package/dist/wallet/ethereum.d.ts +47 -0
- package/dist/wallet/ethereum.js +2 -0
- package/dist/wallet/index.d.ts +1 -0
- package/dist/wallet/index.js +37 -0
- package/esm/actions/AddFrame.d.ts +36 -0
- package/esm/actions/AddFrame.js +19 -0
- package/esm/actions/ComposeCast.d.ts +32 -0
- package/esm/actions/ComposeCast.js +1 -0
- package/esm/actions/Ready.d.ts +13 -0
- package/esm/actions/Ready.js +3 -0
- package/esm/actions/SendToken.d.ts +48 -0
- package/esm/actions/SendToken.js +1 -0
- package/esm/actions/SignIn.d.ts +41 -0
- package/esm/actions/SignIn.js +10 -0
- package/esm/actions/SwapToken.d.ts +46 -0
- package/esm/actions/SwapToken.js +1 -0
- package/esm/actions/ViewProfile.d.ts +4 -0
- package/esm/actions/ViewProfile.js +1 -0
- package/esm/actions/ViewToken.d.ts +4 -0
- package/esm/actions/ViewToken.js +1 -0
- package/esm/actions/index.d.ts +8 -0
- package/esm/actions/index.js +8 -0
- package/esm/context.d.ts +72 -0
- package/esm/context.js +1 -0
- package/esm/errors.d.ts +13 -0
- package/esm/errors.js +8 -0
- package/esm/index.d.ts +7 -0
- package/esm/index.js +7 -0
- package/esm/internal/types.d.ts +8 -0
- package/esm/internal/types.js +1 -0
- package/esm/manifest.d.ts +101 -0
- package/esm/manifest.js +1 -0
- package/esm/schemas/embeds.d.ts +243 -0
- package/esm/schemas/embeds.js +28 -0
- package/esm/schemas/events.d.ts +131 -0
- package/esm/schemas/events.js +22 -0
- package/esm/schemas/index.d.ts +5 -0
- package/esm/schemas/index.js +5 -0
- package/esm/schemas/manifest.d.ts +208 -0
- package/esm/schemas/manifest.js +58 -0
- package/esm/schemas/notifications.d.ts +60 -0
- package/esm/schemas/notifications.js +20 -0
- package/esm/schemas/shared.d.ts +39 -0
- package/esm/schemas/shared.js +54 -0
- package/esm/tsconfig.tsbuildinfo +1 -0
- package/esm/types.d.ts +60 -0
- package/esm/types.js +3 -0
- package/esm/wallet/ethereum.d.ts +47 -0
- package/esm/wallet/ethereum.js +1 -0
- package/esm/wallet/index.d.ts +1 -0
- package/esm/wallet/index.js +1 -0
- package/package.json +41 -0
- package/src/actions/AddFrame.ts +51 -0
- package/src/actions/ComposeCast.ts +36 -0
- package/src/actions/Ready.ts +15 -0
- package/src/actions/SendToken.ts +57 -0
- package/src/actions/SignIn.ts +51 -0
- package/src/actions/SwapToken.ts +54 -0
- package/src/actions/ViewProfile.ts +5 -0
- package/src/actions/ViewToken.ts +5 -0
- package/src/actions/index.ts +8 -0
- package/src/context.ts +90 -0
- package/src/errors.ts +21 -0
- package/src/index.ts +7 -0
- package/src/internal/types.ts +20 -0
- package/src/manifest.ts +113 -0
- package/src/schemas/embeds.ts +44 -0
- package/src/schemas/events.ts +41 -0
- package/src/schemas/index.ts +5 -0
- package/src/schemas/manifest.ts +68 -0
- package/src/schemas/notifications.ts +33 -0
- package/src/schemas/shared.ts +81 -0
- package/src/types.ts +95 -0
- package/src/wallet/ethereum.ts +65 -0
- package/src/wallet/index.ts +1 -0
|
@@ -0,0 +1,208 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const domainFrameConfigSchema: z.ZodObject<{
|
|
3
|
+
version: z.ZodUnion<[z.ZodLiteral<"0.0.0">, z.ZodLiteral<"0.0.1">, z.ZodLiteral<"1">, z.ZodLiteral<"next">]>;
|
|
4
|
+
name: z.ZodString;
|
|
5
|
+
iconUrl: z.ZodString;
|
|
6
|
+
homeUrl: z.ZodString;
|
|
7
|
+
/** deprecated, set ogImageUrl instead */
|
|
8
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
9
|
+
/** deprecated, will rely on fc:frame meta tag */
|
|
10
|
+
buttonTitle: z.ZodOptional<z.ZodString>;
|
|
11
|
+
splashImageUrl: z.ZodOptional<z.ZodString>;
|
|
12
|
+
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
13
|
+
webhookUrl: z.ZodOptional<z.ZodString>;
|
|
14
|
+
/** see: https://github.com/farcasterxyz/miniapps/discussions/191 */
|
|
15
|
+
subtitle: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
16
|
+
description: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
17
|
+
screenshotUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
18
|
+
primaryCategory: z.ZodOptional<z.ZodEnum<["games", "social", "finance", "utility", "productivity", "health-fitness", "news-media", "music", "shopping", "education", "developer-tools", "entertainment", "art-creativity"]>>;
|
|
19
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, "many">>;
|
|
20
|
+
heroImageUrl: z.ZodOptional<z.ZodString>;
|
|
21
|
+
tagline: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
22
|
+
ogTitle: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
23
|
+
ogDescription: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
24
|
+
ogImageUrl: z.ZodOptional<z.ZodString>;
|
|
25
|
+
/** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
|
|
26
|
+
noindex: z.ZodOptional<z.ZodBoolean>;
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
name: string;
|
|
29
|
+
version: "next" | "1" | "0.0.0" | "0.0.1";
|
|
30
|
+
iconUrl: string;
|
|
31
|
+
homeUrl: string;
|
|
32
|
+
splashImageUrl?: string | undefined;
|
|
33
|
+
splashBackgroundColor?: string | undefined;
|
|
34
|
+
imageUrl?: string | undefined;
|
|
35
|
+
buttonTitle?: string | undefined;
|
|
36
|
+
webhookUrl?: string | undefined;
|
|
37
|
+
subtitle?: string | undefined;
|
|
38
|
+
description?: string | undefined;
|
|
39
|
+
screenshotUrls?: string[] | undefined;
|
|
40
|
+
primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
|
|
41
|
+
tags?: string[] | undefined;
|
|
42
|
+
heroImageUrl?: string | undefined;
|
|
43
|
+
tagline?: string | undefined;
|
|
44
|
+
ogTitle?: string | undefined;
|
|
45
|
+
ogDescription?: string | undefined;
|
|
46
|
+
ogImageUrl?: string | undefined;
|
|
47
|
+
noindex?: boolean | undefined;
|
|
48
|
+
}, {
|
|
49
|
+
name: string;
|
|
50
|
+
version: "next" | "1" | "0.0.0" | "0.0.1";
|
|
51
|
+
iconUrl: string;
|
|
52
|
+
homeUrl: string;
|
|
53
|
+
splashImageUrl?: string | undefined;
|
|
54
|
+
splashBackgroundColor?: string | undefined;
|
|
55
|
+
imageUrl?: string | undefined;
|
|
56
|
+
buttonTitle?: string | undefined;
|
|
57
|
+
webhookUrl?: string | undefined;
|
|
58
|
+
subtitle?: string | undefined;
|
|
59
|
+
description?: string | undefined;
|
|
60
|
+
screenshotUrls?: string[] | undefined;
|
|
61
|
+
primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
|
|
62
|
+
tags?: string[] | undefined;
|
|
63
|
+
heroImageUrl?: string | undefined;
|
|
64
|
+
tagline?: string | undefined;
|
|
65
|
+
ogTitle?: string | undefined;
|
|
66
|
+
ogDescription?: string | undefined;
|
|
67
|
+
ogImageUrl?: string | undefined;
|
|
68
|
+
noindex?: boolean | undefined;
|
|
69
|
+
}>;
|
|
70
|
+
export declare const domainManifestSchema: z.ZodObject<{
|
|
71
|
+
accountAssociation: z.ZodObject<{
|
|
72
|
+
header: z.ZodString;
|
|
73
|
+
payload: z.ZodString;
|
|
74
|
+
signature: z.ZodString;
|
|
75
|
+
}, "strip", z.ZodTypeAny, {
|
|
76
|
+
header: string;
|
|
77
|
+
payload: string;
|
|
78
|
+
signature: string;
|
|
79
|
+
}, {
|
|
80
|
+
header: string;
|
|
81
|
+
payload: string;
|
|
82
|
+
signature: string;
|
|
83
|
+
}>;
|
|
84
|
+
frame: z.ZodOptional<z.ZodObject<{
|
|
85
|
+
version: z.ZodUnion<[z.ZodLiteral<"0.0.0">, z.ZodLiteral<"0.0.1">, z.ZodLiteral<"1">, z.ZodLiteral<"next">]>;
|
|
86
|
+
name: z.ZodString;
|
|
87
|
+
iconUrl: z.ZodString;
|
|
88
|
+
homeUrl: z.ZodString;
|
|
89
|
+
/** deprecated, set ogImageUrl instead */
|
|
90
|
+
imageUrl: z.ZodOptional<z.ZodString>;
|
|
91
|
+
/** deprecated, will rely on fc:frame meta tag */
|
|
92
|
+
buttonTitle: z.ZodOptional<z.ZodString>;
|
|
93
|
+
splashImageUrl: z.ZodOptional<z.ZodString>;
|
|
94
|
+
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
95
|
+
webhookUrl: z.ZodOptional<z.ZodString>;
|
|
96
|
+
/** see: https://github.com/farcasterxyz/miniapps/discussions/191 */
|
|
97
|
+
subtitle: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
98
|
+
description: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
99
|
+
screenshotUrls: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
100
|
+
primaryCategory: z.ZodOptional<z.ZodEnum<["games", "social", "finance", "utility", "productivity", "health-fitness", "news-media", "music", "shopping", "education", "developer-tools", "entertainment", "art-creativity"]>>;
|
|
101
|
+
tags: z.ZodOptional<z.ZodArray<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>, "many">>;
|
|
102
|
+
heroImageUrl: z.ZodOptional<z.ZodString>;
|
|
103
|
+
tagline: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
104
|
+
ogTitle: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
105
|
+
ogDescription: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>>;
|
|
106
|
+
ogImageUrl: z.ZodOptional<z.ZodString>;
|
|
107
|
+
/** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
|
|
108
|
+
noindex: z.ZodOptional<z.ZodBoolean>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
name: string;
|
|
111
|
+
version: "next" | "1" | "0.0.0" | "0.0.1";
|
|
112
|
+
iconUrl: string;
|
|
113
|
+
homeUrl: string;
|
|
114
|
+
splashImageUrl?: string | undefined;
|
|
115
|
+
splashBackgroundColor?: string | undefined;
|
|
116
|
+
imageUrl?: string | undefined;
|
|
117
|
+
buttonTitle?: string | undefined;
|
|
118
|
+
webhookUrl?: string | undefined;
|
|
119
|
+
subtitle?: string | undefined;
|
|
120
|
+
description?: string | undefined;
|
|
121
|
+
screenshotUrls?: string[] | undefined;
|
|
122
|
+
primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
|
|
123
|
+
tags?: string[] | undefined;
|
|
124
|
+
heroImageUrl?: string | undefined;
|
|
125
|
+
tagline?: string | undefined;
|
|
126
|
+
ogTitle?: string | undefined;
|
|
127
|
+
ogDescription?: string | undefined;
|
|
128
|
+
ogImageUrl?: string | undefined;
|
|
129
|
+
noindex?: boolean | undefined;
|
|
130
|
+
}, {
|
|
131
|
+
name: string;
|
|
132
|
+
version: "next" | "1" | "0.0.0" | "0.0.1";
|
|
133
|
+
iconUrl: string;
|
|
134
|
+
homeUrl: string;
|
|
135
|
+
splashImageUrl?: string | undefined;
|
|
136
|
+
splashBackgroundColor?: string | undefined;
|
|
137
|
+
imageUrl?: string | undefined;
|
|
138
|
+
buttonTitle?: string | undefined;
|
|
139
|
+
webhookUrl?: string | undefined;
|
|
140
|
+
subtitle?: string | undefined;
|
|
141
|
+
description?: string | undefined;
|
|
142
|
+
screenshotUrls?: string[] | undefined;
|
|
143
|
+
primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
|
|
144
|
+
tags?: string[] | undefined;
|
|
145
|
+
heroImageUrl?: string | undefined;
|
|
146
|
+
tagline?: string | undefined;
|
|
147
|
+
ogTitle?: string | undefined;
|
|
148
|
+
ogDescription?: string | undefined;
|
|
149
|
+
ogImageUrl?: string | undefined;
|
|
150
|
+
noindex?: boolean | undefined;
|
|
151
|
+
}>>;
|
|
152
|
+
}, "strip", z.ZodTypeAny, {
|
|
153
|
+
accountAssociation: {
|
|
154
|
+
header: string;
|
|
155
|
+
payload: string;
|
|
156
|
+
signature: string;
|
|
157
|
+
};
|
|
158
|
+
frame?: {
|
|
159
|
+
name: string;
|
|
160
|
+
version: "next" | "1" | "0.0.0" | "0.0.1";
|
|
161
|
+
iconUrl: string;
|
|
162
|
+
homeUrl: string;
|
|
163
|
+
splashImageUrl?: string | undefined;
|
|
164
|
+
splashBackgroundColor?: string | undefined;
|
|
165
|
+
imageUrl?: string | undefined;
|
|
166
|
+
buttonTitle?: string | undefined;
|
|
167
|
+
webhookUrl?: string | undefined;
|
|
168
|
+
subtitle?: string | undefined;
|
|
169
|
+
description?: string | undefined;
|
|
170
|
+
screenshotUrls?: string[] | undefined;
|
|
171
|
+
primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
|
|
172
|
+
tags?: string[] | undefined;
|
|
173
|
+
heroImageUrl?: string | undefined;
|
|
174
|
+
tagline?: string | undefined;
|
|
175
|
+
ogTitle?: string | undefined;
|
|
176
|
+
ogDescription?: string | undefined;
|
|
177
|
+
ogImageUrl?: string | undefined;
|
|
178
|
+
noindex?: boolean | undefined;
|
|
179
|
+
} | undefined;
|
|
180
|
+
}, {
|
|
181
|
+
accountAssociation: {
|
|
182
|
+
header: string;
|
|
183
|
+
payload: string;
|
|
184
|
+
signature: string;
|
|
185
|
+
};
|
|
186
|
+
frame?: {
|
|
187
|
+
name: string;
|
|
188
|
+
version: "next" | "1" | "0.0.0" | "0.0.1";
|
|
189
|
+
iconUrl: string;
|
|
190
|
+
homeUrl: string;
|
|
191
|
+
splashImageUrl?: string | undefined;
|
|
192
|
+
splashBackgroundColor?: string | undefined;
|
|
193
|
+
imageUrl?: string | undefined;
|
|
194
|
+
buttonTitle?: string | undefined;
|
|
195
|
+
webhookUrl?: string | undefined;
|
|
196
|
+
subtitle?: string | undefined;
|
|
197
|
+
description?: string | undefined;
|
|
198
|
+
screenshotUrls?: string[] | undefined;
|
|
199
|
+
primaryCategory?: "games" | "social" | "finance" | "utility" | "productivity" | "health-fitness" | "news-media" | "music" | "shopping" | "education" | "developer-tools" | "entertainment" | "art-creativity" | undefined;
|
|
200
|
+
tags?: string[] | undefined;
|
|
201
|
+
heroImageUrl?: string | undefined;
|
|
202
|
+
tagline?: string | undefined;
|
|
203
|
+
ogTitle?: string | undefined;
|
|
204
|
+
ogDescription?: string | undefined;
|
|
205
|
+
ogImageUrl?: string | undefined;
|
|
206
|
+
noindex?: boolean | undefined;
|
|
207
|
+
} | undefined;
|
|
208
|
+
}>;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.domainManifestSchema = exports.domainFrameConfigSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const shared_1 = require("./shared");
|
|
6
|
+
const primaryCategorySchema = zod_1.z.enum([
|
|
7
|
+
'games',
|
|
8
|
+
'social',
|
|
9
|
+
'finance',
|
|
10
|
+
'utility',
|
|
11
|
+
'productivity',
|
|
12
|
+
'health-fitness',
|
|
13
|
+
'news-media',
|
|
14
|
+
'music',
|
|
15
|
+
'shopping',
|
|
16
|
+
'education',
|
|
17
|
+
'developer-tools',
|
|
18
|
+
'entertainment',
|
|
19
|
+
'art-creativity',
|
|
20
|
+
]);
|
|
21
|
+
exports.domainFrameConfigSchema = zod_1.z.object({
|
|
22
|
+
// 0.0.0 and 0.0.1 are not technically part of the spec but kept for
|
|
23
|
+
// backwards compatibilty. next should always resolve to the most recent
|
|
24
|
+
// schema version.
|
|
25
|
+
version: zod_1.z.union([
|
|
26
|
+
zod_1.z.literal('0.0.0'),
|
|
27
|
+
zod_1.z.literal('0.0.1'),
|
|
28
|
+
zod_1.z.literal('1'),
|
|
29
|
+
zod_1.z.literal('next'),
|
|
30
|
+
]),
|
|
31
|
+
name: shared_1.frameNameSchema,
|
|
32
|
+
iconUrl: shared_1.secureUrlSchema,
|
|
33
|
+
homeUrl: shared_1.secureUrlSchema,
|
|
34
|
+
/** deprecated, set ogImageUrl instead */
|
|
35
|
+
imageUrl: shared_1.secureUrlSchema.optional(),
|
|
36
|
+
/** deprecated, will rely on fc:frame meta tag */
|
|
37
|
+
buttonTitle: shared_1.buttonTitleSchema.optional(),
|
|
38
|
+
splashImageUrl: shared_1.secureUrlSchema.optional(),
|
|
39
|
+
splashBackgroundColor: shared_1.hexColorSchema.optional(),
|
|
40
|
+
webhookUrl: shared_1.secureUrlSchema.optional(),
|
|
41
|
+
/** see: https://github.com/farcasterxyz/miniapps/discussions/191 */
|
|
42
|
+
subtitle: (0, shared_1.createSimpleStringSchema)({ max: 30 }).optional(),
|
|
43
|
+
description: (0, shared_1.createSimpleStringSchema)({ max: 170 }).optional(),
|
|
44
|
+
screenshotUrls: zod_1.z.array(shared_1.secureUrlSchema).max(3).optional(),
|
|
45
|
+
primaryCategory: primaryCategorySchema.optional(),
|
|
46
|
+
tags: zod_1.z
|
|
47
|
+
.array((0, shared_1.createSimpleStringSchema)({ max: 20, noSpaces: true }))
|
|
48
|
+
.max(5)
|
|
49
|
+
.optional(),
|
|
50
|
+
heroImageUrl: shared_1.secureUrlSchema.optional(),
|
|
51
|
+
tagline: (0, shared_1.createSimpleStringSchema)({ max: 30 }).optional(),
|
|
52
|
+
ogTitle: (0, shared_1.createSimpleStringSchema)({ max: 30 }).optional(),
|
|
53
|
+
ogDescription: (0, shared_1.createSimpleStringSchema)({ max: 100 }).optional(),
|
|
54
|
+
ogImageUrl: shared_1.secureUrlSchema.optional(),
|
|
55
|
+
/** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
|
|
56
|
+
noindex: zod_1.z.boolean().optional(),
|
|
57
|
+
});
|
|
58
|
+
exports.domainManifestSchema = zod_1.z.object({
|
|
59
|
+
accountAssociation: shared_1.encodedJsonFarcasterSignatureSchema,
|
|
60
|
+
frame: exports.domainFrameConfigSchema.optional(),
|
|
61
|
+
});
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const notificationDetailsSchema: z.ZodObject<{
|
|
3
|
+
url: z.ZodString;
|
|
4
|
+
token: z.ZodString;
|
|
5
|
+
}, "strip", z.ZodTypeAny, {
|
|
6
|
+
url: string;
|
|
7
|
+
token: string;
|
|
8
|
+
}, {
|
|
9
|
+
url: string;
|
|
10
|
+
token: string;
|
|
11
|
+
}>;
|
|
12
|
+
export type FrameNotificationDetails = z.infer<typeof notificationDetailsSchema>;
|
|
13
|
+
export declare const sendNotificationRequestSchema: z.ZodObject<{
|
|
14
|
+
notificationId: z.ZodString;
|
|
15
|
+
title: z.ZodString;
|
|
16
|
+
body: z.ZodString;
|
|
17
|
+
targetUrl: z.ZodString;
|
|
18
|
+
tokens: z.ZodArray<z.ZodString, "many">;
|
|
19
|
+
}, "strip", z.ZodTypeAny, {
|
|
20
|
+
title: string;
|
|
21
|
+
notificationId: string;
|
|
22
|
+
body: string;
|
|
23
|
+
targetUrl: string;
|
|
24
|
+
tokens: string[];
|
|
25
|
+
}, {
|
|
26
|
+
title: string;
|
|
27
|
+
notificationId: string;
|
|
28
|
+
body: string;
|
|
29
|
+
targetUrl: string;
|
|
30
|
+
tokens: string[];
|
|
31
|
+
}>;
|
|
32
|
+
export type SendNotificationRequest = z.infer<typeof sendNotificationRequestSchema>;
|
|
33
|
+
export declare const sendNotificationResponseSchema: z.ZodObject<{
|
|
34
|
+
result: z.ZodObject<{
|
|
35
|
+
successfulTokens: z.ZodArray<z.ZodString, "many">;
|
|
36
|
+
invalidTokens: z.ZodArray<z.ZodString, "many">;
|
|
37
|
+
rateLimitedTokens: z.ZodArray<z.ZodString, "many">;
|
|
38
|
+
}, "strip", z.ZodTypeAny, {
|
|
39
|
+
successfulTokens: string[];
|
|
40
|
+
invalidTokens: string[];
|
|
41
|
+
rateLimitedTokens: string[];
|
|
42
|
+
}, {
|
|
43
|
+
successfulTokens: string[];
|
|
44
|
+
invalidTokens: string[];
|
|
45
|
+
rateLimitedTokens: string[];
|
|
46
|
+
}>;
|
|
47
|
+
}, "strip", z.ZodTypeAny, {
|
|
48
|
+
result: {
|
|
49
|
+
successfulTokens: string[];
|
|
50
|
+
invalidTokens: string[];
|
|
51
|
+
rateLimitedTokens: string[];
|
|
52
|
+
};
|
|
53
|
+
}, {
|
|
54
|
+
result: {
|
|
55
|
+
successfulTokens: string[];
|
|
56
|
+
invalidTokens: string[];
|
|
57
|
+
rateLimitedTokens: string[];
|
|
58
|
+
};
|
|
59
|
+
}>;
|
|
60
|
+
export type SendNotificationResponse = z.infer<typeof sendNotificationResponseSchema>;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sendNotificationResponseSchema = exports.sendNotificationRequestSchema = exports.notificationDetailsSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const shared_1 = require("./shared");
|
|
6
|
+
exports.notificationDetailsSchema = zod_1.z.object({
|
|
7
|
+
url: zod_1.z.string(),
|
|
8
|
+
token: zod_1.z.string(),
|
|
9
|
+
});
|
|
10
|
+
exports.sendNotificationRequestSchema = zod_1.z.object({
|
|
11
|
+
notificationId: zod_1.z.string().max(128),
|
|
12
|
+
title: zod_1.z.string().max(32),
|
|
13
|
+
body: zod_1.z.string().max(128),
|
|
14
|
+
targetUrl: shared_1.secureUrlSchema,
|
|
15
|
+
tokens: zod_1.z.string().array().max(100),
|
|
16
|
+
});
|
|
17
|
+
exports.sendNotificationResponseSchema = zod_1.z.object({
|
|
18
|
+
result: zod_1.z.object({
|
|
19
|
+
successfulTokens: zod_1.z.array(zod_1.z.string()),
|
|
20
|
+
invalidTokens: zod_1.z.array(zod_1.z.string()),
|
|
21
|
+
rateLimitedTokens: zod_1.z.array(zod_1.z.string()),
|
|
22
|
+
}),
|
|
23
|
+
});
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
export declare const createSimpleStringSchema: ({ max, noSpaces, }?: {
|
|
3
|
+
max?: number;
|
|
4
|
+
noSpaces?: boolean;
|
|
5
|
+
}) => z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>, string, string>;
|
|
6
|
+
export declare const secureUrlSchema: z.ZodString;
|
|
7
|
+
export declare const frameNameSchema: z.ZodString;
|
|
8
|
+
export declare const buttonTitleSchema: z.ZodString;
|
|
9
|
+
export declare const caip19TokenSchema: z.ZodString;
|
|
10
|
+
export declare const hexColorSchema: z.ZodString;
|
|
11
|
+
export declare const aspectRatioSchema: z.ZodUnion<[z.ZodLiteral<"1:1">, z.ZodLiteral<"3:2">]>;
|
|
12
|
+
export declare const encodedJsonFarcasterSignatureSchema: z.ZodObject<{
|
|
13
|
+
header: z.ZodString;
|
|
14
|
+
payload: z.ZodString;
|
|
15
|
+
signature: z.ZodString;
|
|
16
|
+
}, "strip", z.ZodTypeAny, {
|
|
17
|
+
header: string;
|
|
18
|
+
payload: string;
|
|
19
|
+
signature: string;
|
|
20
|
+
}, {
|
|
21
|
+
header: string;
|
|
22
|
+
payload: string;
|
|
23
|
+
signature: string;
|
|
24
|
+
}>;
|
|
25
|
+
export type EncodedJsonFarcasterSignatureSchema = z.infer<typeof encodedJsonFarcasterSignatureSchema>;
|
|
26
|
+
export declare const jsonFarcasterSignatureHeaderSchema: z.ZodObject<{
|
|
27
|
+
fid: z.ZodNumber;
|
|
28
|
+
type: z.ZodLiteral<"app_key">;
|
|
29
|
+
key: z.ZodString;
|
|
30
|
+
}, "strip", z.ZodTypeAny, {
|
|
31
|
+
type: "app_key";
|
|
32
|
+
fid: number;
|
|
33
|
+
key: string;
|
|
34
|
+
}, {
|
|
35
|
+
type: "app_key";
|
|
36
|
+
fid: number;
|
|
37
|
+
key: string;
|
|
38
|
+
}>;
|
|
39
|
+
export type JsonFarcasterSignatureHeaderSchema = z.infer<typeof jsonFarcasterSignatureHeaderSchema>;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.jsonFarcasterSignatureHeaderSchema = exports.encodedJsonFarcasterSignatureSchema = exports.aspectRatioSchema = exports.hexColorSchema = exports.caip19TokenSchema = exports.buttonTitleSchema = exports.frameNameSchema = exports.secureUrlSchema = exports.createSimpleStringSchema = void 0;
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
|
+
const SPECIAL_CHARS_PATTERN = /[@#$%^&*+=\/\\|~«»]/;
|
|
6
|
+
const REPEATED_PUNCTUATION_PATTERN = /(!{2,}|\?{2,}|-{2,})/;
|
|
7
|
+
// Unicode ranges for emoji detection:
|
|
8
|
+
// \u{1F300}-\u{1F9FF} - Miscellaneous Symbols, Pictographs, Emoticons, Transport, Map, and Supplemental
|
|
9
|
+
// \u{2702}-\u{27B0} - Dingbats
|
|
10
|
+
// \u{2600}-\u{26FF} - Miscellaneous Symbols
|
|
11
|
+
// \u{2B00}-\u{2BFF} - Miscellaneous Symbols and Arrows
|
|
12
|
+
const EMOJI_PATTERN = /[\u{1F300}-\u{1F9FF}]|[\u{2702}-\u{27B0}]|[\u{2600}-\u{26FF}]|[\u{2B00}-\u{2BFF}]/u;
|
|
13
|
+
const createSimpleStringSchema = ({ max, noSpaces, } = {}) => {
|
|
14
|
+
const stringValidations = noSpaces
|
|
15
|
+
? zod_1.z
|
|
16
|
+
.string()
|
|
17
|
+
.max(max ?? Number.POSITIVE_INFINITY)
|
|
18
|
+
.regex(/^\S*$/, 'Spaces are not allowed')
|
|
19
|
+
: zod_1.z.string().max(max ?? Number.POSITIVE_INFINITY);
|
|
20
|
+
return stringValidations
|
|
21
|
+
.refine((value) => !EMOJI_PATTERN.test(value), {
|
|
22
|
+
message: 'Emojis and symbols are not allowed',
|
|
23
|
+
})
|
|
24
|
+
.refine((value) => !SPECIAL_CHARS_PATTERN.test(value), {
|
|
25
|
+
message: 'Special characters (@, #, $, %, ^, &, *, +, =, /, \\, |, ~, «, ») are not allowed',
|
|
26
|
+
})
|
|
27
|
+
.refine((value) => !REPEATED_PUNCTUATION_PATTERN.test(value), {
|
|
28
|
+
message: 'Repeated punctuations (!!, ??, --) are not allowed',
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
exports.createSimpleStringSchema = createSimpleStringSchema;
|
|
32
|
+
exports.secureUrlSchema = zod_1.z
|
|
33
|
+
.string()
|
|
34
|
+
.url()
|
|
35
|
+
.startsWith('https://', { message: 'Must be an https url' })
|
|
36
|
+
.max(1024);
|
|
37
|
+
exports.frameNameSchema = zod_1.z.string().max(32);
|
|
38
|
+
exports.buttonTitleSchema = zod_1.z.string().max(32);
|
|
39
|
+
const CAIP_19_REGEX = /^[-a-z0-9]{3,8}:[-_a-zA-Z0-9]{1,32}\/(?:[-a-z0-9]{3,8}:[-.%a-zA-Z0-9]{1,128}(?:\/[-.%a-zA-Z0-9]{1,78})?|native)$/;
|
|
40
|
+
exports.caip19TokenSchema = zod_1.z
|
|
41
|
+
.string()
|
|
42
|
+
.regex(CAIP_19_REGEX, { message: 'Invalid CAIP-19 asset ID' });
|
|
43
|
+
exports.hexColorSchema = zod_1.z
|
|
44
|
+
.string()
|
|
45
|
+
.regex(/^#([0-9A-F]{3}|[0-9A-F]{6})$/i, {
|
|
46
|
+
message: 'Invalid hex color code. It should be in the format #RRGGBB or #RGB.',
|
|
47
|
+
});
|
|
48
|
+
exports.aspectRatioSchema = zod_1.z.union([zod_1.z.literal('1:1'), zod_1.z.literal('3:2')]);
|
|
49
|
+
exports.encodedJsonFarcasterSignatureSchema = zod_1.z.object({
|
|
50
|
+
header: zod_1.z.string(),
|
|
51
|
+
payload: zod_1.z.string(),
|
|
52
|
+
signature: zod_1.z.string(),
|
|
53
|
+
});
|
|
54
|
+
exports.jsonFarcasterSignatureHeaderSchema = zod_1.z.object({
|
|
55
|
+
fid: zod_1.z.number(),
|
|
56
|
+
type: zod_1.z.literal('app_key'),
|
|
57
|
+
key: zod_1.z.string().startsWith('0x'),
|
|
58
|
+
});
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type { AddFrame, ComposeCast, Ready, SendToken, SignIn, SwapToken, ViewProfile, ViewToken } from './actions';
|
|
2
|
+
import type { FrameContext } from './context';
|
|
3
|
+
import type { EventFrameAdded, EventFrameRemoved, EventNotificationsDisabled, EventNotificationsEnabled } from './schemas';
|
|
4
|
+
import type { Ethereum } from './wallet';
|
|
5
|
+
export type SetPrimaryButtonOptions = {
|
|
6
|
+
text: string;
|
|
7
|
+
loading?: boolean;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
hidden?: boolean;
|
|
10
|
+
};
|
|
11
|
+
export * from './wallet/ethereum';
|
|
12
|
+
export { DEFAULT_READY_OPTIONS, ReadyOptions } from './actions/Ready';
|
|
13
|
+
export type SignInOptions = SignIn.SignInOptions;
|
|
14
|
+
export type SetPrimaryButton = (options: SetPrimaryButtonOptions) => void;
|
|
15
|
+
export type WireFrameHost = {
|
|
16
|
+
context: FrameContext;
|
|
17
|
+
close: () => void;
|
|
18
|
+
ready: Ready.Ready;
|
|
19
|
+
openUrl: (url: string) => void;
|
|
20
|
+
signIn: SignIn.WireSignIn;
|
|
21
|
+
setPrimaryButton: SetPrimaryButton;
|
|
22
|
+
ethProviderRequest: Ethereum.EthProvideRequest;
|
|
23
|
+
ethProviderRequestV2: Ethereum.RpcTransport;
|
|
24
|
+
eip6963RequestProvider: () => void;
|
|
25
|
+
addFrame: AddFrame.WireAddFrame;
|
|
26
|
+
viewProfile: ViewProfile.ViewProfile;
|
|
27
|
+
viewToken: ViewToken.ViewToken;
|
|
28
|
+
sendToken: SendToken.SendToken;
|
|
29
|
+
swapToken: SwapToken.SwapToken;
|
|
30
|
+
composeCast: <close extends boolean | undefined = undefined>(options: ComposeCast.Options<close>) => Promise<ComposeCast.Result<close>>;
|
|
31
|
+
};
|
|
32
|
+
export type FrameHost = {
|
|
33
|
+
context: FrameContext;
|
|
34
|
+
close: () => void;
|
|
35
|
+
ready: Ready.Ready;
|
|
36
|
+
openUrl: (url: string) => void;
|
|
37
|
+
signIn: SignIn.SignIn;
|
|
38
|
+
setPrimaryButton: SetPrimaryButton;
|
|
39
|
+
ethProviderRequest: Ethereum.EthProvideRequest;
|
|
40
|
+
ethProviderRequestV2: Ethereum.RpcTransport;
|
|
41
|
+
/**
|
|
42
|
+
* Receive forwarded eip6963:requestProvider events from the frame document.
|
|
43
|
+
* Hosts must emit an EventEip6963AnnounceProvider in response.
|
|
44
|
+
*/
|
|
45
|
+
eip6963RequestProvider: () => void;
|
|
46
|
+
addFrame: AddFrame.AddFrame;
|
|
47
|
+
viewProfile: ViewProfile.ViewProfile;
|
|
48
|
+
viewToken: ViewToken.ViewToken;
|
|
49
|
+
sendToken: SendToken.SendToken;
|
|
50
|
+
swapToken: SwapToken.SwapToken;
|
|
51
|
+
composeCast: <close extends boolean | undefined = undefined>(options: ComposeCast.Options<close>) => Promise<ComposeCast.Result<close>>;
|
|
52
|
+
};
|
|
53
|
+
export type EventFrameAddRejected = {
|
|
54
|
+
event: 'frame_add_rejected';
|
|
55
|
+
reason: AddFrame.AddFrameRejectedReason;
|
|
56
|
+
};
|
|
57
|
+
export type EventPrimaryButtonClicked = {
|
|
58
|
+
event: 'primary_button_clicked';
|
|
59
|
+
};
|
|
60
|
+
export type FrameClientEvent = EventFrameAdded | EventFrameAddRejected | EventFrameRemoved | EventNotificationsEnabled | EventNotificationsDisabled | EventPrimaryButtonClicked | Ethereum.EventEip6963AnnounceProvider;
|
package/dist/types.js
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
exports.DEFAULT_READY_OPTIONS = void 0;
|
|
18
|
+
// start backwards compat, remove in 1.0
|
|
19
|
+
__exportStar(require("./wallet/ethereum"), exports);
|
|
20
|
+
var Ready_1 = require("./actions/Ready");
|
|
21
|
+
Object.defineProperty(exports, "DEFAULT_READY_OPTIONS", { enumerable: true, get: function () { return Ready_1.DEFAULT_READY_OPTIONS; } });
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import type * as Address from 'ox/Address';
|
|
2
|
+
import type * as Provider from 'ox/Provider';
|
|
3
|
+
import type * as RpcRequest from 'ox/RpcRequest';
|
|
4
|
+
import type * as RpcResponse from 'ox/RpcResponse';
|
|
5
|
+
import type * as RpcSchema from 'ox/RpcSchema';
|
|
6
|
+
export type EthProvideRequest<schema extends RpcSchema.Generic = RpcSchema.Default> = Provider.RequestFn<schema>;
|
|
7
|
+
export type FrameEthProviderEventData = {
|
|
8
|
+
type: 'frame_eth_provider_event';
|
|
9
|
+
} & EthProviderWireEvent;
|
|
10
|
+
export type RpcTransport = (request: RpcRequest.RpcRequest) => Promise<RpcResponse.RpcResponse>;
|
|
11
|
+
export type ProviderRpcError = {
|
|
12
|
+
code: number;
|
|
13
|
+
details?: string;
|
|
14
|
+
message?: string;
|
|
15
|
+
};
|
|
16
|
+
export type EthProviderWireEvent = {
|
|
17
|
+
event: 'accountsChanged';
|
|
18
|
+
params: [readonly Address.Address[]];
|
|
19
|
+
} | {
|
|
20
|
+
event: 'chainChanged';
|
|
21
|
+
params: [string];
|
|
22
|
+
} | {
|
|
23
|
+
event: 'connect';
|
|
24
|
+
params: [Provider.ConnectInfo];
|
|
25
|
+
} | {
|
|
26
|
+
event: 'disconnect';
|
|
27
|
+
params: [ProviderRpcError];
|
|
28
|
+
} | {
|
|
29
|
+
event: 'message';
|
|
30
|
+
params: [Provider.Message];
|
|
31
|
+
};
|
|
32
|
+
export type EmitEthProvider = <event extends EthProviderWireEvent['event']>(event: event, params: Extract<EthProviderWireEvent, {
|
|
33
|
+
event: event;
|
|
34
|
+
}>['params']) => void;
|
|
35
|
+
/**
|
|
36
|
+
* Metadata of the EIP-1193 Provider.
|
|
37
|
+
*/
|
|
38
|
+
export interface EIP6963ProviderInfo {
|
|
39
|
+
icon: `data:image/${string}`;
|
|
40
|
+
name: string;
|
|
41
|
+
rdns: string;
|
|
42
|
+
uuid: string;
|
|
43
|
+
}
|
|
44
|
+
export type EventEip6963AnnounceProvider = {
|
|
45
|
+
event: 'eip6963:announceProvider';
|
|
46
|
+
info: EIP6963ProviderInfo;
|
|
47
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * as Ethereum from './ethereum';
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.Ethereum = void 0;
|
|
37
|
+
exports.Ethereum = __importStar(require("./ethereum"));
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import * as Errors from '../errors';
|
|
2
|
+
import type { OneOf } from '../internal/types';
|
|
3
|
+
import type { FrameNotificationDetails } from '../schemas';
|
|
4
|
+
export type AddFrameResult = {
|
|
5
|
+
notificationDetails?: FrameNotificationDetails;
|
|
6
|
+
};
|
|
7
|
+
export type AddFrame = () => Promise<AddFrameResult>;
|
|
8
|
+
type InvalidDomainManifestJsonError = {
|
|
9
|
+
type: 'invalid_domain_manifest';
|
|
10
|
+
};
|
|
11
|
+
type RejectedByUserJsonError = {
|
|
12
|
+
type: 'rejected_by_user';
|
|
13
|
+
};
|
|
14
|
+
export type AddFrameJsonError = InvalidDomainManifestJsonError | RejectedByUserJsonError;
|
|
15
|
+
export type AddFrameRejectedReason = AddFrameJsonError['type'];
|
|
16
|
+
export type AddFrameJsonResult = OneOf<{
|
|
17
|
+
result: AddFrameResult;
|
|
18
|
+
} | {
|
|
19
|
+
error: AddFrameJsonError;
|
|
20
|
+
}>;
|
|
21
|
+
export type WireAddFrame = () => Promise<AddFrameJsonResult>;
|
|
22
|
+
/**
|
|
23
|
+
* Thrown when the frame does not have a valid domain manifest.
|
|
24
|
+
*/
|
|
25
|
+
export declare class InvalidDomainManifest extends Errors.BaseError {
|
|
26
|
+
readonly name = "AddFrame.InvalidDomainManifest";
|
|
27
|
+
constructor();
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Thrown when add frame action was rejected by the user.
|
|
31
|
+
*/
|
|
32
|
+
export declare class RejectedByUser extends Errors.BaseError {
|
|
33
|
+
readonly name = "AddFrame.RejectedByUser";
|
|
34
|
+
constructor();
|
|
35
|
+
}
|
|
36
|
+
export {};
|