diff --git a/package.json b/package.json index ccad5f6..9750251 100644 --- a/package.json +++ b/package.json @@ -67,6 +67,7 @@ "xml2js": "^0.4.23" }, "devDependencies": { + "@lumeweb/relay-types": "https://github.com/LumeWeb/relay-types.git", "@types/express": "^4.17.13", "@types/minimatch": "^3.0.5", "@types/sprintf-js": "^1.1.2", diff --git a/src/rpc/connection.ts b/src/rpc/connection.ts index b88542c..9db7ba3 100644 --- a/src/rpc/connection.ts +++ b/src/rpc/connection.ts @@ -1,9 +1,9 @@ -import { +import type { RPCRequest, RPCResponse, RPCStreamHandler, StreamFileResponse, -} from "../types"; +} from "@lumeweb/relay-types"; import { pack, unpack } from "msgpackr"; import log from "loglevel"; import { getRpcServer } from "./server"; diff --git a/src/rpc/server.ts b/src/rpc/server.ts index 61f4d45..4d3515e 100644 --- a/src/rpc/server.ts +++ b/src/rpc/server.ts @@ -1,10 +1,9 @@ import { - RPC_REQUEST_SCHEMA, RPCMethod, RPCRequest, RPCResponse, RPCStreamHandler, -} from "../types.js"; +} from "@lumeweb/relay-types"; import NodeCache from "node-cache"; import { get as getDHT } from "../dht.js"; import { Mutex } from "async-mutex"; @@ -14,6 +13,7 @@ import crypto from "crypto"; import stringify from "json-stable-stringify"; import Ajv from "ajv"; import RPCConnection from "./connection.js"; +import { RPC_REQUEST_SCHEMA } from "../types.js"; const ajv = new Ajv({ allowUnionTypes: true }); const validateRpcRequest = ajv.compile(RPC_REQUEST_SCHEMA); diff --git a/yarn.lock b/yarn.lock index d844484..6cceb63 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1074,6 +1074,10 @@ version "0.1.0" resolved "https://github.com/LumeWeb/pokt-rpc-endpoints.git#0223b743f913aa46e914b1dc237ae2e12571d96d" +"@lumeweb/relay-types@https://github.com/LumeWeb/relay-types.git": + version "0.1.0" + resolved "https://github.com/LumeWeb/relay-types.git#9768e2dc9dd8ccc2ee8569424bb9d7a2d8cde13e" + "@msgpackr-extract/msgpackr-extract-darwin-arm64@2.0.2": version "2.0.2" resolved "https://registry.yarnpkg.com/@msgpackr-extract/msgpackr-extract-darwin-arm64/-/msgpackr-extract-darwin-arm64-2.0.2.tgz#01e3669b8b2dc01f6353f2c87e1ec94faf52c587"