@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.
@@ -1122,7 +1122,6 @@ export class BitGoPsbt {
1122
1122
  }
1123
1123
  }
1124
1124
  /**
1125
- * Returns the global xpubs from the PSBT as an array of WasmBIP32 instances.
1126
1125
  * @returns {any}
1127
1126
  */
1128
1127
  get_global_xpubs() {
@@ -1130,10 +1129,6 @@ export class BitGoPsbt {
1130
1129
  return takeObject(ret);
1131
1130
  }
1132
1131
  /**
1133
- * Get all PSBT inputs as an array of PsbtInputData
1134
- *
1135
- * Returns an array with witness_utxo, bip32_derivation, and tap_bip32_derivation
1136
- * for each input.
1137
1132
  * @returns {any}
1138
1133
  */
1139
1134
  get_inputs() {
@@ -1175,10 +1170,6 @@ export class BitGoPsbt {
1175
1170
  }
1176
1171
  }
1177
1172
  /**
1178
- * Get all PSBT outputs as an array of PsbtOutputData
1179
- *
1180
- * Returns an array with script, value, bip32_derivation, and tap_bip32_derivation
1181
- * for each output.
1182
1173
  * @returns {any}
1183
1174
  */
1184
1175
  get_outputs() {
@@ -1197,10 +1188,6 @@ export class BitGoPsbt {
1197
1188
  }
1198
1189
  }
1199
1190
  /**
1200
- * Get all PSBT outputs with resolved address strings.
1201
- *
1202
- * Unlike the generic WrapPsbt which requires a coin parameter, BitGoPsbt
1203
- * uses the network it was created/deserialized with to resolve addresses.
1204
1191
  * @returns {any}
1205
1192
  */
1206
1193
  get_outputs_with_address() {
@@ -1219,7 +1206,6 @@ export class BitGoPsbt {
1219
1206
  }
1220
1207
  }
1221
1208
  /**
1222
- * Get the number of inputs in the PSBT
1223
1209
  * @returns {number}
1224
1210
  */
1225
1211
  input_count() {
@@ -1246,7 +1232,6 @@ export class BitGoPsbt {
1246
1232
  return ret !== 0;
1247
1233
  }
1248
1234
  /**
1249
- * Get the transaction lock time
1250
1235
  * @returns {number}
1251
1236
  */
1252
1237
  lock_time() {
@@ -1274,7 +1259,6 @@ export class BitGoPsbt {
1274
1259
  }
1275
1260
  }
1276
1261
  /**
1277
- * Get the number of outputs in the PSBT
1278
1262
  * @returns {number}
1279
1263
  */
1280
1264
  output_count() {
@@ -1896,7 +1880,6 @@ export class BitGoPsbt {
1896
1880
  }
1897
1881
  }
1898
1882
  /**
1899
- * Get the transaction version
1900
1883
  * @returns {number}
1901
1884
  */
1902
1885
  version() {
@@ -4441,14 +4424,14 @@ export class WrapPsbt {
4441
4424
  * @param {number | null} [sequence]
4442
4425
  * @returns {number}
4443
4426
  */
4444
- addInput(txid, vout, value, script, sequence) {
4427
+ add_input(txid, vout, value, script, sequence) {
4445
4428
  try {
4446
4429
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4447
4430
  const ptr0 = passStringToWasm0(txid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
4448
4431
  const len0 = WASM_VECTOR_LEN;
4449
4432
  const ptr1 = passArray8ToWasm0(script, wasm.__wbindgen_export);
4450
4433
  const len1 = WASM_VECTOR_LEN;
4451
- wasm.wrappsbt_addInput(retptr, this.__wbg_ptr, ptr0, len0, vout, value, ptr1, len1, isLikeNone(sequence) ? 0x100000001 : (sequence) >>> 0);
4434
+ wasm.wrappsbt_add_input(retptr, this.__wbg_ptr, ptr0, len0, vout, value, ptr1, len1, isLikeNone(sequence) ? 0x100000001 : (sequence) >>> 0);
4452
4435
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4453
4436
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4454
4437
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -4480,14 +4463,14 @@ export class WrapPsbt {
4480
4463
  * @param {number | null} [sequence]
4481
4464
  * @returns {number}
4482
4465
  */
4483
- addInputAtIndex(index, txid, vout, value, script, sequence) {
4466
+ add_input_at_index(index, txid, vout, value, script, sequence) {
4484
4467
  try {
4485
4468
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4486
4469
  const ptr0 = passStringToWasm0(txid, wasm.__wbindgen_export, wasm.__wbindgen_export2);
4487
4470
  const len0 = WASM_VECTOR_LEN;
4488
4471
  const ptr1 = passArray8ToWasm0(script, wasm.__wbindgen_export);
4489
4472
  const len1 = WASM_VECTOR_LEN;
4490
- wasm.wrappsbt_addInputAtIndex(retptr, this.__wbg_ptr, index, ptr0, len0, vout, value, ptr1, len1, isLikeNone(sequence) ? 0x100000001 : (sequence) >>> 0);
4473
+ wasm.wrappsbt_add_input_at_index(retptr, this.__wbg_ptr, index, ptr0, len0, vout, value, ptr1, len1, isLikeNone(sequence) ? 0x100000001 : (sequence) >>> 0);
4491
4474
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4492
4475
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4493
4476
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -4504,10 +4487,10 @@ export class WrapPsbt {
4504
4487
  * @param {bigint} value
4505
4488
  * @returns {number}
4506
4489
  */
4507
- addOutput(script, value) {
4490
+ add_output(script, value) {
4508
4491
  const ptr0 = passArray8ToWasm0(script, wasm.__wbindgen_export);
4509
4492
  const len0 = WASM_VECTOR_LEN;
4510
- const ret = wasm.wrappsbt_addOutput(this.__wbg_ptr, ptr0, len0, value);
4493
+ const ret = wasm.wrappsbt_add_output(this.__wbg_ptr, ptr0, len0, value);
4511
4494
  return ret >>> 0;
4512
4495
  }
4513
4496
  /**
@@ -4524,12 +4507,12 @@ export class WrapPsbt {
4524
4507
  * @param {bigint} value
4525
4508
  * @returns {number}
4526
4509
  */
4527
- addOutputAtIndex(index, script, value) {
4510
+ add_output_at_index(index, script, value) {
4528
4511
  try {
4529
4512
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4530
4513
  const ptr0 = passArray8ToWasm0(script, wasm.__wbindgen_export);
4531
4514
  const len0 = WASM_VECTOR_LEN;
4532
- wasm.wrappsbt_addOutputAtIndex(retptr, this.__wbg_ptr, index, ptr0, len0, value);
4515
+ wasm.wrappsbt_add_output_at_index(retptr, this.__wbg_ptr, index, ptr0, len0, value);
4533
4516
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4534
4517
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4535
4518
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -4580,10 +4563,10 @@ export class WrapPsbt {
4580
4563
  * - `Err(WasmUtxoError)` if the PSBT is not fully finalized or extraction fails
4581
4564
  * @returns {WasmTransaction}
4582
4565
  */
4583
- extractTransaction() {
4566
+ extract_transaction() {
4584
4567
  try {
4585
4568
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4586
- wasm.wrappsbt_extractTransaction(retptr, this.__wbg_ptr);
4569
+ wasm.wrappsbt_extract_transaction(retptr, this.__wbg_ptr);
4587
4570
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4588
4571
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4589
4572
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -4595,10 +4578,10 @@ export class WrapPsbt {
4595
4578
  wasm.__wbindgen_add_to_stack_pointer(16);
4596
4579
  }
4597
4580
  }
4598
- finalize() {
4581
+ finalize_mut() {
4599
4582
  try {
4600
4583
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4601
- wasm.wrappsbt_finalize(retptr, this.__wbg_ptr);
4584
+ wasm.wrappsbt_finalize_mut(retptr, this.__wbg_ptr);
4602
4585
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4603
4586
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4604
4587
  if (r1) {
@@ -4609,24 +4592,19 @@ export class WrapPsbt {
4609
4592
  }
4610
4593
  }
4611
4594
  /**
4612
- * Get global xpubs from the PSBT as an array of WasmBIP32 instances.
4613
4595
  * @returns {any}
4614
4596
  */
4615
- getGlobalXpubs() {
4616
- const ret = wasm.wrappsbt_getGlobalXpubs(this.__wbg_ptr);
4597
+ get_global_xpubs() {
4598
+ const ret = wasm.wrappsbt_get_global_xpubs(this.__wbg_ptr);
4617
4599
  return takeObject(ret);
4618
4600
  }
4619
4601
  /**
4620
- * Get all PSBT inputs as an array of PsbtInputData
4621
- *
4622
- * Returns an array with witness_utxo, bip32_derivation, and tap_bip32_derivation
4623
- * for each input. This is useful for introspecting the PSBT structure.
4624
4602
  * @returns {any}
4625
4603
  */
4626
- getInputs() {
4604
+ get_inputs() {
4627
4605
  try {
4628
4606
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4629
- wasm.wrappsbt_getInputs(retptr, this.__wbg_ptr);
4607
+ wasm.wrappsbt_get_inputs(retptr, this.__wbg_ptr);
4630
4608
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4631
4609
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4632
4610
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -4639,16 +4617,12 @@ export class WrapPsbt {
4639
4617
  }
4640
4618
  }
4641
4619
  /**
4642
- * Get all PSBT outputs as an array of PsbtOutputData
4643
- *
4644
- * Returns an array with script, value, bip32_derivation, and tap_bip32_derivation
4645
- * for each output. This is useful for introspecting the PSBT structure.
4646
4620
  * @returns {any}
4647
4621
  */
4648
- getOutputs() {
4622
+ get_outputs() {
4649
4623
  try {
4650
4624
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4651
- wasm.wrappsbt_getOutputs(retptr, this.__wbg_ptr);
4625
+ wasm.wrappsbt_get_outputs(retptr, this.__wbg_ptr);
4652
4626
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4653
4627
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4654
4628
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -4661,19 +4635,15 @@ export class WrapPsbt {
4661
4635
  }
4662
4636
  }
4663
4637
  /**
4664
- * Get all PSBT outputs with resolved address strings.
4665
- *
4666
- * Like `getOutputs()` but each element also includes an `address` field
4667
- * derived from the output script using the given coin name (e.g. "btc", "tbtc").
4668
4638
  * @param {string} coin
4669
4639
  * @returns {any}
4670
4640
  */
4671
- getOutputsWithAddress(coin) {
4641
+ get_outputs_with_address(coin) {
4672
4642
  try {
4673
4643
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4674
4644
  const ptr0 = passStringToWasm0(coin, wasm.__wbindgen_export, wasm.__wbindgen_export2);
4675
4645
  const len0 = WASM_VECTOR_LEN;
4676
- wasm.wrappsbt_getOutputsWithAddress(retptr, this.__wbg_ptr, ptr0, len0);
4646
+ wasm.wrappsbt_get_outputs_with_address(retptr, this.__wbg_ptr, ptr0, len0);
4677
4647
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4678
4648
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4679
4649
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -4686,15 +4656,13 @@ export class WrapPsbt {
4686
4656
  }
4687
4657
  }
4688
4658
  /**
4689
- * Get partial signatures for an input
4690
- * Returns array of { pubkey: Uint8Array, signature: Uint8Array }
4691
4659
  * @param {number} input_index
4692
4660
  * @returns {any}
4693
4661
  */
4694
- getPartialSignatures(input_index) {
4662
+ get_partial_signatures(input_index) {
4695
4663
  try {
4696
4664
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4697
- wasm.wrappsbt_getPartialSignatures(retptr, this.__wbg_ptr, input_index);
4665
+ wasm.wrappsbt_get_partial_signatures(retptr, this.__wbg_ptr, input_index);
4698
4666
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4699
4667
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4700
4668
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -4713,10 +4681,10 @@ export class WrapPsbt {
4713
4681
  * The serialized unsigned transaction
4714
4682
  * @returns {Uint8Array}
4715
4683
  */
4716
- getUnsignedTx() {
4684
+ get_unsigned_tx() {
4717
4685
  try {
4718
4686
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4719
- wasm.wrappsbt_getUnsignedTx(retptr, this.__wbg_ptr);
4687
+ wasm.wrappsbt_get_unsigned_tx(retptr, this.__wbg_ptr);
4720
4688
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4721
4689
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4722
4690
  var v1 = getArrayU8FromWasm0(r0, r1).slice();
@@ -4727,14 +4695,13 @@ export class WrapPsbt {
4727
4695
  }
4728
4696
  }
4729
4697
  /**
4730
- * Check if an input has any partial signatures
4731
4698
  * @param {number} input_index
4732
4699
  * @returns {boolean}
4733
4700
  */
4734
- hasPartialSignatures(input_index) {
4701
+ has_partial_signatures(input_index) {
4735
4702
  try {
4736
4703
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4737
- wasm.wrappsbt_hasPartialSignatures(retptr, this.__wbg_ptr, input_index);
4704
+ wasm.wrappsbt_has_partial_signatures(retptr, this.__wbg_ptr, input_index);
4738
4705
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4739
4706
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4740
4707
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -4747,19 +4714,17 @@ export class WrapPsbt {
4747
4714
  }
4748
4715
  }
4749
4716
  /**
4750
- * Get the number of inputs in the PSBT
4751
4717
  * @returns {number}
4752
4718
  */
4753
- inputCount() {
4754
- const ret = wasm.wrappsbt_inputCount(this.__wbg_ptr);
4719
+ input_count() {
4720
+ const ret = wasm.wrappsbt_input_count(this.__wbg_ptr);
4755
4721
  return ret >>> 0;
4756
4722
  }
4757
4723
  /**
4758
- * Get the transaction lock time
4759
4724
  * @returns {number}
4760
4725
  */
4761
- lockTime() {
4762
- const ret = wasm.wrappsbt_lockTime(this.__wbg_ptr);
4726
+ lock_time() {
4727
+ const ret = wasm.wrappsbt_lock_time(this.__wbg_ptr);
4763
4728
  return ret >>> 0;
4764
4729
  }
4765
4730
  /**
@@ -4778,20 +4743,19 @@ export class WrapPsbt {
4778
4743
  return this;
4779
4744
  }
4780
4745
  /**
4781
- * Get the number of outputs in the PSBT
4782
4746
  * @returns {number}
4783
4747
  */
4784
- outputCount() {
4785
- const ret = wasm.wrappsbt_outputCount(this.__wbg_ptr);
4748
+ output_count() {
4749
+ const ret = wasm.wrappsbt_output_count(this.__wbg_ptr);
4786
4750
  return ret >>> 0;
4787
4751
  }
4788
4752
  /**
4789
4753
  * @param {number} index
4790
4754
  */
4791
- removeInput(index) {
4755
+ remove_input(index) {
4792
4756
  try {
4793
4757
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4794
- wasm.wrappsbt_removeInput(retptr, this.__wbg_ptr, index);
4758
+ wasm.wrappsbt_remove_input(retptr, this.__wbg_ptr, index);
4795
4759
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4796
4760
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4797
4761
  if (r1) {
@@ -4804,10 +4768,10 @@ export class WrapPsbt {
4804
4768
  /**
4805
4769
  * @param {number} index
4806
4770
  */
4807
- removeOutput(index) {
4771
+ remove_output(index) {
4808
4772
  try {
4809
4773
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4810
- wasm.wrappsbt_removeOutput(retptr, this.__wbg_ptr, index);
4774
+ wasm.wrappsbt_remove_output(retptr, this.__wbg_ptr, index);
4811
4775
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4812
4776
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4813
4777
  if (r1) {
@@ -4847,11 +4811,11 @@ export class WrapPsbt {
4847
4811
  * @param {WasmBIP32} key
4848
4812
  * @returns {any}
4849
4813
  */
4850
- signAll(key) {
4814
+ sign_all(key) {
4851
4815
  try {
4852
4816
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4853
4817
  _assertClass(key, WasmBIP32);
4854
- wasm.wrappsbt_signAll(retptr, this.__wbg_ptr, key.__wbg_ptr);
4818
+ wasm.wrappsbt_sign_all(retptr, this.__wbg_ptr, key.__wbg_ptr);
4855
4819
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4856
4820
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4857
4821
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -4877,11 +4841,11 @@ export class WrapPsbt {
4877
4841
  * @param {WasmECPair} key
4878
4842
  * @returns {any}
4879
4843
  */
4880
- signAllWithEcpair(key) {
4844
+ sign_all_with_ecpair(key) {
4881
4845
  try {
4882
4846
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4883
4847
  _assertClass(key, WasmECPair);
4884
- wasm.wrappsbt_signAllWithEcpair(retptr, this.__wbg_ptr, key.__wbg_ptr);
4848
+ wasm.wrappsbt_sign_all_with_ecpair(retptr, this.__wbg_ptr, key.__wbg_ptr);
4885
4849
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4886
4850
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4887
4851
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -4897,12 +4861,12 @@ export class WrapPsbt {
4897
4861
  * @param {Uint8Array} prv
4898
4862
  * @returns {any}
4899
4863
  */
4900
- signWithPrv(prv) {
4864
+ sign_with_prv(prv) {
4901
4865
  try {
4902
4866
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4903
4867
  const ptr0 = passArray8ToWasm0(prv, wasm.__wbindgen_export);
4904
4868
  const len0 = WASM_VECTOR_LEN;
4905
- wasm.wrappsbt_signWithPrv(retptr, this.__wbg_ptr, ptr0, len0);
4869
+ wasm.wrappsbt_sign_with_prv(retptr, this.__wbg_ptr, ptr0, len0);
4906
4870
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4907
4871
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4908
4872
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -4918,12 +4882,12 @@ export class WrapPsbt {
4918
4882
  * @param {string} xprv
4919
4883
  * @returns {any}
4920
4884
  */
4921
- signWithXprv(xprv) {
4885
+ sign_with_xprv(xprv) {
4922
4886
  try {
4923
4887
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4924
4888
  const ptr0 = passStringToWasm0(xprv, wasm.__wbindgen_export, wasm.__wbindgen_export2);
4925
4889
  const len0 = WASM_VECTOR_LEN;
4926
- wasm.wrappsbt_signWithXprv(retptr, this.__wbg_ptr, ptr0, len0);
4890
+ wasm.wrappsbt_sign_with_xprv(retptr, this.__wbg_ptr, ptr0, len0);
4927
4891
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4928
4892
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4929
4893
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -4936,15 +4900,14 @@ export class WrapPsbt {
4936
4900
  }
4937
4901
  }
4938
4902
  /**
4939
- * Get the unsigned transaction ID as a hex string
4940
4903
  * @returns {string}
4941
4904
  */
4942
- unsignedTxId() {
4905
+ unsigned_tx_id() {
4943
4906
  let deferred1_0;
4944
4907
  let deferred1_1;
4945
4908
  try {
4946
4909
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4947
- wasm.wrappsbt_unsignedTxId(retptr, this.__wbg_ptr);
4910
+ wasm.wrappsbt_unsigned_tx_id(retptr, this.__wbg_ptr);
4948
4911
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4949
4912
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4950
4913
  deferred1_0 = r0;
@@ -4959,11 +4922,11 @@ export class WrapPsbt {
4959
4922
  * @param {number} input_index
4960
4923
  * @param {WrapDescriptor} descriptor
4961
4924
  */
4962
- updateInputWithDescriptor(input_index, descriptor) {
4925
+ update_input_with_descriptor(input_index, descriptor) {
4963
4926
  try {
4964
4927
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4965
4928
  _assertClass(descriptor, WrapDescriptor);
4966
- wasm.wrappsbt_updateInputWithDescriptor(retptr, this.__wbg_ptr, input_index, descriptor.__wbg_ptr);
4929
+ wasm.wrappsbt_update_input_with_descriptor(retptr, this.__wbg_ptr, input_index, descriptor.__wbg_ptr);
4967
4930
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4968
4931
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4969
4932
  if (r1) {
@@ -4977,11 +4940,11 @@ export class WrapPsbt {
4977
4940
  * @param {number} output_index
4978
4941
  * @param {WrapDescriptor} descriptor
4979
4942
  */
4980
- updateOutputWithDescriptor(output_index, descriptor) {
4943
+ update_output_with_descriptor(output_index, descriptor) {
4981
4944
  try {
4982
4945
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
4983
4946
  _assertClass(descriptor, WrapDescriptor);
4984
- wasm.wrappsbt_updateOutputWithDescriptor(retptr, this.__wbg_ptr, output_index, descriptor.__wbg_ptr);
4947
+ wasm.wrappsbt_update_output_with_descriptor(retptr, this.__wbg_ptr, output_index, descriptor.__wbg_ptr);
4985
4948
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
4986
4949
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
4987
4950
  if (r1) {
@@ -4992,21 +4955,16 @@ export class WrapPsbt {
4992
4955
  }
4993
4956
  }
4994
4957
  /**
4995
- * Validate a signature at a specific input against a pubkey
4996
- * Returns true if the signature is valid
4997
- *
4998
- * This method handles both ECDSA (legacy/SegWit) and Schnorr (Taproot) signatures.
4999
- * The pubkey should be provided as bytes (33 bytes for compressed ECDSA, 32 bytes for x-only Schnorr).
5000
4958
  * @param {number} input_index
5001
4959
  * @param {Uint8Array} pubkey
5002
4960
  * @returns {boolean}
5003
4961
  */
5004
- validateSignatureAtInput(input_index, pubkey) {
4962
+ validate_signature_at_input(input_index, pubkey) {
5005
4963
  try {
5006
4964
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
5007
4965
  const ptr0 = passArray8ToWasm0(pubkey, wasm.__wbindgen_export);
5008
4966
  const len0 = WASM_VECTOR_LEN;
5009
- wasm.wrappsbt_validateSignatureAtInput(retptr, this.__wbg_ptr, input_index, ptr0, len0);
4967
+ wasm.wrappsbt_validate_signature_at_input(retptr, this.__wbg_ptr, input_index, ptr0, len0);
5010
4968
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
5011
4969
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
5012
4970
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -5037,11 +4995,11 @@ export class WrapPsbt {
5037
4995
  * @param {WasmBIP32} key
5038
4996
  * @returns {boolean}
5039
4997
  */
5040
- verifySignatureWithKey(input_index, key) {
4998
+ verify_signature_with_key(input_index, key) {
5041
4999
  try {
5042
5000
  const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
5043
5001
  _assertClass(key, WasmBIP32);
5044
- wasm.wrappsbt_verifySignatureWithKey(retptr, this.__wbg_ptr, input_index, key.__wbg_ptr);
5002
+ wasm.wrappsbt_verify_signature_with_key(retptr, this.__wbg_ptr, input_index, key.__wbg_ptr);
5045
5003
  var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
5046
5004
  var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
5047
5005
  var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
@@ -5054,7 +5012,6 @@ export class WrapPsbt {
5054
5012
  }
5055
5013
  }
5056
5014
  /**
5057
- * Get the transaction version
5058
5015
  * @returns {number}
5059
5016
  */
5060
5017
  version() {
Binary file
@@ -42,37 +42,37 @@ export const wrapminiscript_fromString: (a: number, b: number, c: number, d: num
42
42
  export const wrapminiscript_node: (a: number, b: number) => void;
43
43
  export const wrapminiscript_toAsmString: (a: number, b: number) => void;
44
44
  export const wrapminiscript_toString: (a: number, b: number) => void;
45
- export const wrappsbt_addInput: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number) => void;
46
- export const wrappsbt_addInputAtIndex: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: number, j: number) => void;
47
- export const wrappsbt_addOutput: (a: number, b: number, c: number, d: bigint) => number;
48
- export const wrappsbt_addOutputAtIndex: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
45
+ export const wrappsbt_add_input: (a: number, b: number, c: number, d: number, e: number, f: bigint, g: number, h: number, i: number) => void;
46
+ export const wrappsbt_add_input_at_index: (a: number, b: number, c: number, d: number, e: number, f: number, g: bigint, h: number, i: number, j: number) => void;
47
+ export const wrappsbt_add_output: (a: number, b: number, c: number, d: bigint) => number;
48
+ export const wrappsbt_add_output_at_index: (a: number, b: number, c: number, d: number, e: number, f: bigint) => void;
49
49
  export const wrappsbt_clone: (a: number) => number;
50
50
  export const wrappsbt_deserialize: (a: number, b: number, c: number) => void;
51
- export const wrappsbt_extractTransaction: (a: number, b: number) => void;
52
- export const wrappsbt_finalize: (a: number, b: number) => void;
53
- export const wrappsbt_getGlobalXpubs: (a: number) => number;
54
- export const wrappsbt_getInputs: (a: number, b: number) => void;
55
- export const wrappsbt_getOutputs: (a: number, b: number) => void;
56
- export const wrappsbt_getOutputsWithAddress: (a: number, b: number, c: number, d: number) => void;
57
- export const wrappsbt_getPartialSignatures: (a: number, b: number, c: number) => void;
58
- export const wrappsbt_getUnsignedTx: (a: number, b: number) => void;
59
- export const wrappsbt_hasPartialSignatures: (a: number, b: number, c: number) => void;
60
- export const wrappsbt_inputCount: (a: number) => number;
61
- export const wrappsbt_lockTime: (a: number) => number;
51
+ export const wrappsbt_extract_transaction: (a: number, b: number) => void;
52
+ export const wrappsbt_finalize_mut: (a: number, b: number) => void;
53
+ export const wrappsbt_get_global_xpubs: (a: number) => number;
54
+ export const wrappsbt_get_inputs: (a: number, b: number) => void;
55
+ export const wrappsbt_get_outputs: (a: number, b: number) => void;
56
+ export const wrappsbt_get_outputs_with_address: (a: number, b: number, c: number, d: number) => void;
57
+ export const wrappsbt_get_partial_signatures: (a: number, b: number, c: number) => void;
58
+ export const wrappsbt_get_unsigned_tx: (a: number, b: number) => void;
59
+ export const wrappsbt_has_partial_signatures: (a: number, b: number, c: number) => void;
60
+ export const wrappsbt_input_count: (a: number) => number;
61
+ export const wrappsbt_lock_time: (a: number) => number;
62
62
  export const wrappsbt_new: (a: number, b: number) => number;
63
- export const wrappsbt_outputCount: (a: number) => number;
64
- export const wrappsbt_removeInput: (a: number, b: number, c: number) => void;
65
- export const wrappsbt_removeOutput: (a: number, b: number, c: number) => void;
63
+ export const wrappsbt_output_count: (a: number) => number;
64
+ export const wrappsbt_remove_input: (a: number, b: number, c: number) => void;
65
+ export const wrappsbt_remove_output: (a: number, b: number, c: number) => void;
66
66
  export const wrappsbt_serialize: (a: number, b: number) => void;
67
- export const wrappsbt_signAll: (a: number, b: number, c: number) => void;
68
- export const wrappsbt_signAllWithEcpair: (a: number, b: number, c: number) => void;
69
- export const wrappsbt_signWithPrv: (a: number, b: number, c: number, d: number) => void;
70
- export const wrappsbt_signWithXprv: (a: number, b: number, c: number, d: number) => void;
71
- export const wrappsbt_unsignedTxId: (a: number, b: number) => void;
72
- export const wrappsbt_updateInputWithDescriptor: (a: number, b: number, c: number, d: number) => void;
73
- export const wrappsbt_updateOutputWithDescriptor: (a: number, b: number, c: number, d: number) => void;
74
- export const wrappsbt_validateSignatureAtInput: (a: number, b: number, c: number, d: number, e: number) => void;
75
- export const wrappsbt_verifySignatureWithKey: (a: number, b: number, c: number, d: number) => void;
67
+ export const wrappsbt_sign_all: (a: number, b: number, c: number) => void;
68
+ export const wrappsbt_sign_all_with_ecpair: (a: number, b: number, c: number) => void;
69
+ export const wrappsbt_sign_with_prv: (a: number, b: number, c: number, d: number) => void;
70
+ export const wrappsbt_sign_with_xprv: (a: number, b: number, c: number, d: number) => void;
71
+ export const wrappsbt_unsigned_tx_id: (a: number, b: number) => void;
72
+ export const wrappsbt_update_input_with_descriptor: (a: number, b: number, c: number, d: number) => void;
73
+ export const wrappsbt_update_output_with_descriptor: (a: number, b: number, c: number, d: number) => void;
74
+ export const wrappsbt_validate_signature_at_input: (a: number, b: number, c: number, d: number, e: number) => void;
75
+ export const wrappsbt_verify_signature_with_key: (a: number, b: number, c: number, d: number) => void;
76
76
  export const wrappsbt_version: (a: number) => number;
77
77
  export const __wbg_wasmdashtransaction_free: (a: number, b: number) => void;
78
78
  export const __wbg_wasmtransaction_free: (a: number, b: number) => void;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@bitgo/wasm-utxo",
3
3
  "description": "WebAssembly wrapper for rust-bitcoin (beta)",
4
- "version": "2.1.0",
4
+ "version": "3.0.0",
5
5
  "type": "module",
6
6
  "repository": {
7
7
  "type": "git",