UNPKG

@digitalasset/daml-ledger

Version:
29 lines 1.48 kB
"use strict"; // Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. // SPDX-License-Identifier: Apache-2.0 Object.defineProperty(exports, "__esModule", { value: true }); exports.CreateAndExerciseCommandCodec = void 0; const commands_pb_1 = require("../generated/com/daml/ledger/api/v1/commands_pb"); const IdentifierCodec_1 = require("./IdentifierCodec"); const RecordCodec_1 = require("./RecordCodec"); const ValueCodec_1 = require("./ValueCodec"); exports.CreateAndExerciseCommandCodec = { deserialize(message) { return { commandType: "createAndExercise", templateId: IdentifierCodec_1.IdentifierCodec.deserialize(message.getTemplateId()), createArguments: RecordCodec_1.RecordCodec.deserialize(message.getCreateArguments()), choice: message.getChoice(), choiceArgument: ValueCodec_1.ValueCodec.deserialize(message.getChoiceArgument()) }; }, serialize(object) { const message = new commands_pb_1.CreateAndExerciseCommand(); message.setTemplateId(IdentifierCodec_1.IdentifierCodec.serialize(object.templateId)); message.setCreateArguments(RecordCodec_1.RecordCodec.serialize(object.createArguments)); message.setChoice(object.choice); message.setChoiceArgument(ValueCodec_1.ValueCodec.serialize(object.choiceArgument)); return message; } }; //# sourceMappingURL=CreateAndExerciseCommandCodec.js.map