@riocrypto/common-server 1.0.2486 → 1.0.2488

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.
@@ -168,6 +168,8 @@ declare class ClusterClient {
168
168
  getSTPMXNBalance(): Promise<number>;
169
169
  createSTPMXNWithdrawal(amount: number, CLABE: string, concepto: string, beneficiaryName: string): Promise<void>;
170
170
  getSTPMXNWithdrawal(id: string): Promise<STPMXNWithdrawal>;
171
+ createBulkBankPayout(userId: string, payoutBankAccountId: string): Promise<void>;
172
+ createBulkCryptoPayout(userId: string, payoutAddressId: string): Promise<void>;
171
173
  }
172
174
  export declare const buildClusterClient: () => Promise<ClusterClient>;
173
175
  export {};
@@ -594,6 +594,16 @@ class ClusterClient {
594
594
  return response.data;
595
595
  });
596
596
  }
597
+ createBulkBankPayout(userId, payoutBankAccountId) {
598
+ return __awaiter(this, void 0, void 0, function* () {
599
+ yield this.axios.post(`${this.baseUrl}/api/payouts/bank/bulk`, { userId, payoutBankAccountId }, { headers: { "x-cluster-api-key": this.clusterApiKey } });
600
+ });
601
+ }
602
+ createBulkCryptoPayout(userId, payoutAddressId) {
603
+ return __awaiter(this, void 0, void 0, function* () {
604
+ yield this.axios.post(`${this.baseUrl}/api/payouts/crypto/bulk`, { userId, payoutAddressId }, { headers: { "x-cluster-api-key": this.clusterApiKey } });
605
+ });
606
+ }
597
607
  }
