@spritz-finance/service-client 0.3.76 → 0.3.78

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,4 +1,5 @@
1
1
  export * as BridgeClient from './bridgeServiceClient';
2
+ import { ExternalPayment } from '../lib/graphClient/generated';
2
3
  import { BridgeUser } from '../onramp/types';
3
4
  import { BridgeExternalAccount, BridgeNetwork, BridgeTransfer, BridgeTransferOffRampPaymentRail, CreateBridgeAccountParams } from './types';
4
5
  export declare function createBridgeBankAccount(userId: string, accountId: string, input: CreateBridgeAccountParams): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<BridgeExternalAccount>>;
@@ -17,3 +18,4 @@ export declare function createBridgeTransfer(userId: string, input: {
17
18
  accountId: string;
18
19
  paymentRail: BridgeTransferOffRampPaymentRail;
19
20
  }): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<BridgeTransfer>>;
21
+ export declare function getExternalPayments(paymentIds: string[]): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<ExternalPayment[]>>;
@@ -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.createBridgeTransfer = exports.validateTransfer = exports.getBridgeUser = exports.createBridgeBankAccount = exports.BridgeClient = void 0;
26
+ exports.getExternalPayments = exports.createBridgeTransfer = exports.validateTransfer = exports.getBridgeUser = exports.createBridgeBankAccount = exports.BridgeClient = void 0;
27
27
  exports.BridgeClient = __importStar(require("./bridgeServiceClient"));
28
28
  const serviceClient_1 = require("../serviceClient");
29
29
  const ONRAMP_ENDPOINT = '/bridge';
@@ -56,3 +56,9 @@ async function createBridgeTransfer(userId, input) {
56
56
  .then((res) => res.data);
57
57
  }
58
58
  exports.createBridgeTransfer = createBridgeTransfer;
59
+ async function getExternalPayments(paymentIds) {
60
+ return serviceClient_1.baseClient
61
+ .get(`${ONRAMP_ENDPOINT}/external-payments?paymentIds=${paymentIds.join(',')}`)
62
+ .then((res) => res.data);
63
+ }
64
+ exports.getExternalPayments = getExternalPayments;
@@ -54,4 +54,21 @@ export type Verification = {
54
54
  cardLimit: number;
55
55
  };
56
56
  };
57
+ export type IdentityData = {
58
+ firstName: string;
59
+ lastName: string;
60
+ email: string;
61
+ address: {
62
+ street: string;
63
+ street2?: string;
64
+ city: string;
65
+ subdivision: string;
66
+ postalCode: string;
67
+ countryCode: string;
68
+ };
69
+ phoneNumberFull: string;
70
+ phoneNumber: string;
71
+ phoneNumberCountryCode: string;
72
+ dateOfBirth: string;
73
+ };
57
74
  export {};
@@ -1,5 +1,6 @@
1
1
  export * as VerificationClient from './verificationServiceClient';
2
2
  import { User } from '../users/types';
3
- import { Verification } from './types';
3
+ import { IdentityData, Verification } from './types';
4
4
  export declare function getUserVerification(userId: string): Promise<Verification>;
5
+ export declare function getUserIdentity(userId: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<IdentityData>>;
5
6
  export declare function createUserVerification(user: User): Promise<Verification>;
@@ -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.createUserVerification = exports.getUserVerification = exports.VerificationClient = void 0;
26
+ exports.createUserVerification = exports.getUserIdentity = exports.getUserVerification = exports.VerificationClient = void 0;
27
27
  exports.VerificationClient = __importStar(require("./verificationServiceClient"));
28
28
  const serviceClient_1 = require("../serviceClient");
29
29
  const VERIFICATION_ENDPOINT = '/verification';
@@ -33,6 +33,12 @@ async function getUserVerification(userId) {
33
33
  .then((res) => res.data);
34
34
  }
35
35
  exports.getUserVerification = getUserVerification;
36
+ async function getUserIdentity(userId) {
37
+ return serviceClient_1.baseClient
38
+ .get(`${VERIFICATION_ENDPOINT}/user/${userId}/identity`)
39
+ .then((res) => res.data);
40
+ }
41
+ exports.getUserIdentity = getUserIdentity;
36
42
  async function createUserVerification(user) {
37
43
  return serviceClient_1.baseClient
38
44
  .post(`${VERIFICATION_ENDPOINT}/users`, user)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spritz-finance/service-client",
3
- "version": "0.3.76",
3
+ "version": "0.3.78",
4
4
  "description": "Service client",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",