This repository was archived by the owner on Oct 12, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 10
This repository was archived by the owner on Oct 12, 2021. It is now read-only.
JS/TS: Implement walletclient #164
Copy link
Copy link
Open
Description
At the moment, we have;
- in the Console:
src/contexts/wallet/
ts and tsx files - in this repo:
- python
walletclient
: https://github.com/vegaprotocol/api/blob/develop/grpc/clients/python/vegaapiclient/walletclient.py - (in tests) javascript clunky
wallet_server_login
functionapi/grpc/clients/js/test/vega/order.test.js
Lines 10 to 30 in 18a356f
function wallet_server_login(walletServerURL, walletName, walletPassphrase) { var request = new xhr.XMLHttpRequest(); var token; request.onload = function () { if (request.status !== 200) { throw "Failed to log in to wallet server: HTTP " + request.status + " " + request.responseText; } var j = JSON.parse(request.responseText); if (j === undefined) { throw "Failed to get parse response JSON: " + request.responseText; } token = j.token; if (token === undefined) { throw "Failed to get token from response body: " + request.responseText; } } request.open("POST", walletServerURL + "/api/v1/auth/token", true); request.setRequestHeader("Content-Type", "application/json;charset=UTF-8"); request.send(JSON.stringify({wallet: walletName, passphrase: walletPassphrase}, null, 2)); return token; }
- python
Task
Implement walletclient in Javascript/Typescript so it can be used by tests in this repo, as well as by other users of the api package (perhaps possibly the Console).
Metadata
Metadata
Assignees
Labels
No labels