@bitgo/wasm-utxo 2.1.0 → 3.0.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/dist/cjs/js/coinName.d.ts +3 -0
- package/dist/cjs/js/coinName.js +49 -0
- package/dist/cjs/js/descriptorWallet/Psbt.d.ts +49 -0
- package/dist/cjs/js/descriptorWallet/Psbt.js +126 -0
- package/dist/cjs/js/descriptorWallet/index.d.ts +1 -0
- package/dist/cjs/js/descriptorWallet/index.js +4 -0
- package/dist/cjs/js/index.d.ts +1 -31
- package/dist/cjs/js/index.js +2 -2
- package/dist/cjs/js/testutils/AcidTest.d.ts +3 -3
- package/dist/cjs/js/testutils/AcidTest.js +79 -80
- package/dist/cjs/js/wasm/wasm_utxo.d.ts +27 -110
- package/dist/cjs/js/wasm/wasm_utxo.js +54 -97
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/cjs/js/wasm/wasm_utxo_bg.wasm.d.ts +27 -27
- package/dist/esm/js/coinName.d.ts +3 -0
- package/dist/esm/js/coinName.js +48 -0
- package/dist/esm/js/descriptorWallet/Psbt.d.ts +49 -0
- package/dist/esm/js/descriptorWallet/Psbt.js +122 -0
- package/dist/esm/js/descriptorWallet/index.d.ts +1 -0
- package/dist/esm/js/descriptorWallet/index.js +2 -0
- package/dist/esm/js/index.d.ts +1 -31
- package/dist/esm/js/index.js +1 -1
- package/dist/esm/js/testutils/AcidTest.d.ts +3 -3
- package/dist/esm/js/testutils/AcidTest.js +80 -81
- package/dist/esm/js/wasm/wasm_utxo.d.ts +27 -110
- package/dist/esm/js/wasm/wasm_utxo_bg.js +54 -97
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm +0 -0
- package/dist/esm/js/wasm/wasm_utxo_bg.wasm.d.ts +27 -27
- package/package.json +1 -1
|
@@ -318,16 +318,7 @@ export class BitGoPsbt {
|
|
|
318
318
|
* generated for security. Custom session_id is only allowed on testnets for testing purposes.
|
|
319
319
|
*/
|
|
320
320
|
generate_musig2_nonces(xpriv: WasmBIP32, session_id_bytes?: Uint8Array | null): void;
|
|
321
|
-
/**
|
|
322
|
-
* Returns the global xpubs from the PSBT as an array of WasmBIP32 instances.
|
|
323
|
-
*/
|
|
324
321
|
get_global_xpubs(): any;
|
|
325
|
-
/**
|
|
326
|
-
* Get all PSBT inputs as an array of PsbtInputData
|
|
327
|
-
*
|
|
328
|
-
* Returns an array with witness_utxo, bip32_derivation, and tap_bip32_derivation
|
|
329
|
-
* for each input.
|
|
330
|
-
*/
|
|
331
322
|
get_inputs(): any;
|
|
332
323
|
/**
|
|
333
324
|
* Get the network type for transaction extraction
|
|
@@ -336,23 +327,8 @@ export class BitGoPsbt {
|
|
|
336
327
|
* wrapper class should be used in TypeScript.
|
|
337
328
|
*/
|
|
338
329
|
get_network_type(): string;
|
|
339
|
-
/**
|
|
340
|
-
* Get all PSBT outputs as an array of PsbtOutputData
|
|
341
|
-
*
|
|
342
|
-
* Returns an array with script, value, bip32_derivation, and tap_bip32_derivation
|
|
343
|
-
* for each output.
|
|
344
|
-
*/
|
|
345
330
|
get_outputs(): any;
|
|
346
|
-
/**
|
|
347
|
-
* Get all PSBT outputs with resolved address strings.
|
|
348
|
-
*
|
|
349
|
-
* Unlike the generic WrapPsbt which requires a coin parameter, BitGoPsbt
|
|
350
|
-
* uses the network it was created/deserialized with to resolve addresses.
|
|
351
|
-
*/
|
|
352
331
|
get_outputs_with_address(): any;
|
|
353
|
-
/**
|
|
354
|
-
* Get the number of inputs in the PSBT
|
|
355
|
-
*/
|
|
356
332
|
input_count(): number;
|
|
357
333
|
/**
|
|
358
334
|
* Check if an input is a MuSig2 keypath input.
|
|
@@ -368,17 +344,11 @@ export class BitGoPsbt {
|
|
|
368
344
|
* - `false` otherwise (or if input_index is out of bounds)
|
|
369
345
|
*/
|
|
370
346
|
is_musig2_input(input_index: number): boolean;
|
|
371
|
-
/**
|
|
372
|
-
* Get the transaction lock time
|
|
373
|
-
*/
|
|
374
347
|
lock_time(): number;
|
|
375
348
|
/**
|
|
376
349
|
* Get the network of the PSBT
|
|
377
350
|
*/
|
|
378
351
|
network(): string;
|
|
379
|
-
/**
|
|
380
|
-
* Get the number of outputs in the PSBT
|
|
381
|
-
*/
|
|
382
352
|
output_count(): number;
|
|
383
353
|
/**
|
|
384
354
|
* Parse outputs with wallet keys to identify which outputs belong to a wallet
|
|
@@ -659,9 +629,6 @@ export class BitGoPsbt {
|
|
|
659
629
|
* - `Err(WasmUtxoError)` if the input index is out of bounds, derivation fails, or verification fails
|
|
660
630
|
*/
|
|
661
631
|
verify_signature_with_xpub(input_index: number, xpub: WasmBIP32): boolean;
|
|
662
|
-
/**
|
|
663
|
-
* Get the transaction version
|
|
664
|
-
*/
|
|
665
632
|
version(): number;
|
|
666
633
|
/**
|
|
667
634
|
* Get the Zcash version group ID (returns None for non-Zcash PSBTs)
|
|
@@ -1311,7 +1278,7 @@ export class WrapMiniscript {
|
|
|
1311
1278
|
export class WrapPsbt {
|
|
1312
1279
|
free(): void;
|
|
1313
1280
|
[Symbol.dispose](): void;
|
|
1314
|
-
|
|
1281
|
+
add_input(txid: string, vout: number, value: bigint, script: Uint8Array, sequence?: number | null): number;
|
|
1315
1282
|
/**
|
|
1316
1283
|
* Add an input to the PSBT
|
|
1317
1284
|
*
|
|
@@ -1325,8 +1292,8 @@ export class WrapPsbt {
|
|
|
1325
1292
|
* # Returns
|
|
1326
1293
|
* The index of the newly added input
|
|
1327
1294
|
*/
|
|
1328
|
-
|
|
1329
|
-
|
|
1295
|
+
add_input_at_index(index: number, txid: string, vout: number, value: bigint, script: Uint8Array, sequence?: number | null): number;
|
|
1296
|
+
add_output(script: Uint8Array, value: bigint): number;
|
|
1330
1297
|
/**
|
|
1331
1298
|
* Add an output to the PSBT
|
|
1332
1299
|
*
|
|
@@ -1337,7 +1304,7 @@ export class WrapPsbt {
|
|
|
1337
1304
|
* # Returns
|
|
1338
1305
|
* The index of the newly added output
|
|
1339
1306
|
*/
|
|
1340
|
-
|
|
1307
|
+
add_output_at_index(index: number, script: Uint8Array, value: bigint): number;
|
|
1341
1308
|
clone(): WrapPsbt;
|
|
1342
1309
|
static deserialize(psbt: Uint8Array): WrapPsbt;
|
|
1343
1310
|
/**
|
|
@@ -1350,57 +1317,23 @@ export class WrapPsbt {
|
|
|
1350
1317
|
* - `Ok(WasmTransaction)` containing the extracted transaction
|
|
1351
1318
|
* - `Err(WasmUtxoError)` if the PSBT is not fully finalized or extraction fails
|
|
1352
1319
|
*/
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
* Get all PSBT inputs as an array of PsbtInputData
|
|
1361
|
-
*
|
|
1362
|
-
* Returns an array with witness_utxo, bip32_derivation, and tap_bip32_derivation
|
|
1363
|
-
* for each input. This is useful for introspecting the PSBT structure.
|
|
1364
|
-
*/
|
|
1365
|
-
getInputs(): any;
|
|
1366
|
-
/**
|
|
1367
|
-
* Get all PSBT outputs as an array of PsbtOutputData
|
|
1368
|
-
*
|
|
1369
|
-
* Returns an array with script, value, bip32_derivation, and tap_bip32_derivation
|
|
1370
|
-
* for each output. This is useful for introspecting the PSBT structure.
|
|
1371
|
-
*/
|
|
1372
|
-
getOutputs(): any;
|
|
1373
|
-
/**
|
|
1374
|
-
* Get all PSBT outputs with resolved address strings.
|
|
1375
|
-
*
|
|
1376
|
-
* Like `getOutputs()` but each element also includes an `address` field
|
|
1377
|
-
* derived from the output script using the given coin name (e.g. "btc", "tbtc").
|
|
1378
|
-
*/
|
|
1379
|
-
getOutputsWithAddress(coin: string): any;
|
|
1380
|
-
/**
|
|
1381
|
-
* Get partial signatures for an input
|
|
1382
|
-
* Returns array of { pubkey: Uint8Array, signature: Uint8Array }
|
|
1383
|
-
*/
|
|
1384
|
-
getPartialSignatures(input_index: number): any;
|
|
1320
|
+
extract_transaction(): WasmTransaction;
|
|
1321
|
+
finalize_mut(): void;
|
|
1322
|
+
get_global_xpubs(): any;
|
|
1323
|
+
get_inputs(): any;
|
|
1324
|
+
get_outputs(): any;
|
|
1325
|
+
get_outputs_with_address(coin: string): any;
|
|
1326
|
+
get_partial_signatures(input_index: number): any;
|
|
1385
1327
|
/**
|
|
1386
1328
|
* Get the unsigned transaction bytes
|
|
1387
1329
|
*
|
|
1388
1330
|
* # Returns
|
|
1389
1331
|
* The serialized unsigned transaction
|
|
1390
1332
|
*/
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
hasPartialSignatures(input_index: number): boolean;
|
|
1396
|
-
/**
|
|
1397
|
-
* Get the number of inputs in the PSBT
|
|
1398
|
-
*/
|
|
1399
|
-
inputCount(): number;
|
|
1400
|
-
/**
|
|
1401
|
-
* Get the transaction lock time
|
|
1402
|
-
*/
|
|
1403
|
-
lockTime(): number;
|
|
1333
|
+
get_unsigned_tx(): Uint8Array;
|
|
1334
|
+
has_partial_signatures(input_index: number): boolean;
|
|
1335
|
+
input_count(): number;
|
|
1336
|
+
lock_time(): number;
|
|
1404
1337
|
/**
|
|
1405
1338
|
* Create an empty PSBT
|
|
1406
1339
|
*
|
|
@@ -1409,12 +1342,9 @@ export class WrapPsbt {
|
|
|
1409
1342
|
* * `lock_time` - Transaction lock time (default: 0)
|
|
1410
1343
|
*/
|
|
1411
1344
|
constructor(version?: number | null, lock_time?: number | null);
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
outputCount(): number;
|
|
1416
|
-
removeInput(index: number): void;
|
|
1417
|
-
removeOutput(index: number): void;
|
|
1345
|
+
output_count(): number;
|
|
1346
|
+
remove_input(index: number): void;
|
|
1347
|
+
remove_output(index: number): void;
|
|
1418
1348
|
serialize(): Uint8Array;
|
|
1419
1349
|
/**
|
|
1420
1350
|
* Sign all inputs with a WasmBIP32 key
|
|
@@ -1428,7 +1358,7 @@ export class WrapPsbt {
|
|
|
1428
1358
|
* # Returns
|
|
1429
1359
|
* A SigningKeysMap converted to JsValue (object mapping input indices to signing keys)
|
|
1430
1360
|
*/
|
|
1431
|
-
|
|
1361
|
+
sign_all(key: WasmBIP32): any;
|
|
1432
1362
|
/**
|
|
1433
1363
|
* Sign all inputs with a WasmECPair key
|
|
1434
1364
|
*
|
|
@@ -1441,23 +1371,13 @@ export class WrapPsbt {
|
|
|
1441
1371
|
* # Returns
|
|
1442
1372
|
* A SigningKeysMap converted to JsValue (object mapping input indices to signing keys)
|
|
1443
1373
|
*/
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
updateInputWithDescriptor(input_index: number, descriptor: WrapDescriptor): void;
|
|
1452
|
-
updateOutputWithDescriptor(output_index: number, descriptor: WrapDescriptor): void;
|
|
1453
|
-
/**
|
|
1454
|
-
* Validate a signature at a specific input against a pubkey
|
|
1455
|
-
* Returns true if the signature is valid
|
|
1456
|
-
*
|
|
1457
|
-
* This method handles both ECDSA (legacy/SegWit) and Schnorr (Taproot) signatures.
|
|
1458
|
-
* The pubkey should be provided as bytes (33 bytes for compressed ECDSA, 32 bytes for x-only Schnorr).
|
|
1459
|
-
*/
|
|
1460
|
-
validateSignatureAtInput(input_index: number, pubkey: Uint8Array): boolean;
|
|
1374
|
+
sign_all_with_ecpair(key: WasmECPair): any;
|
|
1375
|
+
sign_with_prv(prv: Uint8Array): any;
|
|
1376
|
+
sign_with_xprv(xprv: string): any;
|
|
1377
|
+
unsigned_tx_id(): string;
|
|
1378
|
+
update_input_with_descriptor(input_index: number, descriptor: WrapDescriptor): void;
|
|
1379
|
+
update_output_with_descriptor(output_index: number, descriptor: WrapDescriptor): void;
|
|
1380
|
+
validate_signature_at_input(input_index: number, pubkey: Uint8Array): boolean;
|
|
1461
1381
|
/**
|
|
1462
1382
|
* Verify a signature at a specific input using a WasmBIP32 key
|
|
1463
1383
|
*
|
|
@@ -1474,10 +1394,7 @@ export class WrapPsbt {
|
|
|
1474
1394
|
* # Returns
|
|
1475
1395
|
* `true` if a valid signature exists for the key, `false` otherwise
|
|
1476
1396
|
*/
|
|
1477
|
-
|
|
1478
|
-
/**
|
|
1479
|
-
* Get the transaction version
|
|
1480
|
-
*/
|
|
1397
|
+
verify_signature_with_key(input_index: number, key: WasmBIP32): boolean;
|
|
1481
1398
|
version(): number;
|
|
1482
1399
|
}
|
|
1483
1400
|
|