@distrohelena/canton-typescript-sdk 0.1.27 → 0.1.28

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.
@@ -31,7 +31,7 @@ export class Lf2ModelMapper {
31
31
  if (rawType?.sum.oneofKind === "tapp") {
32
32
  const lhs = Lf2ModelMapper.mapType(currentPackageId, rawPackage, rawType.sum.tapp.lhs);
33
33
  const numericScale = lhs.builtinType === DamlLfBuiltinType.numeric
34
- ? Lf2ModelMapper.readNumericScale(rawType.sum.tapp.rhs)
34
+ ? Lf2ModelMapper.readNumericScale(rawPackage, rawType.sum.tapp.rhs)
35
35
  : undefined;
36
36
  return new DamlLfType({
37
37
  builtinType: lhs.builtinType,
@@ -63,7 +63,7 @@ export class Lf2ModelMapper {
63
63
  else if (rawType?.sum.oneofKind === "builtin") {
64
64
  const builtinType = Lf2ModelMapper.mapBuiltinType(rawType.sum.builtin.builtin);
65
65
  const numericScale = builtinType === DamlLfBuiltinType.numeric
66
- ? Lf2ModelMapper.readNumericScale(rawType.sum.builtin.args[0])
66
+ ? Lf2ModelMapper.readNumericScale(rawPackage, rawType.sum.builtin.args[0])
67
67
  : undefined;
68
68
  return new DamlLfType({
69
69
  builtinType,
@@ -111,7 +111,11 @@ export class Lf2ModelMapper {
111
111
  return DamlLfBuiltinType.unknown;
112
112
  }
113
113
  }
114
- static readNumericScale(rawType) {
114
+ static readNumericScale(rawPackage, rawType) {
115
+ if (rawType?.sum.oneofKind === "internedType"
116
+ && rawType.sum.internedType >= 0) {
117
+ return Lf2ModelMapper.readNumericScale(rawPackage, rawPackage.internedTypes[rawType.sum.internedType]);
118
+ }
115
119
  if (rawType?.sum.oneofKind !== "nat") {
116
120
  return undefined;
117
121
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@distrohelena/canton-typescript-sdk",
3
- "version": "0.1.27",
3
+ "version": "0.1.28",
4
4
  "license": "Apache-2.0",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",