-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
client.ts
113 lines (105 loc) · 3.33 KB
/
client.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
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
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
export function hello(name: string): string {
return `Hello ${name}! I am a cli :)`;
}
export function dispute(name: string): string {
return `Hello ${name}! I am the core :)`;
}
export function neworder(name: string): string {
return `Hello ${name}! I am the core :)`;
}
export function takesell(name: string): string {
return `Hello ${name}! I am the core :)`;
}
export function takebuy(name: string): string {
return `Hello ${name}! I am the core :)`;
}
export function addinvoice(name: string): string {
return `Hello ${name}! I am the core :)`;
}
export function getdm(name: string): string {
return `Hello ${name}! I am the core :)`;
}
export function fiatsent(name: string): string {
return `Hello ${name}! I am the core :)`;
}
export function release(name: string): string {
return `Hello ${name}! I am the core :)`;
}
export function cancel(name: string): string {
return `Hello ${name}! I am the core :)`;
}
export function rate(name: string): string {
return `Hello ${name}! I am the core :)`;
}
export function admcancel(name: string): string {
return `Hello ${name}! I am the core :)`;
}
export function admsettle(name: string): string {
return `Hello ${name}! I am the core :)`;
}
export function admlistdisputes(name: string): string {
return `Hello ${name}! I am the core :)`;
}
export function admaddsolver(name: string): string {
return `Hello ${name}! I am the core :)`;
}
export function admtakedispute(name: string): string {
return `Hello ${name}! I am the core :)`;
}
export function help(command: string): string {
let result = '';
const commandList = `listorders, neworder, takesell, takebuy , addinvoice, getdm, fiatsent, release, cancel, rate, dispute, admcancel, admsettle, admlistdisputes, admaddsolver, admtakedispute`;
switch (command) {
case 'listorders':
result = `Requests open orders from Mostro pubkey`;
break;
case 'neworder':
result = `Create a new buy/sell order on Mostro`;
break;
case 'takesell':
result = `Take a sell order from a Mostro pubkey`;
break;
case 'takebuy':
result = `Take a buy order from a Mostro pubkey`;
break;
case 'addinvoice':
result = `Buyer add a new invoice to receive the payment`;
break;
case 'getdm':
result = `Get the latest direct messages from Mostro`;
break;
case 'fiatsent':
result = `Send fiat sent message to confirm payment to other user`;
break;
case 'release':
result = `Settle the hold invoice and pay to buyer`;
break;
case 'cancel':
result = `Cancel a pending order`;
break;
case 'rate':
result = `Rate counterpart after a successful trade`;
break;
case 'dispute':
result = `Start a dispute`;
break;
case 'admcancel':
result = `Cancel an order (only admin)`;
break;
case 'admsettle':
result = `Settle a seller's hold invoice (only admin)`;
break;
case 'admlistdisputes':
result = `Requests open disputes from Mostro pubkey`;
break;
case 'admaddsolver':
result = `Add a new dispute's solver (only admin)`;
break;
case 'admtakedispute':
result = `Admin or solver take a Pending dispute (only admin)`;
break;
default:
result = `we don't have that command; Choosea supported one (${commandList})`;
}
return result;
}