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 |
GetSPLTokenResponse solanaGetSPLToken(publicKey, network)
Get SPL token metadata
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-spl-token/get-spl-token\" target="_blank">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="https://raw.githubusercontent.com/solana-labs/token-list/main/src/tokens/solana.tokenlist.json\" target="_blank">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="#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.SolanaSplTokenApi;
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");
SolanaSplTokenApi apiInstance = new SolanaSplTokenApi(defaultClient);
String publicKey = "MangoCzJ36AjZyKwVj3VnYU4GTonjfVEnJmvvWaxLac"; // String | The public key of the token
String network = "mainnet-beta"; // String | The network ID (devnet, mainnet-beta)
try {
GetSPLTokenResponse result = apiInstance.solanaGetSPLToken(publicKey, network);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SolanaSplTokenApi#solanaGetSPLToken");
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 |
---|---|---|---|
publicKey | String | The public key of the token | |
network | String | The network ID (devnet, mainnet-beta) |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | Successful Response | - |
400 | Bad request (check response message) | - |
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 | Account not found / not initialized with this public key address. | - |