@riocrypto/common-server 1.0.2488 → 1.0.2490

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.
@@ -1,4 +1,4 @@
1
- import { Quote, Fiat, Crypto, BitsoBankAccount, Side, Country, Order, CryptoAddress, BankAccount, AuthRole, Auth, ImportOrderData, TreasuryProvider, FXProvider, EmarketsFXTrade, ExternalTradingAlgorithm, ExternalTrade, ExternalTradeType, ExternalTradingProvider, ExternalTradingAlgorithmType, STPMXNWithdrawal, AuthPermission, DeferredPaymentType, TwoWaySettlementType, OrderType, EmarketsSettlementType, EmarketsOrderType } from "@riocrypto/common";
1
+ import { Quote, Fiat, Crypto, BitsoBankAccount, Side, Country, Order, CryptoAddress, BankAccount, AuthRole, Auth, ImportOrderData, TreasuryProvider, FXProvider, EmarketsFXTrade, ExternalTradingAlgorithm, ExternalTrade, ExternalTradeType, ExternalTradingProvider, ExternalTradingAlgorithmType, STPMXNWithdrawal, AuthPermission, DeferredPaymentType, TwoWaySettlementType, OrderType, EmarketsSettlementType, EmarketsOrderType, BulkBankPayout, BulkCryptoPayout } from "@riocrypto/common";
2
2
  declare class ClusterClient {
3
3
  private baseUrl;
4
4
  private clusterApiKey;
@@ -31,13 +31,15 @@ declare class ClusterClient {
31
31
  timeInForceEndsAt?: Date;
32
32
  }): Promise<Quote>;
33
33
  getCryptoAddresses(userId: string, crypto: Crypto): Promise<CryptoAddress[]>;
34
- createOrder({ quoteId, userAddressId, payoutBankAccountId, parentOrderId, notes, isAxeTaker, }: {
34
+ createOrder({ quoteId, userAddressId, payoutBankAccountId, parentOrderId, notes, isAxeTaker, bulkCryptoPayoutId, bulkBankPayoutId, }: {
35
35
  quoteId: string;
36
36
  userAddressId?: string;
37
37
  payoutBankAccountId?: string;
38
38
  parentOrderId?: string;
39
39
  notes?: string;
40
40
  isAxeTaker?: boolean;
41
+ bulkCryptoPayoutId?: string;
42
+ bulkBankPayoutId?: string;
41
43
  }): Promise<Order>;
42
44
  takeAxe({ axeId, userId, amount, crypto, userAddressId, payoutBankAccountId, deferredPaymentType, twoWaySettlementType, twoWaySettlementDateOffset, }: {
43
45
  axeId: string;
@@ -168,8 +170,8 @@ declare class ClusterClient {
168
170
  getSTPMXNBalance(): Promise<number>;
169
171
  createSTPMXNWithdrawal(amount: number, CLABE: string, concepto: string, beneficiaryName: string): Promise<void>;
170
172
  getSTPMXNWithdrawal(id: string): Promise<STPMXNWithdrawal>;
171
- createBulkBankPayout(userId: string, payoutBankAccountId: string): Promise<void>;
172
- createBulkCryptoPayout(userId: string, payoutAddressId: string): Promise<void>;
173
+ createBulkBankPayout(userId: string, payoutBankAccountId: string): Promise<BulkBankPayout>;
174
+ createBulkCryptoPayout(userId: string, payoutAddressId: string): Promise<BulkCryptoPayout>;
173
175
  }
174
176
  export declare const buildClusterClient: () => Promise<ClusterClient>;
175
177
  export {};
@@ -113,7 +113,7 @@ class ClusterClient {
113
113
  return response.data;
114
114
  });
115
115
  }
116
- createOrder({ quoteId, userAddressId, payoutBankAccountId, parentOrderId, notes, isAxeTaker, }) {
116
+ createOrder({ quoteId, userAddressId, payoutBankAccountId, parentOrderId, notes, isAxeTaker, bulkCryptoPayoutId, bulkBankPayoutId, }) {
117
117
  return __awaiter(this, void 0, void 0, function* () {
118
118
  const response = yield this.axios.post(`${this.baseUrl}/api/orders`, {
119
119
  quoteId,
@@ -124,6 +124,8 @@ class ClusterClient {
124
124
  notes: notes ? notes : undefined,
125
125
  isAxeTaker: isAxeTaker ? isAxeTaker : undefined,
126
126
  parentOrderId: parentOrderId ? parentOrderId : undefined,
127
+ bulkCryptoPayoutId: bulkCryptoPayoutId ? bulkCryptoPayoutId : undefined,
128
+ bulkBankPayoutId: bulkBankPayoutId ? bulkBankPayoutId : undefined,
127
129
  }, {
128
130
  headers: {
129
131
  "x-cluster-api-key": this.clusterApiKey,
@@ -596,12 +598,14 @@ class ClusterClient {
596
598
  }
597
599
  createBulkBankPayout(userId, payoutBankAccountId) {
598
600
  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 } });
601
+ const response = yield this.axios.post(`${this.baseUrl}/api/payouts/bank/bulk`, { userId, payoutBankAccountId }, { headers: { "x-cluster-api-key": this.clusterApiKey } });
602
+ return response.data;
600
603
  });
601
604
  }
602
605
  createBulkCryptoPayout(userId, payoutAddressId) {
603
606
  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 } });
607
+ const response = yield this.axios.post(`${this.baseUrl}/api/payouts/crypto/bulk`, { userId, payoutAddressId }, { headers: { "x-cluster-api-key": this.clusterApiKey } });
608
+ return response.data;
605
609
  });
606
610
  }
