Skip to content

Latest commit

 

History

History
234 lines (159 loc) · 9.96 KB

SolanaCandyMachineApi.md

File metadata and controls

234 lines (159 loc) · 9.96 KB

theblockchainapi.SolanaCandyMachineApi

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

Method HTTP request Description
solanaGetAllNFTsFromCandyMachine GET /solana/nft/candy_machine/{network}/{candy_machine_id}/nfts Get CM's NFTs
solanaGetCandyMachineMetadata POST /solana/nft/candy_machine/metadata Get a CM's metadata
solanaListAllCandyMachines GET /solana/nft/candy_machine/list List all CMs
solanaSearchCandyMachines POST /solana/nft/candy_machine/search Search CMs

solanaGetAllNFTsFromCandyMachine

GetAllNFTsResponse solanaGetAllNFTsFromCandyMachine(network, candyMachineId)

Get CM's NFTs

<a href=&quot;https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-candy-machine/get-candy-machine-all-nfts\" target=&quot;_blank&quot;> See examples (Python, JavaScript)</a>. Use this endpoint to get the list of all NFTs (minted and unminted) from a Solana Candy Machine. This works for `v1` and `v2` candy machines. However, for `v2` only the value for `all_nfts` is provided. To determine which are minted and unminted follow this example. You do not need to specify `v1` or `v2` for this endpoint as it will automatically determine it from the candy machine ID. See example for how to get the list of NFT hashes <a href=&quot;https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-candy-machine/get-candy-machine-hash-table\" target=&quot;_blank&quot;>here</a>. `Cost: 2 Credits` (<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.SolanaCandyMachineApi();
let network = mainnet-beta; // String | The network ID
let candyMachineId = FmkrvXRenCGtwBHw3VtBcExp8eTdnau97upaewF4GUEX; // String | The ID of the candy machine
apiInstance.solanaGetAllNFTsFromCandyMachine(network, candyMachineId).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
network String The network ID
candyMachineId String The ID of the candy machine

Return type

GetAllNFTsResponse

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

solanaGetCandyMachineMetadata

GetCandyMetadataResponse solanaGetCandyMachineMetadata(opts)

Get a CM's metadata

<a href=&quot;https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-candy-machine/get-candy-machine-metadata\" target=&quot;_blank&quot;>See examples (Python, JavaScript)</a>. Use this endpoint to get metadata about a Metaplex candy machine. This includes the goLiveDate, itemsAvailable, and itemsRedeemed. To see what is included, expand the green successful response below. NOTE: Supply exactly one of `candy_machine_id`, `config_address`, or `uuid`. If you provide more than one, you will receive a `400` error. `Cost: 2 Credits` (<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.SolanaCandyMachineApi();
let opts = {
  'getCandyMetadataRequest': new theblockchainapi.GetCandyMetadataRequest() // GetCandyMetadataRequest | 
};
apiInstance.solanaGetCandyMachineMetadata(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
getCandyMetadataRequest GetCandyMetadataRequest [optional]

Return type

GetCandyMetadataResponse

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

solanaListAllCandyMachines

Object solanaListAllCandyMachines()

List all CMs

<a href=&quot;https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-candy-machine/list-all-candy-machines\" target=&quot;_blank&quot;>See examples (Python, JavaScript)</a>. With this endpoint, you can list all candy machines published to Solana mainnet. We update this data every 15 minutes. The output is a list of config addresses, currently about 17000 in length. `Cost: 2 Credits` (<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.SolanaCandyMachineApi();
apiInstance.solanaListAllCandyMachines().then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

This endpoint does not need any parameter.

Return type

Object

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

solanaSearchCandyMachines

[String] solanaSearchCandyMachines(opts)

Search CMs

<a href=&quot;https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-candy-machine/search-candy-machines\" target=&quot;_blank&quot;>See examples (Python, JavaScript)</a>. With this endpoint, you can search candy machines by their symbol, name of NFTs, uuid, configuration address, and update authority. The output is a list of config addresses. You can also provide multiple search clauses, such as the update authority (`update_authority=&quot;G17UmNGnMJ851x3M1JXocgpft1afcYedjPuFpo1ohhCk&quot;`) and symbol begins with &quot;Sol&quot; (`symbol=&quot;Sol&quot;, symbol_search_method='begins_with'`). `Cost: 2 Credits` (<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.SolanaCandyMachineApi();
let opts = {
  'candyMachineSearchRequest': new theblockchainapi.CandyMachineSearchRequest() // CandyMachineSearchRequest | 
};
apiInstance.solanaSearchCandyMachines(opts).then((data) => {
  console.log('API called successfully. Returned data: ' + data);
}, (error) => {
  console.error(error);
});

Parameters

Name Type Description Notes
candyMachineSearchRequest CandyMachineSearchRequest [optional]

Return type

[String]

Authorization

APIKeyID, APISecretKey

HTTP request headers

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