UNPKG

@planq-network/connect

Version:

Light Toolkit for connecting with the Planq network

37 lines 1.58 kB
"use strict"; var __assign = (this && this.__assign) || function () { __assign = Object.assign || function(t) { for (var s, i = 1, n = arguments.length; i < n; i++) { s = arguments[i]; for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p]; } return t; }; return __assign.apply(this, arguments); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.PlanqTransactionObject = exports.toTransactionObject = void 0; function toTransactionObject(connection, txo, defaultParams) { return new PlanqTransactionObject(connection, txo, defaultParams); } exports.toTransactionObject = toTransactionObject; var PlanqTransactionObject = /** @class */ (function () { function PlanqTransactionObject(connection, txo, defaultParams) { var _this = this; this.connection = connection; this.txo = txo; this.defaultParams = defaultParams; /** send the transaction to the chain */ this.send = function (params) { return _this.connection.sendTransactionObject(_this.txo, __assign(__assign({}, _this.defaultParams), params)); }; /** send the transaction and waits for the receipt */ this.sendAndWaitForReceipt = function (params) { return _this.send(params).then(function (result) { return result.waitReceipt(); }); }; } return PlanqTransactionObject; }()); exports.PlanqTransactionObject = PlanqTransactionObject; //# sourceMappingURL=planq-transaction-object.js.map