598
608
  const buildClusterClient = () => __awaiter(void 0, void 0, void 0, function* () {
599
609
  // Retrieve secrets asynchronously
package/build/index.d.ts CHANGED
@@ -95,6 +95,8 @@ export * from "./models/axe-slack-thread";
95
95
  export * from "./models/axe-telegram-thread";
96
96
  export * from "./models/auth-activity-slack-thread";
97
97
  export * from "./models/twap-session";
98
+ export * from "./models/bulk-bank-payout";
99
+ export * from "./models/bulk-crypto-payout";
98
100
  export * from "./clients/axios-with-logging";
99
101
  export * from "./clients/slack-client";
100
102
  export * from "./clients/fireblocks-client";
package/build/index.js CHANGED
@@ -111,6 +111,8 @@ __exportStar(require("./models/axe-slack-thread"), exports);
111
111
  __exportStar(require("./models/axe-telegram-thread"), exports);
112
112
  __exportStar(require("./models/auth-activity-slack-thread"), exports);
113
113
  __exportStar(require("./models/twap-session"), exports);
114
+ __exportStar(require("./models/bulk-bank-payout"), exports);
115
+ __exportStar(require("./models/bulk-crypto-payout"), exports);
114
116
  __exportStar(require("./clients/axios-with-logging"), exports);
115
117
  __exportStar(require("./clients/slack-client"), exports);
116
118
  __exportStar(require("./clients/fireblocks-client"), exports);
@@ -0,0 +1,38 @@
1
+ import { Country, Fiat, BulkBankPayoutStatus } from "@riocrypto/common";
2
+ import { Mongoose, Model, Document } from "mongoose";
3
+ interface BulkBankPayoutAttrs {
4
+ createdAt: Date;
5
+ userId: string;
6
+ orderIds: string[];
7
+ amount: number;
8
+ fiat: Fiat;
9
+ country: Country;
10
+ payoutBankAccountId?: string;
11
+ bankName?: string;
12
+ reference?: string;
13
+ accountNumber?: string;
14
+ CLABE?: string;
15
+ CCI?: string;
16
+ status: BulkBankPayoutStatus;
17
+ }
18
+ interface BulkBankPayoutDoc extends Document {
19
+ id: string;
20
+ createdAt: Date;
21
+ userId: string;
22
+ orderIds: string[];
23
+ amount: number;
24
+ fiat: Fiat;
25
+ country: Country;
26
+ payoutBankAccountId?: string;
27
+ bankName?: string;
28
+ reference?: string;
29
+ accountNumber?: string;
30
+ CLABE?: string;
31
+ CCI?: string;
32
+ status: BulkBankPayoutStatus;
33
+ }
34
+ interface BulkBankPayoutModel extends Model<BulkBankPayoutDoc> {
35
+ build(attrs: BulkBankPayoutAttrs): BulkBankPayoutDoc;
36
+ }
37
+ declare const buildBulkBankPayout: (mongoose: Mongoose) => BulkBankPayoutModel;
38
+ export { buildBulkBankPayout, BulkBankPayoutDoc, BulkBankPayoutAttrs };
@@ -0,0 +1,71 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildBulkBankPayout = void 0;
4
+ const buildBulkBankPayout = (mongoose) => {
5
+ // if model is already defined, return it
6
+ if (mongoose.models.BulkBankPayout) {
7
+ return mongoose.model("BulkBankPayout");
8
+ }
9
+ const BulkBankPayoutSchema = new mongoose.Schema({
10
+ createdAt: {
11
+ type: Date,
12
+ required: true,
13
+ },
14
+ userId: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ orderIds: {
19
+ type: [String],
20
+ required: true,
21
+ },
22
+ amount: {
23
+ type: Number,
24
+ required: true,
25
+ },
26
+ fiat: {
27
+ type: String,
28
+ required: true,
29
+ },
30
+ country: {
31
+ type: String,
32
+ required: true,
33
+ },
34
+ payoutBankAccountId: {
35
+ type: String,
36
+ },
37
+ bankName: {
38
+ type: String,
39
+ },
40
+ reference: {
41
+ type: String,
42
+ },
43
+ accountNumber: {
44
+ type: String,
45
+ },
46
+ CLABE: {
47
+ type: String,
48
+ },
49
+ CCI: {
50
+ type: String,
51
+ },
52
+ status: {
53
+ type: String,
54
+ required: true,
55
+ },
56
+ }, {
57
+ toJSON: {
58
+ transform(doc, ret) {
59
+ ret.id = ret._id.valueOf();
60
+ delete ret._id;
61
+ delete ret.__v;
62
+ },
63
+ },
64
+ });
65
+ BulkBankPayoutSchema.statics.build = (attrs) => {
66
+ return new BulkBankPayout(attrs);
67
+ };
68
+ const BulkBankPayout = mongoose.model("BulkBankPayout", BulkBankPayoutSchema);
69
+ return BulkBankPayout;
70
+ };
71
+ exports.buildBulkBankPayout = buildBulkBankPayout;
@@ -0,0 +1,28 @@
1
+ import { Crypto, BulkCryptoPayoutStatus } from "@riocrypto/common";
2
+ import { Mongoose, Model, Document } from "mongoose";
3
+ interface BulkCryptoPayoutAttrs {
4
+ createdAt: Date;
5
+ userId: string;
6
+ orderIds: string[];
7
+ amount: number;
8
+ crypto: Crypto;
9
+ payoutAddressId?: string;
10
+ blockchainAddress?: string;
11
+ status: BulkCryptoPayoutStatus;
12
+ }
13
+ interface BulkCryptoPayoutDoc extends Document {
14
+ id: string;
15
+ createdAt: Date;
16
+ userId: string;
17
+ orderIds: string[];
18
+ amount: number;
19
+ crypto: Crypto;
20
+ payoutAddressId?: string;
21
+ blockchainAddress?: string;
22
+ status: BulkCryptoPayoutStatus;
23
+ }
24
+ interface BulkCryptoPayoutModel extends Model<BulkCryptoPayoutDoc> {
25
+ build(attrs: BulkCryptoPayoutAttrs): BulkCryptoPayoutDoc;
26
+ }
27
+ declare const buildBulkCryptoPayout: (mongoose: Mongoose) => BulkCryptoPayoutModel;
28
+ export { buildBulkCryptoPayout, BulkCryptoPayoutDoc, BulkCryptoPayoutAttrs };
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.buildBulkCryptoPayout = void 0;
4
+ const buildBulkCryptoPayout = (mongoose) => {
5
+ // if model is already defined, return it
6
+ if (mongoose.models.BulkCryptoPayout) {
7
+ return mongoose.model("BulkCryptoPayout");
8
+ }
9
+ const BulkCryptoPayoutSchema = new mongoose.Schema({
10
+ createdAt: {
11
+ type: Date,
12
+ required: true,
13
+ },
14
+ userId: {
15
+ type: String,
16
+ required: true,
17
+ },
18
+ orderIds: {
19
+ type: [String],
20
+ required: true,
21
+ },
22
+ amount: {
23
+ type: Number,
24
+ required: true,
25
+ },
26
+ crypto: {
27
+ type: String,
28
+ required: true,
29
+ },
30
+ payoutAddressId: {
31
+ type: String,
32
+ },
33
+ blockchainAddress: {
34
+ type: String,
35
+ },
36
+ status: {
37
+ type: String,
38
+ required: true,
39
+ },
40
+ }, {
41
+ toJSON: {
42
+ transform(doc, ret) {
43
+ ret.id = ret._id.valueOf();
44
+ delete ret._id;
45
+ delete ret.__v;
46
+ },
47
+ },
48
+ });
49
+ BulkCryptoPayoutSchema.statics.build = (attrs) => {
50
+ return new BulkCryptoPayout(attrs);
51
+ };
52
+ const BulkCryptoPayout = mongoose.model("BulkCryptoPayout", BulkCryptoPayoutSchema);
53
+ return BulkCryptoPayout;
54
+ };
55
+ exports.buildBulkCryptoPayout = buildBulkCryptoPayout;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2486",
3
+ "version": "1.0.2488",
4
4
  "description": "",
5
5
  "main": "./build/index.js",
6
6
  "types": "./build/index.d.ts",
@@ -28,7 +28,7 @@
28
28
  "@google-cloud/secret-manager": "^5.3.0",
29
29
  "@google-cloud/storage": "^6.9.5",
30
30
  "@hyperdx/node-opentelemetry": "^0.7.0",
31
- "@riocrypto/common": "^1.0.2250",
31
+ "@riocrypto/common": "^1.0.2255",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.7.4",
34
34
  "crypto-js": "^4.2.0",