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

# Starknet Chain Adapter

You can create a Starknet chain adapter from either a [starknet.js](https://www.npmjs.com/package/starknet) account or as a shortcut from a private key.

### From account

Use this method to use connected wallets in webapps or if you want to set up an account yourself.

```typescript theme={null}
import { getStarknetChainAdapterFromAccount } from '@rhino.fi/sdk/adapters/starknet'

const chainAdapter = getStarknetChainAdapterFromAccount(
  account,
  chainConfig
)
```

### From private key

Use this method as a shortcut to setting up an account yourself.

```typescript theme={null}
import { getStarknetChainAdapterFromPrivateKey } from '@rhino.fi/sdk/adapters/starknet'

const chainAdapter = getStarknetChainAdapterFromPrivateKey({
  privateKey: 'YOUR_PRIVATE_KEY',
  address: 'YOUR_ADDRESS',
  chainConfig,
})
```

### Options

Both functions also accept a 3rd options parameter. Currently it only includes a `tokenAllowanceOverride` property that allows you to specify a higher token allowance to be used instead of the calculated one. This can be useful to optimize gas usage by setting bigger allowances that will last for multiple bridges.
