@farcaster/frame-sdk 0.0.0-canary-20250512185912 → 0.0.0-canary-20250512194707

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/sdk.js CHANGED
@@ -1,4 +1,4 @@
1
- import { AddFrame, SignIn, } from '@farcaster/frame-core';
1
+ import { AddMiniApp, SignIn, } from '@farcaster/frame-core';
2
2
  import { EventEmitter } from 'eventemitter3';
3
3
  import { evmProvider, getEvmProvider } from './evmProvider';
4
4
  import { frameHost } from './frameHost';
@@ -61,6 +61,19 @@ async function isInMiniApp(timeoutMs = 50) {
61
61
  }
62
62
  return isInMiniApp;
63
63
  }
64
+ const addMiniApp = async () => {
65
+ const response = await frameHost.addFrame();
66
+ if (response.result) {
67
+ return response.result;
68
+ }
69
+ if (response.error.type === 'invalid_domain_manifest') {
70
+ throw new AddMiniApp.InvalidDomainManifest();
71
+ }
72
+ if (response.error.type === 'rejected_by_user') {
73
+ throw new AddMiniApp.RejectedByUser();
74
+ }
75
+ throw new Error('Unreachable');
76
+ };
64
77
  export const sdk = {
65
78
  ...emitter,
66
79
  getCapabilities: frameHost.getCapabilities,
@@ -85,19 +98,8 @@ export const sdk = {
85
98
  const url = typeof urlArg === 'string' ? urlArg : urlArg.url;
86
99
  return frameHost.openUrl(url.trim());
87
100
  },
88
- addFrame: async () => {
89
- const response = await frameHost.addFrame();
90
- if (response.result) {
91
- return response.result;
92
- }
93
- if (response.error.type === 'invalid_domain_manifest') {
94
- throw new AddFrame.InvalidDomainManifest();
95
- }
96
- if (response.error.type === 'rejected_by_user') {
97
- throw new AddFrame.RejectedByUser();
98
- }
99
- throw new Error('Unreachable');
100
- },
101
+ addFrame: addMiniApp,
102
+ addMiniApp,
101
103
  composeCast(options = {}) {
102
104
  return frameHost.composeCast(options);
103
105
  },