UNPKG

@newos/cli

Version:
20 lines 958 B
"use strict"; var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); const TransactionController_1 = __importDefault(require("../models/network/TransactionController")); async function sendTx({ proxyAddress, methodName, methodArgs, value, gas, network, txParams, networkFile, }) { if (!proxyAddress) throw Error('A contract address must be specified.'); if (!methodName) throw Error('A method name must be specified.'); if (value) txParams = Object.assign({ value }, txParams); if (gas) txParams = Object.assign({ gas }, txParams); const controller = new TransactionController_1.default(txParams, network, networkFile); await controller.sendTransaction(proxyAddress, methodName, methodArgs); } exports.default = sendTx; //# sourceMappingURL=send-tx.js.map