Verify Solana Asset
Solana Asset Verification API
The Solana Asset Verification API allows developers to verify whether a user holds specific assets on the Solana mainnet, including Solana Fungible Tokens (SPL Tokens) and NFTs. This API is essential for integrating asset verification into decentralized applications (dApps) and services built on Solana.
Asset Verification API for Solana
Endpoint:
Headers:
Authorization
:<GR1D_API_KEY>
(Contact [email protected] to get early access)Content-Type
:application/json
Request Body:
owner_address
: The Solana address of the user whose asset holdings are being verified.token_mint_address
: The mint address of the Solana Fungible Token or NFT.
Sample Response:
status
: HTTP status code (200 indicates success).message
: A message indicating the result of the query.data
:owner_address
: The Solana address queried.asset.balance
: The number of tokens or NFTs the user holds.asset.QueryResult
: A hexadecimal string representing the encoded query result.
Error Handling
In the event of an error, the API will return a response with the appropriate HTTP status code and an error message. Common error codes include:
400: Bad Request - The request parameters are invalid.
401: Unauthorized - The
GR1D_API_KEY
is missing or invalid.404: Not Found - The specified
token_mint_address
orowner_address
is invalid.500: Internal Server Error - An unexpected error occurred on the server.
Security Considerations
API Key Management: Ensure that the
GR1D_API_KEY
is kept secure and never exposed in client-side code or public repositories.Data Integrity: The query results are verified to ensure data integrity.
Rate Limiting: Be aware of any rate limits imposed on the API to prevent abuse and ensure fair usage.
Examples and Edge Cases
Solana Fungible Token Verification:
Expected response: The
balance
field will indicate the number of Solana Fungible Tokens held by the user.Solana NFT Verification:
Expected response: The
balance
field will indicate the number of NFTs held by the user.No Asset Held:
Expected response: The
balance
field will be0
, and theQueryResult
will reflect that no assets were found.