Skip to content

Metaplex NFT issues #147

@Sanchoyzer

Description

@Sanchoyzer

Hey. I'm using the DeployCollectionManager (from the agentipy/tools/use_metaplex.py) to create an NFT. I've noticed several issues:

  1. The mint_metaplex_core_nft function does not accept if the following parameters (sellerFeeBasisPoints, address, share, recipient) have None value. However, they have Option type and None default value in the code:
    def mint_metaplex_core_nft(
        agent: SolanaAgentKit,
        collectionMint: str,
        name: str,
        uri: str,
        sellerFeeBasisPoints: Optional[int] = None,
        address: Optional[str] = None,
        share: Optional[str] = None,
        recipient: Optional[str] = None,
    ) -> Optional[Dict[str, Any]]:

If you don't pass it, the API server will return an error:

url
https://api.agentipy.fun/v1/nft/mint

payload
{'requestId': '...', 'encrypted_private_key': '...', 'rpc_url': 'https://api.devnet.solana.com', 'open_api_key': '', 'collectionMint': '...', 'name': '...', 'uri': '...', 'sellerFeeBasisPoints': None, 'address': None, 'share': None, 'recipient': None}

response.json()
{'success': False, 'error': {'issues': [{'code': 'invalid_type', 'expected': 'number', 'received': 'null', 'path': ['sellerFeeBasisPoints'], 'message': 'Expected number, received null'}, {'code': 'invalid_type', 'expected': 'string', 'received': 'null', 'path': ['address'], 'message': 'Expected string, received null'}, {'code': 'invalid_type', 'expected': 'number', 'received': 'null', 'path': ['share'], 'message': 'Expected number, received null'}, {'code': 'invalid_type', 'expected': 'string', 'received': 'null', 'path': ['recipient'], 'message': 'Expected string, received null'}], 'name': 'ZodError'}}v
  1. The parameter share has str type by code, but the server expects int:
url
https://api.agentipy.fun/v1/nft/mint

payload
{'requestId': '...', 'encrypted_private_key': '...', 'rpc_url': 'https://api.devnet.solana.com', 'open_api_key': '', 'collectionMint': '...', 'name': 'My Nft', 'uri': '...', 'sellerFeeBasisPoints': 1, 'address': '...', 'share': '100', 'recipient': '...'}

response.json()
{'success': False, 'error': {'issues': [{'code': 'invalid_type', 'expected': 'number', 'received': 'string', 'path': ['share'], 'message': 'Expected number, received string'}], 'name': 'ZodError'}}
  1. The symbol field in the uri file is ignored:
{"name": "...", "symbol": "WTF", "image": "...", "seller_fee_basis_points": 0, "description": "...", "external_url": "..."}

You can write it, but it won't be used

  1. The function deploy_collection contains a check:
if not all([name, uri, royalty_basis_points, creator_address]):
    raise ValueError("Name, URI, royalty_basis_points, and creator_address are required.")

It will raise an exception if royalty_basis_points==0. Is this the correct behavior?

P.S. if possible, could you please update the versions of the following dependencies: solders, solana, anchorpy

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions