Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const state = {
ready: false,
ishuman: false,
rhusername: '',
}
store.register('security', state)
declare global { namespace Store { interface State { security: typeof state } } }
export const doc = {
uuid: lockr.get('security.uuid'),
finger: lockr.get('security.finger'),
} as Security.Doc
// export function headers() {
// let headers = {
// 'x-uuid': `${doc.uuid}.${Date.now()}`,
// 'x-finger': doc.finger,
// } as Dict
// return headers
// }
const copts = {
domain: core.HOSTNAME,
path: '/', sameSite: true,
} as cookie.CookieSerializeOptions
export function cookies() {
Lockr.set("optional", list);
}
let newdataSource = dataSource.map(item => {
if (record.exchange_id == item.exchange_id) {
item.isChecked = !item.isChecked;
}
return item;
});
let newUnRecomendList = unRecomendList.map(item => {
if (record.exchange_id == item.exchange_id) {
item.isChecked = !item.isChecked;
}
return item;
});
if (Lockr.get("DEX") != "GEM") {
this.setState({
dataSource: newdataSource,
unRecomendList: newUnRecomendList || []
});
}
// if (Lockr.get("DEX") == "GEM") {
// let new20List = dataSource.filter(item => item.isChecked);
// let newUnrecoment = unRecomendList.filter(item => item.isChecked);
// this.setState({
// dataSource: new20List,
// unRecomendList: newUnrecoment || []
// });
// } else {
// this.setState({ dataSource: newdataSource });
// }
initCompile = () => {
// code
const compileCode = Lockr.get('CompileCode');
// 编译状态
const compileStatus = Lockr.get('CompileStatus');
// contractNameList
const contractNameList = Lockr.get('contractNameList');
// compileInfo
const compileInfo = Lockr.get('compileInfo');
// 编译文件列表
const compileFiles = Lockr.get('compileFiles');
const files = compileFiles && this.dataUrlToFile(compileFiles);
this.setState({
code: compileCode && compileCode,
CompileStatus: compileStatus || [],
contractNameList: contractNameList || [],
compileInfo: compileInfo || [],
compileFiles: files || [],
curFile: files && files[0] && files[0].name
});
}
}
}
}
}
if (Lockr.get('optional')) {
let optional = Lockr.get('optional');
for (let i in exchangesList) {
for (let j in optional) {
if (exchangesList[i].exchange_id == optional[j]) {
exchangesList[i].optionalBok = true;
}
}
}
}
if (Lockr.get('dex20')) {
let dex20list = Lockr.get('dex20');
for (let i in exchange20List) {
for (let j in dex20list) {
if (exchange20List[i].exchange_id == dex20list[j]) {
exchange20List[i].optionalBok = true;
}
}
}
}
let newlist = _.concat(exchange20List,exchangesAllList)
let unreviewedTokenList = _(newlist)
.filter(o => o['optionalBok'] == true)
.value();
export function getFriendsExpiry() {
var defaultValue = 60 * 24 * 7; //1 week
return lockr.get('friendsExpiry', defaultValue);
}
async loadPrices() {
var dataEur = Lockr.get("dataEur");
var dataEth = Lockr.get("dataEth");
let eurURL = encodeURI(
`https://api.coinmarketcap.com/v1/ticker/tronix/?convert=EUR`
);
let ethURL = encodeURI(
`https://api.coinmarketcap.com/v1/ticker/tronix/?convert=ETH`
);
if (!Lockr.get("dataEur")) {
var { data: dataEur } = await xhr.get(
`${API_URL}/api/system/proxy?url=${eurURL}`
);
}
if (!Lockr.get("dataEth")) {
var { data: dataEth } = await xhr.get(
`${API_URL}/api/system/proxy?url=${ethURL}`
constructor() {
super();
this.date = "2019-04-18T15:00:00.000Z";
this.state = {
dataSource: [],
time: null,
tokenAudited: true,
exchangesList: [],
optional: Lockr.get("optional") ? Lockr.get("optional") : [],
optionalBok: true,
search: "",
searchExchangesList: [],
showSearch: false,
activeIndex: "",
optionalDisable: false,
searchAddId: false,
listGrount: {
dex: [],
dex20: [],
favorites: []
},
tagLock: true,
open: false,
id: alpha(24),
day: "",
get() {
return Object.assign({}, this._defaults, Lockr.get(MEDIA_PLAYER_SETTINGS_KEY) || {});
}
componentDidMount() {
this.setState({ queries: Lockr.get('queries', []) });
}
beforeMount() {
global.ePub = Epub;
this.book = new Epub(this.epubURL);
const { theme = this.theme, fontSize = this.fontSize } =
Lockr.get(EPUB_RENDERER_SETTINGS_KEY) || {};
this.theme = theme;
this.fontSize = fontSize;
},
mounted() {