UNPKG

@msquared/etherbase-client

Version:

React hooks for interacting with Etherbase smart contracts

18 lines (17 loc) 573 B
import { getConfig } from "./config"; export async function fetchSourcesData(config) { const { httpReaderUrl } = config || getConfig(); const response = await fetch(`${httpReaderUrl}/sources`, { cache: "no-store", }); const data = await response.json(); return data; } export async function fetchCustomContractsData(config) { const { httpReaderUrl } = config || getConfig(); const response = await fetch(`${httpReaderUrl}/custom-contracts`, { cache: "no-store", }); const data = await response.json(); return data; }