metaplex-foundation / metaplex

A directory of what the Metaplex Foundation works on!
https://metaplex.com
Apache License 2.0
3.32k stars 6.27k forks source link

Required / optional fields are not documented in the Token Standard #2284

Open mikemaccana opened 1 year ago

mikemaccana commented 1 year ago

What fields are required vs optional in https://docs.metaplex.com/programs/token-metadata/token-standard#the-non-fungible-standard ?

Eg 'symbol' is in the standard, but not used in the example.

If Metaplex could add a 'required' column to the table it would be helpful. ❤️

mikemaccana commented 1 year ago

Found it: @metaplex-foundation/js/dist/types/plugins/nftModule/models/JsonMetadata.d.ts

/** @group Models */
export type JsonMetadata<Uri = string> = {
    name?: string;
    symbol?: string;
    description?: string;
    seller_fee_basis_points?: number;
    image?: Uri;
    external_url?: Uri;
    attributes?: Array<{
        trait_type?: string;
        value?: string;
        [key: string]: unknown;
    }>;
    properties?: {
        creators?: Array<{
            address?: string;
            share?: number;
            [key: string]: unknown;
        }>;
        files?: Array<{
            type?: string;
            uri?: Uri;
            [key: string]: unknown;
        }>;
        [key: string]: unknown;
    };
    collection?: {
        name?: string;
        family?: string;
        [key: string]: unknown;
    };
    [key: string]: unknown;
};

Someone (maybe me?) should add it to the docs though so keeping open.