@glitterprotocol/glitter-sdk
Version:
The JavaScript SDK for Glitter
99 lines • 4.3 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 (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.SqlGrantMsg = 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/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 SqlGrantMsg = /** @class */ (function (_super) {
__extends(SqlGrantMsg, _super);
/**
* @param value SQLExecRequest
*/
function SqlGrantMsg(uid, onTable, toUID, role, onDatabase) {
var _this = _super.call(this) || this;
_this.uid = uid;
_this.onTable = onTable;
_this.toUID = toUID;
_this.role = role;
_this.onDatabase = onDatabase;
return _this;
}
SqlGrantMsg.fromAmino = function (data, _) {
var _a = data.value, uid = _a.uid, onTable = _a.onTable, toUID = _a.toUID, role = _a.role, onDatabase = _a.onDatabase;
return new SqlGrantMsg(uid, onTable, toUID, role, onDatabase);
};
SqlGrantMsg.prototype.toAmino = function (_) {
var _a = this, uid = _a.uid, onTable = _a.onTable, toUID = _a.toUID, role = _a.role, onDatabase = _a.onDatabase;
return {
type: 'sql/SqlGrantMsg',
value: {
uid: uid,
onTable: onTable,
toUID: toUID,
role: role,
onDatabase: onDatabase,
},
};
};
SqlGrantMsg.fromProto = function (proto, _) {
return new SqlGrantMsg(proto.uid, proto.onTable, proto.toUID, proto.role, proto.onDatabase);
};
SqlGrantMsg.prototype.toProto = function (_) {
var _a = this, uid = _a.uid, onTable = _a.onTable, toUID = _a.toUID, role = _a.role, onDatabase = _a.onDatabase;
return tx_1.SQLGrantRequest.fromPartial({
uid: uid,
onTable: onTable,
toUID: toUID,
role: role,
onDatabase: onDatabase,
});
};
SqlGrantMsg.prototype.packAny = function (isClassic) {
return any_1.Any.fromPartial({
typeUrl: '/blockved.glitterchain.index.SQLGrantRequest',
value: tx_1.SQLGrantRequest.encode(this.toProto(isClassic)).finish(),
});
};
SqlGrantMsg.unpackAny = function (msgAny, isClassic) {
return SqlGrantMsg.fromProto(tx_1.SQLGrantRequest.decode(msgAny.value), isClassic);
};
SqlGrantMsg.fromData = function (data, _) {
var uid = data.uid, onTable = data.onTable, toUID = data.toUID, role = data.role, onDatabase = data.onDatabase;
return new SqlGrantMsg(uid, onTable, toUID, role, onDatabase);
};
SqlGrantMsg.prototype.toData = function (_) {
var _a = this, uid = _a.uid, onTable = _a.onTable, toUID = _a.toUID, role = _a.role, onDatabase = _a.onDatabase;
return {
'@type': '/blockved.glitterchain.index.SQLGrantRequest',
uid: uid,
onTable: onTable,
toUID: toUID,
role: role,
onDatabase: onDatabase,
};
};
return SqlGrantMsg;
}(json_1.JSONSerializable));
exports.SqlGrantMsg = SqlGrantMsg;
//# sourceMappingURL=SqlGrantMsg.js.map