@farcaster/frame-sdk 0.0.0-canary-20250513182339 → 0.0.0-canary-20250515200421
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/evmProvider.js +9 -6
- package/dist/index.min.js +6 -6
- package/dist/index.min.js.map +3 -3
- package/dist/sdk.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types.d.ts +2 -1
- package/package.json +2 -2
- package/src/evmProvider.ts +9 -6
- package/src/sdk.ts +1 -0
- package/src/types.ts +2 -0
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AddMiniApp, ComposeCast, Context, FrameNotificationDetails, GetCapabilities, Ready, SendToken, SetPrimaryButtonOptions, SignIn, SolanaWalletProvider, SwapToken, ViewProfile, ViewToken } from '@farcaster/frame-core';
|
|
1
|
+
import type { AddMiniApp, ComposeCast, Context, FrameNotificationDetails, GetCapabilities, GetChains, Ready, SendToken, SetPrimaryButtonOptions, SignIn, SolanaWalletProvider, SwapToken, ViewProfile, ViewToken } from '@farcaster/frame-core';
|
|
2
2
|
import type { EventEmitter } from 'eventemitter3';
|
|
3
3
|
import type * as Provider from 'ox/Provider';
|
|
4
4
|
declare global {
|
|
@@ -30,6 +30,7 @@ export type Emitter = Compute<EventEmitter<EventMap>>;
|
|
|
30
30
|
type SetPrimaryButton = (options: SetPrimaryButtonOptions) => Promise<void>;
|
|
31
31
|
export type FrameSDK = {
|
|
32
32
|
getCapabilities: GetCapabilities;
|
|
33
|
+
getChains: GetChains;
|
|
33
34
|
isInMiniApp: () => Promise<boolean>;
|
|
34
35
|
context: Promise<Context.FrameContext>;
|
|
35
36
|
actions: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farcaster/frame-sdk",
|
|
3
|
-
"version": "0.0.0-canary-
|
|
3
|
+
"version": "0.0.0-canary-20250515200421",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"comlink": "^4.4.2",
|
|
23
23
|
"eventemitter3": "^5.0.1",
|
|
24
24
|
"ox": "^0.4.4",
|
|
25
|
-
"@farcaster/frame-core": "0.0.
|
|
25
|
+
"@farcaster/frame-core": "0.0.0-canary-20250515200421"
|
|
26
26
|
},
|
|
27
27
|
"scripts": {
|
|
28
28
|
"clean": "rm -rf dist",
|
package/src/evmProvider.ts
CHANGED
|
@@ -85,14 +85,17 @@ export const evmProvider: Provider.Provider = Provider.from({
|
|
|
85
85
|
})
|
|
86
86
|
|
|
87
87
|
export async function getEvmProvider(): Promise<Provider.Provider | undefined> {
|
|
88
|
-
let capabilities: MiniAppHostCapability[] | undefined
|
|
89
88
|
try {
|
|
90
|
-
capabilities = await frameHost.getCapabilities()
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
89
|
+
const capabilities = await frameHost.getCapabilities()
|
|
90
|
+
if (!capabilities.includes('wallet.getEvmProvider')) {
|
|
91
|
+
return undefined
|
|
92
|
+
}
|
|
93
|
+
return evmProvider
|
|
94
|
+
} catch {
|
|
95
|
+
// If this is an old frame host that doesn't support getCapabilities,
|
|
96
|
+
// getEvmProvider will assume that it's supported
|
|
97
|
+
return evmProvider
|
|
94
98
|
}
|
|
95
|
-
return evmProvider
|
|
96
99
|
}
|
|
97
100
|
|
|
98
101
|
function announceEvmProvider(
|
package/src/sdk.ts
CHANGED
package/src/types.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type {
|
|
|
4
4
|
Context,
|
|
5
5
|
FrameNotificationDetails,
|
|
6
6
|
GetCapabilities,
|
|
7
|
+
GetChains,
|
|
7
8
|
Ready,
|
|
8
9
|
SendToken,
|
|
9
10
|
SetPrimaryButtonOptions,
|
|
@@ -54,6 +55,7 @@ type SetPrimaryButton = (options: SetPrimaryButtonOptions) => Promise<void>
|
|
|
54
55
|
|
|
55
56
|
export type FrameSDK = {
|
|
56
57
|
getCapabilities: GetCapabilities
|
|
58
|
+
getChains: GetChains
|
|
57
59
|
isInMiniApp: () => Promise<boolean>
|
|
58
60
|
context: Promise<Context.FrameContext>
|
|
59
61
|
actions: {
|