rpc/dist/index.js

22 lines
548 B
JavaScript
Raw Permalink Normal View History

2022-11-14 16:09:45 +00:00
// @ts-ignore
import ProtomuxRPC from "protomux-rpc";
// @ts-ignore
import c from "compact-encoding";
import b4a from "b4a";
const ID = b4a.from("lumeweb");
export default class RPC extends ProtomuxRPC {
constructor(stream, options = {}) {
options = {
...{
id: ID,
2022-11-27 23:23:08 +00:00
valueEncoding: c.json,
},
...options,
2022-11-14 16:09:45 +00:00
};
super(stream, options);
}
2022-11-28 04:59:51 +00:00
async request(method, value = "", options = {}) {
2022-11-27 23:23:08 +00:00
return super.request(method, value, options);
}
2022-11-14 16:09:45 +00:00
}