@farcaster/frame-core 0.0.27 → 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.
Files changed (61) hide show
  1. package/LICENSE +21 -0
  2. package/dist/actions/Ready.d.ts +13 -0
  3. package/dist/actions/Ready.js +6 -0
  4. package/dist/actions/index.d.ts +3 -2
  5. package/dist/actions/index.js +4 -3
  6. package/dist/index.d.ts +1 -0
  7. package/dist/index.js +1 -0
  8. package/dist/types.d.ts +12 -77
  9. package/dist/types.js +18 -3
  10. package/dist/wallet/ethereum.d.ts +43 -0
  11. package/dist/wallet/ethereum.js +2 -0
  12. package/dist/wallet/index.d.ts +1 -0
  13. package/dist/wallet/index.js +37 -0
  14. package/esm/actions/AddFrame.d.ts +27 -23
  15. package/esm/actions/AddFrame.js +9 -9
  16. package/esm/actions/Ready.d.ts +13 -0
  17. package/esm/actions/Ready.js +3 -0
  18. package/esm/actions/SignIn.d.ts +35 -33
  19. package/esm/actions/SignIn.js +5 -5
  20. package/esm/actions/Swap.d.ts +44 -43
  21. package/esm/actions/Swap.js +1 -1
  22. package/esm/actions/ViewProfile.d.ts +3 -3
  23. package/esm/actions/ViewProfile.js +1 -1
  24. package/esm/actions/ViewToken.d.ts +3 -3
  25. package/esm/actions/ViewToken.js +1 -1
  26. package/esm/actions/index.d.ts +6 -5
  27. package/esm/actions/index.js +6 -5
  28. package/esm/context.d.ts +65 -61
  29. package/esm/context.js +1 -1
  30. package/esm/errors.d.ts +9 -7
  31. package/esm/errors.js +6 -6
  32. package/esm/index.d.ts +5 -4
  33. package/esm/index.js +5 -4
  34. package/esm/internal/types.d.ts +18 -7
  35. package/esm/internal/types.js +1 -1
  36. package/esm/schemas/embeds.d.ts +346 -239
  37. package/esm/schemas/embeds.js +31 -23
  38. package/esm/schemas/events.d.ts +225 -129
  39. package/esm/schemas/events.js +17 -17
  40. package/esm/schemas/index.d.ts +5 -5
  41. package/esm/schemas/index.js +5 -5
  42. package/esm/schemas/manifest.d.ts +154 -110
  43. package/esm/schemas/manifest.js +29 -23
  44. package/esm/schemas/notifications.d.ts +86 -58
  45. package/esm/schemas/notifications.js +17 -17
  46. package/esm/schemas/shared.d.ts +53 -35
  47. package/esm/schemas/shared.js +25 -23
  48. package/esm/tsconfig.tsbuildinfo +1 -1
  49. package/esm/types.d.ts +69 -115
  50. package/esm/types.js +3 -3
  51. package/esm/wallet/ethereum.d.ts +58 -0
  52. package/esm/wallet/ethereum.js +1 -0
  53. package/esm/wallet/index.d.ts +1 -0
  54. package/esm/wallet/index.js +1 -0
  55. package/package.json +8 -2
  56. package/src/actions/Ready.ts +15 -0
  57. package/src/actions/index.ts +3 -2
  58. package/src/index.ts +1 -0
  59. package/src/types.ts +22 -100
  60. package/src/wallet/ethereum.ts +61 -0
  61. package/src/wallet/index.ts +1 -0
