@riocrypto/common-server 1.0.1085 → 1.0.1087
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/bitso-client.d.ts +1 -1
- package/build/clients/bitso-client.js +2 -2
- package/build/index.d.ts +1 -0
- package/build/index.js +1 -0
- package/build/models/bank-account.d.ts +0 -2
- package/build/models/bank-account.js +0 -3
- package/build/models/bitso-receiving-account.d.ts +16 -0
- package/build/models/bitso-receiving-account.js +37 -0
- package/package.json +2 -2
|
@@ -7,7 +7,7 @@ declare class BitsoClient {
|
|
|
7
7
|
private baseUrl;
|
|
8
8
|
constructor(apiKey: string, apiSecret: string, env: "production" | "sandbox");
|
|
9
9
|
createClabe(): Promise<string>;
|
|
10
|
-
createReceivingAccount(user: User, bankAccount: BankAccount): Promise<string>;
|
|
10
|
+
createReceivingAccount(user: User, bankAccount: BankAccount, bitsoBankAccountCode: string): Promise<string>;
|
|
11
11
|
signRequest(requestConfig: AxiosRequestConfig): AxiosRequestConfig;
|
|
12
12
|
}
|
|
13
13
|
export declare const buildBistoClient: () => Promise<BitsoClient>;
|
|
@@ -41,7 +41,7 @@ class BitsoClient {
|
|
|
41
41
|
return data.payload.clabe;
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
-
createReceivingAccount(user, bankAccount) {
|
|
44
|
+
createReceivingAccount(user, bankAccount, bitsoBankAccountCode) {
|
|
45
45
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
46
|
const requestConfig = {
|
|
47
47
|
method: "POST",
|
|
@@ -62,7 +62,7 @@ class BitsoClient {
|
|
|
62
62
|
},
|
|
63
63
|
details: {
|
|
64
64
|
beneficiary: bankAccount.accountHolderName,
|
|
65
|
-
institution_code:
|
|
65
|
+
institution_code: bitsoBankAccountCode,
|
|
66
66
|
clabe: bankAccount.accountNumber,
|
|
67
67
|
},
|
|
68
68
|
},
|
package/build/index.d.ts
CHANGED
|
@@ -42,6 +42,7 @@ export * from "./models/webhook-registration";
|
|
|
42
42
|
export * from "./models/chained-quote";
|
|
43
43
|
export * from "./models/chained-order";
|
|
44
44
|
export * from "./models/bitso-bank-account";
|
|
45
|
+
export * from "./models/bitso-receiving-account";
|
|
45
46
|
export * from "./clients/bitstamp-client";
|
|
46
47
|
export * from "./clients/ccxt-client";
|
|
47
48
|
export * from "./clients/kushki-client";
|
package/build/index.js
CHANGED
|
@@ -58,6 +58,7 @@ __exportStar(require("./models/webhook-registration"), exports);
|
|
|
58
58
|
__exportStar(require("./models/chained-quote"), exports);
|
|
59
59
|
__exportStar(require("./models/chained-order"), exports);
|
|
60
60
|
__exportStar(require("./models/bitso-bank-account"), exports);
|
|
61
|
+
__exportStar(require("./models/bitso-receiving-account"), exports);
|
|
61
62
|
__exportStar(require("./clients/bitstamp-client"), exports);
|
|
62
63
|
__exportStar(require("./clients/ccxt-client"), exports);
|
|
63
64
|
__exportStar(require("./clients/kushki-client"), exports);
|
|
@@ -11,7 +11,6 @@ interface BankAccountAttrs {
|
|
|
11
11
|
approved: boolean;
|
|
12
12
|
swiftCode?: string;
|
|
13
13
|
notes?: string;
|
|
14
|
-
bitsoBankCode?: string;
|
|
15
14
|
}
|
|
16
15
|
interface BankAccountDoc extends Document {
|
|
17
16
|
createdAt: Date;
|
|
@@ -24,7 +23,6 @@ interface BankAccountDoc extends Document {
|
|
|
24
23
|
approved: boolean;
|
|
25
24
|
swiftCode?: string;
|
|
26
25
|
notes?: string;
|
|
27
|
-
bitsoBankCode?: string;
|
|
28
26
|
}
|
|
29
27
|
interface BankAccountModel extends Model<BankAccountDoc> {
|
|
30
28
|
build(attrs: BankAccountAttrs): BankAccountDoc;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import mongoose from "mongoose";
|
|
2
|
+
interface BitsoReceivingAccountAttrs {
|
|
3
|
+
userId: string;
|
|
4
|
+
bankAccountId: string;
|
|
5
|
+
BitsoReceivingAccountId: string;
|
|
6
|
+
}
|
|
7
|
+
interface BitsoReceivingAccountDoc extends mongoose.Document {
|
|
8
|
+
userId: string;
|
|
9
|
+
bankAccountId: string;
|
|
10
|
+
BitsoReceivingAccountId: string;
|
|
11
|
+
}
|
|
12
|
+
interface BitsoReceivingAccountModel extends mongoose.Model<BitsoReceivingAccountDoc> {
|
|
13
|
+
build(attrs: BitsoReceivingAccountAttrs): BitsoReceivingAccountDoc;
|
|
14
|
+
}
|
|
15
|
+
declare const buildBitsoReceivingAccount: (mongoose: typeof mongoose) => BitsoReceivingAccountModel;
|
|
16
|
+
export { buildBitsoReceivingAccount, BitsoReceivingAccountDoc };
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.buildBitsoReceivingAccount = void 0;
|
|
4
|
+
const buildBitsoReceivingAccount = (mongoose) => {
|
|
5
|
+
// if model is already defined, return it
|
|
6
|
+
if (mongoose.models.BitsoReceivingAccount) {
|
|
7
|
+
return mongoose.model("BitsoReceivingAccount");
|
|
8
|
+
}
|
|
9
|
+
const BitsoReceivingAccountSchema = new mongoose.Schema({
|
|
10
|
+
userId: {
|
|
11
|
+
type: String,
|
|
12
|
+
required: true,
|
|
13
|
+
},
|
|
14
|
+
bankAccountId: {
|
|
15
|
+
type: String,
|
|
16
|
+
required: true,
|
|
17
|
+
},
|
|
18
|
+
BitsoReceivingAccountId: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: true,
|
|
21
|
+
},
|
|
22
|
+
}, {
|
|
23
|
+
toJSON: {
|
|
24
|
+
transform(doc, ret) {
|
|
25
|
+
ret.id = ret._id;
|
|
26
|
+
delete ret._id;
|
|
27
|
+
delete ret.__v;
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
BitsoReceivingAccountSchema.statics.build = (attrs) => {
|
|
32
|
+
return new BitsoReceivingAccount(attrs);
|
|
33
|
+
};
|
|
34
|
+
const BitsoReceivingAccount = mongoose.model("BitsoReceivingAccount", BitsoReceivingAccountSchema);
|
|
35
|
+
return BitsoReceivingAccount;
|
|
36
|
+
};
|
|
37
|
+
exports.buildBitsoReceivingAccount = buildBitsoReceivingAccount;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@riocrypto/common-server",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1087",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "./build/index.js",
|
|
6
6
|
"types": "./build/index.d.ts",
|
|
@@ -25,7 +25,7 @@
|
|
|
25
25
|
"@aws-sdk/client-s3": "^3.297.0",
|
|
26
26
|
"@everapi/currencyapi-js": "^1.0.6",
|
|
27
27
|
"@google-cloud/storage": "^6.9.5",
|
|
28
|
-
"@riocrypto/common": "^1.0.
|
|
28
|
+
"@riocrypto/common": "^1.0.925",
|
|
29
29
|
"@types/express": "^4.17.13",
|
|
30
30
|
"axios": "^0.27.2",
|
|
31
31
|
"ccxt": "^3.0.30",
|