@ape.swap/bonds-sdk 1.0.599 → 1.0.601

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.
@@ -60,7 +60,7 @@ var BondModal = function (_a) {
60
60
  var account = _a.account, isActive = _a.isActive, isOpen = _a.isOpen, accountChainId = _a.accountChainId, onClose = _a.onClose, bondAddress = _a.bondAddress;
61
61
  if (!isOpen)
62
62
  return null;
63
- var _b = useWriteContract(), hash = _b.data, isPending = _b.isPending, writeContract = _b.writeContract;
63
+ var _b = useWriteContract(), hash = _b.data, isPending = _b.isPending, writeContract = _b.writeContract, writeContractAsync = _b.writeContractAsync;
64
64
  var _c = useWaitForTransactionReceipt({
65
65
  hash: hash,
66
66
  }), isConfirming = _c.isLoading, isConfirmed = _c.isSuccess;
@@ -75,12 +75,12 @@ var BondModal = function (_a) {
75
75
  billAddress = bondData[0].billAddress;
76
76
  decimals = 18;
77
77
  try {
78
- console.log('HANDLEBUY CLICKED!_!!');
79
- maxPrice = new BigNumber(bondData[0].trueBillPrice).times(103).div(100);
78
+ console.log('HANDLEBUY CLICKED');
79
+ maxPrice = new BigNumber(bondData[0].trueBillPrice).times(102).div(100);
80
80
  amount = convertToTokenValue(inputValue, decimals);
81
81
  console.log('BillAddress:', billAddress);
82
82
  console.log('Amount:', amount);
83
- console.log('MaxPrice:', maxPrice.toFixed(0));
83
+ console.log('MaxPrice:', maxPrice);
84
84
  writeContract({
85
85
  address: billAddress,
86
86
  abi: BOND_ABI,
@@ -103,7 +103,7 @@ var BondModal = function (_a) {
103
103
  var _e = useState(null), buyTx = _e[0], setBuyTx = _e[1];
104
104
  //You approve the token, not the contract (this code will have to be updated for zap)
105
105
  var handleApprove = function () { return __awaiter(void 0, void 0, void 0, function () {
106
- var tokenAddress, decimals, amount, hash_1, error_1;
106
+ var tokenAddress, decimals, amount, tx, error_1;
107
107
  return __generator(this, function (_a) {
108
108
  switch (_a.label) {
109
109
  case 0:
@@ -114,18 +114,18 @@ var BondModal = function (_a) {
114
114
  _a.trys.push([1, 3, , 4]);
115
115
  amount = convertToTokenValue(inputValue, decimals);
116
116
  console.log('Amount:', amount);
117
- return [4 /*yield*/, writeContract({
117
+ return [4 /*yield*/, writeContractAsync({
118
118
  address: tokenAddress,
119
119
  abi: ERC_20_ABI,
120
120
  functionName: 'approve',
121
121
  args: [account, amount]
122
122
  })];
123
123
  case 2:
124
- hash_1 = _a.sent();
125
- console.log('ApproveTransaction Hash:', hash_1);
126
- if (hash_1 != null) {
127
- setApproveTx(hash_1);
128
- console.log('setApproveTx:', hash_1);
124
+ tx = _a.sent();
125
+ console.log('ApproveTransaction:', tx);
126
+ if (tx) {
127
+ setApproveTx(tx);
128
+ console.log('setApproveTx:', tx);
129
129
  }
130
130
  return [3 /*break*/, 4];
131
131
  case 3:
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "description": "Ape Bond SDK",
4
4
  "author": "Ape Bond",
5
5
  "license": "MIT",
6
- "version": "1.0.599",
6
+ "version": "1.0.601",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",