@forgesworn/moneyer 0.3.0 → 0.3.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # Changelog
2
2
 
3
+ ## [0.3.1] - 2026-08-22
4
+
5
+ - **Rounding the fee to a whole sat now really is the default.** 0.3.0
6
+ documented `roundFeeToSat` as on unless turned off, and made it so for a
7
+ mint started from the CLI, where the environment reader fills the
8
+ default in. A mint built by calling `createMoneyer` with a config object
9
+ passes the field through as absent, and the server read absent as off -
10
+ so an embedder got a mint that kept fractions of a sat while the same
11
+ mint from the binary rounded them away. Absent now means on in both,
12
+ and only an explicit `false` opts out.
13
+
14
+ It hid because every test that cared about rounding set the flag
15
+ explicitly, so nothing exercised the default through the library at all.
16
+ Found from the other side: notecase's cross-implementation suite began
17
+ asserting what a wallet is actually credited, and the mint it builds in
18
+ process disagreed with the mint on the wire.
19
+
3
20
  ## [0.3.0] - 2026-08-22
4
21
 
5
22
  - **The mint fee is now ceilinged to a whole sat by default.**
package/dist/server.js CHANGED
@@ -92,7 +92,13 @@ export const createMoneyer = async (config, deps = {}) => {
92
92
  const exact = grossMsat - applyMintFee(grossMsat, config.mintFee);
93
93
  // Both readings sit inside lnurlcash-kit's mintFeeBand, so a wallet
94
94
  // is not misled either way - it is told the range up front.
95
- return config.roundFeeToSat === true ? Math.ceil(exact / 1000) * 1000 : exact;
95
+ //
96
+ // Absent means ON, the same as DEFAULTS and MONEYER_ROUND_FEE_TO_SAT:
97
+ // only an explicit false opts out. Reading it as `=== true` made the
98
+ // library default differ from the binary's, so a mint built by calling
99
+ // createMoneyer kept fractions of a sat that the same mint started from
100
+ // the CLI would have rounded.
101
+ return config.roundFeeToSat !== false ? Math.ceil(exact / 1000) * 1000 : exact;
96
102
  };
97
103
  // Every quote and every credit goes through here, so the fee posture
98
104
  // cannot drift between what is advertised and what is withheld.
@@ -116,7 +122,7 @@ export const createMoneyer = async (config, deps = {}) => {
116
122
  const mintFeeLine = config.mintFee ? `Mint fees: ${config.mintFee.baseFeeMsat},${config.mintFee.feePpm}` : null;
117
123
  // The same fee for a person: "Mint fees: 5000,1000" is for wallets that
118
124
  // parse LUD-25, and reads as nonsense to anyone who does not.
119
- const feeInWords = config.mintFee ? describeFee(config.mintFee, config.roundFeeToSat === true) : null;
125
+ const feeInWords = config.mintFee ? describeFee(config.mintFee, config.roundFeeToSat !== false) : null;
120
126
  const nostr = config.zap ? (deps.nostr ?? poolTransport()) : null;
121
127
  const zap = config.zap && nostr
122
128
  ? createZapBridge({
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@forgesworn/moneyer",
3
- "version": "0.3.0",
3
+ "version": "0.3.1",
4
4
  "description": "An LNURLcash (LUD-25) mint - strikes Lightning bearer notes. Independent implementation, cln/lnd funding sources, SQLite, zero HTTP framework.",
5
5
  "author": "TheCryptoDonkey",
6
6
  "license": "MIT",