@dalmore/api-contracts 0.0.0-dev.b823e2b → 0.0.0-dev.c1dc422
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.
- package/common/types/activity.types.d.ts +24 -26
- package/common/types/activity.types.js +0 -4
- package/common/types/activity.types.js.map +1 -1
- package/common/types/asset.types.d.ts +111 -25
- package/common/types/asset.types.js +100 -24
- package/common/types/asset.types.js.map +1 -1
- package/common/types/bonus-tier.types.d.ts +30 -0
- package/common/types/cap-table.types.d.ts +0 -15
- package/common/types/cap-table.types.js +0 -17
- package/common/types/cap-table.types.js.map +1 -1
- package/common/types/common.types.d.ts +1 -11
- package/common/types/common.types.js +0 -6
- package/common/types/common.types.js.map +1 -1
- package/common/types/dashboard.types.d.ts +7 -7
- package/common/types/file.types.d.ts +9 -10
- package/common/types/index.d.ts +0 -1
- package/common/types/index.js +0 -1
- package/common/types/index.js.map +1 -1
- package/common/types/issuer-offering.types.d.ts +67 -1
- package/common/types/issuer-offering.types.js +45 -3
- package/common/types/issuer-offering.types.js.map +1 -1
- package/common/types/job-item.types.d.ts +14 -14
- package/common/types/note.types.d.ts +15 -15
- package/common/types/offering-submission.types.d.ts +0 -198
- package/common/types/offering-submission.types.js +3 -16
- package/common/types/offering-submission.types.js.map +1 -1
- package/common/types/offering.types.d.ts +40 -1
- package/common/types/offering.types.js +43 -1
- package/common/types/offering.types.js.map +1 -1
- package/common/types/site.types.d.ts +15 -0
- package/common/types/task.types.d.ts +22 -22
- package/common/types/user.types.d.ts +0 -29
- package/common/types/user.types.js +0 -3
- package/common/types/user.types.js.map +1 -1
- package/contracts/clients/assets/index.d.ts +66 -0
- package/contracts/clients/files/index.d.ts +3 -3
- package/contracts/clients/files-public/index.d.ts +3 -3
- package/contracts/clients/index.d.ts +102 -6
- package/contracts/clients/offerings/index.d.ts +30 -0
- package/package.json +1 -1
- package/common/types/reports.types.d.ts +0 -345
- package/common/types/reports.types.js +0 -69
- package/common/types/reports.types.js.map +0 -1
|
@@ -5,6 +5,10 @@ export declare enum AssetTemplateType {
|
|
|
5
5
|
STANDARD = "STANDARD",
|
|
6
6
|
TIERED = "TIERED"
|
|
7
7
|
}
|
|
8
|
+
export declare enum InterestType {
|
|
9
|
+
SIMPLE = "SIMPLE",
|
|
10
|
+
COMPOUND = "COMPOUND"
|
|
11
|
+
}
|
|
8
12
|
export declare const IAsset: z.ZodObject<{
|
|
9
13
|
__entity: z.ZodOptional<z.ZodString>;
|
|
10
14
|
createdAt: z.ZodUnion<[z.ZodString, z.ZodDate]>;
|
|
@@ -67,7 +71,10 @@ export declare const IAsset: z.ZodObject<{
|
|
|
67
71
|
template: z.ZodNativeEnum<typeof AssetTemplateType>;
|
|
68
72
|
tiers: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
|
|
69
73
|
enableBonus: z.ZodBoolean;
|
|
74
|
+
principalAmount: z.ZodNullable<z.ZodNumber>;
|
|
75
|
+
maxTotalRaise: z.ZodNullable<z.ZodNumber>;
|
|
70
76
|
interestRate: z.ZodNullable<z.ZodNumber>;
|
|
77
|
+
interestType: z.ZodNullable<z.ZodNativeEnum<typeof InterestType>>;
|
|
71
78
|
}, "strip", z.ZodTypeAny, {
|
|
72
79
|
type: AssetType | null;
|
|
73
80
|
id: string;
|
|
@@ -86,7 +93,10 @@ export declare const IAsset: z.ZodObject<{
|
|
|
86
93
|
durationType: DurationType | null;
|
|
87
94
|
tiers: number[] | null;
|
|
88
95
|
enableBonus: boolean;
|
|
96
|
+
principalAmount: number | null;
|
|
97
|
+
maxTotalRaise: number | null;
|
|
89
98
|
interestRate: number | null;
|
|
99
|
+
interestType: InterestType | null;
|
|
90
100
|
__entity?: string | undefined;
|
|
91
101
|
account?: {
|
|
92
102
|
status: import("./common.types").AccountStatus;
|
|
@@ -121,7 +131,10 @@ export declare const IAsset: z.ZodObject<{
|
|
|
121
131
|
durationType: DurationType | null;
|
|
122
132
|
tiers: number[] | null;
|
|
123
133
|
enableBonus: boolean;
|
|
134
|
+
principalAmount: number | null;
|
|
135
|
+
maxTotalRaise: number | null;
|
|
124
136
|
interestRate: number | null;
|
|
137
|
+
interestType: InterestType | null;
|
|
125
138
|
__entity?: string | undefined;
|
|
126
139
|
account?: {
|
|
127
140
|
status: import("./common.types").AccountStatus;
|
|
@@ -203,7 +216,10 @@ export declare const IPaginatedAsset: z.ZodObject<{
|
|
|
203
216
|
template: z.ZodNativeEnum<typeof AssetTemplateType>;
|
|
204
217
|
tiers: z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>;
|
|
205
218
|
enableBonus: z.ZodBoolean;
|
|
219
|
+
principalAmount: z.ZodNullable<z.ZodNumber>;
|
|
220
|
+
maxTotalRaise: z.ZodNullable<z.ZodNumber>;
|
|
206
221
|
interestRate: z.ZodNullable<z.ZodNumber>;
|
|
222
|
+
interestType: z.ZodNullable<z.ZodNativeEnum<typeof InterestType>>;
|
|
207
223
|
}, "strip", z.ZodTypeAny, {
|
|
208
224
|
type: AssetType | null;
|
|
209
225
|
id: string;
|
|
@@ -222,7 +238,10 @@ export declare const IPaginatedAsset: z.ZodObject<{
|
|
|
222
238
|
durationType: DurationType | null;
|
|
223
239
|
tiers: number[] | null;
|
|
224
240
|
enableBonus: boolean;
|
|
241
|
+
principalAmount: number | null;
|
|
242
|
+
maxTotalRaise: number | null;
|
|
225
243
|
interestRate: number | null;
|
|
244
|
+
interestType: InterestType | null;
|
|
226
245
|
__entity?: string | undefined;
|
|
227
246
|
account?: {
|
|
228
247
|
status: import("./common.types").AccountStatus;
|
|
@@ -257,7 +276,10 @@ export declare const IPaginatedAsset: z.ZodObject<{
|
|
|
257
276
|
durationType: DurationType | null;
|
|
258
277
|
tiers: number[] | null;
|
|
259
278
|
enableBonus: boolean;
|
|
279
|
+
principalAmount: number | null;
|
|
280
|
+
maxTotalRaise: number | null;
|
|
260
281
|
interestRate: number | null;
|
|
282
|
+
interestType: InterestType | null;
|
|
261
283
|
__entity?: string | undefined;
|
|
262
284
|
account?: {
|
|
263
285
|
status: import("./common.types").AccountStatus;
|
|
@@ -313,7 +335,10 @@ export declare const IPaginatedAsset: z.ZodObject<{
|
|
|
313
335
|
durationType: DurationType | null;
|
|
314
336
|
tiers: number[] | null;
|
|
315
337
|
enableBonus: boolean;
|
|
338
|
+
principalAmount: number | null;
|
|
339
|
+
maxTotalRaise: number | null;
|
|
316
340
|
interestRate: number | null;
|
|
341
|
+
interestType: InterestType | null;
|
|
317
342
|
__entity?: string | undefined;
|
|
318
343
|
account?: {
|
|
319
344
|
status: import("./common.types").AccountStatus;
|
|
@@ -357,7 +382,10 @@ export declare const IPaginatedAsset: z.ZodObject<{
|
|
|
357
382
|
durationType: DurationType | null;
|
|
358
383
|
tiers: number[] | null;
|
|
359
384
|
enableBonus: boolean;
|
|
385
|
+
principalAmount: number | null;
|
|
386
|
+
maxTotalRaise: number | null;
|
|
360
387
|
interestRate: number | null;
|
|
388
|
+
interestType: InterestType | null;
|
|
361
389
|
__entity?: string | undefined;
|
|
362
390
|
account?: {
|
|
363
391
|
status: import("./common.types").AccountStatus;
|
|
@@ -397,7 +425,10 @@ export declare const PostAsset: z.ZodEffects<z.ZodObject<{
|
|
|
397
425
|
template: z.ZodDefault<z.ZodNativeEnum<typeof AssetTemplateType>>;
|
|
398
426
|
tiers: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
|
|
399
427
|
enableBonus: z.ZodDefault<z.ZodBoolean>;
|
|
428
|
+
principalAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
429
|
+
maxTotalRaise: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
400
430
|
interestRate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
431
|
+
interestType: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof InterestType>>>;
|
|
401
432
|
}, "strip", z.ZodTypeAny, {
|
|
402
433
|
type: AssetType;
|
|
403
434
|
name: string;
|
|
@@ -410,7 +441,10 @@ export declare const PostAsset: z.ZodEffects<z.ZodObject<{
|
|
|
410
441
|
duration?: number | null | undefined;
|
|
411
442
|
durationType?: DurationType | null | undefined;
|
|
412
443
|
tiers?: number[] | null | undefined;
|
|
444
|
+
principalAmount?: number | null | undefined;
|
|
445
|
+
maxTotalRaise?: number | null | undefined;
|
|
413
446
|
interestRate?: number | null | undefined;
|
|
447
|
+
interestType?: InterestType | null | undefined;
|
|
414
448
|
}, {
|
|
415
449
|
type: AssetType;
|
|
416
450
|
name: string;
|
|
@@ -423,7 +457,10 @@ export declare const PostAsset: z.ZodEffects<z.ZodObject<{
|
|
|
423
457
|
durationType?: DurationType | null | undefined;
|
|
424
458
|
tiers?: number[] | null | undefined;
|
|
425
459
|
enableBonus?: boolean | undefined;
|
|
460
|
+
principalAmount?: number | null | undefined;
|
|
461
|
+
maxTotalRaise?: number | null | undefined;
|
|
426
462
|
interestRate?: number | null | undefined;
|
|
463
|
+
interestType?: InterestType | null | undefined;
|
|
427
464
|
}>, {
|
|
428
465
|
type: AssetType;
|
|
429
466
|
name: string;
|
|
@@ -436,7 +473,10 @@ export declare const PostAsset: z.ZodEffects<z.ZodObject<{
|
|
|
436
473
|
duration?: number | null | undefined;
|
|
437
474
|
durationType?: DurationType | null | undefined;
|
|
438
475
|
tiers?: number[] | null | undefined;
|
|
476
|
+
principalAmount?: number | null | undefined;
|
|
477
|
+
maxTotalRaise?: number | null | undefined;
|
|
439
478
|
interestRate?: number | null | undefined;
|
|
479
|
+
interestType?: InterestType | null | undefined;
|
|
440
480
|
}, {
|
|
441
481
|
type: AssetType;
|
|
442
482
|
name: string;
|
|
@@ -449,7 +489,10 @@ export declare const PostAsset: z.ZodEffects<z.ZodObject<{
|
|
|
449
489
|
durationType?: DurationType | null | undefined;
|
|
450
490
|
tiers?: number[] | null | undefined;
|
|
451
491
|
enableBonus?: boolean | undefined;
|
|
492
|
+
principalAmount?: number | null | undefined;
|
|
493
|
+
maxTotalRaise?: number | null | undefined;
|
|
452
494
|
interestRate?: number | null | undefined;
|
|
495
|
+
interestType?: InterestType | null | undefined;
|
|
453
496
|
}>;
|
|
454
497
|
export type PostAsset = z.infer<typeof PostAsset>;
|
|
455
498
|
export declare const CompliancePostAsset: z.ZodEffects<z.ZodObject<{
|
|
@@ -464,7 +507,10 @@ export declare const CompliancePostAsset: z.ZodEffects<z.ZodObject<{
|
|
|
464
507
|
template: z.ZodDefault<z.ZodNativeEnum<typeof AssetTemplateType>>;
|
|
465
508
|
tiers: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
|
|
466
509
|
enableBonus: z.ZodDefault<z.ZodBoolean>;
|
|
510
|
+
principalAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
511
|
+
maxTotalRaise: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
467
512
|
interestRate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
513
|
+
interestType: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof InterestType>>>;
|
|
468
514
|
} & {
|
|
469
515
|
accountId: z.ZodLazy<z.ZodEffects<z.ZodString, string, string>>;
|
|
470
516
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -480,7 +526,10 @@ export declare const CompliancePostAsset: z.ZodEffects<z.ZodObject<{
|
|
|
480
526
|
duration?: number | null | undefined;
|
|
481
527
|
durationType?: DurationType | null | undefined;
|
|
482
528
|
tiers?: number[] | null | undefined;
|
|
529
|
+
principalAmount?: number | null | undefined;
|
|
530
|
+
maxTotalRaise?: number | null | undefined;
|
|
483
531
|
interestRate?: number | null | undefined;
|
|
532
|
+
interestType?: InterestType | null | undefined;
|
|
484
533
|
}, {
|
|
485
534
|
type: AssetType;
|
|
486
535
|
accountId: string;
|
|
@@ -494,7 +543,10 @@ export declare const CompliancePostAsset: z.ZodEffects<z.ZodObject<{
|
|
|
494
543
|
durationType?: DurationType | null | undefined;
|
|
495
544
|
tiers?: number[] | null | undefined;
|
|
496
545
|
enableBonus?: boolean | undefined;
|
|
546
|
+
principalAmount?: number | null | undefined;
|
|
547
|
+
maxTotalRaise?: number | null | undefined;
|
|
497
548
|
interestRate?: number | null | undefined;
|
|
549
|
+
interestType?: InterestType | null | undefined;
|
|
498
550
|
}>, {
|
|
499
551
|
type: AssetType;
|
|
500
552
|
accountId: string;
|
|
@@ -508,7 +560,10 @@ export declare const CompliancePostAsset: z.ZodEffects<z.ZodObject<{
|
|
|
508
560
|
duration?: number | null | undefined;
|
|
509
561
|
durationType?: DurationType | null | undefined;
|
|
510
562
|
tiers?: number[] | null | undefined;
|
|
563
|
+
principalAmount?: number | null | undefined;
|
|
564
|
+
maxTotalRaise?: number | null | undefined;
|
|
511
565
|
interestRate?: number | null | undefined;
|
|
566
|
+
interestType?: InterestType | null | undefined;
|
|
512
567
|
}, {
|
|
513
568
|
type: AssetType;
|
|
514
569
|
accountId: string;
|
|
@@ -522,7 +577,10 @@ export declare const CompliancePostAsset: z.ZodEffects<z.ZodObject<{
|
|
|
522
577
|
durationType?: DurationType | null | undefined;
|
|
523
578
|
tiers?: number[] | null | undefined;
|
|
524
579
|
enableBonus?: boolean | undefined;
|
|
580
|
+
principalAmount?: number | null | undefined;
|
|
581
|
+
maxTotalRaise?: number | null | undefined;
|
|
525
582
|
interestRate?: number | null | undefined;
|
|
583
|
+
interestType?: InterestType | null | undefined;
|
|
526
584
|
}>;
|
|
527
585
|
export type CompliancePostAsset = z.infer<typeof CompliancePostAsset>;
|
|
528
586
|
export declare const PutAsset: z.ZodObject<{
|
|
@@ -536,7 +594,10 @@ export declare const PutAsset: z.ZodObject<{
|
|
|
536
594
|
template: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodNativeEnum<typeof AssetTemplateType>>>>;
|
|
537
595
|
tiers: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
|
|
538
596
|
enableBonus: z.ZodOptional<z.ZodBoolean>;
|
|
597
|
+
principalAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
598
|
+
maxTotalRaise: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
539
599
|
interestRate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
600
|
+
interestType: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof InterestType>>>;
|
|
540
601
|
}, "strip", z.ZodTypeAny, {
|
|
541
602
|
type?: AssetType | undefined;
|
|
542
603
|
name?: string | undefined;
|
|
@@ -548,7 +609,10 @@ export declare const PutAsset: z.ZodObject<{
|
|
|
548
609
|
durationType?: DurationType | null | undefined;
|
|
549
610
|
tiers?: number[] | null | undefined;
|
|
550
611
|
enableBonus?: boolean | undefined;
|
|
612
|
+
principalAmount?: number | null | undefined;
|
|
613
|
+
maxTotalRaise?: number | null | undefined;
|
|
551
614
|
interestRate?: number | null | undefined;
|
|
615
|
+
interestType?: InterestType | null | undefined;
|
|
552
616
|
}, {
|
|
553
617
|
type?: AssetType | undefined;
|
|
554
618
|
name?: string | undefined;
|
|
@@ -560,7 +624,10 @@ export declare const PutAsset: z.ZodObject<{
|
|
|
560
624
|
durationType?: DurationType | null | undefined;
|
|
561
625
|
tiers?: number[] | null | undefined;
|
|
562
626
|
enableBonus?: boolean | undefined;
|
|
627
|
+
principalAmount?: number | null | undefined;
|
|
628
|
+
maxTotalRaise?: number | null | undefined;
|
|
563
629
|
interestRate?: number | null | undefined;
|
|
630
|
+
interestType?: InterestType | null | undefined;
|
|
564
631
|
}>;
|
|
565
632
|
export type PutAsset = z.infer<typeof PutAsset>;
|
|
566
633
|
export declare const CompliancePutAsset: z.ZodObject<{
|
|
@@ -574,7 +641,10 @@ export declare const CompliancePutAsset: z.ZodObject<{
|
|
|
574
641
|
template: z.ZodOptional<z.ZodNullable<z.ZodDefault<z.ZodNativeEnum<typeof AssetTemplateType>>>>;
|
|
575
642
|
tiers: z.ZodOptional<z.ZodNullable<z.ZodArray<z.ZodNumber, "many">>>;
|
|
576
643
|
enableBonus: z.ZodOptional<z.ZodBoolean>;
|
|
644
|
+
principalAmount: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
645
|
+
maxTotalRaise: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
577
646
|
interestRate: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
647
|
+
interestType: z.ZodOptional<z.ZodNullable<z.ZodNativeEnum<typeof InterestType>>>;
|
|
578
648
|
} & {
|
|
579
649
|
accountId: z.ZodEffects<z.ZodString, string, string>;
|
|
580
650
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -589,7 +659,10 @@ export declare const CompliancePutAsset: z.ZodObject<{
|
|
|
589
659
|
durationType?: DurationType | null | undefined;
|
|
590
660
|
tiers?: number[] | null | undefined;
|
|
591
661
|
enableBonus?: boolean | undefined;
|
|
662
|
+
principalAmount?: number | null | undefined;
|
|
663
|
+
maxTotalRaise?: number | null | undefined;
|
|
592
664
|
interestRate?: number | null | undefined;
|
|
665
|
+
interestType?: InterestType | null | undefined;
|
|
593
666
|
}, {
|
|
594
667
|
accountId: string;
|
|
595
668
|
type?: AssetType | undefined;
|
|
@@ -602,7 +675,10 @@ export declare const CompliancePutAsset: z.ZodObject<{
|
|
|
602
675
|
durationType?: DurationType | null | undefined;
|
|
603
676
|
tiers?: number[] | null | undefined;
|
|
604
677
|
enableBonus?: boolean | undefined;
|
|
678
|
+
principalAmount?: number | null | undefined;
|
|
679
|
+
maxTotalRaise?: number | null | undefined;
|
|
605
680
|
interestRate?: number | null | undefined;
|
|
681
|
+
interestType?: InterestType | null | undefined;
|
|
606
682
|
}>;
|
|
607
683
|
export type CompliancePutAsset = z.infer<typeof CompliancePutAsset>;
|
|
608
684
|
export declare const AssetsIncludeQuery: z.ZodObject<{
|
|
@@ -685,9 +761,10 @@ export declare const PromissoryNoteAssetSchema: z.ZodObject<{
|
|
|
685
761
|
totalUnits: z.ZodNullable<z.ZodNumber>;
|
|
686
762
|
} & {
|
|
687
763
|
type: z.ZodLiteral<AssetType.PROMISSORY_NOTE>;
|
|
764
|
+
principalAmount: z.ZodNullable<z.ZodNumber>;
|
|
765
|
+
maxTotalRaise: z.ZodNullable<z.ZodNumber>;
|
|
688
766
|
interestRate: z.ZodNullable<z.ZodNumber>;
|
|
689
|
-
|
|
690
|
-
durationType: z.ZodNullable<z.ZodNativeEnum<typeof DurationType>>;
|
|
767
|
+
interestType: z.ZodNullable<z.ZodNativeEnum<typeof InterestType>>;
|
|
691
768
|
}, "strip", z.ZodTypeAny, {
|
|
692
769
|
type: AssetType.PROMISSORY_NOTE;
|
|
693
770
|
id: string;
|
|
@@ -697,9 +774,10 @@ export declare const PromissoryNoteAssetSchema: z.ZodObject<{
|
|
|
697
774
|
issuerId: string | null;
|
|
698
775
|
pricePerUnit: number | null;
|
|
699
776
|
totalUnits: number | null;
|
|
700
|
-
|
|
701
|
-
|
|
777
|
+
principalAmount: number | null;
|
|
778
|
+
maxTotalRaise: number | null;
|
|
702
779
|
interestRate: number | null;
|
|
780
|
+
interestType: InterestType | null;
|
|
703
781
|
}, {
|
|
704
782
|
type: AssetType.PROMISSORY_NOTE;
|
|
705
783
|
id: string;
|
|
@@ -709,9 +787,10 @@ export declare const PromissoryNoteAssetSchema: z.ZodObject<{
|
|
|
709
787
|
issuerId: string | null;
|
|
710
788
|
pricePerUnit: number | null;
|
|
711
789
|
totalUnits: number | null;
|
|
712
|
-
|
|
713
|
-
|
|
790
|
+
principalAmount: number | null;
|
|
791
|
+
maxTotalRaise: number | null;
|
|
714
792
|
interestRate: number | null;
|
|
793
|
+
interestType: InterestType | null;
|
|
715
794
|
}>;
|
|
716
795
|
export type PromissoryNoteAssetSchema = z.infer<typeof PromissoryNoteAssetSchema>;
|
|
717
796
|
declare const BondAssetSchema: z.ZodObject<{
|
|
@@ -828,9 +907,10 @@ export declare const AssetSummarySchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
828
907
|
totalUnits: z.ZodNullable<z.ZodNumber>;
|
|
829
908
|
} & {
|
|
830
909
|
type: z.ZodLiteral<AssetType.PROMISSORY_NOTE>;
|
|
910
|
+
principalAmount: z.ZodNullable<z.ZodNumber>;
|
|
911
|
+
maxTotalRaise: z.ZodNullable<z.ZodNumber>;
|
|
831
912
|
interestRate: z.ZodNullable<z.ZodNumber>;
|
|
832
|
-
|
|
833
|
-
durationType: z.ZodNullable<z.ZodNativeEnum<typeof DurationType>>;
|
|
913
|
+
interestType: z.ZodNullable<z.ZodNativeEnum<typeof InterestType>>;
|
|
834
914
|
}, "strip", z.ZodTypeAny, {
|
|
835
915
|
type: AssetType.PROMISSORY_NOTE;
|
|
836
916
|
id: string;
|
|
@@ -840,9 +920,10 @@ export declare const AssetSummarySchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
840
920
|
issuerId: string | null;
|
|
841
921
|
pricePerUnit: number | null;
|
|
842
922
|
totalUnits: number | null;
|
|
843
|
-
|
|
844
|
-
|
|
923
|
+
principalAmount: number | null;
|
|
924
|
+
maxTotalRaise: number | null;
|
|
845
925
|
interestRate: number | null;
|
|
926
|
+
interestType: InterestType | null;
|
|
846
927
|
}, {
|
|
847
928
|
type: AssetType.PROMISSORY_NOTE;
|
|
848
929
|
id: string;
|
|
@@ -852,9 +933,10 @@ export declare const AssetSummarySchema: z.ZodDiscriminatedUnion<"type", [z.ZodO
|
|
|
852
933
|
issuerId: string | null;
|
|
853
934
|
pricePerUnit: number | null;
|
|
854
935
|
totalUnits: number | null;
|
|
855
|
-
|
|
856
|
-
|
|
936
|
+
principalAmount: number | null;
|
|
937
|
+
maxTotalRaise: number | null;
|
|
857
938
|
interestRate: number | null;
|
|
939
|
+
interestType: InterestType | null;
|
|
858
940
|
}>]>;
|
|
859
941
|
export type AssetSummarySchema = z.infer<typeof AssetSummarySchema>;
|
|
860
942
|
export declare const IPaginatedAssetSummary: z.ZodObject<{
|
|
@@ -933,9 +1015,10 @@ export declare const IPaginatedAssetSummary: z.ZodObject<{
|
|
|
933
1015
|
totalUnits: z.ZodNullable<z.ZodNumber>;
|
|
934
1016
|
} & {
|
|
935
1017
|
type: z.ZodLiteral<AssetType.PROMISSORY_NOTE>;
|
|
1018
|
+
principalAmount: z.ZodNullable<z.ZodNumber>;
|
|
1019
|
+
maxTotalRaise: z.ZodNullable<z.ZodNumber>;
|
|
936
1020
|
interestRate: z.ZodNullable<z.ZodNumber>;
|
|
937
|
-
|
|
938
|
-
durationType: z.ZodNullable<z.ZodNativeEnum<typeof DurationType>>;
|
|
1021
|
+
interestType: z.ZodNullable<z.ZodNativeEnum<typeof InterestType>>;
|
|
939
1022
|
}, "strip", z.ZodTypeAny, {
|
|
940
1023
|
type: AssetType.PROMISSORY_NOTE;
|
|
941
1024
|
id: string;
|
|
@@ -945,9 +1028,10 @@ export declare const IPaginatedAssetSummary: z.ZodObject<{
|
|
|
945
1028
|
issuerId: string | null;
|
|
946
1029
|
pricePerUnit: number | null;
|
|
947
1030
|
totalUnits: number | null;
|
|
948
|
-
|
|
949
|
-
|
|
1031
|
+
principalAmount: number | null;
|
|
1032
|
+
maxTotalRaise: number | null;
|
|
950
1033
|
interestRate: number | null;
|
|
1034
|
+
interestType: InterestType | null;
|
|
951
1035
|
}, {
|
|
952
1036
|
type: AssetType.PROMISSORY_NOTE;
|
|
953
1037
|
id: string;
|
|
@@ -957,9 +1041,10 @@ export declare const IPaginatedAssetSummary: z.ZodObject<{
|
|
|
957
1041
|
issuerId: string | null;
|
|
958
1042
|
pricePerUnit: number | null;
|
|
959
1043
|
totalUnits: number | null;
|
|
960
|
-
|
|
961
|
-
|
|
1044
|
+
principalAmount: number | null;
|
|
1045
|
+
maxTotalRaise: number | null;
|
|
962
1046
|
interestRate: number | null;
|
|
1047
|
+
interestType: InterestType | null;
|
|
963
1048
|
}>]>, "many">;
|
|
964
1049
|
meta: z.ZodObject<{
|
|
965
1050
|
itemCount: z.ZodNumber;
|
|
@@ -999,9 +1084,10 @@ export declare const IPaginatedAssetSummary: z.ZodObject<{
|
|
|
999
1084
|
issuerId: string | null;
|
|
1000
1085
|
pricePerUnit: number | null;
|
|
1001
1086
|
totalUnits: number | null;
|
|
1002
|
-
|
|
1003
|
-
|
|
1087
|
+
principalAmount: number | null;
|
|
1088
|
+
maxTotalRaise: number | null;
|
|
1004
1089
|
interestRate: number | null;
|
|
1090
|
+
interestType: InterestType | null;
|
|
1005
1091
|
} | {
|
|
1006
1092
|
type: AssetType.BOND | null;
|
|
1007
1093
|
id: string;
|
|
@@ -1041,9 +1127,10 @@ export declare const IPaginatedAssetSummary: z.ZodObject<{
|
|
|
1041
1127
|
issuerId: string | null;
|
|
1042
1128
|
pricePerUnit: number | null;
|
|
1043
1129
|
totalUnits: number | null;
|
|
1044
|
-
|
|
1045
|
-
|
|
1130
|
+
principalAmount: number | null;
|
|
1131
|
+
maxTotalRaise: number | null;
|
|
1046
1132
|
interestRate: number | null;
|
|
1133
|
+
interestType: InterestType | null;
|
|
1047
1134
|
} | {
|
|
1048
1135
|
type: AssetType.BOND | null;
|
|
1049
1136
|
id: string;
|
|
@@ -1088,13 +1175,12 @@ export declare const AssetSummaryFiltersZod: z.ZodObject<{
|
|
|
1088
1175
|
export type AssetSummaryFiltersZod = z.infer<typeof AssetSummaryFiltersZod>;
|
|
1089
1176
|
/**
|
|
1090
1177
|
* Maps asset types to fields that should be reset (nullified) when converting
|
|
1091
|
-
* from one asset type to another.
|
|
1092
|
-
*
|
|
1178
|
+
* from one asset type to another. This ensures incompatible fields from the
|
|
1179
|
+
* previous type are cleared when the asset type changes.
|
|
1093
1180
|
*/
|
|
1094
1181
|
export declare const ASSET_TYPE_FIELD_RESETS: Record<AssetType, Partial<IAsset>>;
|
|
1095
1182
|
/**
|
|
1096
1183
|
* Maps asset types to their required fields when converting TO that asset type.
|
|
1097
|
-
* Derived from disjoint field sets for single source of truth.
|
|
1098
1184
|
*/
|
|
1099
1185
|
export declare const ASSET_TYPE_REQUIRED_FIELDS: Record<AssetType, Array<keyof IAsset>>;
|
|
1100
1186
|
export {};
|
|
@@ -23,6 +23,11 @@ export var AssetTemplateType;
|
|
|
23
23
|
AssetTemplateType["STANDARD"] = "STANDARD";
|
|
24
24
|
AssetTemplateType["TIERED"] = "TIERED";
|
|
25
25
|
})(AssetTemplateType || (AssetTemplateType = {}));
|
|
26
|
+
export var InterestType;
|
|
27
|
+
(function (InterestType) {
|
|
28
|
+
InterestType["SIMPLE"] = "SIMPLE";
|
|
29
|
+
InterestType["COMPOUND"] = "COMPOUND";
|
|
30
|
+
})(InterestType || (InterestType = {}));
|
|
26
31
|
export const IAsset = IBaseEntity.extend({
|
|
27
32
|
id: z.lazy(() => assetIdSchema),
|
|
28
33
|
name: z.string(),
|
|
@@ -43,7 +48,10 @@ export const IAsset = IBaseEntity.extend({
|
|
|
43
48
|
template: z.nativeEnum(AssetTemplateType),
|
|
44
49
|
tiers: z.array(z.number().positive()).nullable(),
|
|
45
50
|
enableBonus: z.boolean(),
|
|
51
|
+
principalAmount: z.number().nullable(),
|
|
52
|
+
maxTotalRaise: z.number().nullable(),
|
|
46
53
|
interestRate: z.number().nullable(),
|
|
54
|
+
interestType: z.nativeEnum(InterestType).nullable(),
|
|
47
55
|
});
|
|
48
56
|
export const IPaginatedAsset = z.object({
|
|
49
57
|
items: z.array(IAsset),
|
|
@@ -92,6 +100,22 @@ const PostAssetBase = z.object({
|
|
|
92
100
|
.openapi({ example: AssetTemplateType.STANDARD }),
|
|
93
101
|
tiers: z.array(z.number().positive()).nullable().optional(),
|
|
94
102
|
enableBonus: z.boolean().default(false).openapi({ example: false }),
|
|
103
|
+
principalAmount: z
|
|
104
|
+
.number()
|
|
105
|
+
.int()
|
|
106
|
+
.positive()
|
|
107
|
+
.max(10000000000)
|
|
108
|
+
.nullable()
|
|
109
|
+
.optional()
|
|
110
|
+
.openapi({ example: 1000 }),
|
|
111
|
+
maxTotalRaise: z
|
|
112
|
+
.number()
|
|
113
|
+
.int()
|
|
114
|
+
.positive()
|
|
115
|
+
.max(10000000000)
|
|
116
|
+
.nullable()
|
|
117
|
+
.optional()
|
|
118
|
+
.openapi({ example: 100 }),
|
|
95
119
|
interestRate: z
|
|
96
120
|
.number()
|
|
97
121
|
.min(0.01)
|
|
@@ -99,19 +123,22 @@ const PostAssetBase = z.object({
|
|
|
99
123
|
.nullable()
|
|
100
124
|
.optional()
|
|
101
125
|
.openapi({ example: 10 }),
|
|
126
|
+
interestType: z
|
|
127
|
+
.nativeEnum(InterestType)
|
|
128
|
+
.nullable()
|
|
129
|
+
.optional()
|
|
130
|
+
.openapi({ example: InterestType.SIMPLE }),
|
|
102
131
|
});
|
|
103
|
-
const
|
|
132
|
+
const BOND_FIELDS = [
|
|
133
|
+
'yield',
|
|
104
134
|
'duration',
|
|
105
135
|
'durationType',
|
|
106
136
|
];
|
|
107
|
-
const
|
|
108
|
-
|
|
137
|
+
const PROMISSORY_NOTE_FIELDS = [
|
|
138
|
+
'principalAmount',
|
|
139
|
+
'maxTotalRaise',
|
|
109
140
|
'interestRate',
|
|
110
|
-
|
|
111
|
-
const ALL_DEBT_FIELDS = [
|
|
112
|
-
...DEBT_COMMON_FIELDS,
|
|
113
|
-
...BOND_ONLY_FIELDS,
|
|
114
|
-
...PROMISSORY_NOTE_ONLY_FIELDS,
|
|
141
|
+
'interestType',
|
|
115
142
|
];
|
|
116
143
|
// Field labels for better error messages
|
|
117
144
|
const FIELD_LABELS = {
|
|
@@ -131,7 +158,10 @@ const FIELD_LABELS = {
|
|
|
131
158
|
template: 'Template',
|
|
132
159
|
tiers: 'Tiers',
|
|
133
160
|
enableBonus: 'Enable bonus',
|
|
161
|
+
principalAmount: 'Principal amount',
|
|
162
|
+
maxTotalRaise: 'Max total raise',
|
|
134
163
|
interestRate: 'Interest rate',
|
|
164
|
+
interestType: 'Interest type',
|
|
135
165
|
createdAt: 'Created at',
|
|
136
166
|
updatedAt: 'Updated at',
|
|
137
167
|
deletedAt: 'Deleted at',
|
|
@@ -168,17 +198,23 @@ export const postAssetRefinement = (data, ctx) => {
|
|
|
168
198
|
const assetType = data.assetType || data.type;
|
|
169
199
|
// BOND validation
|
|
170
200
|
if (assetType === AssetType.BOND) {
|
|
171
|
-
|
|
172
|
-
|
|
201
|
+
// Require bond-specific fields
|
|
202
|
+
requireFields(BOND_FIELDS, data, ctx, AssetType.BOND);
|
|
203
|
+
// Prohibit promissory note fields
|
|
204
|
+
prohibitFields(PROMISSORY_NOTE_FIELDS, data, ctx, AssetType.BOND);
|
|
173
205
|
}
|
|
174
206
|
// PROMISSORY_NOTE validation
|
|
175
207
|
if (assetType === AssetType.PROMISSORY_NOTE) {
|
|
176
|
-
|
|
177
|
-
|
|
208
|
+
// Require promissory note-specific fields
|
|
209
|
+
requireFields(PROMISSORY_NOTE_FIELDS, data, ctx, AssetType.PROMISSORY_NOTE);
|
|
210
|
+
// Prohibit bond fields
|
|
211
|
+
prohibitFields(BOND_FIELDS, data, ctx, AssetType.PROMISSORY_NOTE);
|
|
178
212
|
}
|
|
179
213
|
// STOCK validation
|
|
180
214
|
if (assetType === AssetType.STOCK) {
|
|
181
|
-
|
|
215
|
+
// Prohibit both bond and promissory note fields
|
|
216
|
+
prohibitFields(BOND_FIELDS, data, ctx, AssetType.STOCK);
|
|
217
|
+
prohibitFields(PROMISSORY_NOTE_FIELDS, data, ctx, AssetType.STOCK);
|
|
182
218
|
}
|
|
183
219
|
// Template validation (applies to all asset types)
|
|
184
220
|
if (data.template === AssetTemplateType.TIERED) {
|
|
@@ -249,6 +285,22 @@ export const PutAsset = z.object({
|
|
|
249
285
|
.optional(),
|
|
250
286
|
tiers: z.array(z.number().positive()).nullable().optional(),
|
|
251
287
|
enableBonus: z.boolean().optional().openapi({ example: false }),
|
|
288
|
+
principalAmount: z
|
|
289
|
+
.number()
|
|
290
|
+
.int()
|
|
291
|
+
.positive()
|
|
292
|
+
.max(10000000000)
|
|
293
|
+
.nullable()
|
|
294
|
+
.optional()
|
|
295
|
+
.openapi({ example: 1000 }),
|
|
296
|
+
maxTotalRaise: z
|
|
297
|
+
.number()
|
|
298
|
+
.int()
|
|
299
|
+
.positive()
|
|
300
|
+
.max(10000000000)
|
|
301
|
+
.nullable()
|
|
302
|
+
.optional()
|
|
303
|
+
.openapi({ example: 100 }),
|
|
252
304
|
interestRate: z
|
|
253
305
|
.number()
|
|
254
306
|
.min(0.01)
|
|
@@ -256,6 +308,11 @@ export const PutAsset = z.object({
|
|
|
256
308
|
.nullable()
|
|
257
309
|
.optional()
|
|
258
310
|
.openapi({ example: 10 }),
|
|
311
|
+
interestType: z
|
|
312
|
+
.nativeEnum(InterestType)
|
|
313
|
+
.nullable()
|
|
314
|
+
.optional()
|
|
315
|
+
.openapi({ example: InterestType.SIMPLE }),
|
|
259
316
|
});
|
|
260
317
|
export const CompliancePutAsset = PutAsset.merge(z.object({ accountId: accountIdSchema }));
|
|
261
318
|
const assetsInclude = z.enum(['account', 'offering', 'bonusTiers']);
|
|
@@ -299,9 +356,10 @@ export const StockAssetSchema = BaseAssetSummarySchema.extend({
|
|
|
299
356
|
});
|
|
300
357
|
export const PromissoryNoteAssetSchema = BaseAssetSummarySchema.extend({
|
|
301
358
|
type: z.literal(AssetType.PROMISSORY_NOTE),
|
|
359
|
+
principalAmount: z.number().nullable(),
|
|
360
|
+
maxTotalRaise: z.number().nullable(),
|
|
302
361
|
interestRate: z.number().nullable(),
|
|
303
|
-
|
|
304
|
-
durationType: z.nativeEnum(DurationType).nullable(),
|
|
362
|
+
interestType: z.nativeEnum(InterestType).nullable(),
|
|
305
363
|
});
|
|
306
364
|
const BondAssetSchema = BaseAssetSummarySchema.extend({
|
|
307
365
|
type: z.literal(AssetType.BOND).nullable(),
|
|
@@ -330,23 +388,41 @@ export const AssetSummaryFiltersZod = z.object({
|
|
|
330
388
|
});
|
|
331
389
|
/**
|
|
332
390
|
* Maps asset types to fields that should be reset (nullified) when converting
|
|
333
|
-
* from one asset type to another.
|
|
334
|
-
*
|
|
391
|
+
* from one asset type to another. This ensures incompatible fields from the
|
|
392
|
+
* previous type are cleared when the asset type changes.
|
|
335
393
|
*/
|
|
336
394
|
export const ASSET_TYPE_FIELD_RESETS = {
|
|
337
|
-
[AssetType.STOCK]:
|
|
338
|
-
|
|
339
|
-
|
|
395
|
+
[AssetType.STOCK]: {
|
|
396
|
+
yield: null,
|
|
397
|
+
durationType: null,
|
|
398
|
+
duration: null,
|
|
399
|
+
principalAmount: null,
|
|
400
|
+
maxTotalRaise: null,
|
|
401
|
+
interestRate: null,
|
|
402
|
+
interestType: null,
|
|
403
|
+
},
|
|
404
|
+
[AssetType.PROMISSORY_NOTE]: {
|
|
405
|
+
yield: null,
|
|
406
|
+
durationType: null,
|
|
407
|
+
duration: null,
|
|
408
|
+
},
|
|
409
|
+
[AssetType.BOND]: {
|
|
410
|
+
principalAmount: null,
|
|
411
|
+
maxTotalRaise: null,
|
|
412
|
+
interestRate: null,
|
|
413
|
+
interestType: null,
|
|
414
|
+
},
|
|
340
415
|
};
|
|
341
416
|
/**
|
|
342
417
|
* Maps asset types to their required fields when converting TO that asset type.
|
|
343
|
-
* Derived from disjoint field sets for single source of truth.
|
|
344
418
|
*/
|
|
345
419
|
export const ASSET_TYPE_REQUIRED_FIELDS = {
|
|
346
|
-
[AssetType.BOND]: [
|
|
420
|
+
[AssetType.BOND]: ['yield', 'duration', 'durationType'],
|
|
347
421
|
[AssetType.PROMISSORY_NOTE]: [
|
|
348
|
-
|
|
349
|
-
|
|
422
|
+
'principalAmount',
|
|
423
|
+
'maxTotalRaise',
|
|
424
|
+
'interestRate',
|
|
425
|
+
'interestType',
|
|
350
426
|
],
|
|
351
427
|
[AssetType.STOCK]: [],
|
|
352
428
|
};
|