mirror of
https://github.com/freqtrade/frequi.git
synced 2024-11-10 10:21:55 +00:00
Add type for whitelist resonse
This commit is contained in:
parent
fa8b43fdf1
commit
2b8c89eba4
|
@ -13,6 +13,7 @@ import {
|
|||
EMPTY_PLOTCONFIG,
|
||||
AvailablePairPayload,
|
||||
PlotConfigStorage,
|
||||
WhitelistResponse,
|
||||
} from '@/types';
|
||||
|
||||
import {
|
||||
|
@ -89,7 +90,7 @@ export default {
|
|||
updatePerformance(state, performance) {
|
||||
state.performanceStats = performance;
|
||||
},
|
||||
updateWhitelist(state, whitelist) {
|
||||
updateWhitelist(state, whitelist: WhitelistResponse) {
|
||||
state.whitelist = whitelist.whitelist;
|
||||
state.pairlistMethods = whitelist.method;
|
||||
},
|
||||
|
|
|
@ -8,3 +8,9 @@ export interface BlacklistResponse {
|
|||
blacklist: Array<string>;
|
||||
errors: Record<string, string>;
|
||||
}
|
||||
|
||||
export interface WhitelistResponse {
|
||||
method: Array<string>;
|
||||
length: number;
|
||||
whitelist: Array<string>;
|
||||
}
|
||||
|
|
|
@ -41,6 +41,7 @@ import {
|
|||
AvailablePairResult,
|
||||
PairCandlePayload,
|
||||
PairHistoryPayload,
|
||||
WhitelistResponse,
|
||||
} from '@/types';
|
||||
|
||||
const ftbot = namespace('ftbot');
|
||||
|
@ -77,7 +78,7 @@ export default class Graphs extends Vue {
|
|||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
@ftbot.Action public getPairHistory!: (payload: PairHistoryPayload) => void;
|
||||
|
||||
@ftbot.Action public getWhitelist!: () => Promise<any>;
|
||||
@ftbot.Action public getWhitelist!: () => Promise<WhitelistResponse>;
|
||||
|
||||
@ftbot.Action public getAvailablePairs!: (
|
||||
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
||||
|
@ -86,7 +87,7 @@ export default class Graphs extends Vue {
|
|||
|
||||
mounted() {
|
||||
this.getWhitelist().then((whitelist) => {
|
||||
console.log(whitelist?.whitelist?.length > 0);
|
||||
// Autoselect first pair in whitelist
|
||||
if (whitelist?.whitelist?.length > 0) {
|
||||
[this.pair] = whitelist.whitelist;
|
||||
this.refresh();
|
||||
|
|
Loading…
Reference in New Issue
Block a user