@settlemint/dalp-sdk 3.1.9 → 3.1.10-release.33480594920

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 +90 -5
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -70056,6 +70056,91 @@ function validateExpressionSyntax(nodes) {
70056
70056
  }
70057
70057
  return stackSize === 1;
70058
70058
  }
70059
+ function convertInfixToPostfix(nodes) {
70060
+ const output = [];
70061
+ const operatorStack = [];
70062
+ const getPrecedence = (nodeType) => {
70063
+ switch (nodeType) {
70064
+ case ExpressionTypeEnum.NOT: {
70065
+ return 3;
70066
+ }
70067
+ case ExpressionTypeEnum.AND: {
70068
+ return 2;
70069
+ }
70070
+ case ExpressionTypeEnum.OR: {
70071
+ return 1;
70072
+ }
70073
+ default: {
70074
+ return 0;
70075
+ }
70076
+ }
70077
+ };
70078
+ for (const node of nodes) {
70079
+ if (typeof node === "string") {
70080
+ if (node === "(") {
70081
+ operatorStack.push("(");
70082
+ } else if (node === ")") {
70083
+ while (operatorStack.length > 0) {
70084
+ const top = operatorStack.pop();
70085
+ if (top === "(") {
70086
+ break;
70087
+ }
70088
+ if (top && typeof top === "object") {
70089
+ output.push(top);
70090
+ }
70091
+ }
70092
+ }
70093
+ } else if (node.nodeType === ExpressionTypeEnum.TOPIC) {
70094
+ output.push(node);
70095
+ } else {
70096
+ const currentPrecedence = getPrecedence(node.nodeType);
70097
+ while (operatorStack.length > 0 && operatorStack.at(-1) !== "(" && typeof operatorStack.at(-1) === "object") {
70098
+ const topOp = operatorStack.at(-1);
70099
+ const topPrecedence = getPrecedence(topOp.nodeType);
70100
+ if (topPrecedence >= currentPrecedence) {
70101
+ output.push(operatorStack.pop());
70102
+ } else {
70103
+ break;
70104
+ }
70105
+ }
70106
+ operatorStack.push(node);
70107
+ }
70108
+ }
70109
+ while (operatorStack.length > 0) {
70110
+ const top = operatorStack.pop();
70111
+ if (top === "(") {
70112
+ return null;
70113
+ }
70114
+ if (top && typeof top === "object") {
70115
+ output.push(top);
70116
+ }
70117
+ }
70118
+ return output;
70119
+ }
70120
+ function toPostfixExpression(nodes) {
70121
+ let openGroups = 0;
70122
+ for (const node of nodes) {
70123
+ if (node === "(") {
70124
+ openGroups += 1;
70125
+ } else if (node === ")") {
70126
+ openGroups -= 1;
70127
+ if (openGroups < 0) {
70128
+ return null;
70129
+ }
70130
+ }
70131
+ }
70132
+ if (openGroups !== 0) {
70133
+ return null;
70134
+ }
70135
+ const postfix = convertInfixToPostfix(nodes);
70136
+ if (postfix === null || nodes.length > 0 && !validateExpressionSyntax(postfix)) {
70137
+ return null;
70138
+ }
70139
+ return postfix;
70140
+ }
70141
+ var encodableExpressionWithGroups = z66.array(expressionNodeWithGroups).refine((nodes) => toPostfixExpression(nodes) !== null, {
70142
+ message: "Compliance expression is not valid: operators need operands and groups must be balanced"
70143
+ });
70059
70144
 
70060
70145
  // ../../packages/core/validation/src/compliance-contradictions.ts
70061
70146
  var COUNTRY_ALLOW_TYPE_IDS = new Set(["country-allow-list", "country-allow-list-v2"]);
@@ -70092,7 +70177,7 @@ var identityBlockListValues = () => z67.array(ethereumAddress).meta({
70092
70177
  description: "Array of identity contract addresses to block",
70093
70178
  examples: [["0x71C7656EC7ab88b098defB751B7401B5f6d8976F"]]
70094
70179
  });
70095
- var smartIdentityVerificationValues = () => z67.array(expressionNodeWithGroups).meta({ description: "Array of expression nodes", examples: [[]] });
70180
+ var smartIdentityVerificationValues = () => encodableExpressionWithGroups.meta({ description: "Array of expression nodes", examples: [[]] });
70096
70181
  var TokenSupplyLimitValuesSchema = z67.object({
70097
70182
  maxSupply: apiBigInt.meta({
70098
70183
  description: "Maximum allowed supply in raw units (including decimals). If useBasePrice=false: raw token amount (e.g., 1000e18 for 1000 tokens with 18 decimals). If useBasePrice=true: raw currency amount with 18 decimals (e.g., 8000000e18 for 8M). For MiCA compliance with 8M limit, specify 8000000e18.",
@@ -70173,7 +70258,7 @@ var InvestorCountValuesSchema = z67.object({
70173
70258
  description: "Array of investor limits corresponding to countryCodes. Arrays must have the same length.",
70174
70259
  examples: [[500, 300, 200]]
70175
70260
  }),
70176
- topicFilter: z67.array(expressionNodeWithGroups).meta({
70261
+ topicFilter: encodableExpressionWithGroups.meta({
70177
70262
  description: "ExpressionNode array for filtering which investors count toward the limit. Uses postfix notation for logical expressions (e.g., KYC AND AML requirements). Empty array means all investors count.",
70178
70263
  examples: [[]]
70179
70264
  })
@@ -70209,7 +70294,7 @@ var TimeLockValuesSchema = z67.object({
70209
70294
  description: "Whether to allow exemptions via identity claims.",
70210
70295
  examples: [true, false]
70211
70296
  }),
70212
- exemptionExpression: z67.array(expressionNodeWithGroups).meta({
70297
+ exemptionExpression: encodableExpressionWithGroups.meta({
70213
70298
  description: "Postfix logical expression for exemption logic (empty array = no exemptions).",
70214
70299
  examples: [[]]
70215
70300
  })
@@ -70241,7 +70326,7 @@ var TransferApprovalValuesSchema = z67.object({
70241
70326
  description: "Whether approvals are single-use (one-time execution); set to true for regulatory compliance.",
70242
70327
  examples: [true, false]
70243
70328
  }),
70244
- exemptionExpression: z67.array(expressionNodeWithGroups).meta({
70329
+ exemptionExpression: encodableExpressionWithGroups.meta({
70245
70330
  description: "Expression defining exemption logic (e.g., [TOPIC_QII]).",
70246
70331
  examples: [[]]
70247
70332
  }),
@@ -93726,7 +93811,7 @@ function normalizeDalpBaseUrl(url) {
93726
93811
  // package.json
93727
93812
  var package_default = {
93728
93813
  name: "@settlemint/dalp-sdk",
93729
- version: "3.1.9",
93814
+ version: "3.1.10-release.33480594920",
93730
93815
  private: false,
93731
93816
  description: "Fully typed SDK for the DALP tokenization platform API",
93732
93817
  homepage: "https://settlemint.com",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@settlemint/dalp-sdk",
3
- "version": "3.1.9",
3
+ "version": "3.1.10-release.33480594920",
4
4
  "private": false,
5
5
  "description": "Fully typed SDK for the DALP tokenization platform API",
6
6
  "homepage": "https://settlemint.com",