@kodiak-finance/orderly-react-app 2.8.18 → 2.8.19

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.
package/dist/index.d.mts CHANGED
@@ -1,7 +1,8 @@
1
- import react, { ReactNode, ComponentType, PropsWithChildren } from 'react';
1
+ import react, { ReactNode, ComponentType, PropsWithChildren, Component, ErrorInfo } from 'react';
2
2
  import { ExtensionPosition, OrderlyThemeProviderProps } from '@kodiak-finance/orderly-ui';
3
3
  import { ConfigProviderProps, ExclusiveConfigProviderProps, Chains, WalletState, RestrictedInfoReturns, RestrictedInfoOptions, OrderValidationResult } from '@kodiak-finance/orderly-hooks';
4
4
  import { Chain, NetworkId, AccountStatusEnum, API } from '@kodiak-finance/orderly-types';
5
+ import * as react_jsx_runtime from 'react/jsx-runtime';
5
6
 
6
7
  type Logo = {
7
8
  img?: string;
@@ -45,6 +46,10 @@ type WidgetConfigs = {
45
46
  scanQRCode?: {
46
47
  onSuccess?: (url: string) => void;
47
48
  };
49
+ subAccount?: {
50
+ /** @deprecated The number of custom sub-accounts needs to be configured in sync with the backend. If you’re not sure about it, please don’t set this value. */
51
+ maxSubAccountCount: number;
52
+ };
48
53
  };
49
54
  type AppContextState = {
50
55
  connectWallet: ReturnType<typeof useWalletStateHandle>["connectWallet"];
@@ -94,11 +99,34 @@ declare function useOrderEntryFormErrorMsg(errors: OrderValidationResult | null)
94
99
  getErrorMsg: (key: Keys, customValue?: string) => string;
95
100
  };
96
101
 
102
+ type ErrorBoundaryState = {
103
+ hasError: boolean;
104
+ error?: Error;
105
+ errorInfo?: ErrorInfo;
106
+ };
107
+ type ErrorBoundaryProps = PropsWithChildren<{
108
+ className?: string;
109
+ onError?: (error: Error, errorInfo: ErrorInfo) => void;
110
+ icon?: ReactNode;
111
+ title?: string;
112
+ description?: string;
113
+ refreshButtonText?: string;
114
+ onRefresh?: () => void;
115
+ }>;
116
+ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
117
+ constructor(props: PropsWithChildren);
118
+ static getDerivedStateFromError(error: Error): ErrorBoundaryState;
119
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
120
+ render(): string | number | boolean | react_jsx_runtime.JSX.Element | Iterable<ReactNode> | null | undefined;
121
+ }
122
+
123
+ declare function useCanTrade(): boolean;
124
+
97
125
  /**
98
126
  * SDK Version - BUMP THIS WHEN RELEASING
99
127
  * Keep in sync with root package.json version
100
128
  */
