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
@@ -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 useFetchERC721CollectionMarketCap = async (contractAddress: string, duration: 2 | 14 | 30, port: number) => {
4
+ export const useFetchERC721CollectionMarketCap = async (contractAddress: string, duration: 2 | 14 | 30) => {
5
5
 
6
6
  // Set options for request
7
7
  let options = {
@@ -13,7 +13,8 @@ export const useFetchERC721CollectionMarketCap = 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-market-cap`, options);
16
+ // ENDPOINT - /erc721-collection-market-cap
17
+ const state = useFetch("https://o5ntejtug7ixeetoqf5uxjpwgq0mbtvt.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 Sales Hook
4
- export const useFetchERC721CollectionSales = async (contractAddress: string, port: number) => {
4
+ export const useFetchERC721CollectionSales = async (contractAddress: string) => {
5
5
 
6
6
  // Set options for request
7
7
  let options = {
@@ -13,7 +13,8 @@ export const useFetchERC721CollectionSales = async (contractAddress: string, por
13
13
  }
14
14
 
15
15
  // Use the custom hook to fetch data
16
- const state = useFetch(`http://localhost:${port}/erc721-collection-sales`, options);
16
+ // ENDPOINT - /erc721-collection-sales
17
+ const state = useFetch("https://b5xcn2afinyiq32izaoxe4mzua0ggxvm.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 Transfers Hook
4
- export const useFetchERC721CollectionTransfers = async (contractAddress: string, port: number) => {
4
+ export const useFetchERC721CollectionTransfers = async (contractAddress: string) => {
5
5
 
6
6
  // Set options for request
7
7
  let options = {
@@ -13,7 +13,8 @@ export const useFetchERC721CollectionTransfers = 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-transfers`, options);
16
+ // ENDPOINT - /erc721-collection-transfers
17
+ const state = useFetch("https://lrtnsabh6hkimp4hqonw3foi2e0zzuxq.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 Trends Hook
4
- export const useFetchERC721CollectionTrends = async (port: number) => {
4
+ export const useFetchERC721CollectionTrends = async () => {
5
5
 
6
6
  // Set options for request
7
7
  let options = {
@@ -12,7 +12,8 @@ export const useFetchERC721CollectionTrends = async (port: number) => {
12
12
  }
13
13
 
14
14
  // Use the custom hook to fetch data
15
- const state = useFetch(`http://localhost:${port}/erc721-collection-trends`, options);
15
+ // ENDPOINT - /erc721-collection-trends
16
+ const state = useFetch("https://hmzkjpwut4bwaeovhryd6hie540fwvzi.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 ERC721 Collection Volume Hook
4
- export const useFetchERC721CollectionVolume = async (port: number) => {
4
+ export const useFetchERC721CollectionVolume = async () => {
5
5
 
6
6
  // Set options for request
7
7
  let options = {
@@ -12,7 +12,8 @@ export const useFetchERC721CollectionVolume = async (port: number) => {
12
12
  }
13
13
 
14
14
  // Use the custom hook to fetch data
15
- const state = useFetch(`http://localhost:${port}/erc721-collection-volume`, options);
15
+ // ENDPOINT - /erc721-collection-volume
16
+ const state = useFetch("https://zlksxwjaikudsub4rmcc5c4eme0uqntg.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 ERC721 Holdings hook
4
- export const useFetchERC721Holdings = async (walletAddress: string, port: number) => {
4
+ export const useFetchERC721Holdings = async (walletAddress: string) => {
5
5
 
6
6
  // Set options for request
7
7
  let options = {
@@ -13,7 +13,8 @@ export const useFetchERC721Holdings = async (walletAddress: string, port: number
13
13
  }
14
14
 
15
15
  // Use the custom hook to fetch data
16
- const state = useFetch(`http://localhost:${port}/erc721-holdings`, options);
16
+ // ENDPOINT - /erc721-holdings
17
+ const state = useFetch("https://rmepnjzubrgdsvmb66kdwz5upm0khfor.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 Lookup Data hook
4
- export const useFetchERC721LookupData = async (contractAddress: string, tokenID: string, port: number) => {
4
+ export const useFetchERC721LookupData = async (contractAddress: string, tokenID: string) => {
5
5
 
6
6
  // Set options for request
7
7
  let options = {
@@ -13,7 +13,8 @@ export const useFetchERC721LookupData = async (contractAddress: string, tokenID:
13
13
  }
14
14
 
15
15
  // Use the custom hook to fetch data
16
- const state = useFetch(`http://localhost:${port}/erc721-lookup-data`, options);
16
+ // ENDPOINT - /erc721-lookup-data
17
+ const state = useFetch("https://rd7cae6wlnx3lsiuncgjgeap5e0lkbew.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 Opensea data hook
4
- export const useFetchERC721OpenseaData = async (contractAddress: string, tokenID: string, port: number) => {
4
+ export const useFetchERC721OpenseaData = async (contractAddress: string, tokenID: string) => {
5
5
 
6
6
  // Set options for request
7
7
  let options = {
@@ -13,7 +13,8 @@ export const useFetchERC721OpenseaData = async (contractAddress: string, tokenID
13
13
  }
14
14
 
15
15
  // Use the custom hook to fetch data
16
- const state = useFetch(`http://localhost:${port}/erc721-opensea-data`, options);
16
+ // ENDPOINT - /erc721-opensea-data
17
+ const state = useFetch("https://qoeq2n767jbu5gbiiy7463d56m0cwdec.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 Rarity data hook
4
- export const useFetchERC721RarityData = async (contractAddress: string, tokenID: string, port: number) => {
4
+ export const useFetchERC721RarityData = async (contractAddress: string, tokenID: string) => {
5
5
 
6
6
  // Set options for request
7
7
  let options = {
@@ -13,7 +13,8 @@ export const useFetchERC721RarityData = async (contractAddress: string, tokenID:
13
13
  }
14
14
 
15
15
  // Use the custom hook to fetch data
16
- const state = useFetch(`http://localhost:${port}/erc721-rarity-data`, options);
16
+ // ENDPOINT - /erc721-rarity-data
17
+ const state = useFetch("https://eilobcax7r4wayov2rfscraqb40rodzv.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 Sales data hook
4
- export const useFetchERC721SalesData = async (contractAddress: string, tokenID: string, port: number) => {
4
+ export const useFetchERC721SalesData = async (contractAddress: string, tokenID: string) => {
5
5
 
6
6
  // Set options for request
7
7
  let options = {
@@ -13,7 +13,8 @@ export const useFetchERC721SalesData = async (contractAddress: string, tokenID:
13
13
  }
14
14
 
15
15
  // Use the custom hook to fetch data
16
- const state = useFetch(`http://localhost:${port}/erc721-sales-data`, options);
16
+ // ENDPOINT - /erc721-sales-data
17
+ const state = useFetch("https://nhjz6tqihl6bdt7zukf5ru7wnu0ydoqq.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 Transfer Lookup data hook
4
- export const useFetchERC721TransferLookupData = async (contractAddress: string, tokenID: string, port: number) => {
4
+ export const useFetchERC721TransferLookupData = async (contractAddress: string, tokenID: string) => {
5
5
 
6
6
  // Set options for request
7
7
  let options = {
@@ -13,7 +13,8 @@ export const useFetchERC721TransferLookupData = async (contractAddress: string,
13
13
  }
14
14
 
15
15
  // Use the custom hook to fetch data
16
- const state = useFetch(`http://localhost:${port}/erc721-token-transfer-lookup-data`, options);
16
+ // ENDPOINT - /erc721-token-transfer-lookup-data
17
+ const state = useFetch("https://o66cbw3kaufg5t3k2fl5ydazbq0tvfaz.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 Transfer data hook
4
- export const useFetchERC721TransfersData = async (walletAddress: string, port: number) => {
4
+ export const useFetchERC721TransfersData = async (walletAddress: string) => {
5
5
 
6
6
  // Set options for request
7
7
  let options = {
@@ -13,7 +13,8 @@ export const useFetchERC721TransfersData = async (walletAddress: string, port: n
13
13
  }
14
14
 
15
15
  // Use the custom hook to fetch data
16
- const state = useFetch(`http://localhost:${port}/erc721-wallet-transfers`, options);
16
+ // ENDPOINT - /erc721-wallet-transfers
17
+ const state = useFetch("https://gnfeczsyzj4v6rsyf4zmlpv23q0uixkv.lambda-url.us-east-1.on.aws/", options);
17
18
 
18
19
  // Return the state from the custom hook
19
20
  return state;
@@ -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 useFetchGasLookup = (port: number) => {
5
- const URL = `http://localhost:${port}/gas-information`; // Define the API endpoint
6
-
4
+ export const useFetchGasLookup = () => {
7
5
  const options = {
8
6
  method: 'GET',
9
7
  headers: {
@@ -11,7 +9,8 @@ export const useFetchGasLookup = (port: number) => {
11
9
  }
12
10
  };
13
11
 
14
- const state = useFetch(URL, options); // Use the custom hook to fetch data
12
+ // ENDPOINT - /gas-information
13
+ const state = useFetch("https://wsebjfjyi4k2kfb4mbcrcjyrqa0nwifh.lambda-url.us-east-1.on.aws/", options); // Use the custom hook to fetch data
15
14
 
16
15
  return state; // Return the state from the custom hook
17
16
  }
@@ -0,0 +1,39 @@
1
+ // ENS Hooks
2
+ export { useFetchAddressENSLookup } from './ens/useFetchAddressENSLookup';
3
+ export { useFetchENSAddressLookup } from './ens/useFetchENSAddressLookup';
4
+ export { useFetchENSIDLookup } from './ens/useFetchENSIDLookup';
5
+ export { useFetchENSNameLookup } from './ens/useFetchENSNameLookup';
6
+
7
+ // ERC20 Token Hooks
8
+ export { useFetchERC20CollectionOwners } from './erc20Tokens/useFetchERC20CollectionOwners';
9
+ export { useFetchERC20CollectionTopCoins } from './erc20Tokens/useFetchERC20CollectionTopCoins';
10
+ export { useFetchERC20CollectionTransfers } from './erc20Tokens/useFetchERC20CollectionTransfers';
11
+ export { useFetchERC20Holdings } from './erc20Tokens/useFetchERC20Holdings';
12
+ export { useFetchERC20Transfers } from './erc20Tokens/useFetchERC20Transfers';
13
+
14
+ // ERC721 Token Hooks
15
+ export { useFetchERC721CollectionAttributes } from './erc721Tokens/useFetchERC721CollectionAttributes';
16
+ export { useFetchERC721CollectionData } from './erc721Tokens/useFetchERC721CollectionData';
17
+ export { useFetchERC721CollectionExtraData } from './erc721Tokens/useFetchERC721CollectionExtraData';
18
+ export { useFetchERC721CollectionFloorPrice } from './erc721Tokens/useFetchERC721CollectionFloorPrice';
19
+ export { useFetchERC721CollectionMarketCap } from './erc721Tokens/useFetchERC721CollectionMarketCap';
20
+ export { useFetchERC721CollectionSales } from './erc721Tokens/useFetchERC721CollectionSales';
21
+ export { useFetchERC721CollectionTransfers } from './erc721Tokens/useFetchERC721CollectionTransfers';
22
+ export { useFetchERC721CollectionTrends } from './erc721Tokens/useFetchERC721CollectionTrends';
23
+ export { useFetchERC721CollectionVolume } from './erc721Tokens/useFetchERC721CollectionVolume';
24
+ export { useFetchERC721Holdings } from './erc721Tokens/useFetchERC721Holdings';
25
+ export { useFetchERC721LookupData } from './erc721Tokens/useFetchERC721LookupData';
26
+ export { useFetchERC721OpenseaData } from './erc721Tokens/useFetchERC721OpenseaData';
27
+ export { useFetchERC721RarityData } from './erc721Tokens/useFetchERC721RarityData';
28
+ export { useFetchERC721SalesData } from './erc721Tokens/useFetchERC721SalesData';
29
+ export { useFetchERC721TransferLookupData } from './erc721Tokens/useFetchERC721TransferLookupData';
30
+ export { useFetchERC721TransfersData } from './erc721Tokens/useFetchERC721TransfersData';
31
+
32
+ // Gas Hooks
33
+ export { useFetchGasLookup } from './gas/useFetchGasLookup';
34
+
35
+ // Price Hooks
36
+ export { useFetchERC20Price } from './prices/useFetchERC20Price';
37
+ export { useFetchERC721Price } from './prices/useFetchERC721Price';
38
+ export { useFetchETHPrice } from './prices/useFetchETHPrice';
39
+ export { useFetchLayerTwoPrice } from './prices/useFetchLayerTwoPrice';
@@ -1,7 +1,7 @@
1
1
  import { useFetch } from "../../custom_hooks/useFetch";
2
2
 
3
3
  // Fetching ERC20 Prices Hook
4
- export const useFetchERC20Price = async (contractAddress: string, currentPrice: boolean, duration: 2 | 14 | 30, port: number) => {
4
+ export const useFetchERC20Price = async (contractAddress: string, currentPrice: boolean, duration: 2 | 14 | 30) => {
5
5
 
6
6
  // Set options for request
7
7
  let options = {
@@ -13,7 +13,8 @@ export const useFetchERC20Price = async (contractAddress: string, currentPrice:
13
13
  }
14
14
 
15
15
  // Use the custom hook to fetch data
16
- const state = useFetch(`http://localhost:${port}/erc20-token-price`, options);
16
+ // ENDPOINT - /erc20-token-price
17
+ const state = useFetch("https://vw5caqjd3yg2oyslxcyxkln2dy0nqgxz.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 Prices Hook
4
- export const useFetchERC721Price = async (contractAddress: string, tokenID: number, port: number) => {
4
+ export const useFetchERC721Price = async (contractAddress: string, tokenID: number) => {
5
5
  // Set options for request
6
6
  let options = {
7
7
  method: 'POST',
@@ -12,7 +12,8 @@ export const useFetchERC721Price = async (contractAddress: string, tokenID: numb
12
12
  }
13
13
 
14
14
  // Use the custom hook to fetch data
15
- const state = useFetch(`http://localhost:${port}/erc721-token-price`, options);
15
+ // ENDPOINT - /erc721-token-price
16
+ const state = useFetch("https://brjvjnlp35ln3solbquo6fiize0bnwje.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 ETH Prices Hook
4
- export const useFetchETHPrice = async (currentPrice: boolean, duration: 2 | 14 | 30, port: number) => {
4
+ export const useFetchETHPrice = async (currentPrice: boolean, duration: 2 | 14 | 30) => {
5
5
 
6
6
  // Set options for request
7
7
  let options = {
@@ -13,7 +13,8 @@ export const useFetchETHPrice = async (currentPrice: boolean, duration: 2 | 14 |
13
13
  }
14
14
 
15
15
  // Use the custom hook to fetch data
16
- const state = useFetch(`http://localhost:${port}/eth-price`, options);
16
+ // ENDPOINT - /eth-price
17
+ const state = useFetch("https://fl5mxvcm42g3n7wtodnxq52s2a0jeokj.lambda-url.us-east-1.on.aws/", options);
17
18
 
18
19
  // Return the state from the custom hook
19
20
  return state;
@@ -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 useFetchLayerTwoPrice = async (layerTwo: LayerTwoNetworks, currentPrice: boolean, duration: 2 | 14 | 30, port: number) => {
5
+ export const useFetchLayerTwoPrice = async (layerTwo: LayerTwoNetworks, currentPrice: boolean, duration: 2 | 14 | 30) => {
6
6
 
7
7
  // Set options for request
8
8
  let options = {
@@ -14,7 +14,8 @@ export const useFetchLayerTwoPrice = async (layerTwo: LayerTwoNetworks, currentP
14
14
  }
15
15
 
16
16
  // Use the custom hook to fetch data
17
- const state = useFetch(`http://localhost:${port}/layer-two-prices`, options);
17
+ // ENDPOINT - /layer-two-prices
18
+ const state = useFetch("https://jt7ds5ua6iix7cpa5ueg2ud2gi0joklo.lambda-url.us-east-1.on.aws/", options);
18
19
 
19
20
  // Return the state from the custom hook
20
21
  return state;
package/package.json CHANGED
@@ -1,36 +1,38 @@
1
1
  {
2
2
  "name": "ethereum-hooks",
3
- "version": "1.0.1",
4
- "description": "Package containing useful React hooks for working with the Ethereum Blockchain.",
5
- "main": "server/server.ts",
6
- "scripts": {
7
- "start": "ts-node server/server.ts",
8
- "client": "cd client && npm start",
9
- "build": "cd client && npm run build",
10
- "install-all": "cd client && npm install && cd ../server && npm install",
11
- "build-server": "tsc -p server/tsconfig.json",
12
- "test": "echo \"No tests specified\" && exit 0"
3
+ "version": "2.0.0",
4
+ "description": "Resourceful NPM package that contains React hooks for working with the Ethereum Blockchain.",
5
+ "main": "crypto_hooks/index.js",
6
+ "types": "crypto_hooks/index.d.ts",
7
+ "repository": {
8
+ "type": "git",
9
+ "url": "https://github.com/CodingAbdullah/ethereum-hooks.git"
13
10
  },
14
11
  "keywords": [
15
12
  "api",
16
13
  "blockchain",
17
- "client",
18
- "crypto",
14
+ "data",
19
15
  "ethereum",
20
- "expressjs",
21
16
  "hooks",
22
- "nodejs",
23
17
  "reactjs",
24
- "server"
18
+ "npm"
25
19
  ],
26
20
  "author": "CodingAbdullah",
27
21
  "license": "MIT",
28
22
  "private": false,
29
- "devDependencies": {
30
- "ts-node": "^10.9.0",
31
- "typescript": "^5.7.2"
23
+ "files": [
24
+ "crypto_hooks/**/*",
25
+ "custom_hooks/**/*",
26
+ "types/**/*"
27
+ ],
28
+ "peerDependencies": {
29
+ "react": ">=18.0.0",
30
+ "react-dom": ">=18.0.0"
32
31
  },
33
- "dependencies": {
34
- "ethereum-hooks": "file:"
32
+ "devDependencies": {
33
+ "@types/react": "^19.1.12",
34
+ "react": "^19.0.0",
35
+ "react-dom": "^19.0.0",
36
+ "typescript": "^5.8.3"
35
37
  }
36
38
  }
@@ -1,25 +0,0 @@
1
- {
2
- "name": "client",
3
- "version": "1.0.1",
4
- "description": "",
5
- "main": "index.js",
6
- "scripts": {
7
- "test": "echo \"Error: no test specified\" && exit 1"
8
- },
9
- "author": "",
10
- "license": "ISC",
11
- "dependencies": {
12
- "@types/node": "^22.9.0",
13
- "@types/react": "^18.3.12",
14
- "@types/react-dom": "^18.3.1",
15
- "axios": "^1.7.7",
16
- "client": "file:",
17
- "react": "^18.3.1",
18
- "react-dom": "^18.3.1",
19
- "react-router": "^6.27.0",
20
- "react-router-dom": "^6.27.0",
21
- "react-scripts": "^5.0.1",
22
- "ts-node": "^10.9.2",
23
- "typescript": "^5.7.2"
24
- }
25
- }
Binary file
@@ -1,49 +0,0 @@
1
- List of the 30 React Hooks
2
-
3
- Prices
4
- useFetchETHPrice - [Current Price, Duration]
5
- useFetchERC20Price - [Contract Address, Current Price, Duration]
6
- useFetchERC721Price - [Contract Address, Token ID]
7
- useFetchLayerTwoPrice - [Layer Two Network, Current Price, Duration]
8
-
9
- -
10
-
11
- ERC20 Tokens
12
- useFetchERC20CollectionOwners - [Contract Address]
13
- useFetchERC20CollectionTopCoins - []
14
- useFetchERC20CollectionTransfers - [Contract Address]
15
- useFetchERC20Holdings - [Contract Address]
16
- useFetchERC20Transfers - [Contract Address]
17
-
18
- -
19
-
20
- ERC721 Tokens
21
- useFetchERC721CollectionAttributes - [Contract Address]
22
- useFetchERC721CollectionData - [Contract Address]
23
- useFetchERC721CollectionExtraData - [Contract Address]
24
- useFetchERC721CollectionFloorPrice - [Contract Address]
25
- useFetchERC721CollectionMarketCap - [Contract Address, Duration]
26
- useFetchERC721CollectionSales - [Contract Address]
27
- useFetchERC721CollectionTransfers - [Contract Address]
28
- useFetchERC721CollectionTrends - []
29
- useFetchERC721CollectionVolume - []
30
- useFetchERC721Holdings - [Wallet Address]
31
- useFetchERC721LookupData - [Contract Address, Token ID]
32
- useFetchERC721OpenseaData - [Contract Address, Token ID]
33
- useFetchERC721RarityData - [Contract Address, Token ID]
34
- useFetchERC721SalesData - [Contract Address, Token ID]
35
- useFetchERC721TransferLookupData - [Contract Address, Token ID]
36
- useFetchERC721Transfers - [Wallet Address]
37
-
38
- -
39
-
40
- ENS
41
- useFetchAddressENSLookup - [Address]
42
- useFetchENSAddressLookup - [ENS Name]
43
- useFetchENSIDLookup - [ID]
44
- useFetchENSNameLookup - [ENS Name]
45
-
46
- -
47
-
48
- Gas
49
- useFetchGasLookup - []
@@ -1,30 +0,0 @@
1
- require("dotenv").config({ path: '../.env' });
2
- import { Request, Response } from 'express';
3
- import axios from 'axios';
4
-
5
- // Address to ENS information
6
- export const addressToENSInformation = (req: Request, res: Response) => {
7
- const { address } = JSON.parse(req.body.body);
8
-
9
- const MORALIS_URL = 'https://deep-index.moralis.io/api/v2/';
10
- const options = {
11
- method: 'GET',
12
- mode: 'cors', // *cors, same-origin
13
- headers: {
14
- 'content-type' : 'application/json',
15
- 'access-control-allow-origin': '*',
16
- 'X-API-KEY' : process.env.MORALIS_API_KEY // Transpose API key hidden
17
- }
18
- }
19
-
20
- // Making back-end request call for information
21
- axios.get(MORALIS_URL + 'resolve/' + address + "/reverse", options)
22
- .then(response => {
23
- res.status(200).json({
24
- information: response.data
25
- })
26
- })
27
- .catch(() => {
28
- res.status(400).json({});
29
- })
30
- }
@@ -1,32 +0,0 @@
1
- require('dotenv').config({ path: '../.env' });
2
- import { Request, Response } from 'express';
3
- import axios from 'axios';
4
-
5
- // ENS Transfers By ID
6
- export const ensTransfersById = (req: Request, res: Response) => {
7
- const { id } = JSON.parse(req.body.body);
8
-
9
- const params = {
10
- chain_id : 'ethereum',
11
- token_id: id
12
- }
13
-
14
- const options = {
15
- headers: {
16
- 'accept' : 'application/json',
17
- 'content-type': 'application/json',
18
- 'X-API-KEY' : process.env.TRANSPOSE_API_KEY
19
- }
20
- }
21
-
22
- // Making back-end request call to fetch data
23
- axios.get('https://api.transpose.io/ens/ens-transfers-by-token-id?' + new URLSearchParams(params), options)
24
- .then(response => {
25
- res.status(200).json({
26
- information: response.data
27
- })
28
- })
29
- .catch(() => {
30
- res.status(400).json({});
31
- });
32
- }
@@ -1,32 +0,0 @@
1
- require('dotenv').config({ path: '../.env' });
2
- import { Request, Response } from 'express';
3
- import axios from 'axios';
4
-
5
- // ENS Transfers By Name
6
- export const ensTransfersByName = (req: Request, res: Response) => {
7
- const { ensName } = JSON.parse(req.body.body);
8
-
9
- const params = {
10
- chain_id : 'ethereum',
11
- ens_name: ensName
12
- }
13
-
14
- const options = {
15
- headers: {
16
- 'accept' : 'application/json',
17
- 'content-type': 'application/json',
18
- 'X-API-KEY' : process.env.TRANSPOSE_API_KEY
19
- }
20
- }
21
-
22
- // Making back-end request call for information
23
- axios.get('https://api.transpose.io/ens/ens-transfers-by-name?' + new URLSearchParams(params), options)
24
- .then(response => {
25
- res.status(200).json({
26
- information: response.data
27
- });
28
- })
29
- .catch(() => {
30
- res.status(400).json({});
31
- });
32
- }
@@ -1,32 +0,0 @@
1
- require('dotenv').config({ path: '../.env' });
2
- import { Request, Response } from 'express'
3
- import axios from 'axios';
4
-
5
- // ENS to Address Controller
6
- export const additionalENSInformation = (req: Request, res: Response) => {
7
- const { ensName } = JSON.parse(req.body.body);
8
-
9
- const params = {
10
- "chain_id": "ethereum",
11
- "ens_names": ensName,
12
- }
13
-
14
- const options = {
15
- headers: {
16
- 'accept' : 'application/json',
17
- 'content-type': 'application/json',
18
- 'X-API-KEY' : process.env.TRANSPOSE_API_KEY
19
- }
20
- }
21
-
22
- // Making back-end request call for information
23
- axios.get("https://api.transpose.io/ens/ens-records-by-name?" + new URLSearchParams(params), options)
24
- .then(response => {
25
- res.status(200).json({
26
- information: response.data
27
- })
28
- })
29
- .catch(() => {
30
- res.status(400).json({});
31
- });
32
- }