Skip to content

Commit

Permalink
fix: use BigVarUint ts function for coins map value serizaliation type
Browse files Browse the repository at this point in the history
  • Loading branch information
Gusarich committed Nov 2, 2024
1 parent 1b05601 commit 96743bf
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/bindings/typescript/serializers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -620,6 +620,7 @@ type MapSerializerDescrKey =
| { kind: "address" };
type MapSerializerDescrValue =
| { kind: "int" | "uint"; bits: number }
| { kind: "varuint"; length: number }
| { kind: "boolean" }
| { kind: "address" }
| { kind: "cell" }
Expand Down Expand Up @@ -665,6 +666,9 @@ function getValueParser(src: MapSerializerDescrValue) {
return `Dictionary.Values.BigUint(${src.bits})`;
}
}
case "varuint": {
return `Dictionary.Values.BigVarUint(${src.length})`;
}
case "address": {
return "Dictionary.Values.Address()";
}
Expand Down Expand Up @@ -739,7 +743,7 @@ const map: Serializer<MapSerializerDescr> = {
) {
value = { kind: "uint", bits: 256 };
} else if (src.valueFormat === "coins") {
value = { kind: "uint", bits: 124 };
value = { kind: "varuint", length: 4 };
}
}
if (src.value === "address") {
Expand Down Expand Up @@ -809,6 +813,10 @@ const map: Serializer<MapSerializerDescr> = {
}
}
break;
case "varuint": {
valueT = `bigint`;
break;
}
case "boolean":
{
valueT = `boolean`;
Expand Down

0 comments on commit 96743bf

Please sign in to comment.