@farcaster/snap 2.8.0 → 3.0.0

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.
@@ -23,17 +23,6 @@ export type SnapSendTransactionParams = {
23
23
  maxFeePerGas?: string;
24
24
  maxPriorityFeePerGas?: string;
25
25
  };
26
- export type SnapSendCallsParams = {
27
- version?: "1.0";
28
- chainId: string;
29
- atomicRequired?: boolean;
30
- id?: string;
31
- calls: Array<{
32
- to?: string;
33
- data?: string;
34
- value?: string;
35
- }>;
36
- };
37
26
  export type SnapActionHandlers = {
38
27
  submit: (target: string, inputs: Record<string, JsonValue>) => void;
39
28
  open_url: (target: string) => void;
@@ -67,7 +56,6 @@ export type SnapActionHandlers = {
67
56
  buyToken?: string;
68
57
  }) => void;
69
58
  send_transaction?: (params: SnapSendTransactionParams) => void;
70
- send_calls?: (params: SnapSendCallsParams) => void;
71
59
  };
72
60
  export type { SnapRenderState };
73
61
  export declare function SnapCard({ snap, handlers, loading, appearance, maxWidth, showOverflowWarning, onValidationError, validationErrorFallback, actionError, plain, loadingOverlay, initialRenderState, onRenderStateChange, }: {
@@ -353,26 +353,6 @@ export function SnapViewCore({ snap, handlers, loading = false, appearance = "da
353
353
  maxPriorityFeePerGas: optionalString(p.maxPriorityFeePerGas),
354
354
  });
355
355
  break;
356
- case "send_calls":
357
- handlers.send_calls?.({
358
- version: p.version === "1.0" ? "1.0" : undefined,
359
- chainId: String(p.chainId ?? ""),
360
- atomicRequired: typeof p.atomicRequired === "boolean"
361
- ? p.atomicRequired
362
- : undefined,
363
- id: optionalString(p.id),
364
- calls: Array.isArray(p.calls)
365
- ? p.calls.map((call) => {
366
- const c = asRecord(call);
367
- return {
368
- to: optionalString(c.to),
369
- data: optionalString(c.data),
370
- value: optionalString(c.value),
371
- };
372
- })
373
- : [],
374
- });
375
- break;
376
356
  default:
377
357
  break;
378
358
  }
@@ -178,26 +178,6 @@ export function SnapViewCoreInner({ snap, handlers, loading = false, loadingOver
178
178
  maxPriorityFeePerGas: optionalString(p.maxPriorityFeePerGas),
179
179
  });
180
180
  break;
181
- case "send_calls":
182
- h.send_calls?.({
183
- version: p.version === "1.0" ? "1.0" : undefined,
184
- chainId: String(p.chainId ?? ""),
185
- atomicRequired: typeof p.atomicRequired === "boolean"
186
- ? p.atomicRequired
187
- : undefined,
188
- id: optionalString(p.id),
189
- calls: Array.isArray(p.calls)
190
- ? p.calls.map((call) => {
191
- const c = asRecord(call);
192
- return {
193
- to: optionalString(c.to),
194
- data: optionalString(c.data),
195
- value: optionalString(c.value),
196
- };
197
- })
198
- : [],
199
- });
200
- break;
201
181
  default:
202
182
  break;
203
183
  }
@@ -22,17 +22,6 @@ export type SnapSendTransactionParams = {
22
22
  maxFeePerGas?: string;
23
23
  maxPriorityFeePerGas?: string;
24
24
  };
25
- export type SnapSendCallsParams = {
26
- version?: "1.0";
27
- chainId: string;
28
- atomicRequired?: boolean;
29
- id?: string;
30
- calls: Array<{
31
- to?: string;
32
- data?: string;
33
- value?: string;
34
- }>;
35
- };
36
25
  export type SnapActionHandlers = {
37
26
  submit: (target: string, inputs: Record<string, JsonValue>) => void;
38
27
  open_url: (target: string) => void;
@@ -66,5 +55,4 @@ export type SnapActionHandlers = {
66
55
  buyToken?: string;
67
56
  }) => void;
68
57
  send_transaction?: (params: SnapSendTransactionParams) => void;
69
- send_calls?: (params: SnapSendCallsParams) => void;
70
58
  };
@@ -591,20 +591,6 @@ export declare const snapJsonRenderCatalog: import("@json-render/core").Catalog<
591
591
  maxPriorityFeePerGas: z.ZodOptional<z.ZodString>;
592
592
  }, z.core.$strip>;
593
593
  };
