@lawrenceliang-btc/atel-sdk 1.1.39 → 1.1.40
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/bin/atel.mjs +15 -9
- package/package.json +1 -1
package/bin/atel.mjs
CHANGED
|
@@ -3642,15 +3642,21 @@ Format:
|
|
|
3642
3642
|
// When executor receives the final milestone_verified for a fast-coop order,
|
|
3643
3643
|
// sign and submit Escrow::Submit on Fast staging so the Platform can Complete.
|
|
3644
3644
|
if (event === 'milestone_verified' && payload.allComplete === true) {
|
|
3645
|
-
const
|
|
3646
|
-
|
|
3647
|
-
|
|
3648
|
-
|
|
3649
|
-
|
|
3650
|
-
|
|
3651
|
-
|
|
3652
|
-
|
|
3653
|
-
|
|
3645
|
+
const fastOrderId = body.orderId || payload.orderId || '';
|
|
3646
|
+
if (fastOrderId) {
|
|
3647
|
+
// Payload may not include chain — fetch order to check
|
|
3648
|
+
try {
|
|
3649
|
+
const orderInfo = await fetchOrderState(fastOrderId);
|
|
3650
|
+
const orderChain = orderInfo?.chain || orderInfo?.Chain || '';
|
|
3651
|
+
if (orderChain === 'fast-coop') {
|
|
3652
|
+
log({ event: 'fast_submit_triggered', orderId: fastOrderId, chain: orderChain });
|
|
3653
|
+
submitFastDeliverable(fastOrderId, id).catch(e => {
|
|
3654
|
+
log({ event: 'fast_submit_error', orderId: fastOrderId, error: e.message });
|
|
3655
|
+
});
|
|
3656
|
+
}
|
|
3657
|
+
} catch (e) {
|
|
3658
|
+
log({ event: 'fast_submit_check_error', orderId: fastOrderId, error: e.message });
|
|
3659
|
+
}
|
|
3654
3660
|
}
|
|
3655
3661
|
}
|
|
3656
3662
|
|