@pafi-dev/issuer 0.28.1 → 0.29.0
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/index.cjs +37 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +37 -7
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -2424,13 +2424,43 @@ async function handleClaimStatus(params) {
|
|
|
2424
2424
|
lock.userOpHash
|
|
2425
2425
|
);
|
|
2426
2426
|
if (receipt) {
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2427
|
+
if (receipt.success && receipt.txHash) {
|
|
2428
|
+
if (!lock.tokenAddress) {
|
|
2429
|
+
params.onWarning?.(
|
|
2430
|
+
`handleClaimStatus: lock ${lock.lockId} has no tokenAddress; falling back to status-only flip (PACI5-24 defence degraded). Migrate the ledger to the multi-token schema.`
|
|
2431
|
+
);
|
|
2432
|
+
await params.ledger.updateMintStatus(lock.lockId, "MINTED", receipt.txHash).catch((err) => {
|
|
2433
|
+
params.onWarning?.(
|
|
2434
|
+
`handleClaimStatus: ledger updateMintStatus failed for lock ${lock.lockId}: ${err}`
|
|
2435
|
+
);
|
|
2436
|
+
});
|
|
2437
|
+
status = "MINTED";
|
|
2438
|
+
txHash = receipt.txHash;
|
|
2439
|
+
} else {
|
|
2440
|
+
try {
|
|
2441
|
+
await params.ledger.deductBalance(
|
|
2442
|
+
lock.userAddress,
|
|
2443
|
+
lock.amount,
|
|
2444
|
+
receipt.txHash,
|
|
2445
|
+
lock.tokenAddress
|
|
2446
|
+
);
|
|
2447
|
+
status = "MINTED";
|
|
2448
|
+
txHash = receipt.txHash;
|
|
2449
|
+
} catch (deductErr) {
|
|
2450
|
+
params.onWarning?.(
|
|
2451
|
+
`handleClaimStatus: deductBalance failed for lock ${lock.lockId}: ${deductErr}`
|
|
2452
|
+
);
|
|
2453
|
+
}
|
|
2454
|
+
}
|
|
2455
|
+
} else {
|
|
2456
|
+
await params.ledger.updateMintStatus(lock.lockId, "FAILED", receipt.txHash).catch((err) => {
|
|
2457
|
+
params.onWarning?.(
|
|
2458
|
+
`handleClaimStatus: ledger updateMintStatus failed for lock ${lock.lockId}: ${err}`
|
|
2459
|
+
);
|
|
2460
|
+
});
|
|
2461
|
+
status = "FAILED";
|
|
2462
|
+
txHash = receipt.txHash;
|
|
2463
|
+
}
|
|
2434
2464
|
}
|
|
2435
2465
|
} catch (err) {
|
|
2436
2466
|
params.onWarning?.(
|