@spritz-finance/service-client 0.3.36 → 0.3.37
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.
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
export * as OnrampClient from './onrampServiceClient';
|
|
2
2
|
import { OnRampPayment } from '../lib/graphClient/generated';
|
|
3
|
-
import { SyncOnrampTransferInput } from './types';
|
|
3
|
+
import { BridgeUser, SyncOnrampTransferInput } from './types';
|
|
4
4
|
export declare function syncTransfer(input: SyncOnrampTransferInput): Promise<OnRampPayment>;
|
|
5
5
|
export declare function getUserCompletedPayments(userId: string): Promise<OnRampPayment[]>;
|
|
6
|
+
export declare function upsertBridgeUser(input: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<BridgeUser>>;
|
|
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
23
23
|
return result;
|
|
24
24
|
};
|
|
25
25
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.getUserCompletedPayments = exports.syncTransfer = exports.OnrampClient = void 0;
|
|
26
|
+
exports.upsertBridgeUser = exports.getUserCompletedPayments = exports.syncTransfer = exports.OnrampClient = void 0;
|
|
27
27
|
exports.OnrampClient = __importStar(require("./onrampServiceClient"));
|
|
28
28
|
const serviceClient_1 = require("../serviceClient");
|
|
29
29
|
const ONRAMP_ENDPOINT = '/bridge';
|
|
@@ -39,3 +39,9 @@ async function getUserCompletedPayments(userId) {
|
|
|
39
39
|
.then((res) => res.data);
|
|
40
40
|
}
|
|
41
41
|
exports.getUserCompletedPayments = getUserCompletedPayments;
|
|
42
|
+
async function upsertBridgeUser(input) {
|
|
43
|
+
return serviceClient_1.baseClient
|
|
44
|
+
.post(`${ONRAMP_ENDPOINT}/user`, input)
|
|
45
|
+
.then((res) => res.data);
|
|
46
|
+
}
|
|
47
|
+
exports.upsertBridgeUser = upsertBridgeUser;
|
package/lib/onramp/types.d.ts
CHANGED
|
@@ -16,3 +16,22 @@ export type SyncOnrampTransferInput = {
|
|
|
16
16
|
sourceCurrency: string;
|
|
17
17
|
userId: string;
|
|
18
18
|
};
|
|
19
|
+
export type CreateBridgeUserParams = {
|
|
20
|
+
userId: string;
|
|
21
|
+
address: {
|
|
22
|
+
street?: string;
|
|
23
|
+
street2?: string;
|
|
24
|
+
city?: string;
|
|
25
|
+
subdivision?: string;
|
|
26
|
+
postalCode?: string;
|
|
27
|
+
countryCode: string;
|
|
28
|
+
};
|
|
29
|
+
email: string;
|
|
30
|
+
firstName: string;
|
|
31
|
+
lastName: string;
|
|
32
|
+
};
|
|
33
|
+
export type BridgeUser = {
|
|
34
|
+
id: string;
|
|
35
|
+
userId: string;
|
|
36
|
+
externalId: string;
|
|
37
|
+
};
|