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.
Files changed (102) hide show
  1. package/README.md +128 -61
  2. package/{client/src/crypto_hooks → crypto_hooks}/ens/useFetchAddressENSLookup.ts +3 -4
  3. package/{client/src/crypto_hooks → crypto_hooks}/ens/useFetchENSAddressLookup.ts +3 -5
  4. package/{client/src/crypto_hooks → crypto_hooks}/ens/useFetchENSIDLookup.ts +3 -4
  5. package/{client/src/crypto_hooks → crypto_hooks}/ens/useFetchENSNameLookup.ts +3 -3
  6. package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20CollectionOwners.ts +4 -3
  7. package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20CollectionTopCoins.ts +3 -2
  8. package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20CollectionTransfers.ts +3 -2
  9. package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20Holdings.ts +3 -2
  10. package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20Transfers.ts +3 -2
  11. package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionAttributes.ts +3 -2
  12. package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionData.ts +3 -2
  13. package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionExtraData.ts +3 -2
  14. package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionFloorPrice.ts +3 -2
  15. package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionMarketCap.ts +3 -2
  16. package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionSales.ts +3 -2
  17. package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionTransfers.ts +3 -2
  18. package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionTrends.ts +3 -2
  19. package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionVolume.ts +3 -2
  20. package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721Holdings.ts +3 -2
  21. package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721LookupData.ts +3 -2
  22. package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721OpenseaData.ts +3 -2
  23. package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721RarityData.ts +3 -2
  24. package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721SalesData.ts +3 -2
  25. package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721TransferLookupData.ts +3 -2
  26. package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721TransfersData.ts +3 -2
  27. package/{client/src/crypto_hooks → crypto_hooks}/gas/useFetchGasLookup.ts +3 -4
  28. package/crypto_hooks/index.ts +39 -0
  29. package/{client/src/crypto_hooks → crypto_hooks}/prices/useFetchERC20Price.ts +3 -2
  30. package/{client/src/crypto_hooks → crypto_hooks}/prices/useFetchERC721Price.ts +3 -2
  31. package/{client/src/crypto_hooks → crypto_hooks}/prices/useFetchETHPrice.ts +3 -2
  32. package/{client/src/crypto_hooks → crypto_hooks}/prices/useFetchLayerTwoPrice.ts +3 -2
  33. package/package.json +22 -20
  34. package/client/package.json +0 -25
  35. package/hook-server-design.png +0 -0
  36. package/hooksinformation.txt +0 -49
  37. package/server/Controller/ENS/AddressToENSController.ts +0 -30
  38. package/server/Controller/ENS/ENSIDController.ts +0 -32
  39. package/server/Controller/ENS/ENSNameController.ts +0 -32
  40. package/server/Controller/ENS/ENSToAddressController.ts +0 -32
  41. package/server/Controller/ERC20Tokens/ERC20CollectionOwnersController.ts +0 -29
  42. package/server/Controller/ERC20Tokens/ERC20CollectionTopCoinsController.ts +0 -27
  43. package/server/Controller/ERC20Tokens/ERC20CollectionTransfersController.ts +0 -29
  44. package/server/Controller/ERC20Tokens/ERC20HoldingsController.ts +0 -29
  45. package/server/Controller/ERC20Tokens/ERC20TransfersController.ts +0 -29
  46. package/server/Controller/ERC721Tokens/ERC721CollectionAttributesController.ts +0 -29
  47. package/server/Controller/ERC721Tokens/ERC721CollectionDataController.ts +0 -29
  48. package/server/Controller/ERC721Tokens/ERC721CollectionExtraDataController.ts +0 -29
  49. package/server/Controller/ERC721Tokens/ERC721CollectionFloorPriceController.ts +0 -18
  50. package/server/Controller/ERC721Tokens/ERC721CollectionMarketCapController.ts +0 -29
  51. package/server/Controller/ERC721Tokens/ERC721CollectionSalesController.ts +0 -29
  52. package/server/Controller/ERC721Tokens/ERC721CollectionTransfersController.ts +0 -29
  53. package/server/Controller/ERC721Tokens/ERC721CollectionTrendsController.ts +0 -28
  54. package/server/Controller/ERC721Tokens/ERC721CollectionVolumeController.ts +0 -28
  55. package/server/Controller/ERC721Tokens/ERC721HoldingsController.ts +0 -29
  56. package/server/Controller/ERC721Tokens/ERC721LookupDataController.ts +0 -28
  57. package/server/Controller/ERC721Tokens/ERC721OpenseaDataController.ts +0 -29
  58. package/server/Controller/ERC721Tokens/ERC721RarityDataController.ts +0 -29
  59. package/server/Controller/ERC721Tokens/ERC721SalesDataController.ts +0 -34
  60. package/server/Controller/ERC721Tokens/ERC721TransferLookupDataController.ts +0 -28
  61. package/server/Controller/ERC721Tokens/ERC721TransfersDataController.ts +0 -29
  62. package/server/Controller/Gas/GasLookupController.ts +0 -26
  63. package/server/Controller/Prices/ERC20PriceController.ts +0 -43
  64. package/server/Controller/Prices/ERC721PriceController.ts +0 -28
  65. package/server/Controller/Prices/ETHPriceController.ts +0 -42
  66. package/server/Controller/Prices/LayerTwoPriceController.ts +0 -41
  67. package/server/Routes/ENSRoutes/AddressToENSRoute.ts +0 -9
  68. package/server/Routes/ENSRoutes/ENSIDRoute.ts +0 -8
  69. package/server/Routes/ENSRoutes/ENSNameRoute.ts +0 -9
  70. package/server/Routes/ENSRoutes/ENSToAddressRoute.ts +0 -9
  71. package/server/Routes/ERC20TokensRoutes/ERC20CollectionOwnersRoute.ts +0 -9
  72. package/server/Routes/ERC20TokensRoutes/ERC20CollectionTopCoinsRoute.ts +0 -9
  73. package/server/Routes/ERC20TokensRoutes/ERC20CollectionTransfersRoute.ts +0 -9
  74. package/server/Routes/ERC20TokensRoutes/ERC20HoldingsRoute.ts +0 -9
  75. package/server/Routes/ERC20TokensRoutes/ERC20TransfersRoute.ts +0 -9
  76. package/server/Routes/ERC721TokensRoutes/ERC721CollectionAttributesRoutes.ts +0 -9
  77. package/server/Routes/ERC721TokensRoutes/ERC721CollectionDataRoutes.ts +0 -9
  78. package/server/Routes/ERC721TokensRoutes/ERC721CollectionExtraDataRoutes.ts +0 -9
  79. package/server/Routes/ERC721TokensRoutes/ERC721CollectionFloorPriceRoutes.ts +0 -9
  80. package/server/Routes/ERC721TokensRoutes/ERC721CollectionMarketCapRoutes.ts +0 -9
  81. package/server/Routes/ERC721TokensRoutes/ERC721CollectionSalesRoutes.ts +0 -9
  82. package/server/Routes/ERC721TokensRoutes/ERC721CollectionTransfersRoutes.ts +0 -9
  83. package/server/Routes/ERC721TokensRoutes/ERC721CollectionTrendsRoutes.ts +0 -9
  84. package/server/Routes/ERC721TokensRoutes/ERC721CollectionVolumeRoutes.ts +0 -9
  85. package/server/Routes/ERC721TokensRoutes/ERC721HoldingsRoutes.ts +0 -9
  86. package/server/Routes/ERC721TokensRoutes/ERC721LookupDataRoutes.ts +0 -9
  87. package/server/Routes/ERC721TokensRoutes/ERC721OpenseaDataRoutes.ts +0 -9
  88. package/server/Routes/ERC721TokensRoutes/ERC721RarityDataRoutes.ts +0 -9
  89. package/server/Routes/ERC721TokensRoutes/ERC721SalesDataRoutes.ts +0 -9
  90. package/server/Routes/ERC721TokensRoutes/ERC721TransferLookupDataRoutes.ts +0 -9
  91. package/server/Routes/ERC721TokensRoutes/ERC721TransfersDataRoutes.ts +0 -9
  92. package/server/Routes/GasRoutes/GasLookupRoute.ts +0 -9
  93. package/server/Routes/PriceRoutes/ERC20PriceRoute.ts +0 -9
  94. package/server/Routes/PriceRoutes/ERC721PriceRoute.ts +0 -9
  95. package/server/Routes/PriceRoutes/ETHPriceRoute.ts +0 -9
  96. package/server/Routes/PriceRoutes/LayerTwoPriceRoute.ts +0 -9
  97. package/server/package.json +0 -25
  98. package/server/server.ts +0 -53
  99. package/server/tsconfig.json +0 -109
  100. /package/{client/src/custom_hooks → custom_hooks}/useFetch.ts +0 -0
  101. /package/{client/src/types → types}/FetchStateType.ts +0 -0
  102. /package/{client/src/types → types}/LayerTwoType.ts +0 -0
