@chainflip/utils 0.1.5 → 0.2.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.
package/dist/base58.js CHANGED
@@ -1,8 +1,8 @@
1
1
  import {
2
2
  decode,
3
3
  encode
4
- } from "./chunk-O4WBUIAN.js";
5
- import "./chunk-4RHM5374.js";
4
+ } from "./chunk-F5VHSRYQ.js";
5
+ import "./chunk-34J3OMUQ.js";
6
6
  import "./chunk-MYP3UYWE.js";
7
7
  import "./chunk-CZNX6EUV.js";
8
8
  export {
package/dist/bytes.cjs CHANGED
@@ -23,7 +23,8 @@ __export(bytes_exports, {
23
23
  bytesToHex: () => bytesToHex,
24
24
  decodeBytesWithCharset: () => decodeBytesWithCharset,
25
25
  encodeBytesWithCharset: () => encodeBytesWithCharset,
26
- hexToBytes: () => hexToBytes
26
+ hexToBytes: () => hexToBytes,
27
+ reverseBytes: () => reverseBytes
27
28
  });
28
29
  module.exports = __toCommonJS(bytes_exports);
29
30
 
@@ -86,10 +87,12 @@ var decodeBytesWithCharset = (input, charset) => {
86
87
  const bytes = input.split("").map((char) => charMap[char]);
87
88
  return new Uint8Array(convertBase(bytes, charset.length, 256));
88
89
  };
90
+ var reverseBytes = (input) => bytesToHex(hexToBytes(input).reverse());
89
91
  // Annotate the CommonJS export names for ESM import in node:
90
92
  0 && (module.exports = {
91
93
  bytesToHex,
92
94
  decodeBytesWithCharset,
93
95
  encodeBytesWithCharset,
94
- hexToBytes
96
+ hexToBytes,
97
+ reverseBytes
95
98
  });
package/dist/bytes.d.cts CHANGED
@@ -4,5 +4,6 @@ declare const bytesToHex: (input: Uint8Array | number[]) => `0x${string}`;
4
4
  declare const hexToBytes: (input: HexString) => Uint8Array;
5
5
  declare const encodeBytesWithCharset: (bytes: Uint8Array | number[], charset: string) => string;
6
6
  declare const decodeBytesWithCharset: (input: string, charset: string) => Uint8Array;
7
+ declare const reverseBytes: (input: HexString) => HexString;
7
8
 
8
- export { bytesToHex, decodeBytesWithCharset, encodeBytesWithCharset, hexToBytes };
9
+ export { bytesToHex, decodeBytesWithCharset, encodeBytesWithCharset, hexToBytes, reverseBytes };
package/dist/bytes.d.ts CHANGED
@@ -4,5 +4,6 @@ declare const bytesToHex: (input: Uint8Array | number[]) => `0x${string}`;
4
4
  declare const hexToBytes: (input: HexString) => Uint8Array;
5
5
  declare const encodeBytesWithCharset: (bytes: Uint8Array | number[], charset: string) => string;
6
6
  declare const decodeBytesWithCharset: (input: string, charset: string) => Uint8Array;
7
+ declare const reverseBytes: (input: HexString) => HexString;
7
8
 
8
- export { bytesToHex, decodeBytesWithCharset, encodeBytesWithCharset, hexToBytes };
9
+ export { bytesToHex, decodeBytesWithCharset, encodeBytesWithCharset, hexToBytes, reverseBytes };
package/dist/bytes.js CHANGED
@@ -2,13 +2,15 @@ import {
2
2
  bytesToHex,
3
3
  decodeBytesWithCharset,
4
4
  encodeBytesWithCharset,
5
- hexToBytes
6
- } from "./chunk-4RHM5374.js";
5
+ hexToBytes,
6
+ reverseBytes
7
+ } from "./chunk-34J3OMUQ.js";
7
8
  import "./chunk-MYP3UYWE.js";
8
9
  import "./chunk-CZNX6EUV.js";
9
10
  export {
10
11
  bytesToHex,
11
12
  decodeBytesWithCharset,
12
13
  encodeBytesWithCharset,
13
- hexToBytes
14
+ hexToBytes,
15
+ reverseBytes
14
16
  };
@@ -44,10 +44,12 @@ var decodeBytesWithCharset = (input, charset) => {
44
44
  const bytes = input.split("").map((char) => charMap[char]);
45
45
  return new Uint8Array(convertBase(bytes, charset.length, 256));
46
46
  };
47
+ var reverseBytes = (input) => bytesToHex(hexToBytes(input).reverse());
47
48
 
48
49
  export {
49
50
  bytesToHex,
50
51
  hexToBytes,
51
52
  encodeBytesWithCharset,
52
- decodeBytesWithCharset
53
+ decodeBytesWithCharset,
54
+ reverseBytes
53
55
  };
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  decodeBytesWithCharset,
3
3
  encodeBytesWithCharset
4
- } from "./chunk-4RHM5374.js";
4
+ } from "./chunk-34J3OMUQ.js";
5
5
 
6
6
  // src/base58.ts
7
7
  var charset = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
package/dist/ss58.js CHANGED
@@ -1,10 +1,10 @@
1
1
  import {
2
2
  decode,
3
3
  encode
4
- } from "./chunk-O4WBUIAN.js";
4
+ } from "./chunk-F5VHSRYQ.js";
5
5
  import {
6
6
  hexToBytes
7
- } from "./chunk-4RHM5374.js";
7
+ } from "./chunk-34J3OMUQ.js";
8
8
  import {
9
9
  assert
10
10
  } from "./chunk-MYP3UYWE.js";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@chainflip/utils",
3
- "version": "0.1.5",
3
+ "version": "0.2.0",
4
4
  "type": "module",
5
5
  "files": [
6
6
  "dist",