@initia/initia.js 0.0.20 → 0.0.22
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.map +1 -1
- package/dist/client/lcd/api/AuthAPI.d.ts +2 -1
- package/dist/client/lcd/api/AuthAPI.js +15 -0
- package/dist/client/lcd/api/AuthAPI.js.map +1 -1
- package/dist/client/lcd/api/MoveAPI.d.ts +2 -5
- package/dist/client/lcd/api/MoveAPI.js +4 -2
- package/dist/client/lcd/api/MoveAPI.js.map +1 -1
- package/dist/client/lcd/api/StakingAPI.d.ts +10 -8
- package/dist/client/lcd/api/StakingAPI.js +16 -15
- package/dist/client/lcd/api/StakingAPI.js.map +1 -1
- package/dist/core/Msg.js +10 -22
- package/dist/core/Msg.js.map +1 -1
- package/dist/core/auth/Account.d.ts +4 -3
- package/dist/core/auth/Account.js +8 -0
- package/dist/core/auth/Account.js.map +1 -1
- package/dist/core/auth/ModuleAccount.d.ts +48 -0
- package/dist/core/auth/ModuleAccount.js +115 -0
- package/dist/core/auth/ModuleAccount.js.map +1 -0
- package/dist/core/auth/index.d.ts +1 -0
- package/dist/core/auth/index.js +1 -0
- package/dist/core/auth/index.js.map +1 -1
- package/dist/core/authz/authorizations/Authorization.js +2 -2
- package/dist/core/authz/authorizations/Authorization.js.map +1 -1
- package/dist/core/authz/authorizations/StakeAuthorization.d.ts +6 -6
- package/dist/core/authz/authorizations/StakeAuthorization.js +7 -7
- package/dist/core/authz/authorizations/StakeAuthorization.js.map +1 -1
- package/dist/core/staking/Delegation.d.ts +9 -9
- package/dist/core/staking/Delegation.js +10 -12
- package/dist/core/staking/Delegation.js.map +1 -1
- package/dist/core/staking/Redelegation.d.ts +12 -11
- package/dist/core/staking/Redelegation.js +17 -20
- package/dist/core/staking/Redelegation.js.map +1 -1
- package/dist/core/staking/UnbondingDelegation.d.ts +9 -8
- package/dist/core/staking/UnbondingDelegation.js +13 -15
- package/dist/core/staking/UnbondingDelegation.js.map +1 -1
- package/dist/core/staking/Validator.d.ts +15 -11
- package/dist/core/staking/Validator.js +26 -22
- package/dist/core/staking/Validator.js.map +1 -1
- package/dist/core/staking/msgs/MsgBeginRedelegate.d.ts +8 -8
- package/dist/core/staking/msgs/MsgBeginRedelegate.js +9 -9
- package/dist/core/staking/msgs/MsgBeginRedelegate.js.map +1 -1
- package/dist/core/staking/msgs/MsgCreateValidator.d.ts +8 -12
- package/dist/core/staking/msgs/MsgCreateValidator.js +18 -25
- package/dist/core/staking/msgs/MsgCreateValidator.js.map +1 -1
- package/dist/core/staking/msgs/MsgDelegate.d.ts +8 -8
- package/dist/core/staking/msgs/MsgDelegate.js +9 -9
- package/dist/core/staking/msgs/MsgDelegate.js.map +1 -1
- package/dist/core/staking/msgs/MsgEditValidator.d.ts +5 -9
- package/dist/core/staking/msgs/MsgEditValidator.js +14 -29
- package/dist/core/staking/msgs/MsgEditValidator.js.map +1 -1
- package/dist/core/staking/msgs/MsgUndelegate.d.ts +8 -8
- package/dist/core/staking/msgs/MsgUndelegate.js +9 -9
- package/dist/core/staking/msgs/MsgUndelegate.js.map +1 -1
- package/dist/core/vesting/msgs/index.d.ts +4 -8
- package/dist/core/vesting/msgs/index.js +0 -2
- package/dist/core/vesting/msgs/index.js.map +1 -1
- package/package.json +2 -2
|
@@ -17,11 +17,10 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.MsgCreateValidator = void 0;
|
|
19
19
|
var json_1 = require("../../../util/json");
|
|
20
|
-
var
|
|
21
|
-
var num_1 = require("../../num");
|
|
20
|
+
var Coins_1 = require("../../Coins");
|
|
22
21
|
var Validator_1 = require("../Validator");
|
|
23
22
|
var any_1 = require("@initia/initia.proto/google/protobuf/any");
|
|
24
|
-
var tx_1 = require("@initia/initia.proto/
|
|
23
|
+
var tx_1 = require("@initia/initia.proto/initia/mstaking/v1/tx");
|
|
25
24
|
var PublicKey_1 = require("../../PublicKey");
|
|
26
25
|
/**
|
|
27
26
|
* For new validators, this message registers a validator address to be a delegate on
|
|
@@ -33,78 +32,72 @@ var MsgCreateValidator = /** @class */ (function (_super) {
|
|
|
33
32
|
*
|
|
34
33
|
* @param description validator's delegate information
|
|
35
34
|
* @param commission validator's commission policy
|
|
36
|
-
* @param min_self_delegation minimum self delegation
|
|
37
35
|
* @param delegator_address validator's account address
|
|
38
36
|
* @param validator_address validator's operator address
|
|
39
37
|
* @param pubkey validator's consensus public key
|
|
40
|
-
* @param
|
|
38
|
+
* @param amount amount to use for self-delegation
|
|
41
39
|
*/
|
|
42
|
-
function MsgCreateValidator(description, commission,
|
|
40
|
+
function MsgCreateValidator(description, commission, delegator_address, validator_address, pubkey, amount) {
|
|
43
41
|
var _this = _super.call(this) || this;
|
|
44
42
|
_this.description = description;
|
|
45
43
|
_this.commission = commission;
|
|
46
|
-
_this.min_self_delegation = min_self_delegation;
|
|
47
44
|
_this.delegator_address = delegator_address;
|
|
48
45
|
_this.validator_address = validator_address;
|
|
49
46
|
_this.pubkey = pubkey;
|
|
50
|
-
_this.
|
|
51
|
-
_this.min_self_delegation = (0, num_1.num)(min_self_delegation).toFixed(0);
|
|
47
|
+
_this.amount = new Coins_1.Coins(amount);
|
|
52
48
|
return _this;
|
|
53
49
|
}
|
|
54
50
|
MsgCreateValidator.fromAmino = function (data) {
|
|
55
|
-
var _a = data.value, description = _a.description, commission = _a.commission,
|
|
56
|
-
return new MsgCreateValidator(description, Validator_1.Validator.CommissionRates.fromAmino(commission),
|
|
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));
|
|
57
53
|
};
|
|
58
54
|
MsgCreateValidator.prototype.toAmino = function () {
|
|
59
|
-
var _a = this, description = _a.description, commission = _a.commission,
|
|
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;
|
|
60
56
|
return {
|
|
61
57
|
type: 'cosmos-sdk/MsgCreateValidator',
|
|
62
58
|
value: {
|
|
63
59
|
description: description,
|
|
64
60
|
commission: commission.toAmino(),
|
|
65
|
-
min_self_delegation: min_self_delegation.toString(),
|
|
66
61
|
delegator_address: delegator_address,
|
|
67
62
|
validator_address: validator_address,
|
|
68
63
|
pubkey: pubkey.toAmino(),
|
|
69
|
-
|
|
64
|
+
amount: amount.toAmino(),
|
|
70
65
|
},
|
|
71
66
|
};
|
|
72
67
|
};
|
|
73
68
|
MsgCreateValidator.fromData = function (data) {
|
|
74
|
-
var description = data.description, commission = data.commission,
|
|
75
|
-
return new MsgCreateValidator(description, Validator_1.Validator.CommissionRates.fromData(commission),
|
|
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));
|
|
76
71
|
};
|
|
77
72
|
MsgCreateValidator.prototype.toData = function () {
|
|
78
|
-
var _a = this, description = _a.description, commission = _a.commission,
|
|
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;
|
|
79
74
|
return {
|
|
80
|
-
'@type': '/
|
|
75
|
+
'@type': '/initia.mstaking.v1.MsgCreateValidator',
|
|
81
76
|
description: description,
|
|
82
77
|
commission: commission.toData(),
|
|
83
|
-
min_self_delegation: min_self_delegation.toString(),
|
|
84
78
|
delegator_address: delegator_address,
|
|
85
79
|
validator_address: validator_address,
|
|
86
80
|
pubkey: pubkey.toData(),
|
|
87
|
-
|
|
81
|
+
amount: amount.toData(),
|
|
88
82
|
};
|
|
89
83
|
};
|
|
90
84
|
MsgCreateValidator.fromProto = function (proto) {
|
|
91
|
-
return new MsgCreateValidator(Validator_1.Validator.Description.fromProto(proto.description), Validator_1.Validator.CommissionRates.fromProto(proto.commission), 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));
|
|
92
86
|
};
|
|
93
87
|
MsgCreateValidator.prototype.toProto = function () {
|
|
94
|
-
var _a = this, description = _a.description, commission = _a.commission,
|
|
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;
|
|
95
89
|
return tx_1.MsgCreateValidator.fromPartial({
|
|
96
90
|
commission: commission.toProto(),
|
|
97
91
|
delegatorAddress: delegator_address,
|
|
98
92
|
description: description.toProto(),
|
|
99
|
-
minSelfDelegation: min_self_delegation.toString(),
|
|
100
93
|
pubkey: pubkey.packAny(),
|
|
101
94
|
validatorAddress: validator_address,
|
|
102
|
-
|
|
95
|
+
amount: amount.toProto(),
|
|
103
96
|
});
|
|
104
97
|
};
|
|
105
98
|
MsgCreateValidator.prototype.packAny = function () {
|
|
106
99
|
return any_1.Any.fromPartial({
|
|
107
|
-
typeUrl: '/
|
|
100
|
+
typeUrl: '/initia.mstaking.v1.MsgCreateValidator',
|
|
108
101
|
value: tx_1.MsgCreateValidator.encode(this.toProto()).finish(),
|
|
109
102
|
});
|
|
110
103
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MsgCreateValidator.js","sourceRoot":"","sources":["../../../../src/core/staking/msgs/MsgCreateValidator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAsD;AACtD,
|
|
1
|
+
{"version":3,"file":"MsgCreateValidator.js","sourceRoot":"","sources":["../../../../src/core/staking/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,iBAAW,GAAX,WAAW,CAAuB;QAClC,gBAAU,GAAV,UAAU,CAA2B;QACrC,uBAAiB,GAAjB,iBAAiB,CAAY;QAC7B,uBAAiB,GAAjB,iBAAiB,CAAY;QAC7B,YAAM,GAAN,MAAM,CAAkB;QAI/B,KAAI,CAAC,MAAM,GAAG,IAAI,aAAK,CAAC,MAAM,CAAC,CAAC;;IAClC,CAAC;IAEa,4BAAS,GAAvB,UAAwB,IAA8B;QAElD,IAAA,KAQE,IAAI,MADL,EANC,WAAW,iBAAA,EACX,UAAU,gBAAA,EACV,iBAAiB,uBAAA,EACjB,iBAAiB,uBAAA,EACjB,MAAM,YAAA,EACN,MAAM,YACP,CACM;QACT,OAAO,IAAI,kBAAkB,CAC3B,WAAW,EACX,qBAAS,CAAC,eAAe,CAAC,SAAS,CAAC,UAAU,CAAC,EAC/C,iBAAiB,EACjB,iBAAiB,EACjB,4BAAgB,CAAC,SAAS,CAAC,MAAM,CAAC,EAClC,aAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CACxB,CAAC;IACJ,CAAC;IAEM,oCAAO,GAAd;QACQ,IAAA,KAOF,IAAI,EANN,WAAW,iBAAA,EACX,UAAU,gBAAA,EACV,iBAAiB,uBAAA,EACj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Y,gDAAkB"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Coins } from '../../Coins';
|
|
2
2
|
import { JSONSerializable } from '../../../util/json';
|
|
3
3
|
import { AccAddress, ValAddress } from '../../bech32';
|
|
4
4
|
import { Any } from '@initia/initia.proto/google/protobuf/any';
|
|
5
|
-
import { MsgDelegate as MsgDelegate_pb } from '@initia/initia.proto/
|
|
5
|
+
import { MsgDelegate as MsgDelegate_pb } from '@initia/initia.proto/initia/mstaking/v1/tx';
|
|
6
6
|
/**
|
|
7
7
|
* A delegator can submit this message to send more Initia to be staked through a
|
|
8
8
|
* validator delegate.
|
|
@@ -10,14 +10,14 @@ import { MsgDelegate as MsgDelegate_pb } from '@initia/initia.proto/cosmos/staki
|
|
|
10
10
|
export declare class MsgDelegate extends JSONSerializable<MsgDelegate.Amino, MsgDelegate.Data, MsgDelegate.Proto> {
|
|
11
11
|
delegator_address: AccAddress;
|
|
12
12
|
validator_address: ValAddress;
|
|
13
|
-
amount:
|
|
13
|
+
amount: Coins;
|
|
14
14
|
/**
|
|
15
15
|
*
|
|
16
16
|
* @param delegator_address delegator's account address
|
|
17
17
|
* @param validator_address validator's operator address
|
|
18
|
-
* @param amount amount of
|
|
18
|
+
* @param amount amount of INIT to be sent for delegation
|
|
19
19
|
*/
|
|
20
|
-
constructor(delegator_address: AccAddress, validator_address: ValAddress, amount:
|
|
20
|
+
constructor(delegator_address: AccAddress, validator_address: ValAddress, amount: Coins.Input);
|
|
21
21
|
static fromAmino(data: MsgDelegate.Amino): MsgDelegate;
|
|
22
22
|
toAmino(): MsgDelegate.Amino;
|
|
23
23
|
static fromProto(proto: MsgDelegate.Proto): MsgDelegate;
|
|
@@ -33,14 +33,14 @@ export declare namespace MsgDelegate {
|
|
|
33
33
|
value: {
|
|
34
34
|
delegator_address: AccAddress;
|
|
35
35
|
validator_address: ValAddress;
|
|
36
|
-
amount:
|
|
36
|
+
amount: Coins.Amino;
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
interface Data {
|
|
40
|
-
'@type': '/
|
|
40
|
+
'@type': '/initia.mstaking.v1.MsgDelegate';
|
|
41
41
|
delegator_address: AccAddress;
|
|
42
42
|
validator_address: ValAddress;
|
|
43
|
-
amount:
|
|
43
|
+
amount: Coins.Data;
|
|
44
44
|
}
|
|
45
45
|
type Proto = MsgDelegate_pb;
|
|
46
46
|
}
|
|
@@ -16,10 +16,10 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.MsgDelegate = void 0;
|
|
19
|
-
var
|
|
19
|
+
var Coins_1 = require("../../Coins");
|
|
20
20
|
var json_1 = require("../../../util/json");
|
|
21
21
|
var any_1 = require("@initia/initia.proto/google/protobuf/any");
|
|
22
|
-
var tx_1 = require("@initia/initia.proto/
|
|
22
|
+
var tx_1 = require("@initia/initia.proto/initia/mstaking/v1/tx");
|
|
23
23
|
/**
|
|
24
24
|
* A delegator can submit this message to send more Initia to be staked through a
|
|
25
25
|
* validator delegate.
|
|
@@ -30,18 +30,18 @@ var MsgDelegate = /** @class */ (function (_super) {
|
|
|
30
30
|
*
|
|
31
31
|
* @param delegator_address delegator's account address
|
|
32
32
|
* @param validator_address validator's operator address
|
|
33
|
-
* @param amount amount of
|
|
33
|
+
* @param amount amount of INIT to be sent for delegation
|
|
34
34
|
*/
|
|
35
35
|
function MsgDelegate(delegator_address, validator_address, amount) {
|
|
36
36
|
var _this = _super.call(this) || this;
|
|
37
37
|
_this.delegator_address = delegator_address;
|
|
38
38
|
_this.validator_address = validator_address;
|
|
39
|
-
_this.amount = amount;
|
|
39
|
+
_this.amount = new Coins_1.Coins(amount);
|
|
40
40
|
return _this;
|
|
41
41
|
}
|
|
42
42
|
MsgDelegate.fromAmino = function (data) {
|
|
43
43
|
var _a = data.value, delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount;
|
|
44
|
-
return new MsgDelegate(delegator_address, validator_address,
|
|
44
|
+
return new MsgDelegate(delegator_address, validator_address, Coins_1.Coins.fromAmino(amount));
|
|
45
45
|
};
|
|
46
46
|
MsgDelegate.prototype.toAmino = function () {
|
|
47
47
|
var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount;
|
|
@@ -55,7 +55,7 @@ var MsgDelegate = /** @class */ (function (_super) {
|
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
57
|
MsgDelegate.fromProto = function (proto) {
|
|
58
|
-
return new MsgDelegate(proto.delegatorAddress, proto.validatorAddress,
|
|
58
|
+
return new MsgDelegate(proto.delegatorAddress, proto.validatorAddress, Coins_1.Coins.fromProto(proto.amount));
|
|
59
59
|
};
|
|
60
60
|
MsgDelegate.prototype.toProto = function () {
|
|
61
61
|
var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount;
|
|
@@ -67,7 +67,7 @@ var MsgDelegate = /** @class */ (function (_super) {
|
|
|
67
67
|
};
|
|
68
68
|
MsgDelegate.prototype.packAny = function () {
|
|
69
69
|
return any_1.Any.fromPartial({
|
|
70
|
-
typeUrl: '/
|
|
70
|
+
typeUrl: '/initia.mstaking.v1.MsgDelegate',
|
|
71
71
|
value: tx_1.MsgDelegate.encode(this.toProto()).finish(),
|
|
72
72
|
});
|
|
73
73
|
};
|
|
@@ -76,12 +76,12 @@ var MsgDelegate = /** @class */ (function (_super) {
|
|
|
76
76
|
};
|
|
77
77
|
MsgDelegate.fromData = function (data) {
|
|
78
78
|
var delegator_address = data.delegator_address, validator_address = data.validator_address, amount = data.amount;
|
|
79
|
-
return new MsgDelegate(delegator_address, validator_address,
|
|
79
|
+
return new MsgDelegate(delegator_address, validator_address, Coins_1.Coins.fromData(amount));
|
|
80
80
|
};
|
|
81
81
|
MsgDelegate.prototype.toData = function () {
|
|
82
82
|
var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount;
|
|
83
83
|
return {
|
|
84
|
-
'@type': '/
|
|
84
|
+
'@type': '/initia.mstaking.v1.MsgDelegate',
|
|
85
85
|
delegator_address: delegator_address,
|
|
86
86
|
validator_address: validator_address,
|
|
87
87
|
amount: amount.toData(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MsgDelegate.js","sourceRoot":"","sources":["../../../../src/core/staking/msgs/MsgDelegate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"MsgDelegate.js","sourceRoot":"","sources":["../../../../src/core/staking/msgs/MsgDelegate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,qCAAoC;AACpC,2CAAsD;AAEtD,gEAA+D;AAC/D,iEAA2F;AAE3F;;;GAGG;AACH;IAAiC,+BAIhC;IAGC;;;;;OAKG;IACH,qBACS,iBAA6B,EAC7B,iBAA6B,EACpC,MAAmB;QAHrB,YAKE,iBAAO,SAER;QANQ,uBAAiB,GAAjB,iBAAiB,CAAY;QAC7B,uBAAiB,GAAjB,iBAAiB,CAAY;QAIpC,KAAI,CAAC,MAAM,GAAG,IAAI,aAAK,CAAC,MAAM,CAAC,CAAC;;IAClC,CAAC;IAEa,qBAAS,GAAvB,UAAwB,IAAuB;QAE3C,IAAA,KACE,IAAI,MADiD,EAA9C,iBAAiB,uBAAA,EAAE,iBAAiB,uBAAA,EAAE,MAAM,YAAE,CAChD;QACT,OAAO,IAAI,WAAW,CACpB,iBAAiB,EACjB,iBAAiB,EACjB,aAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CACxB,CAAC;IACJ,CAAC;IAEM,6BAAO,GAAd;QACQ,IAAA,KAAmD,IAAI,EAArD,iBAAiB,uBAAA,EAAE,iBAAiB,uBAAA,EAAE,MAAM,YAAS,CAAC;QAC9D,OAAO;YACL,IAAI,EAAE,wBAAwB;YAC9B,KAAK,EAAE;gBACL,iBAAiB,mBAAA;gBACjB,iBAAiB,mBAAA;gBACjB,MAAM,EAAE,MAAM,C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,YAAS,CAAC;QAC9D,OAAO;YACL,OAAO,EAAE,iCAAiC;YAC1C,iBAAiB,mBAAA;YACjB,iBAAiB,mBAAA;YACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;SACxB,CAAC;IACJ,CAAC;IACH,kBAAC;AAAD,CAAC,AA3FD,CAAiC,uBAAgB,GA2FhD;AA3FY,kCAAW"}
|
|
@@ -2,7 +2,7 @@ import { JSONSerializable } from '../../../util/json';
|
|
|
2
2
|
import { ValAddress } from '../../bech32';
|
|
3
3
|
import { Validator } from '../Validator';
|
|
4
4
|
import { Any } from '@initia/initia.proto/google/protobuf/any';
|
|
5
|
-
import { MsgEditValidator as MsgEditValidator_pb } from '@initia/initia.proto/
|
|
5
|
+
import { MsgEditValidator as MsgEditValidator_pb } from '@initia/initia.proto/initia/mstaking/v1/tx';
|
|
6
6
|
/**
|
|
7
7
|
* A validator can edit its delegate information, such as moniker, website, commission
|
|
8
8
|
* rate, etc.
|
|
@@ -15,14 +15,12 @@ export declare class MsgEditValidator extends JSONSerializable<MsgEditValidator.
|
|
|
15
15
|
description: Validator.Description;
|
|
16
16
|
validator_address: ValAddress;
|
|
17
17
|
commission_rate?: string | undefined;
|
|
18
|
-
min_self_delegation?: string | undefined;
|
|
19
18
|
/**
|
|
20
|
-
* @param
|
|
21
|
-
* @param
|
|
19
|
+
* @param description new description to apply
|
|
20
|
+
* @param validator_address new address to apply
|
|
22
21
|
* @param commission_rate new commission rates to apply
|
|
23
|
-
* @param min_self_delegation new min self delegation
|
|
24
22
|
*/
|
|
25
|
-
constructor(description: Validator.Description, validator_address: ValAddress, commission_rate?: string | undefined
|
|
23
|
+
constructor(description: Validator.Description, validator_address: ValAddress, commission_rate?: string | undefined);
|
|
26
24
|
static fromAmino(data: MsgEditValidator.Amino): MsgEditValidator;
|
|
27
25
|
toAmino(): MsgEditValidator.Amino;
|
|
28
26
|
static fromProto(data: MsgEditValidator.Proto): MsgEditValidator;
|
|
@@ -40,15 +38,13 @@ export declare namespace MsgEditValidator {
|
|
|
40
38
|
description: Validator.Description.Amino;
|
|
41
39
|
validator_address: ValAddress;
|
|
42
40
|
commission_rate?: string;
|
|
43
|
-
min_self_delegation?: string;
|
|
44
41
|
};
|
|
45
42
|
}
|
|
46
43
|
interface Data {
|
|
47
|
-
'@type': '/
|
|
44
|
+
'@type': '/initia.mstaking.v1.MsgEditValidator';
|
|
48
45
|
description: Validator.Description.Data;
|
|
49
46
|
validator_address: ValAddress;
|
|
50
47
|
commission_rate?: string;
|
|
51
|
-
min_self_delegation?: string;
|
|
52
48
|
}
|
|
53
49
|
type Proto = MsgEditValidator_pb;
|
|
54
50
|
}
|
|
@@ -20,7 +20,7 @@ var json_1 = require("../../../util/json");
|
|
|
20
20
|
var num_1 = require("../../num");
|
|
21
21
|
var Validator_1 = require("../Validator");
|
|
22
22
|
var any_1 = require("@initia/initia.proto/google/protobuf/any");
|
|
23
|
-
var tx_1 = require("@initia/initia.proto/
|
|
23
|
+
var tx_1 = require("@initia/initia.proto/initia/mstaking/v1/tx");
|
|
24
24
|
/**
|
|
25
25
|
* A validator can edit its delegate information, such as moniker, website, commission
|
|
26
26
|
* rate, etc.
|
|
@@ -32,31 +32,23 @@ var tx_1 = require("@initia/initia.proto/cosmos/staking/v1beta1/tx");
|
|
|
32
32
|
var MsgEditValidator = /** @class */ (function (_super) {
|
|
33
33
|
__extends(MsgEditValidator, _super);
|
|
34
34
|
/**
|
|
35
|
-
* @param
|
|
36
|
-
* @param
|
|
35
|
+
* @param description new description to apply
|
|
36
|
+
* @param validator_address new address to apply
|
|
37
37
|
* @param commission_rate new commission rates to apply
|
|
38
|
-
* @param min_self_delegation new min self delegation
|
|
39
38
|
*/
|
|
40
|
-
function MsgEditValidator(description, validator_address, commission_rate
|
|
39
|
+
function MsgEditValidator(description, validator_address, commission_rate) {
|
|
41
40
|
var _this = _super.call(this) || this;
|
|
42
41
|
_this.description = description;
|
|
43
42
|
_this.validator_address = validator_address;
|
|
44
43
|
_this.commission_rate = commission_rate;
|
|
45
|
-
_this.min_self_delegation = min_self_delegation;
|
|
46
|
-
_this.commission_rate = commission_rate
|
|
47
|
-
? (0, num_1.num)(commission_rate).toString()
|
|
48
|
-
: undefined;
|
|
49
|
-
_this.min_self_delegation = min_self_delegation
|
|
50
|
-
? (0, num_1.num)(min_self_delegation).toFixed(0)
|
|
51
|
-
: undefined;
|
|
52
44
|
return _this;
|
|
53
45
|
}
|
|
54
46
|
MsgEditValidator.fromAmino = function (data) {
|
|
55
|
-
var _a = data.value, description = _a.description, validator_address = _a.validator_address, commission_rate = _a.commission_rate
|
|
56
|
-
return new MsgEditValidator(Validator_1.Validator.Description.fromAmino(description), validator_address, commission_rate
|
|
47
|
+
var _a = data.value, description = _a.description, validator_address = _a.validator_address, commission_rate = _a.commission_rate;
|
|
48
|
+
return new MsgEditValidator(Validator_1.Validator.Description.fromAmino(description), validator_address, commission_rate);
|
|
57
49
|
};
|
|
58
50
|
MsgEditValidator.prototype.toAmino = function () {
|
|
59
|
-
var _a = this, description = _a.description, validator_address = _a.validator_address, commission_rate = _a.commission_rate
|
|
51
|
+
var _a = this, description = _a.description, validator_address = _a.validator_address, commission_rate = _a.commission_rate;
|
|
60
52
|
return {
|
|
61
53
|
type: 'cosmos-sdk/MsgEditValidator',
|
|
62
54
|
value: {
|
|
@@ -65,27 +57,23 @@ var MsgEditValidator = /** @class */ (function (_super) {
|
|
|
65
57
|
commission_rate: commission_rate
|
|
66
58
|
? (0, num_1.num)(commission_rate).toFixed(18)
|
|
67
59
|
: undefined,
|
|
68
|
-
min_self_delegation: min_self_delegation
|
|
69
|
-
? min_self_delegation.toString()
|
|
70
|
-
: undefined,
|
|
71
60
|
},
|
|
72
61
|
};
|
|
73
62
|
};
|
|
74
63
|
MsgEditValidator.fromProto = function (data) {
|
|
75
|
-
return new MsgEditValidator(Validator_1.Validator.Description.fromProto(data.description), data.validatorAddress, data.commissionRate !== '' ? data.commissionRate : undefined
|
|
64
|
+
return new MsgEditValidator(Validator_1.Validator.Description.fromProto(data.description), data.validatorAddress, data.commissionRate !== '' ? data.commissionRate : undefined);
|
|
76
65
|
};
|
|
77
66
|
MsgEditValidator.prototype.toProto = function () {
|
|
78
|
-
var _a = this, description = _a.description, validator_address = _a.validator_address, commission_rate = _a.commission_rate
|
|
67
|
+
var _a = this, description = _a.description, validator_address = _a.validator_address, commission_rate = _a.commission_rate;
|
|
79
68
|
return tx_1.MsgEditValidator.fromPartial({
|
|
80
69
|
description: description.toProto(),
|
|
81
70
|
commissionRate: (commission_rate === null || commission_rate === void 0 ? void 0 : commission_rate.toString()) || '',
|
|
82
|
-
minSelfDelegation: (min_self_delegation === null || min_self_delegation === void 0 ? void 0 : min_self_delegation.toString()) || '',
|
|
83
71
|
validatorAddress: validator_address,
|
|
84
72
|
});
|
|
85
73
|
};
|
|
86
74
|
MsgEditValidator.prototype.packAny = function () {
|
|
87
75
|
return any_1.Any.fromPartial({
|
|
88
|
-
typeUrl: '/
|
|
76
|
+
typeUrl: '/initia.mstaking.v1.MsgEditValidator',
|
|
89
77
|
value: tx_1.MsgEditValidator.encode(this.toProto()).finish(),
|
|
90
78
|
});
|
|
91
79
|
};
|
|
@@ -93,21 +81,18 @@ var MsgEditValidator = /** @class */ (function (_super) {
|
|
|
93
81
|
return MsgEditValidator.fromProto(tx_1.MsgEditValidator.decode(msgAny.value));
|
|
94
82
|
};
|
|
95
83
|
MsgEditValidator.fromData = function (data) {
|
|
96
|
-
var description = data.description, validator_address = data.validator_address, commission_rate = data.commission_rate
|
|
97
|
-
return new MsgEditValidator(Validator_1.Validator.Description.fromData(description), validator_address, commission_rate
|
|
84
|
+
var description = data.description, validator_address = data.validator_address, commission_rate = data.commission_rate;
|
|
85
|
+
return new MsgEditValidator(Validator_1.Validator.Description.fromData(description), validator_address, commission_rate);
|
|
98
86
|
};
|
|
99
87
|
MsgEditValidator.prototype.toData = function () {
|
|
100
|
-
var _a = this, description = _a.description, validator_address = _a.validator_address, commission_rate = _a.commission_rate
|
|
88
|
+
var _a = this, description = _a.description, validator_address = _a.validator_address, commission_rate = _a.commission_rate;
|
|
101
89
|
return {
|
|
102
|
-
'@type': '/
|
|
90
|
+
'@type': '/initia.mstaking.v1.MsgEditValidator',
|
|
103
91
|
description: description,
|
|
104
92
|
validator_address: validator_address,
|
|
105
93
|
commission_rate: commission_rate
|
|
106
94
|
? (0, num_1.num)(commission_rate).toFixed(18)
|
|
107
95
|
: undefined,
|
|
108
|
-
min_self_delegation: min_self_delegation
|
|
109
|
-
? min_self_delegation.toString()
|
|
110
|
-
: undefined,
|
|
111
96
|
};
|
|
112
97
|
};
|
|
113
98
|
return MsgEditValidator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MsgEditValidator.js","sourceRoot":"","sources":["../../../../src/core/staking/msgs/MsgEditValidator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAsD;AACtD,iCAAgC;AAEhC,0CAAyC;AACzC,gEAA+D;AAC/D,
|
|
1
|
+
{"version":3,"file":"MsgEditValidator.js","sourceRoot":"","sources":["../../../../src/core/staking/msgs/MsgEditValidator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAsD;AACtD,iCAAgC;AAEhC,0CAAyC;AACzC,gEAA+D;AAC/D,iEAAqG;AAErG;;;;;;;GAOG;AACH;IAAsC,oCAIrC;IACC;;;;OAIG;IACH,0BACS,WAAkC,EAClC,iBAA6B,EAC7B,eAAwB;QAHjC,YAKE,iBAAO,SACR;QALQ,iBAAW,GAAX,WAAW,CAAuB;QAClC,uBAAiB,GAAjB,iBAAiB,CAAY;QAC7B,qBAAe,GAAf,eAAe,CAAS;;IAGjC,CAAC;IAEa,0BAAS,GAAvB,UAAwB,IAA4B;QAEhD,IAAA,KAKE,IAAI,MADL,EAHC,WAAW,iBAAA,EACX,iBAAiB,uBAAA,EACjB,eAAe,qBAChB,CACM;QACT,OAAO,IAAI,gBAAgB,CACzB,qBAAS,CAAC,WAAW,CAAC,SA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../util/json';
|
|
3
3
|
import { AccAddress, ValAddress } from '../../bech32';
|
|
4
4
|
import { Any } from '@initia/initia.proto/google/protobuf/any';
|
|
5
|
-
import { MsgUndelegate as MsgUndelegate_pb } from '@initia/initia.proto/
|
|
5
|
+
import { MsgUndelegate as MsgUndelegate_pb } from '@initia/initia.proto/initia/mstaking/v1/tx';
|
|
6
6
|
/**
|
|
7
7
|
* A delegator can undelegate an amount of bonded Initia, and will begin the unbonding
|
|
8
8
|
* process for those funds. The unbonding process takes 21 days to complete, during
|
|
@@ -11,13 +11,13 @@ import { MsgUndelegate as MsgUndelegate_pb } from '@initia/initia.proto/cosmos/s
|
|
|
11
11
|
export declare class MsgUndelegate extends JSONSerializable<MsgUndelegate.Amino, MsgUndelegate.Data, MsgUndelegate.Proto> {
|
|
12
12
|
delegator_address: AccAddress;
|
|
13
13
|
validator_address: ValAddress;
|
|
14
|
-
amount:
|
|
14
|
+
amount: Coins;
|
|
15
15
|
/**
|
|
16
16
|
* @param delegator_address delegator's account address
|
|
17
17
|
* @param validator_address validator's operator address
|
|
18
|
-
* @param amount
|
|
18
|
+
* @param amount INIT to be undelegated
|
|
19
19
|
*/
|
|
20
|
-
constructor(delegator_address: AccAddress, validator_address: ValAddress, amount:
|
|
20
|
+
constructor(delegator_address: AccAddress, validator_address: ValAddress, amount: Coins.Input);
|
|
21
21
|
static fromAmino(data: MsgUndelegate.Amino): MsgUndelegate;
|
|
22
22
|
toAmino(): MsgUndelegate.Amino;
|
|
23
23
|
static fromProto(proto: MsgUndelegate.Proto): MsgUndelegate;
|
|
@@ -33,14 +33,14 @@ export declare namespace MsgUndelegate {
|
|
|
33
33
|
value: {
|
|
34
34
|
delegator_address: AccAddress;
|
|
35
35
|
validator_address: ValAddress;
|
|
36
|
-
amount:
|
|
36
|
+
amount: Coins.Amino;
|
|
37
37
|
};
|
|
38
38
|
}
|
|
39
39
|
interface Data {
|
|
40
|
-
'@type': '/
|
|
40
|
+
'@type': '/initia.mstaking.v1.MsgUndelegate';
|
|
41
41
|
delegator_address: AccAddress;
|
|
42
42
|
validator_address: ValAddress;
|
|
43
|
-
amount:
|
|
43
|
+
amount: Coins.Data;
|
|
44
44
|
}
|
|
45
45
|
type Proto = MsgUndelegate_pb;
|
|
46
46
|
}
|
|
@@ -16,10 +16,10 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
16
16
|
})();
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
exports.MsgUndelegate = void 0;
|
|
19
|
-
var
|
|
19
|
+
var Coins_1 = require("../../Coins");
|
|
20
20
|
var json_1 = require("../../../util/json");
|
|
21
21
|
var any_1 = require("@initia/initia.proto/google/protobuf/any");
|
|
22
|
-
var tx_1 = require("@initia/initia.proto/
|
|
22
|
+
var tx_1 = require("@initia/initia.proto/initia/mstaking/v1/tx");
|
|
23
23
|
/**
|
|
24
24
|
* A delegator can undelegate an amount of bonded Initia, and will begin the unbonding
|
|
25
25
|
* process for those funds. The unbonding process takes 21 days to complete, during
|
|
@@ -30,18 +30,18 @@ var MsgUndelegate = /** @class */ (function (_super) {
|
|
|
30
30
|
/**
|
|
31
31
|
* @param delegator_address delegator's account address
|
|
32
32
|
* @param validator_address validator's operator address
|
|
33
|
-
* @param amount
|
|
33
|
+
* @param amount INIT to be undelegated
|
|
34
34
|
*/
|
|
35
35
|
function MsgUndelegate(delegator_address, validator_address, amount) {
|
|
36
36
|
var _this = _super.call(this) || this;
|
|
37
37
|
_this.delegator_address = delegator_address;
|
|
38
38
|
_this.validator_address = validator_address;
|
|
39
|
-
_this.amount = amount;
|
|
39
|
+
_this.amount = new Coins_1.Coins(amount);
|
|
40
40
|
return _this;
|
|
41
41
|
}
|
|
42
42
|
MsgUndelegate.fromAmino = function (data) {
|
|
43
43
|
var _a = data.value, delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount;
|
|
44
|
-
return new MsgUndelegate(delegator_address, validator_address,
|
|
44
|
+
return new MsgUndelegate(delegator_address, validator_address, Coins_1.Coins.fromAmino(amount));
|
|
45
45
|
};
|
|
46
46
|
MsgUndelegate.prototype.toAmino = function () {
|
|
47
47
|
var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount;
|
|
@@ -55,7 +55,7 @@ var MsgUndelegate = /** @class */ (function (_super) {
|
|
|
55
55
|
};
|
|
56
56
|
};
|
|
57
57
|
MsgUndelegate.fromProto = function (proto) {
|
|
58
|
-
return new MsgUndelegate(proto.delegatorAddress, proto.validatorAddress,
|
|
58
|
+
return new MsgUndelegate(proto.delegatorAddress, proto.validatorAddress, Coins_1.Coins.fromProto(proto.amount));
|
|
59
59
|
};
|
|
60
60
|
MsgUndelegate.prototype.toProto = function () {
|
|
61
61
|
var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount;
|
|
@@ -67,7 +67,7 @@ var MsgUndelegate = /** @class */ (function (_super) {
|
|
|
67
67
|
};
|
|
68
68
|
MsgUndelegate.prototype.packAny = function () {
|
|
69
69
|
return any_1.Any.fromPartial({
|
|
70
|
-
typeUrl: '/
|
|
70
|
+
typeUrl: '/initia.mstaking.v1.MsgUndelegate',
|
|
71
71
|
value: tx_1.MsgUndelegate.encode(this.toProto()).finish(),
|
|
72
72
|
});
|
|
73
73
|
};
|
|
@@ -76,12 +76,12 @@ var MsgUndelegate = /** @class */ (function (_super) {
|
|
|
76
76
|
};
|
|
77
77
|
MsgUndelegate.fromData = function (data) {
|
|
78
78
|
var delegator_address = data.delegator_address, validator_address = data.validator_address, amount = data.amount;
|
|
79
|
-
return new MsgUndelegate(delegator_address, validator_address,
|
|
79
|
+
return new MsgUndelegate(delegator_address, validator_address, Coins_1.Coins.fromData(amount));
|
|
80
80
|
};
|
|
81
81
|
MsgUndelegate.prototype.toData = function () {
|
|
82
82
|
var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, amount = _a.amount;
|
|
83
83
|
return {
|
|
84
|
-
'@type': '/
|
|
84
|
+
'@type': '/initia.mstaking.v1.MsgUndelegate',
|
|
85
85
|
delegator_address: delegator_address,
|
|
86
86
|
validator_address: validator_address,
|
|
87
87
|
amount: amount.toData(),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MsgUndelegate.js","sourceRoot":"","sources":["../../../../src/core/staking/msgs/MsgUndelegate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"MsgUndelegate.js","sourceRoot":"","sources":["../../../../src/core/staking/msgs/MsgUndelegate.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,qCAAoC;AACpC,2CAAsD;AAEtD,gEAA+D;AAC/D,iEAA+F;AAE/F;;;;GAIG;AACH;IAAmC,iCAIlC;IAGC;;;;OAIG;IACH,uBACS,iBAA6B,EAC7B,iBAA6B,EACpC,MAAmB;QAHrB,YAKE,iBAAO,SAER;QANQ,uBAAiB,GAAjB,iBAAiB,CAAY;QAC7B,uBAAiB,GAAjB,iBAAiB,CAAY;QAIpC,KAAI,CAAC,MAAM,GAAG,IAAI,aAAK,CAAC,MAAM,CAAC,CAAC;;IAClC,CAAC;IAEa,uBAAS,GAAvB,UAAwB,IAAyB;QAE7C,IAAA,KACE,IAAI,MADiD,EAA9C,iBAAiB,uBAAA,EAAE,iBAAiB,uBAAA,EAAE,MAAM,YAAE,CAChD;QACT,OAAO,IAAI,aAAa,CACtB,iBAAiB,EACjB,iBAAiB,EACjB,aAAK,CAAC,SAAS,CAAC,MAAM,CAAC,CACxB,CAAC;IACJ,CAAC;IAEM,+BAAO,GAAd;QACQ,IAAA,KAAmD,IAAI,EAArD,iBAAiB,uBAAA,EAAE,iBAAiB,uBAAA,EAAE,MAAM,YAAS,CAAC;QAC9D,OAAO;YACL,IAAI,EAAE,0BAA0B;YAChC,KAAK,EAAE;gBACL,iBAAiB,mBAAA;gBACjB,iBAAiB,mBAAA;gBACjB,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE;aACzB;SACF,CAAC;IAC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AO,EAAE,mCAAmC;YAC5C,iBAAiB,mBAAA;YACjB,iBAAiB,mBAAA;YACjB,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE;SACxB,CAAC;IACJ,CAAC;IACH,oBAAC;AAAD,CAAC,AA1FD,CAAmC,uBAAgB,GA0FlD;AA1FY,sCAAa"}
|
|
@@ -1,12 +1,8 @@
|
|
|
1
|
-
import { MsgCreatePeriodicVestingAccount } from './MsgCreatePeriodicVestingAccount';
|
|
2
1
|
import { MsgCreateVestingAccount } from './MsgCreateVestingAccount';
|
|
3
|
-
import { MsgDonateAllVestingTokens } from './MsgDonateAllVestingTokens';
|
|
4
|
-
export * from './MsgCreatePeriodicVestingAccount';
|
|
5
2
|
export * from './MsgCreateVestingAccount';
|
|
6
|
-
export
|
|
7
|
-
export declare type VestingMsg = MsgCreatePeriodicVestingAccount | MsgCreateVestingAccount | MsgDonateAllVestingTokens;
|
|
3
|
+
export declare type VestingMsg = MsgCreateVestingAccount;
|
|
8
4
|
export declare namespace VestingMsg {
|
|
9
|
-
type Amino =
|
|
10
|
-
type Data =
|
|
11
|
-
type Proto =
|
|
5
|
+
type Amino = MsgCreateVestingAccount.Amino;
|
|
6
|
+
type Data = MsgCreateVestingAccount.Data;
|
|
7
|
+
type Proto = MsgCreateVestingAccount.Proto;
|
|
12
8
|
}
|
|
@@ -14,7 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./MsgCreatePeriodicVestingAccount"), exports);
|
|
18
17
|
__exportStar(require("./MsgCreateVestingAccount"), exports);
|
|
19
|
-
__exportStar(require("./MsgDonateAllVestingTokens"), exports);
|
|
20
18
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/vesting/msgs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/vesting/msgs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAEA,4DAA0C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@initia/initia.js",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.22",
|
|
4
4
|
"description": "The JavaScript SDK for Initia",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "InitiaLabs",
|
|
@@ -82,7 +82,7 @@
|
|
|
82
82
|
"webpack-cli": "^4.10.0"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@initia/initia.proto": "^0.0.
|
|
85
|
+
"@initia/initia.proto": "^0.0.6-alpha1",
|
|
86
86
|
"@mysten/bcs": "^0.5.0",
|
|
87
87
|
"axios": "^0.27.2",
|
|
88
88
|
"bech32": "^2.0.0",
|