-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtradingRules_sellerAsMaker.mjs
67 lines (63 loc) · 2.08 KB
/
tradingRules_sellerAsMaker.mjs
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/**
* This file exports an array of trading-related rule objects.
*
* @see {@link ./rules.mjs} for the definition of Rule.
* @type {Rule[]}
*/
export const tradingRules = [
/**
* Step 1. Phase DEPOSIT_PAID
*/
{
eventName: 'SellerAsMakerTrade_SELLER_PUBLISHED_DEPOSIT_TX',
logger: 'b.c.t.m.b.Trade',
pattern: 'Set new state at SellerAsMakerTrade (id={0}): SELLER_PUBLISHED_DEPOSIT_TX',
message: '({0}) Deposit transaction has been published. Wait for blockchain confirmation!',
level: 'notice',
sendToTelegram: true,
},
/**
* Step 2. Phase DEPOSIT_CONFIRMED
*/
{
eventName: 'SellerAsMakerTrade_DEPOSIT_CONFIRMED_IN_BLOCK_CHAIN',
logger: 'b.c.t.m.b.Trade',
pattern: 'Set new state at SellerAsMakerTrade (id={0}): DEPOSIT_CONFIRMED_IN_BLOCK_CHAIN',
message: '({0}) Deposit transaction is confirmed. Wait until BTC buyer starts the payment!',
level: 'notice',
sendToTelegram: true,
},
/**
* Step 3. Phase FIAT_PAYMENT_INITIATED
*/
{
eventName: 'SellerAsMakerTrade_SELLER_RECEIVED_FIAT_PAYMENT_INITIATED_MSG',
logger: 'b.c.t.m.b.Trade',
pattern: 'Set new state at SellerAsMakerTrade (id={0}): SELLER_RECEIVED_FIAT_PAYMENT_INITIATED_MSG',
message: '({0}) BTC buyer has started the payment. Check that you have received the payment, then confirm payment receipt!',
level: 'notice',
sendToTelegram: true,
},
/**
* phase FIAT_SENT
*/
{
eventName: 'SellerAsMakerTrade_SELLER_CONFIRMED_IN_UI_FIAT_PAYMENT_RECEIPT',
logger: 'b.c.t.m.b.Trade',
pattern: 'Set new state at SellerAsMakerTrade (id={0}): SELLER_CONFIRMED_IN_UI_FIAT_PAYMENT_RECEIPT',
message: '({0}) You confirmed payment receipt',
level: 'notice',
sendToTelegram: true,
},
/**
* Step 4. Phase PAYOUT_TX_PUBLISHED
*/
{
eventName: 'SellerAsMakerTrade_SELLER_SENT_PAYOUT_TX_PUBLISHED_MSG',
logger: 'b.c.t.m.b.Trade',
pattern: `Set new state at SellerAsMakerTrade (id={0}): SELLER_SENT_PAYOUT_TX_PUBLISHED_MSG`,
message: '({0}) The trade is completed',
level: 'notice',
sendToTelegram: true
},
]