@farcaster/frame-core 0.0.29 → 0.0.32

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 (74) hide show
  1. package/README.md +13 -0
  2. package/dist/actions/ComposeCast.d.ts +32 -0
  3. package/dist/actions/ComposeCast.js +2 -0
  4. package/dist/actions/index.d.ts +1 -0
  5. package/dist/actions/index.js +2 -1
  6. package/dist/errors.d.ts +3 -0
  7. package/dist/index.d.ts +2 -0
  8. package/dist/index.js +3 -1
  9. package/dist/manifest.d.ts +101 -0
  10. package/dist/manifest.js +2 -0
  11. package/dist/schemas/embeds.d.ts +20 -20
  12. package/dist/schemas/embeds.js +1 -1
  13. package/dist/schemas/manifest.d.ts +92 -6
  14. package/dist/schemas/manifest.js +31 -0
  15. package/dist/schemas/shared.d.ts +4 -0
  16. package/dist/schemas/shared.js +29 -2
  17. package/dist/types.d.ts +3 -1
  18. package/dist/wallet/ethereum.d.ts +5 -1
  19. package/esm/actions/AddFrame.d.ts +23 -27
  20. package/esm/actions/AddFrame.js +9 -9
  21. package/esm/actions/ComposeCast.d.ts +32 -0
  22. package/esm/actions/ComposeCast.js +1 -0
  23. package/esm/actions/Ready.d.ts +11 -11
  24. package/esm/actions/Ready.js +2 -2
  25. package/esm/actions/SignIn.d.ts +33 -35
  26. package/esm/actions/SignIn.js +5 -5
  27. package/esm/actions/Swap.d.ts +43 -44
  28. package/esm/actions/Swap.js +1 -1
  29. package/esm/actions/ViewProfile.d.ts +3 -3
  30. package/esm/actions/ViewProfile.js +1 -1
  31. package/esm/actions/ViewToken.d.ts +3 -3
  32. package/esm/actions/ViewToken.js +1 -1
  33. package/esm/actions/index.d.ts +7 -6
  34. package/esm/actions/index.js +7 -6
  35. package/esm/context.d.ts +61 -65
  36. package/esm/context.js +1 -1
  37. package/esm/errors.d.ts +10 -9
  38. package/esm/errors.js +6 -6
  39. package/esm/index.d.ts +7 -5
  40. package/esm/index.js +7 -5
  41. package/esm/internal/types.d.ts +7 -18
  42. package/esm/internal/types.js +1 -1
  43. package/esm/manifest.d.ts +101 -0
  44. package/esm/manifest.js +1 -0
  45. package/esm/schemas/embeds.d.ts +239 -346
  46. package/esm/schemas/embeds.js +23 -31
  47. package/esm/schemas/events.d.ts +129 -225
  48. package/esm/schemas/events.js +17 -17
  49. package/esm/schemas/index.d.ts +5 -5
  50. package/esm/schemas/index.js +5 -5
  51. package/esm/schemas/manifest.d.ts +196 -154
  52. package/esm/schemas/manifest.js +54 -29
  53. package/esm/schemas/notifications.d.ts +58 -86
  54. package/esm/schemas/notifications.js +17 -17
  55. package/esm/schemas/shared.d.ts +39 -53
  56. package/esm/schemas/shared.js +49 -25
  57. package/esm/tsconfig.tsbuildinfo +1 -1
  58. package/esm/types.d.ts +53 -70
  59. package/esm/types.js +2 -2
  60. package/esm/wallet/ethereum.d.ts +39 -50
  61. package/esm/wallet/ethereum.js +1 -1
  62. package/esm/wallet/index.d.ts +1 -1
  63. package/esm/wallet/index.js +1 -1
  64. package/package.json +1 -1
  65. package/src/actions/ComposeCast.ts +36 -0
  66. package/src/actions/index.ts +1 -0
  67. package/src/errors.ts +4 -0
  68. package/src/index.ts +2 -0
  69. package/src/manifest.ts +113 -0
  70. package/src/schemas/embeds.ts +1 -1
  71. package/src/schemas/manifest.ts +33 -0
  72. package/src/schemas/shared.ts +36 -1
  73. package/src/types.ts +7 -0
  74. package/src/wallet/ethereum.ts +5 -1
@@ -1,19 +1,8 @@
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<
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
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 {};
@@ -1 +1 @@
1
- export {}
1
+ export {};
@@ -0,0 +1,101 @@
1
+ /**
2
+ * Farcaster manifest for a domain hosted at `/.well-known/farcaster.json`
3
+ */
4
+ export type Manifest = {
5
+ accountAssociation: AccountAssociation;
6
+ frame: FrameConfig;
7
+ };
8
+ /**
9
+ * Signed domain association linking this frame to a Farcaster account
10
+ *
11
+ * A DomainAssociation can be generated using the {@link https://warpcast.com/~/developers/domains | Warpcast
12
+ * Domains Developer} tool.
13
+ */
14
+ export type AccountAssociation = {
15
+ /**
16
+ * Base64URL encoded JFS signature
17
+ */
18
+ header: string;
19
+ /**
20
+ * Base64URL encoded payload signature
21
+ */
22
+ payload: string;
23
+ /**
24
+ * Base64URL encoded signature
25
+ */
26
+ signature: string;
27
+ };
28
+ /**
29
+ * Frame configuration
30
+ *
31
+ * @example
32
+ * ``ts
33
+ * const frame: FrameConfig = {
34
+ * version: '1',
35
+ * name: 'Yoink!',
36
+ * homeUrl: 'https://yoink.party',
37
+ * iconUrl: 'https://yoink.party/img/icon.png',
38
+ * imageUrl: 'https://yoink.party/framesV2/opengraph-image',
39
+ * buttonTitle: '🚩 Start',
40
+ * splashImageUrl: 'https://yoink.party/img/splash.png',
41
+ * splashImageBackgroundColor: '#eeeee4',
42
+ * webhookUrl: 'https://yoink.party/webhook'
43
+ * };
44
+ * ``
45
+ */
46
+ export type FrameConfig = {
47
+ /**
48
+ * Manifest version
49
+ *
50
+ * Must be the literal '1'.
51
+ */
52
+ version: '1';
53
+ /**
54
+ * App name that will be displayed to users
55
+ *
56
+ * Max length of 32 characters.
57
+ */
58
+ name: string;
59
+ /**
60
+ * Default launch URL
61
+ *
62
+ * Max length of 1024 characters.
63
+ */
64
+ homeUrl: string;
65
+ /**
66
+ * Icon URL
67
+ *
68
+ * Max length of 1024 characters. Image must be 200x200px and less than 1MB.
69
+ */
70
+ iconUrl: string;
71
+ /**
72
+ * Image URL
73
+ *
74
+ * Max length of 1024 characters. Image must have a 3:2 ratio.
75
+ */
76
+ imageUrl: string;
77
+ /**
78
+ * Default button title to use when frame is rendered.
79
+ *
80
+ * Max length of 32 characters.
81
+ */
82
+ buttonTitle: string;
83
+ /**
84
+ * Splash image URL
85
+ *
86
+ * Max length of 1024 characters. Image must be 200x200px and less than 1MB.
87
+ */
88
+ splashImageUrl?: string;
89
+ /**
90
+ * Splash background color
91
+ *
92
+ * Must be a hex color code.
93
+ */
94
+ splashBackgroundColor?: string;
95
+ /**
96
+ * URL to which clients will POST server events.
97
+ * Max length of 1024 characters.
98
+ * Required if the frame application uses notifications.
99
+ */
100
+ webhookUrl?: string;
101
+ };
@@ -0,0 +1 @@
1
+ export {};