@spritz-finance/service-client 0.2.16 → 0.2.18

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.
@@ -16,7 +16,7 @@ export declare enum RewardCreditSource {
16
16
  OTHER = "OTHER",
17
17
  REVENUE_SHARE = "REVENUE_SHARE"
18
18
  }
19
- declare type CheckbookCardResponse = {
19
+ export declare type CheckbookCardResponse = {
20
20
  userId: string;
21
21
  externalId: string;
22
22
  mask: string;
@@ -140,6 +140,11 @@ export interface ICorporationCreateOpts extends IEntityCreateOpts {
140
140
  type: 'c_corporation' | 's_corporation' | 'llc' | 'partnership' | 'sole_proprietorship';
141
141
  corporation: Partial<IEntityCorporation>;
142
142
  }
143
+ declare type CardTransaction = {
144
+ amount: number;
145
+ timestamp: Date;
146
+ description: string;
147
+ };
143
148
  export declare type CreateEntityParams = Pick<IEntity, 'type' | 'individual' | 'corporation' | 'address'> & {
144
149
  userId: string;
145
150
  };
@@ -149,5 +154,7 @@ export declare class LiabilitiesServiceClient {
149
154
  getRewardTransaction(transactionId: string): Promise<RewardTransaction>;
150
155
  createMethodFiEntity(args: CreateEntityParams): Promise<MethodFiEntity>;
151
156
  createCheckbookVirtualCard(userId: string): Promise<CheckbookCardResponse>;
157
+ getVirtualCardBalance(cardExternalId: string, userId: string): Promise<number>;
158
+ getVirtualCardTransactions(cardExternalId: string, userId: string): Promise<CardTransaction[]>;
152
159
  }
153
160
  export {};
@@ -44,5 +44,15 @@ class LiabilitiesServiceClient {
44
44
  .post(`/virtual-card/${userId}/create`)
45
45
  .then((res) => res.data);
46
46
  }
47
+ async getVirtualCardBalance(cardExternalId, userId) {
48
+ return this.client
49
+ .get(`/virtual-card/${cardExternalId}/balance?userId=${userId}`)
50
+ .then((res) => res.data);
51
+ }
52
+ async getVirtualCardTransactions(cardExternalId, userId) {
53
+ return this.client
54
+ .get(`/virtual-card/${cardExternalId}/transactions?userId=${userId}`)
55
+ .then((res) => res.data);
56
+ }
47
57
  }
48
58
  exports.LiabilitiesServiceClient = LiabilitiesServiceClient;