@settlemint/dalp-sdk 2.1.7-main.23442422201 → 2.1.7-main.23445298463

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 (2) hide show
  1. package/dist/index.js +84 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -9906,6 +9906,10 @@ var FeatureConfigsInputSchema = z190.object({
9906
9906
  // ../../packages/dalp/api-contract/src/routes/token/routes/mutations/create/helpers/create-handlers/dalp-asset.create.schema.ts
9907
9907
  var DALPAssetTokenSchema = TokenBaseSchema.extend({
9908
9908
  type: z191.literal(AssetFactoryTypeIdEnum.dalpAsset),
9909
+ templateId: z191.string().min(1, "Template ID cannot be empty").meta({
9910
+ description: "ID of the instrument template used to create this token",
9911
+ examples: ["template-bond-standard"]
9912
+ }),
9909
9913
  priceCurrency: fiatCurrency().optional().meta({
9910
9914
  description: "The fiat currency code for valuation (e.g., USD, EUR)",
9911
9915
  examples: ["USD", "EUR", "GBP"]
@@ -9914,9 +9918,41 @@ var DALPAssetTokenSchema = TokenBaseSchema.extend({
9914
9918
  description: "The fiat value per token in the price currency",
9915
9919
  examples: ["1.00", "100.00"]
9916
9920
  }),
9917
- templateId: z191.string().min(1, "Template ID cannot be empty").meta({
9918
- description: "ID of the instrument template used to create this token",
9919
- examples: ["template-bond-standard"]
9921
+ cap: assetAmount.optional().meta({
9922
+ description: "Maximum supply cap (bonds, stablecoins, deposits)",
9923
+ examples: ["1000000000000000000000000"]
9924
+ }),
9925
+ faceValue: assetAmount.optional().meta({
9926
+ description: "Face value per bond in denomination asset units",
9927
+ examples: ["1000000000000000000"]
9928
+ }),
9929
+ maturityDate: blocktime({ future: true }).optional().meta({
9930
+ description: "Bond maturity date as unix timestamp",
9931
+ examples: [1735689600]
9932
+ }),
9933
+ denominationAsset: ethereumAddress.optional().meta({
9934
+ description: "ERC-20 token used as denomination asset for bonds",
9935
+ examples: ["0x71C7656EC7ab88b098defB751B7401B5f6d8976F"]
9936
+ }),
9937
+ uniqueIdentifier: z191.string().optional().meta({
9938
+ description: "ISIN or other security identifier",
9939
+ examples: ["US0378331005"]
9940
+ }),
9941
+ managementFeeBps: basisPoints().optional().meta({
9942
+ description: "Annual management fee in basis points",
9943
+ examples: [100, 250]
9944
+ }),
9945
+ maximumFractions: assetAmount.optional().meta({
9946
+ description: "Maximum number of fractions for real-estate tokens",
9947
+ examples: ["1000000000000000000000"]
9948
+ }),
9949
+ premintRecipient: ethereumAddress.optional().meta({
9950
+ description: "Recipient of preminted real-estate fractions",
9951
+ examples: ["0x71C7656EC7ab88b098defB751B7401B5f6d8976F"]
9952
+ }),
9953
+ collateralRatioBps: z191.number().int().min(0).max(20000).optional().meta({
9954
+ description: "Collateral ratio in basis points (10000 = 100%)",
9955
+ examples: [1e4]
9920
9956
  }),
9921
9957
  metadataValues: z191.record(z191.string(), z191.union([z191.string(), z191.number().finite()])).optional().meta({
9922
9958
  description: "Custom metadata values from the instrument template",
@@ -12719,10 +12755,52 @@ function buildSortSchema(sortFields) {
12719
12755
  }
12720
12756
  return z274.enum(values);
12721
12757
  }
12758
+ function buildFlatFormatPreprocess(filterFieldNames) {
12759
+ return (input) => {
12760
+ if (typeof input !== "object" || input === null || Array.isArray(input)) {
12761
+ return input;
12762
+ }
12763
+ const raw = input;
12764
+ if (raw.filter !== undefined || raw.page !== undefined || raw.sort !== undefined) {
12765
+ return input;
12766
+ }
12767
+ const hasFilterField = Object.keys(raw).some((key) => filterFieldNames.has(key));
12768
+ const hasPaginationField = raw.limit !== undefined || raw.offset !== undefined;
12769
+ const hasSortField = raw.sortBy !== undefined;
12770
+ if (!hasFilterField && !hasPaginationField && !hasSortField) {
12771
+ return input;
12772
+ }
12773
+ const filter = {};
12774
+ const page = {};
12775
+ let sort;
12776
+ for (const [key, value2] of Object.entries(raw)) {
12777
+ if (filterFieldNames.has(key) && value2 !== undefined) {
12778
+ filter[key] = typeof value2 === "boolean" ? String(value2) : value2;
12779
+ } else if (key === "limit" || key === "offset") {
12780
+ page[key] = value2;
12781
+ } else if (key === "sortBy" && typeof value2 === "string") {
12782
+ const dir = raw.sortDirection === "desc" ? "-" : "";
12783
+ sort = `${dir}${value2}`;
12784
+ }
12785
+ }
12786
+ const result = {};
12787
+ if (Object.keys(filter).length > 0) {
12788
+ result.filter = filter;
12789
+ }
12790
+ if (Object.keys(page).length > 0) {
12791
+ result.page = page;
12792
+ }
12793
+ if (sort !== undefined) {
12794
+ result.sort = sort;
12795
+ }
12796
+ return result;
12797
+ };
12798
+ }
12722
12799
  function createCollectionInputSchema(fields, options) {
12723
12800
  const sortFields = sortableFieldNames(fields);
12724
12801
  const sortDescription = `JSON:API sort param. Prefix with - for descending. Sortable fields: ${sortFields.join(", ")}`;
12725
12802
  const filterShape = buildFilterShape(fields, options.globalSearch ?? false);
12803
+ const filterFieldNames = new Set(Object.keys(filterShape));
12726
12804
  const sortSchema = buildSortSchema(sortFields);
12727
12805
  const rawSchema = z274.object({
12728
12806
  sort: sortSchema.optional().meta({ description: sortDescription }),
@@ -12734,7 +12812,8 @@ function createCollectionInputSchema(fields, options) {
12734
12812
  description: "JSON:API filter params. Use filter[field]=value (shorthand) or filter[field][operator]=value (explicit)."
12735
12813
  })
12736
12814
  });
12737
- return rawSchema.transform((raw) => {
12815
+ const preprocess = buildFlatFormatPreprocess(filterFieldNames);
12816
+ return z274.preprocess(preprocess, rawSchema).transform((raw) => {
12738
12817
  const rawSort = typeof raw.sort === "string" ? raw.sort : undefined;
12739
12818
  const sorting = parseJsonApiSort(rawSort, fields, options.defaultSort);
12740
12819
  const filterInput = raw.filter;
@@ -23424,7 +23503,7 @@ var dalpSerializers = [
23424
23503
  // package.json
23425
23504
  var package_default = {
23426
23505
  name: "@settlemint/dalp-sdk",
23427
- version: "2.1.7-main.23442422201",
23506
+ version: "2.1.7-main.23445298463",
23428
23507
  private: false,
23429
23508
  description: "Fully typed SDK for the DALP tokenization platform API",
23430
23509
  homepage: "https://settlemint.com",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@settlemint/dalp-sdk",
3
- "version": "2.1.7-main.23442422201",
3
+ "version": "2.1.7-main.23445298463",
4
4
  "private": false,
5
5
  "description": "Fully typed SDK for the DALP tokenization platform API",
6
6
  "homepage": "https://settlemint.com",