bitpro가 원문에서 글자만 모은 내용이에요. 표·그림·수식은 빠지거나 깨질 수 있어요. 전체 12쪽 중 9쪽
getAddress('registry.arb', {
rpcUrl: 'https://arb1.arbitrum.io/rpc',
timeout: 5000,
})
// Works with all methods
const name = await web3name.getDomainName({
address: '0x2886D6792503e04b19640C1f1430d23219AF177F',
queryChainIdList: [10200],
timeout: 5000,
})
const metadata = await web3name.getMetadata({
name: 'spaceid.bnb',
timeout: 5000,
})
```
If a request exceeds the timeout duration, it will throw an error with a message indicating the timeout. The timeout applies to all network operations, including name resolution, reverse lookups, and metadata fetches.
# FAQ
### 1. What is the SPACE ID Web3 Name API?
The Web3 Name API is a free HTTP API that helps developers integrate Web3 domains to their apps, efficiently and securely. The API provides:
* Domain resolution: convert Web3 Domains into crypto addresses.
* Reverse resolution: retrieve the primary Web3 Domain uniquely linked to the crypto address.
### 2. How do I access the API?
You can access the API simply by sending requests to the endpoint URLs (as stated below) using the HTTP method GET.
### 3. How do I resolve a domain to an address using the API?
Send a GET request: 
`https://nameapi.space.id/getAddress?domain=spaceid.bnb`
Response: { "address": "0xb5932a6B7d50A966AEC6C74C97385412Fb497540"}
### 4. How do I reverse resolve an address to a domain?
Send a GET request:
`https://nameapi.space.id/getName?chainid=56&address=0xb5932a6B7d50A966AEC6C74C97385412Fb497540`
Response: {"name": "spaceid.bnb"}
### 5. What is the SPACE ID Web3 Name SDK, and what's the difference between SDK and API?
The SDK is a JavaScript/TypeScript library designed for client-side and backend integrations, allowing developers to directly query on-chain domain records inside their apps instead of handling API calls.
Conversely, the API is a RESTful service that enables developers to access SPACE ID’s domain name resolution via HTTP requests, making it ideal for server-side applications and large-scale integrations.
### 6. How do I install the SDK and resolve domain names?
Developers can install the Web3 Name SDK via:
`npm install @web3-name-sdk/core viem@^1.20` 
And check the complete SDK documents here:
<https://docs.space.id/developer-guide/web3-name-api-and-sdk/web3-name-sdk><br>
<br>
# Registration Integration
Currently, SPACE ID provides an easy way for partners to integrate **.bnb**, **.arb**, and **.eth** domain name registrations. Partners can use our web3-name-sdk with their own designed front-end interfaces to allow their customers to smoothly own a unique web3 domain name. Additionally, qualified partners can also earn commission fees when users register .arb and .bnb domains on their own integrated registration portal.
## Installation
Use **npm** or **yarn** to install our web3-name-sdk along with ethers v5. Ethers v6 has breaking changes and it has not been widely adopted so far. Therefore, we choose to stick with ethers v5.
```
npm install @web3-name-sdk/register ethers@5.7.2
```
```
yarn add @web3-name-sdk/register ethers@5.7.2
```
If you are using `next.js`, please add the following configuration in your `next.config.js` in order to transpile commonjs dependencies:
```javascript
const nextConfig = {
transpilePackages: ['@web3-name-sdk/register'],
}
```
## Registration Steps
Domain registration has 3 steps. The **first step** is to check the availability of a specific domain. If the domain is valid and available, the **second step** would be querying the registration fee of the domain. The fee depends on the length and registration duration of a domain. The **third step** is to let users call the registration function with all the necessary parameters and registration fees.
## Code Examples
### BNB Registration
```javascript
import SIDRegister from ‘@web3-name-sdk/register’
import { providers } from ‘ethers’
async function registerDomain(label: String) {
// detect provider
if (window.ethereum) {
const provider = new providers.Web3Provider(window.ethereum)
// switch to bsc
await provider.send('wallet_switchEthereumChain', [{ chainId: '0x38' }])
// connect wallet
await provider.send('eth_requestAccounts', [])
// get signer
const signer = provider.getSigner()
// get address
const address = await signer.getAddress()
// init SIDRegister
const register = new SIDRegister({ signer, chainId: 56 })
// check if available
const available = await register.getAvailable(label)
// get price. params:{label, duration}
const price = await register.getRentPrice(label, 1)
// register for one year. params:{label, address, duration, {setPrimaryName, referrer}}
await register.register(label, address, 1, {
setPrimaryName: true, // set as primary name, default is false,
referrer: 'test.bnb' // referrer domain, default is null
})
}
}
```
### ARB Registration
```javascript
import SIDRegister from '@web3-name-sdk/register'
import { providers } from 'ethers'
async function registerDomain(label: String) {
// detect provider
if (window.ethereum) {
const provider = new providers.Web3Provider(window.ethereum)
// switch to arbitrum one
await provider.send('wallet_switchEthereumChain', [{ chainId: '0xA4B1' }])
// connect wallet
await provider.send('eth_requestAccounts', [])
// get signer
const signer = provider.getSigner()
// get address
const address = await signer.getAddress()
// init SIDRegister
const register = new SIDRegister({ signer, chainId: 42161 })
// check if available
const available = await register.getAvailable(label)
// get price
const price = await register.getRentPrice(label, 1, {
setPrimaryName: true, // set as primary name, default is false,
referrer: 'test.bnb' // referrer domain, default is null
})
// register for one year
await register.register(label, address, 1)
}
}
```
**\*Notice:** 
* **Label** is the domain name without TLD subfix.(eg: test is the label of domain test.bnb) 
* **ARB** **chain id** is 42161, **BNB** **chain id** is 56. 
* **Primary Name** is the name that will be displayed on the front end for any dapp that integrates our name-resolving SDK. setPrimaryName can be passed as a parameter as new users register domain. Its default value should be set to false.
* **Referrer** is the referrer's domain name. The commission fee will be sent to the address that this domain name resolves to. Be sure to set up both the primary name and resolving address before using the domain as the referrer.
### ETH Registraion
```javascript
import SIDRegister from '@web3-name-sdk/register'
import { providers } from 'ethers'
async function registerEthDomain(label: String) {
// detect provider
if (window.ethereum) {
const provider = new providers.Web3Provider(window.ethereum)
// switch to bsc
await provider.send('wallet_switchEthereumChain', [{ chainId: '0x1' }])
// connect wallet
await provider.send('eth_requestAccounts', [])
// get signer
const signer = provider.getSigner()
// get address
const address = await signer.getAddress()
// init SIDRegister
const register = new SIDRegister({ signer, chainId: 1 })
// check if available
const available = await register.getAvailable(label)
// get price
const price = await register.getRentPrice(label, 1)
// register for one year
await register.register(label, address, 1, {
// wait for commit to be valid, waitTime = 60 in milliseconds
onCommitSuccess: (waitTime) => {
return new Promise(resolve => {
setTimeout(resolve, waitTime * 1000)
})
}
})
}
}
```
**\*Notice:** 
* **Label** is the domain name without TLD subfix.(eg: test is the label of domain test.bnb).
* **ETH chain id** is 1.
* **Referrer** cannot be applied to eth registration and SetPrimaryName does not apply either.
* ETH Registration has one additional step. Users need to commit a message before registering domains. Our SDK has wrapped these two steps into a callback function. Once the first function call is successful, the function has to wait 60 seconds to make the callback.
More details can be referred from <https://www.npmjs.com/package/@web3-name-sdk/register>
# Integration Partners
## SPACE ID 3.0 Partner
<div><figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FOikpRxrY0XQRVSxdFBdG%2FInjective_logo.png?alt=media&token=8a86da09-1595-4e78-b465-a828889c04f7" alt=""><figcaption><p>.inj domain by Injective</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FR7Tm3lE0VypQcD6ZGtpx%2Fmanta_logo.png?alt=media&token=5c729b37-db35-4495-a571-dbb17147a65b" alt=""><figcaption><p>.manta domain by Manta Network </p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FFy5JXS6iedBUCOwbnJkw%2Fpancakeswap%E2%80%94%E2%80%94logo.png?alt=media&token=33d6a78b-6c84-4e2d-8271-32c2aa92d883" alt=""><figcaption><p>.cake domain by PancakeSwap</p></figcaption></figure></div>
<div><figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2F5PXmRTbczfQghA5QzbxJ%2FTaiko.png?alt=media&token=c76daa6e-5260-465b-bdc0-09173e1f751d" alt=""><figcaption><p>.taiko domain by Taiko</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FpP2T5PNWUohuY2KdYjW1%2FZKFair%20Community.png?alt=media&token=9d5efc2a-5a2d-4aa1-9d06-d0f0eea58bd6" alt=""><figcaption><p>.zkf domain by ZKFair</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2Fjg1PZDZuN0ZDodqFxStC%2FMode.png?alt=media&token=d175538f-72e4-464d-8cd5-b69b9e991903" alt=""><figcaption><p>.mode domain by Mode</p></figcaption></figure></div>
<div><figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FaR9JVGTODBL63YIjyMr6%2Fseins_logo.png?alt=media&token=16ea739a-695a-4581-9d65-47be25ed88b4" alt="" width="375"><figcaption><p>.sei Name Service</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FYGHYXGcwAIznnZSZd4rl%2Fgenome_logo.png?alt=media&token=cad7361d-d9d5-46c2-996d-57b8d7e5e42f" alt="" width="375"><figcaption><p>.gno by Genome</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FsF9KYI2NL1HGbZMHStxA%2FZetaChain.png?alt=media&token=fb9d2784-147a-4112-b41e-3ba8c9495e23" alt="" width="375"><figcaption><p>.zeta domain by Zeta Chain</p></figcaption></figure></div>
<div><figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2F6GR0kZ85EN8l4RpcyTd0%2FMint.png?alt=media&token=42d03229-ee4f-455b-bca4-926dfc289db5" alt=""><figcaption><p>.mint domain by Mint</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FLMo1Z2on6ioLmCp40vbS%2FMerlin%20Chain.png?alt=media&token=0b5e15d6-d3c9-434d-8dfc-f5a87a02381e" alt=""><figcaption><p>.merlin domain by Merlin</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FlDjkb0vUR3eCVT8x7B9b%2FFLOKI.png?alt=media&token=f3abe435-f546-43d5-99c6-645fe4af34f4" alt=""><figcaption><p>.floki domain by Floki</p></figcaption></figure></div>
<div><figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FUwDM1TIUdp0xUIJ4036O%2FBurgerCities.png?alt=media&token=f156f891-ff72-481e-b01f-0366374df125" alt=""><figcaption><p>.burger domain by BurgerCities</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2Fmor9fXcu6NZgqj8ZljoK%2FALIENX.png?alt=media&token=44b8d8ce-c999-48fe-a757-676103baf3dc" alt=""><figcaption><p>.alien domain by ALIENX</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FF6z9CvHt7CBbYf4Z1RIr%2FAILayer.png?alt=media&token=bea5b471-9384-4087-b7d6-40b8613b36f0" alt=""><figcaption><p>.ail domain by AILayer</p></figcaption></figure></div>
<div><figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2F37R56nhfAvvNYDg43eAA%2FLightLink.png?alt=media&token=e383364d-03ce-4bad-9a3e-42d60910f4d3" alt="" width="375"><figcaption><p>.ll domain by Lightlink</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FS31LS6aXdsfJXtDFY2SO%2FTomo%20Inc..png?alt=media&token=46e2e624-169a-42b7-b0ef-7ca33298b544" alt="" width="375"><figcaption><p>.tomo domain by TOMO</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FG9ITh1p0dYnMTwx3e8kA%2FGroup%20883379855.png?alt=media&token=9fcb4df9-e9b7-4912-96c9-00cdd281ca5e" alt="" width="384"><figcaption><p>.four domain by FOUR.MEME</p></figcaption></figure></div>
## Strategic
<div><figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FNV7soHJxJIFo3JYWRKLT%2FLogo_BNBChain.png?alt=media&token=87afd445-da7c-473b-9d77-a68cdc6ff919" alt=""><figcaption><p>BNB Chain</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2F8iBYOTeswpy3Sfz4iv0S%2Fbscscan%E2%80%94%E2%80%94logo.png?alt=media&token=e7100dee-2a53-4a6d-a33a-1a39a43b499c" alt=""><figcaption><p>BscScan</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2F0s45kj4sd47KpZ2Y2TXd%2FLogo_Chainlink.png?alt=media&token=0c8d1703-81ac-4563-b942-25d3debd187b" alt=""><figcaption><p>Chainlink</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FZ5faT2dbaXZJdiw5V4vS%2FLogo_NodeReal.png?alt=media&token=66153514-7aa6-48ae-9840-9ba59b080cd4" alt=""><figcaption><p>NodeReal</p></figcaption></figure></div>
<div><figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FlTBD8ckgzIiXT6oFwrmR%2FLogo_TrustWallet.png?alt=media&token=f34f18ce-735f-48cd-8236-69af80ebb352" alt=""><figcaption><p>Trust Wallet</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2Fa9k8bqGwPNJ6DPYARdMC%2FGalxe_Logo.png?alt=media&token=ba2c3879-a202-46ca-9e4f-8c7cfa0f7eb7" alt=""><figcaption><p>Galxe</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FFy5JXS6iedBUCOwbnJkw%2Fpancakeswap%E2%80%94%E2%80%94logo.png?alt=media&token=33d6a78b-6c84-4e2d-8271-32c2aa92d883" alt=""><figcaption><p>PancakeSwap</p></figcaption></figure></div>
<div><figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FiiY6K23aINELTCRto5OV%2FBAS.png?alt=media&token=c9d3fa70-8880-4109-9465-503c2c1a43a9" alt=""><figcaption><p>BAS</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FSMs88UWZ90Ns6QrObXi6%2FArkham.png?alt=media&token=d3f8d9d1-554f-4520-a983-d2e55e406549" alt=""><figcaption><p>Arkham</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FvKnt4LRmhIia5SPVFtbL%2FAxelar%20Network.png?alt=media&token=2b59ae6c-b509-4c35-9377-f20f2794515c" alt=""><figcaption><p>Axelar Network</p></figcaption></figure></div>
## Exchange
<div><figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FWU2DhSP3vOJIAW35VaOp%2Fhuobi_logo.png?alt=media&token=1ba8918a-06b0-44df-9a25-5f2d73e0d50c" alt=""><figcaption><p>Huobi Global</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FOdY5TP6AmkBfNpyHYMfq%2FBitMart_logo.png?alt=media&token=a8b5b03f-2d19-4318-a3cf-a411405c639a" alt=""><figcaption><p>BitMart</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2F3wfGfzbAJ8pdX2fUAwNx%2FAscendEX_logo.png?alt=media&token=12b6303c-23f9-4aa0-99a2-29a4bd76a63f" alt=""><figcaption><p>AscendEX</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FkbNYdzxhdESJdEs1u9tJ%2FBiconomy_logo.png?alt=media&token=31e62d34-64f3-4c45-ae8b-7f12a91f258b" alt=""><figcaption><p>Biconomy</p></figcaption></figure></div>
<div><figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FJpis8BeBoEuWoMmlNrXV%2FTrubit_logo.png?alt=media&token=3a9d16d1-09b6-40f3-9643-a4745e826e8d" alt=""><figcaption><p>Trubit</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FsMTYlfR49TrBnQoSqJZL%2FPhemex_logo.png?alt=media&token=90f48c5d-4661-451e-ac80-d452b29a432e" alt=""><figcaption><p>Phemex</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FjsxUJ339i5GbxhQXJLuq%2FBifinance_logo.png?alt=media&token=0ec18e19-b612-47f3-b56e-d1d8d7284fbb" alt=""><figcaption><p>Bifinance</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FVStCXQkXM1A2bM7aIwqg%2FXT_logo.png?alt=media&token=06244338-040e-4bfb-9517-5c258684a38c" alt=""><figcaption><p>XT</p></figcaption></figure></div>
<div><figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FV4uTupmJXIppPgXEj168%2FTapBit_logo.png?alt=media&token=1bd57c14-1382-431f-a74e-a95e8fc98245" alt=""><figcaption><p>TapBit</p></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FIv3kiMdwAtmcyoIBHXVW%2Fempty.png?alt=media&token=daccc71c-d45b-4ad3-a9e2-560d07fd8b06" alt=""><figcaption></figcaption></figure> <figure><img src="https://2637588294-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F9JGIkcXbzugdcagoi7aL%2Fuploads%2FIv3kiMdwAtmcyoIBHXVW%2Fempty.png?alt=media&token=daccc71c-d45b-4ad3-a9e2-560d07fd8b06" alt=프로젝트로 돌아가기