UNPKG

@msquared/etherbase-client

Version:

React hooks for interacting with Etherbase smart contracts

16 lines (15 loc) 508 B
let config = null; export function initializeApp(userConfig) { if (!userConfig.wsReaderUrl && !userConfig.wsWriterUrl && !userConfig.httpReaderUrl) { throw new Error("wsReaderUrl or wsWriterUrl or httpReaderUrl must be provided in etherbase config"); } config = userConfig; } export function getConfig() { if (!config) { throw new Error("Etherbase must be initialized with initializeApp() before use, or use the EtherbaseProvider"); } return config; }