-
Notifications
You must be signed in to change notification settings - Fork 4
/
eth-btc-mockup.ts
40 lines (32 loc) · 1.41 KB
/
eth-btc-mockup.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import { Bot } from "../../src/Bot/Bot";
import { OrderAction } from "../../src/Bot/Order";
import { SubscriptionData } from "../../src/Bot/Subscription";
// Subscription `ethBtcKrakenBuy` action callback
export const actionEthBtcBuy = (
subscription: SubscriptionData
) => {
// console.log(subscription);
// Bot.log(JSON.stringify(subscription));
Bot.log(`actionEthBtcBuy`);
// NOTE: All items instanciated within a playbook, are prefixed with their item type
// which gives the impression that you can use the same item `name` value everywhere.
// The example below shows how to call a playbook instanciated order
// with `name` of `ethBtcKrakenSell`.
// If you are setting up a bot without using the playbook functionality,
// you will need to use unique `name` values within your items.
// By default, if you add two items with the same `name` values to `Bot.setItem`,
// you will only get the first item that was added, when calling `Bot.getItem`.
// Use the item `uuid` instead for unique referencing.
// For item `name` based overwriting, use `BOT_ITEM_NAME_OVERWRITE=1` on `.env`
// let ethBtcKrakenSell = Bot.getItem('order.ethBtcKrakenSell');
// console.log(ethBtcKrakenSell);
// ethBtcKrakenSell.execute(OrderAction.Open);
Bot.exit();
};
// Subscription `ethBtcKrakenSell` action callback
export const actionEthBtcSell = (
subscription: SubscriptionData
) => {
Bot.log(`actionEthBtcSell`);
Bot.exit();
};