@zofai/trading-widget 0.1.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 (113) hide show
  1. package/README.md +226 -0
  2. package/dist/TradingWidget.d.ts +10 -0
  3. package/dist/TradingWidget.d.ts.map +1 -0
  4. package/dist/components/layout/MarketHeader.d.ts +2 -0
  5. package/dist/components/layout/MarketHeader.d.ts.map +1 -0
  6. package/dist/components/layout/TradingWidgetProvider.d.ts +15 -0
  7. package/dist/components/layout/TradingWidgetProvider.d.ts.map +1 -0
  8. package/dist/components/market/AppDialogs.d.ts +4 -0
  9. package/dist/components/market/AppDialogs.d.ts.map +1 -0
  10. package/dist/components/market/PriceChart.d.ts +2 -0
  11. package/dist/components/market/PriceChart.d.ts.map +1 -0
  12. package/dist/components/market/RecentTrades.d.ts +2 -0
  13. package/dist/components/market/RecentTrades.d.ts.map +1 -0
  14. package/dist/components/settings/RpcSettings.d.ts +2 -0
  15. package/dist/components/settings/RpcSettings.d.ts.map +1 -0
  16. package/dist/components/tables/BottomTabs.d.ts +2 -0
  17. package/dist/components/tables/BottomTabs.d.ts.map +1 -0
  18. package/dist/components/tables/HistoryList.d.ts +2 -0
  19. package/dist/components/tables/HistoryList.d.ts.map +1 -0
  20. package/dist/components/tables/OrdersList.d.ts +2 -0
  21. package/dist/components/tables/OrdersList.d.ts.map +1 -0
  22. package/dist/components/tables/PositionsList.d.ts +2 -0
  23. package/dist/components/tables/PositionsList.d.ts.map +1 -0
  24. package/dist/components/trade/OrderCancel.d.ts +19 -0
  25. package/dist/components/trade/OrderCancel.d.ts.map +1 -0
  26. package/dist/components/trade/PositionAdjust.d.ts +24 -0
  27. package/dist/components/trade/PositionAdjust.d.ts.map +1 -0
  28. package/dist/components/trade/PositionClose.d.ts +28 -0
  29. package/dist/components/trade/PositionClose.d.ts.map +1 -0
  30. package/dist/components/trade/TradePanel.d.ts +2 -0
  31. package/dist/components/trade/TradePanel.d.ts.map +1 -0
  32. package/dist/components/wallet/CustomConnectButton.d.ts +4 -0
  33. package/dist/components/wallet/CustomConnectButton.d.ts.map +1 -0
  34. package/dist/constants/query.d.ts +5 -0
  35. package/dist/constants/query.d.ts.map +1 -0
  36. package/dist/constants/rpc.d.ts +18 -0
  37. package/dist/constants/rpc.d.ts.map +1 -0
  38. package/dist/constants/tokens.d.ts +46 -0
  39. package/dist/constants/tokens.d.ts.map +1 -0
  40. package/dist/hooks/useAccountData.d.ts +18 -0
  41. package/dist/hooks/useAccountData.d.ts.map +1 -0
  42. package/dist/hooks/useClosePositionPreview.d.ts +18 -0
  43. package/dist/hooks/useClosePositionPreview.d.ts.map +1 -0
  44. package/dist/hooks/useEssential.d.ts +23 -0
  45. package/dist/hooks/useEssential.d.ts.map +1 -0
  46. package/dist/hooks/useFundingRate.d.ts +15 -0
  47. package/dist/hooks/useFundingRate.d.ts.map +1 -0
  48. package/dist/hooks/useGenericMarketInfo.d.ts +9 -0
  49. package/dist/hooks/useGenericMarketInfo.d.ts.map +1 -0
  50. package/dist/hooks/useGenericStats.d.ts +19 -0
  51. package/dist/hooks/useGenericStats.d.ts.map +1 -0
  52. package/dist/hooks/useGenericVaultInfo.d.ts +9 -0
  53. package/dist/hooks/useGenericVaultInfo.d.ts.map +1 -0
  54. package/dist/hooks/useGeoBlocking.d.ts +6 -0
  55. package/dist/hooks/useGeoBlocking.d.ts.map +1 -0
  56. package/dist/hooks/useHistoricalLpPrices.d.ts +35 -0
  57. package/dist/hooks/useHistoricalLpPrices.d.ts.map +1 -0
  58. package/dist/hooks/useHistories.d.ts +54 -0
  59. package/dist/hooks/useHistories.d.ts.map +1 -0
  60. package/dist/hooks/useIndexTokenSymbols.d.ts +7 -0
  61. package/dist/hooks/useIndexTokenSymbols.d.ts.map +1 -0
  62. package/dist/hooks/useLPOperations.d.ts +41 -0
  63. package/dist/hooks/useLPOperations.d.ts.map +1 -0
  64. package/dist/hooks/useNetwork.d.ts +3 -0
  65. package/dist/hooks/useNetwork.d.ts.map +1 -0
  66. package/dist/hooks/useOrder.d.ts +10 -0
  67. package/dist/hooks/useOrder.d.ts.map +1 -0
  68. package/dist/hooks/usePosition.d.ts +54 -0
  69. package/dist/hooks/usePosition.d.ts.map +1 -0
  70. package/dist/hooks/usePositionConfig.d.ts +14 -0
  71. package/dist/hooks/usePositionConfig.d.ts.map +1 -0
  72. package/dist/hooks/usePriceImpactEstimate.d.ts +13 -0
  73. package/dist/hooks/usePriceImpactEstimate.d.ts.map +1 -0
  74. package/dist/hooks/usePythPriceChart.d.ts +8 -0
  75. package/dist/hooks/usePythPriceChart.d.ts.map +1 -0
  76. package/dist/hooks/useRecentTrades.d.ts +64 -0
  77. package/dist/hooks/useRecentTrades.d.ts.map +1 -0
  78. package/dist/hooks/useReservingRate.d.ts +17 -0
  79. package/dist/hooks/useReservingRate.d.ts.map +1 -0
  80. package/dist/hooks/useRpc.d.ts +35 -0
  81. package/dist/hooks/useRpc.d.ts.map +1 -0
  82. package/dist/hooks/useSponsoredGasAvailability.d.ts +53 -0
  83. package/dist/hooks/useSponsoredGasAvailability.d.ts.map +1 -0
  84. package/dist/hooks/useSymbolConfig.d.ts +9 -0
  85. package/dist/hooks/useSymbolConfig.d.ts.map +1 -0
  86. package/dist/hooks/useSymbolInfo.d.ts +16 -0
  87. package/dist/hooks/useSymbolInfo.d.ts.map +1 -0
  88. package/dist/hooks/useWallet.d.ts +22 -0
  89. package/dist/hooks/useWallet.d.ts.map +1 -0
  90. package/dist/hooks/useWalletVerification.d.ts +12 -0
  91. package/dist/hooks/useWalletVerification.d.ts.map +1 -0
  92. package/dist/index.d.ts +30 -0
  93. package/dist/index.d.ts.map +1 -0
  94. package/dist/index.js +14802 -0
  95. package/dist/store/index.d.ts +80 -0
  96. package/dist/store/index.d.ts.map +1 -0
  97. package/dist/types/lpToken.d.ts +171 -0
  98. package/dist/types/lpToken.d.ts.map +1 -0
  99. package/dist/utils/error.d.ts +2 -0
  100. package/dist/utils/error.d.ts.map +1 -0
  101. package/dist/utils/execute.d.ts +28 -0
  102. package/dist/utils/execute.d.ts.map +1 -0
  103. package/dist/utils/index.d.ts +45 -0
  104. package/dist/utils/index.d.ts.map +1 -0
  105. package/dist/utils/math.d.ts +26 -0
  106. package/dist/utils/math.d.ts.map +1 -0
  107. package/dist/utils/models.d.ts +48 -0
  108. package/dist/utils/models.d.ts.map +1 -0
  109. package/dist/utils/provider.d.ts +19 -0
  110. package/dist/utils/provider.d.ts.map +1 -0
  111. package/dist/utils/pythChartData.d.ts +16 -0
  112. package/dist/utils/pythChartData.d.ts.map +1 -0
  113. package/package.json +61 -0
