> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cdp.coinbase.com/llms.txt
> Use this file to discover all available pages before exploring further.

# GetSwapPriceResponse

> GetSwapPriceResponse API reference.

Package: [`com.coinbase.cdp.types`](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/types/index)

```java theme={null}
public final class GetSwapPriceResponse extends Object
```

## Method Details

### `getBlockNumber`

```java theme={null}
public String getBlockNumber()
```

**Returns:**

`String` - The block number at which the liquidity conditions were examined.

### `getToAmount`

```java theme={null}
public String getToAmount()
```

**Returns:**

`String` - The amount of the `toToken` that will be received in atomic units of the `toToken`. For example, `1000000000000000000` when receiving ETH equates to 1 ETH, `1000000` when receiving USDC equates to 1 USDC, etc.

### `getToToken`

```java theme={null}
public String getToToken()
```

**Returns:**

`String` - The 0x-prefixed contract address of the token that will be received.

### `getFees`

```java theme={null}
public GetSwapPriceResponseFees getFees()
```

**Returns:**

[GetSwapPriceResponseFees](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/types/GetSwapPriceResponseFees) - The estimated fees for the swap.

### `getIssues`

```java theme={null}
public GetSwapPriceResponseIssues getIssues()
```

**Returns:**

[GetSwapPriceResponseIssues](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/types/GetSwapPriceResponseIssues) - An object containing potential issues discovered during validation that could prevent the swap from being executed successfully.

### `getLiquidityAvailable`

```java theme={null}
public boolean getLiquidityAvailable()
```

**Returns:**

`boolean` - Whether sufficient liquidity is available to settle the swap. All other fields in the response will be empty if this is false.

### `getMinToAmount`

```java theme={null}
public String getMinToAmount()
```

**Returns:**

`String` - The minimum amount of the `toToken` that must be received for the swap to succeed, in atomic units of the `toToken`. For example, `1000000000000000000` when receiving ETH equates to 1 ETH, `1000000` when receiving USDC equates to 1 USDC, etc. This value is influenced by the `slippageBps` parameter.

### `getFromAmount`

```java theme={null}
public String getFromAmount()
```

**Returns:**

`String` - The amount of the `fromToken` that will be sent in this swap, in atomic units of the `fromToken`. For example, `1000000000000000000` when sending ETH equates to 1 ETH, `1000000` when sending USDC equates to 1 USDC, etc.

### `getFromToken`

```java theme={null}
public String getFromToken()
```

**Returns:**

`String` - The 0x-prefixed contract address of the token that will be sent.

### `getGas`

```java theme={null}
public String getGas()
```

**Returns:**

`String` - The estimated gas limit that should be used to send the transaction to guarantee settlement.

### `getGasPrice`

```java theme={null}
public String getGasPrice()
```

**Returns:**

`String` - The gas price, in Wei, that should be used to send the transaction. For EIP-1559 transactions, this value should be seen as the `maxFeePerGas` value. The transaction should be sent with this gas price to guarantee settlement.

### `equals`

```java theme={null}
public boolean equals(Object other)
```

**Overrides:**

`[equals](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#equals\(java.lang.Object\) "class or interface in java.lang")` in class `[Object](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html "class or interface in java.lang")`

**Parameters:**

`other` - `Object`

**Returns:**

`boolean`

### `getAdditionalProperties`

```java theme={null}
public Map<String,Object> getAdditionalProperties()
```

**Returns:**

`Map<String,Object>`

### `hashCode`

```java theme={null}
public int hashCode()
```

**Overrides:**

`[hashCode](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#hashCode\(\) "class or interface in java.lang")` in class `[Object](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html "class or interface in java.lang")`

**Returns:**

`int`

### `toString`

```java theme={null}
public String toString()
```

**Overrides:**

`[toString](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html#toString\(\) "class or interface in java.lang")` in class `[Object](https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/lang/Object.html "class or interface in java.lang")`

**Returns:**

`String`

### `builder`

```java theme={null}
public static GetSwapPriceResponse.BlockNumberStage builder()
```

**Returns:**

[GetSwapPriceResponse](/sdks/cdp-sdks-v2/java/com/coinbase/cdp/types/GetSwapPriceResponse).`BlockNumberStage`
