@symmio/trading-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.
Files changed (2) hide show
  1. package/README.md +47 -0
  2. package/package.json +4 -4
package/README.md ADDED
@@ -0,0 +1,47 @@
1
+ # @symmio/trading-react
2
+
3
+ > React adapter for the SYMMIO SDK. Hooks, providers, and React-bound ergonomics on top of @symmio/trading-core.
4
+
5
+ `@symmio/trading-react` is the React layer of the SYMMIO SDK. It wraps the framework-agnostic `@symmio/trading-core` in hooks and a provider, bridging the SDK to your app's wagmi and TanStack Query setup so you can read positions, quotes, balances, and prices and run trading flows without wiring contract calls yourself.
6
+
7
+ **[Documentation](https://symmio-frontier.vercel.app/react) · [Live SDK console](https://symm-frontier-web.vercel.app/)**
8
+
9
+ ## Installation
10
+
11
+ ```sh
12
+ npm install @symmio/trading-react react react-dom viem wagmi
13
+ ```
14
+
15
+ react, react-dom, viem, and wagmi are peer dependencies you provide; @symmio/trading-core installs automatically.
16
+
17
+ ## Usage
18
+
19
+ ```tsx
20
+ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
21
+ import { SymmioProvider, useWalletAccount } from "@symmio/trading-react";
22
+ import { WagmiProvider, type Config } from "wagmi";
23
+
24
+ const queryClient = new QueryClient();
25
+
26
+ export function Providers({ wagmiConfig, children }: { wagmiConfig: Config; children: React.ReactNode }) {
27
+ return (
28
+ <WagmiProvider config={wagmiConfig}>
29
+ <QueryClientProvider client={queryClient}>
30
+ <SymmioProvider>{children}</SymmioProvider>
31
+ </QueryClientProvider>
32
+ </WagmiProvider>
33
+ );
34
+ }
35
+
36
+ function Account() {
37
+ const { address, isOnExpectedChain } = useWalletAccount();
38
+ if (!address) return <span>Connect a wallet</span>;
39
+ return <span>{isOnExpectedChain ? address : "Wrong network"}</span>;
40
+ }
41
+ ```
42
+
43
+ For the full list of hooks and providers, see the [API reference](https://symmio-frontier.vercel.app/react).
44
+
45
+ ## License
46
+
47
+ [MIT](./LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symmio/trading-react",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "React adapter for the SYMMIO SDK. Hooks, providers, and React-bound ergonomics on top of @symmio/trading-core.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/SYMM-IO/SYMM-Frontier/tree/main/packages/trading-react#readme",
@@ -71,7 +71,7 @@
71
71
  "@tanstack/react-query": "^5.100.0",
72
72
  "decimal.js": "^10.4.3",
73
73
  "zustand": "^5.0.0",
74
- "@symmio/trading-core": "^0.1.0"
74
+ "@symmio/trading-core": "^0.1.1"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "react": "^19.0.0",
@@ -97,8 +97,8 @@
97
97
  "vite-plugin-dts": "^5.0.0",
98
98
  "vitest": "^4.1.6",
99
99
  "wagmi": "^3.4.2",
100
- "@symmio/eslint-config": "^0.1.0",
101
- "@symmio/typescript-config": "^0.1.0"
100
+ "@symmio/eslint-config": "^0.1.1",
101
+ "@symmio/typescript-config": "^0.1.1"
102
102
  },
103
103
  "scripts": {
104
104
  "build": "vite build",