@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,127 @@
|
|
|
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.OperationsProposal = void 0;
|
|
19
|
+
var json_1 = require("../../../util/json");
|
|
20
|
+
var any_1 = require("@initia/initia.proto/google/protobuf/any");
|
|
21
|
+
var ExecuteOperation_1 = require("./ExecuteOperation");
|
|
22
|
+
var PublishOperation_1 = require("./PublishOperation");
|
|
23
|
+
var proposal_1 = require("@initia/initia.proto/initia/move//v1/proposal");
|
|
24
|
+
/**
|
|
25
|
+
* OperationsProposal proposal which supports submitting arbitrary move operations
|
|
26
|
+
*/
|
|
27
|
+
var OperationsProposal = /** @class */ (function (_super) {
|
|
28
|
+
__extends(OperationsProposal, _super);
|
|
29
|
+
/**
|
|
30
|
+
* @param title a short summary
|
|
31
|
+
* @param description a human readable text
|
|
32
|
+
* @param operations arbitrary move operations
|
|
33
|
+
*/
|
|
34
|
+
function OperationsProposal(title, description, operations) {
|
|
35
|
+
var _this = _super.call(this) || this;
|
|
36
|
+
_this.title = title;
|
|
37
|
+
_this.description = description;
|
|
38
|
+
_this.operations = operations;
|
|
39
|
+
return _this;
|
|
40
|
+
}
|
|
41
|
+
OperationsProposal.fromAmino = function (data) {
|
|
42
|
+
var _a = data.value, title = _a.title, description = _a.description, operations = _a.operations;
|
|
43
|
+
return new OperationsProposal(title, description, operations.map(function (op) { return OperationsProposal.Operation.fromAmino(op.operation); }));
|
|
44
|
+
};
|
|
45
|
+
OperationsProposal.prototype.toAmino = function () {
|
|
46
|
+
var _a = this, title = _a.title, description = _a.description, operations = _a.operations;
|
|
47
|
+
return {
|
|
48
|
+
type: 'move/OperationsProposal',
|
|
49
|
+
value: {
|
|
50
|
+
title: title,
|
|
51
|
+
description: description,
|
|
52
|
+
operations: operations.map(function (op) { return ({ operation: op.toAmino() }); }),
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
OperationsProposal.fromData = function (data) {
|
|
57
|
+
var title = data.title, description = data.description, operations = data.operations;
|
|
58
|
+
return new OperationsProposal(title, description, operations.map(function (op) { return OperationsProposal.Operation.fromData(op.operation); }));
|
|
59
|
+
};
|
|
60
|
+
OperationsProposal.prototype.toData = function () {
|
|
61
|
+
var _a = this, title = _a.title, description = _a.description, operations = _a.operations;
|
|
62
|
+
return {
|
|
63
|
+
'@type': '/initia.move.v1.OperationsProposal',
|
|
64
|
+
title: title,
|
|
65
|
+
description: description,
|
|
66
|
+
operations: operations.map(function (op) { return ({ operation: op.toData() }); }),
|
|
67
|
+
};
|
|
68
|
+
};
|
|
69
|
+
OperationsProposal.fromProto = function (proto) {
|
|
70
|
+
return new OperationsProposal(proto.title, proto.description, proto.operations.map(function (op) { return OperationsProposal.Operation.fromProto(op.operation); }));
|
|
71
|
+
};
|
|
72
|
+
OperationsProposal.prototype.toProto = function () {
|
|
73
|
+
var _a = this, title = _a.title, description = _a.description, operations = _a.operations;
|
|
74
|
+
return proposal_1.OperationsProposal.fromPartial({
|
|
75
|
+
title: title,
|
|
76
|
+
description: description,
|
|
77
|
+
operations: operations.map(function (op) { return ({ operation: op.packAny() }); }),
|
|
78
|
+
});
|
|
79
|
+
};
|
|
80
|
+
OperationsProposal.prototype.packAny = function () {
|
|
81
|
+
return any_1.Any.fromPartial({
|
|
82
|
+
typeUrl: '/initia.move.v1.OperationsProposal',
|
|
83
|
+
value: proposal_1.OperationsProposal.encode(this.toProto()).finish(),
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
OperationsProposal.unpackAny = function (msgAny) {
|
|
87
|
+
return OperationsProposal.fromProto(proposal_1.OperationsProposal.decode(msgAny.value));
|
|
88
|
+
};
|
|
89
|
+
return OperationsProposal;
|
|
90
|
+
}(json_1.JSONSerializable));
|
|
91
|
+
exports.OperationsProposal = OperationsProposal;
|
|
92
|
+
(function (OperationsProposal) {
|
|
93
|
+
var Operation;
|
|
94
|
+
(function (Operation) {
|
|
95
|
+
function fromAmino(amino) {
|
|
96
|
+
switch (amino.type) {
|
|
97
|
+
case 'move/ExecuteOperation':
|
|
98
|
+
return ExecuteOperation_1.ExecuteOperation.fromAmino(amino);
|
|
99
|
+
case 'move/PublishOperation':
|
|
100
|
+
return PublishOperation_1.PublishOperation.fromAmino(amino);
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
Operation.fromAmino = fromAmino;
|
|
104
|
+
function fromData(data) {
|
|
105
|
+
switch (data['@type']) {
|
|
106
|
+
case '/initia.move.v1.ExecuteOperation':
|
|
107
|
+
return ExecuteOperation_1.ExecuteOperation.fromData(data);
|
|
108
|
+
case '/initia.move.v1.PublishOperation':
|
|
109
|
+
return PublishOperation_1.PublishOperation.fromData(data);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
Operation.fromData = fromData;
|
|
113
|
+
function fromProto(anyProto) {
|
|
114
|
+
var typeUrl = anyProto.typeUrl;
|
|
115
|
+
switch (typeUrl) {
|
|
116
|
+
case '/initia.move.v1.ExecuteOperation':
|
|
117
|
+
return ExecuteOperation_1.ExecuteOperation.unpackAny(anyProto);
|
|
118
|
+
case '/initia.move.v1.PublishOperation':
|
|
119
|
+
return PublishOperation_1.PublishOperation.unpackAny(anyProto);
|
|
120
|
+
}
|
|
121
|
+
throw "Operation content ".concat(typeUrl, " not recognized");
|
|
122
|
+
}
|
|
123
|
+
Operation.fromProto = fromProto;
|
|
124
|
+
})(Operation = OperationsProposal.Operation || (OperationsProposal.Operation = {}));
|
|
125
|
+
})(OperationsProposal = exports.OperationsProposal || (exports.OperationsProposal = {}));
|
|
126
|
+
exports.OperationsProposal = OperationsProposal;
|
|
127
|
+
//# sourceMappingURL=OperationsProposal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OperationsProposal.js","sourceRoot":"","sources":["../../../../src/core/move/proposals/OperationsProposal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAsD;AACtD,gEAA+D;AAC/D,uDAAsD;AACtD,uDAAsD;AACtD,0EAA4G;AAE5G;;GAEG;AACH;IAAwC,sCAIvC;IACC;;;;OAIG;IACH,4BACS,KAAa,EACb,WAAmB,EACnB,UAA0C;QAHnD,YAKE,iBAAO,SACR;QALQ,WAAK,GAAL,KAAK,CAAQ;QACb,iBAAW,GAAX,WAAW,CAAQ;QACnB,gBAAU,GAAV,UAAU,CAAgC;;IAGnD,CAAC;IAEa,4BAAS,GAAvB,UACE,IAA8B;QAG5B,IAAA,KACE,IAAI,MADmC,EAAhC,KAAK,WAAA,EAAE,WAAW,iBAAA,EAAE,UAAU,gBAAE,CAClC;QACT,OAAO,IAAI,kBAAkB,CAC3B,KAAK,EACL,WAAW,EACX,UAAU,CAAC,GAAG,CAAC,UAAC,EAAE,IAAK,OAAA,kBAAkB,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,SAAS,CAAC,EAApD,CAAoD,CAAC,CAC7E,CAAC;IACJ,CAAC;IAEM,oCAAO,GAAd;QACQ,IAAA,KAAqC,IAAI,EAAvC,KAAK,WAAA,EAAE,WAAW,iBAAA,EAAE,UAAU,gBAAS,CAAC;QAChD,OAAO;YACL,IAAI,EAAE,yBAAyB;YAC/B,KAAK,EAAE;gBACL,KAAK,OAAA;gBACL,WAAW,aAAA;gBACX,UAAU,EAAE,UAAU,CAAC,GAAG,CAAC,UAAC,EAAE,IAAK,OAAA,CAAC,E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C;QACH,CAAC;QAPe,kBAAQ,WAOvB,CAAA;QAED,SAAgB,SAAS,CAAC,QAAa;YACrC,IAAM,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;YACjC,QAAQ,OAAO,EAAE;gBACf,KAAK,kCAAkC;oBACrC,OAAO,mCAAgB,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;gBAC9C,KAAK,kCAAkC;oBACrC,OAAO,mCAAgB,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;aAC/C;YAED,MAAM,4BAAqB,OAAO,oBAAiB,CAAC;QACtD,CAAC;QAVe,mBAAS,YAUxB,CAAA;IACH,CAAC,EA1CgB,SAAS,GAAT,4BAAS,KAAT,4BAAS,QA0CzB;AAmBH,CAAC,EAlEgB,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAkElC;AAnKY,gDAAkB"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { JSONSerializable } from '../../../util/json';
|
|
2
|
+
import { Any } from '@initia/initia.proto/google/protobuf/any';
|
|
3
|
+
import { PublishOperation as PublishOperation_pb } from '@initia/initia.proto/initia/move//v1/proposal';
|
|
4
|
+
/**
|
|
5
|
+
* PublishOperation gov proposal operation type to submit stdlib module to the system
|
|
6
|
+
*/
|
|
7
|
+
export declare class PublishOperation extends JSONSerializable<PublishOperation.Amino, PublishOperation.Data, PublishOperation.Proto> {
|
|
8
|
+
code_bytes: string;
|
|
9
|
+
/**
|
|
10
|
+
* @param code_bytes raw move module bytes code
|
|
11
|
+
*/
|
|
12
|
+
constructor(code_bytes: string);
|
|
13
|
+
static fromAmino(data: PublishOperation.Amino): PublishOperation;
|
|
14
|
+
toAmino(): PublishOperation.Amino;
|
|
15
|
+
static fromData(data: PublishOperation.Data): PublishOperation;
|
|
16
|
+
toData(): PublishOperation.Data;
|
|
17
|
+
static fromProto(proto: PublishOperation.Proto): PublishOperation;
|
|
18
|
+
toProto(): PublishOperation.Proto;
|
|
19
|
+
packAny(): Any;
|
|
20
|
+
static unpackAny(msgAny: Any): PublishOperation;
|
|
21
|
+
}
|
|
22
|
+
export declare namespace PublishOperation {
|
|
23
|
+
interface Amino {
|
|
24
|
+
type: 'move/PublishOperation';
|
|
25
|
+
value: {
|
|
26
|
+
code_bytes: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
interface Data {
|
|
30
|
+
'@type': '/initia.move.v1.PublishOperation';
|
|
31
|
+
code_bytes: string;
|
|
32
|
+
}
|
|
33
|
+
type Proto = PublishOperation_pb;
|
|
34
|
+
}
|
|
@@ -0,0 +1,76 @@
|
|
|
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.PublishOperation = void 0;
|
|
19
|
+
var json_1 = require("../../../util/json");
|
|
20
|
+
var any_1 = require("@initia/initia.proto/google/protobuf/any");
|
|
21
|
+
var proposal_1 = require("@initia/initia.proto/initia/move//v1/proposal");
|
|
22
|
+
/**
|
|
23
|
+
* PublishOperation gov proposal operation type to submit stdlib module to the system
|
|
24
|
+
*/
|
|
25
|
+
var PublishOperation = /** @class */ (function (_super) {
|
|
26
|
+
__extends(PublishOperation, _super);
|
|
27
|
+
/**
|
|
28
|
+
* @param code_bytes raw move module bytes code
|
|
29
|
+
*/
|
|
30
|
+
function PublishOperation(code_bytes) {
|
|
31
|
+
var _this = _super.call(this) || this;
|
|
32
|
+
_this.code_bytes = code_bytes;
|
|
33
|
+
return _this;
|
|
34
|
+
}
|
|
35
|
+
PublishOperation.fromAmino = function (data) {
|
|
36
|
+
return new PublishOperation(data.value.code_bytes);
|
|
37
|
+
};
|
|
38
|
+
PublishOperation.prototype.toAmino = function () {
|
|
39
|
+
var code_bytes = this.code_bytes;
|
|
40
|
+
return {
|
|
41
|
+
type: 'move/PublishOperation',
|
|
42
|
+
value: { code_bytes: code_bytes },
|
|
43
|
+
};
|
|
44
|
+
};
|
|
45
|
+
PublishOperation.fromData = function (data) {
|
|
46
|
+
return new PublishOperation(data.code_bytes);
|
|
47
|
+
};
|
|
48
|
+
PublishOperation.prototype.toData = function () {
|
|
49
|
+
var code_bytes = this.code_bytes;
|
|
50
|
+
return {
|
|
51
|
+
'@type': '/initia.move.v1.PublishOperation',
|
|
52
|
+
code_bytes: code_bytes,
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
PublishOperation.fromProto = function (proto) {
|
|
56
|
+
return new PublishOperation(Buffer.from(proto.codeBytes).toString('base64'));
|
|
57
|
+
};
|
|
58
|
+
PublishOperation.prototype.toProto = function () {
|
|
59
|
+
var code_bytes = this.code_bytes;
|
|
60
|
+
return proposal_1.PublishOperation.fromPartial({
|
|
61
|
+
codeBytes: Buffer.from(code_bytes, 'base64'),
|
|
62
|
+
});
|
|
63
|
+
};
|
|
64
|
+
PublishOperation.prototype.packAny = function () {
|
|
65
|
+
return any_1.Any.fromPartial({
|
|
66
|
+
typeUrl: '/initia.move.v1.PublishOperation',
|
|
67
|
+
value: proposal_1.PublishOperation.encode(this.toProto()).finish(),
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
PublishOperation.unpackAny = function (msgAny) {
|
|
71
|
+
return PublishOperation.fromProto(proposal_1.PublishOperation.decode(msgAny.value));
|
|
72
|
+
};
|
|
73
|
+
return PublishOperation;
|
|
74
|
+
}(json_1.JSONSerializable));
|
|
75
|
+
exports.PublishOperation = PublishOperation;
|
|
76
|
+
//# sourceMappingURL=PublishOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PublishOperation.js","sourceRoot":"","sources":["../../../../src/core/move/proposals/PublishOperation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAsD;AACtD,gEAA+D;AAC/D,0EAAwG;AAExG;;GAEG;AACH;IAAsC,oCAIrC;IACC;;OAEG;IACH,0BACS,UAAkB;QAD3B,YAGE,iBAAO,SACR;QAHQ,gBAAU,GAAV,UAAU,CAAQ;;IAG3B,CAAC;IAEa,0BAAS,GAAvB,UACE,IAA4B;QAE5B,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;IACrD,CAAC;IAEM,kCAAO,GAAd;QACU,IAAA,UAAU,GAAK,IAAI,WAAT,CAAU;QAC5B,OAAO;YACL,IAAI,EAAE,uBAAuB;YAC7B,KAAK,EAAE,EAAE,UAAU,YAAA,EAAE;SACtB,CAAC;IACJ,CAAC;IAEa,yBAAQ,GAAtB,UACE,IAA2B;QAE3B,OAAO,IAAI,gBAAgB,CAAC,IAAI,CAAC,UAAU,CAAC,CAAC;IAC/C,CAAC;IAEM,iCAAM,GAAb;QACU,IAAA,UAAU,GAAK,IAAI,WAAT,CAAU;QAC5B,OAAO;YACL,OAAO,EAAE,kCAAkC;YAC3C,UAAU,YAAA;SACX,CAAC;IACJ,CAAC;IAEa,0BAAS,GAAvB,UACE,KAA6B;QAE7B,OAAO,IAAI,gBAAgB,CACzB,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAChD,CAAC;IACJ,CAAC;IAEM,kCAAO,GAAd;QACU,IAAA,UAAU,GAAK,IAAI,WAAT,CAAU;QAC5B,OAAO,2BAAmB,CAAC,WAAW,CAAC;YACrC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,QAAQ,CAAC;SAC7C,CAAC,CAAC;IACL,CAAC;IAEM,kCAAO,GAAd;QACE,OAAO,SAAG,CAAC,WAAW,CAAC;YACrB,OAAO,EAAE,kCAAkC;YAC3C,KAAK,EAAE,2BAAmB,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;SAC3D,CAAC,CAAC;IACL,CAAC;IAEa,0BAAS,GAAvB,UAAwB,MAAW;QACjC,OAAO,gBAAgB,CAAC,SAAS,CAC/B,2BAAmB,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CACzC,CAAC;IACJ,CAAC;IACH,uBAAC;AAAD,CAAC,AArED,CAAsC,uBAAgB,GAqErD;AArEY,4CAAgB"}
|
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
export * from './
|
|
2
|
-
export * from './
|
|
1
|
+
export * from './OperationsProposal';
|
|
2
|
+
export * from './ExecuteOperation';
|
|
3
|
+
export * from './PublishOperation';
|
|
@@ -14,6 +14,7 @@ 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("./
|
|
18
|
-
__exportStar(require("./
|
|
17
|
+
__exportStar(require("./OperationsProposal"), exports);
|
|
18
|
+
__exportStar(require("./ExecuteOperation"), exports);
|
|
19
|
+
__exportStar(require("./PublishOperation"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/move/proposals/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/move/proposals/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uDAAqC;AACrC,qDAAmC;AACnC,qDAAmC"}
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { JSONSerializable } from '../../util/json';
|
|
2
|
+
import { AccAddress, ValAddress } from '../bech32';
|
|
3
|
+
import { Coins } from '../Coins';
|
|
4
|
+
import { DelegationResponse as DelegationResponse_pb } from '@initia/initia.proto/initia/mstaking/v1/staking';
|
|
5
|
+
/**
|
|
6
|
+
* Stores information about the status of a delegation between a delegator and validator, fetched from the blockchain.
|
|
7
|
+
*/
|
|
8
|
+
export declare class Delegation extends JSONSerializable<Delegation.Amino, Delegation.Data, Delegation.Proto> {
|
|
9
|
+
delegator_address: AccAddress;
|
|
10
|
+
validator_address: ValAddress;
|
|
11
|
+
shares: Coins;
|
|
12
|
+
balance: Coins;
|
|
13
|
+
/**
|
|
14
|
+
* @param delegator_address delegator's account address
|
|
15
|
+
* @param validator_address validator's operator address
|
|
16
|
+
* @param shares delegator's shares
|
|
17
|
+
* @param balance balance of the delegation
|
|
18
|
+
*/
|
|
19
|
+
constructor(delegator_address: AccAddress, validator_address: ValAddress, shares: Coins.Input, balance: Coins.Input);
|
|
20
|
+
static fromAmino(data: Delegation.Amino): Delegation;
|
|
21
|
+
toAmino(): Delegation.Amino;
|
|
22
|
+
static fromData(data: Delegation.Data): Delegation;
|
|
23
|
+
toData(): Delegation.Data;
|
|
24
|
+
static fromProto(proto: Delegation.Proto): Delegation;
|
|
25
|
+
toProto(): Delegation.Proto;
|
|
26
|
+
}
|
|
27
|
+
export declare namespace Delegation {
|
|
28
|
+
interface Amino {
|
|
29
|
+
delegation: {
|
|
30
|
+
delegator_address: AccAddress;
|
|
31
|
+
validator_address: ValAddress;
|
|
32
|
+
shares: Coins.Amino;
|
|
33
|
+
};
|
|
34
|
+
balance: Coins.Amino;
|
|
35
|
+
}
|
|
36
|
+
interface Data {
|
|
37
|
+
delegation: {
|
|
38
|
+
delegator_address: AccAddress;
|
|
39
|
+
validator_address: ValAddress;
|
|
40
|
+
shares: Coins.Data;
|
|
41
|
+
};
|
|
42
|
+
balance: Coins.Data;
|
|
43
|
+
}
|
|
44
|
+
type Proto = DelegationResponse_pb;
|
|
45
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
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.Delegation = void 0;
|
|
19
|
+
var json_1 = require("../../util/json");
|
|
20
|
+
var Coins_1 = require("../Coins");
|
|
21
|
+
var staking_1 = require("@initia/initia.proto/initia/mstaking/v1/staking");
|
|
22
|
+
/**
|
|
23
|
+
* Stores information about the status of a delegation between a delegator and validator, fetched from the blockchain.
|
|
24
|
+
*/
|
|
25
|
+
var Delegation = /** @class */ (function (_super) {
|
|
26
|
+
__extends(Delegation, _super);
|
|
27
|
+
/**
|
|
28
|
+
* @param delegator_address delegator's account address
|
|
29
|
+
* @param validator_address validator's operator address
|
|
30
|
+
* @param shares delegator's shares
|
|
31
|
+
* @param balance balance of the delegation
|
|
32
|
+
*/
|
|
33
|
+
function Delegation(delegator_address, validator_address, shares, balance) {
|
|
34
|
+
var _this = _super.call(this) || this;
|
|
35
|
+
_this.delegator_address = delegator_address;
|
|
36
|
+
_this.validator_address = validator_address;
|
|
37
|
+
_this.shares = new Coins_1.Coins(shares);
|
|
38
|
+
_this.balance = new Coins_1.Coins(balance);
|
|
39
|
+
return _this;
|
|
40
|
+
}
|
|
41
|
+
Delegation.fromAmino = function (data) {
|
|
42
|
+
var _a = data.delegation, delegator_address = _a.delegator_address, validator_address = _a.validator_address, shares = _a.shares, balance = data.balance;
|
|
43
|
+
return new Delegation(delegator_address, validator_address, Coins_1.Coins.fromAmino(shares), Coins_1.Coins.fromAmino(balance));
|
|
44
|
+
};
|
|
45
|
+
Delegation.prototype.toAmino = function () {
|
|
46
|
+
var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, shares = _a.shares, balance = _a.balance;
|
|
47
|
+
return {
|
|
48
|
+
delegation: {
|
|
49
|
+
delegator_address: delegator_address,
|
|
50
|
+
validator_address: validator_address,
|
|
51
|
+
shares: shares.toAmino(),
|
|
52
|
+
},
|
|
53
|
+
balance: balance.toAmino(),
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
Delegation.fromData = function (data) {
|
|
57
|
+
var _a = data.delegation, delegator_address = _a.delegator_address, validator_address = _a.validator_address, shares = _a.shares, balance = data.balance;
|
|
58
|
+
return new Delegation(delegator_address, validator_address, Coins_1.Coins.fromData(shares), Coins_1.Coins.fromData(balance));
|
|
59
|
+
};
|
|
60
|
+
Delegation.prototype.toData = function () {
|
|
61
|
+
var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, shares = _a.shares, balance = _a.balance;
|
|
62
|
+
return {
|
|
63
|
+
delegation: {
|
|
64
|
+
delegator_address: delegator_address,
|
|
65
|
+
validator_address: validator_address,
|
|
66
|
+
shares: shares.toData(),
|
|
67
|
+
},
|
|
68
|
+
balance: balance.toData(),
|
|
69
|
+
};
|
|
70
|
+
};
|
|
71
|
+
Delegation.fromProto = function (proto) {
|
|
72
|
+
var delegationProto = proto.delegation;
|
|
73
|
+
return new Delegation(delegationProto.delegatorAddress, delegationProto.validatorAddress, Coins_1.Coins.fromProto(delegationProto.shares), Coins_1.Coins.fromProto(proto.balance));
|
|
74
|
+
};
|
|
75
|
+
Delegation.prototype.toProto = function () {
|
|
76
|
+
var _a = this, delegator_address = _a.delegator_address, validator_address = _a.validator_address, shares = _a.shares, balance = _a.balance;
|
|
77
|
+
return staking_1.DelegationResponse.fromPartial({
|
|
78
|
+
delegation: staking_1.Delegation.fromPartial({
|
|
79
|
+
delegatorAddress: delegator_address,
|
|
80
|
+
validatorAddress: validator_address,
|
|
81
|
+
shares: shares.toProto(),
|
|
82
|
+
}),
|
|
83
|
+
balance: balance.toProto(),
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
return Delegation;
|
|
87
|
+
}(json_1.JSONSerializable));
|
|
88
|
+
exports.Delegation = Delegation;
|
|
89
|
+
//# sourceMappingURL=Delegation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Delegation.js","sourceRoot":"","sources":["../../../src/core/mstaking/Delegation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,wCAAmD;AAEnD,kCAAiC;AACjC,2EAGyD;AAEzD;;GAEG;AACH;IAAgC,8BAI/B;IAIC;;;;;OAKG;IACH,oBACS,iBAA6B,EAC7B,iBAA6B,EACpC,MAAmB,EACnB,OAAoB;QAJtB,YAME,iBAAO,SAGR;QARQ,uBAAiB,GAAjB,iBAAiB,CAAY;QAC7B,uBAAiB,GAAjB,iBAAiB,CAAY;QAKpC,KAAI,CAAC,MAAM,GAAG,IAAI,aAAK,CAAC,MAAM,CAAC,CAAC;QAChC,KAAI,CAAC,OAAO,GAAG,IAAI,aAAK,CAAC,OAAO,CAAC,CAAC;;IACpC,CAAC;IA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O,EAAE,OAAO,CAAC,MAAM,EAAE;SAC1B,CAAC;IACJ,CAAC;IAEa,oBAAS,GAAvB,UAAwB,KAAuB;QAC7C,IAAM,eAAe,GAAG,KAAK,CAAC,UAA2B,CAAC;QAC1D,OAAO,IAAI,UAAU,CACnB,eAAe,CAAC,gBAAgB,EAChC,eAAe,CAAC,gBAAgB,EAChC,aAAK,CAAC,SAAS,CAAC,eAAe,CAAC,MAAM,CAAC,EACvC,aAAK,CAAC,SAAS,CAAC,KAAK,CAAC,OAAsB,CAAC,CAC9C,CAAC;IACJ,CAAC;IAEM,4BAAO,GAAd;QACQ,IAAA,KAA4D,IAAI,EAA9D,iBAAiB,uBAAA,EAAE,iBAAiB,uBAAA,EAAE,MAAM,YAAA,EAAE,OAAO,aAAS,CAAC;QACvE,OAAO,4BAAqB,CAAC,WAAW,CAAC;YACvC,UAAU,EAAE,oBAAa,CAAC,WAAW,CAAC;gBACpC,gBAAgB,EAAE,iBAAiB;gBACnC,gBAAgB,EAAE,iBAAiB;gBACnC,MAAM,EAAE,MAAM,CAAC,OAAO,EAAE;aACzB,CAAC;YACF,OAAO,EAAE,OAAO,CAAC,OAAO,EAAE;SAC3B,CAAC,CAAC;IACL,CAAC;IACH,iBAAC;AAAD,CAAC,AAlGD,CAAgC,uBAAgB,GAkG/C;AAlGY,gCAAU"}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { JSONSerializable } from '../../util/json';
|
|
2
|
+
import { Coins } from '../Coins';
|
|
3
|
+
import { AccAddress, ValAddress } from '../bech32';
|
|
4
|
+
import { RedelegationResponse as RedelegationResponse_pb, RedelegationEntryResponse as RedelegationEntryResponse_pb } from '@initia/initia.proto/initia/mstaking/v1/staking';
|
|
5
|
+
/**
|
|
6
|
+
* A redelegation is when a delegator decides to stop mstaking with one validator and
|
|
7
|
+
* transfer their delegation to another validator. Rather than unbonding (which takes
|
|
8
|
+
* some time) and re-staking, the funds can be redelegated immediately if a
|
|
9
|
+
* [[Redelegation.Entry]] can be created.
|
|
10
|
+
*
|
|
11
|
+
* A redelegation, like an unbonding delegation, is implemented through
|
|
12
|
+
* [[Redelegation.Entry]] objects, limited by the `max_entry` parameter in the mstaking
|
|
13
|
+
* module params. For each pair of source and target validators, you cannot redelegate
|
|
14
|
+
* more times than the amount of entries. Entries are cleared when the redelegation is
|
|
15
|
+
* completed, the same amount of time as unbonding.
|
|
16
|
+
*/
|
|
17
|
+
export declare class Redelegation extends JSONSerializable<Redelegation.Amino, Redelegation.Data, Redelegation.Proto> {
|
|
18
|
+
delegator_address: AccAddress;
|
|
19
|
+
validator_src_address: ValAddress;
|
|
20
|
+
validator_dst_address: ValAddress;
|
|
21
|
+
entries: Redelegation.Entry[];
|
|
22
|
+
/**
|
|
23
|
+
*
|
|
24
|
+
* @param delegator_address delegator's account address
|
|
25
|
+
* @param validator_src_address source validator's operator address (from)
|
|
26
|
+
* @param validator_dst_address target validator's operator address (to)
|
|
27
|
+
* @param entries entries
|
|
28
|
+
*/
|
|
29
|
+
constructor(delegator_address: AccAddress, validator_src_address: ValAddress, validator_dst_address: ValAddress, entries: Redelegation.Entry[]);
|
|
30
|
+
static fromAmino(data: Redelegation.Amino): Redelegation;
|
|
31
|
+
toAmino(): Redelegation.Amino;
|
|
32
|
+
static fromData(data: Redelegation.Data): Redelegation;
|
|
33
|
+
toData(): Redelegation.Data;
|
|
34
|
+
static fromProto(data: Redelegation.Proto): Redelegation;
|
|
35
|
+
toProto(): Redelegation.Proto;
|
|
36
|
+
}
|
|
37
|
+
export declare namespace Redelegation {
|
|
38
|
+
interface Amino {
|
|
39
|
+
redelegation: {
|
|
40
|
+
delegator_address: AccAddress;
|
|
41
|
+
validator_src_address: ValAddress;
|
|
42
|
+
validator_dst_address: ValAddress;
|
|
43
|
+
};
|
|
44
|
+
entries: Redelegation.Entry.Amino[];
|
|
45
|
+
}
|
|
46
|
+
interface Data {
|
|
47
|
+
redelegation: {
|
|
48
|
+
delegator_address: AccAddress;
|
|
49
|
+
validator_src_address: ValAddress;
|
|
50
|
+
validator_dst_address: ValAddress;
|
|
51
|
+
};
|
|
52
|
+
entries: Redelegation.Entry.Data[];
|
|
53
|
+
}
|
|
54
|
+
type Proto = RedelegationResponse_pb;
|
|
55
|
+
class Entry extends JSONSerializable<Entry.Amino, Entry.Data, Entry.Proto> {
|
|
56
|
+
creation_height: number;
|
|
57
|
+
completion_time: Date;
|
|
58
|
+
initial_balance: Coins;
|
|
59
|
+
shares_dst: Coins;
|
|
60
|
+
balance: Coins;
|
|
61
|
+
/**
|
|
62
|
+
*
|
|
63
|
+
* @param initial_balance balance of delegation prior to initiating redelegation
|
|
64
|
+
* @param shares_dst
|
|
65
|
+
* @param creation_height height of blockchain when entry was created
|
|
66
|
+
* @param completion_time time when redelegation entry will be removed
|
|
67
|
+
*/
|
|
68
|
+
constructor(initial_balance: Coins.Input, balance: Coins.Input, shares_dst: Coins.Input, creation_height: number, completion_time: Date);
|
|
69
|
+
toAmino(): Entry.Amino;
|
|
70
|
+
static fromAmino(data: Entry.Amino): Entry;
|
|
71
|
+
toData(): Entry.Data;
|
|
72
|
+
static fromData(data: Entry.Data): Entry;
|
|
73
|
+
toProto(): Entry.Proto;
|
|
74
|
+
static fromProto(proto: Entry.Proto): Entry;
|
|
75
|
+
}
|
|
76
|
+
namespace Entry {
|
|
77
|
+
interface Amino {
|
|
78
|
+
redelegation_entry: {
|
|
79
|
+
creation_height: number;
|
|
80
|
+
completion_time: string;
|
|
81
|
+
initial_balance: Coins.Amino;
|
|
82
|
+
shares_dst: Coins.Amino;
|
|
83
|
+
};
|
|
84
|
+
balance: Coins.Amino;
|
|
85
|
+
}
|
|
86
|
+
interface Data {
|
|
87
|
+
redelegation_entry: {
|
|
88
|
+
creation_height: number;
|
|
89
|
+
completion_time: string;
|
|
90
|
+
initial_balance: Coins.Data;
|
|
91
|
+
shares_dst: Coins.Data;
|
|
92
|
+
};
|
|
93
|
+
balance: Coins.Data;
|
|
94
|
+
}
|
|
95
|
+
type Proto = RedelegationEntryResponse_pb;
|
|
96
|
+
}
|
|
97
|
+
}
|