@riocrypto/common-server 1.0.1633 → 1.0.1635
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.
|
@@ -5,8 +5,15 @@ declare class CoincoverClient {
|
|
|
5
5
|
private coingeckoMappings;
|
|
6
6
|
constructor(apiKey: string);
|
|
7
7
|
checkTransaction(transactionId: string, userId: string, crypto: Crypto, originVaultOrExchangeId: string, destinationAddress: string, amount: number): Promise<{
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
transactionUUID: string;
|
|
9
|
+
status: "GREEN" | "RED";
|
|
10
|
+
code?: string;
|
|
11
|
+
message?: string;
|
|
12
|
+
meta?: {
|
|
13
|
+
category?: string;
|
|
14
|
+
providerCategory?: string;
|
|
15
|
+
blocklistedAddress?: string;
|
|
16
|
+
};
|
|
10
17
|
}>;
|
|
11
18
|
}
|
|
12
19
|
export declare const buildCoincoverClient: () => Promise<CoincoverClient>;
|
|
@@ -57,23 +57,7 @@ class CoincoverClient {
|
|
|
57
57
|
Authorization: `Bearer ${this.apiKey}`,
|
|
58
58
|
},
|
|
59
59
|
});
|
|
60
|
-
|
|
61
|
-
return {
|
|
62
|
-
approved: false,
|
|
63
|
-
rejectionCode: "NO_RESPONSE",
|
|
64
|
-
};
|
|
65
|
-
}
|
|
66
|
-
if (data.status === "GREEN") {
|
|
67
|
-
return {
|
|
68
|
-
approved: true,
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
else {
|
|
72
|
-
return {
|
|
73
|
-
approved: false,
|
|
74
|
-
rejectionCode: data.code,
|
|
75
|
-
};
|
|
76
|
-
}
|
|
60
|
+
return data;
|
|
77
61
|
});
|
|
78
62
|
}
|
|
79
63
|
}
|
package/build/index.d.ts
CHANGED
|
@@ -56,6 +56,7 @@ export * from "./models/bid";
|
|
|
56
56
|
export * from "./models/rio-bank-account";
|
|
57
57
|
export * from "./models/address-verification";
|
|
58
58
|
export * from "./models/bank-account-verification";
|
|
59
|
+
export * from "./models/coincover-transaction";
|
|
59
60
|
export * from "./clients/bitstamp-client";
|
|
60
61
|
export * from "./clients/ccxt-client";
|
|
61
62
|
export * from "./clients/slack-client";
|
package/build/index.js
CHANGED
|
@@ -72,6 +72,7 @@ __exportStar(require("./models/bid"), exports);
|
|
|
72
72
|
__exportStar(require("./models/rio-bank-account"), exports);
|
|
73
73
|
__exportStar(require("./models/address-verification"), exports);
|
|
74
74
|
__exportStar(require("./models/bank-account-verification"), exports);
|
|
75
|
+
__exportStar(require("./models/coincover-transaction"), exports);
|
|
75
76
|
__exportStar(require("./clients/bitstamp-client"), exports);
|
|
76
77
|
__exportStar(require("./clients/ccxt-client"), exports);
|
|
77
78
|
__exportStar(require("./clients/slack-client"), exports);
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { Mongoose, Model, Document } from "mongoose";
|
|
2
|
+
interface CoincoverTransactionAttrs {
|
|
3
|
+
coincoverTransactionId: string;
|
|
4
|
+
status: "GREEN" | "RED";
|
|
5
|
+
rejectionCode?: string;
|
|
6
|
+
orderId?: string;
|
|
7
|
+
}
|
|
8
|
+
interface CoincoverTransactionModel extends Model<CoincoverTransactionDoc> {
|
|
9
|
+
build(attrs: CoincoverTransactionAttrs): CoincoverTransactionDoc;
|
|
10
|
+
}
|
|
11
|
+
interface CoincoverTransactionDoc extends Document {
|
|
12
|
+
_id: string;
|
|
13
|
+
coincoverTransactionId: string;
|
|
14
|
+
status: "GREEN" | "RED";
|
|
15
|
+
rejectionCode?: string;
|
|
16
|
+
orderId?: string;
|
|
17
|
+
}
|
|
18
|
+
declare const buildCoincoverTransaction: (mongoose: Mongoose) => CoincoverTransactionModel;
|
|
19
|
+
export { buildCoincoverTransaction, CoincoverTransactionDoc, CoincoverTransactionAttrs, };
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildCoincoverTransaction = void 0;
|
|
4
|
+
const buildCoincoverTransaction = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.CoincoverTransaction) {
|
|
7
|
+
return mongoose.model("CoincoverTransaction");
|
|
8
|
+
}
|
|
9
|
+
const CoincoverTransactionSchema = new mongoose.Schema({
|
|
10
|
+
coincoverTransactionId: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
status: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
rejectionCode: {
|
|
19
|
+
type: String,
|
|
20
|
+
},
|
|
21
|
+
orderId: {
|
|
22
|
+
type: String,
|
|
23
|
+
},
|
|
24
|
+
}, {
|
|
25
|
+
toJSON: {
|
|
26
|
+
transform(doc, ret) {
|
|
27
|
+
ret.id = ret._id.valueOf();
|
|
28
|
+
delete ret._id;
|
|
29
|
+
delete ret.__v;
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
});
|
|
33
|
+
CoincoverTransactionSchema.statics.build = (attrs) => {
|
|
34
|
+
return new CoincoverTransaction(attrs);
|
|
35
|
+
};
|
|
36
|
+
const CoincoverTransaction = mongoose.model("CoincoverTransaction", CoincoverTransactionSchema);
|
|
37
|
+
return CoincoverTransaction;
|
|
38
|
+
};
|
|
39
|
+
exports.buildCoincoverTransaction = buildCoincoverTransaction;
|