@dhedge/trading-widget 6.0.6 → 6.2.0-canary.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.
Files changed (88) hide show
  1. package/README.md +136 -125
  2. package/const.cjs +1 -1
  3. package/const.js +96 -89
  4. package/core-kit/abi/dytm-office-asset-guard.d.ts +194 -0
  5. package/core-kit/abi/hyperliquid-withdrawal-manager.d.ts +301 -0
  6. package/core-kit/abi/index.d.ts +2 -0
  7. package/core-kit/abi/ondo-gm-token-asset-guard.d.ts +20 -0
  8. package/core-kit/abi/ondo-price-oracle.d.ts +18 -0
  9. package/core-kit/const/config.d.ts +1 -1
  10. package/core-kit/const/hyperliquid.d.ts +8 -0
  11. package/core-kit/const/index.d.ts +1 -0
  12. package/core-kit/const/logger.d.ts +4 -0
  13. package/core-kit/const/trading.d.ts +3 -0
  14. package/core-kit/hooks/pool/index.d.ts +4 -0
  15. package/core-kit/hooks/pool/use-asset-guard-address.d.ts +8 -0
  16. package/core-kit/hooks/pool/use-dytm-vault-data.d.ts +8 -0
  17. package/core-kit/hooks/pool/use-ondo-price-deviation.d.ts +10 -0
  18. package/core-kit/hooks/pool/use-ondo-vault-data.d.ts +1 -0
  19. package/core-kit/hooks/pool/use-pool-assets-with-type.d.ts +14 -0
  20. package/core-kit/hooks/trading/hyperliquid-withdraw/index.d.ts +12 -0
  21. package/core-kit/hooks/trading/hyperliquid-withdraw/use-handle-hyperliquid-withdraw-step.d.ts +12 -0
  22. package/core-kit/hooks/trading/hyperliquid-withdraw/use-hyperliquid-announce-transaction.d.ts +9 -0
  23. package/core-kit/hooks/trading/hyperliquid-withdraw/use-hyperliquid-cancel-availability.d.ts +5 -0
  24. package/core-kit/hooks/trading/hyperliquid-withdraw/use-hyperliquid-manager-transaction.d.ts +8 -0
  25. package/core-kit/hooks/trading/hyperliquid-withdraw/use-hyperliquid-pending-withdrawal.d.ts +313 -0
  26. package/core-kit/hooks/trading/hyperliquid-withdraw/use-hyperliquid-withdraw-expected-amount.d.ts +4 -0
  27. package/core-kit/hooks/trading/hyperliquid-withdraw/use-hyperliquid-withdrawal-allowance.d.ts +10 -0
  28. package/core-kit/hooks/trading/hyperliquid-withdraw/use-is-hyperliquid-withdraw.d.ts +4 -0
  29. package/core-kit/hooks/trading/hyperliquid-withdraw/use-is-hyperliquid-withdrawal-vault.d.ts +1 -0
  30. package/core-kit/hooks/trading/hyperliquid-withdraw/use-purge-hyperliquid-pending-transactions.d.ts +1 -0
  31. package/core-kit/hooks/trading/withdraw-v2/init-step/use-fetch-dytm-withdraw-asset-data.d.ts +3 -0
  32. package/core-kit/hooks/trading/withdraw-v2/init-step/use-fetch-ondo-withdraw-asset-data.d.ts +3 -2
  33. package/core-kit/services/ondo/api.d.ts +5 -1
  34. package/core-kit/services/ondo/index.d.ts +2 -2
  35. package/core-kit/services/ondo/types.d.ts +9 -0
  36. package/core-kit/types/trading-panel.types.d.ts +1 -1
  37. package/core-kit/utils/complex-withdraw-asset-data.d.ts +9 -5
  38. package/core-kit/utils/dytm.d.ts +51 -0
  39. package/core-kit/utils/error.d.ts +1 -0
  40. package/core-kit/utils/hyperliquid-asset-ids.d.ts +32 -0
  41. package/core-kit/utils/index.d.ts +2 -0
  42. package/core-kit/utils/ondo.d.ts +2 -1
  43. package/core-kit/utils/web3.d.ts +5 -1
  44. package/dytm-C7rdytdA.cjs +1 -0
  45. package/dytm-DIQAbDy2.js +833 -0
  46. package/{geoblocking-NkujbQRm.js → geoblocking-C4bMDd1o.js} +15 -9
  47. package/geoblocking-CUDTwbrq.cjs +1 -0
  48. package/gmx-BTx7XZoO.cjs +1 -0
  49. package/{gmx-DQ-wSifY.js → gmx-D2b-KeY_.js} +622 -353
  50. package/index.cjs +1 -1
  51. package/index.js +5830 -4447
  52. package/package.json +2 -2
  53. package/style.css +1 -1
  54. package/trading-widget/components/common/tab/tab-button/tab-button.d.ts +1 -0
  55. package/trading-widget/components/widget/widget-overlay/hyperliquid-withdraw-stepper-overlay/hyperliquid-withdraw-stepper-overlay.d.ts +3 -0
  56. package/trading-widget/components/widget/widget-overlay/hyperliquid-withdraw-stepper-overlay/hyperliquid-withdraw-stepper-overlay.hooks.d.ts +21 -0
  57. package/trading-widget/components/widget/widget-overlay/hyperliquid-withdraw-stepper-overlay/steps/announce-step.d.ts +3 -0
  58. package/trading-widget/components/widget/widget-overlay/hyperliquid-withdraw-stepper-overlay/steps/announce-step.hooks.d.ts +11 -0
  59. package/trading-widget/components/widget/widget-overlay/hyperliquid-withdraw-stepper-overlay/steps/approve-step.d.ts +3 -0
  60. package/trading-widget/components/widget/widget-overlay/hyperliquid-withdraw-stepper-overlay/steps/approve-step.hooks.d.ts +10 -0
  61. package/trading-widget/components/widget/widget-overlay/hyperliquid-withdraw-stepper-overlay/steps/bridge-step.d.ts +3 -0
  62. package/trading-widget/components/widget/widget-overlay/hyperliquid-withdraw-stepper-overlay/steps/bridge-step.hooks.d.ts +10 -0
  63. package/trading-widget/components/widget/widget-overlay/hyperliquid-withdraw-stepper-overlay/steps/settle-step.d.ts +3 -0
  64. package/trading-widget/components/widget/widget-overlay/hyperliquid-withdraw-stepper-overlay/steps/settle-step.hooks.d.ts +10 -0
  65. package/trading-widget/components/widget/widget-overlay/hyperliquid-withdraw-stepper-overlay/steps/use-hyperliquid-manager-step.d.ts +14 -0
  66. package/trading-widget/components/widget/widget-overlay/hyperliquid-withdraw-stepper-overlay/use-auto-fire-hyperliquid-step.d.ts +11 -0
  67. package/trading-widget/components/widget/widget-overlay/hyperliquid-withdraw-stepper-overlay/use-hyperliquid-step-failure.d.ts +4 -0
  68. package/trading-widget/components/widget/widget-overlay/index.d.ts +1 -0
  69. package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/init-withdraw-step.hooks.d.ts +1 -1
  70. package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/oracle-update-step.d.ts +3 -0
  71. package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/steps/oracle-update-step.hooks.d.ts +11 -0
  72. package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/withdraw-stepper-overlay.hooks.d.ts +10 -2
  73. package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/withdraw-steps.d.ts +2 -9
  74. package/trading-widget/components/widget/widget-overlay/withdraw-stepper-overlay/withdraw-steps.hooks.d.ts +26 -0
  75. package/trading-widget/components/widget/widget-tabs/widget-tabs.hooks.d.ts +1 -0
  76. package/trading-widget/components/withdraw/init-step/button/hyperliquid-withdraw-button/hyperliquid-withdraw-button.d.ts +2 -0
  77. package/trading-widget/components/withdraw/init-step/button/hyperliquid-withdraw-button/hyperliquid-withdraw-button.hooks.d.ts +4 -0
  78. package/trading-widget/components/withdraw/init-step/button/valid-init-withdraw-button/valid-init-withdraw-button.hooks.d.ts +2 -0
  79. package/trading-widget/components/withdraw/init-step/meta/pending-hyperliquid-withdraw-banner.d.ts +2 -0
  80. package/trading-widget/providers/theme-provider/theme-provider.types.d.ts +1 -0
  81. package/trading-widget/providers/translation-provider/translation-provider.types.d.ts +10 -0
  82. package/trading-widget/types/overlay.types.d.ts +1 -0
  83. package/utils.cjs +1 -1
  84. package/utils.js +72 -60
  85. package/geoblocking-9FD_O0-h.cjs +0 -1
  86. package/gmx-Dejxb5_t.cjs +0 -1
  87. package/ondo-GwhTVXds.js +0 -540
  88. package/ondo-rQybmFLf.cjs +0 -1
