@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/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>>