@owney/sdk 0.7.28-beta.7 → 0.7.28-beta.8
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 +11 -1
- package/dist/index.js +11 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -351,6 +351,9 @@ var NAME_TO_CHAIN_ID = Object.entries(
|
|
|
351
351
|
acc[name.toLowerCase()] = Number(id);
|
|
352
352
|
return acc;
|
|
353
353
|
}, {});
|
|
354
|
+
NAME_TO_CHAIN_ID.mainnet = 1;
|
|
355
|
+
NAME_TO_CHAIN_ID["ethereum mainnet"] = 1;
|
|
356
|
+
NAME_TO_CHAIN_ID["arbitrum one"] = 42161;
|
|
354
357
|
function resolveChainId(chain) {
|
|
355
358
|
const asNum = Number(chain);
|
|
356
359
|
if (Number.isFinite(asNum) && asNum > 0) return asNum;
|
|
@@ -3483,7 +3486,14 @@ async function executeSwap(deps, options) {
|
|
|
3483
3486
|
try {
|
|
3484
3487
|
result = quote.rail === "classic" ? await runClassic(deps, options) : quote.rail === "fusion" ? await runSameChainFusion(deps, options, walletAddress) : await runFusion(deps, options, walletAddress);
|
|
3485
3488
|
} catch (error) {
|
|
3486
|
-
if (!stoppedWatching(error))
|
|
3489
|
+
if (!stoppedWatching(error)) {
|
|
3490
|
+
if (quote.rail !== "fusion") throw error;
|
|
3491
|
+
const now = await deps.readTargetBalance().catch(() => before);
|
|
3492
|
+
if (now <= before) throw error;
|
|
3493
|
+
debugLog("owney-sdk", "swap: rail said no but the funds are here", {
|
|
3494
|
+
message: error instanceof Error ? error.message : String(error)
|
|
3495
|
+
});
|
|
3496
|
+
}
|
|
3487
3497
|
railError = error;
|
|
3488
3498
|
debugLog("owney-sdk", "swap: rail failed, checking whether funds landed", {
|
|
3489
3499
|
message: error instanceof Error ? error.message : String(error)
|
package/dist/index.js
CHANGED
|
@@ -311,6 +311,9 @@ var NAME_TO_CHAIN_ID = Object.entries(
|
|
|
311
311
|
acc[name.toLowerCase()] = Number(id);
|
|
312
312
|
return acc;
|
|
313
313
|
}, {});
|
|
314
|
+
NAME_TO_CHAIN_ID.mainnet = 1;
|
|
315
|
+
NAME_TO_CHAIN_ID["ethereum mainnet"] = 1;
|
|
316
|
+
NAME_TO_CHAIN_ID["arbitrum one"] = 42161;
|
|
314
317
|
function resolveChainId(chain) {
|
|
315
318
|
const asNum = Number(chain);
|
|
316
319
|
if (Number.isFinite(asNum) && asNum > 0) return asNum;
|
|
@@ -3453,7 +3456,14 @@ async function executeSwap(deps, options) {
|
|
|
3453
3456
|
try {
|
|
3454
3457
|
result = quote.rail === "classic" ? await runClassic(deps, options) : quote.rail === "fusion" ? await runSameChainFusion(deps, options, walletAddress) : await runFusion(deps, options, walletAddress);
|
|
3455
3458
|
} catch (error) {
|
|
3456
|
-
if (!stoppedWatching(error))
|
|
3459
|
+
if (!stoppedWatching(error)) {
|
|
3460
|
+
if (quote.rail !== "fusion") throw error;
|
|
3461
|
+
const now = await deps.readTargetBalance().catch(() => before);
|
|
3462
|
+
if (now <= before) throw error;
|
|
3463
|
+
debugLog("owney-sdk", "swap: rail said no but the funds are here", {
|
|
3464
|
+
message: error instanceof Error ? error.message : String(error)
|
|
3465
|
+
});
|
|
3466
|
+
}
|
|
3457
3467
|
railError = error;
|
|
3458
3468
|
debugLog("owney-sdk", "swap: rail failed, checking whether funds landed", {
|
|
3459
3469
|
message: error instanceof Error ? error.message : String(error)
|