@riocrypto/common-server 1.0.1079 → 1.0.1080
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.
|
@@ -6,6 +6,7 @@ declare class BitsoClient {
|
|
|
6
6
|
private baseUrl;
|
|
7
7
|
constructor(apiKey: string, apiSecret: string, env: "production" | "sandbox");
|
|
8
8
|
createClabe(): Promise<string>;
|
|
9
|
+
createReceivingAccount(): Promise<string>;
|
|
9
10
|
signRequest(requestConfig: AxiosRequestConfig): AxiosRequestConfig;
|
|
10
11
|
}
|
|
11
12
|
export declare const buildBistoClient: () => Promise<BitsoClient>;
|
|
@@ -41,6 +41,36 @@ class BitsoClient {
|
|
|
41
41
|
return data.payload.clabe;
|
|
42
42
|
});
|
|
43
43
|
}
|
|
44
|
+
createReceivingAccount() {
|
|
45
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
const requestConfig = {
|
|
47
|
+
method: "POST",
|
|
48
|
+
url: `${this.baseUrl}/api/v3/consumer-contacts`,
|
|
49
|
+
headers: {
|
|
50
|
+
"Content-Type": "application/json",
|
|
51
|
+
},
|
|
52
|
+
data: {
|
|
53
|
+
alias: "Test CLABE",
|
|
54
|
+
userMail: "javier@riotransfer.co",
|
|
55
|
+
currency: "mxn",
|
|
56
|
+
taxonomy: {
|
|
57
|
+
network: "spei",
|
|
58
|
+
asset: "mxn",
|
|
59
|
+
protocol: "clabe",
|
|
60
|
+
integration: "stp",
|
|
61
|
+
},
|
|
62
|
+
details: {
|
|
63
|
+
beneficiary: "Javier Roberts",
|
|
64
|
+
institution_code: "37006",
|
|
65
|
+
clabe: "123456789123456789",
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
const signedRequestConfig = this.signRequest(requestConfig);
|
|
70
|
+
const { data } = yield (0, axios_1.default)(signedRequestConfig);
|
|
71
|
+
return data.payload.clabe;
|
|
72
|
+
});
|
|
73
|
+
}
|
|
44
74
|
signRequest(requestConfig) {
|
|
45
75
|
var _a;
|
|
46
76
|
const url = new URL(requestConfig.url || "");
|