@farcaster/frame-core 0.0.28 → 0.0.29
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/LICENSE +21 -0
- package/esm/actions/AddFrame.d.ts +27 -23
- package/esm/actions/AddFrame.js +9 -9
- package/esm/actions/Ready.d.ts +11 -11
- package/esm/actions/Ready.js +2 -2
- package/esm/actions/SignIn.d.ts +35 -33
- package/esm/actions/SignIn.js +5 -5
- package/esm/actions/Swap.d.ts +44 -43
- package/esm/actions/Swap.js +1 -1
- package/esm/actions/ViewProfile.d.ts +3 -3
- package/esm/actions/ViewProfile.js +1 -1
- package/esm/actions/ViewToken.d.ts +3 -3
- package/esm/actions/ViewToken.js +1 -1
- package/esm/actions/index.d.ts +6 -6
- package/esm/actions/index.js +6 -6
- package/esm/context.d.ts +65 -61
- package/esm/context.js +1 -1
- package/esm/errors.d.ts +9 -7
- package/esm/errors.js +6 -6
- package/esm/index.d.ts +5 -5
- package/esm/index.js +5 -5
- package/esm/internal/types.d.ts +18 -7
- package/esm/internal/types.js +1 -1
- package/esm/schemas/embeds.d.ts +346 -239
- package/esm/schemas/embeds.js +31 -23
- package/esm/schemas/events.d.ts +225 -129
- package/esm/schemas/events.js +17 -17
- package/esm/schemas/index.d.ts +5 -5
- package/esm/schemas/index.js +5 -5
- package/esm/schemas/manifest.d.ts +154 -110
- package/esm/schemas/manifest.js +29 -23
- package/esm/schemas/notifications.d.ts +86 -58
- package/esm/schemas/notifications.js +17 -17
- package/esm/schemas/shared.d.ts +53 -35
- package/esm/schemas/shared.js +25 -23
- package/esm/types.d.ts +70 -51
- package/esm/types.js +2 -2
- package/esm/wallet/ethereum.d.ts +50 -35
- package/esm/wallet/ethereum.js +1 -1
- package/esm/wallet/index.d.ts +1 -1
- package/esm/wallet/index.js +1 -1
- package/package.json +7 -1
package/esm/types.d.ts
CHANGED
|
@@ -1,56 +1,75 @@
|
|
|
1
|
-
import type {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import type {
|
|
2
|
+
AddFrame,
|
|
3
|
+
Ready,
|
|
4
|
+
SignIn,
|
|
5
|
+
Swap,
|
|
6
|
+
ViewProfile,
|
|
7
|
+
ViewToken,
|
|
8
|
+
} from './actions'
|
|
9
|
+
import type { FrameContext } from './context'
|
|
10
|
+
import type {
|
|
11
|
+
EventFrameAdded,
|
|
12
|
+
EventFrameRemoved,
|
|
13
|
+
EventNotificationsDisabled,
|
|
14
|
+
EventNotificationsEnabled,
|
|
15
|
+
} from './schemas'
|
|
16
|
+
import type { Ethereum } from './wallet'
|
|
5
17
|
export type SetPrimaryButtonOptions = {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
export * from './wallet/ethereum'
|
|
12
|
-
export { DEFAULT_READY_OPTIONS, ReadyOptions } from './actions/Ready'
|
|
13
|
-
export type SignInOptions = SignIn.SignInOptions
|
|
14
|
-
export type SetPrimaryButton = (options: SetPrimaryButtonOptions) => void
|
|
18
|
+
text: string
|
|
19
|
+
loading?: boolean
|
|
20
|
+
disabled?: boolean
|
|
21
|
+
hidden?: boolean
|
|
22
|
+
}
|
|
23
|
+
export * from './wallet/ethereum'
|
|
24
|
+
export { DEFAULT_READY_OPTIONS, ReadyOptions } from './actions/Ready'
|
|
25
|
+
export type SignInOptions = SignIn.SignInOptions
|
|
26
|
+
export type SetPrimaryButton = (options: SetPrimaryButtonOptions) => void
|
|
15
27
|
export type WireFrameHost = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
}
|
|
28
|
+
context: FrameContext
|
|
29
|
+
close: () => void
|
|
30
|
+
ready: Ready.Ready
|
|
31
|
+
openUrl: (url: string) => void
|
|
32
|
+
signIn: SignIn.WireSignIn
|
|
33
|
+
setPrimaryButton: SetPrimaryButton
|
|
34
|
+
ethProviderRequest: Ethereum.EthProvideRequest
|
|
35
|
+
ethProviderRequestV2: Ethereum.RpcTransport
|
|
36
|
+
eip6963RequestProvider: () => void
|
|
37
|
+
addFrame: AddFrame.WireAddFrame
|
|
38
|
+
viewProfile: ViewProfile.ViewProfile
|
|
39
|
+
viewToken: ViewToken.ViewToken
|
|
40
|
+
swap: Swap.Swap
|
|
41
|
+
}
|
|
30
42
|
export type FrameHost = {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
}
|
|
43
|
+
context: FrameContext
|
|
44
|
+
close: () => void
|
|
45
|
+
ready: Ready.Ready
|
|
46
|
+
openUrl: (url: string) => void
|
|
47
|
+
signIn: SignIn.SignIn
|
|
48
|
+
setPrimaryButton: SetPrimaryButton
|
|
49
|
+
ethProviderRequest: Ethereum.EthProvideRequest
|
|
50
|
+
ethProviderRequestV2: Ethereum.RpcTransport
|
|
51
|
+
/**
|
|
52
|
+
* Receive forwarded eip6963:requestProvider events from the frame document.
|
|
53
|
+
* Hosts must emit an EventEip6963AnnounceProvider in response.
|
|
54
|
+
*/
|
|
55
|
+
eip6963RequestProvider: () => void
|
|
56
|
+
addFrame: AddFrame.AddFrame
|
|
57
|
+
viewProfile: ViewProfile.ViewProfile
|
|
58
|
+
viewToken: ViewToken.ViewToken
|
|
59
|
+
swap: Swap.Swap
|
|
60
|
+
}
|
|
49
61
|
export type EventFrameAddRejected = {
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
}
|
|
62
|
+
event: 'frame_add_rejected'
|
|
63
|
+
reason: AddFrame.AddFrameRejectedReason
|
|
64
|
+
}
|
|
53
65
|
export type EventPrimaryButtonClicked = {
|
|
54
|
-
|
|
55
|
-
}
|
|
56
|
-
export type FrameClientEvent =
|
|
66
|
+
event: 'primary_button_clicked'
|
|
67
|
+
}
|
|
68
|
+
export type FrameClientEvent =
|
|
69
|
+
| EventFrameAdded
|
|
70
|
+
| EventFrameAddRejected
|
|
71
|
+
| EventFrameRemoved
|
|
72
|
+
| EventNotificationsEnabled
|
|
73
|
+
| EventNotificationsDisabled
|
|
74
|
+
| EventPrimaryButtonClicked
|
|
75
|
+
| Ethereum.EventEip6963AnnounceProvider
|
package/esm/types.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
// start backwards compat, remove in 1.0
|
|
2
|
-
export * from './wallet/ethereum'
|
|
3
|
-
export { DEFAULT_READY_OPTIONS } from './actions/Ready'
|
|
2
|
+
export * from './wallet/ethereum'
|
|
3
|
+
export { DEFAULT_READY_OPTIONS } from './actions/Ready'
|
package/esm/wallet/ethereum.d.ts
CHANGED
|
@@ -1,43 +1,58 @@
|
|
|
1
|
-
import type { Address, Provider, RpcRequest, RpcResponse, RpcSchema } from 'ox'
|
|
2
|
-
export type EthProvideRequest<
|
|
1
|
+
import type { Address, Provider, RpcRequest, RpcResponse, RpcSchema } from 'ox'
|
|
2
|
+
export type EthProvideRequest<
|
|
3
|
+
schema extends RpcSchema.Generic = RpcSchema.Default,
|
|
4
|
+
> = Provider.RequestFn<schema>
|
|
3
5
|
export type FrameEthProviderEventData = {
|
|
4
|
-
|
|
5
|
-
} & EthProviderWireEvent
|
|
6
|
-
export type RpcTransport = (
|
|
6
|
+
type: 'frame_eth_provider_event'
|
|
7
|
+
} & EthProviderWireEvent
|
|
8
|
+
export type RpcTransport = (
|
|
9
|
+
request: RpcRequest.RpcRequest,
|
|
10
|
+
) => Promise<RpcResponse.RpcResponse>
|
|
7
11
|
export type ProviderRpcError = {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
}
|
|
12
|
-
export type EthProviderWireEvent =
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
12
|
+
code: number
|
|
13
|
+
details?: string
|
|
14
|
+
message?: string
|
|
15
|
+
}
|
|
16
|
+
export type EthProviderWireEvent =
|
|
17
|
+
| {
|
|
18
|
+
event: 'accountsChanged'
|
|
19
|
+
params: [readonly Address.Address[]]
|
|
20
|
+
}
|
|
21
|
+
| {
|
|
22
|
+
event: 'chainChanged'
|
|
23
|
+
params: [string]
|
|
24
|
+
}
|
|
25
|
+
| {
|
|
26
|
+
event: 'connect'
|
|
27
|
+
params: [Provider.ConnectInfo]
|
|
28
|
+
}
|
|
29
|
+
| {
|
|
30
|
+
event: 'disconnect'
|
|
31
|
+
params: [ProviderRpcError]
|
|
32
|
+
}
|
|
33
|
+
| {
|
|
34
|
+
event: 'message'
|
|
35
|
+
params: [Provider.Message]
|
|
36
|
+
}
|
|
37
|
+
export type EmitEthProvider = <event extends EthProviderWireEvent['event']>(
|
|
38
|
+
event: event,
|
|
39
|
+
params: Extract<
|
|
40
|
+
EthProviderWireEvent,
|
|
41
|
+
{
|
|
42
|
+
event: event
|
|
43
|
+
}
|
|
44
|
+
>['params'],
|
|
45
|
+
) => void
|
|
31
46
|
/**
|
|
32
47
|
* Metadata of the EIP-1193 Provider.
|
|
33
48
|
*/
|
|
34
49
|
export interface EIP6963ProviderInfo {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
50
|
+
icon: `data:image/${string}`
|
|
51
|
+
name: string
|
|
52
|
+
rdns: string
|
|
53
|
+
uuid: string
|
|
39
54
|
}
|
|
40
55
|
export type EventEip6963AnnounceProvider = {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
}
|
|
56
|
+
event: 'eip6963:announceProvider'
|
|
57
|
+
info: EIP6963ProviderInfo
|
|
58
|
+
}
|
package/esm/wallet/ethereum.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export {}
|
|
1
|
+
export {}
|
package/esm/wallet/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as Ethereum from './ethereum'
|
|
1
|
+
export * as Ethereum from './ethereum'
|
package/esm/wallet/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * as Ethereum from './ethereum'
|
|
1
|
+
export * as Ethereum from './ethereum'
|
package/package.json
CHANGED
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@farcaster/frame-core",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.29",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/farcasterxyz/frames.git",
|
|
8
|
+
"directory": "packages/frame-core"
|
|
9
|
+
},
|
|
4
10
|
"main": "dist/index.js",
|
|
5
11
|
"module": "esm/index.js",
|
|
6
12
|
"files": [
|