-
-
Notifications
You must be signed in to change notification settings - Fork 126
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test using @metamask/utils 4e5c07f72371967f78ab79e84764882afce36e86
- Loading branch information
Showing
3 changed files
with
70 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
diff --git a/dist/types/json.d.ts b/dist/types/json.d.ts | ||
index cb6272ee23e3a97aeeb52dcbd3ee1e20f3d8005c..1533dcbb925903367f6cf082a4a54d5aa306caf9 100644 | ||
--- a/dist/types/json.d.ts | ||
+++ b/dist/types/json.d.ts | ||
@@ -88,18 +88,18 @@ export declare type OptionalField<Type extends Record<string, unknown>, Key exte | ||
* `OptionalField` helper, to explicitly make it optional. | ||
*/ | ||
export declare type JsonRpcError = OptionalField<Infer<typeof JsonRpcErrorStruct>, 'data'>; | ||
-export declare const JsonRpcParamsStruct: Struct<Json[] | Record<string, Json> | undefined, null>; | ||
-export declare type JsonRpcParams = Infer<typeof JsonRpcParamsStruct>; | ||
+export declare const JsonRpcParamsStruct: Struct<Json[] | Record<string, Json>, null>; | ||
+export declare type JsonRpcParams = Json[] | Record<string, Json>; | ||
export declare const JsonRpcRequestStruct: Struct<{ | ||
id: string | number | null; | ||
method: string; | ||
jsonrpc: "2.0"; | ||
- params?: Json[] | Record<string, Json> | undefined; | ||
+ params: Json[] | Record<string, Json>; | ||
}, { | ||
id: Struct<string | number | null, null>; | ||
jsonrpc: Struct<"2.0", "2.0">; | ||
method: Struct<string, null>; | ||
- params: Struct<Json[] | Record<string, Json> | undefined, null>; | ||
+ params: Struct<Json[] | Record<string, Json>, null>; | ||
}>; | ||
export declare type InferWithParams<Type extends Struct<any>, Params extends JsonRpcParams> = Omit<Infer<Type>, 'params'> & (keyof Params extends undefined ? { | ||
params?: Params; | ||
@@ -113,12 +113,12 @@ export declare type JsonRpcRequest<Params extends JsonRpcParams = JsonRpcParams> | ||
export declare const JsonRpcNotificationStruct: Struct<{ | ||
method: string; | ||
jsonrpc: "2.0"; | ||
- params?: Json[] | Record<string, Json> | undefined; | ||
+ params: Json[] | Record<string, Json>; | ||
}, Omit<{ | ||
id: Struct<string | number | null, null>; | ||
jsonrpc: Struct<"2.0", "2.0">; | ||
method: Struct<string, null>; | ||
- params: Struct<Json[] | Record<string, Json> | undefined, null>; | ||
+ params: Struct<Json[] | Record<string, Json>, null>; | ||
}, "id">>; | ||
/** | ||
* A JSON-RPC notification object. | ||
diff --git a/dist/types/json.d.ts.map b/dist/types/json.d.ts.map | ||
index e4b182c6d30a4cecf94bdc97d2402d7395f21d24..b8af457fd46d71f4687d6164df970f05e392966e 100644 | ||
--- a/dist/types/json.d.ts.map | ||
+++ b/dist/types/json.d.ts.map | ||
@@ -1 +1 @@ | ||
-{"version":3,"file":"json.d.ts","sourceRoot":"","sources":["../../src/json.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAuBjD,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,UAAU,CAAC;AAG1D;;GAEG;AACH,oBAAY,IAAI,GACZ,IAAI,GACJ,OAAO,GACP,MAAM,GACN,MAAM,GACN,IAAI,EAAE,GACN;IAAE,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC;AAa7B;;;;GAIG;AAEH,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,IAAI,CAUxC,CAAC;AAEH;;;;;GAKG;AACH,eAAO,MAAM,UAAU,uBAWrB,CAAC;AAEH;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,IAAI,CAOzD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,WAAW,CAAC,IAAI,SAAS,IAAI,GAAG,IAAI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vC;AAED;;;;;GAKG;AACH,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,cAAc,CAExE;AAED;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,KAAK,EAAE,OAAO,EAEd,YAAY,CAAC,EAAE,yBAAyB,GACvC,OAAO,CAAC,KAAK,IAAI,cAAc,CAOjC;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,YAAY,CAEpE;AAED;;;;;;;GAOG;AACH,wBAAgB,oBAAoB,CAClC,KAAK,EAAE,OAAO,EAEd,YAAY,CAAC,EAAE,yBAAyB,GACvC,OAAO,CAAC,KAAK,IAAI,YAAY,CAO/B;AAED,aAAK,uBAAuB,GAAG;IAC7B,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,eAAe,CAAC,EAAE,OAAO,CAAC;IAC1B,UAAU,CAAC,EAAE,OAAO,CAAC;CACtB,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,CAAC,EAAE,uBAAuB,QAevC,OAAO,kCAStC"} | ||
\ No newline at end of file |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters