@dalmore/api-contracts 1.0.6 → 1.0.7

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.
Files changed (137) hide show
  1. package/dist/contracts/clients/index.d.ts +19 -0
  2. package/index.mjs +4 -1
  3. package/package.json +4 -4
  4. package/src/common/types/account-contact.types.ts +0 -98
  5. package/src/common/types/account-detail.types.ts +0 -27
  6. package/src/common/types/account-integration.types.ts +0 -143
  7. package/src/common/types/account-manager.types.ts +0 -124
  8. package/src/common/types/account.types.ts +0 -296
  9. package/src/common/types/activity.types.ts +0 -274
  10. package/src/common/types/address.spec.ts +0 -203
  11. package/src/common/types/address.types.ts +0 -41
  12. package/src/common/types/aic.types.ts +0 -246
  13. package/src/common/types/aml.types.ts +0 -18
  14. package/src/common/types/api-key-logs.types.ts +0 -66
  15. package/src/common/types/api-keys.types.ts +0 -69
  16. package/src/common/types/asset.types.ts +0 -338
  17. package/src/common/types/auth.types.ts +0 -370
  18. package/src/common/types/batch-jobs.types.ts +0 -151
  19. package/src/common/types/bonus-tier.types.ts +0 -147
  20. package/src/common/types/cart.types.ts +0 -18
  21. package/src/common/types/checklist-items.types.ts +0 -70
  22. package/src/common/types/checklist.types.ts +0 -97
  23. package/src/common/types/common.types.spec.ts +0 -336
  24. package/src/common/types/common.types.ts +0 -1520
  25. package/src/common/types/comply-advantage-api.types.ts +0 -316
  26. package/src/common/types/comply-advantage.types.ts +0 -25
  27. package/src/common/types/contact-us.types.ts +0 -107
  28. package/src/common/types/contract-helpers.ts +0 -205
  29. package/src/common/types/countries.types.ts +0 -375
  30. package/src/common/types/covered-person.types.ts +0 -274
  31. package/src/common/types/dashboard.types.ts +0 -799
  32. package/src/common/types/data-record.types.ts +0 -325
  33. package/src/common/types/data-room.types.ts +0 -242
  34. package/src/common/types/default-theme-config.types.ts +0 -87
  35. package/src/common/types/disbursement-adjustment.types.ts +0 -32
  36. package/src/common/types/disbursement-approval-user.types.ts +0 -100
  37. package/src/common/types/disbursement-review.types.ts +0 -110
  38. package/src/common/types/disbursement-transaction.types.ts +0 -72
  39. package/src/common/types/disbursements.types.ts +0 -310
  40. package/src/common/types/domain-filter.types.ts +0 -55
  41. package/src/common/types/email-theme.types.ts +0 -442
  42. package/src/common/types/entity.types.ts +0 -15
  43. package/src/common/types/error-responses.types.ts +0 -135
  44. package/src/common/types/escrow-account.types.ts +0 -104
  45. package/src/common/types/exchange-api-key.types.ts +0 -121
  46. package/src/common/types/exchange-import.types.ts +0 -36
  47. package/src/common/types/exchange-provider.types.ts +0 -329
  48. package/src/common/types/file.types.ts +0 -461
  49. package/src/common/types/files.types.spec.ts +0 -154
  50. package/src/common/types/health.types.ts +0 -29
  51. package/src/common/types/index.ts +0 -48
  52. package/src/common/types/individuals.types.ts +0 -554
  53. package/src/common/types/investor-account.types.ts +0 -1239
  54. package/src/common/types/investorAccountIdSchema.type.ts +0 -0
  55. package/src/common/types/investors-offering.types.ts +0 -65
  56. package/src/common/types/invite.types.ts +0 -133
  57. package/src/common/types/issuer-bank-account.types.ts +0 -107
  58. package/src/common/types/issuer-offering.types.ts +0 -306
  59. package/src/common/types/issuer-payment-method.types.spec.ts +0 -612
  60. package/src/common/types/issuer-payment-method.types.ts +0 -341
  61. package/src/common/types/issuer.types.ts +0 -312
  62. package/src/common/types/job-item.types.ts +0 -119
  63. package/src/common/types/jobs.types.ts +0 -171
  64. package/src/common/types/kyb.types.ts +0 -53
  65. package/src/common/types/kyc.types.ts +0 -188
  66. package/src/common/types/legal-entity.types.ts +0 -185
  67. package/src/common/types/login-history.types.ts +0 -46
  68. package/src/common/types/mail-template.types.ts +0 -436
  69. package/src/common/types/north-cap-integration.types.ts +0 -190
  70. package/src/common/types/note.types.ts +0 -109
  71. package/src/common/types/notification.types.ts +0 -58
  72. package/src/common/types/notion-api.types.ts +0 -374
  73. package/src/common/types/notion-database.types.ts +0 -125
  74. package/src/common/types/notion-page.types.ts +0 -267
  75. package/src/common/types/offering-reports.types.ts +0 -153
  76. package/src/common/types/offering-submission.types.ts +0 -314
  77. package/src/common/types/offering.types.spec.ts +0 -91
  78. package/src/common/types/offering.types.ts +0 -590
  79. package/src/common/types/page-revision.types.ts +0 -86
  80. package/src/common/types/page.types.ts +0 -436
  81. package/src/common/types/password.type.ts +0 -15
  82. package/src/common/types/payment-methods.types.ts +0 -298
  83. package/src/common/types/phone.spec.ts +0 -76
  84. package/src/common/types/phone.type.ts +0 -27
  85. package/src/common/types/portfolio.types.ts +0 -50
  86. package/src/common/types/privacy-policy-and-tos.types.ts +0 -231
  87. package/src/common/types/queue.types.ts +0 -112
  88. package/src/common/types/registered-reps.types.ts +0 -25
  89. package/src/common/types/rejection-reasons.types.ts +0 -56
  90. package/src/common/types/reminder-config.types.ts +0 -40
  91. package/src/common/types/review.types.ts +0 -133
  92. package/src/common/types/role.types.ts +0 -26
  93. package/src/common/types/secondary-customer.types.ts +0 -66
  94. package/src/common/types/secondary-issuer.types.ts +0 -50
  95. package/src/common/types/secondary-order.types.ts +0 -58
  96. package/src/common/types/secondary-security.types.ts +0 -60
  97. package/src/common/types/secondary-trade.entity.ts +0 -16
  98. package/src/common/types/secondary-trade.types.ts +0 -95
  99. package/src/common/types/secure-request.types.ts +0 -68
  100. package/src/common/types/signer.types.ts +0 -651
  101. package/src/common/types/site-link.types.spec.ts +0 -134
  102. package/src/common/types/site-link.types.ts +0 -166
  103. package/src/common/types/site-settings.types.ts +0 -726
  104. package/src/common/types/site.types.ts +0 -270
  105. package/src/common/types/sms.types.ts +0 -30
  106. package/src/common/types/state-machine.types.ts +0 -177
  107. package/src/common/types/states.types.ts +0 -163
  108. package/src/common/types/subdoc-preview.types.ts +0 -35
  109. package/src/common/types/task.types.ts +0 -258
  110. package/src/common/types/trade-adjustment.type.ts +0 -33
  111. package/src/common/types/trade-line-item.type.ts +0 -132
  112. package/src/common/types/trade.types.ts +0 -929
  113. package/src/common/types/transaction.types.ts +0 -198
  114. package/src/common/types/trusted-contact.types.ts +0 -122
  115. package/src/common/types/typography.types.ts +0 -75
  116. package/src/common/types/user-manual.types.ts +0 -290
  117. package/src/common/types/user-setting.types.ts +0 -133
  118. package/src/common/types/user.types.ts +0 -320
  119. package/src/common/types/webhook.types.ts +0 -588
  120. package/src/common/types/zip.type.ts +0 -36
  121. package/src/contracts/clients/accounts/index.ts +0 -61
  122. package/src/contracts/clients/aic/index.ts +0 -59
  123. package/src/contracts/clients/api-key-logs/index.ts +0 -53
  124. package/src/contracts/clients/api-keys/index.ts +0 -73
  125. package/src/contracts/clients/assets/index.ts +0 -102
  126. package/src/contracts/clients/auth/index.ts +0 -50
  127. package/src/contracts/clients/files/index.ts +0 -166
  128. package/src/contracts/clients/files-public/index.ts +0 -166
  129. package/src/contracts/clients/index.ts +0 -44
  130. package/src/contracts/clients/individuals/index.ts +0 -93
  131. package/src/contracts/clients/investor-accounts/index.ts +0 -93
  132. package/src/contracts/clients/issuers/index.ts +0 -94
  133. package/src/contracts/clients/legal-entities/index.ts +0 -93
  134. package/src/contracts/clients/offerings/index.ts +0 -117
  135. package/src/contracts/clients/secure-requests/index.ts +0 -34
  136. package/src/contracts/clients/sites/index.ts +0 -56
  137. package/src/contracts/clients/trades/index.ts +0 -122
