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

# Chains and Tools

> Request all available chains, bridges, and exchanges.

Get an overview of which options (chains, bridges, DEXs) are available at this moment.

## Get available chains

### `getChains`

Fetches a list of all available chains supported by the SDK.

**Parameters**

* `client` (`SDKClient`): The SDK client instance.
* `params` (`ChainsRequest`, optional): Configuration for the requested chains.
  * `chainTypes` (`ChainType[]`, optional): List of chain types.
* `options` (`RequestOptions`, optional): Additional request options.

**Returns**

A Promise that resolves to an array of `ExtendedChain` objects.

```typescript Example theme={"system"}
import { createClient } from '@lifi/sdk';
import { ChainType, getChains } from '@lifi/sdk';

const client = createClient({
  integrator: 'Your dApp/company name',
});

try {
  const chains = await getChains(client, { chainTypes: [ChainType.EVM] });
  console.log(chains);
} catch (error) {
  console.error(error);
}
```

## Get available bridges and DEXs

### `getTools`

Fetches the tools available for bridging and swapping tokens.

**Parameters**

* `client` (`SDKClient`): The SDK client instance.
* `params` (`ToolsRequest`, optional): Configuration for the requested tools.
  * `chains` (`(ChainKey | ChainId)[]`, optional): List of chain IDs or keys.
* `options` (`RequestOptions`, optional): Additional request options.

**Returns**

A Promise that resolves to `ToolsResponse` and contains information about available bridges and DEXs.

```typescript Example theme={"system"}
import { createClient } from '@lifi/sdk';
import { getTools } from '@lifi/sdk';

const client = createClient({
  integrator: 'Your dApp/company name',
});

try {
  const tools = await getTools(client);
  console.log(tools);
} catch (error) {
  console.error(error);
}
```

## Get available connections

A connection is a pair of two tokens (on the same chain or on different chains) that can be exchanged via our platform.

Read more [Getting all possible Connections](/api-reference/returns-all-possible-connections-based-on-a-from-or-tochain)

### `getConnections`

Gets all the available connections for swapping or bridging tokens.

**Parameters**

* `client` (`SDKClient`): The SDK client instance.
* `connectionRequest` (`ConnectionsRequest`): Configuration of the connection request.
  * `fromChain` (`number | string`): The source chain ID or key.
  * `fromToken` (`string`, optional): The source token address.
  * `toChain` (`number | string`): The destination chain ID or key.
  * `toToken` (`string`, optional): The destination token address.
  * `allowBridges` (`string[]`, optional): Allowed bridges.
  * `denyBridges` (`string[]`, optional): Denied bridges.
  * `preferBridges` (`string[]`, optional): Preferred bridges.
  * `allowExchanges` (`string[]`, optional): Allowed exchanges.
  * `denyExchanges` (`string[]`, optional): Denied exchanges.
  * `preferExchanges` (`string[]`, optional): Preferred exchanges.
  * `allowProtocols` (`string[]`, optional): Allowed protocols.
  * `denyProtocols` (`string[]`, optional): Denied protocols.
  * `allowSwitchChain` (`boolean`, optional): Whether connections that require chain switch (multiple signatures) are included. Default is true.
  * `allowDestinationCall` (`boolean`, optional): Whether connections that include destination calls are included. Default is true.
  * `chainTypes` (`ChainType[]`, optional): Types of chains to include.
* `options` (`RequestOptions`, optional): Request options.

**Returns**

A Promise that resolves to a `ConnectionsResponse`.

```typescript Example theme={"system"}
import { createClient } from '@lifi/sdk';
import { getConnections } from '@lifi/sdk';

const client = createClient({
  integrator: 'Your dApp/company name',
});

const connectionRequest = {
  fromChain: 1,
  fromToken: '0x0000000000000000000000000000000000000000',
  toChain: 10,
  toToken: '0x0000000000000000000000000000000000000000',
};

try {
  const connections = await getConnections(client, connectionRequest);
  console.log('Connections:', connections);
} catch (error) {
  console.error('Error:', error);
}
```

For more detailed information on each endpoint and their responses, please refer to the [LI.FI API](/api-reference/introduction) documentation.
