applesauce-wallet 0.0.0-next-20250311165233 → 0.0.0-next-20250311171842
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/actions/wallet.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Action } from "applesauce-actions";
|
|
2
2
|
/** An action that creates a new 17375 wallet event and 375 wallet backup */
|
|
3
|
-
export declare function CreateWallet(mints: string[], privateKey?: Uint8Array
|
|
3
|
+
export declare function CreateWallet(mints: string[], privateKey?: Uint8Array): Action;
|
package/dist/helpers/wallet.d.ts
CHANGED
|
@@ -11,4 +11,4 @@ export declare function unlockWallet(wallet: NostrEvent, signer: HiddenContentSi
|
|
|
11
11
|
/** Returns the wallets mints */
|
|
12
12
|
export declare function getWalletMints(wallet: NostrEvent): string[];
|
|
13
13
|
/** Returns the wallets private key as a string */
|
|
14
|
-
export declare function getWalletPrivateKey(wallet: NostrEvent):
|
|
14
|
+
export declare function getWalletPrivateKey(wallet: NostrEvent): Uint8Array;
|
package/dist/helpers/wallet.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { hexToBytes } from "@noble/hashes/utils";
|
|
1
2
|
import { getHiddenTags, getOrComputeCachedValue, isHiddenTagsLocked, unlockHiddenTags, } from "applesauce-core/helpers";
|
|
2
3
|
export const WALLET_KIND = 17375;
|
|
3
4
|
export const WALLET_BACKUP_KIND = 375;
|
|
@@ -29,6 +30,6 @@ export function getWalletPrivateKey(wallet) {
|
|
|
29
30
|
const key = tags.find((t) => t[0] === "privkey" && t[1])?.[1];
|
|
30
31
|
if (!key)
|
|
31
32
|
throw new Error("Wallet missing private key");
|
|
32
|
-
return key;
|
|
33
|
+
return hexToBytes(key);
|
|
33
34
|
});
|
|
34
35
|
}
|
package/dist/queries/wallet.d.ts
CHANGED
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { Query } from "applesauce-core";
|
|
2
|
+
import { NostrEvent } from "nostr-tools";
|
|
2
3
|
export type WalletInfo = {
|
|
3
4
|
locked: true;
|
|
5
|
+
event: NostrEvent;
|
|
4
6
|
} | {
|
|
5
7
|
locked: false;
|
|
6
|
-
|
|
8
|
+
event: NostrEvent;
|
|
9
|
+
privateKey: Uint8Array;
|
|
7
10
|
mints: string[];
|
|
8
11
|
};
|
|
9
12
|
/** A query to get the state of a NIP-60 wallet */
|
package/dist/queries/wallet.js
CHANGED
|
@@ -12,10 +12,10 @@ export function WalletQuery(pubkey) {
|
|
|
12
12
|
if (!wallet)
|
|
13
13
|
return;
|
|
14
14
|
if (isWalletLocked(wallet))
|
|
15
|
-
return { locked: true };
|
|
15
|
+
return { locked: true, event: wallet };
|
|
16
16
|
const mints = getWalletMints(wallet);
|
|
17
17
|
const privateKey = getWalletPrivateKey(wallet);
|
|
18
|
-
return { locked: false, mints, privateKey };
|
|
18
|
+
return { locked: false, mints, privateKey, event: wallet };
|
|
19
19
|
})),
|
|
20
20
|
};
|
|
21
21
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "applesauce-wallet",
|
|
3
|
-
"version": "0.0.0-next-
|
|
3
|
+
"version": "0.0.0-next-20250311171842",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -78,16 +78,16 @@
|
|
|
78
78
|
},
|
|
79
79
|
"dependencies": {
|
|
80
80
|
"@noble/hashes": "^1.7.1",
|
|
81
|
-
"applesauce-actions": "0.0.0-next-
|
|
82
|
-
"applesauce-core": "0.0.0-next-
|
|
83
|
-
"applesauce-factory": "0.0.0-next-
|
|
81
|
+
"applesauce-actions": "0.0.0-next-20250311171842",
|
|
82
|
+
"applesauce-core": "0.0.0-next-20250311171842",
|
|
83
|
+
"applesauce-factory": "0.0.0-next-20250311171842",
|
|
84
84
|
"nostr-tools": "^2.10.4",
|
|
85
85
|
"rxjs": "^7.8.1"
|
|
86
86
|
},
|
|
87
87
|
"devDependencies": {
|
|
88
88
|
"@hirez_io/observer-spy": "^2.2.0",
|
|
89
89
|
"@types/debug": "^4.1.12",
|
|
90
|
-
"applesauce-signers": "0.0.0-next-
|
|
90
|
+
"applesauce-signers": "0.0.0-next-20250311171842",
|
|
91
91
|
"typescript": "^5.7.3",
|
|
92
92
|
"vitest": "^3.0.5"
|
|
93
93
|
},
|