@initia/initia.js 0.0.30 → 0.0.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundle.js +1 -1
- package/dist/bundle.js.map +1 -1
- package/dist/bundle.node.js +1 -1
- package/dist/bundle.node.js.LICENSE.txt +2 -0
- package/dist/bundle.node.js.map +1 -1
- package/dist/client/lcd/LCDClient.d.ts +2 -2
- package/dist/client/lcd/LCDClient.js +1 -1
- package/dist/client/lcd/LCDClient.js.map +1 -1
- package/dist/client/lcd/LCDUtils.d.ts +1 -1
- package/dist/client/lcd/LCDUtils.js +1 -1
- package/dist/client/lcd/LCDUtils.js.map +1 -1
- package/dist/client/lcd/api/MoveAPI.d.ts +2 -0
- package/dist/client/lcd/api/MoveAPI.js +2 -0
- package/dist/client/lcd/api/MoveAPI.js.map +1 -1
- package/dist/client/lcd/api/MstakingAPI.d.ts +97 -0
- package/dist/client/lcd/api/MstakingAPI.js +294 -0
- package/dist/client/lcd/api/MstakingAPI.js.map +1 -0
- package/dist/client/lcd/api/index.d.ts +1 -1
- package/dist/client/lcd/api/index.js +1 -1
- package/dist/client/lcd/api/index.js.map +1 -1
- package/dist/core/Msg.d.ts +5 -5
- package/dist/core/Msg.js +9 -9
- package/dist/core/Msg.js.map +1 -1
- package/dist/core/Tx.d.ts +1 -1
- package/dist/core/gov/Proposal.d.ts +5 -5
- package/dist/core/gov/Proposal.js +6 -12
- package/dist/core/gov/Proposal.js.map +1 -1
- package/dist/core/index.d.ts +5 -5
- package/dist/core/index.js +6 -6
- package/dist/core/index.js.map +1 -1
- package/dist/core/move/msgs/MsgExecute.d.ts +1 -1
- package/dist/core/move/msgs/MsgExecute.js +1 -1
- package/dist/core/move/msgs/MsgPublish.d.ts +8 -3
- package/dist/core/move/msgs/MsgPublish.js +16 -11
- package/dist/core/move/msgs/MsgPublish.js.map +1 -1
- package/dist/core/move/msgs/MsgScript.d.ts +2 -2
- package/dist/core/move/msgs/MsgScript.js +2 -2
- package/dist/core/move/proposals/ExecuteOperation.d.ts +51 -0
- package/dist/core/move/proposals/ExecuteOperation.js +100 -0
- package/dist/core/move/proposals/ExecuteOperation.js.map +1 -0
- package/dist/core/move/proposals/OperationsProposal.d.ts +57 -0
- package/dist/core/move/proposals/OperationsProposal.js +127 -0
- package/dist/core/move/proposals/OperationsProposal.js.map +1 -0
- package/dist/core/move/proposals/PublishOperation.d.ts +34 -0
- package/dist/core/move/proposals/PublishOperation.js +76 -0
- package/dist/core/move/proposals/PublishOperation.js.map +1 -0
- package/dist/core/move/proposals/index.d.ts +3 -2
- package/dist/core/move/proposals/index.js +3 -2
- package/dist/core/move/proposals/index.js.map +1 -1
- package/dist/core/mstaking/Delegation.d.ts +45 -0
- package/dist/core/mstaking/Delegation.js +89 -0
- package/dist/core/mstaking/Delegation.js.map +1 -0
- package/dist/core/mstaking/Redelegation.d.ts +97 -0
- package/dist/core/mstaking/Redelegation.js +174 -0
- package/dist/core/mstaking/Redelegation.js.map +1 -0
- package/dist/core/mstaking/UnbondingDelegation.d.ts +75 -0
- package/dist/core/mstaking/UnbondingDelegation.js +143 -0
- package/dist/core/mstaking/UnbondingDelegation.js.map +1 -0
- package/dist/core/mstaking/Validator.d.ts +173 -0
- package/dist/core/mstaking/Validator.js +287 -0
- package/dist/core/mstaking/Validator.js.map +1 -0
- package/dist/core/mstaking/msgs/MsgBeginRedelegate.d.ts +51 -0
- package/dist/core/mstaking/msgs/MsgBeginRedelegate.js +99 -0
- package/dist/core/mstaking/msgs/MsgBeginRedelegate.js.map +1 -0
- package/dist/core/mstaking/msgs/MsgCreateValidator.d.ts +60 -0
- package/dist/core/mstaking/msgs/MsgCreateValidator.js +110 -0
- package/dist/core/mstaking/msgs/MsgCreateValidator.js.map +1 -0
- package/dist/core/mstaking/msgs/MsgDelegate.d.ts +46 -0
- package/dist/core/mstaking/msgs/MsgDelegate.js +93 -0
- package/dist/core/mstaking/msgs/MsgDelegate.js.map +1 -0
- package/dist/core/mstaking/msgs/MsgEditValidator.d.ts +50 -0
- package/dist/core/mstaking/msgs/MsgEditValidator.js +111 -0
- package/dist/core/mstaking/msgs/MsgEditValidator.js.map +1 -0
- package/dist/core/mstaking/msgs/MsgUndelegate.d.ts +46 -0
- package/dist/core/mstaking/msgs/MsgUndelegate.js +93 -0
- package/dist/core/mstaking/msgs/MsgUndelegate.js.map +1 -0
- package/dist/core/mstaking/msgs/index.d.ts +16 -0
- package/dist/core/mstaking/msgs/index.js +22 -0
- package/dist/core/mstaking/msgs/index.js.map +1 -0
- package/dist/core/params/proposals/ParameterChangeProposal.d.ts +1 -5
- package/dist/core/params/proposals/ParameterChangeProposal.js +1 -5
- package/dist/core/params/proposals/ParameterChangeProposal.js.map +1 -1
- package/dist/key/index.d.ts +1 -0
- package/dist/key/index.js +1 -0
- package/dist/key/index.js.map +1 -1
- package/dist/key/ledger/LedgerKey.d.ts +55 -0
- package/dist/key/ledger/LedgerKey.js +377 -0
- package/dist/key/ledger/LedgerKey.js.map +1 -0
- package/dist/key/ledger/app.d.ts +39 -0
- package/dist/key/ledger/app.js +178 -0
- package/dist/key/ledger/app.js.map +1 -0
- package/dist/key/ledger/constants.d.ts +24 -0
- package/dist/key/ledger/constants.js +50 -0
- package/dist/key/ledger/constants.js.map +1 -0
- package/dist/key/ledger/device.d.ts +11 -0
- package/dist/key/ledger/device.js +379 -0
- package/dist/key/ledger/device.js.map +1 -0
- package/dist/key/ledger/index.d.ts +5 -0
- package/dist/key/ledger/index.js +25 -0
- package/dist/key/ledger/index.js.map +1 -0
- package/dist/key/ledger/types.d.ts +44 -0
- package/dist/key/ledger/types.js +3 -0
- package/dist/key/ledger/types.js.map +1 -0
- package/dist/util/bcs.d.ts +1 -1
- package/package.json +9 -2
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
18
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
19
|
+
};
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.Validator = void 0;
|
|
22
|
+
var json_1 = require("../../util/json");
|
|
23
|
+
var Coins_1 = require("../Coins");
|
|
24
|
+
var num_1 = require("../num");
|
|
25
|
+
var PublicKey_1 = require("../PublicKey");
|
|
26
|
+
var staking_1 = require("@initia/initia.proto/initia/mstaking/v1/staking");
|
|
27
|
+
var long_1 = __importDefault(require("long"));
|
|
28
|
+
/**
|
|
29
|
+
* Stores information fetched from the blockchain about the current status of a validator.
|
|
30
|
+
* As an end user, you will not have to create an instance of this class, one will be
|
|
31
|
+
* generated for you to store information about a validator polled from the API functions
|
|
32
|
+
* in [[MstakingAPI]].
|
|
33
|
+
*/
|
|
34
|
+
var Validator = /** @class */ (function (_super) {
|
|
35
|
+
__extends(Validator, _super);
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
* @param operator_address validator's operator address
|
|
39
|
+
* @param consensus_pubkey validator's consensus public key
|
|
40
|
+
* @param jailed whether the current validator is jailed
|
|
41
|
+
* @param status unbonded `0`, unbonding `1`, bonded `2`
|
|
42
|
+
* @param tokens total Initia from all delegations (including self)
|
|
43
|
+
* @param delegator_shares total shares of all delegators
|
|
44
|
+
* @param description validator's delegate description
|
|
45
|
+
* @param unbonding_height if unbonding, height at which this validator began unbonding
|
|
46
|
+
* @param unbonding_time if unbonding, min time for the validator to complete unbonding
|
|
47
|
+
* @param commission validator commission
|
|
48
|
+
* @param min_self_delegation minimum self delegation
|
|
49
|
+
*/
|
|
50
|
+
function Validator(operator_address, consensus_pubkey, jailed, status, tokens, delegator_shares, description, unbonding_height, unbonding_time, commission, voting_powers, voting_power) {
|
|
51
|
+
var _this = _super.call(this) || this;
|
|
52
|
+
_this.operator_address = operator_address;
|
|
53
|
+
_this.consensus_pubkey = consensus_pubkey;
|
|
54
|
+
_this.jailed = jailed;
|
|
55
|
+
_this.status = status;
|
|
56
|
+
_this.description = description;
|
|
57
|
+
_this.unbonding_height = unbonding_height;
|
|
58
|
+
_this.unbonding_time = unbonding_time;
|
|
59
|
+
_this.commission = commission;
|
|
60
|
+
_this.voting_power = voting_power;
|
|
61
|
+
_this.tokens = new Coins_1.Coins(tokens);
|
|
62
|
+
_this.delegator_shares = new Coins_1.Coins(delegator_shares);
|
|
63
|
+
_this.voting_powers = new Coins_1.Coins(voting_powers);
|
|
64
|
+
return _this;
|
|
65
|
+
}
|
|
66
|
+
Validator.prototype.toAmino = function () {
|
|
67
|
+
return {
|
|
68
|
+
operator_address: this.operator_address,
|
|
69
|
+
consensus_pubkey: this.consensus_pubkey.toAmino(),
|
|
70
|
+
jailed: this.jailed,
|
|
71
|
+
status: this.status,
|
|
72
|
+
tokens: this.tokens.toAmino(),
|
|
73
|
+
delegator_shares: this.delegator_shares.toAmino(),
|
|
74
|
+
description: this.description,
|
|
75
|
+
unbonding_height: this.unbonding_height.toFixed(),
|
|
76
|
+
unbonding_time: this.unbonding_time.toISOString(),
|
|
77
|
+
commission: this.commission.toAmino(),
|
|
78
|
+
voting_powers: this.voting_powers.toAmino(),
|
|
79
|
+
voting_power: this.voting_power
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
Validator.fromAmino = function (data) {
|
|
83
|
+
return new Validator(data.operator_address, PublicKey_1.ValConsPublicKey.fromAmino(data.consensus_pubkey), data.jailed || false, data.status || 0, Coins_1.Coins.fromAmino(data.tokens), Coins_1.Coins.fromAmino(data.delegator_shares), Validator.Description.fromAmino(data.description), Number.parseInt(data.unbonding_height), new Date(data.unbonding_time), Validator.Commission.fromAmino(data.commission), Coins_1.Coins.fromAmino(data.voting_powers), data.voting_power);
|
|
84
|
+
};
|
|
85
|
+
Validator.prototype.toData = function () {
|
|
86
|
+
return {
|
|
87
|
+
operator_address: this.operator_address,
|
|
88
|
+
consensus_pubkey: this.consensus_pubkey.toData(),
|
|
89
|
+
jailed: this.jailed,
|
|
90
|
+
status: this.status,
|
|
91
|
+
tokens: this.tokens.toData(),
|
|
92
|
+
delegator_shares: this.delegator_shares.toData(),
|
|
93
|
+
description: this.description,
|
|
94
|
+
unbonding_height: this.unbonding_height.toFixed(),
|
|
95
|
+
unbonding_time: this.unbonding_time.toISOString(),
|
|
96
|
+
commission: this.commission.toData(),
|
|
97
|
+
voting_powers: this.voting_powers.toData(),
|
|
98
|
+
voting_power: this.voting_power,
|
|
99
|
+
};
|
|
100
|
+
};
|
|
101
|
+
Validator.fromData = function (data) {
|
|
102
|
+
return new Validator(data.operator_address, PublicKey_1.ValConsPublicKey.fromData(data.consensus_pubkey), data.jailed || false, data.status || 0, Coins_1.Coins.fromData(data.tokens), Coins_1.Coins.fromData(data.delegator_shares), Validator.Description.fromData(data.description), Number.parseInt(data.unbonding_height), new Date(data.unbonding_time), Validator.Commission.fromData(data.commission), Coins_1.Coins.fromData(data.voting_powers), data.voting_power);
|
|
103
|
+
};
|
|
104
|
+
Validator.prototype.toProto = function () {
|
|
105
|
+
var _a = this, operator_address = _a.operator_address, consensus_pubkey = _a.consensus_pubkey, jailed = _a.jailed, status = _a.status, tokens = _a.tokens, delegator_shares = _a.delegator_shares, description = _a.description, unbonding_height = _a.unbonding_height, unbonding_time = _a.unbonding_time, commission = _a.commission, voting_powers = _a.voting_powers, voting_power = _a.voting_power;
|
|
106
|
+
return staking_1.Validator.fromPartial({
|
|
107
|
+
operatorAddress: operator_address,
|
|
108
|
+
consensusPubkey: consensus_pubkey.packAny(),
|
|
109
|
+
jailed: jailed,
|
|
110
|
+
status: status,
|
|
111
|
+
tokens: tokens.toProto(),
|
|
112
|
+
delegatorShares: delegator_shares.toProto(),
|
|
113
|
+
description: description.toProto(),
|
|
114
|
+
unbondingHeight: long_1.default.fromNumber(unbonding_height),
|
|
115
|
+
unbondingTime: unbonding_time,
|
|
116
|
+
commission: commission.toProto(),
|
|
117
|
+
votingPowers: voting_powers.toProto(),
|
|
118
|
+
votingPower: voting_power,
|
|
119
|
+
});
|
|
120
|
+
};
|
|
121
|
+
Validator.fromProto = function (data) {
|
|
122
|
+
return new Validator(data.operatorAddress, PublicKey_1.ValConsPublicKey.unpackAny(data.consensusPubkey), data.jailed, data.status, Coins_1.Coins.fromProto(data.tokens), Coins_1.Coins.fromProto(data.delegatorShares), Validator.Description.fromProto(data.description), data.unbondingHeight.toNumber(), data.unbondingTime, Validator.Commission.fromProto(data.commission), Coins_1.Coins.fromProto(data.votingPowers), data.votingPower);
|
|
123
|
+
};
|
|
124
|
+
return Validator;
|
|
125
|
+
}(json_1.JSONSerializable));
|
|
126
|
+
exports.Validator = Validator;
|
|
127
|
+
(function (Validator) {
|
|
128
|
+
Validator.Status = staking_1.BondStatus;
|
|
129
|
+
var Description = /** @class */ (function (_super) {
|
|
130
|
+
__extends(Description, _super);
|
|
131
|
+
/**
|
|
132
|
+
* @param moniker Identifying name, e.g. "Hashed"
|
|
133
|
+
* @param identity time at which commission was last updated
|
|
134
|
+
* @param website validator's website
|
|
135
|
+
* @param details long description
|
|
136
|
+
* @param security_contact validator's contact
|
|
137
|
+
*/
|
|
138
|
+
function Description(moniker, identity, website, details, security_contact) {
|
|
139
|
+
var _this = _super.call(this) || this;
|
|
140
|
+
_this.moniker = moniker;
|
|
141
|
+
_this.identity = identity;
|
|
142
|
+
_this.website = website;
|
|
143
|
+
_this.details = details;
|
|
144
|
+
_this.security_contact = security_contact;
|
|
145
|
+
return _this;
|
|
146
|
+
}
|
|
147
|
+
Description.prototype.toAmino = function () {
|
|
148
|
+
return {
|
|
149
|
+
moniker: this.moniker,
|
|
150
|
+
identity: this.identity,
|
|
151
|
+
website: this.website,
|
|
152
|
+
details: this.details,
|
|
153
|
+
security_contact: this.security_contact,
|
|
154
|
+
};
|
|
155
|
+
};
|
|
156
|
+
Description.fromAmino = function (data) {
|
|
157
|
+
return new Description(data.moniker, data.identity || '', data.website || '', data.details || '', data.security_contact || '');
|
|
158
|
+
};
|
|
159
|
+
Description.prototype.toData = function () {
|
|
160
|
+
return {
|
|
161
|
+
moniker: this.moniker,
|
|
162
|
+
identity: this.identity,
|
|
163
|
+
website: this.website,
|
|
164
|
+
details: this.details,
|
|
165
|
+
security_contact: this.security_contact,
|
|
166
|
+
};
|
|
167
|
+
};
|
|
168
|
+
Description.fromData = function (data) {
|
|
169
|
+
return new Description(data.moniker, data.identity || '', data.website || '', data.details || '', data.security_contact || '');
|
|
170
|
+
};
|
|
171
|
+
Description.prototype.toProto = function () {
|
|
172
|
+
var _a = this, moniker = _a.moniker, identity = _a.identity, website = _a.website, details = _a.details, security_contact = _a.security_contact;
|
|
173
|
+
return staking_1.Description.fromPartial({
|
|
174
|
+
details: details,
|
|
175
|
+
identity: identity,
|
|
176
|
+
moniker: moniker,
|
|
177
|
+
securityContact: security_contact,
|
|
178
|
+
website: website,
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
Description.fromProto = function (proto) {
|
|
182
|
+
return new Description(proto.moniker, proto.identity, proto.website, proto.details, proto.securityContact);
|
|
183
|
+
};
|
|
184
|
+
return Description;
|
|
185
|
+
}(json_1.JSONSerializable));
|
|
186
|
+
Validator.Description = Description;
|
|
187
|
+
var CommissionRates = /** @class */ (function (_super) {
|
|
188
|
+
__extends(CommissionRates, _super);
|
|
189
|
+
/**
|
|
190
|
+
* @param rate current commission rate
|
|
191
|
+
* @param max_rate max commission rate
|
|
192
|
+
* @param max_change_rate max percentage commission can change in 24hrs
|
|
193
|
+
*/
|
|
194
|
+
function CommissionRates(rate, max_rate, max_change_rate) {
|
|
195
|
+
var _this = _super.call(this) || this;
|
|
196
|
+
_this.rate = rate;
|
|
197
|
+
_this.max_rate = max_rate;
|
|
198
|
+
_this.max_change_rate = max_change_rate;
|
|
199
|
+
_this.rate = (0, num_1.num)(rate).toString();
|
|
200
|
+
_this.max_rate = (0, num_1.num)(max_rate).toString();
|
|
201
|
+
_this.max_change_rate = (0, num_1.num)(max_change_rate).toString();
|
|
202
|
+
return _this;
|
|
203
|
+
}
|
|
204
|
+
CommissionRates.fromAmino = function (data) {
|
|
205
|
+
var rate = data.rate, max_rate = data.max_rate, max_change_rate = data.max_change_rate;
|
|
206
|
+
return new CommissionRates(rate, max_rate, max_change_rate);
|
|
207
|
+
};
|
|
208
|
+
CommissionRates.prototype.toAmino = function () {
|
|
209
|
+
var _a = this, rate = _a.rate, max_rate = _a.max_rate, max_change_rate = _a.max_change_rate;
|
|
210
|
+
return {
|
|
211
|
+
rate: (0, num_1.num)(rate).toFixed(18),
|
|
212
|
+
max_rate: (0, num_1.num)(max_rate).toFixed(18),
|
|
213
|
+
max_change_rate: (0, num_1.num)(max_change_rate).toFixed(18),
|
|
214
|
+
};
|
|
215
|
+
};
|
|
216
|
+
CommissionRates.fromData = function (data) {
|
|
217
|
+
var rate = data.rate, max_rate = data.max_rate, max_change_rate = data.max_change_rate;
|
|
218
|
+
return new CommissionRates(rate, max_rate, max_change_rate);
|
|
219
|
+
};
|
|
220
|
+
CommissionRates.prototype.toData = function () {
|
|
221
|
+
var _a = this, rate = _a.rate, max_rate = _a.max_rate, max_change_rate = _a.max_change_rate;
|
|
222
|
+
return {
|
|
223
|
+
rate: (0, num_1.num)(rate).toFixed(18),
|
|
224
|
+
max_rate: (0, num_1.num)(max_rate).toFixed(18),
|
|
225
|
+
max_change_rate: (0, num_1.num)(max_change_rate).toFixed(18),
|
|
226
|
+
};
|
|
227
|
+
};
|
|
228
|
+
CommissionRates.fromProto = function (proto) {
|
|
229
|
+
return new CommissionRates(proto.rate, proto.maxRate, proto.maxChangeRate);
|
|
230
|
+
};
|
|
231
|
+
CommissionRates.prototype.toProto = function () {
|
|
232
|
+
var _a = this, rate = _a.rate, max_rate = _a.max_rate, max_change_rate = _a.max_change_rate;
|
|
233
|
+
return staking_1.CommissionRates.fromPartial({
|
|
234
|
+
maxChangeRate: (0, num_1.num)(max_change_rate).toFixed(18),
|
|
235
|
+
maxRate: (0, num_1.num)(max_rate).toFixed(18),
|
|
236
|
+
rate: (0, num_1.num)(rate).toFixed(18),
|
|
237
|
+
});
|
|
238
|
+
};
|
|
239
|
+
return CommissionRates;
|
|
240
|
+
}(json_1.JSONSerializable));
|
|
241
|
+
Validator.CommissionRates = CommissionRates;
|
|
242
|
+
var Commission = /** @class */ (function (_super) {
|
|
243
|
+
__extends(Commission, _super);
|
|
244
|
+
/**
|
|
245
|
+
* @param commission_rates commission rates
|
|
246
|
+
* @param update_time time at which commission was last updated
|
|
247
|
+
*/
|
|
248
|
+
function Commission(commission_rates, update_time) {
|
|
249
|
+
var _this = _super.call(this) || this;
|
|
250
|
+
_this.commission_rates = commission_rates;
|
|
251
|
+
_this.update_time = update_time;
|
|
252
|
+
return _this;
|
|
253
|
+
}
|
|
254
|
+
Commission.prototype.toAmino = function () {
|
|
255
|
+
return {
|
|
256
|
+
commission_rates: this.commission_rates.toAmino(),
|
|
257
|
+
update_time: this.update_time.toISOString(),
|
|
258
|
+
};
|
|
259
|
+
};
|
|
260
|
+
Commission.fromAmino = function (data) {
|
|
261
|
+
return new Commission(CommissionRates.fromAmino(data.commission_rates), new Date(data.update_time));
|
|
262
|
+
};
|
|
263
|
+
Commission.prototype.toData = function () {
|
|
264
|
+
return {
|
|
265
|
+
commission_rates: this.commission_rates.toData(),
|
|
266
|
+
update_time: this.update_time.toISOString(),
|
|
267
|
+
};
|
|
268
|
+
};
|
|
269
|
+
Commission.fromData = function (data) {
|
|
270
|
+
return new Commission(CommissionRates.fromData(data.commission_rates), new Date(data.update_time));
|
|
271
|
+
};
|
|
272
|
+
Commission.prototype.toProto = function () {
|
|
273
|
+
var _a = this, commission_rates = _a.commission_rates, update_time = _a.update_time;
|
|
274
|
+
return staking_1.Commission.fromPartial({
|
|
275
|
+
commissionRates: commission_rates.toProto(),
|
|
276
|
+
updateTime: update_time,
|
|
277
|
+
});
|
|
278
|
+
};
|
|
279
|
+
Commission.fromProto = function (proto) {
|
|
280
|
+
return new Commission(CommissionRates.fromProto(proto.commissionRates), proto.updateTime);
|
|
281
|
+
};
|
|
282
|
+
return Commission;
|
|
283
|
+
}(json_1.JSONSerializable));
|
|
284
|
+
Validator.Commission = Commission;
|
|
285
|
+
})(Validator = exports.Validator || (exports.Validator = {}));
|
|
286
|
+
exports.Validator = Validator;
|
|
287
|
+
//# sourceMappingURL=Validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Validator.js","sourceRoot":"","sources":["../../../src/core/mstaking/Validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,wCAAmD;AACnD,kCAAiC;AACjC,8BAA6B;AAE7B,0CAAgD;AAChD,2EAMyD;AACzD,8CAAwB;AAGxB;;;;;GAKG;AACH;IAA+B,6BAI9B;IAKC;;;;;;;;;;;;;OAaG;IACH,mBACS,gBAA4B,EAC5B,gBAAkC,EAClC,MAAe,EACf,MAAkB,EACzB,MAAmB,EACnB,gBAA6B,EACtB,WAAkC,EAClC,gBAAwB,EACxB,cAAoB,EACpB,UAAgC,EACvC,aAA0B,EACnB,YAAoB;QAZ7B,YAcE,iBAAO,SAIR;QAjBQ,sBAAgB,GAAhB,gBAAgB,CAAY;QAC5B,sBAAgB,GAAhB,gBAAgB,CAAkB;QAClC,YAAM,GAAN,MAAM,CAAS;QACf,YAAM,GAAN,M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AAgB,CAAC,OAAO,EAAE;gBAC3C,UAAU,EAAE,WAAW;aACxB,CAAC,CAAC;QACL,CAAC;QAEa,oBAAS,GAAvB,UAAwB,KAAuB;YAC7C,OAAO,IAAI,UAAU,CACnB,eAAe,CAAC,SAAS,CACvB,KAAK,CAAC,eAAwC,CAC/C,EACD,KAAK,CAAC,UAAkB,CACzB,CAAC;QACJ,CAAC;QACH,iBAAC;IAAD,CAAC,AA5DD,CAAgC,uBAAgB,GA4D/C;IA5DY,oBAAU,aA4DtB,CAAA;AAeH,CAAC,EA1SgB,SAAS,GAAT,iBAAS,KAAT,iBAAS,QA0SzB;AA9cY,8BAAS"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { JSONSerializable } from '../../../util/json';
|
|
2
|
+
import { Coins } from '../../Coins';
|
|
3
|
+
import { AccAddress, ValAddress } from '../../bech32';
|
|
4
|
+
import { Any } from '@initia/initia.proto/google/protobuf/any';
|
|
5
|
+
import { MsgBeginRedelegate as MsgBeginRedelegate_pb } from '@initia/initia.proto/initia/mstaking/v1/tx';
|
|
6
|
+
/**
|
|
7
|
+
* A delegator can choose to redelegate their bonded Initia and transfer a delegation
|
|
8
|
+
* amount from one validator to another. Unlike undelegating, redelegations do not incur
|
|
9
|
+
* a 21-day unbonding period and happen immediately.
|
|
10
|
+
*/
|
|
11
|
+
export declare class MsgBeginRedelegate extends JSONSerializable<MsgBeginRedelegate.Amino, MsgBeginRedelegate.Data, MsgBeginRedelegate.Proto> {
|
|
12
|
+
delegator_address: AccAddress;
|
|
13
|
+
validator_src_address: ValAddress;
|
|
14
|
+
validator_dst_address: ValAddress;
|
|
15
|
+
amount: Coins;
|
|
16
|
+
/**
|
|
17
|
+
*
|
|
18
|
+
* @param delegator_address delegator's account address
|
|
19
|
+
* @param validator_src_address validator to undelegate from
|
|
20
|
+
* @param validator_dst_address validator to delegate to
|
|
21
|
+
* @param amount INIT to be redelegated
|
|
22
|
+
*/
|
|
23
|
+
constructor(delegator_address: AccAddress, validator_src_address: ValAddress, validator_dst_address: ValAddress, amount: Coins.Input);
|
|
24
|
+
static fromAmino(data: MsgBeginRedelegate.Amino): MsgBeginRedelegate;
|
|
25
|
+
toAmino(): MsgBeginRedelegate.Amino;
|
|
26
|
+
static fromData(data: MsgBeginRedelegate.Data): MsgBeginRedelegate;
|
|
27
|
+
toData(): MsgBeginRedelegate.Data;
|
|
28
|
+
static fromProto(proto: MsgBeginRedelegate.Proto): MsgBeginRedelegate;
|
|
29
|
+
toProto(): MsgBeginRedelegate.Proto;
|
|
30
|
+
packAny(): Any;
|
|
31
|
+
static unpackAny(msgAny: Any): MsgBeginRedelegate;
|
|
32
|
+
}
|
|
33
|
+
export declare namespace MsgBeginRedelegate {
|
|
34
|
+
interface Amino {
|
|
35
|
+
type: 'mstaking/MsgBeginRedelegate';
|
|
36
|
+
value: {
|
|
37
|
+
delegator_address: AccAddress;
|
|
38
|
+
validator_src_address: ValAddress;
|
|
39
|
+
validator_dst_address: ValAddress;
|
|
40
|
+
amount: Coins.Amino;
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
interface Data {
|
|
44
|
+
'@type': '/initia.mstaking.v1.MsgBeginRedelegate';
|
|
45
|
+
delegator_address: AccAddress;
|
|
46
|
+
validator_src_address: ValAddress;
|
|
47
|
+
validator_dst_address: ValAddress;
|
|
48
|
+
amount: Coins.Data;
|
|
49
|
+
}
|
|
50
|
+
type Proto = MsgBeginRedelegate_pb;
|
|
51
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.MsgBeginRedelegate = void 0;
|
|
19
|
+
var json_1 = require("../../../util/json");
|
|
20
|
+
var Coins_1 = require("../../Coins");
|
|
21
|
+
var any_1 = require("@initia/initia.proto/google/protobuf/any");
|
|
22
|
+
var tx_1 = require("@initia/initia.proto/initia/mstaking/v1/tx");
|
|
23
|
+
/**
|
|
24
|
+
* A delegator can choose to redelegate their bonded Initia and transfer a delegation
|
|
25
|
+
* amount from one validator to another. Unlike undelegating, redelegations do not incur
|
|
26
|
+
* a 21-day unbonding period and happen immediately.
|
|
27
|
+
*/
|
|
28
|
+
var MsgBeginRedelegate = /** @class */ (function (_super) {
|
|
29
|
+
__extends(MsgBeginRedelegate, _super);
|
|
30
|
+
/**
|
|
31
|
+
*
|
|
32
|
+
* @param delegator_address delegator's account address
|
|
33
|
+
* @param validator_src_address validator to undelegate from
|
|
34
|
+
* @param validator_dst_address validator to delegate to
|
|
35
|
+
* @param amount INIT to be redelegated
|
|
36
|
+
*/
|
|
37
|
+
function MsgBeginRedelegate(delegator_address, validator_src_address, validator_dst_address, amount) {
|
|
38
|
+
var _this = _super.call(this) || this;
|
|
39
|
+
_this.delegator_address = delegator_address;
|
|
40
|
+
_this.validator_src_address = validator_src_address;
|
|
41
|
+
_this.validator_dst_address = validator_dst_address;
|
|
42
|
+
_this.amount = new Coins_1.Coins(amount);
|
|
43
|
+
return _this;
|
|
44
|
+
}
|
|
45
|
+
MsgBeginRedelegate.fromAmino = function (data) {
|
|
46
|
+
var _a = data.value, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, amount = _a.amount;
|
|
47
|
+
return new MsgBeginRedelegate(delegator_address, validator_src_address, validator_dst_address, Coins_1.Coins.fromAmino(amount));
|
|
48
|
+
};
|
|
49
|
+
MsgBeginRedelegate.prototype.toAmino = function () {
|
|
50
|
+
var _a = this, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, amount = _a.amount;
|
|
51
|
+
return {
|
|
52
|
+
type: 'mstaking/MsgBeginRedelegate',
|
|
53
|
+
value: {
|
|
54
|
+
delegator_address: delegator_address,
|
|
55
|
+
validator_src_address: validator_src_address,
|
|
56
|
+
validator_dst_address: validator_dst_address,
|
|
57
|
+
amount: amount.toAmino(),
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
};
|
|
61
|
+
MsgBeginRedelegate.fromData = function (data) {
|
|
62
|
+
var delegator_address = data.delegator_address, validator_src_address = data.validator_src_address, validator_dst_address = data.validator_dst_address, amount = data.amount;
|
|
63
|
+
return new MsgBeginRedelegate(delegator_address, validator_src_address, validator_dst_address, Coins_1.Coins.fromData(amount));
|
|
64
|
+
};
|
|
65
|
+
MsgBeginRedelegate.prototype.toData = function () {
|
|
66
|
+
var _a = this, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, amount = _a.amount;
|
|
67
|
+
return {
|
|
68
|
+
'@type': '/initia.mstaking.v1.MsgBeginRedelegate',
|
|
69
|
+
delegator_address: delegator_address,
|
|
70
|
+
validator_src_address: validator_src_address,
|
|
71
|
+
validator_dst_address: validator_dst_address,
|
|
72
|
+
amount: amount.toData(),
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
MsgBeginRedelegate.fromProto = function (proto) {
|
|
76
|
+
return new MsgBeginRedelegate(proto.delegatorAddress, proto.validatorSrcAddress, proto.validatorDstAddress, Coins_1.Coins.fromProto(proto.amount));
|
|
77
|
+
};
|
|
78
|
+
MsgBeginRedelegate.prototype.toProto = function () {
|
|
79
|
+
var _a = this, delegator_address = _a.delegator_address, validator_src_address = _a.validator_src_address, validator_dst_address = _a.validator_dst_address, amount = _a.amount;
|
|
80
|
+
return tx_1.MsgBeginRedelegate.fromPartial({
|
|
81
|
+
amount: amount.toProto(),
|
|
82
|
+
delegatorAddress: delegator_address,
|
|
83
|
+
validatorDstAddress: validator_dst_address,
|
|
84
|
+
validatorSrcAddress: validator_src_address,
|
|
85
|
+
});
|
|
86
|
+
};
|
|
87
|
+
MsgBeginRedelegate.prototype.packAny = function () {
|
|
88
|
+
return any_1.Any.fromPartial({
|
|
89
|
+
typeUrl: '/initia.mstaking.v1.MsgBeginRedelegate',
|
|
90
|
+
value: tx_1.MsgBeginRedelegate.encode(this.toProto()).finish(),
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
MsgBeginRedelegate.unpackAny = function (msgAny) {
|
|
94
|
+
return MsgBeginRedelegate.fromProto(tx_1.MsgBeginRedelegate.decode(msgAny.value));
|
|
95
|
+
};
|
|
96
|
+
return MsgBeginRedelegate;
|
|
97
|
+
}(json_1.JSONSerializable));
|
|
98
|
+
exports.MsgBeginRedelegate = MsgBeginRedelegate;
|
|
99
|
+
//# sourceMappingURL=MsgBeginRedelegate.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MsgBeginRedelegate.js","sourceRoot":"","sources":["../../../../src/core/mstaking/msgs/MsgBeginRedelegate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAsD;AACtD,qCAAoC;AAEpC,gEAA+D;AAC/D,iEAAyG;AAEzG;;;;GAIG;AACH;IAAwC,sCAIvC;IAGC;;;;;;OAMG;IACH,4BACS,iBAA6B,EAC7B,qBAAiC,EACjC,qBAAiC,EACxC,MAAmB;QAJrB,YAME,iBAAO,SAER;QAPQ,uBAAiB,GAAjB,iBAAiB,CAAY;QAC7B,2BAAqB,GAArB,qBAAqB,CAA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A;YACjB,qBAAqB,uBAAA;YACrB,qBAAqB,uBAAA;YACrB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;SACxB,CAAC;IACJ,CAAC;IAEa,4BAAS,GAAvB,UAAwB,KAA+B;QACrD,OAAO,IAAI,kBAAkB,CAC3B,KAAK,CAAC,gBAAgB,EACtB,KAAK,CAAC,mBAAmB,EACzB,KAAK,CAAC,mBAAmB,EACzB,aAAK,CAAC,SAAS,CAAC,KAAK,CAAC,MAAqB,CAAC,CAC7C,CAAC;IACJ,CAAC;IAEM,oCAAO,GAAd;QACQ,IAAA,KAKF,IAAI,EAJN,iBAAiB,uBAAA,EACjB,qBAAqB,2BAAA,EACrB,qBAAqB,2BAAA,EACrB,MAAM,YACA,CAAC;QACT,OAAO,uBAAqB,CAAC,WAAW,CAAC;YACvC,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE;YACxB,gBAAgB,EAAE,iBAAiB;YACnC,mBAAmB,EAAE,qBAAqB;YAC1C,mBAAmB,EAAE,qBAAqB;SAC3C,CAAC,CAAC;IACL,CAAC;IAEM,oCAAO,GAAd;QACE,OAAO,SAAG,CAAC,WAAW,CAAC;YACrB,OAAO,EAAE,wCAAwC;YACjD,KAAK,EAAE,uBAAqB,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;SAC7D,CAAC,CAAC;IACL,CAAC;IAEa,4BAAS,GAAvB,UAAwB,MAAW;QACjC,OAAO,kBAAkB,CAAC,SAAS,CACjC,uBAAqB,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAC3C,CAAC;IACJ,CAAC;IACH,yBAAC;AAAD,CAAC,AA9HD,CAAwC,uBAAgB,GA8HvD;AA9HY,gDAAkB"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { JSONSerializable } from '../../../util/json';
|
|
2
|
+
import { Coins } from '../../Coins';
|
|
3
|
+
import { AccAddress, ValAddress } from '../../bech32';
|
|
4
|
+
import { Validator } from '../Validator';
|
|
5
|
+
import { Any } from '@initia/initia.proto/google/protobuf/any';
|
|
6
|
+
import { MsgCreateValidator as MsgCreateValidator_pb } from '@initia/initia.proto/initia/mstaking/v1/tx';
|
|
7
|
+
import { ValConsPublicKey } from '../../PublicKey';
|
|
8
|
+
/**
|
|
9
|
+
* For new validators, this message registers a validator address to be a delegate on
|
|
10
|
+
* the blockchain.
|
|
11
|
+
*/
|
|
12
|
+
export declare class MsgCreateValidator extends JSONSerializable<MsgCreateValidator.Amino, MsgCreateValidator.Data, MsgCreateValidator.Proto> {
|
|
13
|
+
description: Validator.Description;
|
|
14
|
+
commission: Validator.CommissionRates;
|
|
15
|
+
delegator_address: AccAddress;
|
|
16
|
+
validator_address: ValAddress;
|
|
17
|
+
pubkey: ValConsPublicKey;
|
|
18
|
+
amount: Coins;
|
|
19
|
+
/**
|
|
20
|
+
*
|
|
21
|
+
* @param description validator's delegate information
|
|
22
|
+
* @param commission validator's commission policy
|
|
23
|
+
* @param delegator_address validator's account address
|
|
24
|
+
* @param validator_address validator's operator address
|
|
25
|
+
* @param pubkey validator's consensus public key
|
|
26
|
+
* @param amount amount to use for self-delegation
|
|
27
|
+
*/
|
|
28
|
+
constructor(description: Validator.Description, commission: Validator.CommissionRates, delegator_address: AccAddress, validator_address: ValAddress, pubkey: ValConsPublicKey, amount: Coins.Input);
|
|
29
|
+
static fromAmino(data: MsgCreateValidator.Amino): MsgCreateValidator;
|
|
30
|
+
toAmino(): MsgCreateValidator.Amino;
|
|
31
|
+
static fromData(data: MsgCreateValidator.Data): MsgCreateValidator;
|
|
32
|
+
toData(): MsgCreateValidator.Data;
|
|
33
|
+
static fromProto(proto: MsgCreateValidator.Proto): MsgCreateValidator;
|
|
34
|
+
toProto(): MsgCreateValidator.Proto;
|
|
35
|
+
packAny(): Any;
|
|
36
|
+
static unpackAny(msgAny: Any): MsgCreateValidator;
|
|
37
|
+
}
|
|
38
|
+
export declare namespace MsgCreateValidator {
|
|
39
|
+
interface Amino {
|
|
40
|
+
type: 'mstaking/MsgCreateValidator';
|
|
41
|
+
value: {
|
|
42
|
+
description: Validator.Description;
|
|
43
|
+
commission: Validator.CommissionRates.Amino;
|
|
44
|
+
delegator_address: AccAddress;
|
|
45
|
+
validator_address: ValAddress;
|
|
46
|
+
pubkey: ValConsPublicKey.Amino;
|
|
47
|
+
amount: Coins.Amino;
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
interface Data {
|
|
51
|
+
'@type': '/initia.mstaking.v1.MsgCreateValidator';
|
|
52
|
+
description: Validator.Description;
|
|
53
|
+
commission: Validator.CommissionRates.Data;
|
|
54
|
+
delegator_address: AccAddress;
|
|
55
|
+
validator_address: ValAddress;
|
|
56
|
+
pubkey: ValConsPublicKey.Data;
|
|
57
|
+
amount: Coins.Data;
|
|
58
|
+
}
|
|
59
|
+
type Proto = MsgCreateValidator_pb;
|
|
60
|
+
}
|
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.MsgCreateValidator = void 0;
|
|
19
|
+
var json_1 = require("../../../util/json");
|
|
20
|
+
var Coins_1 = require("../../Coins");
|
|
21
|
+
var Validator_1 = require("../Validator");
|
|
22
|
+
var any_1 = require("@initia/initia.proto/google/protobuf/any");
|
|
23
|
+
var tx_1 = require("@initia/initia.proto/initia/mstaking/v1/tx");
|
|
24
|
+
var PublicKey_1 = require("../../PublicKey");
|
|
25
|
+
/**
|
|
26
|
+
* For new validators, this message registers a validator address to be a delegate on
|
|
27
|
+
* the blockchain.
|
|
28
|
+
*/
|
|
29
|
+
var MsgCreateValidator = /** @class */ (function (_super) {
|
|
30
|
+
__extends(MsgCreateValidator, _super);
|
|
31
|
+
/**
|
|
32
|
+
*
|
|
33
|
+
* @param description validator's delegate information
|
|
34
|
+
* @param commission validator's commission policy
|
|
35
|
+
* @param delegator_address validator's account address
|
|
36
|
+
* @param validator_address validator's operator address
|
|
37
|
+
* @param pubkey validator's consensus public key
|
|
38
|
+
* @param amount amount to use for self-delegation
|
|
39
|
+
*/
|
|
40
|
+
function MsgCreateValidator(description, commission, delegator_address, validator_address, pubkey, amount) {
|
|
41
|
+
var _this = _super.call(this) || this;
|
|
42
|
+
_this.description = description;
|
|
43
|
+
_this.commission = commission;
|
|
44
|
+
_this.delegator_address = delegator_address;
|
|
45
|
+
_this.validator_address = validator_address;
|
|
46
|
+
_this.pubkey = pubkey;
|
|
47
|
+
_this.amount = new Coins_1.Coins(amount);
|
|
48
|
+
return _this;
|
|
49
|
+
}
|
|
50
|
+
MsgCreateValidator.fromAmino = function (data) {
|
|
51
|
+
var _a = data.value, description = _a.description, commission = _a.commission, delegator_address = _a.delegator_address, validator_address = _a.validator_address, pubkey = _a.pubkey, amount = _a.amount;
|
|
52
|
+
return new MsgCreateValidator(description, Validator_1.Validator.CommissionRates.fromAmino(commission), delegator_address, validator_address, PublicKey_1.ValConsPublicKey.fromAmino(pubkey), Coins_1.Coins.fromAmino(amount));
|
|
53
|
+
};
|
|
54
|
+
MsgCreateValidator.prototype.toAmino = function () {
|
|
55
|
+
var _a = this, description = _a.description, commission = _a.commission, delegator_address = _a.delegator_address, validator_address = _a.validator_address, pubkey = _a.pubkey, amount = _a.amount;
|
|
56
|
+
return {
|
|
57
|
+
type: 'mstaking/MsgCreateValidator',
|
|
58
|
+
value: {
|
|
59
|
+
description: description,
|
|
60
|
+
commission: commission.toAmino(),
|
|
61
|
+
delegator_address: delegator_address,
|
|
62
|
+
validator_address: validator_address,
|
|
63
|
+
pubkey: pubkey.toAmino(),
|
|
64
|
+
amount: amount.toAmino(),
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
};
|
|
68
|
+
MsgCreateValidator.fromData = function (data) {
|
|
69
|
+
var description = data.description, commission = data.commission, delegator_address = data.delegator_address, validator_address = data.validator_address, pubkey = data.pubkey, amount = data.amount;
|
|
70
|
+
return new MsgCreateValidator(description, Validator_1.Validator.CommissionRates.fromData(commission), delegator_address, validator_address, PublicKey_1.ValConsPublicKey.fromData(pubkey), Coins_1.Coins.fromData(amount));
|
|
71
|
+
};
|
|
72
|
+
MsgCreateValidator.prototype.toData = function () {
|
|
73
|
+
var _a = this, description = _a.description, commission = _a.commission, delegator_address = _a.delegator_address, validator_address = _a.validator_address, pubkey = _a.pubkey, amount = _a.amount;
|
|
74
|
+
return {
|
|
75
|
+
'@type': '/initia.mstaking.v1.MsgCreateValidator',
|
|
76
|
+
description: description,
|
|
77
|
+
commission: commission.toData(),
|
|
78
|
+
delegator_address: delegator_address,
|
|
79
|
+
validator_address: validator_address,
|
|
80
|
+
pubkey: pubkey.toData(),
|
|
81
|
+
amount: amount.toData(),
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
MsgCreateValidator.fromProto = function (proto) {
|
|
85
|
+
return new MsgCreateValidator(Validator_1.Validator.Description.fromProto(proto.description), Validator_1.Validator.CommissionRates.fromProto(proto.commission), proto.delegatorAddress, proto.validatorAddress, PublicKey_1.PublicKey.fromProto(proto.pubkey), Coins_1.Coins.fromProto(proto.amount));
|
|
86
|
+
};
|
|
87
|
+
MsgCreateValidator.prototype.toProto = function () {
|
|
88
|
+
var _a = this, description = _a.description, commission = _a.commission, delegator_address = _a.delegator_address, validator_address = _a.validator_address, pubkey = _a.pubkey, amount = _a.amount;
|
|
89
|
+
return tx_1.MsgCreateValidator.fromPartial({
|
|
90
|
+
commission: commission.toProto(),
|
|
91
|
+
delegatorAddress: delegator_address,
|
|
92
|
+
description: description.toProto(),
|
|
93
|
+
pubkey: pubkey.packAny(),
|
|
94
|
+
validatorAddress: validator_address,
|
|
95
|
+
amount: amount.toProto(),
|
|
96
|
+
});
|
|
97
|
+
};
|
|
98
|
+
MsgCreateValidator.prototype.packAny = function () {
|
|
99
|
+
return any_1.Any.fromPartial({
|
|
100
|
+
typeUrl: '/initia.mstaking.v1.MsgCreateValidator',
|
|
101
|
+
value: tx_1.MsgCreateValidator.encode(this.toProto()).finish(),
|
|
102
|
+
});
|
|
103
|
+
};
|
|
104
|
+
MsgCreateValidator.unpackAny = function (msgAny) {
|
|
105
|
+
return MsgCreateValidator.fromProto(tx_1.MsgCreateValidator.decode(msgAny.value));
|
|
106
|
+
};
|
|
107
|
+
return MsgCreateValidator;
|
|
108
|
+
}(json_1.JSONSerializable));
|
|
109
|
+
exports.MsgCreateValidator = MsgCreateValidator;
|
|
110
|
+
//# sourceMappingURL=MsgCreateValidator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"MsgCreateValidator.js","sourceRoot":"","sources":["../../../../src/core/mstaking/msgs/MsgCreateValidator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAsD;AACtD,qCAAoC;AAEpC,0CAAyC;AACzC,gEAA+D;AAC/D,iEAAyG;AACzG,6CAA8D;AAE9D;;;GAGG;AACH;IAAwC,sCAIvC;IAGC;;;;;;;;OAQG;IACH,4BACS,WAAkC,EAClC,UAAqC,EACrC,iBAA6B,EAC7B,iBAA6B,EAC7B,MAAwB,EAC/B,MAAmB;QANrB,YAQE,iBAAO,SAER;QATQ,iBAA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