mirror of
https://github.com/multipleof4/KalBot.git
synced 2026-03-17 14:01:02 +00:00
Refactor: hardcode series ticker, keep dynamic
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
import { signRequest, KALSHI_API_BASE } from './auth.js';
|
import { signRequest, KALSHI_API_BASE } from './auth.js';
|
||||||
|
|
||||||
|
const SERIES_TICKER = 'KXBTC15M';
|
||||||
const OPEN_EVENT_STATUSES = new Set(['open', 'active', 'initialized', 'trading']);
|
const OPEN_EVENT_STATUSES = new Set(['open', 'active', 'initialized', 'trading']);
|
||||||
|
|
||||||
async function kalshiFetch(method, path, body = null) {
|
async function kalshiFetch(method, path, body = null) {
|
||||||
@@ -68,8 +69,7 @@ async function fetchEvents(series, query) {
|
|||||||
* Returns the currently active event + its markets.
|
* Returns the currently active event + its markets.
|
||||||
*/
|
*/
|
||||||
export async function getActiveBTCEvent() {
|
export async function getActiveBTCEvent() {
|
||||||
const configuredSeries = process.env.KALSHI_SERIES_TICKER || 'KXBTC15M';
|
const seriesCandidates = [...new Set([SERIES_TICKER, SERIES_TICKER.toLowerCase()])];
|
||||||
const seriesCandidates = [...new Set([configuredSeries, configuredSeries.toUpperCase(), configuredSeries.toLowerCase()])];
|
|
||||||
const eventMap = new Map();
|
const eventMap = new Map();
|
||||||
|
|
||||||
for (const series of seriesCandidates) {
|
for (const series of seriesCandidates) {
|
||||||
|
|||||||
Reference in New Issue
Block a user