openreceive-rails 0.4.30 → 0.4.31

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: c6b9ce658e10089f04741afa64838873fe84edcc3254b85bd74eee105ad9cf9f
4
- data.tar.gz: 010ec26e60b6a3e96156f72cb1bb6741bc04dfaf3aadd8225fa07aaa46dc8bdb
3
+ metadata.gz: 7ed29e7ec502193127f157c03582d68ba4bf77b0bb48a891ce8c65b0aa77b3bf
4
+ data.tar.gz: c357a325d594f4cc95ed767c6c1fd0f8a887791c4133227bceb381c02ba42247
5
5
  SHA512:
6
- metadata.gz: a32291c9f40f4a5661a9b11155a75d393fab2845d3b106ad584467674de32dc6c4cd4c7ce409b377eb8f72420bed758fcdaf00ef1b9060e2d8caf3c0eab1481c
7
- data.tar.gz: bb98ff774029c56c52b6470afdd03918582f878be831abe972cfcc1ef9975c39001e54fe7084963ccca09ab14a8ff3b4f123fdbd388edb47ff63c14d262f27cc
6
+ metadata.gz: f728ad2516e05b48ac5e16f840c4a9b338fb4514eb4c5a9246c13f1f911092fbe69a204b1a1dfe30ca733ad5c78a067c922d698d4bc398678c7d739f0551a707
7
+ data.tar.gz: 5136db0bf7ba725697dfd092455c97ce9c86c9f6ac85ae6c27aa9a41483f16350b3f435955c50ff36d90f47a2f1bcba28e42ee5ce24fb021ce784257123df5f2
data/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.4.31 - 2026-10-20
4
+
5
+ Release with the complete 0.4.31 package family. A reconcile pass now stops
6
+ once the wallet has listed every invoice it is looking for, unpaid ones
7
+ included, as the Node engine does. While a payer waits on an unpaid invoice,
8
+ a pass reads two pages of wallet history instead of three. An invoice the
9
+ wallet still lists as pending after expiry plus the grace still closes.
10
+
11
+ Requires `nwc-ruby ~> 0.4`. nwc-ruby 0.4.0 derives a connection's encryption
12
+ key once per client instead of on every wallet call and notification (about
13
+ 33 ms of pure-Ruby work each time, twice per call). The engine keeps one
14
+ client per process, so every reconcile pass, wallet history page and the
15
+ `openreceive:notifications` worker reuses it. No API or wire-format change.
16
+
17
+ The gem's summary names the optional USDT and USDC swaps.
18
+
3
19
  ## 0.4.30 - 2026-10-19
4
20
 
5
21
  Release with the complete 0.4.30 package family. No runtime changes from
@@ -5,6 +5,6 @@ module OpenReceive
5
5
  # top-level `::Rails` framework constant — engine code always references the framework as
6
6
  # `::Rails` to avoid shadowing.
7
7
  module Rails
8
- VERSION = "0.4.30"
8
+ VERSION = "0.4.31"
9
9
  end
10
10
  end
@@ -36,6 +36,21 @@ module OpenReceive
36
36
  window["anchor_offset"] = nil if overlap_only
37
37
  [results.values, false, false]
38
38
  end
39
+ # A fresh sweep certifies, from its start, every expected hash it saw
40
+ # pending or did not see at all: the proof that closes one after expiry.
41
+ complete = lambda do
42
+ if window.fetch("absence_safe")
43
+ expected.each do |hash|
44
+ observation = window.fetch("observations")[hash]
45
+ next if results.key?(hash) || %w[settled expired failed].include?(observation&.fetch("status"))
46
+
47
+ result = { "payment_hash" => hash, "status" => observation.nil? ? "not_found" : observation.fetch("status"), "_coverage_started_at" => window.fetch("started_at") }
48
+ result["details"] = { "transaction" => { "transaction_state" => observation["transaction_state"] } } unless observation.nil?
49
+ results[hash] = result
50
+ end
51
+ end
52
+ [results.values, true, false]
53
+ end
39
54
  max_pages.times do |page_number|
40
55
  break if Process.clock_gettime(Process::CLOCK_MONOTONIC) >= deadline
41
56
 
@@ -94,23 +109,15 @@ module OpenReceive
94
109
  previous = nil
95
110
  next
96
111
  end
97
- if window.fetch("absence_safe")
98
- expected.each do |hash|
99
- observation = window.fetch("observations")[hash]
100
- next if results.key?(hash) || %w[settled expired failed].include?(observation&.fetch("status"))
101
-
102
- result = { "payment_hash" => hash, "status" => observation.nil? ? "not_found" : observation.fetch("status"), "_coverage_started_at" => window.fetch("started_at") }
103
- result["details"] = { "transaction" => { "transaction_state" => observation["transaction_state"] } } unless observation.nil?
104
- results[hash] = result
105
- end
106
- end
107
- return [results.values, true, false]
112
+ return complete.call
108
113
  end
109
114
  return [results.values, false, true] if fingerprint == previous
110
115
 
111
116
  window.merge!("anchor_offset" => offset, "fingerprint" => fingerprint, "offset" => offset + physical)
112
117
  previous = fingerprint
113
- return [results.values, true, false] if expected.all? { |hash| %w[settled expired failed].include?(window.fetch("observations").dig(hash, "status")) }
118
+ # Every expected hash has been seen, pending ones too: a wallet lists
119
+ # each invoice once, so later pages cannot change what this walk found.
120
+ return complete.call if expected.all? { |hash| window.fetch("observations").key?(hash) }
114
121
  end
115
122
  continued.call
116
123
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: openreceive-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.30
4
+ version: 0.4.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - OpenReceive
@@ -15,28 +15,28 @@ dependencies:
15
15
  requirements:
16
16
  - - '='
17
17
  - !ruby/object:Gem::Version
18
- version: 0.4.30
18
+ version: 0.4.31
19
19
  type: :runtime
20
20
  prerelease: false
21
21
  version_requirements: !ruby/object:Gem::Requirement
22
22
  requirements:
23
23
  - - '='
24
24
  - !ruby/object:Gem::Version
25
- version: 0.4.30
25
+ version: 0.4.31
26
26
  - !ruby/object:Gem::Dependency
27
27
  name: openreceive-server
28
28
  requirement: !ruby/object:Gem::Requirement
29
29
  requirements:
30
30
  - - '='
31
31
  - !ruby/object:Gem::Version
32
- version: 0.4.30
32
+ version: 0.4.31
33
33
  type: :runtime
34
34
  prerelease: false
35
35
  version_requirements: !ruby/object:Gem::Requirement
36
36
  requirements:
37
37
  - - '='
38
38
  - !ruby/object:Gem::Version
39
- version: 0.4.30
39
+ version: 0.4.31
40
40
  - !ruby/object:Gem::Dependency
41
41
  name: rails
42
42
  requirement: !ruby/object:Gem::Requirement
@@ -57,14 +57,14 @@ dependencies:
57
57
  requirements:
58
58
  - - "~>"
59
59
  - !ruby/object:Gem::Version
60
- version: '0.3'
60
+ version: '0.4'
61
61
  type: :runtime
62
62
  prerelease: false
63
63
  version_requirements: !ruby/object:Gem::Requirement
64
64
  requirements:
65
65
  - - "~>"
66
66
  - !ruby/object:Gem::Version
67
- version: '0.3'
67
+ version: '0.4'
68
68
  - !ruby/object:Gem::Dependency
69
69
  name: sqlite3
70
70
  requirement: !ruby/object:Gem::Requirement
@@ -152,5 +152,6 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  requirements: []
153
153
  rubygems_version: 3.6.9
154
154
  specification_version: 4
155
- summary: Accept Bitcoin Lightning payments in Rails. Your app, your wallet.
155
+ summary: Accept Bitcoin Lightning payments in Rails, plus USDT and USDC through optional
156
+ swaps. Your app, your wallet.
156
157
  test_files: []