101
- declare const SDK_VERSION = "2.8.18";
129
+ declare const SDK_VERSION = "2.8.19";
102
130
  type ChangesetEntry = {
103
131
  date: string;
104
132
  title: string;
@@ -125,4 +153,4 @@ declare function getChangesetForVersion(version?: string): ChangesetEntry | unde
125
153
  */
126
154
  declare function getLatestChangeset(): ChangesetEntry | undefined;
127
155
 
128
- export { type AppLogos, type AppStateProviderProps, CHANGESETS, type ChangesetEntry, type Changesets, OrderlyAppProvider, type OrderlyAppProviderProps, SDK_VERSION, getChangesetForVersion, getLatestChangeset, useAppConfig, useAppContext, useDataTap, useOrderEntryFormErrorMsg };
156
+ export { type AppLogos, type AppStateProviderProps, CHANGESETS, type ChangesetEntry, type Changesets, ErrorBoundary, OrderlyAppProvider, type OrderlyAppProviderProps, SDK_VERSION, getChangesetForVersion, getLatestChangeset, useAppConfig, useAppContext, useCanTrade, useDataTap, useOrderEntryFormErrorMsg };
package/dist/index.d.ts CHANGED
@@ -1,7 +1,8 @@
1
- import react, { ReactNode, ComponentType, PropsWithChildren } from 'react';
1
+ import react, { ReactNode, ComponentType, PropsWithChildren, Component, ErrorInfo } from 'react';
2
2
  import { ExtensionPosition, OrderlyThemeProviderProps } from '@kodiak-finance/orderly-ui';
3
3
  import { ConfigProviderProps, ExclusiveConfigProviderProps, Chains, WalletState, RestrictedInfoReturns, RestrictedInfoOptions, OrderValidationResult } from '@kodiak-finance/orderly-hooks';
4
4
  import { Chain, NetworkId, AccountStatusEnum, API } from '@kodiak-finance/orderly-types';
5
+ import * as react_jsx_runtime from 'react/jsx-runtime';
5
6
 
6
7
  type Logo = {
7
8
  img?: string;
@@ -45,6 +46,10 @@ type WidgetConfigs = {
45
46
  scanQRCode?: {
46
47
  onSuccess?: (url: string) => void;
47
48
  };
49
+ subAccount?: {
50
+ /** @deprecated The number of custom sub-accounts needs to be configured in sync with the backend. If you’re not sure about it, please don’t set this value. */
51
+ maxSubAccountCount: number;
52
+ };
48
53
  };
49
54
  type AppContextState = {
50
55
  connectWallet: ReturnType<typeof useWalletStateHandle>["connectWallet"];
@@ -94,11 +99,34 @@ declare function useOrderEntryFormErrorMsg(errors: OrderValidationResult | null)
94
99
  getErrorMsg: (key: Keys, customValue?: string) => string;
95
100
  };
96
101
 
102
+ type ErrorBoundaryState = {
103
+ hasError: boolean;
104
+ error?: Error;
105
+ errorInfo?: ErrorInfo;
106
+ };
107
+ type ErrorBoundaryProps = PropsWithChildren<{
108
+ className?: string;
109
+ onError?: (error: Error, errorInfo: ErrorInfo) => void;
110
+ icon?: ReactNode;
111
+ title?: string;
112
+ description?: string;
113
+ refreshButtonText?: string;
114
+ onRefresh?: () => void;
115
+ }>;
116
+ declare class ErrorBoundary extends Component<ErrorBoundaryProps, ErrorBoundaryState> {
117
+ constructor(props: PropsWithChildren);
118
+ static getDerivedStateFromError(error: Error): ErrorBoundaryState;
119
+ componentDidCatch(error: Error, errorInfo: ErrorInfo): void;
120
+ render(): string | number | boolean | react_jsx_runtime.JSX.Element | Iterable<ReactNode> | null | undefined;
121
+ }
122
+
123
+ declare function useCanTrade(): boolean;
124
+
97
125
  /**
98
126
  * SDK Version - BUMP THIS WHEN RELEASING
99
127
  * Keep in sync with root package.json version
100
128
  */
101
- declare const SDK_VERSION = "2.8.18";
129
+ declare const SDK_VERSION = "2.8.19";
102
130
  type ChangesetEntry = {
103
131
  date: string;
104
132
  title: string;
@@ -125,4 +153,4 @@ declare function getChangesetForVersion(version?: string): ChangesetEntry | unde
125
153
  */
126
154
  declare function getLatestChangeset(): ChangesetEntry | undefined;
127
155
 
128
- export { type AppLogos, type AppStateProviderProps, CHANGESETS, type ChangesetEntry, type Changesets, OrderlyAppProvider, type OrderlyAppProviderProps, SDK_VERSION, getChangesetForVersion, getLatestChangeset, useAppConfig, useAppContext, useDataTap, useOrderEntryFormErrorMsg };
156
+ export { type AppLogos, type AppStateProviderProps, CHANGESETS, type ChangesetEntry, type Changesets, ErrorBoundary, OrderlyAppProvider, type OrderlyAppProviderProps, SDK_VERSION, getChangesetForVersion, getLatestChangeset, useAppConfig, useAppContext, useCanTrade, useDataTap, useOrderEntryFormErrorMsg };