diff options
| author | Adam Soltys <[email protected]> | 2023-12-01 11:36:35 -0800 |
|---|---|---|
| committer | Adam Soltys <[email protected]> | 2023-12-01 11:36:35 -0800 |
| commit | 7709c1efde9a1f3078171ee56985cd25511d6f7b (patch) | |
| tree | cd996eaaa860cdb3d7da688e0ad4c5ec7bae1a0c /lib/rpc.js | |
| parent | 826c7b361c93905c4725755038d398221530051d (diff) | |
| download | coinos-server-7709c1efde9a1f3078171ee56985cd25511d6f7b.tar.gz coinos-server-7709c1efde9a1f3078171ee56985cd25511d6f7b.zip | |
biome formatter
Diffstat (limited to 'lib/rpc.js')
| -rw-r--r-- | lib/rpc.js | 38 |
1 files changed, 20 insertions, 18 deletions
@@ -4,23 +4,25 @@ 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) + 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) } ); |
