blockchain-api
Version:
API utilities for interacting with the Exatechl2 blockchain
45 lines (37 loc) • 638 B
text/typescript
let RPC_URL = 'https://rpc-l2.exatech.ai';
let EXPLORER_API_URL = 'http://127.0.0.1:3002/api';
/**
* @param url
*/
export function setRpcUrl(url: string): void {
RPC_URL = url;
}
/**
* @returns
*/
export function getRpcUrl(): string {
return RPC_URL;
}
/**
*
* @param url
*/
export function setExplorerApiUrl(url: string): void {
EXPLORER_API_URL = url;
}
/**
*
* @returns
*/
export function getExplorerApiUrl(): string {
return EXPLORER_API_URL;
}
if (typeof window !== 'undefined') {
EXPLORER_API_URL = '/api';
}
export default {
getRpcUrl,
setRpcUrl,
getExplorerApiUrl,
setExplorerApiUrl
};