@layerzerolabs/ton-sdk-tools 3.0.125 → 3.0.126

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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @layerzerolabs/ton-sdk-tools
2
2
 
3
+ ## 3.0.126
4
+
5
+ ### Patch Changes
6
+
7
+ - 46912f3: bump ton sdk for better error catching
8
+
3
9
  ## 3.0.125
4
10
 
5
11
  ### Patch Changes
package/dist/index.cjs CHANGED
@@ -1070,6 +1070,7 @@ function extractErrors(fileNames) {
1070
1070
  const firstFormat = /^const\s+int\s+((?:[A-Za-z_]+::)*[A-Za-z_]+)\s*=\s*"((?:[A-Za-z_]+::)*[A-Za-z_]+)"\s*c\s*&\s*ERRORCODE_MASK;$/;
1071
1071
  const secondFormat = /^const\s+(?:int\s+)?(error::\w+)\s*=\s*((?:0x[\da-fA-F]+|\d+));$/;
1072
1072
  const thirdFormat = /^const\s+int\s+([\w:]+::(?:ERROR|error)::\w+)\s*=\s*(\d+);$/i;
1073
+ const fourthFormat = /^const\s+int\s+([\w:]+::(?:ERROR|error|ErrorCode)::\w+)\s*=\s*"([^"]+)"\s*c\s*&\s*(0x[\da-fA-F]+|\d+);$/i;
1073
1074
  const result = /* @__PURE__ */ new Map();
1074
1075
  for (const fileName of fileNames) {
1075
1076
  const fileContent = fs__namespace.readFileSync(fileName, "utf-8");
@@ -1082,6 +1083,7 @@ function extractErrors(fileNames) {
1082
1083
  const firstFormatMatch = trimmedLine.match(firstFormat);
1083
1084
  const secondFormatMatch = trimmedLine.match(secondFormat);
1084
1085
  const thirdFormatMatch = trimmedLine.match(thirdFormat);
1086
+ const fourthFormatMatch = trimmedLine.match(fourthFormat);
1085
1087
  if (firstFormatMatch) {
1086
1088
  [, rawVariableName, rawValue] = firstFormatMatch;
1087
1089
  value = getOpcodeCRC(rawValue) & ERRORCODE_MASK;
@@ -1091,6 +1093,10 @@ function extractErrors(fileNames) {
1091
1093
  } else if (thirdFormatMatch) {
1092
1094
  [, rawVariableName, rawValue] = thirdFormatMatch;
1093
1095
  value = BigInt(rawValue) & ERRORCODE_MASK;
1096
+ } else if (fourthFormatMatch) {
1097
+ [, rawVariableName, rawValue] = fourthFormatMatch;
1098
+ const mask = fourthFormatMatch[3];
1099
+ value = getOpcodeCRC(rawValue) & BigInt(mask);
1094
1100
  }
1095
1101
  if (rawVariableName !== "" && rawValue !== "") {
1096
1102
  result.set(tonConstNameToTSName(rawVariableName), value);