mpl-bubblegum icon indicating copy to clipboard operation
mpl-bubblegum copied to clipboard

Inconsistency between DAS API Documentation and Actual Implementation

Open codewithmide opened this issue 5 months ago • 3 comments

Description

There is a significant discrepancy between the documented Digital Asset Standard (DAS) API methods and the actual implementation in the @metaplex-foundation/umi package. The documentation suggests the existence of methods like getAsset, getAssetProof, and getAssetsByOwner on the umi.rpc object, but these methods are not present in the actual RpcInterface.

Steps to Reproduce

  1. Install the latest version of @metaplex-foundation/umi and @metaplex-foundation/digital-asset-standard-api.
  2. Register the DAS API as per the documentation:
    import { dasApi } from '@metaplex-foundation/digital-asset-standard-api';
    umi.use(dasApi());
    
  3. Attempt to use the DAS API methods as documented:
    const rpcAsset = await umi.rpc.getAsset(assetId);
    const rpcAssetProof = await umi.rpc.getAssetProof(assetId);
    const rpcAssetList = await umi.rpc.getAssetsByOwner({ owner: ownerAddress });
    

Expected Behavior

The umi.rpc object should contain the methods getAsset, getAssetProof, and getAssetsByOwner as described in the documentation.

Actual Behavior

TypeScript throws errors indicating that these methods do not exist on the RpcInterface.

Environment

  • Node.js version: 18.20.4
  • TypeScript version: 5.5.4
  • @metaplex-foundation/umi version: 0.9.2
  • @metaplex-foundation/digital-asset-standard-api version: 1.0.4

Additional Context

The documentation at (Fetching Compressed NFTs)[https://developers.metaplex.com/bubblegum/fetch-cnfts] suggests these methods should be available after registering the DAS API plugin. However, the actual implementation does not match this documentation, leading to confusion and implementation difficulties.

Possible Solutions

  1. Update the RpcInterface to include these DAS API methods.
  2. Update the documentation to accurately reflect the current implementation and provide clear instructions on how to use the DAS API methods if they are implemented differently.
  3. If these methods are intended to be used differently, provide clear examples in the documentation.

codewithmide avatar Sep 09 '24 18:09 codewithmide