@riocrypto/common-server 1.0.2491 → 1.0.2493
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.
- package/build/clients/cluster-client.d.ts +6 -2
- package/build/clients/cluster-client.js +17 -1
- package/build/models/bulk-crypto-payout.d.ts +3 -1
- package/build/models/bulk-crypto-payout.js +4 -0
- package/build/models/twap-session.d.ts +16 -4
- package/build/models/twap-session.js +24 -6
- package/package.json +2 -2
|
@@ -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, BulkBankPayout, BulkCryptoPayout } 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, BulkBankPayment, BulkCryptoPayment } 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, bulkCryptoPayoutId, bulkBankPayoutId, }: {
|
|
34
|
+
createOrder({ quoteId, userAddressId, payoutBankAccountId, parentOrderId, notes, isAxeTaker, bulkCryptoPaymentId, bulkBankPaymentId, 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
|
+
bulkCryptoPaymentId?: string;
|
|
42
|
+
bulkBankPaymentId?: string;
|
|
41
43
|
bulkCryptoPayoutId?: string;
|
|
42
44
|
bulkBankPayoutId?: string;
|
|
43
45
|
}): Promise<Order>;
|
|
@@ -172,6 +174,8 @@ declare class ClusterClient {
|
|
|
172
174
|
getSTPMXNWithdrawal(id: string): Promise<STPMXNWithdrawal>;
|
|
173
175
|
createBulkBankPayout(userId: string, payoutBankAccountId: string): Promise<BulkBankPayout>;
|
|
174
176
|
createBulkCryptoPayout(userId: string, payoutAddressId: string): Promise<BulkCryptoPayout>;
|
|
177
|
+
createBulkBankPayment(userId: string, fiat: Fiat, country: Country): Promise<BulkBankPayment>;
|
|
178
|
+
createBulkCryptoPayment(userId: string, crypto: Crypto, country: Country): Promise<BulkCryptoPayment>;
|
|
175
179
|
}
|
|
176
180
|
export declare const buildClusterClient: () => Promise<ClusterClient>;
|
|
177
181
|
export {};
|
|
@@ -113,7 +113,7 @@ class ClusterClient {
|
|
|
113
113
|
return response.data;
|
|
114
114
|
});
|
|
115
115
|
}
|
|
116
|
-
createOrder({ quoteId, userAddressId, payoutBankAccountId, parentOrderId, notes, isAxeTaker, bulkCryptoPayoutId, bulkBankPayoutId, }) {
|
|
116
|
+
createOrder({ quoteId, userAddressId, payoutBankAccountId, parentOrderId, notes, isAxeTaker, bulkCryptoPaymentId, bulkBankPaymentId, 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,
|
|
@@ -126,6 +126,10 @@ class ClusterClient {
|
|
|
126
126
|
parentOrderId: parentOrderId ? parentOrderId : undefined,
|
|
127
127
|
bulkCryptoPayoutId: bulkCryptoPayoutId ? bulkCryptoPayoutId : undefined,
|
|
128
128
|
bulkBankPayoutId: bulkBankPayoutId ? bulkBankPayoutId : undefined,
|
|
129
|
+
bulkCryptoPaymentId: bulkCryptoPaymentId
|
|
130
|
+
? bulkCryptoPaymentId
|
|
131
|
+
: undefined,
|
|
132
|
+
bulkBankPaymentId: bulkBankPaymentId ? bulkBankPaymentId : undefined,
|
|
129
133
|
}, {
|
|
130
134
|
headers: {
|
|
131
135
|
"x-cluster-api-key": this.clusterApiKey,
|
|
@@ -608,6 +612,18 @@ class ClusterClient {
|
|
|
608
612
|
return response.data;
|
|
609
613
|
});
|
|
610
614
|
}
|
|
615
|
+
createBulkBankPayment(userId, fiat, country) {
|
|
616
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
617
|
+
const response = yield this.axios.post(`${this.baseUrl}/api/payments/bank/bulk`, { userId, fiat, country }, { headers: { "x-cluster-api-key": this.clusterApiKey } });
|
|
618
|
+
return response.data;
|
|
619
|
+
});
|
|
620
|
+
}
|
|
621
|
+
createBulkCryptoPayment(userId, crypto, country) {
|
|
622
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
623
|
+
const response = yield this.axios.post(`${this.baseUrl}/api/payments/crypto/bulk`, { userId, crypto, country }, { headers: { "x-cluster-api-key": this.clusterApiKey } });
|
|
624
|
+
return response.data;
|
|
625
|
+
});
|
|
626
|
+
}
|
|
611
627
|
}
|
|
612
628
|
const buildClusterClient = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
613
629
|
// Retrieve secrets asynchronously
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Crypto, BulkCryptoPayoutStatus } from "@riocrypto/common";
|
|
1
|
+
import { Country, Crypto, BulkCryptoPayoutStatus } from "@riocrypto/common";
|
|
2
2
|
import { Mongoose, Model, Document } from "mongoose";
|
|
3
3
|
interface BulkCryptoPayoutAttrs {
|
|
4
4
|
createdAt: Date;
|
|
@@ -8,6 +8,7 @@ interface BulkCryptoPayoutAttrs {
|
|
|
8
8
|
crypto: Crypto;
|
|
9
9
|
payoutAddressId?: string;
|
|
10
10
|
blockchainAddress?: string;
|
|
11
|
+
country: Country;
|
|
11
12
|
status: BulkCryptoPayoutStatus;
|
|
12
13
|
}
|
|
13
14
|
interface BulkCryptoPayoutDoc extends Document {
|
|
@@ -19,6 +20,7 @@ interface BulkCryptoPayoutDoc extends Document {
|
|
|
19
20
|
crypto: Crypto;
|
|
20
21
|
payoutAddressId?: string;
|
|
21
22
|
blockchainAddress?: string;
|
|
23
|
+
country: Country;
|
|
22
24
|
status: BulkCryptoPayoutStatus;
|
|
23
25
|
}
|
|
24
26
|
interface BulkCryptoPayoutModel extends Model<BulkCryptoPayoutDoc> {
|
|
@@ -16,11 +16,17 @@ interface TWAPSessionAttrs {
|
|
|
16
16
|
clipSize: number;
|
|
17
17
|
interval: number;
|
|
18
18
|
isRunning: boolean;
|
|
19
|
-
bulkBankPayoutId?: string;
|
|
20
|
-
bulkCryptoPayoutId?: string;
|
|
21
19
|
deferredPaymentType: DeferredPaymentType;
|
|
22
20
|
twoWaySettlementType: TwoWaySettlementType;
|
|
23
21
|
twoWaySettlementDateOffset: number;
|
|
22
|
+
activeBulkBankPayoutId?: string;
|
|
23
|
+
activeBulkCryptoPayoutId?: string;
|
|
24
|
+
completedBulkBankPayoutIds?: string[];
|
|
25
|
+
completedBulkCryptoPayoutIds?: string[];
|
|
26
|
+
activeBulkBankPaymentId?: string;
|
|
27
|
+
activeBulkCryptoPaymentId?: string;
|
|
28
|
+
completedBulkBankPaymentIds?: string[];
|
|
29
|
+
completedBulkCryptoPaymentIds?: string[];
|
|
24
30
|
lastRanAt?: Date;
|
|
25
31
|
}
|
|
26
32
|
interface TWAPSessionModel extends Model<TWAPSessionDoc> {
|
|
@@ -43,12 +49,18 @@ interface TWAPSessionDoc extends Document {
|
|
|
43
49
|
clipSize: number;
|
|
44
50
|
interval: number;
|
|
45
51
|
isRunning: boolean;
|
|
46
|
-
bulkBankPayoutId?: string;
|
|
47
|
-
bulkCryptoPayoutId?: string;
|
|
48
52
|
deferredPaymentType: DeferredPaymentType;
|
|
49
53
|
twoWaySettlementType: TwoWaySettlementType;
|
|
50
54
|
twoWaySettlementDateOffset: number;
|
|
51
55
|
lastRanAt?: Date;
|
|
56
|
+
activeBulkBankPayoutId?: string;
|
|
57
|
+
activeBulkCryptoPayoutId?: string;
|
|
58
|
+
completedBulkBankPayoutIds?: string[];
|
|
59
|
+
completedBulkCryptoPayoutIds?: string[];
|
|
60
|
+
activeBulkBankPaymentId?: string;
|
|
61
|
+
activeBulkCryptoPaymentId?: string;
|
|
62
|
+
completedBulkBankPaymentIds?: string[];
|
|
63
|
+
completedBulkCryptoPaymentIds?: string[];
|
|
52
64
|
}
|
|
53
65
|
declare const buildTWAPSession: (mongoose: Mongoose) => TWAPSessionModel;
|
|
54
66
|
export { buildTWAPSession, TWAPSessionDoc, TWAPSessionAttrs };
|
|
@@ -69,12 +69,6 @@ const buildTWAPSession = (mongoose) => {
|
|
|
69
69
|
lastRanAt: {
|
|
70
70
|
type: Date,
|
|
71
71
|
},
|
|
72
|
-
bulkBankPayoutId: {
|
|
73
|
-
type: String,
|
|
74
|
-
},
|
|
75
|
-
bulkCryptoPayoutId: {
|
|
76
|
-
type: String,
|
|
77
|
-
},
|
|
78
72
|
deferredPaymentType: {
|
|
79
73
|
type: String,
|
|
80
74
|
required: true,
|
|
@@ -87,6 +81,30 @@ const buildTWAPSession = (mongoose) => {
|
|
|
87
81
|
type: Number,
|
|
88
82
|
required: true,
|
|
89
83
|
},
|
|
84
|
+
activeBulkBankPayoutId: {
|
|
85
|
+
type: String,
|
|
86
|
+
},
|
|
87
|
+
activeBulkCryptoPayoutId: {
|
|
88
|
+
type: String,
|
|
89
|
+
},
|
|
90
|
+
completedBulkBankPayoutIds: {
|
|
91
|
+
type: [String],
|
|
92
|
+
},
|
|
93
|
+
completedBulkCryptoPayoutIds: {
|
|
94
|
+
type: [String],
|
|
95
|
+
},
|
|
96
|
+
activeBulkBankPaymentId: {
|
|
97
|
+
type: String,
|
|
98
|
+
},
|
|
99
|
+
activeBulkCryptoPaymentId: {
|
|
100
|
+
type: String,
|
|
101
|
+
},
|
|
102
|
+
completedBulkBankPaymentIds: {
|
|
103
|
+
type: [String],
|
|
104
|
+
},
|
|
105
|
+
completedBulkCryptoPaymentIds: {
|
|
106
|
+
type: [String],
|
|
107
|
+
},
|
|
90
108
|
}, {
|
|
91
109
|
toJSON: {
|
|
92
110
|
transform(doc, ret) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2493",
|
|
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.
|
|
31
|
+
"@riocrypto/common": "^1.0.2260",
|
|
32
32
|
"@types/express": "^4.17.13",
|
|
33
33
|
"axios": "^1.7.4",
|
|
34
34
|
"crypto-js": "^4.2.0",
|