All URIs are relative to https://api.blockchainapi.com/v1
| Method | HTTP request | Description |
|---|---|---|
| getBlockchainIdentifierFromName | POST /{blockchain}/{network}/name_service/name_to_blockchain_identifier | Get the identifier |
| getNameForBlockchainIdentifier | POST /{blockchain}/{network}/name_service/blockchain_identifier_to_name | Get the name |
InputBlockchainIdentifier getBlockchainIdentifierFromName(blockchain, network, inputName)
Get the identifier
<a href="https://github.com/BL0CK-X/blockchain-api/tree/main/examples/name-service/name-to-blockchain-identifier\" target="_blank">See examples (Python, JavaScript) [Coming Soon]</a>. Get the blockchain identifier from a name. e.g., Input `vitalik.eth` and output `0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045` `Cost: 0.25 Credit` (<a href="#section/Pricing">See Pricing</a>)
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.NameServiceApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.blockchainapi.com/v1");
// Configure API key authorization: APIKeyID
ApiKeyAuth APIKeyID = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyID");
APIKeyID.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyID.setApiKeyPrefix("Token");
// Configure API key authorization: APISecretKey
ApiKeyAuth APISecretKey = (ApiKeyAuth) defaultClient.getAuthentication("APISecretKey");
APISecretKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APISecretKey.setApiKeyPrefix("Token");
NameServiceApi apiInstance = new NameServiceApi(defaultClient);
String blockchain = "ethereum"; // String | The blockchain you want to use
String network = "ropsten"; // String | The network of the blockchain you selected - Solana: `devnet`, `mainnet-beta` - Ethereum: `ropsten`, `mainnet` Defaults when not provided (not applicable to path parameters): - Solana: `devnet` - Ethereum: `ropsten`
InputName inputName = new InputName(); // InputName |
try {
InputBlockchainIdentifier result = apiInstance.getBlockchainIdentifierFromName(blockchain, network, inputName);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling NameServiceApi#getBlockchainIdentifierFromName");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| blockchain | String | The blockchain you want to use | [enum: ethereum, solana] |
| network | String | The network of the blockchain you selected - Solana: `devnet`, `mainnet-beta` - Ethereum: `ropsten`, `mainnet` Defaults when not provided (not applicable to path parameters): - Solana: `devnet` - Ethereum: `ropsten` | |
| inputName | InputName | [optional] |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 400 | Invalid input or issue retrieving transaction. See response for details | - |
| 401 | Invalid API key pair in headers | - |
| 402 | Payment required. Occurs when you run out of API requests. Upgrade <a href="https://dashboard.theblockchainapi.com/billing\" target="_blank">here</a>. | - |
| 404 | Task not found. | - |
InputName getNameForBlockchainIdentifier(blockchain, network, inputBlockchainIdentifier)
Get the name
<a href="https://github.com/BL0CK-X/blockchain-api/tree/main/examples/name-service/blockchain-identifier-to-name\" target="_blank">See examples (Python, JavaScript) [Coming Soon]</a>. Get the name from a blockchain identifier. e.g., Input `0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045` and output `vitalik.eth` `Cost: 0.25 Credit` (<a href="#section/Pricing">See Pricing</a>)
// Import classes:
import org.openapitools.client.ApiClient;
import org.openapitools.client.ApiException;
import org.openapitools.client.Configuration;
import org.openapitools.client.auth.*;
import org.openapitools.client.models.*;
import org.openapitools.client.api.NameServiceApi;
public class Example {
public static void main(String[] args) {
ApiClient defaultClient = Configuration.getDefaultApiClient();
defaultClient.setBasePath("https://api.blockchainapi.com/v1");
// Configure API key authorization: APIKeyID
ApiKeyAuth APIKeyID = (ApiKeyAuth) defaultClient.getAuthentication("APIKeyID");
APIKeyID.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyID.setApiKeyPrefix("Token");
// Configure API key authorization: APISecretKey
ApiKeyAuth APISecretKey = (ApiKeyAuth) defaultClient.getAuthentication("APISecretKey");
APISecretKey.setApiKey("YOUR API KEY");
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APISecretKey.setApiKeyPrefix("Token");
NameServiceApi apiInstance = new NameServiceApi(defaultClient);
String blockchain = "ethereum"; // String | The blockchain you want to use
String network = "ropsten"; // String | The network of the blockchain you selected - Solana: `devnet`, `mainnet-beta` - Ethereum: `ropsten`, `mainnet` Defaults when not provided (not applicable to path parameters): - Solana: `devnet` - Ethereum: `ropsten`
InputBlockchainIdentifier inputBlockchainIdentifier = new InputBlockchainIdentifier(); // InputBlockchainIdentifier |
try {
InputName result = apiInstance.getNameForBlockchainIdentifier(blockchain, network, inputBlockchainIdentifier);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling NameServiceApi#getNameForBlockchainIdentifier");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}| Name | Type | Description | Notes |
|---|---|---|---|
| blockchain | String | The blockchain you want to use | [enum: ethereum, solana] |
| network | String | The network of the blockchain you selected - Solana: `devnet`, `mainnet-beta` - Ethereum: `ropsten`, `mainnet` Defaults when not provided (not applicable to path parameters): - Solana: `devnet` - Ethereum: `ropsten` | |
| inputBlockchainIdentifier | InputBlockchainIdentifier | [optional] |
- Content-Type: application/json
- Accept: application/json
| Status code | Description | Response headers |
|---|---|---|
| 200 | Successful Response | - |
| 400 | Invalid input or issue retrieving transaction. See response for details | - |
| 401 | Invalid API key pair in headers | - |
| 402 | Payment required. Occurs when you run out of API requests. Upgrade <a href="https://dashboard.theblockchainapi.com/billing\" target="_blank">here</a>. | - |
| 404 | Task not found. | - |