diff --git a/packages/apps/rwa-demo/src/app/(app)/page.tsx b/packages/apps/rwa-demo/src/app/(app)/page.tsx
index 6d7f219040..e2c6a6d7c1 100644
--- a/packages/apps/rwa-demo/src/app/(app)/page.tsx
+++ b/packages/apps/rwa-demo/src/app/(app)/page.tsx
@@ -113,15 +113,15 @@ const Home = () => {
{asset && (
<>
>
diff --git a/packages/apps/rwa-demo/src/components/DistributionForm/DistributionForm.tsx b/packages/apps/rwa-demo/src/components/DistributionForm/DistributionForm.tsx
index 538d87cb02..7287bfaa2d 100644
--- a/packages/apps/rwa-demo/src/components/DistributionForm/DistributionForm.tsx
+++ b/packages/apps/rwa-demo/src/components/DistributionForm/DistributionForm.tsx
@@ -15,6 +15,7 @@ import { cloneElement, useEffect, useRef, useState } from 'react';
import { Controller, useForm } from 'react-hook-form';
import { AssetPausedMessage } from '../AssetPausedMessage/AssetPausedMessage';
import { InvestorFrozenMessage } from '../InvestorFrozenMessage/InvestorFrozenMessage';
+import { NoComplianceMessage } from '../NoComplianceMessage/NoComplianceMessage';
import { SendTransactionAnimation } from '../SendTransactionAnimation/SendTransactionAnimation';
import type { ITransaction } from '../TransactionsProvider/TransactionsProvider';
@@ -106,7 +107,7 @@ export const DistributionForm: FC = ({
label="Amount"
{...field}
errorMessage={errors.amount?.message}
- description={`max amount: ${maxAmount} `}
+ description={`max amount: ${maxAmount < 0 ? 0 : maxAmount} `}
/>
)}
/>
@@ -116,6 +117,7 @@ export const DistributionForm: FC = ({
<>
+
>
}
>
diff --git a/packages/apps/rwa-demo/src/components/InvestorBalance/InvestorBalance.tsx b/packages/apps/rwa-demo/src/components/InvestorBalance/InvestorBalance.tsx
index 6592352054..8384153598 100644
--- a/packages/apps/rwa-demo/src/components/InvestorBalance/InvestorBalance.tsx
+++ b/packages/apps/rwa-demo/src/components/InvestorBalance/InvestorBalance.tsx
@@ -22,6 +22,7 @@ export const InvestorBalance: FC = ({
});
const { data: frozenData } = useGetFrozenTokens({ investorAccount });
+ const cleanedBalance = balance < 0 ? 0 : balance;
if (short) {
return (
@@ -33,15 +34,15 @@ export const InvestorBalance: FC = ({
]}
account={investorAccount}
/>
-
- {balance} ( {frozenData})
+
+ {cleanedBalance} ( {frozenData})
);
}
return (
-
+
investorBalance:{' '}
= ({
]}
account={investorAccount}
/>
- {balance} ( {frozenData})
+ {cleanedBalance} ( {frozenData})
);
};
diff --git a/packages/apps/rwa-demo/src/components/NoComplianceMessage/NoComplianceMessage.tsx b/packages/apps/rwa-demo/src/components/NoComplianceMessage/NoComplianceMessage.tsx
new file mode 100644
index 0000000000..0d4eae6f05
--- /dev/null
+++ b/packages/apps/rwa-demo/src/components/NoComplianceMessage/NoComplianceMessage.tsx
@@ -0,0 +1,19 @@
+import { useAsset } from '@/hooks/asset';
+import { Notification } from '@kadena/kode-ui';
+import type { FC } from 'react';
+
+export const NoComplianceMessage: FC = () => {
+ const { asset } = useAsset();
+
+ if (
+ (asset?.maxSupply ?? -1) >= 0 &&
+ (asset?.maxBalance ?? -1) >= 0 &&
+ (asset?.maxInvestors ?? -1) >= 0
+ )
+ return;
+ return (
+
+ There are no compliance rules set
+
+ );
+};
diff --git a/packages/apps/rwa-demo/src/components/SetComplianceForm/SetComplianceForm.tsx b/packages/apps/rwa-demo/src/components/SetComplianceForm/SetComplianceForm.tsx
index 12535cd2b8..d934e4ef60 100644
--- a/packages/apps/rwa-demo/src/components/SetComplianceForm/SetComplianceForm.tsx
+++ b/packages/apps/rwa-demo/src/components/SetComplianceForm/SetComplianceForm.tsx
@@ -23,7 +23,12 @@ export const SetComplianceForm: FC = ({ onClose, trigger }) => {
const { asset } = useAsset();
const { setIsRightAsideExpanded, isRightAsideExpanded } = useLayout();
const [isOpen, setIsOpen] = useState(false);
- const { handleSubmit, reset, control } = useForm({
+ const {
+ handleSubmit,
+ reset,
+ control,
+ formState: { isValid },
+ } = useForm({
defaultValues: {
maxBalance: `${asset?.maxBalance ?? 0}`,
maxSupply: `${asset?.maxSupply ?? 0}`,
@@ -67,7 +72,7 @@ export const SetComplianceForm: FC = ({ onClose, trigger }) => {
(
)}
@@ -76,7 +81,7 @@ export const SetComplianceForm: FC = ({ onClose, trigger }) => {
(
)}
@@ -84,7 +89,7 @@ export const SetComplianceForm: FC = ({ onClose, trigger }) => {
(
= ({ onClose, trigger }) => {
-