@ape.swap/bonds-sdk 1.0.552 → 1.0.554

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.
Files changed (30) hide show
  1. package/dist/pages/YourBonds/YourBonds.js +10 -31
  2. package/package.json +1 -1
  3. package/dist/config/abi/bondNft.json +0 -424
  4. package/dist/config/abi/ens-public-resolver.json +0 -816
  5. package/dist/config/abi/ens-registrar.json +0 -422
  6. package/dist/config/abi/erc20_bytes32.json +0 -30
  7. package/dist/config/abi/jungleChef.json +0 -291
  8. package/dist/config/abi/launchBonds.json +0 -2014
  9. package/dist/config/abi/lockVeAbond.json +0 -2198
  10. package/dist/config/abi/migrationBond.json +0 -1639
  11. package/dist/config/abi/migrationFveAbond.json +0 -160
  12. package/dist/config/abi/multicallv3.json +0 -92
  13. package/dist/config/abi/price-getter-linea.json +0 -1448
  14. package/dist/config/abi/price-getter.json +0 -1309
  15. package/dist/config/abi/sousChef.json +0 -649
  16. package/dist/config/abi/weth.json +0 -279
  17. package/dist/hooks/PriceGetter/dexFactories.d.ts +0 -11
  18. package/dist/hooks/PriceGetter/dexFactories.js +0 -2
  19. package/dist/hooks/PriceGetter/usePricesFromPriceGetter.d.ts +0 -17
  20. package/dist/hooks/PriceGetter/usePricesFromPriceGetter.js +0 -205
  21. package/dist/hooks/useClaimBill.d.ts +0 -4
  22. package/dist/hooks/useClaimBill.js +0 -59
  23. package/dist/hooks/useContract.d.ts +0 -25
  24. package/dist/hooks/useContract.js +0 -107
  25. package/dist/state/tokenPrices/fetchTokenPricesForMultipleChains.d.ts +0 -4
  26. package/dist/state/tokenPrices/fetchTokenPricesForMultipleChains.js +0 -81
  27. package/dist/state/tokenPrices/getAllTokenPrices.d.ts +0 -5
  28. package/dist/state/tokenPrices/getAllTokenPrices.js +0 -288
  29. package/dist/state/tokenPrices/useTokenPricesNew.d.ts +0 -11
  30. package/dist/state/tokenPrices/useTokenPricesNew.js +0 -72
@@ -48,7 +48,6 @@ import { jsx as _jsx, jsxs as _jsxs } from "theme-ui/jsx-runtime";
48
48
  import { useEffect, useState } from 'react';
49
49
  import { Flex, ThemeUIProvider } from 'theme-ui';
50
50
  import { useWeb3React } from '@web3-react/core';
51
- import { useSearchParams, useNavigate } from 'react-router-dom';
52
51
  import getTimePeriods from '../../utils/getTimePeriods';
53
52
  import { defaultTheme } from '../../theme';
54
53
  import '../../scss/YourBonds.scss';
@@ -68,24 +67,7 @@ import { YourBondsModal } from "../../index";
68
67
  import BOND_ABI from '../../config/abi/bond.json';
69
68
  import { useWriteContract } from 'wagmi';
70
69
  var YourBonds = function (_a) {
71
- //const toastError = useToastError()
72
- // const { onClaimBill } = useClaimBill(billAddress, billIds)
73
- var account = _a.account, accountChainId = _a.accountChainId, isActive = _a.isActive;
74
- // const [pendingTrx, setPendingTrx] = useState(false)
75
- // const handleClaim = async (billAddress: string, billIds: string[], chainId: number, event: any) => {
76
- // event?.stopPropagation();
77
- // console.log('CLAIM CLICKED');
78
- // console.log(account);
79
- // if (!account) return;
80
- // const { onClaimBill } = useClaimBill(billAddress, billIds, chainId);
81
- // setPendingTrx(true);
82
- // await onClaimBill().catch((e) => {
83
- // console.error(e);
84
- // //toastError(e);
85
- // setPendingTrx(false);
86
- // });
87
- // setPendingTrx(false);
88
- // };
70
+ var account = _a.account;
89
71
  var writeContract = useWriteContract().writeContract;
90
72
  var handleClaim = function (billId, billAddress) { return __awaiter(void 0, void 0, void 0, function () {
91
73
  var address, tx, error_1;
@@ -118,12 +100,9 @@ var YourBonds = function (_a) {
118
100
  }
119
101
  });
120
102
  }); };
