@lawrenceliang-btc/atel-sdk 1.1.20 → 1.1.21
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 +3 -1
- package/package.json +1 -1
package/bin/atel.mjs
CHANGED
|
@@ -5772,7 +5772,9 @@ async function cmdTradeTask(capability, description) {
|
|
|
5772
5772
|
while (Date.now() - startTime < timeout) {
|
|
5773
5773
|
await new Promise(r => setTimeout(r, 3000));
|
|
5774
5774
|
try {
|
|
5775
|
-
const
|
|
5775
|
+
const pollResp = await fetch(`${PLATFORM_URL}/trade/v1/order/${orderId}`, { signal: AbortSignal.timeout(10000) });
|
|
5776
|
+
if (!pollResp.ok) throw new Error(`HTTP ${pollResp.status}`);
|
|
5777
|
+
const info = await pollResp.json();
|
|
5776
5778
|
if (info.status !== lastStatus) {
|
|
5777
5779
|
console.error(`[trade-task] Status: ${lastStatus} → ${info.status}`);
|
|
5778
5780
|
lastStatus = info.status;
|