@riocrypto/common 1.0.450 → 1.0.452
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,10 @@
|
|
|
1
|
+
declare class GuenoClient {
|
|
2
|
+
private email;
|
|
3
|
+
private password;
|
|
4
|
+
private env;
|
|
5
|
+
constructor(email: string, password: string, env: "sandbox" | "production");
|
|
6
|
+
getAddressRiskScore(address: string, protocol: Crypto): Promise<any>;
|
|
7
|
+
getAccessToken(): Promise<any>;
|
|
8
|
+
}
|
|
9
|
+
export declare const guenoClient: GuenoClient;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,44 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.guenoClient = void 0;
|
|
16
|
+
const axios_1 = __importDefault(require("axios"));
|
|
17
|
+
class GuenoClient {
|
|
18
|
+
constructor(email, password, env) {
|
|
19
|
+
this.email = email;
|
|
20
|
+
this.password = password;
|
|
21
|
+
this.env = env;
|
|
22
|
+
}
|
|
23
|
+
getAddressRiskScore(address, protocol) {
|
|
24
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
25
|
+
const accessToken = yield this.getAccessToken();
|
|
26
|
+
const { data } = yield axios_1.default.get(`https://api-gueno.${this.env === "production" ? "prd" : "stg"}.gueno.com/api/amlCrypto/addressRiskScore?address=${address}&protocol=${protocol}`, {
|
|
27
|
+
headers: {
|
|
28
|
+
Authorization: `Bearer ${accessToken}`,
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
return data;
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
getAccessToken() {
|
|
35
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
36
|
+
const { data } = yield axios_1.default.post(`https://api-gueno.${this.env === "production" ? "prd" : "stg"}.gueno.com/api/auth/login`, {
|
|
37
|
+
email: this.email,
|
|
38
|
+
password: this.password,
|
|
39
|
+
});
|
|
40
|
+
return data.access_token;
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
exports.guenoClient = new GuenoClient(process.env.GUENO_EMAIL, process.env.GUENO_PASSWORD, process.env.GUENO_ENV);
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
};
|
|
14
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
+
exports.slackClient = void 0;
|
|
16
|
+
const axios_1 = __importDefault(require("axios"));
|
|
17
|
+
class SlackClient {
|
|
18
|
+
constructor(webhookUrl) {
|
|
19
|
+
this.webhookUrl = webhookUrl;
|
|
20
|
+
}
|
|
21
|
+
sendMessage(message) {
|
|
22
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
23
|
+
try {
|
|
24
|
+
yield axios_1.default.post(this.webhookUrl, {
|
|
25
|
+
text: message,
|
|
26
|
+
});
|
|
27
|
+
}
|
|
28
|
+
catch (error) {
|
|
29
|
+
console.log(error);
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.slackClient = new SlackClient(process.env.SLACK_WEBHOOK_URL);
|
package/build/index.d.ts
CHANGED
|
@@ -162,4 +162,6 @@ export * from "./clients/bitstamp-client";
|
|
|
162
162
|
export * from "./clients/ccxt-client";
|
|
163
163
|
export * from "./clients/fixer-client";
|
|
164
164
|
export * from "./clients/kushki-client";
|
|
165
|
+
export * from "./clients/slack-client";
|
|
166
|
+
export * from "./clients/gueno-client";
|
|
165
167
|
export * from "./helpers/get-user-helper";
|
package/build/index.js
CHANGED
|
@@ -179,4 +179,6 @@ __exportStar(require("./clients/bitstamp-client"), exports);
|
|
|
179
179
|
__exportStar(require("./clients/ccxt-client"), exports);
|
|
180
180
|
__exportStar(require("./clients/fixer-client"), exports);
|
|
181
181
|
__exportStar(require("./clients/kushki-client"), exports);
|
|
182
|
+
__exportStar(require("./clients/slack-client"), exports);
|
|
183
|
+
__exportStar(require("./clients/gueno-client"), exports);
|
|
182
184
|
__exportStar(require("./helpers/get-user-helper"), exports);
|