@polymarket/relayer-client 0.0.10 → 0.0.11
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.
- package/dist/client.js +9 -6
- package/package.json +1 -1
package/dist/client.js
CHANGED
|
@@ -3,6 +3,7 @@ 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 = tslib_1.__importDefault(require("browser-or-node"));
|
|
6
7
|
const http_helpers_1 = require("./http-helpers");
|
|
7
8
|
const types_1 = require("./types");
|
|
8
9
|
const endpoints_1 = require("./endpoints");
|
|
@@ -118,12 +119,14 @@ class RelayClient {
|
|
|
118
119
|
// Explicitly inject the polymarket session cookies
|
|
119
120
|
// In prod environments, this will be unnecessary as the browser will have the needed cookies
|
|
120
121
|
// Needed only for local testing
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
headers
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
122
|
+
if (!browser_or_node_1.default) {
|
|
123
|
+
const cookie = yield this.authHandler.getPolymarketCookies();
|
|
124
|
+
if (headers != undefined) {
|
|
125
|
+
headers["Cookie"] = cookie;
|
|
126
|
+
}
|
|
127
|
+
else {
|
|
128
|
+
headers = { "Cookie": cookie };
|
|
129
|
+
}
|
|
127
130
|
}
|
|
128
131
|
const resp = yield this.httpClient.send(endpoint, method, headers, data, params);
|
|
129
132
|
return resp.data;
|