594
- send_calls: {
595
- description: string;
596
- params: z.ZodObject<{
597
- version: z.ZodOptional<z.ZodLiteral<"1.0">>;
598
- chainId: z.ZodString;
599
- atomicRequired: z.ZodOptional<z.ZodBoolean>;
600
- id: z.ZodOptional<z.ZodString>;
601
- calls: z.ZodArray<z.ZodObject<{
602
- to: z.ZodOptional<z.ZodString>;
603
- data: z.ZodOptional<z.ZodString>;
604
- value: z.ZodOptional<z.ZodString>;
605
- }, z.core.$strip>>;
606
- }, z.core.$strip>;
607
- };
608
594
  paginator_next: {
609
595
  description: string;
610
596
  params: z.ZodObject<{
@@ -168,20 +168,6 @@ export const snapJsonRenderCatalog = defineCatalog(snapJsonRenderSchema, {
168
168
  maxPriorityFeePerGas: z.string().optional(),
169
169
  }),
170
170
  },
171
- send_calls: {
172
- description: "Request one or more EVM calls through the host wallet using wallet_sendCalls.",
173
- params: z.object({
174
- version: z.literal("1.0").optional(),
175
- chainId: z.string(),
176
- atomicRequired: z.boolean().optional(),
177
- id: z.string().optional(),
178
- calls: z.array(z.object({
179
- to: z.string().optional(),
180
- data: z.string().optional(),
181
- value: z.string().optional(),
182
- })),
183
- }),
184
- },
185
171
  paginator_next: {
186
172
  description: "Move the snap's paginator to the next page locally. Does not POST and is ignored when no paginator is rendered.",
187
173
  params: z.object({ page: z.number().int().min(0).optional() }),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@farcaster/snap",
3
- "version": "2.8.0",
3
+ "version": "3.0.0",
4
4
  "description": "Farcaster Snaps 🫰",
5
5
  "repository": {
6
6
  "type": "git",
@@ -36,18 +36,6 @@ export type SnapSendTransactionParams = {
36
36
  maxPriorityFeePerGas?: string;
37
37
  };
38
38
 
39
- export type SnapSendCallsParams = {
40
- version?: "1.0";
41
- chainId: string;
42
- atomicRequired?: boolean;
43
- id?: string;
44
- calls: Array<{
45
- to?: string;
46
- data?: string;
47
- value?: string;
48
- }>;
49
- };
50
-
51
39
  export type SnapActionHandlers = {
52
40
  submit: (target: string, inputs: Record<string, JsonValue>) => void;
53
41
  open_url: (target: string) => void;
@@ -70,7 +58,6 @@ export type SnapActionHandlers = {
70
58
  }) => void;
71
59
  swap_token: (params: { sellToken?: string; buyToken?: string }) => void;
72
60
  send_transaction?: (params: SnapSendTransactionParams) => void;
73
- send_calls?: (params: SnapSendCallsParams) => void;
74
61
  };
75
62
 
76
63
  export type { SnapRenderState };
@@ -518,27 +518,6 @@ export function SnapViewCore({
518
518
  maxPriorityFeePerGas: optionalString(p.maxPriorityFeePerGas),
519
519
  });
520
520
  break;
521
- case "send_calls":
522
- handlers.send_calls?.({
523
- version: p.version === "1.0" ? "1.0" : undefined,
524
- chainId: String(p.chainId ?? ""),
525
- atomicRequired:
526
- typeof p.atomicRequired === "boolean"
527
- ? p.atomicRequired
528
- : undefined,
529
- id: optionalString(p.id),
530
- calls: Array.isArray(p.calls)
531
- ? p.calls.map((call) => {
532
- const c = asRecord(call);
533
- return {
534
- to: optionalString(c.to),
535
- data: optionalString(c.data),
536
- value: optionalString(c.value),
537
- };
538
- })
539
- : [],
540
- });
541
- break;
542
521
  default:
543
522
  break;
544
523
  }
@@ -253,27 +253,6 @@ export function SnapViewCoreInner({
253
253
  maxPriorityFeePerGas: optionalString(p.maxPriorityFeePerGas),
254
254
  });
255
255
  break;
256
- case "send_calls":
257
- h.send_calls?.({
258
- version: p.version === "1.0" ? "1.0" : undefined,
259
- chainId: String(p.chainId ?? ""),
260
- atomicRequired:
261
- typeof p.atomicRequired === "boolean"
262
- ? p.atomicRequired
263
- : undefined,
264
- id: optionalString(p.id),
265
- calls: Array.isArray(p.calls)
266
- ? p.calls.map((call) => {
267
- const c = asRecord(call);
268
- return {
269
- to: optionalString(c.to),
270
- data: optionalString(c.data),
271
- value: optionalString(c.value),
272
- };
273
- })
274
- : [],
275
- });
276
- break;
277
256
  default:
278
257
  break;
279
258
  }
@@ -29,18 +29,6 @@ export type SnapSendTransactionParams = {
29
29
  maxPriorityFeePerGas?: string;
30
30
  };
31
31
 
32
- export type SnapSendCallsParams = {
33
- version?: "1.0";
34
- chainId: string;
35
- atomicRequired?: boolean;
36
- id?: string;
37
- calls: Array<{
38
- to?: string;
39
- data?: string;
40
- value?: string;
41
- }>;
42
- };
43
-
44
32
  export type SnapActionHandlers = {
45
33
  submit: (target: string, inputs: Record<string, JsonValue>) => void;
46
34
  open_url: (target: string) => void;
@@ -63,5 +51,4 @@ export type SnapActionHandlers = {
63
51
  }) => void;
64
52
  swap_token: (params: { sellToken?: string; buyToken?: string }) => void;
65
53
  send_transaction?: (params: SnapSendTransactionParams) => void;
66
- send_calls?: (params: SnapSendCallsParams) => void;
67
54
  };
package/src/ui/catalog.ts CHANGED
@@ -190,23 +190,6 @@ export const snapJsonRenderCatalog = defineCatalog(snapJsonRenderSchema, {
190
190
  maxPriorityFeePerGas: z.string().optional(),
191
191
  }),
192
192
  },
193
- send_calls: {
194
- description:
195
- "Request one or more EVM calls through the host wallet using wallet_sendCalls.",
196
- params: z.object({
197
- version: z.literal("1.0").optional(),
198
- chainId: z.string(),
199
- atomicRequired: z.boolean().optional(),
200
- id: z.string().optional(),
201
- calls: z.array(
202
- z.object({
203
- to: z.string().optional(),
204
- data: z.string().optional(),
205
- value: z.string().optional(),
206
- }),
207
- ),
208
- }),
209
- },
210
193
  paginator_next: {
211
194
  description:
212
195
  "Move the snap's paginator to the next page locally. Does not POST and is ignored when no paginator is rendered.",