@riocrypto/common 1.0.1508 → 1.0.1511

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.
@@ -52,6 +52,10 @@ import { BankAccountVerification } from "../types/bank-account-verification";
52
52
  import { MultipartLiquidityOrder } from "../types/multipart-liquidity-order";
53
53
  import { LiquidityOrderRecipe } from "../types/liquidity-order-recipe";
54
54
  import { Onboarding } from "../types/onboarding";
55
+ import { AlertTriggerCondition } from "../types/alert-trigger-condition";
56
+ import { Side } from "../types/side";
57
+ import { Alert } from "../types/alert";
58
+ import { AlertType } from "../types/alert-type";
55
59
  export declare class RioAdminClient {
56
60
  private axios;
57
61
  constructor(axios: AxiosStatic | AxiosInstance);
@@ -80,6 +84,34 @@ export declare class RioAdminClient {
80
84
  createTemporaryVerification(phoneNumber: string): Promise<{
81
85
  code: string;
82
86
  }>;
87
+ createAlert({ priceTrigger, liquidityTrigger, destinationType, telegramDestination, }: {
88
+ type: AlertType;
89
+ priceTrigger?: {
90
+ condition: AlertTriggerCondition;
91
+ value: number;
92
+ side: Side;
93
+ fiat: Fiat;
94
+ crypto: Crypto;
95
+ cooldown?: number;
96
+ };
97
+ liquidityTrigger?: {
98
+ condition: AlertTriggerCondition;
99
+ value: number;
100
+ assetType?: "crypto" | "fiat";
101
+ asset?: Crypto | Fiat;
102
+ cooldown?: number;
103
+ };
104
+ destinationType: "telegram";
105
+ telegramDestination: {
106
+ chatId?: string;
107
+ username?: string;
108
+ };
109
+ }): Promise<{
110
+ code: string;
111
+ }>;
112
+ getAlerts(): Promise<Alert[]>;
113
+ getAlert(id: string): Promise<Alert>;
114
+ deleteAlert(id: string): Promise<void>;
83
115
  deleteTemporaryVerification(id: string): Promise<{
84
116
  code: string;
85
117
  }>;
@@ -133,6 +133,34 @@ class RioAdminClient {
133
133
  return data;
134
134
  });
135
135
  }
136
+ createAlert({ priceTrigger, liquidityTrigger, destinationType, telegramDestination, }) {
137
+ return __awaiter(this, void 0, void 0, function* () {
138
+ const { data } = yield this.axios.post("/api/alerts", {
139
+ priceTrigger,
140
+ liquidityTrigger,
141
+ destinationType,
142
+ telegramDestination,
143
+ });
144
+ return data;
145
+ });
146
+ }
147
+ getAlerts() {
148
+ return __awaiter(this, void 0, void 0, function* () {
149
+ const { data } = yield this.axios.get("/api/alerts");
150
+ return data;
151
+ });
152
+ }
153
+ getAlert(id) {
154
+ return __awaiter(this, void 0, void 0, function* () {
155
+ const { data } = yield this.axios.get(`/api/alerts/${id}`);
156
+ return data;
157
+ });
158
+ }
159
+ deleteAlert(id) {
160
+ return __awaiter(this, void 0, void 0, function* () {
161
+ yield this.axios.delete(`/api/alerts/${id}`);
162
+ });
163
+ }
136
164
  deleteTemporaryVerification(id) {
137
165
  return __awaiter(this, void 0, void 0, function* () {
138
166
  const { data } = yield this.axios.delete(`/api/auth/temporary-verifications/${id}`);
@@ -42,6 +42,10 @@ import { BidInput } from "../types/bid-input";
42
42
  import { AddressVerification } from "../types/address-verification";
43
43
  import { BankAccountVerification } from "../types/bank-account-verification";
44
44
  import { Onboarding } from "../types/onboarding";
45
+ import { Alert } from "../types/alert";
46
+ import { AlertTriggerCondition } from "../types/alert-trigger-condition";
47
+ import { Side } from "../types/side";
48
+ import { AlertType } from "../types/alert-type";
45
49
  export declare class RioClient {
46
50
  private axios;
47
51
  constructor(axios: AxiosStatic | AxiosInstance);
@@ -53,6 +57,34 @@ export declare class RioClient {
53
57
  }>;
54
58
  exportOrders(page: number, startDate: Date, endDate: Date, query?: OrderQuery): Promise<Order[]>;
55
59
  getOrders(page: number, limit?: number, query?: OrderQuery, includeOwnOrders?: boolean, startDate?: Date, endDate?: Date): Promise<Order[]>;
60
+ createAlert({ priceTrigger, liquidityTrigger, destinationType, telegramDestination, }: {
61
+ type: AlertType;
62
+ priceTrigger?: {
63
+ condition: AlertTriggerCondition;
64
+ value: number;
65
+ side: Side;
66
+ fiat: Fiat;
67
+ crypto: Crypto;
68
+ cooldown?: number;
69
+ };
70
+ liquidityTrigger?: {
71
+ condition: AlertTriggerCondition;
72
+ value: number;
73
+ assetType?: "crypto" | "fiat";
74
+ asset?: Crypto | Fiat;
75
+ cooldown?: number;
76
+ };
77
+ destinationType: "telegram";
78
+ telegramDestination: {
79
+ chatId?: string;
80
+ username?: string;
81
+ };
82
+ }): Promise<{
83
+ code: string;
84
+ }>;
85
+ getAlerts(): Promise<Alert[]>;
86
+ getAlert(id: string): Promise<Alert>;
87
+ deleteAlert(id: string): Promise<void>;
56
88
  updateOrder(id: string, update: {
57
89
  notes: string;
58
90
  }): Promise<Order>;
@@ -76,6 +76,34 @@ class RioClient {
76
76
  return data;
77
77
  });
78
78
  }
79
+ createAlert({ priceTrigger, liquidityTrigger, destinationType, telegramDestination, }) {
80
+ return __awaiter(this, void 0, void 0, function* () {
81
+ const { data } = yield this.axios.post("/api/alerts", {
82
+ priceTrigger,
83
+ liquidityTrigger,
84
+ destinationType,
85
+ telegramDestination,
86
+ });
87
+ return data;
88
+ });
89
+ }
90
+ getAlerts() {
91
+ return __awaiter(this, void 0, void 0, function* () {
92
+ const { data } = yield this.axios.get("/api/alerts");
93
+ return data;
94
+ });
95
+ }
96
+ getAlert(id) {
97
+ return __awaiter(this, void 0, void 0, function* () {
98
+ const { data } = yield this.axios.get(`/api/alerts/${id}`);
99
+ return data;
100
+ });
101
+ }
102
+ deleteAlert(id) {
103
+ return __awaiter(this, void 0, void 0, function* () {
104
+ yield this.axios.delete(`/api/alerts/${id}`);
105
+ });
106
+ }
79
107
  updateOrder(id, update) {
80
108
  return __awaiter(this, void 0, void 0, function* () {
81
109
  const { data } = yield this.axios.patch(`/api/orders/${id}`, update);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.1508",
3
+ "version": "1.0.1511",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",