@chironbuilder/ootle-sdk 0.1.9 → 0.1.11
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/wallet.d.ts +19 -0
- package/dist/wallet.d.ts.map +1 -1
- package/dist/wallet.js +87 -5
- package/package.json +1 -1
- package/vendor/ootle-patched/package.json +1 -1
- package/vendor/ootle-wasm-patched/README.md +58 -89
- package/vendor/ootle-wasm-patched/ootle_wasm.js +1 -1
- package/vendor/ootle-wasm-patched/ootle_wasm_bg.js +22 -30
- package/vendor/ootle-wasm-patched/ootle_wasm_bg.wasm +0 -0
- package/vendor/ootle-wasm-patched/ootle_wasm_bg.wasm.d.ts +20 -20
- package/vendor/ootle-wasm-patched/package.json +5 -2
package/dist/wallet.d.ts
CHANGED
|
@@ -540,6 +540,25 @@ export declare class OotleAccount implements WalletAccountApi {
|
|
|
540
540
|
* and every `StealthTransfer`-based one below) uses to interpret a `FeeType` the same way.
|
|
541
541
|
*/
|
|
542
542
|
private resolvePrivateFee;
|
|
543
|
+
/**
|
|
544
|
+
* Filters out unspent local records for `resourceAddress` that can't actually be read right now
|
|
545
|
+
* (checked largest-first, stopping once verified-readable records cover `targetAmount` -- the
|
|
546
|
+
* same greedy order `selectShieldedUtxosForAmount` itself uses, so this does the minimum
|
|
547
|
+
* verification needed rather than checking every record up front) -- used by `sendPrivately()`
|
|
548
|
+
* and `unshield()` before their own coin-selection plan runs, so a record that's actually
|
|
549
|
+
* already spent (confirmed live: the indexer can 500 instead of cleanly saying so, e.g. for one
|
|
550
|
+
* spent through another device/session sharing this seed) gets skipped as a *candidate* instead
|
|
551
|
+
* of failing the whole transaction deep inside the `StealthTransfer` builder with no way to
|
|
552
|
+
* retry excluding just the bad one.
|
|
553
|
+
*
|
|
554
|
+
* Deliberately never marks a failing record spent in local storage -- same reasoning as
|
|
555
|
+
* `resolvePrivateFee`: an unreadable-right-now record could just as easily be a transient
|
|
556
|
+
* indexer error as a genuinely spent output, and this wallet's only handle back to a real
|
|
557
|
+
* stealth output is this local record (see `ShieldedOutputRecord`'s own doc comment), so wrongly
|
|
558
|
+
* deleting one is unrecoverable. A record skipped here is simply not offered as a candidate for
|
|
559
|
+
* *this* attempt; it stays in local storage to be tried again later.
|
|
560
|
+
*/
|
|
561
|
+
private filterReadableShieldedOutputs;
|
|
543
562
|
/**
|
|
544
563
|
* Shared prepare/authorize/seal/submit path for every `StealthTransfer`-based operation
|
|
545
564
|
* (shield/unshield/withdrawStealthAndExecute/etc.): `builder` must already have every
|
package/dist/wallet.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"wallet.d.ts","sourceRoot":"","sources":["../src/wallet.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,EA2BR,MAAM,qBAAqB,CAAC;AAE7B,OAAO,KAAK,EACV,aAAa,EACb,mCAAmC,EACnC,WAAW,EAIX,mBAAmB,EACnB,aAAa,EACd,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAC9D,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAYxE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,iBAAiB,CAAC;AAGxD,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,mBAAmB,CAAC;AAI9D,OAAO,EAAE,KAAK,WAAW,EAAkB,MAAM,mBAAmB,CAAC;AAcrE,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AAIzD;;;yFAGyF;AACzF,MAAM,MAAM,OAAO,GAAG;IAAE,IAAI,EAAE,aAAa,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,SAAS,CAAC;IAAC,kBAAkB,EAAE,MAAM,CAAA;CAAE,CAAC;AAahG,MAAM,WAAW,YAAY;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,IAAI,EAAE,MAAM,CAAC;IACb,sFAAsF;IACtF,MAA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ED
|
@@ -897,7 +897,7 @@ export class OotleAccount {
|
|
|
897
897
|
*/
|
|
898
898
|
async unshield(resourceAddress, revealedOutAmount, maxFee = 100000n, memo, feeType = { kind: "transparent" }) {
|
|
899
899
|
const accountId = localAccountId(this.index);
|
|
900
|
-
const records = await listShieldedOutputs(accountId);
|
|
900
|
+
const records = await this.filterReadableShieldedOutputs(await listShieldedOutputs(accountId), resourceAddress, revealedOutAmount);
|
|
901
901
|
const { commitments, remainder } = resolveUnshieldPlan(records, resourceAddress, revealedOutAmount);
|
|
902
902
|
const dust = 1n;
|
|
903
903
|
const provider = await this.getProvider();
|
|
@@ -1306,9 +1306,91 @@ export class OotleAccount {
|
|
|
1306
1306
|
if (feeType.kind !== "private")
|
|
1307
1307
|
return null;
|
|
1308
1308
|
const accountId = localAccountId(this.index);
|
|
1309
|
-
const
|
|
1310
|
-
|
|
1311
|
-
|
|
1309
|
+
const records = await listShieldedOutputs(accountId);
|
|
1310
|
+
// Retries with the next-smallest qualifying UTXO if one fails to read -- confirmed live that a
|
|
1311
|
+
// record this wallet still has as "unspent" can 500 on the indexer (consistent with it having
|
|
1312
|
+
// actually been spent already, e.g. from another device/session sharing this seed, hitting an
|
|
1313
|
+
// indexer bug serving a since-spent substate) rather than a clean not-found. Deliberately does
|
|
1314
|
+
// NOT mark a failing candidate spent here: a 500 doesn't distinguish "genuinely spent" from "the
|
|
1315
|
+
// indexer had a bad moment," and this wallet's only handle back to a real stealth output is this
|
|
1316
|
+
// local record (see `ShieldedOutputRecord`'s own doc comment) -- wrongly deleting one on an
|
|
1317
|
+
// ambiguous error is unrecoverable, so a failing candidate is only skipped for *this* attempt,
|
|
1318
|
+
// tried again next time. Bounded by the exclude set strictly growing each iteration.
|
|
1319
|
+
const tried = new Set(exclude);
|
|
1320
|
+
let lastReadError;
|
|
1321
|
+
for (;;) {
|
|
1322
|
+
let chosen;
|
|
1323
|
+
try {
|
|
1324
|
+
chosen = selectPrivateFeeUtxo(records, feeType.feeResourceAddress, maxFee, [...tried]);
|
|
1325
|
+
}
|
|
1326
|
+
catch (selectError) {
|
|
1327
|
+
// Distinguishes "never had a large-enough candidate" (selectPrivateFeeUtxo's own clear
|
|
1328
|
+
// error) from "had one or more, but every single one failed to read" -- the latter needs
|
|
1329
|
+
// its own message naming the last read failure, or it looks identical to simply not having
|
|
1330
|
+
// enough shielded balance.
|
|
1331
|
+
if (lastReadError) {
|
|
1332
|
+
throw new Error(`Every shielded ${feeType.feeResourceAddress} UTXO large enough to cover a private fee of ${maxFee} failed to read from the network (last error: ${lastReadError instanceof Error ? lastReadError.message : String(lastReadError)}) -- one or more may already be spent, e.g. from another device or session sharing this seed.`, { cause: lastReadError });
|
|
1333
|
+
}
|
|
1334
|
+
throw selectError;
|
|
1335
|
+
}
|
|
1336
|
+
try {
|
|
1337
|
+
const built = await this.buildPrivateFeeInstructions(feeType.feeResourceAddress, chosen.commitment, maxFee);
|
|
1338
|
+
return { ...built, spentCommitment: chosen.commitment };
|
|
1339
|
+
}
|
|
1340
|
+
catch (e) {
|
|
1341
|
+
lastReadError = e;
|
|
1342
|
+
tried.add(chosen.commitment);
|
|
1343
|
+
}
|
|
1344
|
+
}
|
|
1345
|
+
}
|
|
1346
|
+
/**
|
|
1347
|
+
* Filters out unspent local records for `resourceAddress` that can't actually be read right now
|
|
1348
|
+
* (checked largest-first, stopping once verified-readable records cover `targetAmount` -- the
|
|
1349
|
+
* same greedy order `selectShieldedUtxosForAmount` itself uses, so this does the minimum
|
|
1350
|
+
* verification needed rather than checking every record up front) -- used by `sendPrivately()`
|
|
1351
|
+
* and `unshield()` before their own coin-selection plan runs, so a record that's actually
|
|
1352
|
+
* already spent (confirmed live: the indexer can 500 instead of cleanly saying so, e.g. for one
|
|
1353
|
+
* spent through another device/session sharing this seed) gets skipped as a *candidate* instead
|
|
1354
|
+
* of failing the whole transaction deep inside the `StealthTransfer` builder with no way to
|
|
1355
|
+
* retry excluding just the bad one.
|
|
1356
|
+
*
|
|
1357
|
+
* Deliberately never marks a failing record spent in local storage -- same reasoning as
|
|
1358
|
+
* `resolvePrivateFee`: an unreadable-right-now record could just as easily be a transient
|
|
1359
|
+
* indexer error as a genuinely spent output, and this wallet's only handle back to a real
|
|
1360
|
+
* stealth output is this local record (see `ShieldedOutputRecord`'s own doc comment), so wrongly
|
|
1361
|
+
* deleting one is unrecoverable. A record skipped here is simply not offered as a candidate for
|
|
1362
|
+
* *this* attempt; it stays in local storage to be tried again later.
|
|
1363
|
+
*/
|
|
1364
|
+
async filterReadableShieldedOutputs(records, resourceAddress, targetAmount) {
|
|
1365
|
+
const provider = await this.getProvider();
|
|
1366
|
+
const crypto = new WasmStealthCrypto(this.network);
|
|
1367
|
+
const viewSecret = await this.signer.getViewSecret();
|
|
1368
|
+
const candidates = records
|
|
1369
|
+
.filter((r) => r.resourceAddress === resourceAddress && !r.spent)
|
|
1370
|
+
.sort((a, b) => {
|
|
1371
|
+
const diff = BigInt(b.amount) - BigInt(a.amount);
|
|
1372
|
+
return diff > 0n ? 1 : diff < 0n ? -1 : 0;
|
|
1373
|
+
});
|
|
1374
|
+
const unreadable = new Set();
|
|
1375
|
+
let verifiedTotal = 0n;
|
|
1376
|
+
for (const record of candidates) {
|
|
1377
|
+
if (verifiedTotal >= targetAmount)
|
|
1378
|
+
break;
|
|
1379
|
+
try {
|
|
1380
|
+
const substateId = stealthUtxoSubstateId(resourceAddress, fromHex(record.commitment));
|
|
1381
|
+
const substate = await provider.getSubstate(substateId);
|
|
1382
|
+
const decrypted = await decryptOwnedUtxo(crypto, viewSecret, substate, substateId);
|
|
1383
|
+
if (!decrypted) {
|
|
1384
|
+
unreadable.add(record.commitment); // doesn't decrypt as ours -- don't offer it either
|
|
1385
|
+
continue;
|
|
1386
|
+
}
|
|
1387
|
+
verifiedTotal += BigInt(record.amount);
|
|
1388
|
+
}
|
|
1389
|
+
catch {
|
|
1390
|
+
unreadable.add(record.commitment);
|
|
1391
|
+
}
|
|
1392
|
+
}
|
|
1393
|
+
return records.filter((r) => !unreadable.has(r.commitment));
|
|
1312
1394
|
}
|
|
1313
1395
|
/**
|
|
1314
1396
|
* Shared prepare/authorize/seal/submit path for every `StealthTransfer`-based operation
|
|
@@ -1625,7 +1707,7 @@ export class OotleAccount {
|
|
|
1625
1707
|
async sendPrivately(resourceAddress, recipientWalletAddress, amount, maxFee = 100000n, memo, minimumValuePromise = 0n, feeType = { kind: "transparent" }) {
|
|
1626
1708
|
assertValidMinimumValuePromise(minimumValuePromise, amount);
|
|
1627
1709
|
const accountId = localAccountId(this.index);
|
|
1628
|
-
const records = await listShieldedOutputs(accountId);
|
|
1710
|
+
const records = await this.filterReadableShieldedOutputs(await listShieldedOutputs(accountId), resourceAddress, amount);
|
|
1629
1711
|
const { commitments, changeAmount } = resolveSendPrivatelyPlan(records, resourceAddress, amount);
|
|
1630
1712
|
const dust = 1n;
|
|
1631
1713
|
const provider = await this.getProvider();
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@chironbuilder/ootle-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.11",
|
|
4
4
|
"description": "Shared TypeScript client for Tari Ootle (L2): account derivation, balances, transactions, HTLCs, and stealth/confidential transfers — the account core behind Sapient and the Tari L1 web wallet's Ootle support.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -1,128 +1,97 @@
|
|
|
1
1
|
# ootle-wasm
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Rust → WASM library providing client-side crypto operations for Tari Ootle L2.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Architecture
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
```
|
|
10
|
-
|
|
11
|
-
## API
|
|
12
|
-
|
|
13
|
-
All keys and signatures are **`Uint8Array`** (raw 32-byte values).
|
|
14
|
-
|
|
15
|
-
### `generateKeypair()`
|
|
7
|
+
- `core/` — Pure Rust library. All crypto/encoding logic lives here. Testable natively with `cargo test`.
|
|
8
|
+
- `wasm/` — Thin `wasm-bindgen` shell. Accepts JSON strings, calls core, returns results.
|
|
16
9
|
|
|
17
|
-
|
|
10
|
+
## Prerequisites
|
|
18
11
|
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
12
|
+
```bash
|
|
13
|
+
# Install wasm-pack
|
|
14
|
+
cargo install wasm-pack
|
|
15
|
+
|
|
16
|
+
# (Optional) Install wasm-opt for size optimisation
|
|
17
|
+
# macOS:
|
|
18
|
+
brew install binaryen
|
|
19
|
+
# or via cargo:
|
|
20
|
+
cargo install wasm-opt
|
|
25
21
|
```
|
|
26
22
|
|
|
27
|
-
|
|
23
|
+
## Build
|
|
28
24
|
|
|
29
|
-
|
|
25
|
+
### Native (tests only)
|
|
30
26
|
|
|
31
|
-
```
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
const publicKey = publicKeyFromSecretKey(secretKey);
|
|
35
|
-
// publicKey: Uint8Array (32 bytes)
|
|
27
|
+
```bash
|
|
28
|
+
cargo test -p ootle-wasm-core
|
|
36
29
|
```
|
|
37
30
|
|
|
38
|
-
###
|
|
31
|
+
### WASM
|
|
39
32
|
|
|
40
|
-
|
|
33
|
+
```bash
|
|
34
|
+
# Build for bundler (webpack, vite, rollup, esbuild)
|
|
35
|
+
wasm-pack build crates/ootle_wasm/wasm --target bundler --release --out-dir ../../../pkg
|
|
41
36
|
|
|
42
|
-
|
|
43
|
-
-
|
|
37
|
+
# Build for Node.js
|
|
38
|
+
wasm-pack build crates/ootle_wasm/wasm --target nodejs --release --out-dir ../../../pkg
|
|
44
39
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
const hash = hashUnsignedTransaction(
|
|
49
|
-
JSON.stringify(unsignedTransaction),
|
|
50
|
-
sealSignerPublicKey,
|
|
51
|
-
);
|
|
40
|
+
# Build for web (no bundler)
|
|
41
|
+
wasm-pack build crates/ootle_wasm/wasm --target web --release --out-dir ../../../pkg
|
|
52
42
|
```
|
|
53
43
|
|
|
54
|
-
|
|
44
|
+
The output goes to `pkg/` at the repo root containing:
|
|
55
45
|
|
|
56
|
-
|
|
46
|
+
- `ootle_wasm_bg.wasm` — the WASM binary
|
|
47
|
+
- `ootle_wasm.js` — JS glue code
|
|
48
|
+
- `ootle_wasm.d.ts` — TypeScript type definitions
|
|
57
49
|
|
|
58
|
-
|
|
59
|
-
import { schnorrSign } from "@tari-project/ootle-wasm";
|
|
50
|
+
### Size optimisation (optional)
|
|
60
51
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
// signature: Uint8Array (32 bytes)
|
|
52
|
+
```bash
|
|
53
|
+
wasm-opt -Oz --strip-debug --strip-producers pkg/ootle_wasm_bg.wasm -o pkg/ootle_wasm_bg.wasm
|
|
64
54
|
```
|
|
65
55
|
|
|
66
|
-
###
|
|
67
|
-
|
|
68
|
-
BOR-encode a signed `Transaction` into a base64 `TransactionEnvelope` string, ready to submit to the network.
|
|
56
|
+
### Debug build (with panic hook)
|
|
69
57
|
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
const envelope = borEncodeTransaction(JSON.stringify(transaction));
|
|
58
|
+
```bash
|
|
59
|
+
wasm-pack build crates/ootle_wasm/wasm --target bundler --dev --out-dir ../../../pkg -- --features debug
|
|
74
60
|
```
|
|
75
61
|
|
|
76
|
-
##
|
|
62
|
+
## WASM Exports
|
|
77
63
|
|
|
78
|
-
|
|
64
|
+
| Function | Signature | Description |
|
|
65
|
+
|---------------------------|-----------------------------------------------------------------------------|-----------------------------------------------------|
|
|
66
|
+
| `borEncodeTransaction` | `(transactionJson: string) → string` | BOR-encode a Transaction JSON → base64 envelope |
|
|
67
|
+
| `hashUnsignedTransaction` | `(unsignedTxJson: string, sealSignerPubKeyHex: string) → Uint8Array` | Hash an unsigned transaction for signing (64 bytes) |
|
|
68
|
+
| `schnorrSign` | `(secretKeyHex: string, message: Uint8Array) → { public_nonce, signature }` | Schnorr-sign a message |
|
|
69
|
+
| `generateKeypair` | `() → { secret_key, public_key }` | Generate a random Ristretto keypair |
|
|
70
|
+
| `publicKeyFromSecretKey` | `(secretKeyHex: string) → string` | Derive public key from secret key |
|
|
79
71
|
|
|
80
|
-
|
|
81
|
-
import { generateKeypair, publicKeyFromSecretKey } from "@tari-project/ootle-wasm";
|
|
72
|
+
All keys and signatures are lowercase hex-encoded strings.
|
|
82
73
|
|
|
83
|
-
|
|
84
|
-
const { secret_key, public_key } = generateKeypair();
|
|
85
|
-
console.log("Public key:", public_key.toHex());
|
|
86
|
-
|
|
87
|
-
// Load a key from a hex string
|
|
88
|
-
const restored = Uint8Array.fromHex("a1b2c3...");
|
|
89
|
-
const derivedPublicKey = publicKeyFromSecretKey(restored);
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
## Full example
|
|
74
|
+
## Usage from JS/TS
|
|
93
75
|
|
|
94
76
|
```typescript
|
|
95
|
-
import {
|
|
77
|
+
import init, {
|
|
96
78
|
generateKeypair,
|
|
97
|
-
publicKeyFromSecretKey,
|
|
98
|
-
hashUnsignedTransaction,
|
|
99
79
|
schnorrSign,
|
|
80
|
+
hashUnsignedTransaction,
|
|
100
81
|
borEncodeTransaction,
|
|
101
|
-
|
|
82
|
+
publicKeyFromSecretKey,
|
|
83
|
+
} from './pkg/ootle_wasm.js';
|
|
102
84
|
|
|
103
|
-
//
|
|
104
|
-
|
|
85
|
+
// Initialise the WASM module
|
|
86
|
+
await init();
|
|
105
87
|
|
|
106
|
-
//
|
|
107
|
-
const
|
|
108
|
-
/* ... UnsignedTransactionV1 fields ... */
|
|
109
|
-
};
|
|
88
|
+
// Generate a keypair
|
|
89
|
+
const { secret_key, public_key } = generateKeypair();
|
|
110
90
|
|
|
111
|
-
//
|
|
112
|
-
const
|
|
91
|
+
// Hash an unsigned transaction for signing
|
|
92
|
+
const unsignedTxJson = JSON.stringify(unsignedTransaction);
|
|
93
|
+
const hash = hashUnsignedTransaction(unsignedTxJson, sealSignerPublicKeyHex);
|
|
113
94
|
|
|
114
|
-
//
|
|
95
|
+
// Sign the hash
|
|
115
96
|
const { public_nonce, signature } = schnorrSign(secret_key, hash);
|
|
116
|
-
|
|
117
|
-
// 5. Assemble the signed transaction and BOR-encode
|
|
118
|
-
const signedTx = {
|
|
119
|
-
/* ... Transaction with signature attached ... */
|
|
120
|
-
};
|
|
121
|
-
const envelope = borEncodeTransaction(JSON.stringify(signedTx));
|
|
122
|
-
|
|
123
|
-
// 6. Submit envelope to the Ootle network
|
|
124
97
|
```
|
|
125
|
-
|
|
126
|
-
## License
|
|
127
|
-
|
|
128
|
-
BSD-3-Clause
|
|
@@ -3,7 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export class DecryptedOutputResult {
|
|
5
5
|
static __wrap(ptr) {
|
|
6
|
-
ptr = ptr >>> 0;
|
|
7
6
|
const obj = Object.create(DecryptedOutputResult.prototype);
|
|
8
7
|
obj.__wbg_ptr = ptr;
|
|
9
8
|
DecryptedOutputResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -38,7 +37,7 @@ export class DecryptedOutputResult {
|
|
|
38
37
|
const ret = wasm.__wbg_get_decryptedoutputresult_memo_json(this.__wbg_ptr);
|
|
39
38
|
let v1;
|
|
40
39
|
if (ret[0] !== 0) {
|
|
41
|
-
v1 = getStringFromWasm0(ret[0], ret[1])
|
|
40
|
+
v1 = getStringFromWasm0(ret[0], ret[1]);
|
|
42
41
|
wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
|
|
43
42
|
}
|
|
44
43
|
return v1;
|
|
@@ -85,7 +84,6 @@ if (Symbol.dispose) DecryptedOutputResult.prototype[Symbol.dispose] = DecryptedO
|
|
|
85
84
|
*/
|
|
86
85
|
export class KeypairResult {
|
|
87
86
|
static __wrap(ptr) {
|
|
88
|
-
ptr = ptr >>> 0;
|
|
89
87
|
const obj = Object.create(KeypairResult.prototype);
|
|
90
88
|
obj.__wbg_ptr = ptr;
|
|
91
89
|
KeypairResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -143,7 +141,6 @@ if (Symbol.dispose) KeypairResult.prototype[Symbol.dispose] = KeypairResult.prot
|
|
|
143
141
|
*/
|
|
144
142
|
export class OotlePublicKey {
|
|
145
143
|
static __wrap(ptr) {
|
|
146
|
-
ptr = ptr >>> 0;
|
|
147
144
|
const obj = Object.create(OotlePublicKey.prototype);
|
|
148
145
|
obj.__wbg_ptr = ptr;
|
|
149
146
|
OotlePublicKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -186,7 +183,7 @@ export class OotlePublicKey {
|
|
|
186
183
|
set owner_key(arg0) {
|
|
187
184
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
188
185
|
const len0 = WASM_VECTOR_LEN;
|
|
189
|
-
wasm.
|
|
186
|
+
wasm.__wbg_set_ootlepublickey_owner_key(this.__wbg_ptr, ptr0, len0);
|
|
190
187
|
}
|
|
191
188
|
/**
|
|
192
189
|
* The view-only public key bytes.
|
|
@@ -195,7 +192,7 @@ export class OotlePublicKey {
|
|
|
195
192
|
set view_key(arg0) {
|
|
196
193
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
197
194
|
const len0 = WASM_VECTOR_LEN;
|
|
198
|
-
wasm.
|
|
195
|
+
wasm.__wbg_set_ootlepublickey_view_key(this.__wbg_ptr, ptr0, len0);
|
|
199
196
|
}
|
|
200
197
|
}
|
|
201
198
|
if (Symbol.dispose) OotlePublicKey.prototype[Symbol.dispose] = OotlePublicKey.prototype.free;
|
|
@@ -205,7 +202,6 @@ if (Symbol.dispose) OotlePublicKey.prototype[Symbol.dispose] = OotlePublicKey.pr
|
|
|
205
202
|
*/
|
|
206
203
|
export class OotleSecretKey {
|
|
207
204
|
static __wrap(ptr) {
|
|
208
|
-
ptr = ptr >>> 0;
|
|
209
205
|
const obj = Object.create(OotleSecretKey.prototype);
|
|
210
206
|
obj.__wbg_ptr = ptr;
|
|
211
207
|
OotleSecretKeyFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -248,7 +244,7 @@ export class OotleSecretKey {
|
|
|
248
244
|
set owner_key(arg0) {
|
|
249
245
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
250
246
|
const len0 = WASM_VECTOR_LEN;
|
|
251
|
-
wasm.
|
|
247
|
+
wasm.__wbg_set_ootlesecretkey_owner_key(this.__wbg_ptr, ptr0, len0);
|
|
252
248
|
}
|
|
253
249
|
/**
|
|
254
250
|
* The view-only secret key bytes.
|
|
@@ -257,7 +253,7 @@ export class OotleSecretKey {
|
|
|
257
253
|
set view_key(arg0) {
|
|
258
254
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
259
255
|
const len0 = WASM_VECTOR_LEN;
|
|
260
|
-
wasm.
|
|
256
|
+
wasm.__wbg_set_ootlesecretkey_view_key(this.__wbg_ptr, ptr0, len0);
|
|
261
257
|
}
|
|
262
258
|
}
|
|
263
259
|
if (Symbol.dispose) OotleSecretKey.prototype[Symbol.dispose] = OotleSecretKey.prototype.free;
|
|
@@ -267,7 +263,6 @@ if (Symbol.dispose) OotleSecretKey.prototype[Symbol.dispose] = OotleSecretKey.pr
|
|
|
267
263
|
*/
|
|
268
264
|
export class ParsedOotleAddress {
|
|
269
265
|
static __wrap(ptr) {
|
|
270
|
-
ptr = ptr >>> 0;
|
|
271
266
|
const obj = Object.create(ParsedOotleAddress.prototype);
|
|
272
267
|
obj.__wbg_ptr = ptr;
|
|
273
268
|
ParsedOotleAddressFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -347,7 +342,7 @@ export class ParsedOotleAddress {
|
|
|
347
342
|
set owner_key(arg0) {
|
|
348
343
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
349
344
|
const len0 = WASM_VECTOR_LEN;
|
|
350
|
-
wasm.
|
|
345
|
+
wasm.__wbg_set_parsedootleaddress_owner_key(this.__wbg_ptr, ptr0, len0);
|
|
351
346
|
}
|
|
352
347
|
/**
|
|
353
348
|
* The view-only public key bytes.
|
|
@@ -356,7 +351,7 @@ export class ParsedOotleAddress {
|
|
|
356
351
|
set view_key(arg0) {
|
|
357
352
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
358
353
|
const len0 = WASM_VECTOR_LEN;
|
|
359
|
-
wasm.
|
|
354
|
+
wasm.__wbg_set_parsedootleaddress_view_key(this.__wbg_ptr, ptr0, len0);
|
|
360
355
|
}
|
|
361
356
|
}
|
|
362
357
|
if (Symbol.dispose) ParsedOotleAddress.prototype[Symbol.dispose] = ParsedOotleAddress.prototype.free;
|
|
@@ -367,7 +362,6 @@ if (Symbol.dispose) ParsedOotleAddress.prototype[Symbol.dispose] = ParsedOotleAd
|
|
|
367
362
|
*/
|
|
368
363
|
export class SchnorrSignatureResult {
|
|
369
364
|
static __wrap(ptr) {
|
|
370
|
-
ptr = ptr >>> 0;
|
|
371
365
|
const obj = Object.create(SchnorrSignatureResult.prototype);
|
|
372
366
|
obj.__wbg_ptr = ptr;
|
|
373
367
|
SchnorrSignatureResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -407,7 +401,7 @@ export class SchnorrSignatureResult {
|
|
|
407
401
|
set public_nonce(arg0) {
|
|
408
402
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
409
403
|
const len0 = WASM_VECTOR_LEN;
|
|
410
|
-
wasm.
|
|
404
|
+
wasm.__wbg_set_schnorrsignatureresult_public_nonce(this.__wbg_ptr, ptr0, len0);
|
|
411
405
|
}
|
|
412
406
|
/**
|
|
413
407
|
* @param {Uint8Array} arg0
|
|
@@ -415,7 +409,7 @@ export class SchnorrSignatureResult {
|
|
|
415
409
|
set signature(arg0) {
|
|
416
410
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
417
411
|
const len0 = WASM_VECTOR_LEN;
|
|
418
|
-
wasm.
|
|
412
|
+
wasm.__wbg_set_schnorrsignatureresult_signature(this.__wbg_ptr, ptr0, len0);
|
|
419
413
|
}
|
|
420
414
|
}
|
|
421
415
|
if (Symbol.dispose) SchnorrSignatureResult.prototype[Symbol.dispose] = SchnorrSignatureResult.prototype.free;
|
|
@@ -425,7 +419,6 @@ if (Symbol.dispose) SchnorrSignatureResult.prototype[Symbol.dispose] = SchnorrSi
|
|
|
425
419
|
*/
|
|
426
420
|
export class StealthOutputsResult {
|
|
427
421
|
static __wrap(ptr) {
|
|
428
|
-
ptr = ptr >>> 0;
|
|
429
422
|
const obj = Object.create(StealthOutputsResult.prototype);
|
|
430
423
|
obj.__wbg_ptr = ptr;
|
|
431
424
|
StealthOutputsResultFinalization.register(obj, obj.__wbg_ptr, obj);
|
|
@@ -476,7 +469,7 @@ export class StealthOutputsResult {
|
|
|
476
469
|
set aggregated_output_mask(arg0) {
|
|
477
470
|
const ptr0 = passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
|
|
478
471
|
const len0 = WASM_VECTOR_LEN;
|
|
479
|
-
wasm.
|
|
472
|
+
wasm.__wbg_set_stealthoutputsresult_aggregated_output_mask(this.__wbg_ptr, ptr0, len0);
|
|
480
473
|
}
|
|
481
474
|
/**
|
|
482
475
|
* JSON-serialized `StealthOutputsStatement` (the wire-format payload).
|
|
@@ -485,7 +478,7 @@ export class StealthOutputsResult {
|
|
|
485
478
|
set statement_json(arg0) {
|
|
486
479
|
const ptr0 = passStringToWasm0(arg0, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
|
|
487
480
|
const len0 = WASM_VECTOR_LEN;
|
|
488
|
-
wasm.
|
|
481
|
+
wasm.__wbg_set_stealthoutputsresult_statement_json(this.__wbg_ptr, ptr0, len0);
|
|
489
482
|
}
|
|
490
483
|
}
|
|
491
484
|
if (Symbol.dispose) StealthOutputsResult.prototype[Symbol.dispose] = StealthOutputsResult.prototype.free;
|
|
@@ -1321,14 +1314,14 @@ export function validateStealthTransfer(transfer_json, view_key) {
|
|
|
1321
1314
|
throw takeFromExternrefTable0(ret[0]);
|
|
1322
1315
|
}
|
|
1323
1316
|
}
|
|
1324
|
-
export function
|
|
1317
|
+
export function __wbg_Error_67e7344beaa85059(arg0, arg1) {
|
|
1325
1318
|
const ret = Error(getStringFromWasm0(arg0, arg1));
|
|
1326
1319
|
return ret;
|
|
1327
1320
|
}
|
|
1328
|
-
export function
|
|
1321
|
+
export function __wbg___wbindgen_throw_5d9e815e6fdf150f(arg0, arg1) {
|
|
1329
1322
|
throw new Error(getStringFromWasm0(arg0, arg1));
|
|
1330
1323
|
}
|
|
1331
|
-
export function
|
|
1324
|
+
export function __wbg_getRandomValues_47873ea553f6780e() { return handleError(function (arg0, arg1) {
|
|
1332
1325
|
globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
|
|
1333
1326
|
}, arguments); }
|
|
1334
1327
|
export function __wbindgen_init_externref_table() {
|
|
@@ -1342,25 +1335,25 @@ export function __wbindgen_init_externref_table() {
|
|
|
1342
1335
|
}
|
|
1343
1336
|
const DecryptedOutputResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1344
1337
|
? { register: () => {}, unregister: () => {} }
|
|
1345
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_decryptedoutputresult_free(ptr
|
|
1338
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_decryptedoutputresult_free(ptr, 1));
|
|
1346
1339
|
const KeypairResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1347
1340
|
? { register: () => {}, unregister: () => {} }
|
|
1348
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_keypairresult_free(ptr
|
|
1341
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_keypairresult_free(ptr, 1));
|
|
1349
1342
|
const OotlePublicKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1350
1343
|
? { register: () => {}, unregister: () => {} }
|
|
1351
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_ootlepublickey_free(ptr
|
|
1344
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ootlepublickey_free(ptr, 1));
|
|
1352
1345
|
const OotleSecretKeyFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1353
1346
|
? { register: () => {}, unregister: () => {} }
|
|
1354
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_ootlesecretkey_free(ptr
|
|
1347
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_ootlesecretkey_free(ptr, 1));
|
|
1355
1348
|
const ParsedOotleAddressFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1356
1349
|
? { register: () => {}, unregister: () => {} }
|
|
1357
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_parsedootleaddress_free(ptr
|
|
1350
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_parsedootleaddress_free(ptr, 1));
|
|
1358
1351
|
const SchnorrSignatureResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1359
1352
|
? { register: () => {}, unregister: () => {} }
|
|
1360
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_schnorrsignatureresult_free(ptr
|
|
1353
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_schnorrsignatureresult_free(ptr, 1));
|
|
1361
1354
|
const StealthOutputsResultFinalization = (typeof FinalizationRegistry === 'undefined')
|
|
1362
1355
|
? { register: () => {}, unregister: () => {} }
|
|
1363
|
-
: new FinalizationRegistry(ptr => wasm.__wbg_stealthoutputsresult_free(ptr
|
|
1356
|
+
: new FinalizationRegistry(ptr => wasm.__wbg_stealthoutputsresult_free(ptr, 1));
|
|
1364
1357
|
|
|
1365
1358
|
function addToExternrefTable0(obj) {
|
|
1366
1359
|
const idx = wasm.__externref_table_alloc();
|
|
@@ -1374,8 +1367,7 @@ function getArrayU8FromWasm0(ptr, len) {
|
|
|
1374
1367
|
}
|
|
1375
1368
|
|
|
1376
1369
|
function getStringFromWasm0(ptr, len) {
|
|
1377
|
-
|
|
1378
|
-
return decodeText(ptr, len);
|
|
1370
|
+
return decodeText(ptr >>> 0, len);
|
|
1379
1371
|
}
|
|
1380
1372
|
|
|
1381
1373
|
let cachedUint8ArrayMemory0 = null;
|
|
Binary file
|
|
@@ -5,9 +5,19 @@ export const __wbg_decryptedoutputresult_free: (a: number, b: number) => void;
|
|
|
5
5
|
export const __wbg_get_decryptedoutputresult_mask: (a: number) => [number, number];
|
|
6
6
|
export const __wbg_get_decryptedoutputresult_memo_json: (a: number) => [number, number];
|
|
7
7
|
export const __wbg_get_decryptedoutputresult_value: (a: number) => bigint;
|
|
8
|
+
export const __wbg_get_keypairresult_public_key: (a: number) => [number, number];
|
|
8
9
|
export const __wbg_get_keypairresult_secret_key: (a: number) => [number, number];
|
|
10
|
+
export const __wbg_get_ootlepublickey_owner_key: (a: number) => [number, number];
|
|
11
|
+
export const __wbg_get_ootlepublickey_view_key: (a: number) => [number, number];
|
|
12
|
+
export const __wbg_get_ootlesecretkey_owner_key: (a: number) => [number, number];
|
|
13
|
+
export const __wbg_get_ootlesecretkey_view_key: (a: number) => [number, number];
|
|
9
14
|
export const __wbg_get_parsedootleaddress_memo: (a: number) => [number, number];
|
|
10
15
|
export const __wbg_get_parsedootleaddress_network: (a: number) => number;
|
|
16
|
+
export const __wbg_get_parsedootleaddress_owner_key: (a: number) => [number, number];
|
|
17
|
+
export const __wbg_get_parsedootleaddress_view_key: (a: number) => [number, number];
|
|
18
|
+
export const __wbg_get_schnorrsignatureresult_public_nonce: (a: number) => [number, number];
|
|
19
|
+
export const __wbg_get_schnorrsignatureresult_signature: (a: number) => [number, number];
|
|
20
|
+
export const __wbg_get_stealthoutputsresult_aggregated_output_mask: (a: number) => [number, number];
|
|
11
21
|
export const __wbg_get_stealthoutputsresult_statement_json: (a: number) => [number, number];
|
|
12
22
|
export const __wbg_keypairresult_free: (a: number, b: number) => void;
|
|
13
23
|
export const __wbg_ootlepublickey_free: (a: number, b: number) => void;
|
|
@@ -19,8 +29,18 @@ export const __wbg_set_decryptedoutputresult_memo_json: (a: number, b: number, c
|
|
|
19
29
|
export const __wbg_set_decryptedoutputresult_value: (a: number, b: bigint) => void;
|
|
20
30
|
export const __wbg_set_keypairresult_public_key: (a: number, b: number, c: number) => void;
|
|
21
31
|
export const __wbg_set_keypairresult_secret_key: (a: number, b: number, c: number) => void;
|
|
32
|
+
export const __wbg_set_ootlepublickey_owner_key: (a: number, b: number, c: number) => void;
|
|
33
|
+
export const __wbg_set_ootlepublickey_view_key: (a: number, b: number, c: number) => void;
|
|
34
|
+
export const __wbg_set_ootlesecretkey_owner_key: (a: number, b: number, c: number) => void;
|
|
35
|
+
export const __wbg_set_ootlesecretkey_view_key: (a: number, b: number, c: number) => void;
|
|
22
36
|
export const __wbg_set_parsedootleaddress_memo: (a: number, b: number, c: number) => void;
|
|
23
37
|
export const __wbg_set_parsedootleaddress_network: (a: number, b: number) => void;
|
|
38
|
+
export const __wbg_set_parsedootleaddress_owner_key: (a: number, b: number, c: number) => void;
|
|
39
|
+
export const __wbg_set_parsedootleaddress_view_key: (a: number, b: number, c: number) => void;
|
|
40
|
+
export const __wbg_set_schnorrsignatureresult_public_nonce: (a: number, b: number, c: number) => void;
|
|
41
|
+
export const __wbg_set_schnorrsignatureresult_signature: (a: number, b: number, c: number) => void;
|
|
42
|
+
export const __wbg_set_stealthoutputsresult_aggregated_output_mask: (a: number, b: number, c: number) => void;
|
|
43
|
+
export const __wbg_set_stealthoutputsresult_statement_json: (a: number, b: number, c: number) => void;
|
|
24
44
|
export const __wbg_stealthoutputsresult_free: (a: number, b: number) => void;
|
|
25
45
|
export const addTransactionSigner: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
|
|
26
46
|
export const aggregateInputMasks: (a: number, b: number) => [number, number, number, number];
|
|
@@ -51,26 +71,6 @@ export const stealthDhSecret: (a: number, b: number, c: number, d: number, e: nu
|
|
|
51
71
|
export const unblindOutput: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
|
|
52
72
|
export const validateBalanceProofSignature: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number];
|
|
53
73
|
export const validateStealthTransfer: (a: number, b: number, c: number, d: number) => [number, number];
|
|
54
|
-
export const __wbg_get_keypairresult_public_key: (a: number) => [number, number];
|
|
55
|
-
export const __wbg_get_ootlepublickey_owner_key: (a: number) => [number, number];
|
|
56
|
-
export const __wbg_get_ootlepublickey_view_key: (a: number) => [number, number];
|
|
57
|
-
export const __wbg_get_ootlesecretkey_owner_key: (a: number) => [number, number];
|
|
58
|
-
export const __wbg_get_ootlesecretkey_view_key: (a: number) => [number, number];
|
|
59
|
-
export const __wbg_get_parsedootleaddress_owner_key: (a: number) => [number, number];
|
|
60
|
-
export const __wbg_get_parsedootleaddress_view_key: (a: number) => [number, number];
|
|
61
|
-
export const __wbg_get_schnorrsignatureresult_public_nonce: (a: number) => [number, number];
|
|
62
|
-
export const __wbg_get_schnorrsignatureresult_signature: (a: number) => [number, number];
|
|
63
|
-
export const __wbg_get_stealthoutputsresult_aggregated_output_mask: (a: number) => [number, number];
|
|
64
|
-
export const __wbg_set_ootlepublickey_owner_key: (a: number, b: number, c: number) => void;
|
|
65
|
-
export const __wbg_set_ootlepublickey_view_key: (a: number, b: number, c: number) => void;
|
|
66
|
-
export const __wbg_set_ootlesecretkey_owner_key: (a: number, b: number, c: number) => void;
|
|
67
|
-
export const __wbg_set_ootlesecretkey_view_key: (a: number, b: number, c: number) => void;
|
|
68
|
-
export const __wbg_set_parsedootleaddress_owner_key: (a: number, b: number, c: number) => void;
|
|
69
|
-
export const __wbg_set_parsedootleaddress_view_key: (a: number, b: number, c: number) => void;
|
|
70
|
-
export const __wbg_set_schnorrsignatureresult_public_nonce: (a: number, b: number, c: number) => void;
|
|
71
|
-
export const __wbg_set_schnorrsignatureresult_signature: (a: number, b: number, c: number) => void;
|
|
72
|
-
export const __wbg_set_stealthoutputsresult_aggregated_output_mask: (a: number, b: number, c: number) => void;
|
|
73
|
-
export const __wbg_set_stealthoutputsresult_statement_json: (a: number, b: number, c: number) => void;
|
|
74
74
|
export const tari_free: (a: number) => void;
|
|
75
75
|
export const tari_alloc: (a: number) => number;
|
|
76
76
|
export const __wbindgen_exn_store: (a: number) => void;
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
"collaborators": [
|
|
5
5
|
"The Tari Development Community"
|
|
6
6
|
],
|
|
7
|
-
"description": "WASM bindings for Tari Ootle client-side crypto — thin wasm-bindgen shell over ootle-wasm-core. LOCAL VENDOR PATCH: adds createConfidentialWithdrawProofLiteral, built from tari-dan crates/ootle_wasm at commit
|
|
8
|
-
"version": "0.
|
|
7
|
+
"description": "WASM bindings for Tari Ootle client-side crypto — thin wasm-bindgen shell over ootle-wasm-core. LOCAL VENDOR PATCH: adds createConfidentialWithdrawProofLiteral, built from tari-dan crates/ootle_wasm at commit ac73128 (v0.41.0, esmeralda V1 activation) plus the confidential.rs module added on top -- not yet in an upstream release.",
|
|
8
|
+
"version": "0.41.0",
|
|
9
9
|
"license": "BSD-3-Clause",
|
|
10
10
|
"repository": {
|
|
11
11
|
"type": "git",
|
|
@@ -18,6 +18,9 @@
|
|
|
18
18
|
"ootle_wasm.d.ts",
|
|
19
19
|
"README.md"
|
|
20
20
|
],
|
|
21
|
+
"publishConfig": {
|
|
22
|
+
"access": "public"
|
|
23
|
+
},
|
|
21
24
|
"main": "ootle_wasm.js",
|
|
22
25
|
"types": "ootle_wasm.d.ts",
|
|
23
26
|
"sideEffects": [
|