@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/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AddMiniApp, ComposeCast, Context, GetCapabilities, GetChains, ImpactOccurred, MiniAppNotificationDetails, NotificationOccurred, OpenMiniApp, Ready, RequestCameraAndMicrophoneAccess, SelectionChanged, SendToken, SetPrimaryButtonOptions, SignIn, SolanaWalletProvider, SwapToken, ViewCast, ViewProfile, ViewToken } from '@farcaster/miniapp-core';
|
|
1
|
+
import type { AddMiniApp, ComposeCast, Context, GetCapabilities, GetChains, ImpactOccurred, MiniAppNotificationDetails, NotificationOccurred, OpenMiniApp, Ready, RequestCameraAndMicrophoneAccess, SelectionChanged, SendToken, SetPrimaryButtonOptions, SignIn, SignManifest, SolanaWalletProvider, SwapToken, ViewCast, ViewProfile, ViewToken } from '@farcaster/miniapp-core';
|
|
2
2
|
import type { EventEmitter } from 'eventemitter3';
|
|
3
3
|
import type * as Provider from 'ox/Provider';
|
|
4
4
|
import type { Back } from './back.ts';
|
|
@@ -59,6 +59,7 @@ export type MiniAppSDK = {
|
|
|
59
59
|
};
|
|
60
60
|
experimental: {
|
|
61
61
|
getSolanaProvider: () => Promise<SolanaWalletProvider | undefined>;
|
|
62
|
+
signManifest: SignManifest.SignManifest;
|
|
62
63
|
/**
|
|
63
64
|
* @deprecated - use `sdk.quickAuth.getToken`
|
|
64
65
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farcaster/miniapp-sdk",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20250926142931",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
"comlink": "^4.4.2",
|
|
24
24
|
"eventemitter3": "^5.0.1",
|
|
25
25
|
"ox": "^0.4.4",
|
|
26
|
-
"@farcaster/miniapp-core": "0.0.0-canary-
|
|
26
|
+
"@farcaster/miniapp-core": "0.0.0-canary-20250926142931"
|
|
27
27
|
},
|
|
28
28
|
"scripts": {
|
|
29
29
|
"clean": "rm -rf dist",
|
package/src/sdk.ts
CHANGED
|
@@ -2,6 +2,7 @@ import {
|
|
|
2
2
|
AddMiniApp,
|
|
3
3
|
type MiniAppClientEvent,
|
|
4
4
|
SignIn,
|
|
5
|
+
SignManifest,
|
|
5
6
|
} from '@farcaster/miniapp-core'
|
|
6
7
|
import { createBack } from './back.ts'
|
|
7
8
|
import { ethereumProvider, getEthereumProvider } from './ethereumProvider.ts'
|
|
@@ -91,7 +92,10 @@ export const sdk: MiniAppSDK = {
|
|
|
91
92
|
viewProfile: miniAppHost.viewProfile.bind(miniAppHost),
|
|
92
93
|
openMiniApp: miniAppHost.openMiniApp.bind(miniAppHost),
|
|
93
94
|
signIn: async (options) => {
|
|
94
|
-
const response = await miniAppHost.signIn(
|
|
95
|
+
const response = await miniAppHost.signIn({
|
|
96
|
+
...options,
|
|
97
|
+
acceptAuthAddress: options.acceptAuthAddress ?? true,
|
|
98
|
+
})
|
|
95
99
|
if (response.result) {
|
|
96
100
|
return response.result
|
|
97
101
|
}
|
|
@@ -119,6 +123,26 @@ export const sdk: MiniAppSDK = {
|
|
|
119
123
|
},
|
|
120
124
|
experimental: {
|
|
121
125
|
getSolanaProvider,
|
|
126
|
+
signManifest: async (options) => {
|
|
127
|
+
const response = await miniAppHost.signManifest(options)
|
|
128
|
+
if (response.result) {
|
|
129
|
+
return response.result
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (response.error.type === 'rejected_by_user') {
|
|
133
|
+
throw new SignManifest.RejectedByUser()
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
if (response.error.type === 'invalid_domain') {
|
|
137
|
+
throw new SignManifest.InvalidDomain()
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
if (response.error.type === 'generic_error') {
|
|
141
|
+
throw new SignManifest.GenericError(response.error.message)
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
throw new Error('Unreachable')
|
|
145
|
+
},
|
|
122
146
|
quickAuth(options) {
|
|
123
147
|
return quickAuth.getToken(options)
|
|
124
148
|
},
|
package/src/types.ts
CHANGED
|
@@ -14,6 +14,7 @@ import type {
|
|
|
14
14
|
SendToken,
|
|
15
15
|
SetPrimaryButtonOptions,
|
|
16
16
|
SignIn,
|
|
17
|
+
SignManifest,
|
|
17
18
|
SolanaWalletProvider,
|
|
18
19
|
SwapToken,
|
|
19
20
|
ViewCast,
|
|
@@ -93,6 +94,7 @@ export type MiniAppSDK = {
|
|
|
93
94
|
}
|
|
94
95
|
experimental: {
|
|
95
96
|
getSolanaProvider: () => Promise<SolanaWalletProvider | undefined>
|
|
97
|
+
signManifest: SignManifest.SignManifest
|
|
96
98
|
|
|
97
99
|
/**
|
|
98
100
|
* @deprecated - use `sdk.quickAuth.getToken`
|