@owneraio/finp2p-sdk-js 0.13.1 → 0.13.2
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.
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const utils_1 = require("../utils");
|
|
4
4
|
const payments = (connector) => ({
|
|
5
|
-
deposit: (request) => utils_1.apiPost(`/payments/deposit`, request, 'finapi', connector,
|
|
6
|
-
withdraw: (request) => utils_1.apiPost(`/payments/withdraw`, request, 'finapi', connector,
|
|
5
|
+
deposit: (request, options) => utils_1.apiPost(`/payments/deposit`, request, 'finapi', connector, options),
|
|
6
|
+
withdraw: (request, options) => utils_1.apiPost(`/payments/withdraw`, request, 'finapi', connector, options),
|
|
7
7
|
});
|
|
8
8
|
exports.default = payments;
|
|
9
9
|
//# sourceMappingURL=payments.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payments.js","sourceRoot":"","sources":["../../../src/OwneraAPI/finp2p-node-api/payments.ts"],"names":[],"mappings":";;AACA,oCAAmC;
|
|
1
|
+
{"version":3,"file":"payments.js","sourceRoot":"","sources":["../../../src/OwneraAPI/finp2p-node-api/payments.ts"],"names":[],"mappings":";;AACA,oCAAmC;AAInC,MAAM,QAAQ,GAAG,CAAC,SAAwB,EAAY,EAAE,CAAC,CAAC;IACxD,OAAO,EAAE,CAAC,OAAuB,EAAE,OAAwB,EAA4B,EAAE,CACvF,eAAO,CAAkC,mBAAmB,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;IACtG,QAAQ,EAAE,CAAC,OAAwB,EAAE,OAAwB,EAA6B,EAAE,CAC1F,eAAO,CAAoC,oBAAoB,EAAE,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,CAAC;CAC1G,CAAC,CAAC;AAEH,kBAAe,QAAQ,CAAC"}
|
package/lib/core/payments.js
CHANGED
|
@@ -11,6 +11,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.withdraw = exports.deposit = void 0;
|
|
13
13
|
const utils_1 = require("../OwneraAPI/utils");
|
|
14
|
+
const utils_2 = require("./utils");
|
|
14
15
|
const deposit = (req) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
16
|
const { owneraAPI, userId, account, amount } = req;
|
|
16
17
|
const orgId = account.account.orgId;
|
|
@@ -43,12 +44,25 @@ const deposit = (req) => __awaiter(void 0, void 0, void 0, function* () {
|
|
|
43
44
|
data: { orgId },
|
|
44
45
|
};
|
|
45
46
|
}
|
|
46
|
-
return Promise.resolve(yield owneraAPI.payments.deposit({
|
|
47
|
+
return Promise.resolve(yield owneraAPI.payments.deposit({
|
|
48
|
+
profileId: userId,
|
|
49
|
+
account,
|
|
50
|
+
amount,
|
|
51
|
+
}, {
|
|
52
|
+
idempotency: utils_2.generateIdempotencyKey(),
|
|
53
|
+
}));
|
|
47
54
|
});
|
|
48
55
|
exports.deposit = deposit;
|
|
49
56
|
const withdraw = (req) => __awaiter(void 0, void 0, void 0, function* () {
|
|
50
57
|
const { owneraAPI, userId, account, amount, withdrawInstruction } = req;
|
|
51
|
-
return Promise.resolve(yield owneraAPI.payments.withdraw({
|
|
58
|
+
return Promise.resolve(yield owneraAPI.payments.withdraw({
|
|
59
|
+
profileId: userId,
|
|
60
|
+
account,
|
|
61
|
+
amount,
|
|
62
|
+
withdrawInstruction,
|
|
63
|
+
}, {
|
|
64
|
+
idempotency: utils_2.generateIdempotencyKey(),
|
|
65
|
+
}));
|
|
52
66
|
});
|
|
53
67
|
exports.withdraw = withdraw;
|
|
54
68
|
//# sourceMappingURL=payments.js.map
|
package/lib/core/payments.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"payments.js","sourceRoot":"","sources":["../../src/core/payments.ts"],"names":[],"mappings":";;;;;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ocurrencyAsset, FiatAsset, FinP2PAsset } from '../Profiles';
|
|
2
|
-
import { Operation } from '../Commons';
|
|
2
|
+
import { Operation, RequestOptions } from '../Commons';
|
|
3
3
|
export interface Payments {
|
|
4
|
-
deposit(r: DepositRequest): Promise<DepositResponse>;
|
|
5
|
-
withdraw(r: WithdrawRequest): Promise<WithdrawResponse>;
|
|
4
|
+
deposit(r: DepositRequest, options?: RequestOptions): Promise<DepositResponse>;
|
|
5
|
+
withdraw(r: WithdrawRequest, options?: RequestOptions): Promise<WithdrawResponse>;
|
|
6
6
|
}
|
|
7
7
|
export interface DepositRequest {
|
|
8
8
|
profileId: string;
|
|
@@ -10,6 +10,8 @@ export interface DepositRequest {
|
|
|
10
10
|
amount: string;
|
|
11
11
|
}
|
|
12
12
|
export interface PaymentError {
|
|
13
|
+
code: number;
|
|
14
|
+
message: string;
|
|
13
15
|
}
|
|
14
16
|
export interface DepositResponse extends Operation {
|
|
15
17
|
error?: PaymentError;
|