fix: swapMarket / swapLimit

This commit is contained in:
Alex Kraiz
2024-01-04 11:21:04 +04:00
parent 994e6d44fa
commit 0633f9c113

View File

@@ -12,6 +12,8 @@ type PureDepositParams = Omit<DepositParams, 'unit'>
type PureWithdrawParams = Omit<WithdrawParams, 'unit'>
type PureGetSwapMarketInfoParams = Omit<GetSwapInfoParams, 'blockchainService' | 'aggregator'>
type PureGenerateSwapCalldataParams = Omit<GenerateSwapCalldataWithUnitParams, 'unit'>
type PureSwapLimitParams = Omit<SwapLimitParams, 'unit'>
type PureSwapMarketParams = Omit<SwapMarketParams, 'unit'>
export default class Exchange {
private readonly unit: Unit;
@@ -49,11 +51,17 @@ export default class Exchange {
})
}
public swapLimit(params: SwapLimitParams) {
return swapLimit(params);
public swapLimit(params: PureSwapLimitParams) {
return swapLimit({
...params,
unit: this.unit,
});
}
public swapMarket(params: SwapMarketParams) {
return swapMarket(params);
public swapMarket(params: PureSwapMarketParams) {
return swapMarket({
...params,
unit: this.unit,
});
}
}