@pear-protocol/core-sdk 0.0.13 → 0.0.15

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.
@@ -1,92 +0,0 @@
1
- class Trade {
2
- client;
3
- constructor(client) {
4
- this.client = client;
5
- }
6
- async open(body, headers) {
7
- return await this.client.fetch(`/trade/open`, {
8
- method: "POST",
9
- headers,
10
- body
11
- });
12
- }
13
- async adjust(positionId, body, headers) {
14
- return await this.client.fetch(`/trade/${positionId}/adjust`, {
15
- method: "POST",
16
- headers,
17
- body
18
- });
19
- }
20
- async close(positionId, body, headers) {
21
- return await this.client.fetch(`/trade/${positionId}/close`, {
22
- method: "POST",
23
- headers,
24
- body
25
- });
26
- }
27
- async closeAll(body, headers) {
28
- return await this.client.fetch(`/trade/close-all`, {
29
- method: "POST",
30
- headers,
31
- body
32
- });
33
- }
34
- async setLeverage(body, headers) {
35
- return await this.client.fetch(`/leverage`, {
36
- method: "PUT",
37
- headers,
38
- body
39
- });
40
- }
41
- schedules = {
42
- create: async (body, headers) => {
43
- return await this.client.fetch(`/schedules`, {
44
- method: "POST",
45
- headers,
46
- body
47
- });
48
- },
49
- cancel: async (scheduleId, headers) => {
50
- return await this.client.fetch(`/schedules/${scheduleId}/cancel`, {
51
- method: "PATCH",
52
- headers
53
- });
54
- },
55
- cancelAll: async (headers) => {
56
- return await this.client.fetch(`/schedules/cancel-all`, {
57
- method: "PATCH",
58
- headers
59
- });
60
- }
61
- };
62
- triggers = {
63
- open: async (body, headers) => {
64
- return await this.client.fetch(`/triggers/open`, {
65
- method: "POST",
66
- headers,
67
- body
68
- });
69
- },
70
- close: async (body, headers) => {
71
- return await this.client.fetch(`/triggers/close`, {
72
- method: "POST",
73
- headers,
74
- body
75
- });
76
- },
77
- cancel: async (triggerId, headers) => {
78
- return await this.client.fetch(`/triggers/${triggerId}/cancel`, {
79
- method: "PATCH",
80
- headers
81
- });
82
- },
83
- cancelAll: async (headers) => {
84
- return await this.client.fetch(`/triggers/cancel-all`, {
85
- method: "PATCH",
86
- headers
87
- });
88
- }
89
- };
90
- }
91
-
92
- export { Trade };