@metamask-previews/keyring-snap-sdk 3.0.1-528bbfb → 3.1.0-0faa33d

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.
package/CHANGELOG.md CHANGED
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
7
7
 
8
8
  ## [Unreleased]
9
9
 
10
+ ## [3.1.0]
11
+
12
+ ### Added
13
+
14
+ - Add UNIX timestamp helpers `getCurrentUnixTimestamp` and `toUnixTimestamp` ([#236](https://github.com/MetaMask/accounts/pull/236))
15
+
10
16
  ## [3.0.1]
11
17
 
12
18
  ### Changed
@@ -64,7 +70,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
64
70
  - This new version fixes a bug with CJS re-exports.
65
71
  - Initial release ([#24](https://github.com/MetaMask/accounts/pull/24))
66
72
 
67
- [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-snap-sdk@3.0.1...HEAD
73
+ [Unreleased]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-snap-sdk@3.1.0...HEAD
74
+ [3.1.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-snap-sdk@3.0.1...@metamask/keyring-snap-sdk@3.1.0
68
75
  [3.0.1]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-snap-sdk@3.0.0...@metamask/keyring-snap-sdk@3.0.1
69
76
  [3.0.0]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-snap-sdk@2.1.2...@metamask/keyring-snap-sdk@3.0.0
70
77
  [2.1.2]: https://github.com/MetaMask/accounts/compare/@metamask/keyring-snap-sdk@2.1.1...@metamask/keyring-snap-sdk@2.1.2
package/dist/index.cjs CHANGED
@@ -16,4 +16,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./rpc-handler.cjs"), exports);
18
18
  __exportStar(require("./snap-utils.cjs"), exports);
19
+ __exportStar(require("./time.cjs"), exports);
19
20
  //# sourceMappingURL=index.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAA8B;AAC9B,mDAA6B","sourcesContent":["export * from './rpc-handler';\nexport * from './snap-utils';\n"]}
1
+ {"version":3,"file":"index.cjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAA8B;AAC9B,mDAA6B;AAC7B,6CAAuB","sourcesContent":["export * from './rpc-handler';\nexport * from './snap-utils';\nexport * from './time';\n"]}
package/dist/index.d.cts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./rpc-handler.cjs";
2
2
  export * from "./snap-utils.cjs";
3
+ export * from "./time.cjs";
3
4
  //# sourceMappingURL=index.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kCAA8B;AAC9B,iCAA6B"}
1
+ {"version":3,"file":"index.d.cts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kCAA8B;AAC9B,iCAA6B;AAC7B,2BAAuB"}
package/dist/index.d.mts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./rpc-handler.mjs";
2
2
  export * from "./snap-utils.mjs";
3
+ export * from "./time.mjs";
3
4
  //# sourceMappingURL=index.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kCAA8B;AAC9B,iCAA6B"}
1
+ {"version":3,"file":"index.d.mts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kCAA8B;AAC9B,iCAA6B;AAC7B,2BAAuB"}
package/dist/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./rpc-handler.mjs";
2
2
  export * from "./snap-utils.mjs";
3
+ export * from "./time.mjs";
3
4
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kCAA8B;AAC9B,iCAA6B","sourcesContent":["export * from './rpc-handler';\nexport * from './snap-utils';\n"]}
1
+ {"version":3,"file":"index.mjs","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,kCAA8B;AAC9B,iCAA6B;AAC7B,2BAAuB","sourcesContent":["export * from './rpc-handler';\nexport * from './snap-utils';\nexport * from './time';\n"]}
package/dist/time.cjs ADDED
@@ -0,0 +1,22 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toUnixTimestamp = toUnixTimestamp;
4
+ exports.getCurrentUnixTimestamp = getCurrentUnixTimestamp;
5
+ /**
6
+ * Convert a date to its UNIX timestamp equivalent.
7
+ *
8
+ * @param date - The date object to convert.
9
+ * @returns A UNIX timestamp.
10
+ */
11
+ function toUnixTimestamp(date) {
12
+ return Math.floor(date.getTime() / 1000);
13
+ }
14
+ /**
15
+ * Get the current UNIX timestamp.
16
+ *
17
+ * @returns The current UNIX timestamp.
18
+ */
19
+ function getCurrentUnixTimestamp() {
20
+ return toUnixTimestamp(new Date());
21
+ }
22
+ //# sourceMappingURL=time.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time.cjs","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":";;AAMA,0CAEC;AAOD,0DAEC;AAjBD;;;;;GAKG;AACH,SAAgB,eAAe,CAAC,IAAU;IACxC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED;;;;GAIG;AACH,SAAgB,uBAAuB;IACrC,OAAO,eAAe,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;AACrC,CAAC","sourcesContent":["/**\n * Convert a date to its UNIX timestamp equivalent.\n *\n * @param date - The date object to convert.\n * @returns A UNIX timestamp.\n */\nexport function toUnixTimestamp(date: Date): number {\n return Math.floor(date.getTime() / 1000);\n}\n\n/**\n * Get the current UNIX timestamp.\n *\n * @returns The current UNIX timestamp.\n */\nexport function getCurrentUnixTimestamp(): number {\n return toUnixTimestamp(new Date());\n}\n"]}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Convert a date to its UNIX timestamp equivalent.
3
+ *
4
+ * @param date - The date object to convert.
5
+ * @returns A UNIX timestamp.
6
+ */
7
+ export declare function toUnixTimestamp(date: Date): number;
8
+ /**
9
+ * Get the current UNIX timestamp.
10
+ *
11
+ * @returns The current UNIX timestamp.
12
+ */
13
+ export declare function getCurrentUnixTimestamp(): number;
14
+ //# sourceMappingURL=time.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time.d.cts","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAElD;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD"}
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Convert a date to its UNIX timestamp equivalent.
3
+ *
4
+ * @param date - The date object to convert.
5
+ * @returns A UNIX timestamp.
6
+ */
7
+ export declare function toUnixTimestamp(date: Date): number;
8
+ /**
9
+ * Get the current UNIX timestamp.
10
+ *
11
+ * @returns The current UNIX timestamp.
12
+ */
13
+ export declare function getCurrentUnixTimestamp(): number;
14
+ //# sourceMappingURL=time.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time.d.mts","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAElD;AAED;;;;GAIG;AACH,wBAAgB,uBAAuB,IAAI,MAAM,CAEhD"}
package/dist/time.mjs ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Convert a date to its UNIX timestamp equivalent.
3
+ *
4
+ * @param date - The date object to convert.
5
+ * @returns A UNIX timestamp.
6
+ */
7
+ export function toUnixTimestamp(date) {
8
+ return Math.floor(date.getTime() / 1000);
9
+ }
10
+ /**
11
+ * Get the current UNIX timestamp.
12
+ *
13
+ * @returns The current UNIX timestamp.
14
+ */
15
+ export function getCurrentUnixTimestamp() {
16
+ return toUnixTimestamp(new Date());
17
+ }
18
+ //# sourceMappingURL=time.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"time.mjs","sourceRoot":"","sources":["../src/time.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,UAAU,eAAe,CAAC,IAAU;IACxC,OAAO,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AAC3C,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,uBAAuB;IACrC,OAAO,eAAe,CAAC,IAAI,IAAI,EAAE,CAAC,CAAC;AACrC,CAAC","sourcesContent":["/**\n * Convert a date to its UNIX timestamp equivalent.\n *\n * @param date - The date object to convert.\n * @returns A UNIX timestamp.\n */\nexport function toUnixTimestamp(date: Date): number {\n return Math.floor(date.getTime() / 1000);\n}\n\n/**\n * Get the current UNIX timestamp.\n *\n * @returns The current UNIX timestamp.\n */\nexport function getCurrentUnixTimestamp(): number {\n return toUnixTimestamp(new Date());\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask-previews/keyring-snap-sdk",
3
- "version": "3.0.1-528bbfb",
3
+ "version": "3.1.0-0faa33d",
4
4
  "description": "MetaMask Keyring Snap SDK",
5
5
  "keywords": [
6
6
  "metamask",