dpos-offline
Version:
Offline Signing Transactions for DPOS Blockchains
36 lines (35 loc) • 1.52 kB
JavaScript
;
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
Object.defineProperty(exports, "__esModule", { value: true });
var base_v1_1 = require("./base_v1");
var RiseRegDelegateV1TxCodec = /** @class */ (function (_super) {
__extends(RiseRegDelegateV1TxCodec, _super);
function RiseRegDelegateV1TxCodec() {
return _super.call(this, 2, 'register-delegate') || this;
}
RiseRegDelegateV1TxCodec.prototype.calcFees = function (tx) {
return 2500000000;
};
RiseRegDelegateV1TxCodec.prototype.transform = function (from) {
var s = _super.prototype.transform.call(this, from);
s.asset = { delegate: { username: from.identifier } };
return s;
};
RiseRegDelegateV1TxCodec.prototype.assetBytes = function (tx) {
return Buffer.from(tx.asset.delegate.username, 'utf8');
};
return RiseRegDelegateV1TxCodec;
}(base_v1_1.BaseRiseV1Codec));
exports.RiseRegDelegateV1TxCodec = RiseRegDelegateV1TxCodec;