Get Asset Proof
Get a merkle proof for a compressed asset by its ID.
This is an essential method for transactions involving a compressed asset. For instance, when you need to transfer a compressed NFT you need to return the proof and tree id for the transaction to be successful.
There is additional preparation needed on the root for a transaction, you can check out
transferAsset
in our examples repository here to see how this is used. post
https://rpc.helius.xyz
/?api-key=<api_key>
getAssetProof
Parameters
Query
api-key*
string
The API key.
Body
Example
Schema
{
"jsonrpc": "2.0",
"id": "string",
"method": "getAssetProof",
"params": {
"id": "string"
}
}
Responses
200: OK
Successful response
200 No Content
No content.
400: Bad Request
Invalid request.
401: Unauthorized
Unauthorized request.
403: Forbidden
Request was forbidden.
404: Not Found
The specified resource was not found.
429: Too Many Requests
Exceeded rate limit..
500: Internal Server Error
The server encountered an unexpected condition that prevented it from fulfilling the request.
const url = `https://mainnet.helius-rpc.com/?api-key=<api_key>`
const getAssetProof = async () => {
const response = await fetch(url, {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({
jsonrpc: '2.0',
id: 'my-id',
method: 'getAssetProof',
params: {
id: 'Bu1DEKeawy7txbnCEJE4BU3BKLXaNAKCYcHR4XhndGss'
},
}),
});
const { result } = await response.json();
console.log("Assets Proof: ", result);
};
getAssetProof();
Last modified 2mo ago