@dhedge/trading-widget 3.3.0-alpha.0 → 3.3.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/README.md +9 -0
- package/core-kit/abi/easy-swapper-v2.d.ts +4 -0
- package/core-kit/abi/pool-logic.d.ts +5 -692
- package/core-kit/hooks/pool/index.d.ts +1 -0
- package/core-kit/hooks/pool/multicall/use-pool.static.d.ts +12 -691
- package/core-kit/hooks/pool/multicall/use-pools.dynamic.d.ts +413 -3161
- package/core-kit/hooks/pool/use-has-dhedge-vault-in-composition.d.ts +64 -0
- package/core-kit/hooks/trading/deposit-v2/use-deposit-quote-contract-read.d.ts +4 -0
- package/core-kit/hooks/trading/use-is-transaction-loading.d.ts +2 -0
- package/core-kit/hooks/trading/withdraw-v2/init-step/index.d.ts +1 -1
- package/core-kit/hooks/trading/withdraw-v2/init-step/{use-init-withdraw-transaction-arguments.d.ts → use-get-init-withdraw-transaction-arguments.d.ts} +2 -2
- package/core-kit/hooks/trading/withdraw-v2/init-step/use-init-withdraw-transaction.d.ts +5 -1
- package/core-kit/hooks/trading/withdraw-v2/use-withdrawal-vault-address.d.ts +4 -0
- package/core-kit/hooks/user/multicall/use-user-multicall.d.ts +4 -0
- package/core-kit/utils/transaction.d.ts +3 -3
- package/{index-a29190ba.js → index-5ba43d21.js} +8032 -8852
- package/index-addee486.cjs +217 -0
- package/index.cjs +1 -1
- package/index.d.ts +1 -1
- package/index.js +89 -88
- package/package.json +1 -1
- package/{pyth-adapter-a81f3e9c.cjs → pyth-adapter-557e7325.cjs} +1 -1
- package/{pyth-adapter-330946d6.js → pyth-adapter-ae35e010.js} +1 -1
- package/style.css +1 -1
- package/trading-widget/components/deposit/button/trade-button/trade-button.hooks.d.ts +1 -0
- package/trading-widget/components/deposit/button/valid-deposit-button/valid-deposit-button.hooks.d.ts +1 -0
- package/trading-widget/components/widget/widget-buttons/approve-button/approve-button.hooks.d.ts +1 -0
- package/trading-widget/components/widget/widget-buttons/reload-swap-quote-button/reload-deposit-swap-quote-button/reload-deposit-swap-quote-button.hooks.d.ts +0 -1
- package/trading-widget/components/widget/widget-buttons/reload-swap-quote-button/reload-withdraw-swap-quote-button/reload-withdraw-swap-quote-button.hooks.d.ts +0 -1
- package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-overlay.hooks.d.ts +1 -0
- package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-summary/vault-transaction-summary.d.ts +1 -7
- package/trading-widget/components/withdraw/complete-step/button/claim-button/claim-button.hooks.d.ts +1 -0
- package/trading-widget/components/withdraw/complete-step/button/swap-button/swap-button.hooks.d.ts +1 -0
- package/trading-widget/components/withdraw/init-step/button/init-withdraw-button/init-withdraw-button.hooks.d.ts +1 -0
- package/trading-widget/components/withdraw/init-step/meta/transaction-disclosure/transaction-disclosure.hooks.d.ts +1 -0
- package/trading-widget/providers/theme-provider/theme-provider.types.d.ts +5 -0
- package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +1 -0
- package/index-486e8b60.cjs +0 -217
- /package/core-kit/hooks/trading/withdraw-v2/init-step/{use-init-withdraw-aave-swap-data.d.ts → use-fetch-init-withdraw-aave-swap-data.d.ts} +0 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import type { PoolContractCallParams } from 'core-kit/types';
|
|
2
|
+
export declare const useHasDhedgeVaultInComposition: ({ address, chainId, }: PoolContractCallParams) => import("wagmi").UseReadContractsReturnType<{
|
|
3
|
+
address: `0x${string}`;
|
|
4
|
+
abi: readonly [{
|
|
5
|
+
readonly inputs: readonly [{
|
|
6
|
+
readonly internalType: "address";
|
|
7
|
+
readonly name: "asset";
|
|
8
|
+
readonly type: "address";
|
|
9
|
+
}];
|
|
10
|
+
readonly name: "getAssetPrice";
|
|
11
|
+
readonly outputs: readonly [{
|
|
12
|
+
readonly internalType: "uint256";
|
|
13
|
+
readonly name: "price";
|
|
14
|
+
readonly type: "uint256";
|
|
15
|
+
}];
|
|
16
|
+
readonly stateMutability: "view";
|
|
17
|
+
readonly type: "function";
|
|
18
|
+
}, {
|
|
19
|
+
readonly inputs: readonly [{
|
|
20
|
+
readonly internalType: "address";
|
|
21
|
+
readonly name: "";
|
|
22
|
+
readonly type: "address";
|
|
23
|
+
}];
|
|
24
|
+
readonly name: "isPool";
|
|
25
|
+
readonly outputs: readonly [{
|
|
26
|
+
readonly internalType: "bool";
|
|
27
|
+
readonly name: "";
|
|
28
|
+
readonly type: "bool";
|
|
29
|
+
}];
|
|
30
|
+
readonly stateMutability: "view";
|
|
31
|
+
readonly type: "function";
|
|
32
|
+
}, {
|
|
33
|
+
readonly inputs: readonly [{
|
|
34
|
+
readonly internalType: "address";
|
|
35
|
+
readonly name: "extContract";
|
|
36
|
+
readonly type: "address";
|
|
37
|
+
}];
|
|
38
|
+
readonly name: "getAssetGuard";
|
|
39
|
+
readonly outputs: readonly [{
|
|
40
|
+
readonly internalType: "address";
|
|
41
|
+
readonly name: "guard";
|
|
42
|
+
readonly type: "address";
|
|
43
|
+
}];
|
|
44
|
+
readonly stateMutability: "view";
|
|
45
|
+
readonly type: "function";
|
|
46
|
+
}, {
|
|
47
|
+
readonly inputs: readonly [{
|
|
48
|
+
readonly internalType: "address";
|
|
49
|
+
readonly name: "extContract";
|
|
50
|
+
readonly type: "address";
|
|
51
|
+
}];
|
|
52
|
+
readonly name: "getContractGuard";
|
|
53
|
+
readonly outputs: readonly [{
|
|
54
|
+
readonly internalType: "address";
|
|
55
|
+
readonly name: "guard";
|
|
56
|
+
readonly type: "address";
|
|
57
|
+
}];
|
|
58
|
+
readonly stateMutability: "view";
|
|
59
|
+
readonly type: "function";
|
|
60
|
+
}];
|
|
61
|
+
functionName: string;
|
|
62
|
+
chainId: number;
|
|
63
|
+
args: `0x${string}`[];
|
|
64
|
+
}[], true, boolean>;
|
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
import type { PoolConfig } from 'core-kit/types/config.types';
|
|
2
2
|
export declare const useDepositQuoteContractRead: ({ address, chainId, }: Pick<PoolConfig, 'address' | 'chainId'>) => import("wagmi").UseReadContractReturnType<readonly [{
|
|
3
|
+
readonly inputs: readonly [];
|
|
4
|
+
readonly name: "EmptyPayload";
|
|
5
|
+
readonly type: "error";
|
|
6
|
+
}, {
|
|
3
7
|
readonly inputs: readonly [];
|
|
4
8
|
readonly name: "FailedInnerCall";
|
|
5
9
|
readonly type: "error";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { useIsMultiAssetWithdraw } from './use-is-multi-asset-withdraw';
|
|
2
2
|
export { useInitWithdrawAllowance } from './use-init-withdraw-allowance';
|
|
3
3
|
export { useInitWithdrawTransaction } from './use-init-withdraw-transaction';
|
|
4
|
-
export { useInitWithdrawTransactionArgumentsForSimulationOnly, useGetInitWithdrawTransactionArguments, } from './use-init-withdraw-transaction-arguments';
|
|
4
|
+
export { useInitWithdrawTransactionArgumentsForSimulationOnly, useGetInitWithdrawTransactionArguments, } from './use-get-init-withdraw-transaction-arguments';
|
|
5
5
|
export { useInitWithdrawEstimatedReceiveAssets } from './use-init-withdraw-estimated-receive-assets';
|
|
6
6
|
export { useIsUnrollAndClaimTransaction } from './use-is-unroll-and-claim-transaction';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
interface
|
|
1
|
+
interface UseGetInitWithdrawTransactionArguments {
|
|
2
2
|
debounceTime?: number;
|
|
3
3
|
}
|
|
4
4
|
export declare const useGetInitWithdrawTransactionArguments: () => () => Promise<(bigint | `0x${string}` | import("../../../../types").ComplexWithdrawAssetData[])[]>;
|
|
5
|
-
export declare const useInitWithdrawTransactionArgumentsForSimulationOnly: ({ debounceTime, }?:
|
|
5
|
+
export declare const useInitWithdrawTransactionArgumentsForSimulationOnly: ({ debounceTime, }?: UseGetInitWithdrawTransactionArguments) => (bigint | `0x${string}` | {
|
|
6
6
|
supportedAsset: `0x${string}`;
|
|
7
7
|
withdrawData: string;
|
|
8
8
|
slippageTolerance: bigint;
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
import type { TransactionAction } from 'core-kit/types';
|
|
1
2
|
import type { ContractActionFunc } from 'core-kit/types/web3.types';
|
|
2
|
-
export declare const useInitWithdrawTransaction: () =>
|
|
3
|
+
export declare const useInitWithdrawTransaction: () => {
|
|
4
|
+
withdraw: ContractActionFunc;
|
|
5
|
+
action: TransactionAction;
|
|
6
|
+
};
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export declare const useWithdrawalVaultAddress: () => import("wagmi").UseReadContractReturnType<readonly [{
|
|
2
|
+
readonly inputs: readonly [];
|
|
3
|
+
readonly name: "EmptyPayload";
|
|
4
|
+
readonly type: "error";
|
|
5
|
+
}, {
|
|
2
6
|
readonly inputs: readonly [];
|
|
3
7
|
readonly name: "FailedInnerCall";
|
|
4
8
|
readonly type: "error";
|
|
@@ -64,6 +64,10 @@ export declare const useUserMulticall: ({ address, chainId, }: PoolContractCallP
|
|
|
64
64
|
}, {
|
|
65
65
|
readonly address: `0x${string}`;
|
|
66
66
|
readonly abi: readonly [{
|
|
67
|
+
readonly inputs: readonly [];
|
|
68
|
+
readonly name: "EmptyPayload";
|
|
69
|
+
readonly type: "error";
|
|
70
|
+
}, {
|
|
67
71
|
readonly inputs: readonly [];
|
|
68
72
|
readonly name: "FailedInnerCall";
|
|
69
73
|
readonly type: "error";
|
|
@@ -9,7 +9,7 @@ import type { CalculateSwapDataParamsResponse } from 'core-kit/types';
|
|
|
9
9
|
* @param {string} slippage - The slippage value in % from 0 to 100.
|
|
10
10
|
* @returns {string} - The slippage tolerance.
|
|
11
11
|
*/
|
|
12
|
-
export declare const getSlippageToleranceForContractTransaction: (slippage: number) =>
|
|
12
|
+
export declare const getSlippageToleranceForContractTransaction: (slippage: number) => bigint;
|
|
13
13
|
export declare const buildZapDepositTransactionArguments: ({ vaultAddress, swapData, sendTokenAddress, sendTokenAmount, vaultDepositTokenAddress, minVaultTokensReceivedAmount, routerKey, swapDestinationAmount, swapSlippage, }: {
|
|
14
14
|
vaultAddress: Address;
|
|
15
15
|
swapData: string;
|
|
@@ -27,11 +27,11 @@ export declare const buildSwapWithdrawTransactionData: ({ receiveAssetAddress, s
|
|
|
27
27
|
assets: ReturnType<typeof useCompleteWithdrawTrackedAssets>['data'];
|
|
28
28
|
swapData: ReturnType<typeof useSwapsDataQuery>['data'];
|
|
29
29
|
}) => unknown[][];
|
|
30
|
-
export declare const buildAaveWithdrawAssetTransactionData: ({ assetAddress, swapData, swapParams,
|
|
30
|
+
export declare const buildAaveWithdrawAssetTransactionData: ({ assetAddress, swapData, swapParams, slippageToleranceForContractTransaction, }: {
|
|
31
31
|
assetAddress: Address;
|
|
32
32
|
swapParams: CalculateSwapDataParamsResponse | undefined;
|
|
33
33
|
swapData: ReturnType<typeof useSwapsDataQuery>['data'];
|
|
34
|
-
|
|
34
|
+
slippageToleranceForContractTransaction: bigint;
|
|
35
35
|
}) => {
|
|
36
36
|
supportedAsset: `0x${string}`;
|
|
37
37
|
withdrawData: string;
|