@orderly.network/ui-transfer 2.8.5 → 2.8.6-alpha.0
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 +45 -5
- package/dist/index.d.ts +45 -5
- package/dist/index.js +485 -85
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +487 -87
- package/dist/index.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +13 -13
package/dist/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { FC, ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
4
|
import { ConnectedChain, Chain, SubAccount } from '@orderly.network/hooks';
|
|
4
5
|
import * as _orderly_network_types from '@orderly.network/types';
|
|
5
6
|
import { API, NetworkId, AssetHistoryStatusEnum } from '@orderly.network/types';
|
|
6
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
import { InputFormatter, InputProps } from '@orderly.network/ui';
|
|
8
8
|
|
|
9
9
|
type DST = {
|
|
@@ -103,6 +103,7 @@ declare const useDepositFormScript: (options: DepositFormScriptOptions) => {
|
|
|
103
103
|
quantity: string;
|
|
104
104
|
collateralContributionQuantity: number;
|
|
105
105
|
maxQuantity: string;
|
|
106
|
+
maxDepositAmount: string;
|
|
106
107
|
indexPrice: number;
|
|
107
108
|
onQuantityChange: react.Dispatch<react.SetStateAction<string>>;
|
|
108
109
|
hintMessage: string | undefined;
|
|
@@ -164,7 +165,7 @@ declare const useDepositFormScript: (options: DepositFormScriptOptions) => {
|
|
|
164
165
|
symbol: string | undefined;
|
|
165
166
|
}[];
|
|
166
167
|
};
|
|
167
|
-
warningMessage: string;
|
|
168
|
+
warningMessage: string | react_jsx_runtime.JSX.Element;
|
|
168
169
|
targetQuantity: string;
|
|
169
170
|
targetQuantityLoading: boolean;
|
|
170
171
|
tokenBalances: Record<string, string>;
|
|
@@ -197,6 +198,8 @@ declare const useWithdrawFormScript: (options: WithdrawFormScriptOptions) => {
|
|
|
197
198
|
nextLTV: number;
|
|
198
199
|
warningMessage: string;
|
|
199
200
|
isLoggedIn: boolean;
|
|
201
|
+
isTokenUnsupported: boolean;
|
|
202
|
+
onSwitchToSupportedNetwork: (this: unknown) => Promise<void>;
|
|
200
203
|
toAccountId: string;
|
|
201
204
|
setToAccountId: react.Dispatch<react.SetStateAction<string>>;
|
|
202
205
|
onTransfer: () => void;
|
|
@@ -208,8 +211,23 @@ declare const useWithdrawFormScript: (options: WithdrawFormScriptOptions) => {
|
|
|
208
211
|
quantity: string;
|
|
209
212
|
onQuantityChange: (qty: string) => void;
|
|
210
213
|
sourceToken: API.TokenInfo | undefined;
|
|
211
|
-
onSourceTokenChange: (token: API.TokenInfo) => void;
|
|
212
|
-
sourceTokens: API.TokenInfo[]
|
|
214
|
+
onSourceTokenChange: (this: unknown, token: API.TokenInfo) => void;
|
|
215
|
+
sourceTokens: API.TokenInfo[] | {
|
|
216
|
+
symbol: string;
|
|
217
|
+
token_decimal: number;
|
|
218
|
+
precision: number;
|
|
219
|
+
token: string;
|
|
220
|
+
token_hash: string;
|
|
221
|
+
decimals: number;
|
|
222
|
+
minimum_withdraw_amount: number;
|
|
223
|
+
base_weight: number;
|
|
224
|
+
discount_factor: number;
|
|
225
|
+
haircut: number;
|
|
226
|
+
user_max_qty: number;
|
|
227
|
+
is_collateral: boolean;
|
|
228
|
+
on_chain_swap: boolean;
|
|
229
|
+
chain_details: API.ChainDetail[];
|
|
230
|
+
}[];
|
|
213
231
|
inputStatus: InputStatus;
|
|
214
232
|
hintMessage: string | undefined;
|
|
215
233
|
amount: number;
|
|
@@ -220,7 +238,25 @@ declare const useWithdrawFormScript: (options: WithdrawFormScriptOptions) => {
|
|
|
220
238
|
unsettledPnL: number;
|
|
221
239
|
wrongNetwork: boolean;
|
|
222
240
|
settingChain: boolean;
|
|
223
|
-
tokenChains:
|
|
241
|
+
tokenChains: {
|
|
242
|
+
isSupported: boolean;
|
|
243
|
+
name: string;
|
|
244
|
+
shortName: string;
|
|
245
|
+
public_rpc_url: string;
|
|
246
|
+
chain_id: number;
|
|
247
|
+
currency_symbol: string;
|
|
248
|
+
bridge_enable: boolean;
|
|
249
|
+
mainnet: boolean;
|
|
250
|
+
est_txn_mins: number | null;
|
|
251
|
+
explorer_base_url: string;
|
|
252
|
+
bridgeless?: boolean;
|
|
253
|
+
withdrawal_fee?: number;
|
|
254
|
+
minimum_withdraw_amount?: number;
|
|
255
|
+
vault_address: string;
|
|
256
|
+
currency_decimal?: number;
|
|
257
|
+
cross_chain_router: string;
|
|
258
|
+
depositor: string;
|
|
259
|
+
}[];
|
|
224
260
|
currentChain: CurrentChain | null;
|
|
225
261
|
onChainChange: (chain: API.NetworkInfos) => Promise<void>;
|
|
226
262
|
onWithdraw: () => Promise<void>;
|
|
@@ -446,6 +482,7 @@ type QuantityInputProps = {
|
|
|
446
482
|
label?: string;
|
|
447
483
|
status?: InputStatus;
|
|
448
484
|
hintMessage?: string;
|
|
485
|
+
hintSuffix?: ReactNode;
|
|
449
486
|
onValueChange?: (value: string) => void;
|
|
450
487
|
onTokenChange?: (token: any) => void;
|
|
451
488
|
fetchBalance?: (token: string, decimals: number) => Promise<any>;
|
|
@@ -455,6 +492,8 @@ type QuantityInputProps = {
|
|
|
455
492
|
vaultBalanceList?: API.VaultBalance[];
|
|
456
493
|
displayType?: "balance" | "vaultBalance";
|
|
457
494
|
tokenBalances?: Record<string, string>;
|
|
495
|
+
tokenValueFormatter?: (value: string) => ReactNode;
|
|
496
|
+
tokenShowCaret?: boolean;
|
|
458
497
|
} & Omit<InputProps, "onClear" | "suffix" | "onValueChange">;
|
|
459
498
|
declare const QuantityInput: FC<QuantityInputProps>;
|
|
460
499
|
|
|
@@ -464,6 +503,7 @@ type AvailableQuantityProps = {
|
|
|
464
503
|
maxQuantity?: number | string;
|
|
465
504
|
onClick?: () => void;
|
|
466
505
|
loading?: boolean;
|
|
506
|
+
tooltipContent?: React.ReactNode;
|
|
467
507
|
};
|
|
468
508
|
declare const AvailableQuantity: FC<AvailableQuantityProps>;
|
|
469
509
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import * as react from 'react';
|
|
2
2
|
import react__default, { FC, ReactNode } from 'react';
|
|
3
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
4
|
import { ConnectedChain, Chain, SubAccount } from '@orderly.network/hooks';
|
|
4
5
|
import * as _orderly_network_types from '@orderly.network/types';
|
|
5
6
|
import { API, NetworkId, AssetHistoryStatusEnum } from '@orderly.network/types';
|
|
6
|
-
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
7
7
|
import { InputFormatter, InputProps } from '@orderly.network/ui';
|
|
8
8
|
|
|
9
9
|
type DST = {
|
|
@@ -103,6 +103,7 @@ declare const useDepositFormScript: (options: DepositFormScriptOptions) => {
|
|
|
103
103
|
quantity: string;
|
|
104
104
|
collateralContributionQuantity: number;
|
|
105
105
|
maxQuantity: string;
|
|
106
|
+
maxDepositAmount: string;
|
|
106
107
|
indexPrice: number;
|
|
107
108
|
onQuantityChange: react.Dispatch<react.SetStateAction<string>>;
|
|
108
109
|
hintMessage: string | undefined;
|
|
@@ -164,7 +165,7 @@ declare const useDepositFormScript: (options: DepositFormScriptOptions) => {
|
|
|
164
165
|
symbol: string | undefined;
|
|
165
166
|
}[];
|
|
166
167
|
};
|
|
167
|
-
warningMessage: string;
|
|
168
|
+
warningMessage: string | react_jsx_runtime.JSX.Element;
|
|
168
169
|
targetQuantity: string;
|
|
169
170
|
targetQuantityLoading: boolean;
|
|
170
171
|
tokenBalances: Record<string, string>;
|
|
@@ -197,6 +198,8 @@ declare const useWithdrawFormScript: (options: WithdrawFormScriptOptions) => {
|
|
|
197
198
|
nextLTV: number;
|
|
198
199
|
warningMessage: string;
|
|
199
200
|
isLoggedIn: boolean;
|
|
201
|
+
isTokenUnsupported: boolean;
|
|
202
|
+
onSwitchToSupportedNetwork: (this: unknown) => Promise<void>;
|
|
200
203
|
toAccountId: string;
|
|
201
204
|
setToAccountId: react.Dispatch<react.SetStateAction<string>>;
|
|
202
205
|
onTransfer: () => void;
|
|
@@ -208,8 +211,23 @@ declare const useWithdrawFormScript: (options: WithdrawFormScriptOptions) => {
|
|
|
208
211
|
quantity: string;
|
|
209
212
|
onQuantityChange: (qty: string) => void;
|
|
210
213
|
sourceToken: API.TokenInfo | undefined;
|
|
211
|
-
onSourceTokenChange: (token: API.TokenInfo) => void;
|
|
212
|
-
sourceTokens: API.TokenInfo[]
|
|
214
|
+
onSourceTokenChange: (this: unknown, token: API.TokenInfo) => void;
|
|
215
|
+
sourceTokens: API.TokenInfo[] | {
|
|
216
|
+
symbol: string;
|
|
217
|
+
token_decimal: number;
|
|
218
|
+
precision: number;
|
|
219
|
+
token: string;
|
|
220
|
+
token_hash: string;
|
|
221
|
+
decimals: number;
|
|
222
|
+
minimum_withdraw_amount: number;
|
|
223
|
+
base_weight: number;
|
|
224
|
+
discount_factor: number;
|
|
225
|
+
haircut: number;
|
|
226
|
+
user_max_qty: number;
|
|
227
|
+
is_collateral: boolean;
|
|
228
|
+
on_chain_swap: boolean;
|
|
229
|
+
chain_details: API.ChainDetail[];
|
|
230
|
+
}[];
|
|
213
231
|
inputStatus: InputStatus;
|
|
214
232
|
hintMessage: string | undefined;
|
|
215
233
|
amount: number;
|
|
@@ -220,7 +238,25 @@ declare const useWithdrawFormScript: (options: WithdrawFormScriptOptions) => {
|
|
|
220
238
|
unsettledPnL: number;
|
|
221
239
|
wrongNetwork: boolean;
|
|
222
240
|
settingChain: boolean;
|
|
223
|
-
tokenChains:
|
|
241
|
+
tokenChains: {
|
|
242
|
+
isSupported: boolean;
|
|
243
|
+
name: string;
|
|
244
|
+
shortName: string;
|
|
245
|
+
public_rpc_url: string;
|
|
246
|
+
chain_id: number;
|
|
247
|
+
currency_symbol: string;
|
|
248
|
+
bridge_enable: boolean;
|
|
249
|
+
mainnet: boolean;
|
|
250
|
+
est_txn_mins: number | null;
|
|
251
|
+
explorer_base_url: string;
|
|
252
|
+
bridgeless?: boolean;
|
|
253
|
+
withdrawal_fee?: number;
|
|
254
|
+
minimum_withdraw_amount?: number;
|
|
255
|
+
vault_address: string;
|
|
256
|
+
currency_decimal?: number;
|
|
257
|
+
cross_chain_router: string;
|
|
258
|
+
depositor: string;
|
|
259
|
+
}[];
|
|
224
260
|
currentChain: CurrentChain | null;
|
|
225
261
|
onChainChange: (chain: API.NetworkInfos) => Promise<void>;
|
|
226
262
|
onWithdraw: () => Promise<void>;
|
|
@@ -446,6 +482,7 @@ type QuantityInputProps = {
|
|
|
446
482
|
label?: string;
|
|
447
483
|
status?: InputStatus;
|
|
448
484
|
hintMessage?: string;
|
|
485
|
+
hintSuffix?: ReactNode;
|
|
449
486
|
onValueChange?: (value: string) => void;
|
|
450
487
|
onTokenChange?: (token: any) => void;
|
|
451
488
|
fetchBalance?: (token: string, decimals: number) => Promise<any>;
|
|
@@ -455,6 +492,8 @@ type QuantityInputProps = {
|
|
|
455
492
|
vaultBalanceList?: API.VaultBalance[];
|
|
456
493
|
displayType?: "balance" | "vaultBalance";
|
|
457
494
|
tokenBalances?: Record<string, string>;
|
|
495
|
+
tokenValueFormatter?: (value: string) => ReactNode;
|
|
496
|
+
tokenShowCaret?: boolean;
|
|
458
497
|
} & Omit<InputProps, "onClear" | "suffix" | "onValueChange">;
|
|
459
498
|
declare const QuantityInput: FC<QuantityInputProps>;
|
|
460
499
|
|
|
@@ -464,6 +503,7 @@ type AvailableQuantityProps = {
|
|
|
464
503
|
maxQuantity?: number | string;
|
|
465
504
|
onClick?: () => void;
|
|
466
505
|
loading?: boolean;
|
|
506
|
+
tooltipContent?: React.ReactNode;
|
|
467
507
|
};
|
|
468
508
|
declare const AvailableQuantity: FC<AvailableQuantityProps>;
|
|
469
509
|
|