Skip to main content

TokenMintForm

The TokenMintForm component provides an interface for minting tokens to verified investors.

Import​

import { TokenMintForm } from '@mantle-rwa/react';

Basic Usage​

<TokenMintForm
tokenAddress="0x..."
onSuccess={(tx) => console.log('Minted:', tx)}
/>

Props​

PropTypeRequiredDescription
tokenAddressstringYesAddress of the RWA token
onSuccess(tx: TransactionReceipt) => voidNoCallback on successful mint
onError(error: Error) => voidNoCallback on error
maxAmountstringNoMaximum mintable amount
showKYCCheckbooleanNoShow KYC verification status
batchModebooleanNoEnable batch minting
classNamestringNoAdditional CSS class

Examples​

Single Mint​

<TokenMintForm
tokenAddress="0x..."
onSuccess={(tx) => {
toast.success('Tokens minted successfully!');
refetchBalance();
}}
onError={(error) => {
toast.error(error.message);
}}
/>

Batch Minting​

<TokenMintForm
tokenAddress="0x..."
batchMode={true}
onSuccess={(tx) => {
console.log('Batch mint complete:', tx);
}}
/>

With KYC Check​

<TokenMintForm
tokenAddress="0x..."
showKYCCheck={true}
kycRegistryAddress="0x..."
/>

With Amount Limits​

<TokenMintForm
tokenAddress="0x..."
maxAmount="100000"
minAmount="100"
/>

Form Fields​

Single Mode​

  • Recipient Address: Wallet address to receive tokens
  • Amount: Number of tokens to mint
  • Memo (optional): Transaction memo

Batch Mode​

  • CSV Upload: Upload CSV with addresses and amounts
  • Manual Entry: Add multiple recipients manually
  • Preview: Review before submitting

Validation​

The form automatically validates:

  • Valid Ethereum address format
  • Recipient KYC status (if enabled)
  • Amount within min/max limits
  • Compliance rule checks
  • Sufficient minter permissions

Customization​

Custom Fields​

<TokenMintForm
tokenAddress="0x..."
additionalFields={[
{
name: 'investorId',
label: 'Investor ID',
type: 'text',
required: true,
},
]}
/>

Custom Validation​

<TokenMintForm
tokenAddress="0x..."
validate={async (values) => {
const errors = {};
if (values.amount > maxAllowed) {
errors.amount = 'Exceeds maximum allowed';
}
return errors;
}}
/>

Styling​

CSS Variables​

.rwa-mint-form {
--form-background: #1A1A1A;
--form-input-bg: #2D2D2D;
--form-border-radius: 8px;
--form-spacing: 1rem;
}

Class Names​

ClassDescription
.rwa-mint-formRoot container
.rwa-mint-inputInput fields
.rwa-mint-buttonSubmit button
.rwa-mint-previewBatch preview
.rwa-mint-errorError messages

See Also​