context-markets-react 0.1.0 → 0.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/index.d.ts +4 -2
- package/dist/index.js +3 -1
- package/package.json +3 -3
package/README.md
CHANGED
|
@@ -82,7 +82,7 @@ function MarketList() {
|
|
|
82
82
|
|
|
83
83
|
## Peer Dependencies
|
|
84
84
|
|
|
85
|
-
`react` >= 18 · `@tanstack/react-query` >= 5 · `wagmi` >= 2 · `viem` >= 2 · `context-markets` >= 0.
|
|
85
|
+
`react` >= 18 · `@tanstack/react-query` >= 5 · `wagmi` >= 2 · `viem` >= 2 · `context-markets` >= 0.5
|
|
86
86
|
|
|
87
87
|
## Documentation
|
|
88
88
|
|
|
@@ -96,8 +96,8 @@ function MarketList() {
|
|
|
96
96
|
|---------|-------------|
|
|
97
97
|
| **[context-markets](https://github.com/contextwtf/context-sdk)** | TypeScript SDK for trading |
|
|
98
98
|
| **[context-markets-react](https://github.com/contextwtf/context-react)** | React hooks for market data and trading |
|
|
99
|
-
| **[
|
|
100
|
-
| **[
|
|
99
|
+
| **[context-markets-mcp](https://github.com/contextwtf/context-mcp)** | MCP server for AI agents |
|
|
100
|
+
| **[context-markets-cli](https://github.com/contextwtf/context-cli)** | CLI for trading from the terminal |
|
|
101
101
|
| **[context-skills](https://github.com/contextwtf/context-skills)** | AI agent skill files |
|
|
102
102
|
| **[context-plugin](https://github.com/contextwtf/context-plugin)** | Claude Code plugin |
|
|
103
103
|
|
package/dist/index.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
import * as context_markets from 'context-markets';
|
|
4
|
-
import { ContextClient, Balance, ClaimableResponse, GetPortfolioParams, Portfolio, PortfolioStats, GetPositionsParams, PositionList, OracleQuoteLatest, Market, GetActivityParams, ActivityResponse, SearchMarketsParams, MarketList, GetOrderbookParams, Orderbook, GetPriceHistoryParams, PriceHistory, Quotes, MarketSearchParams, MarketSearchResult, SimulateTradeParams, SimulateResult, GaslessOperatorResult, WalletSetupResult, WalletStatus, GaslessDepositResult, Order, GetOrdersParams, OrderList, CancelResult, CancelReplaceResult, PlaceOrderRequest, CreateOrderResult, PlaceMarketOrderRequest, SubmitQuestionResult, AgentSubmitMarketDraft, QuestionSubmission, SubmitAndWaitOptions, CreateMarketResult } from 'context-markets';
|
|
4
|
+
import { ChainOption, ContextClient, Balance, ClaimableResponse, GetPortfolioParams, Portfolio, PortfolioStats, GetPositionsParams, PositionList, OracleQuoteLatest, Market, GetActivityParams, ActivityResponse, SearchMarketsParams, MarketList, GetOrderbookParams, Orderbook, GetPriceHistoryParams, PriceHistory, Quotes, MarketSearchParams, MarketSearchResult, SimulateTradeParams, SimulateResult, GaslessOperatorResult, WalletSetupResult, WalletStatus, GaslessDepositResult, Order, GetOrdersParams, OrderList, CancelResult, CancelReplaceResult, PlaceOrderRequest, CreateOrderResult, PlaceMarketOrderRequest, SubmitQuestionResult, AgentSubmitMarketDraft, QuestionSubmission, SubmitAndWaitOptions, CreateMarketResult } from 'context-markets';
|
|
5
|
+
export { ChainOption } from 'context-markets';
|
|
5
6
|
import * as _tanstack_react_query from '@tanstack/react-query';
|
|
6
7
|
import { UseQueryOptions, UseMutationOptions } from '@tanstack/react-query';
|
|
7
8
|
import { Address, Hex } from 'viem';
|
|
8
9
|
|
|
9
10
|
interface ContextProviderProps {
|
|
10
11
|
apiKey: string;
|
|
12
|
+
chain?: ChainOption;
|
|
11
13
|
rpcUrl?: string;
|
|
12
14
|
baseUrl?: string;
|
|
13
15
|
children: ReactNode;
|
|
14
16
|
}
|
|
15
|
-
declare function ContextProvider({ apiKey, rpcUrl, baseUrl, children, }: ContextProviderProps): react_jsx_runtime.JSX.Element;
|
|
17
|
+
declare function ContextProvider({ apiKey, chain, rpcUrl, baseUrl, children, }: ContextProviderProps): react_jsx_runtime.JSX.Element;
|
|
16
18
|
declare function useContextClient(): ContextClient;
|
|
17
19
|
|
|
18
20
|
declare const contextKeys: {
|
package/dist/index.js
CHANGED
|
@@ -10,6 +10,7 @@ import { jsx } from "react/jsx-runtime";
|
|
|
10
10
|
var ContextClientContext = createContext(null);
|
|
11
11
|
function ContextProvider({
|
|
12
12
|
apiKey,
|
|
13
|
+
chain,
|
|
13
14
|
rpcUrl,
|
|
14
15
|
baseUrl,
|
|
15
16
|
children
|
|
@@ -19,11 +20,12 @@ function ContextProvider({
|
|
|
19
20
|
const client = useMemo(() => {
|
|
20
21
|
return new ContextClient({
|
|
21
22
|
apiKey,
|
|
23
|
+
chain,
|
|
22
24
|
rpcUrl,
|
|
23
25
|
baseUrl,
|
|
24
26
|
...walletClient ? { signer: { walletClient } } : {}
|
|
25
27
|
});
|
|
26
|
-
}, [apiKey, rpcUrl, baseUrl, walletClient, address]);
|
|
28
|
+
}, [apiKey, chain, rpcUrl, baseUrl, walletClient, address]);
|
|
27
29
|
return /* @__PURE__ */ jsx(ContextClientContext.Provider, { value: client, children });
|
|
28
30
|
}
|
|
29
31
|
function useContextClient() {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "context-markets-react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "React hooks for Context Markets — built on context-markets and TanStack Query",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Context",
|
|
@@ -34,14 +34,14 @@
|
|
|
34
34
|
"dist"
|
|
35
35
|
],
|
|
36
36
|
"peerDependencies": {
|
|
37
|
-
"context-markets": ">=0.
|
|
37
|
+
"context-markets": ">=0.5.0",
|
|
38
38
|
"@tanstack/react-query": ">=5.0.0",
|
|
39
39
|
"react": ">=18.0.0",
|
|
40
40
|
"viem": ">=2.0.0",
|
|
41
41
|
"wagmi": ">=2.0.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"context-markets": "^0.
|
|
44
|
+
"context-markets": "^0.5.0",
|
|
45
45
|
"@tanstack/react-query": "^5.0.0",
|
|
46
46
|
"@testing-library/react": "^16.0.0",
|
|
47
47
|
"@types/react": "^19.2.14",
|