> ## Documentation Index
> Fetch the complete documentation index at: https://injectivelabs-docs-ai-sdk.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Auth

체인에서 Auth 모듈을 쿼리하는 예제 코드 스니펫입니다.

## gRPC 사용

### 최대 메모 문자 수, 트랜잭션 서명 제한 등 파라미터 조회

```ts theme={null}
import { ChainGrpcAuthApi } from "@injectivelabs/sdk-ts/client/chain";
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";

const endpoints = getNetworkEndpoints(Network.Testnet);
const chainGrpcAuthApi = new ChainGrpcAuthApi(endpoints.grpc);

const moduleParams = await chainGrpcAuthApi.fetchModuleParams();

console.log(moduleParams);
```

### Injective 주소와 관련된 계정 상세 정보 조회 (주소, 시퀀스, pub\_key 등)

```ts theme={null}
import { ChainGrpcAuthApi } from "@injectivelabs/sdk-ts/client/chain";
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";

const endpoints = getNetworkEndpoints(Network.Testnet);
const chainGrpcAuthApi = new ChainGrpcAuthApi(endpoints.grpc);
const injectiveAddress = "inj...";

const accountDetailsResponse = await chainGrpcAuthApi.fetchAccount(
  injectiveAddress
);

console.log(accountDetailsResponse);
```

### 체인의 계정 목록 조회

```ts theme={null}
import { PaginationOption } from '@injectivelabs/sdk-ts/types'
import { ChainGrpcAuthApi } from '@injectivelabs/sdk-ts/client/chain'
import { getNetworkEndpoints, Network } from '@injectivelabs/networks'

const endpoints = getNetworkEndpoints(Network.Testnet)
const chainGrpcAuthApi = new ChainGrpcAuthApi(endpoints.grpc)
const injectiveAddress = 'inj...'
const pagination = {...} as PaginationOption

const accounts = await chainGrpcAuthApi.fetchAccounts(/* optional pagination params*/)

console.log(accounts)
```

## HTTP REST 사용

### Injective 주소와 관련된 계정 상세 정보 조회 (주소, 시퀀스, pub\_key 등)

```ts theme={null}
import { ChainRestAuthApi } from "@injectivelabs/sdk-ts/client/chain";
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";

const endpoints = getNetworkEndpoints(Network.Testnet);
const chainRestAuthApi = new ChainRestAuthApi(endpoints.rest);
const injectiveAddress = "inj...";

const accountDetailsResponse = await chainRestAuthApi.fetchAccount(
  injectiveAddress
);

console.log(accountDetailsResponse);
```

#### Injective 주소에서 Cosmos 주소 조회

```ts theme={null}
import { ChainRestAuthApi } from "@injectivelabs/sdk-ts/client/chain";
import { getNetworkEndpoints, Network } from "@injectivelabs/networks";

const endpoints = getNetworkEndpoints(Network.Testnet);
const chainRestAuthApi = new ChainRestAuthApi(endpoints.rest);
const injectiveAddress = "inj...";

const cosmosAddress = await chainRestAuthApi.fetchCosmosAccount(
  injectiveAddress
);

console.log(cosmosAddress);
```
