@symmio/trading-core 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 +18 -45
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,67 +1,40 @@
1
1
  # @symmio/trading-core
2
2
 
3
- Framework-agnostic SYMMIO SDK.
3
+ > Framework-agnostic SYMMIO SDK. Contract calls, calculations, and transformations with no framework assumptions.
4
4
 
5
- This package wraps SYMMIO contract calls behind a small, typed API built on [viem](https://viem.sh). It has no framework dependencies — `@symmio/trading-react` (and future Vue / Solid layers) sit on top of it.
5
+ `@symmio/trading-core` is the base layer of the SYMMIO SDK: contract reads and writes (via viem), REST and GraphQL calls, and the calculations and transformations that turn raw protocol data into typed results. It has no framework dependency, so React (`@symmio/trading-react`) and other framework bindings build on top of it.
6
6
 
7
- ## Status
7
+ **[Documentation](https://symmio-frontier.vercel.app/core) · [Live SDK console](https://symm-frontier-web.vercel.app/)**
8
8
 
9
- Early. This first slice ships the `AccountLayer` domain (v0.8.5) on HyperEVM with two methods:
10
-
11
- - `getUserSubAccounts(publicClient, params)` — list a user's subaccounts.
12
- - `editAccountName(walletClient, params)` — rename a subaccount.
13
-
14
- ## Install
9
+ ## Installation
15
10
 
16
11
  ```sh
17
- pnpm add @symmio/trading-core viem
12
+ npm install @symmio/trading-core viem
18
13
  ```
19
14
 
20
- `viem` is a peer dependency.
15
+ viem is a peer dependency.
21
16
 
22
17
  ## Usage
23
18
 
24
- ### Free functions
25
-
26
19
  ```ts
27
- import { createPublicClient, createWalletClient, http, custom } from "viem";
28
- import { hyperevm } from "viem/chains";
29
- import { getUserSubAccounts, editAccountName } from "@symmio/trading-core";
30
-
31
- const publicClient = createPublicClient({ chain: hyperevm, transport: http() });
20
+ import { createConfig, getMarkets } from "@symmio/trading-core";
21
+ import { createPublicClient, http } from "viem";
22
+ import { hyperEvm } from "viem/chains";
32
23
 
33
- const subs = await getUserSubAccounts(publicClient, {
34
- user: "0xabc...",
35
- limit: 100n,
36
- });
37
-
38
- const walletClient = createWalletClient({
39
- chain: hyperevm,
40
- transport: custom(window.ethereum),
41
- });
24
+ const publicClient = createPublicClient({ chain: hyperEvm, transport: http() });
42
25
 
43
- const hash = await editAccountName(walletClient, {
44
- account: "0xsub...",
45
- name: "My Trading Account",
26
+ const config = createConfig({
27
+ getClient: () => publicClient,
46
28
  });
47
- ```
48
-
49
- ### viem actions
50
-
51
- Attach SDK methods to a viem client via `.extend()`:
52
-
53
- ```ts
54
- import { accountLayerReadActions, accountLayerWriteActions } from "@symmio/trading-core";
55
-
56
- const reader = createPublicClient({ chain: hyperevm, transport: http() }).extend(accountLayerReadActions);
57
29
 
58
- await reader.getUserSubAccounts({ user: "0xabc..." });
30
+ const markets = await getMarkets(config, {});
31
+ console.log(markets[0]?.name);
59
32
  ```
60
33
 
61
- ## Documentation
34
+ Every action ships a matching TanStack Query / Mutation options factory (e.g. `getMarketsQueryOptions`) for wiring into a query client.
62
35
 
63
- Full reference and concept docs: see `apps/docs` in the monorepo (or [the published docs site] once available).
36
+ See the [full API reference](https://symmio-frontier.vercel.app/core) for every action, options factory, and type.
64
37
 
65
- ## Contributing
38
+ ## License
66
39
 
67
- See [`AGENTS.md`](./AGENTS.md) for package-specific rules and the repo-root [`AGENTS.md`](../../AGENTS.md) for monorepo conventions.
40
+ [MIT](./LICENSE)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@symmio/trading-core",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "Framework-agnostic SYMMIO SDK. Contract calls, calculations, and transformations with no framework assumptions.",
5
5
  "license": "MIT",
6
6
  "homepage": "https://github.com/SYMM-IO/SYMM-Frontier/tree/main/packages/trading-core#readme",
@@ -47,14 +47,14 @@
47
47
  "vite": "^8.0.13",
48
48
  "vite-plugin-dts": "^5.0.0",
49
49
  "vitest": "^4.1.6",
50
- "@symmio/eslint-config": "^0.1.0",
51
- "@symmio/typescript-config": "^0.1.0"
50
+ "@symmio/eslint-config": "^0.1.1",
51
+ "@symmio/typescript-config": "^0.1.1"
52
52
  },
53
53
  "dependencies": {
54
54
  "@tanstack/query-core": "^5.90.5",
55
55
  "axios": "^1.16.1",
56
56
  "ohash": "^2.0.11",
57
- "@symmio/utils": "^0.1.0"
57
+ "@symmio/utils": "^0.1.1"
58
58
  },
59
59
  "scripts": {
60
60
  "build": "vite build",