@ape.swap/bonds-sdk 1.0.604 → 1.0.605

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.
@@ -61,15 +61,13 @@ var BondModal = function (_a) {
61
61
  if (!isOpen)
62
62
  return null;
63
63
  var _b = useWriteContract(), hash = _b.data, isPending = _b.isPending, writeContract = _b.writeContract, writeContractAsync = _b.writeContractAsync;
64
- var transactionReceipt = function (txHash) { return __awaiter(void 0, void 0, void 0, function () {
65
- return __generator(this, function (_a) {
66
- return [2 /*return*/, useWaitForTransactionReceipt({
67
- confirmations: 4,
68
- hash: txHash,
69
- pollingInterval: 1000
70
- })];
71
- });
72
- }); };
64
+ // const transactionReceipt = async (txHash: `0x${string}`) => {
65
+ // return useWaitForTransactionReceipt({
66
+ // confirmations: 4,
67
+ // hash: txHash,
68
+ // pollingInterval: 1_000
69
+ // });
70
+ // }
73
71
  var _c = useState([]), bondData = _c[0], setBondData = _c[1];
74
72
  //This is a temp solution, but we will force approval each time, and then once set we will set status here and allow
75
73
  //user to buy
@@ -124,7 +122,7 @@ var BondModal = function (_a) {
124
122
  decimals = tokenDecimals !== null && tokenDecimals !== void 0 ? tokenDecimals : 18;
125
123
  _a.label = 1;
126
124
  case 1:
127
- _a.trys.push([1, 4, , 5]);
125
+ _a.trys.push([1, 3, , 4]);
128
126
  amount = convertToTokenValue(inputValue, decimals);
129
127
  console.log('Amount:', amount);
130
128
  return [4 /*yield*/, writeContractAsync({
@@ -135,9 +133,12 @@ var BondModal = function (_a) {
135
133
  })];
136
134
  case 2:
137
135
  tx = _a.sent();
138
- return [4 /*yield*/, transactionReceipt(tx)];
139
- case 3:
140
- receipt = _a.sent();
136
+ receipt = useWaitForTransactionReceipt({
137
+ confirmations: 4,
138
+ hash: tx,
139
+ pollingInterval: 1000
140
+ });
141
+ ;
141
142
  if (receipt.isSuccess) {
142
143
  setReceiptTx(receipt.data.transactionHash);
143
144
  console.log('Receipt:', receipt);
@@ -146,13 +147,13 @@ var BondModal = function (_a) {
146
147
  setApproveTx(tx);
147
148
  console.log('setApproveTx:', tx);
148
149
  }
149
- return [3 /*break*/, 5];
150
- case 4:
150
+ return [3 /*break*/, 4];
151
+ case 3:
151
152
  error_2 = _a.sent();
152
153
  console.error('Approval failed:', error_2);
153
154
  alert('Approval Failed');
154
- return [3 /*break*/, 5];
155
- case 5: return [2 /*return*/];
155
+ return [3 /*break*/, 4];
156
+ case 4: return [2 /*return*/];
156
157
  }
157
158
  });
158
159
  }); };
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.604",
6
+ "version": "1.0.605",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",