Skip to content

Latest commit

 

History

History
325 lines (231 loc) · 14.7 KB

SolanaNFTApi.md

File metadata and controls

325 lines (231 loc) · 14.7 KB

openapi.api.SolanaNFTApi

Load the API package

import 'package:openapi/api.dart';

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

Method HTTP request Description
solanaCreateNFT POST /solana/nft Create an NFT on Solana
solanaGetNFT GET /solana/nft/{network}/{mint_address} Get an NFT's metadata
solanaGetNFTMintFee GET /solana/nft/mint/fee Get the NFT mint fee
solanaGetNFTOwner GET /solana/nft/{network}/{mint_address}/owner Get owner of an NFT
solanaGetNFTsCandyMachineId POST /solana/nft/candy_machine_id Get the ID of the candy machine of an NFT
solanaSearchNFTs POST /solana/nft/search Search NFTs on Solana

solanaCreateNFT

NFT solanaCreateNFT(nFTMintRequest)

Create an NFT on Solana

<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-nft/create-an-nft\" target="_blank">See examples (Python, JavaScript). Create a Metaplex NFT on Solana. Read more on this <a href="https://blog.blockchainapi.com/2021/11/16/a-note-on-nfts.html\" target="_blank">here. Note: Please see <a href="https://blog.blockchainapi.com/2022/01/18/how-to-format-off-chain-nft-metadata.html\" target="_blank">this article to learn more about what nft_upload_method means and how storing the metadata of an NFT works. If you're using nft_upload_method = \"LINK\", then to add attributes to the NFT or an image, add them to a JSON file and upload that to Arweave/IPFS/Filecoin. See the JSON format <a href="https://blog.blockchainapi.com/2022/01/18/how-to-format-off-chain-nft-metadata.html\">here. Then supply the link to the JSON file in nft_url. NOTE: Don't use nft_metadata. Values provided here do not do anything at the moment. We are fixing this soon. Cost: 2 Credits (<a href="#section/Pricing">See Pricing)

Example

import 'package:openapi/api.dart';
// TODO Configure API key authorization: APIKeyID
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIKeyID').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIKeyID').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: APISecretKey
//defaultApiClient.getAuthentication<ApiKeyAuth>('APISecretKey').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APISecretKey').apiKeyPrefix = 'Bearer';

final api_instance = SolanaNFTApi();
final nFTMintRequest = NFTMintRequest(); // NFTMintRequest | 

try {
    final result = api_instance.solanaCreateNFT(nFTMintRequest);
    print(result);
} catch (e) {
    print('Exception when calling SolanaNFTApi->solanaCreateNFT: $e\n');
}

Parameters

Name Type Description Notes
nFTMintRequest NFTMintRequest [optional]

Return type

NFT

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

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

solanaGetNFT

NFT solanaGetNFT(network, mintAddress)

Get an NFT's metadata

<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-nft/get-nft-metadata\" target="_blank">See examples (Python, JavaScript). Get the metadata of an NFT. If you're looking for metadata such as attributes and others, you can retrieve them from the link in the URI field of the NFT metadata returned. See the example on the right. The URI is an Arweave URL. That contains the attributes and other information about the NFT. That URL is stored on the Solana blockchain. Cost: 1 Credits (<a href="#section/Pricing">See Pricing)

Example

import 'package:openapi/api.dart';
// TODO Configure API key authorization: APIKeyID
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIKeyID').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIKeyID').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: APISecretKey
//defaultApiClient.getAuthentication<ApiKeyAuth>('APISecretKey').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APISecretKey').apiKeyPrefix = 'Bearer';

final api_instance = SolanaNFTApi();
final network = mainnet-beta; // String | The network ID
final mintAddress = EEr5yQpNXf7Bru6Rt5podx56HGW9CEehXqgRGh2wa71w; // String | The mint address of the NFT

try {
    final result = api_instance.solanaGetNFT(network, mintAddress);
    print(result);
} catch (e) {
    print('Exception when calling SolanaNFTApi->solanaGetNFT: $e\n');
}

Parameters

Name Type Description Notes
network String The network ID
mintAddress String The mint address of the NFT

Return type

NFT

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

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

solanaGetNFTMintFee

NFTMintFee solanaGetNFTMintFee()

Get the NFT mint fee

<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-nft/get-nft-mint-fee\" target="_blank">See examples (Python, JavaScript). Get the estimated fee for minting an NFT on the Solana blockchain using the Metaplex protocol. Cost: 1 Credit (<a href="#section/Pricing">See Pricing)

Example

import 'package:openapi/api.dart';
// TODO Configure API key authorization: APIKeyID
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIKeyID').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIKeyID').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: APISecretKey
//defaultApiClient.getAuthentication<ApiKeyAuth>('APISecretKey').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APISecretKey').apiKeyPrefix = 'Bearer';

final api_instance = SolanaNFTApi();

try {
    final result = api_instance.solanaGetNFTMintFee();
    print(result);
} catch (e) {
    print('Exception when calling SolanaNFTApi->solanaGetNFTMintFee: $e\n');
}

