@riocrypto/common 1.0.485 → 1.0.487

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,6 @@
1
+ import { AxiosInstance, AxiosStatic } from "axios";
2
+ export declare class EtherscanClient {
3
+ private axios;
4
+ constructor(axios: AxiosStatic | AxiosInstance);
5
+ getTransactions(address: string): Promise<any[]>;
6
+ }
@@ -0,0 +1,24 @@
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.EtherscanClient = void 0;
13
+ class EtherscanClient {
14
+ constructor(axios) {
15
+ this.axios = axios;
16
+ }
17
+ getTransactions(address) {
18
+ return __awaiter(this, void 0, void 0, function* () {
19
+ const { data } = yield this.axios.get(`https://api.etherscan.io/api?module=account&action=txlist&address=${address}&startblock=0&endblock=99999999&page=1&offset=100&sort=asc&apikey=${"DDR78IVPYXCVGFKTT6YWBBYZBRD18S2EW1"}`);
20
+ return data.result;
21
+ });
22
+ }
23
+ }
24
+ exports.EtherscanClient = EtherscanClient;
package/build/index.d.ts CHANGED
@@ -175,4 +175,5 @@ export * from "./clients/slack-client";
175
175
  export * from "./clients/gueno-client";
176
176
  export * from "./clients/fireblocks-client";
177
177
  export * from "./clients/kapstar-client";
178
+ export * from "./clients/etherscan-client";
178
179
  export * from "./helpers/get-user-helper";
package/build/index.js CHANGED
@@ -191,4 +191,5 @@ __exportStar(require("./clients/slack-client"), exports);
191
191
  __exportStar(require("./clients/gueno-client"), exports);
192
192
  __exportStar(require("./clients/fireblocks-client"), exports);
193
193
  __exportStar(require("./clients/kapstar-client"), exports);
194
+ __exportStar(require("./clients/etherscan-client"), exports);
194
195
  __exportStar(require("./helpers/get-user-helper"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common",
3
- "version": "1.0.485",
3
+ "version": "1.0.487",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -16,6 +16,7 @@
16
16
  "license": "ISC",
17
17
  "devDependencies": {
18
18
  "@types/jsonwebtoken": "^8.5.8",
19
+ "@types/uuid": "^9.0.1",
19
20
  "del-cli": "^5.0.0",
20
21
  "typescript": "^4.7.4"
21
22
  },
@@ -29,6 +30,7 @@
29
30
  "fireblocks-sdk": "^4.0.0",
30
31
  "jsonwebtoken": "^8.5.1",
31
32
  "mongoose": "^7.0.2",
32
- "node-nats-streaming": "^0.3.2"
33
+ "node-nats-streaming": "^0.3.2",
34
+ "uuid": "^9.0.0"
33
35
  }
34
36
  }