UNPKG

@glitterprotocol/glitter-sdk

Version:

The JavaScript SDK for Glitter

102 lines 4.42 kB
"use strict"; 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 (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { if (typeof b !== "function" && b !== null) throw new TypeError("Class extends value " + String(b) + " is not a constructor or null"); extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.RenewalDataset = void 0; var json_1 = require("../../util/json"); var any_1 = require("@glitterprotocol/glitter.proto/google/protobuf/any"); //import { MsgVerifyInvariant as MsgVerifyInvariant_pb } from '@glitterprotocol/glitter.proto/cosmos/crisis/v1beta1/tx'; // import { SQLGrantRequest as CreateDatasetRequest } from '@glitterprotocol/glitter.proto/index/tx'; var tx_1 = require("@glitterprotocol/glitter.proto/glitterchain/index/tx"); /** * Executes a market swap between 2 denominations at the exchange rate registered by the * Oracle module. The account will lose the amount of coins offered, and receive funds * in the requested denomination after a swap fee has been applied. */ var RenewalDataset = /** @class */ (function (_super) { __extends(RenewalDataset, _super); /** * @param value SQLExecRequest */ function RenewalDataset(params) { var _this = _super.call(this) || this; _this.params = params; return _this; } RenewalDataset.fromAmino = function (data, _) { var _a = data.value, fromAddress = _a.fromAddress, datasetName = _a.datasetName, duration = _a.duration; return new RenewalDataset({ fromAddress: fromAddress, datasetName: datasetName, duration: duration, }); }; RenewalDataset.prototype.toAmino = function (_) { var _a = this.params, fromAddress = _a.fromAddress, datasetName = _a.datasetName, duration = _a.duration; return { type: 'transfer/RenewalDataset', value: { fromAddress: fromAddress, datasetName: datasetName, duration: duration, }, }; }; RenewalDataset.fromProto = function (proto, _) { return new RenewalDataset({ fromAddress: proto.fromAddress, datasetName: proto.datasetName, duration: proto.duration, }); }; RenewalDataset.prototype.toProto = function (_) { var _a = this.params, fromAddress = _a.fromAddress, datasetName = _a.datasetName, duration = _a.duration; return tx_1.RenewalDatasetRequest.fromPartial({ fromAddress: fromAddress, datasetName: datasetName, duration: duration, }); }; RenewalDataset.prototype.packAny = function (isClassic) { return any_1.Any.fromPartial({ typeUrl: '/glitterchain.index.RenewalDatasetRequest', value: tx_1.RenewalDatasetRequest.encode(this.toProto(isClassic)).finish(), }); }; RenewalDataset.unpackAny = function (msgAny, isClassic) { return RenewalDataset.fromProto(tx_1.RenewalDatasetRequest.decode(msgAny.value), isClassic); }; RenewalDataset.fromData = function (data, _) { var fromAddress = data.fromAddress, datasetName = data.datasetName, duration = data.duration; return new RenewalDataset({ fromAddress: fromAddress, datasetName: datasetName, duration: duration, }); }; RenewalDataset.prototype.toData = function (_) { var _a = this.params, fromAddress = _a.fromAddress, datasetName = _a.datasetName, duration = _a.duration; return { '@type': '/glitterchain.index.RenewalDatasetRequest', fromAddress: fromAddress, datasetName: datasetName, duration: duration, }; }; return RenewalDataset; }(json_1.JSONSerializable)); exports.RenewalDataset = RenewalDataset; //# sourceMappingURL=RenewalDataset.js.map