kraken-grid 1.4.0 → 1.4.1

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/README.md CHANGED
@@ -58,6 +58,10 @@
58
58
 
59
59
  <!-- END doctoc generated TOC please keep comment here to allow auto update -->
60
60
 
61
+ # Release Notes for version 1.4
62
+ This project has been converted to Typescript. There are also a few changes on the way to supporting the Gemini Exchange (using gemini-grid instead of krakn-grid). If you use both, lucky you! Kraken asked me to close my account after I got arrested for trading Bitcoin. See https://litmocracy.blogspot.com/2024/06/daves-narrative.html, the beginning of a book about it. I have not tested using both Gemini and Kraken with the
63
+ same instance.
64
+
61
65
  # kraken-grid BETA
62
66
  A bot that extends grid trading once you use it to create a grid using orders with conditional closes.
63
67
 
package/allocation.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
- import { Portfolio, GridPoint } from './types';
3
- import { BotInstance } from './bot';
2
+ import type { Portfolio, GridPoint } from './types.d.ts';
3
+ import type { BotInstance } from './bot.ts';
4
4
  // Asset in allocation
5
5
  export interface AllocationAsset {
6
6
  ticker: string;
package/balancer.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { AllocationInstance } from './allocation';
2
- import { BotInstance } from './bot';
1
+ import type { AllocationInstance } from './allocation.ts';
2
+ import type { BotInstance } from './bot.ts';
3
3
 
4
4
  // Configuration object passed to Balancer
5
5
  export interface BalancerConfig {
package/bot.ts CHANGED
@@ -2,17 +2,17 @@
2
2
  /* eslint-disable no-restricted-globals */
3
3
  /* eslint-disable import/extensions */
4
4
  /* eslint-disable no-console */
5
- import {GridPoint, BothSidesRef, BothSidesPair, OrderEntry,
5
+ import type {GridPoint, BothSidesRef, BothSidesPair, OrderEntry,
6
6
  KOrder, TickerResponse, ClosedOrderResponse,
7
- Portfolio, GotError, APIResponse} from './types';
8
- import {Savings} from 'savings.d';
7
+ Portfolio, GotError, APIResponse} from './types.d.ts';
8
+ import type Savings from 'savings.ts';
9
9
  export interface BotInstance {
10
10
  order(buysell: string, market: string, price: number, amt: number,
11
11
  lev?: string, inUref?: number, closeO?: number): Promise<any>;
12
12
  set(ur: any, type: any, price: any): Promise<void>;
13
13
  listOpens(isFresh?: boolean): Promise<void>;
14
14
  deleverage(opensA: any[], oid: number, undo?: boolean): Promise<void>;
15
- ExchangeSavings(): Savings;
15
+ ExchangeSavings(): SavingsInstance;
16
16
  refnum(opensA: any[], oid: number, newRef: any): Promise<void>;
17
17
  list(args: any[]): Promise<void>;
18
18
  kapi(...args: [string | [string, Record<string, any>], number?]): Promise<APIResponse>;
@@ -55,6 +55,7 @@ import PSCon from 'prompt-sync';
55
55
  import ssModule from './safestore.js'; // encrypted storage
56
56
  import ReportCon from './reports.js';
57
57
  import TFC from './testFasterCache.js';
58
+ import { SavingsInstance } from './savings.js';
58
59
 
59
60
  const prompt = PSCon({sigint: true});
60
61
  const myConfig : any = {exch: 'K'};
package/krak2gem.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  /* eslint-disable import/extensions */
2
- import Gem from './gemini';
2
+ import Gem from './gemini.js';
3
3
 
4
4
  // Define interfaces
5
5
  interface GemClientOptions {
package/manager.ts CHANGED
@@ -1,10 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  /* eslint-disable no-restricted-globals */
3
3
  import PSCon from 'prompt-sync';
4
- import { Portfolio } from './types';
5
- import Balancer from './balancer';
6
- import Savings from './savings';
7
- import Web from './web';
4
+ import type { Portfolio } from './types.d.ts';
8
5
 
9
6
  interface ManagerConfig {
10
7
  bot?: any;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kraken-grid",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "description": "Bot repeatedly buys & sells on kraken from a conditional close order.",
5
5
  "main": "./.dist/init.js",
6
6
  "bin": {
package/reports.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /* eslint-disable no-console */
2
2
  import fs from 'fs';
3
- import { Portfolio, Order, ClosedOrderResponse } from './types';
3
+ import type { Portfolio, Order, ClosedOrderResponse } from './types.d.ts';
4
4
 
5
5
  interface ReportInstance {
6
6
  getExecuted(count: number, known: ClosedOrders): Promise<any>;
@@ -4,8 +4,8 @@ import {expect, describe, test, jest} from '@jest/globals';
4
4
  import http from 'http';
5
5
  import { fileURLToPath } from 'url';
6
6
  import path, { dirname } from 'path';
7
- import fnInit from "../init";
8
- import customExpect from './customExpect';
7
+ import fnInit from "../init.js";
8
+ import customExpect from './customExpect.js';
9
9
  import TFC from '../testFasterCache.js';
10
10
 
11
11
  // eslint-disable-next-line no-underscore-dangle
package/web.ts CHANGED
@@ -5,8 +5,8 @@ import path from "path";
5
5
  import session from 'express-session';
6
6
  import bodyParser from 'body-parser';
7
7
  import fs from 'fs';
8
- import { Portfolio } from './types';
9
- import { BotInstance } from './bot';
8
+ import type { Portfolio } from './types.d.ts';
9
+ import { BotInstance } from './bot.js';
10
10
 
11
11
  const app = express();
12
12