@pear-protocol/core-sdk 0.0.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.
@@ -0,0 +1,135 @@
1
+ class Info {
2
+ client;
3
+ constructor(client) {
4
+ this.client = client;
5
+ }
6
+ accounts = {
7
+ list: async (headers) => {
8
+ return await this.client.fetch(`/trade-accounts`, {
9
+ method: "GET",
10
+ headers
11
+ });
12
+ },
13
+ create: async (body, headers) => {
14
+ return await this.client.fetch(`/trade-accounts`, {
15
+ method: "POST",
16
+ headers,
17
+ body
18
+ });
19
+ },
20
+ update: async (id, body, headers) => {
21
+ return await this.client.fetch(`/trade-accounts/${id}`, {
22
+ method: "PATCH",
23
+ headers,
24
+ body
25
+ });
26
+ },
27
+ delete: async (id, headers) => {
28
+ return await this.client.fetch(`/trade-accounts/${id}`, {
29
+ method: "DELETE",
30
+ headers
31
+ });
32
+ },
33
+ credentials: async (id, headers) => {
34
+ return await this.client.fetch(`/trade-accounts/${id}/credentials`, {
35
+ method: "GET",
36
+ headers
37
+ });
38
+ }
39
+ };
40
+ users = {
41
+ profile: async (headers) => {
42
+ return await this.client.fetch(`/users/profile`, {
43
+ method: "GET",
44
+ headers
45
+ });
46
+ },
47
+ updatePreferences: async (body, headers) => {
48
+ return await this.client.fetch(`/users/preferences`, {
49
+ method: "PATCH",
50
+ headers,
51
+ body
52
+ });
53
+ }
54
+ };
55
+ schedules = {
56
+ list: async (query, headers) => {
57
+ return await this.client.fetch(`/schedules`, {
58
+ method: "GET",
59
+ headers,
60
+ query
61
+ });
62
+ }
63
+ };
64
+ triggers = {
65
+ list: async (query, headers) => {
66
+ return await this.client.fetch(`/triggers`, {
67
+ method: "GET",
68
+ headers,
69
+ query
70
+ });
71
+ }
72
+ };
73
+ positions = {
74
+ list: async (query, headers) => {
75
+ return await this.client.fetch(`/positions`, {
76
+ method: "GET",
77
+ headers,
78
+ query
79
+ });
80
+ }
81
+ };
82
+ fills = {
83
+ details: async (positionId, headers) => {
84
+ return await this.client.fetch(`/fills/${positionId}`, {
85
+ method: "GET",
86
+ headers
87
+ });
88
+ },
89
+ list: async (query, headers) => {
90
+ return await this.client.fetch(`/fills`, {
91
+ method: "GET",
92
+ headers,
93
+ query
94
+ });
95
+ }
96
+ };
97
+ executions = {
98
+ list: async (query, headers) => {
99
+ return await this.client.fetch(`/executions`, {
100
+ method: "GET",
101
+ headers,
102
+ query
103
+ });
104
+ }
105
+ };
106
+ instruments = {
107
+ list: async (query, headers) => {
108
+ return await this.client.fetch(`/instruments`, {
109
+ method: "GET",
110
+ headers,
111
+ query
112
+ });
113
+ }
114
+ };
115
+ prices = {
116
+ list: async (query, headers) => {
117
+ return await this.client.fetch(`/prices`, {
118
+ method: "GET",
119
+ headers,
120
+ query
121
+ });
122
+ }
123
+ };
124
+ funding = {
125
+ list: async (query, headers) => {
126
+ return await this.client.fetch(`/funding`, {
127
+ method: "GET",
128
+ headers,
129
+ query
130
+ });
131
+ }
132
+ };
133
+ }
134
+
135
+ export { Info };