@riocrypto/common 1.0.488 → 1.0.489
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.
- package/build/clients/rio-client.d.ts +31 -0
- package/build/clients/rio-client.js +102 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { AxiosInstance, AxiosStatic } from "axios";
|
|
2
|
+
import { Admin } from "../types/admin";
|
|
3
|
+
import { BusinessUser } from "../types/business-user";
|
|
4
|
+
import { BusinessUserUpdate } from "../types/business-user-update";
|
|
5
|
+
import { Order } from "../types/order";
|
|
6
|
+
import { RioSettings } from "../types/rio-settings";
|
|
7
|
+
import { RioSettingsUpdate } from "../types/rio-settings-update";
|
|
8
|
+
import { User } from "../types/user";
|
|
9
|
+
import { UserUpdate } from "../types/user-update";
|
|
10
|
+
export declare class RioClient {
|
|
11
|
+
private axios;
|
|
12
|
+
constructor(axios: AxiosStatic | AxiosInstance);
|
|
13
|
+
getOrders(): Promise<Order[]>;
|
|
14
|
+
getUsers(): Promise<User[]>;
|
|
15
|
+
getBusinessUsers(): Promise<BusinessUser[]>;
|
|
16
|
+
signin(email: string, password: string): Promise<any>;
|
|
17
|
+
updateUser(userId: string, update: UserUpdate): Promise<User>;
|
|
18
|
+
updateBusinessUser(businessUserId: string, update: BusinessUserUpdate): Promise<BusinessUser>;
|
|
19
|
+
updateAdminUserPassword({ password, newPassword, }: {
|
|
20
|
+
password: string;
|
|
21
|
+
newPassword: string;
|
|
22
|
+
}): Promise<Admin>;
|
|
23
|
+
getAdminUser(): Promise<any>;
|
|
24
|
+
signout(): Promise<void>;
|
|
25
|
+
getRioSettings(): Promise<RioSettings>;
|
|
26
|
+
createRioSettings(rioSettings: {
|
|
27
|
+
platformFee: number;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
updateRioSettings(update: RioSettingsUpdate): Promise<void>;
|
|
30
|
+
confirmBankPayment(orderId: string): Promise<any>;
|
|
31
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.RioClient = void 0;
|
|
13
|
+
class RioClient {
|
|
14
|
+
constructor(axios) {
|
|
15
|
+
this.axios = axios;
|
|
16
|
+
}
|
|
17
|
+
getOrders() {
|
|
18
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
19
|
+
const { data } = yield this.axios.get(`/api/orders`);
|
|
20
|
+
return data;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
getUsers() {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const { data } = yield this.axios.get(`/api/users`);
|
|
26
|
+
return data;
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
getBusinessUsers() {
|
|
30
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
31
|
+
const { data } = yield this.axios.get(`/api/business/users`);
|
|
32
|
+
return data;
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
signin(email, password) {
|
|
36
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
37
|
+
const { data } = yield this.axios.post(`/api/admin/signin`, {
|
|
38
|
+
email,
|
|
39
|
+
password,
|
|
40
|
+
});
|
|
41
|
+
return data;
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
updateUser(userId, update) {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const { data } = yield this.axios.patch(`/api/users/${userId}`, update);
|
|
47
|
+
return data;
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
updateBusinessUser(businessUserId, update) {
|
|
51
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
52
|
+
const { data } = yield this.axios.patch(`/api/business/users/${businessUserId}`, update);
|
|
53
|
+
return data;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
updateAdminUserPassword({ password, newPassword, }) {
|
|
57
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
58
|
+
const { data } = yield this.axios.patch(`/api/admin`, {
|
|
59
|
+
password,
|
|
60
|
+
newPassword,
|
|
61
|
+
});
|
|
62
|
+
return data;
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
getAdminUser() {
|
|
66
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
+
const { data } = yield this.axios.get(`/api/admin`);
|
|
68
|
+
return data;
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
signout() {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
73
|
+
yield this.axios.post("/api/admin/signout", {});
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
getRioSettings() {
|
|
77
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
78
|
+
const { data } = yield this.axios.get(`/api/settings`);
|
|
79
|
+
return data;
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
createRioSettings(rioSettings) {
|
|
83
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
84
|
+
yield this.axios.post(`/api/settings`, rioSettings);
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
updateRioSettings(update) {
|
|
88
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
89
|
+
const { data } = yield this.axios.patch(`/api/settings`, update);
|
|
90
|
+
return data;
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
confirmBankPayment(orderId) {
|
|
94
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
|
+
const { data } = yield this.axios.post(`/api/payments/bank/confirm`, {
|
|
96
|
+
orderId,
|
|
97
|
+
});
|
|
98
|
+
return data;
|
|
99
|
+
});
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
exports.RioClient = RioClient;
|
package/build/index.d.ts
CHANGED
|
@@ -176,4 +176,5 @@ export * from "./clients/gueno-client";
|
|
|
176
176
|
export * from "./clients/fireblocks-client";
|
|
177
177
|
export * from "./clients/kapstar-client";
|
|
178
178
|
export * from "./clients/etherscan-client";
|
|
179
|
+
export * from "./clients/rio-client";
|
|
179
180
|
export * from "./helpers/get-user-helper";
|
package/build/index.js
CHANGED
|
@@ -192,4 +192,5 @@ __exportStar(require("./clients/gueno-client"), exports);
|
|
|
192
192
|
__exportStar(require("./clients/fireblocks-client"), exports);
|
|
193
193
|
__exportStar(require("./clients/kapstar-client"), exports);
|
|
194
194
|
__exportStar(require("./clients/etherscan-client"), exports);
|
|
195
|
+
__exportStar(require("./clients/rio-client"), exports);
|
|
195
196
|
__exportStar(require("./helpers/get-user-helper"), exports);
|