@chironbuilder/ootle-sdk 0.1.30 → 0.2.1

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.
Files changed (30) hide show
  1. package/dist/bucketStealthTransfer.d.ts +12 -0
  2. package/dist/bucketStealthTransfer.d.ts.map +1 -0
  3. package/dist/bucketStealthTransfer.js +57 -0
  4. package/dist/indexerDecode.d.ts +23 -0
  5. package/dist/indexerDecode.d.ts.map +1 -0
  6. package/dist/indexerDecode.js +68 -0
  7. package/dist/utxoScan.d.ts +24 -39
  8. package/dist/utxoScan.d.ts.map +1 -1
  9. package/dist/utxoScan.js +136 -133
  10. package/dist/wallet.d.ts +16 -9
  11. package/dist/wallet.d.ts.map +1 -1
  12. package/dist/wallet.js +102 -71
  13. package/package.json +8 -8
  14. package/vendor/ootle-wasm-patched/chiron-0.49.2.patch +199 -0
  15. package/vendor/ootle-wasm-patched/ootle_wasm.d.ts +53 -35
  16. package/vendor/ootle-wasm-patched/ootle_wasm.js +1 -1
  17. package/vendor/ootle-wasm-patched/ootle_wasm_bg.js +158 -45
  18. package/vendor/ootle-wasm-patched/ootle_wasm_bg.wasm +0 -0
  19. package/vendor/ootle-wasm-patched/ootle_wasm_bg.wasm.d.ts +15 -12
  20. package/vendor/ootle-wasm-patched/package.json +3 -3
  21. package/vendor/ootle-patched/README.md +0 -67
  22. package/vendor/ootle-patched/dist/index.d.ts +0 -2158
  23. package/vendor/ootle-patched/dist/index.js +0 -1389
  24. package/vendor/ootle-patched/node_modules/@tari-project/ootle-wasm/README.md +0 -128
  25. package/vendor/ootle-patched/node_modules/@tari-project/ootle-wasm/ootle_wasm.d.ts +0 -436
  26. package/vendor/ootle-patched/node_modules/@tari-project/ootle-wasm/ootle_wasm.js +0 -9
  27. package/vendor/ootle-patched/node_modules/@tari-project/ootle-wasm/ootle_wasm_bg.js +0 -1450
  28. package/vendor/ootle-patched/node_modules/@tari-project/ootle-wasm/ootle_wasm_bg.wasm +0 -0
  29. package/vendor/ootle-patched/node_modules/@tari-project/ootle-wasm/package.json +0 -30
  30. package/vendor/ootle-patched/package.json +0 -23
@@ -29,7 +29,7 @@ export class DecryptedOutputResult {
29
29
  return v1;
30
30
  }
31
31
  /**
32
- * JSON-encoded `Memo` (variants: `U256` / `Message` / `Bytes` / `PayRefAndBytes`), or `null` if
32
+ * JSON-encoded `Memo` (variants: `U256` / `Message` / `Bytes` / `DestinationTagAndBytes`), or `null` if
33
33
  * the payload carried no memo or `skipMemo` was set.
34
34
  * @returns {string | undefined}
35
35
  */
@@ -60,7 +60,7 @@ export class DecryptedOutputResult {
60
60
  wasm.__wbg_set_decryptedoutputresult_mask(this.__wbg_ptr, ptr0, len0);
61
61
  }
62
62
  /**
63
- * JSON-encoded `Memo` (variants: `U256` / `Message` / `Bytes` / `PayRefAndBytes`), or `null` if
63
+ * JSON-encoded `Memo` (variants: `U256` / `Message` / `Bytes` / `DestinationTagAndBytes`), or `null` if
64
64
  * the payload carried no memo or `skipMemo` was set.
65
65
  * @param {string | null} [arg0]
66
66
  */
@@ -279,11 +279,11 @@ export class ParsedOotleAddress {
279
279
  wasm.__wbg_parsedootleaddress_free(ptr, 0);
280
280
  }
281
281
  /**
282
- * Optional pay reference / memo bytes.
282
+ * Optional destination tag bytes.
283
283
  * @returns {Uint8Array | undefined}
284
284
  */
