@riocrypto/common-server 1.0.1367 → 1.0.1369

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.
@@ -11,6 +11,7 @@ declare class ClusterClient {
11
11
  confirmPayment(orderId: string): Promise<void>;
12
12
  createBitsoBankAccount(userId: string): Promise<BitsoBankAccount>;
13
13
  getBalance(asset: Crypto | Fiat): Promise<number>;
14
+ createPayout(orderId: string, bankAccountId: string): Promise<void>;
14
15
  getUSBankAccounts(userId: string, fiat: Fiat, country: Country): Promise<{
15
16
  id: string;
16
17
  bank_name: string;
@@ -152,6 +152,18 @@ class ClusterClient {
152
152
  return rioResponse.data.balance;
153
153
  });
154
154
  }
155
+ createPayout(orderId, bankAccountId) {
156
+ return __awaiter(this, void 0, void 0, function* () {
157
+ yield this.axios.post(`${this.baseUrl}/api/payouts/bank`, {
158
+ orderId,
159
+ bankAccountId,
160
+ }, {
161
+ headers: {
162
+ "x-cluster-api-key": this.clusterApiKey,
163
+ },
164
+ });
165
+ });
166
+ }
155
167
  getUSBankAccounts(userId, fiat, country) {
156
168
  return __awaiter(this, void 0, void 0, function* () {
157
169
  const rioResponse = yield this.axios.get(`${this.baseUrl}/api/bank/us/accounts?userId=${userId}&fiat=${fiat}&country=${country}`, {
@@ -21,6 +21,7 @@ interface TelegramSessionAttrs {
21
21
  orderId?: string;
22
22
  cryptoAddress?: string;
23
23
  externalAccountId?: string;
24
+ bankAccountId?: string;
24
25
  }
25
26
  interface TelegramSessionDoc extends mongoose.Document {
26
27
  createdAt: Date;
@@ -43,6 +44,7 @@ interface TelegramSessionDoc extends mongoose.Document {
43
44
  orderId?: string;
44
45
  cryptoAddress?: string;
45
46
  externalAccountId?: string;
47
+ bankAccountId?: string;
46
48
  }
47
49
  interface TelegramSessionModel extends mongoose.Model<TelegramSessionDoc> {
48
50
  build(attrs: TelegramSessionAttrs): TelegramSessionDoc;
@@ -68,6 +68,9 @@ const buildTelegramSession = (mongoose) => {
68
68
  cryptoAddress: {
69
69
  type: String,
70
70
  },
71
+ bankAccountId: {
72
+ type: String,
73
+ },
71
74
  }, {
72
75
  toJSON: {
73
76
  transform(doc, ret) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.1367",
3
+ "version": "1.0.1369",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",