@farcaster/miniapp-core 0.3.0 → 0.3.2
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/dist/actions/index.d.ts +1 -1
- package/dist/actions/index.js +2 -2
- package/dist/index.d.ts +3 -3
- package/dist/index.js +4 -4
- package/dist/schemas/embeds.d.ts +324 -40
- package/dist/schemas/embeds.js +11 -11
- package/dist/schemas/events.d.ts +156 -24
- package/dist/schemas/events.js +14 -14
- package/dist/schemas/index.d.ts +1 -1
- package/dist/schemas/index.js +1 -1
- package/dist/schemas/manifest.d.ts +750 -220
- package/dist/schemas/manifest.js +22 -16
- package/dist/schemas/notifications.d.ts +48 -10
- package/dist/schemas/notifications.js +14 -14
- package/dist/schemas/shared.d.ts +23 -7
- package/dist/schemas/shared.js +19 -19
- package/dist/solanaWire.js +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.js +2 -2
- package/esm/actions/index.d.ts +1 -1
- package/esm/actions/index.js +1 -1
- package/esm/index.d.ts +3 -3
- package/esm/index.js +3 -3
- package/esm/schemas/embeds.d.ts +324 -40
- package/esm/schemas/embeds.js +1 -1
- package/esm/schemas/events.d.ts +156 -24
- package/esm/schemas/events.js +1 -1
- package/esm/schemas/index.d.ts +1 -1
- package/esm/schemas/index.js +1 -1
- package/esm/schemas/manifest.d.ts +750 -220
- package/esm/schemas/manifest.js +7 -1
- package/esm/schemas/notifications.d.ts +48 -10
- package/esm/schemas/notifications.js +1 -1
- package/esm/schemas/shared.d.ts +23 -7
- package/esm/schemas/shared.js +2 -2
- package/esm/solanaWire.js +1 -1
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/esm/types.d.ts +1 -1
- package/esm/types.js +1 -1
- package/package.json +1 -1
- package/src/actions/index.ts +1 -1
- package/src/index.ts +3 -3
- package/src/schemas/embeds.ts +1 -1
- package/src/schemas/events.ts +1 -1
- package/src/schemas/index.ts +1 -1
- package/src/schemas/manifest.ts +7 -1
- package/src/schemas/notifications.ts +1 -1
- package/src/schemas/shared.ts +6 -3
- package/src/solana.ts +1 -3
- package/src/solanaWire.ts +1 -1
- package/src/types.ts +1 -1
package/dist/actions/index.d.ts
CHANGED
|
@@ -2,8 +2,8 @@ export * as AddMiniApp from './AddMiniApp.ts';
|
|
|
2
2
|
export * as ComposeCast from './ComposeCast.ts';
|
|
3
3
|
export * as Haptics from './Haptics.ts';
|
|
4
4
|
export * as Ready from './Ready.ts';
|
|
5
|
-
export * as SignIn from './SignIn.ts';
|
|
6
5
|
export * as SendToken from './SendToken.ts';
|
|
6
|
+
export * as SignIn from './SignIn.ts';
|
|
7
7
|
export * as SwapToken from './SwapToken.ts';
|
|
8
8
|
export * as ViewCast from './ViewCast.ts';
|
|
9
9
|
export * as ViewProfile from './ViewProfile.ts';
|
package/dist/actions/index.js
CHANGED
|
@@ -33,13 +33,13 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
33
33
|
};
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.ViewToken = exports.ViewProfile = exports.ViewCast = exports.SwapToken = exports.
|
|
36
|
+
exports.ViewToken = exports.ViewProfile = exports.ViewCast = exports.SwapToken = exports.SignIn = exports.SendToken = exports.Ready = exports.Haptics = exports.ComposeCast = exports.AddMiniApp = void 0;
|
|
37
37
|
exports.AddMiniApp = __importStar(require("./AddMiniApp.js"));
|
|
38
38
|
exports.ComposeCast = __importStar(require("./ComposeCast.js"));
|
|
39
39
|
exports.Haptics = __importStar(require("./Haptics.js"));
|
|
40
40
|
exports.Ready = __importStar(require("./Ready.js"));
|
|
41
|
-
exports.SignIn = __importStar(require("./SignIn.js"));
|
|
42
41
|
exports.SendToken = __importStar(require("./SendToken.js"));
|
|
42
|
+
exports.SignIn = __importStar(require("./SignIn.js"));
|
|
43
43
|
exports.SwapToken = __importStar(require("./SwapToken.js"));
|
|
44
44
|
exports.ViewCast = __importStar(require("./ViewCast.js"));
|
|
45
45
|
exports.ViewProfile = __importStar(require("./ViewProfile.js"));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * from './actions/index.ts';
|
|
2
|
-
export * from './wallet/index.ts';
|
|
3
2
|
export * as Back from './back.ts';
|
|
4
|
-
export * as Errors from './errors.ts';
|
|
5
3
|
export * as Context from './context.ts';
|
|
4
|
+
export * as Errors from './errors.ts';
|
|
6
5
|
export * as Manifest from './manifest.ts';
|
|
7
|
-
export * from './types.ts';
|
|
8
6
|
export * from './schemas/index.ts';
|
|
9
7
|
export * from './solana.ts';
|
|
10
8
|
export * from './solanaWire.ts';
|
|
9
|
+
export * from './types.ts';
|
|
10
|
+
export * from './wallet/index.ts';
|
package/dist/index.js
CHANGED
|
@@ -36,14 +36,14 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
36
36
|
};
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
-
exports.Manifest = exports.
|
|
39
|
+
exports.Manifest = exports.Errors = exports.Context = exports.Back = void 0;
|
|
40
40
|
__exportStar(require("./actions/index.js"), exports);
|
|
41
|
-
__exportStar(require("./wallet/index.js"), exports);
|
|
42
41
|
exports.Back = __importStar(require("./back.js"));
|
|
43
|
-
exports.Errors = __importStar(require("./errors.js"));
|
|
44
42
|
exports.Context = __importStar(require("./context.js"));
|
|
43
|
+
exports.Errors = __importStar(require("./errors.js"));
|
|
45
44
|
exports.Manifest = __importStar(require("./manifest.js"));
|
|
46
|
-
__exportStar(require("./types.js"), exports);
|
|
47
45
|
__exportStar(require("./schemas/index.js"), exports);
|
|
48
46
|
__exportStar(require("./solana.js"), exports);
|
|
49
47
|
__exportStar(require("./solanaWire.js"), exports);
|
|
48
|
+
__exportStar(require("./types.js"), exports);
|
|
49
|
+
__exportStar(require("./wallet/index.js"), exports);
|
package/dist/schemas/embeds.d.ts
CHANGED
|
@@ -1,87 +1,284 @@
|
|
|
1
|
-
import { z } from 'zod
|
|
1
|
+
import { z } from 'zod';
|
|
2
2
|
export declare const actionLaunchFrameSchema: z.ZodObject<{
|
|
3
3
|
type: z.ZodLiteral<"launch_frame">;
|
|
4
4
|
name: z.ZodString;
|
|
5
|
-
url: z.ZodOptional<z.ZodString
|
|
6
|
-
splashImageUrl: z.ZodOptional<z.ZodString
|
|
5
|
+
url: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
6
|
+
splashImageUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
7
7
|
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
8
|
-
}, z.
|
|
8
|
+
}, "strip", z.ZodTypeAny, {
|
|
9
|
+
type: "launch_frame";
|
|
10
|
+
name: string;
|
|
11
|
+
url?: string | undefined;
|
|
12
|
+
splashImageUrl?: string | undefined;
|
|
13
|
+
splashBackgroundColor?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
type: "launch_frame";
|
|
16
|
+
name: string;
|
|
17
|
+
url?: string | undefined;
|
|
18
|
+
splashImageUrl?: string | undefined;
|
|
19
|
+
splashBackgroundColor?: string | undefined;
|
|
20
|
+
}>;
|
|
9
21
|
export declare const actionLaunchMiniAppSchema: z.ZodObject<{
|
|
10
22
|
type: z.ZodLiteral<"launch_miniapp">;
|
|
11
23
|
name: z.ZodString;
|
|
12
|
-
url: z.ZodOptional<z.ZodString
|
|
13
|
-
splashImageUrl: z.ZodOptional<z.ZodString
|
|
24
|
+
url: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
25
|
+
splashImageUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
14
26
|
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
15
|
-
}, z.
|
|
27
|
+
}, "strip", z.ZodTypeAny, {
|
|
28
|
+
type: "launch_miniapp";
|
|
29
|
+
name: string;
|
|
30
|
+
url?: string | undefined;
|
|
31
|
+
splashImageUrl?: string | undefined;
|
|
32
|
+
splashBackgroundColor?: string | undefined;
|
|
33
|
+
}, {
|
|
34
|
+
type: "launch_miniapp";
|
|
35
|
+
name: string;
|
|
36
|
+
url?: string | undefined;
|
|
37
|
+
splashImageUrl?: string | undefined;
|
|
38
|
+
splashBackgroundColor?: string | undefined;
|
|
39
|
+
}>;
|
|
16
40
|
export declare const actionViewTokenSchema: z.ZodObject<{
|
|
17
41
|
type: z.ZodLiteral<"view_token">;
|
|
18
42
|
token: z.ZodString;
|
|
19
|
-
}, z.
|
|
20
|
-
|
|
43
|
+
}, "strip", z.ZodTypeAny, {
|
|
44
|
+
type: "view_token";
|
|
45
|
+
token: string;
|
|
46
|
+
}, {
|
|
47
|
+
type: "view_token";
|
|
48
|
+
token: string;
|
|
49
|
+
}>;
|
|
50
|
+
export declare const actionSchema: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
21
51
|
type: z.ZodLiteral<"launch_miniapp">;
|
|
22
52
|
name: z.ZodString;
|
|
23
|
-
url: z.ZodOptional<z.ZodString
|
|
24
|
-
splashImageUrl: z.ZodOptional<z.ZodString
|
|
53
|
+
url: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
54
|
+
splashImageUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
25
55
|
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
26
|
-
},
|
|
56
|
+
}, "strip", z.ZodTypeAny, {
|
|
57
|
+
type: "launch_miniapp";
|
|
58
|
+
name: string;
|
|
59
|
+
url?: string | undefined;
|
|
60
|
+
splashImageUrl?: string | undefined;
|
|
61
|
+
splashBackgroundColor?: string | undefined;
|
|
62
|
+
}, {
|
|
63
|
+
type: "launch_miniapp";
|
|
64
|
+
name: string;
|
|
65
|
+
url?: string | undefined;
|
|
66
|
+
splashImageUrl?: string | undefined;
|
|
67
|
+
splashBackgroundColor?: string | undefined;
|
|
68
|
+
}>, z.ZodObject<{
|
|
27
69
|
type: z.ZodLiteral<"view_token">;
|
|
28
70
|
token: z.ZodString;
|
|
29
|
-
},
|
|
71
|
+
}, "strip", z.ZodTypeAny, {
|
|
72
|
+
type: "view_token";
|
|
73
|
+
token: string;
|
|
74
|
+
}, {
|
|
75
|
+
type: "view_token";
|
|
76
|
+
token: string;
|
|
77
|
+
}>, z.ZodObject<{
|
|
30
78
|
type: z.ZodLiteral<"launch_frame">;
|
|
31
79
|
name: z.ZodString;
|
|
32
|
-
url: z.ZodOptional<z.ZodString
|
|
33
|
-
splashImageUrl: z.ZodOptional<z.ZodString
|
|
80
|
+
url: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
81
|
+
splashImageUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
34
82
|
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
35
|
-
}, z.
|
|
83
|
+
}, "strip", z.ZodTypeAny, {
|
|
84
|
+
type: "launch_frame";
|
|
85
|
+
name: string;
|
|
86
|
+
url?: string | undefined;
|
|
87
|
+
splashImageUrl?: string | undefined;
|
|
88
|
+
splashBackgroundColor?: string | undefined;
|
|
89
|
+
}, {
|
|
90
|
+
type: "launch_frame";
|
|
91
|
+
name: string;
|
|
92
|
+
url?: string | undefined;
|
|
93
|
+
splashImageUrl?: string | undefined;
|
|
94
|
+
splashBackgroundColor?: string | undefined;
|
|
95
|
+
}>]>;
|
|
36
96
|
export declare const buttonSchema: z.ZodObject<{
|
|
37
97
|
title: z.ZodString;
|
|
38
|
-
action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
98
|
+
action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
39
99
|
type: z.ZodLiteral<"launch_miniapp">;
|
|
40
100
|
name: z.ZodString;
|
|
41
|
-
url: z.ZodOptional<z.ZodString
|
|
42
|
-
splashImageUrl: z.ZodOptional<z.ZodString
|
|
101
|
+
url: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
102
|
+
splashImageUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
43
103
|
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
44
|
-
},
|
|
104
|
+
}, "strip", z.ZodTypeAny, {
|
|
105
|
+
type: "launch_miniapp";
|
|
106
|
+
name: string;
|
|
107
|
+
url?: string | undefined;
|
|
108
|
+
splashImageUrl?: string | undefined;
|
|
109
|
+
splashBackgroundColor?: string | undefined;
|
|
110
|
+
}, {
|
|
111
|
+
type: "launch_miniapp";
|
|
112
|
+
name: string;
|
|
113
|
+
url?: string | undefined;
|
|
114
|
+
splashImageUrl?: string | undefined;
|
|
115
|
+
splashBackgroundColor?: string | undefined;
|
|
116
|
+
}>, z.ZodObject<{
|
|
45
117
|
type: z.ZodLiteral<"view_token">;
|
|
46
118
|
token: z.ZodString;
|
|
47
|
-
},
|
|
119
|
+
}, "strip", z.ZodTypeAny, {
|
|
120
|
+
type: "view_token";
|
|
121
|
+
token: string;
|
|
122
|
+
}, {
|
|
123
|
+
type: "view_token";
|
|
124
|
+
token: string;
|
|
125
|
+
}>, z.ZodObject<{
|
|
48
126
|
type: z.ZodLiteral<"launch_frame">;
|
|
49
127
|
name: z.ZodString;
|
|
50
|
-
url: z.ZodOptional<z.ZodString
|
|
51
|
-
splashImageUrl: z.ZodOptional<z.ZodString
|
|
128
|
+
url: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
129
|
+
splashImageUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
52
130
|
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
53
|
-
}, z.
|
|
54
|
-
|
|
131
|
+
}, "strip", z.ZodTypeAny, {
|
|
132
|
+
type: "launch_frame";
|
|
133
|
+
name: string;
|
|
134
|
+
url?: string | undefined;
|
|
135
|
+
splashImageUrl?: string | undefined;
|
|
136
|
+
splashBackgroundColor?: string | undefined;
|
|
137
|
+
}, {
|
|
138
|
+
type: "launch_frame";
|
|
139
|
+
name: string;
|
|
140
|
+
url?: string | undefined;
|
|
141
|
+
splashImageUrl?: string | undefined;
|
|
142
|
+
splashBackgroundColor?: string | undefined;
|
|
143
|
+
}>]>;
|
|
144
|
+
}, "strip", z.ZodTypeAny, {
|
|
145
|
+
title: string;
|
|
146
|
+
action: {
|
|
147
|
+
type: "launch_frame";
|
|
148
|
+
name: string;
|
|
149
|
+
url?: string | undefined;
|
|
150
|
+
splashImageUrl?: string | undefined;
|
|
151
|
+
splashBackgroundColor?: string | undefined;
|
|
152
|
+
} | {
|
|
153
|
+
type: "launch_miniapp";
|
|
154
|
+
name: string;
|
|
155
|
+
url?: string | undefined;
|
|
156
|
+
splashImageUrl?: string | undefined;
|
|
157
|
+
splashBackgroundColor?: string | undefined;
|
|
158
|
+
} | {
|
|
159
|
+
type: "view_token";
|
|
160
|
+
token: string;
|
|
161
|
+
};
|
|
162
|
+
}, {
|
|
163
|
+
title: string;
|
|
164
|
+
action: {
|
|
165
|
+
type: "launch_frame";
|
|
166
|
+
name: string;
|
|
167
|
+
url?: string | undefined;
|
|
168
|
+
splashImageUrl?: string | undefined;
|
|
169
|
+
splashBackgroundColor?: string | undefined;
|
|
170
|
+
} | {
|
|
171
|
+
type: "launch_miniapp";
|
|
172
|
+
name: string;
|
|
173
|
+
url?: string | undefined;
|
|
174
|
+
splashImageUrl?: string | undefined;
|
|
175
|
+
splashBackgroundColor?: string | undefined;
|
|
176
|
+
} | {
|
|
177
|
+
type: "view_token";
|
|
178
|
+
token: string;
|
|
179
|
+
};
|
|
180
|
+
}>;
|
|
55
181
|
export declare const miniAppEmbedNextSchema: z.ZodObject<{
|
|
56
182
|
version: z.ZodLiteral<"next">;
|
|
57
|
-
imageUrl: z.ZodString
|
|
58
|
-
aspectRatio: z.ZodOptional<z.ZodUnion<
|
|
183
|
+
imageUrl: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>;
|
|
184
|
+
aspectRatio: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"1:1">, z.ZodLiteral<"3:2">]>>;
|
|
59
185
|
button: z.ZodObject<{
|
|
60
186
|
title: z.ZodString;
|
|
61
|
-
action: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
187
|
+
action: z.ZodDiscriminatedUnion<"type", [z.ZodObject<{
|
|
62
188
|
type: z.ZodLiteral<"launch_miniapp">;
|
|
63
189
|
name: z.ZodString;
|
|
64
|
-
url: z.ZodOptional<z.ZodString
|
|
65
|
-
splashImageUrl: z.ZodOptional<z.ZodString
|
|
190
|
+
url: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
191
|
+
splashImageUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
66
192
|
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
67
|
-
},
|
|
193
|
+
}, "strip", z.ZodTypeAny, {
|
|
194
|
+
type: "launch_miniapp";
|
|
195
|
+
name: string;
|
|
196
|
+
url?: string | undefined;
|
|
197
|
+
splashImageUrl?: string | undefined;
|
|
198
|
+
splashBackgroundColor?: string | undefined;
|
|
199
|
+
}, {
|
|
200
|
+
type: "launch_miniapp";
|
|
201
|
+
name: string;
|
|
202
|
+
url?: string | undefined;
|
|
203
|
+
splashImageUrl?: string | undefined;
|
|
204
|
+
splashBackgroundColor?: string | undefined;
|
|
205
|
+
}>, z.ZodObject<{
|
|
68
206
|
type: z.ZodLiteral<"view_token">;
|
|
69
207
|
token: z.ZodString;
|
|
70
|
-
},
|
|
208
|
+
}, "strip", z.ZodTypeAny, {
|
|
209
|
+
type: "view_token";
|
|
210
|
+
token: string;
|
|
211
|
+
}, {
|
|
212
|
+
type: "view_token";
|
|
213
|
+
token: string;
|
|
214
|
+
}>, z.ZodObject<{
|
|
71
215
|
type: z.ZodLiteral<"launch_frame">;
|
|
72
216
|
name: z.ZodString;
|
|
73
|
-
url: z.ZodOptional<z.ZodString
|
|
74
|
-
splashImageUrl: z.ZodOptional<z.ZodString
|
|
217
|
+
url: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
218
|
+
splashImageUrl: z.ZodOptional<z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, string, string>>;
|
|
75
219
|
splashBackgroundColor: z.ZodOptional<z.ZodString>;
|
|
76
|
-
}, z.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
220
|
+
}, "strip", z.ZodTypeAny, {
|
|
221
|
+
type: "launch_frame";
|
|
222
|
+
name: string;
|
|
223
|
+
url?: string | undefined;
|
|
224
|
+
splashImageUrl?: string | undefined;
|
|
225
|
+
splashBackgroundColor?: string | undefined;
|
|
226
|
+
}, {
|
|
227
|
+
type: "launch_frame";
|
|
228
|
+
name: string;
|
|
229
|
+
url?: string | undefined;
|
|
230
|
+
splashImageUrl?: string | undefined;
|
|
231
|
+
splashBackgroundColor?: string | undefined;
|
|
232
|
+
}>]>;
|
|
233
|
+
}, "strip", z.ZodTypeAny, {
|
|
234
|
+
title: string;
|
|
235
|
+
action: {
|
|
236
|
+
type: "launch_frame";
|
|
237
|
+
name: string;
|
|
238
|
+
url?: string | undefined;
|
|
239
|
+
splashImageUrl?: string | undefined;
|
|
240
|
+
splashBackgroundColor?: string | undefined;
|
|
241
|
+
} | {
|
|
242
|
+
type: "launch_miniapp";
|
|
243
|
+
name: string;
|
|
244
|
+
url?: string | undefined;
|
|
245
|
+
splashImageUrl?: string | undefined;
|
|
246
|
+
splashBackgroundColor?: string | undefined;
|
|
247
|
+
} | {
|
|
248
|
+
type: "view_token";
|
|
249
|
+
token: string;
|
|
250
|
+
};
|
|
251
|
+
}, {
|
|
252
|
+
title: string;
|
|
253
|
+
action: {
|
|
254
|
+
type: "launch_frame";
|
|
255
|
+
name: string;
|
|
256
|
+
url?: string | undefined;
|
|
257
|
+
splashImageUrl?: string | undefined;
|
|
258
|
+
splashBackgroundColor?: string | undefined;
|
|
259
|
+
} | {
|
|
260
|
+
type: "launch_miniapp";
|
|
261
|
+
name: string;
|
|
262
|
+
url?: string | undefined;
|
|
263
|
+
splashImageUrl?: string | undefined;
|
|
264
|
+
splashBackgroundColor?: string | undefined;
|
|
265
|
+
} | {
|
|
266
|
+
type: "view_token";
|
|
267
|
+
token: string;
|
|
268
|
+
};
|
|
269
|
+
}>;
|
|
270
|
+
}, "strip", z.ZodTypeAny, {
|
|
80
271
|
version: "next";
|
|
81
272
|
imageUrl: string;
|
|
82
273
|
button: {
|
|
83
274
|
title: string;
|
|
84
275
|
action: {
|
|
276
|
+
type: "launch_frame";
|
|
277
|
+
name: string;
|
|
278
|
+
url?: string | undefined;
|
|
279
|
+
splashImageUrl?: string | undefined;
|
|
280
|
+
splashBackgroundColor?: string | undefined;
|
|
281
|
+
} | {
|
|
85
282
|
type: "launch_miniapp";
|
|
86
283
|
name: string;
|
|
87
284
|
url?: string | undefined;
|
|
@@ -90,22 +287,45 @@ export declare const safeParseMiniAppEmbed: (rawResponse: unknown) => z.ZodSafeP
|
|
|
90
287
|
} | {
|
|
91
288
|
type: "view_token";
|
|
92
289
|
token: string;
|
|
93
|
-
}
|
|
290
|
+
};
|
|
291
|
+
};
|
|
292
|
+
aspectRatio?: "1:1" | "3:2" | undefined;
|
|
293
|
+
}, {
|
|
294
|
+
version: "next";
|
|
295
|
+
imageUrl: string;
|
|
296
|
+
button: {
|
|
297
|
+
title: string;
|
|
298
|
+
action: {
|
|
94
299
|
type: "launch_frame";
|
|
95
300
|
name: string;
|
|
96
301
|
url?: string | undefined;
|
|
97
302
|
splashImageUrl?: string | undefined;
|
|
98
303
|
splashBackgroundColor?: string | undefined;
|
|
304
|
+
} | {
|
|
305
|
+
type: "launch_miniapp";
|
|
306
|
+
name: string;
|
|
307
|
+
url?: string | undefined;
|
|
308
|
+
splashImageUrl?: string | undefined;
|
|
309
|
+
splashBackgroundColor?: string | undefined;
|
|
310
|
+
} | {
|
|
311
|
+
type: "view_token";
|
|
312
|
+
token: string;
|
|
99
313
|
};
|
|
100
314
|
};
|
|
101
315
|
aspectRatio?: "1:1" | "3:2" | undefined;
|
|
102
316
|
}>;
|
|
103
|
-
export declare const
|
|
317
|
+
export declare const safeParseMiniAppEmbed: (rawResponse: unknown) => z.SafeParseReturnType<{
|
|
104
318
|
version: "next";
|
|
105
319
|
imageUrl: string;
|
|
106
320
|
button: {
|
|
107
321
|
title: string;
|
|
108
322
|
action: {
|
|
323
|
+
type: "launch_frame";
|
|
324
|
+
name: string;
|
|
325
|
+
url?: string | undefined;
|
|
326
|
+
splashImageUrl?: string | undefined;
|
|
327
|
+
splashBackgroundColor?: string | undefined;
|
|
328
|
+
} | {
|
|
109
329
|
type: "launch_miniapp";
|
|
110
330
|
name: string;
|
|
111
331
|
url?: string | undefined;
|
|
@@ -114,12 +334,76 @@ export declare const safeParseFrameEmbed: (rawResponse: unknown) => z.ZodSafePar
|
|
|
114
334
|
} | {
|
|
115
335
|
type: "view_token";
|
|
116
336
|
token: string;
|
|
337
|
+
};
|
|
338
|
+
};
|
|
339
|
+
aspectRatio?: "1:1" | "3:2" | undefined;
|
|
340
|
+
}, {
|
|
341
|
+
version: "next";
|
|
342
|
+
imageUrl: string;
|
|
343
|
+
button: {
|
|
344
|
+
title: string;
|
|
345
|
+
action: {
|
|
346
|
+
type: "launch_frame";
|
|
347
|
+
name: string;
|
|
348
|
+
url?: string | undefined;
|
|
349
|
+
splashImageUrl?: string | undefined;
|
|
350
|
+
splashBackgroundColor?: string | undefined;
|
|
117
351
|
} | {
|
|
352
|
+
type: "launch_miniapp";
|
|
353
|
+
name: string;
|
|
354
|
+
url?: string | undefined;
|
|
355
|
+
splashImageUrl?: string | undefined;
|
|
356
|
+
splashBackgroundColor?: string | undefined;
|
|
357
|
+
} | {
|
|
358
|
+
type: "view_token";
|
|
359
|
+
token: string;
|
|
360
|
+
};
|
|
361
|
+
};
|
|
362
|
+
aspectRatio?: "1:1" | "3:2" | undefined;
|
|
363
|
+
}>;
|
|
364
|
+
export declare const safeParseFrameEmbed: (rawResponse: unknown) => z.SafeParseReturnType<{
|
|
365
|
+
version: "next";
|
|
366
|
+
imageUrl: string;
|
|
367
|
+
button: {
|
|
368
|
+
title: string;
|
|
369
|
+
action: {
|
|
370
|
+
type: "launch_frame";
|
|
371
|
+
name: string;
|
|
372
|
+
url?: string | undefined;
|
|
373
|
+
splashImageUrl?: string | undefined;
|
|
374
|
+
splashBackgroundColor?: string | undefined;
|
|
375
|
+
} | {
|
|
376
|
+
type: "launch_miniapp";
|
|
377
|
+
name: string;
|
|
378
|
+
url?: string | undefined;
|
|
379
|
+
splashImageUrl?: string | undefined;
|
|
380
|
+
splashBackgroundColor?: string | undefined;
|
|
381
|
+
} | {
|
|
382
|
+
type: "view_token";
|
|
383
|
+
token: string;
|
|
384
|
+
};
|
|
385
|
+
};
|
|
386
|
+
aspectRatio?: "1:1" | "3:2" | undefined;
|
|
387
|
+
}, {
|
|
388
|
+
version: "next";
|
|
389
|
+
imageUrl: string;
|
|
390
|
+
button: {
|
|
391
|
+
title: string;
|
|
392
|
+
action: {
|
|
118
393
|
type: "launch_frame";
|
|
119
394
|
name: string;
|
|
120
395
|
url?: string | undefined;
|
|
121
396
|
splashImageUrl?: string | undefined;
|
|
122
397
|
splashBackgroundColor?: string | undefined;
|
|
398
|
+
} | {
|
|
399
|
+
type: "launch_miniapp";
|
|
400
|
+
name: string;
|
|
401
|
+
url?: string | undefined;
|
|
402
|
+
splashImageUrl?: string | undefined;
|
|
403
|
+
splashBackgroundColor?: string | undefined;
|
|
404
|
+
} | {
|
|
405
|
+
type: "view_token";
|
|
406
|
+
token: string;
|
|
123
407
|
};
|
|
124
408
|
};
|
|
125
409
|
aspectRatio?: "1:1" | "3:2" | undefined;
|
package/dist/schemas/embeds.js
CHANGED
|
@@ -1,38 +1,38 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.safeParseFrameEmbed = exports.safeParseMiniAppEmbed = exports.miniAppEmbedNextSchema = exports.buttonSchema = exports.actionSchema = exports.actionViewTokenSchema = exports.actionLaunchMiniAppSchema = exports.actionLaunchFrameSchema = void 0;
|
|
4
|
-
const
|
|
4
|
+
const zod_1 = require("zod");
|
|
5
5
|
const shared_ts_1 = require("./shared.js");
|
|
6
|
-
exports.actionLaunchFrameSchema =
|
|
7
|
-
type:
|
|
6
|
+
exports.actionLaunchFrameSchema = zod_1.z.object({
|
|
7
|
+
type: zod_1.z.literal('launch_frame'),
|
|
8
8
|
name: shared_ts_1.miniAppNameSchema,
|
|
9
9
|
url: shared_ts_1.secureUrlSchema.optional(),
|
|
10
10
|
splashImageUrl: shared_ts_1.secureUrlSchema.optional(),
|
|
11
11
|
splashBackgroundColor: shared_ts_1.hexColorSchema.optional(),
|
|
12
12
|
});
|
|
13
|
-
exports.actionLaunchMiniAppSchema =
|
|
14
|
-
type:
|
|
13
|
+
exports.actionLaunchMiniAppSchema = zod_1.z.object({
|
|
14
|
+
type: zod_1.z.literal('launch_miniapp'),
|
|
15
15
|
name: shared_ts_1.miniAppNameSchema,
|
|
16
16
|
url: shared_ts_1.secureUrlSchema.optional(),
|
|
17
17
|
splashImageUrl: shared_ts_1.secureUrlSchema.optional(),
|
|
18
18
|
splashBackgroundColor: shared_ts_1.hexColorSchema.optional(),
|
|
19
19
|
});
|
|
20
|
-
exports.actionViewTokenSchema =
|
|
21
|
-
type:
|
|
20
|
+
exports.actionViewTokenSchema = zod_1.z.object({
|
|
21
|
+
type: zod_1.z.literal('view_token'),
|
|
22
22
|
token: shared_ts_1.caip19TokenSchema,
|
|
23
23
|
});
|
|
24
|
-
exports.actionSchema =
|
|
24
|
+
exports.actionSchema = zod_1.z.discriminatedUnion('type', [
|
|
25
25
|
exports.actionLaunchMiniAppSchema,
|
|
26
26
|
exports.actionViewTokenSchema,
|
|
27
27
|
// Remove after compatibility period
|
|
28
28
|
exports.actionLaunchFrameSchema,
|
|
29
29
|
]);
|
|
30
|
-
exports.buttonSchema =
|
|
30
|
+
exports.buttonSchema = zod_1.z.object({
|
|
31
31
|
title: shared_ts_1.buttonTitleSchema,
|
|
32
32
|
action: exports.actionSchema,
|
|
33
33
|
});
|
|
34
|
-
exports.miniAppEmbedNextSchema =
|
|
35
|
-
version:
|
|
34
|
+
exports.miniAppEmbedNextSchema = zod_1.z.object({
|
|
35
|
+
version: zod_1.z.literal('next'),
|
|
36
36
|
imageUrl: shared_ts_1.secureUrlSchema,
|
|
37
37
|
aspectRatio: shared_ts_1.aspectRatioSchema.optional(),
|
|
38
38
|
button: exports.buttonSchema,
|