@@ -1,298 +0,0 @@
1
- import { TypeID } from 'typeid-js';
2
- import { z } from 'zod';
3
- import { CountryEnumSchema } from './countries.types';
4
- import { userIdSchema } from './user.types';
5
- import { PaymentMethodType } from './common.types';
6
- // Re-export PaymentMethodType for backward compatibility
7
- export { PaymentMethodType };
8
-
9
- export const paymentMethodIdSchema = z.string().refine(
10
- (value) => {
11
- try {
12
- const tid = TypeID.fromString(value);
13
- return tid.getType() === 'payment_method';
14
- } catch {
15
- return false;
16
- }
17
- },
18
- {
19
- message: `Invalid payment_method ID format. Must be a valid TypeID with "payment_method" prefix. Example: payment_method_01j5y5ghx5fg68d663j1fvy2x7`,
20
- },
21
- );
22
-
23
- export enum PaymentMethodProvider {
24
- STRIPE = 'STRIPE',
25
- PLAID = 'PLAID',
26
- OTHER = 'OTHER',
27
- }
28
- export enum PaymentMethodStatus {
29
- PENDING = 'PENDING',
30
- VERIFIED = 'VERIFIED',
31
- CANCELLED = 'CANCELLED',
32
- ERRORED = 'ERRORED',
33
- }
34
-
35
- // https://docs.stripe.com/api/setup_intents/create
36
- // https://docs.stripe.com/api/payment_methods/object#payment_method_object-type
37
- export enum SetupIntentPaymentMethodType {
38
- card = 'card',
39
- us_bank_account = 'us_bank_account',
40
- ach = 'ach', // ACH is not directly supported by Stripe but we add it here to differentiate between instant bank account
41
- }
42
-
43
- export const PostPaymentMethod = z.object({
44
- paymentMethodType: z.nativeEnum(PaymentMethodType),
45
- paymentMethodProvider: z.nativeEnum(PaymentMethodProvider),
46
- status: z.nativeEnum(PaymentMethodStatus).optional(),
47
- clientSecret: z.string().min(1).max(255).optional(),
48
- tid: z.string(),
49
- name: z
50
- .string()
51
- .min(2, 'name is less than 2 characters')
52
- .max(30, 'name is more than 30 characters'),
53
- last4: z.string().length(4, 'last4 shall be 4 characters'),
54
- brand: z
55
- .string()
56
- .min(2, 'brand is less than 2 characters')
57
- .max(30, 'brand is more than 30 characters')
58
- .optional(),
59
- country: CountryEnumSchema.optional(),
60
- });
61
- export type PostPaymentMethod = z.infer<typeof PostPaymentMethod>;
62
-
63
- export const PostProviderPaymentMethod = z.object({
64
- providerPaymentMethodId: z.string(),
65
- paymentMethodType: z.enum([PaymentMethodType.BANK_ACCOUNT]),
66
- clientSecret: z.string(),
67
- });
68
- export type PostProviderPaymentMethod = z.infer<
69
- typeof PostProviderPaymentMethod
70
- >;
71
-
72
- export const CompliancePostPaymentMethod = PostPaymentMethod.omit({
73
- tid: true,
74
- }).extend({
75
- tid: z.string().optional(),
76
- userId: z.lazy(() => userIdSchema),
77
- });
78
-
79
- export const UpdatePaymentMethod = z.object({
80
- paymentMethodType: z.nativeEnum(PaymentMethodType).optional(),
81
- paymentMethodProvider: z.nativeEnum(PaymentMethodProvider).optional(),
82
- status: z.nativeEnum(PaymentMethodStatus).optional(),
83
- clientSecret: z.string().min(1).max(255).optional(),
84
- tid: z.string().optional(),
85
- name: z
86
- .string()
87
- .min(2, 'name is less than 2 characters')
88
- .max(30, 'name is more than 30 characters')
89
- .optional(),
90
- last4: z.string().length(4, 'last4 shall be 4 characters').optional(),
91
- brand: z
92
- .string()
93
- .min(2, 'brand is less than 2 characters')
94
- .max(30, 'brand is more than 30 characters')
95
- .optional(),
96
- country: CountryEnumSchema.optional(),
97
- });
98
-
99
- export const PaymentMethodFilterQuery = z.object({
100
- userId: z.lazy(() => userIdSchema).optional(),
101
- });
102
- export type PaymentMethodFilterQuery = z.infer<typeof PaymentMethodFilterQuery>;
103
-
104
- export const PaymentMethodResponse = z.object({
105
- id: paymentMethodIdSchema,
106
- paymentMethodType: z.nativeEnum(PaymentMethodType),
107
- paymentMethodProvider: z.nativeEnum(PaymentMethodProvider),
108
- status: z.nativeEnum(PaymentMethodStatus),
109
- clientSecret: z.string().nullable(),
110
- tid: z.string().nullable(),
111
- name: z.string(),
112
- last4: z.string().nullable(),
113
- brand: z.string().nullable(),
114
- country: z.string().nullable(),
115
- userId: z.string().nullable(),
116
- });
117
- export type PaymentMethodResponse = z.infer<typeof PaymentMethodResponse>;
118
- export const PaymentMethodResponseArray = z.array(PaymentMethodResponse);
119
-
120
- // https://docs.stripe.com/api/payment_intents/object#payment_intent_object-status
121
- export enum StripePaymentIntentStatus {
122
- SUCCEEDED = 'succeeded',
123
- REQUIRES_PAYMENT_METHOD = 'requires_payment_method',
124
- REQUIRES_CONFIRMATION = 'requires_confirmation',
125
- REQUIRES_ACTION = 'requires_action',
126
- REQUIRES_CAPTURE = 'requires_capture',
127
- PROCESSING = 'processing',
128
- CANCELED = 'canceled',
129
- }
130
-
131
- export const PaymentProviderResult = z.object({
132
- id: z.string(),
133
- amount: z.number(),
134
- currency: z.string(),
135
- provider: z.nativeEnum(PaymentMethodProvider),
136
- created: z.date(),
137
- status: z.nativeEnum(StripePaymentIntentStatus),
138
- });
139
- export type PaymentProviderResult = z.infer<typeof PaymentProviderResult>;
140
-
141
- export const PostSetupIntentBody = z.object({
142
- paymentMethodType: z.nativeEnum(SetupIntentPaymentMethodType),
143
- });
144
- export type PostSetupIntentBody = z.infer<typeof PostSetupIntentBody>;
145
-
146
- export const SetupIntentResponse = z.object({
147
- id: z.string(),
148
- object: z.literal('setup_intent'),
149
- application: z.string().nullable(),
150
- cancellation_reason: z.string().nullable(),
151
- client_secret: z.string(),
152
- created: z.number(),
153
- customer: z.string().nullable(),
154
- description: z.string().nullable(),
155
- flow_directions: z.string().nullable(),
156
- last_setup_error: z.string().nullable(),
157
- latest_attempt: z.string().nullable(),
158
- livemode: z.boolean(),
159
- mandate: z.string().nullable(),
160
- metadata: z.record(z.any()),
161
- next_action: z.string().nullable(),
162
- on_behalf_of: z.string().nullable(),
163
- payment_method: z.string().nullable(),
164
- payment_method_options: z.object({
165
- card: z.object({
166
- mandate_options: z.string().nullable(),
167
- network: z.string().nullable(),
168
- request_three_d_secure: z.string(),
169
- }),
170
- }),
171
- payment_method_types: z.array(z.string()),
172
- single_use_mandate: z.string().nullable(),
173
- status: z.string(),
174
- usage: z.string(),
175
- });
176
- export type SetupIntentResponse = z.infer<typeof SetupIntentResponse>;
177
-
178
- export const StripePaymentMethod = z.object({
179
- id: z.string(),
180
- object: z.string(),
181
- billing_details: z.object({
182
- address: z.object({
183
- city: z.string().nullable(),
184
- country: z.string().nullable(),
185
- line1: z.string().nullable(),
186
- line2: z.string().nullable(),
187
- postal_code: z.string().nullable(),
188
- state: z.string().nullable(),
189
- }),
190
- email: z.string(),
191
- name: z.string(),
192
- phone: z.string().nullable(),
193
- tax_id: z.string().nullable(),
194
- }),
195
- card: z
196
- .object({
197
- brand: z.string(),
198
- checks: z.object({
199
- address_line1_check: z.string().nullable(),
200
- address_postal_code_check: z.string().nullable(),
201
- cvc_check: z.string().nullable(),
202
- }),
203
- country: z.string(),
204
- exp_month: z.number().nullable(),
205
- exp_year: z.number().nullable(),
206
- fingerprint: z.string().nullable(),
207
- funding: z.string().nullable(),
208
- generated_from: z.string().nullable(),
209
- last4: z.string(),
210
- networks: z.object({
211
- available: z.array(z.string()),
212
- preferred: z.string().nullable(),
213
- }),
214
- three_d_secure_usage: z.object({ supported: z.boolean() }),
215
- wallet: z.string().nullable(),
216
- })
217
- .nullable(),
218
- us_bank_account: z.object({
219
- account_holder_type: z.string(),
220
- account_type: z.string(),
221
- bank_name: z.string(),
222
- financial_connections_account: z.string(),
223
- fingerprint: z.string(),
224
- last4: z.string(),
225
- networks: z.object({
226
- preferred: z.string().nullable(),
227
- supported: z.array(z.string()),
228
- }),
229
- routing_number: z.string(),
230
- status_details: z.object({
231
- reason: z.string().nullable(),
232
- }),
233
- }),
234
- created: z.number(),
235
- customer: z.string(),
236
- livemode: z.boolean(),
237
- metadata: z.object({}),
238
- redaction: z.string().nullable(),
239
- type: z.string(),
240
- });
241
- export type StripePaymentMethod = z.infer<typeof StripePaymentMethod>;
242
-
243
- export const StripeConnectedAccountZod = z.object({
244
- id: z.string(),
245
- name: z.string(),
246
- });
247
- export type StripeConnectedAccountZod = z.infer<
248
- typeof StripeConnectedAccountZod
249
- >;
250
-
251
- // Stripe Connect Account Management Types
252
- // https://docs.stripe.com/api/accounts/create
253
- export enum StripeBusinessType {
254
- INDIVIDUAL = 'individual',
255
- COMPANY = 'company',
256
- GOVERNMENT_ENTITY = 'government_entity',
257
- NON_PROFIT = 'non_profit',
258
- }
259
-
260
- export const CreateConnectedAccountDataZod = z.object({
261
- email: z.string().email(),
262
- businessType: z.nativeEnum(StripeBusinessType),
263
- country: z.string().length(2).optional().default('US'),
264
- companyName: z.string().optional(),
265
- individualFirstName: z.string().optional(),
266
- individualLastName: z.string().optional(),
267
- });
268
-
269
- export type CreateConnectedAccountData = z.infer<
270
- typeof CreateConnectedAccountDataZod
271
- >;
272
-
273
- export const ConnectedAccountResponseZod = z.object({
274
- id: z.string(),
275
- email: z.string().optional(),
276
- country: z.string(),
277
- business_type: z.string().optional(),
278
- charges_enabled: z.boolean(),
279
- payouts_enabled: z.boolean(),
280
- details_submitted: z.boolean(),
281
- requirements: z.object({
282
- currently_due: z.array(z.string()),
283
- eventually_due: z.array(z.string()),
284
- past_due: z.array(z.string()),
285
- disabled_reason: z.string().nullable(),
286
- }),
287
- });
288
-
289
- export type ConnectedAccountResponse = z.infer<
290
- typeof ConnectedAccountResponseZod
291
- >;
292
-
293
- export const AccountLinkResponseZod = z.object({
294
- url: z.string().url(),
295
- expires_at: z.number(),
296
- });
297
-
298
- export type AccountLinkResponse = z.infer<typeof AccountLinkResponseZod>;
@@ -1,76 +0,0 @@
1
- import { PhoneZodSchema } from './phone.type';
2
-
3
- describe('PhoneSchema Tests', () => {
4
- it('should pass if US phone is valid', () => {
5
- const phone = '+1-212-456-7890';
6
- const parseRes = PhoneZodSchema.safeParse(phone);
7
-
8
- const result = parseRes.success;
9
- expect(result).toBeTruthy();
10
- });
11
-
12
- it('should pass if EG phone is valid', () => {
13
- const phone = '+201088511706';
14
- const parseRes = PhoneZodSchema.safeParse(phone);
15
-
16
- const result = parseRes.success;
17
- expect(result).toBeTruthy();
18
- });
19
-
20
- it('should fail if EG phone is not valid', () => {
21
- const phone = '+2010885101706';
22
- const parseRes = PhoneZodSchema.safeParse(phone);
23
-
24
- const result = parseRes.success;
25
- expect(result).toBeFalsy();
26
- });
27
-
28
- it('should fail if phone is not valid', () => {
29
- const phone = '+201706';
30
- const parseRes = PhoneZodSchema.safeParse(phone);
31
-
32
- const result = parseRes.success;
33
- expect(result).toBeFalsy();
34
- });
35
-
36
- it('should not fail if phone is empty string', () => {
37
- const phone = '';
38
- const parseRes = PhoneZodSchema.safeParse(phone);
39
-
40
- const result = parseRes.success;
41
- expect(result).toBeTruthy();
42
- });
43
-
44
- it('should fail if phone is too long string', () => {
45
- const phone = '+125055501990001';
46
- const parseRes = PhoneZodSchema.safeParse(phone);
47
-
48
- const result = parseRes.success;
49
- expect(result).toBeFalsy();
50
- });
51
-
52
- it('should fail if phone contains letters', () => {
53
- const phone = '+12505d50199';
54
- const parseRes = PhoneZodSchema.safeParse(phone);
55
-
56
- const result = parseRes.success;
57
- expect(result).toBeFalsy();
58
- });
59
-
60
- it('should pass if US phone is valid', () => {
61
- const phone = '+12505550199';
62
- const parseRes = PhoneZodSchema.safeParse(phone);
63
-
64
- const result = parseRes.success;
65
- expect(result).toBeTruthy();
66
- });
67
-
68
- it('should pass if US phone is valid', () => {
69
- const phone = '+12124567890';
70
-
71
- const parseRes = PhoneZodSchema.safeParse(phone);
72
-
73
- const result = parseRes.success;
74
- expect(result).toBeTruthy();
75
- });
76
- });
@@ -1,27 +0,0 @@
1
- import { z } from 'zod';
2
- import { normalizePhoneNumber } from './contract-helpers';
3
- import { CountryCodes } from './countries.types';
4
- import { CountryCode } from 'libphonenumber-js';
5
- import { ok } from 'neverthrow';
6
-
7
- export const PhoneZodSchema = z
8
- .string()
9
- .nullable()
10
- .transform((phone) => {
11
- if (phone === null || phone === '') return ok(null); // Allow null values
12
- let result!: ReturnType<typeof normalizePhoneNumber>;
13
- for (const code of CountryCodes) {
14
- if (result && result.isOk()) break;
15
- result = normalizePhoneNumber(phone, code as CountryCode);
16
- }
17
-
18
- return result;
19
- })
20
- .refine((result) => result.isOk(), { message: 'phone is not valid' })
21
- .transform((result) => {
22
- if (result.isErr()) return ''; // the condition shall always evaluate to false!, it just calms TS :)
23
- const parsedPhoneNumber = result?.value;
24
- if (parsedPhoneNumber === null) return '';
25
- const phone = parsedPhoneNumber.number.toString();
26
- return phone;
27
- });
@@ -1,50 +0,0 @@
1
- import { z } from 'zod';
2
- import { AssetType, InvestorAccountType, TradeStatus } from './common.types';
3
-
4
- export const PortfolioResponse = z.object({
5
- totalAmount: z.string(),
6
- id: z.string(),
7
- type: z.nativeEnum(InvestorAccountType),
8
- name: z.string(),
9
- });
10
-
11
- export type PortfolioResponse = z.infer<typeof PortfolioResponse>;
12
- export const PortfolioResponseList = z.object({
13
- totalAmount: z.number().default(0),
14
- portfollios: z.array(PortfolioResponse),
15
- });
16
- export type PortfolioResponseList = z.infer<typeof PortfolioResponseList>;
17
-
18
- export const AccountPortfolio = z.object({
19
- totalAmount: z.string(),
20
- id: z.string(),
21
- name: z.string(),
22
- description: z.string().nullable(),
23
- type: z.nativeEnum(AssetType),
24
- accountTotalAmount: z.string(),
25
- percentage: z.string(),
26
- });
27
-
28
- export type AccountPortfolio = z.infer<typeof AccountPortfolio>;
29
-
30
- export const AccountPortfolioResponse = z.object({
31
- totalAmount: z.number().default(0),
32
- portfollios: z.array(AccountPortfolio),
33
- });
34
- export type AccountPortfolioResponse = z.infer<typeof AccountPortfolioResponse>;
35
-
36
- export const TradeStatusBreakdown = z.object({
37
- tradeStatus: z.nativeEnum(TradeStatus),
38
- count: z.number(),
39
- amount: z.number(),
40
- percentage: z.string(),
41
- });
42
- export type TradeStatusBreakdown = z.infer<typeof TradeStatusBreakdown>;
43
-
44
- export const TradeStatusBreakdownResponse = z.object({
45
- totalAmount: z.number(),
46
- tradeStatusBreakdown: z.array(TradeStatusBreakdown),
47
- });
48
- export type TradeStatusBreakdownResponse = z.infer<
49
- typeof TradeStatusBreakdownResponse
50
- >;