0

Can we use umi and mpltokenmetadata lib same time in one solana transaction

1 Answer 1

2

Sure. @metaplex-foundation/mpl-token-metadata actually is some kind of umi plugin.

E.g. if you mint a NFT using it you first set up umi, then run the mpl token metadata function:

import { generateSigner, percentAmount } from '@metaplex-foundation/umi'
import {
  createNft,
  fetchDigitalAsset,
} from '@metaplex-foundation/mpl-token-metadata'

const mint = generateSigner(umi)
await createNft(umi, {
  mint,
  name: 'My NFT',
  uri: 'https://example.com/my-nft.json',
  sellerFeeBasisPoints: percentAmount(5.5),
}).sendAndConfirm(umi)

const asset = await fetchDigitalAsset(umi, mint.publicKey)

Source: https://developers.metaplex.com/token-metadata/getting-started/js

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.