ethereum-hooks 2.0.0 → 2.0.1
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 +32 -32
- 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/{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/{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/{useFetchGasLookup.ts → useGasLookup.ts} +1 -1
- package/crypto_hooks/index.ts +30 -30
- 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 +2 -2
package/README.md
CHANGED
|
@@ -37,14 +37,14 @@ Here is a quick example of how you can work with client hooks. The following is
|
|
|
37
37
|
<code>ENSToAddressPage.tsx</code>
|
|
38
38
|
```javascript
|
|
39
39
|
import React, { FC } from 'react';
|
|
40
|
-
import {
|
|
40
|
+
import { useENSAddressLookup } from 'ethereum-hooks';
|
|
41
41
|
|
|
42
42
|
// Incorporating the ENS to Address Client Hook.. using Vitalik Buterin's address
|
|
43
43
|
// No server setup required - connects directly to AWS Lambda
|
|
44
44
|
|
|
45
45
|
const ENSToAddressPage: FC = () => {
|
|
46
46
|
// Hook automatically connects to AWS Lambda - no server setup required
|
|
47
|
-
const addressInformation =
|
|
47
|
+
const addressInformation = useENSAddressLookup('vitalik.eth');
|
|
48
48
|
|
|
49
49
|
// Each client hook uses the useFetch custom hook
|
|
50
50
|
// It returns three states: data, error, loading
|
|
@@ -94,181 +94,181 @@ The following table shows the **30 different client hooks** and their correspond
|
|
|
94
94
|
</tr>
|
|
95
95
|
<tr>
|
|
96
96
|
<td>ENS</td>
|
|
97
|
-
<td><code>
|
|
97
|
+
<td><code>useAddressENSLookup(address: string)</code></td>
|
|
98
98
|
<td><code>https://37zq2u4ntbygkw7inki3djjm440xctyd.lambda-url.us-east-1.on.aws/</code></td>
|
|
99
99
|
<td>Fetch the equivalent ENS name from a given address</td>
|
|
100
100
|
</tr>
|
|
101
101
|
<tr>
|
|
102
102
|
<td>ENS</td>
|
|
103
|
-
<td><code>
|
|
103
|
+
<td><code>useENSAddressLookup(ensName: string)</code></td>
|
|
104
104
|
<td><code>https://jy3upsy3rgbengcktqlqfcwyhy0wcamb.lambda-url.us-east-1.on.aws/</code></td>
|
|
105
105
|
<td>Fetch the equivalent ETH address from a given ENS name</td>
|
|
106
106
|
</tr>
|
|
107
107
|
<tr>
|
|
108
108
|
<td>ENS</td>
|
|
109
|
-
<td><code>
|
|
109
|
+
<td><code>useENSIDLookup(id: string)</code></td>
|
|
110
110
|
<td><code>https://ev6i3gsesgdvj7ouxiwpg4qafu0nfvdw.lambda-url.us-east-1.on.aws/</code></td>
|
|
111
111
|
<td>Fetch information of a given ENS ID</td>
|
|
112
112
|
</tr>
|
|
113
113
|
<tr>
|
|
114
114
|
<td>ENS</td>
|
|
115
|
-
<td><code>
|
|
115
|
+
<td><code>useENSNameLookup(ensName: string)</code></td>
|
|
116
116
|
<td><code>https://f53actwgpl2a3rk6uynoryuoxq0eifuo.lambda-url.us-east-1.on.aws/</code></td>
|
|
117
117
|
<td>Fetch information of a given ENS name</td>
|
|
118
118
|
</tr>
|
|
119
119
|
<tr>
|
|
120
120
|
<td>ERC20</td>
|
|
121
|
-
<td><code>
|
|
121
|
+
<td><code>useERC20CollectionOwners(contractAddress: string)</code></td>
|
|
122
122
|
<td><code>https://hyrbuxy6aivjqjrgtogd3nx5we0gcxjr.lambda-url.us-east-1.on.aws/</code></td>
|
|
123
123
|
<td>Fetch list of owners of a particular ERC20 collection</td>
|
|
124
124
|
</tr>
|
|
125
125
|
<tr>
|
|
126
126
|
<td>ERC20</td>
|
|
127
|
-
<td><code>
|
|
127
|
+
<td><code>useERC20CollectionTopCoins()</code></td>
|
|
128
128
|
<td><code>https://2ebpropr2dgzqicposkbrvr5nq0ofyyx.lambda-url.us-east-1.on.aws/</code></td>
|
|
129
129
|
<td>Fetch list of the top ERC20 collections</td>
|
|
130
130
|
</tr>
|
|
131
131
|
<tr>
|
|
132
132
|
<td>ERC20</td>
|
|
133
|
-
<td><code>
|
|
133
|
+
<td><code>useERC20CollectionTransfers(contractAddress: string)</code></td>
|
|
134
134
|
<td><code>https://bwqre7ze2vm3sum5avrvwzwbrm0gyxcy.lambda-url.us-east-1.on.aws/</code></td>
|
|
135
135
|
<td>Fetch transfer activity of a particular ERC20 collection</td>
|
|
136
136
|
</tr>
|
|
137
137
|
<tr>
|
|
138
138
|
<td>ERC20</td>
|
|
139
|
-
<td><code>
|
|
139
|
+
<td><code>useERC20Holdings(contractAddress: string)</code></td>
|
|
140
140
|
<td><code>https://2i2neqclwlgygwimhbzlhdtjwa0dupee.lambda-url.us-east-1.on.aws/</code></td>
|
|
141
141
|
<td>Track wallet holdings of a particular ERC20 token activity</td>
|
|
142
142
|
</tr>
|
|
143
143
|
<tr>
|
|
144
144
|
<td>ERC20</td>
|
|
145
|
-
<td><code>
|
|
145
|
+
<td><code>useERC20Transfers(contractAddress: string)</code></td>
|
|
146
146
|
<td><code>https://msee4ccresifmjhm3mdedry3ki0xvdgx.lambda-url.us-east-1.on.aws/</code></td>
|
|
147
147
|
<td>Track the transfer activity of a particular ERC20 token in a wallet</td>
|
|
148
148
|
</tr>
|
|
149
149
|
<tr>
|
|
150
150
|
<td>ERC721</td>
|
|
151
|
-
<td><code>
|
|
151
|
+
<td><code>useERC721CollectionAttributes(contractAddress: string)</code></td>
|
|
152
152
|
<td><code>https://7rs4acgso6ld44zjpl25jras3q0szvag.lambda-url.us-east-1.on.aws/</code></td>
|
|
153
153
|
<td>Fetch attributes of a particular ERC721 collection</td>
|
|
154
154
|
</tr>
|
|
155
155
|
<tr>
|
|
156
156
|
<td>ERC721</td>
|
|
157
|
-
<td><code>
|
|
157
|
+
<td><code>useERC721CollectionData(contractAddress: string)</code></td>
|
|
158
158
|
<td><code>https://u2pdhfz4qbfkkyp6z4yg4n57hq0hzica.lambda-url.us-east-1.on.aws/</code></td>
|
|
159
159
|
<td>Fetch data of a particular ERC721 collection</td>
|
|
160
160
|
</tr>
|
|
161
161
|
<tr>
|
|
162
162
|
<td>ERC721</td>
|
|
163
|
-
<td><code>
|
|
163
|
+
<td><code>useERC721CollectionExtraData(contractAddress: string)</code></td>
|
|
164
164
|
<td><code>https://b5mkshxv54bbj4d54rxze5cj6q0xhptc.lambda-url.us-east-1.on.aws/</code></td>
|
|
165
165
|
<td>Fetch extra data of a particular ERC721 collection</td>
|
|
166
166
|
</tr>
|
|
167
167
|
<tr>
|
|
168
168
|
<td>ERC721</td>
|
|
169
|
-
<td><code>
|
|
169
|
+
<td><code>useERC721CollectionFloorPrice(contractAddress: string)</code></td>
|
|
170
170
|
<td><code>https://343rc276twphsdjwtzrzjytepu0xdxxn.lambda-url.us-east-1.on.aws/</code></td>
|
|
171
171
|
<td>Fetch floor price data of a particular ERC721 collection</td>
|
|
172
172
|
</tr>
|
|
173
173
|
<tr>
|
|
174
174
|
<td>ERC721</td>
|
|
175
|
-
<td><code>
|
|
175
|
+
<td><code>useERC721CollectionMarketCap(contractAddress: string, duration: 2 | 14 | 30)</code></td>
|
|
176
176
|
<td><code>https://o5ntejtug7ixeetoqf5uxjpwgq0mbtvt.lambda-url.us-east-1.on.aws/</code></td>
|
|
177
177
|
<td>Fetch market cap data of a particular ERC721 collection</td>
|
|
178
178
|
</tr>
|
|
179
179
|
<tr>
|
|
180
180
|
<td>ERC721</td>
|
|
181
|
-
<td><code>
|
|
181
|
+
<td><code>useERC721CollectionSales(contractAddress: string)</code></td>
|
|
182
182
|
<td><code>https://b5xcn2afinyiq32izaoxe4mzua0ggxvm.lambda-url.us-east-1.on.aws/</code></td>
|
|
183
183
|
<td>Fetch sales data of a particular ERC721 collection</td>
|
|
184
184
|
</tr>
|
|
185
185
|
<tr>
|
|
186
186
|
<td>ERC721</td>
|
|
187
|
-
<td><code>
|
|
187
|
+
<td><code>useERC721CollectionTransfers(contractAddress: string)</code></td>
|
|
188
188
|
<td><code>https://lrtnsabh6hkimp4hqonw3foi2e0zzuxq.lambda-url.us-east-1.on.aws/</code></td>
|
|
189
189
|
<td>Fetch transfer activity of a particular ERC721 collection</td>
|
|
190
190
|
</tr>
|
|
191
191
|
<tr>
|
|
192
192
|
<td>ERC721</td>
|
|
193
|
-
<td><code>
|
|
193
|
+
<td><code>useERC721CollectionTrends()</code></td>
|
|
194
194
|
<td><code>https://hmzkjpwut4bwaeovhryd6hie540fwvzi.lambda-url.us-east-1.on.aws/</code></td>
|
|
195
195
|
<td>Fetch trending ERC721 collection data</td>
|
|
196
196
|
</tr>
|
|
197
197
|
<tr>
|
|
198
198
|
<td>ERC721</td>
|
|
199
|
-
<td><code>
|
|
199
|
+
<td><code>useERC721CollectionVolume()</code></td>
|
|
200
200
|
<td><code>https://zlksxwjaikudsub4rmcc5c4eme0uqntg.lambda-url.us-east-1.on.aws/</code></td>
|
|
201
201
|
<td>Fetch ERC721 collections by volume data</td>
|
|
202
202
|
</tr>
|
|
203
203
|
<tr>
|
|
204
204
|
<td>ERC721</td>
|
|
205
|
-
<td><code>
|
|
205
|
+
<td><code>useERC721Holdings(walletAddress: string)</code></td>
|
|
206
206
|
<td><code>https://rmepnjzubrgdsvmb66kdwz5upm0khfor.lambda-url.us-east-1.on.aws/</code></td>
|
|
207
207
|
<td>Fetch ERC721 holdings of a particular wallet</td>
|
|
208
208
|
</tr>
|
|
209
209
|
<tr>
|
|
210
210
|
<td>ERC721</td>
|
|
211
|
-
<td><code>
|
|
211
|
+
<td><code>useERC721LookupData(contractAddress: string, tokenID: string)</code></td>
|
|
212
212
|
<td><code>https://rd7cae6wlnx3lsiuncgjgeap5e0lkbew.lambda-url.us-east-1.on.aws/</code></td>
|
|
213
213
|
<td>Fetch data of a particular ERC721 token</td>
|
|
214
214
|
</tr>
|
|
215
215
|
<tr>
|
|
216
216
|
<td>ERC721</td>
|
|
217
|
-
<td><code>
|
|
217
|
+
<td><code>useERC721OpenseaData(contractAddress: string, tokenID: string)</code></td>
|
|
218
218
|
<td><code>https://qoeq2n767jbu5gbiiy7463d56m0cwdec.lambda-url.us-east-1.on.aws/</code></td>
|
|
219
219
|
<td>Fetch Opensea data of a particular ERC721 token</td>
|
|
220
220
|
</tr>
|
|
221
221
|
<tr>
|
|
222
222
|
<td>ERC721</td>
|
|
223
|
-
<td><code>
|
|
223
|
+
<td><code>useERC721RarityData(contractAddress: string, tokenID: string)</code></td>
|
|
224
224
|
<td><code>https://eilobcax7r4wayov2rfscraqb40rodzv.lambda-url.us-east-1.on.aws/</code></td>
|
|
225
225
|
<td>Fetch rarity data of a particular ERC721 token</td>
|
|
226
226
|
</tr>
|
|
227
227
|
<tr>
|
|
228
228
|
<td>ERC721</td>
|
|
229
|
-
<td><code>
|
|
229
|
+
<td><code>useERC721SalesData(contractAddress: string, tokenID: string)</code></td>
|
|
230
230
|
<td><code>https://nhjz6tqihl6bdt7zukf5ru7wnu0ydoqq.lambda-url.us-east-1.on.aws/</code></td>
|
|
231
231
|
<td>Fetch sales data of a particular ERC721 token</td>
|
|
232
232
|
</tr>
|
|
233
233
|
<tr>
|
|
234
234
|
<td>ERC721</td>
|
|
235
|
-
<td><code>
|
|
235
|
+
<td><code>useERC721TransferLookupData(contractAddress: string, tokenID: string)</code></td>
|
|
236
236
|
<td><code>https://o66cbw3kaufg5t3k2fl5ydazbq0tvfaz.lambda-url.us-east-1.on.aws/</code></td>
|
|
237
237
|
<td>Fetch transfer data of a particular ERC721 token</td>
|
|
238
238
|
</tr>
|
|
239
239
|
<tr>
|
|
240
240
|
<td>ERC721</td>
|
|
241
|
-
<td><code>
|
|
241
|
+
<td><code>useERC721TransfersData(walletAddress: string)</code></td>
|
|
242
242
|
<td><code>https://gnfeczsyzj4v6rsyf4zmlpv23q0uixkv.lambda-url.us-east-1.on.aws/</code></td>
|
|
243
243
|
<td>Fetch ERC721 transfer activity of a particular wallet</td>
|
|
244
244
|
</tr>
|
|
245
245
|
<tr>
|
|
246
246
|
<td>Gas</td>
|
|
247
|
-
<td><code>
|
|
247
|
+
<td><code>useGasLookup()</code></td>
|
|
248
248
|
<td><code>https://wsebjfjyi4k2kfb4mbcrcjyrqa0nwifh.lambda-url.us-east-1.on.aws/</code></td>
|
|
249
249
|
<td>Fetch gas information related to Ethereum or a supported layer two</td>
|
|
250
250
|
</tr>
|
|
251
251
|
<tr>
|
|
252
252
|
<td>Prices</td>
|
|
253
|
-
<td><code>
|
|
253
|
+
<td><code>useERC20Price(contractAddress: string, currentPrice: boolean, duration: 2 | 14 | 30)</code></td>
|
|
254
254
|
<td><code>https://vw5caqjd3yg2oyslxcyxkln2dy0nqgxz.lambda-url.us-east-1.on.aws/</code></td>
|
|
255
255
|
<td>Fetch pricing data of a particular ERC20 collection</td>
|
|
256
256
|
</tr>
|
|
257
257
|
<tr>
|
|
258
258
|
<td>Prices</td>
|
|
259
|
-
<td><code>
|
|
259
|
+
<td><code>useERC721Price(contractAddress: string, tokenID: string)</code></td>
|
|
260
260
|
<td><code>https://brjvjnlp35ln3solbquo6fiize0bnwje.lambda-url.us-east-1.on.aws/</code></td>
|
|
261
261
|
<td>Fetch pricing data of a particular ERC721 collection</td>
|
|
262
262
|
</tr>
|
|
263
263
|
<tr>
|
|
264
264
|
<td>Prices</td>
|
|
265
|
-
<td><code>
|
|
265
|
+
<td><code>useETHPrice(currentPrice: boolean, duration: 2 | 14 | 30)</code></td>
|
|
266
266
|
<td><code>https://fl5mxvcm42g3n7wtodnxq52s2a0jeokj.lambda-url.us-east-1.on.aws/</code></td>
|
|
267
267
|
<td>Fetch Ethereum price data</td>
|
|
268
268
|
</tr>
|
|
269
269
|
<tr>
|
|
270
270
|
<td>Prices</td>
|
|
271
|
-
<td><code>
|
|
271
|
+
<td><code>useLayerTwoPrice(layerTwo: LayerTwoNetworks, currentPrice: boolean, duration: 2 | 14 | 30)</code></td>
|
|
272
272
|
<td><code>https://jt7ds5ua6iix7cpa5ueg2ud2gi0joklo.lambda-url.us-east-1.on.aws/</code></td>
|
|
273
273
|
<td>Fetch Layer Two price data</td>
|
|
274
274
|
</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 }),
|
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 = {
|
|
@@ -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 = {
|
package/crypto_hooks/index.ts
CHANGED
|
@@ -1,39 +1,39 @@
|
|
|
1
1
|
// ENS Hooks
|
|
2
|
-
export {
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
2
|
+
export { useAddressENSLookup } from './ens/useAddressENSLookup';
|
|
3
|
+
export { useENSAddressLookup } from './ens/useENSAddressLookup';
|
|
4
|
+
export { useENSIDLookup } from './ens/useENSIDLookup';
|
|
5
|
+
export { useENSNameLookup } from './ens/useENSNameLookup';
|
|
6
6
|
|
|
7
7
|
// ERC20 Token Hooks
|
|
8
|
-
export {
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
11
|
-
export {
|
|
12
|
-
export {
|
|
8
|
+
export { useERC20CollectionOwners } from './erc20Tokens/useERC20CollectionOwners';
|
|
9
|
+
export { useERC20CollectionTopCoins } from './erc20Tokens/useERC20CollectionTopCoins';
|
|
10
|
+
export { useERC20CollectionTransfers } from './erc20Tokens/useERC20CollectionTransfers';
|
|
11
|
+
export { useERC20Holdings } from './erc20Tokens/useERC20Holdings';
|
|
12
|
+
export { useERC20Transfers } from './erc20Tokens/useERC20Transfers';
|
|
13
13
|
|
|
14
14
|
// ERC721 Token Hooks
|
|
15
|
-
export {
|
|
16
|
-
export {
|
|
17
|
-
export {
|
|
18
|
-
export {
|
|
19
|
-
export {
|
|
20
|
-
export {
|
|
21
|
-
export {
|
|
22
|
-
export {
|
|
23
|
-
export {
|
|
24
|
-
export {
|
|
25
|
-
export {
|
|
26
|
-
export {
|
|
27
|
-
export {
|
|
28
|
-
export {
|
|
29
|
-
export {
|
|
30
|
-
export {
|
|
15
|
+
export { useERC721CollectionAttributes } from './erc721Tokens/useERC721CollectionAttributes';
|
|
16
|
+
export { useERC721CollectionData } from './erc721Tokens/useERC721CollectionData';
|
|
17
|
+
export { useERC721CollectionExtraData } from './erc721Tokens/useERC721CollectionExtraData';
|
|
18
|
+
export { useERC721CollectionFloorPrice } from './erc721Tokens/useERC721CollectionFloorPrice';
|
|
19
|
+
export { useERC721CollectionMarketCap } from './erc721Tokens/useERC721CollectionMarketCap';
|
|
20
|
+
export { useERC721CollectionSales } from './erc721Tokens/useERC721CollectionSales';
|
|
21
|
+
export { useERC721CollectionTransfers } from './erc721Tokens/useERC721CollectionTransfers';
|
|
22
|
+
export { useERC721CollectionTrends } from './erc721Tokens/useERC721CollectionTrends';
|
|
23
|
+
export { useERC721CollectionVolume } from './erc721Tokens/useERC721CollectionVolume';
|
|
24
|
+
export { useERC721Holdings } from './erc721Tokens/useERC721Holdings';
|
|
25
|
+
export { useERC721LookupData } from './erc721Tokens/useERC721LookupData';
|
|
26
|
+
export { useERC721OpenseaData } from './erc721Tokens/useERC721OpenseaData';
|
|
27
|
+
export { useERC721RarityData } from './erc721Tokens/useERC721RarityData';
|
|
28
|
+
export { useERC721SalesData } from './erc721Tokens/useERC721SalesData';
|
|
29
|
+
export { useERC721TransferLookupData } from './erc721Tokens/useERC721TransferLookupData';
|
|
30
|
+
export { useERC721TransfersData } from './erc721Tokens/useERC721TransfersData';
|
|
31
31
|
|
|
32
32
|
// Gas Hooks
|
|
33
|
-
export {
|
|
33
|
+
export { useGasLookup } from './gas/useGasLookup';
|
|
34
34
|
|
|
35
35
|
// Price Hooks
|
|
36
|
-
export {
|
|
37
|
-
export {
|
|
38
|
-
export {
|
|
39
|
-
export {
|
|
36
|
+
export { useERC20Price } from './prices/useERC20Price';
|
|
37
|
+
export { useERC721Price } from './prices/useERC721Price';
|
|
38
|
+
export { useETHPrice } from './prices/useETHPrice';
|
|
39
|
+
export { useLayerTwoPrice } from './prices/useLayerTwoPrice';
|
|
@@ -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,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ethereum-hooks",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.1",
|
|
4
4
|
"description": "Resourceful NPM package that contains React hooks for working with the Ethereum Blockchain.",
|
|
5
5
|
"main": "crypto_hooks/index.js",
|
|
6
6
|
"types": "crypto_hooks/index.d.ts",
|
|
@@ -9,9 +9,9 @@
|
|
|
9
9
|
"url": "https://github.com/CodingAbdullah/ethereum-hooks.git"
|
|
10
10
|
},
|
|
11
11
|
"keywords": [
|
|
12
|
+
"aws",
|
|
12
13
|
"api",
|
|
13
14
|
"blockchain",
|
|
14
|
-
"data",
|
|
15
15
|
"ethereum",
|
|
16
16
|
"hooks",
|
|
17
17
|
"reactjs",
|