UNPKG

@glitterprotocol/glitter-sdk

Version:

The JavaScript SDK for Glitter

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