@dhedge/trading-widget 3.17.0 → 3.18.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 +31 -24
- package/core-kit/const/default-data.d.ts +1 -0
- package/core-kit/const/links.d.ts +1 -0
- package/core-kit/hooks/pool/use-pool-dynamic-exit-remaining-cooldown.d.ts +1 -1
- package/core-kit/hooks/state/action.d.ts +2 -0
- package/core-kit/hooks/trading/deposit-v2/deposit-transaction/use-batch-approve-transaction.d.ts +141 -0
- package/core-kit/hooks/trading/deposit-v2/deposit-transaction/use-batch-deposit.d.ts +1 -0
- package/core-kit/hooks/trading/deposit-v2/deposit-transaction/use-deposit-common.d.ts +6 -0
- package/core-kit/hooks/trading/deposit-v2/index.d.ts +1 -1
- package/core-kit/hooks/trading/index.d.ts +3 -3
- package/core-kit/hooks/trading/trade-handlers/use-batch-trading-settle-handler.d.ts +5 -0
- package/core-kit/hooks/web3/index.d.ts +1 -0
- package/core-kit/hooks/web3/use-custom-send-calls.d.ts +14 -0
- package/core-kit/hooks/web3/use-is-batch-contract-writes-supported.d.ts +1 -0
- package/core-kit/types/state.types.d.ts +2 -0
- package/core-kit/types/trading-panel.types.d.ts +2 -1
- package/index.cjs +53 -53
- package/index.d.ts +1 -1
- package/index.js +11680 -11495
- package/package.json +4 -4
- package/style.css +1 -1
- package/trading-widget/components/deposit/button/batch-trade-button.d.ts +2 -0
- package/trading-widget/components/deposit/button/deposit-trade-button.hooks.d.ts +7 -0
- package/trading-widget/components/deposit/button/single-trade-button.d.ts +2 -0
- package/trading-widget/components/deposit/button/valid-deposit-button/valid-deposit-button.d.ts +2 -2
- package/trading-widget/components/deposit/button/valid-deposit-button/valid-deposit-button.hooks.d.ts +1 -0
- package/trading-widget/components/deposit/meta/batched-transaction-tip.d.ts +2 -0
- package/trading-widget/components/deposit/meta/batched-transaction-tip.hooks.d.ts +3 -0
- package/trading-widget/components/widget/widget-settings/batch-transactions-switch/batch-transactions-switch.d.ts +6 -0
- package/trading-widget/components/widget/widget-settings/batch-transactions-switch/batch-transactions-switch.hooks.d.ts +1 -0
- package/trading-widget/components/widget/widget-settings/index.d.ts +1 -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 -0
- package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +6 -0
- package/trading-widget/components/deposit/button/trade-button/trade-button.d.ts +0 -2
- package/trading-widget/components/deposit/button/trade-button/trade-button.hooks.d.ts +0 -6
- /package/core-kit/hooks/trading/deposit-v2/{use-deposit.d.ts → deposit-transaction/use-deposit.d.ts} +0 -0
- /package/core-kit/hooks/trading/{use-handle-trade.d.ts → trade-handlers/use-handle-trade.d.ts} +0 -0
- /package/core-kit/hooks/trading/{use-trading-result-handling.d.ts → trade-handlers/use-trading-result-handling.d.ts} +0 -0
- /package/core-kit/hooks/trading/{use-trading-settle-handler.d.ts → trade-handlers/use-trading-settle-handler.d.ts} +0 -0
package/README.md
CHANGED
|
@@ -57,7 +57,7 @@ Top level provider component. Headless part of trading logic. API handles params
|
|
|
57
57
|
> | name | type | default value | description |
|
|
58
58
|
> | ------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ------------- | --------------------------------------------------------------------------------- |
|
|
59
59
|
> | `onUpdateSendTokenInput` | (payload: Partial\<{ address: `Address`; symbol: `string`; value: `string`; decimals: `number`; isLoading?: `boolean` }\>) => void | undefined | triggers on send token change |
|
|
60
|
-
> | `onUpdateTradingSettings` | (payload: Partial\<{ slippage: `number \| 'auto'`; minSlippage?: `number` isInfiniteAllowance: `boolean`; isMultiAssetWithdrawalEnabled: `boolean`; isMaxSlippageLoading: `boolean` }\>) => void
|
|
60
|
+
> | `onUpdateTradingSettings` | (payload: Partial\<{ slippage: `number \| 'auto'`; minSlippage?: `number` isInfiniteAllowance: `boolean`; isMultiAssetWithdrawalEnabled: `boolean`; isCustomDepositOptionsDisabled?: `boolean`; isMaxSlippageLoading: `boolean` }\>) => void | undefined | triggers on trading settings change |
|
|
61
61
|
> | `onSetTradingType` | (payload: `'deposit' \| 'withdraw'`) => void | undefined | triggers on trading type change |
|
|
62
62
|
> | `onUpdateTradingModal` | (payload: Partial\<{ isOpen: `boolean`; status: `'Success' \| 'None' \| 'Mining' \| 'Wallet'` }\>) => void | undefined | triggers on trading modal change |
|
|
63
63
|
> | `onUpdateTransactions` | (payload: AddTransaction \| UpdateTransaction \| RemoveTransaction) => void | undefined | triggers on transaction action change |
|
|
@@ -81,18 +81,18 @@ Top level provider component. Headless part of trading logic. API handles params
|
|
|
81
81
|
<details>
|
|
82
82
|
<summary><code>initialState</code> <code><b>/</b></code> <code>Optional initial state of trading panel</code></summary>
|
|
83
83
|
|
|
84
|
-
> | name | type
|
|
85
|
-
> | ------------------ |
|
|
86
|
-
> | `poolAddress` | Address
|
|
87
|
-
> | `poolConfigMap` | Record<Address, PoolConfig>
|
|
88
|
-
> | `settings` | { slippage: `number \| 'auto'`; minSlippage?: `number`; isInfiniteAllowance: `boolean`; isMultiAssetWithdrawalEnabled: `boolean`; isMaxSlippageLoading: `boolean`; availableAggregators: `string[]` }
|
|
89
|
-
> | `type` | 'deposit' \| 'withdraw'
|
|
90
|
-
> | `input` | { sendToken: { address: `Address`; symbol: `string`; value: `string`; decimals: `number`; isLoading?: `boolean` }; receiveToken: { address: `Address`; symbol: `string`; value: `string`; decimals: `number`; isLoading?: `boolean` } }
|
|
91
|
-
> | `entryFee` | { deposit: `number`; depositWithCustomCooldown: `number`; }
|
|
92
|
-
> | `modal` | { isOpen: `boolean`; status: `'Success' \| 'None' \| 'Mining' \| 'Wallet'`; action: `'deposit' \| 'withdraw' \| 'approve \`; link?: `string`; sendToken: TradingToken \| null; receiveToken: TradingToken \| null }
|
|
93
|
-
> | `transactions` | { action: `'deposit' \| 'withdraw' \| 'approve'`; symbol: `string`; chainId: `ChainId`; txHash?: `Address` }[]
|
|
94
|
-
> | `poolFallbackData` | { address: `Address`; managerLogicAddress?: `Address`; poolCompositions: `PoolComposition[]`; tokenPrice?: `string`; apy?: { value: `number`; currency: `'USD' \| 'ETH'` } }
|
|
95
|
-
> | `defaultChainId` | number (optional)
|
|
84
|
+
> | name | type | default value | description |
|
|
85
|
+
> | ------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------ | ----------------------------------------------------------------------------------------------- |
|
|
86
|
+
> | `poolAddress` | Address | `AddressZero` | Current active pool address |
|
|
87
|
+
> | `poolConfigMap` | Record<Address, PoolConfig> | `{}` | Map of pool configs available for trading |
|
|
88
|
+
> | `settings` | { slippage: `number \| 'auto'`; minSlippage?: `number`; isInfiniteAllowance: `boolean`; isMultiAssetWithdrawalEnabled: `boolean`; isCustomDepositOptionsDisabled?: `boolean`; isMaxSlippageLoading: `boolean`; availableAggregators: `string[]` } | { slippage: `'auto'`; isInfiniteAllowance: `false`; isMultiAssetWithdrawalEnabled: `true`; isMaxSlippageLoading: `false`; availableAggregators: `[]` } | Panel settings |
|
|
89
|
+
> | `type` | 'deposit' \| 'withdraw' | `'deposit'` | Trading type |
|
|
90
|
+
> | `input` | { sendToken: { address: `Address`; symbol: `string`; value: `string`; decimals: `number`; isLoading?: `boolean` }; receiveToken: { address: `Address`; symbol: `string`; value: `string`; decimals: `number`; isLoading?: `boolean` } } | `poolConfigMap[poolAddress]` | Send/receive tokens pair |
|
|
91
|
+
> | `entryFee` | { deposit: `number`; depositWithCustomCooldown: `number`; } | { deposit: `0`; depositWithCustomCooldown: `0.1` } | Entry fee config map |
|
|
92
|
+
> | `modal` | { isOpen: `boolean`; status: `'Success' \| 'None' \| 'Mining' \| 'Wallet'`; action: `'deposit' \| 'withdraw' \| 'approve \`; link?: `string`; sendToken: TradingToken \| null; receiveToken: TradingToken \| null } | `{ isOpen: `false`,status: `'None'`, receiveToken: `null`, sendToken: `null` }` | Trading modal state |
|
|
93
|
+
> | `transactions` | { action: `'deposit' \| 'withdraw' \| 'approve'`; symbol: `string`; chainId: `ChainId`; txHash?: `Address` }[] | `[]` | Pending transactions |
|
|
94
|
+
> | `poolFallbackData` | { address: `Address`; managerLogicAddress?: `Address`; poolCompositions: `PoolComposition[]`; tokenPrice?: `string`; apy?: { value: `number`; currency: `'USD' \| 'ETH'` } } | { address: `AddressZero` } | Current active pool fallback data to override or extend contract's response |
|
|
95
|
+
> | `defaultChainId` | number (optional) | undefined | Chain id that will be returned from useNetwork wagmi hook when connected to unsupported network |
|
|
96
96
|
|
|
97
97
|
###### Source: `packages/trading-widget/src/core-kit/providers/index.tsx`
|
|
98
98
|
|
|
@@ -126,6 +126,7 @@ UI configuration provider. Manages params to configure custom styling, component
|
|
|
126
126
|
> | `termsOfUseAccepted` | `boolean` | `true` | Requires user to confirm terms of use by rendering DepositTermsOfUse component before deposit action |
|
|
127
127
|
> | `standalone` | `boolean` | `true` | Handles token selection in SPA mode |
|
|
128
128
|
> | `isAllAssetsWithdrawOptionDefault` | `boolean` | `false` | Sets "All Assets" withdraw option by default |
|
|
129
|
+
> | `isCustomDepositOptionsDisabled` | `boolean` | `false` | When enabled, excludes custom deposit tokens and native tokens from deposit options. Only vault's default deposit tokens are available. |
|
|
129
130
|
> | `chainConfig` | `Partial<Record<ChainId, { name: string; iconPath: string }>>` | `{}` | Sets map of chain `name` and `iconPath` |
|
|
130
131
|
> | `aaveOffchainWithdrawMinValue` | `number` | `50` | Value in USD when off-chain Aave withdrawal is enabled |
|
|
131
132
|
> | `getFallbackIconPath` | `(tokenName: string) => string` | `buildIconLink` | Fallback token icon path getter |
|
|
@@ -150,17 +151,17 @@ UI configuration provider. Manages params to configure custom styling, component
|
|
|
150
151
|
<code>Custom components to be injected into widget layout</code>
|
|
151
152
|
</summary>
|
|
152
153
|
|
|
153
|
-
> | name | type | default value | description
|
|
154
|
-
> | ------------------- | ----------------------------------- | ------------------- |
|
|
155
|
-
> | `GeoBlockAlert` | ComponentType | `<GeoBlockAlert>` | Component replaces deposit button while `isGeoBlocked` config param is set to `true`
|
|
156
|
-
> | `SanctionedAlert` | ComponentType | `<SanctionedAlert>` | Component replaces deposit button while `isSanctioned` config param is set to `true`
|
|
157
|
-
> | `DepositMetaInfo` | ComponentType | `undefined` | Component is injected into deposit meta part of widget layout nearby TransactionOverviewDisclosure
|
|
158
|
-
> | `WithdrawMetaInfo` | ComponentType | `undefined` | Component is injected into withdraw meta part of widget layout nearby WithdrawTransactionOverviewDisclosure
|
|
159
|
-
> | `CustomDepositMeta` | ComponentType | `undefined` | Custom extra component injected above deposit meta section in the deposit tab panel (e.g., chart, info, etc.)
|
|
160
|
-
> | `Image` | ComponentType<ImageProps> | `<img>` | Component optionally can be used to pass `nextjs` Image component to be used for assets rendering
|
|
161
|
-
> | `LogoSpinner` | ComponentType<SVGProps<SVGElement>> | `<Spinner>` | Component is injected into widget pending transaction overlay. Assume using of spinning animation
|
|
162
|
-
> | `DepositTermsOfUse` | ComponentType | `undefined` | Component is injected into `TermsOfUseOverlay` to extend default terms of use statement points
|
|
163
|
-
> | `ActionButton` | ComponentType | `<ActionButton>` | Component overrides default `ActionButton` and has `ButtonProps` API
|
|
154
|
+
> | name | type | default value | description |
|
|
155
|
+
> | ------------------- | ----------------------------------- | ------------------- | ------------------------------------------------------------------------------------------------------------- |
|
|
156
|
+
> | `GeoBlockAlert` | ComponentType | `<GeoBlockAlert>` | Component replaces deposit button while `isGeoBlocked` config param is set to `true` |
|
|
157
|
+
> | `SanctionedAlert` | ComponentType | `<SanctionedAlert>` | Component replaces deposit button while `isSanctioned` config param is set to `true` |
|
|
158
|
+
> | `DepositMetaInfo` | ComponentType | `undefined` | Component is injected into deposit meta part of widget layout nearby TransactionOverviewDisclosure |
|
|
159
|
+
> | `WithdrawMetaInfo` | ComponentType | `undefined` | Component is injected into withdraw meta part of widget layout nearby WithdrawTransactionOverviewDisclosure |
|
|
160
|
+
> | `CustomDepositMeta` | ComponentType | `undefined` | Custom extra component injected above deposit meta section in the deposit tab panel (e.g., chart, info, etc.) |
|
|
161
|
+
> | `Image` | ComponentType<ImageProps> | `<img>` | Component optionally can be used to pass `nextjs` Image component to be used for assets rendering |
|
|
162
|
+
> | `LogoSpinner` | ComponentType<SVGProps<SVGElement>> | `<Spinner>` | Component is injected into widget pending transaction overlay. Assume using of spinning animation |
|
|
163
|
+
> | `DepositTermsOfUse` | ComponentType | `undefined` | Component is injected into `TermsOfUseOverlay` to extend default terms of use statement points |
|
|
164
|
+
> | `ActionButton` | ComponentType | `<ActionButton>` | Component overrides default `ActionButton` and has `ButtonProps` API |
|
|
164
165
|
|
|
165
166
|
###### Source: `packages/trading-widget/src/trading-widget/providers/component-provider/component-provider.tsx`
|
|
166
167
|
|
|
@@ -546,6 +547,12 @@ path: `component.meta[name]`
|
|
|
546
547
|
> | `proceedWithNextStep` | string | Please proceed with the next step. | |
|
|
547
548
|
> | `aggregatorsLabel` | string | Swap source | |
|
|
548
549
|
> | `aggregatorsTooltip` | string | Choose which aggregators to use for your trades. | |
|
|
550
|
+
> | `batchTransactionsLabel` | string | Batch transactions | |
|
|
551
|
+
> | `batchTransactionsSwitchLabel` | string | Batch | |
|
|
552
|
+
> | `batchTransactionsTooltip` | string | Group approve and trade calls into a single batch transaction. Disable if you prefer separate prompts. | |
|
|
553
|
+
> | `seamlessOneClickTrading` | string | Seamless one-click trading | |
|
|
554
|
+
> | `approveDepositPrefix` | string | Approve & deposit in a | |
|
|
555
|
+
> | `singleTransaction` | string | single transaction | |
|
|
549
556
|
|
|
550
557
|
###### Source: `packages/trading-widget/src/trading-widget/providers/translation-provider/translation-provider.tsx`
|
|
551
558
|
|
|
@@ -4,6 +4,7 @@ export declare const DEFAULT_PRECISION = 18;
|
|
|
4
4
|
export declare const EXTENDED_POLLING_INTERVAL = 59000;
|
|
5
5
|
export declare const DEFAULT_POLLING_INTERVAL = 30000;
|
|
6
6
|
export declare const SHORTEN_POLLING_INTERVAL = 15000;
|
|
7
|
+
export declare const EXTREMELY_SHORT_POLLING_INTERVAL = 5000;
|
|
7
8
|
export declare const DEFAULT_DEBOUNCE_TIME = 400;
|
|
8
9
|
export declare const EXTENDED_DEBOUNCE_TIME: number;
|
|
9
10
|
export declare const DEFAULT_LOCK_TIME: string;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare const PYTH_API_LINK = "https://hermes.pyth.network";
|
|
2
2
|
export declare const FLAT_MONEY_UNIT_LINK = "https://flat.money/flatcoin";
|
|
3
3
|
export declare const FLAT_MONEY_V1_UNIT_LINK = "https://v1.flat.money/flatcoin";
|
|
4
|
+
export declare const EIP5792_LINK = "https://www.eip5792.xyz";
|
|
@@ -4,7 +4,7 @@ interface PoolExitRemainingCooldownParams {
|
|
|
4
4
|
chainId: ChainId;
|
|
5
5
|
}
|
|
6
6
|
export declare const REFETCH_INTERVALS: readonly [readonly [number, 5000], readonly [number, 10000], readonly [number, 20000]];
|
|
7
|
-
export declare const getRefetchInterval: (cooldownMs: number) => false | 59000 |
|
|
7
|
+
export declare const getRefetchInterval: (cooldownMs: number) => false | 59000 | 5000 | 10000 | 20000;
|
|
8
8
|
export declare const usePoolDynamicExitRemainingCooldown: ({ address, chainId, }: PoolExitRemainingCooldownParams) => import("wagmi").UseReadContractReturnType<readonly [{
|
|
9
9
|
readonly inputs: readonly [{
|
|
10
10
|
readonly internalType: "address";
|
|
@@ -7,9 +7,11 @@ export declare const useUpdateTradingSettings: () => (payload: Partial<{
|
|
|
7
7
|
minSlippage?: number | undefined;
|
|
8
8
|
isInfiniteAllowance: boolean;
|
|
9
9
|
isMultiAssetWithdrawalEnabled: boolean;
|
|
10
|
+
isCustomDepositOptionsDisabled?: boolean | undefined;
|
|
10
11
|
isMaxSlippageLoading: boolean;
|
|
11
12
|
availableAggregators: string[];
|
|
12
13
|
selectedAggregators: string[];
|
|
14
|
+
isBatchTransactionsEnabled: boolean;
|
|
13
15
|
}>) => void;
|
|
14
16
|
export declare const useSetTradingType: () => (payload: import("core-kit/types").TradingPanelType) => void;
|
|
15
17
|
export declare const useUpdateTradingModal: () => (payload: Partial<import("core-kit/types").TradingPanelStateModal>) => void;
|
package/core-kit/hooks/trading/deposit-v2/deposit-transaction/use-batch-approve-transaction.d.ts
ADDED
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
export declare const useBatchApproveTransaction: () => {
|
|
2
|
+
address: `0x${string}`;
|
|
3
|
+
abi: readonly [{
|
|
4
|
+
readonly type: "event";
|
|
5
|
+
readonly name: "Approval";
|
|
6
|
+
readonly inputs: readonly [{
|
|
7
|
+
readonly indexed: true;
|
|
8
|
+
readonly name: "owner";
|
|
9
|
+
readonly type: "address";
|
|
10
|
+
}, {
|
|
11
|
+
readonly indexed: true;
|
|
12
|
+
readonly name: "spender";
|
|
13
|
+
readonly type: "address";
|
|
14
|
+
}, {
|
|
15
|
+
readonly indexed: false;
|
|
16
|
+
readonly name: "value";
|
|
17
|
+
readonly type: "uint256";
|
|
18
|
+
}];
|
|
19
|
+
}, {
|
|
20
|
+
readonly type: "event";
|
|
21
|
+
readonly name: "Transfer";
|
|
22
|
+
readonly inputs: readonly [{
|
|
23
|
+
readonly indexed: true;
|
|
24
|
+
readonly name: "from";
|
|
25
|
+
readonly type: "address";
|
|
26
|
+
}, {
|
|
27
|
+
readonly indexed: true;
|
|
28
|
+
readonly name: "to";
|
|
29
|
+
readonly type: "address";
|
|
30
|
+
}, {
|
|
31
|
+
readonly indexed: false;
|
|
32
|
+
readonly name: "value";
|
|
33
|
+
readonly type: "uint256";
|
|
34
|
+
}];
|
|
35
|
+
}, {
|
|
36
|
+
readonly type: "function";
|
|
37
|
+
readonly name: "allowance";
|
|
38
|
+
readonly stateMutability: "view";
|
|
39
|
+
readonly inputs: readonly [{
|
|
40
|
+
readonly name: "owner";
|
|
41
|
+
readonly type: "address";
|
|
42
|
+
}, {
|
|
43
|
+
readonly name: "spender";
|
|
44
|
+
readonly type: "address";
|
|
45
|
+
}];
|
|
46
|
+
readonly outputs: readonly [{
|
|
47
|
+
readonly type: "uint256";
|
|
48
|
+
}];
|
|
49
|
+
}, {
|
|
50
|
+
readonly type: "function";
|
|
51
|
+
readonly name: "approve";
|
|
52
|
+
readonly stateMutability: "nonpayable";
|
|
53
|
+
readonly inputs: readonly [{
|
|
54
|
+
readonly name: "spender";
|
|
55
|
+
readonly type: "address";
|
|
56
|
+
}, {
|
|
57
|
+
readonly name: "amount";
|
|
58
|
+
readonly type: "uint256";
|
|
59
|
+
}];
|
|
60
|
+
readonly outputs: readonly [{
|
|
61
|
+
readonly type: "bool";
|
|
62
|
+
}];
|
|
63
|
+
}, {
|
|
64
|
+
readonly type: "function";
|
|
65
|
+
readonly name: "balanceOf";
|
|
66
|
+
readonly stateMutability: "view";
|
|
67
|
+
readonly inputs: readonly [{
|
|
68
|
+
readonly name: "account";
|
|
69
|
+
readonly type: "address";
|
|
70
|
+
}];
|
|
71
|
+
readonly outputs: readonly [{
|
|
72
|
+
readonly type: "uint256";
|
|
73
|
+
}];
|
|
74
|
+
}, {
|
|
75
|
+
readonly type: "function";
|
|
76
|
+
readonly name: "decimals";
|
|
77
|
+
readonly stateMutability: "view";
|
|
78
|
+
readonly inputs: readonly [];
|
|
79
|
+
readonly outputs: readonly [{
|
|
80
|
+
readonly type: "uint8";
|
|
81
|
+
}];
|
|
82
|
+
}, {
|
|
83
|
+
readonly type: "function";
|
|
84
|
+
readonly name: "name";
|
|
85
|
+
readonly stateMutability: "view";
|
|
86
|
+
readonly inputs: readonly [];
|
|
87
|
+
readonly outputs: readonly [{
|
|
88
|
+
readonly type: "string";
|
|
89
|
+
}];
|
|
90
|
+
}, {
|
|
91
|
+
readonly type: "function";
|
|
92
|
+
readonly name: "symbol";
|
|
93
|
+
readonly stateMutability: "view";
|
|
94
|
+
readonly inputs: readonly [];
|
|
95
|
+
readonly outputs: readonly [{
|
|
96
|
+
readonly type: "string";
|
|
97
|
+
}];
|
|
98
|
+
}, {
|
|
99
|
+
readonly type: "function";
|
|
100
|
+
readonly name: "totalSupply";
|
|
101
|
+
readonly stateMutability: "view";
|
|
102
|
+
readonly inputs: readonly [];
|
|
103
|
+
readonly outputs: readonly [{
|
|
104
|
+
readonly type: "uint256";
|
|
105
|
+
}];
|
|
106
|
+
}, {
|
|
107
|
+
readonly type: "function";
|
|
108
|
+
readonly name: "transfer";
|
|
109
|
+
readonly stateMutability: "nonpayable";
|
|
110
|
+
readonly inputs: readonly [{
|
|
111
|
+
readonly name: "recipient";
|
|
112
|
+
readonly type: "address";
|
|
113
|
+
}, {
|
|
114
|
+
readonly name: "amount";
|
|
115
|
+
readonly type: "uint256";
|
|
116
|
+
}];
|
|
117
|
+
readonly outputs: readonly [{
|
|
118
|
+
readonly type: "bool";
|
|
119
|
+
}];
|
|
120
|
+
}, {
|
|
121
|
+
readonly type: "function";
|
|
122
|
+
readonly name: "transferFrom";
|
|
123
|
+
readonly stateMutability: "nonpayable";
|
|
124
|
+
readonly inputs: readonly [{
|
|
125
|
+
readonly name: "sender";
|
|
126
|
+
readonly type: "address";
|
|
127
|
+
}, {
|
|
128
|
+
readonly name: "recipient";
|
|
129
|
+
readonly type: "address";
|
|
130
|
+
}, {
|
|
131
|
+
readonly name: "amount";
|
|
132
|
+
readonly type: "uint256";
|
|
133
|
+
}];
|
|
134
|
+
readonly outputs: readonly [{
|
|
135
|
+
readonly type: "bool";
|
|
136
|
+
}];
|
|
137
|
+
}];
|
|
138
|
+
functionName: string;
|
|
139
|
+
chainId: number;
|
|
140
|
+
args: string[];
|
|
141
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useBatchDeposit: () => () => Promise<void>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { useDeposit } from './use-deposit';
|
|
1
|
+
export { useDeposit } from './deposit-transaction/use-deposit';
|
|
2
2
|
export { useDepositAllowance } from './use-deposit-allowance';
|
|
3
3
|
export { useDepositQuote } from './use-deposit-quote';
|
|
4
4
|
export { useDepositQuoteContractRead } from './use-deposit-quote-contract-read';
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export { useTradingResultHandling } from './use-trading-result-handling';
|
|
2
|
-
export { useTradingSettleHandler } from './use-trading-settle-handler';
|
|
1
|
+
export { useTradingResultHandling } from './trade-handlers/use-trading-result-handling';
|
|
2
|
+
export { useTradingSettleHandler } from './trade-handlers/use-trading-settle-handler';
|
|
3
3
|
export { useAssetPrice } from './use-asset-price';
|
|
4
4
|
export { useRawAssetPrice } from './use-raw-asset-price';
|
|
5
5
|
export { useIsTradingEnabled } from './use-is-trading-enabled';
|
|
6
6
|
export { useExchangeRate } from './use-exchange-rate';
|
|
7
|
-
export { useHandleTrade } from './use-handle-trade';
|
|
7
|
+
export { useHandleTrade } from './trade-handlers/use-handle-trade';
|
|
8
8
|
export { useDepositProjectedEarnings } from './projected-earnings/use-deposit-projected-earnings';
|
|
9
9
|
export { useProjectedEarningsCore } from './projected-earnings/use-projected-earnings-core';
|
|
10
10
|
export { useSwapDataQuery } from './use-swap-data-query';
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { UseSendCallsParameters } from 'wagmi';
|
|
2
|
+
import type { PendingTransaction } from 'core-kit/types/trading-panel.types';
|
|
3
|
+
type BatchTradingSettleHandler = Required<Required<UseSendCallsParameters>['mutation']>['onSettled'];
|
|
4
|
+
export declare const useBatchTradingSettleHandler: (action: PendingTransaction['action']) => BatchTradingSettleHandler;
|
|
5
|
+
export {};
|
|
@@ -11,3 +11,4 @@ export { useContractReadErrorLogging } from './use-contract-read-error-logging';
|
|
|
11
11
|
export { useStaticCallQuery } from './use-static-call-query';
|
|
12
12
|
export { useInvalidateOnBlock } from './use-invalidate-on-block';
|
|
13
13
|
export { useInvalidateTradingQueries } from './use-invalidate-trading-queries';
|
|
14
|
+
export { useIsBatchContractWritesSupported } from './use-is-batch-contract-writes-supported';
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Address } from 'viem';
|
|
2
|
+
import { type UseSendCallsParameters } from 'wagmi';
|
|
3
|
+
interface ContractsFunctionsOptions {
|
|
4
|
+
onSettled?: Required<UseSendCallsParameters>['mutation']['onSettled'];
|
|
5
|
+
}
|
|
6
|
+
interface SendCallsParams {
|
|
7
|
+
address: Address;
|
|
8
|
+
abi: any;
|
|
9
|
+
functionName: string;
|
|
10
|
+
args: unknown[];
|
|
11
|
+
value?: bigint;
|
|
12
|
+
}
|
|
13
|
+
export declare const useCustomSendCalls: ({ onSettled, }: ContractsFunctionsOptions) => (contracts: SendCallsParams[]) => Promise<void>;
|
|
14
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const useIsBatchContractWritesSupported: () => boolean;
|
|
@@ -20,9 +20,11 @@ export interface TradingPanelState {
|
|
|
20
20
|
minSlippage?: number;
|
|
21
21
|
isInfiniteAllowance: boolean;
|
|
22
22
|
isMultiAssetWithdrawalEnabled: boolean;
|
|
23
|
+
isCustomDepositOptionsDisabled?: boolean;
|
|
23
24
|
isMaxSlippageLoading: boolean;
|
|
24
25
|
availableAggregators: string[];
|
|
25
26
|
selectedAggregators: string[];
|
|
27
|
+
isBatchTransactionsEnabled: boolean;
|
|
26
28
|
};
|
|
27
29
|
type: TradingPanelType;
|
|
28
30
|
input: {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { Address, ChainId } from 'core-kit/types/web3.types';
|
|
1
|
+
import type { Address, ChainId, Hex } from 'core-kit/types/web3.types';
|
|
2
2
|
export interface TradingToken {
|
|
3
3
|
address: Address;
|
|
4
4
|
symbol: string;
|
|
@@ -14,6 +14,7 @@ export interface PendingTransaction {
|
|
|
14
14
|
symbol: string;
|
|
15
15
|
chainId: ChainId;
|
|
16
16
|
txHash?: Address;
|
|
17
|
+
batchId?: Hex;
|
|
17
18
|
}
|
|
18
19
|
type AddTransaction = {
|
|
19
20
|
type: 'add';
|