@metamask-previews/keyring-utils 0.0.1-1c468fa → 0.0.1-388ed88

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.
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.JsonRpcRequestStruct = void 0;
4
+ const superstruct_1 = require("@metamask/superstruct");
5
+ const utils_1 = require("@metamask/utils");
6
+ const _1 = require("./index.cjs");
7
+ exports.JsonRpcRequestStruct = (0, _1.object)({
8
+ jsonrpc: (0, superstruct_1.literal)('2.0'),
9
+ id: (0, superstruct_1.union)([(0, superstruct_1.string)(), (0, superstruct_1.number)(), (0, superstruct_1.literal)(null)]),
10
+ method: (0, superstruct_1.string)(),
11
+ params: (0, _1.exactOptional)((0, superstruct_1.union)([(0, superstruct_1.array)(utils_1.JsonStruct), (0, superstruct_1.record)((0, superstruct_1.string)(), utils_1.JsonStruct)])),
12
+ });
13
+ //# sourceMappingURL=JsonRpcRequest.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonRpcRequest.cjs","sourceRoot":"","sources":["../src/JsonRpcRequest.ts"],"names":[],"mappings":";;;AAAA,uDAO+B;AAE/B,2CAA6C;AAE7C,kCAA0C;AAE7B,QAAA,oBAAoB,GAAG,IAAA,SAAM,EAAC;IACzC,OAAO,EAAE,IAAA,qBAAO,EAAC,KAAK,CAAC;IACvB,EAAE,EAAE,IAAA,mBAAK,EAAC,CAAC,IAAA,oBAAM,GAAE,EAAE,IAAA,oBAAM,GAAE,EAAE,IAAA,qBAAO,EAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,MAAM,EAAE,IAAA,oBAAM,GAAE;IAChB,MAAM,EAAE,IAAA,gBAAa,EACnB,IAAA,mBAAK,EAAC,CAAC,IAAA,mBAAK,EAAC,kBAAU,CAAC,EAAE,IAAA,oBAAM,EAAC,IAAA,oBAAM,GAAE,EAAE,kBAAU,CAAC,CAAC,CAAC,CACzD;CACF,CAAC,CAAC","sourcesContent":["import {\n array,\n literal,\n number,\n record,\n string,\n union,\n} from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { exactOptional, object } from '.';\n\nexport const JsonRpcRequestStruct = object({\n jsonrpc: literal('2.0'),\n id: union([string(), number(), literal(null)]),\n method: string(),\n params: exactOptional(\n union([array(JsonStruct), record(string(), JsonStruct)]),\n ),\n});\n\n/**\n * JSON-RPC request type.\n */\nexport type JsonRpcRequest = Infer<typeof JsonRpcRequestStruct>;\n"]}
@@ -0,0 +1,17 @@
1
+ import type { Infer } from "@metamask/superstruct";
2
+ export declare const JsonRpcRequestStruct: import("@metamask/superstruct").Struct<{
3
+ method: string;
4
+ id: string | number | null;
5
+ jsonrpc: "2.0";
6
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
7
+ }, {
8
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
9
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
10
+ method: import("@metamask/superstruct").Struct<string, null>;
11
+ params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[] | import("./superstruct.cjs").ExactOptionalTag, null>;
12
+ }>;
13
+ /**
14
+ * JSON-RPC request type.
15
+ */
16
+ export type JsonRpcRequest = Infer<typeof JsonRpcRequestStruct>;
17
+ //# sourceMappingURL=JsonRpcRequest.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonRpcRequest.d.cts","sourceRoot":"","sources":["../src/JsonRpcRequest.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD,eAAO,MAAM,oBAAoB;;;;;;;;;;EAO/B,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { Infer } from "@metamask/superstruct";
2
+ export declare const JsonRpcRequestStruct: import("@metamask/superstruct").Struct<{
3
+ method: string;
4
+ id: string | number | null;
5
+ jsonrpc: "2.0";
6
+ params?: Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[];
7
+ }, {
8
+ jsonrpc: import("@metamask/superstruct").Struct<"2.0", "2.0">;
9
+ id: import("@metamask/superstruct").Struct<string | number | null, null>;
10
+ method: import("@metamask/superstruct").Struct<string, null>;
11
+ params: import("@metamask/superstruct").Struct<Record<string, import("@metamask/utils").Json> | import("@metamask/utils").Json[] | import("./superstruct.mjs").ExactOptionalTag, null>;
12
+ }>;
13
+ /**
14
+ * JSON-RPC request type.
15
+ */
16
+ export type JsonRpcRequest = Infer<typeof JsonRpcRequestStruct>;
17
+ //# sourceMappingURL=JsonRpcRequest.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonRpcRequest.d.mts","sourceRoot":"","sources":["../src/JsonRpcRequest.ts"],"names":[],"mappings":"AAQA,OAAO,KAAK,EAAE,KAAK,EAAE,8BAA8B;AAKnD,eAAO,MAAM,oBAAoB;;;;;;;;;;EAO/B,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC"}
@@ -0,0 +1,10 @@
1
+ import { array, literal, number, record, string, union } from "@metamask/superstruct";
2
+ import { JsonStruct } from "@metamask/utils";
3
+ import { exactOptional, object } from "./index.mjs";
4
+ export const JsonRpcRequestStruct = object({
5
+ jsonrpc: literal('2.0'),
6
+ id: union([string(), number(), literal(null)]),
7
+ method: string(),
8
+ params: exactOptional(union([array(JsonStruct), record(string(), JsonStruct)])),
9
+ });
10
+ //# sourceMappingURL=JsonRpcRequest.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"JsonRpcRequest.mjs","sourceRoot":"","sources":["../src/JsonRpcRequest.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,EACL,OAAO,EACP,MAAM,EACN,MAAM,EACN,MAAM,EACN,KAAK,EACN,8BAA8B;AAE/B,OAAO,EAAE,UAAU,EAAE,wBAAwB;AAE7C,OAAO,EAAE,aAAa,EAAE,MAAM,EAAE,oBAAU;AAE1C,MAAM,CAAC,MAAM,oBAAoB,GAAG,MAAM,CAAC;IACzC,OAAO,EAAE,OAAO,CAAC,KAAK,CAAC;IACvB,EAAE,EAAE,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IAC9C,MAAM,EAAE,MAAM,EAAE;IAChB,MAAM,EAAE,aAAa,CACnB,KAAK,CAAC,CAAC,KAAK,CAAC,UAAU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,EAAE,UAAU,CAAC,CAAC,CAAC,CACzD;CACF,CAAC,CAAC","sourcesContent":["import {\n array,\n literal,\n number,\n record,\n string,\n union,\n} from '@metamask/superstruct';\nimport type { Infer } from '@metamask/superstruct';\nimport { JsonStruct } from '@metamask/utils';\n\nimport { exactOptional, object } from '.';\n\nexport const JsonRpcRequestStruct = object({\n jsonrpc: literal('2.0'),\n id: union([string(), number(), literal(null)]),\n method: string(),\n params: exactOptional(\n union([array(JsonStruct), record(string(), JsonStruct)]),\n ),\n});\n\n/**\n * JSON-RPC request type.\n */\nexport type JsonRpcRequest = Infer<typeof JsonRpcRequestStruct>;\n"]}
package/dist/index.cjs CHANGED
@@ -17,4 +17,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./types.cjs"), exports);
18
18
  __exportStar(require("./typing.cjs"), exports);
