# Getting Started

`useink/chains` is an extension of **useink** that provides hundreds of chain configurations. Configurations are necessary to set up core **useink** React hooks and display user-facing content. They contain RPC urls, links to block explorers, official websites, and metadata QR codes, and contain native token information, and more.

It is important to note that most of these chains do not implement [pallet-contracts](https://paritytech.github.io/substrate/master/pallet_contracts/pallet/struct.Pallet.html), and therefore do not support ink! contracts, but many of the features in **useink** are compatible with all of these chains. We have added them here for convenience. In addition, many chains are in the process of adding pallet-contracts as they adopt the [hybrid chain design](https://www.rob.tech/blog/hybrid-chains/), so we expect more and more compatibility with the **useink** library in the near future.

### Installation[​](https://use.ink/frontend/chains#installation) <a href="#installation" id="installation"></a>

You must first [install useink](https://use.ink/frontend/getting-started#installation).

### Configure tsconfig.json[​](https://use.ink/frontend/chains#configure-tsconfigjson) <a href="#configure-tsconfigjson" id="configure-tsconfigjson"></a>

Set `moduleResolution` to `nodenext` or `bundler` inside of your `tsconfig.json`. This feature allows your application to discover the `useink/chains` import paths defined in the **useink** `package.json`.

```javascript
{
  "compilerOptions": {
    "moduleResolution": "nodenext", // or `bundler`
  }
}
```

You can now import any of the chain configurations in `useink/chains`.

```javascript
// Example
import { RococoContractsTestnet, ShibuyaTestnet } from 'useink/chains';
```

* [See useink Configuration](https://use.ink/frontend/getting-started#configuration) to learn how these are used in a React app built with **useink**.
* [See Chain Configurations](https://use.ink/frontend/chains/configurations) for a list of all available configurations.

### Chain Type Definition[​](https://use.ink/frontend/chains#chain-type-definition) <a href="#chain-type-definition" id="chain-type-definition"></a>

```javascript
interface Chain {
  id: ChainId; // See https://use.ink/frontend/chains/chain-id for a list of all possible values.
  name: string;
  account: '*25519' | 'secp256k1' | 'Sr25519';
  subscanUrl?: string;
  overrideNativeTokenId?: string;
  chainspecQrUrl?: string;
  latestMetadataQrUrl?: string;
  rpcs: readonly `ws://${string}` | `wss://${string}`[];
  coingeckoId?: string | null;
  paraId?: number;
  relay?: {
    id: string;
  };
  balanceModuleConfigs?: {
    [k: string]: {
      disable?: boolean;
      tokens?: readonly (Token | TokenAsset)[];
    };
  };
}

interface Token {
  symbol: string;
  decimals: number;
  // existentialDeposit is the minimum amount an account must hold to stay alive.
  // Balances held below this amount will be removed from storage
  existentialDeposit: string;
  // onChainId is the ID for a token in the pallet
  onChainId: string | number;
  coingeckoId?: string;
}

interface TokenAsset {
  assetId: string | number;
  symbol: string;
  coingeckoId?: string;
}
```

#### Example: RococoContractsTestnet[​](https://use.ink/frontend/chains#example-rocococontractstestnet) <a href="#example-rocococontractstestnet" id="example-rocococontractstestnet"></a>

```javascript
const RococoContractsTestnet: Chain = {
  id: 'rococo-contracts-testnet',
  name: 'Contracts',
  account: '*25519',
  rpcs: ['wss://rococo-contracts-rpc.polkadot.io'],
  paraId: 1002,
  relay: { id: 'rococo-testnet' },
};
```

#### Example: Astar[​](https://use.ink/frontend/chains#example-astar) <a href="#example-astar" id="example-astar"></a>

```javascript
export const Astar: Chain = {
  id: 'astar',
  name: 'Astar',
  account: '*25519',
  subscanUrl: 'https://astar.subscan.io/',
  chainspecQrUrl: 'https://metadata.novasama.io/qr/astar_specs.png',
  latestMetadataQrUrl:
    'https://metadata.novasama.io/qr/astar_metadata_latest.apng',
  rpcs: [
    'wss://rpc.astar.network',
    'wss://astar.public.blastapi.io',
    'wss://astar-rpc.dwellir.com',
    'wss://astar.api.onfinality.io/public-ws',
    'wss://astar.public.curie.radiumblock.co/ws',
    'wss://public-rpc.pinknode.io/astar',
    'wss://1rpc.io/astr',
  ],
  paraId: 2006,
  relay: { id: 'polkadot' },
  balanceModuleConfigs: {
    'substrate-assets': {
      tokens: [
        { assetId: '4294969280', symbol: 'USDT', coingeckoId: 'tether' },
        {
          assetId: '18446744073709551616',
          symbol: 'ACA',
          coingeckoId: 'acala',
        },
        {
          assetId: '18446744073709551617',
          symbol: 'AUSD',
          coingeckoId: 'acala-dollar',
        },
        {
          assetId: '18446744073709551618',
          symbol: 'LDOT',
          coingeckoId: 'liquid-staking-dot',
        },
        {
          assetId: '18446744073709551619',
          symbol: 'GLMR',
          coingeckoId: 'moonbeam',
        },
        {
          assetId: '18446744073709551620',
          symbol: 'IBTC',
          coingeckoId: 'interbtc',
        },
        {
          assetId: '18446744073709551621',
          symbol: 'INTR',
          coingeckoId: 'interlay',
        },
        { assetId: '18446744073709551622', symbol: 'PHA', coingeckoId: 'pha' },
        {
          assetId: '18446744073709551623',
          symbol: 'BNC',
          coingeckoId: 'bifrost-native-coin',
        },
        { assetId: '18446744073709551624', symbol: 'VDOT' },
        { assetId: '18446744073709551625', symbol: 'CLV' },
        { assetId: '18446744073709551626', symbol: 'VSDOT' },
        {
          assetId: '18446744073709551627',
          symbol: 'RING',
          coingeckoId: 'darwinia-network-native-token',
        },
        {
          assetId: '18446744073709551628',
          symbol: 'EQ',
          coingeckoId: 'equilibrium-token',
        },
        { assetId: '18446744073709551629', symbol: 'EQD' },
        {
          assetId: '340282366920938463463374607431768211455',
          symbol: 'DOT',
          coingeckoId: 'polkadot',
        },
      ],
    },
  },
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://lunes-labs.gitbook.io/dao-lunes-labs-pt/developers/para-desenvolvedores/smart-contract-ink-4.x/frontend-development/useink-chains/getting-started.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
