@farcaster/miniapp-sdk 0.1.9 → 0.1.10
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 +17 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +2 -1
- package/package.json +2 -2
- package/src/sdk.ts +21 -0
- 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";
|
|
@@ -99,6 +99,22 @@ export const sdk = {
|
|
|
99
99
|
},
|
|
100
100
|
experimental: {
|
|
101
101
|
getSolanaProvider,
|
|
102
|
+
signManifest: async (options) => {
|
|
103
|
+
const response = await miniAppHost.signManifest(options);
|
|
104
|
+
if (response.result) {
|
|
105
|
+
return response.result;
|
|
106
|
+
}
|
|
107
|
+
if (response.error.type === 'rejected_by_user') {
|
|
108
|
+
throw new SignManifest.RejectedByUser();
|
|
109
|
+
}
|
|
110
|
+
if (response.error.type === 'invalid_domain') {
|
|
111
|
+
throw new SignManifest.InvalidDomain();
|
|
112
|
+
}
|
|
113
|
+
if (response.error.type === 'generic_error') {
|
|
114
|
+
throw new SignManifest.GenericError(response.error.message);
|
|
115
|
+
}
|
|
116
|
+
throw new Error('Unreachable');
|
|
117
|
+
},
|
|
102
118
|
quickAuth(options) {
|
|
103
119
|
return quickAuth.getToken(options);
|
|
104
120
|
},
|