@ape.swap/bonds-sdk 1.0.465 → 1.0.466
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.
|
@@ -126,31 +126,25 @@ var BondModal = function (_a) {
|
|
|
126
126
|
alert('No Ethereum provider found');
|
|
127
127
|
return [2 /*return*/];
|
|
128
128
|
}
|
|
129
|
-
console.log('
|
|
130
|
-
console.log(account);
|
|
129
|
+
console.log('---!');
|
|
131
130
|
console.log((_a = bondData[0]) === null || _a === void 0 ? void 0 : _a.principalToken);
|
|
132
131
|
provider = new ethers.providers.Web3Provider(window.ethereum);
|
|
133
132
|
signer = provider.getSigner();
|
|
134
133
|
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);
|
|
135
134
|
_d.label = 1;
|
|
136
135
|
case 1:
|
|
137
|
-
_d.trys.push([1,
|
|
136
|
+
_d.trys.push([1, 3, , 4]);
|
|
138
137
|
amount = adjustDecimals(inputValue);
|
|
139
138
|
return [4 /*yield*/, tokenContract.approve(bondAddress, amount)];
|
|
140
139
|
case 2:
|
|
141
140
|
tx = _d.sent();
|
|
142
|
-
return [
|
|
141
|
+
return [3 /*break*/, 4];
|
|
143
142
|
case 3:
|
|
144
|
-
_d.sent();
|
|
145
|
-
setApprovalStatus(true);
|
|
146
|
-
alert('Approve Successful');
|
|
147
|
-
return [3 /*break*/, 5];
|
|
148
|
-
case 4:
|
|
149
143
|
error_2 = _d.sent();
|
|
150
144
|
console.error('Approval error', error_2);
|
|
151
145
|
alert('Approval Failed');
|
|
152
|
-
return [3 /*break*/,
|
|
153
|
-
case
|
|
146
|
+
return [3 /*break*/, 4];
|
|
147
|
+
case 4: return [2 /*return*/];
|
|
154
148
|
}
|
|
155
149
|
});
|
|
156
150
|
}); };
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
/** @jsxImportSource theme-ui */
|
|
2
2
|
import React from 'react';
|
|
3
3
|
import '../../scss/YourBonds.scss';
|
|
4
|
+
import { ExternalProvider } from '@ethersproject/providers';
|
|
4
5
|
declare global {
|
|
5
6
|
interface Window {
|
|
6
7
|
ethereum?: any;
|
|
7
8
|
}
|
|
8
9
|
}
|
|
9
10
|
interface YourBondsProps {
|
|
10
|
-
|
|
11
|
+
externalProvider: ExternalProvider;
|
|
11
12
|
}
|
|
12
13
|
declare const YourBonds: React.FC<YourBondsProps>;
|
|
13
14
|
export default YourBonds;
|
|
@@ -76,8 +76,13 @@ import { getPendingVesting } from '../../hooks/usePendingVesting';
|
|
|
76
76
|
import axios from 'axios';
|
|
77
77
|
import { fetchUserOwnedBillsDataAsync } from './fetchBillsUser';
|
|
78
78
|
import { Input } from '../../components/uikit-sdk/Input';
|
|
79
|
+
import { Web3Provider } from '@ethersproject/providers';
|
|
79
80
|
var YourBonds = function (_a) {
|
|
80
|
-
var
|
|
81
|
+
var externalProvider = _a.externalProvider;
|
|
82
|
+
var web3Provider = new Web3Provider(externalProvider);
|
|
83
|
+
console.log("WEB3PROVIDER");
|
|
84
|
+
console.log(web3Provider);
|
|
85
|
+
console.log("WEB3PROVIDER");
|
|
81
86
|
var _b = useWeb3React(), account = _b.account, isActive = _b.isActive;
|
|
82
87
|
var _c = useSearchParams(), searchParams = _c[0], setSearchParams = _c[1];
|
|
83
88
|
var navigate = useNavigate();
|