@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.
- package/dist/index.cjs +2 -2
- package/dist/index.es.js +106 -122
- package/package.json +14 -14
- package/src/client/index.ts +15 -18
package/src/client/index.ts
CHANGED
|
@@ -411,25 +411,19 @@ export class SwapKitCore<T = ''> {
|
|
|
411
411
|
? undefined
|
|
412
412
|
: assetValue;
|
|
413
413
|
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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 = ({
|