@@ -1,5 +1,6 @@
1
- export * as AddFrame from './AddFrame';
2
- export * as ViewProfile from './ViewProfile';
3
- export * as ViewToken from './ViewToken';
4
- export * as SignIn from './SignIn';
5
- export * as Swap from './Swap';
1
+ export * as AddFrame from './AddFrame'
2
+ export * as Ready from './Ready'
3
+ export * as SignIn from './SignIn'
4
+ export * as Swap from './Swap'
5
+ export * as ViewProfile from './ViewProfile'
6
+ export * as ViewToken from './ViewToken'
@@ -1,5 +1,6 @@
1
- export * as AddFrame from './AddFrame';
2
- export * as ViewProfile from './ViewProfile';
3
- export * as ViewToken from './ViewToken';
4
- export * as SignIn from './SignIn';
5
- export * as Swap from './Swap';
1
+ export * as AddFrame from './AddFrame'
2
+ export * as Ready from './Ready'
3
+ export * as SignIn from './SignIn'
4
+ export * as Swap from './Swap'
5
+ export * as ViewProfile from './ViewProfile'
6
+ export * as ViewToken from './ViewToken'
package/esm/context.d.ts CHANGED
@@ -1,72 +1,76 @@
1
- import type { FrameNotificationDetails } from './schemas';
1
+ import type { FrameNotificationDetails } from './schemas'
2
2
  export type CastEmbedLocationContext = {
3
- type: 'cast_embed';
4
- embed: string;
5
- cast: {
6
- fid: number;
7
- hash: string;
8
- };
9
- };
3
+ type: 'cast_embed'
4
+ embed: string
5
+ cast: {
6
+ fid: number
7
+ hash: string
8
+ }
9
+ }
10
10
  export type NotificationLocationContext = {
11
- type: 'notification';
12
- notification: {
13
- notificationId: string;
14
- title: string;
15
- body: string;
16
- };
17
- };
11
+ type: 'notification'
12
+ notification: {
13
+ notificationId: string
14
+ title: string
15
+ body: string
16
+ }
17
+ }
18
18
  export type LauncherLocationContext = {
19
- type: 'launcher';
20
- };
19
+ type: 'launcher'
20
+ }
21
21
  export type ChannelLocationContext = {
22
- type: 'channel';
23
- channel: {
24
- /**
25
- * Channel key identifier
26
- */
27
- key: string;
28
- /**
29
- * Channel name
30
- */
31
- name: string;
32
- /**
33
- * Channel profile image URL
34
- */
35
- imageUrl?: string;
36
- };
37
- };
38
- export type LocationContext = CastEmbedLocationContext | NotificationLocationContext | LauncherLocationContext | ChannelLocationContext;
39
- export type AccountLocation = {
40
- placeId: string;
22
+ type: 'channel'
23
+ channel: {
41
24
  /**
42
- * Human-readable string describing the location
25
+ * Channel key identifier
43
26
  */
44
- description: string;
45
- };
46
- export type UserContext = {
47
- fid: number;
48
- username?: string;
49
- displayName?: string;
27
+ key: string
28
+ /**
29
+ * Channel name
30
+ */
31
+ name: string
50
32
  /**
51
- * Profile image URL
33
+ * Channel profile image URL
52
34
  */
53
- pfpUrl?: string;
54
- location?: AccountLocation;
55
- };
35
+ imageUrl?: string
36
+ }
37
+ }
38
+ export type LocationContext =
39
+ | CastEmbedLocationContext
40
+ | NotificationLocationContext
41
+ | LauncherLocationContext
42
+ | ChannelLocationContext
43
+ export type AccountLocation = {
44
+ placeId: string
45
+ /**
46
+ * Human-readable string describing the location
47
+ */
48
+ description: string
49
+ }
50
+ export type UserContext = {
51
+ fid: number
52
+ username?: string
53
+ displayName?: string
54
+ /**
55
+ * Profile image URL
56
+ */
57
+ pfpUrl?: string
58
+ location?: AccountLocation
59
+ }
56
60
  export type SafeAreaInsets = {
57
- top: number;
58
- bottom: number;
59
- left: number;
60
- right: number;
61
- };
61
+ top: number
62
+ bottom: number
63
+ left: number
64
+ right: number
65
+ }
62
66
  export type ClientContext = {
63
- clientFid: number;
64
- added: boolean;
65
- notificationDetails?: FrameNotificationDetails;
66
- safeAreaInsets?: SafeAreaInsets;
67
- };
67
+ clientFid: number
68
+ added: boolean
69
+ notificationDetails?: FrameNotificationDetails
70
+ safeAreaInsets?: SafeAreaInsets
71
+ }
68
72
  export type FrameContext = {
69
- client: ClientContext;
70
- user: UserContext;
71
- location?: LocationContext;
72
- };
73
+ client: ClientContext
74
+ user: UserContext
75
+ location?: LocationContext
76
+ }
package/esm/context.js CHANGED
@@ -1 +1 @@
1
- export {};
1
+ export {}
package/esm/errors.d.ts CHANGED
@@ -1,10 +1,12 @@
1
- export declare class BaseError<cause extends Error | undefined = undefined> extends Error {
2
- name: string;
3
- cause: cause;
4
- constructor(message: string, options?: BaseError.Options<cause>);
1
+ export declare class BaseError<
2
+ cause extends Error | undefined = undefined,
3
+ > extends Error {
4
+ name: string
5
+ cause: cause
6
+ constructor(message: string, options?: BaseError.Options<cause>)
5
7
  }
6
8
  export declare namespace BaseError {
7
- type Options<cause extends Error | undefined = Error | undefined> = {
8
- cause?: cause | undefined;
9
- };
9
+ type Options<cause extends Error | undefined = Error | undefined> = {
10
+ cause?: cause | undefined
11
+ }
10
12
  }
package/esm/errors.js CHANGED
@@ -1,8 +1,8 @@
1
1
  export class BaseError extends Error {
2
- name = 'BaseError';
3
- cause;
4
- constructor(message, options = {}) {
5
- super(message, options.cause ? { cause: options.cause } : undefined);
6
- this.cause = options.cause;
7
- }
2
+ name = 'BaseError'
3
+ cause
4
+ constructor(message, options = {}) {
5
+ super(message, options.cause ? { cause: options.cause } : undefined)
6
+ this.cause = options.cause
7
+ }
8
8
  }
package/esm/index.d.ts CHANGED
@@ -1,4 +1,5 @@
1
- export * from './actions';
2
- export * as Context from './context';
3
- export * from './types';
4
- export * from './schemas';
1
+ export * from './actions'
2
+ export * from './wallet'
3
+ export * as Context from './context'
4
+ export * from './types'
5
+ export * from './schemas'
package/esm/index.js CHANGED
@@ -1,4 +1,5 @@
1
- export * from './actions';
2
- export * as Context from './context';
3
- export * from './types';
4
- export * from './schemas';
1
+ export * from './actions'
2
+ export * from './wallet'
3
+ export * as Context from './context'
4
+ export * from './types'
5
+ export * from './schemas'
@@ -1,8 +1,19 @@
1
1
  type Compute<type> = {
2
- [key in keyof type]: type[key];
3
- } & unknown;
4
- type KeyofUnion<type> = type extends type ? keyof type : never;
5
- export type OneOf<union extends object, fallback extends object | undefined = undefined, keys extends KeyofUnion<union> = KeyofUnion<union>> = union extends infer item ? Compute<item & {
6
- [key in Exclude<keys, keyof item>]?: fallback extends object ? key extends keyof fallback ? fallback[key] : undefined : undefined;
7
- }> : never;
8
- export {};
2
+ [key in keyof type]: type[key]
3
+ } & unknown
4
+ type KeyofUnion<type> = type extends type ? keyof type : never
5
+ export type OneOf<
6
+ union extends object,
7
+ fallback extends object | undefined = undefined,
8
+ keys extends KeyofUnion<union> = KeyofUnion<union>,
9
+ > = union extends infer item
10
+ ? Compute<
11
+ item & {
12
+ [key in Exclude<keys, keyof item>]?: fallback extends object
13
+ ? key extends keyof fallback
14
+ ? fallback[key]
15
+ : undefined
16
+ : undefined
17
+ }
18
+ >
19
+ : never
@@ -1 +1 @@
1
- export {};
1
+ export {}