stellar-non-fungible
Generate SEP-50 compliant non-fungible token contracts with customizable features like burnable, enumerable, pausable, and upgradeable options. Returns contract source code in Markdown format without writing to disk.
Instructions
Make a non-fungible token per the Non-Fungible Token Standard, compatible with SEP-50, similar to ERC-721.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| name | Yes | The name of the contract | |
| symbol | Yes | The short symbol for the token | |
| tokenUri | No | The metadata URI returned by the token contract for every NFT. | |
| burnable | No | Whether token holders will be able to destroy their tokens | |
| enumerable | No | Whether the NFTs are enumerable (can be iterated over). | |
| consecutive | No | To batch mint NFTs instead of minting them individually (sequential minting is mandatory). | |
| pausable | No | Whether privileged accounts will be able to pause specifically marked functionality. Useful for emergency response. | |
| mintable | No | Whether privileged accounts will be able to create more supply or emit more tokens | |
| sequential | No | Whether the IDs of the minted NFTs will be sequential. | |
| access | No | The type of access control to provision. Ownable is a simple mechanism with a single account authorized for all privileged actions. Roles is a flexible mechanism with a separate role for each privileged action. A role can have many authorized accounts. | |
| upgradeable | No | Whether the contract can be upgraded. | |
| info | No | Metadata about the contract and author |
Implementation Reference
- Async handler function that constructs NonFungibleOptions from input parameters and generates Rust code using nonFungible.print(opts), wrapped in safePrintRustCodeBlock.async ({ name, symbol, tokenUri, burnable, enumerable, consecutive, pausable, mintable, sequential, upgradeable, info, }) => { const opts: NonFungibleOptions = { name, symbol, tokenUri, burnable, enumerable, consecutive, pausable, mintable, sequential, upgradeable, info, }; return { content: [ { type: 'text', text: safePrintRustCodeBlock(() => nonFungible.print(opts)), }, ], }; },
- Zod schema defining the input parameters for the stellar-non-fungible tool, including name, symbol, various optional flags, and common schema.export const nonFungibleSchema = { name: z.string().describe(commonDescriptions.name), symbol: z.string().describe(commonDescriptions.symbol), tokenUri: z.string().optional().describe(stellarNonFungibleDescriptions.tokenUri), burnable: z.boolean().optional().describe(commonDescriptions.burnable), enumerable: z.boolean().optional().describe(stellarNonFungibleDescriptions.enumerable), consecutive: z.boolean().optional().describe(stellarNonFungibleDescriptions.consecutive), pausable: z.boolean().optional().describe(commonDescriptions.pausable), mintable: z.boolean().optional().describe(commonDescriptions.mintable), sequential: z.boolean().optional().describe(stellarNonFungibleDescriptions.sequential), ...commonSchema, } as const satisfies z.ZodRawShape;
- packages/mcp/src/stellar/tools/non-fungible.ts:8-49 (registration)Registration function that registers the 'stellar-non-fungible' tool on the MCP server with its prompt, schema, and handler.export function registerStellarNonFungible(server: McpServer): RegisteredTool { return server.tool( 'stellar-non-fungible', makeDetailedPrompt(stellarPrompts.NonFungible), nonFungibleSchema, async ({ name, symbol, tokenUri, burnable, enumerable, consecutive, pausable, mintable, sequential, upgradeable, info, }) => { const opts: NonFungibleOptions = { name, symbol, tokenUri, burnable, enumerable, consecutive, pausable, mintable, sequential, upgradeable, info, }; return { content: [ { type: 'text', text: safePrintRustCodeBlock(() => nonFungible.print(opts)), }, ], }; }, ); }