@riocrypto/common-server 1.0.2170 → 1.0.2172
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, ChainedQuote, AuthRole, Auth, ImportOrderData, TreasuryProvider, FXProvider, EmarketsFXTrade, ExternalTradingAlgorithm, ExternalTrade, ExternalTradeType, ExternalTradingProvider, ExternalTradingAlgorithmType } from "@riocrypto/common";
|
|
1
|
+
import { Quote, Fiat, Crypto, BitsoBankAccount, Side, Country, Order, CryptoAddress, BankAccount, ChainedQuote, AuthRole, Auth, ImportOrderData, TreasuryProvider, FXProvider, EmarketsFXTrade, ExternalTradingAlgorithm, ExternalTrade, ExternalTradeType, ExternalTradingProvider, ExternalTradingAlgorithmType, SettlementTime } from "@riocrypto/common";
|
|
2
2
|
declare class ClusterClient {
|
|
3
3
|
private baseUrl;
|
|
4
4
|
private clusterApiKey;
|
|
@@ -13,15 +13,16 @@ declare class ClusterClient {
|
|
|
13
13
|
getNewChainedQuote(chainedOrderId: string, chainedQuote: ChainedQuote, newOriginAmount?: number): Promise<ChainedQuote>;
|
|
14
14
|
getBidQuote(userId: string, side: Side, country: Country, fiat: Fiat, crypto: Crypto, amountFiat?: number, amountCrypto?: number, USBankTransferMethod?: "ach_push" | "wire", netPrice?: string): Promise<Quote>;
|
|
15
15
|
getCryptoAddresses(userId: string, crypto: Crypto): Promise<CryptoAddress[]>;
|
|
16
|
-
createOrder({ quoteId, userAddressId, payoutBankAccountId, notes, }: {
|
|
16
|
+
createOrder({ quoteId, userAddressId, payoutBankAccountId, notes, settlementTime, }: {
|
|
17
17
|
quoteId: string;
|
|
18
18
|
userAddressId?: string;
|
|
19
19
|
payoutBankAccountId?: string;
|
|
20
20
|
notes?: string;
|
|
21
|
+
settlementTime?: SettlementTime;
|
|
21
22
|
}): Promise<Order>;
|
|
22
23
|
confirmPayment(orderId: string): Promise<void>;
|
|
23
24
|
createBitsoBankAccount(userId: string): Promise<BitsoBankAccount>;
|
|
24
|
-
createAuthWithoutRegistration(phoneNumber: string, firstName: string, lastName: string, role?: AuthRole): Promise<Auth>;
|
|
25
|
+
createAuthWithoutRegistration(phoneNumber: string, firstName: string, lastName: string, role?: AuthRole, telegramUsername?: string, telegramUserId?: string): Promise<Auth>;
|
|
25
26
|
getLiquidityAvailable(): Promise<{
|
|
26
27
|
buy: number;
|
|
27
28
|
sell: number;
|
|
@@ -146,7 +146,7 @@ class ClusterClient {
|
|
|
146
146
|
return response.data;
|
|
147
147
|
});
|
|
148
148
|
}
|
|
149
|
-
createOrder({ quoteId, userAddressId, payoutBankAccountId, notes, }) {
|
|
149
|
+
createOrder({ quoteId, userAddressId, payoutBankAccountId, notes, settlementTime, }) {
|
|
150
150
|
return __awaiter(this, void 0, void 0, function* () {
|
|
151
151
|
const response = yield this.axios.post(`${this.baseUrl}/api/orders`, {
|
|
152
152
|
quoteId,
|
|
@@ -155,6 +155,7 @@ class ClusterClient {
|
|
|
155
155
|
? payoutBankAccountId
|
|
156
156
|
: undefined,
|
|
157
157
|
notes: notes ? notes : undefined,
|
|
158
|
+
settlementTime: settlementTime ? settlementTime : undefined,
|
|
158
159
|
}, {
|
|
159
160
|
headers: {
|
|
160
161
|
"x-cluster-api-key": this.clusterApiKey,
|
|
@@ -186,13 +187,17 @@ class ClusterClient {
|
|
|
186
187
|
return response.data;
|
|
187
188
|
});
|
|
188
189
|
}
|
|
189
|
-
createAuthWithoutRegistration(phoneNumber, firstName, lastName, role) {
|
|
190
|
+
createAuthWithoutRegistration(phoneNumber, firstName, lastName, role, telegramUsername, telegramUserId) {
|
|
190
191
|
return __awaiter(this, void 0, void 0, function* () {
|
|
191
192
|
const response = yield this.axios.post(`${this.baseUrl}/api/auth/unregistered`, {
|
|
192
193
|
phoneNumber,
|
|
193
194
|
firstName,
|
|
194
195
|
lastName,
|
|
195
196
|
role,
|
|
197
|
+
telegram: {
|
|
198
|
+
username: telegramUsername,
|
|
199
|
+
telegramUserId: telegramUserId,
|
|
200
|
+
},
|
|
196
201
|
}, {
|
|
197
202
|
headers: {
|
|
198
203
|
"x-cluster-api-key": this.clusterApiKey,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Country, Fiat, Side, Crypto } from "@riocrypto/common";
|
|
1
|
+
import { Country, Fiat, Side, Crypto, SettlementTime } from "@riocrypto/common";
|
|
2
2
|
import mongoose from "mongoose";
|
|
3
3
|
interface TelegramSessionAttrs {
|
|
4
4
|
createdAt: Date;
|
|
@@ -23,6 +23,7 @@ interface TelegramSessionAttrs {
|
|
|
23
23
|
orderId?: string;
|
|
24
24
|
userAddressId?: string;
|
|
25
25
|
payoutBankAccountId?: string;
|
|
26
|
+
settlementTime?: SettlementTime;
|
|
26
27
|
}
|
|
27
28
|
interface TelegramSessionDoc extends mongoose.Document {
|
|
28
29
|
createdAt: Date;
|
|
@@ -47,6 +48,7 @@ interface TelegramSessionDoc extends mongoose.Document {
|
|
|
47
48
|
orderId?: string;
|
|
48
49
|
userAddressId?: string;
|
|
49
50
|
payoutBankAccountId?: string;
|
|
51
|
+
settlementTime?: SettlementTime;
|
|
50
52
|
}
|
|
51
53
|
interface TelegramSessionModel extends mongoose.Model<TelegramSessionDoc> {
|
|
52
54
|
build(attrs: TelegramSessionAttrs): TelegramSessionDoc;
|