121
- // const { account, isActive } = useWeb3React();
122
- var _b = useSearchParams(), searchParams = _b[0], setSearchParams = _b[1];
123
- var navigate = useNavigate();
124
103
  // Fetch data
125
- var _c = useState([]), bondData = _c[0], setBondData = _c[1];
126
- var _d = useState([]), mappedUserBills = _d[0], setMappedUserBills = _d[1];
104
+ var _b = useState([]), bondData = _b[0], setBondData = _b[1];
105
+ var _c = useState([]), mappedUserBills = _c[0], setMappedUserBills = _c[1];
127
106
  useEffect(function () {
128
107
  axios.get('https://realtime-api.ape.bond/bonds').then(function (response) {
129
108
  var bonds = response.data.bonds;
@@ -157,8 +136,8 @@ var YourBonds = function (_a) {
157
136
  }); };
158
137
  fetchData();
159
138
  }, [account, bondData]);
160
- var _e = useState(null), sortConfig = _e[0], setSortConfig = _e[1];
161
- var _f = useState(mappedUserBills), sortedBonds = _f[0], setSortedBonds = _f[1];
139
+ var _d = useState(null), sortConfig = _d[0], setSortConfig = _d[1];
140
+ var _e = useState(mappedUserBills), sortedBonds = _e[0], setSortedBonds = _e[1];
162
141
  var handleSort = function (key) {
163
142
  var direction = 'asc';
164
143
  if ((sortConfig === null || sortConfig === void 0 ? void 0 : sortConfig.key) === key && (sortConfig === null || sortConfig === void 0 ? void 0 : sortConfig.direction) === 'asc') {
@@ -239,8 +218,8 @@ var YourBonds = function (_a) {
239
218
  return getFirstNonZeroDigits(parseFloat((_a = bond === null || bond === void 0 ? void 0 : bond.payoutTokenPrice) !== null && _a !== void 0 ? _a : '0'));
240
219
  };
241
220
  // Modal
242
- var _g = useState(false), isModalOpen = _g[0], setIsModalOpen = _g[1];
243
- var _h = useState(undefined), selectedBill = _h[0], setSelectedBill = _h[1];
221
+ var _f = useState(false), isModalOpen = _f[0], setIsModalOpen = _f[1];
222
+ var _g = useState(undefined), selectedBill = _g[0], setSelectedBill = _g[1];
244
223
  var rowClick = function (bill) {
245
224
  console.log(bill);
246
225
  setSelectedBill(bill);
@@ -248,8 +227,8 @@ var YourBonds = function (_a) {
248
227
  // navigate(`/yourBonds/?bondAddress=${bill.address}&bondChain=${bill.bond.chainId}`, { replace: true });
249
228
  };
250
229
  // Search logic
251
- var _j = useState(''), inputValue = _j[0], setInputValue = _j[1];
252
- var _k = useState(sortedBonds), filteredBonds = _k[0], setFilteredBonds = _k[1];
230
+ var _h = useState(''), inputValue = _h[0], setInputValue = _h[1];
231
+ var _j = useState(sortedBonds), filteredBonds = _j[0], setFilteredBonds = _j[1];
253
232
  useEffect(function () {
254
233
  if (inputValue === '') {
255
234
  setFilteredBonds(sortedBonds);
@@ -264,7 +243,7 @@ var YourBonds = function (_a) {
264
243
  setInputValue(event.target.value);
265
244
  };
266
245
  // Page render logic
267
- var _l = useState(false), bondsRendered = _l[0], setBondsRendered = _l[1];
246
+ var _k = useState(false), bondsRendered = _k[0], setBondsRendered = _k[1];
268
247
  useEffect(function () {
269
248
  if (filteredBonds.length > 0) {
270
249
  setBondsRendered(true);
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.552",
6
+ "version": "1.0.554",
7
7
  "main": "dist/index.js",
8
8
  "module": "dist/index.es.js",
9
9
  "types": "dist/index.d.ts",
@@ -1,424 +0,0 @@
1
- [
2
- {
3
- "anonymous": false,
4
- "inputs": [
5
- { "indexed": true, "internalType": "address", "name": "owner", "type": "address" },
6
- { "indexed": true, "internalType": "address", "name": "approved", "type": "address" },
7
- { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }
8
- ],
9
- "name": "Approval",
10
- "type": "event"
11
- },
12
- {
13
- "anonymous": false,
14
- "inputs": [
15
- { "indexed": true, "internalType": "address", "name": "owner", "type": "address" },
16
- { "indexed": true, "internalType": "address", "name": "operator", "type": "address" },
17
- { "indexed": false, "internalType": "bool", "name": "approved", "type": "bool" }
18
- ],
19
- "name": "ApprovalForAll",
20
- "type": "event"
21
- },
22
- {
23
- "anonymous": false,
24
- "inputs": [{ "indexed": false, "internalType": "string", "name": "newUri", "type": "string" }],
25
- "name": "BaseTokenUriChanged",
26
- "type": "event"
27
- },
28
- {
29
- "anonymous": false,
30
- "inputs": [
31
- { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" },
32
- { "indexed": true, "internalType": "bytes32", "name": "previousAdminRole", "type": "bytes32" },
33
- { "indexed": true, "internalType": "bytes32", "name": "newAdminRole", "type": "bytes32" }
34
- ],
35
- "name": "RoleAdminChanged",
36
- "type": "event"
37
- },
38
- {
39
- "anonymous": false,
40
- "inputs": [
41
- { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" },
42
- { "indexed": true, "internalType": "address", "name": "account", "type": "address" },
43
- { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }
44
- ],
45
- "name": "RoleGranted",
46
- "type": "event"
47
- },
48
- {
49
- "anonymous": false,
50
- "inputs": [
51
- { "indexed": true, "internalType": "bytes32", "name": "role", "type": "bytes32" },
52
- { "indexed": true, "internalType": "address", "name": "account", "type": "address" },
53
- { "indexed": true, "internalType": "address", "name": "sender", "type": "address" }
54
- ],
55
- "name": "RoleRevoked",
56
- "type": "event"
57
- },
58
- {
59
- "anonymous": false,
60
- "inputs": [
61
- { "indexed": true, "internalType": "address", "name": "from", "type": "address" },
62
- { "indexed": true, "internalType": "address", "name": "to", "type": "address" },
63
- { "indexed": true, "internalType": "uint256", "name": "tokenId", "type": "uint256" }
64
- ],
65
- "name": "Transfer",
66
- "type": "event"
67
- },
68
- {
69
- "anonymous": false,
70
- "inputs": [{ "indexed": false, "internalType": "bool", "name": "locked", "type": "bool" }],
71
- "name": "UriLocked",
72
- "type": "event"
73
- },
74
- {
75
- "inputs": [],
76
- "name": "DEFAULT_ADMIN_ROLE",
77
- "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
78
- "stateMutability": "view",
79
- "type": "function"
80
- },
81
- {
82
- "inputs": [],
83
- "name": "FACTORY_ROLE",
84
- "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
85
- "stateMutability": "view",
86
- "type": "function"
87
- },
88
- {
89
- "inputs": [],
90
- "name": "MINTER_ROLE",
91
- "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
92
- "stateMutability": "view",
93
- "type": "function"
94
- },
95
- {
96
- "inputs": [],
97
- "name": "URI_SETTER_ROLE",
98
- "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
99
- "stateMutability": "view",
100
- "type": "function"
101
- },
102
- {
103
- "inputs": [{ "internalType": "address", "name": "minter", "type": "address" }],
104
- "name": "addMinter",
105
- "outputs": [],
106
- "stateMutability": "nonpayable",
107
- "type": "function"
108
- },
109
- {
110
- "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }],
111
- "name": "allTokensDataOfOwner",
112
- "outputs": [
113
- {
114
- "components": [
115
- { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
116
- { "internalType": "address", "name": "billAddress", "type": "address" }
117
- ],
118
- "internalType": "struct BillNft.TokenData[]",
119
- "name": "",
120
- "type": "tuple[]"
121
- }
122
- ],
123
- "stateMutability": "view",
124
- "type": "function"
125
- },
126
- {
127
- "inputs": [
128
- { "internalType": "address", "name": "to", "type": "address" },
129
- { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
130
- ],
131
- "name": "approve",
132
- "outputs": [],
133
- "stateMutability": "nonpayable",
134
- "type": "function"
135
- },
136
- {
137
- "inputs": [{ "internalType": "address", "name": "owner", "type": "address" }],
138
- "name": "balanceOf",
139
- "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
140
- "stateMutability": "view",
141
- "type": "function"
142
- },
143
- {
144
- "inputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
145
- "name": "billAddresses",
146
- "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
147
- "stateMutability": "view",
148
- "type": "function"
149
- },
150
- {
151
- "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }],
152
- "name": "getApproved",
153
- "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
154
- "stateMutability": "view",
155
- "type": "function"
156
- },
157
- {
158
- "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }],
159
- "name": "getRoleAdmin",
160
- "outputs": [{ "internalType": "bytes32", "name": "", "type": "bytes32" }],
161
- "stateMutability": "view",
162
- "type": "function"
163
- },
164
- {
165
- "inputs": [
166
- { "internalType": "bytes32", "name": "role", "type": "bytes32" },
167
- { "internalType": "uint256", "name": "index", "type": "uint256" }
168
- ],
169
- "name": "getRoleMember",
170
- "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
171
- "stateMutability": "view",
172
- "type": "function"
173
- },
174
- {
175
- "inputs": [{ "internalType": "bytes32", "name": "role", "type": "bytes32" }],
176
- "name": "getRoleMemberCount",
177
- "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
178
- "stateMutability": "view",
179
- "type": "function"
180
- },
181
- {
182
- "inputs": [
183
- { "internalType": "address", "name": "owner", "type": "address" },
184
- { "internalType": "uint256", "name": "start", "type": "uint256" },
185
- { "internalType": "uint256", "name": "end", "type": "uint256" }
186
- ],
187
- "name": "getTokensOfOwnerByIndexes",
188
- "outputs": [
189
- {
190
- "components": [
191
- { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
192
- { "internalType": "address", "name": "billAddress", "type": "address" }
193
- ],
194
- "internalType": "struct BillNft.TokenData[]",
195
- "name": "",
196
- "type": "tuple[]"
197
- }
198
- ],
199
- "stateMutability": "view",
200
- "type": "function"
201
- },
202
- {
203
- "inputs": [
204
- { "internalType": "bytes32", "name": "role", "type": "bytes32" },
205
- { "internalType": "address", "name": "account", "type": "address" }
206
- ],
207
- "name": "grantRole",
208
- "outputs": [],
209
- "stateMutability": "nonpayable",
210
- "type": "function"
211
- },
212
- {
213
- "inputs": [
214
- { "internalType": "bytes32", "name": "role", "type": "bytes32" },
215
- { "internalType": "address", "name": "account", "type": "address" }
216
- ],
217
- "name": "hasRole",
218
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
219
- "stateMutability": "view",
220
- "type": "function"
221
- },
222
- {
223
- "inputs": [
224
- { "internalType": "string", "name": "name", "type": "string" },
225
- { "internalType": "string", "name": "symbol", "type": "string" },
226
- { "internalType": "string", "name": "baseTokenURI", "type": "string" },
227
- { "internalType": "address", "name": "factory", "type": "address" },
228
- { "internalType": "address", "name": "owner", "type": "address" }
229
- ],
230
- "name": "initialize",
231
- "outputs": [],
232
- "stateMutability": "nonpayable",
233
- "type": "function"
234
- },
235
- {
236
- "inputs": [
237
- { "internalType": "address", "name": "owner", "type": "address" },
238
- { "internalType": "address", "name": "operator", "type": "address" }
239
- ],
240
- "name": "isApprovedForAll",
241
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
242
- "stateMutability": "view",
243
- "type": "function"
244
- },
245
- { "inputs": [], "name": "lockURI", "outputs": [], "stateMutability": "nonpayable", "type": "function" },
246
- {
247
- "inputs": [
248
- { "internalType": "address", "name": "to", "type": "address" },
249
- { "internalType": "address", "name": "billAddress", "type": "address" }
250
- ],
251
- "name": "mint",
252
- "outputs": [{ "internalType": "uint256", "name": "newTokenId", "type": "uint256" }],
253
- "stateMutability": "nonpayable",
254
- "type": "function"
255
- },
256
- {
257
- "inputs": [
258
- { "internalType": "uint256", "name": "amount", "type": "uint256" },
259
- { "internalType": "address", "name": "to", "type": "address" },
260
- { "internalType": "address", "name": "billAddress", "type": "address" }
261
- ],
262
- "name": "mintMany",
263
- "outputs": [],
264
- "stateMutability": "nonpayable",
265
- "type": "function"
266
- },
267
- {
268
- "inputs": [],
269
- "name": "name",
270
- "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
271
- "stateMutability": "view",
272
- "type": "function"
273
- },
274
- {
275
- "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }],
276
- "name": "ownerOf",
277
- "outputs": [{ "internalType": "address", "name": "", "type": "address" }],
278
- "stateMutability": "view",
279
- "type": "function"
280
- },
281
- {
282
- "inputs": [
283
- { "internalType": "bytes32", "name": "role", "type": "bytes32" },
284
- { "internalType": "address", "name": "account", "type": "address" }
285
- ],
286
- "name": "renounceRole",
287
- "outputs": [],
288
- "stateMutability": "nonpayable",
289
- "type": "function"
290
- },
291
- {
292
- "inputs": [
293
- { "internalType": "bytes32", "name": "role", "type": "bytes32" },
294
- { "internalType": "address", "name": "account", "type": "address" }
295
- ],
296
- "name": "revokeRole",
297
- "outputs": [],
298
- "stateMutability": "nonpayable",
299
- "type": "function"
300
- },
301
- {
302
- "inputs": [
303
- { "internalType": "address", "name": "from", "type": "address" },
304
- { "internalType": "address", "name": "to", "type": "address" },
305
- { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
306
- ],
307
- "name": "safeTransferFrom",
308
- "outputs": [],
309
- "stateMutability": "nonpayable",
310
- "type": "function"
311
- },
312
- {
313
- "inputs": [
314
- { "internalType": "address", "name": "from", "type": "address" },
315
- { "internalType": "address", "name": "to", "type": "address" },
316
- { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
317
- { "internalType": "bytes", "name": "_data", "type": "bytes" }
318
- ],
319
- "name": "safeTransferFrom",
320
- "outputs": [],
321
- "stateMutability": "nonpayable",
322
- "type": "function"
323
- },
324
- {
325
- "inputs": [
326
- { "internalType": "address", "name": "operator", "type": "address" },
327
- { "internalType": "bool", "name": "approved", "type": "bool" }
328
- ],
329
- "name": "setApprovalForAll",
330
- "outputs": [],
331
- "stateMutability": "nonpayable",
332
- "type": "function"
333
- },
334
- {
335
- "inputs": [{ "internalType": "string", "name": "baseTokenURI", "type": "string" }],
336
- "name": "setBaseURI",
337
- "outputs": [],
338
- "stateMutability": "nonpayable",
339
- "type": "function"
340
- },
341
- {
342
- "inputs": [{ "internalType": "bytes4", "name": "interfaceId", "type": "bytes4" }],
343
- "name": "supportsInterface",
344
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
345
- "stateMutability": "view",
346
- "type": "function"
347
- },
348
- {
349
- "inputs": [],
350
- "name": "symbol",
351
- "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
352
- "stateMutability": "view",
353
- "type": "function"
354
- },
355
- {
356
- "inputs": [{ "internalType": "uint256", "name": "index", "type": "uint256" }],
357
- "name": "tokenByIndex",
358
- "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
359
- "stateMutability": "view",
360
- "type": "function"
361
- },
362
- {
363
- "inputs": [
364
- { "internalType": "address", "name": "owner", "type": "address" },
365
- { "internalType": "uint256", "name": "index", "type": "uint256" }
366
- ],
367
- "name": "tokenDataOfOwnerByIndex",
368
- "outputs": [
369
- {
370
- "components": [
371
- { "internalType": "uint256", "name": "tokenId", "type": "uint256" },
372
- { "internalType": "address", "name": "billAddress", "type": "address" }
373
- ],
374
- "internalType": "struct BillNft.TokenData",
375
- "name": "tokenData",
376
- "type": "tuple"
377
- }
378
- ],
379
- "stateMutability": "view",
380
- "type": "function"
381
- },
382
- {
383
- "inputs": [
384
- { "internalType": "address", "name": "owner", "type": "address" },
385
- { "internalType": "uint256", "name": "index", "type": "uint256" }
386
- ],
387
- "name": "tokenOfOwnerByIndex",
388
- "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
389
- "stateMutability": "view",
390
- "type": "function"
391
- },
392
- {
393
- "inputs": [{ "internalType": "uint256", "name": "tokenId", "type": "uint256" }],
394
- "name": "tokenURI",
395
- "outputs": [{ "internalType": "string", "name": "", "type": "string" }],
396
- "stateMutability": "view",
397
- "type": "function"
398
- },
399
- {
400
- "inputs": [],
401
- "name": "totalSupply",
402
- "outputs": [{ "internalType": "uint256", "name": "", "type": "uint256" }],
403
- "stateMutability": "view",
404
- "type": "function"
405
- },
406
- {
407
- "inputs": [
408
- { "internalType": "address", "name": "from", "type": "address" },
409
- { "internalType": "address", "name": "to", "type": "address" },
410
- { "internalType": "uint256", "name": "tokenId", "type": "uint256" }
411
- ],
412
- "name": "transferFrom",
413
- "outputs": [],
414
- "stateMutability": "nonpayable",
415
- "type": "function"
416
- },
417
- {
418
- "inputs": [],
419
- "name": "uriLocked",
420
- "outputs": [{ "internalType": "bool", "name": "", "type": "bool" }],
421
- "stateMutability": "view",
422
- "type": "function"
423
- }
424
- ]