Skip to content

Latest commit

 

History

History
126 lines (86 loc) · 5.63 KB

File metadata and controls

126 lines (86 loc) · 5.63 KB

theblockchainapi.TokenApi

All URIs are relative to https://api.blockchainapi.com/v1

Method HTTP request Description
getTokenMetadata GET /{blockchain}/{network}/token/{token_blockchain_identifier} Get a token's metadata
listAllTokens GET /{blockchain}/{network}/all_tokens List all tokens

getTokenMetadata

TokenMetadataResponse getTokenMetadata(blockchain, network, tokenBlockchainIdentifier)

Get a token's metadata

<a href=&quot;https://github.com/BL0CK-X/blockchain-api/tree/main/examples/tokens/get-token-metadata\" target=&quot;_blank&quot;>See examples (Python, JavaScript) [Coming Soon]</a>. Get the metadata of a token. `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.TokenApi();
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 tokenBlockchainIdentifier = "tokenBlockchainIdentifier_example"; // String | The identifier of the token (e.g., `mint_address` on `Solana` or `token_address` on `Ethereum`) 
apiInstance.getTokenMetadata(blockchain, network, tokenBlockchainIdentifier).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`
tokenBlockchainIdentifier String The identifier of the token (e.g., `mint_address` on `Solana` or `token_address` on `Ethereum`)

Return type

TokenMetadataResponse

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

listAllTokens

[TokenMetadataResponse] listAllTokens(blockchain, network)

List all tokens

<a href=&quot;https://github.com/BL0CK-X/blockchain-api/tree/main/examples/tokens/get-all-tokens\" target=&quot;_blank&quot;>See examples (Python, JavaScript) [Coming Soon]</a>. List all tokens. `Cost: 1 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.TokenApi();
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`
apiInstance.listAllTokens(blockchain, network).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`

Return type

[TokenMetadataResponse]

Authorization

APIKeyID, APISecretKey

HTTP request headers

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