285
- get memo() {
286
- const ret = wasm.__wbg_get_parsedootleaddress_memo(this.__wbg_ptr);
285
+ get destination_tag() {
286
+ const ret = wasm.__wbg_get_parsedootleaddress_destination_tag(this.__wbg_ptr);
287
287
  let v1;
288
288
  if (ret[0] !== 0) {
289
289
  v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
@@ -320,13 +320,13 @@ export class ParsedOotleAddress {
320
320
  return v1;
321
321
  }
322
322
  /**
323
- * Optional pay reference / memo bytes.
323
+ * Optional destination tag bytes.
324
324
  * @param {Uint8Array | null} [arg0]
325
325
  */
326
- set memo(arg0) {
326
+ set destination_tag(arg0) {
327
327
  var ptr0 = isLikeNone(arg0) ? 0 : passArray8ToWasm0(arg0, wasm.__wbindgen_malloc);
328
328
  var len0 = WASM_VECTOR_LEN;
329
- wasm.__wbg_set_parsedootleaddress_memo(this.__wbg_ptr, ptr0, len0);
329
+ wasm.__wbg_set_parsedootleaddress_destination_tag(this.__wbg_ptr, ptr0, len0);
330
330
  }
331
331
  /**
332
332
  * The network byte.
@@ -542,6 +542,84 @@ export function aggregateInputMasks(masks_concat) {
542
542
  return v2;
543
543
  }
544
544
 
545
+ /**
546
+ * Seal a transaction (unsigned or unsealed JSON) with a signature from an external signer (HSM, MPC).
547
+ *
548
+ * `signature` is the 64-byte sr25519 signature (scheme in the NPM README) over the hash from
549
+ * `hashUnsealedTransaction`, made by the key for `seal_signer_public_key`. The seal and any
550
+ * authorization signatures are verified.
551
+ * Returns the sealed `Transaction` as a JSON string.
552
+ * @param {string} tx_json
553
+ * @param {Uint8Array} seal_signer_public_key
554
+ * @param {Uint8Array} signature
555
+ * @returns {string}
556
+ */
557
+ export function attachSealSignature(tx_json, seal_signer_public_key, signature) {
558
+ let deferred5_0;
559
+ let deferred5_1;
560
+ try {
561
+ const ptr0 = passStringToWasm0(tx_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
562
+ const len0 = WASM_VECTOR_LEN;
563
+ const ptr1 = passArray8ToWasm0(seal_signer_public_key, wasm.__wbindgen_malloc);
564
+ const len1 = WASM_VECTOR_LEN;
565
+ const ptr2 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
566
+ const len2 = WASM_VECTOR_LEN;
567
+ const ret = wasm.attachSealSignature(ptr0, len0, ptr1, len1, ptr2, len2);
568
+ var ptr4 = ret[0];
569
+ var len4 = ret[1];
570
+ if (ret[3]) {
571
+ ptr4 = 0; len4 = 0;
572
+ throw takeFromExternrefTable0(ret[2]);
573
+ }
574
+ deferred5_0 = ptr4;
575
+ deferred5_1 = len4;
576
+ return getStringFromWasm0(ptr4, len4);
577
+ } finally {
578
+ wasm.__wbindgen_free(deferred5_0, deferred5_1, 1);
579
+ }
580
+ }
581
+
582
+ /**
583
+ * Add an authorization signature from an external signer (HSM, MPC) to a transaction (unsigned or
584
+ * unsealed JSON).
585
+ *
586
+ * `signature` is the 64-byte sr25519 signature (scheme in the NPM README) over the hash from
587
+ * `hashUnsignedTransaction` for `seal_signer_public_key`, made by the key for
588
+ * `signer_public_key`. It is verified before it is appended.
589
+ * Returns the `UnsealedTransactionV1` (with the new signature appended) as a JSON string.
590
+ * @param {string} tx_json
591
+ * @param {Uint8Array} signer_public_key
592
+ * @param {Uint8Array} signature
593
+ * @param {Uint8Array} seal_signer_public_key
594
+ * @returns {string}
595
+ */
596
+ export function attachTransactionSignature(tx_json, signer_public_key, signature, seal_signer_public_key) {
597
+ let deferred6_0;
598
+ let deferred6_1;
599
+ try {
600
+ const ptr0 = passStringToWasm0(tx_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
601
+ const len0 = WASM_VECTOR_LEN;
602
+ const ptr1 = passArray8ToWasm0(signer_public_key, wasm.__wbindgen_malloc);
603
+ const len1 = WASM_VECTOR_LEN;
604
+ const ptr2 = passArray8ToWasm0(signature, wasm.__wbindgen_malloc);
605
+ const len2 = WASM_VECTOR_LEN;
606
+ const ptr3 = passArray8ToWasm0(seal_signer_public_key, wasm.__wbindgen_malloc);
607
+ const len3 = WASM_VECTOR_LEN;
608
+ const ret = wasm.attachTransactionSignature(ptr0, len0, ptr1, len1, ptr2, len2, ptr3, len3);
609
+ var ptr5 = ret[0];
610
+ var len5 = ret[1];
611
+ if (ret[3]) {
612
+ ptr5 = 0; len5 = 0;
613
+ throw takeFromExternrefTable0(ret[2]);
614
+ }
615
+ deferred6_0 = ptr5;
616
+ deferred6_1 = len5;
617
+ return getStringFromWasm0(ptr5, len5);
618
+ } finally {
619
+ wasm.__wbindgen_free(deferred6_0, deferred6_1, 1);
620
+ }
621
+ }
622
+
545
623
  /**
546
624
  * BOR-encode a Transaction (JSON string) → base64 string (TransactionEnvelope format).
547
625
  * @param {string} transaction_json
@@ -652,10 +730,9 @@ export function buildStealthInputsStatement(input_commitments, revealed_amount_m
652
730
  * this accepts a caller-supplied `witness` per input -- the only way to spend an output committed with
653
731
  * `PayTo::Conditions` (e.g. claiming or refunding an HTLC-style hashlock/timelock output). Build each
654
732
  * script-path input's witness with `buildScriptPathWitness` first; a plain key-path input can still be
655
- * included in the same call, either with `"witness":"KeyPath"` or by omitting `witness` entirely
656
- * (defaults to key path).
733
+ * included in the same call with `"witness":"KeyPath"`.
657
734
  *
658
- * `inputs_json` shape: `[{ "commitment": <hex 32 bytes>, "witness"?: <SpendWitness> }, ...]`.
735
+ * `inputs_json` shape: `[{ "commitment": <hex 32 bytes>, "witness": <SpendWitness> }, ...]`.
659
736
  * @param {string} inputs_json
660
737
  * @param {bigint} revealed_amount_microtari
661
738
  * @returns {string}
@@ -755,20 +832,9 @@ export function burnClaimStealthSecret(account_secret, sender_offset_public_key)
755
832
  }
756
833
 
757
834
  /**
758
- * Builds a `ConfidentialWithdrawProof` for the Account template's `withdraw_confidential` /
759
- * `join_confidential` methods, and returns it `tari_bor`-encoded -- ready to hex-encode and wrap
760
- * as an instruction `Literal` arg exactly like `microTariLiteral`/`amountLiteral` do for simpler
761
- * types. Unlike those, this is NOT re-encoded on the JS side: the bytes are already the encoding
762
- * the chain itself decodes, produced by the same derive-generated `Encode` impl.
763
- *
764
- * `inputs_json` is a JSON array of `{ value, mask }` for each confidential UTXO being spent — `"[]"`
765
- * for a revealed-only withdrawal (depositing into the vault). `output_json` / `change_json` are each
766
- * an optional JSON object (see `createStealthOutputWitness`'s `OutputWitnessJson` shape) — omit to
767
- * skip that side. `*_revealed_amount` is the plaintext portion on each side; confidential and
768
- * revealed amounts can be mixed on either side.
769
- *
770
- * Throws if `inputs_json`/`output_json`/`change_json` don't parse, or if any mask isn't a valid
771
- * 32-byte Ristretto scalar.
835
+ * tari_bor-encoded `ConfidentialWithdrawProof` (the bytes the chain decodes), for use as an
836
+ * instruction `Literal` argument. `inputs_json` is a JSON array of `{ value, mask }`;
837
+ * `output_json` / `change_json` are optional `OutputWitnessJson` objects.
772
838
  * @param {string} inputs_json
773
839
  * @param {bigint} input_revealed_amount
774
840
  * @param {string | null | undefined} output_json
@@ -997,14 +1063,14 @@ export function generateKeypair() {
997
1063
  * Generate an Ootle address (bech32m string) from public keys.
998
1064
  *
999
1065
  * `network` is the network byte (0x00 = MainNet, 0x10 = LocalNet, 0x26 = Esmeralda, etc.).
1000
- * `memo` is an optional pay reference (max 64 bytes).
1066
+ * `destination_tag` is optional (max 64 bytes).
1001
1067
  * @param {Uint8Array} owner_public_key
1002
1068
  * @param {Uint8Array} view_public_key
1003
1069
  * @param {number} network
1004
- * @param {Uint8Array | null} [memo]
1070
+ * @param {Uint8Array | null} [destination_tag]
1005
1071
  * @returns {string}
1006
1072
  */
1007
- export function generateOotleAddress(owner_public_key, view_public_key, network, memo) {
1073
+ export function generateOotleAddress(owner_public_key, view_public_key, network, destination_tag) {
1008
1074
  let deferred5_0;
1009
1075
  let deferred5_1;
1010
1076
  try {
@@ -1012,7 +1078,7 @@ export function generateOotleAddress(owner_public_key, view_public_key, network,
1012
1078
  const len0 = WASM_VECTOR_LEN;
1013
1079
  const ptr1 = passArray8ToWasm0(view_public_key, wasm.__wbindgen_malloc);
1014
1080
  const len1 = WASM_VECTOR_LEN;
1015
- var ptr2 = isLikeNone(memo) ? 0 : passArray8ToWasm0(memo, wasm.__wbindgen_malloc);
1081
+ var ptr2 = isLikeNone(destination_tag) ? 0 : passArray8ToWasm0(destination_tag, wasm.__wbindgen_malloc);
1016
1082
  var len2 = WASM_VECTOR_LEN;
1017
1083
  const ret = wasm.generateOotleAddress(ptr0, len0, ptr1, len1, network, ptr2, len2);
1018
1084
  var ptr4 = ret[0];
@@ -1111,8 +1177,30 @@ export function generateStealthOutputsStatement(witnesses_json, revealed_output_
1111
1177
  }
1112
1178
 
1113
1179
  /**
1114
- * Hash an UnsignedTransactionV1 (JSON string) for signing.
1115
- * Returns the 64-byte signing message that must be Schnorr-signed.
1180
+ * Hash a transaction (unsigned or unsealed JSON) for sealing.
1181
+ * Returns the 64-byte seal message that the seal signer must sign.
1182
+ *
1183
+ * The seal message covers every authorization signature, so attach all of them before hashing.
1184
+ * @param {string} tx_json
1185
+ * @returns {Uint8Array}
1186
+ */
1187
+ export function hashUnsealedTransaction(tx_json) {
1188
+ const ptr0 = passStringToWasm0(tx_json, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1189
+ const len0 = WASM_VECTOR_LEN;
1190
+ const ret = wasm.hashUnsealedTransaction(ptr0, len0);
1191
+ if (ret[3]) {
1192
+ throw takeFromExternrefTable0(ret[2]);
1193
+ }
1194
+ var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1195
+ wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1196
+ return v2;
1197
+ }
1198
+
1199
+ /**
1200
+ * Hash a transaction (unsigned or unsealed JSON) for an authorization signature.
1201
+ * Returns the 64-byte signing message that must be sr25519-signed.
1202
+ *
1203
+ * The message excludes attached signatures, so it is the same before and after `attachTransactionSignature`.
1116
1204
  *
1117
1205
  * `seal_signer_public_key` is the raw bytes of the seal signer's public key (account owner).
1118
1206
  * @param {string} unsigned_tx_json
@@ -1161,7 +1249,7 @@ export function ootlePublicKeyFromSecretKey(owner_key, view_key) {
1161
1249
 
1162
1250
  /**
1163
1251
  * Parse a bech32m Ootle address string into its components.
1164
- * Returns { owner_key: Uint8Array, view_key: Uint8Array, network: number, memo: Uint8Array | undefined }.
1252
+ * Returns { owner_key: Uint8Array, view_key: Uint8Array, network: number, destination_tag: Uint8Array | undefined }.
1165
1253
  * @param {string} address
1166
1254
  * @returns {ParsedOotleAddress}
1167
1255
  */
@@ -1193,8 +1281,7 @@ export function publicKeyFromSecretKey(secret_key) {
1193
1281
  }
1194
1282
 
1195
1283
  /**
1196
- * Schnorr-sign a message with a secret key.
1197
- * Returns { public_nonce: Uint8Array, signature: Uint8Array }.
1284
+ * Ristretto Schnorr-sign `message` (off-chain proofs only; transactions use sr25519).
1198
1285
  * @param {Uint8Array} secret_key
1199
1286
  * @param {Uint8Array} message
1200
1287
  * @returns {SchnorrSignatureResult}
@@ -1244,28 +1331,31 @@ export function sealTransaction(tx_json, seal_signer_secret_key) {
1244
1331
  }
1245
1332
 
1246
1333
  /**
1247
- * Derive the recipient's stealth spending scalar `c + k`, where `c = H(network || k.G * r)`. The
1248
- * receiver runs this with their account secret key (`private_key`) and the sender-provided public
1249
- * nonce to obtain the one-time secret that controls the stealth output.
1334
+ * Derive the recipient's stealth spending scalar `c + k`, where `c = H(network || v·R)`. The
1335
+ * receiver runs this with their account secret key `k`, view secret key `v` and the sender-provided
1336
+ * public nonce `R` to obtain the one-time secret that controls the stealth output.
1250
1337
  *
1251
1338
  * `network` is the network byte (0x00 = MainNet, 0x10 = LocalNet, 0x26 = Esmeralda, ...).
1252
1339
  * @param {number} network
1253
- * @param {Uint8Array} private_key
1340
+ * @param {Uint8Array} account_secret
1341
+ * @param {Uint8Array} view_secret
1254
1342
  * @param {Uint8Array} public_nonce
1255
1343
  * @returns {Uint8Array}
1256
1344
  */
1257
- export function stealthDhSecret(network, private_key, public_nonce) {
1258
- const ptr0 = passArray8ToWasm0(private_key, wasm.__wbindgen_malloc);
1345
+ export function stealthDhSecret(network, account_secret, view_secret, public_nonce) {
1346
+ const ptr0 = passArray8ToWasm0(account_secret, wasm.__wbindgen_malloc);
1259
1347
  const len0 = WASM_VECTOR_LEN;
1260
- const ptr1 = passArray8ToWasm0(public_nonce, wasm.__wbindgen_malloc);
1348
+ const ptr1 = passArray8ToWasm0(view_secret, wasm.__wbindgen_malloc);
1261
1349
  const len1 = WASM_VECTOR_LEN;
1262
- const ret = wasm.stealthDhSecret(network, ptr0, len0, ptr1, len1);
1350
+ const ptr2 = passArray8ToWasm0(public_nonce, wasm.__wbindgen_malloc);
1351
+ const len2 = WASM_VECTOR_LEN;
1352
+ const ret = wasm.stealthDhSecret(network, ptr0, len0, ptr1, len1, ptr2, len2);
1263
1353
  if (ret[3]) {
1264
1354
  throw takeFromExternrefTable0(ret[2]);
1265
1355
  }
1266
- var v3 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1356
+ var v4 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
1267
1357
  wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
1268
- return v3;
1358
+ return v4;
1269
1359
  }
1270
1360
 
1271
1361
  /**
@@ -1328,7 +1418,7 @@ export function validateBalanceProofSignature(public_nonce, signature, inputs_st
1328
1418
  }
1329
1419
 
1330
1420
  /**
1331
- * Check an L1 burn's ownership proof against the stealth claim key derived from `stealth_secret`,
1421
+ * Check an L1 burn ownership proof against the stealth claim key derived from `stealth_secret`,
1332
1422
  * exactly as a validator will. `false` means the claim would be rejected.
1333
1423
  *
1334
1424
  * `network` is the network byte (0x00 = MainNet, 0x10 = LocalNet, 0x26 = Esmeralda, ...).
@@ -1381,12 +1471,27 @@ export function __wbg_Error_67e7344beaa85059(arg0, arg1) {
1381
1471
  const ret = Error(getStringFromWasm0(arg0, arg1));
1382
1472
  return ret;
1383
1473
  }
1474
+ export function __wbg___wbindgen_bigint_get_as_i64_b482365c149396c8(arg0, arg1) {
1475
+ const v = arg1;
1476
+ const ret = typeof(v) === 'bigint' ? v : undefined;
1477
+ getDataViewMemory0().setBigInt64(arg0 + 8 * 1, isLikeNone(ret) ? BigInt(0) : ret, true);
1478
+ getDataViewMemory0().setInt32(arg0 + 4 * 0, !isLikeNone(ret), true);
1479
+ }
1480
+ export function __wbg___wbindgen_jsval_eq_9fdcd3c0a860dd3b(arg0, arg1) {
1481
+ const ret = arg0 === arg1;
1482
+ return ret;
1483
+ }
1384
1484
  export function __wbg___wbindgen_throw_5d9e815e6fdf150f(arg0, arg1) {
1385
1485
  throw new Error(getStringFromWasm0(arg0, arg1));
1386
1486
  }
1387
1487
  export function __wbg_getRandomValues_47873ea553f6780e() { return handleError(function (arg0, arg1) {
1388
1488
  globalThis.crypto.getRandomValues(getArrayU8FromWasm0(arg0, arg1));
1389
1489
  }, arguments); }
1490
+ export function __wbindgen_generic_0000000000000001(arg0) {
1491
+ // Cast intrinsic for `U64 -> Externref`.
1492
+ const ret = BigInt.asUintN(64, arg0);
1493
+ return ret;
1494
+ }
1390
1495
  export function __wbindgen_init_externref_table() {
1391
1496
  const table = wasm.__wbindgen_externrefs;
1392
1497
  const offset = table.grow(4);
@@ -1429,6 +1534,14 @@ function getArrayU8FromWasm0(ptr, len) {
1429
1534
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
1430
1535
  }
1431
1536
 
1537
+ let cachedDataViewMemory0 = null;
1538
+ function getDataViewMemory0() {
1539
+ if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || (cachedDataViewMemory0.buffer.detached === undefined && cachedDataViewMemory0.buffer !== wasm.memory.buffer)) {
1540
+ cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
1541
+ }
1542
+ return cachedDataViewMemory0;
1543
+ }
1544
+
1432
1545
  function getStringFromWasm0(ptr, len) {
1433
1546
  return decodeText(ptr >>> 0, len);
1434
1547
  }
@@ -11,7 +11,7 @@ export const __wbg_get_ootlepublickey_owner_key: (a: number) => [number, number]
11
11
  export const __wbg_get_ootlepublickey_view_key: (a: number) => [number, number];
12
12
  export const __wbg_get_ootlesecretkey_owner_key: (a: number) => [number, number];
13
13
  export const __wbg_get_ootlesecretkey_view_key: (a: number) => [number, number];
14
- export const __wbg_get_parsedootleaddress_memo: (a: number) => [number, number];
14
+ export const __wbg_get_parsedootleaddress_destination_tag: (a: number) => [number, number];
15
15
  export const __wbg_get_parsedootleaddress_network: (a: number) => number;
16
16
  export const __wbg_get_parsedootleaddress_owner_key: (a: number) => [number, number];
17
17
  export const __wbg_get_parsedootleaddress_view_key: (a: number) => [number, number];
@@ -33,7 +33,7 @@ export const __wbg_set_ootlepublickey_owner_key: (a: number, b: number, c: numbe
33
33
  export const __wbg_set_ootlepublickey_view_key: (a: number, b: number, c: number) => void;
34
34
  export const __wbg_set_ootlesecretkey_owner_key: (a: number, b: number, c: number) => void;
35
35
  export const __wbg_set_ootlesecretkey_view_key: (a: number, b: number, c: number) => void;
36
- export const __wbg_set_parsedootleaddress_memo: (a: number, b: number, c: number) => void;
36
+ export const __wbg_set_parsedootleaddress_destination_tag: (a: number, b: number, c: number) => void;
37
37
  export const __wbg_set_parsedootleaddress_network: (a: number, b: number) => void;
38
38
  export const __wbg_set_parsedootleaddress_owner_key: (a: number, b: number, c: number) => void;
39
39
  export const __wbg_set_parsedootleaddress_view_key: (a: number, b: number, c: number) => void;
@@ -44,23 +44,26 @@ export const __wbg_set_stealthoutputsresult_statement_json: (a: number, b: numbe
44
44
  export const __wbg_stealthoutputsresult_free: (a: number, b: number) => void;
45
45
  export const addTransactionSigner: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
46
46
  export const aggregateInputMasks: (a: number, b: number) => [number, number, number, number];
47
+ export const attachSealSignature: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
48
+ export const attachTransactionSignature: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => [number, number, number, number];
47
49
  export const borEncodeTransaction: (a: number, b: number) => [number, number, number, number];
48
50
  export const buildScriptPathWitness: (a: number, b: number, c: number, d: number, e: number, f: number) => [number, number, number, number];
49
- export const buildStealthInputsStatement: (a: number, b: number, c: bigint) => [number, number, number, number];
50
- export const buildStealthInputsStatementFromInputs: (a: number, b: number, c: bigint) => [number, number, number, number];
51
- export const buildStealthTransferStatement: (a: number, b: number, c: bigint, d: number, e: number, f: bigint, g: number, h: number) => [number, number, number, number];
51
+ export const buildStealthInputsStatement: (a: number, b: number, c: any) => [number, number, number, number];
52
+ export const buildStealthInputsStatementFromInputs: (a: number, b: number, c: any) => [number, number, number, number];
53
+ export const buildStealthTransferStatement: (a: number, b: number, c: any, d: number, e: number, f: any, g: number, h: number) => [number, number, number, number];
52
54
  export const burnClaimStealthSecret: (a: number, b: number, c: number, d: number) => [number, number, number, number];
53
- export const createConfidentialWithdrawProofLiteral: (a: number, b: number, c: bigint, d: number, e: number, f: bigint, g: number, h: number, i: bigint) => [number, number, number, number];
54
- export const createStealthOutputWitness: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: bigint) => [number, number, number, number];
55
- export const decryptElgamalViewableBalance: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: bigint, j: bigint) => [number, bigint, number, number];
55
+ export const createConfidentialWithdrawProofLiteral: (a: number, b: number, c: any, d: number, e: number, f: any, g: number, h: number, i: any) => [number, number, number, number];
56
+ export const createStealthOutputWitness: (a: number, b: number, c: number, d: number, e: number, f: any, g: number, h: number, i: number, j: number, k: number, l: number, m: number, n: number, o: any) => [number, number, number, number];
57
+ export const decryptElgamalViewableBalance: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: any, j: any) => [number, bigint, number, number];
56
58
  export const encryptedDataDhKdfAead: (a: number, b: number, c: number, d: number) => [number, number, number, number];
57
- export const generateElgamalViewableBalanceProof: (a: number, b: number, c: bigint, d: number, e: number, f: number, g: number) => [number, number, number, number];
59
+ export const generateElgamalViewableBalanceProof: (a: number, b: number, c: any, d: number, e: number, f: number, g: number) => [number, number, number, number];
58
60
  export const generateExtendedBulletProof: (a: number, b: number) => [number, number, number, number];
59
61
  export const generateKeypair: () => number;
60
62
  export const generateOotleAddress: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
61
63
  export const generateOotleSecretKey: () => number;
62
64
  export const generateStealthBalanceProofSignature: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number, number];
63
- export const generateStealthOutputsStatement: (a: number, b: number, c: bigint, d: number, e: number) => [number, number, number];
65
+ export const generateStealthOutputsStatement: (a: number, b: number, c: any, d: number, e: number) => [number, number, number];
66
+ export const hashUnsealedTransaction: (a: number, b: number) => [number, number, number, number];
64
67
  export const hashUnsignedTransaction: (a: number, b: number, c: number, d: number) => [number, number, number, number];
65
68
  export const on_start: () => void;
66
69
  export const ootlePublicKeyFromSecretKey: (a: number, b: number, c: number, d: number) => [number, number, number];
@@ -68,10 +71,10 @@ export const parseOotleAddress: (a: number, b: number) => [number, number, numbe
68
71
  export const publicKeyFromSecretKey: (a: number, b: number) => [number, number, number, number];
69
72
  export const schnorrSign: (a: number, b: number, c: number, d: number) => [number, number, number];
70
73
  export const sealTransaction: (a: number, b: number, c: number, d: number) => [number, number, number, number];
71
- export const stealthDhSecret: (a: number, b: number, c: number, d: number, e: number) => [number, number, number, number];
74
+ export const stealthDhSecret: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number, number];
72
75
  export const unblindOutput: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => [number, number, number];
73
76
  export const validateBalanceProofSignature: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number, i: number, j: number) => [number, number, number];
74
- export const validateBurnClaimOwnershipProof: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: bigint, i: number, j: number) => [number, number, number];
77
+ export const validateBurnClaimOwnershipProof: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: any, i: number, j: number) => [number, number, number];
75
78
  export const validateStealthTransfer: (a: number, b: number, c: number, d: number) => [number, number];
76
79
  export const tari_free: (a: number) => void;
77
80
  export const tari_alloc: (a: number) => number;
@@ -1,11 +1,11 @@
1
1
  {
2
- "name": "@tari-project/ootle-wasm",
2
+ "name": "@chironbuilder/ootle-wasm-legacy",
3
3
  "type": "module",
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: built from tari-ootle v0.42.0 (a43773e) plus two commits not in an upstream release: createConfidentialWithdrawProofLiteral (confidential.rs) and the burn_claim exports (burnClaimStealthSecret, validateBurnClaimOwnershipProof).",
8
- "version": "0.42.0",
7
+ "description": "WASM bindings for Tari Ootle client-side crypto. LOCAL VENDOR PATCH: built from tari-ootle v0.49.2 plus chiron-0.49.2.patch (core/src/chiron.rs): createConfidentialWithdrawProofLiteral, burnClaimStealthSecret, validateBurnClaimOwnershipProof.",
8
+ "version": "0.49.2-chiron.1",
9
9
  "license": "BSD-3-Clause",
10
10
  "repository": {
11
11
  "type": "git",
@@ -1,67 +0,0 @@
1
- # Patched `@tari-project/ootle` (temporary, remove once upstream releases a fix)
2
-
3
- Rebased 2026-08-20 onto `tari-project/ootle.ts`'s `main` branch at commit `1f2e8b2`
4
- ("feat(deps)!: upgrade the tari package set to the 0.39 protocol (#123)") — the same commit the
5
- officially published `@tari-project/ootle@0.3.0` npm release was built from (confirmed: identical
6
- `version` field, identical `covenant_claims` hardcoding when diffed against the published tarball).
7
- This is a source rebase, not a re-derivation from scratch — the previous vendor copy (built
8
- 2026-08-06 from a since-unknown `ootle.ts` `main` commit `2bc5e93e`) carried one patch that no
9
- longer applies and one that still does:
10
-
11
- 1. ~~One line changed in `packages/ootle/src/stealth/statements.ts` to always include
12
- `"covenant_claims":[]`~~ — **no longer needed**. Confirmed by grepping the real, published
13
- `@tari-project/ootle@0.3.0` dist: it already includes `"covenant_claims":[]` unconditionally.
14
- Upstream picked this up independently at some point after the original 2026-08-06 patch. This
15
- remains correct for every transfer this wallet builds today, including the HTLC claim/refund
16
- this rebase was done to unblock — `covenant_claims` is only ever read by
17
- `SpendScriptExecution::covenant_balanced`, reached only from a `Covenant::BalancePreserved`
18
- leaf or a `TemplateFunction` calling `SpendContext::covenant_balanced`; a revealed
19
- `HashLock`/`AfterEpoch`/`AccessRule` leaf (what every HTLC leaf in `src/lib/htlc.ts` is) never
20
- touches it (confirmed against `tari-project/tari-ootle#2431`'s own review discussion, where a
21
- maintainer caught an earlier PR description overclaiming this field was "required whenever a
22
- script-path input is spent").
23
-
24
- 2. `packages/ootle/src/stealth/transfer.ts`'s `StealthTransfer` builder still needs its two
25
- wallet-specific public methods, `toRevealedOutputAsBucket(amount, workspaceVarName)` and
26
- `andThen(instructions)` — **re-applied on top of the current source**, still absent upstream
27
- (confirmed: `grep -c toRevealedOutputAsBucket` on the fresh `ootle.ts` checkout before
28
- patching was 0). Upstream's `toRevealedOutput()` always auto-deposits the revealed change back
29
- into the source account — there's no way to get it as a bucket a caller can route elsewhere.
30
- The patched methods leave it on the workspace instead and let extra instructions run in the
31
- *same* signed transaction, consuming that bucket. This exists because a third-party dApp (or
32
- this wallet's own `withdrawStealthAndExecute`) cannot move Stealth-typed funds (e.g. XTR) into
33
- its own contract call at all otherwise — a plain `CallMethod withdraw` on a Stealth vault is
34
- not a standalone-valid instruction; moving Stealth funds anywhere always requires the native
35
- `StealthTransfer` instruction, paired with `WalletStealthAuthorizer` to sign it — which
36
- `account.execute()`/plain `TransactionBuilder` never invokes. See `withdrawStealthAndExecute`
37
- in `src/lib/wallet.ts` for the wallet-side method that uses this. Full method docs are inline
38
- in `transfer.ts` itself now (copied into this package's own `dist/index.d.ts`).
39
-
40
- **Why this rebase happened now**: `@tari-project/ootle-wasm@0.39.0`/`0.39.1` are real, officially
41
- published releases (not a moving branch HEAD) that finally include
42
- `buildScriptPathWitness`/`buildStealthInputsStatementFromInputs`/`buildStealthTransferStatement`
43
- (`tari-project/tari-ootle#2426`, `#2431`) — the primitives `OotleAccount.htlcClaim`/`htlcRefund`
44
- need. Picking those up meant moving off the old `^0.37.0` pin, which meant rebuilding this vendor
45
- copy against a source tree consistent with the new wasm version rather than continuing to build
46
- against the stale 2026-08-06 base.
47
-
48
- **Verified before landing**: `packages/ootle`'s own `tsc -b` and `vite build` both clean against
49
- this patch; its non-wasm-dependent test files (240 tests across 17 files) pass unchanged. Its
50
- wasm-dependent test files fail to even load in this build environment with
51
- `TypeError: filename must be a file URL... Received 'file:///__vite-plugin-wasm-helper'` —
52
- confirmed via `git stash` that this happens identically on the *unpatched* upstream source, so
53
- it's a pre-existing `vite-plugin-wasm`/Node version environment issue, not something this patch
54
- introduced or something this patch's correctness can be judged by. `tari-wallet`'s own test suite
55
- (a different vitest config) is the real correctness check for this vendor copy — see this repo's
56
- top-level `README.md` / commit history for that result.
57
-
58
- To rebuild after further edits: clone `tari-project/ootle.ts` fresh, re-apply the
59
- `toRevealedOutputAsBucket`/`andThen` patch to `packages/ootle/src/stealth/transfer.ts` (diff
60
- against this vendored `dist/index.d.ts` if the patch itself is lost), then
61
- `cd packages/ootle && pnpm install && npx tsc -b && npx vite build`, and copy `dist/index.js` +
62
- `dist/index.d.ts` into this directory's `dist/`.
63
-
64
- Delete `vendor/ootle-patched/` and the `pnpm-workspace.yaml` override once `@tari-project/ootle`
65
- publishes a release that includes fix 2 (fix 1 is already moot) — re-verify shield/unshield *and*
66
- the bucket-output/`andThen` capability (and, once built, HTLC claim/refund) against whatever
67
- version ships, since fix 2 still has no upstream equivalent and would need to be proposed there.