@riocrypto/common-server 1.0.2172 → 1.0.2174
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.
|
@@ -9,18 +9,28 @@ declare class ClusterClient {
|
|
|
9
9
|
newAmountFiat?: number;
|
|
10
10
|
newAmountCrypto?: number;
|
|
11
11
|
}): Promise<Quote>;
|
|
12
|
-
|
|
12
|
+
createQuote({ userId, side, country, fiat, crypto, amountFiat, amountCrypto, USBankTransferMethod, settlementTime, }: {
|
|
13
|
+
userId: string;
|
|
14
|
+
side: Side;
|
|
15
|
+
country: Country;
|
|
16
|
+
fiat: Fiat;
|
|
17
|
+
crypto: Crypto;
|
|
18
|
+
amountFiat?: number;
|
|
19
|
+
amountCrypto?: number;
|
|
20
|
+
USBankTransferMethod?: "ach_push" | "wire";
|
|
21
|
+
settlementTime?: SettlementTime;
|
|
22
|
+
}): Promise<Quote>;
|
|
13
23
|
getNewChainedQuote(chainedOrderId: string, chainedQuote: ChainedQuote, newOriginAmount?: number): Promise<ChainedQuote>;
|
|
14
24
|
getBidQuote(userId: string, side: Side, country: Country, fiat: Fiat, crypto: Crypto, amountFiat?: number, amountCrypto?: number, USBankTransferMethod?: "ach_push" | "wire", netPrice?: string): Promise<Quote>;
|
|
15
25
|
getCryptoAddresses(userId: string, crypto: Crypto): Promise<CryptoAddress[]>;
|
|
16
|
-
createOrder({ quoteId, userAddressId, payoutBankAccountId, notes,
|
|
26
|
+
createOrder({ quoteId, userAddressId, payoutBankAccountId, notes, }: {
|
|
17
27
|
quoteId: string;
|
|
18
28
|
userAddressId?: string;
|
|
19
29
|
payoutBankAccountId?: string;
|
|
20
30
|
notes?: string;
|
|
21
|
-
settlementTime?: SettlementTime;
|
|
22
31
|
}): Promise<Order>;
|
|
23
|
-
|
|
32
|
+
checkBankPayment(orderId: string): Promise<void>;
|
|
33
|
+
checkCryptoPayment(orderId: string): Promise<void>;
|
|
24
34
|
createBitsoBankAccount(userId: string): Promise<BitsoBankAccount>;
|
|
25
35
|
createAuthWithoutRegistration(phoneNumber: string, firstName: string, lastName: string, role?: AuthRole, telegramUsername?: string, telegramUserId?: string): Promise<Auth>;
|
|
26
36
|
getLiquidityAvailable(): Promise<{
|
|
@@ -73,7 +73,7 @@ class ClusterClient {
|
|
|
73
73
|
return response.data.quote;
|
|
74
74
|
});
|
|
75
75
|
}
|
|
76
|
-
|
|
76
|
+
createQuote({ userId, side, country, fiat, crypto, amountFiat, amountCrypto, USBankTransferMethod, settlementTime, }) {
|
|
77
77
|
return __awaiter(this, void 0, void 0, function* () {
|
|
78
78
|
const response = yield this.axios.post(`${this.baseUrl}/api/quotes`, {
|
|
79
79
|
userId,
|
|
@@ -84,6 +84,7 @@ class ClusterClient {
|
|
|
84
84
|
amountCrypto,
|
|
85
85
|
country,
|
|
86
86
|
USBankTransferMethod,
|
|
87
|
+
settlementTime,
|
|
87
88
|
}, {
|
|
88
89
|
headers: {
|
|
89
90
|
"x-cluster-api-key": this.clusterApiKey,
|
|
@@ -146,7 +147,7 @@ class ClusterClient {
|
|
|
146
147
|
return response.data;
|
|
147
148
|
});
|
|
148
149
|
}
|
|
149
|
-
createOrder({ quoteId, userAddressId, payoutBankAccountId, notes,
|
|
150
|
+
createOrder({ quoteId, userAddressId, payoutBankAccountId, notes, }) {
|
|
150
151
|
return __awaiter(this, void 0, void 0, function* () {
|
|
151
152
|
const response = yield this.axios.post(`${this.baseUrl}/api/orders`, {
|
|
152
153
|
quoteId,
|
|
@@ -155,7 +156,6 @@ class ClusterClient {
|
|
|
155
156
|
? payoutBankAccountId
|
|
156
157
|
: undefined,
|
|
157
158
|
notes: notes ? notes : undefined,
|
|
158
|
-
settlementTime: settlementTime ? settlementTime : undefined,
|
|
159
159
|
}, {
|
|
160
160
|
headers: {
|
|
161
161
|
"x-cluster-api-key": this.clusterApiKey,
|
|
@@ -164,7 +164,7 @@ class ClusterClient {
|
|
|
164
164
|
return response.data;
|
|
165
165
|
});
|
|
166
166
|
}
|
|
167
|
-
|
|
167
|
+
checkBankPayment(orderId) {
|
|
168
168
|
return __awaiter(this, void 0, void 0, function* () {
|
|
169
169
|
yield this.axios.post(`${this.baseUrl}/api/payments/bank/check`, {
|
|
170
170
|
orderId,
|
|
@@ -175,6 +175,17 @@ class ClusterClient {
|
|
|
175
175
|
});
|
|
176
176
|
});
|
|
177
177
|
}
|
|
178
|
+
checkCryptoPayment(orderId) {
|
|
179
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
180
|
+
yield this.axios.post(`${this.baseUrl}/api/payments/crypto/check`, {
|
|
181
|
+
orderId,
|
|
182
|
+
}, {
|
|
183
|
+
headers: {
|
|
184
|
+
"x-cluster-api-key": this.clusterApiKey,
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
});
|
|
188
|
+
}
|
|
178
189
|
createBitsoBankAccount(userId) {
|
|
179
190
|
return __awaiter(this, void 0, void 0, function* () {
|
|
180
191
|
const response = yield this.axios.post(`${this.baseUrl}/api/bank/accounts/bitso`, {
|
|
@@ -18,12 +18,12 @@ interface TelegramSessionAttrs {
|
|
|
18
18
|
country?: Country;
|
|
19
19
|
quoteMode?: "fiat" | "crypto";
|
|
20
20
|
USBankTransferMethod?: "ach_push" | "wire";
|
|
21
|
+
settlementTime?: SettlementTime;
|
|
21
22
|
};
|
|
22
23
|
quoteId?: string;
|
|
23
24
|
orderId?: string;
|
|
24
25
|
userAddressId?: string;
|
|
25
26
|
payoutBankAccountId?: string;
|
|
26
|
-
settlementTime?: SettlementTime;
|
|
27
27
|
}
|
|
28
28
|
interface TelegramSessionDoc extends mongoose.Document {
|
|
29
29
|
createdAt: Date;
|
|
@@ -43,12 +43,12 @@ interface TelegramSessionDoc extends mongoose.Document {
|
|
|
43
43
|
country?: Country;
|
|
44
44
|
quoteMode?: "fiat" | "crypto";
|
|
45
45
|
USBankTransferMethod?: "ach_push" | "wire";
|
|
46
|
+
settlementTime?: SettlementTime;
|
|
46
47
|
};
|
|
47
48
|
quoteId?: string;
|
|
48
49
|
orderId?: string;
|
|
49
50
|
userAddressId?: string;
|
|
50
51
|
payoutBankAccountId?: string;
|
|
51
|
-
settlementTime?: SettlementTime;
|
|
52
52
|
}
|
|
53
53
|
interface TelegramSessionModel extends mongoose.Model<TelegramSessionDoc> {
|
|
54
54
|
build(attrs: TelegramSessionAttrs): TelegramSessionDoc;
|
|
@@ -63,6 +63,9 @@ const buildTelegramSession = (mongoose) => {
|
|
|
63
63
|
quoteMode: {
|
|
64
64
|
type: String,
|
|
65
65
|
},
|
|
66
|
+
settlementTime: {
|
|
67
|
+
type: String,
|
|
68
|
+
},
|
|
66
69
|
},
|
|
67
70
|
quoteId: {
|
|
68
71
|
type: String,
|
|
@@ -76,9 +79,6 @@ const buildTelegramSession = (mongoose) => {
|
|
|
76
79
|
payoutBankAccountId: {
|
|
77
80
|
type: String,
|
|
78
81
|
},
|
|
79
|
-
settlementTime: {
|
|
80
|
-
type: String,
|
|
81
|
-
},
|
|
82
82
|
}, {
|
|
83
83
|
toJSON: {
|
|
84
84
|
transform(doc, ret) {
|