@spfunctions/cli 1.7.19 → 1.7.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/101.index.js +1 -0
- package/dist/12.index.js +1 -0
- package/dist/160.index.js +1 -0
- package/dist/174.index.js +1 -0
- package/dist/278.index.js +6 -0
- package/dist/582.index.js +1 -0
- package/dist/641.index.js +324 -0
- package/dist/669.index.js +1 -0
- package/dist/722.index.js +1 -0
- package/dist/788.index.js +1 -0
- package/dist/816.index.js +12 -0
- package/dist/830.index.js +1 -0
- package/dist/921.index.js +1 -0
- package/dist/index.js +1 -833
- package/package.json +5 -2
- package/dist/cache.d.ts +0 -6
- package/dist/cache.js +0 -31
- package/dist/cache.test.d.ts +0 -1
- package/dist/cache.test.js +0 -73
- package/dist/client.d.ts +0 -56
- package/dist/client.js +0 -205
- package/dist/client.test.d.ts +0 -1
- package/dist/client.test.js +0 -89
- package/dist/commands/agent.d.ts +0 -20
- package/dist/commands/agent.js +0 -4119
- package/dist/commands/announcements.d.ts +0 -3
- package/dist/commands/announcements.js +0 -28
- package/dist/commands/augment.d.ts +0 -12
- package/dist/commands/augment.js +0 -56
- package/dist/commands/balance.d.ts +0 -3
- package/dist/commands/balance.js +0 -17
- package/dist/commands/book.d.ts +0 -17
- package/dist/commands/book.js +0 -220
- package/dist/commands/cancel.d.ts +0 -5
- package/dist/commands/cancel.js +0 -41
- package/dist/commands/context.d.ts +0 -6
- package/dist/commands/context.js +0 -208
- package/dist/commands/create.d.ts +0 -7
- package/dist/commands/create.js +0 -42
- package/dist/commands/dashboard.d.ts +0 -14
- package/dist/commands/dashboard.js +0 -215
- package/dist/commands/delta.d.ts +0 -16
- package/dist/commands/delta.js +0 -115
- package/dist/commands/edges.d.ts +0 -26
- package/dist/commands/edges.js +0 -246
- package/dist/commands/evaluate.d.ts +0 -4
- package/dist/commands/evaluate.js +0 -30
- package/dist/commands/explore.d.ts +0 -14
- package/dist/commands/explore.js +0 -116
- package/dist/commands/feed.d.ts +0 -13
- package/dist/commands/feed.js +0 -73
- package/dist/commands/fills.d.ts +0 -4
- package/dist/commands/fills.js +0 -29
- package/dist/commands/forecast.d.ts +0 -4
- package/dist/commands/forecast.js +0 -53
- package/dist/commands/get.d.ts +0 -5
- package/dist/commands/get.js +0 -98
- package/dist/commands/heartbeat.d.ts +0 -20
- package/dist/commands/heartbeat.js +0 -73
- package/dist/commands/history.d.ts +0 -3
- package/dist/commands/history.js +0 -38
- package/dist/commands/liquidity.d.ts +0 -14
- package/dist/commands/liquidity.js +0 -378
- package/dist/commands/list.d.ts +0 -5
- package/dist/commands/list.js +0 -38
- package/dist/commands/login.d.ts +0 -10
- package/dist/commands/login.js +0 -98
- package/dist/commands/markets.d.ts +0 -10
- package/dist/commands/markets.js +0 -39
- package/dist/commands/milestones.d.ts +0 -8
- package/dist/commands/milestones.js +0 -56
- package/dist/commands/orders.d.ts +0 -4
- package/dist/commands/orders.js +0 -28
- package/dist/commands/performance.d.ts +0 -11
- package/dist/commands/performance.js +0 -250
- package/dist/commands/positions.d.ts +0 -19
- package/dist/commands/positions.js +0 -294
- package/dist/commands/prompt.d.ts +0 -13
- package/dist/commands/prompt.js +0 -35
- package/dist/commands/publish.d.ts +0 -15
- package/dist/commands/publish.js +0 -39
- package/dist/commands/query.d.ts +0 -15
- package/dist/commands/query.js +0 -132
- package/dist/commands/rfq.d.ts +0 -5
- package/dist/commands/rfq.js +0 -35
- package/dist/commands/scan.d.ts +0 -11
- package/dist/commands/scan.js +0 -230
- package/dist/commands/schedule.d.ts +0 -3
- package/dist/commands/schedule.js +0 -38
- package/dist/commands/settlements.d.ts +0 -6
- package/dist/commands/settlements.js +0 -50
- package/dist/commands/setup.d.ts +0 -24
- package/dist/commands/setup.js +0 -700
- package/dist/commands/signal.d.ts +0 -6
- package/dist/commands/signal.js +0 -32
- package/dist/commands/strategies.d.ts +0 -11
- package/dist/commands/strategies.js +0 -130
- package/dist/commands/telegram.d.ts +0 -15
- package/dist/commands/telegram.js +0 -125
- package/dist/commands/trade.d.ts +0 -12
- package/dist/commands/trade.js +0 -112
- package/dist/commands/watch.d.ts +0 -19
- package/dist/commands/watch.js +0 -157
- package/dist/commands/whatif.d.ts +0 -17
- package/dist/commands/whatif.js +0 -209
- package/dist/commands/x.d.ts +0 -28
- package/dist/commands/x.js +0 -167
- package/dist/config.d.ts +0 -55
- package/dist/config.js +0 -139
- package/dist/config.test.d.ts +0 -1
- package/dist/config.test.js +0 -138
- package/dist/index.d.ts +0 -20
- package/dist/kalshi.d.ts +0 -144
- package/dist/kalshi.js +0 -498
- package/dist/polymarket.d.ts +0 -237
- package/dist/polymarket.js +0 -353
- package/dist/polymarket.test.d.ts +0 -1
- package/dist/polymarket.test.js +0 -424
- package/dist/share.d.ts +0 -4
- package/dist/share.js +0 -27
- package/dist/skills/loader.d.ts +0 -19
- package/dist/skills/loader.js +0 -86
- package/dist/telegram/agent-bridge.d.ts +0 -15
- package/dist/telegram/agent-bridge.js +0 -573
- package/dist/telegram/bot.d.ts +0 -10
- package/dist/telegram/bot.js +0 -297
- package/dist/telegram/commands.d.ts +0 -11
- package/dist/telegram/commands.js +0 -120
- package/dist/telegram/format.d.ts +0 -11
- package/dist/telegram/format.js +0 -51
- package/dist/telegram/format.test.d.ts +0 -1
- package/dist/telegram/format.test.js +0 -73
- package/dist/telegram/poller.d.ts +0 -6
- package/dist/telegram/poller.js +0 -32
- package/dist/topics.d.ts +0 -17
- package/dist/topics.js +0 -102
- package/dist/topics.test.d.ts +0 -1
- package/dist/topics.test.js +0 -131
- package/dist/tui/border.d.ts +0 -33
- package/dist/tui/border.js +0 -87
- package/dist/tui/chart.d.ts +0 -19
- package/dist/tui/chart.js +0 -117
- package/dist/tui/dashboard.d.ts +0 -9
- package/dist/tui/dashboard.js +0 -814
- package/dist/tui/layout.d.ts +0 -16
- package/dist/tui/layout.js +0 -41
- package/dist/tui/screen.d.ts +0 -33
- package/dist/tui/screen.js +0 -102
- package/dist/tui/state.d.ts +0 -40
- package/dist/tui/state.js +0 -36
- package/dist/tui/widgets/commandbar.d.ts +0 -8
- package/dist/tui/widgets/commandbar.js +0 -82
- package/dist/tui/widgets/detail.d.ts +0 -9
- package/dist/tui/widgets/detail.js +0 -151
- package/dist/tui/widgets/edges.d.ts +0 -4
- package/dist/tui/widgets/edges.js +0 -34
- package/dist/tui/widgets/liquidity.d.ts +0 -9
- package/dist/tui/widgets/liquidity.js +0 -142
- package/dist/tui/widgets/orders.d.ts +0 -4
- package/dist/tui/widgets/orders.js +0 -37
- package/dist/tui/widgets/portfolio.d.ts +0 -4
- package/dist/tui/widgets/portfolio.js +0 -59
- package/dist/tui/widgets/signals.d.ts +0 -4
- package/dist/tui/widgets/signals.js +0 -31
- package/dist/tui/widgets/statusbar.d.ts +0 -8
- package/dist/tui/widgets/statusbar.js +0 -72
- package/dist/tui/widgets/thesis.d.ts +0 -4
- package/dist/tui/widgets/thesis.js +0 -66
- package/dist/tui/widgets/trade.d.ts +0 -9
- package/dist/tui/widgets/trade.js +0 -117
- package/dist/tui/widgets/upcoming.d.ts +0 -4
- package/dist/tui/widgets/upcoming.js +0 -41
- package/dist/tui/widgets/whatif.d.ts +0 -7
- package/dist/tui/widgets/whatif.js +0 -113
- package/dist/types/output.d.ts +0 -412
- package/dist/types/output.js +0 -9
- package/dist/utils.d.ts +0 -52
- package/dist/utils.js +0 -146
- package/dist/utils.test.d.ts +0 -1
- package/dist/utils.test.js +0 -111
package/dist/config.test.js
DELETED
|
@@ -1,138 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
const vitest_1 = require("vitest");
|
|
7
|
-
vitest_1.vi.mock('fs', () => ({
|
|
8
|
-
default: {
|
|
9
|
-
existsSync: vitest_1.vi.fn(),
|
|
10
|
-
readFileSync: vitest_1.vi.fn(),
|
|
11
|
-
writeFileSync: vitest_1.vi.fn(),
|
|
12
|
-
mkdirSync: vitest_1.vi.fn(),
|
|
13
|
-
unlinkSync: vitest_1.vi.fn(),
|
|
14
|
-
},
|
|
15
|
-
existsSync: vitest_1.vi.fn(),
|
|
16
|
-
readFileSync: vitest_1.vi.fn(),
|
|
17
|
-
writeFileSync: vitest_1.vi.fn(),
|
|
18
|
-
mkdirSync: vitest_1.vi.fn(),
|
|
19
|
-
unlinkSync: vitest_1.vi.fn(),
|
|
20
|
-
}));
|
|
21
|
-
const fs_1 = __importDefault(require("fs"));
|
|
22
|
-
const config_js_1 = require("./config.js");
|
|
23
|
-
(0, vitest_1.beforeEach)(() => {
|
|
24
|
-
vitest_1.vi.mocked(fs_1.default.existsSync).mockReset();
|
|
25
|
-
vitest_1.vi.mocked(fs_1.default.readFileSync).mockReset();
|
|
26
|
-
vitest_1.vi.mocked(fs_1.default.writeFileSync).mockReset();
|
|
27
|
-
vitest_1.vi.mocked(fs_1.default.mkdirSync).mockReset();
|
|
28
|
-
vitest_1.vi.mocked(fs_1.default.unlinkSync).mockReset();
|
|
29
|
-
// Clear env vars
|
|
30
|
-
delete process.env.SF_API_KEY;
|
|
31
|
-
delete process.env.SF_API_URL;
|
|
32
|
-
delete process.env.OPENROUTER_API_KEY;
|
|
33
|
-
delete process.env.KALSHI_API_KEY_ID;
|
|
34
|
-
delete process.env.KALSHI_PRIVATE_KEY_PATH;
|
|
35
|
-
delete process.env.TAVILY_API_KEY;
|
|
36
|
-
delete process.env.SF_MODEL;
|
|
37
|
-
delete process.env.TELEGRAM_BOT_TOKEN;
|
|
38
|
-
});
|
|
39
|
-
(0, vitest_1.describe)('loadFileConfig', () => {
|
|
40
|
-
(0, vitest_1.it)('returns empty object when no config file', () => {
|
|
41
|
-
vitest_1.vi.mocked(fs_1.default.existsSync).mockReturnValue(false);
|
|
42
|
-
(0, vitest_1.expect)((0, config_js_1.loadFileConfig)()).toEqual({});
|
|
43
|
-
});
|
|
44
|
-
(0, vitest_1.it)('reads and parses config file', () => {
|
|
45
|
-
vitest_1.vi.mocked(fs_1.default.existsSync).mockReturnValue(true);
|
|
46
|
-
vitest_1.vi.mocked(fs_1.default.readFileSync).mockReturnValue(JSON.stringify({ apiKey: 'sf_live_test' }));
|
|
47
|
-
(0, vitest_1.expect)((0, config_js_1.loadFileConfig)()).toEqual({ apiKey: 'sf_live_test' });
|
|
48
|
-
});
|
|
49
|
-
(0, vitest_1.it)('returns empty object on corrupt file', () => {
|
|
50
|
-
vitest_1.vi.mocked(fs_1.default.existsSync).mockReturnValue(true);
|
|
51
|
-
vitest_1.vi.mocked(fs_1.default.readFileSync).mockReturnValue('not json');
|
|
52
|
-
(0, vitest_1.expect)((0, config_js_1.loadFileConfig)()).toEqual({});
|
|
53
|
-
});
|
|
54
|
-
});
|
|
55
|
-
(0, vitest_1.describe)('loadConfig', () => {
|
|
56
|
-
(0, vitest_1.it)('returns defaults when no file and no env', () => {
|
|
57
|
-
vitest_1.vi.mocked(fs_1.default.existsSync).mockReturnValue(false);
|
|
58
|
-
const config = (0, config_js_1.loadConfig)();
|
|
59
|
-
(0, vitest_1.expect)(config.apiUrl).toBe('https://simplefunctions.dev');
|
|
60
|
-
(0, vitest_1.expect)(config.model).toBe('anthropic/claude-sonnet-4.6');
|
|
61
|
-
(0, vitest_1.expect)(config.tradingEnabled).toBe(false);
|
|
62
|
-
});
|
|
63
|
-
(0, vitest_1.it)('env vars override file values', () => {
|
|
64
|
-
vitest_1.vi.mocked(fs_1.default.existsSync).mockReturnValue(true);
|
|
65
|
-
vitest_1.vi.mocked(fs_1.default.readFileSync).mockReturnValue(JSON.stringify({
|
|
66
|
-
apiKey: 'file_key',
|
|
67
|
-
model: 'file_model',
|
|
68
|
-
}));
|
|
69
|
-
process.env.SF_API_KEY = 'env_key';
|
|
70
|
-
const config = (0, config_js_1.loadConfig)();
|
|
71
|
-
(0, vitest_1.expect)(config.apiKey).toBe('env_key');
|
|
72
|
-
(0, vitest_1.expect)(config.model).toBe('file_model');
|
|
73
|
-
});
|
|
74
|
-
(0, vitest_1.it)('file values fill gaps', () => {
|
|
75
|
-
vitest_1.vi.mocked(fs_1.default.existsSync).mockReturnValue(true);
|
|
76
|
-
vitest_1.vi.mocked(fs_1.default.readFileSync).mockReturnValue(JSON.stringify({
|
|
77
|
-
apiKey: 'file_key',
|
|
78
|
-
tavilyKey: 'tavily123',
|
|
79
|
-
}));
|
|
80
|
-
const config = (0, config_js_1.loadConfig)();
|
|
81
|
-
(0, vitest_1.expect)(config.apiKey).toBe('file_key');
|
|
82
|
-
(0, vitest_1.expect)(config.tavilyKey).toBe('tavily123');
|
|
83
|
-
});
|
|
84
|
-
});
|
|
85
|
-
(0, vitest_1.describe)('saveConfig', () => {
|
|
86
|
-
(0, vitest_1.it)('writes JSON with configuredAt', () => {
|
|
87
|
-
(0, config_js_1.saveConfig)({ apiKey: 'test_key' });
|
|
88
|
-
(0, vitest_1.expect)(vitest_1.vi.mocked(fs_1.default.mkdirSync)).toHaveBeenCalled();
|
|
89
|
-
(0, vitest_1.expect)(vitest_1.vi.mocked(fs_1.default.writeFileSync)).toHaveBeenCalled();
|
|
90
|
-
const written = JSON.parse(vitest_1.vi.mocked(fs_1.default.writeFileSync).mock.calls[0][1]);
|
|
91
|
-
(0, vitest_1.expect)(written.apiKey).toBe('test_key');
|
|
92
|
-
(0, vitest_1.expect)(written.configuredAt).toBeDefined();
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
(0, vitest_1.describe)('applyConfig', () => {
|
|
96
|
-
(0, vitest_1.it)('sets env vars from file when not already set', () => {
|
|
97
|
-
vitest_1.vi.mocked(fs_1.default.existsSync).mockReturnValue(true);
|
|
98
|
-
vitest_1.vi.mocked(fs_1.default.readFileSync).mockReturnValue(JSON.stringify({
|
|
99
|
-
apiKey: 'file_key',
|
|
100
|
-
openrouterKey: 'or_key',
|
|
101
|
-
}));
|
|
102
|
-
(0, config_js_1.applyConfig)();
|
|
103
|
-
(0, vitest_1.expect)(process.env.SF_API_KEY).toBe('file_key');
|
|
104
|
-
(0, vitest_1.expect)(process.env.OPENROUTER_API_KEY).toBe('or_key');
|
|
105
|
-
});
|
|
106
|
-
(0, vitest_1.it)('does not override existing env vars', () => {
|
|
107
|
-
process.env.SF_API_KEY = 'existing_key';
|
|
108
|
-
vitest_1.vi.mocked(fs_1.default.existsSync).mockReturnValue(true);
|
|
109
|
-
vitest_1.vi.mocked(fs_1.default.readFileSync).mockReturnValue(JSON.stringify({
|
|
110
|
-
apiKey: 'file_key',
|
|
111
|
-
}));
|
|
112
|
-
(0, config_js_1.applyConfig)();
|
|
113
|
-
(0, vitest_1.expect)(process.env.SF_API_KEY).toBe('existing_key');
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
(0, vitest_1.describe)('isConfigured', () => {
|
|
117
|
-
(0, vitest_1.it)('returns true when apiKey is set', () => {
|
|
118
|
-
process.env.SF_API_KEY = 'test';
|
|
119
|
-
vitest_1.vi.mocked(fs_1.default.existsSync).mockReturnValue(false);
|
|
120
|
-
(0, vitest_1.expect)((0, config_js_1.isConfigured)()).toBe(true);
|
|
121
|
-
});
|
|
122
|
-
(0, vitest_1.it)('returns false when no apiKey', () => {
|
|
123
|
-
vitest_1.vi.mocked(fs_1.default.existsSync).mockReturnValue(false);
|
|
124
|
-
(0, vitest_1.expect)((0, config_js_1.isConfigured)()).toBe(false);
|
|
125
|
-
});
|
|
126
|
-
});
|
|
127
|
-
(0, vitest_1.describe)('resetConfig', () => {
|
|
128
|
-
(0, vitest_1.it)('deletes config file if exists', () => {
|
|
129
|
-
vitest_1.vi.mocked(fs_1.default.existsSync).mockReturnValue(true);
|
|
130
|
-
(0, config_js_1.resetConfig)();
|
|
131
|
-
(0, vitest_1.expect)(vitest_1.vi.mocked(fs_1.default.unlinkSync)).toHaveBeenCalled();
|
|
132
|
-
});
|
|
133
|
-
(0, vitest_1.it)('does nothing if no config file', () => {
|
|
134
|
-
vitest_1.vi.mocked(fs_1.default.existsSync).mockReturnValue(false);
|
|
135
|
-
(0, config_js_1.resetConfig)();
|
|
136
|
-
(0, vitest_1.expect)(vitest_1.vi.mocked(fs_1.default.unlinkSync)).not.toHaveBeenCalled();
|
|
137
|
-
});
|
|
138
|
-
});
|
package/dist/index.d.ts
DELETED
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
/**
|
|
3
|
-
* SimpleFunctions CLI — sf
|
|
4
|
-
*
|
|
5
|
-
* Prediction market thesis agent CLI.
|
|
6
|
-
* Zero heavy dependencies: commander + native fetch.
|
|
7
|
-
*
|
|
8
|
-
* Usage:
|
|
9
|
-
* sf setup — Interactive configuration wizard
|
|
10
|
-
* sf list — List all theses
|
|
11
|
-
* sf get <id> — Full thesis details
|
|
12
|
-
* sf context <id> [--json] — Thesis context snapshot
|
|
13
|
-
* sf create "thesis text" [--async]
|
|
14
|
-
* sf signal <id> "content" [--type news|user_note|external]
|
|
15
|
-
* sf evaluate <id>
|
|
16
|
-
* sf scan "keywords" [--series TICKER] [--market TICKER] [--json]
|
|
17
|
-
* sf positions — Kalshi positions with edge overlay
|
|
18
|
-
* sf agent [thesisId] — Interactive agent mode
|
|
19
|
-
*/
|
|
20
|
-
export {};
|
package/dist/kalshi.d.ts
DELETED
|
@@ -1,144 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Kalshi Authenticated Client (CLI-side only)
|
|
3
|
-
*
|
|
4
|
-
* Uses the kalshi-typescript SDK with RSA-PSS private key auth.
|
|
5
|
-
* Credentials NEVER leave the user's machine — they are read from env vars
|
|
6
|
-
* pointing to a local PEM file.
|
|
7
|
-
*
|
|
8
|
-
* Required env vars:
|
|
9
|
-
* KALSHI_API_KEY_ID — Key ID from Kalshi dashboard
|
|
10
|
-
* KALSHI_PRIVATE_KEY_PATH — Path to RSA private key PEM file (e.g. ~/.kalshi/private.pem)
|
|
11
|
-
*/
|
|
12
|
-
/**
|
|
13
|
-
* Check if Kalshi credentials are configured locally.
|
|
14
|
-
*/
|
|
15
|
-
export declare function isKalshiConfigured(): boolean;
|
|
16
|
-
export interface KalshiPosition {
|
|
17
|
-
ticker: string;
|
|
18
|
-
event_ticker: string;
|
|
19
|
-
market_title: string;
|
|
20
|
-
side: 'yes' | 'no';
|
|
21
|
-
quantity: number;
|
|
22
|
-
average_price_paid: number;
|
|
23
|
-
current_value: number;
|
|
24
|
-
realized_pnl: number;
|
|
25
|
-
unrealized_pnl: number;
|
|
26
|
-
total_cost: number;
|
|
27
|
-
settlement_value?: number;
|
|
28
|
-
[key: string]: unknown;
|
|
29
|
-
}
|
|
30
|
-
export interface KalshiPortfolio {
|
|
31
|
-
positions: KalshiPosition[];
|
|
32
|
-
}
|
|
33
|
-
/**
|
|
34
|
-
* Get user's live positions from Kalshi.
|
|
35
|
-
* Returns null if Kalshi is not configured.
|
|
36
|
-
*/
|
|
37
|
-
export declare function getPositions(): Promise<KalshiPosition[] | null>;
|
|
38
|
-
/**
|
|
39
|
-
* Extract price in cents (0-100) from a Kalshi market object.
|
|
40
|
-
* Dollars fields first (Kalshi API returns null for integer cents fields).
|
|
41
|
-
*/
|
|
42
|
-
export declare function kalshiPriceCents(market: any): number;
|
|
43
|
-
/**
|
|
44
|
-
* Get the current market price for a given ticker (public, no auth).
|
|
45
|
-
* Returns price in cents (0-100) or null.
|
|
46
|
-
*/
|
|
47
|
-
export declare function getMarketPrice(ticker: string): Promise<number | null>;
|
|
48
|
-
/**
|
|
49
|
-
* Fetch orderbook for a ticker using local Kalshi auth credentials.
|
|
50
|
-
* Returns simplified spread/depth info or null.
|
|
51
|
-
*/
|
|
52
|
-
export interface LocalOrderbook {
|
|
53
|
-
bestBid: number;
|
|
54
|
-
bestAsk: number;
|
|
55
|
-
spread: number;
|
|
56
|
-
bidDepth: number;
|
|
57
|
-
askDepth: number;
|
|
58
|
-
liquidityScore: 'high' | 'medium' | 'low';
|
|
59
|
-
}
|
|
60
|
-
export declare function getOrderbook(ticker: string): Promise<LocalOrderbook | null>;
|
|
61
|
-
export interface PublicOrderbook {
|
|
62
|
-
yes_dollars: Array<[string, string]>;
|
|
63
|
-
no_dollars: Array<[string, string]>;
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Fetch orderbook for a ticker using the public (unauthenticated) endpoint.
|
|
67
|
-
* Returns raw yes_dollars/no_dollars arrays or null on failure.
|
|
68
|
-
*/
|
|
69
|
-
export declare function getPublicOrderbook(ticker: string, depth?: number): Promise<PublicOrderbook | null>;
|
|
70
|
-
export declare function getSettlements(params?: {
|
|
71
|
-
limit?: number;
|
|
72
|
-
cursor?: string;
|
|
73
|
-
ticker?: string;
|
|
74
|
-
}): Promise<{
|
|
75
|
-
settlements: any[];
|
|
76
|
-
cursor: string;
|
|
77
|
-
} | null>;
|
|
78
|
-
export declare function getBalance(): Promise<{
|
|
79
|
-
balance: number;
|
|
80
|
-
portfolioValue: number;
|
|
81
|
-
} | null>;
|
|
82
|
-
export declare function getOrders(params?: {
|
|
83
|
-
status?: string;
|
|
84
|
-
ticker?: string;
|
|
85
|
-
limit?: number;
|
|
86
|
-
cursor?: string;
|
|
87
|
-
}): Promise<{
|
|
88
|
-
orders: any[];
|
|
89
|
-
cursor: string;
|
|
90
|
-
} | null>;
|
|
91
|
-
export declare function getFills(params?: {
|
|
92
|
-
ticker?: string;
|
|
93
|
-
limit?: number;
|
|
94
|
-
cursor?: string;
|
|
95
|
-
}): Promise<{
|
|
96
|
-
fills: any[];
|
|
97
|
-
cursor: string;
|
|
98
|
-
} | null>;
|
|
99
|
-
export declare function getForecastHistory(params: {
|
|
100
|
-
seriesTicker: string;
|
|
101
|
-
eventTicker: string;
|
|
102
|
-
percentiles: number[];
|
|
103
|
-
startTs: number;
|
|
104
|
-
endTs: number;
|
|
105
|
-
periodInterval: number;
|
|
106
|
-
}): Promise<any[] | null>;
|
|
107
|
-
export declare function getExchangeAnnouncements(): Promise<any[]>;
|
|
108
|
-
export declare function getHistoricalMarket(ticker: string): Promise<any | null>;
|
|
109
|
-
export declare function createOrder(params: {
|
|
110
|
-
ticker: string;
|
|
111
|
-
side: 'yes' | 'no';
|
|
112
|
-
action: 'buy' | 'sell';
|
|
113
|
-
type: 'limit' | 'market';
|
|
114
|
-
count: number;
|
|
115
|
-
yes_price?: number;
|
|
116
|
-
client_order_id?: string;
|
|
117
|
-
}): Promise<{
|
|
118
|
-
order: any;
|
|
119
|
-
}>;
|
|
120
|
-
export declare function cancelOrder(orderId: string): Promise<void>;
|
|
121
|
-
export declare function batchCancelOrders(orderIds: string[]): Promise<void>;
|
|
122
|
-
export declare function amendOrder(orderId: string, params: {
|
|
123
|
-
price?: string;
|
|
124
|
-
count?: number;
|
|
125
|
-
}): Promise<{
|
|
126
|
-
order: any;
|
|
127
|
-
}>;
|
|
128
|
-
export declare function getBatchCandlesticks(params: {
|
|
129
|
-
tickers: string[];
|
|
130
|
-
startTs: number;
|
|
131
|
-
endTs: number;
|
|
132
|
-
periodInterval?: number;
|
|
133
|
-
}): Promise<{
|
|
134
|
-
market_ticker: string;
|
|
135
|
-
candlesticks: any[];
|
|
136
|
-
}[]>;
|
|
137
|
-
export declare function createRFQ(params: {
|
|
138
|
-
market_ticker: string;
|
|
139
|
-
contracts: number;
|
|
140
|
-
rest_remainder: boolean;
|
|
141
|
-
target_cost_centi_cents?: number;
|
|
142
|
-
}): Promise<{
|
|
143
|
-
id: string;
|
|
144
|
-
}>;
|