Skip to content

Latest commit

 

History

History
136 lines (89 loc) · 6.13 KB

File metadata and controls

136 lines (89 loc) · 6.13 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()

<a href="https://github.com/BL0CK-X/blockchain-api/tree/main/examples/tokens/get-token-metadata\" target="_blank">See examples (Python, JavaScript) [Coming Soon]. Get the metadata of a token. Cost: 0.25 Credit (<a href="#section/Pricing">See Pricing)

Example

import { theblockchainapi } from 'theblockchainapi';
import * as fs from 'fs';

const configuration = theblockchainapi.createConfiguration();
const apiInstance = new theblockchainapi.TokenApi(configuration);

let body:theblockchainapi.TokenApiGetTokenMetadataRequest = {
  // 'ethereum' | 'solana' | The blockchain you want to use 
  blockchain: "ethereum",
  // 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`
  network: "ropsten",
  // 'ethereum' | 'solana' | The identifier of the token (e.g., `mint_address` on `Solana` or `token_address` on `Ethereum`) 
  tokenBlockchainIdentifier: "ethereum",
};

apiInstance.getTokenMetadata(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
blockchain [**'ethereum' 'solana'**]Array<'ethereum' | 'solana'> 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` defaults to undefined
tokenBlockchainIdentifier [**'ethereum' 'solana'**]Array<'ethereum' | 'solana'> 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

HTTP response details

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=&quot;https://dashboard.theblockchainapi.com/billing\" target=&quot;_blank&quot;>here</a>. -
404 Task not found. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

listAllTokens

Array listAllTokens()

<a href="https://github.com/BL0CK-X/blockchain-api/tree/main/examples/tokens/get-all-tokens\" target="_blank">See examples (Python, JavaScript) [Coming Soon]. List all tokens. Cost: 1 Credit (<a href="#section/Pricing">See Pricing)

Example

import { theblockchainapi } from 'theblockchainapi';
import * as fs from 'fs';

const configuration = theblockchainapi.createConfiguration();
const apiInstance = new theblockchainapi.TokenApi(configuration);

let body:theblockchainapi.TokenApiListAllTokensRequest = {
  // 'solana' | The blockchain you want to use 
  blockchain: "solana",
  // 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`
  network: "ropsten",
};

apiInstance.listAllTokens(body).then((data:any) => {
  console.log('API called successfully. Returned data: ' + data);
}).catch((error:any) => console.error(error));

Parameters

Name Type Description Notes
blockchain ['solana']Array<'solana'> The blockchain you want to use defaults to undefined
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` defaults to undefined

Return type

Array

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

HTTP response details

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=&quot;https://dashboard.theblockchainapi.com/billing\" target=&quot;_blank&quot;>here</a>. -
404 Task not found. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]