bsv-wallet 0.2.1 → 0.2.2

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 640f3d2d34c8ef7a9acbaa3680904bae8507d091b251213fcb1fd7d3dd4e1796
4
- data.tar.gz: f0fdf19e4128bace6be1dd7a09c0c9bf0c63a5a9bb4699e1c3736b8263d5ffc1
3
+ metadata.gz: c1c9a3b59c2d83b14456fcdc7e4eb9f26ad8a5cd4094bc1dd192b26e69903d2b
4
+ data.tar.gz: 3fa4584de7d5f3ce782468aa9243ffc80ddc7106b1da6ed11b7d0a97250c2a29
5
5
  SHA512:
6
- metadata.gz: e46a2a8781c325707ec1bfa6de79bb7f1c84ea8a5b904237ad1080d9cf2d22a3ac80d31111304bd9ed3138bd9418ba0efe2d77f0c0554476a011ef7308f68ccb
7
- data.tar.gz: a238543de60ded0e911eb564c34fb47f4b5367c0570fd4d0fabefa02327caa2141ff9ba6d09308e6478692541446ae367934d095d321421c7ae13e02ac48fd39
6
+ metadata.gz: 500bec40cbe5fbf13f325e975522ec467a87d8ddef268a88cc6f4f35f429d75d27b1fd7adbd0f085668d21c79ddef1a19270b5502296e4dcc35fa74031f27b0f
7
+ data.tar.gz: b0dd2838de3f000c5dadd73cb9ce3b6e5575e7c224a4397dbdb0ce2cfd73afdd2cb0366e6805faa035a3375560d3fe2b5ede49a82ae77e494957eb9549cd7727
@@ -2,6 +2,6 @@
2
2
 
3
3
  module BSV
4
4
  module WalletInterface
5
- VERSION = '0.2.1'
5
+ VERSION = '0.2.2'
6
6
  end
7
7
  end
@@ -520,6 +520,10 @@ module BSV
520
520
 
521
521
  input.source_satoshis = stored[:satoshis]
522
522
  input.source_locking_script = BSV::Script::Script.from_hex(stored[:locking_script])
523
+
524
+ return unless stored[:source_tx_hex]
525
+
526
+ input.source_transaction = BSV::Transaction::Transaction.from_hex(stored[:source_tx_hex])
523
527
  end
524
528
 
525
529
  def build_outputs(tx, outputs)
@@ -601,6 +605,8 @@ module BSV
601
605
  def store_tracked_outputs(txid, tx, output_specs)
602
606
  return unless output_specs
603
607
 
608
+ tx_hex = tx.to_hex
609
+
604
610
  output_specs.each do |spec|
605
611
  next unless spec[:basket]
606
612
 
@@ -617,7 +623,8 @@ module BSV
617
623
  basket: spec[:basket],
618
624
  tags: spec[:tags] || [],
619
625
  custom_instructions: spec[:custom_instructions],
620
- spendable: true
626
+ spendable: true,
627
+ source_tx_hex: tx_hex
621
628
  })
622
629
  end
623
630
  end
@@ -660,6 +667,7 @@ module BSV
660
667
 
661
668
  def process_internalize_outputs(tx, output_specs)
662
669
  txid = tx.txid_hex
670
+ tx_hex = tx.to_hex
663
671
 
664
672
  output_specs.each do |spec|
665
673
  output_index = spec[:output_index]
@@ -668,16 +676,16 @@ module BSV
668
676
 
669
677
  case spec[:protocol]
670
678
  when 'wallet payment'
671
- internalize_payment(txid, output_index, tx_output, spec[:payment_remittance])
679
+ internalize_payment(txid, output_index, tx_output, spec[:payment_remittance], tx_hex)
672
680
  when 'basket insertion'
673
- internalize_basket(txid, output_index, tx_output, spec[:insertion_remittance])
681
+ internalize_basket(txid, output_index, tx_output, spec[:insertion_remittance], tx_hex)
674
682
  else
675
683
  raise InvalidParameterError.new('protocol', '"wallet payment" or "basket insertion"')
676
684
  end
677
685
  end
678
686
  end
679
687
 
680
- def internalize_payment(txid, output_index, tx_output, remittance)
688
+ def internalize_payment(txid, output_index, tx_output, remittance, tx_hex = nil)
681
689
  unless remittance
682
690
  raise InvalidParameterError.new('payment_remittance',
683
691
  'present for wallet payment protocol')
@@ -705,11 +713,12 @@ module BSV
705
713
  spendable: true,
706
714
  sender_identity_key: sender_key,
707
715
  derivation_prefix: prefix,
708
- derivation_suffix: suffix
716
+ derivation_suffix: suffix,
717
+ source_tx_hex: tx_hex
709
718
  })
710
719
  end
711
720
 
712
- def internalize_basket(txid, output_index, tx_output, remittance)
721
+ def internalize_basket(txid, output_index, tx_output, remittance, tx_hex = nil)
713
722
  unless remittance
714
723
  raise InvalidParameterError.new('insertion_remittance',
715
724
  'present for basket insertion protocol')
@@ -724,7 +733,8 @@ module BSV
724
733
  basket: remittance[:basket],
725
734
  tags: remittance[:tags] || [],
726
735
  custom_instructions: remittance[:custom_instructions],
727
- spendable: true
736
+ spendable: true,
737
+ source_tx_hex: tx_hex
728
738
  })
729
739
  end
730
740
 
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bsv-wallet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Bettison
8
8
  bindir: bin
9
9
  cert_chain: []
10
- date: 2026-04-05 00:00:00.000000000 Z
10
+ date: 2026-04-06 00:00:00.000000000 Z
11
11
  dependencies:
12
12
  - !ruby/object:Gem::Dependency
13
13
  name: base64