@tari-project/ootle-secret-key-wallet 0.17.0 → 0.19.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/README.md +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +12 -12
- package/package.json +4 -4
package/README.md
CHANGED
|
@@ -25,7 +25,7 @@ so the key never enters JavaScript.
|
|
|
25
25
|
> API in `@tari-project/ootle` (`decryptOwnedUtxo`, `WalletStealthAuthorizer`)
|
|
26
26
|
> will throw if the wallet was created without a view key. See the canonical
|
|
27
27
|
> usage in [`examples/node/`](../../examples/node/README.md) — the stealth
|
|
28
|
-
> scripts (`stealth:faucet-deposit`, `stealth:to-revealed`, `stealth:to-stealth`,
|
|
28
|
+
> scripts (`stealth:faucet-deposit`, `stealth:to-revealed`, `stealth:revealed-to-stealth`,
|
|
29
29
|
> `stealth:spend`) all build their wallets via
|
|
30
30
|
> `SecretKeyWallet.randomWithViewKey(Network.LocalNet)`.
|
|
31
31
|
|
|
@@ -49,7 +49,7 @@ const wallet = SecretKeyWallet.randomWithViewKey(Network.LocalNet);
|
|
|
49
49
|
console.log(await wallet.getAddress());
|
|
50
50
|
|
|
51
51
|
// Sign a previously-built unsigned transaction:
|
|
52
|
-
const
|
|
52
|
+
const signed = await signTransaction([wallet], unsignedTx); // from @tari-project/ootle
|
|
53
53
|
```
|
|
54
54
|
|
|
55
55
|
For a fully-typed account-key restore (no view key needed) use
|
package/dist/index.d.ts
CHANGED
|
@@ -41,7 +41,7 @@ export declare class EphemeralKeySigner implements Signer {
|
|
|
41
41
|
static generate(network?: Network): EphemeralKeySigner;
|
|
42
42
|
getAddress(): Promise<string>;
|
|
43
43
|
getPublicKey(): Promise<Uint8Array>;
|
|
44
|
-
signTransaction(unsignedTx: UnsignedTransactionV1, sealPublicKey: Uint8Array): Promise<TransactionSignature[]>;
|
|
44
|
+
signTransaction(unsignedTx: UnsignedTransactionV1, sealPublicKey: Uint8Array, authorizers: Uint8Array[]): Promise<TransactionSignature[]>;
|
|
45
45
|
}
|
|
46
46
|
|
|
47
47
|
/**
|
|
@@ -119,7 +119,7 @@ export declare class SecretKeyWallet implements Signer {
|
|
|
119
119
|
* wallet's owner public key) — it authorizes the specific stealth UTXO being spent.
|
|
120
120
|
*/
|
|
121
121
|
addStealthSignature(unsignedJson: string, publicNonce: Uint8Array, sealPublicKey: Uint8Array, ctx: AddStealthSignatureCtx): Promise<TransactionSignature>;
|
|
122
|
-
signTransaction(unsignedTx: UnsignedTransactionV1, sealPublicKey: Uint8Array): Promise<TransactionSignature[]>;
|
|
122
|
+
signTransaction(unsignedTx: UnsignedTransactionV1, sealPublicKey: Uint8Array, authorizers: Uint8Array[]): Promise<TransactionSignature[]>;
|
|
123
123
|
}
|
|
124
124
|
|
|
125
125
|
export { }
|
package/dist/index.js
CHANGED
|
@@ -2,8 +2,8 @@ var __defProp = Object.defineProperty;
|
|
|
2
2
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
3
3
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
4
4
|
import { addTransactionSigner as e, generateKeypair as t, generateOotleAddress as n, generateOotleSecretKey as r, ootlePublicKeyFromSecretKey as i, publicKeyFromSecretKey as a } from "@tari-project/ootle-wasm";
|
|
5
|
-
import { Network as o, WalletError as s, assertByteLength as c,
|
|
6
|
-
var
|
|
5
|
+
import { Network as o, WalletError as s, assertByteLength as c, encodeAuthorizerSet as l, serializeUnsignedTx as u } from "@tari-project/ootle";
|
|
6
|
+
var d = class t2 {
|
|
7
7
|
constructor(e2, t3, n2, r3, i2) {
|
|
8
8
|
__publicField(this, "ownerSecretKey");
|
|
9
9
|
__publicField(this, "ownerPublicKey");
|
|
@@ -43,15 +43,15 @@ var u = class t2 {
|
|
|
43
43
|
return e2;
|
|
44
44
|
}
|
|
45
45
|
async addStealthSignature(t3, n2, r3, i2) {
|
|
46
|
-
let a2 = e(t3, await i2.crypto.stealthDhSecret(this.network, this.ownerSecretKey, i2.viewSecret, n2), r3), o2 = JSON.parse(a2);
|
|
46
|
+
let a2 = e(t3, await i2.crypto.stealthDhSecret(this.network, this.ownerSecretKey, i2.viewSecret, n2), r3, l(i2.authorizers)), o2 = JSON.parse(a2);
|
|
47
47
|
return o2.signatures[o2.signatures.length - 1];
|
|
48
48
|
}
|
|
49
|
-
async signTransaction(t3, n2) {
|
|
49
|
+
async signTransaction(t3, n2, r3) {
|
|
50
50
|
c(n2, 32, "SecretKeyWallet.signTransaction sealPublicKey");
|
|
51
|
-
let
|
|
52
|
-
return JSON.parse(
|
|
51
|
+
let i2 = e(u(t3), this.ownerSecretKey, n2, l(r3));
|
|
52
|
+
return JSON.parse(i2).signatures;
|
|
53
53
|
}
|
|
54
|
-
},
|
|
54
|
+
}, f = class r2 {
|
|
55
55
|
constructor(e2, r3, i2) {
|
|
56
56
|
__publicField(this, "secretKey");
|
|
57
57
|
__publicField(this, "publicKey");
|
|
@@ -68,13 +68,13 @@ var u = class t2 {
|
|
|
68
68
|
async getPublicKey() {
|
|
69
69
|
return Promise.resolve(this.publicKey);
|
|
70
70
|
}
|
|
71
|
-
async signTransaction(t3, n2) {
|
|
71
|
+
async signTransaction(t3, n2, r3) {
|
|
72
72
|
c(n2, 32, "EphemeralKeySigner.signTransaction sealPublicKey");
|
|
73
|
-
let
|
|
74
|
-
return Promise.resolve(
|
|
73
|
+
let i2 = e(u(t3), this.secretKey, n2, l(r3)), a2 = JSON.parse(i2);
|
|
74
|
+
return Promise.resolve(a2.signatures);
|
|
75
75
|
}
|
|
76
76
|
};
|
|
77
77
|
export {
|
|
78
|
-
|
|
79
|
-
|
|
78
|
+
f as EphemeralKeySigner,
|
|
79
|
+
d as SecretKeyWallet
|
|
80
80
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tari-project/ootle-secret-key-wallet",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.19.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/tari-project/ootle.ts.git",
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
}
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@tari-project/ootle-ts-bindings": "^1.
|
|
29
|
-
"@tari-project/ootle-wasm": "^0.
|
|
30
|
-
"@tari-project/ootle": "0.
|
|
28
|
+
"@tari-project/ootle-ts-bindings": "^1.66.0",
|
|
29
|
+
"@tari-project/ootle-wasm": "^0.55.0",
|
|
30
|
+
"@tari-project/ootle": "0.19.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@types/node": "^25.5.0",
|