@@ -7,6 +7,8 @@ export { PoolManagerLogicAbi } from '../abi/pool-manager-logic';
7
7
  export { RewardDistributionAbi } from '../abi/reward-distribution';
8
8
  export { FlatcoinPointsModuleAbi } from '../abi/flatcoin-points-module';
9
9
  export { EasySwapperV2Abi } from '../abi/easy-swapper-v2';
10
+ export { HyperliquidWithdrawalManagerAbi } from '../abi/hyperliquid-withdrawal-manager';
10
11
  export { LimitOrderAbi } from '../abi/limit-order';
11
12
  export { OndoPriceOracleAbi } from '../abi/ondo-price-oracle';
12
13
  export { OndoGMTokenAssetGuardAbi, OndoWithdrawDataAbiItem, } from '../abi/ondo-gm-token-asset-guard';
14
+ export { DytmOfficeAssetGuardAbi, DytmOfficeAbi, OndoGMSwapAbi, UnwindPlanAbiItem, } from '../abi/dytm-office-asset-guard';
@@ -20,6 +20,26 @@ export declare const OndoGMTokenAssetGuardAbi: readonly [{
20
20
  }];
21
21
  readonly stateMutability: "nonpayable";
22
22
  readonly type: "function";
23
+ }, {
24
+ readonly inputs: readonly [];
25
+ readonly name: "ondoGMSwap";
26
+ readonly outputs: readonly [{
27
+ readonly internalType: "address";
28
+ readonly name: "";
29
+ readonly type: "address";
30
+ }];
31
+ readonly stateMutability: "view";
32
+ readonly type: "function";
33
+ }, {
34
+ readonly inputs: readonly [];
35
+ readonly name: "usdc";
36
+ readonly outputs: readonly [{
37
+ readonly internalType: "address";
38
+ readonly name: "";
39
+ readonly type: "address";
40
+ }];
41
+ readonly stateMutability: "view";
42
+ readonly type: "function";
23
43
  }];