607
611
  }
@@ -51,6 +51,8 @@ interface OrderAttrs {
51
51
  payoutBankAccountId?: string;
52
52
  bulkCryptoPaymentId?: string;
53
53
  bulkBankPaymentId?: string;
54
+ bulkCryptoPayoutId?: string;
55
+ bulkBankPayoutId?: string;
54
56
  binancePayment?: {
55
57
  binanceTransactionId: string;
56
58
  amount: number;
@@ -179,6 +181,8 @@ interface OrderDoc extends Document {
179
181
  payoutBankAccountId?: string;
180
182
  bulkCryptoPaymentId?: string;
181
183
  bulkBankPaymentId?: string;
184
+ bulkCryptoPayoutId?: string;
185
+ bulkBankPayoutId?: string;
182
186
  invoice?: {
183
187
  PDFLink?: string;
184
188
  XMLLink?: string;
@@ -37,6 +37,12 @@ const buildOrder = (mongoose) => {
37
37
  bulkBankPaymentId: {
38
38
  type: String,
39
39
  },
40
+ bulkCryptoPayoutId: {
41
+ type: String,
42
+ },
43
+ bulkBankPayoutId: {
44
+ type: String,
45
+ },
40
46
  timeInForceStartsAt: {
41
47
  type: mongoose.Schema.Types.Date,
42
48
  },
@@ -16,8 +16,8 @@ interface TWAPSessionAttrs {
16
16
  clipSize: number;
17
17
  interval: number;
18
18
  isRunning: boolean;
19
- payoutBankAccountId?: string;
20
- payoutAddressId?: string;
19
+ bulkBankPayoutId?: string;
20
+ bulkCryptoPayoutId?: string;
21
21
  deferredPaymentType: DeferredPaymentType;
22
22
  twoWaySettlementType: TwoWaySettlementType;
23
23
  twoWaySettlementDateOffset: number;
@@ -43,8 +43,8 @@ interface TWAPSessionDoc extends Document {
43
43
  clipSize: number;
44
44
  interval: number;
45
45
  isRunning: boolean;
46
- payoutBankAccountId?: string;
47
- payoutAddressId?: string;
46
+ bulkBankPayoutId?: string;
47
+ bulkCryptoPayoutId?: string;
48
48
  deferredPaymentType: DeferredPaymentType;
49
49
  twoWaySettlementType: TwoWaySettlementType;
50
50
  twoWaySettlementDateOffset: number;
@@ -69,10 +69,10 @@ const buildTWAPSession = (mongoose) => {
69
69
  lastRanAt: {
70
70
  type: Date,
71
71
  },
72
- payoutBankAccountId: {
72
+ bulkBankPayoutId: {
73
73
  type: String,
74
74
  },
75
- payoutAddressId: {
75
+ bulkCryptoPayoutId: {
76
76
  type: String,
77
77
  },
78
78
  deferredPaymentType: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@riocrypto/common-server",
3
- "version": "1.0.2488",
3
+ "version": "1.0.2490",
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.2255",
31
+ "@riocrypto/common": "^1.0.2257",
32
32
  "@types/express": "^4.17.13",
33
33
  "axios": "^1.7.4",
34
34
  "crypto-js": "^4.2.0",