@0xmonaco/react 0.4.1 → 0.5.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 +377 -0
- package/dist/hooks/index.d.ts +10 -10
- package/dist/hooks/index.d.ts.map +1 -1
- package/dist/hooks/index.js +10 -10
- package/dist/hooks/index.js.map +1 -1
- package/dist/hooks/useAuth/index.d.ts +2 -2
- package/dist/hooks/useAuth/index.d.ts.map +1 -1
- package/dist/hooks/useAuth/index.js +1 -1
- package/dist/hooks/useAuth/index.js.map +1 -1
- package/dist/hooks/useAuth/types.d.ts +1 -1
- package/dist/hooks/useAuth/types.d.ts.map +1 -1
- package/dist/hooks/useAuth/useAuth.d.ts +1 -1
- package/dist/hooks/useAuth/useAuth.d.ts.map +1 -1
- package/dist/hooks/useAuth/useAuth.js +5 -6
- package/dist/hooks/useAuth/useAuth.js.map +1 -1
- package/dist/hooks/useFees/index.d.ts +2 -2
- package/dist/hooks/useFees/index.d.ts.map +1 -1
- package/dist/hooks/useFees/index.js +1 -1
- package/dist/hooks/useFees/index.js.map +1 -1
- package/dist/hooks/useFees/useFees.d.ts +1 -1
- package/dist/hooks/useFees/useFees.d.ts.map +1 -1
- package/dist/hooks/useFees/useFees.js +1 -1
- package/dist/hooks/useFees/useFees.js.map +1 -1
- package/dist/hooks/useMarket/index.d.ts +2 -2
- package/dist/hooks/useMarket/index.d.ts.map +1 -1
- package/dist/hooks/useMarket/index.js +1 -1
- package/dist/hooks/useMarket/index.js.map +1 -1
- package/dist/hooks/useMarket/useMarket.d.ts +1 -1
- package/dist/hooks/useMarket/useMarket.d.ts.map +1 -1
- package/dist/hooks/useMarket/useMarket.js +1 -1
- package/dist/hooks/useMarket/useMarket.js.map +1 -1
- package/dist/hooks/useMonaco/index.d.ts +2 -2
- package/dist/hooks/useMonaco/index.d.ts.map +1 -1
- package/dist/hooks/useMonaco/index.js +1 -1
- package/dist/hooks/useMonaco/index.js.map +1 -1
- package/dist/hooks/useMonaco/types.d.ts +4 -4
- package/dist/hooks/useMonaco/types.d.ts.map +1 -1
- package/dist/hooks/useMonaco/useMonaco.d.ts +1 -1
- package/dist/hooks/useMonaco/useMonaco.d.ts.map +1 -1
- package/dist/hooks/useMonaco/useMonaco.js +1 -1
- package/dist/hooks/useMonaco/useMonaco.js.map +1 -1
- package/dist/hooks/useOrderbook/index.d.ts +2 -1
- package/dist/hooks/useOrderbook/index.d.ts.map +1 -1
- package/dist/hooks/useOrderbook/index.js +1 -1
- package/dist/hooks/useOrderbook/index.js.map +1 -1
- package/dist/hooks/useOrderbook/types.d.ts +1 -3
- package/dist/hooks/useOrderbook/types.d.ts.map +1 -1
- package/dist/hooks/useOrderbook/useOrderbook.d.ts +3 -47
- package/dist/hooks/useOrderbook/useOrderbook.d.ts.map +1 -1
- package/dist/hooks/useOrderbook/useOrderbook.js +22 -146
- package/dist/hooks/useOrderbook/useOrderbook.js.map +1 -1
- package/dist/hooks/useProfile/index.d.ts +2 -2
- package/dist/hooks/useProfile/index.d.ts.map +1 -1
- package/dist/hooks/useProfile/index.js +1 -1
- package/dist/hooks/useProfile/index.js.map +1 -1
- package/dist/hooks/useProfile/types.d.ts +2 -3
- package/dist/hooks/useProfile/types.d.ts.map +1 -1
- package/dist/hooks/useProfile/useProfile.d.ts +1 -1
- package/dist/hooks/useProfile/useProfile.d.ts.map +1 -1
- package/dist/hooks/useProfile/useProfile.js +6 -6
- package/dist/hooks/useProfile/useProfile.js.map +1 -1
- package/dist/hooks/useTokenLifecycle/index.d.ts +2 -2
- package/dist/hooks/useTokenLifecycle/index.d.ts.map +1 -1
- package/dist/hooks/useTokenLifecycle/index.js +1 -1
- package/dist/hooks/useTokenLifecycle/index.js.map +1 -1
- package/dist/hooks/useTokenLifecycle/useTokenLifecycle.d.ts +1 -1
- package/dist/hooks/useTokenLifecycle/useTokenLifecycle.d.ts.map +1 -1
- package/dist/hooks/useTokenLifecycle/useTokenLifecycle.js +2 -2
- package/dist/hooks/useTokenLifecycle/useTokenLifecycle.js.map +1 -1
- package/dist/hooks/useTrade/index.d.ts +2 -2
- package/dist/hooks/useTrade/index.d.ts.map +1 -1
- package/dist/hooks/useTrade/index.js +1 -1
- package/dist/hooks/useTrade/index.js.map +1 -1
- package/dist/hooks/useTrade/types.d.ts.map +1 -1
- package/dist/hooks/useTrade/useTrade.d.ts +1 -1
- package/dist/hooks/useTrade/useTrade.d.ts.map +1 -1
- package/dist/hooks/useTrade/useTrade.js +1 -1
- package/dist/hooks/useTrade/useTrade.js.map +1 -1
- package/dist/hooks/useTradeFeed/index.d.ts +2 -2
- package/dist/hooks/useTradeFeed/index.d.ts.map +1 -1
- package/dist/hooks/useTradeFeed/index.js +2 -2
- package/dist/hooks/useTradeFeed/index.js.map +1 -1
- package/dist/hooks/useTradeFeed/types.d.ts +3 -37
- package/dist/hooks/useTradeFeed/types.d.ts.map +1 -1
- package/dist/hooks/useTradeFeed/useTradeFeed.d.ts +5 -28
- package/dist/hooks/useTradeFeed/useTradeFeed.d.ts.map +1 -1
- package/dist/hooks/useTradeFeed/useTradeFeed.js +33 -136
- package/dist/hooks/useTradeFeed/useTradeFeed.js.map +1 -1
- package/dist/hooks/useVault/index.d.ts +2 -2
- package/dist/hooks/useVault/index.d.ts.map +1 -1
- package/dist/hooks/useVault/index.js +1 -1
- package/dist/hooks/useVault/index.js.map +1 -1
- package/dist/hooks/useVault/types.d.ts +2 -2
- package/dist/hooks/useVault/types.d.ts.map +1 -1
- package/dist/hooks/useVault/useVault.d.ts +1 -1
- package/dist/hooks/useVault/useVault.d.ts.map +1 -1
- package/dist/hooks/useVault/useVault.js +9 -9
- package/dist/hooks/useVault/useVault.js.map +1 -1
- package/dist/index.d.ts +3 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/provider/MonacoProvider.d.ts +2 -2
- package/dist/provider/MonacoProvider.d.ts.map +1 -1
- package/dist/provider/MonacoProvider.js +9 -8
- package/dist/provider/MonacoProvider.js.map +1 -1
- package/dist/provider/index.d.ts +2 -2
- package/dist/provider/index.d.ts.map +1 -1
- package/dist/provider/index.js +2 -2
- package/dist/provider/index.js.map +1 -1
- package/dist/provider/types.d.ts +5 -4
- package/dist/provider/types.d.ts.map +1 -1
- package/dist/provider/types.js.map +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/dist/utils/index.d.ts.map +1 -1
- package/dist/utils/index.js +1 -1
- package/dist/utils/index.js.map +1 -1
- package/package.json +3 -3
- package/dist/hooks/useTradeFeed/utils.d.ts +0 -4
- package/dist/hooks/useTradeFeed/utils.d.ts.map +0 -1
- package/dist/hooks/useTradeFeed/utils.js +0 -16
- package/dist/hooks/useTradeFeed/utils.js.map +0 -1
package/README.md
ADDED
|
@@ -0,0 +1,377 @@
|
|
|
1
|
+
# Monaco React SDK
|
|
2
|
+
|
|
3
|
+
React hooks and components for the Monaco Protocol. Build trading applications with React using type-safe hooks for authentication, trading, market data, and WebSocket connections.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
# Install the React SDK and its dependencies
|
|
9
|
+
npm install @0xmonaco/react react wagmi@^2.17.5 viem@^2.31.7
|
|
10
|
+
|
|
11
|
+
# Or with pnpm
|
|
12
|
+
pnpm add @0xmonaco/react react wagmi@^2.17.5 viem@^2.31.7
|
|
13
|
+
|
|
14
|
+
# Or with yarn
|
|
15
|
+
yarn add @0xmonaco/react react wagmi@^2.17.5 viem@^2.31.7
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Features
|
|
19
|
+
|
|
20
|
+
- 🎣 **React Hooks**: Type-safe hooks for all Monaco Protocol operations
|
|
21
|
+
- 🔐 **Authentication**: `useAuth` hook for wallet-based login and session management
|
|
22
|
+
- 📈 **Trading**: `useTrade` hook for placing and managing orders
|
|
23
|
+
- 📊 **Market Data**: `useMarket` hook for trading pairs and candlestick data
|
|
24
|
+
- 👤 **Profile**: `useProfile` hook for user account information
|
|
25
|
+
- 🔄 **WebSocket**: Real-time hooks for orders, OHLCV, and orderbook updates
|
|
26
|
+
- 💼 **Vault**: `useVault` hook for token deposits and withdrawals
|
|
27
|
+
|
|
28
|
+
## Quick Start
|
|
29
|
+
|
|
30
|
+
### 1. Setup the Monaco Provider
|
|
31
|
+
|
|
32
|
+
Wrap your application with the `MonacoProvider`:
|
|
33
|
+
|
|
34
|
+
```tsx
|
|
35
|
+
import { MonacoProvider } from "@0xmonaco/react";
|
|
36
|
+
import { WagmiProvider, createConfig, http } from "wagmi";
|
|
37
|
+
import { seiTestnet } from "wagmi/chains";
|
|
38
|
+
|
|
39
|
+
const wagmiConfig = createConfig({
|
|
40
|
+
chains: [seiTestnet],
|
|
41
|
+
transports: {
|
|
42
|
+
[seiTestnet.id]: http("https://evm-rpc-testnet.sei-apis.com"),
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
|
|
46
|
+
function App() {
|
|
47
|
+
return (
|
|
48
|
+
<WagmiProvider config={wagmiConfig}>
|
|
49
|
+
<MonacoProvider
|
|
50
|
+
network="testnet"
|
|
51
|
+
seiRpcUrl="https://evm-rpc-testnet.sei-apis.com"
|
|
52
|
+
>
|
|
53
|
+
<YourApp />
|
|
54
|
+
</MonacoProvider>
|
|
55
|
+
</WagmiProvider>
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### 2. Use Monaco Hooks
|
|
61
|
+
|
|
62
|
+
```tsx
|
|
63
|
+
import { useMonaco, useAuth, useTrade, useMarket } from "@0xmonaco/react";
|
|
64
|
+
|
|
65
|
+
function TradingComponent() {
|
|
66
|
+
const sdk = useMonaco();
|
|
67
|
+
const { login, logout, isAuthenticated } = useAuth();
|
|
68
|
+
const { placeLimitOrder, placeMarketOrder } = useTrade();
|
|
69
|
+
const { tradingPairs, getTradingPairBySymbol } = useMarket();
|
|
70
|
+
|
|
71
|
+
// Login
|
|
72
|
+
const handleLogin = async () => {
|
|
73
|
+
await login("your-client-id", { connectWebSocket: true });
|
|
74
|
+
};
|
|
75
|
+
|
|
76
|
+
// Place an order
|
|
77
|
+
const handlePlaceOrder = async () => {
|
|
78
|
+
const order = await placeLimitOrder(
|
|
79
|
+
"BTC/USDC",
|
|
80
|
+
"BUY",
|
|
81
|
+
"0.001",
|
|
82
|
+
"50000"
|
|
83
|
+
);
|
|
84
|
+
console.log("Order placed:", order.order_id);
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
return (
|
|
88
|
+
<div>
|
|
89
|
+
<button onClick={handleLogin}>
|
|
90
|
+
{isAuthenticated ? "Logout" : "Login"}
|
|
91
|
+
</button>
|
|
92
|
+
<button onClick={handlePlaceOrder}>Place Order</button>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
}
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
## Available Hooks
|
|
99
|
+
|
|
100
|
+
### Core Hooks
|
|
101
|
+
|
|
102
|
+
#### `useMonaco()`
|
|
103
|
+
Access the Monaco SDK instance directly.
|
|
104
|
+
|
|
105
|
+
```tsx
|
|
106
|
+
const sdk = useMonaco();
|
|
107
|
+
const address = sdk.getAccountAddress();
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
#### `useAuth()`
|
|
111
|
+
Authentication and session management.
|
|
112
|
+
|
|
113
|
+
```tsx
|
|
114
|
+
const { login, logout, isAuthenticated, authState } = useAuth();
|
|
115
|
+
|
|
116
|
+
// Login with auto-connect WebSocket
|
|
117
|
+
await login(clientId, { connectWebSocket: true });
|
|
118
|
+
|
|
119
|
+
// Check authentication status
|
|
120
|
+
if (isAuthenticated) {
|
|
121
|
+
console.log("User:", authState?.user);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
// Logout
|
|
125
|
+
await logout();
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
### Trading Hooks
|
|
129
|
+
|
|
130
|
+
#### `useTrade()`
|
|
131
|
+
Place and manage orders.
|
|
132
|
+
|
|
133
|
+
```tsx
|
|
134
|
+
const {
|
|
135
|
+
placeLimitOrder,
|
|
136
|
+
placeMarketOrder,
|
|
137
|
+
cancelOrder,
|
|
138
|
+
replaceOrder,
|
|
139
|
+
getOrder,
|
|
140
|
+
getPaginatedOrders,
|
|
141
|
+
} = useTrade();
|
|
142
|
+
|
|
143
|
+
// Place a limit order
|
|
144
|
+
const order = await placeLimitOrder(
|
|
145
|
+
"BTC/USDC",
|
|
146
|
+
"BUY",
|
|
147
|
+
"0.001",
|
|
148
|
+
"50000",
|
|
149
|
+
{ timeInForce: "GTC" }
|
|
150
|
+
);
|
|
151
|
+
|
|
152
|
+
// Place a market order
|
|
153
|
+
const marketOrder = await placeMarketOrder(
|
|
154
|
+
"BTC/USDC",
|
|
155
|
+
"SELL",
|
|
156
|
+
"0.001",
|
|
157
|
+
{ slippageTolerance: 0.01 } // 1%
|
|
158
|
+
);
|
|
159
|
+
|
|
160
|
+
// Cancel an order
|
|
161
|
+
await cancelOrder(orderId);
|
|
162
|
+
|
|
163
|
+
// Get orders
|
|
164
|
+
const { data: orders } = await getPaginatedOrders({
|
|
165
|
+
status: "PENDING",
|
|
166
|
+
trading_pair: "BTC/USDC",
|
|
167
|
+
});
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
### Market Data Hooks
|
|
171
|
+
|
|
172
|
+
#### `useMarket()`
|
|
173
|
+
Access trading pair metadata and market data.
|
|
174
|
+
|
|
175
|
+
```tsx
|
|
176
|
+
const { tradingPairs, getTradingPairBySymbol, getCandlestickData } = useMarket();
|
|
177
|
+
|
|
178
|
+
// Get all trading pairs
|
|
179
|
+
const pairs = await tradingPairs();
|
|
180
|
+
|
|
181
|
+
// Get specific pair
|
|
182
|
+
const btcPair = await getTradingPairBySymbol("BTC/USDC");
|
|
183
|
+
|
|
184
|
+
// Get candlestick data
|
|
185
|
+
const candles = await getCandlestickData(
|
|
186
|
+
"BTC/USDC",
|
|
187
|
+
"1h",
|
|
188
|
+
Date.now() - 86400000, // 24h ago
|
|
189
|
+
Date.now()
|
|
190
|
+
);
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
#### `useTradeFeed()`
|
|
194
|
+
Get recent trades for a trading pair.
|
|
195
|
+
|
|
196
|
+
```tsx
|
|
197
|
+
const { getTradeFeed } = useTradeFeed();
|
|
198
|
+
|
|
199
|
+
const trades = await getTradeFeed("BTC/USDC", { limit: 50 });
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### Vault Hooks
|
|
203
|
+
|
|
204
|
+
#### `useVault()`
|
|
205
|
+
Manage token deposits and withdrawals.
|
|
206
|
+
|
|
207
|
+
```tsx
|
|
208
|
+
const { deposit, withdraw, approve, getBalance, needsApproval } = useVault();
|
|
209
|
+
|
|
210
|
+
// Check balance
|
|
211
|
+
const balance = await getBalance(tokenAddress);
|
|
212
|
+
console.log(`Balance: ${balance.formatted} ${balance.symbol}`);
|
|
213
|
+
|
|
214
|
+
// Approve if needed
|
|
215
|
+
if (await needsApproval(tokenAddress, amount)) {
|
|
216
|
+
await approve(tokenAddress, amount);
|
|
217
|
+
}
|
|
218
|
+
|
|
219
|
+
// Deposit
|
|
220
|
+
await deposit(tokenAddress, amount);
|
|
221
|
+
|
|
222
|
+
// Withdraw
|
|
223
|
+
await withdraw(tokenAddress, amount);
|
|
224
|
+
```
|
|
225
|
+
|
|
226
|
+
### Profile Hooks
|
|
227
|
+
|
|
228
|
+
#### `useProfile()`
|
|
229
|
+
Access user profile and account information.
|
|
230
|
+
|
|
231
|
+
```tsx
|
|
232
|
+
const { getProfile, getUserBalances, getUserMovements } = useProfile();
|
|
233
|
+
|
|
234
|
+
// Get profile
|
|
235
|
+
const profile = await getProfile();
|
|
236
|
+
|
|
237
|
+
// Get balances
|
|
238
|
+
const balances = await getUserBalances({
|
|
239
|
+
page: 1,
|
|
240
|
+
page_size: 10,
|
|
241
|
+
});
|
|
242
|
+
|
|
243
|
+
// Get movements (transaction history)
|
|
244
|
+
const movements = await getUserMovements({
|
|
245
|
+
page: 1,
|
|
246
|
+
page_size: 20,
|
|
247
|
+
});
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
### WebSocket Hooks
|
|
251
|
+
|
|
252
|
+
#### `useOrderWebSocket()`
|
|
253
|
+
Subscribe to real-time order updates.
|
|
254
|
+
|
|
255
|
+
```tsx
|
|
256
|
+
const { subscribe, unsubscribe, connect, disconnect } = useOrderWebSocket();
|
|
257
|
+
|
|
258
|
+
useEffect(() => {
|
|
259
|
+
// Connect and subscribe
|
|
260
|
+
await connect();
|
|
261
|
+
|
|
262
|
+
subscribe("BTC/USDC", "SPOT", (event) => {
|
|
263
|
+
console.log("Order event:", event.eventType);
|
|
264
|
+
if (event.eventType === "ORDER_FILLED") {
|
|
265
|
+
console.log("Order filled:", event.order);
|
|
266
|
+
}
|
|
267
|
+
});
|
|
268
|
+
|
|
269
|
+
return () => {
|
|
270
|
+
unsubscribe("BTC/USDC", "SPOT");
|
|
271
|
+
disconnect();
|
|
272
|
+
};
|
|
273
|
+
}, []);
|
|
274
|
+
```
|
|
275
|
+
|
|
276
|
+
#### `useOHLCVWebSocket()`
|
|
277
|
+
Subscribe to real-time candlestick data.
|
|
278
|
+
|
|
279
|
+
```tsx
|
|
280
|
+
const { subscribe, unsubscribe, connect, disconnect } = useOHLCVWebSocket();
|
|
281
|
+
|
|
282
|
+
useEffect(() => {
|
|
283
|
+
await connect();
|
|
284
|
+
|
|
285
|
+
subscribe("BTC/USDC", "SPOT", "1m", (event) => {
|
|
286
|
+
console.log("New candle:", event.candlestick);
|
|
287
|
+
});
|
|
288
|
+
|
|
289
|
+
return () => {
|
|
290
|
+
unsubscribe("BTC/USDC", "SPOT", "1m");
|
|
291
|
+
disconnect();
|
|
292
|
+
};
|
|
293
|
+
}, []);
|
|
294
|
+
```
|
|
295
|
+
|
|
296
|
+
#### `useOrderbook()`
|
|
297
|
+
Subscribe to real-time orderbook updates.
|
|
298
|
+
|
|
299
|
+
```tsx
|
|
300
|
+
const { subscribe, unsubscribe, connect, disconnect } = useOrderbook();
|
|
301
|
+
|
|
302
|
+
useEffect(() => {
|
|
303
|
+
await connect();
|
|
304
|
+
|
|
305
|
+
subscribe("BTC/USDC", "SPOT", (event) => {
|
|
306
|
+
console.log("Orderbook:", {
|
|
307
|
+
bids: event.bids.length,
|
|
308
|
+
asks: event.asks.length,
|
|
309
|
+
});
|
|
310
|
+
});
|
|
311
|
+
|
|
312
|
+
return () => {
|
|
313
|
+
unsubscribe("BTC/USDC", "SPOT");
|
|
314
|
+
disconnect();
|
|
315
|
+
};
|
|
316
|
+
}, []);
|
|
317
|
+
```
|
|
318
|
+
|
|
319
|
+
## TypeScript Configuration
|
|
320
|
+
|
|
321
|
+
For optimal type inference, use these TypeScript settings:
|
|
322
|
+
|
|
323
|
+
```json
|
|
324
|
+
{
|
|
325
|
+
"compilerOptions": {
|
|
326
|
+
"target": "ES2020",
|
|
327
|
+
"module": "nodenext",
|
|
328
|
+
"moduleResolution": "nodenext",
|
|
329
|
+
"jsx": "react-jsx",
|
|
330
|
+
"strict": true,
|
|
331
|
+
"esModuleInterop": true,
|
|
332
|
+
"resolveJsonModule": true
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
```
|
|
336
|
+
|
|
337
|
+
## Examples
|
|
338
|
+
|
|
339
|
+
Check out the [`examples/react-vite-app`](../../examples/react-vite-app) directory for a complete React application using the Monaco SDK.
|
|
340
|
+
|
|
341
|
+
## Development
|
|
342
|
+
|
|
343
|
+
### Build
|
|
344
|
+
|
|
345
|
+
```bash
|
|
346
|
+
pnpm build
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
### Watch Mode
|
|
350
|
+
|
|
351
|
+
```bash
|
|
352
|
+
pnpm dev
|
|
353
|
+
```
|
|
354
|
+
|
|
355
|
+
### Lint
|
|
356
|
+
|
|
357
|
+
```bash
|
|
358
|
+
pnpm lint
|
|
359
|
+
```
|
|
360
|
+
|
|
361
|
+
## Contributing
|
|
362
|
+
|
|
363
|
+
We welcome contributions! Please see our [Contributing Guide](../../docs/contributing.mdx) for details.
|
|
364
|
+
|
|
365
|
+
## License
|
|
366
|
+
|
|
367
|
+
This project is licensed under the MIT License - see the [LICENSE](../../LICENSE) file for details.
|
|
368
|
+
|
|
369
|
+
## Support
|
|
370
|
+
|
|
371
|
+
For support, please:
|
|
372
|
+
|
|
373
|
+
- Open an issue on GitHub
|
|
374
|
+
- Join our [Discord community](https://discord.gg/monaco)
|
|
375
|
+
- Visit our [documentation site](https://docs.monaco.xyz)
|
|
376
|
+
- Check our [API documentation](../../docs/api-reference.mdx)
|
|
377
|
+
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from "./useAuth
|
|
2
|
-
export * from "./useFees
|
|
3
|
-
export * from "./useMarket
|
|
4
|
-
export * from "./useMonaco
|
|
5
|
-
export * from "./useOrderbook
|
|
6
|
-
export * from "./useProfile
|
|
7
|
-
export * from "./useTokenLifecycle
|
|
8
|
-
export * from "./useTrade
|
|
9
|
-
export * from "./useTradeFeed
|
|
10
|
-
export * from "./useVault
|
|
1
|
+
export * from "./useAuth";
|
|
2
|
+
export * from "./useFees";
|
|
3
|
+
export * from "./useMarket";
|
|
4
|
+
export * from "./useMonaco";
|
|
5
|
+
export * from "./useOrderbook";
|
|
6
|
+
export * from "./useProfile";
|
|
7
|
+
export * from "./useTokenLifecycle";
|
|
8
|
+
export * from "./useTrade";
|
|
9
|
+
export * from "./useTradeFeed";
|
|
10
|
+
export * from "./useVault";
|
|
11
11
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
|
package/dist/hooks/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
export * from "./useAuth
|
|
2
|
-
export * from "./useFees
|
|
3
|
-
export * from "./useMarket
|
|
4
|
-
export * from "./useMonaco
|
|
5
|
-
export * from "./useOrderbook
|
|
6
|
-
export * from "./useProfile
|
|
7
|
-
export * from "./useTokenLifecycle
|
|
8
|
-
export * from "./useTrade
|
|
9
|
-
export * from "./useTradeFeed
|
|
10
|
-
export * from "./useVault
|
|
1
|
+
export * from "./useAuth";
|
|
2
|
+
export * from "./useFees";
|
|
3
|
+
export * from "./useMarket";
|
|
4
|
+
export * from "./useMonaco";
|
|
5
|
+
export * from "./useOrderbook";
|
|
6
|
+
export * from "./useProfile";
|
|
7
|
+
export * from "./useTokenLifecycle";
|
|
8
|
+
export * from "./useTrade";
|
|
9
|
+
export * from "./useTradeFeed";
|
|
10
|
+
export * from "./useVault";
|
|
11
11
|
//# sourceMappingURL=index.js.map
|
package/dist/hooks/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/hooks/index.ts"],"names":[],"mappings":"AAAA,cAAc,WAAW,CAAC;AAC1B,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,qBAAqB,CAAC;AACpC,cAAc,YAAY,CAAC;AAC3B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,YAAY,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type * from "./types
|
|
2
|
-
export { useAuth } from "./useAuth
|
|
1
|
+
export type * from "./types";
|
|
2
|
+
export { useAuth } from "./useAuth";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAuth/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAuth/index.ts"],"names":[],"mappings":"AAAA,mBAAmB,SAAS,CAAC;AAC7B,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { useAuth } from "./useAuth
|
|
1
|
+
export { useAuth } from "./useAuth";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/useAuth/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/useAuth/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { AuthState, ChallengeResponse, TokenRefreshResponse } from "@0xmonaco/types";
|
|
2
|
-
import type { AuthenticationStatus } from "../../provider
|
|
2
|
+
import type { AuthenticationStatus } from "../../provider";
|
|
3
3
|
export interface UseAuthState {
|
|
4
4
|
/** Current authentication status */
|
|
5
5
|
authenticationStatus: AuthenticationStatus;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAuth/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAA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
{"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAuth/useAuth.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"useAuth.d.ts","sourceRoot":"","sources":["../../../src/hooks/useAuth/useAuth.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,OAAO,QAAO,aAyK1B,CAAC"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
import { useCallback } from "react";
|
|
2
2
|
import { useWalletClient } from "wagmi";
|
|
3
|
-
import { AuthenticationStatus } from "../../provider
|
|
4
|
-
import {
|
|
5
|
-
import { useMonacoSDK } from "../useMonaco/index.js";
|
|
3
|
+
import { AuthenticationStatus, useMonacoContext } from "../../provider";
|
|
4
|
+
import { useMonacoSDK } from "../useMonaco";
|
|
6
5
|
export const useAuth = () => {
|
|
7
6
|
const { sdk, clientId } = useMonacoSDK();
|
|
8
7
|
const { authenticationStatus, setAuthenticationStatus, tokenLifecycle } = useMonacoContext();
|
|
9
8
|
const { data: walletClient } = useWalletClient();
|
|
10
|
-
const login = useCallback(async (
|
|
9
|
+
const login = useCallback(async () => {
|
|
11
10
|
if (!sdk)
|
|
12
11
|
throw new Error("SDK not available");
|
|
13
12
|
if (!walletClient)
|
|
14
13
|
throw new Error("Wallet not connected");
|
|
15
14
|
setAuthenticationStatus(AuthenticationStatus.AUTHENTICATING);
|
|
16
15
|
try {
|
|
17
|
-
const authState = await sdk.login(clientId
|
|
16
|
+
const authState = await sdk.login(clientId);
|
|
18
17
|
// Initialize token lifecycle management (caching + auto-refresh)
|
|
19
18
|
tokenLifecycle.initializeTokens(authState);
|
|
20
19
|
const authenticated = sdk.isAuthenticated();
|
|
@@ -49,7 +48,7 @@ export const useAuth = () => {
|
|
|
49
48
|
setAuthenticationStatus(AuthenticationStatus.AUTHENTICATING);
|
|
50
49
|
try {
|
|
51
50
|
const result = await sdk.refreshAuth();
|
|
52
|
-
// Reinitialize token lifecycle with new tokens
|
|
51
|
+
// Reinitialize the token lifecycle with new tokens
|
|
53
52
|
tokenLifecycle.initializeTokens(result);
|
|
54
53
|
const authenticated = sdk.isAuthenticated();
|
|
55
54
|
setAuthenticationStatus(authenticated ? AuthenticationStatus.AUTHENTICATED : AuthenticationStatus.UNAUTHENTICATED);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useAuth.js","sourceRoot":"","sources":["../../../src/hooks/useAuth/useAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"useAuth.js","sourceRoot":"","sources":["../../../src/hooks/useAuth/useAuth.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AACxC,OAAO,EAAE,oBAAoB,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,MAAM,CAAC,MAAM,OAAO,GAAG,GAAkB,EAAE;IACzC,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,GAAG,YAAY,EAAE,CAAC;IACzC,MAAM,EAAE,oBAAoB,EAAE,uBAAuB,EAAE,cAAc,EAAE,GAAG,gBAAgB,EAAE,CAAC;IAC7F,MAAM,EAAE,IAAI,EAAE,YAAY,EAAE,GAAG,eAAe,EAAE,CAAC;IAEjD,MAAM,KAAK,GAAG,WAAW,CAAC,KAAK,IAAI,EAAE;QACnC,IAAI,CAAC,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAC/C,IAAI,CAAC,YAAY;YAAE,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,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AC;YAClC,MAAM,aAAa,GAAG,GAAG,CAAC,eAAe,EAAE,CAAC;YAC5C,uBAAuB,CAAC,aAAa,CAAC,CAAC,CAAC,oBAAoB,CAAC,aAAa,CAAC,CAAC,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC;QACrH,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,uBAAuB,CAAC,oBAAoB,CAAC,eAAe,CAAC,CAAC;YAC9D,MAAM,KAAK,CAAC;QACd,CAAC;IACH,CAAC,EACD,CAAC,GAAG,EAAE,uBAAuB,CAAC,CAC/B,CAAC;IAEF,OAAO;QACL,QAAQ;QACR,oBAAoB;QAEpB,uBAAuB;QACvB,KAAK;QACL,MAAM;QAEN,mBAAmB;QACnB,WAAW;QACX,YAAY;QACZ,WAAW;QAEX,2BAA2B;QAC3B,YAAY;QACZ,aAAa;QACb,eAAe;KAChB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { UseFeesReturn } from "./types
|
|
2
|
-
export { useFees } from "./useFees
|
|
1
|
+
export type { UseFeesReturn } from "./types";
|
|
2
|
+
export { useFees } from "./useFees";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFees/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFees/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAC7C,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { useFees } from "./useFees
|
|
1
|
+
export { useFees } from "./useFees";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/useFees/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/useFees/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFees.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFees/useFees.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useFees.d.ts","sourceRoot":"","sources":["../../../src/hooks/useFees/useFees.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,eAAO,MAAM,OAAO,QAAO,aAgB1B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useFees.js","sourceRoot":"","sources":["../../../src/hooks/useFees/useFees.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useFees.js","sourceRoot":"","sources":["../../../src/hooks/useFees/useFees.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,MAAM,CAAC,MAAM,OAAO,GAAG,GAAkB,EAAE;IACzC,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;IAE/B,MAAM,YAAY,GAAG,WAAW,CAC9B,KAAK,EAAE,MAAyB,EAAgC,EAAE;QAChE,IAAI,CAAC,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAE/C,4DAA4D;QAC5D,OAAO,MAAM,GAAG,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC;IAC7C,CAAC,EACD,CAAC,GAAG,CAAC,CACN,CAAC;IAEF,OAAO;QACL,YAAY;KACb,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { UseMarketReturn } from "./types
|
|
2
|
-
export { useMarket } from "./useMarket
|
|
1
|
+
export type { UseMarketReturn } from "./types";
|
|
2
|
+
export { useMarket } from "./useMarket";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMarket/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMarket/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAC/C,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { useMarket } from "./useMarket
|
|
1
|
+
export { useMarket } from "./useMarket";
|
|
2
2
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/useMarket/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/hooks/useMarket/index.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMarket.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMarket/useMarket.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useMarket.d.ts","sourceRoot":"","sources":["../../../src/hooks/useMarket/useMarket.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAE/C,eAAO,MAAM,SAAS,QAAO,eA+C5B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { useCallback } from "react";
|
|
2
|
-
import { useMonacoSDK } from "../useMonaco
|
|
2
|
+
import { useMonacoSDK } from "../useMonaco";
|
|
3
3
|
export const useMarket = () => {
|
|
4
4
|
const { sdk } = useMonacoSDK();
|
|
5
5
|
const getPaginatedTradingPairs = useCallback(async (params) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useMarket.js","sourceRoot":"","sources":["../../../src/hooks/useMarket/useMarket.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"useMarket.js","sourceRoot":"","sources":["../../../src/hooks/useMarket/useMarket.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAG5C,MAAM,CAAC,MAAM,SAAS,GAAG,GAAoB,EAAE;IAC7C,MAAM,EAAE,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;IAE/B,MAAM,wBAAwB,GAAG,WAAW,CAC1C,KAAK,EAAE,MAA8B,EAAkC,EAAE;QACvE,IAAI,CAAC,GAAG;YAAE,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;QAE/C,MAAM,QAAQ,GAAG,MAAM,GAAG,CAAC,MAAM,CAAC,wBAAwB,CAAC,MAAM,CAAC,CAAC;QAEnE,IAAI,CAAC,QAAQ,CAAC,OAAO,EAAE,CAAC;YACtB,MAAM,IAAI,KAAK,CAAC,+BAA+B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,wBAAwB;QACxB,sBAAsB;QACtB,eAAe;KAChB,CAAC;AACJ,CAAC,CAAC"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export type { UseMonacoReturn } from "./types
|
|
2
|
-
export { useMonacoSDK } from "./useMonaco
|
|
1
|
+
export type { UseMonacoReturn } from "./types";
|
|
2
|
+
export { useMonacoSDK } from "./useMonaco";
|
|
3
3
|
//# sourceMappingURL=index.d.ts.map
|