@eternl/tools 0.10.14 → 0.10.17
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/README.md +4 -0
- package/dist/index.cjs +6 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -1
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +2 -1
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -1
- package/dist/index.mjs.map +1 -1
- package/dist/lib/bech32.cjs +46 -0
- package/dist/lib/bech32.cjs.map +1 -0
- package/dist/lib/bech32.d.cts +25 -0
- package/dist/lib/bech32.d.cts.map +1 -0
- package/dist/lib/bech32.d.mts +25 -0
- package/dist/lib/bech32.d.mts.map +1 -0
- package/dist/lib/bech32.mjs +40 -0
- package/dist/lib/bech32.mjs.map +1 -0
- package/dist/lib/hex.cjs +6 -6
- package/dist/lib/hex.cjs.map +1 -1
- package/dist/lib/hex.d.cts +16 -16
- package/dist/lib/hex.d.cts.map +1 -1
- package/dist/lib/hex.d.mts +16 -16
- package/dist/lib/hex.d.mts.map +1 -1
- package/dist/lib/hex.mjs +6 -6
- package/dist/lib/hex.mjs.map +1 -1
- package/llms.txt +1 -1
- package/package.json +3 -2
package/README.md
CHANGED
|
@@ -14,6 +14,8 @@ npm install @eternl/tools
|
|
|
14
14
|
- Structured console helpers: `el`, `sl`, `warn`, `error`, `json`
|
|
15
15
|
- `@eternl/tools/lib/array`
|
|
16
16
|
- Array utilities
|
|
17
|
+
- `@eternl/tools/lib/bech32`
|
|
18
|
+
- Bech32 encode/decode helpers and shared `PREFIX_BECH32` constants
|
|
17
19
|
- `@eternl/tools/lib/crc8`
|
|
18
20
|
- CRC-8 checksum helpers
|
|
19
21
|
- `@eternl/tools/lib/hex`
|
|
@@ -37,10 +39,12 @@ npm install @eternl/tools
|
|
|
37
39
|
|
|
38
40
|
```sh
|
|
39
41
|
import { el, sl, json } from '@eternl/tools/log'
|
|
42
|
+
import { encodeBech32 } from '@eternl/tools/lib/bech32'
|
|
40
43
|
import { sleep } from '@eternl/tools/lib/sleep'
|
|
41
44
|
import { now } from '@eternl/tools/lib/time'
|
|
42
45
|
|
|
43
46
|
console.log(el('addressBookStore'), sl('loadAddressBook'), json({ ok: true }))
|
|
47
|
+
console.log(encodeBech32('pool', Buffer.from('ab'.repeat(28), 'hex')))
|
|
44
48
|
await sleep(50)
|
|
45
49
|
console.log(now())
|
|
46
50
|
```
|
package/dist/index.cjs
CHANGED
|
@@ -4,6 +4,7 @@ const require_lib_hex = require('./lib/hex.cjs');
|
|
|
4
4
|
const require_lib_json = require('./lib/json.cjs');
|
|
5
5
|
const require_log_index = require('./log/index.cjs');
|
|
6
6
|
const require_lib_array = require('./lib/array.cjs');
|
|
7
|
+
const require_lib_bech32 = require('./lib/bech32.cjs');
|
|
7
8
|
const require_lib_blake = require('./lib/blake.cjs');
|
|
8
9
|
const require_lib_crc8 = require('./lib/crc8.cjs');
|
|
9
10
|
const require_lib_id = require('./lib/id.cjs');
|
|
@@ -17,6 +18,7 @@ const fileHashSubstringLength = 8;
|
|
|
17
18
|
|
|
18
19
|
//#endregion
|
|
19
20
|
exports.DEFAULT_SLEEP_MS = require_lib_sleep.DEFAULT_SLEEP_MS;
|
|
21
|
+
exports.PREFIX_BECH32 = require_lib_bech32.PREFIX_BECH32;
|
|
20
22
|
exports.blake2b160 = require_lib_blake.blake2b160;
|
|
21
23
|
exports.blake2b224 = require_lib_blake.blake2b224;
|
|
22
24
|
exports.blake2b224Str = require_lib_blake.blake2b224Str;
|
|
@@ -30,11 +32,15 @@ exports.crc8 = require_lib_crc8.crc8;
|
|
|
30
32
|
exports.createHash = require_lib_string.createHash;
|
|
31
33
|
exports.createJsonFromCborJson = require_lib_json.createJsonFromCborJson;
|
|
32
34
|
exports.dataViewToArray = require_lib_hex.dataViewToArray;
|
|
35
|
+
exports.decodeBech32 = require_lib_bech32.decodeBech32;
|
|
36
|
+
exports.decodeBech32Buffer = require_lib_bech32.decodeBech32Buffer;
|
|
37
|
+
exports.decodeBech32Key = require_lib_bech32.decodeBech32Key;
|
|
33
38
|
exports.decodeHex = require_lib_hex.decodeHex;
|
|
34
39
|
exports.deepMerge = require_lib_json.deepMerge;
|
|
35
40
|
exports.el = require_log_index.el;
|
|
36
41
|
exports.elapsedSeconds = require_lib_sleep.elapsedSeconds;
|
|
37
42
|
exports.elapsedTime = require_lib_sleep.elapsedTime;
|
|
43
|
+
exports.encodeBech32 = require_lib_bech32.encodeBech32;
|
|
38
44
|
exports.encodeHex = require_lib_hex.encodeHex;
|
|
39
45
|
exports.ensureLength = require_lib_string.ensureLength;
|
|
40
46
|
exports.er = require_log_index.er;
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":[],"sources":["../src/lib/guard.ts"],"sourcesContent":["export const fileHashSubstringLength = 8\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.cjs","names":[],"sources":["../src/lib/guard.ts"],"sourcesContent":["export const fileHashSubstringLength = 8\n"],"mappings":";;;;;;;;;;;;;;;;AAAA,MAAa,0BAA0B"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createJsonFromCborJson, deepMerge, getErrorMsg, getKeyValue, json } from "./lib/json.cjs";
|
|
2
2
|
import { el, er, error, sl, warn } from "./log/index.cjs";
|
|
3
3
|
import { copyToNewArray, isSameArray, removeDuplicates, removeMissingNumbersFromArray, removeNumberFromArray, replaceItemsInList } from "./lib/array.cjs";
|
|
4
|
+
import { PREFIX_BECH32, decodeBech32, decodeBech32Buffer, decodeBech32Key, encodeBech32 } from "./lib/bech32.cjs";
|
|
4
5
|
import { blake2b160, blake2b224, blake2b224Str, blake2b256, blake2b256Str } from "./lib/blake.cjs";
|
|
5
6
|
import { crc8 } from "./lib/crc8.cjs";
|
|
6
7
|
import { byteaToHex, dataViewToArray, decodeHex, encodeHex, hasUnicode, hexToBytea, hexToDataView, isASCII, isHexString, isTxHash, prefix0x, toB64Array, toB64Buffer, toB64String, toBuffer, toBufferFromArray, toHexArray, toHexBuffer, toHexString, toHexStringBuffer, toStringArray, uint8ArrayToUtf8String } from "./lib/hex.cjs";
|
|
@@ -14,5 +15,5 @@ import { changeTimezone, now, setOffsetFromServer } from "./lib/time.cjs";
|
|
|
14
15
|
//#region src/lib/guard.d.ts
|
|
15
16
|
declare const fileHashSubstringLength = 8;
|
|
16
17
|
//#endregion
|
|
17
|
-
export { DEFAULT_SLEEP_MS, blake2b160, blake2b224, blake2b224Str, blake2b256, blake2b256Str, byteaToHex, canUpdate, changeTimezone, copyToNewArray, crc8, createHash, createJsonFromCborJson, dataViewToArray, decodeHex, deepMerge, el, elapsedSeconds, elapsedTime, encodeHex, ensureLength, er, error, fileHashSubstringLength, getErrorMsg, getKeyValue, getRandomId, getShortId, hasUnicode, hexToBytea, hexToDataView, isASCII, isHexString, isNumber, isSameArray, isTxHash, json, now, prefix0x, removeDuplicates, removeMissingNumbersFromArray, removeNumberFromArray, replaceItemsInList, reverseString, setOffsetFromServer, sl, sleep, sleepDefault, toB64Array, toB64Buffer, toB64String, toBuffer, toBufferFromArray, toFraction, toHexArray, toHexBuffer, toHexString, toHexStringBuffer, toStringArray, trimAllStrings, trimQuotes, truncateAddress, truncateString, uint8ArrayToUtf8String, warn };
|
|
18
|
+
export { DEFAULT_SLEEP_MS, PREFIX_BECH32, blake2b160, blake2b224, blake2b224Str, blake2b256, blake2b256Str, byteaToHex, canUpdate, changeTimezone, copyToNewArray, crc8, createHash, createJsonFromCborJson, dataViewToArray, decodeBech32, decodeBech32Buffer, decodeBech32Key, decodeHex, deepMerge, el, elapsedSeconds, elapsedTime, encodeBech32, encodeHex, ensureLength, er, error, fileHashSubstringLength, getErrorMsg, getKeyValue, getRandomId, getShortId, hasUnicode, hexToBytea, hexToDataView, isASCII, isHexString, isNumber, isSameArray, isTxHash, json, now, prefix0x, removeDuplicates, removeMissingNumbersFromArray, removeNumberFromArray, replaceItemsInList, reverseString, setOffsetFromServer, sl, sleep, sleepDefault, toB64Array, toB64Buffer, toB64String, toBuffer, toBufferFromArray, toFraction, toHexArray, toHexBuffer, toHexString, toHexStringBuffer, toStringArray, trimAllStrings, trimQuotes, truncateAddress, truncateString, uint8ArrayToUtf8String, warn };
|
|
18
19
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/lib/guard.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/lib/guard.ts"],"mappings":";;;;;;;;;;;;;;;cAAa,uBAAA"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { createJsonFromCborJson, deepMerge, getErrorMsg, getKeyValue, json } from "./lib/json.mjs";
|
|
2
2
|
import { el, er, error, sl, warn } from "./log/index.mjs";
|
|
3
3
|
import { copyToNewArray, isSameArray, removeDuplicates, removeMissingNumbersFromArray, removeNumberFromArray, replaceItemsInList } from "./lib/array.mjs";
|
|
4
|
+
import { PREFIX_BECH32, decodeBech32, decodeBech32Buffer, decodeBech32Key, encodeBech32 } from "./lib/bech32.mjs";
|
|
4
5
|
import { blake2b160, blake2b224, blake2b224Str, blake2b256, blake2b256Str } from "./lib/blake.mjs";
|
|
5
6
|
import { crc8 } from "./lib/crc8.mjs";
|
|
6
7
|
import { byteaToHex, dataViewToArray, decodeHex, encodeHex, hasUnicode, hexToBytea, hexToDataView, isASCII, isHexString, isTxHash, prefix0x, toB64Array, toB64Buffer, toB64String, toBuffer, toBufferFromArray, toHexArray, toHexBuffer, toHexString, toHexStringBuffer, toStringArray, uint8ArrayToUtf8String } from "./lib/hex.mjs";
|
|
@@ -14,5 +15,5 @@ import { changeTimezone, now, setOffsetFromServer } from "./lib/time.mjs";
|
|
|
14
15
|
//#region src/lib/guard.d.ts
|
|
15
16
|
declare const fileHashSubstringLength = 8;
|
|
16
17
|
//#endregion
|
|
17
|
-
export { DEFAULT_SLEEP_MS, blake2b160, blake2b224, blake2b224Str, blake2b256, blake2b256Str, byteaToHex, canUpdate, changeTimezone, copyToNewArray, crc8, createHash, createJsonFromCborJson, dataViewToArray, decodeHex, deepMerge, el, elapsedSeconds, elapsedTime, encodeHex, ensureLength, er, error, fileHashSubstringLength, getErrorMsg, getKeyValue, getRandomId, getShortId, hasUnicode, hexToBytea, hexToDataView, isASCII, isHexString, isNumber, isSameArray, isTxHash, json, now, prefix0x, removeDuplicates, removeMissingNumbersFromArray, removeNumberFromArray, replaceItemsInList, reverseString, setOffsetFromServer, sl, sleep, sleepDefault, toB64Array, toB64Buffer, toB64String, toBuffer, toBufferFromArray, toFraction, toHexArray, toHexBuffer, toHexString, toHexStringBuffer, toStringArray, trimAllStrings, trimQuotes, truncateAddress, truncateString, uint8ArrayToUtf8String, warn };
|
|
18
|
+
export { DEFAULT_SLEEP_MS, PREFIX_BECH32, blake2b160, blake2b224, blake2b224Str, blake2b256, blake2b256Str, byteaToHex, canUpdate, changeTimezone, copyToNewArray, crc8, createHash, createJsonFromCborJson, dataViewToArray, decodeBech32, decodeBech32Buffer, decodeBech32Key, decodeHex, deepMerge, el, elapsedSeconds, elapsedTime, encodeBech32, encodeHex, ensureLength, er, error, fileHashSubstringLength, getErrorMsg, getKeyValue, getRandomId, getShortId, hasUnicode, hexToBytea, hexToDataView, isASCII, isHexString, isNumber, isSameArray, isTxHash, json, now, prefix0x, removeDuplicates, removeMissingNumbersFromArray, removeNumberFromArray, replaceItemsInList, reverseString, setOffsetFromServer, sl, sleep, sleepDefault, toB64Array, toB64Buffer, toB64String, toBuffer, toBufferFromArray, toFraction, toHexArray, toHexBuffer, toHexString, toHexStringBuffer, toStringArray, trimAllStrings, trimQuotes, truncateAddress, truncateString, uint8ArrayToUtf8String, warn };
|
|
18
19
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/lib/guard.ts"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/lib/guard.ts"],"mappings":";;;;;;;;;;;;;;;cAAa,uBAAA"}
|
package/dist/index.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { byteaToHex, dataViewToArray, decodeHex, encodeHex, hasUnicode, hexToByt
|
|
|
3
3
|
import { createJsonFromCborJson, deepMerge, getErrorMsg, getKeyValue, json } from "./lib/json.mjs";
|
|
4
4
|
import { el, er, error, sl, warn } from "./log/index.mjs";
|
|
5
5
|
import { copyToNewArray, isSameArray, removeDuplicates, removeMissingNumbersFromArray, removeNumberFromArray, replaceItemsInList } from "./lib/array.mjs";
|
|
6
|
+
import { PREFIX_BECH32, decodeBech32, decodeBech32Buffer, decodeBech32Key, encodeBech32 } from "./lib/bech32.mjs";
|
|
6
7
|
import { blake2b160, blake2b224, blake2b224Str, blake2b256, blake2b256Str } from "./lib/blake.mjs";
|
|
7
8
|
import { crc8 } from "./lib/crc8.mjs";
|
|
8
9
|
import { getRandomId, getShortId } from "./lib/id.mjs";
|
|
@@ -15,5 +16,5 @@ import { DEFAULT_SLEEP_MS, canUpdate, elapsedSeconds, elapsedTime, sleep, sleepD
|
|
|
15
16
|
const fileHashSubstringLength = 8;
|
|
16
17
|
|
|
17
18
|
//#endregion
|
|
18
|
-
export { DEFAULT_SLEEP_MS, blake2b160, blake2b224, blake2b224Str, blake2b256, blake2b256Str, byteaToHex, canUpdate, changeTimezone, copyToNewArray, crc8, createHash, createJsonFromCborJson, dataViewToArray, decodeHex, deepMerge, el, elapsedSeconds, elapsedTime, encodeHex, ensureLength, er, error, fileHashSubstringLength, getErrorMsg, getKeyValue, getRandomId, getShortId, hasUnicode, hexToBytea, hexToDataView, isASCII, isHexString, isNumber, isSameArray, isTxHash, json, now, prefix0x, removeDuplicates, removeMissingNumbersFromArray, removeNumberFromArray, replaceItemsInList, reverseString, setOffsetFromServer, sl, sleep, sleepDefault, toB64Array, toB64Buffer, toB64String, toBuffer, toBufferFromArray, toFraction, toHexArray, toHexBuffer, toHexString, toHexStringBuffer, toStringArray, trimAllStrings, trimQuotes, truncateAddress, truncateString, uint8ArrayToUtf8String, warn };
|
|
19
|
+
export { DEFAULT_SLEEP_MS, PREFIX_BECH32, blake2b160, blake2b224, blake2b224Str, blake2b256, blake2b256Str, byteaToHex, canUpdate, changeTimezone, copyToNewArray, crc8, createHash, createJsonFromCborJson, dataViewToArray, decodeBech32, decodeBech32Buffer, decodeBech32Key, decodeHex, deepMerge, el, elapsedSeconds, elapsedTime, encodeBech32, encodeHex, ensureLength, er, error, fileHashSubstringLength, getErrorMsg, getKeyValue, getRandomId, getShortId, hasUnicode, hexToBytea, hexToDataView, isASCII, isHexString, isNumber, isSameArray, isTxHash, json, now, prefix0x, removeDuplicates, removeMissingNumbersFromArray, removeNumberFromArray, replaceItemsInList, reverseString, setOffsetFromServer, sl, sleep, sleepDefault, toB64Array, toB64Buffer, toB64String, toBuffer, toBufferFromArray, toFraction, toHexArray, toHexBuffer, toHexString, toHexStringBuffer, toStringArray, trimAllStrings, trimQuotes, truncateAddress, truncateString, uint8ArrayToUtf8String, warn };
|
|
19
20
|
//# sourceMappingURL=index.mjs.map
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":[],"sources":["../src/lib/guard.ts"],"sourcesContent":["export const fileHashSubstringLength = 8\n"],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.mjs","names":[],"sources":["../src/lib/guard.ts"],"sourcesContent":["export const fileHashSubstringLength = 8\n"],"mappings":";;;;;;;;;;;;;;;AAAA,MAAa,0BAA0B"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_chunk = require('../chunk-C0xms8kb.cjs');
|
|
3
|
+
let bech32 = require("bech32");
|
|
4
|
+
|
|
5
|
+
//#region src/lib/bech32.ts
|
|
6
|
+
const DEFAULT_BECH32_LIMIT = 1023;
|
|
7
|
+
const DEFAULT_HEX_LIMIT = 128;
|
|
8
|
+
const PREFIX_BECH32 = {
|
|
9
|
+
ASSET: "asset",
|
|
10
|
+
POOL: "pool",
|
|
11
|
+
DREP: "drep",
|
|
12
|
+
DREP_SCRIPT: "drep_script",
|
|
13
|
+
CC_COLD: "cc_cold",
|
|
14
|
+
CC_HOT: "cc_hot",
|
|
15
|
+
CALIDUS: "calidus",
|
|
16
|
+
GOV_ACTION: "gov_action",
|
|
17
|
+
XPUB: "xpub",
|
|
18
|
+
XPRV: "xprv",
|
|
19
|
+
ACCT_XVK: "acct_xvk",
|
|
20
|
+
ACCT_SHARED_XVK: "acct_shared_xvk"
|
|
21
|
+
};
|
|
22
|
+
const decodeBech32Key = (data, limit = DEFAULT_BECH32_LIMIT) => {
|
|
23
|
+
const decoded = bech32.bech32.decode(data.toString(), limit);
|
|
24
|
+
const bytes = Buffer.from(bech32.bech32.fromWords(decoded.words));
|
|
25
|
+
return {
|
|
26
|
+
prefix: decoded.prefix,
|
|
27
|
+
bytes
|
|
28
|
+
};
|
|
29
|
+
};
|
|
30
|
+
const decodeBech32 = (data) => {
|
|
31
|
+
return decodeBech32Key(data, DEFAULT_HEX_LIMIT).bytes.toString("hex");
|
|
32
|
+
};
|
|
33
|
+
const decodeBech32Buffer = (data) => {
|
|
34
|
+
return decodeBech32Key(data, DEFAULT_HEX_LIMIT).bytes;
|
|
35
|
+
};
|
|
36
|
+
const encodeBech32 = (prefix, data, limit = DEFAULT_BECH32_LIMIT) => {
|
|
37
|
+
return bech32.bech32.encode(prefix.toString(), bech32.bech32.toWords(data), limit);
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
//#endregion
|
|
41
|
+
exports.PREFIX_BECH32 = PREFIX_BECH32;
|
|
42
|
+
exports.decodeBech32 = decodeBech32;
|
|
43
|
+
exports.decodeBech32Buffer = decodeBech32Buffer;
|
|
44
|
+
exports.decodeBech32Key = decodeBech32Key;
|
|
45
|
+
exports.encodeBech32 = encodeBech32;
|
|
46
|
+
//# sourceMappingURL=bech32.cjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bech32.cjs","names":[],"sources":["../../src/lib/bech32.ts"],"sourcesContent":["import { bech32 } from 'bech32'\n\nconst DEFAULT_BECH32_LIMIT = 1023\nconst DEFAULT_HEX_LIMIT = 128\n\nexport const PREFIX_BECH32 = {\n ASSET: 'asset',\n POOL: 'pool',\n DREP: 'drep',\n DREP_SCRIPT: 'drep_script',\n CC_COLD: 'cc_cold',\n CC_HOT: 'cc_hot',\n CALIDUS: 'calidus',\n GOV_ACTION: 'gov_action',\n XPUB: 'xpub',\n XPRV: 'xprv',\n ACCT_XVK: 'acct_xvk',\n ACCT_SHARED_XVK: 'acct_shared_xvk'\n} as const\n\nexport const decodeBech32Key = (\n data: String | string,\n limit: number = DEFAULT_BECH32_LIMIT\n): {\n prefix: string\n bytes: Buffer\n} => {\n\n const decoded = bech32.decode(data.toString(), limit)\n const bytes = Buffer.from(bech32.fromWords(decoded.words))\n\n return {\n prefix: decoded.prefix,\n bytes\n }\n}\n\nexport const decodeBech32 = (\n data: String | string\n): string => {\n\n return decodeBech32Key(data, DEFAULT_HEX_LIMIT).bytes.toString('hex')\n}\n\nexport const decodeBech32Buffer = (\n data: String | string\n): Buffer => {\n\n return decodeBech32Key(data, DEFAULT_HEX_LIMIT).bytes\n}\n\nexport const encodeBech32 = (\n prefix: String | string,\n data: Buffer | Uint8Array,\n limit: number = DEFAULT_BECH32_LIMIT\n): string => {\n\n return bech32.encode(prefix.toString(), bech32.toWords(data), limit)\n}\n"],"mappings":";;;;;AAEA,MAAM,uBAA0B;AAChC,MAAM,oBAA0B;AAEhC,MAAa,gBAAmB;CAC9B,OAA4B;CAC5B,MAA4B;CAC5B,MAA4B;CAC5B,aAA4B;CAC5B,SAA4B;CAC5B,QAA4B;CAC5B,SAA4B;CAC5B,YAA4B;CAC5B,MAA4B;CAC5B,MAA4B;CAC5B,UAA4B;CAC5B,iBAA4B;CAC7B;AAED,MAAa,mBACX,MACA,QAAqC,yBAIlC;CAEH,MAAM,UAAwB,cAAO,OAAO,KAAK,UAAU,EAAE,MAAM;CACnE,MAAM,QAAwB,OAAO,KAAK,cAAO,UAAU,QAAQ,MAAM,CAAC;AAE1E,QAAO;EACL,QAA0B,QAAQ;EAClC;EACD;;AAGH,MAAa,gBACX,SACW;AAEX,QAAO,gBAAgB,MAAM,kBAAkB,CAAC,MAAM,SAAS,MAAM;;AAGvE,MAAa,sBACX,SACW;AAEX,QAAO,gBAAgB,MAAM,kBAAkB,CAAC;;AAGlD,MAAa,gBACX,QACA,MACA,QAAqC,yBAC1B;AAEX,QAAO,cAAO,OAAO,OAAO,UAAU,EAAE,cAAO,QAAQ,KAAK,EAAE,MAAM"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/lib/bech32.d.ts
|
|
2
|
+
declare const PREFIX_BECH32: {
|
|
3
|
+
readonly ASSET: "asset";
|
|
4
|
+
readonly POOL: "pool";
|
|
5
|
+
readonly DREP: "drep";
|
|
6
|
+
readonly DREP_SCRIPT: "drep_script";
|
|
7
|
+
readonly CC_COLD: "cc_cold";
|
|
8
|
+
readonly CC_HOT: "cc_hot";
|
|
9
|
+
readonly CALIDUS: "calidus";
|
|
10
|
+
readonly GOV_ACTION: "gov_action";
|
|
11
|
+
readonly XPUB: "xpub";
|
|
12
|
+
readonly XPRV: "xprv";
|
|
13
|
+
readonly ACCT_XVK: "acct_xvk";
|
|
14
|
+
readonly ACCT_SHARED_XVK: "acct_shared_xvk";
|
|
15
|
+
};
|
|
16
|
+
declare const decodeBech32Key: (data: String | string, limit?: number) => {
|
|
17
|
+
prefix: string;
|
|
18
|
+
bytes: Buffer;
|
|
19
|
+
};
|
|
20
|
+
declare const decodeBech32: (data: String | string) => string;
|
|
21
|
+
declare const decodeBech32Buffer: (data: String | string) => Buffer;
|
|
22
|
+
declare const encodeBech32: (prefix: String | string, data: Buffer | Uint8Array, limit?: number) => string;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { PREFIX_BECH32, decodeBech32, decodeBech32Buffer, decodeBech32Key, encodeBech32 };
|
|
25
|
+
//# sourceMappingURL=bech32.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bech32.d.cts","names":[],"sources":["../../src/lib/bech32.ts"],"mappings":";cAKa,aAAA;EAAA;;;;;;;;;;;;;cAeA,eAAA,GACX,IAAA,EAA4B,MAAA,WAC5B,KAAA;EAEA,MAAA;EACA,KAAA,EAA4B,MAAA;AAAA;AAAA,cAYjB,YAAA,GACX,IAAA,EAA4B,MAAA;AAAA,cAMjB,kBAAA,GACX,IAAA,EAA4B,MAAA,cAC3B,MAAA;AAAA,cAKU,YAAA,GACX,MAAA,EAA4B,MAAA,WAC5B,IAAA,EAA4B,MAAA,GAAS,UAAA,EACrC,KAAA"}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/lib/bech32.d.ts
|
|
2
|
+
declare const PREFIX_BECH32: {
|
|
3
|
+
readonly ASSET: "asset";
|
|
4
|
+
readonly POOL: "pool";
|
|
5
|
+
readonly DREP: "drep";
|
|
6
|
+
readonly DREP_SCRIPT: "drep_script";
|
|
7
|
+
readonly CC_COLD: "cc_cold";
|
|
8
|
+
readonly CC_HOT: "cc_hot";
|
|
9
|
+
readonly CALIDUS: "calidus";
|
|
10
|
+
readonly GOV_ACTION: "gov_action";
|
|
11
|
+
readonly XPUB: "xpub";
|
|
12
|
+
readonly XPRV: "xprv";
|
|
13
|
+
readonly ACCT_XVK: "acct_xvk";
|
|
14
|
+
readonly ACCT_SHARED_XVK: "acct_shared_xvk";
|
|
15
|
+
};
|
|
16
|
+
declare const decodeBech32Key: (data: String | string, limit?: number) => {
|
|
17
|
+
prefix: string;
|
|
18
|
+
bytes: Buffer;
|
|
19
|
+
};
|
|
20
|
+
declare const decodeBech32: (data: String | string) => string;
|
|
21
|
+
declare const decodeBech32Buffer: (data: String | string) => Buffer;
|
|
22
|
+
declare const encodeBech32: (prefix: String | string, data: Buffer | Uint8Array, limit?: number) => string;
|
|
23
|
+
//#endregion
|
|
24
|
+
export { PREFIX_BECH32, decodeBech32, decodeBech32Buffer, decodeBech32Key, encodeBech32 };
|
|
25
|
+
//# sourceMappingURL=bech32.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bech32.d.mts","names":[],"sources":["../../src/lib/bech32.ts"],"mappings":";cAKa,aAAA;EAAA;;;;;;;;;;;;;cAeA,eAAA,GACX,IAAA,EAA4B,MAAA,WAC5B,KAAA;EAEA,MAAA;EACA,KAAA,EAA4B,MAAA;AAAA;AAAA,cAYjB,YAAA,GACX,IAAA,EAA4B,MAAA;AAAA,cAMjB,kBAAA,GACX,IAAA,EAA4B,MAAA,cAC3B,MAAA;AAAA,cAKU,YAAA,GACX,MAAA,EAA4B,MAAA,WAC5B,IAAA,EAA4B,MAAA,GAAS,UAAA,EACrC,KAAA"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { bech32 } from "bech32";
|
|
2
|
+
|
|
3
|
+
//#region src/lib/bech32.ts
|
|
4
|
+
const DEFAULT_BECH32_LIMIT = 1023;
|
|
5
|
+
const DEFAULT_HEX_LIMIT = 128;
|
|
6
|
+
const PREFIX_BECH32 = {
|
|
7
|
+
ASSET: "asset",
|
|
8
|
+
POOL: "pool",
|
|
9
|
+
DREP: "drep",
|
|
10
|
+
DREP_SCRIPT: "drep_script",
|
|
11
|
+
CC_COLD: "cc_cold",
|
|
12
|
+
CC_HOT: "cc_hot",
|
|
13
|
+
CALIDUS: "calidus",
|
|
14
|
+
GOV_ACTION: "gov_action",
|
|
15
|
+
XPUB: "xpub",
|
|
16
|
+
XPRV: "xprv",
|
|
17
|
+
ACCT_XVK: "acct_xvk",
|
|
18
|
+
ACCT_SHARED_XVK: "acct_shared_xvk"
|
|
19
|
+
};
|
|
20
|
+
const decodeBech32Key = (data, limit = DEFAULT_BECH32_LIMIT) => {
|
|
21
|
+
const decoded = bech32.decode(data.toString(), limit);
|
|
22
|
+
const bytes = Buffer.from(bech32.fromWords(decoded.words));
|
|
23
|
+
return {
|
|
24
|
+
prefix: decoded.prefix,
|
|
25
|
+
bytes
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
const decodeBech32 = (data) => {
|
|
29
|
+
return decodeBech32Key(data, DEFAULT_HEX_LIMIT).bytes.toString("hex");
|
|
30
|
+
};
|
|
31
|
+
const decodeBech32Buffer = (data) => {
|
|
32
|
+
return decodeBech32Key(data, DEFAULT_HEX_LIMIT).bytes;
|
|
33
|
+
};
|
|
34
|
+
const encodeBech32 = (prefix, data, limit = DEFAULT_BECH32_LIMIT) => {
|
|
35
|
+
return bech32.encode(prefix.toString(), bech32.toWords(data), limit);
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
//#endregion
|
|
39
|
+
export { PREFIX_BECH32, decodeBech32, decodeBech32Buffer, decodeBech32Key, encodeBech32 };
|
|
40
|
+
//# sourceMappingURL=bech32.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bech32.mjs","names":[],"sources":["../../src/lib/bech32.ts"],"sourcesContent":["import { bech32 } from 'bech32'\n\nconst DEFAULT_BECH32_LIMIT = 1023\nconst DEFAULT_HEX_LIMIT = 128\n\nexport const PREFIX_BECH32 = {\n ASSET: 'asset',\n POOL: 'pool',\n DREP: 'drep',\n DREP_SCRIPT: 'drep_script',\n CC_COLD: 'cc_cold',\n CC_HOT: 'cc_hot',\n CALIDUS: 'calidus',\n GOV_ACTION: 'gov_action',\n XPUB: 'xpub',\n XPRV: 'xprv',\n ACCT_XVK: 'acct_xvk',\n ACCT_SHARED_XVK: 'acct_shared_xvk'\n} as const\n\nexport const decodeBech32Key = (\n data: String | string,\n limit: number = DEFAULT_BECH32_LIMIT\n): {\n prefix: string\n bytes: Buffer\n} => {\n\n const decoded = bech32.decode(data.toString(), limit)\n const bytes = Buffer.from(bech32.fromWords(decoded.words))\n\n return {\n prefix: decoded.prefix,\n bytes\n }\n}\n\nexport const decodeBech32 = (\n data: String | string\n): string => {\n\n return decodeBech32Key(data, DEFAULT_HEX_LIMIT).bytes.toString('hex')\n}\n\nexport const decodeBech32Buffer = (\n data: String | string\n): Buffer => {\n\n return decodeBech32Key(data, DEFAULT_HEX_LIMIT).bytes\n}\n\nexport const encodeBech32 = (\n prefix: String | string,\n data: Buffer | Uint8Array,\n limit: number = DEFAULT_BECH32_LIMIT\n): string => {\n\n return bech32.encode(prefix.toString(), bech32.toWords(data), limit)\n}\n"],"mappings":";;;AAEA,MAAM,uBAA0B;AAChC,MAAM,oBAA0B;AAEhC,MAAa,gBAAmB;CAC9B,OAA4B;CAC5B,MAA4B;CAC5B,MAA4B;CAC5B,aAA4B;CAC5B,SAA4B;CAC5B,QAA4B;CAC5B,SAA4B;CAC5B,YAA4B;CAC5B,MAA4B;CAC5B,MAA4B;CAC5B,UAA4B;CAC5B,iBAA4B;CAC7B;AAED,MAAa,mBACX,MACA,QAAqC,yBAIlC;CAEH,MAAM,UAAwB,OAAO,OAAO,KAAK,UAAU,EAAE,MAAM;CACnE,MAAM,QAAwB,OAAO,KAAK,OAAO,UAAU,QAAQ,MAAM,CAAC;AAE1E,QAAO;EACL,QAA0B,QAAQ;EAClC;EACD;;AAGH,MAAa,gBACX,SACW;AAEX,QAAO,gBAAgB,MAAM,kBAAkB,CAAC,MAAM,SAAS,MAAM;;AAGvE,MAAa,sBACX,SACW;AAEX,QAAO,gBAAgB,MAAM,kBAAkB,CAAC;;AAGlD,MAAa,gBACX,QACA,MACA,QAAqC,yBAC1B;AAEX,QAAO,OAAO,OAAO,OAAO,UAAU,EAAE,OAAO,QAAQ,KAAK,EAAE,MAAM"}
|
package/dist/lib/hex.cjs
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
2
|
|
|
3
3
|
//#region src/lib/hex.ts
|
|
4
|
-
const byteaToHex = (bytea) => bytea.startsWith("\\x") ? bytea.substring(2) : bytea;
|
|
5
|
-
const hexToBytea = (hex) => hex.startsWith("\\x") ? hex : "\\x" + hex;
|
|
6
|
-
const prefix0x = (hex) => hex.startsWith("0x") ? hex : "0x" + hex;
|
|
4
|
+
const byteaToHex = (bytea) => bytea.startsWith("\\x") ? bytea.substring(2) : bytea.toString();
|
|
5
|
+
const hexToBytea = (hex) => hex.startsWith("\\x") ? hex.toString() : "\\x" + hex;
|
|
6
|
+
const prefix0x = (hex) => hex.startsWith("0x") ? hex.toString() : "0x" + hex;
|
|
7
7
|
const toBufferView = (arr) => Buffer.isBuffer(arr) ? arr : Buffer.from(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
8
8
|
const encodeHex = (str) => Buffer.from(str).toString("hex");
|
|
9
9
|
const toHexStringBuffer = (arr) => arr ? arr.toString("hex") : "";
|
|
10
10
|
const toHexString = (arr) => arr ? toBufferView(arr).toString("hex") : "";
|
|
11
11
|
const toB64String = (arr) => Buffer.from(arr).toString("base64");
|
|
12
|
-
const toBuffer = (hex) =>
|
|
12
|
+
const toBuffer = (hex) => toHexBuffer(hex);
|
|
13
13
|
const toHexBuffer = (hex) => Buffer.from(byteaToHex(hex), "hex");
|
|
14
14
|
const toB64Buffer = (str) => Buffer.from(str, "base64");
|
|
15
15
|
const toBufferFromArray = (arr) => Buffer.from(arr);
|
|
@@ -22,8 +22,8 @@ const decodeHex = (str) => {
|
|
|
22
22
|
const decoded = toHexBuffer(str).toString();
|
|
23
23
|
return !isASCII(decoded) || hasUnicode(decoded) ? prefix0x(str) : decoded;
|
|
24
24
|
};
|
|
25
|
-
const isASCII = (str, ext = true) => (ext ? /^[\x00-\xFF]*$/ : /^[\x00-\x7F]*$/).test(str);
|
|
26
|
-
const isHexString = (str) => str.length % 2 === 0 && /^[0-9a-fA-F]*$/.test(str);
|
|
25
|
+
const isASCII = (str, ext = true) => (ext ? /^[\x00-\xFF]*$/ : /^[\x00-\x7F]*$/).test(str.toString());
|
|
26
|
+
const isHexString = (str) => str.length % 2 === 0 && /^[0-9a-fA-F]*$/.test(str.toString());
|
|
27
27
|
const isTxHash = (str) => str.length === 64 && isHexString(str);
|
|
28
28
|
const hasUnicode = (str) => (JSON.stringify(str).match(/\\u[\dA-F]{4}/gi)?.length ?? 0) > 0;
|
|
29
29
|
const uint8ArrayToUtf8String = (array) => {
|
package/dist/lib/hex.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hex.cjs","names":[],"sources":["../../src/lib/hex.ts"],"sourcesContent":["export const byteaToHex = (bytea: string):
|
|
1
|
+
{"version":3,"file":"hex.cjs","names":[],"sources":["../../src/lib/hex.ts"],"sourcesContent":["export const byteaToHex = (bytea: string | String): string => bytea.startsWith('\\\\x') ? bytea.substring(2) : bytea.toString()\nexport const hexToBytea = ( hex: string | String): string => hex.startsWith('\\\\x') ? hex.toString() : ( '\\\\x' + hex )\nexport const prefix0x = ( hex: string | String): string => hex.startsWith( '0x') ? hex.toString() : ( '0x' + hex )\n\nconst toBufferView = ( arr: Uint8Array): Buffer => Buffer.isBuffer(arr)\n ? arr\n : Buffer.from(arr.buffer, arr.byteOffset, arr.byteLength)\n\nexport const encodeHex = ( str: string | String): string => Buffer.from(str).toString('hex')\nexport const toHexStringBuffer= ( arr: Buffer | null): string => arr ? arr.toString('hex') : ''\nexport const toHexString = ( arr: Uint8Array | null): string => arr ? toBufferView(arr).toString('hex') : ''\nexport const toB64String = ( arr: Uint8Array): string => Buffer.from(arr).toString('base64')\nexport const toBuffer = ( hex: string | String): Buffer => toHexBuffer(hex)\nexport const toHexBuffer = ( hex: string | String): Buffer => Buffer.from(byteaToHex(hex), 'hex')\nexport const toB64Buffer = ( str: string | String): Buffer => Buffer.from(str, 'base64')\nexport const toBufferFromArray= ( arr: Uint8Array): Buffer => Buffer.from(arr)\nexport const toHexArray = ( hex: string | String): Uint8Array => Uint8Array.from(toHexBuffer(hex))\nexport const toB64Array = ( str: string | String): Uint8Array => Uint8Array.from(toB64Buffer(str))\nexport const toStringArray = ( str: string | String): Uint8Array => Uint8Array.from(toBuffer(str))\n\nexport const hexToDataView = ( hex: string | String): DataView => new DataView(toHexArray(hex).buffer)\nexport const dataViewToArray = ( dv: DataView): Uint8Array => new Uint8Array(dv.buffer, dv.byteOffset, dv.byteLength)\n\nexport const decodeHex = ( str: string | String): string => {\n\n const decoded = toHexBuffer(str).toString()\n\n return !isASCII(decoded) || hasUnicode(decoded) ? prefix0x(str) : decoded\n}\nexport const isASCII = ( str: string | String, ext: boolean = true): boolean => (ext ? /^[\\x00-\\xFF]*$/ : /^[\\x00-\\x7F]*$/).test(str.toString())\nexport const isHexString = ( str: string | String): boolean => str.length % 2 === 0 && /^[0-9a-fA-F]*$/.test(str.toString())\nexport const isTxHash = ( str: string | String): boolean => str.length === 64 && isHexString(str)\nexport const hasUnicode = ( str: string | String): boolean => (JSON.stringify(str).match(/\\\\u[\\dA-F]{4}/gi)?.length ?? 0) > 0\n\n/* utf.js - UTF-8 <=> UTF-16 convertion\n *\n * Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>\n * Version: 1.0\n * LastModified: Dec 25 1999\n * This library is free. You can redistribute it and/or modify it.\n */\nexport const uint8ArrayToUtf8String = (array: Uint8Array): string => {\n var out, i, len, c;\n var char2, char3;\n\n out = \"\";\n len = array.length;\n i = 0;\n while (i < len) {\n c = array[i++]!;\n switch (c >> 4)\n {\n case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c);\n break;\n case 12: case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++]!;\n out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));\n break;\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++]!;\n char3 = array[i++]!;\n out += String.fromCharCode(((c & 0x0F) << 12) |\n ((char2 & 0x3F) << 6) |\n ((char3 & 0x3F) << 0));\n break;\n }\n }\n\n return out;\n}\n"],"mappings":";;;AAAA,MAAa,cAAoB,UAA2D,MAAM,WAAW,MAAM,GAAG,MAAM,UAAU,EAAE,GAAG,MAAM,UAAU;AAC3J,MAAa,cAAsB,QAA2D,IAAI,WAAW,MAAM,GAAG,IAAI,UAAU,GAAS,QAAQ;AACrJ,MAAa,YAAsB,QAA2D,IAAI,WAAY,KAAK,GAAG,IAAI,UAAU,GAAU,OAAO;AAErJ,MAAM,gBAA6B,QAAkD,OAAO,SAAS,IAAI,GACrG,MACA,OAAO,KAAK,IAAI,QAAQ,IAAI,YAAY,IAAI,WAAW;AAE3D,MAAa,aAAsB,QAAwD,OAAO,KAAK,IAAI,CAAC,SAAS,MAAM;AAC3H,MAAa,qBAAsB,QAAkD,MAAM,IAAI,SAAS,MAAM,GAAG;AACjH,MAAa,eAAsB,QAAkD,MAAM,aAAa,IAAI,CAAC,SAAS,MAAM,GAAG;AAC/H,MAAa,eAAsB,QAAwD,OAAO,KAAK,IAAI,CAAC,SAAS,SAAS;AAC9H,MAAa,YAAsB,QAAwD,YAAY,IAAI;AAC3G,MAAa,eAAsB,QAAwD,OAAO,KAAK,WAAW,IAAI,EAAE,MAAM;AAC9H,MAAa,eAAsB,QAAwD,OAAO,KAAK,KAAK,SAAS;AACrH,MAAa,qBAAsB,QAAwD,OAAO,KAAK,IAAI;AAC3G,MAAa,cAAsB,QAAoD,WAAW,KAAK,YAAY,IAAI,CAAC;AACxH,MAAa,cAAsB,QAAoD,WAAW,KAAK,YAAY,IAAI,CAAC;AACxH,MAAa,iBAAsB,QAAoD,WAAW,KAAK,SAAS,IAAI,CAAC;AAErH,MAAa,iBAAsB,QAAkD,IAAI,SAAS,WAAW,IAAI,CAAC,OAAO;AACzH,MAAa,mBAAuB,OAAiD,IAAI,WAAW,GAAG,QAAQ,GAAG,YAAY,GAAG,WAAW;AAE5I,MAAa,aAAsB,QAAkD;CAEnF,MAAM,UAAwB,YAAY,IAAI,CAAC,UAAU;AAEzD,QAAO,CAAC,QAAQ,QAAQ,IAAI,WAAW,QAAQ,GAAG,SAAS,IAAI,GAAG;;AAEpE,MAAa,WAAsB,KAAsB,MAAe,UAAmB,MAAM,mBAAmB,kBAAkB,KAAK,IAAI,UAAU,CAAC;AAC1J,MAAa,eAAsB,QAAkD,IAAI,SAAS,MAAM,KAAK,iBAAiB,KAAK,IAAI,UAAU,CAAC;AAClJ,MAAa,YAAsB,QAAkD,IAAI,WAAW,MAAM,YAAY,IAAI;AAC1H,MAAa,cAAsB,SAAuD,KAAK,UAAU,IAAI,CAAC,MAAM,kBAAkB,EAAE,UAAU,KAAK;AASvJ,MAAa,0BAA0B,UAA8B;CACnE,IAAI,KAAK,GAAG,KAAK;CACjB,IAAI,OAAO;AAEX,OAAM;AACN,OAAM,MAAM;AACZ,KAAI;AACJ,QAAO,IAAI,KAAK;AACd,MAAI,MAAM;AACV,UAAQ,KAAK,GAAb;GAEE,KAAK;GAAG,KAAK;GAAG,KAAK;GAAG,KAAK;GAAG,KAAK;GAAG,KAAK;GAAG,KAAK;GAAG,KAAK;AAE7D,WAAO,OAAO,aAAa,EAAE;AAC7B;GACA,KAAK;GAAI,KAAK;AAEd,YAAQ,MAAM;AACd,WAAO,OAAO,cAAe,IAAI,OAAS,IAAM,QAAQ,GAAM;AAC9D;GACA,KAAK;AAEH,YAAQ,MAAM;AACd,YAAQ,MAAM;AACd,WAAO,OAAO,cAAe,IAAI,OAAS,MACtC,QAAQ,OAAS,KACjB,QAAQ,OAAS,EAAG;AACxB;;;AAIN,QAAO"}
|
package/dist/lib/hex.d.cts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
//#region src/lib/hex.d.ts
|
|
2
|
-
declare const byteaToHex: (bytea: string) => string;
|
|
3
|
-
declare const hexToBytea: (hex: string) => string;
|
|
4
|
-
declare const prefix0x: (hex: string) => string;
|
|
5
|
-
declare const encodeHex: (str: string) => string;
|
|
2
|
+
declare const byteaToHex: (bytea: string | String) => string;
|
|
3
|
+
declare const hexToBytea: (hex: string | String) => string;
|
|
4
|
+
declare const prefix0x: (hex: string | String) => string;
|
|
5
|
+
declare const encodeHex: (str: string | String) => string;
|
|
6
6
|
declare const toHexStringBuffer: (arr: Buffer | null) => string;
|
|
7
7
|
declare const toHexString: (arr: Uint8Array | null) => string;
|
|
8
8
|
declare const toB64String: (arr: Uint8Array) => string;
|
|
9
|
-
declare const toBuffer: (hex: string) => Buffer;
|
|
10
|
-
declare const toHexBuffer: (hex: string) => Buffer;
|
|
11
|
-
declare const toB64Buffer: (str: string) => Buffer;
|
|
9
|
+
declare const toBuffer: (hex: string | String) => Buffer;
|
|
10
|
+
declare const toHexBuffer: (hex: string | String) => Buffer;
|
|
11
|
+
declare const toB64Buffer: (str: string | String) => Buffer;
|
|
12
12
|
declare const toBufferFromArray: (arr: Uint8Array) => Buffer;
|
|
13
|
-
declare const toHexArray: (hex: string) => Uint8Array;
|
|
14
|
-
declare const toB64Array: (str: string) => Uint8Array;
|
|
15
|
-
declare const toStringArray: (str: string) => Uint8Array;
|
|
16
|
-
declare const hexToDataView: (hex: string) => DataView;
|
|
13
|
+
declare const toHexArray: (hex: string | String) => Uint8Array;
|
|
14
|
+
declare const toB64Array: (str: string | String) => Uint8Array;
|
|
15
|
+
declare const toStringArray: (str: string | String) => Uint8Array;
|
|
16
|
+
declare const hexToDataView: (hex: string | String) => DataView;
|
|
17
17
|
declare const dataViewToArray: (dv: DataView) => Uint8Array;
|
|
18
|
-
declare const decodeHex: (str: string) => string;
|
|
19
|
-
declare const isASCII: (str: string, ext?: boolean) => boolean;
|
|
20
|
-
declare const isHexString: (str: string) => boolean;
|
|
21
|
-
declare const isTxHash: (str: string) => boolean;
|
|
22
|
-
declare const hasUnicode: (str: string) => boolean;
|
|
18
|
+
declare const decodeHex: (str: string | String) => string;
|
|
19
|
+
declare const isASCII: (str: string | String, ext?: boolean) => boolean;
|
|
20
|
+
declare const isHexString: (str: string | String) => boolean;
|
|
21
|
+
declare const isTxHash: (str: string | String) => boolean;
|
|
22
|
+
declare const hasUnicode: (str: string | String) => boolean;
|
|
23
23
|
declare const uint8ArrayToUtf8String: (array: Uint8Array) => string;
|
|
24
24
|
//#endregion
|
|
25
25
|
export { byteaToHex, dataViewToArray, decodeHex, encodeHex, hasUnicode, hexToBytea, hexToDataView, isASCII, isHexString, isTxHash, prefix0x, toB64Array, toB64Buffer, toB64String, toBuffer, toBufferFromArray, toHexArray, toHexBuffer, toHexString, toHexStringBuffer, toStringArray, uint8ArrayToUtf8String };
|
package/dist/lib/hex.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hex.d.cts","names":[],"sources":["../../src/lib/hex.ts"],"mappings":";cAAa,UAAA,GAAoB,KAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"hex.d.cts","names":[],"sources":["../../src/lib/hex.ts"],"mappings":";cAAa,UAAA,GAAoB,KAAA,WAAgB,MAAA;AAAA,cACpC,UAAA,GAAsB,GAAA,WAAc,MAAA;AAAA,cACpC,QAAA,GAAsB,GAAA,WAAc,MAAA;AAAA,cAMpC,SAAA,GAAsB,GAAA,WAAc,MAAA;AAAA,cACpC,iBAAA,GAAsB,GAAA,EAAK,MAAA;AAAA,cAC3B,WAAA,GAAsB,GAAA,EAAK,UAAA;AAAA,cAC3B,WAAA,GAAsB,GAAA,EAAK,UAAA;AAAA,cAC3B,QAAA,GAAsB,GAAA,WAAc,MAAA,KAAqB,MAAA;AAAA,cACzD,WAAA,GAAsB,GAAA,WAAc,MAAA,KAAqB,MAAA;AAAA,cACzD,WAAA,GAAsB,GAAA,WAAc,MAAA,KAAqB,MAAA;AAAA,cACzD,iBAAA,GAAsB,GAAA,EAAK,UAAA,KAA8B,MAAA;AAAA,cACzD,UAAA,GAAsB,GAAA,WAAc,MAAA,KAAqB,UAAA;AAAA,cACzD,UAAA,GAAsB,GAAA,WAAc,MAAA,KAAqB,UAAA;AAAA,cACzD,aAAA,GAAsB,GAAA,WAAc,MAAA,KAAqB,UAAA;AAAA,cAEzD,aAAA,GAAsB,GAAA,WAAc,MAAA,KAAqB,QAAA;AAAA,cACzD,eAAA,GAAuB,EAAA,EAAI,QAAA,KAA8B,UAAA;AAAA,cAEzD,SAAA,GAAsB,GAAA,WAAc,MAAA;AAAA,cAMpC,OAAA,GAAsB,GAAA,WAAc,MAAA,EAAQ,GAAA;AAAA,cAC5C,WAAA,GAAsB,GAAA,WAAc,MAAA;AAAA,cACpC,QAAA,GAAsB,GAAA,WAAc,MAAA;AAAA,cACpC,UAAA,GAAsB,GAAA,WAAc,MAAA;AAAA,cASpC,sBAAA,GAA0B,KAAA,EAAO,UAAA"}
|
package/dist/lib/hex.d.mts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
1
|
//#region src/lib/hex.d.ts
|
|
2
|
-
declare const byteaToHex: (bytea: string) => string;
|
|
3
|
-
declare const hexToBytea: (hex: string) => string;
|
|
4
|
-
declare const prefix0x: (hex: string) => string;
|
|
5
|
-
declare const encodeHex: (str: string) => string;
|
|
2
|
+
declare const byteaToHex: (bytea: string | String) => string;
|
|
3
|
+
declare const hexToBytea: (hex: string | String) => string;
|
|
4
|
+
declare const prefix0x: (hex: string | String) => string;
|
|
5
|
+
declare const encodeHex: (str: string | String) => string;
|
|
6
6
|
declare const toHexStringBuffer: (arr: Buffer | null) => string;
|
|
7
7
|
declare const toHexString: (arr: Uint8Array | null) => string;
|
|
8
8
|
declare const toB64String: (arr: Uint8Array) => string;
|
|
9
|
-
declare const toBuffer: (hex: string) => Buffer;
|
|
10
|
-
declare const toHexBuffer: (hex: string) => Buffer;
|
|
11
|
-
declare const toB64Buffer: (str: string) => Buffer;
|
|
9
|
+
declare const toBuffer: (hex: string | String) => Buffer;
|
|
10
|
+
declare const toHexBuffer: (hex: string | String) => Buffer;
|
|
11
|
+
declare const toB64Buffer: (str: string | String) => Buffer;
|
|
12
12
|
declare const toBufferFromArray: (arr: Uint8Array) => Buffer;
|
|
13
|
-
declare const toHexArray: (hex: string) => Uint8Array;
|
|
14
|
-
declare const toB64Array: (str: string) => Uint8Array;
|
|
15
|
-
declare const toStringArray: (str: string) => Uint8Array;
|
|
16
|
-
declare const hexToDataView: (hex: string) => DataView;
|
|
13
|
+
declare const toHexArray: (hex: string | String) => Uint8Array;
|
|
14
|
+
declare const toB64Array: (str: string | String) => Uint8Array;
|
|
15
|
+
declare const toStringArray: (str: string | String) => Uint8Array;
|
|
16
|
+
declare const hexToDataView: (hex: string | String) => DataView;
|
|
17
17
|
declare const dataViewToArray: (dv: DataView) => Uint8Array;
|
|
18
|
-
declare const decodeHex: (str: string) => string;
|
|
19
|
-
declare const isASCII: (str: string, ext?: boolean) => boolean;
|
|
20
|
-
declare const isHexString: (str: string) => boolean;
|
|
21
|
-
declare const isTxHash: (str: string) => boolean;
|
|
22
|
-
declare const hasUnicode: (str: string) => boolean;
|
|
18
|
+
declare const decodeHex: (str: string | String) => string;
|
|
19
|
+
declare const isASCII: (str: string | String, ext?: boolean) => boolean;
|
|
20
|
+
declare const isHexString: (str: string | String) => boolean;
|
|
21
|
+
declare const isTxHash: (str: string | String) => boolean;
|
|
22
|
+
declare const hasUnicode: (str: string | String) => boolean;
|
|
23
23
|
declare const uint8ArrayToUtf8String: (array: Uint8Array) => string;
|
|
24
24
|
//#endregion
|
|
25
25
|
export { byteaToHex, dataViewToArray, decodeHex, encodeHex, hasUnicode, hexToBytea, hexToDataView, isASCII, isHexString, isTxHash, prefix0x, toB64Array, toB64Buffer, toB64String, toBuffer, toBufferFromArray, toHexArray, toHexBuffer, toHexString, toHexStringBuffer, toStringArray, uint8ArrayToUtf8String };
|
package/dist/lib/hex.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hex.d.mts","names":[],"sources":["../../src/lib/hex.ts"],"mappings":";cAAa,UAAA,GAAoB,KAAA;AAAA,
|
|
1
|
+
{"version":3,"file":"hex.d.mts","names":[],"sources":["../../src/lib/hex.ts"],"mappings":";cAAa,UAAA,GAAoB,KAAA,WAAgB,MAAA;AAAA,cACpC,UAAA,GAAsB,GAAA,WAAc,MAAA;AAAA,cACpC,QAAA,GAAsB,GAAA,WAAc,MAAA;AAAA,cAMpC,SAAA,GAAsB,GAAA,WAAc,MAAA;AAAA,cACpC,iBAAA,GAAsB,GAAA,EAAK,MAAA;AAAA,cAC3B,WAAA,GAAsB,GAAA,EAAK,UAAA;AAAA,cAC3B,WAAA,GAAsB,GAAA,EAAK,UAAA;AAAA,cAC3B,QAAA,GAAsB,GAAA,WAAc,MAAA,KAAqB,MAAA;AAAA,cACzD,WAAA,GAAsB,GAAA,WAAc,MAAA,KAAqB,MAAA;AAAA,cACzD,WAAA,GAAsB,GAAA,WAAc,MAAA,KAAqB,MAAA;AAAA,cACzD,iBAAA,GAAsB,GAAA,EAAK,UAAA,KAA8B,MAAA;AAAA,cACzD,UAAA,GAAsB,GAAA,WAAc,MAAA,KAAqB,UAAA;AAAA,cACzD,UAAA,GAAsB,GAAA,WAAc,MAAA,KAAqB,UAAA;AAAA,cACzD,aAAA,GAAsB,GAAA,WAAc,MAAA,KAAqB,UAAA;AAAA,cAEzD,aAAA,GAAsB,GAAA,WAAc,MAAA,KAAqB,QAAA;AAAA,cACzD,eAAA,GAAuB,EAAA,EAAI,QAAA,KAA8B,UAAA;AAAA,cAEzD,SAAA,GAAsB,GAAA,WAAc,MAAA;AAAA,cAMpC,OAAA,GAAsB,GAAA,WAAc,MAAA,EAAQ,GAAA;AAAA,cAC5C,WAAA,GAAsB,GAAA,WAAc,MAAA;AAAA,cACpC,QAAA,GAAsB,GAAA,WAAc,MAAA;AAAA,cACpC,UAAA,GAAsB,GAAA,WAAc,MAAA;AAAA,cASpC,sBAAA,GAA0B,KAAA,EAAO,UAAA"}
|
package/dist/lib/hex.mjs
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
//#region src/lib/hex.ts
|
|
2
|
-
const byteaToHex = (bytea) => bytea.startsWith("\\x") ? bytea.substring(2) : bytea;
|
|
3
|
-
const hexToBytea = (hex) => hex.startsWith("\\x") ? hex : "\\x" + hex;
|
|
4
|
-
const prefix0x = (hex) => hex.startsWith("0x") ? hex : "0x" + hex;
|
|
2
|
+
const byteaToHex = (bytea) => bytea.startsWith("\\x") ? bytea.substring(2) : bytea.toString();
|
|
3
|
+
const hexToBytea = (hex) => hex.startsWith("\\x") ? hex.toString() : "\\x" + hex;
|
|
4
|
+
const prefix0x = (hex) => hex.startsWith("0x") ? hex.toString() : "0x" + hex;
|
|
5
5
|
const toBufferView = (arr) => Buffer.isBuffer(arr) ? arr : Buffer.from(arr.buffer, arr.byteOffset, arr.byteLength);
|
|
6
6
|
const encodeHex = (str) => Buffer.from(str).toString("hex");
|
|
7
7
|
const toHexStringBuffer = (arr) => arr ? arr.toString("hex") : "";
|
|
8
8
|
const toHexString = (arr) => arr ? toBufferView(arr).toString("hex") : "";
|
|
9
9
|
const toB64String = (arr) => Buffer.from(arr).toString("base64");
|
|
10
|
-
const toBuffer = (hex) =>
|
|
10
|
+
const toBuffer = (hex) => toHexBuffer(hex);
|
|
11
11
|
const toHexBuffer = (hex) => Buffer.from(byteaToHex(hex), "hex");
|
|
12
12
|
const toB64Buffer = (str) => Buffer.from(str, "base64");
|
|
13
13
|
const toBufferFromArray = (arr) => Buffer.from(arr);
|
|
@@ -20,8 +20,8 @@ const decodeHex = (str) => {
|
|
|
20
20
|
const decoded = toHexBuffer(str).toString();
|
|
21
21
|
return !isASCII(decoded) || hasUnicode(decoded) ? prefix0x(str) : decoded;
|
|
22
22
|
};
|
|
23
|
-
const isASCII = (str, ext = true) => (ext ? /^[\x00-\xFF]*$/ : /^[\x00-\x7F]*$/).test(str);
|
|
24
|
-
const isHexString = (str) => str.length % 2 === 0 && /^[0-9a-fA-F]*$/.test(str);
|
|
23
|
+
const isASCII = (str, ext = true) => (ext ? /^[\x00-\xFF]*$/ : /^[\x00-\x7F]*$/).test(str.toString());
|
|
24
|
+
const isHexString = (str) => str.length % 2 === 0 && /^[0-9a-fA-F]*$/.test(str.toString());
|
|
25
25
|
const isTxHash = (str) => str.length === 64 && isHexString(str);
|
|
26
26
|
const hasUnicode = (str) => (JSON.stringify(str).match(/\\u[\dA-F]{4}/gi)?.length ?? 0) > 0;
|
|
27
27
|
const uint8ArrayToUtf8String = (array) => {
|
package/dist/lib/hex.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hex.mjs","names":[],"sources":["../../src/lib/hex.ts"],"sourcesContent":["export const byteaToHex = (bytea: string):
|
|
1
|
+
{"version":3,"file":"hex.mjs","names":[],"sources":["../../src/lib/hex.ts"],"sourcesContent":["export const byteaToHex = (bytea: string | String): string => bytea.startsWith('\\\\x') ? bytea.substring(2) : bytea.toString()\nexport const hexToBytea = ( hex: string | String): string => hex.startsWith('\\\\x') ? hex.toString() : ( '\\\\x' + hex )\nexport const prefix0x = ( hex: string | String): string => hex.startsWith( '0x') ? hex.toString() : ( '0x' + hex )\n\nconst toBufferView = ( arr: Uint8Array): Buffer => Buffer.isBuffer(arr)\n ? arr\n : Buffer.from(arr.buffer, arr.byteOffset, arr.byteLength)\n\nexport const encodeHex = ( str: string | String): string => Buffer.from(str).toString('hex')\nexport const toHexStringBuffer= ( arr: Buffer | null): string => arr ? arr.toString('hex') : ''\nexport const toHexString = ( arr: Uint8Array | null): string => arr ? toBufferView(arr).toString('hex') : ''\nexport const toB64String = ( arr: Uint8Array): string => Buffer.from(arr).toString('base64')\nexport const toBuffer = ( hex: string | String): Buffer => toHexBuffer(hex)\nexport const toHexBuffer = ( hex: string | String): Buffer => Buffer.from(byteaToHex(hex), 'hex')\nexport const toB64Buffer = ( str: string | String): Buffer => Buffer.from(str, 'base64')\nexport const toBufferFromArray= ( arr: Uint8Array): Buffer => Buffer.from(arr)\nexport const toHexArray = ( hex: string | String): Uint8Array => Uint8Array.from(toHexBuffer(hex))\nexport const toB64Array = ( str: string | String): Uint8Array => Uint8Array.from(toB64Buffer(str))\nexport const toStringArray = ( str: string | String): Uint8Array => Uint8Array.from(toBuffer(str))\n\nexport const hexToDataView = ( hex: string | String): DataView => new DataView(toHexArray(hex).buffer)\nexport const dataViewToArray = ( dv: DataView): Uint8Array => new Uint8Array(dv.buffer, dv.byteOffset, dv.byteLength)\n\nexport const decodeHex = ( str: string | String): string => {\n\n const decoded = toHexBuffer(str).toString()\n\n return !isASCII(decoded) || hasUnicode(decoded) ? prefix0x(str) : decoded\n}\nexport const isASCII = ( str: string | String, ext: boolean = true): boolean => (ext ? /^[\\x00-\\xFF]*$/ : /^[\\x00-\\x7F]*$/).test(str.toString())\nexport const isHexString = ( str: string | String): boolean => str.length % 2 === 0 && /^[0-9a-fA-F]*$/.test(str.toString())\nexport const isTxHash = ( str: string | String): boolean => str.length === 64 && isHexString(str)\nexport const hasUnicode = ( str: string | String): boolean => (JSON.stringify(str).match(/\\\\u[\\dA-F]{4}/gi)?.length ?? 0) > 0\n\n/* utf.js - UTF-8 <=> UTF-16 convertion\n *\n * Copyright (C) 1999 Masanao Izumo <iz@onicos.co.jp>\n * Version: 1.0\n * LastModified: Dec 25 1999\n * This library is free. You can redistribute it and/or modify it.\n */\nexport const uint8ArrayToUtf8String = (array: Uint8Array): string => {\n var out, i, len, c;\n var char2, char3;\n\n out = \"\";\n len = array.length;\n i = 0;\n while (i < len) {\n c = array[i++]!;\n switch (c >> 4)\n {\n case 0: case 1: case 2: case 3: case 4: case 5: case 6: case 7:\n // 0xxxxxxx\n out += String.fromCharCode(c);\n break;\n case 12: case 13:\n // 110x xxxx 10xx xxxx\n char2 = array[i++]!;\n out += String.fromCharCode(((c & 0x1F) << 6) | (char2 & 0x3F));\n break;\n case 14:\n // 1110 xxxx 10xx xxxx 10xx xxxx\n char2 = array[i++]!;\n char3 = array[i++]!;\n out += String.fromCharCode(((c & 0x0F) << 12) |\n ((char2 & 0x3F) << 6) |\n ((char3 & 0x3F) << 0));\n break;\n }\n }\n\n return out;\n}\n"],"mappings":";AAAA,MAAa,cAAoB,UAA2D,MAAM,WAAW,MAAM,GAAG,MAAM,UAAU,EAAE,GAAG,MAAM,UAAU;AAC3J,MAAa,cAAsB,QAA2D,IAAI,WAAW,MAAM,GAAG,IAAI,UAAU,GAAS,QAAQ;AACrJ,MAAa,YAAsB,QAA2D,IAAI,WAAY,KAAK,GAAG,IAAI,UAAU,GAAU,OAAO;AAErJ,MAAM,gBAA6B,QAAkD,OAAO,SAAS,IAAI,GACrG,MACA,OAAO,KAAK,IAAI,QAAQ,IAAI,YAAY,IAAI,WAAW;AAE3D,MAAa,aAAsB,QAAwD,OAAO,KAAK,IAAI,CAAC,SAAS,MAAM;AAC3H,MAAa,qBAAsB,QAAkD,MAAM,IAAI,SAAS,MAAM,GAAG;AACjH,MAAa,eAAsB,QAAkD,MAAM,aAAa,IAAI,CAAC,SAAS,MAAM,GAAG;AAC/H,MAAa,eAAsB,QAAwD,OAAO,KAAK,IAAI,CAAC,SAAS,SAAS;AAC9H,MAAa,YAAsB,QAAwD,YAAY,IAAI;AAC3G,MAAa,eAAsB,QAAwD,OAAO,KAAK,WAAW,IAAI,EAAE,MAAM;AAC9H,MAAa,eAAsB,QAAwD,OAAO,KAAK,KAAK,SAAS;AACrH,MAAa,qBAAsB,QAAwD,OAAO,KAAK,IAAI;AAC3G,MAAa,cAAsB,QAAoD,WAAW,KAAK,YAAY,IAAI,CAAC;AACxH,MAAa,cAAsB,QAAoD,WAAW,KAAK,YAAY,IAAI,CAAC;AACxH,MAAa,iBAAsB,QAAoD,WAAW,KAAK,SAAS,IAAI,CAAC;AAErH,MAAa,iBAAsB,QAAkD,IAAI,SAAS,WAAW,IAAI,CAAC,OAAO;AACzH,MAAa,mBAAuB,OAAiD,IAAI,WAAW,GAAG,QAAQ,GAAG,YAAY,GAAG,WAAW;AAE5I,MAAa,aAAsB,QAAkD;CAEnF,MAAM,UAAwB,YAAY,IAAI,CAAC,UAAU;AAEzD,QAAO,CAAC,QAAQ,QAAQ,IAAI,WAAW,QAAQ,GAAG,SAAS,IAAI,GAAG;;AAEpE,MAAa,WAAsB,KAAsB,MAAe,UAAmB,MAAM,mBAAmB,kBAAkB,KAAK,IAAI,UAAU,CAAC;AAC1J,MAAa,eAAsB,QAAkD,IAAI,SAAS,MAAM,KAAK,iBAAiB,KAAK,IAAI,UAAU,CAAC;AAClJ,MAAa,YAAsB,QAAkD,IAAI,WAAW,MAAM,YAAY,IAAI;AAC1H,MAAa,cAAsB,SAAuD,KAAK,UAAU,IAAI,CAAC,MAAM,kBAAkB,EAAE,UAAU,KAAK;AASvJ,MAAa,0BAA0B,UAA8B;CACnE,IAAI,KAAK,GAAG,KAAK;CACjB,IAAI,OAAO;AAEX,OAAM;AACN,OAAM,MAAM;AACZ,KAAI;AACJ,QAAO,IAAI,KAAK;AACd,MAAI,MAAM;AACV,UAAQ,KAAK,GAAb;GAEE,KAAK;GAAG,KAAK;GAAG,KAAK;GAAG,KAAK;GAAG,KAAK;GAAG,KAAK;GAAG,KAAK;GAAG,KAAK;AAE7D,WAAO,OAAO,aAAa,EAAE;AAC7B;GACA,KAAK;GAAI,KAAK;AAEd,YAAQ,MAAM;AACd,WAAO,OAAO,cAAe,IAAI,OAAS,IAAM,QAAQ,GAAM;AAC9D;GACA,KAAK;AAEH,YAAQ,MAAM;AACd,YAAQ,MAAM;AACd,WAAO,OAAO,cAAe,IAAI,OAAS,MACtC,QAAQ,OAAS,KACjB,QAAQ,OAAS,EAAG;AACxB;;;AAIN,QAAO"}
|
package/llms.txt
CHANGED
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@eternl/tools",
|
|
3
|
-
"version": "0.10.
|
|
4
|
-
"description": "Shared tools package for log helpers and
|
|
3
|
+
"version": "0.10.17",
|
|
4
|
+
"description": "Shared tools package for log helpers, base utilities and bech32 helpers",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"sideEffects": false,
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"llms.txt"
|
|
32
32
|
],
|
|
33
33
|
"dependencies": {
|
|
34
|
+
"bech32": "2.0.0",
|
|
34
35
|
"blakejs": "1.2.1"
|
|
35
36
|
},
|
|
36
37
|
"publishConfig": {
|