@digitalasset/daml-ledger
Version:
DAML Ledger API Node.js bindings
24 lines • 1.1 kB
JavaScript
;
// 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.CreateCommandCodec = void 0;
const IdentifierCodec_1 = require("./IdentifierCodec");
const RecordCodec_1 = require("./RecordCodec");
const commands_pb_1 = require("../generated/com/daml/ledger/api/v1/commands_pb");
exports.CreateCommandCodec = {
deserialize(command) {
return {
commandType: "create",
templateId: IdentifierCodec_1.IdentifierCodec.deserialize(command.getTemplateId()),
arguments: RecordCodec_1.RecordCodec.deserialize(command.getCreateArguments())
};
},
serialize(command) {
const result = new commands_pb_1.CreateCommand();
result.setTemplateId(IdentifierCodec_1.IdentifierCodec.serialize(command.templateId));
result.setCreateArguments(RecordCodec_1.RecordCodec.serialize(command.arguments));
return result;
}
};
//# sourceMappingURL=CreateCommandCodec.js.map