UNPKG

@glitterprotocol/glitter-sdk

Version:

The JavaScript SDK for Glitter

102 lines 4.36 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.ReleasePledge = 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/consumer/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 ReleasePledge = /** @class */ (function (_super) { __extends(ReleasePledge, _super); /** * @param value SQLExecRequest */ function ReleasePledge(params) { var _this = _super.call(this) || this; _this.params = params; return _this; } ReleasePledge.fromAmino = function (data, _) { var _a = data.value, fromAddress = _a.fromAddress, datasetName = _a.datasetName, amount = _a.amount; return new ReleasePledge({ fromAddress: fromAddress, datasetName: datasetName, amount: amount, }); }; ReleasePledge.prototype.toAmino = function (_) { var _a = this.params, fromAddress = _a.fromAddress, datasetName = _a.datasetName, amount = _a.amount; return { type: 'transfer/ReleasePledge', value: { fromAddress: fromAddress, datasetName: datasetName, amount: amount, }, }; }; ReleasePledge.fromProto = function (proto, _) { return new ReleasePledge({ fromAddress: proto.fromAddress, datasetName: proto.datasetName, amount: proto.amount, }); }; ReleasePledge.prototype.toProto = function (_) { var _a = this.params, fromAddress = _a.fromAddress, datasetName = _a.datasetName, amount = _a.amount; return tx_1.ReleasePledgeRequest.fromPartial({ fromAddress: fromAddress, datasetName: datasetName, amount: amount, }); }; ReleasePledge.prototype.packAny = function (isClassic) { return any_1.Any.fromPartial({ typeUrl: '/glitterchain.consumer.ReleasePledgeRequest', value: tx_1.ReleasePledgeRequest.encode(this.toProto(isClassic)).finish(), }); }; ReleasePledge.unpackAny = function (msgAny, isClassic) { return ReleasePledge.fromProto(tx_1.ReleasePledgeRequest.decode(msgAny.value), isClassic); }; ReleasePledge.fromData = function (data, _) { var fromAddress = data.fromAddress, datasetName = data.datasetName, amount = data.amount; return new ReleasePledge({ fromAddress: fromAddress, datasetName: datasetName, amount: amount, }); }; ReleasePledge.prototype.toData = function (_) { var _a = this.params, fromAddress = _a.fromAddress, datasetName = _a.datasetName, amount = _a.amount; return { '@type': '/glitterchain.consumer.ReleasePledgeRequest', fromAddress: fromAddress, datasetName: datasetName, amount: amount, }; }; return ReleasePledge; }(json_1.JSONSerializable)); exports.ReleasePledge = ReleasePledge; //# sourceMappingURL=ReleasePledge.js.map