> ## Documentation Index
> Fetch the complete documentation index at: https://docs.orbitflare.com/llms.txt
> Use this file to discover all available pages before exploring further.

# getAssetWithProof

> Get a Solana compressed NFT and its Merkle proof in a single DAS request with getAssetWithProof on OrbitFlare.

## Overview

Building a Bubblegum transfer, burn or delegate instruction needs data from two places: the asset (owner, delegate, data hash, creator hash, leaf index) and its Merkle proof. `getAssetWithProof` returns both in one round trip.

This method is an OrbitFlare addition. You can still call [getAsset](/das-api/methods/getAsset) and [getAssetProof](/das-api/methods/getAssetProof) separately.

## Parameters

<ResponseField name="id" type="string" required>
  The compressed asset ID (base-58).
</ResponseField>

<ResponseField name="options" type="object">
  [Display options](/das-api/display-options) for the asset: `showUnverifiedCollections`, `showCollectionMetadata`, `showInscription`. Also accepted as `displayOptions`.
</ResponseField>

## Response

<ResponseField name="result" type="object">
  <Expandable title="result fields">
    <ResponseField name="asset" type="object">
      The [asset object](/das-api/asset-object).
    </ResponseField>

    <ResponseField name="proof" type="object">
      The Merkle proof, with the same fields as [getAssetProof](/das-api/methods/getAssetProof).
    </ResponseField>
  </Expandable>
</ResponseField>

## Code Examples

### Request

```bash theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
curl https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY -X POST -H "Content-Type: application/json" -d '{
  "jsonrpc": "2.0",
  "id": 1,
  "method": "getAssetWithProof",
  "params": {
    "id": "JEKNNLZK6uQaQUEUz9GRoYZ7buHQ4rTN6k3qhX9NG8qU"
  }
}'
```

### Response

```json theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
{
  "jsonrpc": "2.0",
  "result": {
    "asset": {
      "interface": "V1_NFT",
      "id": "JEKNNLZK6uQaQUEUz9GRoYZ7buHQ4rTN6k3qhX9NG8qU",
      "compression": {
        "eligible": false,
        "compressed": true,
        "data_hash": "6TuHoKagPg1Vqz92K5fiUNJtSC7wXHXSQfadLPnXsP8s",
        "creator_hash": "EuiqSYWYf6KnUcEmorrTrGQovPKF9a1wSVJAk7bfLgnR",
        "asset_hash": "CcMhrzXFkjyLwZdijjRibgSYw4tUzXYALoCxwms4aMFH",
        "tree": "E7fYCRWkNykc8HNZvEMRj5GuNYSwJ3WjA6HuLsh3YHvL",
        "seq": 627605,
        "leaf_id": 622994
      },
      "ownership": {
        "frozen": false,
        "delegated": false,
        "delegate": null,
        "ownership_model": "single",
        "owner": "5MRNQW3NxNes1EDnxUhqyXwffseQBLpdu6QJF8G4MdN9"
      }
    },
    "proof": {
      "root": "3wxyaNRvzuZqDd9jtqthCu87spdKuhcpaKVzP1msGyHW",
      "proof": [
        "8mjbWMPrBwYJeEmQbeYLR7mscS4umW4U3kxibuH8hcY1",
        "DV31TLc5BXCnCQMaQ9H6empbG9i69w4AWkjR5RPiyXr8",
        "G6f1pEKetujNm6JXQxD47eBudxLV1irR1U5atpAXBb4q"
      ],
      "node_index": 1671570,
      "leaf": "CcMhrzXFkjyLwZdijjRibgSYw4tUzXYALoCxwms4aMFH",
      "tree_id": "E7fYCRWkNykc8HNZvEMRj5GuNYSwJ3WjA6HuLsh3YHvL"
    }
  },
  "id": 1
}
```

The asset and proof are shortened. See [getAsset](/das-api/methods/getAsset) and [getAssetProof](/das-api/methods/getAssetProof) for full examples.

### TypeScript

Collect the fields a Bubblegum transfer needs:

```typescript theme={"theme":{"light":"github-light","dark":"github-dark-default"}}
const RPC_URL = 'https://fra.rpc.orbitflare.com?api_key=YOUR-API-KEY';

async function getTransferInputs(assetId: string) {
  const response = await fetch(RPC_URL, {
    method: 'POST',
    headers: { 'Content-Type': 'application/json' },
    body: JSON.stringify({
      jsonrpc: '2.0',
      id: 1,
      method: 'getAssetWithProof',
      params: { id: assetId },
    }),
  });
  const { result, error } = await response.json();
  if (error) throw new Error(error.message);

  const { asset, proof } = result;
  return {
    merkleTree: proof.tree_id,
    root: proof.root,
    proof: proof.proof,
    leafOwner: asset.ownership.owner,
    leafDelegate: asset.ownership.delegate ?? asset.ownership.owner,
    dataHash: asset.compression.data_hash,
    creatorHash: asset.compression.creator_hash,
    nonce: asset.compression.leaf_id,
    index: asset.compression.leaf_id,
  };
}
```

## Common Errors

| Code | Message | Solution |
| - | - | - |
| -32602 | Pubkey Validation Err: ... is invalid | Pass a valid base-58 asset ID |
| -32000 | Asset Proof Not Found | The asset is not compressed, or it has not been indexed |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.