# @metaplex-foundation/mpl-core

> Digital Assets

Latest version **1.10.0** (published 2026-04-16) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install @metaplex-foundation/mpl-core
pnpm add @metaplex-foundation/mpl-core
yarn add @metaplex-foundation/mpl-core
bun add @metaplex-foundation/mpl-core
```

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; no vulnerabilities; has provenance; high maintenance score; high quality score.

Warnings: low downloads; no esm support.

## Facts

| | |
|---|---|
| Version | 1.10.0 |
| Published | 2026-04-16 |
| First published | 2021-12-03 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 957.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 119 |
| Author | Metaplex Maintainers |
| Maintainers | danenbm1, nhanphan, brandontulsi, svc01-metaplex, danenbm, blockiosaurus |

## Links

- npm: https://www.npmjs.com/package/@metaplex-foundation/mpl-core
- Repository: https://github.com/metaplex-foundation/mpl-core
- Homepage: https://metaplex.com
- Issues: https://github.com/metaplex-foundation/mpl-core/issues
- npm.io page: https://npm.io/package/@metaplex-foundation/mpl-core

## Dependencies (1)

- [@msgpack/msgpack](https://npm.io/package/@msgpack/msgpack.md) ^3.0.0-beta2

## Recent versions

- 1.10.0 (latest) — 2026-04-16
- 1.4.0-beta.0 (beta) — 2025-05-01
- 1.3.0-alpha.0 (alpha) — 2025-03-10
- 1.0.0-alpha.6 (next) — 2024-05-14
- 1.9.1 — 2026-04-02
- 1.8.1 — 2026-04-02
- 1.9.0 — 2026-03-26
- 1.8.0 — 2026-03-12
- 1.7.0 — 2025-09-16
- 1.6.0 — 2025-07-17
- 1.4.1 — 2025-06-25
- 1.5.0 — 2025-06-23
- 1.4.0 — 2025-05-07
- 1.3.0 — 2025-03-26
- 1.2.0 — 2025-01-17
- … 32 more at https://npm.io/package/@metaplex-foundation/mpl-core/versions

## README

# JavaScript client for Mpl Core

A Umi-compatible JavaScript library for the project.

## Getting started

1. First, if you're not already using Umi, [follow these instructions to install the Umi framework](https://github.com/metaplex-foundation/umi/blob/main/docs/installation.md).
2. Next, install this library using the package manager of your choice.
   ```sh
   npm install @metaplex-foundation/mpl-core
   ```
3. Finally, register the library with your Umi instance like so.
   ```ts
   import { createUmi } from '@metaplex-foundation/umi-bundle-defaults';
   import { mplCore } from '@metaplex-foundation/mpl-core';

   const umi = createUmi('<your rpc endpoint>');
   umi.use(mplCore());
   ```

   For using on the frontend wallets, see [this React example](https://github.com/metaplex-foundation/inscriptions-ui-mantine/blob/master/providers/UmiProvider.tsx)

   ```ts
   import { useConnection, useWallet } from '@solana/wallet-adapter-react';
   import { walletAdapterIdentity } from '@metaplex-foundation/umi-signer-wallet-adapters';

   export function MyComponent() {
      const wallet = useWallet();
      const { connection } = useConnection();
      const umi = createUmi(connection)
         .use(walletAdapterIdentity(wallet))
         .use(mplCore())

      // rest of component
   }
   ```

4. Examples
   ```ts
   // Create an asset
   const assetAddress = generateSigner(umi);
   const owner = generateSigner(umi);
   await create(umi, {
     name: 'Test Asset',
     uri: 'https://example.com/asset.json',
     asset: assetAddress,
     owner: owner.publicKey, // optional, will default to payer
   }).sendAndConfirm(umi);

   // Fetch an asset
   const asset = await fetchAssetV1(umi, assetAddress.publicKey);

   // Create a collection
   const collectionUpdateAuthority = generateSigner(umi);
   const collectionAddress = generateSigner(umi);
   await createCollection(umi, {
     name: 'Test Collection',
     uri: 'https://example.com/collection.json',
     collection: collectionAddress,
     updateAuthority: collectionUpdateAuthority.publicKey, // optional, defaults to payer
   }).sendAndConfirm(umi);

   // Fetch a collection
   const collection = await fetchCollectionV1(umi, collectionAddress.publicKey);

   // Create an asset in a collection, the authority must be the updateAuthority of the collection
   await create(umi, {
     name: 'Test Asset',
     uri: 'https://example.com/asset.json',
     asset: assetAddress,
     collection,
     authority: collectionUpdateAuthority, // optional, defaults to payer
   }).sendAndConfirm(umi);

   // Transfer an asset
   const recipient = generateSigner(umi);
   await transfer(umi, {
     asset,
     newOwner: recipient.publicKey,
   }).sendAndConfirm(umi);

   // Transfer an asset in a collection
   await transfer(umi, {
     asset,
     newOwner: recipient.publicKey,
     collection,
   }).sendAndConfirm(umi);

   // GPA fetch assets by owner
   const assetsByOwner = await getAssetV1GpaBuilder(umi)
     .whereField('key', Key.AssetV1)
     .whereField('owner', owner.publicKey)
     .getDeserialized();

   // GPA fetch assets by collection
   const assetsByCollection = await getAssetV1GpaBuilder(umi)
     .whereField('key', Key.AssetV1)
     .whereField(
       'updateAuthority',
       updateAuthority('Collection', [collectionAddress.publicKey])
     )
     .getDeserialized();

   // DAS API (RPC based indexing) fetch assets by owner/collection
   // Coming soon

   ```
5. Some advanced examples
   ```ts
   const umi = await createUmi();

   // Freezing an asset
   const assetAddress = generateSigner(umi);
   const freezeDelegate = generateSigner(umi);

   await addPlugin(umi, {
     asset: assetAddress.publicKey,
     // adds the owner-managed freeze plugin to the asset
     plugin: {
       type: 'FreezeDelegate',
       frozen: true,
       
       // Optionally set the authority to a delegate who can unfreeze. If unset, this will be the Owner
       // This is functionally the same as calling addPlugin and approvePluginAuthority separately.
       // Freezing with a delegate is commonly used for escrowless staking programs.
       authority: {
         type: 'Address',
         address: freezeDelegate.publicKey,
       },
     }
   }).sendAndConfirm(umi);

   // Unfreezing an asset with a delegate
   // Revoking an authority will revert the authority back to the owner for owner-managed plugins
   await revokePluginAuthority(umi, {
     asset: assetAddress.publicKey,
     plugin: {
       type: 'FreezeDelegate',
     },
     authority: freezeDelegate,
   }).sendAndConfirm(umi);

   // Create a collection with royalties
   const collectionAddress = generateSigner(umi);
   const creator1 = generateSigner(umi);
   const creator2 = generateSigner(umi);

   await createCollection(umi, {
     name: 'Test Collection',
     uri: 'https://example.com/collection.json',
     collection: collectionAddress,
     plugins: [
       {
         type: 'Royalties',
           basisPoints: 500,
           creators: [
             {
               address: creator1.publicKey,
               percentage: 20,
             },
             {
               address: creator2.publicKey,
               percentage: 80,
             },
           ],
           ruleSet: ruleSet('None'), // Compatibility rule set

       },
     ],
   }).sendAndConfirm(umi);

   // Create an asset in a collection.
   // Assets in a collection will inherit the collection's authority-managed plugins, in this case the royalties plugin
   await create(umi, {
     name: 'Test Asset',
     uri: 'https://example.com/asset.json',
     asset: assetAddress,
     collection: await fetchCollectionV1(umi, collectionAddress.publicKey),
   }).sendAndConfirm(umi);
   ```

You can learn more about this library's API by reading its generated [TypeDoc documentation](https://mpl-core-js-docs.vercel.app).

## Contributing

Check out the [Contributing Guide](./CONTRIBUTING.md) the learn more about how to contribute to this library.

---
_Source: https://npm.io/package/@metaplex-foundation/mpl-core · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
