@silentswap/react 0.1.49 → 0.1.50

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -50,13 +50,20 @@ export type PlatformHealthProviderProps = {
50
50
  * API's own maximumDepositUusdc limit applies.
51
51
  */
52
52
  maxDepositUsd?: number;
53
+ /**
54
+ * Optional maintenance override from admin dashboard settings. When true, the effective
55
+ * platform health is forced to 'MAINTENANCE' regardless of what the platform status API
56
+ * reports — flipping formDisabled and trackingDisabled to true and letting consumers
57
+ * show a maintenance screen.
58
+ */
59
+ maintenanceMode?: boolean;
53
60
  };
54
61
  /**
55
62
  * Provider that monitors platform health from SilentSwapContext (which calls useStatus
56
63
  * once with proId) and provides validation functions for deposit amounts, output limits,
57
64
  * and service fee rates.
58
65
  */
59
- export declare function PlatformHealthProvider({ children, onFormDisabledChange, onTrackingDisabledChange, maxDepositUsd, }: PlatformHealthProviderProps): import("react/jsx-runtime").JSX.Element;
66
+ export declare function PlatformHealthProvider({ children, onFormDisabledChange, onTrackingDisabledChange, maxDepositUsd, maintenanceMode, }: PlatformHealthProviderProps): import("react/jsx-runtime").JSX.Element;
60
67
  /**
61
68
  * Hook to access platform health context
62
69
  */
@@ -9,16 +9,19 @@ const PlatformHealthContext = createContext(undefined);
9
9
  * once with proId) and provides validation functions for deposit amounts, output limits,
10
10
  * and service fee rates.
11
11
  */
12
- export function PlatformHealthProvider({ children, onFormDisabledChange, onTrackingDisabledChange, maxDepositUsd, }) {
12
+ export function PlatformHealthProvider({ children, onFormDisabledChange, onTrackingDisabledChange, maxDepositUsd, maintenanceMode, }) {
13
13
  // Consume status data from parent SilentSwapContext instead of calling useStatus again
14
14
  const { status } = useSilentSwap();
15
15
  const { platformHealth: statusPlatformHealth, maximumDepositUusdc, minimumDepositUusdc, outputLimit, serviceFeeRate, overheadUsd, identity, volume, liquidity, storage, } = status;
16
- // Normalize platform health status
16
+ // Normalize platform health status. A dashboard-driven maintenance override forces
17
+ // the effective status to 'MAINTENANCE' regardless of what the status API reports.
17
18
  const platformHealth = useMemo(() => {
19
+ if (maintenanceMode)
20
+ return 'MAINTENANCE';
18
21
  if (!statusPlatformHealth)
19
22
  return null;
20
23
  return statusPlatformHealth;
21
- }, [statusPlatformHealth]);
24
+ }, [statusPlatformHealth, maintenanceMode]);
22
25
  // Track disabled states locally for context value
23
26
  const [formDisabled, setFormDisabled] = React.useState(false);
24
27
  const [trackingDisabled, setTrackingDisabled] = React.useState(false);
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@silentswap/react",
3
3
  "type": "module",
4
- "version": "0.1.49",
4
+ "version": "0.1.50",
5
5
  "license": "MIT",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -24,8 +24,8 @@
24
24
  "dependencies": {
25
25
  "@bigmi/core": "^0.6.5",
26
26
  "@ensdomains/ensjs": "^4.2.0",
27
- "@silentswap/sdk": "0.1.49",
28
- "@silentswap/ui-kit": "0.1.49",
27
+ "@silentswap/sdk": "0.1.50",
28
+ "@silentswap/ui-kit": "0.1.50",
29
29
  "@solana/codecs-strings": "^5.1.0",
30
30
  "@solana/kit": "^5.1.0",
31
31
  "@solana/rpc": "^5.1.0",