ethereum-hooks 2.0.0 → 2.0.2
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.
- package/README.md +59 -33
- package/crypto_hooks/ens/index.ts +5 -0
- package/crypto_hooks/ens/{useFetchAddressENSLookup.ts → useAddressENSLookup.ts} +1 -1
- package/crypto_hooks/ens/{useFetchENSAddressLookup.ts → useENSAddressLookup.ts} +1 -1
- package/crypto_hooks/ens/{useFetchENSIDLookup.ts → useENSIDLookup.ts} +1 -1
- package/crypto_hooks/ens/{useFetchENSNameLookup.ts → useENSNameLookup.ts} +1 -1
- package/crypto_hooks/erc20Tokens/index.ts +6 -0
- package/crypto_hooks/erc20Tokens/{useFetchERC20CollectionOwners.ts → useERC20CollectionOwners.ts} +1 -1
- package/crypto_hooks/erc20Tokens/{useFetchERC20CollectionTopCoins.ts → useERC20CollectionTopCoins.ts} +1 -1
- package/crypto_hooks/erc20Tokens/{useFetchERC20CollectionTransfers.ts → useERC20CollectionTransfers.ts} +1 -1
- package/crypto_hooks/erc20Tokens/{useFetchERC20Holdings.ts → useERC20Holdings.ts} +1 -1
- package/crypto_hooks/erc20Tokens/{useFetchERC20Transfers.ts → useERC20Transfers.ts} +1 -1
- package/crypto_hooks/erc721Tokens/index.ts +17 -0
- package/crypto_hooks/erc721Tokens/{useFetchERC721CollectionAttributes.ts → useERC721CollectionAttributes.ts} +1 -1
- package/crypto_hooks/erc721Tokens/{useFetchERC721CollectionData.ts → useERC721CollectionData.ts} +1 -1
- package/crypto_hooks/erc721Tokens/{useFetchERC721CollectionExtraData.ts → useERC721CollectionExtraData.ts} +1 -1
- package/crypto_hooks/erc721Tokens/{useFetchERC721CollectionFloorPrice.ts → useERC721CollectionFloorPrice.ts} +1 -1
- package/crypto_hooks/erc721Tokens/{useFetchERC721CollectionMarketCap.ts → useERC721CollectionMarketCap.ts} +1 -1
- package/crypto_hooks/erc721Tokens/{useFetchERC721CollectionSales.ts → useERC721CollectionSales.ts} +1 -1
- package/crypto_hooks/erc721Tokens/{useFetchERC721CollectionTransfers.ts → useERC721CollectionTransfers.ts} +1 -1
- package/crypto_hooks/erc721Tokens/{useFetchERC721CollectionTrends.ts → useERC721CollectionTrends.ts} +1 -1
- package/crypto_hooks/erc721Tokens/{useFetchERC721CollectionVolume.ts → useERC721CollectionVolume.ts} +1 -1
- package/crypto_hooks/erc721Tokens/{useFetchERC721Holdings.ts → useERC721Holdings.ts} +1 -1
- package/crypto_hooks/erc721Tokens/{useFetchERC721LookupData.ts → useERC721LookupData.ts} +1 -1
- package/crypto_hooks/erc721Tokens/{useFetchERC721OpenseaData.ts → useERC721OpenseaData.ts} +1 -1
- package/crypto_hooks/erc721Tokens/{useFetchERC721RarityData.ts → useERC721RarityData.ts} +1 -1
- package/crypto_hooks/erc721Tokens/{useFetchERC721SalesData.ts → useERC721SalesData.ts} +1 -1
- package/crypto_hooks/erc721Tokens/{useFetchERC721TransferLookupData.ts → useERC721TransferLookupData.ts} +1 -1
- package/crypto_hooks/erc721Tokens/{useFetchERC721TransfersData.ts → useERC721TransfersData.ts} +1 -1
- package/crypto_hooks/gas/index.ts +2 -0
- package/crypto_hooks/gas/{useFetchGasLookup.ts → useGasLookup.ts} +1 -1
- package/crypto_hooks/prices/index.ts +5 -0
- package/crypto_hooks/prices/{useFetchERC20Price.ts → useERC20Price.ts} +1 -1
- package/crypto_hooks/prices/{useFetchERC721Price.ts → useERC721Price.ts} +1 -1
- package/crypto_hooks/prices/{useFetchETHPrice.ts → useETHPrice.ts} +1 -1
- package/crypto_hooks/prices/{useFetchLayerTwoPrice.ts → useLayerTwoPrice.ts} +1 -1
- package/package.json +34 -5
- package/crypto_hooks/index.ts +0 -39
package/README.md
CHANGED
|
@@ -28,23 +28,49 @@ No backend setup or environment variables are required on your end.
|
|
|
28
28
|
|
|
29
29
|
## React Client Hooks
|
|
30
30
|
|
|
31
|
-
The hooks cover several areas of the Ethereum blockchain and can be used for Layer Two chains as well.
|
|
31
|
+
The hooks cover several areas of the Ethereum blockchain and can be used for Layer Two chains as well.
|
|
32
32
|
|
|
33
33
|
Each hook automatically connects to its dedicated AWS Lambda endpoint - no manual URL configuration is needed.
|
|
34
34
|
|
|
35
|
+
### Import Structure (v2.0.2+)
|
|
36
|
+
|
|
37
|
+
Starting with version 2.0.2, hooks are organized into grouped imports for better organization:
|
|
38
|
+
|
|
39
|
+
```javascript
|
|
40
|
+
// ENS Hooks
|
|
41
|
+
import { useAddressENSLookup, useENSNameLookup, useENSAddressLookup, useENSIDLookup } from 'ethereum-hooks/ens';
|
|
42
|
+
|
|
43
|
+
// ERC20 Token Hooks
|
|
44
|
+
import { useERC20Holdings, useERC20Transfers, useERC20CollectionOwners } from 'ethereum-hooks/erc20';
|
|
45
|
+
|
|
46
|
+
// ERC721 Token Hooks
|
|
47
|
+
import { useERC721CollectionData, useERC721Holdings, useERC721LookupData } from 'ethereum-hooks/erc721';
|
|
48
|
+
|
|
49
|
+
// Gas Hooks
|
|
50
|
+
import { useGasLookup } from 'ethereum-hooks/gas';
|
|
51
|
+
|
|
52
|
+
// Price Hooks
|
|
53
|
+
import { useETHPrice, useERC20Price, useERC721Price, useLayerTwoPrice } from 'ethereum-hooks/prices';
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
This structured approach makes it easier to:
|
|
57
|
+
- Import only what you need
|
|
58
|
+
- Understand which category each hook belongs to
|
|
59
|
+
- Maintain cleaner import statements
|
|
60
|
+
|
|
35
61
|
Here is a quick example of how you can work with client hooks. The following is a code snippet for working with React.js:
|
|
36
62
|
|
|
37
63
|
<code>ENSToAddressPage.tsx</code>
|
|
38
64
|
```javascript
|
|
39
65
|
import React, { FC } from 'react';
|
|
40
|
-
import {
|
|
66
|
+
import { useENSAddressLookup } from 'ethereum-hooks/ens';
|
|
41
67
|
|
|
42
68
|
// Incorporating the ENS to Address Client Hook.. using Vitalik Buterin's address
|
|
43
69
|
// No server setup required - connects directly to AWS Lambda
|
|
44
70
|
|
|
45
71
|
const ENSToAddressPage: FC = () => {
|
|
46
72
|
// Hook automatically connects to AWS Lambda - no server setup required
|
|
47
|
-
const addressInformation =
|
|
73
|
+
const addressInformation = useENSAddressLookup('vitalik.eth');
|
|
48
74
|
|
|
49
75
|
// Each client hook uses the useFetch custom hook
|
|
50
76
|
// It returns three states: data, error, loading
|
|
@@ -94,181 +120,181 @@ The following table shows the **30 different client hooks** and their correspond
|
|
|
94
120
|
</tr>
|
|
95
121
|
<tr>
|
|
96
122
|
<td>ENS</td>
|
|
97
|
-
<td><code>
|
|
123
|
+
<td><code>useAddressENSLookup(address: string)</code></td>
|
|
98
124
|
<td><code>https://37zq2u4ntbygkw7inki3djjm440xctyd.lambda-url.us-east-1.on.aws/</code></td>
|
|
99
125
|
<td>Fetch the equivalent ENS name from a given address</td>
|
|
100
126
|
</tr>
|
|
101
127
|
<tr>
|
|
102
128
|
<td>ENS</td>
|
|
103
|
-
<td><code>
|
|
129
|
+
<td><code>useENSAddressLookup(ensName: string)</code></td>
|
|
104
130
|
<td><code>https://jy3upsy3rgbengcktqlqfcwyhy0wcamb.lambda-url.us-east-1.on.aws/</code></td>
|
|
105
131
|
<td>Fetch the equivalent ETH address from a given ENS name</td>
|
|
106
132
|
</tr>
|
|
107
133
|
<tr>
|
|
108
134
|
<td>ENS</td>
|
|
109
|
-
<td><code>
|
|
135
|
+
<td><code>useENSIDLookup(id: string)</code></td>
|
|
110
136
|
<td><code>https://ev6i3gsesgdvj7ouxiwpg4qafu0nfvdw.lambda-url.us-east-1.on.aws/</code></td>
|
|
111
137
|
<td>Fetch information of a given ENS ID</td>
|
|
112
138
|
</tr>
|
|
113
139
|
<tr>
|
|
114
140
|
<td>ENS</td>
|
|
115
|
-
<td><code>
|
|
141
|
+
<td><code>useENSNameLookup(ensName: string)</code></td>
|
|
116
142
|
<td><code>https://f53actwgpl2a3rk6uynoryuoxq0eifuo.lambda-url.us-east-1.on.aws/</code></td>
|
|
117
143
|
<td>Fetch information of a given ENS name</td>
|
|
118
144
|
</tr>
|
|
119
145
|
<tr>
|
|
120
146
|
<td>ERC20</td>
|
|
121
|
-
<td><code>
|
|
147
|
+
<td><code>useERC20CollectionOwners(contractAddress: string)</code></td>
|
|
122
148
|
<td><code>https://hyrbuxy6aivjqjrgtogd3nx5we0gcxjr.lambda-url.us-east-1.on.aws/</code></td>
|
|
123
149
|
<td>Fetch list of owners of a particular ERC20 collection</td>
|
|
124
150
|
</tr>
|
|
125
151
|
<tr>
|
|
126
152
|
<td>ERC20</td>
|
|
127
|
-
<td><code>
|
|
153
|
+
<td><code>useERC20CollectionTopCoins()</code></td>
|
|
128
154
|
<td><code>https://2ebpropr2dgzqicposkbrvr5nq0ofyyx.lambda-url.us-east-1.on.aws/</code></td>
|
|
129
155
|
<td>Fetch list of the top ERC20 collections</td>
|
|
130
156
|
</tr>
|
|
131
157
|
<tr>
|
|
132
158
|
<td>ERC20</td>
|
|
133
|
-
<td><code>
|
|
159
|
+
<td><code>useERC20CollectionTransfers(contractAddress: string)</code></td>
|
|
134
160
|
<td><code>https://bwqre7ze2vm3sum5avrvwzwbrm0gyxcy.lambda-url.us-east-1.on.aws/</code></td>
|
|
135
161
|
<td>Fetch transfer activity of a particular ERC20 collection</td>
|
|
136
162
|
</tr>
|
|
137
163
|
<tr>
|
|
138
164
|
<td>ERC20</td>
|
|
139
|
-
<td><code>
|
|
165
|
+
<td><code>useERC20Holdings(contractAddress: string)</code></td>
|
|
140
166
|
<td><code>https://2i2neqclwlgygwimhbzlhdtjwa0dupee.lambda-url.us-east-1.on.aws/</code></td>
|
|
141
167
|
<td>Track wallet holdings of a particular ERC20 token activity</td>
|
|
142
168
|
</tr>
|
|
143
169
|
<tr>
|
|
144
170
|
<td>ERC20</td>
|
|
145
|
-
<td><code>
|
|
171
|
+
<td><code>useERC20Transfers(contractAddress: string)</code></td>
|
|
146
172
|
<td><code>https://msee4ccresifmjhm3mdedry3ki0xvdgx.lambda-url.us-east-1.on.aws/</code></td>
|
|
147
173
|
<td>Track the transfer activity of a particular ERC20 token in a wallet</td>
|
|
148
174
|
</tr>
|
|
149
175
|
<tr>
|
|
150
176
|
<td>ERC721</td>
|
|
151
|
-
<td><code>
|
|
177
|
+
<td><code>useERC721CollectionAttributes(contractAddress: string)</code></td>
|
|
152
178
|
<td><code>https://7rs4acgso6ld44zjpl25jras3q0szvag.lambda-url.us-east-1.on.aws/</code></td>
|
|
153
179
|
<td>Fetch attributes of a particular ERC721 collection</td>
|
|
154
180
|
</tr>
|
|
155
181
|
<tr>
|
|
156
182
|
<td>ERC721</td>
|
|
157
|
-
<td><code>
|
|
183
|
+
<td><code>useERC721CollectionData(contractAddress: string)</code></td>
|
|
158
184
|
<td><code>https://u2pdhfz4qbfkkyp6z4yg4n57hq0hzica.lambda-url.us-east-1.on.aws/</code></td>
|
|
159
185
|
<td>Fetch data of a particular ERC721 collection</td>
|
|
160
186
|
</tr>
|
|
161
187
|
<tr>
|
|
162
188
|
<td>ERC721</td>
|
|
163
|
-
<td><code>
|
|
189
|
+
<td><code>useERC721CollectionExtraData(contractAddress: string)</code></td>
|
|
164
190
|
<td><code>https://b5mkshxv54bbj4d54rxze5cj6q0xhptc.lambda-url.us-east-1.on.aws/</code></td>
|
|
165
191
|
<td>Fetch extra data of a particular ERC721 collection</td>
|
|
166
192
|
</tr>
|
|
167
193
|
<tr>
|
|
168
194
|
<td>ERC721</td>
|
|
169
|
-
<td><code>
|
|
195
|
+
<td><code>useERC721CollectionFloorPrice(contractAddress: string)</code></td>
|
|
170
196
|
<td><code>https://343rc276twphsdjwtzrzjytepu0xdxxn.lambda-url.us-east-1.on.aws/</code></td>
|
|
171
197
|
<td>Fetch floor price data of a particular ERC721 collection</td>
|
|
172
198
|
</tr>
|
|
173
199
|
<tr>
|
|
174
200
|
<td>ERC721</td>
|
|
175
|
-
<td><code>
|
|
201
|
+
<td><code>useERC721CollectionMarketCap(contractAddress: string, duration: 2 | 14 | 30)</code></td>
|
|
176
202
|
<td><code>https://o5ntejtug7ixeetoqf5uxjpwgq0mbtvt.lambda-url.us-east-1.on.aws/</code></td>
|
|
177
203
|
<td>Fetch market cap data of a particular ERC721 collection</td>
|
|
178
204
|
</tr>
|
|
179
205
|
<tr>
|
|
180
206
|
<td>ERC721</td>
|
|
181
|
-
<td><code>
|
|
207
|
+
<td><code>useERC721CollectionSales(contractAddress: string)</code></td>
|
|
182
208
|
<td><code>https://b5xcn2afinyiq32izaoxe4mzua0ggxvm.lambda-url.us-east-1.on.aws/</code></td>
|
|
183
209
|
<td>Fetch sales data of a particular ERC721 collection</td>
|
|
184
210
|
</tr>
|
|
185
211
|
<tr>
|
|
186
212
|
<td>ERC721</td>
|
|
187
|
-
<td><code>
|
|
213
|
+
<td><code>useERC721CollectionTransfers(contractAddress: string)</code></td>
|
|
188
214
|
<td><code>https://lrtnsabh6hkimp4hqonw3foi2e0zzuxq.lambda-url.us-east-1.on.aws/</code></td>
|
|
189
215
|
<td>Fetch transfer activity of a particular ERC721 collection</td>
|
|
190
216
|
</tr>
|
|
191
217
|
<tr>
|
|
192
218
|
<td>ERC721</td>
|
|
193
|
-
<td><code>
|
|
219
|
+
<td><code>useERC721CollectionTrends()</code></td>
|
|
194
220
|
<td><code>https://hmzkjpwut4bwaeovhryd6hie540fwvzi.lambda-url.us-east-1.on.aws/</code></td>
|
|
195
221
|
<td>Fetch trending ERC721 collection data</td>
|
|
196
222
|
</tr>
|
|
197
223
|
<tr>
|
|
198
224
|
<td>ERC721</td>
|
|
199
|
-
<td><code>
|
|
225
|
+
<td><code>useERC721CollectionVolume()</code></td>
|
|
200
226
|
<td><code>https://zlksxwjaikudsub4rmcc5c4eme0uqntg.lambda-url.us-east-1.on.aws/</code></td>
|
|
201
227
|
<td>Fetch ERC721 collections by volume data</td>
|
|
202
228
|
</tr>
|
|
203
229
|
<tr>
|
|
204
230
|
<td>ERC721</td>
|
|
205
|
-
<td><code>
|
|
231
|
+
<td><code>useERC721Holdings(walletAddress: string)</code></td>
|
|
206
232
|
<td><code>https://rmepnjzubrgdsvmb66kdwz5upm0khfor.lambda-url.us-east-1.on.aws/</code></td>
|
|
207
233
|
<td>Fetch ERC721 holdings of a particular wallet</td>
|
|
208
234
|
</tr>
|
|
209
235
|
<tr>
|
|
210
236
|
<td>ERC721</td>
|
|
211
|
-
<td><code>
|
|
237
|
+
<td><code>useERC721LookupData(contractAddress: string, tokenID: string)</code></td>
|
|
212
238
|
<td><code>https://rd7cae6wlnx3lsiuncgjgeap5e0lkbew.lambda-url.us-east-1.on.aws/</code></td>
|
|
213
239
|
<td>Fetch data of a particular ERC721 token</td>
|
|
214
240
|
</tr>
|
|
215
241
|
<tr>
|
|
216
242
|
<td>ERC721</td>
|
|
217
|
-
<td><code>
|
|
243
|
+
<td><code>useERC721OpenseaData(contractAddress: string, tokenID: string)</code></td>
|
|
218
244
|
<td><code>https://qoeq2n767jbu5gbiiy7463d56m0cwdec.lambda-url.us-east-1.on.aws/</code></td>
|
|
219
245
|
<td>Fetch Opensea data of a particular ERC721 token</td>
|
|
220
246
|
</tr>
|
|
221
247
|
<tr>
|
|
222
248
|
<td>ERC721</td>
|
|
223
|
-
<td><code>
|
|
249
|
+
<td><code>useERC721RarityData(contractAddress: string, tokenID: string)</code></td>
|
|
224
250
|
<td><code>https://eilobcax7r4wayov2rfscraqb40rodzv.lambda-url.us-east-1.on.aws/</code></td>
|
|
225
251
|
<td>Fetch rarity data of a particular ERC721 token</td>
|
|
226
252
|
</tr>
|
|
227
253
|
<tr>
|
|
228
254
|
<td>ERC721</td>
|
|
229
|
-
<td><code>
|
|
255
|
+
<td><code>useERC721SalesData(contractAddress: string, tokenID: string)</code></td>
|
|
230
256
|
<td><code>https://nhjz6tqihl6bdt7zukf5ru7wnu0ydoqq.lambda-url.us-east-1.on.aws/</code></td>
|
|
231
257
|
<td>Fetch sales data of a particular ERC721 token</td>
|
|
232
258
|
</tr>
|
|
233
259
|
<tr>
|
|
234
260
|
<td>ERC721</td>
|
|
235
|
-
<td><code>
|
|
261
|
+
<td><code>useERC721TransferLookupData(contractAddress: string, tokenID: string)</code></td>
|
|
236
262
|
<td><code>https://o66cbw3kaufg5t3k2fl5ydazbq0tvfaz.lambda-url.us-east-1.on.aws/</code></td>
|
|
237
263
|
<td>Fetch transfer data of a particular ERC721 token</td>
|
|
238
264
|
</tr>
|
|
239
265
|
<tr>
|
|
240
266
|
<td>ERC721</td>
|
|
241
|
-
<td><code>
|
|
267
|
+
<td><code>useERC721TransfersData(walletAddress: string)</code></td>
|
|
242
268
|
<td><code>https://gnfeczsyzj4v6rsyf4zmlpv23q0uixkv.lambda-url.us-east-1.on.aws/</code></td>
|
|
243
269
|
<td>Fetch ERC721 transfer activity of a particular wallet</td>
|
|
244
270
|
</tr>
|
|
245
271
|
<tr>
|
|
246
272
|
<td>Gas</td>
|
|
247
|
-
<td><code>
|
|
273
|
+
<td><code>useGasLookup()</code></td>
|
|
248
274
|
<td><code>https://wsebjfjyi4k2kfb4mbcrcjyrqa0nwifh.lambda-url.us-east-1.on.aws/</code></td>
|
|
249
275
|
<td>Fetch gas information related to Ethereum or a supported layer two</td>
|
|
250
276
|
</tr>
|
|
251
277
|
<tr>
|
|
252
278
|
<td>Prices</td>
|
|
253
|
-
<td><code>
|
|
279
|
+
<td><code>useERC20Price(contractAddress: string, currentPrice: boolean, duration: 2 | 14 | 30)</code></td>
|
|
254
280
|
<td><code>https://vw5caqjd3yg2oyslxcyxkln2dy0nqgxz.lambda-url.us-east-1.on.aws/</code></td>
|
|
255
281
|
<td>Fetch pricing data of a particular ERC20 collection</td>
|
|
256
282
|
</tr>
|
|
257
283
|
<tr>
|
|
258
284
|
<td>Prices</td>
|
|
259
|
-
<td><code>
|
|
285
|
+
<td><code>useERC721Price(contractAddress: string, tokenID: string)</code></td>
|
|
260
286
|
<td><code>https://brjvjnlp35ln3solbquo6fiize0bnwje.lambda-url.us-east-1.on.aws/</code></td>
|
|
261
287
|
<td>Fetch pricing data of a particular ERC721 collection</td>
|
|
262
288
|
</tr>
|
|
263
289
|
<tr>
|
|
264
290
|
<td>Prices</td>
|
|
265
|
-
<td><code>
|
|
291
|
+
<td><code>useETHPrice(currentPrice: boolean, duration: 2 | 14 | 30)</code></td>
|
|
266
292
|
<td><code>https://fl5mxvcm42g3n7wtodnxq52s2a0jeokj.lambda-url.us-east-1.on.aws/</code></td>
|
|
267
293
|
<td>Fetch Ethereum price data</td>
|
|
268
294
|
</tr>
|
|
269
295
|
<tr>
|
|
270
296
|
<td>Prices</td>
|
|
271
|
-
<td><code>
|
|
297
|
+
<td><code>useLayerTwoPrice(layerTwo: LayerTwoNetworks, currentPrice: boolean, duration: 2 | 14 | 30)</code></td>
|
|
272
298
|
<td><code>https://jt7ds5ua6iix7cpa5ueg2ud2gi0joklo.lambda-url.us-east-1.on.aws/</code></td>
|
|
273
299
|
<td>Fetch Layer Two price data</td>
|
|
274
300
|
</tr>
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching Address to ENS Custom hook
|
|
4
|
-
export const
|
|
4
|
+
export const useAddressENSLookup = (address: string) => {
|
|
5
5
|
const options = {
|
|
6
6
|
method: 'POST',
|
|
7
7
|
body: JSON.stringify({ address }),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ENS to Address Custom hook
|
|
4
|
-
export const
|
|
4
|
+
export const useENSAddressLookup = (ensName: string) => {
|
|
5
5
|
const options = {
|
|
6
6
|
method: 'POST',
|
|
7
7
|
body: JSON.stringify({ ensName }),
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
// ERC20 Token Hooks
|
|
2
|
+
export { useERC20CollectionOwners } from './useERC20CollectionOwners';
|
|
3
|
+
export { useERC20CollectionTopCoins } from './useERC20CollectionTopCoins';
|
|
4
|
+
export { useERC20CollectionTransfers } from './useERC20CollectionTransfers';
|
|
5
|
+
export { useERC20Holdings } from './useERC20Holdings';
|
|
6
|
+
export { useERC20Transfers } from './useERC20Transfers';
|
package/crypto_hooks/erc20Tokens/{useFetchERC20CollectionOwners.ts → useERC20CollectionOwners.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC20 Collection Owners Hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC20CollectionOwners = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC20 Collection Top Coins
|
|
4
|
-
export const
|
|
4
|
+
export const useERC20CollectionTopCoins = async () => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC20 Collection Transfers
|
|
4
|
-
export const
|
|
4
|
+
export const useERC20CollectionTransfers = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC20 Collection Holdings
|
|
4
|
-
export const
|
|
4
|
+
export const useERC20Holdings = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC20 Collection Transfers
|
|
4
|
-
export const
|
|
4
|
+
export const useERC20Transfers = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// ERC721 Token Hooks
|
|
2
|
+
export { useERC721CollectionAttributes } from './useERC721CollectionAttributes';
|
|
3
|
+
export { useERC721CollectionData } from './useERC721CollectionData';
|
|
4
|
+
export { useERC721CollectionExtraData } from './useERC721CollectionExtraData';
|
|
5
|
+
export { useERC721CollectionFloorPrice } from './useERC721CollectionFloorPrice';
|
|
6
|
+
export { useERC721CollectionMarketCap } from './useERC721CollectionMarketCap';
|
|
7
|
+
export { useERC721CollectionSales } from './useERC721CollectionSales';
|
|
8
|
+
export { useERC721CollectionTransfers } from './useERC721CollectionTransfers';
|
|
9
|
+
export { useERC721CollectionTrends } from './useERC721CollectionTrends';
|
|
10
|
+
export { useERC721CollectionVolume } from './useERC721CollectionVolume';
|
|
11
|
+
export { useERC721Holdings } from './useERC721Holdings';
|
|
12
|
+
export { useERC721LookupData } from './useERC721LookupData';
|
|
13
|
+
export { useERC721OpenseaData } from './useERC721OpenseaData';
|
|
14
|
+
export { useERC721RarityData } from './useERC721RarityData';
|
|
15
|
+
export { useERC721SalesData } from './useERC721SalesData';
|
|
16
|
+
export { useERC721TransferLookupData } from './useERC721TransferLookupData';
|
|
17
|
+
export { useERC721TransfersData } from './useERC721TransfersData';
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Collection Attributes Hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721CollectionAttributes = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
package/crypto_hooks/erc721Tokens/{useFetchERC721CollectionData.ts → useERC721CollectionData.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Collection Data Hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721CollectionData = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Collection Data Hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721CollectionExtraData = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Collection Floor Price Hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721CollectionFloorPrice = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Collection Market Cap Hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721CollectionMarketCap = async (contractAddress: string, duration: 2 | 14 | 30) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
package/crypto_hooks/erc721Tokens/{useFetchERC721CollectionSales.ts → useERC721CollectionSales.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Collection Sales Hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721CollectionSales = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Collection Transfers Hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721CollectionTransfers = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
package/crypto_hooks/erc721Tokens/{useFetchERC721CollectionTrends.ts → useERC721CollectionTrends.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Collection Trends Hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721CollectionTrends = async () => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
package/crypto_hooks/erc721Tokens/{useFetchERC721CollectionVolume.ts → useERC721CollectionVolume.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Collection Volume Hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721CollectionVolume = async () => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Holdings hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721Holdings = async (walletAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Lookup Data hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721LookupData = async (contractAddress: string, tokenID: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Opensea data hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721OpenseaData = async (contractAddress: string, tokenID: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Rarity data hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721RarityData = async (contractAddress: string, tokenID: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Sales data hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721SalesData = async (contractAddress: string, tokenID: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Transfer Lookup data hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721TransferLookupData = async (contractAddress: string, tokenID: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
package/crypto_hooks/erc721Tokens/{useFetchERC721TransfersData.ts → useERC721TransfersData.ts}
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Transfer data hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721TransfersData = async (walletAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC20 Prices Hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC20Price = async (contractAddress: string, currentPrice: boolean, duration: 2 | 14 | 30) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Prices Hook
|
|
4
|
-
export const
|
|
4
|
+
export const useERC721Price = async (contractAddress: string, tokenID: number) => {
|
|
5
5
|
// Set options for request
|
|
6
6
|
let options = {
|
|
7
7
|
method: 'POST',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ETH Prices Hook
|
|
4
|
-
export const
|
|
4
|
+
export const useETHPrice = async (currentPrice: boolean, duration: 2 | 14 | 30) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -2,7 +2,7 @@ import { LayerTwoNetworks } from "../../types/LayerTwoType";
|
|
|
2
2
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
3
3
|
|
|
4
4
|
// Fetching Layer Two Prices Hook
|
|
5
|
-
export const
|
|
5
|
+
export const useLayerTwoPrice = async (layerTwo: LayerTwoNetworks, currentPrice: boolean, duration: 2 | 14 | 30) => {
|
|
6
6
|
|
|
7
7
|
// Set options for request
|
|
8
8
|
let options = {
|
package/package.json
CHANGED
|
@@ -1,17 +1,42 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ethereum-hooks",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.2",
|
|
4
4
|
"description": "Resourceful NPM package that contains React hooks for working with the Ethereum Blockchain.",
|
|
5
|
-
"
|
|
6
|
-
|
|
5
|
+
"exports": {
|
|
6
|
+
"./ens": {
|
|
7
|
+
"import": "./crypto_hooks/ens/index.js",
|
|
8
|
+
"require": "./crypto_hooks/ens/index.js",
|
|
9
|
+
"types": "./crypto_hooks/ens/index.d.ts"
|
|
10
|
+
},
|
|
11
|
+
"./erc20": {
|
|
12
|
+
"import": "./crypto_hooks/erc20Tokens/index.js",
|
|
13
|
+
"require": "./crypto_hooks/erc20Tokens/index.js",
|
|
14
|
+
"types": "./crypto_hooks/erc20Tokens/index.d.ts"
|
|
15
|
+
},
|
|
16
|
+
"./erc721": {
|
|
17
|
+
"import": "./crypto_hooks/erc721Tokens/index.js",
|
|
18
|
+
"require": "./crypto_hooks/erc721Tokens/index.js",
|
|
19
|
+
"types": "./crypto_hooks/erc721Tokens/index.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./gas": {
|
|
22
|
+
"import": "./crypto_hooks/gas/index.js",
|
|
23
|
+
"require": "./crypto_hooks/gas/index.js",
|
|
24
|
+
"types": "./crypto_hooks/gas/index.d.ts"
|
|
25
|
+
},
|
|
26
|
+
"./prices": {
|
|
27
|
+
"import": "./crypto_hooks/prices/index.js",
|
|
28
|
+
"require": "./crypto_hooks/prices/index.js",
|
|
29
|
+
"types": "./crypto_hooks/prices/index.d.ts"
|
|
30
|
+
}
|
|
31
|
+
},
|
|
7
32
|
"repository": {
|
|
8
33
|
"type": "git",
|
|
9
34
|
"url": "https://github.com/CodingAbdullah/ethereum-hooks.git"
|
|
10
35
|
},
|
|
11
36
|
"keywords": [
|
|
37
|
+
"aws",
|
|
12
38
|
"api",
|
|
13
39
|
"blockchain",
|
|
14
|
-
"data",
|
|
15
40
|
"ethereum",
|
|
16
41
|
"hooks",
|
|
17
42
|
"reactjs",
|
|
@@ -21,7 +46,11 @@
|
|
|
21
46
|
"license": "MIT",
|
|
22
47
|
"private": false,
|
|
23
48
|
"files": [
|
|
24
|
-
"crypto_hooks/**/*",
|
|
49
|
+
"crypto_hooks/ens/**/*",
|
|
50
|
+
"crypto_hooks/erc20Tokens/**/*",
|
|
51
|
+
"crypto_hooks/erc721Tokens/**/*",
|
|
52
|
+
"crypto_hooks/gas/**/*",
|
|
53
|
+
"crypto_hooks/prices/**/*",
|
|
25
54
|
"custom_hooks/**/*",
|
|
26
55
|
"types/**/*"
|
|
27
56
|
],
|
package/crypto_hooks/index.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
// ENS Hooks
|
|
2
|
-
export { useFetchAddressENSLookup } from './ens/useFetchAddressENSLookup';
|
|
3
|
-
export { useFetchENSAddressLookup } from './ens/useFetchENSAddressLookup';
|
|
4
|
-
export { useFetchENSIDLookup } from './ens/useFetchENSIDLookup';
|
|
5
|
-
export { useFetchENSNameLookup } from './ens/useFetchENSNameLookup';
|
|
6
|
-
|
|
7
|
-
// ERC20 Token Hooks
|
|
8
|
-
export { useFetchERC20CollectionOwners } from './erc20Tokens/useFetchERC20CollectionOwners';
|
|
9
|
-
export { useFetchERC20CollectionTopCoins } from './erc20Tokens/useFetchERC20CollectionTopCoins';
|
|
10
|
-
export { useFetchERC20CollectionTransfers } from './erc20Tokens/useFetchERC20CollectionTransfers';
|
|
11
|
-
export { useFetchERC20Holdings } from './erc20Tokens/useFetchERC20Holdings';
|
|
12
|
-
export { useFetchERC20Transfers } from './erc20Tokens/useFetchERC20Transfers';
|
|
13
|
-
|
|
14
|
-
// ERC721 Token Hooks
|
|
15
|
-
export { useFetchERC721CollectionAttributes } from './erc721Tokens/useFetchERC721CollectionAttributes';
|
|
16
|
-
export { useFetchERC721CollectionData } from './erc721Tokens/useFetchERC721CollectionData';
|
|
17
|
-
export { useFetchERC721CollectionExtraData } from './erc721Tokens/useFetchERC721CollectionExtraData';
|
|
18
|
-
export { useFetchERC721CollectionFloorPrice } from './erc721Tokens/useFetchERC721CollectionFloorPrice';
|
|
19
|
-
export { useFetchERC721CollectionMarketCap } from './erc721Tokens/useFetchERC721CollectionMarketCap';
|
|
20
|
-
export { useFetchERC721CollectionSales } from './erc721Tokens/useFetchERC721CollectionSales';
|
|
21
|
-
export { useFetchERC721CollectionTransfers } from './erc721Tokens/useFetchERC721CollectionTransfers';
|
|
22
|
-
export { useFetchERC721CollectionTrends } from './erc721Tokens/useFetchERC721CollectionTrends';
|
|
23
|
-
export { useFetchERC721CollectionVolume } from './erc721Tokens/useFetchERC721CollectionVolume';
|
|
24
|
-
export { useFetchERC721Holdings } from './erc721Tokens/useFetchERC721Holdings';
|
|
25
|
-
export { useFetchERC721LookupData } from './erc721Tokens/useFetchERC721LookupData';
|
|
26
|
-
export { useFetchERC721OpenseaData } from './erc721Tokens/useFetchERC721OpenseaData';
|
|
27
|
-
export { useFetchERC721RarityData } from './erc721Tokens/useFetchERC721RarityData';
|
|
28
|
-
export { useFetchERC721SalesData } from './erc721Tokens/useFetchERC721SalesData';
|
|
29
|
-
export { useFetchERC721TransferLookupData } from './erc721Tokens/useFetchERC721TransferLookupData';
|
|
30
|
-
export { useFetchERC721TransfersData } from './erc721Tokens/useFetchERC721TransfersData';
|
|
31
|
-
|
|
32
|
-
// Gas Hooks
|
|
33
|
-
export { useFetchGasLookup } from './gas/useFetchGasLookup';
|
|
34
|
-
|
|
35
|
-
// Price Hooks
|
|
36
|
-
export { useFetchERC20Price } from './prices/useFetchERC20Price';
|
|
37
|
-
export { useFetchERC721Price } from './prices/useFetchERC721Price';
|
|
38
|
-
export { useFetchETHPrice } from './prices/useFetchETHPrice';
|
|
39
|
-
export { useFetchLayerTwoPrice } from './prices/useFetchLayerTwoPrice';
|