@dhedge/trading-widget 5.7.3 → 5.8.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 +52 -13
- package/{complex-withdraw-asset-data-CSbXrln9.js → complex-withdraw-asset-data-Cf9Ea0VI.js} +55 -54
- package/complex-withdraw-asset-data-Cmnlgieq.cjs +1 -0
- package/const.cjs +1 -1
- package/const.js +62 -61
- package/core-kit/abi/easy-swapper-v2.d.ts +32 -0
- package/core-kit/abi/index.d.ts +1 -1
- package/core-kit/const/default-data.d.ts +2 -2
- package/core-kit/const/network.d.ts +1 -0
- package/core-kit/hooks/pool/multicall/use-pool.static.d.ts +74 -0
- package/core-kit/hooks/pool/use-has-single-asset-withdraw-blockers.d.ts +10 -0
- package/core-kit/hooks/referral/index.d.ts +2 -1
- package/core-kit/hooks/referral/use-legacy-referral-program.d.ts +2 -0
- package/core-kit/hooks/referral/use-referral-address.d.ts +15 -0
- package/core-kit/hooks/state/action.d.ts +3 -0
- package/core-kit/hooks/state/index.d.ts +1 -1
- package/core-kit/hooks/trading/deposit-v2/use-deposit-quote-contract-read.d.ts +32 -0
- package/core-kit/hooks/trading/use-easy-swapper-tracked-assets.d.ts +32 -0
- package/core-kit/hooks/trading/withdraw-v2/complete-step/use-complete-withdraw-tracked-assets.d.ts +10 -0
- package/core-kit/hooks/trading/withdraw-v2/init-step/use-init-withdraw-estimated-receive-assets.d.ts +10 -0
- package/core-kit/hooks/trading/withdraw-v2/use-withdraw-assets-info.d.ts +10 -0
- package/core-kit/hooks/trading/withdraw-v2/use-withdrawal-vault-address.d.ts +32 -0
- package/core-kit/types/referral.types.d.ts +6 -1
- package/core-kit/types/state.types.d.ts +4 -0
- package/core-kit/utils/deposit.d.ts +4 -3
- package/index.cjs +1 -1
- package/index.d.ts +4 -4
- package/index.js +3128 -3014
- package/package.json +1 -1
- package/storage-Bbr6G6F3.cjs +1 -0
- package/{storage-C-fGORin.js → storage-DhvdxqW3.js} +392 -337
- package/style.css +1 -1
- package/trading-widget/components/deposit/meta/projected-earnings-cards/projected-earnings-cards.d.ts +2 -0
- package/trading-widget/components/deposit/meta/transaction-disclosure/transaction-disclosure.hooks.d.ts +0 -1
- package/trading-widget/components/widget/widget-input/widget-input.utils.d.ts +2 -0
- package/trading-widget/components/widget/widget-settings/slippage-selector/slippage-selector.hooks.d.ts +2 -0
- package/trading-widget/providers/config-provider/config-provider.types.d.ts +1 -1
- package/trading-widget/providers/config-provider/index.d.ts +1 -0
- package/trading-widget/providers/config-provider/use-resolved-default-withdraw-slippage.d.ts +1 -0
- package/trading-widget/providers/theme-provider/theme-provider.types.d.ts +1 -0
- package/utils.cjs +1 -1
- package/utils.js +1 -1
- package/complex-withdraw-asset-data-PUJePMgr.cjs +0 -1
- package/core-kit/abi/pool-factory.d.ts +0 -57
- package/core-kit/hooks/referral/use-referral-program.d.ts +0 -2
- package/storage-DpKnvEM4.cjs +0 -1
|
@@ -457,6 +457,10 @@ export declare const useWithdrawalVaultAddress: () => import("wagmi").UseReadCon
|
|
|
457
457
|
readonly internalType: "uint256";
|
|
458
458
|
readonly name: "_expectedAmountReceived";
|
|
459
459
|
readonly type: "uint256";
|
|
460
|
+
}, {
|
|
461
|
+
readonly internalType: "bytes";
|
|
462
|
+
readonly name: "_referralData";
|
|
463
|
+
readonly type: "bytes";
|
|
460
464
|
}];
|
|
461
465
|
readonly name: "deposit";
|
|
462
466
|
readonly outputs: readonly [];
|
|
@@ -501,6 +505,10 @@ export declare const useWithdrawalVaultAddress: () => import("wagmi").UseReadCon
|
|
|
501
505
|
readonly internalType: "uint256";
|
|
502
506
|
readonly name: "_expectedAmountReceived";
|
|
503
507
|
readonly type: "uint256";
|
|
508
|
+
}, {
|
|
509
|
+
readonly internalType: "bytes";
|
|
510
|
+
readonly name: "_referralData";
|
|
511
|
+
readonly type: "bytes";
|
|
504
512
|
}];
|
|
505
513
|
readonly name: "depositWithCustomCooldown";
|
|
506
514
|
readonly outputs: readonly [];
|
|
@@ -717,6 +725,10 @@ export declare const useWithdrawalVaultAddress: () => import("wagmi").UseReadCon
|
|
|
717
725
|
readonly internalType: "uint256";
|
|
718
726
|
readonly name: "_expectedAmountReceived";
|
|
719
727
|
readonly type: "uint256";
|
|
728
|
+
}, {
|
|
729
|
+
readonly internalType: "bytes";
|
|
730
|
+
readonly name: "_referralData";
|
|
731
|
+
readonly type: "bytes";
|
|
720
732
|
}];
|
|
721
733
|
readonly name: "nativeDeposit";
|
|
722
734
|
readonly outputs: readonly [];
|
|
@@ -731,6 +743,10 @@ export declare const useWithdrawalVaultAddress: () => import("wagmi").UseReadCon
|
|
|
731
743
|
readonly internalType: "uint256";
|
|
732
744
|
readonly name: "_expectedAmountReceived";
|
|
733
745
|
readonly type: "uint256";
|
|
746
|
+
}, {
|
|
747
|
+
readonly internalType: "bytes";
|
|
748
|
+
readonly name: "_referralData";
|
|
749
|
+
readonly type: "bytes";
|
|
734
750
|
}];
|
|
735
751
|
readonly name: "nativeDepositWithCustomCooldown";
|
|
736
752
|
readonly outputs: readonly [];
|
|
@@ -995,6 +1011,10 @@ export declare const useWithdrawalVaultAddress: () => import("wagmi").UseReadCon
|
|
|
995
1011
|
readonly internalType: "uint256";
|
|
996
1012
|
readonly name: "_expectedAmountReceived";
|
|
997
1013
|
readonly type: "uint256";
|
|
1014
|
+
}, {
|
|
1015
|
+
readonly internalType: "bytes";
|
|
1016
|
+
readonly name: "_referralData";
|
|
1017
|
+
readonly type: "bytes";
|
|
998
1018
|
}];
|
|
999
1019
|
readonly name: "zapDeposit";
|
|
1000
1020
|
readonly outputs: readonly [];
|
|
@@ -1053,6 +1073,10 @@ export declare const useWithdrawalVaultAddress: () => import("wagmi").UseReadCon
|
|
|
1053
1073
|
readonly internalType: "uint256";
|
|
1054
1074
|
readonly name: "_expectedAmountReceived";
|
|
1055
1075
|
readonly type: "uint256";
|
|
1076
|
+
}, {
|
|
1077
|
+
readonly internalType: "bytes";
|
|
1078
|
+
readonly name: "_referralData";
|
|
1079
|
+
readonly type: "bytes";
|
|
1056
1080
|
}];
|
|
1057
1081
|
readonly name: "zapDepositWithCustomCooldown";
|
|
1058
1082
|
readonly outputs: readonly [];
|
|
@@ -1111,6 +1135,10 @@ export declare const useWithdrawalVaultAddress: () => import("wagmi").UseReadCon
|
|
|
1111
1135
|
readonly internalType: "uint256";
|
|
1112
1136
|
readonly name: "_expectedAmountReceived";
|
|
1113
1137
|
readonly type: "uint256";
|
|
1138
|
+
}, {
|
|
1139
|
+
readonly internalType: "bytes";
|
|
1140
|
+
readonly name: "_referralData";
|
|
1141
|
+
readonly type: "bytes";
|
|
1114
1142
|
}];
|
|
1115
1143
|
readonly name: "zapNativeDeposit";
|
|
1116
1144
|
readonly outputs: readonly [];
|
|
@@ -1169,6 +1197,10 @@ export declare const useWithdrawalVaultAddress: () => import("wagmi").UseReadCon
|
|
|
1169
1197
|
readonly internalType: "uint256";
|
|
1170
1198
|
readonly name: "_expectedAmountReceived";
|
|
1171
1199
|
readonly type: "uint256";
|
|
1200
|
+
}, {
|
|
1201
|
+
readonly internalType: "bytes";
|
|
1202
|
+
readonly name: "_referralData";
|
|
1203
|
+
readonly type: "bytes";
|
|
1172
1204
|
}];
|
|
1173
1205
|
readonly name: "zapNativeDepositWithCustomCooldown";
|
|
1174
1206
|
readonly outputs: readonly [];
|
|
@@ -1,9 +1,14 @@
|
|
|
1
|
+
import type { Address, Hex } from '../types/web3.types';
|
|
2
|
+
export interface ReferralData {
|
|
3
|
+
referrerAddress: Address | undefined;
|
|
4
|
+
referralData: Hex | undefined;
|
|
5
|
+
}
|
|
1
6
|
export interface TagInvestorByReferrerCallbackVariables {
|
|
2
7
|
poolAddress: string;
|
|
3
8
|
referrerAddress: string;
|
|
4
9
|
investorAddress: string;
|
|
5
10
|
}
|
|
6
|
-
export interface
|
|
11
|
+
export interface UseLegacyReferralProgramProps {
|
|
7
12
|
vaultAddress: string;
|
|
8
13
|
userAddress?: string | null;
|
|
9
14
|
query: Record<string, string | string[] | undefined>;
|
|
@@ -34,6 +34,8 @@ export interface TradingPanelState {
|
|
|
34
34
|
availableAggregators: string[];
|
|
35
35
|
selectedAggregators: string[];
|
|
36
36
|
isBatchTransactionsEnabled: boolean;
|
|
37
|
+
isForceSendEnabled?: boolean;
|
|
38
|
+
forceSendGas?: number;
|
|
37
39
|
};
|
|
38
40
|
swapQuoteRefreshTriggered: 'deposit' | 'withdraw' | null;
|
|
39
41
|
type: TradingPanelType;
|
|
@@ -90,6 +92,7 @@ export interface CallbackConfig {
|
|
|
90
92
|
signal: AbortSignal;
|
|
91
93
|
variables: SwapDataRequest;
|
|
92
94
|
}) => Promise<SwapDataResponse[] | null>;
|
|
95
|
+
getReferrerAddress: (userAddress: Address) => Promise<Address | undefined>;
|
|
93
96
|
}
|
|
94
97
|
export type TradingPanelAction = {
|
|
95
98
|
type: 'SET_POOL_ADDRESS';
|
|
@@ -144,4 +147,5 @@ export type TradingPanelActionsState = TradingPanelSetters & {
|
|
|
144
147
|
onLog: CallbackConfig['onLog'] | undefined;
|
|
145
148
|
onSimulateTransaction: CallbackConfig['onSimulateTransaction'] | undefined;
|
|
146
149
|
getSwapQuotes: CallbackConfig['getSwapQuotes'];
|
|
150
|
+
getReferrerAddress: CallbackConfig['getReferrerAddress'] | undefined;
|
|
147
151
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SwapDataResponse } from '@shared/types';
|
|
2
2
|
import type { DepositMethodName, EstimateCall, VaultDepositParams } from '../types';
|
|
3
|
-
import type { Address } from '../types/web3.types';
|
|
3
|
+
import type { Address, Hex } from '../types/web3.types';
|
|
4
4
|
export type DepositArguments = [Address, string, {
|
|
5
5
|
value: string;
|
|
6
6
|
}] | [Address, Address, string, string] | [...unknown[], {
|
|
@@ -19,7 +19,8 @@ export interface BuildZapDepositArgsParams {
|
|
|
19
19
|
depositSlippage: number;
|
|
20
20
|
sendTokenAddress: Address;
|
|
21
21
|
depositMethod: VaultDepositParams['depositMethod'];
|
|
22
|
+
referralData?: Hex;
|
|
22
23
|
}
|
|
23
|
-
export declare const buildDepositTransactionArgumentsForMethod: (depositMethod: VaultDepositParams['depositMethod'], baseArgs: BuildZapDepositArgsParams['baseArgs'], zapArguments?: unknown[]) => DepositArguments;
|
|
24
|
-
export declare const buildZapDepositArguments: ({ baseArgs, swapQuotes, estimate, depositSlippage, sendTokenAddress, depositMethod, }: BuildZapDepositArgsParams) => Promise<DepositArguments>;
|
|
24
|
+
export declare const buildDepositTransactionArgumentsForMethod: (depositMethod: VaultDepositParams['depositMethod'], baseArgs: BuildZapDepositArgsParams['baseArgs'], zapArguments?: unknown[], referralData?: Hex) => DepositArguments;
|
|
25
|
+
export declare const buildZapDepositArguments: ({ baseArgs, swapQuotes, estimate, depositSlippage, sendTokenAddress, depositMethod, referralData, }: BuildZapDepositArgsParams) => Promise<DepositArguments>;
|
|
25
26
|
export declare const isZapDepositMethod: (depositMethod: DepositMethodName) => boolean;
|