From 60894b6e241a4049687184b68eabc073d1118da0 Mon Sep 17 00:00:00 2001 From: "mintlify[bot]" <109931778+mintlify[bot]@users.noreply.github.com> Date: Wed, 27 May 2026 04:39:58 +0000 Subject: [PATCH 1/2] docs: add Japanese translation for Querying the Chain section under Native Developers --- .gitbook/docs.json | 23 ++ .../developers-native/query-chain/auction.mdx | 50 +++++ .../jp/developers-native/query-chain/auth.mdx | 92 ++++++++ .../jp/developers-native/query-chain/bank.mdx | 112 +++++++++ .../query-chain/distribution.mdx | 60 +++++ .../query-chain/exchange.mdx | 138 ++++++++++++ .../query-chain/governance.mdx | 159 +++++++++++++ .../jp/developers-native/query-chain/ibc.mdx | 37 +++ .../developers-native/query-chain/index.mdx | 24 ++ .../query-chain/insurance-funds.mdx | 95 ++++++++ .../jp/developers-native/query-chain/mint.mdx | 50 +++++ .../developers-native/query-chain/oracle.mdx | 22 ++ .../developers-native/query-chain/peggy.mdx | 22 ++ .../query-chain/permissions.mdx | 100 +++++++++ .../developers-native/query-chain/staking.mdx | 212 ++++++++++++++++++ .../query-chain/tendermint.mdx | 36 +++ .../query-chain/token-factory.mdx | 42 ++++ .../jp/developers-native/query-chain/wasm.mdx | 161 +++++++++++++ .../developers-native/query-chain/wasmx.mdx | 36 +++ 19 files changed, 1471 insertions(+) create mode 100644 .gitbook/jp/developers-native/query-chain/auction.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/auth.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/bank.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/distribution.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/exchange.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/governance.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/ibc.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/index.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/insurance-funds.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/mint.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/oracle.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/peggy.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/permissions.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/staking.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/tendermint.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/token-factory.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/wasm.mdx create mode 100644 .gitbook/jp/developers-native/query-chain/wasmx.mdx diff --git a/.gitbook/docs.json b/.gitbook/docs.json index 2329f029..0d3a916b 100644 --- a/.gitbook/docs.json +++ b/.gitbook/docs.json @@ -2053,6 +2053,29 @@ "jp/developers-native/examples/token-factory", "jp/developers-native/examples/wasm" ] + }, + { + "group": "チェーンのクエリ", + "pages": [ + "jp/developers-native/query-chain/index", + "jp/developers-native/query-chain/auction", + "jp/developers-native/query-chain/auth", + "jp/developers-native/query-chain/bank", + "jp/developers-native/query-chain/distribution", + "jp/developers-native/query-chain/exchange", + "jp/developers-native/query-chain/governance", + "jp/developers-native/query-chain/ibc", + "jp/developers-native/query-chain/mint", + "jp/developers-native/query-chain/insurance-funds", + "jp/developers-native/query-chain/oracle", + "jp/developers-native/query-chain/peggy", + "jp/developers-native/query-chain/permissions", + "jp/developers-native/query-chain/staking", + "jp/developers-native/query-chain/tendermint", + "jp/developers-native/query-chain/wasm", + "jp/developers-native/query-chain/wasmx", + "jp/developers-native/query-chain/token-factory" + ] } ] }, diff --git a/.gitbook/jp/developers-native/query-chain/auction.mdx b/.gitbook/jp/developers-native/query-chain/auction.mdx new file mode 100644 index 00000000..3e91c1cd --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/auction.mdx @@ -0,0 +1,50 @@ +--- +title: Auction +updatedAt: "2025-12-23" +--- + +チェーン上のauctionモジュールをクエリするためのコードスニペット例。 + +## gRPCを使用する + +### auction periodなどのモジュールパラメータを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcAuctionApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcAuctionApi = new ChainGrpcAuctionApi(endpoints.grpc); + +const moduleParams = await chainGrpcAuctionApi.fetchModuleParams(); + +console.log(moduleParams); +``` + +### 現在のauctionの状態(最新のラウンドなど)を取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcAuctionApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcAuctionApi = new ChainGrpcAuctionApi(endpoints.grpc); + +const latestAuctionModuleState = await chainGrpcAuctionApi.fetchModuleState(); + +console.log(latestAuctionModuleState); +``` + +### 現在のauction basketを取得し、最高入札者や入札額などの情報を取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcAuctionApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcAuctionApi = new ChainGrpcAuctionApi(endpoints.grpc); + +const currentBasket = await chainGrpcAuctionApi.fetchCurrentBasket(); + +console.log(currentBasket); +``` diff --git a/.gitbook/jp/developers-native/query-chain/auth.mdx b/.gitbook/jp/developers-native/query-chain/auth.mdx new file mode 100644 index 00000000..21d1a98e --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/auth.mdx @@ -0,0 +1,92 @@ +--- +title: Auth +updatedAt: "2025-12-23" +--- + +チェーン上のauthモジュールをクエリするためのコードスニペット例。 + +## gRPCを使用する + +### memoの最大文字数やトランザクション署名の上限などのパラメータを取得する + +```ts +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 addressに紐づくアカウント詳細(address、sequence、pub_keyなど)を取得する + +```ts +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 +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 addressに紐づくアカウント詳細(address、sequence、pub_keyなど)を取得する + +```ts +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 addressからcosmos addressを取得する + +```ts +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); +``` diff --git a/.gitbook/jp/developers-native/query-chain/bank.mdx b/.gitbook/jp/developers-native/query-chain/bank.mdx new file mode 100644 index 00000000..5f4d9a58 --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/bank.mdx @@ -0,0 +1,112 @@ +--- +title: Bank +updatedAt: "2025-12-23" +--- + +bankモジュール関連のデータをチェーンからクエリするためのコードスニペット例。 + +## gRPCを使用する + +### bankモジュールのパラメータを取得する + +```ts line highlight={2} +import { ChainGrpcBankApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcBankApi = new ChainGrpcBankApi(endpoints.grpc); + +const moduleParams = await chainGrpcBankApi.fetchModuleParams(); + +console.log(moduleParams); +``` + +### injective addressの残高を取得する + +```ts +import { ChainGrpcBankApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcBankApi = new ChainGrpcBankApi(endpoints.grpc); + +const injectiveAddress = "inj..."; + +const balances = await chainGrpcBankApi.fetchBalances(injectiveAddress); + +console.log(balances); +``` + +### base denomごとのcosmos addressの残高を取得する + +```ts +import { ChainGrpcBankApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcBankApi = new ChainGrpcBankApi(endpoints.grpc); + +const cosmosAddress = "cosmos1..."; /* example is using Cosmos Hub */ +const denom = "uatom"; + +const balance = await chainGrpcBankApi.fetchBalance({ + accountAddress: cosmosAddress, + denom, +}); + +console.log(balance); +``` + +### チェーン上の総供給量を取得する + +```ts +import { PaginationOption } from '@injectivelabs/sdk-ts/types' +import { ChainGrpcBankApi } from '@injectivelabs/sdk-ts/client/chain' +import { getNetworkEndpoints, Network } from '@injectivelabs/networks' + +const endpoints = getNetworkEndpoints(Network.Testnet) +const chainGrpcBankApi = new ChainGrpcBankApi(endpoints.grpc) + +const pagination = {...} as PaginationOption + +const totalSupply = await chainGrpcBankApi.fetchTotalSupply( + pagination /* optional pagination parameter */ +) + +console.log(totalSupply) +``` + +## HTTP RESTを使用する + +### アドレスの残高を取得する + +```ts +import { ChainRestBankApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainRestBankApi = new ChainRestBankApi(endpoints.rest); + +const injectiveAddress = "inj..."; + +const balances = await chainRestBankApi.fetchBalances(injectiveAddress); + +console.log(balances); +``` + +### base denomごとのcosmos addressの残高を取得する + +```ts +import { ChainRestBankApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainRestBankApi = new ChainRestBankApi(endpoints.rest); + +const cosmosAddress = "cosmos..."; /* example is using Cosmos Hub */ +const denom = "uatom"; + +const balance = await chainRestBankApi.fetchBalance(cosmosAddress, denom); + +console.log(balance); +``` diff --git a/.gitbook/jp/developers-native/query-chain/distribution.mdx b/.gitbook/jp/developers-native/query-chain/distribution.mdx new file mode 100644 index 00000000..4bae3419 --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/distribution.mdx @@ -0,0 +1,60 @@ +--- +title: Distribution +updatedAt: "2025-12-23" +--- + +チェーンからvalidatorへのdelegate関連データをクエリするためのコードスニペット例。 + +## gRPCを使用する + +### base proposer rewardやbonus proposer rewardなどのパラメータを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcDistributionApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcDistributionApi = new ChainGrpcDistributionApi(endpoints.grpc); + +const moduleParams = await chainGrpcDistributionApi.fetchModuleParams(); + +console.log(moduleParams); +``` + +### 特定のvalidatorへdelegateしているdelegatorの報酬の量とdenomを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcDistributionApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcDistributionApi = new ChainGrpcDistributionApi(endpoints.grpc); + +const delegatorAddress = "inj..."; +const validatorAddress = "injvaloper..."; + +const delegatorRewardsFromValidator = + await chainGrpcDistributionApi.fetchDelegatorRewardsForValidatorNoThrow({ + delegatorAddress, + validatorAddress, + }); + +console.log(delegatorRewardsFromValidator); +``` + +### delegatorのすべての報酬の量とdenomを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcDistributionApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcDistributionApi = new ChainGrpcDistributionApi(endpoints.grpc); + +const delegatorAddress = "inj..."; + +const totalDelegatorRewards = + await chainGrpcDistributionApi.fetchDelegatorRewardsNoThrow(delegatorAddress); + +console.log(totalDelegatorRewards); +``` diff --git a/.gitbook/jp/developers-native/query-chain/exchange.mdx b/.gitbook/jp/developers-native/query-chain/exchange.mdx new file mode 100644 index 00000000..df23d6a4 --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/exchange.mdx @@ -0,0 +1,138 @@ +--- +title: Exchange +updatedAt: "2025-12-23" +--- + +チェーン上のexchangeモジュールをクエリするためのコードスニペット例。 + +## gRPCを使用する + +### デフォルトのspotおよびderivativesの手数料/trading rewardsなどのパラメータを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcExchangeApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcExchangeApi = new ChainGrpcExchangeApi(endpoints.grpc); + +const moduleParams = await chainGrpcExchangeApi.fetchModuleParams(); + +console.log(moduleParams); +``` + +### fee discount scheduleを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcExchangeApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcExchangeApi = new ChainGrpcExchangeApi(endpoints.grpc); + +const feeDiscountSchedule = + await chainGrpcExchangeApi.fetchFeeDiscountSchedule(); + +console.log(feeDiscountSchedule); +``` + +### injective addressに紐づくfee discountsを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcExchangeApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcExchangeApi = new ChainGrpcExchangeApi(endpoints.grpc); + +const injectiveAddress = "inj..."; + +const feeDiscountAccountInfo = + await chainGrpcExchangeApi.fetchFeeDiscountAccountInfo(injectiveAddress); + +console.log(feeDiscountAccountInfo); +``` + +### trading reward campaignの詳細(total reward pointsなど)を取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcExchangeApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcExchangeApi = new ChainGrpcExchangeApi(endpoints.grpc); + +const tradingRewardsCampaign = + await chainGrpcExchangeApi.fetchTradingRewardsCampaign(); + +console.log(tradingRewardsCampaign); +``` + +### injective addressのtrading rewards pointsを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcExchangeApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcExchangeApi = new ChainGrpcExchangeApi(endpoints.grpc); + +const injectiveAddress = "inj..."; + +const tradeRewardsPoints = await chainGrpcExchangeApi.fetchTradeRewardsPoints( + injectiveAddress +); + +console.log(tradeRewardsPoints); +``` + +### injective addressのpending trading rewards pointsを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcExchangeApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcExchangeApi = new ChainGrpcExchangeApi(endpoints.grpc); + +const injectiveAddresses = ["inj..."]; + +const pendingTradeRewardsPoints = + await chainGrpcExchangeApi.fetchPendingTradeRewardPoints(injectiveAddresses); + +console.log(pendingTradeRewardsPoints); +``` + +#### subaccountId、marketId、positionなど、現在のpositionを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcExchangeApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcExchangeApi = new ChainGrpcExchangeApi(endpoints.grpc); + +// Replace with your own Injective address(es) +const injectiveAddresses = ["inj1..."]; + +const positions = await chainGrpcExchangeApi.fetchPositions(injectiveAddresses); + +console.log(positions); +``` + +### subaccount trade nonceを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcExchangeApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcExchangeApi = new ChainGrpcExchangeApi(endpoints.grpc); + +const subaccountId = "0x..."; + +const subaccountTradeNonce = + await chainGrpcExchangeApi.fetchSubaccountTradeNonce(subaccountId); + +console.log(subaccountTradeNonce); +``` diff --git a/.gitbook/jp/developers-native/query-chain/governance.mdx b/.gitbook/jp/developers-native/query-chain/governance.mdx new file mode 100644 index 00000000..39e52803 --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/governance.mdx @@ -0,0 +1,159 @@ +--- +title: Governance +updatedAt: "2025-12-23" +--- + +チェーン上のgovernanceモジュールをクエリするためのコードスニペット例。 + +## gRPCを使用する + +### voting period、max depositing period、tally詳細などのパラメータを取得する + +```ts +import { ChainGrpcGovApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcGovApi = new ChainGrpcGovApi(endpoints.grpc); + +const moduleParams = await chainGrpcGovApi.fetchModuleParams(); + +console.log(moduleParams); +``` + +### statusに基づいてproposalsを取得する + +```ts +import { getNetworkEndpoints, Network } from '@injectivelabs/networks' +import { ProposalStatusMap } from '@injectivelabs/sdk-ts/client/chain' +import { PaginationOption } from '@injectivelabs/sdk-ts/types' +import { ChainGrpcGovApi } from '@injectivelabs/sdk-ts/client/chain' + +const endpoints = getNetworkEndpoints(Network.Testnet) +const chainGrpcGovApi = new ChainGrpcGovApi(endpoints.grpc) + +const status = 3 as ProposalStatusMap[keyof ProposalStatusMap] +const pagination = {...} as PaginationOption + +const proposals = await chainGrpcGovApi.fetchProposals({ + status, + pagination /* optional pagination params */ +}) + +console.log(proposals) +``` + +### proposalのidに基づいてproposalの詳細を取得する + +```ts +import { ChainGrpcGovApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcGovApi = new ChainGrpcGovApi(endpoints.grpc); + +const proposalId = 123; + +const proposalDetails = await chainGrpcGovApi.fetchProposal(proposalId); + +console.log(proposalDetails); +``` + +### proposalのidに基づいてproposal depositsを取得する + +```ts +import { PaginationOption } from '@injectivelabs/sdk-ts/types' +import { ChainGrpcGovApi } from '@injectivelabs/sdk-ts/client/chain' +import { getNetworkEndpoints, Network } from '@injectivelabs/networks' + +const endpoints = getNetworkEndpoints(Network.Testnet) +const chainGrpcGovApi = new ChainGrpcGovApi(endpoints.grpc) + +const proposalId = 123 +const pagination = {...} as PaginationOption + +const proposalDeposits = await chainGrpcGovApi.fetchProposalDeposits({ + proposalId, + pagination /* optiona pagination parameter */ +}) + +console.log(proposalDeposits) +``` + +### proposalのidに基づいてproposalの詳細を取得する + +```ts +import { ChainGrpcGovApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcGovApi = new ChainGrpcGovApi(endpoints.grpc); + +const proposalId = 123; + +const proposalDetails = await chainGrpcGovApi.fetchProposal(proposalId); + +console.log(proposalDetails); +``` + +### proposalのidに基づいてproposal depositsを取得する + +```ts +import { PaginationOption } from '@injectivelabs/sdk-ts/types' +import { ChainGrpcGovApi } from '@injectivelabs/sdk-ts/client/chain' +import { getNetworkEndpoints, Network } from '@injectivelabs/networks' + +const endpoints = getNetworkEndpoints(Network.Testnet) +const chainGrpcGovApi = new ChainGrpcGovApi(endpoints.grpc) + +const proposalId = 123 +const pagination = {...} as PaginationOption + +const proposalDeposits = await chainGrpcGovApi.fetchProposalDeposits({ + proposalId, + pagination /* optional pagination param */ +}) + +console.log(proposalDeposits) +``` + +### proposalのidに基づいてproposal votesを取得する + +```ts +import { PaginationOption } from '@injectivelabs/sdk-ts/types' +import { ChainGrpcGovApi } from '@injectivelabs/sdk-ts/client/chain' +import { getNetworkEndpoints, Network } from '@injectivelabs/networks' + +const endpoints = getNetworkEndpoints(Network.Testnet) +const chainGrpcGovApi = new ChainGrpcGovApi(endpoints.grpc) + +const proposalId = 123 + +const proposalVotes = await chainGrpcGovApi.fetchProposalVotes({ + proposalId, + pagination: /* optional pagination Options */ +}) + +console.log(proposalVotes) +``` + +### proposalのidに基づいてproposal tallyを取得する + +```ts +import { PaginationOption } from '@injectivelabs/sdk-ts/types' +import { ChainGrpcGovApi } from '@injectivelabs/sdk-ts/client/chain' +import { getNetworkEndpoints, Network } from '@injectivelabs/networks' + +const endpoints = getNetworkEndpoints(Network.Testnet) +const chainGrpcGovApi = new ChainGrpcGovApi(endpoints.grpc) + +const proposalId = 123 +const pagination = {...} as PaginationOption + +const proposalTally = await chainGrpcGovApi.fetchProposalTally({ + proposalId, + pagination /* optional pagination Options */ +}) + +console.log(proposalTally) +``` diff --git a/.gitbook/jp/developers-native/query-chain/ibc.mdx b/.gitbook/jp/developers-native/query-chain/ibc.mdx new file mode 100644 index 00000000..ec3c4fef --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/ibc.mdx @@ -0,0 +1,37 @@ +--- +title: IBC +updatedAt: "2025-12-23" +--- + +IBC関連のデータをチェーンからクエリするためのコードスニペット例。 + +## gRPCを使用する + +### IBC hashからdenom traceを取得する + +```ts +import { ChainGrpcIbcApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcIbcApi = new ChainGrpcIbcApi(endpoints.grpc); +const hash = "..."; + +const denomTrace = await chainGrpcIbcApi.fetchDenomTrace(hash); + +console.log(denomTrace); +``` + +### denom traceの一覧を取得する + +```ts +import { ChainGrpcIbcApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcIbcApi = new ChainGrpcIbcApi(endpoints.grpc); + +const denomTraces = await chainGrpcIbcApi.fetchDenomsTrace(); + +console.log(denomTraces); +``` diff --git a/.gitbook/jp/developers-native/query-chain/index.mdx b/.gitbook/jp/developers-native/query-chain/index.mdx new file mode 100644 index 00000000..70591074 --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/index.mdx @@ -0,0 +1,24 @@ +--- +title: チェーンのクエリ +updatedAt: "2025-11-27" +--- + +このセクションでは、Injectiveブロックチェーンから直接データをクエリする方法について説明します。 + +- [Auction](/jp/developers-native/query-chain/auction/) - auctionモジュールのデータをクエリする +- [Auth](/jp/developers-native/query-chain/auth/) - authモジュールのデータをクエリする +- [Bank](/jp/developers-native/query-chain/bank/) - bankモジュールのデータをクエリする +- [Distribution](/jp/developers-native/query-chain/distribution/) - distributionモジュールのデータをクエリする +- [Exchange](/jp/developers-native/query-chain/exchange/) - exchangeモジュールのデータをクエリする +- [Governance](/jp/developers-native/query-chain/governance/) - governanceモジュールのデータをクエリする +- [IBC](/jp/developers-native/query-chain/ibc/) - IBCモジュールのデータをクエリする +- [Insurance Funds](/jp/developers-native/query-chain/insurance-funds/) - insurance fundsのデータをクエリする +- [Mint](/jp/developers-native/query-chain/mint/) - mintモジュールのデータをクエリする +- [Oracle](/jp/developers-native/query-chain/oracle/) - oracleモジュールのデータをクエリする +- [Peggy](/jp/developers-native/query-chain/peggy/) - peggyモジュールのデータをクエリする +- [Permissions](/jp/developers-native/query-chain/permissions/) - permissionsモジュールのデータをクエリする +- [Staking](/jp/developers-native/query-chain/staking/) - stakingモジュールのデータをクエリする +- [Tendermint](/jp/developers-native/query-chain/tendermint/) - tendermintのデータをクエリする +- [Token Factory](/jp/developers-native/query-chain/token-factory/) - token factoryのデータをクエリする +- [Wasm](/jp/developers-native/query-chain/wasm/) - wasmモジュールのデータをクエリする +- [WasmX](/jp/developers-native/query-chain/wasmx/) - wasmxモジュールのデータをクエリする diff --git a/.gitbook/jp/developers-native/query-chain/insurance-funds.mdx b/.gitbook/jp/developers-native/query-chain/insurance-funds.mdx new file mode 100644 index 00000000..4ae018e7 --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/insurance-funds.mdx @@ -0,0 +1,95 @@ +--- +title: Insurance Funds +updatedAt: "2025-12-23" +--- + +チェーン上のinsurance fund関連のデータをクエリするためのコードスニペット例。 + +## gRPCを使用する + +### デフォルトのredemption notice period durationを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcInsuranceFundApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcInsuranceFundApi = new ChainGrpcInsuranceFundApi(endpoints.grpc); + +const moduleParams = await chainGrpcInsuranceFundApi.fetchModuleParams(); + +console.log(moduleParams); +``` + +### insurance fundsとそれに関連するmetadataを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcInsuranceFundApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcInsuranceFundApi = new ChainGrpcInsuranceFundApi(endpoints.grpc); + +const insuranceFunds = await chainGrpcInsuranceFundApi.fetchInsuranceFunds(); + +console.log(insuranceFunds); +``` + +### market IDに基づいてinsurance fundとそれに関連するmetadataを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcInsuranceFundApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcInsuranceFundApi = new ChainGrpcInsuranceFundApi(endpoints.grpc); + +const marketId = "0x..."; +const insuranceFund = await chainGrpcInsuranceFundApi.fetchInsuranceFund( + marketId +); + +console.log(insuranceFund); +``` + +### あるmarketにおける指定したinjective addressの予測されるredemptionsを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcInsuranceFundApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcInsuranceFundApi = new ChainGrpcInsuranceFundApi(endpoints.grpc); + +const marketId = "0x..."; +const injectiveAddress = "inj..."; + +const estimatedRedemptions = + await chainGrpcInsuranceFundApi.fetchEstimatedRedemptions({ + marketId, + address: injectiveAddress, + }); + +console.log(estimatedRedemptions); +``` + +### あるmarketにおける指定したinjective addressのpending redemptionsを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcInsuranceFundApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcInsuranceFundApi = new ChainGrpcInsuranceFundApi(endpoints.grpc); + +const marketId = "0x..."; +const injectiveAddress = "inj..."; + +const pendingRedemptions = + await chainGrpcInsuranceFundApi.fetchPendingRedemptions({ + marketId, + address: injectiveAddress, + }); + +console.log(pendingRedemptions); +``` diff --git a/.gitbook/jp/developers-native/query-chain/mint.mdx b/.gitbook/jp/developers-native/query-chain/mint.mdx new file mode 100644 index 00000000..8d0d9eb0 --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/mint.mdx @@ -0,0 +1,50 @@ +--- +title: Mint +updatedAt: "2025-12-23" +--- + +チェーン上のmintモジュールをクエリするためのコードスニペット例。 + +## gRPCを使用する + +### mintモジュールに関連するパラメータを取得する + +```ts +import { ChainGrpcMintApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcMintApi = new ChainGrpcMintApi(endpoints.grpc); + +const moduleParams = await chainGrpcMintApi.fetchModuleParams(); + +console.log(moduleParams); +``` + +### inflationを取得する + +```ts +import { ChainGrpcMintApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcMintApi = new ChainGrpcMintApi(endpoints.grpc); + +const inflation = await chainGrpcMintApi.fetchInflation(); + +console.log(inflation); +``` + +### annual provisionsを取得する + +```ts +import { ChainGrpcMintApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcMintApi = new ChainGrpcMintApi(endpoints.grpc); + +const annualProvisions = await chainGrpcMintApi.fetchAnnualProvisions(); + +console.log(annualProvisions); +``` diff --git a/.gitbook/jp/developers-native/query-chain/oracle.mdx b/.gitbook/jp/developers-native/query-chain/oracle.mdx new file mode 100644 index 00000000..4092a90e --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/oracle.mdx @@ -0,0 +1,22 @@ +--- +title: Oracle +updatedAt: "2025-12-23" +--- + +oracle apiを介してチェーンをクエリするためのコードスニペット例。 + +## gRPCを使用する + +### oracleに関連するパラメータを取得する + +```ts +import { ChainGrpcOracleApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcOracleApi = new ChainGrpcOracleApi(endpoints.grpc); + +const moduleParams = await chainGrpcOracleApi.fetchModuleParams(); + +console.log(moduleParams); +``` diff --git a/.gitbook/jp/developers-native/query-chain/peggy.mdx b/.gitbook/jp/developers-native/query-chain/peggy.mdx new file mode 100644 index 00000000..686437c5 --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/peggy.mdx @@ -0,0 +1,22 @@ +--- +title: Peggy +updatedAt: "2025-12-23" +--- + +peggy apiを介してチェーンをクエリするためのコードスニペット例。 + +## gRPCを使用する + +### peggyに関連するパラメータを取得する + +```ts +import { ChainGrpcPeggyApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcPeggyApi = new ChainGrpcPeggyApi(endpoints.grpc); + +const moduleParams = await chainGrpcPeggyApi.fetchModuleParams(); + +console.log(moduleParams); +``` diff --git a/.gitbook/jp/developers-native/query-chain/permissions.mdx b/.gitbook/jp/developers-native/query-chain/permissions.mdx new file mode 100644 index 00000000..59709f7c --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/permissions.mdx @@ -0,0 +1,100 @@ +--- +title: Permissions +updatedAt: "2025-12-23" +--- + +チェーン上のpermissionsモジュール関連のデータをクエリするためのコードスニペット例。 + +## gRPCを使用する + +### すべてのnamespaceを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcPermissionsApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcPermissionsApi = new ChainGrpcPermissionsApi(endpoints.grpc); + +const allNamespaces = await chainGrpcPermissionsApi.fetchAllNamespaces(); + +console.log(allNamespaces); +``` + +### denomに基づいてnamespaceを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcPermissionsApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcPermissionsApi = new ChainGrpcPermissionsApi(endpoints.grpc); + +const subdenom = "NINJA"; +const includeRoles = true; + +const namespace = await chainGrpcPermissionsApi.fetchNamespaceByDenom({ + subdenom, + includeRoles: includeRoles, +}); + +console.log(namespace); +``` + +### denomに基づいて、アドレスに紐づくすべてのroleを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcPermissionsApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcPermissionsApi = new ChainGrpcPermissionsApi(endpoints.grpc); + +const injectiveAddress = "inj..."; +const subdenom = "NINJA"; + +const addressRoles = await chainGrpcPermissionsApi.fetchAddressRoles({ + injectiveAddress, + denom: subdenom, +}); + +console.log(addressRoles); +``` + +### あるdenomで指定されたroleに紐づくすべてのアドレスを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcPermissionsApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcPermissionsApi = new ChainGrpcPermissionsApi(endpoints.grpc); + +const subdenom = "NINJA"; +const role = "role"; + +const addressesByRole = await chainGrpcPermissionsApi.fetchAddressesByRole({ + subdenom, + role: role, +}); + +console.log(addressesByRole); +``` + +### 指定されたinjective addressのvouchersを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcPermissionsApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcPermissionsApi = new ChainGrpcPermissionsApi(endpoints.grpc); + +const injectiveAddress = "inj..."; + +const vouchers = await chainGrpcPermissionsApi.fetchVouchersForAddress( + injectiveAddress +); + +console.log(vouchers); +``` diff --git a/.gitbook/jp/developers-native/query-chain/staking.mdx b/.gitbook/jp/developers-native/query-chain/staking.mdx new file mode 100644 index 00000000..c695c2f2 --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/staking.mdx @@ -0,0 +1,212 @@ +--- +title: Staking +updatedAt: "2025-12-23" +--- + +チェーンのstakingモジュールをクエリするためのコードスニペット例。 + +## gRPCを使用する + +### unbonding timeやbond denomなど、stakingモジュールに関連するパラメータを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcStakingApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcStakingApi = new ChainGrpcStakingApi(endpoints.grpc); + +const moduleParams = await chainGrpcStakingApi.fetchModuleParams(); + +console.log(moduleParams); +``` + +### poolのunbonded tokensおよびbonded tokensを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcStakingApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcStakingApi = new ChainGrpcStakingApi(endpoints.grpc); + +const pool = await chainGrpcStakingApi.fetchPool(); + +console.log(pool); +``` + +### validatorsとそれに関連するmetadataを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcStakingApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcStakingApi = new ChainGrpcStakingApi(endpoints.grpc); + +const validators = await chainGrpcStakingApi.fetchValidators(); + +console.log(validators); +``` + +### validator addressからvalidatorとそれに関連するmetadataを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcStakingApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcStakingApi = new ChainGrpcStakingApi(endpoints.grpc); + +const validatorAddress = "injvaloper..."; + +const validator = await chainGrpcStakingApi.fetchValidator(validatorAddress); + +console.log(validator); +``` + +### validatorに紐づくdelegationsを取得する + +```ts +import { getNetworkEndpoints, Network } from '@injectivelabs/networks' +import { PaginationOption } from '@injectivelabs/sdk-ts/types' +import { ChainGrpcStakingApi } from '@injectivelabs/sdk-ts/client/chain' + +const endpoints = getNetworkEndpoints(Network.Testnet) +const chainGrpcStakingApi = new ChainGrpcStakingApi(endpoints.grpc) + +const validatorAddress = 'injvaloper...' +const pagination = {...} as PaginationOption + +const delegations = await chainGrpcStakingApi.fetchValidatorDelegationsNoThrow({ + validatorAddress, + pagination /* optional pagination options */ +}) + +console.log(delegations) +``` + +### validatorに紐づくunbonding delegationsを取得する + +```ts +import { getNetworkEndpoints, Network } from '@injectivelabs/networks' +import { PaginationOption } from '@injectivelabs/sdk-ts/types' +import { ChainGrpcStakingApi } from '@injectivelabs/sdk-ts/client/chain' + +const endpoints = getNetworkEndpoints(Network.Testnet) +const chainGrpcStakingApi = new ChainGrpcStakingApi(endpoints.grpc) + +const validatorAddress = 'injvaloper...' +const pagination = {...} as PaginationOption + +const unbondingDelegations = await chainGrpcStakingApi.fetchValidatorUnbondingDelegationsNoThrow({ + validatorAddress, + pagination /* optional pagination options */ +}) + +console.log(unbondingDelegations) +``` + +### 特定のvalidatorに対するinjective addressのdelegationsを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcStakingApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcStakingApi = new ChainGrpcStakingApi(endpoints.grpc); + +const injectiveAddress = "inj..."; +const validatorAddress = "injvaloper..."; + +const delegation = await chainGrpcStakingApi.fetchDelegation({ + injectiveAddress, + validatorAddress, +}); + +console.log(delegation); +``` + +### injective addressのdelegationsを取得する + +```ts +import { getNetworkEndpoints, Network } from '@injectivelabs/networks' +import { PaginationOption } from '@injectivelabs/sdk-ts/types' +import { ChainGrpcStakingApi } from '@injectivelabs/sdk-ts/client/chain' + +const endpoints = getNetworkEndpoints(Network.Testnet) +const chainGrpcStakingApi = new ChainGrpcStakingApi(endpoints.grpc) + +const injectiveAddress = 'inj...' +const pagination = {...} as PaginationOption + +const delegations = await chainGrpcStakingApi.fetchDelegationsNoThrow({ + injectiveAddress, + pagination /* optional pagination options */ +}) + +console.log(delegations) +``` + +### validatorのdelegatorsを取得する + +```ts +import { getNetworkEndpoints, Network } from '@injectivelabs/networks' +import { PaginationOption } from '@injectivelabs/sdk-ts/types' +import { ChainGrpcStakingApi } from '@injectivelabs/sdk-ts/client/chain' + +const endpoints = getNetworkEndpoints(Network.Testnet) +const chainGrpcStakingApi = new ChainGrpcStakingApi(endpoints.grpc) + +const validatorAddress = 'injvaloper...' +const pagination = {...} as PaginationOption + +const delegators = await chainGrpcStakingApi.fetchDelegatorsNoThrow({ + validatorAddress, + pagination /* optional pagination options */ +}) + +console.log(delegators) +``` + +### injective addressのunbonding delegationsを取得する + +```ts +import { getNetworkEndpoints, Network } from '@injectivelabs/networks' +import { PaginationOption } from '@injectivelabs/sdk-ts/types' +import { ChainGrpcStakingApi } from '@injectivelabs/sdk-ts/client/chain' + +const endpoints = getNetworkEndpoints(Network.Testnet) +const chainGrpcStakingApi = new ChainGrpcStakingApi(endpoints.grpc) + +const injectiveAddress = 'inj...' +const pagination = {...} as PaginationOption + +const unbondingDelegations = await chainGrpcStakingApi.fetchUnbondingDelegationsNoThrow({ + injectiveAddress, + pagination /* optional pagination options */ +}) + +console.log(unbondingDelegations) +``` + +### injective addressのredelegationsを取得する + +```ts +import { getNetworkEndpoints, Network } from '@injectivelabs/networks' +import { PaginationOption } from '@injectivelabs/sdk-ts/types' +import { ChainGrpcStakingApi } from '@injectivelabs/sdk-ts/client/chain' + +const endpoints = getNetworkEndpoints(Network.Testnet) +const chainGrpcStakingApi = new ChainGrpcStakingApi(endpoints.grpc) + +const injectiveAddress = 'inj...' +const pagination = {...} as PaginationOption + +const unbondingDelegations = await chainGrpcStakingApi.fetchReDelegationsNoThrow({ + injectiveAddress, + pagination /* optional pagination options */ +}) + +console.log(unbondingDelegations) +``` diff --git a/.gitbook/jp/developers-native/query-chain/tendermint.mdx b/.gitbook/jp/developers-native/query-chain/tendermint.mdx new file mode 100644 index 00000000..397f13cc --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/tendermint.mdx @@ -0,0 +1,36 @@ +--- +title: Tendermint +updatedAt: "2025-12-23" +--- + +チェーンノード関連のデータをクエリするためのコードスニペット例。 + +## HTTP RESTを使用する + +### 最新のblock情報を取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainRestTendermintApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainRestTendermintApi = new ChainRestTendermintApi(endpoints.rest); + +const latestBlock = await chainRestTendermintApi.fetchLatestBlock(); + +console.log(latestBlock); +``` + +### chain nodeの情報を取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainRestTendermintApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainRestTendermintApi = new ChainRestTendermintApi(endpoints.rest); + +const nodeInfo = await chainRestTendermintApi.fetchNodeInfo(); + +console.log(nodeInfo); +``` diff --git a/.gitbook/jp/developers-native/query-chain/token-factory.mdx b/.gitbook/jp/developers-native/query-chain/token-factory.mdx new file mode 100644 index 00000000..8ebccb06 --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/token-factory.mdx @@ -0,0 +1,42 @@ +--- +title: Token Factory +updatedAt: "2025-12-23" +--- + +token factoryモジュール関連のデータをチェーンからクエリするためのコードスニペット例。 + +## gRPCを使用する + +### _creator_ が作成したすべてのdenomを取得する + +```ts lines highlight={1} +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcTokenFactoryApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcTokenFactoryApi = new ChainGrpcTokenFactoryApi(endpoints.grpc); + +const creator = "inj..."; +const denoms = await chainGrpcTokenFactoryApi.fetchDenomsFromCreator(creator); + +console.log(denoms); +``` + +### denom authority metadataを取得する(トークンのadminを取得するなど) + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcTokenFactoryApi } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcTokenFactoryApi = new ChainGrpcTokenFactoryApi(endpoints.grpc); + +const creator = "inj..."; +const subdenom = "NINJA"; +const metadata = await chainGrpcTokenFactoryApi.fetchDenomAuthorityMetadata( + creator, + subdenom +); + +console.log(metadata); +``` diff --git a/.gitbook/jp/developers-native/query-chain/wasm.mdx b/.gitbook/jp/developers-native/query-chain/wasm.mdx new file mode 100644 index 00000000..edba8f0f --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/wasm.mdx @@ -0,0 +1,161 @@ +--- +title: Wasm +updatedAt: "2025-12-23" +--- + +チェーン上のwasmモジュールをクエリするためのコードスニペット例。 + +## gRPCを使用する + +### contractのアカウント残高を取得する。追加のアカウントを取得するためにpaginationパラメータを渡すこともできます。 + +```ts +import { getNetworkEndpoints, Network } from '@injectivelabs/networks' +import { ChainGrpcWasmApi, PaginationOption } from '@injectivelabs/sdk-ts/client/chain' + +const endpoints = getNetworkEndpoints(Network.Testnet) +const chainGrpcWasmApi = new ChainGrpcWasmApi(endpoints.grpc) + +const contractAddress = 'inj...' +const pagination = {...} as PaginationOption + +const contractAccountsBalance = await chainGrpcWasmApi.fetchContractAccountsBalance({ + contractAddress, + pagination /* optional pagination options */ +}) + +console.log(contractAccountsBalance) +``` + +### contractに関連する情報を取得する + +```ts +import { ChainGrpcWasmApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcWasmApi = new ChainGrpcWasmApi(endpoints.grpc); + +const contractAddress = "inj..."; + +const contractInfo = await chainGrpcWasmApi.fetchContractInfo(contractAddress); + +console.log(contractInfo); +``` + +### contractのhistoryを取得する + +```ts +import { ChainGrpcWasmApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcWasmApi = new ChainGrpcWasmApi(endpoints.grpc); + +const contractAddress = "inj..."; + +const contractHistory = await chainGrpcWasmApi.fetchContractHistory( + contractAddress +); + +console.log(contractHistory); +``` + +### smart contractのstateを取得する + +```ts +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; +import { ChainGrpcWasmApi, toBase64 } from "@injectivelabs/sdk-ts/client/chain"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcWasmApi = new ChainGrpcWasmApi(endpoints.grpc); + +const contractAddress = "inj..."; +const query = "..."; +const queryFromObject = toBase64({ get_coin: {} }); + +const contractState = await chainGrpcWasmApi.fetchSmartContractState({ + contractAddress, + query /* optional string query - HAS to be in base64 or use queryFromObject */, +}); + +console.log(contractState); +``` + +### smart contractのraw stateを取得する + +```ts +import { ChainGrpcWasmApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcWasmApi = new ChainGrpcWasmApi(endpoints.grpc); + +const contractAddress = "inj..."; +const query = "..."; +const queryFromObject = toBase64({ get_coin: {} }); + +const rawContractState = await chainGrpcWasmApi.fetchRawContractState({ + contractAddress, + query /* optional string query - HAS to be in base64 or use queryFromObject */, +}); + +console.log(rawContractState); +``` + +### contractに紐づくcodesを取得する + +```ts +import { PaginationOption } from '@injectivelabs/sdk-ts/types' +import { ChainGrpcWasmApi } from '@injectivelabs/sdk-ts/client/chain' +import { getNetworkEndpoints, Network } from '@injectivelabs/networks' + +const endpoints = getNetworkEndpoints(Network.Testnet) +const chainGrpcWasmApi = new ChainGrpcWasmApi(endpoints.grpc) + +const pagination = {...} as PaginationOption + + +const rawContractState = await chainGrpcWasmApi.fetchRawContractState( +pagination /* optional pagination options */ +) + +console.log(rawContractState) +``` + +### contract codeに紐づく情報を取得する + +```ts +import { ChainGrpcWasmApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcWasmApi = new ChainGrpcWasmApi(endpoints.grpc); + +const codeId = 1; + +const codeDetails = await chainGrpcWasmApi.fetchContractCode(codeId); + +console.log(codeDetails); +``` + +### codeに紐づくcontractsを取得する + +```ts +import { PaginationOption } from '@injectivelabs/sdk-ts/types' +import { getNetworkEndpoints, Network } from '@injectivelabs/networks' +import { ChainGrpcWasmApi } from '@injectivelabs/sdk-ts/client/chain' + +const endpoints = getNetworkEndpoints(Network.Testnet) +const chainGrpcWasmApi = new ChainGrpcWasmApi(endpoints.grpc) + +const codeId = 1 +const pagination = {...} as PaginationOption + +const contracts = await chainGrpcWasmApi.fetchContractCodeContracts({ + codeId, + pagination /* optional pagination options */ +}) + +console.log(contracts) +``` diff --git a/.gitbook/jp/developers-native/query-chain/wasmx.mdx b/.gitbook/jp/developers-native/query-chain/wasmx.mdx new file mode 100644 index 00000000..d6652117 --- /dev/null +++ b/.gitbook/jp/developers-native/query-chain/wasmx.mdx @@ -0,0 +1,36 @@ +--- +title: WasmX +updatedAt: "2025-12-23" +--- + +チェーン上のwasmXモジュールをクエリするためのコードスニペット例。 + +## gRPCを使用する + +### wasmXモジュールに関連するパラメータを取得する + +```ts +import { ChainGrpcWasmXApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcWasmXApi = new ChainGrpcWasmXApi(endpoints.grpc); + +const moduleParams = await chainGrpcWasmXApi.fetchModuleParams(); + +console.log(moduleParams); +``` + +### wasmXモジュールのstateを取得する + +```ts +import { ChainGrpcWasmXApi } from "@injectivelabs/sdk-ts/client/chain"; +import { getNetworkEndpoints, Network } from "@injectivelabs/networks"; + +const endpoints = getNetworkEndpoints(Network.Testnet); +const chainGrpcWasmXApi = new ChainGrpcWasmXApi(endpoints.grpc); + +const moduleState = await chainGrpcWasmXApi.fetchModuleState(); + +console.log(moduleState); +``` From 7e9d4e19def9c52d3cfe4920b300c27ca8068fad Mon Sep 17 00:00:00 2001 From: Star Assistant Date: Thu, 28 May 2026 18:38:26 +0800 Subject: [PATCH 2/2] fix(jp): apply translation review fixes for examples pages MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - bank.mdx: 「セキュアなやり取り」→「安全にやり取り」、「しなければならない」→「する必要がある」 - exchange.mdx: MsgBatchCancelDerivativeOrders 説明文をヘッダーの後に移動 - feegrant.mdx: grant 上書き表現をより正確に修正 - governance.mdx: 「コミュニティ運営」→「コミュニティ主導」 - token-factory.mdx: MsgBurn・MsgSetDenomMetadata の説明文を改善 --- .gitbook/jp/developers-native/examples/bank.mdx | 2 +- .gitbook/jp/developers-native/examples/exchange.mdx | 4 ++-- .gitbook/jp/developers-native/examples/feegrant.mdx | 2 +- .gitbook/jp/developers-native/examples/governance.mdx | 2 +- .gitbook/jp/developers-native/examples/token-factory.mdx | 4 ++-- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.gitbook/jp/developers-native/examples/bank.mdx b/.gitbook/jp/developers-native/examples/bank.mdx index aa5fdd17..37c4a986 100644 --- a/.gitbook/jp/developers-native/examples/bank.mdx +++ b/.gitbook/jp/developers-native/examples/bank.mdx @@ -3,7 +3,7 @@ title: Bank updatedAt: "2025-11-28" --- -Bankモジュールは、アカウント間のマルチアセットコイン転送の処理、および特定の種類のアカウント(特にvestingアカウントのdelegate/undelegate)で異なる動作が必要な特殊な擬似転送のトラッキングを担当します。残高を変更しなければならない他のモジュールとのセキュアなやり取りのために、さまざまな機能を持つ複数のインターフェースを公開しています。 +Bankモジュールは、アカウント間のマルチアセットコイン転送の処理、および特定の種類のアカウント(特にvestingアカウントのdelegate/undelegate)で異なる動作が必要な特殊な擬似転送のトラッキングを担当します。残高を変更する必要がある他のモジュールと安全にやり取りするために、さまざまな機能を持つ複数のインターフェースを公開しています。 加えて、Bankモジュールはアプリケーションで使用されるすべてのアセットの総供給量をトラッキングし、クエリのサポートを提供します。 diff --git a/.gitbook/jp/developers-native/examples/exchange.mdx b/.gitbook/jp/developers-native/examples/exchange.mdx index 869e4fb3..9e3a07b9 100644 --- a/.gitbook/jp/developers-native/examples/exchange.mdx +++ b/.gitbook/jp/developers-native/examples/exchange.mdx @@ -532,10 +532,10 @@ const txHash = await new MsgBroadcasterWithPk({ console.log(txHash); ``` -このメッセージはチェーン上のspot注文をバッチでキャンセルするために使用されます - ### MsgBatchCancelDerivativeOrders +このメッセージはチェーン上のspot注文をバッチでキャンセルするために使用されます + ```ts import { Network } from "@injectivelabs/networks"; import { MsgBroadcasterWithPk } from "@injectivelabs/sdk-ts/core/tx"; diff --git a/.gitbook/jp/developers-native/examples/feegrant.mdx b/.gitbook/jp/developers-native/examples/feegrant.mdx index f8cdd21c..9e485796 100644 --- a/.gitbook/jp/developers-native/examples/feegrant.mdx +++ b/.gitbook/jp/developers-native/examples/feegrant.mdx @@ -9,7 +9,7 @@ updatedAt: "2025-11-28" ### MsgGrantAllowance -fee allowance grantは`MsgGrantAllowance`メッセージを使用して作成されます。すでに(granter, grantee)ペアに対するgrantが存在する場合、新しいgrantで以前のものが上書きされます。 +fee allowance grantは`MsgGrantAllowance`メッセージを使用して作成されます。すでに (granter, grantee) ペアに対するgrantが存在する場合、新しいgrantによって以前のgrantは上書きされます。 ```ts import { Network } from "@injectivelabs/networks"; diff --git a/.gitbook/jp/developers-native/examples/governance.mdx b/.gitbook/jp/developers-native/examples/governance.mdx index a6d57f18..0f4b4efe 100644 --- a/.gitbook/jp/developers-native/examples/governance.mdx +++ b/.gitbook/jp/developers-native/examples/governance.mdx @@ -3,7 +3,7 @@ title: Governance updatedAt: "2025-12-23" --- -Injectiveはコミュニティ運営のブロックチェーンであり、INJをステーキングしているユーザーはブロックチェーンに関するgovernanceに参加できます。Injectiveプログラムへの修正、技術アップグレード、またはInjectiveエコシステム全体に影響を与えるその他のInjective関連の変更について、Proposalを提出できます。 +Injectiveはコミュニティ主導のブロックチェーンであり、INJをステーキングしているユーザーはブロックチェーンのgovernanceに参加できます。Injectiveプログラムへの修正、技術アップグレード、またはInjectiveエコシステム全体に影響を与えるその他のInjective関連の変更について、Proposalを提出できます。 作成する各Proposalに対して、少なくとも1 INJのデポジットが必要です。これはあなたがInjectiveコミュニティのアクティブな参加者であり、Proposalの作成とプロトコルのガバナンスに資格があることを確認するためです。Proposalが投票ステージに進むには、500 INJのデポジットが必要です。500 INJを自身でデポジットすることもできますし、コミュニティと協力してまとめてデポジットすることもできます。 diff --git a/.gitbook/jp/developers-native/examples/token-factory.mdx b/.gitbook/jp/developers-native/examples/token-factory.mdx index bdf0e9bf..fd2c5dbf 100644 --- a/.gitbook/jp/developers-native/examples/token-factory.mdx +++ b/.gitbook/jp/developers-native/examples/token-factory.mdx @@ -79,7 +79,7 @@ console.log(txHash); ### MsgBurn -adminはtoken factoryの供給量をバーンできます。それ以外のすべての人は、このメッセージを使用して自分の資金のみをバーンできます。 +adminは、token factoryトークンの供給量をバーンできます。それ以外のユーザーは、このメッセージを使用して自身の資金のみをバーンできます。 ```ts import { Network } from "@injectivelabs/networks"; @@ -111,7 +111,7 @@ console.log(txHash); ### MsgSetDenomMetadata -特定のdenomへのメタデータの設定はdenomのadminのみが許可されます。bankモジュール内のdenomメタデータを上書きできます。 +特定のdenomに対するメタデータの設定は、そのdenomのadminのみが実行できます。このメッセージを使用することで、bankモジュール内のdenomメタデータを上書きできます。 ```ts import { Network } from "@injectivelabs/networks";