mirror of
https://github.com/stronk-dev/LivepeerEvents.git
synced 2025-07-05 10:45:10 +02:00
Quick n dirty 3box support
This commit is contained in:
parent
5581b84ac6
commit
8c5721560a
@ -52,6 +52,7 @@ const provider = new ethers.providers.JsonRpcProvider(API_L1_HTTP);
|
|||||||
// const ens = new ENS({ provider: web3layer1, ensAddress: getEnsAddress('1') });
|
// const ens = new ENS({ provider: web3layer1, ensAddress: getEnsAddress('1') });
|
||||||
let ensDomainCache = [];
|
let ensDomainCache = [];
|
||||||
let ensInfoCache = [];
|
let ensInfoCache = [];
|
||||||
|
let threeboxCache = [];
|
||||||
|
|
||||||
// Update CoinMarketCap related api calls every 5 minutes
|
// Update CoinMarketCap related api calls every 5 minutes
|
||||||
let cmcPriceGet = 0;
|
let cmcPriceGet = 0;
|
||||||
@ -677,7 +678,7 @@ const parseOrchestrator = async function (reqAddr) {
|
|||||||
return orchestratorCache[idx];
|
return orchestratorCache[idx];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else{
|
} else {
|
||||||
console.log("Thegraph is probably acting up, but there is no cached value. Returning null...");
|
console.log("Thegraph is probably acting up, but there is no cached value. Returning null...");
|
||||||
return {};
|
return {};
|
||||||
}
|
}
|
||||||
@ -1056,7 +1057,6 @@ const getEnsInfo = async function (addr) {
|
|||||||
}
|
}
|
||||||
return ensObj;
|
return ensObj;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Gets and caches info for a single address
|
// Gets and caches info for a single address
|
||||||
apiRouter.get("/getENS/:orch", async (req, res) => {
|
apiRouter.get("/getENS/:orch", async (req, res) => {
|
||||||
try {
|
try {
|
||||||
@ -1090,4 +1090,75 @@ apiRouter.get("/getEnsInfo", async (req, res) => {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
const getThreeBoxInfo = async function (addr) {
|
||||||
|
const now = new Date().getTime();
|
||||||
|
let wasInCache = false;
|
||||||
|
// See if it is cached
|
||||||
|
for (const thisAddr of threeboxCache) {
|
||||||
|
if (thisAddr.address === addr) {
|
||||||
|
// Check timeout
|
||||||
|
if (now - thisAddr.timestamp < CONF_TIMEOUT_ENS_INFO) {
|
||||||
|
return thisAddr;
|
||||||
|
}
|
||||||
|
wasInCache = true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// Else get it and cache it
|
||||||
|
const url = "https://explorer.livepeer.org/api/3box?account=" + addr;
|
||||||
|
await https.get(url, (res) => {
|
||||||
|
let body = "";
|
||||||
|
res.on("data", (chunk) => {
|
||||||
|
body += chunk;
|
||||||
|
});
|
||||||
|
res.on("end", () => {
|
||||||
|
try {
|
||||||
|
const data = JSON.parse(body);
|
||||||
|
const threeBoxObj = {
|
||||||
|
address: data.id,
|
||||||
|
name: data.name,
|
||||||
|
website: data.website,
|
||||||
|
description: data.description,
|
||||||
|
image: data.image,
|
||||||
|
timestamp: now
|
||||||
|
}
|
||||||
|
if (wasInCache) {
|
||||||
|
for (var idx = 0; idx < threeboxCache.length; idx++) {
|
||||||
|
if (threeboxCache[idx].address == addr) {
|
||||||
|
console.log("Updating outdated 3box info " + threeBoxObj.address + " @ " + threeBoxObj.timestamp);
|
||||||
|
threeboxCache[idx] = threeBoxObj;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.log("Caching new 3box info " + threeBoxObj.address + " @ " + threeBoxObj.timestamp);
|
||||||
|
threeboxCache.push(threeBoxObj);
|
||||||
|
}
|
||||||
|
} catch (error) {
|
||||||
|
console.error(error.message);
|
||||||
|
};
|
||||||
|
});
|
||||||
|
}).on("error", (error) => {
|
||||||
|
console.error(error.message);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
// Gets and caches info for a single address
|
||||||
|
apiRouter.get("/getThreeBox/:orch", async (req, res) => {
|
||||||
|
try {
|
||||||
|
// First resolve addr => domain name
|
||||||
|
const threeBoxInfo = await getThreeBoxInfo(req.params.orch);
|
||||||
|
res.send(threeBoxInfo);
|
||||||
|
} catch (err) {
|
||||||
|
res.status(400).send(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
// Returns entire 3box info mapping cache
|
||||||
|
apiRouter.get("/getAllThreeBox", async (req, res) => {
|
||||||
|
try {
|
||||||
|
res.send(threeboxCache);
|
||||||
|
} catch (err) {
|
||||||
|
res.status(400).send(err);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
export default apiRouter;
|
export default apiRouter;
|
@ -26,6 +26,7 @@ export const CLEAR_ORCHESTRATOR = "CLEAR_ORCHESTRATOR";
|
|||||||
export const RECEIVE_TICKETS = "RECEIVE_TICKETS";
|
export const RECEIVE_TICKETS = "RECEIVE_TICKETS";
|
||||||
export const SET_ALL_ENS_INFO = "SET_ALL_ENS_INFO";
|
export const SET_ALL_ENS_INFO = "SET_ALL_ENS_INFO";
|
||||||
export const SET_ALL_ENS_DOMAINS = "SET_ALL_ENS_DOMAINS";
|
export const SET_ALL_ENS_DOMAINS = "SET_ALL_ENS_DOMAINS";
|
||||||
|
export const SET_ALL_THREEBOX_INFO = "SET_ALL_THREEBOX_INFO";
|
||||||
|
|
||||||
const setQuotes = message => ({
|
const setQuotes = message => ({
|
||||||
type: RECEIVE_QUOTES, message
|
type: RECEIVE_QUOTES, message
|
||||||
@ -54,6 +55,9 @@ const setAllEnsInfo = message => ({
|
|||||||
const setAllEnsDomains = message => ({
|
const setAllEnsDomains = message => ({
|
||||||
type: SET_ALL_ENS_DOMAINS, message
|
type: SET_ALL_ENS_DOMAINS, message
|
||||||
});
|
});
|
||||||
|
const setAllThreeBoxInfo = message => ({
|
||||||
|
type: SET_ALL_THREEBOX_INFO, message
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
export const getQuotes = () => async dispatch => {
|
export const getQuotes = () => async dispatch => {
|
||||||
@ -552,4 +556,19 @@ export const getEnsInfo = async (addr) => {
|
|||||||
const response = await apiUtil.getEnsInfo(addr);
|
const response = await apiUtil.getEnsInfo(addr);
|
||||||
const data = await response.json();
|
const data = await response.json();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
export const getAllThreeBoxInfo = () => async dispatch => {
|
||||||
|
const response = await apiUtil.getAllThreeBox();
|
||||||
|
const data = await response.json();
|
||||||
|
if (response.ok) {
|
||||||
|
return dispatch(setAllThreeBoxInfo(data));
|
||||||
|
}
|
||||||
|
return dispatch(receiveErrors(data));
|
||||||
|
};
|
||||||
|
|
||||||
|
export const getThreeBoxInfo = async (addr) => {
|
||||||
|
const response = await apiUtil.getThreeBox(addr);
|
||||||
|
const data = await response.json();
|
||||||
|
};
|
||||||
|
|
@ -5,6 +5,8 @@ import { getEnsInfo } from "../actions/livepeer";
|
|||||||
const Address = (obj) => {
|
const Address = (obj) => {
|
||||||
const livepeer = useSelector((state) => state.livepeerstate);
|
const livepeer = useSelector((state) => state.livepeerstate);
|
||||||
const [hasRefreshed, setRefresh] = useState(false);
|
const [hasRefreshed, setRefresh] = useState(false);
|
||||||
|
let hasENS = false;
|
||||||
|
let hasThreeBox = false;
|
||||||
let thisDomain = null;
|
let thisDomain = null;
|
||||||
let thisInfo = null;
|
let thisInfo = null;
|
||||||
const now = new Date().getTime();
|
const now = new Date().getTime();
|
||||||
@ -36,6 +38,7 @@ const Address = (obj) => {
|
|||||||
for (const thisAddr of livepeer.ensInfoMapping) {
|
for (const thisAddr of livepeer.ensInfoMapping) {
|
||||||
if (thisAddr.domain === thisDomain.domain) {
|
if (thisAddr.domain === thisDomain.domain) {
|
||||||
thisInfo = thisAddr;
|
thisInfo = thisAddr;
|
||||||
|
hasENS = true;
|
||||||
// Check timeout
|
// Check timeout
|
||||||
if (now - thisAddr.timestamp < 86400000) {
|
if (now - thisAddr.timestamp < 86400000) {
|
||||||
break;
|
break;
|
||||||
@ -55,9 +58,22 @@ const Address = (obj) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ugly shit, but temporary for now to quickly enable threebox. Sorry!
|
||||||
|
if (!hasENS) {
|
||||||
|
if (livepeer.threeBoxInfo) {
|
||||||
|
for (const thisAddr of livepeer.threeBoxInfo) {
|
||||||
|
if (thisAddr.address === obj.address) {
|
||||||
|
thisInfo = thisAddr;
|
||||||
|
hasThreeBox = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let thisName;
|
let thisName;
|
||||||
let thisIcon;
|
let thisIcon;
|
||||||
if (thisInfo) {
|
if (hasENS) {
|
||||||
thisName = thisInfo.domain;
|
thisName = thisInfo.domain;
|
||||||
console.log(thisInfo.avatar);
|
console.log(thisInfo.avatar);
|
||||||
if (thisInfo.avatar) {
|
if (thisInfo.avatar) {
|
||||||
@ -71,13 +87,24 @@ const Address = (obj) => {
|
|||||||
<img alt="" src="ens.png" width="20em" height="20em" />
|
<img alt="" src="ens.png" width="20em" height="20em" />
|
||||||
</a >
|
</a >
|
||||||
}
|
}
|
||||||
|
} else if (hasThreeBox) {
|
||||||
|
if (thisInfo.name) {
|
||||||
|
thisName = <h4 className="elipsText elipsOnMobileExtra">{thisInfo.name}</h4>;
|
||||||
|
} else {
|
||||||
|
thisName = <span className="elipsText elipsOnMobileExtra">{obj.address}</span>;
|
||||||
|
}
|
||||||
|
if (thisInfo.image) {
|
||||||
|
thisIcon = <img alt="" src={"https://ipfs.livepeer.com/ipfs/" + thisInfo.image} width="20em" height="20em" style={{ margin: 0, padding: 0 }} />
|
||||||
|
} else {
|
||||||
|
thisIcon = null;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
thisName = obj.address;
|
thisName = obj.address;
|
||||||
thisIcon = null;
|
thisIcon = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="row" style={{width: 'unset'}}>
|
<div className="row" style={{ width: 'unset' }}>
|
||||||
<a className="selectOrchLight" style={{ padding: '0.2em', cursor: 'alias' }} target="_blank" rel="noopener noreferrer" href={"https://explorer.livepeer.org/accounts/" + obj.address} >
|
<a className="selectOrchLight" style={{ padding: '0.2em', cursor: 'alias' }} target="_blank" rel="noopener noreferrer" href={"https://explorer.livepeer.org/accounts/" + obj.address} >
|
||||||
<img alt="" src="livepeer.png" width="20em" height="20em" />
|
<img alt="" src="livepeer.png" width="20em" height="20em" />
|
||||||
</a>
|
</a>
|
||||||
|
@ -26,6 +26,8 @@ function copyLink(addr) {
|
|||||||
|
|
||||||
const OrchInfoViewer = (obj) => {
|
const OrchInfoViewer = (obj) => {
|
||||||
const livepeer = useSelector((state) => state.livepeerstate);
|
const livepeer = useSelector((state) => state.livepeerstate);
|
||||||
|
let hasENS = false;
|
||||||
|
let hasThreeBox = false;
|
||||||
let rewardCut = 0;
|
let rewardCut = 0;
|
||||||
let feeCut = 0;
|
let feeCut = 0;
|
||||||
let totalStake = 0;
|
let totalStake = 0;
|
||||||
@ -86,13 +88,28 @@ const OrchInfoViewer = (obj) => {
|
|||||||
for (const thisAddr of livepeer.ensInfoMapping) {
|
for (const thisAddr of livepeer.ensInfoMapping) {
|
||||||
if (thisAddr.domain === thisDomain.domain) {
|
if (thisAddr.domain === thisDomain.domain) {
|
||||||
thisInfo = thisAddr;
|
thisInfo = thisAddr;
|
||||||
|
hasENS = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ugly shit, but temporary for now to quickly enable threebox. Sorry!
|
||||||
|
if (!hasENS) {
|
||||||
|
if (livepeer.threeBoxInfo) {
|
||||||
|
for (const thisAddr of livepeer.threeBoxInfo) {
|
||||||
|
if (thisAddr.address === thisID) {
|
||||||
|
thisInfo = thisAddr;
|
||||||
|
hasThreeBox = true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let ensDescription;
|
let ensDescription;
|
||||||
let ensUrl;
|
let ensUrl;
|
||||||
if (thisInfo) {
|
if (hasENS) {
|
||||||
if (thisInfo.description) {
|
if (thisInfo.description) {
|
||||||
ensDescription =
|
ensDescription =
|
||||||
<div className="stroke">
|
<div className="stroke">
|
||||||
@ -113,6 +130,27 @@ const OrchInfoViewer = (obj) => {
|
|||||||
</a >
|
</a >
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
} else if (hasThreeBox) {
|
||||||
|
if (thisInfo.description) {
|
||||||
|
ensDescription =
|
||||||
|
<div className="stroke">
|
||||||
|
<div className="verticalDivider" />
|
||||||
|
<span>{thisInfo.description}</span>
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
if (thisInfo.website) {
|
||||||
|
if (!thisInfo.website.startsWith('http')) {
|
||||||
|
thisInfo.website = "https://" + thisInfo.website;
|
||||||
|
}
|
||||||
|
ensUrl =
|
||||||
|
<div className="stroke">
|
||||||
|
<a className="selectOrchLight" style={{ cursor: 'alias' }} target="_blank" rel="noopener noreferrer" href={thisInfo.website} >
|
||||||
|
<div className="rowAlignLeft">
|
||||||
|
<span>{thisInfo.website}</span>
|
||||||
|
</div>
|
||||||
|
</a >
|
||||||
|
</div>
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
|
@ -1,16 +1,18 @@
|
|||||||
import React, { useState } from "react";
|
import React, { useState } from "react";
|
||||||
import {
|
import {
|
||||||
getOrchestratorInfo
|
getOrchestratorInfo, getEnsInfo, getThreeBoxInfo
|
||||||
} from "../actions/livepeer";
|
} from "../actions/livepeer";
|
||||||
import { useDispatch, useSelector } from 'react-redux';
|
import { useDispatch, useSelector } from 'react-redux';
|
||||||
import { getEnsInfo } from "../actions/livepeer";
|
|
||||||
|
|
||||||
const EventButtonAddress = (obj) => {
|
const EventButtonAddress = (obj) => {
|
||||||
const dispatch = useDispatch();
|
const dispatch = useDispatch();
|
||||||
const livepeer = useSelector((state) => state.livepeerstate);
|
const livepeer = useSelector((state) => state.livepeerstate);
|
||||||
const [hasRefreshed, setRefresh] = useState(false);
|
const [hasRefreshed, setRefresh] = useState(false);
|
||||||
|
const [hasThreeBoxRefreshed, setThreeBoxRefresh] = useState(false);
|
||||||
let thisDomain = null;
|
let thisDomain = null;
|
||||||
let thisInfo = null;
|
let thisInfo = null;
|
||||||
|
let hasENS = false;
|
||||||
|
let hasThreeBox = false;
|
||||||
const now = new Date().getTime();
|
const now = new Date().getTime();
|
||||||
// Lookup domain in cache
|
// Lookup domain in cache
|
||||||
if (livepeer.ensDomainMapping) {
|
if (livepeer.ensDomainMapping) {
|
||||||
@ -40,6 +42,7 @@ const EventButtonAddress = (obj) => {
|
|||||||
for (const thisAddr of livepeer.ensInfoMapping) {
|
for (const thisAddr of livepeer.ensInfoMapping) {
|
||||||
if (thisAddr.domain === thisDomain.domain) {
|
if (thisAddr.domain === thisDomain.domain) {
|
||||||
thisInfo = thisAddr;
|
thisInfo = thisAddr;
|
||||||
|
hasENS = true;
|
||||||
// Check timeout
|
// Check timeout
|
||||||
if (now - thisAddr.timestamp < 86400000) {
|
if (now - thisAddr.timestamp < 86400000) {
|
||||||
break;
|
break;
|
||||||
@ -59,21 +62,62 @@ const EventButtonAddress = (obj) => {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Ugly shit, but temporary for now to quickly enable threebox. Sorry!
|
||||||
|
if (!hasENS) {
|
||||||
|
if (livepeer.threeBoxInfo) {
|
||||||
|
for (const thisAddr of livepeer.threeBoxInfo) {
|
||||||
|
if (thisAddr.address === obj.address) {
|
||||||
|
thisInfo = thisAddr;
|
||||||
|
hasThreeBox = true;
|
||||||
|
// Check timeout
|
||||||
|
if (now - thisAddr.timestamp < 86400000) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
// Is outdated
|
||||||
|
if (!hasThreeBoxRefreshed) {
|
||||||
|
getThreeBoxInfo(obj.address);
|
||||||
|
setThreeBoxRefresh(true);
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// If it was not cached at all
|
||||||
|
if (thisDomain == null && !hasThreeBoxRefreshed) {
|
||||||
|
setThreeBoxRefresh(true);
|
||||||
|
getThreeBoxInfo(obj.address);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
let thisName;
|
let thisName;
|
||||||
let thisIcon;
|
let thisIcon;
|
||||||
if (thisInfo) {
|
if (hasENS) {
|
||||||
thisName = <h4 className="elipsText elipsOnMobileExtra">{thisInfo.domain}</h4>;
|
if (thisInfo) {
|
||||||
if (thisInfo.avatar) {
|
thisName = <h4 className="elipsText elipsOnMobileExtra">{thisInfo.domain}</h4>;
|
||||||
thisIcon =
|
if (thisInfo.avatar) {
|
||||||
<a className="selectOrch" style={{ padding: '0', cursor: 'alias' }} target="_blank" rel="noopener noreferrer" href={"https://app.ens.domains/name/" + thisInfo.domain + "/details"} >
|
thisIcon =
|
||||||
<img alt="" src={thisInfo.avatar.url} width="20em" height="20em" style={{ margin: 0, padding: 0 }} />
|
<a className="selectOrch" style={{ padding: '0', cursor: 'alias' }} target="_blank" rel="noopener noreferrer" href={"https://app.ens.domains/name/" + thisInfo.domain + "/details"} >
|
||||||
</a >
|
<img alt="" src={thisInfo.avatar.url} width="20em" height="20em" style={{ margin: 0, padding: 0 }} />
|
||||||
|
</a >
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
thisName = <span className="elipsText elipsOnMobileExtra">{obj.address}</span>;
|
||||||
|
thisIcon = null;
|
||||||
|
}
|
||||||
|
} else if (hasThreeBox) {
|
||||||
|
if (thisInfo.name) {
|
||||||
|
thisName = <h4 className="elipsText elipsOnMobileExtra">{thisInfo.name}</h4>;
|
||||||
|
} else {
|
||||||
|
thisName = <span className="elipsText elipsOnMobileExtra">{obj.address}</span>;
|
||||||
|
}
|
||||||
|
if (thisInfo.image) {
|
||||||
|
thisIcon = <img alt="" src={"https://ipfs.livepeer.com/ipfs/" + thisInfo.image} width="20em" height="20em" style={{ margin: 0, padding: 0 }} />
|
||||||
|
} else {
|
||||||
|
thisIcon = null;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
thisName = <span className="elipsText elipsOnMobileExtra">{obj.address}</span>;
|
|
||||||
thisIcon = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="rowAlignLeft" style={{ width: '100%' }}>
|
<div className="rowAlignLeft" style={{ width: '100%' }}>
|
||||||
<a className="selectOrch" style={{ padding: '0.2em', cursor: 'alias' }} rel="noopener noreferrer" target="_blank" href={"https://explorer.livepeer.org/accounts/" + obj.address}>
|
<a className="selectOrch" style={{ padding: '0.2em', cursor: 'alias' }} rel="noopener noreferrer" target="_blank" href={"https://explorer.livepeer.org/accounts/" + obj.address}>
|
||||||
|
@ -5,7 +5,7 @@ import {
|
|||||||
} from "../actions/user";
|
} from "../actions/user";
|
||||||
import {
|
import {
|
||||||
getQuotes, getBlockchainData, getEvents, getCurrentOrchestratorInfo, getTickets,
|
getQuotes, getBlockchainData, getEvents, getCurrentOrchestratorInfo, getTickets,
|
||||||
getAllEnsDomains, getAllEnsInfo
|
getAllEnsDomains, getAllEnsInfo, getAllThreeBoxInfo
|
||||||
} from "../actions/livepeer";
|
} from "../actions/livepeer";
|
||||||
import { login } from "../actions/session";
|
import { login } from "../actions/session";
|
||||||
|
|
||||||
@ -40,6 +40,7 @@ const Startup = (obj) => {
|
|||||||
const refreshENS = () => {
|
const refreshENS = () => {
|
||||||
console.log("Refreshing ENS data...");
|
console.log("Refreshing ENS data...");
|
||||||
batch(() => {
|
batch(() => {
|
||||||
|
dispatch(getAllThreeBoxInfo());
|
||||||
dispatch(getAllEnsDomains());
|
dispatch(getAllEnsDomains());
|
||||||
dispatch(getAllEnsInfo());
|
dispatch(getAllEnsInfo());
|
||||||
});
|
});
|
||||||
|
@ -7,7 +7,8 @@ import {
|
|||||||
CLEAR_ORCHESTRATOR,
|
CLEAR_ORCHESTRATOR,
|
||||||
RECEIVE_TICKETS,
|
RECEIVE_TICKETS,
|
||||||
SET_ALL_ENS_INFO,
|
SET_ALL_ENS_INFO,
|
||||||
SET_ALL_ENS_DOMAINS
|
SET_ALL_ENS_DOMAINS,
|
||||||
|
SET_ALL_THREEBOX_INFO
|
||||||
} from "../../actions/livepeer";
|
} from "../../actions/livepeer";
|
||||||
|
|
||||||
export default (state = {
|
export default (state = {
|
||||||
@ -40,6 +41,8 @@ export default (state = {
|
|||||||
return { ...state, ensInfoMapping: message };
|
return { ...state, ensInfoMapping: message };
|
||||||
case SET_ALL_ENS_DOMAINS:
|
case SET_ALL_ENS_DOMAINS:
|
||||||
return { ...state, ensDomainMapping: message };
|
return { ...state, ensDomainMapping: message };
|
||||||
|
case SET_ALL_THREEBOX_INFO:
|
||||||
|
return { ...state, threeBoxInfo: message };
|
||||||
default:
|
default:
|
||||||
return { ...state };
|
return { ...state };
|
||||||
}
|
}
|
||||||
|
@ -89,3 +89,21 @@ export const getEnsInfo = (addr) => (
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
);
|
);
|
||||||
|
|
||||||
|
export const getAllThreeBox = () => (
|
||||||
|
fetch("api/livepeer/getAllThreeBox/", {
|
||||||
|
method: "GET",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
|
||||||
|
export const getThreeBox = (addr) => (
|
||||||
|
fetch("api/livepeer/getThreeBox/" + addr, {
|
||||||
|
method: "GET",
|
||||||
|
headers: {
|
||||||
|
"Content-Type": "application/json"
|
||||||
|
}
|
||||||
|
})
|
||||||
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user