@farcaster/frame-core 0.1.0 → 0.1.2
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/actions/AddMiniApp.d.ts +3 -3
- package/dist/actions/AddMiniApp.js +1 -1
- package/dist/actions/SignIn.d.ts +2 -2
- package/dist/actions/SignIn.js +1 -1
- package/dist/actions/ViewCast.d.ts +25 -0
- package/dist/actions/ViewCast.js +2 -0
- package/dist/actions/index.d.ts +9 -8
- package/dist/actions/index.js +10 -9
- package/dist/context.d.ts +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +9 -9
- package/dist/schemas/embeds.js +9 -9
- package/dist/schemas/events.js +3 -3
- package/dist/schemas/index.d.ts +5 -5
- package/dist/schemas/index.js +5 -5
- package/dist/schemas/manifest.js +22 -22
- package/dist/schemas/notifications.js +2 -2
- package/dist/solanaWire.d.ts +1 -1
- package/dist/types.d.ts +10 -8
- package/dist/types.js +4 -3
- package/dist/wallet/index.d.ts +1 -1
- package/dist/wallet/index.js +1 -1
- package/esm/actions/AddMiniApp.d.ts +3 -3
- package/esm/actions/AddMiniApp.js +1 -1
- package/esm/actions/SignIn.d.ts +2 -2
- package/esm/actions/SignIn.js +1 -1
- package/esm/actions/ViewCast.d.ts +25 -0
- package/esm/actions/ViewCast.js +1 -0
- package/esm/actions/index.d.ts +9 -8
- package/esm/actions/index.js +9 -8
- package/esm/context.d.ts +1 -1
- package/esm/index.d.ts +9 -9
- package/esm/index.js +9 -9
- package/esm/schemas/embeds.js +1 -1
- package/esm/schemas/events.js +1 -1
- package/esm/schemas/index.d.ts +5 -5
- package/esm/schemas/index.js +5 -5
- package/esm/schemas/manifest.js +2 -2
- package/esm/schemas/notifications.js +1 -1
- package/esm/solanaWire.d.ts +1 -1
- package/esm/tsconfig.tsbuildinfo +1 -1
- package/esm/types.d.ts +10 -8
- package/esm/types.js +3 -2
- package/esm/wallet/index.d.ts +1 -1
- package/esm/wallet/index.js +1 -1
- package/package.json +2 -2
- package/src/actions/AddMiniApp.ts +3 -3
- package/src/actions/SignIn.ts +2 -2
- package/src/actions/ViewCast.ts +27 -0
- package/src/actions/index.ts +9 -8
- package/src/context.ts +1 -1
- package/src/index.ts +9 -9
- package/src/schemas/embeds.ts +1 -1
- package/src/schemas/events.ts +1 -1
- package/src/schemas/index.ts +5 -5
- package/src/schemas/manifest.ts +2 -2
- package/src/schemas/notifications.ts +1 -1
- package/src/solanaWire.ts +1 -1
- package/src/types.ts +12 -7
- package/src/wallet/index.ts +1 -1
package/esm/wallet/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as Ethereum from
|
|
1
|
+
export * as Ethereum from "./ethereum.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farcaster/frame-core",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@vitest/coverage-v8": "^2.1.8",
|
|
19
19
|
"typescript": "^5.8.3",
|
|
20
20
|
"vitest": "^2.1.9",
|
|
21
|
-
"@farcaster/tsconfig": "0.0.
|
|
21
|
+
"@farcaster/tsconfig": "0.0.5"
|
|
22
22
|
},
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@solana/web3.js": "^1.98.2",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import * as Errors from '../errors'
|
|
2
|
-
import type { OneOf } from '../internal/types'
|
|
3
|
-
import type { FrameNotificationDetails } from '../schemas'
|
|
1
|
+
import * as Errors from '../errors.ts'
|
|
2
|
+
import type { OneOf } from '../internal/types.ts'
|
|
3
|
+
import type { FrameNotificationDetails } from '../schemas/index.ts'
|
|
4
4
|
|
|
5
5
|
export type AddMiniAppResult = {
|
|
6
6
|
notificationDetails?: FrameNotificationDetails
|
package/src/actions/SignIn.ts
CHANGED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export type ViewCastOptions = {
|
|
2
|
+
/**
|
|
3
|
+
* The hash of the cast to view.
|
|
4
|
+
* @example "0x6a112e2d35e2d2008e25dd29811e8769d1edd9ca"
|
|
5
|
+
*/
|
|
6
|
+
hash: string
|
|
7
|
+
|
|
8
|
+
/**
|
|
9
|
+
* Whether the app should be closed when this action is called.
|
|
10
|
+
* If true, the app will be closed after opening the cast view.
|
|
11
|
+
*/
|
|
12
|
+
close?: boolean
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Opens a cast view in the Farcaster client.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* await sdk.actions.viewCast({
|
|
21
|
+
* hash: "0x6a112e2d35e2d2008e25dd29811e8769d1edd9ca"
|
|
22
|
+
* })
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @see {@link https://miniapps.farcaster.xyz/docs/sdk/actions/view-cast | View Cast Documentation}
|
|
26
|
+
*/
|
|
27
|
+
export type ViewCast = (options: ViewCastOptions) => Promise<void>
|
package/src/actions/index.ts
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export * as AddMiniApp from './AddMiniApp'
|
|
2
|
-
export * as ComposeCast from './ComposeCast'
|
|
3
|
-
export * as Ready from './Ready'
|
|
4
|
-
export * as SignIn from './SignIn'
|
|
5
|
-
export * as SendToken from './SendToken'
|
|
6
|
-
export * as SwapToken from './SwapToken'
|
|
7
|
-
export * as
|
|
8
|
-
export * as
|
|
1
|
+
export * as AddMiniApp from './AddMiniApp.ts'
|
|
2
|
+
export * as ComposeCast from './ComposeCast.ts'
|
|
3
|
+
export * as Ready from './Ready.ts'
|
|
4
|
+
export * as SignIn from './SignIn.ts'
|
|
5
|
+
export * as SendToken from './SendToken.ts'
|
|
6
|
+
export * as SwapToken from './SwapToken.ts'
|
|
7
|
+
export * as ViewCast from './ViewCast.ts'
|
|
8
|
+
export * as ViewProfile from './ViewProfile.ts'
|
|
9
|
+
export * as ViewToken from './ViewToken.ts'
|
package/src/context.ts
CHANGED
package/src/index.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export * from './actions'
|
|
2
|
-
export * from './wallet'
|
|
3
|
-
export * as Errors from './errors'
|
|
4
|
-
export * as Context from './context'
|
|
5
|
-
export * as Manifest from './manifest'
|
|
6
|
-
export * from './types'
|
|
7
|
-
export * from './schemas'
|
|
8
|
-
export * from './solana'
|
|
9
|
-
export * from './solanaWire'
|
|
1
|
+
export * from './actions/index.ts'
|
|
2
|
+
export * from './wallet/index.ts'
|
|
3
|
+
export * as Errors from './errors.ts'
|
|
4
|
+
export * as Context from './context.ts'
|
|
5
|
+
export * as Manifest from './manifest.ts'
|
|
6
|
+
export * from './types.ts'
|
|
7
|
+
export * from './schemas/index.ts'
|
|
8
|
+
export * from './solana.ts'
|
|
9
|
+
export * from './solanaWire.ts'
|
package/src/schemas/embeds.ts
CHANGED
package/src/schemas/events.ts
CHANGED
package/src/schemas/index.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export * from './embeds'
|
|
2
|
-
export * from './events'
|
|
3
|
-
export * from './shared'
|
|
4
|
-
export * from './manifest'
|
|
5
|
-
export * from './notifications'
|
|
1
|
+
export * from './embeds.ts'
|
|
2
|
+
export * from './events.ts'
|
|
3
|
+
export * from './shared.ts'
|
|
4
|
+
export * from './manifest.ts'
|
|
5
|
+
export * from './notifications.ts'
|
package/src/schemas/manifest.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { z } from 'zod'
|
|
2
|
-
import { miniAppHostCapabilityList } from '../types'
|
|
2
|
+
import { miniAppHostCapabilityList } from '../types.ts'
|
|
3
3
|
import {
|
|
4
4
|
buttonTitleSchema,
|
|
5
5
|
createSimpleStringSchema,
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
frameNameSchema,
|
|
8
8
|
hexColorSchema,
|
|
9
9
|
secureUrlSchema,
|
|
10
|
-
} from './shared'
|
|
10
|
+
} from './shared.ts'
|
|
11
11
|
|
|
12
12
|
const primaryCategorySchema = z.enum([
|
|
13
13
|
'games',
|
package/src/solanaWire.ts
CHANGED
|
@@ -14,7 +14,7 @@ import type {
|
|
|
14
14
|
SolanaWireRequestFn,
|
|
15
15
|
SolanaWireSignAndSendTransactionRequestArguments,
|
|
16
16
|
SolanaWireSignTransactionRequestArguments,
|
|
17
|
-
} from './solana'
|
|
17
|
+
} from './solana.ts'
|
|
18
18
|
|
|
19
19
|
function serializeTransaction(transaction: SolanaCombinedTransaction): string {
|
|
20
20
|
return Buffer.from(
|
package/src/types.ts
CHANGED
|
@@ -5,18 +5,19 @@ import type {
|
|
|
5
5
|
SendToken,
|
|
6
6
|
SignIn,
|
|
7
7
|
SwapToken,
|
|
8
|
+
ViewCast,
|
|
8
9
|
ViewProfile,
|
|
9
10
|
ViewToken,
|
|
10
|
-
} from './actions'
|
|
11
|
-
import type { FrameContext } from './context'
|
|
11
|
+
} from './actions/index.ts'
|
|
12
|
+
import type { FrameContext } from './context.ts'
|
|
12
13
|
import type {
|
|
13
14
|
EventFrameAdded,
|
|
14
15
|
EventFrameRemoved,
|
|
15
16
|
EventNotificationsDisabled,
|
|
16
17
|
EventNotificationsEnabled,
|
|
17
|
-
} from './schemas'
|
|
18
|
-
import type { SolanaRequestFn, SolanaWireRequestFn } from './solana'
|
|
19
|
-
import type { Ethereum } from './wallet'
|
|
18
|
+
} from './schemas/index.ts'
|
|
19
|
+
import type { SolanaRequestFn, SolanaWireRequestFn } from './solana.ts'
|
|
20
|
+
import type { Ethereum } from './wallet/index.ts'
|
|
20
21
|
|
|
21
22
|
export type SetPrimaryButtonOptions = {
|
|
22
23
|
text: string
|
|
@@ -26,8 +27,8 @@ export type SetPrimaryButtonOptions = {
|
|
|
26
27
|
}
|
|
27
28
|
|
|
28
29
|
// start backwards compat, remove in 1.0
|
|
29
|
-
export * from './wallet/ethereum'
|
|
30
|
-
export { DEFAULT_READY_OPTIONS, ReadyOptions } from './actions/Ready'
|
|
30
|
+
export * from './wallet/ethereum.ts'
|
|
31
|
+
export { DEFAULT_READY_OPTIONS, ReadyOptions } from './actions/Ready.ts'
|
|
31
32
|
export type SignInOptions = SignIn.SignInOptions
|
|
32
33
|
// end backwards compat
|
|
33
34
|
|
|
@@ -42,6 +43,7 @@ export const miniAppHostCapabilityList: [string, ...string[]] = [
|
|
|
42
43
|
'actions.setPrimaryButton',
|
|
43
44
|
'actions.addMiniApp',
|
|
44
45
|
'actions.signIn',
|
|
46
|
+
'actions.viewCast',
|
|
45
47
|
'actions.viewProfile',
|
|
46
48
|
'actions.composeCast',
|
|
47
49
|
'actions.viewToken',
|
|
@@ -58,6 +60,7 @@ export type MiniAppHostCapability =
|
|
|
58
60
|
| 'actions.setPrimaryButton'
|
|
59
61
|
| 'actions.addMiniApp'
|
|
60
62
|
| 'actions.signIn'
|
|
63
|
+
| 'actions.viewCast'
|
|
61
64
|
| 'actions.viewProfile'
|
|
62
65
|
| 'actions.composeCast'
|
|
63
66
|
| 'actions.viewToken'
|
|
@@ -81,6 +84,7 @@ export type WireFrameHost = {
|
|
|
81
84
|
eip6963RequestProvider: () => void
|
|
82
85
|
solanaProviderRequest?: SolanaWireRequestFn
|
|
83
86
|
addFrame: AddMiniApp.WireAddMiniApp
|
|
87
|
+
viewCast: ViewCast.ViewCast
|
|
84
88
|
viewProfile: ViewProfile.ViewProfile
|
|
85
89
|
viewToken: ViewToken.ViewToken
|
|
86
90
|
sendToken: SendToken.SendToken
|
|
@@ -108,6 +112,7 @@ export type FrameHost = {
|
|
|
108
112
|
eip6963RequestProvider: () => void
|
|
109
113
|
solanaProviderRequest?: SolanaRequestFn
|
|
110
114
|
addFrame: AddMiniApp.AddMiniApp
|
|
115
|
+
viewCast: ViewCast.ViewCast
|
|
111
116
|
viewProfile: ViewProfile.ViewProfile
|
|
112
117
|
viewToken: ViewToken.ViewToken
|
|
113
118
|
sendToken: SendToken.SendToken
|
package/src/wallet/index.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as Ethereum from './ethereum'
|
|
1
|
+
export * as Ethereum from './ethereum.ts'
|