@getpara/ethers-v6-integration 2.1.0 → 2.2.0

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.
@@ -42,6 +42,10 @@ __export(ethersSigner_exports, {
42
42
  module.exports = __toCommonJS(ethersSigner_exports);
43
43
  var import_ethers = require("ethers");
44
44
  var import_core_sdk = require("@getpara/core-sdk");
45
+ function normalizeSignature(rawSignature) {
46
+ const sig = import_ethers.ethers.Signature.from(`0x${rawSignature}`);
47
+ return sig.serialized;
48
+ }
45
49
  class ParaEthersSigner extends import_ethers.ethers.AbstractSigner {
46
50
  /**
47
51
  * Signs a message.
@@ -80,7 +84,7 @@ class ParaEthersSigner extends import_ethers.ethers.AbstractSigner {
80
84
  timeoutMs: this.messageSigningTimeoutMs
81
85
  });
82
86
  const signature = res.signature;
83
- return `0x${signature}`;
87
+ return normalizeSignature(signature);
84
88
  });
85
89
  }
86
90
  validateTx(tx) {
@@ -121,8 +125,9 @@ class ParaEthersSigner extends import_ethers.ethers.AbstractSigner {
121
125
  chainId: `${txObj.chainId}`
122
126
  });
123
127
  const signature = res.signature;
128
+ const normalizedSig = import_ethers.ethers.Signature.from(`0x${signature}`);
124
129
  const btx = import_ethers.ethers.Transaction.from(tx);
125
- btx.signature = `0x${signature}`;
130
+ btx.signature = normalizedSig;
126
131
  return btx.serialized;
127
132
  });
128
133
  }
@@ -144,7 +149,7 @@ class ParaEthersSigner extends import_ethers.ethers.AbstractSigner {
144
149
  messageBase64: (0, import_core_sdk.hexStringToBase64)(import_ethers.ethers.TypedDataEncoder.hash(populated.domain, types, populated.value))
145
150
  });
146
151
  const signature = res.signature;
147
- return `0x${signature}`;
152
+ return normalizeSignature(signature);
148
153
  });
149
154
  }
150
155
  }
@@ -3,6 +3,10 @@ import {
3
3
  } from "./chunk-4AFQP74Z.js";
4
4
  import { ethers } from "ethers";
5
5
  import { hexStringToBase64 } from "@getpara/core-sdk";
6
+ function normalizeSignature(rawSignature) {
7
+ const sig = ethers.Signature.from(`0x${rawSignature}`);
8
+ return sig.serialized;
9
+ }
6
10
  class ParaEthersSigner extends ethers.AbstractSigner {
7
11
  /**
8
12
  * Signs a message.
@@ -41,7 +45,7 @@ class ParaEthersSigner extends ethers.AbstractSigner {
41
45
  timeoutMs: this.messageSigningTimeoutMs
42
46
  });
43
47
  const signature = res.signature;
44
- return `0x${signature}`;
48
+ return normalizeSignature(signature);
45
49
  });
46
50
  }
47
51
  validateTx(tx) {
@@ -82,8 +86,9 @@ class ParaEthersSigner extends ethers.AbstractSigner {
82
86
  chainId: `${txObj.chainId}`
83
87
  });
84
88
  const signature = res.signature;
89
+ const normalizedSig = ethers.Signature.from(`0x${signature}`);
85
90
  const btx = ethers.Transaction.from(tx);
86
- btx.signature = `0x${signature}`;
91
+ btx.signature = normalizedSig;
87
92
  return btx.serialized;
88
93
  });
89
94
  }
@@ -105,7 +110,7 @@ class ParaEthersSigner extends ethers.AbstractSigner {
105
110
  messageBase64: hexStringToBase64(ethers.TypedDataEncoder.hash(populated.domain, types, populated.value))
106
111
  });
107
112
  const signature = res.signature;
108
- return `0x${signature}`;
113
+ return normalizeSignature(signature);
109
114
  });
110
115
  }
111
116
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@getpara/ethers-v6-integration",
3
- "version": "2.1.0",
3
+ "version": "2.2.0",
4
4
  "dependencies": {
5
- "@getpara/core-sdk": "2.1.0"
5
+ "@getpara/core-sdk": "2.2.0"
6
6
  },
7
7
  "devDependencies": {
8
8
  "ethers": "^6.13.5",
@@ -19,7 +19,7 @@
19
19
  "dist",
20
20
  "package.json"
21
21
  ],
22
- "gitHead": "3ae7f836324a3a2a8a57156e16304aeaf0d37b42",
22
+ "gitHead": "51765cf39b1667e0283b3906a8f8ef91e447e347",
23
23
  "main": "dist/cjs/index.js",
24
24
  "module": "dist/esm/index.js",
25
25
  "peerDependencies": {