@farcaster/frame-core 0.1.1 → 0.1.3
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/README.md +1 -1
- package/dist/actions/AddMiniApp.d.ts +3 -3
- package/dist/actions/AddMiniApp.js +1 -1
- package/dist/actions/Haptics.d.ts +3 -0
- package/dist/actions/Haptics.js +2 -0
- package/dist/actions/SignIn.d.ts +2 -2
- package/dist/actions/SignIn.js +1 -1
- package/dist/actions/index.d.ts +10 -9
- package/dist/actions/index.js +11 -10
- package/dist/context.d.ts +5 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +9 -9
- package/dist/manifest.d.ts +1 -1
- package/dist/schemas/embeds.js +9 -9
- package/dist/schemas/events.js +3 -3
- package/dist/schemas/index.d.ts +5 -5
- package/dist/schemas/index.js +5 -5
- package/dist/schemas/manifest.js +22 -22
- package/dist/schemas/notifications.js +2 -2
- package/dist/solanaWire.d.ts +1 -1
- package/dist/types.d.ts +14 -8
- package/dist/types.js +6 -3
- package/dist/wallet/index.d.ts +1 -1
- package/dist/wallet/index.js +1 -1
- package/esm/actions/AddMiniApp.d.ts +3 -3
- package/esm/actions/AddMiniApp.js +1 -1
- package/esm/actions/Haptics.d.ts +3 -0
- package/esm/actions/Haptics.js +1 -0
- package/esm/actions/SignIn.d.ts +2 -2
- package/esm/actions/SignIn.js +1 -1
- package/esm/actions/index.d.ts +10 -9
- package/esm/actions/index.js +10 -9
- package/esm/context.d.ts +5 -1
- package/esm/index.d.ts +9 -9
- package/esm/index.js +9 -9
- package/esm/manifest.d.ts +1 -1
- package/esm/schemas/embeds.js +1 -1
- package/esm/schemas/events.js +1 -1
- package/esm/schemas/index.d.ts +5 -5
- package/esm/schemas/index.js +5 -5
- package/esm/schemas/manifest.js +2 -2
- package/esm/schemas/notifications.js +1 -1
- package/esm/solanaWire.d.ts +1 -1
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/esm/types.d.ts +14 -8
- package/esm/types.js +5 -2
- package/esm/wallet/index.d.ts +1 -1
- package/esm/wallet/index.js +1 -1
- package/package.json +2 -2
- package/src/actions/AddMiniApp.ts +3 -3
- package/src/actions/Haptics.ts +9 -0
- package/src/actions/SignIn.ts +2 -2
- package/src/actions/index.ts +10 -9
- package/src/context.ts +6 -1
- package/src/index.ts +9 -9
- package/src/manifest.ts +1 -1
- package/src/schemas/embeds.ts +1 -1
- package/src/schemas/events.ts +1 -1
- package/src/schemas/index.ts +5 -5
- package/src/schemas/manifest.ts +2 -2
- package/src/schemas/notifications.ts +1 -1
- package/src/solanaWire.ts +1 -1
- package/src/types.ts +20 -7
- package/src/wallet/index.ts +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as Errors from '../errors';
|
|
2
|
-
import type { OneOf } from '../internal/types';
|
|
3
|
-
import type { FrameNotificationDetails } from '../schemas';
|
|
1
|
+
import * as Errors from '../errors.ts';
|
|
2
|
+
import type { OneOf } from '../internal/types.ts';
|
|
3
|
+
import type { FrameNotificationDetails } from '../schemas/index.ts';
|
|
4
4
|
export type AddMiniAppResult = {
|
|
5
5
|
notificationDetails?: FrameNotificationDetails;
|
|
6
6
|
};
|
|
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.RejectedByUser = exports.InvalidDomainManifest = void 0;
|
|
37
|
-
const Errors = __importStar(require("../errors"));
|
|
37
|
+
const Errors = __importStar(require("../errors.js"));
|
|
38
38
|
/**
|
|
39
39
|
* Thrown when the frame does not have a valid domain manifest.
|
|
40
40
|
*/
|
package/dist/actions/SignIn.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as Errors from '../errors';
|
|
2
|
-
import type { OneOf } from '../internal/types';
|
|
1
|
+
import * as Errors from '../errors.ts';
|
|
2
|
+
import type { OneOf } from '../internal/types.ts';
|
|
3
3
|
export type SignInOptions = {
|
|
4
4
|
/**
|
|
5
5
|
* A random string used to prevent replay attacks.
|
package/dist/actions/SignIn.js
CHANGED
|
@@ -34,7 +34,7 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.RejectedByUser = void 0;
|
|
37
|
-
const Errors = __importStar(require("../errors"));
|
|
37
|
+
const Errors = __importStar(require("../errors.js"));
|
|
38
38
|
/**
|
|
39
39
|
* Thrown when a sign in action was rejected.
|
|
40
40
|
*/
|
package/dist/actions/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export * as AddMiniApp from './AddMiniApp';
|
|
2
|
-
export * as ComposeCast from './ComposeCast';
|
|
3
|
-
export * as
|
|
4
|
-
export * as
|
|
5
|
-
export * as
|
|
6
|
-
export * as
|
|
7
|
-
export * as
|
|
8
|
-
export * as
|
|
9
|
-
export * as
|
|
1
|
+
export * as AddMiniApp from './AddMiniApp.ts';
|
|
2
|
+
export * as ComposeCast from './ComposeCast.ts';
|
|
3
|
+
export * as Haptics from './Haptics.ts';
|
|
4
|
+
export * as Ready from './Ready.ts';
|
|
5
|
+
export * as SignIn from './SignIn.ts';
|
|
6
|
+
export * as SendToken from './SendToken.ts';
|
|
7
|
+
export * as SwapToken from './SwapToken.ts';
|
|
8
|
+
export * as ViewCast from './ViewCast.ts';
|
|
9
|
+
export * as ViewProfile from './ViewProfile.ts';
|
|
10
|
+
export * as ViewToken from './ViewToken.ts';
|
package/dist/actions/index.js
CHANGED
|
@@ -33,13 +33,14 @@ 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.SendToken = exports.SignIn = exports.Ready = exports.ComposeCast = exports.AddMiniApp = void 0;
|
|
37
|
-
exports.AddMiniApp = __importStar(require("./AddMiniApp"));
|
|
38
|
-
exports.ComposeCast = __importStar(require("./ComposeCast"));
|
|
39
|
-
exports.
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
42
|
-
exports.
|
|
43
|
-
exports.
|
|
44
|
-
exports.
|
|
45
|
-
exports.
|
|
36
|
+
exports.ViewToken = exports.ViewProfile = exports.ViewCast = exports.SwapToken = exports.SendToken = exports.SignIn = exports.Ready = exports.Haptics = exports.ComposeCast = exports.AddMiniApp = void 0;
|
|
37
|
+
exports.AddMiniApp = __importStar(require("./AddMiniApp.js"));
|
|
38
|
+
exports.ComposeCast = __importStar(require("./ComposeCast.js"));
|
|
39
|
+
exports.Haptics = __importStar(require("./Haptics.js"));
|
|
40
|
+
exports.Ready = __importStar(require("./Ready.js"));
|
|
41
|
+
exports.SignIn = __importStar(require("./SignIn.js"));
|
|
42
|
+
exports.SendToken = __importStar(require("./SendToken.js"));
|
|
43
|
+
exports.SwapToken = __importStar(require("./SwapToken.js"));
|
|
44
|
+
exports.ViewCast = __importStar(require("./ViewCast.js"));
|
|
45
|
+
exports.ViewProfile = __importStar(require("./ViewProfile.js"));
|
|
46
|
+
exports.ViewToken = __importStar(require("./ViewToken.js"));
|
package/dist/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FrameNotificationDetails } from './schemas';
|
|
1
|
+
import type { FrameNotificationDetails } from './schemas/index.ts';
|
|
2
2
|
export type CastEmbedLocationContext = {
|
|
3
3
|
type: 'cast_embed';
|
|
4
4
|
embed: string;
|
|
@@ -65,8 +65,12 @@ export type ClientContext = {
|
|
|
65
65
|
notificationDetails?: FrameNotificationDetails;
|
|
66
66
|
safeAreaInsets?: SafeAreaInsets;
|
|
67
67
|
};
|
|
68
|
+
export type ClientFeatures = {
|
|
69
|
+
haptics: boolean;
|
|
70
|
+
};
|
|
68
71
|
export type FrameContext = {
|
|
69
72
|
client: ClientContext;
|
|
70
73
|
user: UserContext;
|
|
71
74
|
location?: LocationContext;
|
|
75
|
+
features?: ClientFeatures;
|
|
72
76
|
};
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from './actions';
|
|
2
|
-
export * from './wallet';
|
|
3
|
-
export * as Errors from './errors';
|
|
4
|
-
export * as Context from './context';
|
|
5
|
-
export * as Manifest from './manifest';
|
|
6
|
-
export * from './types';
|
|
7
|
-
export * from './schemas';
|
|
8
|
-
export * from './solana';
|
|
9
|
-
export * from './solanaWire';
|
|
1
|
+
export * from './actions/index.ts';
|
|
2
|
+
export * from './wallet/index.ts';
|
|
3
|
+
export * as Errors from './errors.ts';
|
|
4
|
+
export * as Context from './context.ts';
|
|
5
|
+
export * as Manifest from './manifest.ts';
|
|
6
|
+
export * from './types.ts';
|
|
7
|
+
export * from './schemas/index.ts';
|
|
8
|
+
export * from './solana.ts';
|
|
9
|
+
export * from './solanaWire.ts';
|
package/dist/index.js
CHANGED
|
@@ -37,12 +37,12 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
37
37
|
})();
|
|
38
38
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
39
|
exports.Manifest = exports.Context = exports.Errors = void 0;
|
|
40
|
-
__exportStar(require("./actions"), exports);
|
|
41
|
-
__exportStar(require("./wallet"), exports);
|
|
42
|
-
exports.Errors = __importStar(require("./errors"));
|
|
43
|
-
exports.Context = __importStar(require("./context"));
|
|
44
|
-
exports.Manifest = __importStar(require("./manifest"));
|
|
45
|
-
__exportStar(require("./types"), exports);
|
|
46
|
-
__exportStar(require("./schemas"), exports);
|
|
47
|
-
__exportStar(require("./solana"), exports);
|
|
48
|
-
__exportStar(require("./solanaWire"), exports);
|
|
40
|
+
__exportStar(require("./actions/index.js"), exports);
|
|
41
|
+
__exportStar(require("./wallet/index.js"), exports);
|
|
42
|
+
exports.Errors = __importStar(require("./errors.js"));
|
|
43
|
+
exports.Context = __importStar(require("./context.js"));
|
|
44
|
+
exports.Manifest = __importStar(require("./manifest.js"));
|
|
45
|
+
__exportStar(require("./types.js"), exports);
|
|
46
|
+
__exportStar(require("./schemas/index.js"), exports);
|
|
47
|
+
__exportStar(require("./solana.js"), exports);
|
|
48
|
+
__exportStar(require("./solanaWire.js"), exports);
|
package/dist/manifest.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type Manifest = {
|
|
|
8
8
|
/**
|
|
9
9
|
* Signed domain association linking this frame to a Farcaster account
|
|
10
10
|
*
|
|
11
|
-
* A DomainAssociation can be generated using the {@link https://
|
|
11
|
+
* A DomainAssociation can be generated using the {@link https://farcaster.xyz/~/developers/domains | Warpcast
|
|
12
12
|
* Domains Developer} tool.
|
|
13
13
|
*/
|
|
14
14
|
export type AccountAssociation = {
|
package/dist/schemas/embeds.js
CHANGED
|
@@ -2,30 +2,30 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.safeParseFrameEmbed = exports.frameEmbedNextSchema = exports.buttonSchema = exports.actionSchema = exports.actionViewTokenSchema = exports.actionLaunchFrameSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const shared_ts_1 = require("./shared.js");
|
|
6
6
|
exports.actionLaunchFrameSchema = zod_1.z.object({
|
|
7
7
|
type: zod_1.z.literal('launch_frame'),
|
|
8
|
-
name:
|
|
9
|
-
url:
|
|
10
|
-
splashImageUrl:
|
|
11
|
-
splashBackgroundColor:
|
|
8
|
+
name: shared_ts_1.frameNameSchema,
|
|
9
|
+
url: shared_ts_1.secureUrlSchema.optional(),
|
|
10
|
+
splashImageUrl: shared_ts_1.secureUrlSchema.optional(),
|
|
11
|
+
splashBackgroundColor: shared_ts_1.hexColorSchema.optional(),
|
|
12
12
|
});
|
|
13
13
|
exports.actionViewTokenSchema = zod_1.z.object({
|
|
14
14
|
type: zod_1.z.literal('view_token'),
|
|
15
|
-
token:
|
|
15
|
+
token: shared_ts_1.caip19TokenSchema,
|
|
16
16
|
});
|
|
17
17
|
exports.actionSchema = zod_1.z.discriminatedUnion('type', [
|
|
18
18
|
exports.actionLaunchFrameSchema,
|
|
19
19
|
exports.actionViewTokenSchema,
|
|
20
20
|
]);
|
|
21
21
|
exports.buttonSchema = zod_1.z.object({
|
|
22
|
-
title:
|
|
22
|
+
title: shared_ts_1.buttonTitleSchema,
|
|
23
23
|
action: exports.actionSchema,
|
|
24
24
|
});
|
|
25
25
|
exports.frameEmbedNextSchema = zod_1.z.object({
|
|
26
26
|
version: zod_1.z.literal('next'),
|
|
27
|
-
imageUrl:
|
|
28
|
-
aspectRatio:
|
|
27
|
+
imageUrl: shared_ts_1.secureUrlSchema,
|
|
28
|
+
aspectRatio: shared_ts_1.aspectRatioSchema.optional(),
|
|
29
29
|
button: exports.buttonSchema,
|
|
30
30
|
});
|
|
31
31
|
const safeParseFrameEmbed = (rawResponse) => exports.frameEmbedNextSchema.safeParse(rawResponse);
|
package/dist/schemas/events.js
CHANGED
|
@@ -2,17 +2,17 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.serverEventSchema = exports.notificationsDisabledSchema = exports.eventNotificationsEnabledSchema = exports.eventFrameRemovedSchema = exports.eventFrameAddedSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const notifications_ts_1 = require("./notifications.js");
|
|
6
6
|
exports.eventFrameAddedSchema = zod_1.z.object({
|
|
7
7
|
event: zod_1.z.literal('frame_added'),
|
|
8
|
-
notificationDetails:
|
|
8
|
+
notificationDetails: notifications_ts_1.notificationDetailsSchema.optional(),
|
|
9
9
|
});
|
|
10
10
|
exports.eventFrameRemovedSchema = zod_1.z.object({
|
|
11
11
|
event: zod_1.z.literal('frame_removed'),
|
|
12
12
|
});
|
|
13
13
|
exports.eventNotificationsEnabledSchema = zod_1.z.object({
|
|
14
14
|
event: zod_1.z.literal('notifications_enabled'),
|
|
15
|
-
notificationDetails:
|
|
15
|
+
notificationDetails: notifications_ts_1.notificationDetailsSchema.required(),
|
|
16
16
|
});
|
|
17
17
|
exports.notificationsDisabledSchema = zod_1.z.object({
|
|
18
18
|
event: zod_1.z.literal('notifications_disabled'),
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './embeds';
|
|
2
|
-
export * from './events';
|
|
3
|
-
export * from './shared';
|
|
4
|
-
export * from './manifest';
|
|
5
|
-
export * from './notifications';
|
|
1
|
+
export * from './embeds.ts';
|
|
2
|
+
export * from './events.ts';
|
|
3
|
+
export * from './shared.ts';
|
|
4
|
+
export * from './manifest.ts';
|
|
5
|
+
export * from './notifications.ts';
|
package/dist/schemas/index.js
CHANGED
|
@@ -14,8 +14,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./embeds"), exports);
|
|
18
|
-
__exportStar(require("./events"), exports);
|
|
19
|
-
__exportStar(require("./shared"), exports);
|
|
20
|
-
__exportStar(require("./manifest"), exports);
|
|
21
|
-
__exportStar(require("./notifications"), exports);
|
|
17
|
+
__exportStar(require("./embeds.js"), exports);
|
|
18
|
+
__exportStar(require("./events.js"), exports);
|
|
19
|
+
__exportStar(require("./shared.js"), exports);
|
|
20
|
+
__exportStar(require("./manifest.js"), exports);
|
|
21
|
+
__exportStar(require("./notifications.js"), exports);
|
package/dist/schemas/manifest.js
CHANGED
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.domainManifestSchema = exports.domainFrameConfigSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
6
|
-
const
|
|
5
|
+
const types_ts_1 = require("../types.js");
|
|
6
|
+
const shared_ts_1 = require("./shared.js");
|
|
7
7
|
const primaryCategorySchema = zod_1.z.enum([
|
|
8
8
|
'games',
|
|
9
9
|
'social',
|
|
@@ -47,40 +47,40 @@ exports.domainFrameConfigSchema = zod_1.z.object({
|
|
|
47
47
|
zod_1.z.literal('1'),
|
|
48
48
|
zod_1.z.literal('next'),
|
|
49
49
|
]),
|
|
50
|
-
name:
|
|
51
|
-
iconUrl:
|
|
52
|
-
homeUrl:
|
|
50
|
+
name: shared_ts_1.frameNameSchema,
|
|
51
|
+
iconUrl: shared_ts_1.secureUrlSchema,
|
|
52
|
+
homeUrl: shared_ts_1.secureUrlSchema,
|
|
53
53
|
/** deprecated, set ogImageUrl instead */
|
|
54
|
-
imageUrl:
|
|
54
|
+
imageUrl: shared_ts_1.secureUrlSchema.optional(),
|
|
55
55
|
/** deprecated, will rely on fc:frame meta tag */
|
|
56
|
-
buttonTitle:
|
|
57
|
-
splashImageUrl:
|
|
58
|
-
splashBackgroundColor:
|
|
59
|
-
webhookUrl:
|
|
56
|
+
buttonTitle: shared_ts_1.buttonTitleSchema.optional(),
|
|
57
|
+
splashImageUrl: shared_ts_1.secureUrlSchema.optional(),
|
|
58
|
+
splashBackgroundColor: shared_ts_1.hexColorSchema.optional(),
|
|
59
|
+
webhookUrl: shared_ts_1.secureUrlSchema.optional(),
|
|
60
60
|
/** see: https://github.com/farcasterxyz/miniapps/discussions/191 */
|
|
61
|
-
subtitle: (0,
|
|
62
|
-
description: (0,
|
|
63
|
-
screenshotUrls: zod_1.z.array(
|
|
61
|
+
subtitle: (0, shared_ts_1.createSimpleStringSchema)({ max: 30 }).optional(),
|
|
62
|
+
description: (0, shared_ts_1.createSimpleStringSchema)({ max: 170 }).optional(),
|
|
63
|
+
screenshotUrls: zod_1.z.array(shared_ts_1.secureUrlSchema).max(3).optional(),
|
|
64
64
|
primaryCategory: primaryCategorySchema.optional(),
|
|
65
65
|
tags: zod_1.z
|
|
66
|
-
.array((0,
|
|
66
|
+
.array((0, shared_ts_1.createSimpleStringSchema)({ max: 20, noSpaces: true }))
|
|
67
67
|
.max(5)
|
|
68
68
|
.optional(),
|
|
69
|
-
heroImageUrl:
|
|
70
|
-
tagline: (0,
|
|
71
|
-
ogTitle: (0,
|
|
72
|
-
ogDescription: (0,
|
|
73
|
-
ogImageUrl:
|
|
69
|
+
heroImageUrl: shared_ts_1.secureUrlSchema.optional(),
|
|
70
|
+
tagline: (0, shared_ts_1.createSimpleStringSchema)({ max: 30 }).optional(),
|
|
71
|
+
ogTitle: (0, shared_ts_1.createSimpleStringSchema)({ max: 30 }).optional(),
|
|
72
|
+
ogDescription: (0, shared_ts_1.createSimpleStringSchema)({ max: 100 }).optional(),
|
|
73
|
+
ogImageUrl: shared_ts_1.secureUrlSchema.optional(),
|
|
74
74
|
/** see: https://github.com/farcasterxyz/miniapps/discussions/204 */
|
|
75
75
|
noindex: zod_1.z.boolean().optional(),
|
|
76
76
|
/** see https://github.com/farcasterxyz/miniapps/discussions/256 */
|
|
77
77
|
requiredChains: zod_1.z.array(zod_1.z.enum(chainList)).max(chainList.length).optional(),
|
|
78
78
|
requiredCapabilities: zod_1.z
|
|
79
|
-
.array(zod_1.z.enum(
|
|
80
|
-
.max(
|
|
79
|
+
.array(zod_1.z.enum(types_ts_1.miniAppHostCapabilityList))
|
|
80
|
+
.max(types_ts_1.miniAppHostCapabilityList.length)
|
|
81
81
|
.optional(),
|
|
82
82
|
});
|
|
83
83
|
exports.domainManifestSchema = zod_1.z.object({
|
|
84
|
-
accountAssociation:
|
|
84
|
+
accountAssociation: shared_ts_1.encodedJsonFarcasterSignatureSchema,
|
|
85
85
|
frame: exports.domainFrameConfigSchema.optional(),
|
|
86
86
|
});
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.sendNotificationResponseSchema = exports.sendNotificationRequestSchema = exports.notificationDetailsSchema = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
|
-
const
|
|
5
|
+
const shared_ts_1 = require("./shared.js");
|
|
6
6
|
exports.notificationDetailsSchema = zod_1.z.object({
|
|
7
7
|
url: zod_1.z.string(),
|
|
8
8
|
token: zod_1.z.string(),
|
|
@@ -11,7 +11,7 @@ exports.sendNotificationRequestSchema = zod_1.z.object({
|
|
|
11
11
|
notificationId: zod_1.z.string().max(128),
|
|
12
12
|
title: zod_1.z.string().max(32),
|
|
13
13
|
body: zod_1.z.string().max(128),
|
|
14
|
-
targetUrl:
|
|
14
|
+
targetUrl: shared_ts_1.secureUrlSchema,
|
|
15
15
|
tokens: zod_1.z.string().array().max(100),
|
|
16
16
|
});
|
|
17
17
|
exports.sendNotificationResponseSchema = zod_1.z.object({
|
package/dist/solanaWire.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import type { SolanaRequestFn, SolanaWireRequestFn } from './solana';
|
|
1
|
+
import type { SolanaRequestFn, SolanaWireRequestFn } from './solana.ts';
|
|
2
2
|
export declare function wrapSolanaProviderRequest(requestFn: SolanaRequestFn): SolanaWireRequestFn;
|
|
3
3
|
export declare function unwrapSolanaProviderRequest(wrappedRequestFn: SolanaWireRequestFn): SolanaRequestFn;
|
package/dist/types.d.ts
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import type { AddMiniApp, ComposeCast, Ready, SendToken, SignIn, SwapToken, ViewCast, ViewProfile, ViewToken } from './actions';
|
|
2
|
-
import type { FrameContext } from './context';
|
|
3
|
-
import type { EventFrameAdded, EventFrameRemoved, EventNotificationsDisabled, EventNotificationsEnabled } from './schemas';
|
|
4
|
-
import type { SolanaRequestFn, SolanaWireRequestFn } from './solana';
|
|
5
|
-
import type { Ethereum } from './wallet';
|
|
1
|
+
import type { AddMiniApp, ComposeCast, Haptics, Ready, SendToken, SignIn, SwapToken, ViewCast, ViewProfile, ViewToken } from './actions/index.ts';
|
|
2
|
+
import type { FrameContext } from './context.ts';
|
|
3
|
+
import type { EventFrameAdded, EventFrameRemoved, EventNotificationsDisabled, EventNotificationsEnabled } from './schemas/index.ts';
|
|
4
|
+
import type { SolanaRequestFn, SolanaWireRequestFn } from './solana.ts';
|
|
5
|
+
import type { Ethereum } from './wallet/index.ts';
|
|
6
6
|
export type SetPrimaryButtonOptions = {
|
|
7
7
|
text: string;
|
|
8
8
|
loading?: boolean;
|
|
9
9
|
disabled?: boolean;
|
|
10
10
|
hidden?: boolean;
|
|
11
11
|
};
|
|
12
|
-
export * from './wallet/ethereum';
|
|
13
|
-
export { DEFAULT_READY_OPTIONS, ReadyOptions } from './actions/Ready';
|
|
12
|
+
export * from './wallet/ethereum.ts';
|
|
13
|
+
export { DEFAULT_READY_OPTIONS, ReadyOptions } from './actions/Ready.ts';
|
|
14
14
|
export type SignInOptions = SignIn.SignInOptions;
|
|
15
15
|
export type SetPrimaryButton = (options: SetPrimaryButtonOptions) => void;
|
|
16
16
|
export declare const miniAppHostCapabilityList: [string, ...string[]];
|
|
17
|
-
export type MiniAppHostCapability = 'wallet.getEthereumProvider' | 'wallet.getSolanaProvider' | 'actions.ready' | 'actions.openUrl' | 'actions.close' | 'actions.setPrimaryButton' | 'actions.addMiniApp' | 'actions.signIn' | 'actions.viewCast' | 'actions.viewProfile' | 'actions.composeCast' | 'actions.viewToken' | 'actions.sendToken' | 'actions.swapToken';
|
|
17
|
+
export type MiniAppHostCapability = 'wallet.getEthereumProvider' | 'wallet.getSolanaProvider' | 'actions.ready' | 'actions.openUrl' | 'actions.close' | 'actions.setPrimaryButton' | 'actions.addMiniApp' | 'actions.signIn' | 'actions.viewCast' | 'actions.viewProfile' | 'actions.composeCast' | 'actions.viewToken' | 'actions.sendToken' | 'actions.swapToken' | 'actions.haptics.impactOccurred' | 'actions.haptics.notificationOccurred' | 'actions.haptics.selectionChanged';
|
|
18
18
|
export type GetCapabilities = () => Promise<MiniAppHostCapability[]>;
|
|
19
19
|
export type GetChains = () => Promise<string[]>;
|
|
20
20
|
export type WireFrameHost = {
|
|
@@ -35,6 +35,9 @@ export type WireFrameHost = {
|
|
|
35
35
|
sendToken: SendToken.SendToken;
|
|
36
36
|
swapToken: SwapToken.SwapToken;
|
|
37
37
|
composeCast: <close extends boolean | undefined = undefined>(options: ComposeCast.Options<close>) => Promise<ComposeCast.Result<close>>;
|
|
38
|
+
impactOccurred: Haptics.ImpactOccurred;
|
|
39
|
+
notificationOccurred: Haptics.NotificationOccurred;
|
|
40
|
+
selectionChanged: Haptics.SelectionChanged;
|
|
38
41
|
getCapabilities: GetCapabilities;
|
|
39
42
|
getChains: GetChains;
|
|
40
43
|
};
|
|
@@ -60,6 +63,9 @@ export type FrameHost = {
|
|
|
60
63
|
sendToken: SendToken.SendToken;
|
|
61
64
|
swapToken: SwapToken.SwapToken;
|
|
62
65
|
composeCast: <close extends boolean | undefined = undefined>(options: ComposeCast.Options<close>) => Promise<ComposeCast.Result<close>>;
|
|
66
|
+
impactOccurred: Haptics.ImpactOccurred;
|
|
67
|
+
notificationOccurred: Haptics.NotificationOccurred;
|
|
68
|
+
selectionChanged: Haptics.SelectionChanged;
|
|
63
69
|
getCapabilities: GetCapabilities;
|
|
64
70
|
getChains: GetChains;
|
|
65
71
|
};
|
package/dist/types.js
CHANGED
|
@@ -16,9 +16,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
exports.miniAppHostCapabilityList = exports.DEFAULT_READY_OPTIONS = void 0;
|
|
18
18
|
// start backwards compat, remove in 1.0
|
|
19
|
-
__exportStar(require("./wallet/ethereum"), exports);
|
|
20
|
-
var
|
|
21
|
-
Object.defineProperty(exports, "DEFAULT_READY_OPTIONS", { enumerable: true, get: function () { return
|
|
19
|
+
__exportStar(require("./wallet/ethereum.js"), exports);
|
|
20
|
+
var Ready_ts_1 = require("./actions/Ready.js");
|
|
21
|
+
Object.defineProperty(exports, "DEFAULT_READY_OPTIONS", { enumerable: true, get: function () { return Ready_ts_1.DEFAULT_READY_OPTIONS; } });
|
|
22
22
|
exports.miniAppHostCapabilityList = [
|
|
23
23
|
'wallet.getEthereumProvider',
|
|
24
24
|
'wallet.getSolanaProvider',
|
|
@@ -34,4 +34,7 @@ exports.miniAppHostCapabilityList = [
|
|
|
34
34
|
'actions.viewToken',
|
|
35
35
|
'actions.sendToken',
|
|
36
36
|
'actions.swapToken',
|
|
37
|
+
'actions.haptics.impactOccurred',
|
|
38
|
+
'actions.haptics.notificationOccurred',
|
|
39
|
+
'actions.haptics.selectionChanged',
|
|
37
40
|
];
|
package/dist/wallet/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as Ethereum from './ethereum';
|
|
1
|
+
export * as Ethereum from './ethereum.ts';
|
package/dist/wallet/index.js
CHANGED
|
@@ -34,4 +34,4 @@ var __importStar = (this && this.__importStar) || (function () {
|
|
|
34
34
|
})();
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
36
|
exports.Ethereum = void 0;
|
|
37
|
-
exports.Ethereum = __importStar(require("./ethereum"));
|
|
37
|
+
exports.Ethereum = __importStar(require("./ethereum.js"));
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as Errors from '../errors';
|
|
2
|
-
import type { OneOf } from '../internal/types';
|
|
3
|
-
import type { FrameNotificationDetails } from '../schemas';
|
|
1
|
+
import * as Errors from '../errors.ts';
|
|
2
|
+
import type { OneOf } from '../internal/types.ts';
|
|
3
|
+
import type { FrameNotificationDetails } from '../schemas/index.ts';
|
|
4
4
|
export type AddMiniAppResult = {
|
|
5
5
|
notificationDetails?: FrameNotificationDetails;
|
|
6
6
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/esm/actions/SignIn.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as Errors from '../errors';
|
|
2
|
-
import type { OneOf } from '../internal/types';
|
|
1
|
+
import * as Errors from '../errors.ts';
|
|
2
|
+
import type { OneOf } from '../internal/types.ts';
|
|
3
3
|
export type SignInOptions = {
|
|
4
4
|
/**
|
|
5
5
|
* A random string used to prevent replay attacks.
|
package/esm/actions/SignIn.js
CHANGED
package/esm/actions/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export * as AddMiniApp from './AddMiniApp';
|
|
2
|
-
export * as ComposeCast from './ComposeCast';
|
|
3
|
-
export * as
|
|
4
|
-
export * as
|
|
5
|
-
export * as
|
|
6
|
-
export * as
|
|
7
|
-
export * as
|
|
8
|
-
export * as
|
|
9
|
-
export * as
|
|
1
|
+
export * as AddMiniApp from './AddMiniApp.ts';
|
|
2
|
+
export * as ComposeCast from './ComposeCast.ts';
|
|
3
|
+
export * as Haptics from './Haptics.ts';
|
|
4
|
+
export * as Ready from './Ready.ts';
|
|
5
|
+
export * as SignIn from './SignIn.ts';
|
|
6
|
+
export * as SendToken from './SendToken.ts';
|
|
7
|
+
export * as SwapToken from './SwapToken.ts';
|
|
8
|
+
export * as ViewCast from './ViewCast.ts';
|
|
9
|
+
export * as ViewProfile from './ViewProfile.ts';
|
|
10
|
+
export * as ViewToken from './ViewToken.ts';
|
package/esm/actions/index.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
export * as AddMiniApp from
|
|
2
|
-
export * as ComposeCast from
|
|
3
|
-
export * as
|
|
4
|
-
export * as
|
|
5
|
-
export * as
|
|
6
|
-
export * as
|
|
7
|
-
export * as
|
|
8
|
-
export * as
|
|
9
|
-
export * as
|
|
1
|
+
export * as AddMiniApp from "./AddMiniApp.js";
|
|
2
|
+
export * as ComposeCast from "./ComposeCast.js";
|
|
3
|
+
export * as Haptics from "./Haptics.js";
|
|
4
|
+
export * as Ready from "./Ready.js";
|
|
5
|
+
export * as SignIn from "./SignIn.js";
|
|
6
|
+
export * as SendToken from "./SendToken.js";
|
|
7
|
+
export * as SwapToken from "./SwapToken.js";
|
|
8
|
+
export * as ViewCast from "./ViewCast.js";
|
|
9
|
+
export * as ViewProfile from "./ViewProfile.js";
|
|
10
|
+
export * as ViewToken from "./ViewToken.js";
|
package/esm/context.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { FrameNotificationDetails } from './schemas';
|
|
1
|
+
import type { FrameNotificationDetails } from './schemas/index.ts';
|
|
2
2
|
export type CastEmbedLocationContext = {
|
|
3
3
|
type: 'cast_embed';
|
|
4
4
|
embed: string;
|
|
@@ -65,8 +65,12 @@ export type ClientContext = {
|
|
|
65
65
|
notificationDetails?: FrameNotificationDetails;
|
|
66
66
|
safeAreaInsets?: SafeAreaInsets;
|
|
67
67
|
};
|
|
68
|
+
export type ClientFeatures = {
|
|
69
|
+
haptics: boolean;
|
|
70
|
+
};
|
|
68
71
|
export type FrameContext = {
|
|
69
72
|
client: ClientContext;
|
|
70
73
|
user: UserContext;
|
|
71
74
|
location?: LocationContext;
|
|
75
|
+
features?: ClientFeatures;
|
|
72
76
|
};
|
package/esm/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from './actions';
|
|
2
|
-
export * from './wallet';
|
|
3
|
-
export * as Errors from './errors';
|
|
4
|
-
export * as Context from './context';
|
|
5
|
-
export * as Manifest from './manifest';
|
|
6
|
-
export * from './types';
|
|
7
|
-
export * from './schemas';
|
|
8
|
-
export * from './solana';
|
|
9
|
-
export * from './solanaWire';
|
|
1
|
+
export * from './actions/index.ts';
|
|
2
|
+
export * from './wallet/index.ts';
|
|
3
|
+
export * as Errors from './errors.ts';
|
|
4
|
+
export * as Context from './context.ts';
|
|
5
|
+
export * as Manifest from './manifest.ts';
|
|
6
|
+
export * from './types.ts';
|
|
7
|
+
export * from './schemas/index.ts';
|
|
8
|
+
export * from './solana.ts';
|
|
9
|
+
export * from './solanaWire.ts';
|
package/esm/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from
|
|
2
|
-
export * from
|
|
3
|
-
export * as Errors from
|
|
4
|
-
export * as Context from
|
|
5
|
-
export * as Manifest from
|
|
6
|
-
export * from
|
|
7
|
-
export * from
|
|
8
|
-
export * from
|
|
9
|
-
export * from
|
|
1
|
+
export * from "./actions/index.js";
|
|
2
|
+
export * from "./wallet/index.js";
|
|
3
|
+
export * as Errors from "./errors.js";
|
|
4
|
+
export * as Context from "./context.js";
|
|
5
|
+
export * as Manifest from "./manifest.js";
|
|
6
|
+
export * from "./types.js";
|
|
7
|
+
export * from "./schemas/index.js";
|
|
8
|
+
export * from "./solana.js";
|
|
9
|
+
export * from "./solanaWire.js";
|
package/esm/manifest.d.ts
CHANGED
|
@@ -8,7 +8,7 @@ export type Manifest = {
|
|
|
8
8
|
/**
|
|
9
9
|
* Signed domain association linking this frame to a Farcaster account
|
|
10
10
|
*
|
|
11
|
-
* A DomainAssociation can be generated using the {@link https://
|
|
11
|
+
* A DomainAssociation can be generated using the {@link https://farcaster.xyz/~/developers/domains | Warpcast
|
|
12
12
|
* Domains Developer} tool.
|
|
13
13
|
*/
|
|
14
14
|
export type AccountAssociation = {
|
package/esm/schemas/embeds.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { aspectRatioSchema, buttonTitleSchema, caip19TokenSchema, frameNameSchema, hexColorSchema, secureUrlSchema, } from
|
|
2
|
+
import { aspectRatioSchema, buttonTitleSchema, caip19TokenSchema, frameNameSchema, hexColorSchema, secureUrlSchema, } from "./shared.js";
|
|
3
3
|
export const actionLaunchFrameSchema = z.object({
|
|
4
4
|
type: z.literal('launch_frame'),
|
|
5
5
|
name: frameNameSchema,
|