24
44
  export declare const OndoWithdrawDataAbiItem: readonly [{
25
45
  readonly type: "tuple";
@@ -1,4 +1,22 @@
1
1
  export declare const OndoPriceOracleAbi: readonly [{
2
+ readonly inputs: readonly [{
3
+ readonly internalType: "address";
4
+ readonly name: "_gmToken";
5
+ readonly type: "address";
6
+ }];
7
+ readonly name: "getPrice";
8
+ readonly outputs: readonly [{
9
+ readonly internalType: "uint256";
10
+ readonly name: "price";
11
+ readonly type: "uint256";
12
+ }, {
13
+ readonly internalType: "uint256";
14
+ readonly name: "updatedAt";
15
+ readonly type: "uint256";
16
+ }];
17
+ readonly stateMutability: "view";
18
+ readonly type: "function";
19
+ }, {
2
20
  readonly inputs: readonly [{
3
21
  readonly components: readonly [{
4
22
  readonly internalType: "uint256";
@@ -1,5 +1,5 @@
1
1
  import type { Address, ChainId } from '../types/web3.types';
2
- export type ContractId = 'factory' | 'rewardDistribution' | 'aaveLendingPoolV2' | 'aaveLendingPoolV3' | 'poolManagerLogic' | 'erc20' | 'poolLogic' | 'flatcoinPointsModule' | 'easySwapperV2' | 'limitOrder' | 'ondoPriceOracle';
2
+ export type ContractId = 'factory' | 'rewardDistribution' | 'aaveLendingPoolV2' | 'aaveLendingPoolV3' | 'poolManagerLogic' | 'erc20' | 'poolLogic' | 'flatcoinPointsModule' | 'easySwapperV2' | 'limitOrder' | 'ondoPriceOracle' | 'hyperliquidWithdrawalManager';
3
3
  type ContractsAddressesMap = Readonly<Record<ChainId, {
4
4
  [id in ContractId]?: Address;
5
5
  }>>;
@@ -0,0 +1,8 @@
1
+ export declare const HYPERLIQUID_WITHDRAWAL_POLLING_INTERVAL = 3000;
2
+ export declare const HYPERLIQUID_WITHDRAWAL_TIMEOUT_MS = 300000;
3
+ export declare const HYPERLIQUID_INFO_API_URL = "https://api.hyperliquid.xyz/info";
4
+ export declare enum HyperliquidWithdrawalState {
5
+ NONE = 0,
6
+ REDUCED = 1,
7
+ BRIDGED = 2
8
+ }
@@ -11,6 +11,7 @@ export * from '../const/links';
11
11
  export * from '../const/flat-money';
12
12
  export * from '../const/trading';
13
13
  export * from '../const/gmx';
14
+ export * from '../const/hyperliquid';
14
15
  export * from '../const/derive';
15
16
  export * from '../const/storage';
16
17
  export * from '../const/geoblocking';
@@ -18,6 +18,10 @@ export declare const TRADING_PANEL_LOG_EVENT: {
18
18
  LIMIT_ORDER_WITHDRAW: string;
19
19
  LIMIT_ORDER_WITHDRAW_DELETE: string;
20
20
  UPDATE_ONDO_PRICES: string;
21
+ HYPERLIQUID_ANNOUNCE_WITHDRAW: string;
22
+ HYPERLIQUID_BRIDGE_WITHDRAW: string;
23
+ HYPERLIQUID_SETTLE_WITHDRAW: string;
24
+ HYPERLIQUID_CANCEL_WITHDRAW: string;
21
25
  };
22
26
  export declare const LOG_EVENT_BY_TRANSACTION_ACTION_MAP: Record<TransactionAction, string[]>;
23
27
  /**
@@ -3,6 +3,9 @@ export declare const DEFAULT_ONDO_WITHDRAWAL_CONTRACT_SLIPPAGE = 500n;
3
3
  export declare const TRANSACTION_SETTLE_DELAY: Record<ChainId, number>;
4
4
  export declare const ONDO_PRICES_RABBY_SETTLE_DELAY = 6000;
5
5
  export declare const ONDO_PRICE_FRESHNESS_WINDOW_MS = 40000;
6
+ export declare const ONDO_PRICE_MAX_DEVIATION_PERCENT = 0.5;
7
+ export declare const ONDO_PRICES_FETCH_TIMEOUT_MS = 6000;
8
+ export declare const ONDO_PRICE_CHECK_TIMEOUT_MS = 8000;
6
9
  export declare const EASY_SWAPPER_V2_DEPOSIT_METHODS: {
7
10
  DEPOSIT: "deposit";
8
11
  DEPOSIT_CUSTOM: "depositWithCustomCooldown";
@@ -17,3 +17,7 @@ export { useVaultSupplyCap } from '../../hooks/pool/use-vault-supply-cap';
17
17
  export { useIsDepositBlocked } from '../../hooks/pool/use-is-deposit-blocked';
18
18
  export { useVaultContractData } from '../../hooks/pool/use-vault-contract-data';
19
19
  export { useOndoVaultData, type OndoVaultAsset, type OndoVaultData, } from '../../hooks/pool/use-ondo-vault-data';
20
+ export { useOndoPriceDeviation, type OndoPriceDeviationResult, } from '../../hooks/pool/use-ondo-price-deviation';
21
+ export { useDytmVaultData, type DytmVaultData, } from '../../hooks/pool/use-dytm-vault-data';
22
+ export { usePoolAssetsWithType, type PoolAssetWithType, type PoolAssetsWithType, } from '../../hooks/pool/use-pool-assets-with-type';
23
+ export { useAssetGuardAddress, useFetchAssetGuardAddress, } from '../../hooks/pool/use-asset-guard-address';
@@ -0,0 +1,8 @@
1
+ import type { Address, ChainId } from '../../types';
2
+ interface UseAssetGuardAddressParams {
3
+ asset: Address | undefined;
4
+ chainId: ChainId;
5
+ }
6
+ export declare const useAssetGuardAddress: ({ asset, chainId, }: UseAssetGuardAddressParams) => Address | undefined;
7
+ export declare const useFetchAssetGuardAddress: (chainId: ChainId) => (asset: Address) => Promise<Address | undefined>;
8
+ export {};
@@ -0,0 +1,8 @@
1
+ import type { Address, PoolContractCallParams } from '../../types';
2
+ export interface DytmVaultData {
3
+ dytmOfficeAddress: Address | undefined;
4
+ assetGuardAddress: Address | undefined;
5
+ hasAssets: boolean;
6
+ isReady: boolean;
7
+ }
8
+ export declare const useDytmVaultData: ({ address, chainId, }: PoolContractCallParams) => DytmVaultData;
@@ -0,0 +1,10 @@
1
+ import type { PoolContractCallParams } from '../../types';
2
+ export interface OndoPriceDeviationResult {
3
+ needsPriceUpdate: boolean | undefined;
4
+ isChecking: boolean;
5
+ }
6
+ interface UseOndoPriceDeviationParams extends PoolContractCallParams {
7
+ enabled?: boolean;
8
+ }
9
+ export declare const useOndoPriceDeviation: ({ address, chainId, enabled, }: UseOndoPriceDeviationParams) => OndoPriceDeviationResult;
10
+ export {};
@@ -7,5 +7,6 @@ export interface OndoVaultData {
7
7
  assets: OndoVaultAsset[];
8
8
  assetGuardAddress: Address | undefined;
9
9
  hasAssets: boolean;
10
+ isReady: boolean;
10
11
  }
11
12
  export declare const useOndoVaultData: ({ address, chainId, }: PoolContractCallParams) => OndoVaultData;
@@ -0,0 +1,14 @@
1
+ import type { PoolComposition } from '../../types/pool.types';
2
+ import type { PoolContractCallParams } from '../../types/web3.types';
3
+ export interface PoolAssetWithType extends PoolComposition {
4
+ assetType: number | undefined;
5
+ }
6
+ export interface PoolAssetsWithType {
7
+ assets: PoolAssetWithType[];
8
+ isReady: boolean;
9
+ }
10
+ interface UsePoolAssetsWithTypeParams extends PoolContractCallParams {
11
+ enabled?: boolean;
12
+ }
13
+ export declare const usePoolAssetsWithType: ({ address, chainId, enabled, }: UsePoolAssetsWithTypeParams) => PoolAssetsWithType;
14
+ export {};
@@ -0,0 +1,12 @@
1
+ export * from './use-handle-hyperliquid-withdraw-step';
2
+ export * from './use-hyperliquid-announce-fallback-check';
3
+ export * from './use-hyperliquid-announce-transaction';
4
+ export * from './use-hyperliquid-cancel-availability';
5
+ export * from './use-hyperliquid-manager-transaction';
6
+ export * from './use-hyperliquid-pending-withdrawal';
7
+ export * from './use-purge-hyperliquid-pending-transactions';
8
+ export * from './use-hyperliquid-withdraw-expected-amount';
9
+ export * from './use-hyperliquid-withdrawal-allowance';
10
+ export * from './use-hyperliquid-withdrawal-asset-ids';
11
+ export * from './use-is-hyperliquid-withdraw';
12
+ export * from './use-is-hyperliquid-withdrawal-vault';
@@ -0,0 +1,12 @@
1
+ import type { TransactionAction } from '../../../types';
2
+ import type { ContractActionFunc } from '../../../types/web3.types';
3
+ export interface HyperliquidWithdrawStepResult {
4
+ submitted: boolean;
5
+ errorMessage?: string;
6
+ }
7
+ interface UseHandleHyperliquidWithdrawStepProps {
8
+ trade: ContractActionFunc;
9
+ action: TransactionAction;
10
+ }
11
+ export declare const useHandleHyperliquidWithdrawStep: ({ trade, action, }: UseHandleHyperliquidWithdrawStepProps) => () => Promise<HyperliquidWithdrawStepResult>;
12
+ export {};
@@ -0,0 +1,9 @@
1
+ import { type OnTradingSettleErrorCallback } from '../../../hooks/trading';
2
+ import type { ContractActionFunc } from '../../../types/web3.types';
3
+ interface UseHyperliquidAnnounceTransactionParams {
4
+ onErrorCallback?: OnTradingSettleErrorCallback;
5
+ }
6
+ export declare const useHyperliquidAnnounceTransaction: ({ onErrorCallback, }?: UseHyperliquidAnnounceTransactionParams | undefined) => {
7
+ announce: ContractActionFunc;
8
+ };
9
+ export {};
@@ -0,0 +1,5 @@
1
+ export declare const formatCancelCountdown: (totalSeconds: number) => string;
2
+ export declare const useHyperliquidCancelAvailability: (announcedAt: bigint | undefined) => {
3
+ canCancel: boolean;
4
+ cancelRemainingSeconds: number;
5
+ };
@@ -0,0 +1,8 @@
1
+ import { type OnTradingSettleErrorCallback } from '../../../hooks/trading';
2
+ import type { TransactionAction } from '../../../types';
3
+ import type { ContractActionFunc } from '../../../types/web3.types';
4
+ export declare const useHyperliquidManagerTransaction: ({ functionName, action, onErrorCallback, }: {
5
+ functionName: 'bridge' | 'settle' | 'cancel';
6
+ action: TransactionAction;
7
+ onErrorCallback?: OnTradingSettleErrorCallback | undefined;
8
+ }) => ContractActionFunc;
@@ -0,0 +1,313 @@
1
+ import type { UseReadContractReturnType } from 'wagmi';
2
+ import { HyperliquidWithdrawalState } from '../../../const';
3
+ export interface HyperliquidPendingWithdrawal {
4
+ amount: bigint;
5
+ announcedAt: bigint;
6
+ announcedBlock: bigint;
7
+ bridgedBlock: bigint;
8
+ state: HyperliquidWithdrawalState;
9
+ hasPending: boolean;
10
+ }
11
+ export declare const useHyperliquidPendingWithdrawal: ({ watch, }?: {
12
+ watch?: boolean | undefined;
13
+ }) => UseReadContractReturnType<readonly [{
14
+ readonly inputs: readonly [];
15
+ readonly name: "HyperliquidWithdrawalManager__ZeroAmount";
16
+ readonly type: "error";
17
+ }, {
18
+ readonly inputs: readonly [];
19
+ readonly name: "HyperliquidWithdrawalManager__WithdrawalAlreadyPending";
20
+ readonly type: "error";
21
+ }, {
22
+ readonly inputs: readonly [];
23
+ readonly name: "HyperliquidWithdrawalManager__InvalidPool";
24
+ readonly type: "error";
25
+ }, {
26
+ readonly inputs: readonly [];
27
+ readonly name: "HyperliquidWithdrawalManager__PoolHasNoHLIntegration";
28
+ readonly type: "error";
29
+ }, {
30
+ readonly inputs: readonly [{
31
+ readonly internalType: "enum IHyperliquidWithdrawalManager.WithdrawalState";
32
+ readonly name: "current";
33
+ readonly type: "uint8";
34
+ }, {
35
+ readonly internalType: "enum IHyperliquidWithdrawalManager.WithdrawalState";
36
+ readonly name: "expected";
37
+ readonly type: "uint8";
38
+ }];
39
+ readonly name: "HyperliquidWithdrawalManager__InvalidState";
40
+ readonly type: "error";
41
+ }, {
42
+ readonly inputs: readonly [{
43
+ readonly internalType: "uint32";
44
+ readonly name: "asset";
45
+ readonly type: "uint32";
46
+ }];
47
+ readonly name: "HyperliquidWithdrawalManager__NoPositionForAsset";
48
+ readonly type: "error";
49
+ }, {
50
+ readonly inputs: readonly [{
51
+ readonly internalType: "uint32";
52
+ readonly name: "asset";
53
+ readonly type: "uint32";
54
+ }];
55
+ readonly name: "HyperliquidWithdrawalManager__NoSpotBalanceForAsset";
56
+ readonly type: "error";
57
+ }, {
58
+ readonly inputs: readonly [{
59
+ readonly internalType: "uint32";
60
+ readonly name: "asset";
61
+ readonly type: "uint32";
62
+ }];
63
+ readonly name: "HyperliquidWithdrawalManager__SpotAssetNotSupported";
64
+ readonly type: "error";
65
+ }, {
66
+ readonly inputs: readonly [];
67
+ readonly name: "HyperliquidWithdrawalManager__NoPendingWithdrawal";
68
+ readonly type: "error";
69
+ }, {
70
+ readonly inputs: readonly [];
71
+ readonly name: "HyperliquidWithdrawalManager__TimeoutNotReached";
72
+ readonly type: "error";
73
+ }, {
74
+ readonly inputs: readonly [];
75
+ readonly name: "HyperliquidWithdrawalManager__NothingToBridge";
76
+ readonly type: "error";
77
+ }, {
78
+ readonly inputs: readonly [];
79
+ readonly name: "HyperliquidWithdrawalManager__NoSpotUsdcFreed";
80
+ readonly type: "error";
81
+ }, {
82
+ readonly inputs: readonly [];
83
+ readonly name: "HyperliquidWithdrawalManager__TooEarly";
84
+ readonly type: "error";
85
+ }, {
86
+ readonly inputs: readonly [];
87
+ readonly name: "HyperliquidWithdrawalManager__FullWithdrawalNotSupported";
88
+ readonly type: "error";
89
+ }, {
90
+ readonly inputs: readonly [];
91
+ readonly name: "HyperliquidWithdrawalManager__UnreducedPerpPosition";
92
+ readonly type: "error";
93
+ }, {
94
+ readonly inputs: readonly [];
95
+ readonly name: "HyperliquidWithdrawalManager__NoBridgeNeeded";
96
+ readonly type: "error";
97
+ }, {
98
+ readonly inputs: readonly [];
99
+ readonly name: "HyperliquidWithdrawalManager__UnsortedAssetIds";
100
+ readonly type: "error";
101
+ }, {
102
+ readonly anonymous: false;
103
+ readonly inputs: readonly [{
104
+ readonly indexed: true;
105
+ readonly internalType: "address";
106
+ readonly name: "user";
107
+ readonly type: "address";
108
+ }, {
109
+ readonly indexed: true;
110
+ readonly internalType: "address";
111
+ readonly name: "pool";
112
+ readonly type: "address";
113
+ }, {
114
+ readonly indexed: false;
115
+ readonly internalType: "uint256";
116
+ readonly name: "amount";
117
+ readonly type: "uint256";
118
+ }];
119
+ readonly name: "WithdrawalAnnounced";
120
+ readonly type: "event";
121
+ }, {
122
+ readonly anonymous: false;
123
+ readonly inputs: readonly [{
124
+ readonly indexed: true;
125
+ readonly internalType: "address";
126
+ readonly name: "user";
127
+ readonly type: "address";
128
+ }, {
129
+ readonly indexed: true;
130
+ readonly internalType: "address";
131
+ readonly name: "pool";
132
+ readonly type: "address";
133
+ }];
134
+ readonly name: "WithdrawalBridged";
135
+ readonly type: "event";
136
+ }, {
137
+ readonly anonymous: false;
138
+ readonly inputs: readonly [{
139
+ readonly indexed: true;
140
+ readonly internalType: "address";
141
+ readonly name: "user";
142
+ readonly type: "address";
143
+ }, {
144
+ readonly indexed: true;
145
+ readonly internalType: "address";
146
+ readonly name: "pool";
147
+ readonly type: "address";
148
+ }, {
149
+ readonly indexed: false;
150
+ readonly internalType: "uint256";
151
+ readonly name: "amount";
152
+ readonly type: "uint256";
153
+ }];
154
+ readonly name: "WithdrawalSettled";
155
+ readonly type: "event";
156
+ }, {
157
+ readonly anonymous: false;
158
+ readonly inputs: readonly [{
159
+ readonly indexed: true;
160
+ readonly internalType: "address";
161
+ readonly name: "user";
162
+ readonly type: "address";
163
+ }, {
164
+ readonly indexed: true;
165
+ readonly internalType: "address";
166
+ readonly name: "pool";
167
+ readonly type: "address";
168
+ }, {
169
+ readonly indexed: false;
170
+ readonly internalType: "uint256";
171
+ readonly name: "amount";
172
+ readonly type: "uint256";
173
+ }];
174
+ readonly name: "WithdrawalCancelled";
175
+ readonly type: "event";
176
+ }, {
177
+ readonly inputs: readonly [{
178
+ readonly internalType: "address";
179
+ readonly name: "pool";
180
+ readonly type: "address";
181
+ }, {
182
+ readonly internalType: "uint256";
183
+ readonly name: "tokenAmount";
184
+ readonly type: "uint256";
185
+ }, {
186
+ readonly internalType: "uint32[]";
187
+ readonly name: "perpAssetIds";
188
+ readonly type: "uint32[]";
189
+ }, {
190
+ readonly internalType: "uint32[]";
191
+ readonly name: "spotAssetIds";
192
+ readonly type: "uint32[]";
193
+ }];
194
+ readonly name: "announceAndReduce";
195
+ readonly outputs: readonly [];
196
+ readonly stateMutability: "nonpayable";
197
+ readonly type: "function";
198
+ }, {
199
+ readonly inputs: readonly [{
200
+ readonly internalType: "address";
201
+ readonly name: "pool";
202
+ readonly type: "address";
203
+ }];
204
+ readonly name: "bridge";
205
+ readonly outputs: readonly [];
206
+ readonly stateMutability: "nonpayable";
207
+ readonly type: "function";
208
+ }, {
209
+ readonly inputs: readonly [{
210
+ readonly internalType: "address";
211
+ readonly name: "pool";
212
+ readonly type: "address";
213
+ }];
214
+ readonly name: "settle";
215
+ readonly outputs: readonly [];
216
+ readonly stateMutability: "nonpayable";
217
+ readonly type: "function";
218
+ }, {
219
+ readonly inputs: readonly [{
220
+ readonly internalType: "address";
221
+ readonly name: "pool";
222
+ readonly type: "address";
223
+ }];
224
+ readonly name: "cancel";
225
+ readonly outputs: readonly [];
226
+ readonly stateMutability: "nonpayable";
227
+ readonly type: "function";
228
+ }, {
229
+ readonly inputs: readonly [{
230
+ readonly internalType: "address";
231
+ readonly name: "user";
232
+ readonly type: "address";
233
+ }, {
234
+ readonly internalType: "address";
235
+ readonly name: "pool";
236
+ readonly type: "address";
237
+ }];
238
+ readonly name: "pendingWithdrawals";
239
+ readonly outputs: readonly [{
240
+ readonly components: readonly [{
241
+ readonly internalType: "uint256";
242
+ readonly name: "amount";
243
+ readonly type: "uint256";
244
+ }, {
245
+ readonly internalType: "uint256";
246
+ readonly name: "announcedAt";
247
+ readonly type: "uint256";
248
+ }, {
249
+ readonly internalType: "uint256";
250
+ readonly name: "announcedBlock";
251
+ readonly type: "uint256";
252
+ }, {
253
+ readonly internalType: "uint256";
254
+ readonly name: "bridgedBlock";
255
+ readonly type: "uint256";
256
+ }, {
257
+ readonly internalType: "enum IHyperliquidWithdrawalManager.WithdrawalState";
258
+ readonly name: "state";
259
+ readonly type: "uint8";
260
+ }, {
261
+ readonly internalType: "uint32[]";
262
+ readonly name: "spotAssetIds";
263
+ readonly type: "uint32[]";
264
+ }, {
265
+ readonly internalType: "uint256";
266
+ readonly name: "reservedBridge";
267
+ readonly type: "uint256";
268
+ }];
269
+ readonly internalType: "struct IHyperliquidWithdrawalManager.PendingWithdrawal";
270
+ readonly name: "";
271
+ readonly type: "tuple";
272
+ }];
273
+ readonly stateMutability: "view";
274
+ readonly type: "function";
275
+ }, {
276
+ readonly inputs: readonly [{
277
+ readonly internalType: "address";
278
+ readonly name: "pool";
279
+ readonly type: "address";
280
+ }];
281
+ readonly name: "hasPendingWithdrawal";
282
+ readonly outputs: readonly [{
283
+ readonly internalType: "bool";
284
+ readonly name: "";
285
+ readonly type: "bool";
286
+ }];
287
+ readonly stateMutability: "view";
288
+ readonly type: "function";
289
+ }, {
290
+ readonly inputs: readonly [{
291
+ readonly internalType: "address";
292
+ readonly name: "pool";
293
+ readonly type: "address";
294
+ }];
295
+ readonly name: "totalPendingTokens";
296
+ readonly outputs: readonly [{
297
+ readonly internalType: "uint256";
298
+ readonly name: "";
299
+ readonly type: "uint256";
300
+ }];
301
+ readonly stateMutability: "view";
302
+ readonly type: "function";
303
+ }, {
304
+ readonly inputs: readonly [];
305
+ readonly name: "WITHDRAWAL_TIMEOUT";
306
+ readonly outputs: readonly [{
307
+ readonly internalType: "uint256";
308
+ readonly name: "";
309
+ readonly type: "uint256";
310
+ }];
311
+ readonly stateMutability: "view";
312
+ readonly type: "function";
313
+ }], "pendingWithdrawals", readonly [user: `0x${string}`, pool: `0x${string}`], HyperliquidPendingWithdrawal>;
@@ -0,0 +1,4 @@
1
+ export declare const useHyperliquidWithdrawExpectedAmount: () => {
2
+ expectedAmount: string;
3
+ symbol: string;
4
+ };
@@ -0,0 +1,10 @@
1
+ import type { OnTradingSettleErrorCallback } from '../../../hooks/trading';
2
+ interface UseHyperliquidWithdrawalAllowanceParams {
3
+ onErrorCallback?: OnTradingSettleErrorCallback;
4
+ }
5
+ export declare const useHyperliquidWithdrawalAllowance: ({ onErrorCallback, }?: UseHyperliquidWithdrawalAllowanceParams | undefined) => {
6
+ canSpend: boolean;
7
+ approve: () => Promise<void>;
8
+ isCanSpendFetching: boolean;
9
+ };
10
+ export {};
@@ -0,0 +1,4 @@
1
+ export declare const useIsHyperliquidWithdraw: () => {
2
+ isHyperliquidWithdraw: boolean;
3
+ isFullWithdrawalNotSupported: boolean;
4
+ };
@@ -0,0 +1 @@
1
+ export declare const useIsHyperliquidWithdrawalVault: () => boolean;
@@ -0,0 +1 @@
1
+ export declare const usePurgeHyperliquidPendingTransactions: () => () => void;
@@ -0,0 +1,3 @@
1
+ import type { PoolConfig } from '../../../../types';
2
+ import type { WithdrawDataOverride } from '../../../../utils';
3
+ export declare const useFetchDytmWithdrawAssetData: ({ address, chainId, }: Pick<PoolConfig, 'address' | 'chainId'>) => (withdrawAmountD18: bigint) => Promise<Map<string, WithdrawDataOverride>>;
@@ -1,2 +1,3 @@
1
- import type { Hex, PoolConfig } from '../../../../types';
2
- export declare const useFetchOndoWithdrawAssetData: ({ address, chainId, }: Pick<PoolConfig, 'address' | 'chainId'>) => (withdrawAmountD18: bigint) => Promise<Map<string, Hex>>;
1
+ import type { PoolConfig } from '../../../../types';
2
+ import type { WithdrawDataOverride } from '../../../../utils';
3
+ export declare const useFetchOndoWithdrawAssetData: ({ address, chainId, }: Pick<PoolConfig, 'address' | 'chainId'>) => (withdrawAmountD18: bigint) => Promise<Map<string, WithdrawDataOverride>>;
@@ -1,4 +1,4 @@
1
- import type { OndoAttestationApiResponse, OndoPriceUpdateApiResponse } from '../../services/ondo/types';
1
+ import type { OndoAttestationApiResponse, OndoLatestPricesApiResponse, OndoPriceUpdateApiResponse } from '../../services/ondo/types';
2
2
  import type { Address, ChainId } from '../../types';
3
3
  interface CreateOndoAttestationsApiResponse {
4
4
  attestations: OndoAttestationApiResponse[];
@@ -7,6 +7,10 @@ export declare const fetchOndoPriceUpdateData: ({ chainId, addresses, }: {
7
7
  chainId: ChainId;
8
8
  addresses: Address[];
9
9
  }) => Promise<OndoPriceUpdateApiResponse>;
10
+ export declare const fetchOndoPrices: ({ chainId, addresses, }: {
11
+ chainId: ChainId;
12
+ addresses: Address[];
13
+ }) => Promise<OndoLatestPricesApiResponse>;
10
14
  export declare const fetchCreateOndoAttestations: ({ chainId, items, }: {
11
15
  chainId: ChainId;
12
16
  items: {
@@ -1,3 +1,3 @@
1
1
  export { configureOndoServices, getOndoAppCheckToken, getOndoConfig, prewarmOndoAppCheck, } from '../../services/ondo/firebase-app-check';
2
- export { fetchCreateOndoAttestations, fetchOndoPriceUpdateData, } from '../../services/ondo/api';
3
- export type { OndoApiUrls, OndoAttestationApiResponse, OndoFirebaseConfig, OndoIntegrationConfig, OndoPriceUpdateApiQuote, OndoPriceUpdateApiResponse, OndoRecaptchaConfig, } from '../../services/ondo/types';
2
+ export { fetchCreateOndoAttestations, fetchOndoPriceUpdateData, fetchOndoPrices, } from '../../services/ondo/api';
3
+ export type { OndoApiUrls, OndoAttestationApiResponse, OndoFirebaseConfig, OndoIntegrationConfig, OndoLatestPriceApiEntry, OndoLatestPricesApiResponse, OndoPriceUpdateApiQuote, OndoPriceUpdateApiResponse, OndoRecaptchaConfig, } from '../../services/ondo/types';
@@ -40,6 +40,15 @@ export interface OndoRecaptchaConfig {
40
40
  export interface OndoApiUrls {
41
41
  priceUpdateUrl: string;
42
42
  createAttestationsUrl: string;
43
+ getPricesUrl?: string;
44
+ }
45
+ export interface OndoLatestPriceApiEntry {
46
+ symbol: string;
47
+ address?: string;
48
+ price: string;
49
+ }
50
+ export interface OndoLatestPricesApiResponse {
51
+ prices: OndoLatestPriceApiEntry[];
43
52
  }
44
53
  export interface OndoIntegrationConfig {
45
54
  firebase: OndoFirebaseConfig;
@@ -22,7 +22,7 @@ type RemoveTransaction = {
22
22
  } & Partial<PendingTransaction>;
23
23
  export type UpdateTransactionsArguments = AddTransaction | UpdateTransaction | RemoveTransaction;
24
24
  export type TradingPanelType = 'deposit' | 'withdraw';
25
- export type TransactionAction = 'deposit' | 'multi_withdraw' | 'single_withdraw' | 'approve' | 'swap' | 'claim' | 'single_withdraw_and_claim' | 'create_limit_sell_order' | 'create_limit_buy_order' | 'limit_order_withdraw' | 'delete_limit_order_withdraw' | 'update_ondo_prices';
25
+ export type TransactionAction = 'deposit' | 'multi_withdraw' | 'single_withdraw' | 'approve' | 'swap' | 'claim' | 'single_withdraw_and_claim' | 'create_limit_sell_order' | 'create_limit_buy_order' | 'limit_order_withdraw' | 'delete_limit_order_withdraw' | 'update_ondo_prices' | 'hyperliquid_announce_withdraw' | 'hyperliquid_bridge_withdraw' | 'hyperliquid_settle_withdraw' | 'hyperliquid_cancel_withdraw';
26
26
  export type SwapEntity = 'token' | 'pool';
27
27
  export interface TokenSelectorPayload {
28
28
  isOpen: boolean;