@polymarket/relayer-client 1.0.16 → 1.0.18

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.
@@ -70,7 +70,7 @@ function createStructHash(chainId, safe, to, value, data, operation, safeTxGas,
70
70
  nonce: nonce,
71
71
  };
72
72
  const structHash = utils_2._TypedDataEncoder.hash(domain, types, values);
73
- // console.log(`Safe Struct Hash: ${structHash}`);
73
+ console.log(`Safe Struct Hash: ${structHash}`);
74
74
  return structHash;
75
75
  }
76
76
  function aggregateTransaction(txns) {
package/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from "./client";
2
2
  export * from "./types";
3
3
  export * from "./signeradapter";
4
+ export * from "./response";
package/dist/index.js CHANGED
@@ -4,3 +4,4 @@ const tslib_1 = require("tslib");
4
4
  tslib_1.__exportStar(require("./client"), exports);
5
5
  tslib_1.__exportStar(require("./types"), exports);
6
6
  tslib_1.__exportStar(require("./signeradapter"), exports);
7
+ tslib_1.__exportStar(require("./response"), exports);
@@ -4,6 +4,7 @@ exports.SignerAdapter = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const providers_1 = require("@ethersproject/providers");
6
6
  const ethers_1 = require("ethers");
7
+ const encoding = tslib_1.__importStar(require("@walletconnect/encoding"));
7
8
  const response_1 = require("../response");
8
9
  class SignerAdapter {
9
10
  constructor(ethersSigner, viemSigner) {
@@ -54,10 +55,16 @@ class SignerAdapter {
54
55
  if (this.viemSigner == undefined) {
55
56
  throw new Error("must provide viem WalletClient");
56
57
  }
58
+ console.log(`StructHash: `);
59
+ console.log(message);
60
+ // force to walletconnect signable hex
61
+ const msg = encoding.utf8ToHex(message);
62
+ console.log(`Struct Hash after wc specific encoding:`);
63
+ console.log(msg);
57
64
  const account = (_b = (_a = this.viemSigner) === null || _a === void 0 ? void 0 : _a.walletClient.account) === null || _b === void 0 ? void 0 : _b.address;
58
65
  return (_c = this.viemSigner) === null || _c === void 0 ? void 0 : _c.walletClient.signMessage({
59
66
  account: account,
60
- message: message.slice(0, 2) == "0x" ? { raw: message } : message,
67
+ message: msg.slice(0, 2) == "0x" ? { raw: msg } : msg,
61
68
  });
62
69
  });
63
70
  }
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": "1.0.16",
4
+ "version": "1.0.18",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
7
7
  "files": [
@@ -12,6 +12,7 @@
12
12
  "clean": "rm -rf ./dist"
13
13
  },
14
14
  "dependencies": {
15
+ "@walletconnect/encoding": "^1.0.2",
15
16
  "axios": "^0.27.2",
16
17
  "browser-or-node": "^3.0.0",
17
18
  "ethers": "^5.7.1",