@openreceive/node 0.3.1 → 0.3.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.
- package/dist/{chunk-6HALOJYF.js → chunk-SDCOJGCF.js} +3 -7
- package/dist/cli.js +1 -1
- package/dist/index.d.ts +6 -4
- package/dist/index.js +1 -1
- package/package.json +2 -2
|
@@ -583,13 +583,6 @@ function normalizeFixedFloatStatus(status, emergency, refundTxId) {
|
|
|
583
583
|
attention_reason: "provider_reported_emergency"
|
|
584
584
|
};
|
|
585
585
|
}
|
|
586
|
-
if (emergencyStatuses.includes("MORE") || emergencyStatuses.includes("OVER") || emergencyStatuses.includes("OVERPAID")) {
|
|
587
|
-
return {
|
|
588
|
-
state: "attention",
|
|
589
|
-
attention: true,
|
|
590
|
-
attention_reason: "provider_reported_emergency"
|
|
591
|
-
};
|
|
592
|
-
}
|
|
593
586
|
return {
|
|
594
587
|
state: "refund_required",
|
|
595
588
|
...refundReason === void 0 ? {} : { refund_reason: refundReason }
|
|
@@ -600,9 +593,12 @@ function normalizeFixedFloatStatus(status, emergency, refundTxId) {
|
|
|
600
593
|
}
|
|
601
594
|
function refundReasonFromEmergencyStatuses(statuses) {
|
|
602
595
|
const less = statuses.includes("LESS");
|
|
596
|
+
const more = statuses.includes("MORE") || statuses.includes("OVER") || statuses.includes("OVERPAID");
|
|
603
597
|
const expired = statuses.includes("EXPIRED");
|
|
604
598
|
if (less && expired) return "underpaid_and_late";
|
|
599
|
+
if (more && expired) return "overpaid_and_late";
|
|
605
600
|
if (less) return "underpaid";
|
|
601
|
+
if (more) return "overpaid";
|
|
606
602
|
if (expired) return "late_deposit";
|
|
607
603
|
return void 0;
|
|
608
604
|
}
|
package/dist/cli.js
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -180,10 +180,12 @@ type SwapAvailabilityReason = "provider_unconfigured" | "amount_too_small" | "am
|
|
|
180
180
|
type SwapAttentionReason = "provider_completed_without_wallet_settlement" | "provider_order_creation_stale" | "provider_order_creation_failed" | "provider_order_creation_needs_reconcile" | "provider_reported_emergency" | "provider_status_unrecognized" | "provider_order_expires_after_shadow_invoice";
|
|
181
181
|
/**
|
|
182
182
|
* Why a swap attempt entered the refund path (`refund_required` → `refunded`).
|
|
183
|
-
* Mapped from FixedFloat `emergency.status` (LESS / EXPIRED).
|
|
184
|
-
*
|
|
183
|
+
* Mapped from FixedFloat `emergency.status` (LESS / MORE / EXPIRED). An overpay
|
|
184
|
+
* refunds the WHOLE deposit like every other emergency: the payout is a
|
|
185
|
+
* fixed-amount bolt11, so there is nothing to exchange the surplus into and
|
|
186
|
+
* `choice=EXCHANGE` is not a path this client takes.
|
|
185
187
|
*/
|
|
186
|
-
type SwapRefundReason = "underpaid" | "late_deposit" | "underpaid_and_late";
|
|
188
|
+
type SwapRefundReason = "underpaid" | "overpaid" | "late_deposit" | "underpaid_and_late" | "overpaid_and_late";
|
|
187
189
|
interface SwapQuote {
|
|
188
190
|
readonly pay_amount?: string;
|
|
189
191
|
readonly minimum_pay_amount?: string;
|
|
@@ -239,7 +241,7 @@ interface SwapOrder {
|
|
|
239
241
|
readonly attention_reason?: SwapAttentionReason;
|
|
240
242
|
/**
|
|
241
243
|
* Why a refund is needed, when the attempt is on the refund path. Mapped from
|
|
242
|
-
* FixedFloat `emergency.status` (LESS / EXPIRED).
|
|
244
|
+
* FixedFloat `emergency.status` (LESS / MORE / EXPIRED).
|
|
243
245
|
*/
|
|
244
246
|
readonly refund_reason?: SwapRefundReason;
|
|
245
247
|
/**
|
package/dist/index.js
CHANGED
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
sanitizeEvent,
|
|
13
13
|
summarizeSwapProviderApiRequest,
|
|
14
14
|
summarizeSwapProviderApiResponse
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SDCOJGCF.js";
|
|
16
16
|
|
|
17
17
|
// src/index.ts
|
|
18
18
|
import { OpenReceiveError as OpenReceiveError4 } from "@openreceive/core";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@openreceive/node",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.2",
|
|
4
4
|
"description": "The OpenReceive Node service: receive-only NWC wallet client, checkout and swap service, pricing, and the openreceive CLI.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bitcoin",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
"types": "./dist/index.d.ts",
|
|
18
18
|
"dependencies": {
|
|
19
19
|
"@getalby/sdk": "^8.0.3",
|
|
20
|
-
"@openreceive/core": "0.3.
|
|
20
|
+
"@openreceive/core": "0.3.2"
|
|
21
21
|
},
|
|
22
22
|
"bin": {
|
|
23
23
|
"openreceive": "./bin/openreceive.mjs"
|