aboutsummaryrefslogtreecommitdiffstats
path: root/lib/rpc.js
diff options
context:
space:
mode:
authorAdam Soltys <[email protected]>2024-08-26 21:17:43 -0700
committerAdam Soltys <[email protected]>2024-08-26 21:17:43 -0700
commitfe62cadd6fb4a7e49f7d59401fc74ae0411e32a7 (patch)
treeaa8f34e1692bd2d638a2c996eeadb58671d07aea /lib/rpc.js
parent00e43ddc0bf3d6dd719fc9295d156567fa2fecfb (diff)
downloadcoinos-server-fe62cadd6fb4a7e49f7d59401fc74ae0411e32a7.tar.gz
coinos-server-fe62cadd6fb4a7e49f7d59401fc74ae0411e32a7.zip
typescript
Diffstat (limited to 'lib/rpc.js')
-rw-r--r--lib/rpc.js28
1 files changed, 0 insertions, 28 deletions
diff --git a/lib/rpc.js b/lib/rpc.js
deleted file mode 100644
index bb57d075..00000000
--- a/lib/rpc.js
+++ /dev/null
@@ -1,28 +0,0 @@
-import got from "got";
-
-export default ({ host, port, wallet, username, password }) =>
- new Proxy(
- {},
- {
- get:
- (target, prop) =>
- (...params) =>
- ((method, ...params) => {
- let url = `http://${host}:${port}/wallet/${wallet}`;
- return got
- .post(url, {
- json: {
- method,
- params,
- },
- headers: {
- authorization: `Basic ${Buffer.from(
- `${username}:${password}`,
- ).toString("base64")}`,
- },
- })
- .json()
- .then(({ result }) => result);
- })(prop.toLowerCase(), ...params),
- },
- );