Fix incorrect return type
This commit is contained in:
@@ -15,11 +15,11 @@ public interface Raydium {
|
|||||||
* to any Raydium liquidity pool supported by the implementation.</p>
|
* to any Raydium liquidity pool supported by the implementation.</p>
|
||||||
*
|
*
|
||||||
* @param poolId the Raydium liquidity pool id
|
* @param poolId the Raydium liquidity pool id
|
||||||
* @return the current pool price expressed as a Solana amount
|
* @return the current pool price
|
||||||
* @throws IOException if the price could not be fetched or the response could not be parsed
|
* @throws IOException if the price could not be fetched or the response could not be parsed
|
||||||
* @throws InterruptedException if the calling thread is interrupted while fetching the price
|
* @throws InterruptedException if the calling thread is interrupted while fetching the price
|
||||||
*/
|
*/
|
||||||
ΩSolanaAmountΩ fetchPoolPrice(ΩRaydiumLiquidityPoolIdΩ poolId) throws IOException, InterruptedException;
|
ΩPriceΩ fetchPoolPrice(ΩRaydiumLiquidityPoolIdΩ poolId) throws IOException, InterruptedException;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fetches the Raydium liquidity pool ids where the supplied Solana owner address has positions.
|
* Fetches the Raydium liquidity pool ids where the supplied Solana owner address has positions.
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class RaydiumImpl implements Raydium {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public ΩSolanaAmountΩ fetchPoolPrice(ΩRaydiumLiquidityPoolIdΩ raydiumLiquidityPoolId) throws IOException, InterruptedException {
|
public ΩPriceΩ fetchPoolPrice(ΩRaydiumLiquidityPoolIdΩ raydiumLiquidityPoolId) throws IOException, InterruptedException {
|
||||||
ΩRestEndpointΩ endpoint = createPoolInfoByIdEndpoint(raydiumLiquidityPoolId);
|
ΩRestEndpointΩ endpoint = createPoolInfoByIdEndpoint(raydiumLiquidityPoolId);
|
||||||
|
|
||||||
JsonNode root = fetchJson(endpoint);
|
JsonNode root = fetchJson(endpoint);
|
||||||
@@ -57,11 +57,8 @@ public class RaydiumImpl implements Raydium {
|
|||||||
throw new IOException("Could NOT find field 'price' in JSON!");
|
throw new IOException("Could NOT find field 'price' in JSON!");
|
||||||
}
|
}
|
||||||
|
|
||||||
CurrencyType ct = WellKnownCurrencyTypes.SOLANA.getCurrencyType();
|
ΩPriceΩ price = new ΩPriceΩ(priceNode.toString());
|
||||||
ΩAmountΩ a = new ΩAmountΩ(priceNode.toString());
|
return price;
|
||||||
ΩSolanaAmountΩ sa = new ΩSolanaAmountΩ(a, ct);
|
|
||||||
|
|
||||||
return sa;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user