Introduction
Getting Started
The @metaplex-foundation/digital-asset-standard-api
package can be use to interact with Metaplex DAS API:
The DAS API client is a Umi plugin so you will have to install Umi in conjunction with the DAS API client.
You can install umi and the plugin from the location below.
npm install @metaplex-foundation/umi
npm install @metaplex-foundation/umi-bundle-defaults
npm install @metaplex-foundation/digital-asset-standard-api
Once installed you can register the library with your Umi instance.
import { dasApi } from "@metaplex-foundation/digital-asset-standard-api"
import { createUmi } from '@metaplex-foundation/umi-bundle-defaults';
const umi = createUmi("exampleDasProvider.com").use(dasApi());
The plugin can be used with any RPC that supports the Metaplex DAS API specification – RPCs that support the specification can be found on the RPC Providers page.
Note You might need to contact your RPC provider to "enable" the DAS API on your endpoint.
Metaplex Core DAS API
If you intend to use DAS on Metaplex Core Assets you want to install the additional @metaplex-foundation/mpl-core-das
package:
DAS for MPL Core
The DAS Extension for MPL Core helps directly returns you the correct types to further use with the MPL SDKs. It also automatically derives the plugins in assets inherited from the collection and provides functions for DAS-to-Core type conversions.
To use it first install the additional package:
npm install @metaplex-foundation/mpl-core-das
Then import that package
import { das } from '@metaplex-foundation/mpl-core-das';
After this you can either use the Core specific functions like mentioned above.