19
19
  __exportStar(require("./superstruct.cjs"), exports);
20
+ __exportStar(require("./JsonRpcRequest.cjs"), exports);
20
21
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAAwB;AACxB,+CAAyB;AACzB,oDAA8B","sourcesContent":["export * from './types';\nexport * from './typing';\nexport * from './superstruct';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,8CAAwB;AACxB,+CAAyB;AACzB,oDAA8B;AAC9B,uDAAiC","sourcesContent":["export * from './types';\nexport * from './typing';\nexport * from './superstruct';\nexport * from './JsonRpcRequest';\n"]}
package/dist/index.d.cts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./types.cjs";
2
2
  export * from "./typing.cjs";
3
3
  export * from "./superstruct.cjs";
4
+ export * from "./JsonRpcRequest.cjs";
4
5
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4BAAwB;AACxB,6BAAyB;AACzB,kCAA8B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4BAAwB;AACxB,6BAAyB;AACzB,kCAA8B;AAC9B,qCAAiC"}
package/dist/index.d.mts CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./types.mjs";
2
2
  export * from "./typing.mjs";
3
3
  export * from "./superstruct.mjs";
4
+ export * from "./JsonRpcRequest.mjs";
4
5
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4BAAwB;AACxB,6BAAyB;AACzB,kCAA8B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4BAAwB;AACxB,6BAAyB;AACzB,kCAA8B;AAC9B,qCAAiC"}
package/dist/index.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  export * from "./types.mjs";
2
2
  export * from "./typing.mjs";
3
3
  export * from "./superstruct.mjs";
4
+ export * from "./JsonRpcRequest.mjs";
4
5
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4BAAwB;AACxB,6BAAyB;AACzB,kCAA8B","sourcesContent":["export * from './types';\nexport * from './typing';\nexport * from './superstruct';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4BAAwB;AACxB,6BAAyB;AACzB,kCAA8B;AAC9B,qCAAiC","sourcesContent":["export * from './types';\nexport * from './typing';\nexport * from './superstruct';\nexport * from './JsonRpcRequest';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/keyring-utils",
3
- "version": "0.0.1-1c468fa",
3
+ "version": "0.0.1-388ed88",
4
4
  "description": "MetaMask Keyring utils",
5
5
  "keywords": [
6
6
  "metamask",