@ape.swap/bonds-sdk 1.0.463 → 1.0.465
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.
|
@@ -115,7 +115,7 @@ var BondModal = function (_a) {
|
|
|
115
115
|
}); };
|
|
116
116
|
//You approve the token, not the contract (this code will have to be updated for zap)
|
|
117
117
|
var handleApprove = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
118
|
-
var provider, signer,
|
|
118
|
+
var provider, signer, tokenContract, amount, tx, error_2;
|
|
119
119
|
var _a, _b, _c;
|
|
120
120
|
return __generator(this, function (_d) {
|
|
121
121
|
switch (_d.label) {
|
|
@@ -126,16 +126,17 @@ var BondModal = function (_a) {
|
|
|
126
126
|
alert('No Ethereum provider found');
|
|
127
127
|
return [2 /*return*/];
|
|
128
128
|
}
|
|
129
|
-
console.log('
|
|
129
|
+
console.log('---***!');
|
|
130
|
+
console.log(account);
|
|
130
131
|
console.log((_a = bondData[0]) === null || _a === void 0 ? void 0 : _a.principalToken);
|
|
131
132
|
provider = new ethers.providers.Web3Provider(window.ethereum);
|
|
132
133
|
signer = provider.getSigner();
|
|
133
|
-
|
|
134
|
+
tokenContract = new ethers.Contract((_c = (_b = bondData[0]) === null || _b === void 0 ? void 0 : _b.principalToken) !== null && _c !== void 0 ? _c : "", ERC_20_ABI, signer);
|
|
134
135
|
_d.label = 1;
|
|
135
136
|
case 1:
|
|
136
137
|
_d.trys.push([1, 4, , 5]);
|
|
137
138
|
amount = adjustDecimals(inputValue);
|
|
138
|
-
return [4 /*yield*/,
|
|
139
|
+
return [4 /*yield*/, tokenContract.approve(bondAddress, amount)];
|
|
139
140
|
case 2:
|
|
140
141
|
tx = _d.sent();
|
|
141
142
|
return [4 /*yield*/, tx.wait()];
|