@multiversx/sdk-dapp-liquidity 1.1.0-alpha.22 → 1.1.0-alpha.23

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/package.json CHANGED
@@ -28,7 +28,7 @@
28
28
  },
29
29
  "homepage": "https://github.com/multiversx/mx-sdk-dapp-liquidity#readme",
30
30
  "license": "MIT",
31
- "version": "1.1.0-alpha.22",
31
+ "version": "1.1.0-alpha.23",
32
32
  "main": "index.js",
33
33
  "module": "index.mjs",
34
34
  "types": "index.d.ts",
@@ -8,6 +8,7 @@ interface BridgeFormProps {
8
8
  secondTokenIdentifier?: string;
9
9
  refetchTrigger?: number;
10
10
  showHistory?: boolean;
11
+ forcedDestinationTokenSymbol?: string;
11
12
  onSuccessfullySentTransaction?: (txHashes?: string[]) => void;
12
13
  onFailedSentTransaction?: (message?: string) => void;
13
14
  onHistoryClose?: () => void;
@@ -15,5 +16,5 @@ interface BridgeFormProps {
15
16
  onMvxDisconnect?: () => void;
16
17
  onNavigate?: (url: string, options?: object) => void;
17
18
  }
18
- export declare const BridgeForm: ({ mvxChainId, mvxAddress, username, nativeAuthToken, callbackRoute, firstTokenIdentifier, secondTokenIdentifier, refetchTrigger, showHistory, onSuccessfullySentTransaction, onFailedSentTransaction, onHistoryClose, onMvxConnect, onMvxDisconnect, onNavigate }: BridgeFormProps) => import("react/jsx-runtime").JSX.Element;
19
+ export declare const BridgeForm: ({ mvxChainId, mvxAddress, username, nativeAuthToken, callbackRoute, firstTokenIdentifier, secondTokenIdentifier, refetchTrigger, showHistory, forcedDestinationTokenSymbol, onSuccessfullySentTransaction, onFailedSentTransaction, onHistoryClose, onMvxConnect, onMvxDisconnect, onNavigate }: BridgeFormProps) => import("react/jsx-runtime").JSX.Element;
19
20
  export {};
@@ -127,6 +127,7 @@ const BridgeForm = ({
127
127
  secondTokenIdentifier,
128
128
  refetchTrigger,
129
129
  showHistory,
130
+ forcedDestinationTokenSymbol,
130
131
  onSuccessfullySentTransaction,
131
132
  onFailedSentTransaction,
132
133
  onHistoryClose,
@@ -194,6 +195,15 @@ const BridgeForm = ({
194
195
  );
195
196
  const getAvailableTokens = React.useCallback(
196
197
  (option) => {
198
+ if (forcedDestinationTokenSymbol) {
199
+ const forcedToken = mvxTokensWithBalances == null ? void 0 : mvxTokensWithBalances.find(
200
+ (mvxToken) => mvxToken.symbol.toLowerCase() === forcedDestinationTokenSymbol.toLowerCase()
201
+ );
202
+ if (forcedToken) {
203
+ return [forcedToken];
204
+ }
205
+ return [];
206
+ }
197
207
  if (!(option == null ? void 0 : option.availableTokens)) {
198
208
  return [];
199
209
  }
@@ -124,6 +124,7 @@ const BridgeForm = ({
124
124
  secondTokenIdentifier,
125
125
  refetchTrigger,
126
126
  showHistory,
127
+ forcedDestinationTokenSymbol,
127
128
  onSuccessfullySentTransaction,
128
129
  onFailedSentTransaction,
129
130
  onHistoryClose,
@@ -191,6 +192,15 @@ const BridgeForm = ({
191
192
  );
192
193
  const getAvailableTokens = useCallback(
193
194
  (option) => {
195
+ if (forcedDestinationTokenSymbol) {
196
+ const forcedToken = mvxTokensWithBalances == null ? void 0 : mvxTokensWithBalances.find(
197
+ (mvxToken) => mvxToken.symbol.toLowerCase() === forcedDestinationTokenSymbol.toLowerCase()
198
+ );
199
+ if (forcedToken) {
200
+ return [forcedToken];
201
+ }
202
+ return [];
203
+ }
194
204
  if (!(option == null ? void 0 : option.availableTokens)) {
195
205
  return [];
196
206
  }