All URIs are relative to https://api.blockchainapi.com/v1
Method | HTTP request | Description |
---|---|---|
solanaDeriveAssociatedTokenAccountAddress | GET /solana/wallet/{public_key}/associated_token_account/{mint_address} | Derive an associated token account address |
solanaDerivePrivateKey | POST /solana/wallet/private_key | Derive private key |
solanaDerivePublicKey | POST /solana/wallet/public_key | Derive public key |
solanaGeneratePrivateKey | POST /solana/wallet/generate/private_key | Generate private key |
solanaGenerateSecretRecoveryPhrase | POST /solana/wallet/generate/secret_recovery_phrase | Generate secret phrase |
solanaGetAirdrop | POST /solana/wallet/airdrop | Get an airdrop on devnet |
solanaGetBalance | POST /solana/wallet/balance | Get wallet's balance in SOL or any SPL |
solanaGetNFTsBelongingToWallet | GET /solana/wallet/{network}/{public_key}/nfts | Get address's NFTs |
solanaGetTokensBelongingToWallet | GET /solana/wallet/{network}/{public_key}/tokens | Get address's tokens and respective balances |
solanaGetWalletTransactions | GET /solana/wallet/{network}/{public_key}/transactions | Get address's associated transaction signatures |
solanaTransfer | POST /solana/wallet/transfer | Transfer SOL, a token, or an NFT to another address |
ATAResponse solanaDeriveAssociatedTokenAccountAddress(publicKey, mintAddress)
Derive an associated token account address
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-wallet/derive-associated-token-account-address\" target="_blank">See example (Python, JavaScript)</a>. Each wallet can own tokens, but in Solana, each token is actually held by an <a href="https://spl.solana.com/associated-token-account\" target="_blank">associated token account</a> (ATA), which is an account specific for a token owned by the wallet. When you transfer an SPL token, such as Serum, or transfer an NFT, you're transfering from an ATA you own to another person's ATA for that specific token. With this endpoint, you can derive an associated token address given a wallet and a token address. `Cost: 0 Credit` (Free) (<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.SolanaWalletApi;
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");
SolanaWalletApi apiInstance = new SolanaWalletApi(defaultClient);
String publicKey = "31LKs39pjT5oj6fWjC3F76dHWf9489asCthmgj8wu7pj"; // String | The public key of the wallet
String mintAddress = "7EWJNaNYfPYMaqzdAAa4ps5kpqW95B7VHsjhW1kr18sj"; // String | The mint address of the token (either SPL or NFT)
try {
ATAResponse result = apiInstance.solanaDeriveAssociatedTokenAccountAddress(publicKey, mintAddress);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SolanaWalletApi#solanaDeriveAssociatedTokenAccountAddress");
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 wallet | |
mintAddress | String | The mint address of the token (either SPL or NFT) |
- 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>. | - |
GeneratePrivateKey solanaDerivePrivateKey(getPublicKeyRequest)
Derive private key
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-wallet/derive-private-key\" target="_blank">See examples (Python, JavaScript)</a>. Returns a private key array and a base58-encoded private key given wallet authentication. A wallet is defined by a public key. A public key is derived from a combination of seed phrase, derivation path, and passphrase. Changing any one of these three will change the public key output. You can generate a unique public key with each combination of secret recovery phrase, passphrase, and derivation path. Thus, with a single secret recovery phrase, you can generate many public keys. If you are just starting, just supply the secret recovery phrase you generated with the Solana Wallet Secret Recovery Phrase endpoint. If you are trying to get a public key that already exists (e.g., created in the Phantom wallet), make sure you use the correct derivation path and passphrase. To read more about that, see the descriptions of those parameters below. `Cost: 0 Credit` (Free) (<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.SolanaWalletApi;
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");
SolanaWalletApi apiInstance = new SolanaWalletApi(defaultClient);
GetPublicKeyRequest getPublicKeyRequest = new GetPublicKeyRequest(); // GetPublicKeyRequest |
try {
GeneratePrivateKey result = apiInstance.solanaDerivePrivateKey(getPublicKeyRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SolanaWalletApi#solanaDerivePrivateKey");
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 |
---|---|---|---|
getPublicKeyRequest | GetPublicKeyRequest |
- Content-Type: application/json
- 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>. | - |
PublicKey solanaDerivePublicKey(getPublicKeyRequest)
Derive public key
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-wallet/derive-public-key\" target="_blank">See examples (Python, JavaScript)</a>. Returns a public key given wallet authentication. A wallet is identified by a public key. A public key is derived from a combination of seed phrase, derivation path, and passphrase. Changing any one of these three will change the public key output. It can also be derived from a private key. *You can generate a unique public key with each combination of secret recovery phrase, passphrase, and derivation path; or from a private key. Thus, with a single secret recovery phrase, you can generate many public keys; however, with a private key, you can only generate one public key. If you are just starting, generate a <a href="#operation/solanaGenerateSecretRecoveryPhrase">secret recovery phrase</a> or <a href="#operation/solanaGeneratePrivateKey">private key</a>. If you are trying to get a public key that already exists (e.g., created in the Phantom wallet), make sure you use the correct derivation path and passphrase; or just use the private key. To read more about that, see the descriptions of those parameters below. `Cost: 0 Credit` (Free) (<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.SolanaWalletApi;
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");
SolanaWalletApi apiInstance = new SolanaWalletApi(defaultClient);
GetPublicKeyRequest getPublicKeyRequest = new GetPublicKeyRequest(); // GetPublicKeyRequest |
try {
PublicKey result = apiInstance.solanaDerivePublicKey(getPublicKeyRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SolanaWalletApi#solanaDerivePublicKey");
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 |
---|---|---|---|
getPublicKeyRequest | GetPublicKeyRequest |
- Content-Type: application/json
- 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>. | - |
GeneratePrivateKey solanaGeneratePrivateKey()
Generate private key
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-wallet/generate-private-key\" target="_blank">See examples (Python, JavaScript)</a>. Use this endpoint to securely and randomly generate a private key for a Solana wallet. `Cost: 0 Credit` (Free) (<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.SolanaWalletApi;
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");
SolanaWalletApi apiInstance = new SolanaWalletApi(defaultClient);
try {
GeneratePrivateKey result = apiInstance.solanaGeneratePrivateKey();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SolanaWalletApi#solanaGeneratePrivateKey");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
This endpoint does not need any parameter.
- 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>. | - |
SecretPhrase solanaGenerateSecretRecoveryPhrase()
Generate secret phrase
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-wallet/generate-secret-phrase\" target="_blank">See examples (Python, JavaScript)</a>. Use this endpoint to securely and randomly generate a secret recovery phrase for a Solana wallet. `Cost: 0 Credit` (Free) (<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.SolanaWalletApi;
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");
SolanaWalletApi apiInstance = new SolanaWalletApi(defaultClient);
try {
SecretPhrase result = apiInstance.solanaGenerateSecretRecoveryPhrase();
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SolanaWalletApi#solanaGenerateSecretRecoveryPhrase");
System.err.println("Status code: " + e.getCode());
System.err.println("Reason: " + e.getResponseBody());
System.err.println("Response headers: " + e.getResponseHeaders());
e.printStackTrace();
}
}
}
This endpoint does not need any parameter.
- 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>. | - |
TransferResponse solanaGetAirdrop(airdropRequest)
Get an airdrop on devnet
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-wallet/get-airdrop\" target="_blank">See examples (Python, JavaScript)</a>. Use this endpoint to get an airdrop of SOL on the devnet (not real SOL). Amount of 0.015, which is the minimum amount of SOL you need to mint a Metaplex NFT and then transfer it to another wallet. `Cost: 0 Credit` (Free) (<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.SolanaWalletApi;
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");
SolanaWalletApi apiInstance = new SolanaWalletApi(defaultClient);
AirdropRequest airdropRequest = new AirdropRequest(); // AirdropRequest |
try {
TransferResponse result = apiInstance.solanaGetAirdrop(airdropRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SolanaWalletApi#solanaGetAirdrop");
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 |
---|---|---|---|
airdropRequest | AirdropRequest | [optional] |
- Content-Type: application/json
- 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>. | - |
BalanceResponse solanaGetBalance(balanceRequest)
Get wallet's balance in SOL or any SPL
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-wallet/get-wallet-balance\" target="_blank">See examples (Python, JavaScript)</a>. See the balance of a wallet in SOL or any SPL token. To get the balance of an SPL token, supply the `mint_address` of the SPL token. The list of SPL tokens can be viewed <a href="https://raw.githubusercontent.com/solana-labs/token-list/main/src/tokens/solana.tokenlist.json\" target="_blank">here</a>. You can also use this endpoint to see whether or not a person owns an NFT. Just supply the `mint_address` of the NFT. A balance of "1" means the person owns the NFT, and a balance of "0" means the person does not own the NFT. This works in most cases, but we are aware of one edge case where a balance of "0" will show up for a person who is actually the owner of the NFT. We just recommend using the <a href="#operation/solanaGetNFTOwner">getNFTOwner</a> endpoint and comparing that output to the expected address. `Cost: 0.25 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.SolanaWalletApi;
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");
SolanaWalletApi apiInstance = new SolanaWalletApi(defaultClient);
BalanceRequest balanceRequest = new BalanceRequest(); // BalanceRequest |
try {
BalanceResponse result = apiInstance.solanaGetBalance(balanceRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SolanaWalletApi#solanaGetBalance");
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 |
---|---|---|---|
balanceRequest | BalanceRequest | [optional] |
- Content-Type: application/json
- 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>. | - |
ListNFTsResponse solanaGetNFTsBelongingToWallet(network, publicKey)
Get address's NFTs
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-wallet/get-wallet-nfts\" target="_blank">See examples (Python, JavaScript)</a>. See the NFTs that belong to a given public key address `Cost: 3 Credits` (<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.SolanaWalletApi;
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");
SolanaWalletApi apiInstance = new SolanaWalletApi(defaultClient);
String network = "mainnet-beta"; // String | The network ID (devnet, mainnet-beta)
String publicKey = "HE3ZYk4aWfKD7R9EmFQbxjj75JdgHuDztNAsseKVan82"; // String | The public key of the account whose list of owned NFTs you want to get
try {
ListNFTsResponse result = apiInstance.solanaGetNFTsBelongingToWallet(network, publicKey);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SolanaWalletApi#solanaGetNFTsBelongingToWallet");
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 |
---|---|---|---|
network | String | The network ID (devnet, mainnet-beta) | |
publicKey | String | The public key of the account whose list of owned NFTs you want to get |
- 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>. | - |
List<Object> solanaGetTokensBelongingToWallet(network, publicKey, includeNfts, includeZeroBalanceHoldings)
Get address's tokens and respective balances
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-wallet/get-wallet-token-holdings\" target="_blank">See examples (Python, JavaScript)</a>. See the token holdings of a given public key address `Cost: 2 Credits` (<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.SolanaWalletApi;
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");
SolanaWalletApi apiInstance = new SolanaWalletApi(defaultClient);
String network = "mainnet-beta"; // String | The network ID (devnet, mainnet-beta)
String publicKey = "GKNcUmNacSJo4S2Kq3DuYRYRGw3sNUfJ4tyqd198t6vQ"; // String | The public key of the account whose list of owned NFTs you want to get
Boolean includeNfts = false; // Boolean | Whether or not to include NFTs in the response
Boolean includeZeroBalanceHoldings = false; // Boolean | Whether or not to include holdings that have zero balance. This indicates that the wallet held this token or NFT in the past, but no longer holds it.
try {
List<Object> result = apiInstance.solanaGetTokensBelongingToWallet(network, publicKey, includeNfts, includeZeroBalanceHoldings);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SolanaWalletApi#solanaGetTokensBelongingToWallet");
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 |
---|---|---|---|
network | String | The network ID (devnet, mainnet-beta) | |
publicKey | String | The public key of the account whose list of owned NFTs you want to get | |
includeNfts | Boolean | Whether or not to include NFTs in the response | [optional] [default to false] |
includeZeroBalanceHoldings | Boolean | Whether or not to include holdings that have zero balance. This indicates that the wallet held this token or NFT in the past, but no longer holds it. | [optional] [default to false] |
List<Object>
- 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>. | - |
List<String> solanaGetWalletTransactions(network, publicKey)
Get address's associated transaction signatures
<a href="https://github.com/BL0CK-X/blockchain-api/tree/main/examples/solana-wallet/get-wallet-transactions\" target="_blank">See examples (Python, JavaScript)</a>. See the transaction signatures of a given public key address `Cost: 1 Credits` (<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.SolanaWalletApi;
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");
SolanaWalletApi apiInstance = new SolanaWalletApi(defaultClient);
String network = "mainnet-beta"; // String | The network ID (devnet, mainnet-beta)
String publicKey = "GKNcUmNacSJo4S2Kq3DuYRYRGw3sNUfJ4tyqd198t6vQ"; // String | The public key of the account whose list of signatures you want to get
try {
List<String> result = apiInstance.solanaGetWalletTransactions(network, publicKey);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SolanaWalletApi#solanaGetWalletTransactions");
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 |
---|---|---|---|
network | String | The network ID (devnet, mainnet-beta) | |
publicKey | String | The public key of the account whose list of signatures you want to get |
List<String>
- 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>. | - |
DoubleTransferResponse solanaTransfer(transferRequest)
Transfer SOL, a token, or an NFT to another address
<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-wallet/transfer-sol\" target="_blank">See transfer SOL example (Python, JavaScript)</a>. <a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-wallet/transfer-nft\" target="_blank">See transfer NFT example (can also be used for SPL token) (Python, JavaScript)</a>. This is a powerful function. It might be slightly confusing because there are several optional parameters, so take some time to review it. This function can send SOL, send an SPL token, or send an NFT. You can set the fee payer of the transaction; you can sign and submit the transaction for confirmation; and you can select to simply return the compiled transaction so that you can submit it to the user for signing (e.g., via Phantom; no private keys required in this case). Transfer SOL, a token or an NFT to another address. If you're transferring an NFT, supply the `mint` (the address of the mint) for the `token_address`. SENDER: Note that the wallet information is used to authorize the sending of the tokens and identifies the source of the tokens. If `return_compiled_transaction = false`, we sign and submit the transaction (`wallet` is required in this case; do not provide a value for `sender_public_key`). If `return_compiled_transaction = true`, we compile the transaction (one of `wallet` or `sender_public_key` is required in this case; do not provide both). RECIPIENT: `recipient_address` identifies the receiver. This is entirely separate from the information used for the SENDER above. So, in this API call, there are two wallets involved, but only one (namely, the SENDER) is needed to authorize the transaction. FEE_PAYER: The fee payer of the transaction defaults to `wallet` (or `sender_public_key`). To set a different fee payer, provide a value for `fee_payer_wallet`. If you're transfering a token, supply the token address found on the explorer (e.g., see `SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt` for <a href="https://explorer.solana.com/address/SRMuApVNdxXokk5GT7XD5cUUgXMBCoAz2LHeuAoKWRt\" target="_blank">Serum Token</a>) for the `token_address`. If you're transferring SOL, do not supply a value for `token_address`. `Cost: 2 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.SolanaWalletApi;
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");
SolanaWalletApi apiInstance = new SolanaWalletApi(defaultClient);
TransferRequest transferRequest = new TransferRequest(); // TransferRequest |
try {
DoubleTransferResponse result = apiInstance.solanaTransfer(transferRequest);
System.out.println(result);
} catch (ApiException e) {
System.err.println("Exception when calling SolanaWalletApi#solanaTransfer");
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 |
---|---|---|---|
transferRequest | TransferRequest | [optional] |
- Content-Type: application/json
- 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>. | - |