metaplex-foundation / js

A JavaScript SDK for interacting with Metaplex's programs
357 stars 182 forks source link

Recognise MetaplexFile instances in provided JSON and automatically upload them #8

Closed lorisleiva closed 2 years ago

lorisleiva commented 2 years ago

Basically simplifying the usage from this:

const url = await metaplex.value.storage().upload(new MetaplexFile(someFileBuffer, someFileName));
await metaplex.value.nfts().createNft({
    metadata: {
        name: 'My NFT',
        description: 'My NFT description',
        image: url,
        // ...
    },
});

To this:

await metaplex.value.nfts().createNft({
    metadata: {
        name: 'My NFT',
        description: 'My NFT description',
        image: new MetaplexFile(someFileBuffer, someFileName),
        // ...
    },
});
lorisleiva commented 2 years ago

No longer relevant since #33