@polymarket/relayer-client 0.0.8 → 0.0.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -23,8 +23,6 @@ class AuthHandler {
23
23
  // Logging in will set the session cookies on the httpClient
24
24
  const resp = yield this.httpClient.send(`${this.url}/login`, http_helpers_1.GET, { Authorization: `Bearer ${this.token}` });
25
25
  const cookies = resp.headers['set-cookie'];
26
- console.log(`RelayClient Coookies:`);
27
- console.log(cookies);
28
26
  let aggregatedCookie = "";
29
27
  for (const cookie of cookies) {
30
28
  if (cookie.includes(POLYMARKET_COOKIE_NAME)) {
package/dist/client.js CHANGED
@@ -3,7 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.RelayClient = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const ethers_1 = require("ethers");
6
- const browser_or_node_1 = require("browser-or-node");
7
6
  const http_helpers_1 = require("./http-helpers");
8
7
  const types_1 = require("./types");
9
8
  const endpoints_1 = require("./endpoints");
@@ -116,19 +115,16 @@ class RelayClient {
116
115
  }
117
116
  send(endpoint, method, headers, data, params) {
118
117
  return tslib_1.__awaiter(this, void 0, void 0, function* () {
119
- yield this.authHandler.login();
120
- // If client is instantiated locally/not on the browser, explicitly inject the polymarket session cookies
121
- // this is to ensure examples still run locally
122
- if (!browser_or_node_1.isBrowser) {
123
- const cookie = yield this.authHandler.getPolymarketCookies();
124
- if (headers != undefined) {
125
- headers["Cookie"] = cookie;
126
- }
127
- else {
128
- headers = { "Cookie": cookie };
129
- }
118
+ // Explicitly inject the polymarket session cookies
119
+ // In prod environments, this will be unnecessary as the browser will have the needed cookies
120
+ // Needed only for local testing
121
+ const cookie = yield this.authHandler.getPolymarketCookies();
122
+ if (headers != undefined) {
123
+ headers["Cookie"] = cookie;
124
+ }
125
+ else {
126
+ headers = { "Cookie": cookie };
130
127
  }
131
- // If the client is instantiated on the browser, do not inject cookies
132
128
  const resp = yield this.httpClient.send(endpoint, method, headers, data, params);
133
129
  return resp.data;
134
130
  });
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@polymarket/relayer-client",
3
3
  "description": "Client for Polymarket relayers",
4
- "version": "0.0.8",
4
+ "version": "0.0.10",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [