@spritz-finance/service-client 0.2.9 → 0.2.11

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.
@@ -36,8 +36,98 @@ export interface RewardTransaction {
36
36
  userId: string;
37
37
  context?: string;
38
38
  }
39
+ declare type TEntityTypes = 'individual' | 'c_corporation' | 's_corporation' | 'llc' | 'partnership' | 'sole_proprietorship' | 'receive_only';
40
+ interface IEntityIndividual {
41
+ first_name: string | null;
42
+ last_name: string | null;
43
+ phone: string | null;
44
+ email: string | null;
45
+ dob: string | null;
46
+ ssn?: string;
47
+ }
48
+ interface IEntityAddress {
49
+ line1: string | null;
50
+ line2: string | null;
51
+ city: string | null;
52
+ state: string | null;
53
+ zip: string | null;
54
+ }
55
+ interface IEntityCorporationOwner {
56
+ first_name: string | null;
57
+ last_name: string | null;
58
+ phone: string | null;
59
+ email: string | null;
60
+ dob: string | null;
61
+ address: IEntityAddress;
62
+ }
63
+ interface IEntityCorporation {
64
+ name: string | null;
65
+ dba: string | null;
66
+ ein: string | null;
67
+ owners: IEntityCorporationOwner[];
68
+ }
69
+ interface IEntityReceiveOnly {
70
+ name: string;
71
+ phone: string | null;
72
+ email: string | null;
73
+ }
74
+ declare type TEntityCapabilities = 'payments:send' | 'payments:receive' | 'payments:limited-send' | 'data:retrieve' | 'data:sync';
75
+ declare type TEntityStatuses = 'active' | 'incomplete' | 'disabled';
76
+ interface IResourceError {
77
+ type: string;
78
+ code: number;
79
+ sub_type: string;
80
+ message: string;
81
+ }
82
+ interface IEntity {
83
+ id: string;
84
+ type: TEntityTypes;
85
+ individual: IEntityIndividual | null;
86
+ corporation: IEntityCorporation | null;
87
+ receive_only: IEntityReceiveOnly | null;
88
+ capabilities: TEntityCapabilities[];
89
+ available_capabilities: TEntityCapabilities[];
90
+ pending_capabilities: TEntityCapabilities[];
91
+ address: IEntityAddress;
92
+ status: TEntityStatuses;
93
+ error: IResourceError | null;
94
+ metadata: {} | null;
95
+ created_at: string;
96
+ updated_at: string;
97
+ }
98
+ interface MethodFiEntity extends IEntity {
99
+ userId: string;
100
+ }
101
+ interface IEntityCreateOpts {
102
+ type: TEntityTypes;
103
+ address?: IEntityAddress | null;
104
+ metadata?: {};
105
+ }
106
+ interface IEntityCorporationOwner {
107
+ first_name: string | null;
108
+ last_name: string | null;
109
+ phone: string | null;
110
+ email: string | null;
111
+ dob: string | null;
112
+ address: IEntityAddress;
113
+ }
114
+ interface IEntityCorporation {
115
+ name: string | null;
116
+ dba: string | null;
117
+ ein: string | null;
118
+ owners: IEntityCorporationOwner[];
119
+ }
120
+ export interface ICorporationCreateOpts extends IEntityCreateOpts {
121
+ type: 'c_corporation' | 's_corporation' | 'llc' | 'partnership' | 'sole_proprietorship';
122
+ corporation: Partial<IEntityCorporation>;
123
+ }
124
+ export declare type CreateEntityParams = Pick<IEntity, 'type' | 'individual' | 'corporation' | 'address'> & {
125
+ userId: string;
126
+ };
39
127
  export declare class LiabilitiesServiceClient {
40
128
  client: AxiosInstance;
41
129
  constructor();
42
130
  getRewardTransaction(transactionId: string): Promise<RewardTransaction>;
131
+ createMethodFiEntity(args: CreateEntityParams): Promise<MethodFiEntity>;
43
132
  }
133
+ export {};
@@ -34,5 +34,10 @@ class LiabilitiesServiceClient {
34
34
  .get(`/reward-transactions/${transactionId}`)
35
35
  .then((res) => res.data);
36
36
  }
37
+ async createMethodFiEntity(args) {
38
+ return this.client
39
+ .post(`/methodFi/entity`, args)
40
+ .then((res) => res.data);
41
+ }
37
42
  }
38
43
  exports.LiabilitiesServiceClient = LiabilitiesServiceClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spritz-finance/service-client",
3
- "version": "0.2.9",
3
+ "version": "0.2.11",
4
4
  "description": "Service client",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",