@orderly.network/ui-transfer 2.0.0-alpha.1
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 +251 -0
- package/dist/index.d.ts +251 -0
- package/dist/index.js +44 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +15 -0
- package/dist/index.mjs.map +1 -0
- package/dist/styles.css +1 -0
- package/package.json +42 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import react__default, { FC } from 'react';
|
|
3
|
+
import { ConnectedChain, Chain } from '@orderly.network/hooks';
|
|
4
|
+
import { API, NetworkId } from '@orderly.network/types';
|
|
5
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
+
import { InputProps } from '@orderly.network/ui';
|
|
7
|
+
|
|
8
|
+
type DST = {
|
|
9
|
+
symbol: string;
|
|
10
|
+
address?: string;
|
|
11
|
+
decimals?: number;
|
|
12
|
+
chainId: number;
|
|
13
|
+
network: string;
|
|
14
|
+
};
|
|
15
|
+
declare enum DepositAction {
|
|
16
|
+
Deposit = 0,
|
|
17
|
+
Approve = 1,
|
|
18
|
+
Increase = 2
|
|
19
|
+
}
|
|
20
|
+
type InputStatus = "error" | "warning" | "success" | "default";
|
|
21
|
+
|
|
22
|
+
type Options$3 = {
|
|
23
|
+
isNativeToken: boolean;
|
|
24
|
+
allowance: string;
|
|
25
|
+
quantity: string;
|
|
26
|
+
maxQuantity: string;
|
|
27
|
+
};
|
|
28
|
+
declare function useActionType(options: Options$3): DepositAction;
|
|
29
|
+
|
|
30
|
+
type CurrentChain = Pick<ConnectedChain, "namespace"> & {
|
|
31
|
+
id: number;
|
|
32
|
+
info?: Chain;
|
|
33
|
+
};
|
|
34
|
+
declare function useChainSelect(): {
|
|
35
|
+
chains: API.NetworkInfos[];
|
|
36
|
+
currentChain: CurrentChain | null;
|
|
37
|
+
settingChain: boolean;
|
|
38
|
+
onChainChange: (chain: API.NetworkInfos) => Promise<void>;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
type Options$2 = {
|
|
42
|
+
quantity: string;
|
|
43
|
+
allowance?: string;
|
|
44
|
+
approve: (quantity?: string) => Promise<any>;
|
|
45
|
+
deposit: () => Promise<any>;
|
|
46
|
+
onSuccess?: () => void;
|
|
47
|
+
customDeposit?: () => Promise<any>;
|
|
48
|
+
enableCustomDeposit?: boolean;
|
|
49
|
+
};
|
|
50
|
+
declare function useDepositAction(options: Options$2): {
|
|
51
|
+
submitting: boolean;
|
|
52
|
+
onApprove: () => Promise<void>;
|
|
53
|
+
onDeposit: () => void;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
type Options$1 = {
|
|
57
|
+
quantity: string;
|
|
58
|
+
maxQuantity: string;
|
|
59
|
+
};
|
|
60
|
+
declare function useInputStatus(options: Options$1): {
|
|
61
|
+
inputStatus: InputStatus;
|
|
62
|
+
hintMessage: string | undefined;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
type Options = {
|
|
66
|
+
currentChain: CurrentChain | null;
|
|
67
|
+
tokensFilter?: (chainInfo: API.Chain) => API.TokenInfo[];
|
|
68
|
+
};
|
|
69
|
+
declare function useToken(options: Options): {
|
|
70
|
+
token: API.TokenInfo | undefined;
|
|
71
|
+
tokens: API.TokenInfo[];
|
|
72
|
+
onTokenChange: react.Dispatch<react.SetStateAction<API.TokenInfo | undefined>>;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
type UseDepositFormScriptReturn = ReturnType<typeof useDepositFormScript>;
|
|
76
|
+
type UseDepositFormScriptOptions = {
|
|
77
|
+
onClose?: () => void;
|
|
78
|
+
};
|
|
79
|
+
declare const useDepositFormScript: (options: UseDepositFormScriptOptions) => {
|
|
80
|
+
token: API.TokenInfo | undefined;
|
|
81
|
+
tokens: API.TokenInfo[];
|
|
82
|
+
onTokenChange: react.Dispatch<react.SetStateAction<API.TokenInfo | undefined>>;
|
|
83
|
+
amount: number;
|
|
84
|
+
quantity: string;
|
|
85
|
+
maxQuantity: string;
|
|
86
|
+
onQuantityChange: react.Dispatch<react.SetStateAction<string>>;
|
|
87
|
+
hintMessage: string | undefined;
|
|
88
|
+
inputStatus: InputStatus;
|
|
89
|
+
chains: API.NetworkInfos[];
|
|
90
|
+
currentChain: CurrentChain | null;
|
|
91
|
+
settingChain: boolean;
|
|
92
|
+
onChainChange: (chain: API.NetworkInfos) => Promise<void>;
|
|
93
|
+
actionType: DepositAction;
|
|
94
|
+
onDeposit: () => void;
|
|
95
|
+
onApprove: () => Promise<void>;
|
|
96
|
+
fetchBalance: (address: string, decimals?: number | undefined) => Promise<string>;
|
|
97
|
+
dst: {
|
|
98
|
+
symbol: string;
|
|
99
|
+
address: string | undefined;
|
|
100
|
+
decimals: number | undefined;
|
|
101
|
+
chainId: number;
|
|
102
|
+
network: string;
|
|
103
|
+
};
|
|
104
|
+
wrongNetwork: boolean;
|
|
105
|
+
balanceRevalidating: boolean;
|
|
106
|
+
loading: boolean;
|
|
107
|
+
disabled: boolean;
|
|
108
|
+
networkId: NetworkId;
|
|
109
|
+
fee: {
|
|
110
|
+
nativeSymbol: string | undefined;
|
|
111
|
+
dstGasFee: string;
|
|
112
|
+
feeQty: string;
|
|
113
|
+
feeAmount: string;
|
|
114
|
+
dp: number;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
type UseFeeReturn = ReturnType<typeof useDepositFee>;
|
|
118
|
+
declare function useDepositFee(options: {
|
|
119
|
+
nativeToken?: API.TokenInfo;
|
|
120
|
+
depositFee?: bigint;
|
|
121
|
+
}): {
|
|
122
|
+
nativeSymbol: string | undefined;
|
|
123
|
+
dstGasFee: string;
|
|
124
|
+
feeQty: string;
|
|
125
|
+
feeAmount: string;
|
|
126
|
+
dp: number;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
declare const DepositForm: FC<UseDepositFormScriptReturn>;
|
|
130
|
+
|
|
131
|
+
type DepositFormWidgetProps = UseDepositFormScriptOptions;
|
|
132
|
+
declare const DepositFormWidget: FC<DepositFormWidgetProps>;
|
|
133
|
+
|
|
134
|
+
type UseWithdrawFormScriptReturn = ReturnType<typeof useWithdrawForm>;
|
|
135
|
+
declare const useWithdrawForm: ({ onClose }: {
|
|
136
|
+
onClose: (() => void) | undefined;
|
|
137
|
+
}) => {
|
|
138
|
+
walletName: string;
|
|
139
|
+
address: string;
|
|
140
|
+
quantity: string;
|
|
141
|
+
onQuantityChange: (qty: string) => void;
|
|
142
|
+
token: API.TokenInfo;
|
|
143
|
+
inputStatus: InputStatus;
|
|
144
|
+
hintMessage: string | undefined;
|
|
145
|
+
dst: {
|
|
146
|
+
symbol: string;
|
|
147
|
+
decimals: number;
|
|
148
|
+
address: string | undefined;
|
|
149
|
+
chainId: number;
|
|
150
|
+
network: string;
|
|
151
|
+
};
|
|
152
|
+
amount: number;
|
|
153
|
+
balanceRevalidating: boolean;
|
|
154
|
+
maxQuantity: number;
|
|
155
|
+
disabled: boolean;
|
|
156
|
+
loading: boolean;
|
|
157
|
+
hasPositions: boolean;
|
|
158
|
+
unsettledPnL: number;
|
|
159
|
+
wrongNetwork: boolean;
|
|
160
|
+
settingChain: boolean;
|
|
161
|
+
chains: API.NetworkInfos[];
|
|
162
|
+
currentChain: CurrentChain | null;
|
|
163
|
+
onChainChange: (chain: API.NetworkInfos) => Promise<void>;
|
|
164
|
+
onSettlePnl: () => Promise<any>;
|
|
165
|
+
onWithdraw: () => Promise<void>;
|
|
166
|
+
chainVaultBalance: any;
|
|
167
|
+
fee: any;
|
|
168
|
+
crossChainWithdraw: boolean;
|
|
169
|
+
crossChainTrans: boolean;
|
|
170
|
+
showQty: string | number;
|
|
171
|
+
networkId: NetworkId;
|
|
172
|
+
checkIsBridgeless: boolean;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
declare const WithdrawFormUI: ({ address, loading, disabled, quantity, onQuantityChange, token, inputStatus, hintMessage, amount, maxQuantity, balanceRevalidating, chains, currentChain, onChainChange, fee, settingChain, wrongNetwork, hasPositions, unsettledPnL, onSettlePnl, onWithdraw, chainVaultBalance, crossChainWithdraw, crossChainTrans, showQty, networkId, checkIsBridgeless, }: UseWithdrawFormScriptReturn) => react_jsx_runtime.JSX.Element;
|
|
176
|
+
|
|
177
|
+
declare const DepositAndWithdrawWithDialogId = "DepositAndWithdrawWithDialogId";
|
|
178
|
+
declare const DepositAndWithdrawWithSheetId = "DepositAndWithdrawWithSheetId";
|
|
179
|
+
type DepositAndWithdrawProps = {
|
|
180
|
+
activeTab?: "deposit" | "withdraw";
|
|
181
|
+
close?: () => void;
|
|
182
|
+
};
|
|
183
|
+
declare const DepositAndWithdraw: FC<DepositAndWithdrawProps>;
|
|
184
|
+
|
|
185
|
+
declare const WithdrawFormWidget: (dialogProps: DepositAndWithdrawProps) => react_jsx_runtime.JSX.Element;
|
|
186
|
+
|
|
187
|
+
declare function installDeposit(): void;
|
|
188
|
+
|
|
189
|
+
declare function formatAddress(address?: string): string;
|
|
190
|
+
declare const getTokenByTokenList: (tokens?: API.TokenInfo[]) => any;
|
|
191
|
+
declare const feeDecimalsOffset: (origin?: number) => number;
|
|
192
|
+
|
|
193
|
+
type ChainSelectProps = {
|
|
194
|
+
chains: API.NetworkInfos[];
|
|
195
|
+
value: CurrentChain;
|
|
196
|
+
onValueChange: (chain: API.NetworkInfos) => Promise<void>;
|
|
197
|
+
wrongNetwork: boolean;
|
|
198
|
+
loading?: boolean;
|
|
199
|
+
};
|
|
200
|
+
declare const ChainSelect: React.FC<ChainSelectProps>;
|
|
201
|
+
|
|
202
|
+
declare const QuantityInput: react.ForwardRefExoticComponent<{
|
|
203
|
+
token?: API.TokenInfo | undefined;
|
|
204
|
+
tokens?: API.TokenInfo[] | undefined;
|
|
205
|
+
label?: string | undefined;
|
|
206
|
+
status?: InputStatus | undefined;
|
|
207
|
+
hintMessage?: string | undefined;
|
|
208
|
+
onValueChange?: ((value: string) => void) | undefined;
|
|
209
|
+
onTokenChange?: ((token: API.TokenInfo) => void) | undefined;
|
|
210
|
+
fetchBalance?: ((token: string, decimals: number) => Promise<any>) | undefined;
|
|
211
|
+
loading?: boolean | undefined;
|
|
212
|
+
} & Omit<InputProps<string>, "onClear" | "suffix" | "onValueChange"> & react.RefAttributes<HTMLInputElement>>;
|
|
213
|
+
|
|
214
|
+
type AvailableQuantityProps = {
|
|
215
|
+
token?: API.TokenInfo;
|
|
216
|
+
amount: number;
|
|
217
|
+
maxQuantity?: string;
|
|
218
|
+
onClick?: () => void;
|
|
219
|
+
loading?: boolean;
|
|
220
|
+
};
|
|
221
|
+
declare const AvailableQuantity: FC<AvailableQuantityProps>;
|
|
222
|
+
|
|
223
|
+
declare const Web3Wallet: FC;
|
|
224
|
+
|
|
225
|
+
declare const BrokerWallet: FC;
|
|
226
|
+
|
|
227
|
+
declare const ExchangeDivider: FC;
|
|
228
|
+
|
|
229
|
+
type SwapCoinProps = {
|
|
230
|
+
className?: string;
|
|
231
|
+
token?: API.TokenInfo;
|
|
232
|
+
dst?: DST;
|
|
233
|
+
price?: number;
|
|
234
|
+
};
|
|
235
|
+
declare const SwapCoin: FC<SwapCoinProps>;
|
|
236
|
+
|
|
237
|
+
type ActionButtonProps = {
|
|
238
|
+
disabled?: boolean;
|
|
239
|
+
loading?: boolean;
|
|
240
|
+
actionType: DepositAction;
|
|
241
|
+
symbol?: string;
|
|
242
|
+
onDeposit?: () => void;
|
|
243
|
+
onApprove?: () => void;
|
|
244
|
+
networkId?: NetworkId;
|
|
245
|
+
};
|
|
246
|
+
declare const ActionButton: react__default.FC<ActionButtonProps>;
|
|
247
|
+
|
|
248
|
+
type FeeProps = UseFeeReturn;
|
|
249
|
+
declare const Fee: FC<FeeProps>;
|
|
250
|
+
|
|
251
|
+
export { ActionButton, AvailableQuantity, BrokerWallet, ChainSelect, type CurrentChain, type DST, DepositAction, DepositAndWithdraw, type DepositAndWithdrawProps, DepositAndWithdrawWithDialogId, DepositAndWithdrawWithSheetId, DepositForm, DepositFormWidget, ExchangeDivider, Fee, type InputStatus, QuantityInput, SwapCoin, Web3Wallet, WithdrawFormUI, WithdrawFormWidget, feeDecimalsOffset, formatAddress, getTokenByTokenList, installDeposit, useActionType, useChainSelect, useDepositAction, useDepositFormScript, useInputStatus, useToken, useWithdrawForm };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,251 @@
|
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import react__default, { FC } from 'react';
|
|
3
|
+
import { ConnectedChain, Chain } from '@orderly.network/hooks';
|
|
4
|
+
import { API, NetworkId } from '@orderly.network/types';
|
|
5
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
6
|
+
import { InputProps } from '@orderly.network/ui';
|
|
7
|
+
|
|
8
|
+
type DST = {
|
|
9
|
+
symbol: string;
|
|
10
|
+
address?: string;
|
|
11
|
+
decimals?: number;
|
|
12
|
+
chainId: number;
|
|
13
|
+
network: string;
|
|
14
|
+
};
|
|
15
|
+
declare enum DepositAction {
|
|
16
|
+
Deposit = 0,
|
|
17
|
+
Approve = 1,
|
|
18
|
+
Increase = 2
|
|
19
|
+
}
|
|
20
|
+
type InputStatus = "error" | "warning" | "success" | "default";
|
|
21
|
+
|
|
22
|
+
type Options$3 = {
|
|
23
|
+
isNativeToken: boolean;
|
|
24
|
+
allowance: string;
|
|
25
|
+
quantity: string;
|
|
26
|
+
maxQuantity: string;
|
|
27
|
+
};
|
|
28
|
+
declare function useActionType(options: Options$3): DepositAction;
|
|
29
|
+
|
|
30
|
+
type CurrentChain = Pick<ConnectedChain, "namespace"> & {
|
|
31
|
+
id: number;
|
|
32
|
+
info?: Chain;
|
|
33
|
+
};
|
|
34
|
+
declare function useChainSelect(): {
|
|
35
|
+
chains: API.NetworkInfos[];
|
|
36
|
+
currentChain: CurrentChain | null;
|
|
37
|
+
settingChain: boolean;
|
|
38
|
+
onChainChange: (chain: API.NetworkInfos) => Promise<void>;
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
type Options$2 = {
|
|
42
|
+
quantity: string;
|
|
43
|
+
allowance?: string;
|
|
44
|
+
approve: (quantity?: string) => Promise<any>;
|
|
45
|
+
deposit: () => Promise<any>;
|
|
46
|
+
onSuccess?: () => void;
|
|
47
|
+
customDeposit?: () => Promise<any>;
|
|
48
|
+
enableCustomDeposit?: boolean;
|
|
49
|
+
};
|
|
50
|
+
declare function useDepositAction(options: Options$2): {
|
|
51
|
+
submitting: boolean;
|
|
52
|
+
onApprove: () => Promise<void>;
|
|
53
|
+
onDeposit: () => void;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
type Options$1 = {
|
|
57
|
+
quantity: string;
|
|
58
|
+
maxQuantity: string;
|
|
59
|
+
};
|
|
60
|
+
declare function useInputStatus(options: Options$1): {
|
|
61
|
+
inputStatus: InputStatus;
|
|
62
|
+
hintMessage: string | undefined;
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
type Options = {
|
|
66
|
+
currentChain: CurrentChain | null;
|
|
67
|
+
tokensFilter?: (chainInfo: API.Chain) => API.TokenInfo[];
|
|
68
|
+
};
|
|
69
|
+
declare function useToken(options: Options): {
|
|
70
|
+
token: API.TokenInfo | undefined;
|
|
71
|
+
tokens: API.TokenInfo[];
|
|
72
|
+
onTokenChange: react.Dispatch<react.SetStateAction<API.TokenInfo | undefined>>;
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
type UseDepositFormScriptReturn = ReturnType<typeof useDepositFormScript>;
|
|
76
|
+
type UseDepositFormScriptOptions = {
|
|
77
|
+
onClose?: () => void;
|
|
78
|
+
};
|
|
79
|
+
declare const useDepositFormScript: (options: UseDepositFormScriptOptions) => {
|
|
80
|
+
token: API.TokenInfo | undefined;
|
|
81
|
+
tokens: API.TokenInfo[];
|
|
82
|
+
onTokenChange: react.Dispatch<react.SetStateAction<API.TokenInfo | undefined>>;
|
|
83
|
+
amount: number;
|
|
84
|
+
quantity: string;
|
|
85
|
+
maxQuantity: string;
|
|
86
|
+
onQuantityChange: react.Dispatch<react.SetStateAction<string>>;
|
|
87
|
+
hintMessage: string | undefined;
|
|
88
|
+
inputStatus: InputStatus;
|
|
89
|
+
chains: API.NetworkInfos[];
|
|
90
|
+
currentChain: CurrentChain | null;
|
|
91
|
+
settingChain: boolean;
|
|
92
|
+
onChainChange: (chain: API.NetworkInfos) => Promise<void>;
|
|
93
|
+
actionType: DepositAction;
|
|
94
|
+
onDeposit: () => void;
|
|
95
|
+
onApprove: () => Promise<void>;
|
|
96
|
+
fetchBalance: (address: string, decimals?: number | undefined) => Promise<string>;
|
|
97
|
+
dst: {
|
|
98
|
+
symbol: string;
|
|
99
|
+
address: string | undefined;
|
|
100
|
+
decimals: number | undefined;
|
|
101
|
+
chainId: number;
|
|
102
|
+
network: string;
|
|
103
|
+
};
|
|
104
|
+
wrongNetwork: boolean;
|
|
105
|
+
balanceRevalidating: boolean;
|
|
106
|
+
loading: boolean;
|
|
107
|
+
disabled: boolean;
|
|
108
|
+
networkId: NetworkId;
|
|
109
|
+
fee: {
|
|
110
|
+
nativeSymbol: string | undefined;
|
|
111
|
+
dstGasFee: string;
|
|
112
|
+
feeQty: string;
|
|
113
|
+
feeAmount: string;
|
|
114
|
+
dp: number;
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
type UseFeeReturn = ReturnType<typeof useDepositFee>;
|
|
118
|
+
declare function useDepositFee(options: {
|
|
119
|
+
nativeToken?: API.TokenInfo;
|
|
120
|
+
depositFee?: bigint;
|
|
121
|
+
}): {
|
|
122
|
+
nativeSymbol: string | undefined;
|
|
123
|
+
dstGasFee: string;
|
|
124
|
+
feeQty: string;
|
|
125
|
+
feeAmount: string;
|
|
126
|
+
dp: number;
|
|
127
|
+
};
|
|
128
|
+
|
|
129
|
+
declare const DepositForm: FC<UseDepositFormScriptReturn>;
|
|
130
|
+
|
|
131
|
+
type DepositFormWidgetProps = UseDepositFormScriptOptions;
|
|
132
|
+
declare const DepositFormWidget: FC<DepositFormWidgetProps>;
|
|
133
|
+
|
|
134
|
+
type UseWithdrawFormScriptReturn = ReturnType<typeof useWithdrawForm>;
|
|
135
|
+
declare const useWithdrawForm: ({ onClose }: {
|
|
136
|
+
onClose: (() => void) | undefined;
|
|
137
|
+
}) => {
|
|
138
|
+
walletName: string;
|
|
139
|
+
address: string;
|
|
140
|
+
quantity: string;
|
|
141
|
+
onQuantityChange: (qty: string) => void;
|
|
142
|
+
token: API.TokenInfo;
|
|
143
|
+
inputStatus: InputStatus;
|
|
144
|
+
hintMessage: string | undefined;
|
|
145
|
+
dst: {
|
|
146
|
+
symbol: string;
|
|
147
|
+
decimals: number;
|
|
148
|
+
address: string | undefined;
|
|
149
|
+
chainId: number;
|
|
150
|
+
network: string;
|
|
151
|
+
};
|
|
152
|
+
amount: number;
|
|
153
|
+
balanceRevalidating: boolean;
|
|
154
|
+
maxQuantity: number;
|
|
155
|
+
disabled: boolean;
|
|
156
|
+
loading: boolean;
|
|
157
|
+
hasPositions: boolean;
|
|
158
|
+
unsettledPnL: number;
|
|
159
|
+
wrongNetwork: boolean;
|
|
160
|
+
settingChain: boolean;
|
|
161
|
+
chains: API.NetworkInfos[];
|
|
162
|
+
currentChain: CurrentChain | null;
|
|
163
|
+
onChainChange: (chain: API.NetworkInfos) => Promise<void>;
|
|
164
|
+
onSettlePnl: () => Promise<any>;
|
|
165
|
+
onWithdraw: () => Promise<void>;
|
|
166
|
+
chainVaultBalance: any;
|
|
167
|
+
fee: any;
|
|
168
|
+
crossChainWithdraw: boolean;
|
|
169
|
+
crossChainTrans: boolean;
|
|
170
|
+
showQty: string | number;
|
|
171
|
+
networkId: NetworkId;
|
|
172
|
+
checkIsBridgeless: boolean;
|
|
173
|
+
};
|
|
174
|
+
|
|
175
|
+
declare const WithdrawFormUI: ({ address, loading, disabled, quantity, onQuantityChange, token, inputStatus, hintMessage, amount, maxQuantity, balanceRevalidating, chains, currentChain, onChainChange, fee, settingChain, wrongNetwork, hasPositions, unsettledPnL, onSettlePnl, onWithdraw, chainVaultBalance, crossChainWithdraw, crossChainTrans, showQty, networkId, checkIsBridgeless, }: UseWithdrawFormScriptReturn) => react_jsx_runtime.JSX.Element;
|
|
176
|
+
|
|
177
|
+
declare const DepositAndWithdrawWithDialogId = "DepositAndWithdrawWithDialogId";
|
|
178
|
+
declare const DepositAndWithdrawWithSheetId = "DepositAndWithdrawWithSheetId";
|
|
179
|
+
type DepositAndWithdrawProps = {
|
|
180
|
+
activeTab?: "deposit" | "withdraw";
|
|
181
|
+
close?: () => void;
|
|
182
|
+
};
|
|
183
|
+
declare const DepositAndWithdraw: FC<DepositAndWithdrawProps>;
|
|
184
|
+
|
|
185
|
+
declare const WithdrawFormWidget: (dialogProps: DepositAndWithdrawProps) => react_jsx_runtime.JSX.Element;
|
|
186
|
+
|
|
187
|
+
declare function installDeposit(): void;
|
|
188
|
+
|
|
189
|
+
declare function formatAddress(address?: string): string;
|
|
190
|
+
declare const getTokenByTokenList: (tokens?: API.TokenInfo[]) => any;
|
|
191
|
+
declare const feeDecimalsOffset: (origin?: number) => number;
|
|
192
|
+
|
|
193
|
+
type ChainSelectProps = {
|
|
194
|
+
chains: API.NetworkInfos[];
|
|
195
|
+
value: CurrentChain;
|
|
196
|
+
onValueChange: (chain: API.NetworkInfos) => Promise<void>;
|
|
197
|
+
wrongNetwork: boolean;
|
|
198
|
+
loading?: boolean;
|
|
199
|
+
};
|
|
200
|
+
declare const ChainSelect: React.FC<ChainSelectProps>;
|
|
201
|
+
|
|
202
|
+
declare const QuantityInput: react.ForwardRefExoticComponent<{
|
|
203
|
+
token?: API.TokenInfo | undefined;
|
|
204
|
+
tokens?: API.TokenInfo[] | undefined;
|
|
205
|
+
label?: string | undefined;
|
|
206
|
+
status?: InputStatus | undefined;
|
|
207
|
+
hintMessage?: string | undefined;
|
|
208
|
+
onValueChange?: ((value: string) => void) | undefined;
|
|
209
|
+
onTokenChange?: ((token: API.TokenInfo) => void) | undefined;
|
|
210
|
+
fetchBalance?: ((token: string, decimals: number) => Promise<any>) | undefined;
|
|
211
|
+
loading?: boolean | undefined;
|
|
212
|
+
} & Omit<InputProps<string>, "onClear" | "suffix" | "onValueChange"> & react.RefAttributes<HTMLInputElement>>;
|
|
213
|
+
|
|
214
|
+
type AvailableQuantityProps = {
|
|
215
|
+
token?: API.TokenInfo;
|
|
216
|
+
amount: number;
|
|
217
|
+
maxQuantity?: string;
|
|
218
|
+
onClick?: () => void;
|
|
219
|
+
loading?: boolean;
|
|
220
|
+
};
|
|
221
|
+
declare const AvailableQuantity: FC<AvailableQuantityProps>;
|
|
222
|
+
|
|
223
|
+
declare const Web3Wallet: FC;
|
|
224
|
+
|
|
225
|
+
declare const BrokerWallet: FC;
|
|
226
|
+
|
|
227
|
+
declare const ExchangeDivider: FC;
|
|
228
|
+
|
|
229
|
+
type SwapCoinProps = {
|
|
230
|
+
className?: string;
|
|
231
|
+
token?: API.TokenInfo;
|
|
232
|
+
dst?: DST;
|
|
233
|
+
price?: number;
|
|
234
|
+
};
|
|
235
|
+
declare const SwapCoin: FC<SwapCoinProps>;
|
|
236
|
+
|
|
237
|
+
type ActionButtonProps = {
|
|
238
|
+
disabled?: boolean;
|
|
239
|
+
loading?: boolean;
|
|
240
|
+
actionType: DepositAction;
|
|
241
|
+
symbol?: string;
|
|
242
|
+
onDeposit?: () => void;
|
|
243
|
+
onApprove?: () => void;
|
|
244
|
+
networkId?: NetworkId;
|
|
245
|
+
};
|
|
246
|
+
declare const ActionButton: react__default.FC<ActionButtonProps>;
|
|
247
|
+
|
|
248
|
+
type FeeProps = UseFeeReturn;
|
|
249
|
+
declare const Fee: FC<FeeProps>;
|
|
250
|
+
|
|
251
|
+
export { ActionButton, AvailableQuantity, BrokerWallet, ChainSelect, type CurrentChain, type DST, DepositAction, DepositAndWithdraw, type DepositAndWithdrawProps, DepositAndWithdrawWithDialogId, DepositAndWithdrawWithSheetId, DepositForm, DepositFormWidget, ExchangeDivider, Fee, type InputStatus, QuantityInput, SwapCoin, Web3Wallet, WithdrawFormUI, WithdrawFormWidget, feeDecimalsOffset, formatAddress, getTokenByTokenList, installDeposit, useActionType, useChainSelect, useDepositAction, useDepositFormScript, useInputStatus, useToken, useWithdrawForm };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var ui = require('@orderly.network/ui');
|
|
4
|
+
var react = require('react');
|
|
5
|
+
var utils = require('@orderly.network/utils');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var hooks = require('@orderly.network/hooks');
|
|
8
|
+
var reactApp = require('@orderly.network/react-app');
|
|
9
|
+
var uiConnector = require('@orderly.network/ui-connector');
|
|
10
|
+
var types = require('@orderly.network/types');
|
|
11
|
+
var uiChainSelector = require('@orderly.network/ui-chain-selector');
|
|
12
|
+
|
|
13
|
+
function gt(e,o){let[n,t]=react.useState(""),[r,a]=react.useState(!1);return react.useEffect(()=>{r||typeof o!="function"||(a(!0),o(e.address,e.decimals).then(i=>{t(i);}).catch(i=>{}).finally(()=>{a(!1);}));},[e]),{balance:n,loading:r}}var Ct=e=>{let{token:o,isActive:n,onTokenChange:t,fetchBalance:r}=e,{symbol:a,precision:i,decimals:s}=o,{balance:l,loading:c}=gt(o,r),m=typeof r=="function",w=i??2,h=()=>m?c?jsxRuntime.jsx(ui.Spinner,{size:"sm"}):jsxRuntime.jsx(ui.Text.numeral,{rule:"price",dp:w,rm:utils.Decimal.ROUND_DOWN,className:ui.cn("oui-text-base-contrast-80 group-hover:oui-text-base-contrast-54",n&&"oui-text-base-contrast-54"),children:l}):null;return jsxRuntime.jsxs(ui.Flex,{justify:"between",px:2,r:"base",className:ui.cn("group","oui-h-[30px] hover:oui-bg-base-5","oui-text-2xs oui-font-semibold","oui-cursor-pointer",n&&"oui-bg-base-5",e.index!==0&&"oui-mt-[2px]"),onClick:()=>{t?.(o);},children:[jsxRuntime.jsxs(ui.Flex,{gapX:1,children:[jsxRuntime.jsx(ui.TokenIcon,{name:a,className:"oui-w-[16px] oui-h-[16px]"}),jsxRuntime.jsx(ui.Text,{className:ui.cn("oui-text-base-contrast-54 group-hover:oui-text-base-contrast-80",n&&"oui-text-base-contrast-80"),children:a})]}),h()]},a)};var L=react.forwardRef((e,o)=>{let{token:n,tokens:t=[],classNames:r,label:a,status:i,hintMessage:s,value:l,onValueChange:c,onTokenChange:m,fetchBalance:w,loading:h,placeholder:f,...p}=e,d=react.useRef(null),[b,I]=react.useState(!1),[N,T]=react.useState(0),v=react.useMemo(()=>t.map(g=>({...g,name:g.display_name||g.symbol})),[t]);react.useEffect(()=>{let g=d?.current?.getBoundingClientRect();T(g?.width||0);},[d]);let S=g=>{let V=t.find(q=>q.symbol===g);V&&m?.(V);},F=g=>{let V=g.symbol===n?.symbol;return jsxRuntime.jsx(Ct,{token:g,fetchBalance:w,onTokenChange:q=>{m?.(q),I(!1);},isActive:V})},A=jsxRuntime.jsxs(ui.Box,{children:[jsxRuntime.jsx(ui.Box,{className:"oui-absolute oui-top-0",children:jsxRuntime.jsx(ui.Text,{size:"2xs",intensity:36,children:a||"Quantity"})}),h&&jsxRuntime.jsx(ui.Box,{className:"oui-absolute oui-bottom-1",children:jsxRuntime.jsx(ui.Spinner,{size:"sm"})})]}),U=t.length>1,E=jsxRuntime.jsx("div",{className:"oui-absolute oui-right-0",children:jsxRuntime.jsx(ui.Select.tokens,{open:U?b:!1,onOpenChange:I,disabled:p.disabled,variant:"text",tokens:v,value:n?.display_name||n?.symbol,size:p.size,onValueChange:S,showIcon:!0,optionRenderer:F,contentProps:{onCloseAutoFocus:g=>{g.preventDefault(),d.current?.focus();},onClick:g=>{g.preventDefault(),d.current?.focus();},style:{width:N},align:"end",sideOffset:5,className:"oui-border oui-border-line-6"}})}),z=jsxRuntime.jsxs(ui.Flex,{mt:1,gapX:1,px:1,children:[jsxRuntime.jsx(ui.Box,{width:4,height:4,r:"full",className:ui.cn(i==="error"&&"oui-bg-danger-light",i==="warning"&&"oui-bg-warning-light")}),jsxRuntime.jsx(ui.Text,{size:"2xs",className:ui.cn(i==="error"&&"oui-text-danger-light",i==="warning"&&"oui-text-warning-light"),children:s})]});return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ui.Input,{"data-testid":"oui-testid-withdraw_deposit-dialog-quantity-input",ref:d,autoComplete:"off",placeholder:f??(h?"":"0"),prefix:A,suffix:E,value:l,onValueChange:g=>{e.onValueChange?.(g);},formatters:[ui.inputFormatter.numberFormatter,ui.inputFormatter.dpFormatter(n?.precision??2),ui.inputFormatter.currencyFormatter],...p,classNames:{...r,root:ui.cn("oui-h-[54px] oui-relative oui-px-3","oui-bg-base-5 oui-rounded-lg","oui-border oui-border-line",i==="error"&&"focus-within:oui-outline-danger-light oui-outline-danger-light",i==="warning"&&"focus-within:oui-outline-warning-light oui-outline-warning-light",e.readOnly?"oui-bg-base-6 focus-within:oui-outline-0":"oui-bg-base-5",r?.root),input:ui.cn("oui-absolute oui-bottom-0",r?.input)}}),s&&z]})});var It=e=>jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:jsxRuntime.jsx("path",{d:"M10.997 8.004a.5.5 0 0 0-.14-.36l-1.86-1.843-.703.703.984 1h-7.28a.5.5 0 0 0 0 1h7.28l-.984 1 .703.703 1.86-1.844a.5.5 0 0 0 .14-.36m-.5-4a.5.5 0 0 0-.5-.5H2.716l.984-1-.703-.703-1.859 1.843a.515.515 0 0 0 0 .719l1.86 1.844.702-.703-.984-1h7.281a.5.5 0 0 0 .5-.5"})}),vt=e=>jsxRuntime.jsx("svg",{width:"20",height:"21",viewBox:"0 0 20 21",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:jsxRuntime.jsx("path",{d:"M9.994 5.51a.83.83 0 0 0-.832.833v6.295l-2.498-2.471-1.17 1.17 3.902 3.929a.84.84 0 0 0 .599.244.84.84 0 0 0 .597-.244l3.903-3.928-1.171-1.171-2.498 2.471V6.343a.83.83 0 0 0-.832-.833"})});var Ft=e=>jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:jsxRuntime.jsx("path",{d:"M3.496 1.495a2 2 0 0 0-2 2v5a2 2 0 0 0 2 2h5a2 2 0 0 0 2-2v-5a2 2 0 0 0-2-2zm2.5 2a.5.5 0 0 1 .5.5v2.5h1.5l-2 2-2-2h1.5v-2.5a.5.5 0 0 1 .5-.5"})}),Tt=e=>jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"currentColor",xmlns:"http://www.w3.org/2000/svg",...e,children:jsxRuntime.jsx("path",{d:"M3.495 10.495a2 2 0 0 1-2-2v-5a2 2 0 0 1 2-2h5a2 2 0 0 1 2 2v5a2 2 0 0 1-2 2zm2.5-2a.5.5 0 0 0 .5-.5v-2.5h1.5l-2-2-2 2h1.5v2.5a.5.5 0 0 0 .5.5"})}),St=e=>jsxRuntime.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:jsxRuntime.jsx("path",{d:"M6.00342 1.49561C4.97642 1.49561 3.99542 1.84011 3.20642 2.46461C2.98992 2.63561 2.95692 2.9511 3.12842 3.1676C3.29992 3.3841 3.61492 3.4171 3.83142 3.2456C4.44492 2.7601 5.20392 2.4956 6.00342 2.4956C7.93642 2.4956 9.50342 4.0626 9.50342 5.9956H8.50342L10.0034 7.9956L11.5034 5.9956H10.5034C10.5034 3.5101 8.48892 1.49561 6.00342 1.49561ZM2.00342 3.9956L0.503418 5.9956H1.50342C1.50342 8.4811 3.51792 10.4956 6.00342 10.4956C7.03092 10.4956 8.01142 10.1516 8.80042 9.52659C9.01692 9.35559 9.04992 9.0401 8.87842 8.8236C8.70692 8.6071 8.39191 8.5741 8.17542 8.7456C7.56142 9.2316 6.80342 9.4956 6.00342 9.4956C4.07042 9.4956 2.50342 7.9286 2.50342 5.9956H3.50342L2.00342 3.9956Z",fill:"#608CFF"})});var se=e=>{let{chains:o,value:n,wrongNetwork:t,loading:r}=e,[a,i]=react.useState(!1),s=t||o?.length>1,l=t?jsxRuntime.jsx(ui.Flex,{width:18,height:18,intensity:100,r:"full",justify:"center",itemAlign:"center",children:jsxRuntime.jsx(ui.Text,{size:"2xs",intensity:80,children:"U"})}):jsxRuntime.jsx(ui.ChainIcon,{className:"oui-w-[18px] oui-h-[18px]",chainId:n?.id}),c=t?"Unknown":n?.info?.network_infos?.name,m=()=>{if(r)return jsxRuntime.jsx(ui.Spinner,{size:"sm"});if(s)return jsxRuntime.jsx(It,{className:"oui-text-base-contrast-54"})},w=jsxRuntime.jsxs(ui.Flex,{intensity:600,className:ui.cn("oui-rounded-t-xl oui-rounded-b-sm oui-border oui-border-line",s?"oui-cursor-pointer":"oui-cursor-auto"),height:54,px:3,justify:"between",itemAlign:"center",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(ui.Flex,{children:jsxRuntime.jsx(ui.Text,{size:"2xs",intensity:54,children:"Network"})}),jsxRuntime.jsxs(ui.Flex,{gapX:1,children:[l,jsxRuntime.jsx(ui.Text,{size:"sm",intensity:80,children:c})]})]}),m()]}),h=o.map((f,p)=>{let d=f.chain_id===n?.id;return jsxRuntime.jsxs(ui.Flex,{px:2,r:"base",justify:"between",className:ui.cn("oui-deposit-network-select-item","hover:oui-bg-base-5 oui-h-[30px] oui-cursor-pointer",d&&"oui-bg-base-5",p!==0&&"oui-mt-[2px]"),onClick:async()=>{i(!1),await e.onValueChange(f);},children:[jsxRuntime.jsxs(ui.Flex,{gapX:1,itemAlign:"center",children:[jsxRuntime.jsx(ui.ChainIcon,{className:"oui-w-[18px] oui-h-[18px]",chainId:f.chain_id}),jsxRuntime.jsx(ui.Text,{size:"2xs",intensity:54,children:f.name}),f.bridgeless&&jsxRuntime.jsx(ui.Flex,{className:"oui-bg-success-light/15",height:18,px:2,r:"base",justify:"center",itemAlign:"center",children:jsxRuntime.jsx(ui.Text,{size:"2xs",className:"oui-text-success-light",children:"lowest fee"})})]}),d&&jsxRuntime.jsx(ui.Box,{width:4,height:4,r:"full",className:"oui-deposit-network-select-active-dot oui-bg-[linear-gradient(270deg,#59B0FE_0%,#26FEFE_100%)]"})]},f.chain_id)});return jsxRuntime.jsxs(ui.DropdownMenuRoot,{open:s?a:!1,onOpenChange:i,children:[jsxRuntime.jsx(ui.DropdownMenuTrigger,{asChild:!0,children:w}),jsxRuntime.jsx(ui.DropdownMenuPortal,{children:jsxRuntime.jsx(ui.DropdownMenuContent,{onCloseAutoFocus:f=>f.preventDefault(),align:"start",sideOffset:2,className:ui.cn("oui-deposit-token-select-dropdown-menu-content","oui-bg-base-8 oui-p-1","oui-w-[var(--radix-dropdown-menu-trigger-width)]","oui-rounded-md oui-select-none"),children:jsxRuntime.jsx(ui.ScrollArea,{children:jsxRuntime.jsxs("div",{className:"oui-max-h-[254px]",children:[h," "]})})})})]})};var ae=()=>jsxRuntime.jsxs(ui.Flex,{height:40,gapX:3,children:[jsxRuntime.jsx(ui.Flex,{height:1,className:"oui-bg-base-contrast-12 oui-flex-1"}),jsxRuntime.jsx(vt,{className:"oui-text-primary-light"}),jsxRuntime.jsx(ui.Flex,{height:1,className:"oui-bg-base-contrast-12 oui-flex-1"})]});function Dt(e){return e?e.replace(/^(.{6})(.*)(.{4})$/,"$1......$3"):"--"}var Nt=(e=[])=>{let o=e.reduce((n,t)=>(n[t.symbol]=t,n),{});return o.USDC||o.USDbC||e[0]},At=e=>(e??2)+3;var le=()=>{let{wallet:e}=hooks.useWalletConnector(),{walletName:o,address:n}=react.useMemo(()=>({walletName:e?.label,address:Dt(e?.accounts?.[0].address)}),[e]);return jsxRuntime.jsxs(ui.Flex,{justify:"between",children:[jsxRuntime.jsx(ui.Text,{size:"sm",children:"Your Web3 Wallet"}),jsxRuntime.jsxs(ui.Flex,{gapX:1,children:[jsxRuntime.jsx(ui.WalletIcon,{size:"xs",name:o}),jsxRuntime.jsx(ui.Text,{size:"sm",intensity:54,children:n})]})]})};var ue=()=>{let{appIcons:e}=reactApp.useAppConfig(),o=hooks.useConfig("brokerName"),n=react.useMemo(()=>{let{secondary:t}=e||{};if(!t?.img&&t?.component)return null;if(t?.img)return jsxRuntime.jsx("img",{src:t?.img,className:"oui-w-5 oui-h-5"});if(t?.component)return jsxRuntime.jsx(jsxRuntime.Fragment,{children:t.component})},[e]);return jsxRuntime.jsxs(ui.Flex,{justify:"between",children:[jsxRuntime.jsx(ui.Text,{size:"sm",children:`Your ${o} account`}),n]})};var me=e=>{let{amount:o,maxQuantity:n,token:t,loading:r}=e,a=t?.display_name||t?.symbol||"",i=t?.precision??2;return jsxRuntime.jsxs(ui.Flex,{justify:"between",px:2,children:[jsxRuntime.jsxs(ui.Text,{size:"2xs",intensity:36,children:["$",jsxRuntime.jsx(ui.Text.numeral,{dp:2,padding:!1,rm:utils.Decimal.ROUND_DOWN,children:o})]}),jsxRuntime.jsxs(ui.Flex,{gapX:2,children:[jsxRuntime.jsxs(ui.Text,{size:"2xs",intensity:36,children:["Available:"," ",jsxRuntime.jsx(ui.Text.numeral,{rm:utils.Decimal.ROUND_DOWN,dp:i,padding:!1,"data-testid":"oui-testid-withdraw_deposit-dialog-available-value",children:n})," ",a]}),r&&jsxRuntime.jsx(ui.Spinner,{size:"sm"}),jsxRuntime.jsx(ui.Text,{size:"2xs",color:"primaryLight",className:"oui-cursor-pointer oui-select-none",onClick:e.onClick,children:"Max"})]})]})};var Qe=e=>{let{token:o,dst:n,price:t}=e,r=o?.display_name||o?.symbol||"USDC";return jsxRuntime.jsx(ui.Flex,{children:jsxRuntime.jsxs(ui.Text,{size:"xs",intensity:36,className:e.className,children:[jsxRuntime.jsx(ui.Text,{size:"xs",intensity:80,children:"1"}),` ${r} = `,t?jsxRuntime.jsx(ui.Text.numeral,{size:"xs",intensity:80,dp:3,padding:!1,children:t}):"-",` ${n?.symbol}`]})})};var Ge=e=>{let{dstGasFee:o,feeQty:n,feeAmount:t,dp:r,nativeSymbol:a}=e,i=()=>{let l=jsxRuntime.jsxs("div",{className:"oui-text-2xs",children:[jsxRuntime.jsxs(ui.Flex,{gapX:1,children:[jsxRuntime.jsx(ui.Text,{intensity:54,children:"Destination gas fee:"}),jsxRuntime.jsx(ui.Text.numeral,{intensity:80,dp:r,rm:utils.Decimal.ROUND_UP,padding:!1,children:n}),jsxRuntime.jsx(ui.Text,{intensity:54,children:a})]}),jsxRuntime.jsx(ui.Box,{mt:2,children:jsxRuntime.jsx(ui.Text,{intensity:36,children:"Additional gas tokens are required to cover operations on the destination chain."})})]});ui.modal.alert({title:"Fee",message:l});},s=!!o&&o!=="0";return jsxRuntime.jsxs(ui.Text,{size:"xs",intensity:36,className:"oui-border-dashed oui-border-b oui-border-line-12 oui-cursor-pointer",onClick:i,children:["Fee \u2248 ",jsxRuntime.jsxs(ui.Text,{size:"xs",intensity:80,children:["$",jsxRuntime.jsx(ui.Text.numeral,{dp:2,padding:!1,rm:utils.Decimal.ROUND_UP,children:t})," "]}),s&&jsxRuntime.jsxs("span",{children:["(",jsxRuntime.jsxs(ui.Text,{intensity:54,children:[jsxRuntime.jsx(ui.Text.numeral,{dp:r,padding:!1,rm:utils.Decimal.ROUND_UP,children:n}),a]}),")"]})]})};var Le=(t=>(t[t.Deposit=0]="Deposit",t[t.Approve=1]="Approve",t[t.Increase=2]="Increase",t))(Le||{});var He=e=>{let{disabled:o,loading:n,actionType:t,symbol:r="USDC",onDeposit:a,onApprove:i,networkId:s}=e,l=react.useMemo(()=>({1:{children:`Approve ${r}`,onClick:i,disabled:!1,"data-testid":"oui-testid-deposit-dialog-approve-btn"},2:{children:`increase ${r} authorized amount`,onClick:i,"data-testid":"oui-testid-deposit-dialog-increase-btn"},0:{children:"Deposit",onClick:a,"data-testid":"oui-testid-deposit-dialog-deposit-btn"}})[t],[i,a,t,r]);return jsxRuntime.jsx(ui.Box,{className:"oui-min-w-[184px]",children:jsxRuntime.jsx(uiConnector.AuthGuard,{networkId:s,buttonProps:{fullWidth:!0},children:jsxRuntime.jsx(ui.Button,{fullWidth:!0,disabled:o,loading:n,...l})})})};var Ye=e=>{let{token:o,tokens:n,onTokenChange:t,amount:r,quantity:a,maxQuantity:i,onQuantityChange:s,hintMessage:l,inputStatus:c,chains:m,currentChain:w,settingChain:h,onChainChange:f,actionType:p,onDeposit:d,onApprove:b,fetchBalance:I,dst:N,wrongNetwork:T,balanceRevalidating:v,loading:S,disabled:F,networkId:A,fee:U}=e;return jsxRuntime.jsxs(ui.Box,{id:"oui-deposit-form",className:ui.textVariants({weight:"semibold"}),children:[jsxRuntime.jsx(le,{}),jsxRuntime.jsxs(ui.Box,{mt:3,mb:1,children:[jsxRuntime.jsx(se,{chains:m,value:w,onValueChange:f,wrongNetwork:T,loading:h}),jsxRuntime.jsx(L,{classNames:{root:"oui-mt-[2px] oui-rounded-t-sm oui-rounded-b-xl"},value:a,onValueChange:s,tokens:n,token:o,onTokenChange:t,status:c,hintMessage:l,fetchBalance:I})]}),jsxRuntime.jsx(me,{token:o,amount:r,maxQuantity:i,loading:v,onClick:()=>{s(i);}}),jsxRuntime.jsx(ae,{}),jsxRuntime.jsx(ue,{}),jsxRuntime.jsx(L,{readOnly:!0,token:N,value:a,classNames:{root:"oui-mt-3 oui-border-transparent focus-within:oui-outline-transparent"}}),jsxRuntime.jsxs(ui.Flex,{direction:"column",mt:1,gapY:1,itemAlign:"start",children:[jsxRuntime.jsx(Qe,{token:o,dst:N,price:1}),jsxRuntime.jsx(Ge,{...U})]}),jsxRuntime.jsx(ui.Flex,{justify:"center",mt:8,children:jsxRuntime.jsx(He,{actionType:p,symbol:o?.symbol,disabled:F,loading:S,onDeposit:d,onApprove:b,networkId:A})})]})};function Je(e){let{isNativeToken:o,allowance:n,quantity:t,maxQuantity:r}=e;return react.useMemo(()=>{let i=o?Number.MAX_VALUE:Number(n);if(i<=0)return 1;let s=Number(t),l=Number(r);return i<s&&s<=l?2:0},[o,n,t,r])}function je(){let e=hooks.useConfig("networkId"),{connectedChain:o,settingChain:n,setChain:t}=hooks.useWalletConnector(),[r,{findByChainId:a}]=hooks.useChains(e,{pick:"network_infos",filter:l=>l.network_infos?.bridge_enable||l.network_infos?.bridgeless}),i=react.useMemo(()=>{if(!o)return null;let l=utils.praseChainIdToNumber(o.id),c=a(l);return {...o,id:l,info:c}},[o,a]),s=react.useCallback(async l=>{let c=a(l.chain_id);return !c||c.network_infos?.chain_id===i?.id?Promise.resolve():t({chainId:utils.int2hex(Number(c.network_infos?.chain_id))}).then(m=>{m?ui.toast.success("Network switched"):ui.toast.error("Switch chain failed");}).catch(m=>{ui.toast.error(`Switch chain failed: ${m.message}`);})},[i,t,a]);return {chains:r,currentChain:i,settingChain:n,onChainChange:s}}function et(e){let{quantity:o,allowance:n,approve:t,deposit:r,enableCustomDeposit:a,customDeposit:i,onSuccess:s}=e,[l,c]=react.useState(!1),m=hooks.useEventEmitter(),w=react.useCallback(async()=>{if(!l)return c(!0),t(o).then(p=>{ui.toast.success("Approve success");}).catch(p=>{ui.toast.error(p?.errorCode||"Approve failed");}).finally(()=>{c(!1);})},[t,l,o,n]),h=react.useCallback(async()=>r().then(p=>{ui.toast.success("Deposit requested"),m.emit("deposit:requested"),s?.();}).catch(p=>{ui.toast.error(p?.errorCode||"Deposit failed");}),[r,s,m]),f=react.useCallback(()=>{let p=Number(o);if(isNaN(p)||p<=0){ui.toast.error("Please input a valid number");return}if(l)return;c(!0),(a?i:h)?.()?.finally(()=>{c(!1);});},[o,l,h,a,i]);return {submitting:l,onApprove:w,onDeposit:f}}function tt(e){let{quantity:o,maxQuantity:n}=e,[t,r]=react.useState("default"),[a,i]=react.useState();return react.useEffect(()=>{if(!o){r("default"),i("");return}new utils.Decimal(o).gt(n)?(r("error"),i("Insufficient balance")):(r("default"),i(""));},[o,n]),{inputStatus:t,hintMessage:a}}function ot(e){let{currentChain:o,tokensFilter:n}=e,[t,r]=react.useState(),[a,i]=react.useState([]),s=react.useCallback(l=>{if(l&&l?.token_infos?.length>0){let c=typeof n=="function"?n(l):l.token_infos;i(c);let m=Nt(c);if(!m)return;r(m);}},[n]);return react.useEffect(()=>{s(o?.info);},[o?.id,s]),{token:t,tokens:a,onTokenChange:r}}var rt=e=>{let{wrongNetwork:o}=reactApp.useAppContext(),n=hooks.useConfig("networkId"),{chains:t,currentChain:r,settingChain:a,onChainChange:i}=je(),{token:s,tokens:l,onTokenChange:c}=ot({currentChain:r}),{dst:m,balance:w,allowance:h,depositFeeRevalidating:f,depositFee:p,quantity:d,setQuantity:b,approve:I,deposit:N,isNativeToken:T,balanceRevalidating:v,fetchBalance:S}=hooks.useDeposit({address:s?.address,decimals:s?.decimals,srcChainId:r?.id,srcToken:s?.symbol}),F=react.useMemo(()=>new utils.Decimal(w||0).todp(s?.precision??2,utils.Decimal.ROUND_DOWN).toString(),[w,s]),{inputStatus:A,hintMessage:U}=tt({quantity:d,maxQuantity:F}),E=()=>{b("");},z=react.useCallback(()=>{E(),e.onClose?.();},[e.onClose]),{submitting:ge,onApprove:g,onDeposit:V}=et({quantity:d,allowance:h,approve:I,deposit:N,onSuccess:z}),q=ge||f,ct=!d||Number(d)===0||!s||A==="error"||f,W=react.useMemo(()=>new utils.Decimal(d||0).mul(1).toNumber(),[d]),mt=Je({isNativeToken:T,allowance:h,quantity:d,maxQuantity:F}),pt=Pn({nativeToken:r?.info?.nativeToken,depositFee:p});return react.useEffect(()=>{E();},[s,r?.id]),{token:s,tokens:l,onTokenChange:c,amount:W,quantity:d,maxQuantity:F,onQuantityChange:b,hintMessage:U,inputStatus:A,chains:t,currentChain:r,settingChain:a,onChainChange:i,actionType:mt,onDeposit:V,onApprove:g,fetchBalance:S,dst:m,wrongNetwork:o,balanceRevalidating:v,loading:q,disabled:ct,networkId:n,fee:pt}};function Pn(e){let{nativeToken:o,depositFee:n=0}=e,{account:t}=hooks.useAccount(),r=o?.symbol,{data:a}=hooks.useIndexPrice(`SPOT_${r}_USDC`);return {...react.useMemo(()=>{let s=new utils.Decimal(n.toString()).div(new utils.Decimal(10).pow(t.walletAdapter?.chainNamespace===types.ChainNamespace.solana?9:18)).toString(),l=new utils.Decimal(s).mul(a||0).toString();return {dstGasFee:s,feeQty:s,feeAmount:l,dp:At(4)}},[n,a]),nativeSymbol:r}}var Fe=e=>{let o=rt(e);return jsxRuntime.jsx(Ye,{...o})};var Gt=({checkIsBridgeless:e,quantity:o,chainVaultBalance:n,currentChain:t,maxAmount:r,crossChainTrans:a})=>{let{wrongNetwork:i}=reactApp.useAppContext(),{state:s}=hooks.useAccount(),l=react.useMemo(()=>{if(t&&t.info&&t.info.network_infos)return t.info.network_infos.name},[t]),c=react.useMemo(()=>!n||!r||!o||new utils.Decimal(o).gt(r)?!1:!!new utils.Decimal(o).gt(n),[o,n]);return jsxRuntime.jsx(ui.Flex,{className:"oui-text-warning oui-text-xs oui-text-center",children:(()=>{if(s.status===types.AccountStatusEnum.NotConnected)return jsxRuntime.jsx(jsxRuntime.Fragment,{});if(i||!e)return jsxRuntime.jsxs(ui.Box,{children:["Withdrawals are not supported on ",l??"this chain",". Please switch to any of the bridgeless networks."]});if(a)return "Your cross-chain withdrawal is being processed...";if(c)return `Withdrawal exceeds the balance of the ${l} vault ( ${n} USDC ). Cross-chain rebalancing fee will be charged for withdrawal to ${l}.`})()})};var Lt=({hasPositions:e,unsettledPnl:o,onSettlle:n})=>{if(o===0&&!e)return jsxRuntime.jsx(jsxRuntime.Fragment,{});let t=()=>{ui.modal.confirm({title:"Settle PnL",content:jsxRuntime.jsxs(ui.Box,{children:["Are you sure you want to settle your PnL?",jsxRuntime.jsx("br",{})," Settlement will take up to 1 minute before you can withdraw your available balance."]}),onOk:()=>n()});};return jsxRuntime.jsxs(ui.Flex,{justify:"between",className:"oui-text-2xs oui-text-base-contrast-36 oui-mt-1 oui-mx-2",children:[jsxRuntime.jsxs(ui.Flex,{itemAlign:"center",justify:"start",gap:1,children:[jsxRuntime.jsx(ui.Tooltip,{className:"oui-max-w-[274px]",content:"Unsettled balance can not be withdrawn. In order to withdraw, please settle your balance first.",children:jsxRuntime.jsxs(ui.Flex,{itemAlign:"center",justify:"start",gap:1,children:[jsxRuntime.jsx(ui.ExclamationFillIcon,{size:14,className:"oui-text-warning"}),jsxRuntime.jsx(ui.Text,{className:"oui-border-dashed oui-border-b oui-border-line-12 oui-cursor-pointer",children:"Unsettled:"})]})}),jsxRuntime.jsx(ui.Text.numeral,{showIdentifier:!0,coloring:!0,weight:"semibold",dp:6,"data-testid":"oui-testid-withdraw-dialog-unsettledPnl-value",children:o}),jsxRuntime.jsx(ui.Text,{children:"USDC"})]}),jsxRuntime.jsxs(ui.Flex,{itemAlign:"center",gap:1,className:"oui-cursor-pointer",children:[jsxRuntime.jsx(St,{}),jsxRuntime.jsx(ui.Text,{"data-testid":"oui-testid-withdraw-dialog-settle-text",size:"2xs",color:"primaryLight",className:" oui-select-none",onClick:t,children:"Settle"})]})]})};var $t=({address:e,amount:o,currentChain:n})=>{let t=react.useMemo(()=>{if(n&&n.info&&n.info.network_infos)return n.info.network_infos.name},[n]);return jsxRuntime.jsxs(ui.Flex,{direction:"column",itemAlign:"start",justify:"start",gap:3,children:[jsxRuntime.jsxs(ui.Flex,{direction:"column",itemAlign:"start",gap:3,mb:5,children:[jsxRuntime.jsxs(ui.Flex,{direction:"column",justify:"start",itemAlign:"start",children:[jsxRuntime.jsx(ui.Text,{size:"2xs",intensity:36,children:"Recipient address"}),jsxRuntime.jsx(ui.Text,{size:"sm",intensity:98,children:e})]}),jsxRuntime.jsxs(ui.Flex,{direction:"column",justify:"start",itemAlign:"start",children:[jsxRuntime.jsx(ui.Text,{size:"2xs",intensity:36,children:"Recipient network"}),jsxRuntime.jsxs(ui.Flex,{gap:1,children:[jsxRuntime.jsx(ui.ChainIcon,{className:"oui-h-[18px] oui-w-[18px]",size:"sm",chainId:n.id}),jsxRuntime.jsx(ui.Text,{size:"sm",intensity:98,children:t})]})]}),jsxRuntime.jsxs(ui.Flex,{direction:"column",justify:"start",itemAlign:"start",children:[jsxRuntime.jsx(ui.Text,{size:"2xs",intensity:36,children:"Withdraw amount (USDC)"}),jsxRuntime.jsx(ui.Text.numeral,{size:"sm",intensity:98,dp:2,children:o})]})]}),jsxRuntime.jsx(ui.Flex,{justify:"center",className:"oui-text-warning oui-text-xs oui-text-center",children:"Withdrawals that require cross-chain rebalancing can't be cancelled or followed up with more withdrawals until they've been processed."})]})};function it(e){hooks.useAccount();let n=()=>{ui.modal.show(uiChainSelector.ChainSelectorId,{networkId:e.networkId,bridgeLessOnly:!0}).then(t=>{ui.toast.success("Network switched");},t=>{});};return jsxRuntime.jsx(ui.Flex,{direction:"column",children:jsxRuntime.jsx(ui.Button,{color:"warning",onClick:()=>{n();},children:"Switch Network"})})}var Xt=e=>{let{disabled:o,loading:n,onWithdraw:t,networkId:r,crossChainWithdraw:a,address:i,currentChain:s,quantity:l,fee:c,checkIsBridgeless:m}=e,w=react.useMemo(()=>l?new utils.Decimal(l).minus(c??0).toNumber():0,[l,c]);return jsxRuntime.jsx(ui.Box,{width:184,children:jsxRuntime.jsx(uiConnector.AuthGuard,{networkId:r,bridgeLessOnly:!0,buttonProps:{fullWidth:!0},children:m?jsxRuntime.jsx(ui.Button,{"data-testid":"oui-testid-withdraw-dialog-withdraw-btn",fullWidth:!0,disabled:o,loading:n,onClick:()=>{if(a){ui.modal.confirm({title:"Confirm to withdraw",content:jsxRuntime.jsx($t,{address:i,amount:w,currentChain:s}),bodyClassName:"oui-p-0",onOk:async()=>{t();}});return}t();},children:"Withdraw"}):jsxRuntime.jsx(it,{networkId:r})})})};var at=({address:e,loading:o,disabled:n,quantity:t,onQuantityChange:r,token:a,inputStatus:i,hintMessage:s,amount:l,maxQuantity:c,balanceRevalidating:m,chains:w,currentChain:h,onChainChange:f,fee:p,settingChain:d,wrongNetwork:b,hasPositions:I,unsettledPnL:N,onSettlePnl:T,onWithdraw:v,chainVaultBalance:S,crossChainWithdraw:F,crossChainTrans:A,showQty:U,networkId:E,checkIsBridgeless:z})=>jsxRuntime.jsxs(ui.Box,{id:"oui-withdraw-form",className:ui.textVariants({weight:"semibold"}),children:[jsxRuntime.jsxs(ui.Box,{mb:5,children:[jsxRuntime.jsx(ue,{}),jsxRuntime.jsx(ui.Box,{mt:3,mb:1,children:jsxRuntime.jsx(L,{value:t,onValueChange:r,token:a,onTokenChange:()=>{},status:i,hintMessage:s})}),jsxRuntime.jsx(me,{token:a,amount:l,maxQuantity:c.toString(),loading:m,onClick:()=>{r(c.toString());}}),jsxRuntime.jsx(Lt,{unsettledPnl:N,hasPositions:I,onSettlle:T}),jsxRuntime.jsx(ae,{}),jsxRuntime.jsx(le,{}),jsxRuntime.jsxs(ui.Box,{mt:3,children:[jsxRuntime.jsx(se,{chains:w,value:h,onValueChange:f,wrongNetwork:b,loading:d}),jsxRuntime.jsx(L,{classNames:{root:"oui-mt-[2px] oui-rounded-t-sm oui-rounded-b-xl"},token:a,value:U,readOnly:!0})]}),jsxRuntime.jsx(ui.Flex,{direction:"column",mt:1,gapY:1,itemAlign:"start",children:jsxRuntime.jsxs(ui.Text,{size:"xs",intensity:36,children:["Fee \u2248 ",jsxRuntime.jsx(ui.Text,{size:"xs",intensity:80,children:`${p} `}),jsxRuntime.jsx(ui.Text,{children:"USDC"})]})})]}),jsxRuntime.jsx(Gt,{checkIsBridgeless:z,chainVaultBalance:S,currentChain:h,quantity:t,maxAmount:c,crossChainTrans:A}),jsxRuntime.jsx(ui.Flex,{justify:"center",mt:3,children:jsxRuntime.jsx(Xt,{checkIsBridgeless:z,networkId:E,disabled:n,loading:o,onWithdraw:v,crossChainWithdraw:F,currentChain:h,address:e,quantity:t,fee:p})})]});var Kt=1,lt=({onClose:e})=>{let [o]=hooks.usePositionStream(),[n,t]=react.useState(!1),[r,a]=react.useState(!1),{data:i}=hooks.usePrivateQuery("/v1/asset/history",{revalidateOnMount:!0}),s=hooks.useConfig("networkId"),l=hooks.useEventEmitter(),[c,m]=react.useState(""),[w,h]=react.useState({symbol:"USDC",decimals:6,address:"",display_name:"",precision:6}),[f,p]=react.useState("default"),[d,b]=react.useState(),{wrongNetwork:I}=reactApp.useAppContext(),{account:N}=hooks.useAccount(),{data:T}=hooks.useQuery("/v1/public/vault_balance",{revalidateOnMount:!0}),{connectedChain:v,wallet:S,setChain:F,settingChain:A}=hooks.useWalletConnector();hooks.useConfig();let {walletName:E,address:z}=react.useMemo(()=>({walletName:S?.label,address:S?.accounts?.[0].address}),[S]),ge=u=>{m(u);},g=react.useMemo(()=>new utils.Decimal(c||0).mul(Kt).toNumber(),[c,Kt]),{dst:V,withdraw:q,isLoading:ct,maxAmount:W,availableBalance:mt,availableWithdraw:pt,unsettledPnL:oe}=hooks.useWithdraw(),[io,G]=react.useState(!0),[Ne,{findByChainId:we}]=hooks.useChains(s,{pick:"network_infos",filter:u=>u.network_infos?.bridge_enable||u.network_infos?.bridgeless}),ne=react.useMemo(()=>s==="mainnet"?Ne.filter(u=>u.bridgeless):Ne,[Ne,s]),{configStore:so}=react.useContext(hooks.OrderlyContext),ao=so.get("apiBaseUrl"),{data:dt}=hooks.useQuery(`${ao}/v1/public/token?t=withdraw`,{revalidateIfStale:!1,revalidateOnFocus:!1,revalidateOnReconnect:!1,revalidateOnMount:!0,dedupingInterval:36e5,formatter:u=>{if(u.rows.length===1)return u.rows[0].chain_details}}),C=react.useMemo(()=>{if(!v)return null;let u=utils.praseChainIdToNumber(v.id),k=we(u);return {...v,id:u,info:k}},[v,we]),lo=react.useMemo(()=>I||!C?!1:s==="testnet"?!0:!(!C.info||!C.info.network_infos||!C.info.network_infos.bridgeless),[C,I]),uo=()=>{m("");},co=react.useCallback(async u=>{let k=we(u.chain_id);return !k||k.network_infos?.chain_id===C?.id?Promise.resolve():F?.({chainId:utils.int2hex(Number(k.network_infos?.chain_id))}).then(re=>{re?(ui.toast.success("Network switched"),uo()):ui.toast.error("Switch chain failed");}).catch(re=>{ui.toast.error(`Switch chain failed: ${re.message}`);})},[C,F,we]),mo=react.useMemo(()=>o?.rows?.length>0,[o]),po=async()=>N.settle().catch(u=>(u.code==-1104&&ui.toast.error("Settlement is only allowed once every 10 minutes. Please try again later."),u.message.indexOf("user rejected")!==-1&&ui.toast.error("REJECTED_TRANSACTION"),Promise.reject(u))).then(u=>(ui.toast.success("Settlement requested"),Promise.resolve(u))),xe=react.useMemo(()=>{if(!T||!C)return null;let u=T.find(k=>parseInt(k.chain_id)===C?.id);return u?u.balance:null},[ne,C,T]),be=react.useMemo(()=>{if(xe!==null){let u=parseFloat(c);return u>xe&&u<=W}return !1},[c,W,xe]),ft=react.useMemo(()=>ne.minimum_withdraw_amount??1,[ne]),fo=async()=>{if(!r&&f==="default"){if(new utils.Decimal(c).lt(ft)){ui.toast.error(`quantity must large than ${ft}`);return}return a(!0),q({amount:c,token:"USDC",chainId:C?.id,allowCrossChainWithdraw:be}).then(u=>{ui.toast.success("Withdraw requested"),l.emit("withdraw:requested"),e&&e(),m("");}).catch(u=>{if(u.message.indexOf("user rejected")!==-1){ui.toast.error("REJECTED_TRANSACTION");return}ui.toast.error(u.message);}).finally(()=>{a(!1);})}},Ae=react.useMemo(()=>{if(!C)return 0;let u=dt?.find(k=>parseInt(k.chain_id)===C.id);return u?be?(u.withdrawal_fee||0)+(u.cross_chain_withdrawal_fee||0):u.withdrawal_fee||0:0},[C,dt,ne,be]),ho=react.useMemo(()=>{if(!c)return "";let u=new utils.Decimal(c).sub(Ae??0);return u.isNegative()?"":u.toNumber()},[Ae,c]);return react.useEffect(()=>{if(n&&G(!0),!c){p("default"),b(""),G(!0);return}let u=new utils.Decimal(c??0);oe<0?u.gt(W)?(p("error"),b("Insufficient balance"),G(!0)):(p("default"),b(""),G(!1)):u.gt(W)?(p("error"),b("Insufficient balance"),G(!0)):u.gt(new utils.Decimal(W).minus(oe))&&u.lessThanOrEqualTo(W)?(p("warning"),b("Please settle your balance"),G(!0)):(p("default"),b(""),G(!1));},[c,W,oe,n]),react.useEffect(()=>{let u=i?.find(k=>k.trans_status==="pending_rebalance".toUpperCase());t(!!u);},[i]),hooks.useWalletSubscription({onMessage(u){if(!n)return;let{trxId:k,transStatus:re}=u;k===n&&re==="COMPLETED"&&t(!1);}}),{walletName:E,address:z,quantity:c,onQuantityChange:ge,token:w,inputStatus:f,hintMessage:d,dst:V,amount:g,balanceRevalidating:!1,maxQuantity:W,disabled:io,loading:r,hasPositions:mo,unsettledPnL:oe,wrongNetwork:I,settingChain:A,chains:ne,currentChain:C,onChainChange:co,onSettlePnl:po,onWithdraw:fo,chainVaultBalance:xe,fee:Ae,crossChainWithdraw:be,crossChainTrans:n,showQty:ho,networkId:s,checkIsBridgeless:lo}};var ut=e=>{let o=lt({onClose:e.close});return jsxRuntime.jsx(at,{...o})};function Cr(){ui.installExtension({name:"deposit-form",scope:["*"],positions:[ui.ExtensionPositionEnum.DepositForm],__isInternal:!0})(e=>jsxRuntime.jsx(Fe,{onClose:e.onClose}));}var to=e=>jsxRuntime.jsx(ui.ExtensionSlot,{position:ui.ExtensionPositionEnum.DepositForm,defaultWidget:Fe,...e});var Fr="DepositAndWithdrawWithDialogId",Tr="DepositAndWithdrawWithSheetId",ro=e=>{let[o,n]=react.useState(e.activeTab||"deposit");return jsxRuntime.jsxs(ui.Tabs,{value:o,onValueChange:n,variant:"contained",classNames:{tabsList:"oui-px-0",tabsContent:"oui-pt-5"},children:[jsxRuntime.jsx(ui.TabPanel,{title:"Deposit",icon:jsxRuntime.jsx(Ft,{}),value:"deposit",children:jsxRuntime.jsx(to,{onClose:e.close})}),jsxRuntime.jsx(ui.TabPanel,{title:"Withdraw",icon:jsxRuntime.jsx(Tt,{}),value:"withdraw",children:jsxRuntime.jsx(ut,{...e})})]})};ui.registerSimpleDialog(Fr,ro,{size:"md",bodyClassName:"oui-pt-3"});ui.registerSimpleSheet(Tr,ro);
|
|
14
|
+
|
|
15
|
+
exports.ActionButton = He;
|
|
16
|
+
exports.AvailableQuantity = me;
|
|
17
|
+
exports.BrokerWallet = ue;
|
|
18
|
+
exports.ChainSelect = se;
|
|
19
|
+
exports.DepositAction = Le;
|
|
20
|
+
exports.DepositAndWithdraw = ro;
|
|
21
|
+
exports.DepositAndWithdrawWithDialogId = Fr;
|
|
22
|
+
exports.DepositAndWithdrawWithSheetId = Tr;
|
|
23
|
+
exports.DepositForm = Ye;
|
|
24
|
+
exports.DepositFormWidget = Fe;
|
|
25
|
+
exports.ExchangeDivider = ae;
|
|
26
|
+
exports.Fee = Ge;
|
|
27
|
+
exports.QuantityInput = L;
|
|
28
|
+
exports.SwapCoin = Qe;
|
|
29
|
+
exports.Web3Wallet = le;
|
|
30
|
+
exports.WithdrawFormUI = at;
|
|
31
|
+
exports.WithdrawFormWidget = ut;
|
|
32
|
+
exports.feeDecimalsOffset = At;
|
|
33
|
+
exports.formatAddress = Dt;
|
|
34
|
+
exports.getTokenByTokenList = Nt;
|
|
35
|
+
exports.installDeposit = Cr;
|
|
36
|
+
exports.useActionType = Je;
|
|
37
|
+
exports.useChainSelect = je;
|
|
38
|
+
exports.useDepositAction = et;
|
|
39
|
+
exports.useDepositFormScript = rt;
|
|
40
|
+
exports.useInputStatus = tt;
|
|
41
|
+
exports.useToken = ot;
|
|
42
|
+
exports.useWithdrawForm = lt;
|
|
43
|
+
//# sourceMappingURL=out.js.map
|
|
44
|
+
//# sourceMappingURL=index.js.map
|