applesauce-core 0.0.0-next-20250610175335 → 0.0.0-next-20250610194602
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.
|
@@ -61,7 +61,7 @@ export declare function addRelayHintsToPointer<T extends {
|
|
|
61
61
|
/** Gets the hex pubkey from any nip-19 encoded string */
|
|
62
62
|
export declare function normalizeToPubkey(str: string): string;
|
|
63
63
|
/** Converts hex to nsec strings into Uint8 secret keys */
|
|
64
|
-
export declare function normalizeToSecretKey(str: string): Uint8Array;
|
|
64
|
+
export declare function normalizeToSecretKey(str: string | Uint8Array): Uint8Array;
|
|
65
65
|
/**
|
|
66
66
|
* Merges two event points and keeps all relays
|
|
67
67
|
* @throws if the ids are different
|
package/dist/helpers/pointers.js
CHANGED
|
@@ -198,7 +198,9 @@ export function normalizeToPubkey(str) {
|
|
|
198
198
|
}
|
|
199
199
|
/** Converts hex to nsec strings into Uint8 secret keys */
|
|
200
200
|
export function normalizeToSecretKey(str) {
|
|
201
|
-
if (
|
|
201
|
+
if (str instanceof Uint8Array)
|
|
202
|
+
return str;
|
|
203
|
+
else if (isHexKey(str))
|
|
202
204
|
return hexToBytes(str);
|
|
203
205
|
else {
|
|
204
206
|
const decode = nip19.decode(str);
|