Function getQueryClient

Gets a client used to interact with the Sei chain.

import { getQueryClient } from '@sei-js/cosmjs';

const queryClient = await getQueryClient(REST_URL);

// Getting the market summary from the Sei dex module
const dexMarketSummary = await queryClient.seiprotocol.seichain.dex.getMarketSummary(params);

// Query the bank balance of a given address
const balances = await queryClient.cosmos.bank.v1beta1.allBalances({ address });

// Query a specific transaction hash
const txInfo = await queryClient.cosmos.tx.v1beta1.getTx({ hash });
  • Parameters

    • restEndpoint: string

      The endpoint of the REST node used to interact to the Sei chain.

    Returns Promise<
        {
            cosmos: {
                accesscontrol_x: { v1beta1: LCDQueryClient };
                auth: { v1beta1: LCDQueryClient };
                authz: { v1beta1: LCDQueryClient };
                bank: { v1beta1: LCDQueryClient };
                base: { tendermint: { v1beta1: LCDQueryClient } };
                distribution: { v1beta1: LCDQueryClient };
                evidence: { v1beta1: LCDQueryClient };
                feegrant: { v1beta1: LCDQueryClient };
                gov: { v1beta1: LCDQueryClient };
                slashing: { v1beta1: LCDQueryClient };
                staking: { v1beta1: LCDQueryClient };
                tx: { v1beta1: LCDQueryClient };
                upgrade: { v1beta1: LCDQueryClient };
            };
            seiprotocol: {
                seichain: {
                    epoch: LCDQueryClient;
                    evm: LCDQueryClient;
                    mint: LCDQueryClient;
                    oracle: LCDQueryClient;
                    tokenfactory: LCDQueryClient;
                };
            };
        },
    >

    An LCD client object that can be used to query the Sei chain.