@settlemint/dalp-cli 3.1.9 → 3.1.10
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/dist/dalp.js +218 -10
- package/package.json +1 -1
package/dist/dalp.js
CHANGED
|
@@ -120091,6 +120091,91 @@ function validateExpressionSyntax(nodes) {
|
|
|
120091
120091
|
}
|
|
120092
120092
|
return stackSize === 1;
|
|
120093
120093
|
}
|
|
120094
|
+
function convertInfixToPostfix(nodes) {
|
|
120095
|
+
const output = [];
|
|
120096
|
+
const operatorStack = [];
|
|
120097
|
+
const getPrecedence = (nodeType) => {
|
|
120098
|
+
switch (nodeType) {
|
|
120099
|
+
case ExpressionTypeEnum.NOT: {
|
|
120100
|
+
return 3;
|
|
120101
|
+
}
|
|
120102
|
+
case ExpressionTypeEnum.AND: {
|
|
120103
|
+
return 2;
|
|
120104
|
+
}
|
|
120105
|
+
case ExpressionTypeEnum.OR: {
|
|
120106
|
+
return 1;
|
|
120107
|
+
}
|
|
120108
|
+
default: {
|
|
120109
|
+
return 0;
|
|
120110
|
+
}
|
|
120111
|
+
}
|
|
120112
|
+
};
|
|
120113
|
+
for (const node of nodes) {
|
|
120114
|
+
if (typeof node === "string") {
|
|
120115
|
+
if (node === "(") {
|
|
120116
|
+
operatorStack.push("(");
|
|
120117
|
+
} else if (node === ")") {
|
|
120118
|
+
while (operatorStack.length > 0) {
|
|
120119
|
+
const top = operatorStack.pop();
|
|
120120
|
+
if (top === "(") {
|
|
120121
|
+
break;
|
|
120122
|
+
}
|
|
120123
|
+
if (top && typeof top === "object") {
|
|
120124
|
+
output.push(top);
|
|
120125
|
+
}
|
|
120126
|
+
}
|
|
120127
|
+
}
|
|
120128
|
+
} else if (node.nodeType === ExpressionTypeEnum.TOPIC) {
|
|
120129
|
+
output.push(node);
|
|
120130
|
+
} else {
|
|
120131
|
+
const currentPrecedence = getPrecedence(node.nodeType);
|
|
120132
|
+
while (operatorStack.length > 0 && operatorStack.at(-1) !== "(" && typeof operatorStack.at(-1) === "object") {
|
|
120133
|
+
const topOp = operatorStack.at(-1);
|
|
120134
|
+
const topPrecedence = getPrecedence(topOp.nodeType);
|
|
120135
|
+
if (topPrecedence >= currentPrecedence) {
|
|
120136
|
+
output.push(operatorStack.pop());
|
|
120137
|
+
} else {
|
|
120138
|
+
break;
|
|
120139
|
+
}
|
|
120140
|
+
}
|
|
120141
|
+
operatorStack.push(node);
|
|
120142
|
+
}
|
|
120143
|
+
}
|
|
120144
|
+
while (operatorStack.length > 0) {
|
|
120145
|
+
const top = operatorStack.pop();
|
|
120146
|
+
if (top === "(") {
|
|
120147
|
+
return null;
|
|
120148
|
+
}
|
|
120149
|
+
if (top && typeof top === "object") {
|
|
120150
|
+
output.push(top);
|
|
120151
|
+
}
|
|
120152
|
+
}
|
|
120153
|
+
return output;
|
|
120154
|
+
}
|
|
120155
|
+
function toPostfixExpression(nodes) {
|
|
120156
|
+
let openGroups = 0;
|
|
120157
|
+
for (const node of nodes) {
|
|
120158
|
+
if (node === "(") {
|
|
120159
|
+
openGroups += 1;
|
|
120160
|
+
} else if (node === ")") {
|
|
120161
|
+
openGroups -= 1;
|
|
120162
|
+
if (openGroups < 0) {
|
|
120163
|
+
return null;
|
|
120164
|
+
}
|
|
120165
|
+
}
|
|
120166
|
+
}
|
|
120167
|
+
if (openGroups !== 0) {
|
|
120168
|
+
return null;
|
|
120169
|
+
}
|
|
120170
|
+
const postfix = convertInfixToPostfix(nodes);
|
|
120171
|
+
if (postfix === null || nodes.length > 0 && !validateExpressionSyntax(postfix)) {
|
|
120172
|
+
return null;
|
|
120173
|
+
}
|
|
120174
|
+
return postfix;
|
|
120175
|
+
}
|
|
120176
|
+
var encodableExpressionWithGroups = exports_external.array(expressionNodeWithGroups).refine((nodes) => toPostfixExpression(nodes) !== null, {
|
|
120177
|
+
message: "Compliance expression is not valid: operators need operands and groups must be balanced"
|
|
120178
|
+
});
|
|
120094
120179
|
var COUNTRY_ALLOW_TYPE_IDS = new Set(["country-allow-list", "country-allow-list-v2"]);
|
|
120095
120180
|
var COUNTRY_BLOCK_TYPE_IDS = new Set(["country-block-list", "country-block-list-v2"]);
|
|
120096
120181
|
var COUNTRY_MODULE_TYPE_IDS = new Set([
|
|
@@ -120123,7 +120208,7 @@ var identityBlockListValues = () => exports_external.array(ethereumAddress).meta
|
|
|
120123
120208
|
description: "Array of identity contract addresses to block",
|
|
120124
120209
|
examples: [["0x71C7656EC7ab88b098defB751B7401B5f6d8976F"]]
|
|
120125
120210
|
});
|
|
120126
|
-
var smartIdentityVerificationValues = () =>
|
|
120211
|
+
var smartIdentityVerificationValues = () => encodableExpressionWithGroups.meta({ description: "Array of expression nodes", examples: [[]] });
|
|
120127
120212
|
var TokenSupplyLimitValuesSchema = exports_external.object({
|
|
120128
120213
|
maxSupply: apiBigInt.meta({
|
|
120129
120214
|
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.",
|
|
@@ -120204,7 +120289,7 @@ var InvestorCountValuesSchema = exports_external.object({
|
|
|
120204
120289
|
description: "Array of investor limits corresponding to countryCodes. Arrays must have the same length.",
|
|
120205
120290
|
examples: [[500, 300, 200]]
|
|
120206
120291
|
}),
|
|
120207
|
-
topicFilter:
|
|
120292
|
+
topicFilter: encodableExpressionWithGroups.meta({
|
|
120208
120293
|
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.",
|
|
120209
120294
|
examples: [[]]
|
|
120210
120295
|
})
|
|
@@ -120240,7 +120325,7 @@ var TimeLockValuesSchema = exports_external.object({
|
|
|
120240
120325
|
description: "Whether to allow exemptions via identity claims.",
|
|
120241
120326
|
examples: [true, false]
|
|
120242
120327
|
}),
|
|
120243
|
-
exemptionExpression:
|
|
120328
|
+
exemptionExpression: encodableExpressionWithGroups.meta({
|
|
120244
120329
|
description: "Postfix logical expression for exemption logic (empty array = no exemptions).",
|
|
120245
120330
|
examples: [[]]
|
|
120246
120331
|
})
|
|
@@ -120272,7 +120357,7 @@ var TransferApprovalValuesSchema = exports_external.object({
|
|
|
120272
120357
|
description: "Whether approvals are single-use (one-time execution); set to true for regulatory compliance.",
|
|
120273
120358
|
examples: [true, false]
|
|
120274
120359
|
}),
|
|
120275
|
-
exemptionExpression:
|
|
120360
|
+
exemptionExpression: encodableExpressionWithGroups.meta({
|
|
120276
120361
|
description: "Expression defining exemption logic (e.g., [TOPIC_QII]).",
|
|
120277
120362
|
examples: [[]]
|
|
120278
120363
|
}),
|
|
@@ -141791,7 +141876,7 @@ function normalizeDalpBaseUrl(url2) {
|
|
|
141791
141876
|
}
|
|
141792
141877
|
var package_default = {
|
|
141793
141878
|
name: "@settlemint/dalp-sdk",
|
|
141794
|
-
version: "3.1.
|
|
141879
|
+
version: "3.1.10",
|
|
141795
141880
|
private: false,
|
|
141796
141881
|
description: "Fully typed SDK for the DALP tokenization platform API",
|
|
141797
141882
|
homepage: "https://settlemint.com",
|
|
@@ -143013,7 +143098,7 @@ var failedStateSet = new Set(FAILED_TRANSACTION_STATES);
|
|
|
143013
143098
|
// package.json
|
|
143014
143099
|
var package_default2 = {
|
|
143015
143100
|
name: "@settlemint/dalp-cli",
|
|
143016
|
-
version: "3.1.
|
|
143101
|
+
version: "3.1.10",
|
|
143017
143102
|
private: false,
|
|
143018
143103
|
description: "CLI for the Digital Asset Lifecycle Platform — manage tokens, identities, compliance, and more from the command line.",
|
|
143019
143104
|
homepage: "https://settlemint.com",
|
|
@@ -209405,6 +209490,12 @@ var idToTopicNameCache2 = new Map;
|
|
|
209405
209490
|
// ../../packages/core/validation/src/expression-type.ts
|
|
209406
209491
|
var expressionTypes2 = [0, 1, 2, 3];
|
|
209407
209492
|
var expressionTypeKeys2 = ["TOPIC", "AND", "OR", "NOT"];
|
|
209493
|
+
var ExpressionTypeEnum2 = {
|
|
209494
|
+
TOPIC: 0,
|
|
209495
|
+
AND: 1,
|
|
209496
|
+
OR: 2,
|
|
209497
|
+
NOT: 3
|
|
209498
|
+
};
|
|
209408
209499
|
var ExpressionTypeKeySchema2 = exports_external.literal(expressionTypeKeys2).meta({ description: "Expression type key identifier", examples: ["TOPIC", "AND", "OR", "NOT"] });
|
|
209409
209500
|
var ExpressionTypeSchema2 = exports_external.literal(expressionTypes2).meta({ description: "Expression type identifier", examples: [0, 1, 2, 3] });
|
|
209410
209501
|
var expressionType2 = () => ExpressionTypeSchema2;
|
|
@@ -209417,6 +209508,123 @@ var expressionNode2 = exports_external.object({
|
|
|
209417
209508
|
var expression2 = exports_external.array(expressionNode2);
|
|
209418
209509
|
var expressionNodeWithGroups2 = exports_external.union([expressionNode2, exports_external.literal("("), exports_external.literal(")")]);
|
|
209419
209510
|
var expressionWithGroups2 = exports_external.array(expressionNodeWithGroups2);
|
|
209511
|
+
function validateExpressionSyntax2(nodes) {
|
|
209512
|
+
if (nodes.length === 0) {
|
|
209513
|
+
return false;
|
|
209514
|
+
}
|
|
209515
|
+
let stackSize = 0;
|
|
209516
|
+
for (const node of nodes) {
|
|
209517
|
+
switch (node.nodeType) {
|
|
209518
|
+
case ExpressionTypeEnum2.TOPIC: {
|
|
209519
|
+
stackSize += 1;
|
|
209520
|
+
break;
|
|
209521
|
+
}
|
|
209522
|
+
case ExpressionTypeEnum2.AND:
|
|
209523
|
+
case ExpressionTypeEnum2.OR: {
|
|
209524
|
+
if (stackSize < 2) {
|
|
209525
|
+
return false;
|
|
209526
|
+
}
|
|
209527
|
+
stackSize -= 1;
|
|
209528
|
+
break;
|
|
209529
|
+
}
|
|
209530
|
+
case ExpressionTypeEnum2.NOT: {
|
|
209531
|
+
if (stackSize < 1) {
|
|
209532
|
+
return false;
|
|
209533
|
+
}
|
|
209534
|
+
break;
|
|
209535
|
+
}
|
|
209536
|
+
default: {
|
|
209537
|
+
return false;
|
|
209538
|
+
}
|
|
209539
|
+
}
|
|
209540
|
+
}
|
|
209541
|
+
return stackSize === 1;
|
|
209542
|
+
}
|
|
209543
|
+
function convertInfixToPostfix2(nodes) {
|
|
209544
|
+
const output = [];
|
|
209545
|
+
const operatorStack = [];
|
|
209546
|
+
const getPrecedence = (nodeType) => {
|
|
209547
|
+
switch (nodeType) {
|
|
209548
|
+
case ExpressionTypeEnum2.NOT: {
|
|
209549
|
+
return 3;
|
|
209550
|
+
}
|
|
209551
|
+
case ExpressionTypeEnum2.AND: {
|
|
209552
|
+
return 2;
|
|
209553
|
+
}
|
|
209554
|
+
case ExpressionTypeEnum2.OR: {
|
|
209555
|
+
return 1;
|
|
209556
|
+
}
|
|
209557
|
+
default: {
|
|
209558
|
+
return 0;
|
|
209559
|
+
}
|
|
209560
|
+
}
|
|
209561
|
+
};
|
|
209562
|
+
for (const node of nodes) {
|
|
209563
|
+
if (typeof node === "string") {
|
|
209564
|
+
if (node === "(") {
|
|
209565
|
+
operatorStack.push("(");
|
|
209566
|
+
} else if (node === ")") {
|
|
209567
|
+
while (operatorStack.length > 0) {
|
|
209568
|
+
const top = operatorStack.pop();
|
|
209569
|
+
if (top === "(") {
|
|
209570
|
+
break;
|
|
209571
|
+
}
|
|
209572
|
+
if (top && typeof top === "object") {
|
|
209573
|
+
output.push(top);
|
|
209574
|
+
}
|
|
209575
|
+
}
|
|
209576
|
+
}
|
|
209577
|
+
} else if (node.nodeType === ExpressionTypeEnum2.TOPIC) {
|
|
209578
|
+
output.push(node);
|
|
209579
|
+
} else {
|
|
209580
|
+
const currentPrecedence = getPrecedence(node.nodeType);
|
|
209581
|
+
while (operatorStack.length > 0 && operatorStack.at(-1) !== "(" && typeof operatorStack.at(-1) === "object") {
|
|
209582
|
+
const topOp = operatorStack.at(-1);
|
|
209583
|
+
const topPrecedence = getPrecedence(topOp.nodeType);
|
|
209584
|
+
if (topPrecedence >= currentPrecedence) {
|
|
209585
|
+
output.push(operatorStack.pop());
|
|
209586
|
+
} else {
|
|
209587
|
+
break;
|
|
209588
|
+
}
|
|
209589
|
+
}
|
|
209590
|
+
operatorStack.push(node);
|
|
209591
|
+
}
|
|
209592
|
+
}
|
|
209593
|
+
while (operatorStack.length > 0) {
|
|
209594
|
+
const top = operatorStack.pop();
|
|
209595
|
+
if (top === "(") {
|
|
209596
|
+
return null;
|
|
209597
|
+
}
|
|
209598
|
+
if (top && typeof top === "object") {
|
|
209599
|
+
output.push(top);
|
|
209600
|
+
}
|
|
209601
|
+
}
|
|
209602
|
+
return output;
|
|
209603
|
+
}
|
|
209604
|
+
function toPostfixExpression2(nodes) {
|
|
209605
|
+
let openGroups = 0;
|
|
209606
|
+
for (const node of nodes) {
|
|
209607
|
+
if (node === "(") {
|
|
209608
|
+
openGroups += 1;
|
|
209609
|
+
} else if (node === ")") {
|
|
209610
|
+
openGroups -= 1;
|
|
209611
|
+
if (openGroups < 0) {
|
|
209612
|
+
return null;
|
|
209613
|
+
}
|
|
209614
|
+
}
|
|
209615
|
+
}
|
|
209616
|
+
if (openGroups !== 0) {
|
|
209617
|
+
return null;
|
|
209618
|
+
}
|
|
209619
|
+
const postfix = convertInfixToPostfix2(nodes);
|
|
209620
|
+
if (postfix === null || nodes.length > 0 && !validateExpressionSyntax2(postfix)) {
|
|
209621
|
+
return null;
|
|
209622
|
+
}
|
|
209623
|
+
return postfix;
|
|
209624
|
+
}
|
|
209625
|
+
var encodableExpressionWithGroups2 = exports_external.array(expressionNodeWithGroups2).refine((nodes) => toPostfixExpression2(nodes) !== null, {
|
|
209626
|
+
message: "Compliance expression is not valid: operators need operands and groups must be balanced"
|
|
209627
|
+
});
|
|
209420
209628
|
|
|
209421
209629
|
// ../../packages/core/validation/src/compliance-contradictions.ts
|
|
209422
209630
|
var COUNTRY_ALLOW_TYPE_IDS2 = new Set(["country-allow-list", "country-allow-list-v2"]);
|
|
@@ -209453,7 +209661,7 @@ var identityBlockListValues2 = () => exports_external.array(ethereumAddress2).me
|
|
|
209453
209661
|
description: "Array of identity contract addresses to block",
|
|
209454
209662
|
examples: [["0x71C7656EC7ab88b098defB751B7401B5f6d8976F"]]
|
|
209455
209663
|
});
|
|
209456
|
-
var smartIdentityVerificationValues2 = () =>
|
|
209664
|
+
var smartIdentityVerificationValues2 = () => encodableExpressionWithGroups2.meta({ description: "Array of expression nodes", examples: [[]] });
|
|
209457
209665
|
var TokenSupplyLimitValuesSchema2 = exports_external.object({
|
|
209458
209666
|
maxSupply: apiBigInt2.meta({
|
|
209459
209667
|
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.",
|
|
@@ -209534,7 +209742,7 @@ var InvestorCountValuesSchema2 = exports_external.object({
|
|
|
209534
209742
|
description: "Array of investor limits corresponding to countryCodes. Arrays must have the same length.",
|
|
209535
209743
|
examples: [[500, 300, 200]]
|
|
209536
209744
|
}),
|
|
209537
|
-
topicFilter:
|
|
209745
|
+
topicFilter: encodableExpressionWithGroups2.meta({
|
|
209538
209746
|
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.",
|
|
209539
209747
|
examples: [[]]
|
|
209540
209748
|
})
|
|
@@ -209570,7 +209778,7 @@ var TimeLockValuesSchema2 = exports_external.object({
|
|
|
209570
209778
|
description: "Whether to allow exemptions via identity claims.",
|
|
209571
209779
|
examples: [true, false]
|
|
209572
209780
|
}),
|
|
209573
|
-
exemptionExpression:
|
|
209781
|
+
exemptionExpression: encodableExpressionWithGroups2.meta({
|
|
209574
209782
|
description: "Postfix logical expression for exemption logic (empty array = no exemptions).",
|
|
209575
209783
|
examples: [[]]
|
|
209576
209784
|
})
|
|
@@ -209602,7 +209810,7 @@ var TransferApprovalValuesSchema2 = exports_external.object({
|
|
|
209602
209810
|
description: "Whether approvals are single-use (one-time execution); set to true for regulatory compliance.",
|
|
209603
209811
|
examples: [true, false]
|
|
209604
209812
|
}),
|
|
209605
|
-
exemptionExpression:
|
|
209813
|
+
exemptionExpression: encodableExpressionWithGroups2.meta({
|
|
209606
209814
|
description: "Expression defining exemption logic (e.g., [TOPIC_QII]).",
|
|
209607
209815
|
examples: [[]]
|
|
209608
209816
|
}),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@settlemint/dalp-cli",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.10",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "CLI for the Digital Asset Lifecycle Platform — manage tokens, identities, compliance, and more from the command line.",
|
|
6
6
|
"homepage": "https://settlemint.com",
|