Skip to content

Commit

Permalink
GITBOOK-19: change request with no subject merged in GitBook
Browse files Browse the repository at this point in the history
  • Loading branch information
Bojan Angjelkoski authored and gitbook-bot committed Sep 22, 2023
1 parent f834622 commit 0c121f5
Showing 1 changed file with 22 additions and 2 deletions.
24 changes: 22 additions & 2 deletions .gitbook/contracts/injective-name-service.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,28 @@
# Injective Name Service

Within this section we are going to have a look how to query the Injective name service contracts.
Within this section, we will look at how to query the Injective name service contracts.

## Querying
## Abstraction Service

You can use our `InjNameService` [abstraction](../../packages/sdk-ui-ts/src/services/nameservice/InjNameService.ts) to query the smart contracts with a single method call. Below this example, you can also find the raw implementation on how to query the smart contracts in case you need more flexibility. 

<pre class="language-typescript"><code class="lang-typescript">import { getNetworkEndpoints, Network } from '@injectivelabs/network'
import { InjNameService } from '@injectivelabs/sdk-ui-ts'

(async (){
const injNameService = new InjNameService(Network.Testnet)

<strong> const name = 'ninja.inj'
</strong>
// Fetch the address for the particular name
const address = await injNameService.fetchInjAddress(name)

// Fetch the name for the particular address
const nameFromAddress = await injNameService.fetchInjName(address)
})()
</code></pre>

## Raw Smart Contract Querying

Example code snippets to resolve .inj domain name.

Expand Down

0 comments on commit 0c121f5

Please sign in to comment.