Parameters

This endpoint does not need any parameter.

Return type

NFTMintFee

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

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

solanaGetNFTOwner

NFTOwnerResponse solanaGetNFTOwner(network, mintAddress)

Get owner of an NFT

<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-nft/get-nft-owner\" target="_blank">See examples (Python, JavaScript). Get the owner of an NFT. This returns the public key of the wallet that owns the associated token account that owns the NFT. If you want to get the associated token account that literally owns the NFT, derive the associated token account address from the public key returned and the NFT mint address using <a href="#operation/solanaDeriveAssociatedTokenAccountAddress">this endpoint. Cost: 1 Credits (<a href="#section/Pricing">See Pricing)

Example

import 'package:openapi/api.dart';
// TODO Configure API key authorization: APIKeyID
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIKeyID').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIKeyID').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: APISecretKey
//defaultApiClient.getAuthentication<ApiKeyAuth>('APISecretKey').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APISecretKey').apiKeyPrefix = 'Bearer';

final api_instance = SolanaNFTApi();
final network = devnet; // String | The network ID
final mintAddress = 4zH3Rwm1QXdfTSUqsYmeUBY4QqQmQEXJVbv4ErSK736Q; // String | The mint address of the NFT

try {
    final result = api_instance.solanaGetNFTOwner(network, mintAddress);
    print(result);
} catch (e) {
    print('Exception when calling SolanaNFTApi->solanaGetNFTOwner: $e\n');
}

Parameters

Name Type Description Notes
network String The network ID
mintAddress String The mint address of the NFT

Return type

NFTOwnerResponse

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

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

solanaGetNFTsCandyMachineId

GetCandyMachineIDResponse solanaGetNFTsCandyMachineId(getCandyMachineIDRequest)

Get the ID of the candy machine of an NFT

<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-nft/get-nft-candy-machine-id\" target="_blank">See examples (Python, JavaScript). Get the candy machine ID from where the NFT came, if any. NFTs can also be minted without a candy machine. It's also possible that we return "Not Found" when the NFT actually did come from a version of a candy machine. We check for the most popular versions of candy machine, but it is possible that someone creates their own candy machine version and mints NFTs from it. Cost: 1 Credit (<a href="#section/Pricing">See Pricing)

Example

import 'package:openapi/api.dart';
// TODO Configure API key authorization: APIKeyID
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIKeyID').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIKeyID').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: APISecretKey
//defaultApiClient.getAuthentication<ApiKeyAuth>('APISecretKey').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APISecretKey').apiKeyPrefix = 'Bearer';

final api_instance = SolanaNFTApi();
final getCandyMachineIDRequest = GetCandyMachineIDRequest(); // GetCandyMachineIDRequest | 

try {
    final result = api_instance.solanaGetNFTsCandyMachineId(getCandyMachineIDRequest);
    print(result);
} catch (e) {
    print('Exception when calling SolanaNFTApi->solanaGetNFTsCandyMachineId: $e\n');
}

Parameters

Name Type Description Notes
getCandyMachineIDRequest GetCandyMachineIDRequest [optional]

Return type

GetCandyMachineIDResponse

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

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

solanaSearchNFTs

List solanaSearchNFTs(nFTSearchRequest)

Search NFTs on Solana

<a href="https://github.com/BL0CK-X/the-blockchain-api/tree/main/examples/solana-nft/search-nfts\" target="_blank">See examples (Python, JavaScript). With this endpoint, you can search for NFTs by their symbol, name of NFTs, uuid, configuration address, and update authority. The output is a list of NFTs that match your query. You can also provide multiple search clauses, such as the update authority (update_authority=\"G17UmNGnMJ851x3M1JXocgpft1afcYedjPuFpo1ohhCk\") and symbol begins with "Sol" (symbol=\"Sol\", symbol_search_method='begins_with'). Cost: 1 Credit (<a href="#section/Pricing">See Pricing)

Example

import 'package:openapi/api.dart';
// TODO Configure API key authorization: APIKeyID
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIKeyID').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APIKeyID').apiKeyPrefix = 'Bearer';
// TODO Configure API key authorization: APISecretKey
//defaultApiClient.getAuthentication<ApiKeyAuth>('APISecretKey').apiKey = 'YOUR_API_KEY';
// uncomment below to setup prefix (e.g. Bearer) for API key, if needed
//defaultApiClient.getAuthentication<ApiKeyAuth>('APISecretKey').apiKeyPrefix = 'Bearer';

final api_instance = SolanaNFTApi();
final nFTSearchRequest = NFTSearchRequest(); // NFTSearchRequest | 

try {
    final result = api_instance.solanaSearchNFTs(nFTSearchRequest);
    print(result);
} catch (e) {
    print('Exception when calling SolanaNFTApi->solanaSearchNFTs: $e\n');
}

Parameters

Name Type Description Notes
nFTSearchRequest NFTSearchRequest [optional]

Return type

List

Authorization

APIKeyID, APISecretKey

HTTP request headers

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

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