Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/miniapp-core/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,8 @@ export const miniAppHostCapabilityList = [
'actions.sendToken',
'actions.swapToken',
'actions.openMiniApp',
// Legacy alias for actions.openMiniApp (Frames `open_snap`)
'actions.openSnap',
'actions.requestCameraAndMicrophoneAccess',
'experimental.signManifest',
'haptics.impactOccurred',
Expand Down Expand Up @@ -97,6 +99,8 @@ export type WireMiniAppHost = {
sendToken: SendToken.SendToken
swapToken: SwapToken.SwapToken
openMiniApp: OpenMiniApp.OpenMiniApp
/** @deprecated Legacy Frames wire name; same as {@link openMiniApp}. */
openSnap: OpenMiniApp.OpenMiniApp
composeCast: <close extends boolean | undefined = undefined>(
options: ComposeCast.Options<close>,
) => Promise<ComposeCast.Result<close>>
Expand Down
3 changes: 3 additions & 0 deletions packages/miniapp-host/src/comlink/comlink.ts
Original file line number Diff line number Diff line change
Expand Up @@ -387,6 +387,9 @@ export function expose(
return obj.updateBackState(...argumentList);
case 'openMiniApp':
return obj.openMiniApp(...argumentList);
// Legacy Frames SDK name for opening another mini app
case 'openSnap':
return obj.openSnap(...argumentList);
default:
throw new Error(`Unsupported APPLY for ${path.join('/')}`)
}
Expand Down
1 change: 1 addition & 0 deletions packages/miniapp-host/src/helpers/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import {
export function wrapHandlers(host: MiniAppHost): WireMiniAppHost {
return {
...host,
openSnap: host.openMiniApp,
addFrame: async () => {
try {
const result = await host.addMiniApp()
Expand Down
1 change: 1 addition & 0 deletions packages/miniapp-sdk/src/sdk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ export const sdk: MiniAppSDK = {
viewCast: miniAppHost.viewCast.bind(miniAppHost),
viewProfile: miniAppHost.viewProfile.bind(miniAppHost),
openMiniApp: miniAppHost.openMiniApp.bind(miniAppHost),
openSnap: miniAppHost.openSnap.bind(miniAppHost),
signIn: async (options) => {
const response = await miniAppHost.signIn({
...options,
Expand Down
2 changes: 2 additions & 0 deletions packages/miniapp-sdk/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ export type MiniAppSDK = {
sendToken: SendToken.SendToken
swapToken: SwapToken.SwapToken
openMiniApp: OpenMiniApp.OpenMiniApp
/** @deprecated Legacy Frames action name; same as {@link openMiniApp}. */
openSnap: OpenMiniApp.OpenMiniApp
requestCameraAndMicrophoneAccess: RequestCameraAndMicrophoneAccess.RequestCameraAndMicrophoneAccess
}
experimental: {
Expand Down
Loading