@dhedge/trading-widget 1.2.10 → 2.0.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/README.md +110 -110
- package/core-kit/abi/easy-swapper-v2.d.ts +413 -0
- package/core-kit/abi/flatcoin-points-module.d.ts +1 -1
- package/core-kit/abi/index.d.ts +2 -1
- package/core-kit/const/config.d.ts +1 -1
- package/core-kit/const/contracts/arbitrum.d.ts +1 -0
- package/core-kit/const/contracts/base.d.ts +1 -0
- package/core-kit/const/contracts/optimism.d.ts +1 -0
- package/core-kit/const/contracts/polygon.d.ts +1 -0
- package/core-kit/const/default-data.d.ts +3 -7
- package/core-kit/const/index.d.ts +1 -0
- package/core-kit/const/logger.d.ts +0 -1
- package/core-kit/const/tokens/index.d.ts +2 -1
- package/core-kit/const/trading.d.ts +10 -0
- package/core-kit/hooks/pool/multicall/use-pool.static.d.ts +530 -401
- package/core-kit/hooks/pool/use-pool-fees.d.ts +0 -1
- package/core-kit/hooks/state/action.d.ts +4 -1
- package/core-kit/hooks/state/index.d.ts +3 -3
- package/core-kit/hooks/state/meta.d.ts +0 -2
- package/core-kit/hooks/state/pool.d.ts +0 -2
- package/core-kit/hooks/trading/deposit-v2/index.d.ts +16 -0
- package/core-kit/hooks/trading/deposit-v2/use-applied-deposit-slippage.d.ts +1 -0
- package/core-kit/hooks/trading/deposit-v2/use-deposit-lock-time.d.ts +1 -0
- package/core-kit/hooks/trading/deposit-v2/use-deposit-price-diff.d.ts +5 -0
- package/core-kit/hooks/trading/deposit-v2/use-deposit-quote-contract-read.d.ts +414 -0
- package/core-kit/hooks/trading/deposit-v2/use-deposit-quote.d.ts +1 -0
- package/core-kit/hooks/trading/deposit-v2/use-deposit-slippage.d.ts +1 -0
- package/core-kit/hooks/trading/deposit-v2/use-is-custom-cooldown-deposit.d.ts +1 -0
- package/core-kit/hooks/trading/deposit-v2/use-is-deposit-with-swap-transaction.d.ts +1 -0
- package/core-kit/hooks/trading/deposit-v2/use-is-vault-deposit-locked.d.ts +4 -0
- package/core-kit/hooks/trading/deposit-v2/use-min-vault-tokens-received-amount.d.ts +1 -0
- package/core-kit/hooks/trading/deposit-v2/use-swap-data-based-on-send-token.d.ts +1 -0
- package/core-kit/hooks/trading/deposit-v2/use-vault-deposit-params.d.ts +2 -0
- package/core-kit/hooks/trading/deposit-v2/use-vault-deposit-token-amount.d.ts +1 -0
- package/core-kit/hooks/trading/{deposit/use-pool-deposit-tokens.d.ts → deposit-v2/use-vault-deposit-tokens.d.ts} +1 -1
- package/core-kit/hooks/trading/deposit-v2/use-vault-deposit-transaction-arguments.d.ts +2 -0
- package/core-kit/hooks/trading/index.d.ts +1 -3
- package/core-kit/hooks/trading/use-swap-data-query.d.ts +6 -0
- package/core-kit/models/index.d.ts +0 -3
- package/core-kit/types/config.types.d.ts +1 -4
- package/core-kit/types/state.types.d.ts +8 -13
- package/core-kit/types/trading-panel.types.d.ts +0 -1
- package/core-kit/types/trading.types.d.ts +21 -3
- package/core-kit/utils/transaction.d.ts +12 -0
- package/{index-79f679c5.js → index-8649280a.js} +12333 -12023
- package/index-e1549967.cjs +207 -0
- package/index.cjs +1 -1
- package/index.d.ts +6 -9
- package/index.js +226 -260
- package/package.json +1 -1
- package/{pyth-adapter-556efdbc.js → pyth-adapter-ac818fc3.js} +1 -1
- package/{pyth-adapter-a30de8f8.cjs → pyth-adapter-e6d49270.cjs} +1 -1
- package/trading-widget/components/deposit/meta/transaction-disclosure/transaction-disclosure.hooks.d.ts +1 -0
- package/trading-widget/components/widget/widget-overlay/pool-select-overlay/pool-select-overlay.hooks.d.ts +0 -3
- package/trading-widget/providers/config-provider/config-provider.types.d.ts +2 -1
- package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +0 -2
- package/core-kit/hooks/trading/deposit/index.d.ts +0 -10
- package/core-kit/hooks/trading/deposit/use-deposit-method-handler.d.ts +0 -2
- package/core-kit/hooks/trading/deposit/use-deposit-quote.d.ts +0 -2
- package/core-kit/hooks/trading/deposit/use-deposit-slippage.d.ts +0 -1
- package/core-kit/hooks/trading/deposit/use-deposit-trading-params.d.ts +0 -2
- package/core-kit/hooks/trading/deposit/use-pool-deposit-asset-address.d.ts +0 -9
- package/core-kit/hooks/trading/deposit/use-should-be-whitelisted.d.ts +0 -4
- package/core-kit/hooks/trading/use-handle-pool-swap-info.d.ts +0 -1
- package/core-kit/hooks/trading/use-is-easy-swapper-trading.d.ts +0 -1
- package/core-kit/hooks/trading/use-trading-price-diff.d.ts +0 -8
- package/core-kit/models/buying-with-easyswapper-args.d.ts +0 -18
- package/core-kit/models/buying-with-native-asset-args.d.ts +0 -16
- package/core-kit/models/buying-with-pool-logic-args.d.ts +0 -14
- package/index-76a2bf91.cjs +0 -207
- package/trading-widget/components/deposit/settings/deposit-fee-switch/deposit-fee-switch.d.ts +0 -1
- package/trading-widget/components/deposit/settings/deposit-fee-switch/deposit-fee-switch.hooks.d.ts +0 -5
- package/trading-widget/components/deposit/settings/deposit-settings/deposit-settings.hooks.d.ts +0 -6
- /package/core-kit/hooks/trading/{deposit → deposit-v2}/use-deposit-allowance.d.ts +0 -0
- /package/core-kit/hooks/trading/{deposit → deposit-v2}/use-deposit.d.ts +0 -0
- /package/core-kit/hooks/trading/{deposit → deposit-v2}/use-handle-pool-deposit-data.d.ts +0 -0
|
@@ -12,7 +12,6 @@ export declare const useSetTradingType: () => (payload: import("../../types").Tr
|
|
|
12
12
|
export declare const useUpdateTradingMeta: () => (payload: Partial<{
|
|
13
13
|
approvingStatus?: "pending" | "success" | undefined;
|
|
14
14
|
}>) => void;
|
|
15
|
-
export declare const useUpdateEntryFee: () => (payload: Partial<Record<import("../../types").DepositMethodName, number>>) => void;
|
|
16
15
|
export declare const useUpdateTradingModal: () => (payload: Partial<import("../../types").TradingPanelStateModal>) => void;
|
|
17
16
|
export declare const useUpdatePoolFallbackData: () => (payload: import("../../types").PoolFallbackData) => void;
|
|
18
17
|
export declare const useOnTransactionError: () => ((error: Error, action: import("../../types").TransactionAction | undefined, chainId?: number | undefined, txHash?: `0x${string}` | undefined) => void) | undefined;
|
|
@@ -22,3 +21,7 @@ export declare const useOnTransactionEstimationError: () => ((error: import("../
|
|
|
22
21
|
export declare const useOnTokenSelector: () => ((payload: import("../../types").TokenSelectorPayload) => void) | undefined;
|
|
23
22
|
export declare const useTradingPanelLogger: () => ((eventName: string, payload?: Record<string, unknown> | undefined) => void) | undefined;
|
|
24
23
|
export declare const useOnSimulateTransaction: () => ((params: import("../../types").SimulateTransactionParams) => Promise<import("../../types").SimulateTransactionResponse | null>) | undefined;
|
|
24
|
+
export declare const useGetSwapData: () => (args: {
|
|
25
|
+
signal: AbortSignal;
|
|
26
|
+
variables: import("../../types").SwapDataRequest;
|
|
27
|
+
}) => Promise<import("../../types").SwapDataResponse | null>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { useSetTradingType, useUpdateTradingMeta, useUpdateTradingModal, useUpdateSendTokenInput, useSetPoolAddress, useUpdateReceiveTokenInput, useUpdateTradingSettings,
|
|
2
|
-
export { useTradingPanelPoolAddress, useTradingPanelPoolConfig,
|
|
1
|
+
export { useSetTradingType, useUpdateTradingMeta, useUpdateTradingModal, useUpdateSendTokenInput, useSetPoolAddress, useUpdateReceiveTokenInput, useUpdateTradingSettings, useOnTransactionError, useOnTransactionSuccess, useOnTransactionEstimationError, useOnTokenSelector, useTradingPanelLogger, useOnSimulateTransaction, useUpdatePoolFallbackData, useOnTradingSettleError, useGetSwapData, } from './action';
|
|
2
|
+
export { useTradingPanelPoolAddress, useTradingPanelPoolConfig, useTradingPanelPoolConfigs, useTradingPanelPoolFallbackData, useIsPoolAddress, } from './pool';
|
|
3
3
|
export { useSendTokenInput, useReceiveTokenInput } from './input';
|
|
4
4
|
export { useTradingPanelSettings } from './settings';
|
|
5
|
-
export { useTradingPanelMeta, useTradingPanelApprovingStatus
|
|
5
|
+
export { useTradingPanelMeta, useTradingPanelApprovingStatus } from './meta';
|
|
6
6
|
export { useTradingPanelModal } from './modal';
|
|
7
7
|
export { useTradingPanelType, useIsDepositTradingPanelType } from './type';
|
|
8
8
|
export { useTradingPanelTransactions } from './transaction';
|
|
@@ -4,5 +4,3 @@ export declare const useTradingPanelMeta: () => [
|
|
|
4
4
|
TradingPanelActionsState['updateTradingMeta']
|
|
5
5
|
];
|
|
6
6
|
export declare const useTradingPanelApprovingStatus: () => ["pending" | "success" | undefined, (approvingStatus: TradingPanelState['meta']['approvingStatus']) => void];
|
|
7
|
-
export declare const useTradingPanelEntryFee: () => [number, (entryFeeSlice: Partial<TradingPanelState['entryFee']>) => void];
|
|
8
|
-
export declare const useTradingPanelLockTime: () => string;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import type { PoolConfig } from 'core-kit/types/config.types';
|
|
2
2
|
import type { TradingPanelActionsState, TradingPanelState } from 'core-kit/types/state.types';
|
|
3
|
-
import type { DepositMethodName } from 'core-kit/types/trading-panel.types';
|
|
4
3
|
import type { Address } from 'core-kit/types/web3.types';
|
|
5
4
|
export declare const useTradingPanelPoolAddress: () => [
|
|
6
5
|
TradingPanelState['poolAddress'],
|
|
@@ -9,7 +8,6 @@ export declare const useTradingPanelPoolAddress: () => [
|
|
|
9
8
|
export declare const useTradingPanelPoolConfig: () => PoolConfig;
|
|
10
9
|
export declare const useTradingPanelPoolConfigs: () => PoolConfig[];
|
|
11
10
|
export declare const useIsPoolAddress: (address: Address) => boolean;
|
|
12
|
-
export declare const useTradingPanelDepositMethod: () => [DepositMethodName, (payload: Pick<PoolConfig, 'address'> & Pick<PoolConfig['depositParams'], 'method'>) => void];
|
|
13
11
|
export declare const useTradingPanelPoolFallbackData: () => [
|
|
14
12
|
TradingPanelState['poolFallbackData'],
|
|
15
13
|
TradingPanelActionsState['updatePoolFallbackData']
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export { useDeposit } from './use-deposit';
|
|
2
|
+
export { useDepositAllowance } from './use-deposit-allowance';
|
|
3
|
+
export { useDepositQuote } from './use-deposit-quote';
|
|
4
|
+
export { useDepositQuoteContractRead } from './use-deposit-quote-contract-read';
|
|
5
|
+
export { useDepositSlippage } from './use-deposit-slippage';
|
|
6
|
+
export { useHandlePoolDepositData } from './use-handle-pool-deposit-data';
|
|
7
|
+
export { useIsVaultDepositLocked } from './use-is-vault-deposit-locked';
|
|
8
|
+
export { useSwapDataBasedOnSendToken } from './use-swap-data-based-on-send-token';
|
|
9
|
+
export { useVaultDepositParams } from './use-vault-deposit-params';
|
|
10
|
+
export { useVaultDepositTokenAmount } from './use-vault-deposit-token-amount';
|
|
11
|
+
export { useVaultDepositTokens } from './use-vault-deposit-tokens';
|
|
12
|
+
export { useVaultDepositTransactionArguments } from './use-vault-deposit-transaction-arguments';
|
|
13
|
+
export { useDepositLockTime } from './use-deposit-lock-time';
|
|
14
|
+
export { useDepositPriceDiff } from './use-deposit-price-diff';
|
|
15
|
+
export { useIsDepositWithSwapTransaction } from './use-is-deposit-with-swap-transaction';
|
|
16
|
+
export { useMinVaultTokensReceivedAmount } from './use-min-vault-tokens-received-amount';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useAppliedDepositSlippage: () => number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useDepositLockTime: () => string;
|
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
import type { PoolConfig } from 'core-kit/types/config.types';
|
|
2
|
+
export declare const useDepositQuoteContractRead: ({ address, chainId, }: Pick<PoolConfig, 'address' | 'chainId'>) => import("wagmi").UseReadContractReturnType<readonly [{
|
|
3
|
+
readonly inputs: readonly [];
|
|
4
|
+
readonly name: "customCooldown";
|
|
5
|
+
readonly outputs: readonly [{
|
|
6
|
+
readonly internalType: "uint256";
|
|
7
|
+
readonly name: "";
|
|
8
|
+
readonly type: "uint256";
|
|
9
|
+
}];
|
|
10
|
+
readonly stateMutability: "view";
|
|
11
|
+
readonly type: "function";
|
|
12
|
+
}, {
|
|
13
|
+
readonly inputs: readonly [{
|
|
14
|
+
readonly internalType: "address";
|
|
15
|
+
readonly name: "";
|
|
16
|
+
readonly type: "address";
|
|
17
|
+
}];
|
|
18
|
+
readonly name: "customCooldownDepositsWhitelist";
|
|
19
|
+
readonly outputs: readonly [{
|
|
20
|
+
readonly internalType: "bool";
|
|
21
|
+
readonly name: "";
|
|
22
|
+
readonly type: "bool";
|
|
23
|
+
}];
|
|
24
|
+
readonly stateMutability: "view";
|
|
25
|
+
readonly type: "function";
|
|
26
|
+
}, {
|
|
27
|
+
readonly inputs: readonly [{
|
|
28
|
+
readonly internalType: "address";
|
|
29
|
+
readonly name: "_dHedgeVault";
|
|
30
|
+
readonly type: "address";
|
|
31
|
+
}, {
|
|
32
|
+
readonly internalType: "contract IERC20";
|
|
33
|
+
readonly name: "_vaultDepositToken";
|
|
34
|
+
readonly type: "address";
|
|
35
|
+
}, {
|
|
36
|
+
readonly internalType: "uint256";
|
|
37
|
+
readonly name: "_depositAmount";
|
|
38
|
+
readonly type: "uint256";
|
|
39
|
+
}, {
|
|
40
|
+
readonly internalType: "uint256";
|
|
41
|
+
readonly name: "_expectedAmountReceived";
|
|
42
|
+
readonly type: "uint256";
|
|
43
|
+
}];
|
|
44
|
+
readonly name: "deposit";
|
|
45
|
+
readonly outputs: readonly [];
|
|
46
|
+
readonly stateMutability: "nonpayable";
|
|
47
|
+
readonly type: "function";
|
|
48
|
+
}, {
|
|
49
|
+
readonly inputs: readonly [{
|
|
50
|
+
readonly internalType: "address";
|
|
51
|
+
readonly name: "_dHedgeVault";
|
|
52
|
+
readonly type: "address";
|
|
53
|
+
}, {
|
|
54
|
+
readonly internalType: "address";
|
|
55
|
+
readonly name: "_vaultDepositToken";
|
|
56
|
+
readonly type: "address";
|
|
57
|
+
}, {
|
|
58
|
+
readonly internalType: "uint256";
|
|
59
|
+
readonly name: "_depositAmount";
|
|
60
|
+
readonly type: "uint256";
|
|
61
|
+
}];
|
|
62
|
+
readonly name: "depositQuote";
|
|
63
|
+
readonly outputs: readonly [{
|
|
64
|
+
readonly internalType: "uint256";
|
|
65
|
+
readonly name: "expectedAmountReceived";
|
|
66
|
+
readonly type: "uint256";
|
|
67
|
+
}];
|
|
68
|
+
readonly stateMutability: "view";
|
|
69
|
+
readonly type: "function";
|
|
70
|
+
}, {
|
|
71
|
+
readonly inputs: readonly [{
|
|
72
|
+
readonly internalType: "address";
|
|
73
|
+
readonly name: "_dHedgeVault";
|
|
74
|
+
readonly type: "address";
|
|
75
|
+
}, {
|
|
76
|
+
readonly internalType: "contract IERC20";
|
|
77
|
+
readonly name: "_vaultDepositToken";
|
|
78
|
+
readonly type: "address";
|
|
79
|
+
}, {
|
|
80
|
+
readonly internalType: "uint256";
|
|
81
|
+
readonly name: "_depositAmount";
|
|
82
|
+
readonly type: "uint256";
|
|
83
|
+
}, {
|
|
84
|
+
readonly internalType: "uint256";
|
|
85
|
+
readonly name: "_expectedAmountReceived";
|
|
86
|
+
readonly type: "uint256";
|
|
87
|
+
}];
|
|
88
|
+
readonly name: "depositWithCustomCooldown";
|
|
89
|
+
readonly outputs: readonly [];
|
|
90
|
+
readonly stateMutability: "nonpayable";
|
|
91
|
+
readonly type: "function";
|
|
92
|
+
}, {
|
|
93
|
+
readonly inputs: readonly [{
|
|
94
|
+
readonly internalType: "address";
|
|
95
|
+
readonly name: "_dHedgeVault";
|
|
96
|
+
readonly type: "address";
|
|
97
|
+
}, {
|
|
98
|
+
readonly internalType: "uint256";
|
|
99
|
+
readonly name: "_amountIn";
|
|
100
|
+
readonly type: "uint256";
|
|
101
|
+
}, {
|
|
102
|
+
readonly internalType: "uint256";
|
|
103
|
+
readonly name: "_slippageTolerance";
|
|
104
|
+
readonly type: "uint256";
|
|
105
|
+
}];
|
|
106
|
+
readonly name: "initWithdrawal";
|
|
107
|
+
readonly outputs: readonly [];
|
|
108
|
+
readonly stateMutability: "nonpayable";
|
|
109
|
+
readonly type: "function";
|
|
110
|
+
}, {
|
|
111
|
+
readonly inputs: readonly [{
|
|
112
|
+
readonly internalType: "address";
|
|
113
|
+
readonly name: "_dHedgeVault";
|
|
114
|
+
readonly type: "address";
|
|
115
|
+
}, {
|
|
116
|
+
readonly internalType: "uint256";
|
|
117
|
+
readonly name: "_expectedAmountReceived";
|
|
118
|
+
readonly type: "uint256";
|
|
119
|
+
}];
|
|
120
|
+
readonly name: "nativeDeposit";
|
|
121
|
+
readonly outputs: readonly [];
|
|
122
|
+
readonly stateMutability: "payable";
|
|
123
|
+
readonly type: "function";
|
|
124
|
+
}, {
|
|
125
|
+
readonly inputs: readonly [{
|
|
126
|
+
readonly internalType: "address";
|
|
127
|
+
readonly name: "_dHedgeVault";
|
|
128
|
+
readonly type: "address";
|
|
129
|
+
}, {
|
|
130
|
+
readonly internalType: "uint256";
|
|
131
|
+
readonly name: "_expectedAmountReceived";
|
|
132
|
+
readonly type: "uint256";
|
|
133
|
+
}];
|
|
134
|
+
readonly name: "nativeDepositWithCustomCooldown";
|
|
135
|
+
readonly outputs: readonly [];
|
|
136
|
+
readonly stateMutability: "payable";
|
|
137
|
+
readonly type: "function";
|
|
138
|
+
}, {
|
|
139
|
+
readonly inputs: readonly [];
|
|
140
|
+
readonly name: "swapper";
|
|
141
|
+
readonly outputs: readonly [{
|
|
142
|
+
readonly internalType: "contract ISwapper";
|
|
143
|
+
readonly name: "";
|
|
144
|
+
readonly type: "address";
|
|
145
|
+
}];
|
|
146
|
+
readonly stateMutability: "view";
|
|
147
|
+
readonly type: "function";
|
|
148
|
+
}, {
|
|
149
|
+
readonly inputs: readonly [];
|
|
150
|
+
readonly name: "weth";
|
|
151
|
+
readonly outputs: readonly [{
|
|
152
|
+
readonly internalType: "address";
|
|
153
|
+
readonly name: "";
|
|
154
|
+
readonly type: "address";
|
|
155
|
+
}];
|
|
156
|
+
readonly stateMutability: "view";
|
|
157
|
+
readonly type: "function";
|
|
158
|
+
}, {
|
|
159
|
+
readonly inputs: readonly [{
|
|
160
|
+
readonly internalType: "address";
|
|
161
|
+
readonly name: "";
|
|
162
|
+
readonly type: "address";
|
|
163
|
+
}];
|
|
164
|
+
readonly name: "withdrawalContracts";
|
|
165
|
+
readonly outputs: readonly [{
|
|
166
|
+
readonly internalType: "address";
|
|
167
|
+
readonly name: "";
|
|
168
|
+
readonly type: "address";
|
|
169
|
+
}];
|
|
170
|
+
readonly stateMutability: "view";
|
|
171
|
+
readonly type: "function";
|
|
172
|
+
}, {
|
|
173
|
+
readonly inputs: readonly [];
|
|
174
|
+
readonly name: "wrappedNativeToken";
|
|
175
|
+
readonly outputs: readonly [{
|
|
176
|
+
readonly internalType: "contract IWETH";
|
|
177
|
+
readonly name: "";
|
|
178
|
+
readonly type: "address";
|
|
179
|
+
}];
|
|
180
|
+
readonly stateMutability: "view";
|
|
181
|
+
readonly type: "function";
|
|
182
|
+
}, {
|
|
183
|
+
readonly inputs: readonly [{
|
|
184
|
+
readonly internalType: "address";
|
|
185
|
+
readonly name: "_dHedgeVault";
|
|
186
|
+
readonly type: "address";
|
|
187
|
+
}, {
|
|
188
|
+
readonly components: readonly [{
|
|
189
|
+
readonly components: readonly [{
|
|
190
|
+
readonly internalType: "contract IERC20";
|
|
191
|
+
readonly name: "token";
|
|
192
|
+
readonly type: "address";
|
|
193
|
+
}, {
|
|
194
|
+
readonly internalType: "uint256";
|
|
195
|
+
readonly name: "amount";
|
|
196
|
+
readonly type: "uint256";
|
|
197
|
+
}, {
|
|
198
|
+
readonly components: readonly [{
|
|
199
|
+
readonly internalType: "bytes32";
|
|
200
|
+
readonly name: "routerKey";
|
|
201
|
+
readonly type: "bytes32";
|
|
202
|
+
}, {
|
|
203
|
+
readonly internalType: "bytes";
|
|
204
|
+
readonly name: "swapData";
|
|
205
|
+
readonly type: "bytes";
|
|
206
|
+
}];
|
|
207
|
+
readonly internalType: "struct ISwapper.AggregatorData";
|
|
208
|
+
readonly name: "aggregatorData";
|
|
209
|
+
readonly type: "tuple";
|
|
210
|
+
}];
|
|
211
|
+
readonly internalType: "struct ISwapper.SrcTokenSwapDetails";
|
|
212
|
+
readonly name: "srcData";
|
|
213
|
+
readonly type: "tuple";
|
|
214
|
+
}, {
|
|
215
|
+
readonly components: readonly [{
|
|
216
|
+
readonly internalType: "contract IERC20";
|
|
217
|
+
readonly name: "destToken";
|
|
218
|
+
readonly type: "address";
|
|
219
|
+
}, {
|
|
220
|
+
readonly internalType: "uint256";
|
|
221
|
+
readonly name: "minDestAmount";
|
|
222
|
+
readonly type: "uint256";
|
|
223
|
+
}];
|
|
224
|
+
readonly internalType: "struct ISwapper.DestData";
|
|
225
|
+
readonly name: "destData";
|
|
226
|
+
readonly type: "tuple";
|
|
227
|
+
}];
|
|
228
|
+
readonly internalType: "struct EasySwapperV2.SingleInSingleOutData";
|
|
229
|
+
readonly name: "_swapData";
|
|
230
|
+
readonly type: "tuple";
|
|
231
|
+
}, {
|
|
232
|
+
readonly internalType: "uint256";
|
|
233
|
+
readonly name: "_expectedAmountReceived";
|
|
234
|
+
readonly type: "uint256";
|
|
235
|
+
}];
|
|
236
|
+
readonly name: "zapDeposit";
|
|
237
|
+
readonly outputs: readonly [];
|
|
238
|
+
readonly stateMutability: "nonpayable";
|
|
239
|
+
readonly type: "function";
|
|
240
|
+
}, {
|
|
241
|
+
readonly inputs: readonly [{
|
|
242
|
+
readonly internalType: "address";
|
|
243
|
+
readonly name: "_dHedgeVault";
|
|
244
|
+
readonly type: "address";
|
|
245
|
+
}, {
|
|
246
|
+
readonly components: readonly [{
|
|
247
|
+
readonly components: readonly [{
|
|
248
|
+
readonly internalType: "contract IERC20";
|
|
249
|
+
readonly name: "token";
|
|
250
|
+
readonly type: "address";
|
|
251
|
+
}, {
|
|
252
|
+
readonly internalType: "uint256";
|
|
253
|
+
readonly name: "amount";
|
|
254
|
+
readonly type: "uint256";
|
|
255
|
+
}, {
|
|
256
|
+
readonly components: readonly [{
|
|
257
|
+
readonly internalType: "bytes32";
|
|
258
|
+
readonly name: "routerKey";
|
|
259
|
+
readonly type: "bytes32";
|
|
260
|
+
}, {
|
|
261
|
+
readonly internalType: "bytes";
|
|
262
|
+
readonly name: "swapData";
|
|
263
|
+
readonly type: "bytes";
|
|
264
|
+
}];
|
|
265
|
+
readonly internalType: "struct ISwapper.AggregatorData";
|
|
266
|
+
readonly name: "aggregatorData";
|
|
267
|
+
readonly type: "tuple";
|
|
268
|
+
}];
|
|
269
|
+
readonly internalType: "struct ISwapper.SrcTokenSwapDetails";
|
|
270
|
+
readonly name: "srcData";
|
|
271
|
+
readonly type: "tuple";
|
|
272
|
+
}, {
|
|
273
|
+
readonly components: readonly [{
|
|
274
|
+
readonly internalType: "contract IERC20";
|
|
275
|
+
readonly name: "destToken";
|
|
276
|
+
readonly type: "address";
|
|
277
|
+
}, {
|
|
278
|
+
readonly internalType: "uint256";
|
|
279
|
+
readonly name: "minDestAmount";
|
|
280
|
+
readonly type: "uint256";
|
|
281
|
+
}];
|
|
282
|
+
readonly internalType: "struct ISwapper.DestData";
|
|
283
|
+
readonly name: "destData";
|
|
284
|
+
readonly type: "tuple";
|
|
285
|
+
}];
|
|
286
|
+
readonly internalType: "struct EasySwapperV2.SingleInSingleOutData";
|
|
287
|
+
readonly name: "_swapData";
|
|
288
|
+
readonly type: "tuple";
|
|
289
|
+
}, {
|
|
290
|
+
readonly internalType: "uint256";
|
|
291
|
+
readonly name: "_expectedAmountReceived";
|
|
292
|
+
readonly type: "uint256";
|
|
293
|
+
}];
|
|
294
|
+
readonly name: "zapDepositWithCustomCooldown";
|
|
295
|
+
readonly outputs: readonly [];
|
|
296
|
+
readonly stateMutability: "nonpayable";
|
|
297
|
+
readonly type: "function";
|
|
298
|
+
}, {
|
|
299
|
+
readonly inputs: readonly [{
|
|
300
|
+
readonly internalType: "address";
|
|
301
|
+
readonly name: "_dHedgeVault";
|
|
302
|
+
readonly type: "address";
|
|
303
|
+
}, {
|
|
304
|
+
readonly components: readonly [{
|
|
305
|
+
readonly components: readonly [{
|
|
306
|
+
readonly internalType: "contract IERC20";
|
|
307
|
+
readonly name: "token";
|
|
308
|
+
readonly type: "address";
|
|
309
|
+
}, {
|
|
310
|
+
readonly internalType: "uint256";
|
|
311
|
+
readonly name: "amount";
|
|
312
|
+
readonly type: "uint256";
|
|
313
|
+
}, {
|
|
314
|
+
readonly components: readonly [{
|
|
315
|
+
readonly internalType: "bytes32";
|
|
316
|
+
readonly name: "routerKey";
|
|
317
|
+
readonly type: "bytes32";
|
|
318
|
+
}, {
|
|
319
|
+
readonly internalType: "bytes";
|
|
320
|
+
readonly name: "swapData";
|
|
321
|
+
readonly type: "bytes";
|
|
322
|
+
}];
|
|
323
|
+
readonly internalType: "struct ISwapper.AggregatorData";
|
|
324
|
+
readonly name: "aggregatorData";
|
|
325
|
+
readonly type: "tuple";
|
|
326
|
+
}];
|
|
327
|
+
readonly internalType: "struct ISwapper.SrcTokenSwapDetails";
|
|
328
|
+
readonly name: "srcData";
|
|
329
|
+
readonly type: "tuple";
|
|
330
|
+
}, {
|
|
331
|
+
readonly components: readonly [{
|
|
332
|
+
readonly internalType: "contract IERC20";
|
|
333
|
+
readonly name: "destToken";
|
|
334
|
+
readonly type: "address";
|
|
335
|
+
}, {
|
|
336
|
+
readonly internalType: "uint256";
|
|
337
|
+
readonly name: "minDestAmount";
|
|
338
|
+
readonly type: "uint256";
|
|
339
|
+
}];
|
|
340
|
+
readonly internalType: "struct ISwapper.DestData";
|
|
341
|
+
readonly name: "destData";
|
|
342
|
+
readonly type: "tuple";
|
|
343
|
+
}];
|
|
344
|
+
readonly internalType: "struct EasySwapperV2.SingleInSingleOutData";
|
|
345
|
+
readonly name: "_swapData";
|
|
346
|
+
readonly type: "tuple";
|
|
347
|
+
}, {
|
|
348
|
+
readonly internalType: "uint256";
|
|
349
|
+
readonly name: "_expectedAmountReceived";
|
|
350
|
+
readonly type: "uint256";
|
|
351
|
+
}];
|
|
352
|
+
readonly name: "zapNativeDeposit";
|
|
353
|
+
readonly outputs: readonly [];
|
|
354
|
+
readonly stateMutability: "payable";
|
|
355
|
+
readonly type: "function";
|
|
356
|
+
}, {
|
|
357
|
+
readonly inputs: readonly [{
|
|
358
|
+
readonly internalType: "address";
|
|
359
|
+
readonly name: "_dHedgeVault";
|
|
360
|
+
readonly type: "address";
|
|
361
|
+
}, {
|
|
362
|
+
readonly components: readonly [{
|
|
363
|
+
readonly components: readonly [{
|
|
364
|
+
readonly internalType: "contract IERC20";
|
|
365
|
+
readonly name: "token";
|
|
366
|
+
readonly type: "address";
|
|
367
|
+
}, {
|
|
368
|
+
readonly internalType: "uint256";
|
|
369
|
+
readonly name: "amount";
|
|
370
|
+
readonly type: "uint256";
|
|
371
|
+
}, {
|
|
372
|
+
readonly components: readonly [{
|
|
373
|
+
readonly internalType: "bytes32";
|
|
374
|
+
readonly name: "routerKey";
|
|
375
|
+
readonly type: "bytes32";
|
|
376
|
+
}, {
|
|
377
|
+
readonly internalType: "bytes";
|
|
378
|
+
readonly name: "swapData";
|
|
379
|
+
readonly type: "bytes";
|
|
380
|
+
}];
|
|
381
|
+
readonly internalType: "struct ISwapper.AggregatorData";
|
|
382
|
+
readonly name: "aggregatorData";
|
|
383
|
+
readonly type: "tuple";
|
|
384
|
+
}];
|
|
385
|
+
readonly internalType: "struct ISwapper.SrcTokenSwapDetails";
|
|
386
|
+
readonly name: "srcData";
|
|
387
|
+
readonly type: "tuple";
|
|
388
|
+
}, {
|
|
389
|
+
readonly components: readonly [{
|
|
390
|
+
readonly internalType: "contract IERC20";
|
|
391
|
+
readonly name: "destToken";
|
|
392
|
+
readonly type: "address";
|
|
393
|
+
}, {
|
|
394
|
+
readonly internalType: "uint256";
|
|
395
|
+
readonly name: "minDestAmount";
|
|
396
|
+
readonly type: "uint256";
|
|
397
|
+
}];
|
|
398
|
+
readonly internalType: "struct ISwapper.DestData";
|
|
399
|
+
readonly name: "destData";
|
|
400
|
+
readonly type: "tuple";
|
|
401
|
+
}];
|
|
402
|
+
readonly internalType: "struct EasySwapperV2.SingleInSingleOutData";
|
|
403
|
+
readonly name: "_swapData";
|
|
404
|
+
readonly type: "tuple";
|
|
405
|
+
}, {
|
|
406
|
+
readonly internalType: "uint256";
|
|
407
|
+
readonly name: "_expectedAmountReceived";
|
|
408
|
+
readonly type: "uint256";
|
|
409
|
+
}];
|
|
410
|
+
readonly name: "zapNativeDepositWithCustomCooldown";
|
|
411
|
+
readonly outputs: readonly [];
|
|
412
|
+
readonly stateMutability: "payable";
|
|
413
|
+
readonly type: "function";
|
|
414
|
+
}], "depositQuote", [`0x${string}`, `0x${string}`, bigint], bigint>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useDepositQuote: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useDepositSlippage: () => void;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsCustomCooldownDeposit: () => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsDepositWithSwapTransaction: () => boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useMinVaultTokensReceivedAmount: () => string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useSwapDataBasedOnSendToken: () => import("@tanstack/react-query/build/legacy/types").UseQueryResult<import("../../../types").SwapDataResponse | null, Error>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useVaultDepositTokenAmount: () => string;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { TradingToken } from 'core-kit/types/trading-panel.types';
|
|
2
|
-
export declare const
|
|
2
|
+
export declare const useVaultDepositTokens: () => TradingToken[];
|
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
export { useTradingResultHandling } from './use-trading-result-handling';
|
|
2
|
-
export { useHandlePoolSwapInfo } from './use-handle-pool-swap-info';
|
|
3
2
|
export { useTradingSettleHandler } from './use-trading-settle-handler';
|
|
4
|
-
export { useTradingPriceDiff } from './use-trading-price-diff';
|
|
5
3
|
export { useAssetPrice } from './use-asset-price';
|
|
6
4
|
export { useRawAssetPrice } from './use-raw-asset-price';
|
|
7
5
|
export { useIsTradingEnabled } from './use-is-trading-enabled';
|
|
@@ -12,4 +10,4 @@ export { useMaxSlippagePlaceholder } from './use-max-slippage-placeholder';
|
|
|
12
10
|
export { useSynthetixV3OraclesUpdate } from './synthetix-v3/use-synthetix-v3-oracles-update';
|
|
13
11
|
export { useDepositProjectedEarnings } from './projected-earnings/use-deposit-projected-earnings';
|
|
14
12
|
export { useProjectedEarningsCore } from './projected-earnings/use-projected-earnings-core';
|
|
15
|
-
export {
|
|
13
|
+
export { useSwapDataQuery } from './use-swap-data-query';
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { type UseQueryOptions } from '@tanstack/react-query';
|
|
2
|
+
import type { SwapDataRequest, SwapDataResponse } from 'core-kit/types';
|
|
3
|
+
export declare const useSwapDataQuery: (variables: SwapDataRequest, options?: Omit<UseQueryOptions<SwapDataResponse | null, Error, SwapDataResponse | null, [
|
|
4
|
+
string,
|
|
5
|
+
SwapDataRequest
|
|
6
|
+
]>, 'queryKey' | 'queryFn'>) => import("@tanstack/react-query/build/legacy/types").UseQueryResult<SwapDataResponse | null, Error>;
|
|
@@ -1,5 +1,2 @@
|
|
|
1
|
-
export { BuyingWithEasyswapperArgs } from './buying-with-easyswapper-args';
|
|
2
|
-
export { BuyingWithNativeAssetArgs } from './buying-with-native-asset-args';
|
|
3
|
-
export { BuyingWithPoolLogicArgs } from './buying-with-pool-logic-args';
|
|
4
1
|
export { DefaultSellingParams } from './default-selling-params';
|
|
5
2
|
export { EstimationError } from './estimation-error';
|
|
@@ -1,21 +1,18 @@
|
|
|
1
1
|
import type { PoolComposition } from 'core-kit/types/pool.types';
|
|
2
|
-
import type { ApyCurrency,
|
|
2
|
+
import type { ApyCurrency, TradingToken, WithdrawTradingToken } from 'core-kit/types/trading-panel.types';
|
|
3
3
|
import type { Address, ChainId } from 'core-kit/types/web3.types';
|
|
4
4
|
export interface PoolConfig {
|
|
5
5
|
address: Address;
|
|
6
6
|
symbol: string;
|
|
7
7
|
chainId: ChainId;
|
|
8
8
|
depositParams: {
|
|
9
|
-
method?: DepositMethodName;
|
|
10
9
|
customTokens: TradingToken[];
|
|
11
10
|
defaultDepositTokenSymbol?: string;
|
|
12
11
|
};
|
|
13
12
|
withdrawParams: {
|
|
14
|
-
method?: string;
|
|
15
13
|
customTokens: WithdrawTradingToken[];
|
|
16
14
|
};
|
|
17
15
|
deprecated?: boolean;
|
|
18
|
-
usePoolLogicDeposit?: boolean;
|
|
19
16
|
}
|
|
20
17
|
export interface PoolFallbackData {
|
|
21
18
|
address: Address;
|