> ## 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.

# Ton Chain Adapter

You can either create a TON chain adapter from a [TonConnectUI](https://www.npmjs.com/package/@tonconnect/ui) instance or from a TON private key:

### From wallet

Use this method to use connected wallets.

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

const chainAdapter = getTonChainAdapter(
  tonConnectUI,
  chainConfig,
  rpcUrl,
)
```

### From private key

Use this method to pass a private key directly.

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

const chainAdapter = getTonChainAdapterFromSecretKey(
  'YOUR_PRIVATE_KEY',
  'YOUR_PUBLIC_KEY',
  chainConfig,
  rpcUrl,
)
```

<Warning>
  As there are no stable public TON RPC endpoints, you will need to provide your own.
</Warning>
