mirror of
https://github.com/FlipsideCrypto/flipside-js.git
synced 2026-02-06 10:48:11 +00:00
Update config.
This commit is contained in:
parent
56987cf57f
commit
c7aaf54f3e
29
index.html
29
index.html
@ -64,7 +64,34 @@
|
||||
});
|
||||
|
||||
flipside.multiTable("multiTable", {
|
||||
title: { text: "Top Coins" }
|
||||
assets: null,
|
||||
columns: [
|
||||
"trend",
|
||||
"userActivity",
|
||||
"developerBehavior",
|
||||
"marketMaturity",
|
||||
"rank"
|
||||
],
|
||||
exclusions: ["gas", "TRX"],
|
||||
fontFamily: "inherit",
|
||||
headers: {},
|
||||
limit: 10,
|
||||
page: 1,
|
||||
mode: "light",
|
||||
rows: {
|
||||
alternating: true,
|
||||
alternatingColors: "#eeeeee",
|
||||
dividers: false,
|
||||
dividersColor: "#979797",
|
||||
style: {}
|
||||
},
|
||||
title: {
|
||||
text: "Top Coins",
|
||||
style: { fontSize: "24px", fontWeight: 400 }
|
||||
},
|
||||
trend: {
|
||||
changeOver: 7
|
||||
}
|
||||
});
|
||||
</script>
|
||||
</body>
|
||||
|
||||
@ -21,7 +21,11 @@ export default class API {
|
||||
): Promise<any> {
|
||||
let res;
|
||||
try {
|
||||
res = await this.client.request({ url, method, params: params });
|
||||
res = await this.client.request({
|
||||
url,
|
||||
method,
|
||||
params: params
|
||||
});
|
||||
if (res.status >= 200 && res.status < 300) {
|
||||
return { data: res.data, success: true };
|
||||
}
|
||||
@ -62,6 +66,7 @@ export default class API {
|
||||
page: number;
|
||||
size?: number;
|
||||
metrics: string[];
|
||||
change_over: number;
|
||||
}) {
|
||||
return await this.client.post(`/assets/metrics`, payload);
|
||||
}
|
||||
|
||||
@ -73,8 +73,8 @@ export type Props = {
|
||||
assets?: string[];
|
||||
exclusions?: string[];
|
||||
autoWidth?: boolean;
|
||||
size?: number;
|
||||
limit?: number;
|
||||
page?: number;
|
||||
columns?: ColumnName[];
|
||||
fontFamily?: string;
|
||||
title?: {
|
||||
@ -82,7 +82,6 @@ export type Props = {
|
||||
style?: object;
|
||||
};
|
||||
trend?: {
|
||||
enabled?: boolean;
|
||||
changeOver?: number;
|
||||
};
|
||||
headers?: {
|
||||
@ -130,7 +129,8 @@ export default class MultiTable extends Component<Props, State> {
|
||||
|
||||
static defaultProps = {
|
||||
mode: "light",
|
||||
size: 10,
|
||||
limit: 10,
|
||||
page: 1,
|
||||
sortBy: "fcas",
|
||||
fontFamily: "inherit",
|
||||
columns: [
|
||||
@ -142,6 +142,9 @@ export default class MultiTable extends Component<Props, State> {
|
||||
],
|
||||
rows: {
|
||||
alternating: true
|
||||
},
|
||||
trend: {
|
||||
changeOver: 7
|
||||
}
|
||||
};
|
||||
|
||||
@ -153,11 +156,12 @@ export default class MultiTable extends Component<Props, State> {
|
||||
const res = await this.props.api.fetchMetrics({
|
||||
assets: this.props.assets,
|
||||
exclusions: this.props.exclusions,
|
||||
page: 1,
|
||||
size: 10,
|
||||
page: this.props.page,
|
||||
size: this.props.limit,
|
||||
sort_by: COLUMNS[this.state.sortColumn].sortKey,
|
||||
sort_desc: true,
|
||||
metrics: ["fcas", "utility", "dev", "market-maturity"]
|
||||
metrics: ["fcas", "utility", "dev", "market-maturity"],
|
||||
change_over: this.props.trend.changeOver
|
||||
});
|
||||
this.setState({
|
||||
loading: false,
|
||||
|
||||
Loading…
Reference in New Issue
Block a user