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 |
solanaGetNFTOwnerAdvanced | GET /solana/nft/{network}/{mint_address}/owner_advanced | Get owner of an NFT (advanced) |
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 |
open class func solanaCreateNFT(nFTMintRequest: NFTMintRequest? = nil, completion: @escaping (_ data: NFT?, _ error: Error?) -> Void)
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: 5 Credits
(<a href="#section/Pricing">See Pricing)
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import theblockchainapi
let nFTMintRequest = NFTMintRequest(waitForConfirmation: false, wallet: Wallet(secretRecoveryPhrase: "secretRecoveryPhrase_example", derivationPath: "derivationPath_example", passphrase: "passphrase_example", privateKey: "TODO", b58PrivateKey: "b58PrivateKey_example"), name: "name_example", symbol: "symbol_example", description: "description_example", uploadMethod: "uploadMethod_example", uri: "uri_example", imageUrl: "imageUrl_example", uriMetadata: "TODO", isMutable: false, isMasterEdition: false, sellerFeeBasisPoints: 123, creators: ["creators_example"], share: [123], mintToPublicKey: "mintToPublicKey_example", network: "network_example") // NFTMintRequest | (optional)
// Create an NFT on Solana
SolanaNFTAPI.solanaCreateNFT(nFTMintRequest: nFTMintRequest) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
nFTMintRequest | NFTMintRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func solanaGetNFT(network: Network_solanaGetNFT, mintAddress: String, completion: @escaping (_ data: NFT?, _ error: Error?) -> Void)
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: 0.25 Credit
(<a href="#section/Pricing">See Pricing)
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import theblockchainapi
let network = "network_example" // String | The network ID
let mintAddress = "mintAddress_example" // String | The mint address of the NFT
// Get an NFT's metadata
SolanaNFTAPI.solanaGetNFT(network: network, mintAddress: mintAddress) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
network | String | The network ID | |
mintAddress | String | The mint address of the NFT |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func solanaGetNFTMintFee(completion: @escaping (_ data: NFTMintFee?, _ error: Error?) -> Void)
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: 0 Credit
(Free) (<a href="#section/Pricing">See Pricing)
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import theblockchainapi
// Get the NFT mint fee
SolanaNFTAPI.solanaGetNFTMintFee() { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func solanaGetNFTOwner(network: Network_solanaGetNFTOwner, mintAddress: String, completion: @escaping (_ data: NFTOwnerResponse?, _ error: Error?) -> Void)
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: 0.25 Credit
(<a href="#section/Pricing">See Pricing)
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import theblockchainapi
let network = "network_example" // String | The network ID
let mintAddress = "mintAddress_example" // String | The mint address of the NFT
// Get owner of an NFT
SolanaNFTAPI.solanaGetNFTOwner(network: network, mintAddress: mintAddress) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
network | String | The network ID | |
mintAddress | String | The mint address of the NFT |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func solanaGetNFTOwnerAdvanced(network: Network_solanaGetNFTOwnerAdvanced, mintAddress: String, completion: @escaping (_ data: NFTOwnerAdvancedResponse?, _ error: Error?) -> Void)
Get owner of an NFT (advanced)
<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, state, listed price, and listed marketplace (if any) of an NFT. Here's are a couple of example responses: { 'contract': { 'contract_blockchain_identifier': 'M2mx93ekt1fmXSVkTrUL9xVFHkmME8HTUi5Cyc5aF7K', 'contract_id': 'magic-eden-v2', 'contract_name': 'Magic Eden v2', 'contract_type': 'marketplace' }, 'owner': '25UJMR3FiMM6noQtPEaCJ6eDU2YQ7myDhikVQXmMuSRW', 'price': 50000000, 'state': 'listing' }
{ 'contract': null, 'owner': 'C37PJiJU8WTgoUoFqmB1Maw8hkuENDZoGDQA1pm54Fdd', 'price': null, 'state': 'holding' }
This function will return whether the NFT is listed
, loaned
(Yawww NFT loans), otc
, staked
, burned
, or held
. If listed, it will return the contract, the readable name of the contract (e.g., Magic Eden, OpenSea), the contract ID (if any; e.g., open-sea), the owner, and the listed price. From this, you can get the floor of a collection. We currently support Magic Eden (v1, v2), Exchange.Art (auction, singles), CoralCube, Solanart (v1, v2), Yawww Loans, Yawww OTC, OpenSea, Fractal, SolSea, and AlphaArt. If loaned, it will return the loan requester as the owner, the loan amount, and the loan contract. We only support the Yawww loaning contract. If listed on an OTC marketplace, it will return the same information as listed
. OTC is used to distinguish between marketplaces that respect royalties (OTC) and those that don't (normal ones). The only OTC
contract we track is Yawwww, at the moment. We do not yet track Solanart v3. If staked, it will return the owner and the staking contract public key. If burned, it will return the burner
as the owner
. If held, it will simply return the owner. If you want to get the literal owner, which may or may not be the same as the owner returned here, call the simplified get NFT owner function. For example, Bob might own the NFT, but if it is listed on Magic Eden, then the NFT is held in escrow and "owned" by Magic Eden. The simplified function will return Magic Eden as the owner (the literal owner). This advanced function will tell you the implied owner, which would be Bob. Cost: 1.0 Credit
(<a href="#section/Pricing">See Pricing)
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import theblockchainapi
let network = "network_example" // String | The network ID
let mintAddress = "mintAddress_example" // String | The mint address of the NFT
// Get owner of an NFT (advanced)
SolanaNFTAPI.solanaGetNFTOwnerAdvanced(network: network, mintAddress: mintAddress) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
network | String | The network ID | |
mintAddress | String | The mint address of the NFT |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func solanaGetNFTsCandyMachineId(getCandyMachineIDRequest: GetCandyMachineIDRequest? = nil, completion: @escaping (_ data: GetCandyMachineIDResponse?, _ error: Error?) -> Void)
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)
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import theblockchainapi
let getCandyMachineIDRequest = GetCandyMachineIDRequest(mintAddress: "mintAddress_example", network: "network_example") // GetCandyMachineIDRequest | (optional)
// Get the ID of the candy machine of an NFT
SolanaNFTAPI.solanaGetNFTsCandyMachineId(getCandyMachineIDRequest: getCandyMachineIDRequest) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
getCandyMachineIDRequest | GetCandyMachineIDRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
open class func solanaSearchNFTs(nFTSearchRequest: NFTSearchRequest? = nil, completion: @escaping (_ data: [NFTSearchResponse]?, _ error: Error?) -> Void)
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)
// The following code samples are still beta. For any issue, please report via http://github.com/OpenAPITools/openapi-generator/issues/new
import theblockchainapi
let nFTSearchRequest = NFTSearchRequest(updateAuthority: "updateAuthority_example", updateAuthoritySearchMethod: "updateAuthoritySearchMethod_example", mintAddress: "mintAddress_example", mintAddressSearchMethod: "mintAddressSearchMethod_example", name: "name_example", nameSearchMethod: "nameSearchMethod_example", uri: "uri_example", uriSearchMethod: "uriSearchMethod_example", symbol: "symbol_example", symbolSearchMethod: "symbolSearchMethod_example", network: "network_example") // NFTSearchRequest | (optional)
// Search NFTs on Solana
SolanaNFTAPI.solanaSearchNFTs(nFTSearchRequest: nFTSearchRequest) { (response, error) in
guard error == nil else {
print(error)
return
}
if (response) {
dump(response)
}
}
Name | Type | Description | Notes |
---|---|---|---|
nFTSearchRequest | NFTSearchRequest | [optional] |
- Content-Type: application/json
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]