Skip to content

Latest commit

 

History

History
66 lines (44 loc) · 2.96 KB

SolanaSPLTokenApi.md

File metadata and controls

66 lines (44 loc) · 2.96 KB

theblockchainapi.SolanaSPLTokenApi

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

Method HTTP request Description
solanaGetSPLToken GET /solana/spl-token/{network}/{public_key} Get SPL token metadata

solanaGetSPLToken

GetSPLTokenResponse solanaGetSPLToken(publicKey, network)

Get SPL token metadata

<a href=&quot;https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-spl-token/get-spl-token\" target=&quot;_blank&quot;>See examples (Python, JavaScript)</a>. Retrieves basic information about an SPL token given its `mint_address`. You can see the mint addresses of popular SPL tokens <a href=&quot;https://raw.githubusercontent.com/solana-labs/token-list/main/src/tokens/solana.tokenlist.json\" target=&quot;_blank&quot;>here</a>. Some example mint addresses of SPL tokens: - USDC: EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v - Mango: MangoCzJ36AjZyKwVj3VnYU4GTonjfVEnJmvvWaxLac - Serum: SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt - Raydium: 4k3Dyjzvzp8eMZWUXbBCjEvwSkkk59S5iCNLY3QrkX6R - wSOL: So11111111111111111111111111111111111111112 - ATLAS: ATLASXmbPQxBUYbxPsV97usA3fPQYEqzQBUHgiFCUsXx `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.SolanaSPLTokenApi();
let publicKey = MangoCzJ36AjZyKwVj3VnYU4GTonjfVEnJmvvWaxLac; // String | The public key of the token
let network = mainnet-beta; // String | The network ID (devnet, mainnet-beta)
apiInstance.solanaGetSPLToken(publicKey, network).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
publicKey String The public key of the token
network String The network ID (devnet, mainnet-beta)

Return type

GetSPLTokenResponse

Authorization

APIKeyID, APISecretKey

HTTP request headers

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