查询链上 auth 模块的示例代码片段。Documentation Index
Fetch the complete documentation index at: https://docs.injective.network/llms.txt
Use this file to discover all available pages before exploring further.
查询链上 auth 模块的示例代码片段。Documentation Index
Fetch the complete documentation index at: https://docs.injective.network/llms.txt
Use this file to discover all available pages before exploring further.
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);
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);
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(/* 可选分页参数 */)
console.log(accounts)
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);
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);