package/README.md ADDED
@@ -0,0 +1,226 @@
1
+ # @zo/trading-widget
2
+
3
+ Embeddable perpetuals trading UI for ZO Finance on Sui. Partners can drop the full widget into their dapp or compose custom layouts from sub-components.
4
+
5
+ ## Features
6
+
7
+ - **Market header** – Symbol selector, mark price, funding rate
8
+ - **Price chart** – Pyth-powered OHLC + live updates (lightweight-charts)
9
+ - **Recent trades** – Live trade feed
10
+ - **Trade panel** – Open/close positions (market & limit), ZLP/SLP/USDZ
11
+ - **Positions / Orders / History** – Bottom tabs with countdown to next refresh
12
+ - **RPC settings** – Predefined or custom RPC URL
13
+ - **Wallet** – Sui connect via `@mysten/dapp-kit-react`; custom connect button and account sidebar
14
+
15
+ ## Peer dependencies
16
+
17
+ Your app must install:
18
+
19
+ - `react` & `react-dom` (≥18)
20
+ - `jotai` (≥2)
21
+ - `@tanstack/react-query` (≥5)
22
+ - `@mysten/dapp-kit-react` (≥1) & `@mysten/sui` (≥2)
23
+ - `zo-sdk` (≥0.1)
24
+
25
+ The widget uses Tailwind-compatible utility classes (e.g. `flex`, `text-white`, `rounded-lg`). Use **Tailwind CSS** or **UnoCSS** in your app so those classes resolve.
26
+
27
+ ---
28
+
29
+ ## Quick start: full widget
30
+
31
+ 1. **Wrap your app** with the required providers (order matters):
32
+
33
+ ```tsx
34
+ import { appStore } from '@zo/trading-widget'
35
+ import { Provider as JotaiProvider } from 'jotai'
36
+ import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
37
+ import { DAppKitProvider } from '@mysten/dapp-kit-react'
38
+
39
+ // Your dapp-kit instance (Sui wallet + network)
40
+ import { dAppKit } from './dapp-kit'
41
+
42
+ const queryClient = new QueryClient({
43
+ defaultOptions: {
44
+ queries: { staleTime: 60_000, retry: 2 },
45
+ },
46
+ })
47
+
48
+ export function Root() {
49
+ return (
50
+ <JotaiProvider store={appStore}>
51
+ <QueryClientProvider client={queryClient}>
52
+ <DAppKitProvider dAppKit={dAppKit}>
53
+ <App />
54
+ </DAppKitProvider>
55
+ </QueryClientProvider>
56
+ </JotaiProvider>
57
+ )
58
+ }
59
+ ```
60
+
61
+ 2. **Render the widget** where you want the trading UI:
62
+
63
+ ```tsx
64
+ import { TradingWidget } from '@zo/trading-widget'
65
+
66
+ export function App() {
67
+ return (
68
+ <div className="h-screen flex flex-col">
69
+ <header>{/* Your navbar, connect button, etc. */}</header>
70
+ <main className="min-h-0 flex-1">
71
+ <TradingWidget className="h-full" />
72
+ </main>
73
+ </div>
74
+ )
75
+ }
76
+ ```
77
+
78
+ **TradingWidget props**
79
+
80
+ | Prop | Type | Description |
81
+ | ---------- | -------- | ------------------------------------ |
82
+ | `symbol` | `string` | Initial symbol (default `"BTC"`) |
83
+ | `className`| `string` | Extra class on the widget container |
84
+
85
+ ---
86
+
87
+ ## Components
88
+
89
+ ### All-in-one
90
+
91
+ - **`TradingWidget`** – Full layout: header, chart, recent trades, trade panel, bottom tabs (positions/orders/history), dialogs and toasts.
92
+
93
+ ### Layout & header
94
+
95
+ - **`TradingWidgetProvider`** – Sui + React Query + Jotai setup. Use when building a custom layout so sub-components have the same context.
96
+ - **`MarketHeader`** – Symbol dropdown (from ZLP/SLP index tokens), mark price, funding rate.
97
+
98
+ ### Market data
99
+
100
+ - **`PriceChart`** – Pyth-backed candlestick chart (history + streaming).
101
+ - **`RecentTrades`** – Recent trades for the selected symbol.
102
+
103
+ ### Trading & account
104
+
105
+ - **`TradePanel`** – Long/short, market/limit, leverage, collateral selector; opens positions on ZLP/SLP/USDZ.
106
+ - **`CustomConnectButton`** – Connect wallet; when connected opens the account sidebar instead of a dropdown.
107
+
108
+ ### Tables (bottom section)
109
+
110
+ - **`BottomTabs`** – Tabs: Positions, Orders, History; each shows a circular countdown to next refresh.
111
+ - **`PositionsList`** – Open positions with PnL, adjust/close.
112
+ - **`OrdersList`** – Open orders with cancel.
113
+ - **`HistoryList`** – Trade history.
114
+
115
+ ### Settings
116
+
117
+ - **`RpcSettings`** – Dropdown: choose predefined RPC or enter custom URL; shows latency. Persists to `localStorage` so the widget’s provider uses the selected RPC.
118
+
119
+ ---
120
+
121
+ ## Custom layout
122
+
123
+ Use **`TradingWidgetProvider`** and the sub-components to build your own layout:
124
+
125
+ ```tsx
126
+ import {
127
+ TradingWidgetProvider,
128
+ MarketHeader,
129
+ PriceChart,
130
+ RecentTrades,
131
+ TradePanel,
132
+ BottomTabs,
133
+ CustomConnectButton,
134
+ RpcSettings,
135
+ } from '@zo/trading-widget'
136
+
137
+ export function CustomTradePage() {
138
+ return (
139
+ <TradingWidgetProvider>
140
+ <div className="flex flex-col h-full bg-gray-950 text-white">
141
+ <header className="flex items-center gap-3 border-b border-gray-800 px-4 py-2">
142
+ <MarketHeader />
143
+ <div className="flex-1" />
144
+ <RpcSettings />
145
+ <CustomConnectButton />
146
+ </header>
147
+ <div className="flex flex-1 overflow-hidden">
148
+ <div className="flex-1 min-w-0">
149
+ <PriceChart />
150
+ </div>
151
+ <aside className="w-48 shrink-0">
152
+ <RecentTrades />
153
+ </aside>
154
+ <aside className="w-72 shrink-0">
155
+ <TradePanel />
156
+ </aside>
157
+ </div>
158
+ <div className="h-52 shrink-0 border-t border-gray-800">
159
+ <BottomTabs />
160
+ </div>
161
+ </div>
162
+ </TradingWidgetProvider>
163
+ )
164
+ }
165
+ ```
166
+
167
+ Ensure your app is wrapped with **Jotai** (`appStore`), **React Query**, and **DAppKit** as in Quick start.
168
+
169
+ ---
170
+
171
+ ## Hooks & store
172
+
173
+ For custom UIs that need widget data or actions:
174
+
175
+ **Hooks**
176
+
177
+ - `useEssential()` – wallet, network, consts (zo/sudo/usdz), accountData, refreshAccount
178
+ - `useWallet()`, `useNetwork()` – wallet and current network
179
+ - `usePosition(address, network)` – positions list, refresh, `dataUpdatedAt`
180
+ - `useOrder(address, network)` – orders list, refresh, `dataUpdatedAt`
181
+ - `useHistories(address, network)` – trade history
182
+ - `useFundingRate(symbol, network, lpToken)` – funding rate
183
+ - `usePositionConfig(network, { symbols })` – position config (fees, etc.)
184
+ - `useSymbolInfo(network)` – symbol info map (ZLP/SLP/USDZ)
185
+ - `useRpc()` – RPC list, custom URL, latency; used by `RpcSettings`
186
+ - `useSponsoredGasAvailability(address, network)` – gas sponsorship
187
+
188
+ **Store (Jotai)**
189
+
190
+ - `appStore` – same store instance must be used for the widget and your app (see Quick start).
191
+ - `currentSymbolAtom` – `{ symbolId, unit, icon }`; set when user picks a market.
192
+ - `tokenPriceAtom` – `{ tokenPrice: Record<string, number>, isLoading, error }` (Pyth oracle prices).
193
+
194
+ ---
195
+
196
+ ## RPC and wallet
197
+
198
+ - **RPC** – The widget reads RPC from `localStorage`: `is-custom-rpc`, `custom-rpc-url`, `custom-rpc-index`. Use **`RpcSettings`** in your header (or elsewhere) so users can pick a predefined RPC or set a custom URL. After changing RPC, a full page refresh is recommended.
199
+ - **Wallet** – Uses **Sui dapp-kit**. Your app must create a `dAppKit` (e.g. with `createDAppKit`) and wrap the tree in `DAppKitProvider`. **`CustomConnectButton`** triggers the kit’s connect flow; when connected, it opens the widget’s account sidebar.
200
+
201
+ ---
202
+
203
+ ## Example app
204
+
205
+ The repo includes an example app that integrates the widget:
206
+
207
+ - **Apps/example** – Minimal shell: navbar (brand, RPC settings, connect), then full-width `TradingWidget`. See `apps/example/src/App.tsx` and `apps/example/src/main.tsx` for provider setup and `dAppKit` registration.
208
+
209
+ Run it (from monorepo root):
210
+
211
+ ```bash
212
+ pnpm install
213
+ pnpm --filter example dev
214
+ ```
215
+
216
+ ---
217
+
218
+ ## Build
219
+
220
+ From the repo root:
221
+
222
+ ```bash
223
+ pnpm --filter @zo/trading-widget build
224
+ ```
225
+
226
+ Output: `packages/trading-widget/dist/` (ESM + types). Consume from your app as `@zo/trading-widget` (workspace or published package).
@@ -0,0 +1,10 @@
1
+ export interface TradingWidgetProps {
2
+ /** Initial symbol to display (default: BTC) */
3
+ symbol?: string;
4
+ /** Custom RPC URL */
5
+ rpcUrl?: string;
6
+ /** Custom class for the outer wrapper */
7
+ className?: string;
8
+ }
9
+ export declare function TradingWidget({ symbol: _symbol, rpcUrl: _rpcUrl, className }: TradingWidgetProps): import("react/jsx-runtime").JSX.Element;
10
+ //# sourceMappingURL=TradingWidget.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TradingWidget.d.ts","sourceRoot":"","sources":["../src/TradingWidget.tsx"],"names":[],"mappings":"AAUA,MAAM,WAAW,kBAAkB;IACjC,+CAA+C;IAC/C,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,qBAAqB;IACrB,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,yCAAyC;IACzC,SAAS,CAAC,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,aAAa,CAAC,EAAE,MAAM,EAAE,OAAe,EAAE,MAAM,EAAE,OAAO,EAAE,SAAS,EAAE,EAAE,kBAAkB,2CAwCxG"}
@@ -0,0 +1,2 @@
1
+ export declare function MarketHeader(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=MarketHeader.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"MarketHeader.d.ts","sourceRoot":"","sources":["../../../src/components/layout/MarketHeader.tsx"],"names":[],"mappings":"AAUA,wBAAgB,YAAY,4CA0G3B"}
@@ -0,0 +1,15 @@
1
+ import { SuiGrpcClient } from '@mysten/sui/grpc';
2
+ import type { ReactNode } from 'react';
3
+ declare const dAppKit: import("@mysten/dapp-kit-react").DAppKit<"mainnet"[], SuiGrpcClient>;
4
+ declare module '@mysten/dapp-kit-react' {
5
+ interface Register {
6
+ dAppKit: typeof dAppKit;
7
+ }
8
+ }
9
+ interface TradingWidgetProviderProps {
10
+ children: ReactNode;
11
+ rpcUrl?: string;
12
+ }
13
+ export declare function TradingWidgetProvider({ children }: TradingWidgetProviderProps): import("react/jsx-runtime").JSX.Element;
14
+ export {};
15
+ //# sourceMappingURL=TradingWidgetProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TradingWidgetProvider.d.ts","sourceRoot":"","sources":["../../../src/components/layout/TradingWidgetProvider.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAIhD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAStC,QAAA,MAAM,OAAO,sEAKX,CAAA;AAEF,OAAO,QAAQ,wBAAwB,CAAC;IACtC,UAAU,QAAQ;QAChB,OAAO,EAAE,OAAO,OAAO,CAAA;KACxB;CACF;AAED,UAAU,0BAA0B;IAClC,QAAQ,EAAE,SAAS,CAAA;IACnB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AAWD,wBAAgB,qBAAqB,CAAC,EAAE,QAAQ,EAAE,EAAE,0BAA0B,2CAU7E"}
@@ -0,0 +1,4 @@
1
+ export declare function shouldShowDialog(key: string): boolean;
2
+ export declare function acknowledgeDialog(key: string): void;
3
+ export declare function AppDialogs(): import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=AppDialogs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"AppDialogs.d.ts","sourceRoot":"","sources":["../../../src/components/market/AppDialogs.tsx"],"names":[],"mappings":"AAIA,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAMrD;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAMnD;AAiDD,wBAAgB,UAAU,4CAyDzB"}
@@ -0,0 +1,2 @@
1
+ export declare function PriceChart(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=PriceChart.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PriceChart.d.ts","sourceRoot":"","sources":["../../../src/components/market/PriceChart.tsx"],"names":[],"mappings":"AAOA,wBAAgB,UAAU,4CAyFzB"}
@@ -0,0 +1,2 @@
1
+ export declare function RecentTrades(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=RecentTrades.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RecentTrades.d.ts","sourceRoot":"","sources":["../../../src/components/market/RecentTrades.tsx"],"names":[],"mappings":"AASA,wBAAgB,YAAY,4CA4F3B"}
@@ -0,0 +1,2 @@
1
+ export declare function RpcSettings(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=RpcSettings.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"RpcSettings.d.ts","sourceRoot":"","sources":["../../../src/components/settings/RpcSettings.tsx"],"names":[],"mappings":"AAeA,wBAAgB,WAAW,4CAgL1B"}
@@ -0,0 +1,2 @@
1
+ export declare function BottomTabs(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=BottomTabs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"BottomTabs.d.ts","sourceRoot":"","sources":["../../../src/components/tables/BottomTabs.tsx"],"names":[],"mappings":"AA6DA,wBAAgB,UAAU,4CAqCzB"}
@@ -0,0 +1,2 @@
1
+ export declare function HistoryList(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=HistoryList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"HistoryList.d.ts","sourceRoot":"","sources":["../../../src/components/tables/HistoryList.tsx"],"names":[],"mappings":"AAYA,wBAAgB,WAAW,4CA2I1B"}
@@ -0,0 +1,2 @@
1
+ export declare function OrdersList(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=OrdersList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrdersList.d.ts","sourceRoot":"","sources":["../../../src/components/tables/OrdersList.tsx"],"names":[],"mappings":"AAaA,wBAAgB,UAAU,4CA2HzB"}
@@ -0,0 +1,2 @@
1
+ export declare function PositionsList(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=PositionsList.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PositionsList.d.ts","sourceRoot":"","sources":["../../../src/components/tables/PositionsList.tsx"],"names":[],"mappings":"AAwCA,wBAAgB,aAAa,4CA6M5B"}
@@ -0,0 +1,19 @@
1
+ import type { LPToken, Network } from 'zo-sdk';
2
+ import type { WalletContextState } from '../../hooks/useWallet';
3
+ import type { CoinConsts, ExtendedOrderInfo, GenericConsts } from '../../utils/models';
4
+ type Props = {
5
+ showOrderCancel: boolean;
6
+ setShowOrderCancel: (show: boolean) => void;
7
+ order: ExtendedOrderInfo | null;
8
+ consts: GenericConsts;
9
+ mergedCoinConsts: CoinConsts;
10
+ network: Network;
11
+ wallet: WalletContextState;
12
+ refreshAccount: () => void;
13
+ refreshOrder: () => void;
14
+ prices: Record<string, number>;
15
+ activeLPType: LPToken;
16
+ };
17
+ export declare function OrderCancel({ showOrderCancel, setShowOrderCancel, order, mergedCoinConsts, consts: _consts, network, wallet, refreshAccount, refreshOrder, prices, activeLPType, }: Props): import("react/jsx-runtime").JSX.Element | null;
18
+ export {};
19
+ //# sourceMappingURL=OrderCancel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"OrderCancel.d.ts","sourceRoot":"","sources":["../../../src/components/trade/OrderCancel.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAY,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAKxD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAG/D,OAAO,KAAK,EAAE,UAAU,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEtF,KAAK,KAAK,GAAG;IACX,eAAe,EAAE,OAAO,CAAA;IACxB,kBAAkB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IAC3C,KAAK,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAC/B,MAAM,EAAE,aAAa,CAAA;IACrB,gBAAgB,EAAE,UAAU,CAAA;IAC5B,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,kBAAkB,CAAA;IAC1B,cAAc,EAAE,MAAM,IAAI,CAAA;IAC1B,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,YAAY,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,wBAAgB,WAAW,CAAC,EAC1B,eAAe,EACf,kBAAkB,EAClB,KAAK,EACL,gBAAgB,EAChB,MAAM,EAAE,OAAO,EACf,OAAO,EACP,MAAM,EACN,cAAc,EACd,YAAY,EACZ,MAAM,EACN,YAAY,GACb,EAAE,KAAK,kDA+HP"}
@@ -0,0 +1,24 @@
1
+ import type { IBasePositionConfig, LPToken, Network } from 'zo-sdk';
2
+ import type { IAccountData } from '../../hooks/useAccountData';
3
+ import type { WalletContextState } from '../../hooks/useWallet';
4
+ import type { CoinConsts, DisplayPosition, GenericConsts } from '../../utils/models';
5
+ type Props = {
6
+ showPositionAdjust: boolean;
7
+ setShowPositionAdjust: (show: boolean) => void;
8
+ position: DisplayPosition | null;
9
+ positionConfig?: IBasePositionConfig | null;
10
+ consts: GenericConsts;
11
+ mergedCoinConsts: CoinConsts;
12
+ prices: Record<string, number>;
13
+ accountData: IAccountData;
14
+ network: Network;
15
+ wallet: WalletContextState;
16
+ activeLPType: LPToken;
17
+ refreshAccount: () => void;
18
+ refreshPosition: () => void;
19
+ refreshVaultInfo: () => void;
20
+ refreshReservingRate: () => void;
21
+ };
22
+ export declare function PositionAdjust({ showPositionAdjust, setShowPositionAdjust, position, positionConfig, consts, mergedCoinConsts, accountData, network, wallet, activeLPType, refreshAccount, refreshPosition, refreshVaultInfo, refreshReservingRate, }: Props): import("react/jsx-runtime").JSX.Element | null;
23
+ export {};
24
+ //# sourceMappingURL=PositionAdjust.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PositionAdjust.d.ts","sourceRoot":"","sources":["../../../src/components/trade/PositionAdjust.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAY,mBAAmB,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAG7E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAG9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAG/D,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEpF,KAAK,KAAK,GAAG;IACX,kBAAkB,EAAE,OAAO,CAAA;IAC3B,qBAAqB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IAC9C,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAA;IAChC,cAAc,CAAC,EAAE,mBAAmB,GAAG,IAAI,CAAA;IAC3C,MAAM,EAAE,aAAa,CAAA;IACrB,gBAAgB,EAAE,UAAU,CAAA;IAC5B,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAA;IAC9B,WAAW,EAAE,YAAY,CAAA;IACzB,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,kBAAkB,CAAA;IAC1B,YAAY,EAAE,OAAO,CAAA;IACrB,cAAc,EAAE,MAAM,IAAI,CAAA;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B,gBAAgB,EAAE,MAAM,IAAI,CAAA;IAC5B,oBAAoB,EAAE,MAAM,IAAI,CAAA;CACjC,CAAA;AAED,wBAAgB,cAAc,CAAC,EAC7B,kBAAkB,EAClB,qBAAqB,EACrB,QAAQ,EACR,cAAc,EACd,MAAM,EACN,gBAAgB,EAChB,WAAW,EACX,OAAO,EACP,MAAM,EACN,YAAY,EACZ,cAAc,EACd,eAAe,EACf,gBAAgB,EAChB,oBAAoB,GACrB,EAAE,KAAK,kDAiOP"}
@@ -0,0 +1,28 @@
1
+ import type { LPToken, Network } from 'zo-sdk';
2
+ import type { IAccountData } from '../../hooks/useAccountData';
3
+ import type { WalletContextState } from '../../hooks/useWallet';
4
+ import type { CoinConsts, DisplayPosition, ExtendedOrderInfo, GenericConsts } from '../../utils/models';
5
+ type Props = {
6
+ relativeOrders?: ExtendedOrderInfo[];
7
+ position: DisplayPosition | null;
8
+ showPositionClose: boolean;
9
+ setShowPositionClose: (show: boolean) => void;
10
+ accountData: IAccountData;
11
+ wallet: WalletContextState;
12
+ network: Network;
13
+ refreshAccount: () => void;
14
+ refreshPosition: () => void;
15
+ consts: GenericConsts;
16
+ markPrice: number;
17
+ refreshVaultInfo: () => void;
18
+ refreshReservingRate: () => void;
19
+ closeBps?: number;
20
+ collateralToken: string;
21
+ collateralPrice: number;
22
+ refreshOrder: () => void;
23
+ mergedCoinConsts: CoinConsts;
24
+ activeLPType: LPToken;
25
+ };
26
+ export declare function PositionClose({ relativeOrders, position, showPositionClose, setShowPositionClose, accountData, wallet, network, refreshAccount, refreshPosition, consts, markPrice, refreshVaultInfo, refreshReservingRate, closeBps, collateralToken, collateralPrice, mergedCoinConsts, refreshOrder, activeLPType, }: Props): import("react/jsx-runtime").JSX.Element | null;
27
+ export {};
28
+ //# sourceMappingURL=PositionClose.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"PositionClose.d.ts","sourceRoot":"","sources":["../../../src/components/trade/PositionClose.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAY,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAGxD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,4BAA4B,CAAA;AAK9D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAA;AAI/D,OAAO,KAAK,EAAE,UAAU,EAAE,eAAe,EAAE,iBAAiB,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAA;AAEvG,KAAK,KAAK,GAAG;IACX,cAAc,CAAC,EAAE,iBAAiB,EAAE,CAAA;IACpC,QAAQ,EAAE,eAAe,GAAG,IAAI,CAAA;IAChC,iBAAiB,EAAE,OAAO,CAAA;IAC1B,oBAAoB,EAAE,CAAC,IAAI,EAAE,OAAO,KAAK,IAAI,CAAA;IAC7C,WAAW,EAAE,YAAY,CAAA;IACzB,MAAM,EAAE,kBAAkB,CAAA;IAC1B,OAAO,EAAE,OAAO,CAAA;IAChB,cAAc,EAAE,MAAM,IAAI,CAAA;IAC1B,eAAe,EAAE,MAAM,IAAI,CAAA;IAC3B,MAAM,EAAE,aAAa,CAAA;IACrB,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,MAAM,IAAI,CAAA;IAC5B,oBAAoB,EAAE,MAAM,IAAI,CAAA;IAChC,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,MAAM,CAAA;IACvB,eAAe,EAAE,MAAM,CAAA;IACvB,YAAY,EAAE,MAAM,IAAI,CAAA;IACxB,gBAAgB,EAAE,UAAU,CAAA;IAC5B,YAAY,EAAE,OAAO,CAAA;CACtB,CAAA;AAED,wBAAgB,aAAa,CAAC,EAC5B,cAAc,EACd,QAAQ,EACR,iBAAiB,EACjB,oBAAoB,EACpB,WAAW,EACX,MAAM,EACN,OAAO,EACP,cAAc,EACd,eAAe,EACf,MAAM,EACN,SAAS,EACT,gBAAgB,EAChB,oBAAoB,EACpB,QAAY,EACZ,eAAe,EACf,eAAe,EACf,gBAAgB,EAChB,YAAY,EACZ,YAAY,GACb,EAAE,KAAK,kDAoSP"}
@@ -0,0 +1,2 @@
1
+ export declare function TradePanel(): import("react/jsx-runtime").JSX.Element;
2
+ //# sourceMappingURL=TradePanel.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"TradePanel.d.ts","sourceRoot":"","sources":["../../../src/components/trade/TradePanel.tsx"],"names":[],"mappings":"AA2BA,wBAAgB,UAAU,4CAmbzB"}
@@ -0,0 +1,4 @@
1
+ export declare function CustomConnectButton({ className }: {
2
+ className?: string;
3
+ }): import("react/jsx-runtime").JSX.Element;
4
+ //# sourceMappingURL=CustomConnectButton.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CustomConnectButton.d.ts","sourceRoot":"","sources":["../../../src/components/wallet/CustomConnectButton.tsx"],"names":[],"mappings":"AA4DA,wBAAgB,mBAAmB,CAAC,EAAE,SAAS,EAAE,EAAE;IAAE,SAAS,CAAC,EAAE,MAAM,CAAA;CAAE,2CA4ExE"}
@@ -0,0 +1,5 @@
1
+ export declare const ZO_API_ENDPOINT = "https://api.zofinance.io";
2
+ export declare const SUDO_API_ENDPOINT = "https://api.sudofinance.xyz";
3
+ export declare const ZO_WEB_APP_URL = "https://app.zofai.io";
4
+ export declare const SUINS_TYPE = "0x00c2f85e07181b90c140b15c5ce27d863f93c4d9159d2a4e7bdaeb40e286d6f5::subdomain_registration::SubDomainRegistration";
5
+ //# sourceMappingURL=query.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"query.d.ts","sourceRoot":"","sources":["../../src/constants/query.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,eAAe,6BAA6B,CAAA;AACzD,eAAO,MAAM,iBAAiB,gCAAgC,CAAA;AAC9D,eAAO,MAAM,cAAc,yBAAyB,CAAA;AACpD,eAAO,MAAM,UAAU,sHACgG,CAAA"}
@@ -0,0 +1,18 @@
1
+ export declare const RPC_LIST: {
2
+ devnet: {
3
+ name: string;
4
+ rpc: string;
5
+ wss: string;
6
+ }[];
7
+ testnet: {
8
+ name: string;
9
+ rpc: string;
10
+ wss: string;
11
+ }[];
12
+ mainnet: {
13
+ name: string;
14
+ rpc: string;
15
+ wss: string;
16
+ }[];
17
+ };
18
+ //# sourceMappingURL=rpc.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"rpc.d.ts","sourceRoot":"","sources":["../../src/constants/rpc.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,QAAQ;;;;;;;;;;;;;;;;CAqCpB,CAAA"}
@@ -0,0 +1,46 @@
1
+ export declare const MARKET_HOURS_24_7 = "24/7";
2
+ export declare const MARKET_HOURS_COMMODITY = "America/New_York;0000-1700&1800-2400,0000-1700&1800-2400,0000-1700&1800-2400,0000-1700&1800-2400,0000-1700,C,1800-2400;0119/0000-1430&1800-2400,0216/0000-1430&1800-2400,0402/0000-1700,0403/C";
3
+ export declare const MARKET_HOURS_EQUITY_ETF = "America/New_York;0930-1600,0930-1600,0930-1600,0930-1600,0930-1600,C,C;0101/C,0119/C,0216/C,0403/C,0525/C,0619/C";
4
+ export type TOKEN = {
5
+ symbol: string;
6
+ name: string;
7
+ icon: string;
8
+ symbolDisplay: string;
9
+ tradingViewSymbol?: string;
10
+ tags?: string[];
11
+ isPayingToken?: boolean;
12
+ marketHour?: string;
13
+ };
14
+ export declare const TOKENS: TOKEN[];
15
+ export declare const UNSUPPORTED_COLLATERALS: string[];
16
+ export declare const OFFLINE_TOKEN: string[];
17
+ export declare const OFFLINE_ZLP_TOKEN: string[];
18
+ export declare const OFFLINE_SLP_TOKEN: string[];
19
+ export declare const SWAP_MINT_TOKEN: string[];
20
+ export declare const CETUS_SWAP_SLIPPAGE = 0.03;
21
+ export declare function getTokenInfo(symbol: string): TOKEN | undefined;
22
+ export declare function getAllTokenIcons(): Record<string, string>;
23
+ export declare function getTokenIcon(symbol: string): string;
24
+ export declare const MAIN_COLOR = "#007AF0";
25
+ export declare const LONG_COLOR = "#4ade80";
26
+ export declare const SHORT_COLOR = "#f43f5e";
27
+ export declare const SWAP_COLOR = "#007AF0";
28
+ export declare const LONG_LEVERAGE_MIN = 1;
29
+ export declare const LONG_LEVERAGE_MAX = 20;
30
+ export declare const LONG_LEVERAGE_STEP = 0.5;
31
+ export declare const SHORT_LEVERAGE_MIN = 1;
32
+ export declare const SHORT_LEVERAGE_MAX = 20;
33
+ export declare const SHORT_LEVERAGE_STEP = 0.5;
34
+ export declare const DEFAULT_INDEX_TOKEN = "btc";
35
+ export declare const DEFAULT_COLLATERAL_TOKEN = "sui";
36
+ export declare const DEFAULT_SWAP_FROM_TOKEN = "sui";
37
+ export declare const DEFAULT_SWAP_TO_TOKEN = "nusdc";
38
+ export declare const DEFAULT_LEVERAGE = 10;
39
+ export declare const ACCOUNT_REFRESH_INTERVAL = 5000;
40
+ export declare const PRICE_REFRESH_INTERVAL = 5000;
41
+ export declare const POOL_OP_MIN_FEE = 1;
42
+ export declare const PERP_OP_MIN_FEE = 0.2;
43
+ export declare const RELAYER_FEE = 0.01;
44
+ export declare const RELAYER_CLOSE_FEE = 0.03;
45
+ export declare const SWAP_OP_MIN_FEE = 1;
46
+ //# sourceMappingURL=tokens.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tokens.d.ts","sourceRoot":"","sources":["../../src/constants/tokens.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,iBAAiB,SAAS,CAAA;AACvC,eAAO,MAAM,sBAAsB,mMAAmM,CAAA;AACtO,eAAO,MAAM,uBAAuB,qHAAqH,CAAA;AAEzJ,MAAM,MAAM,KAAK,GAAG;IAClB,MAAM,EAAE,MAAM,CAAA;IACd,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;IACZ,aAAa,EAAE,MAAM,CAAA;IACrB,iBAAiB,CAAC,EAAE,MAAM,CAAA;IAC1B,IAAI,CAAC,EAAE,MAAM,EAAE,CAAA;IACf,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,MAAM,EAAE,KAAK,EAyiBzB,CAAA;AAED,eAAO,MAAM,uBAAuB,EAAE,MAAM,EAAwD,CAAA;AAEpG,eAAO,MAAM,aAAa,EAAE,MAAM,EAA6B,CAAA;AAC/D,eAAO,MAAM,iBAAiB,EAAE,MAAM,EAAsB,CAAA;AAC5D,eAAO,MAAM,iBAAiB,EAAE,MAAM,EAA+B,CAAA;AACrE,eAAO,MAAM,eAAe,EAAE,MAAM,EAAY,CAAA;AAEhD,eAAO,MAAM,mBAAmB,OAAO,CAAA;AAGvC,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,KAAK,GAAG,SAAS,CAE9D;AAGD,wBAAgB,gBAAgB,IAAI,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAUzD;AAGD,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAOnD;AAED,eAAO,MAAM,UAAU,YAAY,CAAA;AAEnC,eAAO,MAAM,UAAU,YAAY,CAAA;AACnC,eAAO,MAAM,WAAW,YAAY,CAAA;AACpC,eAAO,MAAM,UAAU,YAAY,CAAA;AAEnC,eAAO,MAAM,iBAAiB,IAAI,CAAA;AAClC,eAAO,MAAM,iBAAiB,KAAK,CAAA;AACnC,eAAO,MAAM,kBAAkB,MAAM,CAAA;AAErC,eAAO,MAAM,kBAAkB,IAAI,CAAA;AACnC,eAAO,MAAM,kBAAkB,KAAK,CAAA;AACpC,eAAO,MAAM,mBAAmB,MAAM,CAAA;AAEtC,eAAO,MAAM,mBAAmB,QAAQ,CAAA;AACxC,eAAO,MAAM,wBAAwB,QAAQ,CAAA;AAC7C,eAAO,MAAM,uBAAuB,QAAQ,CAAA;AAC5C,eAAO,MAAM,qBAAqB,UAAU,CAAA;AAC5C,eAAO,MAAM,gBAAgB,KAAK,CAAA;AAElC,eAAO,MAAM,wBAAwB,OAAO,CAAA;AAC5C,eAAO,MAAM,sBAAsB,OAAO,CAAA;AAE1C,eAAO,MAAM,eAAe,IAAI,CAAA;AAEhC,eAAO,MAAM,eAAe,MAAM,CAAA;AAElC,eAAO,MAAM,WAAW,OAAO,CAAA;AAC/B,eAAO,MAAM,iBAAiB,OAAO,CAAA;AACrC,eAAO,MAAM,eAAe,IAAI,CAAA"}
@@ -0,0 +1,18 @@
1
+ import type { IConsts, Network } from 'zo-sdk';
2
+ import type { WalletContextState } from './useWallet';
3
+ export interface ITokenBalance {
4
+ symbol: string;
5
+ balance: number;
6
+ }
7
+ export interface IAccountData {
8
+ balance: ITokenBalance[];
9
+ address: string;
10
+ suiBalance: number;
11
+ }
12
+ export declare function useAccountData(wallet: WalletContextState, network: Network, zoConsts: IConsts, sudoConsts?: IConsts, usdzConsts?: IConsts, zbtcvcConsts?: IConsts): {
13
+ accountData: IAccountData;
14
+ isLoading: boolean;
15
+ error: string | null;
16
+ refresh: (options?: import("@tanstack/react-query").RefetchOptions) => Promise<import("@tanstack/react-query").QueryObserverResult<IAccountData, Error>>;
17
+ };
18
+ //# sourceMappingURL=useAccountData.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useAccountData.d.ts","sourceRoot":"","sources":["../../src/hooks/useAccountData.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AAI9C,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAA;AAIrD,MAAM,WAAW,aAAa;IAC5B,MAAM,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,MAAM,CAAA;CAChB;AAED,MAAM,WAAW,YAAY;IAC3B,OAAO,EAAE,aAAa,EAAE,CAAA;IACxB,OAAO,EAAE,MAAM,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;CACnB;AAED,wBAAgB,cAAc,CAC5B,MAAM,EAAE,kBAAkB,EAC1B,OAAO,EAAE,OAAO,EAChB,QAAQ,EAAE,OAAO,EACjB,UAAU,CAAC,EAAE,OAAO,EACpB,UAAU,CAAC,EAAE,OAAO,EACpB,YAAY,CAAC,EAAE,OAAO;;;;;EA+IvB"}
@@ -0,0 +1,18 @@
1
+ export interface ClosePositionPreview {
2
+ baseToSwapForQuote: number;
3
+ quoteToSwapForBase: number;
4
+ /** Exact quote received when selling base for quote */
5
+ quoteOutFromSell: number;
6
+ /** Exact base received when buying base with quote */
7
+ baseOutFromBuy: number;
8
+ withdrawableBase: number;
9
+ withdrawableQuote: number;
10
+ repayBaseAmount: number;
11
+ repayQuoteAmount: number;
12
+ }
13
+ export declare function useClosePositionPreview(poolKey: string, managerId: string | null, baseAsset: number, quoteAsset: number, baseDebt: number, quoteDebt: number, closePercent: number | null, slippage?: number): {
14
+ preview: ClosePositionPreview | null;
15
+ isLoading: boolean;
16
+ error: string | null;
17
+ };
18
+ //# sourceMappingURL=useClosePositionPreview.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useClosePositionPreview.d.ts","sourceRoot":"","sources":["../../src/hooks/useClosePositionPreview.ts"],"names":[],"mappings":"AAMA,MAAM,WAAW,oBAAoB;IACnC,kBAAkB,EAAE,MAAM,CAAA;IAC1B,kBAAkB,EAAE,MAAM,CAAA;IAC1B,uDAAuD;IACvD,gBAAgB,EAAE,MAAM,CAAA;IACxB,sDAAsD;IACtD,cAAc,EAAE,MAAM,CAAA;IACtB,gBAAgB,EAAE,MAAM,CAAA;IACxB,iBAAiB,EAAE,MAAM,CAAA;IACzB,eAAe,EAAE,MAAM,CAAA;IACvB,gBAAgB,EAAE,MAAM,CAAA;CACzB;AAKD,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,MAAM,EACf,SAAS,EAAE,MAAM,GAAG,IAAI,EACxB,SAAS,EAAE,MAAM,EACjB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM,GAAG,IAAI,EAC3B,QAAQ,SAAO;;;;EAkIhB"}
@@ -0,0 +1,23 @@
1
+ import type { Network } from 'zo-sdk';
2
+ import { getConsts as getSudoConsts, getConsts as getZoConsts } from 'zo-sdk';
3
+ import type { CoinConsts } from '../utils/models';
4
+ import { useWallet } from './useWallet';
5
+ export declare function useEssential(): {
6
+ wallet: ReturnType<typeof useWallet>;
7
+ network: Network;
8
+ consts: ReturnType<typeof getZoConsts>;
9
+ zoConsts: ReturnType<typeof getZoConsts>;
10
+ sudoConsts: ReturnType<typeof getSudoConsts>;
11
+ usdzConsts: ReturnType<typeof getZoConsts>;
12
+ zbtcvcConsts: ReturnType<typeof getZoConsts>;
13
+ sharedConfig: ReturnType<typeof getZoConsts>;
14
+ mergedCoinConsts: CoinConsts;
15
+ accountData: any;
16
+ refreshAccount: () => void;
17
+ verifyWalletStatus: (address: string) => Promise<boolean>;
18
+ isVerifying: boolean;
19
+ verificationStatus: any;
20
+ hasRejectedSigning: boolean;
21
+ resetVerificationState: () => void;
22
+ };
23
+ //# sourceMappingURL=useEssential.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useEssential.d.ts","sourceRoot":"","sources":["../../src/hooks/useEssential.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAAE,SAAS,IAAI,aAAa,EAAE,SAAS,IAAI,WAAW,EAA4B,MAAM,QAAQ,CAAA;AAEvG,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAA;AAGjD,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAA;AAGvC,wBAAgB,YAAY,IAAI;IAC9B,MAAM,EAAE,UAAU,CAAC,OAAO,SAAS,CAAC,CAAA;IACpC,OAAO,EAAE,OAAO,CAAA;IAChB,MAAM,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA;IACtC,QAAQ,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA;IACxC,UAAU,EAAE,UAAU,CAAC,OAAO,aAAa,CAAC,CAAA;IAC5C,UAAU,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA;IAC1C,YAAY,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA;IAC5C,YAAY,EAAE,UAAU,CAAC,OAAO,WAAW,CAAC,CAAA;IAC5C,gBAAgB,EAAE,UAAU,CAAA;IAC5B,WAAW,EAAE,GAAG,CAAA;IAChB,cAAc,EAAE,MAAM,IAAI,CAAA;IAC1B,kBAAkB,EAAE,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC,OAAO,CAAC,CAAA;IACzD,WAAW,EAAE,OAAO,CAAA;IACpB,kBAAkB,EAAE,GAAG,CAAA;IACvB,kBAAkB,EAAE,OAAO,CAAA;IAC3B,sBAAsB,EAAE,MAAM,IAAI,CAAA;CACnC,CAwDA"}
@@ -0,0 +1,15 @@
1
+ import type { Network } from 'zo-sdk';
2
+ import { LPToken } from 'zo-sdk';
3
+ import type { Pair } from '../utils/models';
4
+ export declare function useFundingRate(indexToken: string, network: Network, lpTokenType?: LPToken): {
5
+ fundingRateMap: Record<string, number> | null;
6
+ isLoading: boolean;
7
+ error: string | null;
8
+ };
9
+ export declare function getFundingRateFromMap(fundingRateMap: Record<string, number> | null, indexToken: string, lpTokenType: LPToken, isLong: boolean): number;
10
+ export declare function useMultipleFundingRates(pairs: Pair[], network: Network): {
11
+ fundingRateMap: Record<string, number> | null;
12
+ isLoading: boolean;
13
+ error: string | null;
14
+ };
15
+ //# sourceMappingURL=useFundingRate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"useFundingRate.d.ts","sourceRoot":"","sources":["../../src/hooks/useFundingRate.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAAc,OAAO,EAAE,MAAM,QAAQ,CAAA;AAG5C,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,iBAAiB,CAAA;AAiB3C,wBAAgB,cAAc,CAAC,UAAU,EAAE,MAAM,EAAE,OAAO,EAAE,OAAO,EAAE,WAAW,GAAE,OAAqB;;;;EA8DtG;AAGD,wBAAgB,qBAAqB,CACnC,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,EAC7C,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,OAAO,EACpB,MAAM,EAAE,OAAO,GACd,MAAM,CAUR;AAGD,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,IAAI,EAAE,EACb,OAAO,EAAE,OAAO;;;;EA4JjB"}