UNPKG

796 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3var middleware_1 = require("./middleware");
4var crypto_utils_1 = require("./crypto-utils");
5/**
6 * Creates the default set of tx middleware required to successfully commit a tx to a Loom DAppChain.
7 * @param client The client the middleware is being created for.
8 * @param privateKey Private key that should be used to sign txs.
9 * @returns Set of middleware.
10 */
11function createDefaultTxMiddleware(client, privateKey) {
12 var pubKey = crypto_utils_1.publicKeyFromPrivateKey(privateKey);
13 return [new middleware_1.NonceTxMiddleware(pubKey, client), new middleware_1.SignedTxMiddleware(privateKey)];
14}
15exports.createDefaultTxMiddleware = createDefaultTxMiddleware;
16//# sourceMappingURL=helpers.js.map
\No newline at end of file