ethereum-hooks 1.0.1 → 2.0.0
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 +128 -61
- package/{client/src/crypto_hooks → crypto_hooks}/ens/useFetchAddressENSLookup.ts +3 -4
- package/{client/src/crypto_hooks → crypto_hooks}/ens/useFetchENSAddressLookup.ts +3 -5
- package/{client/src/crypto_hooks → crypto_hooks}/ens/useFetchENSIDLookup.ts +3 -4
- package/{client/src/crypto_hooks → crypto_hooks}/ens/useFetchENSNameLookup.ts +3 -3
- package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20CollectionOwners.ts +4 -3
- package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20CollectionTopCoins.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20CollectionTransfers.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20Holdings.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20Transfers.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionAttributes.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionData.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionExtraData.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionFloorPrice.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionMarketCap.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionSales.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionTransfers.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionTrends.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionVolume.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721Holdings.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721LookupData.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721OpenseaData.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721RarityData.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721SalesData.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721TransferLookupData.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721TransfersData.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/gas/useFetchGasLookup.ts +3 -4
- package/crypto_hooks/index.ts +39 -0
- package/{client/src/crypto_hooks → crypto_hooks}/prices/useFetchERC20Price.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/prices/useFetchERC721Price.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/prices/useFetchETHPrice.ts +3 -2
- package/{client/src/crypto_hooks → crypto_hooks}/prices/useFetchLayerTwoPrice.ts +3 -2
- package/package.json +22 -20
- package/client/package.json +0 -25
- package/hook-server-design.png +0 -0
- package/hooksinformation.txt +0 -49
- package/server/Controller/ENS/AddressToENSController.ts +0 -30
- package/server/Controller/ENS/ENSIDController.ts +0 -32
- package/server/Controller/ENS/ENSNameController.ts +0 -32
- package/server/Controller/ENS/ENSToAddressController.ts +0 -32
- package/server/Controller/ERC20Tokens/ERC20CollectionOwnersController.ts +0 -29
- package/server/Controller/ERC20Tokens/ERC20CollectionTopCoinsController.ts +0 -27
- package/server/Controller/ERC20Tokens/ERC20CollectionTransfersController.ts +0 -29
- package/server/Controller/ERC20Tokens/ERC20HoldingsController.ts +0 -29
- package/server/Controller/ERC20Tokens/ERC20TransfersController.ts +0 -29
- package/server/Controller/ERC721Tokens/ERC721CollectionAttributesController.ts +0 -29
- package/server/Controller/ERC721Tokens/ERC721CollectionDataController.ts +0 -29
- package/server/Controller/ERC721Tokens/ERC721CollectionExtraDataController.ts +0 -29
- package/server/Controller/ERC721Tokens/ERC721CollectionFloorPriceController.ts +0 -18
- package/server/Controller/ERC721Tokens/ERC721CollectionMarketCapController.ts +0 -29
- package/server/Controller/ERC721Tokens/ERC721CollectionSalesController.ts +0 -29
- package/server/Controller/ERC721Tokens/ERC721CollectionTransfersController.ts +0 -29
- package/server/Controller/ERC721Tokens/ERC721CollectionTrendsController.ts +0 -28
- package/server/Controller/ERC721Tokens/ERC721CollectionVolumeController.ts +0 -28
- package/server/Controller/ERC721Tokens/ERC721HoldingsController.ts +0 -29
- package/server/Controller/ERC721Tokens/ERC721LookupDataController.ts +0 -28
- package/server/Controller/ERC721Tokens/ERC721OpenseaDataController.ts +0 -29
- package/server/Controller/ERC721Tokens/ERC721RarityDataController.ts +0 -29
- package/server/Controller/ERC721Tokens/ERC721SalesDataController.ts +0 -34
- package/server/Controller/ERC721Tokens/ERC721TransferLookupDataController.ts +0 -28
- package/server/Controller/ERC721Tokens/ERC721TransfersDataController.ts +0 -29
- package/server/Controller/Gas/GasLookupController.ts +0 -26
- package/server/Controller/Prices/ERC20PriceController.ts +0 -43
- package/server/Controller/Prices/ERC721PriceController.ts +0 -28
- package/server/Controller/Prices/ETHPriceController.ts +0 -42
- package/server/Controller/Prices/LayerTwoPriceController.ts +0 -41
- package/server/Routes/ENSRoutes/AddressToENSRoute.ts +0 -9
- package/server/Routes/ENSRoutes/ENSIDRoute.ts +0 -8
- package/server/Routes/ENSRoutes/ENSNameRoute.ts +0 -9
- package/server/Routes/ENSRoutes/ENSToAddressRoute.ts +0 -9
- package/server/Routes/ERC20TokensRoutes/ERC20CollectionOwnersRoute.ts +0 -9
- package/server/Routes/ERC20TokensRoutes/ERC20CollectionTopCoinsRoute.ts +0 -9
- package/server/Routes/ERC20TokensRoutes/ERC20CollectionTransfersRoute.ts +0 -9
- package/server/Routes/ERC20TokensRoutes/ERC20HoldingsRoute.ts +0 -9
- package/server/Routes/ERC20TokensRoutes/ERC20TransfersRoute.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionAttributesRoutes.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionDataRoutes.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionExtraDataRoutes.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionFloorPriceRoutes.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionMarketCapRoutes.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionSalesRoutes.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionTransfersRoutes.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionTrendsRoutes.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionVolumeRoutes.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721HoldingsRoutes.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721LookupDataRoutes.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721OpenseaDataRoutes.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721RarityDataRoutes.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721SalesDataRoutes.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721TransferLookupDataRoutes.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721TransfersDataRoutes.ts +0 -9
- package/server/Routes/GasRoutes/GasLookupRoute.ts +0 -9
- package/server/Routes/PriceRoutes/ERC20PriceRoute.ts +0 -9
- package/server/Routes/PriceRoutes/ERC721PriceRoute.ts +0 -9
- package/server/Routes/PriceRoutes/ETHPriceRoute.ts +0 -9
- package/server/Routes/PriceRoutes/LayerTwoPriceRoute.ts +0 -9
- package/server/package.json +0 -25
- package/server/server.ts +0 -53
- package/server/tsconfig.json +0 -109
- /package/{client/src/custom_hooks → custom_hooks}/useFetch.ts +0 -0
- /package/{client/src/types → types}/FetchStateType.ts +0 -0
- /package/{client/src/types → types}/LayerTwoType.ts +0 -0
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# ethereum-hooks
|
|
2
|
-
|
|
2
|
+
Useful package that contains custom React hooks that can be used for rapid development while working with the Ethereum blockchain.
|
|
3
|
+
|
|
4
|
+
These hooks make use of various crypto APIs (free versions only) and save developer time by taking away the need for manual configuration and setup.
|
|
5
|
+
|
|
6
|
+
The following resources were utilized when building these client hooks:
|
|
3
7
|
|
|
4
8
|
- <a href="https://docs.alchemy.com/reference/api-overview">Alchemy</a>
|
|
5
9
|
- <a href="https://docs.blocknative.com/">Blocknative</a>
|
|
@@ -10,199 +14,262 @@ A package containing useful hooks for working with the Ethereum blockchain using
|
|
|
10
14
|
|
|
11
15
|
<br />
|
|
12
16
|
|
|
13
|
-
## React Hooks
|
|
14
|
-
|
|
17
|
+
## React Hooks
|
|
18
|
+
This package uses AWS Lambda functions to construct authenticated API calls. The architecture follows a simple flow: **Client Hook → useFetch → AWS Lambda → Response**.
|
|
15
19
|
|
|
16
|
-
|
|
20
|
+
The AWS Lambda functions handle authentication automatically using pre-configured API keys for various blockchain services:
|
|
21
|
+
- **OPENSEA_API_KEY** - For NFT marketplace data
|
|
22
|
+
- **MORALIS_API_KEY** - For Web3 data aggregation
|
|
23
|
+
- **BLK_API_KEY** - For Blocknative gas and mempool data
|
|
24
|
+
- **TRANSPOSE_API_KEY** - For indexed blockchain data
|
|
25
|
+
- **ALCHEMY_API_KEY** - For Ethereum node access and enhanced APIs
|
|
17
26
|
|
|
18
|
-
|
|
19
|
-
- <code>BLK_API_KEY</code>
|
|
20
|
-
- <code>CLIENT_PORT</code>
|
|
21
|
-
- <code>COINGECKO_API_KEY</code>
|
|
22
|
-
- <code>MORALIS_API_KEY</code>
|
|
23
|
-
- <code>OPENSEA_API_KEY</code>
|
|
24
|
-
- <code>PORT</code>
|
|
25
|
-
- <code>TRANSPOSE_API_KEY</code>
|
|
27
|
+
No backend setup or environment variables are required on your end.
|
|
26
28
|
|
|
27
|
-
|
|
29
|
+
## React Client Hooks
|
|
28
30
|
|
|
29
|
-
|
|
31
|
+
The hooks cover several areas of the Ethereum blockchain and can be used for Layer Two chains as well.
|
|
30
32
|
|
|
31
|
-
|
|
33
|
+
Each hook automatically connects to its dedicated AWS Lambda endpoint - no manual URL configuration is needed.
|
|
32
34
|
|
|
33
|
-
|
|
34
|
-
- <a href="https://www.npmjs.com/package/ethereum-hooks">Ethereum Hooks</a>
|
|
35
|
+
Here is a quick example of how you can work with client hooks. The following is a code snippet for working with React.js:
|
|
35
36
|
|
|
36
|
-
<
|
|
37
|
+
<code>ENSToAddressPage.tsx</code>
|
|
38
|
+
```javascript
|
|
39
|
+
import React, { FC } from 'react';
|
|
40
|
+
import { useFetchENSAddressLookup } from 'ethereum-hooks';
|
|
37
41
|
|
|
38
|
-
|
|
42
|
+
// Incorporating the ENS to Address Client Hook.. using Vitalik Buterin's address
|
|
43
|
+
// No server setup required - connects directly to AWS Lambda
|
|
39
44
|
|
|
40
|
-
|
|
41
|
-
|
|
45
|
+
const ENSToAddressPage: FC = () => {
|
|
46
|
+
// Hook automatically connects to AWS Lambda - no server setup required
|
|
47
|
+
const addressInformation = useFetchENSAddressLookup('vitalik.eth');
|
|
48
|
+
|
|
49
|
+
// Each client hook uses the useFetch custom hook
|
|
50
|
+
// It returns three states: data, error, loading
|
|
51
|
+
// We capture these states in a variable (like above) and conditionally render the component
|
|
52
|
+
if (addressInformation.loading){
|
|
53
|
+
return <div>Loading..</div>
|
|
54
|
+
}
|
|
55
|
+
else if (addressInformation.error){
|
|
56
|
+
return <div>Error loading data...</div>
|
|
57
|
+
}
|
|
58
|
+
else {
|
|
59
|
+
// Hardcoded some parts for demonstrative purposes only
|
|
60
|
+
return (
|
|
61
|
+
<div className='home-page'>
|
|
62
|
+
<table>
|
|
63
|
+
<tr>
|
|
64
|
+
<th>ENS</th>
|
|
65
|
+
<th>Address</th>
|
|
66
|
+
</tr>
|
|
67
|
+
<tr>
|
|
68
|
+
<td>vitalik.eth</td>
|
|
69
|
+
<td>{ addressInformation.data?.information }</td>
|
|
70
|
+
</tr>
|
|
71
|
+
</table>
|
|
72
|
+
</div>
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export default ENSToAddressPage;
|
|
78
|
+
```
|
|
42
79
|
|
|
43
80
|
<br />
|
|
44
81
|
|
|
45
|
-
|
|
82
|
+
A list of chains supported is provided below in the <code>Types</code> section.
|
|
46
83
|
|
|
47
|
-
|
|
48
|
-
A list of what chains are supported is provided below in the <code>Types</code> section.
|
|
84
|
+
## AWS Lambda Endpoints
|
|
49
85
|
|
|
50
|
-
The following table
|
|
86
|
+
The following table shows the **30 different client hooks** and their corresponding **AWS Lambda endpoints**:
|
|
51
87
|
|
|
52
88
|
<table>
|
|
53
89
|
<tr>
|
|
54
90
|
<th>Category</th>
|
|
55
91
|
<th>Client Hook Name</th>
|
|
92
|
+
<th>AWS Lambda Endpoint</th>
|
|
56
93
|
<th>Description</th>
|
|
57
|
-
|
|
94
|
+
</tr>
|
|
58
95
|
<tr>
|
|
59
96
|
<td>ENS</td>
|
|
60
|
-
<td><code>useFetchAddressENSLookup(address: string
|
|
97
|
+
<td><code>useFetchAddressENSLookup(address: string)</code></td>
|
|
98
|
+
<td><code>https://37zq2u4ntbygkw7inki3djjm440xctyd.lambda-url.us-east-1.on.aws/</code></td>
|
|
61
99
|
<td>Fetch the equivalent ENS name from a given address</td>
|
|
62
100
|
</tr>
|
|
63
101
|
<tr>
|
|
64
102
|
<td>ENS</td>
|
|
65
|
-
<td><code>useFetchENSAddressLookup(ensName: string
|
|
103
|
+
<td><code>useFetchENSAddressLookup(ensName: string)</code></td>
|
|
104
|
+
<td><code>https://jy3upsy3rgbengcktqlqfcwyhy0wcamb.lambda-url.us-east-1.on.aws/</code></td>
|
|
66
105
|
<td>Fetch the equivalent ETH address from a given ENS name</td>
|
|
67
106
|
</tr>
|
|
68
107
|
<tr>
|
|
69
108
|
<td>ENS</td>
|
|
70
|
-
<td><code>useFetchENSIDLookup(id: string
|
|
109
|
+
<td><code>useFetchENSIDLookup(id: string)</code></td>
|
|
110
|
+
<td><code>https://ev6i3gsesgdvj7ouxiwpg4qafu0nfvdw.lambda-url.us-east-1.on.aws/</code></td>
|
|
71
111
|
<td>Fetch information of a given ENS ID</td>
|
|
72
112
|
</tr>
|
|
73
113
|
<tr>
|
|
74
114
|
<td>ENS</td>
|
|
75
|
-
<td><code>useFetchENSNameLookup(ensName: string
|
|
115
|
+
<td><code>useFetchENSNameLookup(ensName: string)</code></td>
|
|
116
|
+
<td><code>https://f53actwgpl2a3rk6uynoryuoxq0eifuo.lambda-url.us-east-1.on.aws/</code></td>
|
|
76
117
|
<td>Fetch information of a given ENS name</td>
|
|
77
118
|
</tr>
|
|
78
119
|
<tr>
|
|
79
120
|
<td>ERC20</td>
|
|
80
|
-
<td><code>useFetchERC20CollectionOwners(contractAddress: string
|
|
121
|
+
<td><code>useFetchERC20CollectionOwners(contractAddress: string)</code></td>
|
|
122
|
+
<td><code>https://hyrbuxy6aivjqjrgtogd3nx5we0gcxjr.lambda-url.us-east-1.on.aws/</code></td>
|
|
81
123
|
<td>Fetch list of owners of a particular ERC20 collection</td>
|
|
82
124
|
</tr>
|
|
83
125
|
<tr>
|
|
84
126
|
<td>ERC20</td>
|
|
85
|
-
<td><code>useFetchERC20CollectionTopCoins(
|
|
127
|
+
<td><code>useFetchERC20CollectionTopCoins()</code></td>
|
|
128
|
+
<td><code>https://2ebpropr2dgzqicposkbrvr5nq0ofyyx.lambda-url.us-east-1.on.aws/</code></td>
|
|
86
129
|
<td>Fetch list of the top ERC20 collections</td>
|
|
87
130
|
</tr>
|
|
88
131
|
<tr>
|
|
89
132
|
<td>ERC20</td>
|
|
90
|
-
<td><code>useFetchERC20CollectionTransfers(contractAddress: string
|
|
133
|
+
<td><code>useFetchERC20CollectionTransfers(contractAddress: string)</code></td>
|
|
134
|
+
<td><code>https://bwqre7ze2vm3sum5avrvwzwbrm0gyxcy.lambda-url.us-east-1.on.aws/</code></td>
|
|
91
135
|
<td>Fetch transfer activity of a particular ERC20 collection</td>
|
|
92
136
|
</tr>
|
|
93
137
|
<tr>
|
|
94
138
|
<td>ERC20</td>
|
|
95
|
-
<td><code>useFetchERC20Holdings(contractAddress: string
|
|
139
|
+
<td><code>useFetchERC20Holdings(contractAddress: string)</code></td>
|
|
140
|
+
<td><code>https://2i2neqclwlgygwimhbzlhdtjwa0dupee.lambda-url.us-east-1.on.aws/</code></td>
|
|
96
141
|
<td>Track wallet holdings of a particular ERC20 token activity</td>
|
|
97
142
|
</tr>
|
|
98
143
|
<tr>
|
|
99
144
|
<td>ERC20</td>
|
|
100
|
-
<td><code>useFetchERC20Transfers(contractAddress: string
|
|
145
|
+
<td><code>useFetchERC20Transfers(contractAddress: string)</code></td>
|
|
146
|
+
<td><code>https://msee4ccresifmjhm3mdedry3ki0xvdgx.lambda-url.us-east-1.on.aws/</code></td>
|
|
101
147
|
<td>Track the transfer activity of a particular ERC20 token in a wallet</td>
|
|
102
148
|
</tr>
|
|
103
149
|
<tr>
|
|
104
150
|
<td>ERC721</td>
|
|
105
|
-
<td><code>useFetchERC721CollectionAttributes(contractAddress: string
|
|
151
|
+
<td><code>useFetchERC721CollectionAttributes(contractAddress: string)</code></td>
|
|
152
|
+
<td><code>https://7rs4acgso6ld44zjpl25jras3q0szvag.lambda-url.us-east-1.on.aws/</code></td>
|
|
106
153
|
<td>Fetch attributes of a particular ERC721 collection</td>
|
|
107
154
|
</tr>
|
|
108
155
|
<tr>
|
|
109
156
|
<td>ERC721</td>
|
|
110
|
-
<td><code>useFetchERC721CollectionData(contractAddress: string
|
|
157
|
+
<td><code>useFetchERC721CollectionData(contractAddress: string)</code></td>
|
|
158
|
+
<td><code>https://u2pdhfz4qbfkkyp6z4yg4n57hq0hzica.lambda-url.us-east-1.on.aws/</code></td>
|
|
111
159
|
<td>Fetch data of a particular ERC721 collection</td>
|
|
112
160
|
</tr>
|
|
113
161
|
<tr>
|
|
114
162
|
<td>ERC721</td>
|
|
115
|
-
<td><code>useFetchERC721CollectionExtraData(contractAddress: string
|
|
163
|
+
<td><code>useFetchERC721CollectionExtraData(contractAddress: string)</code></td>
|
|
164
|
+
<td><code>https://b5mkshxv54bbj4d54rxze5cj6q0xhptc.lambda-url.us-east-1.on.aws/</code></td>
|
|
116
165
|
<td>Fetch extra data of a particular ERC721 collection</td>
|
|
117
166
|
</tr>
|
|
118
167
|
<tr>
|
|
119
168
|
<td>ERC721</td>
|
|
120
|
-
<td><code>useFetchERC721CollectionFloorPrice(contractAddress: string
|
|
169
|
+
<td><code>useFetchERC721CollectionFloorPrice(contractAddress: string)</code></td>
|
|
170
|
+
<td><code>https://343rc276twphsdjwtzrzjytepu0xdxxn.lambda-url.us-east-1.on.aws/</code></td>
|
|
121
171
|
<td>Fetch floor price data of a particular ERC721 collection</td>
|
|
122
172
|
</tr>
|
|
123
173
|
<tr>
|
|
124
174
|
<td>ERC721</td>
|
|
125
|
-
<td><code>useFetchERC721CollectionMarketCap(contractAddress: string, duration: 2 | 14 | 30
|
|
175
|
+
<td><code>useFetchERC721CollectionMarketCap(contractAddress: string, duration: 2 | 14 | 30)</code></td>
|
|
176
|
+
<td><code>https://o5ntejtug7ixeetoqf5uxjpwgq0mbtvt.lambda-url.us-east-1.on.aws/</code></td>
|
|
126
177
|
<td>Fetch market cap data of a particular ERC721 collection</td>
|
|
127
178
|
</tr>
|
|
128
179
|
<tr>
|
|
129
180
|
<td>ERC721</td>
|
|
130
|
-
<td><code>useFetchERC721CollectionSales(contractAddress: string
|
|
181
|
+
<td><code>useFetchERC721CollectionSales(contractAddress: string)</code></td>
|
|
182
|
+
<td><code>https://b5xcn2afinyiq32izaoxe4mzua0ggxvm.lambda-url.us-east-1.on.aws/</code></td>
|
|
131
183
|
<td>Fetch sales data of a particular ERC721 collection</td>
|
|
132
184
|
</tr>
|
|
133
185
|
<tr>
|
|
134
186
|
<td>ERC721</td>
|
|
135
|
-
<td><code>useFetchERC721CollectionTransfers(contractAddress: string
|
|
187
|
+
<td><code>useFetchERC721CollectionTransfers(contractAddress: string)</code></td>
|
|
188
|
+
<td><code>https://lrtnsabh6hkimp4hqonw3foi2e0zzuxq.lambda-url.us-east-1.on.aws/</code></td>
|
|
136
189
|
<td>Fetch transfer activity of a particular ERC721 collection</td>
|
|
137
190
|
</tr>
|
|
138
191
|
<tr>
|
|
139
192
|
<td>ERC721</td>
|
|
140
|
-
<td><code>useFetchERC721CollectionTrends(
|
|
193
|
+
<td><code>useFetchERC721CollectionTrends()</code></td>
|
|
194
|
+
<td><code>https://hmzkjpwut4bwaeovhryd6hie540fwvzi.lambda-url.us-east-1.on.aws/</code></td>
|
|
141
195
|
<td>Fetch trending ERC721 collection data</td>
|
|
142
196
|
</tr>
|
|
143
197
|
<tr>
|
|
144
198
|
<td>ERC721</td>
|
|
145
|
-
<td><code>useFetchERC721CollectionVolume(
|
|
199
|
+
<td><code>useFetchERC721CollectionVolume()</code></td>
|
|
200
|
+
<td><code>https://zlksxwjaikudsub4rmcc5c4eme0uqntg.lambda-url.us-east-1.on.aws/</code></td>
|
|
146
201
|
<td>Fetch ERC721 collections by volume data</td>
|
|
147
202
|
</tr>
|
|
148
203
|
<tr>
|
|
149
204
|
<td>ERC721</td>
|
|
150
|
-
<td><code>useFetchERC721Holdings(walletAddress: string
|
|
205
|
+
<td><code>useFetchERC721Holdings(walletAddress: string)</code></td>
|
|
206
|
+
<td><code>https://rmepnjzubrgdsvmb66kdwz5upm0khfor.lambda-url.us-east-1.on.aws/</code></td>
|
|
151
207
|
<td>Fetch ERC721 holdings of a particular wallet</td>
|
|
152
208
|
</tr>
|
|
153
209
|
<tr>
|
|
154
210
|
<td>ERC721</td>
|
|
155
|
-
<td><code>useFetchERC721LookupData(contractAddress: string, tokenID: string
|
|
211
|
+
<td><code>useFetchERC721LookupData(contractAddress: string, tokenID: string)</code></td>
|
|
212
|
+
<td><code>https://rd7cae6wlnx3lsiuncgjgeap5e0lkbew.lambda-url.us-east-1.on.aws/</code></td>
|
|
156
213
|
<td>Fetch data of a particular ERC721 token</td>
|
|
157
214
|
</tr>
|
|
158
215
|
<tr>
|
|
159
216
|
<td>ERC721</td>
|
|
160
|
-
<td><code>useFetchERC721OpenseaData(contractAddress: string, tokenID: string
|
|
217
|
+
<td><code>useFetchERC721OpenseaData(contractAddress: string, tokenID: string)</code></td>
|
|
218
|
+
<td><code>https://qoeq2n767jbu5gbiiy7463d56m0cwdec.lambda-url.us-east-1.on.aws/</code></td>
|
|
161
219
|
<td>Fetch Opensea data of a particular ERC721 token</td>
|
|
162
220
|
</tr>
|
|
163
221
|
<tr>
|
|
164
222
|
<td>ERC721</td>
|
|
165
|
-
<td><code>useFetchERC721RarityData(contractAddress: string, tokenID: string
|
|
223
|
+
<td><code>useFetchERC721RarityData(contractAddress: string, tokenID: string)</code></td>
|
|
224
|
+
<td><code>https://eilobcax7r4wayov2rfscraqb40rodzv.lambda-url.us-east-1.on.aws/</code></td>
|
|
166
225
|
<td>Fetch rarity data of a particular ERC721 token</td>
|
|
167
226
|
</tr>
|
|
168
227
|
<tr>
|
|
169
228
|
<td>ERC721</td>
|
|
170
|
-
<td><code>useFetchERC721SalesData(contractAddress: string, tokenID: string
|
|
229
|
+
<td><code>useFetchERC721SalesData(contractAddress: string, tokenID: string)</code></td>
|
|
230
|
+
<td><code>https://nhjz6tqihl6bdt7zukf5ru7wnu0ydoqq.lambda-url.us-east-1.on.aws/</code></td>
|
|
171
231
|
<td>Fetch sales data of a particular ERC721 token</td>
|
|
172
232
|
</tr>
|
|
173
233
|
<tr>
|
|
174
234
|
<td>ERC721</td>
|
|
175
|
-
<td><code>useFetchERC721TransferLookupData(contractAddress: string, tokenID: string
|
|
235
|
+
<td><code>useFetchERC721TransferLookupData(contractAddress: string, tokenID: string)</code></td>
|
|
236
|
+
<td><code>https://o66cbw3kaufg5t3k2fl5ydazbq0tvfaz.lambda-url.us-east-1.on.aws/</code></td>
|
|
176
237
|
<td>Fetch transfer data of a particular ERC721 token</td>
|
|
177
238
|
</tr>
|
|
178
239
|
<tr>
|
|
179
240
|
<td>ERC721</td>
|
|
180
|
-
<td><code>useFetchERC721TransfersData(walletAddress: string
|
|
241
|
+
<td><code>useFetchERC721TransfersData(walletAddress: string)</code></td>
|
|
242
|
+
<td><code>https://gnfeczsyzj4v6rsyf4zmlpv23q0uixkv.lambda-url.us-east-1.on.aws/</code></td>
|
|
181
243
|
<td>Fetch ERC721 transfer activity of a particular wallet</td>
|
|
182
244
|
</tr>
|
|
183
245
|
<tr>
|
|
184
246
|
<td>Gas</td>
|
|
185
|
-
<td><code>useFetchGasLookup(
|
|
247
|
+
<td><code>useFetchGasLookup()</code></td>
|
|
248
|
+
<td><code>https://wsebjfjyi4k2kfb4mbcrcjyrqa0nwifh.lambda-url.us-east-1.on.aws/</code></td>
|
|
186
249
|
<td>Fetch gas information related to Ethereum or a supported layer two</td>
|
|
187
250
|
</tr>
|
|
188
251
|
<tr>
|
|
189
252
|
<td>Prices</td>
|
|
190
|
-
<td><code>useFetchERC20Price(contractAddress: string, currentPrice: boolean, duration: 2 | 14 | 30
|
|
253
|
+
<td><code>useFetchERC20Price(contractAddress: string, currentPrice: boolean, duration: 2 | 14 | 30)</code></td>
|
|
254
|
+
<td><code>https://vw5caqjd3yg2oyslxcyxkln2dy0nqgxz.lambda-url.us-east-1.on.aws/</code></td>
|
|
191
255
|
<td>Fetch pricing data of a particular ERC20 collection</td>
|
|
192
256
|
</tr>
|
|
193
257
|
<tr>
|
|
194
258
|
<td>Prices</td>
|
|
195
|
-
<td><code>useFetchERC721Price(contractAddress: string, tokenID: string
|
|
259
|
+
<td><code>useFetchERC721Price(contractAddress: string, tokenID: string)</code></td>
|
|
260
|
+
<td><code>https://brjvjnlp35ln3solbquo6fiize0bnwje.lambda-url.us-east-1.on.aws/</code></td>
|
|
196
261
|
<td>Fetch pricing data of a particular ERC721 collection</td>
|
|
197
262
|
</tr>
|
|
198
263
|
<tr>
|
|
199
264
|
<td>Prices</td>
|
|
200
|
-
<td><code>useFetchETHPrice(currentPrice: boolean, duration: 2 | 14 | 30
|
|
265
|
+
<td><code>useFetchETHPrice(currentPrice: boolean, duration: 2 | 14 | 30)</code></td>
|
|
266
|
+
<td><code>https://fl5mxvcm42g3n7wtodnxq52s2a0jeokj.lambda-url.us-east-1.on.aws/</code></td>
|
|
201
267
|
<td>Fetch Ethereum price data</td>
|
|
202
268
|
</tr>
|
|
203
269
|
<tr>
|
|
204
270
|
<td>Prices</td>
|
|
205
|
-
<td><code>useFetchLayerTwoPrice(layerTwo: LayerTwoNetworks, currentPrice: boolean, duration: 2 | 14 | 30
|
|
271
|
+
<td><code>useFetchLayerTwoPrice(layerTwo: LayerTwoNetworks, currentPrice: boolean, duration: 2 | 14 | 30)</code></td>
|
|
272
|
+
<td><code>https://jt7ds5ua6iix7cpa5ueg2ud2gi0joklo.lambda-url.us-east-1.on.aws/</code></td>
|
|
206
273
|
<td>Fetch Layer Two price data</td>
|
|
207
274
|
</tr>
|
|
208
275
|
</table>
|
|
@@ -210,7 +277,7 @@ The following table highlights the 30 different client hooks:
|
|
|
210
277
|
<br />
|
|
211
278
|
|
|
212
279
|
## Custom Hooks
|
|
213
|
-
Custom hooks were
|
|
280
|
+
Custom hooks were incorporated into the main client hooks. The following table details the custom hooks used in this package:
|
|
214
281
|
|
|
215
282
|
<table>
|
|
216
283
|
<tr>
|
|
@@ -218,15 +285,15 @@ Custom hooks were used for development convenience and were fully incorporated i
|
|
|
218
285
|
<th>Function</th>
|
|
219
286
|
<tr>
|
|
220
287
|
<tr>
|
|
221
|
-
<td><code>useFetch</code></td>
|
|
222
|
-
<td>
|
|
288
|
+
<td><code>useFetch<T = any>(URL: string, options: RequestInit = {})</code></td>
|
|
289
|
+
<td>Readily fetch data using a set of defined parameters</td>
|
|
223
290
|
</tr>
|
|
224
291
|
</table>
|
|
225
292
|
|
|
226
293
|
<br />
|
|
227
294
|
|
|
228
295
|
## Types
|
|
229
|
-
Custom data types were developed for fetch
|
|
296
|
+
Custom data types were developed for monitoring data fetch status and defining a set of available layer two networks:
|
|
230
297
|
|
|
231
298
|
<table>
|
|
232
299
|
<tr>
|
|
@@ -235,7 +302,7 @@ Custom data types were developed for fetch state and defining a set of available
|
|
|
235
302
|
<tr>
|
|
236
303
|
<tr>
|
|
237
304
|
<td><code>FetchStateType</code></td>
|
|
238
|
-
<td>
|
|
305
|
+
<td>Readily fetch data and track its state using a type with a set of defined states: <code>{ data: T | null, error: boolean, loading: boolean }</code></td>
|
|
239
306
|
</tr>
|
|
240
307
|
<tr>
|
|
241
308
|
<td><code>LayerTwoType</code></td>
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching Address to ENS Custom hook
|
|
4
|
-
export const useFetchAddressENSLookup = (address: string
|
|
5
|
-
const URL = `http://localhost:${port}/address-to-ens-information`; // Define the API endpoint
|
|
6
|
-
|
|
4
|
+
export const useFetchAddressENSLookup = (address: string) => {
|
|
7
5
|
const options = {
|
|
8
6
|
method: 'POST',
|
|
9
7
|
body: JSON.stringify({ address }),
|
|
@@ -12,7 +10,8 @@ export const useFetchAddressENSLookup = (address: string, port: number) => {
|
|
|
12
10
|
}
|
|
13
11
|
};
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
// ENDPOINT - /address-to-ens-information
|
|
14
|
+
const state = useFetch("https://37zq2u4ntbygkw7inki3djjm440xctyd.lambda-url.us-east-1.on.aws/", options); // Use the custom hook to fetch data
|
|
16
15
|
|
|
17
16
|
return state; // Return the state from the custom hook
|
|
18
17
|
}
|
|
@@ -1,10 +1,7 @@
|
|
|
1
|
-
import axios from "axios";
|
|
2
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
3
2
|
|
|
4
3
|
// Fetching ENS to Address Custom hook
|
|
5
|
-
export const useFetchENSAddressLookup = (ensName: string
|
|
6
|
-
const URL = `http://localhost:${port}/additional-address-to-ens-information`; // Define the API endpoint
|
|
7
|
-
|
|
4
|
+
export const useFetchENSAddressLookup = (ensName: string) => {
|
|
8
5
|
const options = {
|
|
9
6
|
method: 'POST',
|
|
10
7
|
body: JSON.stringify({ ensName }),
|
|
@@ -13,7 +10,8 @@ export const useFetchENSAddressLookup = (ensName: string, port: number) => {
|
|
|
13
10
|
}
|
|
14
11
|
};
|
|
15
12
|
|
|
16
|
-
|
|
13
|
+
// ENDPOINT - /ens-to-address-information
|
|
14
|
+
const state = useFetch("https://jy3upsy3rgbengcktqlqfcwyhy0wcamb.lambda-url.us-east-1.on.aws/", options); // Use the custom hook to fetch data
|
|
17
15
|
|
|
18
16
|
return state; // Return the state from the custom hook
|
|
19
17
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetch ENS ID lookups
|
|
4
|
-
export const useFetchENSIDLookup = (id: string
|
|
5
|
-
const URL = `https://localhost:${port}/ens-transfers-by-id`; // Define the API endpoint
|
|
6
|
-
|
|
4
|
+
export const useFetchENSIDLookup = (id: string) => {
|
|
7
5
|
const options = {
|
|
8
6
|
method: 'POST',
|
|
9
7
|
body: JSON.stringify({ id }),
|
|
@@ -12,7 +10,8 @@ export const useFetchENSIDLookup = (id: string, port: number) => {
|
|
|
12
10
|
}
|
|
13
11
|
};
|
|
14
12
|
|
|
15
|
-
|
|
13
|
+
// ENDPOINT - /ens-transfers-by-id
|
|
14
|
+
const state = useFetch("https://ev6i3gsesgdvj7ouxiwpg4qafu0nfvdw.lambda-url.us-east-1.on.aws/", options); // Use the custom hook to fetch data
|
|
16
15
|
|
|
17
16
|
return state; // Return the state from the custom hook
|
|
18
17
|
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetch ENS Name lookups
|
|
4
|
-
export const useFetchENSNameLookup = (ensName: string
|
|
5
|
-
const URL = `https://localhost:${port}/ens-transfers-by-name`; // Define the API endpoint
|
|
4
|
+
export const useFetchENSNameLookup = (ensName: string) => {
|
|
6
5
|
|
|
7
6
|
const options = {
|
|
8
7
|
method: 'POST',
|
|
@@ -12,7 +11,8 @@ export const useFetchENSNameLookup = (ensName: string, port: number) => {
|
|
|
12
11
|
}
|
|
13
12
|
};
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
// ENDPOINT - /ens-transfers-by-name
|
|
15
|
+
const state = useFetch("https://f53actwgpl2a3rk6uynoryuoxq0eifuo.lambda-url.us-east-1.on.aws/", options); // Use the custom hook to fetch data
|
|
16
16
|
|
|
17
17
|
return state; // Return the state from the custom hook
|
|
18
18
|
}
|
package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20CollectionOwners.ts
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
|
-
// Fetching ERC20
|
|
4
|
-
export const useFetchERC20CollectionOwners = async (contractAddress: string
|
|
3
|
+
// Fetching ERC20 Collection Owners Hook
|
|
4
|
+
export const useFetchERC20CollectionOwners = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -13,7 +13,8 @@ export const useFetchERC20CollectionOwners = async (contractAddress: string, por
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
|
-
|
|
16
|
+
// ENDPOINT - /erc20-collection-owners
|
|
17
|
+
const state = useFetch("https://hyrbuxy6aivjqjrgtogd3nx5we0gcxjr.lambda-url.us-east-1.on.aws/", options);
|
|
17
18
|
|
|
18
19
|
// Return the state from the custom hook
|
|
19
20
|
return state;
|
package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20CollectionTopCoins.ts
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC20 Collection Top Coins
|
|
4
|
-
export const useFetchERC20CollectionTopCoins = async (
|
|
4
|
+
export const useFetchERC20CollectionTopCoins = async () => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -12,7 +12,8 @@ export const useFetchERC20CollectionTopCoins = async (port: number) => {
|
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
// Use the custom hook to fetch data
|
|
15
|
-
|
|
15
|
+
// ENDPOINT - /erc20-top-coins
|
|
16
|
+
const state = useFetch("https://2ebpropr2dgzqicposkbrvr5nq0ofyyx.lambda-url.us-east-1.on.aws/", options);
|
|
16
17
|
|
|
17
18
|
// Return the state from the custom hook
|
|
18
19
|
return state;
|
package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20CollectionTransfers.ts
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC20 Collection Transfers
|
|
4
|
-
export const useFetchERC20CollectionTransfers = async (contractAddress: string
|
|
4
|
+
export const useFetchERC20CollectionTransfers = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -13,7 +13,8 @@ export const useFetchERC20CollectionTransfers = async (contractAddress: string,
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
|
-
|
|
16
|
+
// ENDPOINT - /erc20-collection-transfers
|
|
17
|
+
const state = useFetch("https://bwqre7ze2vm3sum5avrvwzwbrm0gyxcy.lambda-url.us-east-1.on.aws/", options);
|
|
17
18
|
|
|
18
19
|
// Return the state from the custom hook
|
|
19
20
|
return state;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC20 Collection Holdings
|
|
4
|
-
export const useFetchERC20Holdings = async (contractAddress: string
|
|
4
|
+
export const useFetchERC20Holdings = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -13,7 +13,8 @@ export const useFetchERC20Holdings = async (contractAddress: string, port: numbe
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
|
-
|
|
16
|
+
// ENDPOINT - /erc20-collection-holdings
|
|
17
|
+
const state = useFetch("https://2i2neqclwlgygwimhbzlhdtjwa0dupee.lambda-url.us-east-1.on.aws/", options);
|
|
17
18
|
|
|
18
19
|
// Return the state from the custom hook
|
|
19
20
|
return state;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC20 Collection Transfers
|
|
4
|
-
export const useFetchERC20Transfers = async (contractAddress: string
|
|
4
|
+
export const useFetchERC20Transfers = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -13,7 +13,8 @@ export const useFetchERC20Transfers = async (contractAddress: string, port: numb
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
|
-
|
|
16
|
+
// ENDPOINT - /erc20-collection-transfers
|
|
17
|
+
const state = useFetch("https://msee4ccresifmjhm3mdedry3ki0xvdgx.lambda-url.us-east-1.on.aws/", options);
|
|
17
18
|
|
|
18
19
|
// Return the state from the custom hook
|
|
19
20
|
return state;
|
package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionAttributes.ts
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Collection Attributes Hook
|
|
4
|
-
export const useFetchERC721CollectionAttributes = async (contractAddress: string
|
|
4
|
+
export const useFetchERC721CollectionAttributes = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -13,7 +13,8 @@ export const useFetchERC721CollectionAttributes = async (contractAddress: string
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
|
-
|
|
16
|
+
// ENDPOINT - /erc721-collection-attributes
|
|
17
|
+
const state = useFetch("https://7rs4acgso6ld44zjpl25jras3q0szvag.lambda-url.us-east-1.on.aws/", options);
|
|
17
18
|
|
|
18
19
|
// Return the state from the custom hook
|
|
19
20
|
return state;
|
package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionData.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 useFetchERC721CollectionData = async (contractAddress: string
|
|
4
|
+
export const useFetchERC721CollectionData = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -13,7 +13,8 @@ export const useFetchERC721CollectionData = async (contractAddress: string, port
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
|
-
|
|
16
|
+
// ENDPOINT - /erc721-collection-data
|
|
17
|
+
const state = useFetch("https://u2pdhfz4qbfkkyp6z4yg4n57hq0hzica.lambda-url.us-east-1.on.aws/", options);
|
|
17
18
|
|
|
18
19
|
// Return the state from the custom hook
|
|
19
20
|
return state;
|
package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionExtraData.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 useFetchERC721CollectionExtraData = async (contractAddress: string
|
|
4
|
+
export const useFetchERC721CollectionExtraData = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -13,7 +13,8 @@ export const useFetchERC721CollectionExtraData = async (contractAddress: string,
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
|
-
|
|
16
|
+
// ENDPOINT - erc721-collection-extra-data
|
|
17
|
+
const state = useFetch("https://b5mkshxv54bbj4d54rxze5cj6q0xhptc.lambda-url.us-east-1.on.aws/", options);
|
|
17
18
|
|
|
18
19
|
// Return the state from the custom hook
|
|
19
20
|
return state;
|
package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionFloorPrice.ts
RENAMED
|
@@ -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 useFetchERC721CollectionFloorPrice = async (contractAddress: string
|
|
4
|
+
export const useFetchERC721CollectionFloorPrice = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -13,7 +13,8 @@ export const useFetchERC721CollectionFloorPrice = async (contractAddress: string
|
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
|
-
|
|
16
|
+
// ENDPOINT - /erc721-collection-floor-price
|
|
17
|
+
const state = useFetch("https://343rc276twphsdjwtzrzjytepu0xdxxn.lambda-url.us-east-1.on.aws/", options);
|
|
17
18
|
|
|
18
19
|
// Return the state from the custom hook
|
|
19
20
|
return state;
|