@swapkit/core 1.0.0-rc.26 → 1.0.0-rc.28

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.
@@ -411,25 +411,19 @@ export class SwapKitCore<T = ''> {
411
411
  ? undefined
412
412
  : assetValue;
413
413
 
414
- try {
415
- const txHash = await this.#depositToPool({
416
- assetValue: getMinAmountByChain(from === 'asset' ? assetValue.chain : Chain.THORChain),
417
- memo:
418
- memo ||
419
- getMemoFor(MemoType.WITHDRAW, {
420
- symbol: assetValue.symbol,
421
- chain: assetValue.chain,
422
- ticker: assetValue.ticker,
423
- basisPoints: Math.max(10000, Math.round(percent * 100)),
424
- targetAssetString: targetAsset?.toString(),
425
- singleSide: false,
426
- }),
414
+ const value = getMinAmountByChain(from === 'asset' ? assetValue.chain : Chain.THORChain);
415
+ const memoString =
416
+ memo ||
417
+ getMemoFor(MemoType.WITHDRAW, {
418
+ symbol: assetValue.symbol,
419
+ chain: assetValue.chain,
420
+ ticker: assetValue.ticker,
421
+ basisPoints: Math.max(10000, Math.round(percent * 100)),
422
+ targetAssetString: targetAsset?.toString(),
423
+ singleSide: false,
427
424
  });
428
425
 
429
- return txHash;
430
- } catch (error) {
431
- throw new SwapKitError('core_transaction_withdraw_error', error);
432
- }
426
+ return this.#depositToPool({ assetValue: value, memo: memoString });
433
427
  };
434
428
 
435
429
  savings = async ({
@@ -452,7 +446,10 @@ export class SwapKitCore<T = ''> {
452
446
  basisPoints: percent ? Math.min(10000, Math.round(percent * 100)) : undefined,
453
447
  });
454
448
 
455
- return this.#depositToPool({ assetValue, memo: memoString });
449
+ const value =
450
+ memoType === MemoType.DEPOSIT ? assetValue : getMinAmountByChain(assetValue.chain);
451
+
452
+ return this.#depositToPool({ memo: memoString, assetValue: value });
456
453
  };
457
454
 
458
455
  loan = ({