@dhedge/trading-widget 3.2.0-alpha.0 → 3.2.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 +1 -5
- package/core-kit/abi/easy-swapper-v2.d.ts +0 -48
- package/core-kit/abi/index.d.ts +2 -3
- package/core-kit/abi/pool-logic.d.ts +124 -878
- package/core-kit/abi/pool-manager-logic.d.ts +0 -19
- package/core-kit/const/contracts/base.d.ts +1 -1
- package/core-kit/const/contracts/polygon.d.ts +0 -2
- package/core-kit/const/default-data.d.ts +1 -1
- package/core-kit/const/synthetix.d.ts +1 -0
- package/core-kit/hooks/pool/multicall/use-pool-manager.dynamic.d.ts +190 -75
- package/core-kit/hooks/pool/multicall/use-pool-manager.static.d.ts +0 -57
- package/core-kit/hooks/pool/multicall/use-pool.static.d.ts +5 -878
- package/core-kit/hooks/pool/multicall/use-pools.dynamic.d.ts +214 -3315
- package/core-kit/hooks/pool/use-pool-dynamic-contract-data.d.ts +0 -1
- package/core-kit/hooks/pool/use-pool-fees.d.ts +1 -0
- package/core-kit/hooks/state/action.d.ts +0 -3
- package/core-kit/hooks/state/index.d.ts +1 -2
- package/core-kit/hooks/trading/deposit-v2/use-deposit-quote-contract-read.d.ts +0 -48
- package/core-kit/hooks/trading/use-swaps-data-query.d.ts +0 -6
- 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 +1 -6
- package/core-kit/hooks/trading/withdraw-v2/use-withdrawal-vault-address.d.ts +0 -48
- package/core-kit/hooks/user/multicall/use-user-multicall.d.ts +0 -48
- package/core-kit/hooks/web3/use-static-call-query.d.ts +6 -7
- package/core-kit/types/index.d.ts +0 -1
- package/core-kit/types/state.types.d.ts +0 -8
- package/core-kit/types/web3.types.d.ts +12 -0
- package/core-kit/utils/transaction.d.ts +3 -14
- package/core-kit/utils/web3.d.ts +2 -0
- package/index-8d920656.cjs +217 -0
- package/{index-97262ee5.js → index-d62956b7.js} +10949 -12275
- package/index.cjs +1 -1
- package/index.d.ts +3 -3
- package/index.js +203 -204
- package/package.json +1 -1
- package/{pyth-adapter-3dec6847.cjs → pyth-adapter-c8d76d79.cjs} +1 -1
- package/{pyth-adapter-4822ae26.js → pyth-adapter-e278f630.js} +1 -1
- package/style.css +1 -1
- package/trading-widget/components/deposit/meta/transaction-disclosure/transaction-disclosure.hooks.d.ts +0 -3
- package/trading-widget/components/widget/widget-buttons/approve-button/approve-button.hooks.d.ts +0 -1
- package/trading-widget/components/widget/widget-buttons/reload-swap-quote-button/reload-deposit-swap-quote-button/reload-deposit-swap-quote-button.hooks.d.ts +1 -2
- package/trading-widget/components/widget/widget-buttons/reload-swap-quote-button/reload-withdraw-swap-quote-button/reload-withdraw-swap-quote-button.hooks.d.ts +1 -2
- package/trading-widget/components/widget/widget-overlay/index.d.ts +0 -1
- package/trading-widget/components/withdraw/init-step/meta/transaction-disclosure/transaction-disclosure.hooks.d.ts +0 -3
- package/trading-widget/providers/config-provider/config-provider.types.d.ts +0 -1
- package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +0 -1
- package/core-kit/abi/aave/aave-asset-guard.d.ts +0 -50
- package/core-kit/hooks/state/meta.d.ts +0 -6
- package/core-kit/hooks/trading/withdraw-v2/init-step/use-fetch-aave-swap-params.d.ts +0 -6
- package/core-kit/hooks/trading/withdraw-v2/init-step/use-fetch-init-withdraw-complex-asset-data.d.ts +0 -5
- package/core-kit/hooks/trading/withdraw-v2/init-step/use-init-withdraw-aave-swap-data.d.ts +0 -5
- package/core-kit/types/contract.types.d.ts +0 -28
- package/index-3ff0a312.cjs +0 -217
- package/trading-widget/components/widget/widget-overlay/pending-approval-overlay/pending-approval-overlay.d.ts +0 -2
- package/trading-widget/components/widget/widget-overlay/pending-approval-overlay/pending-approval-overlay.hooks.d.ts +0 -3
- package/trading-widget/components/widget/widget-overlay/trading-overlay/trading-summary/claim-summary.d.ts +0 -7
- /package/core-kit/abi/{aave/aave-lending-pool.d.ts → aave-lending-pool.d.ts} +0 -0
|
@@ -8,7 +8,6 @@ export declare const usePoolDynamicContractData: ({ address, chainId, }: PoolDyn
|
|
|
8
8
|
isFetched: boolean;
|
|
9
9
|
userBalance?: string | undefined;
|
|
10
10
|
tokenPrice?: string | undefined;
|
|
11
|
-
getExitRemainingCooldown?: string | undefined;
|
|
12
11
|
totalSupply?: string | undefined;
|
|
13
12
|
isPrivateVault?: boolean | undefined;
|
|
14
13
|
performanceFee?: string | undefined;
|
|
@@ -9,9 +9,6 @@ export declare const useUpdateTradingSettings: () => (payload: Partial<{
|
|
|
9
9
|
isMaxSlippageLoading: boolean;
|
|
10
10
|
}>) => void;
|
|
11
11
|
export declare const useSetTradingType: () => (payload: import("../../types").TradingPanelType) => void;
|
|
12
|
-
export declare const useUpdateTradingMeta: () => (payload: Partial<{
|
|
13
|
-
approvingStatus?: "success" | "pending" | undefined;
|
|
14
|
-
}>) => void;
|
|
15
12
|
export declare const useUpdateTradingModal: () => (payload: Partial<import("../../types").TradingPanelStateModal>) => void;
|
|
16
13
|
export declare const useUpdatePoolFallbackData: () => (payload: import("../../types").PoolFallbackData) => void;
|
|
17
14
|
export declare const useOnTransactionError: () => ((error: Error, action: import("../../types").TransactionAction | undefined, chainId?: number | undefined, txHash?: `0x${string}` | undefined) => void) | undefined;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
export { useSetTradingType,
|
|
1
|
+
export { useSetTradingType, useUpdateTradingModal, useUpdateSendTokenInput, useSetPoolAddress, useUpdateReceiveTokenInput, useUpdateTradingSettings, useOnTransactionError, useOnTransactionSuccess, useOnTransactionEstimationError, useOnTokenSelector, useTradingPanelLogger, useOnSimulateTransaction, useUpdatePoolFallbackData, useOnTradingSettleError, useGetSwapData, } from './action';
|
|
2
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 } from './meta';
|
|
6
5
|
export { useTradingPanelModal } from './modal';
|
|
7
6
|
export { useTradingPanelType, useIsDepositTradingPanelType } from './type';
|
|
8
7
|
export { useTradingPanelTransactions } from './transaction';
|
|
@@ -435,54 +435,6 @@ export declare const useDepositQuoteContractRead: ({ address, chainId, }: Pick<P
|
|
|
435
435
|
}];
|
|
436
436
|
readonly stateMutability: "view";
|
|
437
437
|
readonly type: "function";
|
|
438
|
-
}, {
|
|
439
|
-
readonly inputs: readonly [{
|
|
440
|
-
readonly internalType: "address";
|
|
441
|
-
readonly name: "_dHedgeVault";
|
|
442
|
-
readonly type: "address";
|
|
443
|
-
}, {
|
|
444
|
-
readonly internalType: "uint256";
|
|
445
|
-
readonly name: "_amountIn";
|
|
446
|
-
readonly type: "uint256";
|
|
447
|
-
}, {
|
|
448
|
-
readonly components: readonly [{
|
|
449
|
-
readonly internalType: "address";
|
|
450
|
-
readonly name: "supportedAsset";
|
|
451
|
-
readonly type: "address";
|
|
452
|
-
}, {
|
|
453
|
-
readonly internalType: "bytes";
|
|
454
|
-
readonly name: "withdrawData";
|
|
455
|
-
readonly type: "bytes";
|
|
456
|
-
}, {
|
|
457
|
-
readonly internalType: "uint256";
|
|
458
|
-
readonly name: "slippageTolerance";
|
|
459
|
-
readonly type: "uint256";
|
|
460
|
-
}];
|
|
461
|
-
readonly internalType: "struct IPoolLogic.ComplexAsset[]";
|
|
462
|
-
readonly name: "_complexAssetsData";
|
|
463
|
-
readonly type: "tuple[]";
|
|
464
|
-
}];
|
|
465
|
-
readonly name: "initWithdrawal";
|
|
466
|
-
readonly outputs: readonly [{
|
|
467
|
-
readonly components: readonly [{
|
|
468
|
-
readonly internalType: "address";
|
|
469
|
-
readonly name: "token";
|
|
470
|
-
readonly type: "address";
|
|
471
|
-
}, {
|
|
472
|
-
readonly internalType: "uint256";
|
|
473
|
-
readonly name: "balance";
|
|
474
|
-
readonly type: "uint256";
|
|
475
|
-
}];
|
|
476
|
-
readonly internalType: "struct IWithdrawalVault.TrackedAsset[]";
|
|
477
|
-
readonly name: "trackedAssets";
|
|
478
|
-
readonly type: "tuple[]";
|
|
479
|
-
}, {
|
|
480
|
-
readonly internalType: "address";
|
|
481
|
-
readonly name: "vault";
|
|
482
|
-
readonly type: "address";
|
|
483
|
-
}];
|
|
484
|
-
readonly stateMutability: "nonpayable";
|
|
485
|
-
readonly type: "function";
|
|
486
438
|
}, {
|
|
487
439
|
readonly inputs: readonly [{
|
|
488
440
|
readonly internalType: "address";
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { type UseQueryOptions } from '@tanstack/react-query';
|
|
2
2
|
import type { Address } from 'viem';
|
|
3
|
-
import { useGetSwapData } from 'core-kit/hooks/state';
|
|
4
3
|
import type { SwapDataRequest, SwapDataResponse } from 'core-kit/types';
|
|
5
|
-
export declare const fetchSwapsData: ({ assets, getSwapData, signal, }: {
|
|
6
|
-
assets: Omit<SwapDataRequest, 'fromAddress'>[];
|
|
7
|
-
getSwapData: ReturnType<typeof useGetSwapData>;
|
|
8
|
-
signal: AbortSignal;
|
|
9
|
-
}) => Promise<Record<Address, SwapDataResponse>>;
|
|
10
4
|
export declare const useSwapsDataQuery: (assets: Omit<SwapDataRequest, 'fromAddress'>[], options?: Omit<UseQueryOptions<Record<Address, SwapDataResponse | null>, Error, Record<Address, SwapDataResponse | null>, [
|
|
11
5
|
string,
|
|
12
6
|
Omit<SwapDataRequest, 'fromAddress'>[]
|
|
@@ -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 {
|
|
4
|
+
export { useInitWithdrawTransactionArguments } from './use-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';
|
package/core-kit/hooks/trading/withdraw-v2/init-step/use-init-withdraw-transaction-arguments.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
interface UseInitWithdrawTransactionArguments {
|
|
2
2
|
debounceTime?: number;
|
|
3
3
|
}
|
|
4
|
-
export declare const
|
|
5
|
-
export declare const useInitWithdrawTransactionArgumentsForSimulationOnly: ({ debounceTime, }?: UseInitWithdrawTransactionArguments) => (bigint | `0x${string}` | {
|
|
6
|
-
supportedAsset: `0x${string}`;
|
|
7
|
-
withdrawData: string;
|
|
8
|
-
slippageTolerance: bigint;
|
|
9
|
-
}[])[];
|
|
4
|
+
export declare const useInitWithdrawTransactionArguments: ({ debounceTime, }?: UseInitWithdrawTransactionArguments) => (bigint | `0x${string}`)[];
|
|
10
5
|
export {};
|
|
@@ -434,54 +434,6 @@ export declare const useWithdrawalVaultAddress: () => import("wagmi").UseReadCon
|
|
|
434
434
|
}];
|
|
435
435
|
readonly stateMutability: "view";
|
|
436
436
|
readonly type: "function";
|
|
437
|
-
}, {
|
|
438
|
-
readonly inputs: readonly [{
|
|
439
|
-
readonly internalType: "address";
|
|
440
|
-
readonly name: "_dHedgeVault";
|
|
441
|
-
readonly type: "address";
|
|
442
|
-
}, {
|
|
443
|
-
readonly internalType: "uint256";
|
|
444
|
-
readonly name: "_amountIn";
|
|
445
|
-
readonly type: "uint256";
|
|
446
|
-
}, {
|
|
447
|
-
readonly components: readonly [{
|
|
448
|
-
readonly internalType: "address";
|
|
449
|
-
readonly name: "supportedAsset";
|
|
450
|
-
readonly type: "address";
|
|
451
|
-
}, {
|
|
452
|
-
readonly internalType: "bytes";
|
|
453
|
-
readonly name: "withdrawData";
|
|
454
|
-
readonly type: "bytes";
|
|
455
|
-
}, {
|
|
456
|
-
readonly internalType: "uint256";
|
|
457
|
-
readonly name: "slippageTolerance";
|
|
458
|
-
readonly type: "uint256";
|
|
459
|
-
}];
|
|
460
|
-
readonly internalType: "struct IPoolLogic.ComplexAsset[]";
|
|
461
|
-
readonly name: "_complexAssetsData";
|
|
462
|
-
readonly type: "tuple[]";
|
|
463
|
-
}];
|
|
464
|
-
readonly name: "initWithdrawal";
|
|
465
|
-
readonly outputs: readonly [{
|
|
466
|
-
readonly components: readonly [{
|
|
467
|
-
readonly internalType: "address";
|
|
468
|
-
readonly name: "token";
|
|
469
|
-
readonly type: "address";
|
|
470
|
-
}, {
|
|
471
|
-
readonly internalType: "uint256";
|
|
472
|
-
readonly name: "balance";
|
|
473
|
-
readonly type: "uint256";
|
|
474
|
-
}];
|
|
475
|
-
readonly internalType: "struct IWithdrawalVault.TrackedAsset[]";
|
|
476
|
-
readonly name: "trackedAssets";
|
|
477
|
-
readonly type: "tuple[]";
|
|
478
|
-
}, {
|
|
479
|
-
readonly internalType: "address";
|
|
480
|
-
readonly name: "vault";
|
|
481
|
-
readonly type: "address";
|
|
482
|
-
}];
|
|
483
|
-
readonly stateMutability: "nonpayable";
|
|
484
|
-
readonly type: "function";
|
|
485
437
|
}, {
|
|
486
438
|
readonly inputs: readonly [{
|
|
487
439
|
readonly internalType: "address";
|
|
@@ -499,54 +499,6 @@ export declare const useUserMulticall: ({ address, chainId, }: PoolContractCallP
|
|
|
499
499
|
}];
|
|
500
500
|
readonly stateMutability: "view";
|
|
501
501
|
readonly type: "function";
|
|
502
|
-
}, {
|
|
503
|
-
readonly inputs: readonly [{
|
|
504
|
-
readonly internalType: "address";
|
|
505
|
-
readonly name: "_dHedgeVault";
|
|
506
|
-
readonly type: "address";
|
|
507
|
-
}, {
|
|
508
|
-
readonly internalType: "uint256";
|
|
509
|
-
readonly name: "_amountIn";
|
|
510
|
-
readonly type: "uint256";
|
|
511
|
-
}, {
|
|
512
|
-
readonly components: readonly [{
|
|
513
|
-
readonly internalType: "address";
|
|
514
|
-
readonly name: "supportedAsset";
|
|
515
|
-
readonly type: "address";
|
|
516
|
-
}, {
|
|
517
|
-
readonly internalType: "bytes";
|
|
518
|
-
readonly name: "withdrawData";
|
|
519
|
-
readonly type: "bytes";
|
|
520
|
-
}, {
|
|
521
|
-
readonly internalType: "uint256";
|
|
522
|
-
readonly name: "slippageTolerance";
|
|
523
|
-
readonly type: "uint256";
|
|
524
|
-
}];
|
|
525
|
-
readonly internalType: "struct IPoolLogic.ComplexAsset[]";
|
|
526
|
-
readonly name: "_complexAssetsData";
|
|
527
|
-
readonly type: "tuple[]";
|
|
528
|
-
}];
|
|
529
|
-
readonly name: "initWithdrawal";
|
|
530
|
-
readonly outputs: readonly [{
|
|
531
|
-
readonly components: readonly [{
|
|
532
|
-
readonly internalType: "address";
|
|
533
|
-
readonly name: "token";
|
|
534
|
-
readonly type: "address";
|
|
535
|
-
}, {
|
|
536
|
-
readonly internalType: "uint256";
|
|
537
|
-
readonly name: "balance";
|
|
538
|
-
readonly type: "uint256";
|
|
539
|
-
}];
|
|
540
|
-
readonly internalType: "struct IWithdrawalVault.TrackedAsset[]";
|
|
541
|
-
readonly name: "trackedAssets";
|
|
542
|
-
readonly type: "tuple[]";
|
|
543
|
-
}, {
|
|
544
|
-
readonly internalType: "address";
|
|
545
|
-
readonly name: "vault";
|
|
546
|
-
readonly type: "address";
|
|
547
|
-
}];
|
|
548
|
-
readonly stateMutability: "nonpayable";
|
|
549
|
-
readonly type: "function";
|
|
550
502
|
}, {
|
|
551
503
|
readonly inputs: readonly [{
|
|
552
504
|
readonly internalType: "address";
|
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
import type { UseQueryResult } from '@tanstack/react-query';
|
|
2
|
-
import { usePublicClient } from 'wagmi';
|
|
3
2
|
import type { UseReadContractParameters } from 'wagmi';
|
|
4
|
-
type
|
|
3
|
+
import type { ContractId } from 'core-kit/const';
|
|
4
|
+
import type { Address } from 'core-kit/types';
|
|
5
|
+
type UseStaticCallVariables = Pick<Required<UseReadContractParameters>, 'chainId' | 'functionName'> & {
|
|
6
|
+
contractId: ContractId;
|
|
5
7
|
disabled?: boolean;
|
|
6
8
|
args: unknown[];
|
|
7
|
-
|
|
9
|
+
dynamicContractAddress?: Address;
|
|
8
10
|
};
|
|
9
|
-
export declare const
|
|
10
|
-
publicClient: ReturnType<typeof usePublicClient>;
|
|
11
|
-
}) => Promise<T | undefined>;
|
|
12
|
-
export declare const useStaticCallQuery: <T>({ disabled, functionName, address, abi, args, chainId, refetchInterval, }: UseStaticCallVariables) => UseQueryResult<T>;
|
|
11
|
+
export declare const useStaticCallQuery: <T>({ disabled, functionName, dynamicContractAddress, contractId, args, chainId, }: UseStaticCallVariables) => UseQueryResult<T>;
|
|
13
12
|
export {};
|
|
@@ -27,9 +27,6 @@ export interface TradingPanelState {
|
|
|
27
27
|
sendToken: DynamicTradingToken;
|
|
28
28
|
receiveToken: DynamicTradingToken;
|
|
29
29
|
};
|
|
30
|
-
meta: {
|
|
31
|
-
approvingStatus?: 'pending' | 'success';
|
|
32
|
-
};
|
|
33
30
|
modal: TradingPanelStateModal;
|
|
34
31
|
poolAddress: PoolConfig['address'];
|
|
35
32
|
poolConfigMap: Record<PoolConfig['address'], PoolConfig>;
|
|
@@ -43,7 +40,6 @@ export interface TradingPanelSetters {
|
|
|
43
40
|
updateReceiveTokenInput: (payload: Partial<DynamicTradingToken>) => void;
|
|
44
41
|
updateTradingSettings: (payload: Partial<TradingPanelState['settings']>) => void;
|
|
45
42
|
setTradingType: (payload: TradingPanelState['type']) => void;
|
|
46
|
-
updateTradingMeta: (payload: Partial<TradingPanelState['meta']>) => void;
|
|
47
43
|
updateTradingModal: (payload: Partial<TradingPanelState['modal']>) => void;
|
|
48
44
|
updateTransactions: (payload: UpdateTransactionsArguments) => void;
|
|
49
45
|
updatePoolFallbackData: (payload: PoolFallbackData) => void;
|
|
@@ -54,7 +50,6 @@ export interface CallbackConfig {
|
|
|
54
50
|
onUpdateReceiveTokenInput: TradingPanelSetters['updateReceiveTokenInput'];
|
|
55
51
|
onUpdateTradingSettings: TradingPanelSetters['updateTradingSettings'];
|
|
56
52
|
onSetTradingType: TradingPanelSetters['setTradingType'];
|
|
57
|
-
onUpdateTradingMeta: TradingPanelSetters['updateTradingMeta'];
|
|
58
53
|
onUpdateTradingModal: TradingPanelSetters['updateTradingModal'];
|
|
59
54
|
onUpdateTransactions: TradingPanelSetters['updateTransactions'];
|
|
60
55
|
onTradingSettleError: (error: Error) => void;
|
|
@@ -84,9 +79,6 @@ export type TradingPanelAction = {
|
|
|
84
79
|
} | {
|
|
85
80
|
type: 'UPDATE_TRADING_SETTINGS';
|
|
86
81
|
payload: Partial<TradingPanelState['settings']>;
|
|
87
|
-
} | {
|
|
88
|
-
type: 'UPDATE_TRADING_META';
|
|
89
|
-
payload: Partial<TradingPanelState['meta']>;
|
|
90
82
|
} | {
|
|
91
83
|
type: 'UPDATE_TRADING_MODAL';
|
|
92
84
|
payload: Partial<TradingPanelState['modal']>;
|
|
@@ -32,3 +32,15 @@ export interface PoolContractCallParams {
|
|
|
32
32
|
export interface PoolContractAccountCallParams extends PoolContractCallParams {
|
|
33
33
|
account: Address;
|
|
34
34
|
}
|
|
35
|
+
export interface DynamicPoolContractData {
|
|
36
|
+
userBalance: string | undefined;
|
|
37
|
+
tokenPrice: string | undefined;
|
|
38
|
+
totalValue: string | undefined;
|
|
39
|
+
totalSupply: string | undefined;
|
|
40
|
+
isPrivateVault: boolean | undefined;
|
|
41
|
+
performanceFee: string | undefined;
|
|
42
|
+
streamingFee: string | undefined;
|
|
43
|
+
entryFee: string | undefined;
|
|
44
|
+
exitFee: string | undefined;
|
|
45
|
+
managerAddress: string | undefined;
|
|
46
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import type { Address } from 'viem';
|
|
2
|
-
import type {
|
|
2
|
+
import type { useCompleteWithdrawSwapData } from 'core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-swap-data';
|
|
3
3
|
import type { useCompleteWithdrawTrackedAssets } from 'core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-tracked-assets';
|
|
4
|
-
import type { CalculateSwapDataParamsResponse } from 'core-kit/types';
|
|
5
4
|
/**
|
|
6
5
|
* Calculates the slippage tolerance for withdrawSafe.
|
|
7
6
|
* Returns an integer number from 0 to 10000,
|
|
@@ -9,7 +8,7 @@ import type { CalculateSwapDataParamsResponse } from 'core-kit/types';
|
|
|
9
8
|
* @param {string} slippage - The slippage value in % from 0 to 100.
|
|
10
9
|
* @returns {string} - The slippage tolerance.
|
|
11
10
|
*/
|
|
12
|
-
export declare const
|
|
11
|
+
export declare const getSlippageToleranceForWithdrawSafe: (slippage: number) => string;
|
|
13
12
|
export declare const buildZapDepositTransactionArguments: ({ vaultAddress, swapData, sendTokenAddress, sendTokenAmount, vaultDepositTokenAddress, minVaultTokensReceivedAmount, routerKey, swapDestinationAmount, swapSlippage, }: {
|
|
14
13
|
vaultAddress: Address;
|
|
15
14
|
swapData: string;
|
|
@@ -25,15 +24,5 @@ export declare const buildSwapWithdrawTransactionData: ({ receiveAssetAddress, s
|
|
|
25
24
|
receiveAssetAddress: Address;
|
|
26
25
|
slippage: number;
|
|
27
26
|
assets: ReturnType<typeof useCompleteWithdrawTrackedAssets>['data'];
|
|
28
|
-
swapData: ReturnType<typeof
|
|
27
|
+
swapData: ReturnType<typeof useCompleteWithdrawSwapData>['data'];
|
|
29
28
|
}) => unknown[][];
|
|
30
|
-
export declare const buildAaveWithdrawAssetTransactionData: ({ assetAddress, swapData, swapParams, slippage, }: {
|
|
31
|
-
assetAddress: Address;
|
|
32
|
-
swapParams: CalculateSwapDataParamsResponse | undefined;
|
|
33
|
-
swapData: ReturnType<typeof useSwapsDataQuery>['data'];
|
|
34
|
-
slippage: number;
|
|
35
|
-
}) => {
|
|
36
|
-
supportedAsset: `0x${string}`;
|
|
37
|
-
withdrawData: string;
|
|
38
|
-
slippageTolerance: bigint;
|
|
39
|
-
};
|
package/core-kit/utils/web3.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { Chain } from 'wagmi/chains';
|
|
1
2
|
import type { ContractId } from 'core-kit/const';
|
|
2
3
|
import type { Address, ChainId } from 'core-kit/types/web3.types';
|
|
3
4
|
export { formatUnits, formatEther, encodeFunctionData, decodeErrorResult, hexToString, trim, } from 'viem';
|
|
@@ -5,5 +6,6 @@ export declare const getContractAddressById: (contractId: ContractId, chainId: C
|
|
|
5
6
|
export declare const getContractAbiById: (contractId: ContractId) => any;
|
|
6
7
|
export declare const isZeroAddress: (address: string | undefined) => boolean;
|
|
7
8
|
export declare const shortenAddress: (address: string) => string;
|
|
9
|
+
export declare const getChainData: (chainId: number) => Chain | undefined;
|
|
8
10
|
export declare const commify: (value: string) => string;
|
|
9
11
|
export declare const isEqualAddress: (a: string | undefined, b: string | undefined) => boolean;
|