@farcaster/miniapp-core 0.3.4 → 0.3.5
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/OpenMiniApp.d.ts +4 -0
- package/dist/actions/OpenMiniApp.js +2 -0
- package/dist/actions/index.d.ts +1 -0
- package/dist/actions/index.js +2 -1
- package/dist/context.d.ts +7 -1
- package/dist/schemas/manifest.d.ts +27 -27
- package/dist/types.d.ts +4 -2
- package/dist/types.js +1 -0
- package/esm/actions/OpenMiniApp.d.ts +4 -0
- package/esm/actions/OpenMiniApp.js +1 -0
- package/esm/actions/index.d.ts +1 -0
- package/esm/actions/index.js +1 -0
- package/esm/context.d.ts +7 -1
- package/esm/schemas/manifest.d.ts +27 -27
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/esm/types.d.ts +4 -2
- package/esm/types.js +1 -0
- package/package.json +1 -1
- package/src/actions/OpenMiniApp.ts +5 -0
- package/src/actions/index.ts +1 -0
- package/src/context.ts +9 -0
- package/src/types.ts +4 -0
package/src/context.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import type { MiniAppNotificationDetails } from './schemas/index.ts'
|
|
2
2
|
|
|
3
|
+
export type MiniAppPlatformType = 'web' | 'mobile'
|
|
4
|
+
|
|
3
5
|
export type MiniAppUser = {
|
|
4
6
|
fid: number
|
|
5
7
|
username?: string
|
|
@@ -63,12 +65,18 @@ export type ChannelLocationContext = {
|
|
|
63
65
|
}
|
|
64
66
|
}
|
|
65
67
|
|
|
68
|
+
export type OpenMiniAppLocationContext = {
|
|
69
|
+
type: 'open_miniapp'
|
|
70
|
+
referrerDomain: string
|
|
71
|
+
}
|
|
72
|
+
|
|
66
73
|
export type LocationContext =
|
|
67
74
|
| CastEmbedLocationContext
|
|
68
75
|
| CastShareLocationContext
|
|
69
76
|
| NotificationLocationContext
|
|
70
77
|
| LauncherLocationContext
|
|
71
78
|
| ChannelLocationContext
|
|
79
|
+
| OpenMiniAppLocationContext
|
|
72
80
|
|
|
73
81
|
export type AccountLocation = {
|
|
74
82
|
placeId: string
|
|
@@ -99,6 +107,7 @@ export type SafeAreaInsets = {
|
|
|
99
107
|
}
|
|
100
108
|
|
|
101
109
|
export type ClientContext = {
|
|
110
|
+
platformType?: MiniAppPlatformType
|
|
102
111
|
clientFid: number
|
|
103
112
|
added: boolean
|
|
104
113
|
notificationDetails?: MiniAppNotificationDetails
|
package/src/types.ts
CHANGED
|
@@ -6,6 +6,7 @@ import type {
|
|
|
6
6
|
import type {
|
|
7
7
|
AddMiniApp,
|
|
8
8
|
ComposeCast,
|
|
9
|
+
OpenMiniApp,
|
|
9
10
|
Ready,
|
|
10
11
|
SendToken,
|
|
11
12
|
SignIn,
|
|
@@ -60,6 +61,7 @@ export const miniAppHostCapabilityList = [
|
|
|
60
61
|
'actions.viewToken',
|
|
61
62
|
'actions.sendToken',
|
|
62
63
|
'actions.swapToken',
|
|
64
|
+
'actions.openMiniApp',
|
|
63
65
|
'haptics.impactOccurred',
|
|
64
66
|
'haptics.notificationOccurred',
|
|
65
67
|
'haptics.selectionChanged',
|
|
@@ -91,6 +93,7 @@ export type WireMiniAppHost = {
|
|
|
91
93
|
viewToken: ViewToken.ViewToken
|
|
92
94
|
sendToken: SendToken.SendToken
|
|
93
95
|
swapToken: SwapToken.SwapToken
|
|
96
|
+
openMiniApp: OpenMiniApp.OpenMiniApp
|
|
94
97
|
composeCast: <close extends boolean | undefined = undefined>(
|
|
95
98
|
options: ComposeCast.Options<close>,
|
|
96
99
|
) => Promise<ComposeCast.Result<close>>
|
|
@@ -124,6 +127,7 @@ export type MiniAppHost = {
|
|
|
124
127
|
viewToken: ViewToken.ViewToken
|
|
125
128
|
sendToken: SendToken.SendToken
|
|
126
129
|
swapToken: SwapToken.SwapToken
|
|
130
|
+
openMiniApp: OpenMiniApp.OpenMiniApp
|
|
127
131
|
composeCast: <close extends boolean | undefined = undefined>(
|
|
128
132
|
options: ComposeCast.Options<close>,
|
|
129
133
|
) => Promise<ComposeCast.Result<close>>
|