@farcaster/miniapp-sdk 0.0.0-canary-20250816182708 → 0.0.0-canary-20250926142931
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/index.min.js +11 -11
- package/dist/index.min.js.map +4 -4
- package/dist/sdk.js +21 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +2 -1
- package/package.json +2 -2
- package/src/sdk.ts +25 -1
- package/src/types.ts +2 -0
package/dist/sdk.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AddMiniApp, SignIn, } from '@farcaster/miniapp-core';
|
|
1
|
+
import { AddMiniApp, SignIn, SignManifest, } from '@farcaster/miniapp-core';
|
|
2
2
|
import { createBack } from "./back.js";
|
|
3
3
|
import { ethereumProvider, getEthereumProvider } from "./ethereumProvider.js";
|
|
4
4
|
import { miniAppHost } from "./miniAppHost.js";
|
|
@@ -74,7 +74,10 @@ export const sdk = {
|
|
|
74
74
|
viewProfile: miniAppHost.viewProfile.bind(miniAppHost),
|
|
75
75
|
openMiniApp: miniAppHost.openMiniApp.bind(miniAppHost),
|
|
76
76
|
signIn: async (options) => {
|
|
77
|
-
const response = await miniAppHost.signIn(
|
|
77
|
+
const response = await miniAppHost.signIn({
|
|
78
|
+
...options,
|
|
79
|
+
acceptAuthAddress: options.acceptAuthAddress ?? true,
|
|
80
|
+
});
|
|
78
81
|
if (response.result) {
|
|
79
82
|
return response.result;
|
|
80
83
|
}
|
|
@@ -99,6 +102,22 @@ export const sdk = {
|
|
|
99
102
|
},
|
|
100
103
|
experimental: {
|
|
101
104
|
getSolanaProvider,
|
|
105
|
+
signManifest: async (options) => {
|
|
106
|
+
const response = await miniAppHost.signManifest(options);
|
|
107
|
+
if (response.result) {
|
|
108
|
+
return response.result;
|
|
109
|
+
}
|
|
110
|
+
if (response.error.type === 'rejected_by_user') {
|
|
111
|
+
throw new SignManifest.RejectedByUser();
|
|
112
|
+
}
|
|
113
|
+
if (response.error.type === 'invalid_domain') {
|
|
114
|
+
throw new SignManifest.InvalidDomain();
|
|
115
|
+
}
|
|
116
|
+
if (response.error.type === 'generic_error') {
|
|
117
|
+
throw new SignManifest.GenericError(response.error.message);
|
|
118
|
+
}
|
|
119
|
+
throw new Error('Unreachable');
|
|
120
|
+
},
|
|
102
121
|
quickAuth(options) {
|
|
103
122
|
return quickAuth.getToken(options);
|
|
104
123
|
},
|