Skip to content

Latest commit

 

History

History
132 lines (92 loc) · 6.09 KB

NameServiceApi.md

File metadata and controls

132 lines (92 loc) · 6.09 KB

theblockchainapi.NameServiceApi

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

getBlockchainIdentifierFromName

InputBlockchainIdentifier getBlockchainIdentifierFromName(blockchain, network, opts)

Get the identifier

<a href=&quot;https://github.com/BL0CK-X/blockchain-api/tree/main/examples/name-service/name-to-blockchain-identifier\" target=&quot;_blank&quot;>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=&quot;#section/Pricing&quot;>See Pricing</a>)

Example

import theblockchainapi from 'theblockchainapi';
let defaultClient = theblockchainapi.ApiClient.instance;
// Configure API key authorization: APIKeyID
let APIKeyID = defaultClient.authentications['APIKeyID'];
APIKeyID.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyID.apiKeyPrefix = 'Token';
// Configure API key authorization: APISecretKey
let APISecretKey = defaultClient.authentications['APISecretKey'];
APISecretKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APISecretKey.apiKeyPrefix = 'Token';

let apiInstance = new theblockchainapi.NameServiceApi();
let blockchain = "blockchain_example"; // String | The blockchain you want to use 
let 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`
let opts = {
  'inputName': new theblockchainapi.InputName() // InputName | 
};
apiInstance.getBlockchainIdentifierFromName(blockchain, network, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
blockchain String The blockchain you want to use
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]

Return type

InputBlockchainIdentifier

Authorization

APIKeyID, APISecretKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

getNameForBlockchainIdentifier

InputName getNameForBlockchainIdentifier(blockchain, network, opts)

Get the name

<a href=&quot;https://github.com/BL0CK-X/blockchain-api/tree/main/examples/name-service/blockchain-identifier-to-name\" target=&quot;_blank&quot;>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=&quot;#section/Pricing&quot;>See Pricing</a>)

Example

import theblockchainapi from 'theblockchainapi';
let defaultClient = theblockchainapi.ApiClient.instance;
// Configure API key authorization: APIKeyID
let APIKeyID = defaultClient.authentications['APIKeyID'];
APIKeyID.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APIKeyID.apiKeyPrefix = 'Token';
// Configure API key authorization: APISecretKey
let APISecretKey = defaultClient.authentications['APISecretKey'];
APISecretKey.apiKey = 'YOUR API KEY';
// Uncomment the following line to set a prefix for the API key, e.g. "Token" (defaults to null)
//APISecretKey.apiKeyPrefix = 'Token';

let apiInstance = new theblockchainapi.NameServiceApi();
let blockchain = "blockchain_example"; // String | The blockchain you want to use 
let 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`
let opts = {
  'inputBlockchainIdentifier': new theblockchainapi.InputBlockchainIdentifier() // InputBlockchainIdentifier | 
};
apiInstance.getNameForBlockchainIdentifier(blockchain, network, opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
blockchain String The blockchain you want to use
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]

Return type

InputName

Authorization

APIKeyID, APISecretKey

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json