@digitalasset/daml-ledger
Version:
DAML Ledger API Node.js bindings
26 lines • 1.49 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.NodeJsLedgerIdentityClient = void 0;
const Callback_1 = require("../util/Callback");
const ClientCancellableCall_1 = require("../call/ClientCancellableCall");
const GetLedgerIdentityResponseCodec_1 = require("../codec/GetLedgerIdentityResponseCodec");
const ledger_identity_service_pb_1 = require("../generated/com/daml/ledger/api/v1/ledger_identity_service_pb");
class NodeJsLedgerIdentityClient {
constructor(client) {
this.getLedgerIdentityPromise = Callback_1.promisify(this.getLedgerIdentityCallback);
this.client = client;
}
getLedgerIdentityCallback(callback) {
return ClientCancellableCall_1.ClientCancellableCall.accept(this.client.getLedgerIdentity(NodeJsLedgerIdentityClient.request, (error, response) => {
Callback_1.forward(callback, error, response, GetLedgerIdentityResponseCodec_1.GetLedgerIdentityResponseCodec.deserialize);
}));
}
getLedgerIdentity(callback) {
return callback ? this.getLedgerIdentityCallback(callback) : this.getLedgerIdentityPromise();
}
}
exports.NodeJsLedgerIdentityClient = NodeJsLedgerIdentityClient;
NodeJsLedgerIdentityClient.request = new ledger_identity_service_pb_1.GetLedgerIdentityRequest();
//# sourceMappingURL=NodeJsLedgerIdentityClient.js.map