ethereum-hooks 1.0.2 → 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 +81 -117
- package/{client/src/crypto_hooks → crypto_hooks}/ens/useFetchAddressENSLookup.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/ens/useFetchENSAddressLookup.ts +3 -4
- package/{client/src/crypto_hooks → crypto_hooks}/ens/useFetchENSIDLookup.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/ens/useFetchENSNameLookup.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20CollectionOwners.ts +3 -3
- package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20CollectionTopCoins.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20CollectionTransfers.ts +3 -3
- package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20Holdings.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc20Tokens/useFetchERC20Transfers.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionAttributes.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionData.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionExtraData.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionFloorPrice.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionMarketCap.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionSales.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionTransfers.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionTrends.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionVolume.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721Holdings.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721LookupData.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721OpenseaData.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721RarityData.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721SalesData.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721TransferLookupData.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721TransfersData.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/gas/useFetchGasLookup.ts +2 -2
- package/crypto_hooks/index.ts +39 -0
- package/{client/src/crypto_hooks → crypto_hooks}/prices/useFetchERC20Price.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/prices/useFetchERC721Price.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/prices/useFetchETHPrice.ts +2 -2
- package/{client/src/crypto_hooks → crypto_hooks}/prices/useFetchLayerTwoPrice.ts +2 -2
- package/package.json +19 -21
- 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/ERC721CollectionAttributesRoute.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionDataRoute.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionExtraDataRoute.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionFloorPriceRoute.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionMarketCapRoute.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionSalesRoute.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionTransfersRoute.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionTrendsRoute.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721CollectionVolumeRoute.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721HoldingsRoute.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721LookupDataRoute.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721OpenseaDataRoute.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721RarityDataRoute.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721SalesDataRoute.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721TransferLookupDataRoute.ts +0 -9
- package/server/Routes/ERC721TokensRoutes/ERC721TransfersDataRoute.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 -96
- 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/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionSales.ts
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Collection Sales Hook
|
|
4
|
-
export const useFetchERC721CollectionSales = async (contractAddress: string
|
|
4
|
+
export const useFetchERC721CollectionSales = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -14,7 +14,7 @@ export const useFetchERC721CollectionSales = async (contractAddress: string, ser
|
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
16
|
// ENDPOINT - /erc721-collection-sales
|
|
17
|
-
const state = useFetch(
|
|
17
|
+
const state = useFetch("https://b5xcn2afinyiq32izaoxe4mzua0ggxvm.lambda-url.us-east-1.on.aws/", options);
|
|
18
18
|
|
|
19
19
|
// Return the state from the custom hook
|
|
20
20
|
return state;
|
package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionTransfers.ts
RENAMED
|
@@ -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
|
|
4
|
+
export const useFetchERC721CollectionTransfers = async (contractAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -14,7 +14,7 @@ export const useFetchERC721CollectionTransfers = async (contractAddress: string,
|
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
16
|
// ENDPOINT - /erc721-collection-transfers
|
|
17
|
-
const state = useFetch(
|
|
17
|
+
const state = useFetch("https://lrtnsabh6hkimp4hqonw3foi2e0zzuxq.lambda-url.us-east-1.on.aws/", options);
|
|
18
18
|
|
|
19
19
|
// Return the state from the custom hook
|
|
20
20
|
return state;
|
package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionTrends.ts
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Collection Trends Hook
|
|
4
|
-
export const useFetchERC721CollectionTrends = async (
|
|
4
|
+
export const useFetchERC721CollectionTrends = async () => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -13,7 +13,7 @@ export const useFetchERC721CollectionTrends = async (serverURL: string) => {
|
|
|
13
13
|
|
|
14
14
|
// Use the custom hook to fetch data
|
|
15
15
|
// ENDPOINT - /erc721-collection-trends
|
|
16
|
-
const state = useFetch(
|
|
16
|
+
const state = useFetch("https://hmzkjpwut4bwaeovhryd6hie540fwvzi.lambda-url.us-east-1.on.aws/", options);
|
|
17
17
|
|
|
18
18
|
// Return the state from the custom hook
|
|
19
19
|
return state;
|
package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721CollectionVolume.ts
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Collection Volume Hook
|
|
4
|
-
export const useFetchERC721CollectionVolume = async (
|
|
4
|
+
export const useFetchERC721CollectionVolume = async () => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -13,7 +13,7 @@ export const useFetchERC721CollectionVolume = async (serverURL: string) => {
|
|
|
13
13
|
|
|
14
14
|
// Use the custom hook to fetch data
|
|
15
15
|
// ENDPOINT - /erc721-collection-volume
|
|
16
|
-
const state = useFetch(
|
|
16
|
+
const state = useFetch("https://zlksxwjaikudsub4rmcc5c4eme0uqntg.lambda-url.us-east-1.on.aws/", options);
|
|
17
17
|
|
|
18
18
|
// Return the state from the custom hook
|
|
19
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
|
|
4
|
+
export const useFetchERC721Holdings = async (walletAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -14,7 +14,7 @@ export const useFetchERC721Holdings = async (walletAddress: string, serverURL: s
|
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
16
|
// ENDPOINT - /erc721-holdings
|
|
17
|
-
const state = useFetch(
|
|
17
|
+
const state = useFetch("https://rmepnjzubrgdsvmb66kdwz5upm0khfor.lambda-url.us-east-1.on.aws/", options);
|
|
18
18
|
|
|
19
19
|
// Return the state from the custom hook
|
|
20
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
|
|
4
|
+
export const useFetchERC721LookupData = async (contractAddress: string, tokenID: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -14,7 +14,7 @@ export const useFetchERC721LookupData = async (contractAddress: string, tokenID:
|
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
16
|
// ENDPOINT - /erc721-lookup-data
|
|
17
|
-
const state = useFetch(
|
|
17
|
+
const state = useFetch("https://rd7cae6wlnx3lsiuncgjgeap5e0lkbew.lambda-url.us-east-1.on.aws/", options);
|
|
18
18
|
|
|
19
19
|
// Return the state from the custom hook
|
|
20
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
|
|
4
|
+
export const useFetchERC721OpenseaData = async (contractAddress: string, tokenID: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -14,7 +14,7 @@ export const useFetchERC721OpenseaData = async (contractAddress: string, tokenID
|
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
16
|
// ENDPOINT - /erc721-opensea-data
|
|
17
|
-
const state = useFetch(
|
|
17
|
+
const state = useFetch("https://qoeq2n767jbu5gbiiy7463d56m0cwdec.lambda-url.us-east-1.on.aws/", options);
|
|
18
18
|
|
|
19
19
|
// Return the state from the custom hook
|
|
20
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
|
|
4
|
+
export const useFetchERC721RarityData = async (contractAddress: string, tokenID: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -14,7 +14,7 @@ export const useFetchERC721RarityData = async (contractAddress: string, tokenID:
|
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
16
|
// ENDPOINT - /erc721-rarity-data
|
|
17
|
-
const state = useFetch(
|
|
17
|
+
const state = useFetch("https://eilobcax7r4wayov2rfscraqb40rodzv.lambda-url.us-east-1.on.aws/", options);
|
|
18
18
|
|
|
19
19
|
// Return the state from the custom hook
|
|
20
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
|
|
4
|
+
export const useFetchERC721SalesData = async (contractAddress: string, tokenID: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -14,7 +14,7 @@ export const useFetchERC721SalesData = async (contractAddress: string, tokenID:
|
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
16
|
// ENDPOINT - /erc721-sales-data
|
|
17
|
-
const state = useFetch(
|
|
17
|
+
const state = useFetch("https://nhjz6tqihl6bdt7zukf5ru7wnu0ydoqq.lambda-url.us-east-1.on.aws/", options);
|
|
18
18
|
|
|
19
19
|
// Return the state from the custom hook
|
|
20
20
|
return state;
|
package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721TransferLookupData.ts
RENAMED
|
@@ -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
|
|
4
|
+
export const useFetchERC721TransferLookupData = async (contractAddress: string, tokenID: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -14,7 +14,7 @@ export const useFetchERC721TransferLookupData = async (contractAddress: string,
|
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
16
|
// ENDPOINT - /erc721-token-transfer-lookup-data
|
|
17
|
-
const state = useFetch(
|
|
17
|
+
const state = useFetch("https://o66cbw3kaufg5t3k2fl5ydazbq0tvfaz.lambda-url.us-east-1.on.aws/", options);
|
|
18
18
|
|
|
19
19
|
// Return the state from the custom hook
|
|
20
20
|
return state;
|
package/{client/src/crypto_hooks → crypto_hooks}/erc721Tokens/useFetchERC721TransfersData.ts
RENAMED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching ERC721 Transfer data hook
|
|
4
|
-
export const useFetchERC721TransfersData = async (walletAddress: string
|
|
4
|
+
export const useFetchERC721TransfersData = async (walletAddress: string) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -14,7 +14,7 @@ export const useFetchERC721TransfersData = async (walletAddress: string, serverU
|
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
16
|
// ENDPOINT - /erc721-wallet-transfers
|
|
17
|
-
const state = useFetch(
|
|
17
|
+
const state = useFetch("https://gnfeczsyzj4v6rsyf4zmlpv23q0uixkv.lambda-url.us-east-1.on.aws/", options);
|
|
18
18
|
|
|
19
19
|
// Return the state from the custom hook
|
|
20
20
|
return state;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { useFetch } from "../../custom_hooks/useFetch";
|
|
2
2
|
|
|
3
3
|
// Fetching Address to ENS Custom hook
|
|
4
|
-
export const useFetchGasLookup = (
|
|
4
|
+
export const useFetchGasLookup = () => {
|
|
5
5
|
const options = {
|
|
6
6
|
method: 'GET',
|
|
7
7
|
headers: {
|
|
@@ -10,7 +10,7 @@ export const useFetchGasLookup = (serverURL: string) => {
|
|
|
10
10
|
};
|
|
11
11
|
|
|
12
12
|
// ENDPOINT - /gas-information
|
|
13
|
-
const state = useFetch(
|
|
13
|
+
const state = useFetch("https://wsebjfjyi4k2kfb4mbcrcjyrqa0nwifh.lambda-url.us-east-1.on.aws/", options); // Use the custom hook to fetch data
|
|
14
14
|
|
|
15
15
|
return state; // Return the state from the custom hook
|
|
16
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
|
|
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 = {
|
|
@@ -14,7 +14,7 @@ export const useFetchERC20Price = async (contractAddress: string, currentPrice:
|
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
16
|
// ENDPOINT - /erc20-token-price
|
|
17
|
-
const state = useFetch(
|
|
17
|
+
const state = useFetch("https://vw5caqjd3yg2oyslxcyxkln2dy0nqgxz.lambda-url.us-east-1.on.aws/", options);
|
|
18
18
|
|
|
19
19
|
// Return the state from the custom hook
|
|
20
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
|
|
4
|
+
export const useFetchERC721Price = async (contractAddress: string, tokenID: number) => {
|
|
5
5
|
// Set options for request
|
|
6
6
|
let options = {
|
|
7
7
|
method: 'POST',
|
|
@@ -13,7 +13,7 @@ export const useFetchERC721Price = async (contractAddress: string, tokenID: numb
|
|
|
13
13
|
|
|
14
14
|
// Use the custom hook to fetch data
|
|
15
15
|
// ENDPOINT - /erc721-token-price
|
|
16
|
-
const state = useFetch(
|
|
16
|
+
const state = useFetch("https://brjvjnlp35ln3solbquo6fiize0bnwje.lambda-url.us-east-1.on.aws/", options);
|
|
17
17
|
|
|
18
18
|
// Return the state from the custom hook
|
|
19
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
|
|
4
|
+
export const useFetchETHPrice = async (currentPrice: boolean, duration: 2 | 14 | 30) => {
|
|
5
5
|
|
|
6
6
|
// Set options for request
|
|
7
7
|
let options = {
|
|
@@ -14,7 +14,7 @@ export const useFetchETHPrice = async (currentPrice: boolean, duration: 2 | 14 |
|
|
|
14
14
|
|
|
15
15
|
// Use the custom hook to fetch data
|
|
16
16
|
// ENDPOINT - /eth-price
|
|
17
|
-
const state = useFetch(
|
|
17
|
+
const state = useFetch("https://fl5mxvcm42g3n7wtodnxq52s2a0jeokj.lambda-url.us-east-1.on.aws/", options);
|
|
18
18
|
|
|
19
19
|
// Return the state from the custom hook
|
|
20
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
|
|
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 = {
|
|
@@ -15,7 +15,7 @@ export const useFetchLayerTwoPrice = async (layerTwo: LayerTwoNetworks, currentP
|
|
|
15
15
|
|
|
16
16
|
// Use the custom hook to fetch data
|
|
17
17
|
// ENDPOINT - /layer-two-prices
|
|
18
|
-
const state = useFetch(
|
|
18
|
+
const state = useFetch("https://jt7ds5ua6iix7cpa5ueg2ud2gi0joklo.lambda-url.us-east-1.on.aws/", options);
|
|
19
19
|
|
|
20
20
|
// Return the state from the custom hook
|
|
21
21
|
return state;
|
package/package.json
CHANGED
|
@@ -1,16 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ethereum-hooks",
|
|
3
|
-
"version": "
|
|
4
|
-
"description": "
|
|
5
|
-
"main": "
|
|
6
|
-
"
|
|
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"
|
|
13
|
-
},
|
|
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",
|
|
14
7
|
"repository": {
|
|
15
8
|
"type": "git",
|
|
16
9
|
"url": "https://github.com/CodingAbdullah/ethereum-hooks.git"
|
|
@@ -18,23 +11,28 @@
|
|
|
18
11
|
"keywords": [
|
|
19
12
|
"api",
|
|
20
13
|
"blockchain",
|
|
21
|
-
"
|
|
22
|
-
"crypto",
|
|
14
|
+
"data",
|
|
23
15
|
"ethereum",
|
|
24
|
-
"expressjs",
|
|
25
16
|
"hooks",
|
|
26
|
-
"nodejs",
|
|
27
17
|
"reactjs",
|
|
28
|
-
"
|
|
18
|
+
"npm"
|
|
29
19
|
],
|
|
30
20
|
"author": "CodingAbdullah",
|
|
31
21
|
"license": "MIT",
|
|
32
22
|
"private": false,
|
|
33
|
-
"
|
|
34
|
-
"
|
|
35
|
-
"
|
|
23
|
+
"files": [
|
|
24
|
+
"crypto_hooks/**/*",
|
|
25
|
+
"custom_hooks/**/*",
|
|
26
|
+
"types/**/*"
|
|
27
|
+
],
|
|
28
|
+
"peerDependencies": {
|
|
29
|
+
"react": ">=18.0.0",
|
|
30
|
+
"react-dom": ">=18.0.0"
|
|
36
31
|
},
|
|
37
|
-
"
|
|
38
|
-
"
|
|
32
|
+
"devDependencies": {
|
|
33
|
+
"@types/react": "^19.1.12",
|
|
34
|
+
"react": "^19.0.0",
|
|
35
|
+
"react-dom": "^19.0.0",
|
|
36
|
+
"typescript": "^5.8.3"
|
|
39
37
|
}
|
|
40
38
|
}
|
package/client/package.json
DELETED
|
@@ -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
|
-
}
|
package/hook-server-design.png
DELETED
|
Binary file
|
package/hooksinformation.txt
DELETED
|
@@ -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
|
-
}
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
require('dotenv').config({ path: '../.env' });
|
|
2
|
-
import { Request, Response } from 'express';
|
|
3
|
-
import axios from "axios";
|
|
4
|
-
|
|
5
|
-
// Controller function for fetching ERC20 Collection Owners data
|
|
6
|
-
export const ERC20CollectionOwnersController = (req: Request, res: Response) => {
|
|
7
|
-
const { contractAddress } = JSON.parse(req.body.body);
|
|
8
|
-
|
|
9
|
-
// Add ERC20 Collection Owners Controller data parameters
|
|
10
|
-
const options = {
|
|
11
|
-
method: 'GET',
|
|
12
|
-
headers: {
|
|
13
|
-
'accept': 'application/json',
|
|
14
|
-
'content-type': 'application/json',
|
|
15
|
-
'X-API-KEY' : process.env.MORALIS_API_KEY
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
// Conditionally making API calls for ERC20 Collection Owners Controller
|
|
20
|
-
axios.get('https://deep-index.moralis.io/api/v2.2/erc20/' + contractAddress + '/owners?chain=eth&order=DESC', options)
|
|
21
|
-
.then(response => {
|
|
22
|
-
res.status(200).json({
|
|
23
|
-
information: response.data
|
|
24
|
-
});
|
|
25
|
-
})
|
|
26
|
-
.catch(() => {
|
|
27
|
-
res.status(400).json({});
|
|
28
|
-
});
|
|
29
|
-
}
|