You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
mdk.com side:
- New checkout.waitForPayoutResult oRPC handler that blocks until the
programmatic_payout / withdrawal row identified by idempotencyKey or
paymentId reaches a terminal Lightning state. Two-path wake strategy:
fast in-process waiter on the live WS session (when on this task),
with a 2s DB poll as the cross-task backstop. On timeout the response
is {status:'REQUESTED'} so SDK callers can loop without try/catch.
- Refactors payment-waiters to Map<paymentId, Set<waiter>> so the
autopayout retry loop and an SDK caller can both subscribe to the
same paymentId outcome without one stealing it from the other. Each
waiter owns its own timer; one expiring doesn't disturb the others.
SDK (mdk-checkout/packages/core):
- waitForPayoutResult() export: server-only, loops the underlying RPC
when the caller's total budget exceeds the 25s per-call cap.
- programmaticPayout.amountSats is now optional: the SDK decodes the
amount locally for fixed-amount BOLT11 destinations. amountless
BOLT11, LNURL, lightning addresses, and BOLT12 still require an
explicit amountSats. Caller passing an amountSats that disagrees
with the BOLT11 is rejected up-front because lightning-js's
FixedAmount branch silently pays the BOLT11 amount.
- New bolt11.ts amount parser (msat-precise, sat-granular only).
Depends on @moneydevkit/api-contract@0.1.32 (PR #776). Until that is
published, package.json points at a local tarball; before final merge
this needs to swap back to "0.1.32" and the lockfile regenerated.
Includes 16 BOLT11 unit tests, 9 SDK waitForPayoutResult tests, 7
multi-subscriber waiter tests, 10 mdk.com handler tests, and the
existing payout/autopayout test suites still pass.
message: `BOLT11 invoice amount (${bolt11AmountSats} sats) does not match the amountSats passed (${options.amountSats}). Remove amountSats or pass the matching value.`,
195
+
retryable: false,
196
+
})
197
+
}
198
+
effectiveAmountSats=options.amountSats
199
+
}elseif(bolt11AmountSats!==null){
200
+
effectiveAmountSats=bolt11AmountSats
201
+
}else{
202
+
returnfailure({
203
+
code: 'amount_required',
204
+
message:
205
+
'amountSats is required for amountless BOLT11, LNURL, lightning address, and BOLT12 destinations.',
206
+
retryable: false,
207
+
})
208
+
}
209
+
148
210
constaccessToken=process.env.MDK_ACCESS_TOKEN
149
211
if(!accessToken){
150
212
returnfailure({
@@ -164,7 +226,7 @@ export async function programmaticPayout(
0 commit comments