> For the complete documentation index, see [llms.txt](https://messinaone.gitbook.io/messina-sdk/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://messinaone.gitbook.io/messina-sdk/methods/utils/nativetohexstring.md).

# nativeToHexString()

To convert an address in a chain's native representation into a 32-byte hex string

### Method Parameters

**address:** string | undefined

Destination address

**chain:** ChainId | ChainName

Destination chain

### Returns

Returns hex address `string`

### Usage   &#x20;

```javascript
import { ethers } from "ethers";
import { nativeToHexString, CHAIN_ID_ETH } from "@algo-foundry/messina-sdk";

const provider = new ethers.providers.WebSocketProvider(
      <ETH_NODE_URL>
    ) as any;   
const signer = new ethers.Wallet(<ETH_PRIVATE_KEY>, provider);

const hexStr = nativeToHexString(
      signer.address,
      CHAIN_ID_ETH
    );
```
