@asyncswap/jsonrpc 0.4.11 → 0.4.12

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@asyncswap/jsonrpc",
3
3
  "description": "A minimal jsonrpc spec implementation.",
4
4
  "author": "Meek Msaki",
5
- "version": "0.4.11",
5
+ "version": "0.4.12",
6
6
  "license": "MIT",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.mjs",
@@ -13,6 +13,10 @@
13
13
  "rpc",
14
14
  "bun"
15
15
  ],
16
+ "files": [
17
+ "dist",
18
+ "src"
19
+ ],
16
20
  "homepage": "https://github.com/asyncswap/eth-libs/tree/main/packages/jsonrpc",
17
21
  "repository": {
18
22
  "type": "git",
package/CHANGELOG.md DELETED
@@ -1,94 +0,0 @@
1
- # @asyncswap/jsonrpc
2
-
3
- ## 0.4.11
4
-
5
- ### Patch Changes
6
-
7
- - 2f7dece: fixes build
8
-
9
- ## 0.4.10
10
-
11
- ### Patch Changes
12
-
13
- - 69a2d7e: patch types updates
14
-
15
- ## 0.4.9
16
-
17
- ### Patch Changes
18
-
19
- - dc792b1: (refactor): change to `withHeaders` option and update BaseClient source
20
-
21
- ## 0.4.8
22
-
23
- ### Patch Changes
24
-
25
- - e9fc1df: remove biome dep
26
-
27
- ## 0.4.7
28
-
29
- ### Patch Changes
30
-
31
- - 882f94f: new params typing
32
-
33
- ## 0.4.6
34
-
35
- ### Patch Changes
36
-
37
- - 07c284d: update handle type
38
-
39
- ## 0.4.5
40
-
41
- ### Patch Changes
42
-
43
- - 0d61f89: simplify method type and export error codes
44
-
45
- ## 0.4.4
46
-
47
- ### Patch Changes
48
-
49
- - f7d28d9: (fix): error code now generated in build
50
-
51
- ## 0.4.3
52
-
53
- ### Patch Changes
54
-
55
- - 40a79dc: add support for batcing and streamlined error methods
56
-
57
- ## 0.4.2
58
-
59
- ### Patch Changes
60
-
61
- - 9512db5: update documentation
62
-
63
- ## 0.4.0
64
-
65
- ### Minor Changes
66
-
67
- - 7e8300c: changes api for jsonrpc construction
68
-
69
- ### Patch Changes
70
-
71
- - 43de065: update docs
72
- - 7126afa: add `otherHeaders` to initializedClient calls
73
-
74
- ## 0.3.1
75
-
76
- ### Patch Changes
77
-
78
- - 1c3a46e: fix example
79
-
80
- ## 0.3.0
81
-
82
- ### Minor Changes
83
-
84
- - dc1718c: refactor of types dir to global types
85
- - 00ba692: - Converts error codes as enums
86
- - Uses generic types on rpc request and response methods, and results
87
- - 07dc4e5: improve docs example and updates to build config
88
-
89
- ### Patch Changes
90
-
91
- - e15733c: update scripts and make changeset in monorepo
92
- - e3ac747: patch
93
- - abddcdc: add source map to typescript build build
94
- - ded3e6b: update
package/example.ts DELETED
@@ -1,39 +0,0 @@
1
- import { JsonRpcServer } from "./src";
2
-
3
- const server = new JsonRpcServer();
4
-
5
- server.register("eth_add", async ([a, b]: [number, number]) => a + b);
6
- server.register("eth_ping", async () => "pong");
7
-
8
- Bun.serve({
9
- port: 4444,
10
- async fetch(req) {
11
- if (req.method !== "POST") {
12
- return new Response("JSON-RPC only", { status: 405 });
13
- }
14
- const payload = await req.json();
15
- const response = await server.handle(payload);
16
- if (!response) {
17
- return new Response(null, { status: 204 });
18
- }
19
- return Response.json(response);
20
- },
21
- });
22
-
23
- console.log("JSON-RPC running on http://localhost:4444");
24
-
25
- import { JsonRpcClient } from "./src";
26
-
27
- const url = "http://localhost:4444";
28
- const client = new JsonRpcClient(url);
29
- const result = await client.call(client.buildRequest("eth_ping", []));
30
- console.log(result); // pong
31
-
32
- const response = await server.handle({
33
- jsonrpc: "2.0",
34
- method: "eth_add",
35
- params: [2, 3],
36
- id: 1,
37
- });
38
-
39
- console.log(response); // { jsonrpc: '2.0', result: 5, id: 1 }
package/tsconfig.json DELETED
@@ -1,33 +0,0 @@
1
- {
2
- "compilerOptions": {
3
- // Environment setup & latest features
4
- "lib": ["ESNext"],
5
- "target": "ESNext",
6
- "module": "Preserve",
7
- "moduleDetection": "force",
8
- "jsx": "react-jsx",
9
- "allowJs": true,
10
- // Bundler mode
11
- "sourceMap": true,
12
- "declaration": true,
13
- "declarationMap": true,
14
- "moduleResolution": "bundler",
15
- "outDir": "dist",
16
- "rootDir": "src",
17
- "allowImportingTsExtensions": false,
18
- "verbatimModuleSyntax": true,
19
- "noEmit": false,
20
- // Best practices
21
- "strict": true,
22
- "skipLibCheck": true,
23
- "noFallthroughCasesInSwitch": true,
24
- "noUncheckedIndexedAccess": true,
25
- "noImplicitOverride": true,
26
- // Some stricter flags (disabled by default)
27
- "noUnusedLocals": false,
28
- "noUnusedParameters": false,
29
- "noPropertyAccessFromIndexSignature": false
30
- },
31
- "include": ["src/**/*"],
32
- "exclude": ["example.ts"]
33
- }