@digitalasset/daml-ledger
Version:
DAML Ledger API Node.js bindings
21 lines • 760 B
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.TimestampCodec = void 0;
const timestamp_pb_1 = require("google-protobuf/google/protobuf/timestamp_pb");
exports.TimestampCodec = {
deserialize(timestamp) {
return {
seconds: timestamp.getSeconds(),
nanoseconds: timestamp.getNanos()
};
},
serialize(timestamp) {
const result = new timestamp_pb_1.Timestamp();
result.setSeconds(timestamp.seconds);
result.setNanos(timestamp.nanoseconds);
return result;
}
};
//# sourceMappingURL=TimestampCodec.js.map