@digitalasset/daml-ledger
Version:
DAML Ledger API Node.js bindings
26 lines • 1.17 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.NodeJsResetClient = void 0;
const reset_service_pb_1 = require("../generated/com/daml/ledger/api/v1/testing/reset_service_pb");
const Callback_1 = require("../util/Callback");
const ClientCancellableCall_1 = require("../call/ClientCancellableCall");
class NodeJsResetClient {
constructor(ledgerId, client) {
this.resetPromise = Callback_1.promisify(this.resetCallback);
this.client = client;
this.request = new reset_service_pb_1.ResetRequest();
this.request.setLedgerId(ledgerId);
}
resetCallback(callback) {
return ClientCancellableCall_1.ClientCancellableCall.accept(this.client.reset(this.request, (error, _) => {
Callback_1.forwardVoidResponse(callback, error);
}));
}
reset(callback) {
return callback ? this.resetCallback(callback) : this.resetPromise();
}
}
exports.NodeJsResetClient = NodeJsResetClient;
//# sourceMappingURL=NodeJsResetClient.js.map