package/README.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # ethereum-hooks
2
- A package containing useful hooks for working with the Ethereum blockchain using crypto APIs. The following resources will be referenced when building these hooks:
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 Client-Server Setup
14
- When working with this package, you will need to implement the typical MERN design pattern. Set up <code>.env</code> variables and set up the server to allow the client hooks to establish communication.
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
- <b>You will need to set the following environment variables in your <code>.env</code> file: </b>
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
- - <code>ALCHEMY_API_KEY</code>
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
- The following diagram will help you understand the flow of how everything works:
29
+ ## React Client Hooks
28
30
 
29
- <img src="https://genericbucket95.s3.us-east-2.amazonaws.com/hook-server-design.png" alt="Hook Server" width="600" height="400" />
31
+ The hooks cover several areas of the Ethereum blockchain and can be used for Layer Two chains as well.
30
32
 
31
- <br />
33
+ Each hook automatically connects to its dedicated AWS Lambda endpoint - no manual URL configuration is needed.
32
34
 
33
- ## Link to Published NPM Package
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
- <br />
37
+ <code>ENSToAddressPage.tsx</code>
38
+ ```javascript
39
+ import React, { FC } from 'react';
40
+ import { useFetchENSAddressLookup } from 'ethereum-hooks';
37
41
 
38
- ## Server Setup
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
- For this part, you will need to incorporate the server object exported from the <code>server.ts</code> file inside the server directory.
41
- <b>You will need to build on top of this built-in server any additional routes and configurations as this server contains all the routes needed to effectively use the client hooks. </b>
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
- ## React Client Hooks
82
+ A list of chains supported is provided below in the <code>Types</code> section.
46
83
 
47
- The hooks cover several areas of the Ethereum blockchain and can be used for Layer Two chains as well. You will need to specify the <b>server port number</b> in order to access it for local development API calls.
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 highlights the 30 different client hooks:
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
- <tr>
94
+ </tr>
58
95
  <tr>
59
96
  <td>ENS</td>
60
- <td><code>useFetchAddressENSLookup(address: string, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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(port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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(port: number)</code></td>
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(port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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(port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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, port: number)</code></td>
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 used for development convenience and were fully incorporated into the main client hooks. The following table depicts the custom hooks:
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>To fetch data readily using a set of defined parameters</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 state and defining a set of available layer two networks
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>To fetch data readily using a set of defined parameters</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, port: number) => {
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
- const state = useFetch(URL, options); // Use the custom hook to fetch data
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, port: number) => {
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
- const state = useFetch(URL, options); // Use the custom hook to fetch data
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, port: number) => {
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
- const state = useFetch(URL, options); // Use the custom hook to fetch data
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, port: number) => {
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
- const state = useFetch(URL, options); // Use the custom hook to fetch data
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
  }
@@ -1,7 +1,7 @@
1
1
  import { useFetch } from "../../custom_hooks/useFetch";
2
2
 
3
- // Fetching ERC20 Prices Hook
4
- export const useFetchERC20CollectionOwners = async (contractAddress: string, port: number) => {
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
- const state = useFetch(`http://localhost:${port}/erc20-collection-owners`, options);
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;
@@ -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 (port: number) => {
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
- const state = useFetch(`http://localhost:${port}/erc20-top-coins`, options);
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;
@@ -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, port: number) => {
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
- const state = useFetch(`http://localhost:${port}/erc20-collection-transfers`, options);
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, port: number) => {
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
- const state = useFetch(`http://localhost:${port}/erc20-collection-holdings`, options);
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, port: number) => {
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
- const state = useFetch(`http://localhost:${port}/erc20-collection-transfers`, options);
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;
@@ -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, port: number) => {
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
- const state = useFetch(`http://localhost:${port}/erc721-collection-attributes`, options);
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;
@@ -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, port: number) => {
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
- const state = useFetch(`http://localhost:${port}/erc721-collection-data`, options);
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;
@@ -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, port: number) => {
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
- const state = useFetch(`http://localhost:${port}/erc721-collection-extra-data`, options);
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;
@@ -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, port: number) => {
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
- const state = useFetch(`http://localhost:${port}/erc721-collection-floor-price`, options);
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;