@nockchain/rose 0.1.4-nightly.6 → 0.1.4-nightly.8
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/extension/manifest.json +1 -1
- package/extension/shared/vault.ts +4 -10
- package/package.json +2 -2
- package/sdk/package-lock.json +2 -2
- package/sdk/package.json +1 -1
- package/sdk/src/hooks/use-rose.ts +10 -4
package/extension/manifest.json
CHANGED
|
@@ -509,7 +509,7 @@ export class Vault {
|
|
|
509
509
|
|
|
510
510
|
// Reset in-memory state
|
|
511
511
|
this.state = {
|
|
512
|
-
locked:
|
|
512
|
+
locked: false,
|
|
513
513
|
accounts: [],
|
|
514
514
|
currentAccountIndex: 0,
|
|
515
515
|
enc: null,
|
|
@@ -1478,15 +1478,9 @@ export class Vault {
|
|
|
1478
1478
|
}
|
|
1479
1479
|
|
|
1480
1480
|
try {
|
|
1481
|
-
const
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
wasm.SpendCondition.fromProtobuf(sc)
|
|
1485
|
-
);
|
|
1486
|
-
const builder = wasm.TxBuilder.fromTx(irisRawTx, irisNotes, irisSpendConditions);
|
|
1487
|
-
builder.sign(key.privateKey);
|
|
1488
|
-
const signedTx = builder.build();
|
|
1489
|
-
return signedTx.toRawTx().toProtobuf();
|
|
1481
|
+
const rawTx = wasm.RawTx.fromProtobuf(params.rawTx);
|
|
1482
|
+
rawTx.signAll(key.privateKey);
|
|
1483
|
+
return rawTx.toProtobuf();
|
|
1490
1484
|
} finally {
|
|
1491
1485
|
if (key !== masterKey) key.free();
|
|
1492
1486
|
masterKey.free();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nockchain/rose",
|
|
3
|
-
"version": "0.1.4-nightly.
|
|
3
|
+
"version": "0.1.4-nightly.8",
|
|
4
4
|
"description": "Rose - Chrome Wallet Extension for Nockchain",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"scripts": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
"dependencies": {
|
|
15
15
|
"@fontsource/inter": "5.2.8",
|
|
16
16
|
"@fontsource/lora": "5.2.8",
|
|
17
|
-
"@nockchain/sdk": "0.1.4-nightly.
|
|
17
|
+
"@nockchain/sdk": "0.1.4-nightly.7",
|
|
18
18
|
"@scure/base": "2.0.0",
|
|
19
19
|
"@scure/bip39": "2.0.1",
|
|
20
20
|
"react": "19.2.3",
|
package/sdk/package-lock.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nockchain/sdk",
|
|
3
|
-
"version": "0.1.4-nightly.
|
|
3
|
+
"version": "0.1.4-nightly.7",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "@nockchain/sdk",
|
|
9
|
-
"version": "0.1.4-nightly.
|
|
9
|
+
"version": "0.1.4-nightly.7",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@nockchain/rose-wasm": "^0.1.4-nightly.17.1.a460619",
|
package/sdk/package.json
CHANGED
|
@@ -36,11 +36,17 @@ function ensureWasmInitializedOnce(): WasmInit {
|
|
|
36
36
|
return p;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
function getProviderOnce(): NockchainProvider {
|
|
39
|
+
async function getProviderOnce(): Promise<NockchainProvider> {
|
|
40
40
|
const g = globalThis as typeof globalThis & Record<string, unknown>;
|
|
41
41
|
const existing = g[ROSE_SDK_PROVIDER_KEY];
|
|
42
42
|
if (existing instanceof NockchainProvider) return existing;
|
|
43
43
|
|
|
44
|
+
// Wait for provider to announce via EIP-6963
|
|
45
|
+
const found = await NockchainProvider.waitForInstallation(3000);
|
|
46
|
+
if (!found) {
|
|
47
|
+
throw new Error('Rose wallet not found. Please install the Rose extension.');
|
|
48
|
+
}
|
|
49
|
+
|
|
44
50
|
const provider = new NockchainProvider();
|
|
45
51
|
g[ROSE_SDK_PROVIDER_KEY] = provider;
|
|
46
52
|
return provider;
|
|
@@ -61,10 +67,10 @@ export function useRose({ rpcUrl = 'https://rpc.nockbox.org' }: { rpcUrl?: strin
|
|
|
61
67
|
setStatus('loading');
|
|
62
68
|
setError(null);
|
|
63
69
|
|
|
64
|
-
ensureWasmInitializedOnce()
|
|
65
|
-
.then(() => {
|
|
70
|
+
Promise.all([ensureWasmInitializedOnce(), getProviderOnce()])
|
|
71
|
+
.then(([, provider]) => {
|
|
66
72
|
if (cancelled) return;
|
|
67
|
-
setProvider(
|
|
73
|
+
setProvider(provider);
|
|
68
74
|
// The wasm package's type surface may lag runtime exports; keep this resilient.
|
|
69
75
|
const GrpcClientCtor = (wasm as any).GrpcClient as
|
|
70
76
|
| (new (rpcUrl: string) => unknown)
|