impermax-sdk 2.1.39 → 2.1.41
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.
|
@@ -170,7 +170,7 @@ class OnchainPermitHelper {
|
|
|
170
170
|
}
|
|
171
171
|
getPermit2Single(token, owner, spender, value) {
|
|
172
172
|
return __awaiter(this, void 0, void 0, function* () {
|
|
173
|
-
const allowanceData = yield this.permit2.methods.allowance(owner, token.
|
|
173
|
+
const allowanceData = yield this.permit2.methods.allowance(owner, token._address, spender).call();
|
|
174
174
|
if (!allowanceData)
|
|
175
175
|
throw new Error("Invalid permit2 allowance data");
|
|
176
176
|
const nonce = allowanceData.nonce;
|
|
@@ -186,9 +186,10 @@ class OnchainPermitHelper {
|
|
|
186
186
|
spender,
|
|
187
187
|
sigDeadline: this.deadline,
|
|
188
188
|
});
|
|
189
|
+
console.log("jsonData", jsonData);
|
|
189
190
|
return {
|
|
190
191
|
permitType: onchainTypes_1.PermitType.PERMIT2_SINGLE,
|
|
191
|
-
permitData: ethers_1.ethers.utils.defaultAbiCoder.encode([permitDetailsType, 'address', 'uint256'], [
|
|
192
|
+
permitData: ethers_1.ethers.utils.defaultAbiCoder.encode([permitDetailsType, 'address', 'uint256'], [details, spender, this.deadline]),
|
|
192
193
|
signature: yield this.getSignature(owner, jsonData)
|
|
193
194
|
};
|
|
194
195
|
});
|