@initia/initia.js 0.0.31 → 0.0.33
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/api/IbcAPI.d.ts +6 -0
- package/dist/client/lcd/api/IbcAPI.js +18 -0
- package/dist/client/lcd/api/IbcAPI.js.map +1 -1
- package/dist/client/lcd/api/IbcTransferAPI.d.ts +3 -1
- package/dist/client/lcd/api/IbcTransferAPI.js +12 -1
- package/dist/client/lcd/api/IbcTransferAPI.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/ibc/applications/fee/index.d.ts +2 -1
- package/dist/core/ibc/applications/fee/index.js +2 -1
- package/dist/core/ibc/applications/fee/index.js.map +1 -1
- package/dist/core/ibc/applications/fee/msgs/MsgRegisterCounterpartyPayee.d.ts +37 -0
- package/dist/core/ibc/applications/fee/msgs/MsgRegisterCounterpartyPayee.js +86 -0
- package/dist/core/ibc/applications/fee/msgs/MsgRegisterCounterpartyPayee.js.map +1 -0
- package/dist/core/ibc/applications/fee/msgs/MsgRegisterPayee.d.ts +37 -0
- package/dist/core/ibc/applications/fee/msgs/MsgRegisterPayee.js +86 -0
- package/dist/core/ibc/applications/fee/msgs/MsgRegisterPayee.js.map +1 -0
- package/dist/core/ibc/applications/transfer/v1/msgs/MsgTransfer.d.ts +5 -1
- package/dist/core/ibc/applications/transfer/v1/msgs/MsgTransfer.js +14 -9
- package/dist/core/ibc/applications/transfer/v1/msgs/MsgTransfer.js.map +1 -1
- package/dist/core/ibc/applications/transfer/v2/FungibleTokenPacketData.d.ts +5 -1
- package/dist/core/ibc/applications/transfer/v2/FungibleTokenPacketData.js +14 -9
- package/dist/core/ibc/applications/transfer/v2/FungibleTokenPacketData.js.map +1 -1
- 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/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
|
@@ -38,8 +38,9 @@ var MsgTransfer = /** @class */ (function (_super) {
|
|
|
38
38
|
* @param receiver the recipient address on the destination chain
|
|
39
39
|
* @param timeout_height Timeout height relative to the current block height. (0 to disable)
|
|
40
40
|
* @param timeout_timestamp Timeout timestamp (in nanoseconds) relative to the current block timestamp. (0 to disable)
|
|
41
|
+
* @param memo optional memo
|
|
41
42
|
*/
|
|
42
|
-
function MsgTransfer(source_port, source_channel, token, sender, receiver, timeout_height, timeout_timestamp) {
|
|
43
|
+
function MsgTransfer(source_port, source_channel, token, sender, receiver, timeout_height, timeout_timestamp, memo) {
|
|
43
44
|
var _this = _super.call(this) || this;
|
|
44
45
|
if (!timeout_height && !timeout_timestamp) {
|
|
45
46
|
throw 'both of timeout_height and timeout_timestamp are undefined';
|
|
@@ -51,17 +52,18 @@ var MsgTransfer = /** @class */ (function (_super) {
|
|
|
51
52
|
_this.receiver = receiver;
|
|
52
53
|
_this.timeout_height = timeout_height;
|
|
53
54
|
_this.timeout_timestamp = timeout_timestamp;
|
|
55
|
+
_this.memo = memo;
|
|
54
56
|
return _this;
|
|
55
57
|
}
|
|
56
58
|
MsgTransfer.fromAmino = function (data) {
|
|
57
|
-
var _a = data.value, source_port = _a.source_port, source_channel = _a.source_channel, token = _a.token, sender = _a.sender, receiver = _a.receiver, timeout_height = _a.timeout_height, timeout_timestamp = _a.timeout_timestamp;
|
|
59
|
+
var _a = data.value, source_port = _a.source_port, source_channel = _a.source_channel, token = _a.token, sender = _a.sender, receiver = _a.receiver, timeout_height = _a.timeout_height, timeout_timestamp = _a.timeout_timestamp, memo = _a.memo;
|
|
58
60
|
if (!timeout_height && !timeout_timestamp) {
|
|
59
61
|
throw 'both of timeout_height and timeout_timestamp are undefined';
|
|
60
62
|
}
|
|
61
|
-
return new MsgTransfer(source_port, source_channel, token ? Coin_1.Coin.fromAmino(token) : undefined, sender, receiver, timeout_height ? Height_1.Height.fromAmino(timeout_height) : undefined, timeout_timestamp);
|
|
63
|
+
return new MsgTransfer(source_port, source_channel, token ? Coin_1.Coin.fromAmino(token) : undefined, sender, receiver, timeout_height ? Height_1.Height.fromAmino(timeout_height) : undefined, timeout_timestamp, memo);
|
|
62
64
|
};
|
|
63
65
|
MsgTransfer.prototype.toAmino = function () {
|
|
64
|
-
var _a = this, source_port = _a.source_port, source_channel = _a.source_channel, token = _a.token, sender = _a.sender, receiver = _a.receiver, timeout_height = _a.timeout_height, timeout_timestamp = _a.timeout_timestamp;
|
|
66
|
+
var _a = this, source_port = _a.source_port, source_channel = _a.source_channel, token = _a.token, sender = _a.sender, receiver = _a.receiver, timeout_height = _a.timeout_height, timeout_timestamp = _a.timeout_timestamp, memo = _a.memo;
|
|
65
67
|
return {
|
|
66
68
|
type: 'cosmos-sdk/MsgTransfer',
|
|
67
69
|
value: {
|
|
@@ -72,18 +74,19 @@ var MsgTransfer = /** @class */ (function (_super) {
|
|
|
72
74
|
receiver: receiver,
|
|
73
75
|
timeout_height: (timeout_height === null || timeout_height === void 0 ? void 0 : timeout_height.toAmino()) || {},
|
|
74
76
|
timeout_timestamp: timeout_timestamp,
|
|
77
|
+
memo: memo,
|
|
75
78
|
},
|
|
76
79
|
};
|
|
77
80
|
};
|
|
78
81
|
MsgTransfer.fromData = function (data) {
|
|
79
|
-
var source_port = data.source_port, source_channel = data.source_channel, token = data.token, sender = data.sender, receiver = data.receiver, timeout_timestamp = data.timeout_timestamp, timeout_height = data.timeout_height;
|
|
82
|
+
var source_port = data.source_port, source_channel = data.source_channel, token = data.token, sender = data.sender, receiver = data.receiver, timeout_timestamp = data.timeout_timestamp, timeout_height = data.timeout_height, memo = data.memo;
|
|
80
83
|
if (!timeout_height && !timeout_timestamp) {
|
|
81
84
|
throw 'both of timeout_height and timeout_timestamp are undefined';
|
|
82
85
|
}
|
|
83
|
-
return new MsgTransfer(source_port, source_channel, token ? Coin_1.Coin.fromData(token) : undefined, sender, receiver, timeout_height ? Height_1.Height.fromData(timeout_height) : undefined, timeout_timestamp === '0' ? undefined : timeout_timestamp);
|
|
86
|
+
return new MsgTransfer(source_port, source_channel, token ? Coin_1.Coin.fromData(token) : undefined, sender, receiver, timeout_height ? Height_1.Height.fromData(timeout_height) : undefined, timeout_timestamp === '0' ? undefined : timeout_timestamp, memo);
|
|
84
87
|
};
|
|
85
88
|
MsgTransfer.prototype.toData = function () {
|
|
86
|
-
var _a = this, source_port = _a.source_port, source_channel = _a.source_channel, token = _a.token, sender = _a.sender, receiver = _a.receiver, timeout_height = _a.timeout_height, timeout_timestamp = _a.timeout_timestamp;
|
|
89
|
+
var _a = this, source_port = _a.source_port, source_channel = _a.source_channel, token = _a.token, sender = _a.sender, receiver = _a.receiver, timeout_height = _a.timeout_height, timeout_timestamp = _a.timeout_timestamp, memo = _a.memo;
|
|
87
90
|
return {
|
|
88
91
|
'@type': '/ibc.applications.transfer.v1.MsgTransfer',
|
|
89
92
|
source_port: source_port,
|
|
@@ -95,16 +98,17 @@ var MsgTransfer = /** @class */ (function (_super) {
|
|
|
95
98
|
? timeout_height.toData()
|
|
96
99
|
: new Height_1.Height(0, 0).toData(),
|
|
97
100
|
timeout_timestamp: timeout_timestamp !== null && timeout_timestamp !== void 0 ? timeout_timestamp : '0',
|
|
101
|
+
memo: memo,
|
|
98
102
|
};
|
|
99
103
|
};
|
|
100
104
|
MsgTransfer.fromProto = function (proto) {
|
|
101
105
|
if (!proto.timeoutHeight && proto.timeoutTimestamp.toNumber() == 0) {
|
|
102
106
|
throw 'both of timeout_height and timeout_timestamp are empty';
|
|
103
107
|
}
|
|
104
|
-
return new MsgTransfer(proto.sourcePort, proto.sourceChannel, proto.token ? Coin_1.Coin.fromProto(proto.token) : undefined, proto.sender, proto.receiver, proto.timeoutHeight ? Height_1.Height.fromProto(proto.timeoutHeight) : undefined, proto.timeoutTimestamp.toString());
|
|
108
|
+
return new MsgTransfer(proto.sourcePort, proto.sourceChannel, proto.token ? Coin_1.Coin.fromProto(proto.token) : undefined, proto.sender, proto.receiver, proto.timeoutHeight ? Height_1.Height.fromProto(proto.timeoutHeight) : undefined, proto.timeoutTimestamp.toString(), proto.memo);
|
|
105
109
|
};
|
|
106
110
|
MsgTransfer.prototype.toProto = function () {
|
|
107
|
-
var _a = this, source_port = _a.source_port, source_channel = _a.source_channel, token = _a.token, sender = _a.sender, receiver = _a.receiver, timeout_height = _a.timeout_height, timeout_timestamp = _a.timeout_timestamp;
|
|
111
|
+
var _a = this, source_port = _a.source_port, source_channel = _a.source_channel, token = _a.token, sender = _a.sender, receiver = _a.receiver, timeout_height = _a.timeout_height, timeout_timestamp = _a.timeout_timestamp, memo = _a.memo;
|
|
108
112
|
return tx_1.MsgTransfer.fromPartial({
|
|
109
113
|
sourcePort: source_port,
|
|
110
114
|
sourceChannel: source_channel,
|
|
@@ -113,6 +117,7 @@ var MsgTransfer = /** @class */ (function (_super) {
|
|
|
113
117
|
receiver: receiver,
|
|
114
118
|
timeoutHeight: timeout_height ? timeout_height.toProto() : undefined,
|
|
115
119
|
timeoutTimestamp: long_1.default.fromString(timeout_timestamp !== null && timeout_timestamp !== void 0 ? timeout_timestamp : '0'),
|
|
120
|
+
memo: memo,
|
|
116
121
|
});
|
|
117
122
|
};
|
|
118
123
|
MsgTransfer.prototype.packAny = function () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MsgTransfer.js","sourceRoot":"","sources":["../../../../../../../src/core/ibc/applications/transfer/v1/msgs/MsgTransfer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,oDAA+D;AAE/D,4CAA2C;AAC3C,8CAAwB;AACxB,gEAA+D;AAC/D,2EAAqG;AACrG,yDAAwD;AAExD;;GAEG;AACH;IAAiC,+BAIhC;
|
|
1
|
+
{"version":3,"file":"MsgTransfer.js","sourceRoot":"","sources":["../../../../../../../src/core/ibc/applications/transfer/v1/msgs/MsgTransfer.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,oDAA+D;AAE/D,4CAA2C;AAC3C,8CAAwB;AACxB,gEAA+D;AAC/D,2EAAqG;AACrG,yDAAwD;AAExD;;GAEG;AACH;IAAiC,+BAIhC;IASC;;;;;;;;;OASG;IACH,qBACE,WAAmB,EACnB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AC;IACJ,CAAC;IAEM,6BAAO,GAAd;QACQ,IAAA,KASF,IAAI,EARN,WAAW,iBAAA,EACX,cAAc,oBAAA,EACd,KAAK,WAAA,EACL,MAAM,YAAA,EACN,QAAQ,cAAA,EACR,cAAc,oBAAA,EACd,iBAAiB,uBAAA,EACjB,IAAI,UACE,CAAC;QACT,OAAO,gBAAc,CAAC,WAAW,CAAC;YAChC,UAAU,EAAE,WAAW;YACvB,aAAa,EAAE,cAAc;YAC7B,KAAK,EAAE,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS;YAC1C,MAAM,QAAA;YACN,QAAQ,UAAA;YACR,aAAa,EAAE,cAAc,CAAC,CAAC,CAAC,cAAc,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,SAAS;YACpE,gBAAgB,EAAE,cAAI,CAAC,UAAU,CAAC,iBAAiB,aAAjB,iBAAiB,cAAjB,iBAAiB,GAAI,GAAG,CAAC;YAC3D,IAAI,MAAA;SACL,CAAC,CAAC;IACL,CAAC;IAEM,6BAAO,GAAd;QACE,OAAO,SAAG,CAAC,WAAW,CAAC;YACrB,OAAO,EAAE,2CAA2C;YACpD,KAAK,EAAE,gBAAc,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;SACtD,CAAC,CAAC;IACL,CAAC;IAEa,qBAAS,GAAvB,UAAwB,MAAW;QACjC,OAAO,WAAW,CAAC,SAAS,CAAC,gBAAc,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACpE,CAAC;IACH,kBAAC;AAAD,CAAC,AAjND,CAAiC,uBAAgB,GAiNhD;AAjNY,kCAAW"}
|
|
@@ -10,13 +10,15 @@ export declare class FungibleTokenPacketData extends JSONSerializable<FungibleTo
|
|
|
10
10
|
amount: string;
|
|
11
11
|
sender: string;
|
|
12
12
|
receiver: string;
|
|
13
|
+
memo?: string | undefined;
|
|
13
14
|
/**
|
|
14
15
|
* @param denom the token denomination to be transferred
|
|
15
16
|
* @param amount the token amount to be transferred
|
|
16
17
|
* @param sender the sender address
|
|
17
18
|
* @param receiver the recipient address on the destination chain
|
|
19
|
+
* @param memo optional memo
|
|
18
20
|
*/
|
|
19
|
-
constructor(denom: string, amount: string, sender: string, receiver: string);
|
|
21
|
+
constructor(denom: string, amount: string, sender: string, receiver: string, memo?: string | undefined);
|
|
20
22
|
static fromAmino(data: FungibleTokenPacketData.Amino): FungibleTokenPacketData;
|
|
21
23
|
toAmino(): FungibleTokenPacketData.Amino;
|
|
22
24
|
static fromData(data: FungibleTokenPacketData.Data): FungibleTokenPacketData;
|
|
@@ -30,12 +32,14 @@ export declare namespace FungibleTokenPacketData {
|
|
|
30
32
|
amount: string;
|
|
31
33
|
sender: string;
|
|
32
34
|
receiver: string;
|
|
35
|
+
memo?: string;
|
|
33
36
|
}
|
|
34
37
|
interface Data {
|
|
35
38
|
denom: string;
|
|
36
39
|
amount: string;
|
|
37
40
|
sender: string;
|
|
38
41
|
receiver: string;
|
|
42
|
+
memo?: string;
|
|
39
43
|
}
|
|
40
44
|
type Proto = FungibleTokenPacketData_pb;
|
|
41
45
|
}
|
|
@@ -30,53 +30,58 @@ var FungibleTokenPacketData = /** @class */ (function (_super) {
|
|
|
30
30
|
* @param amount the token amount to be transferred
|
|
31
31
|
* @param sender the sender address
|
|
32
32
|
* @param receiver the recipient address on the destination chain
|
|
33
|
+
* @param memo optional memo
|
|
33
34
|
*/
|
|
34
|
-
function FungibleTokenPacketData(denom, amount, sender, receiver) {
|
|
35
|
+
function FungibleTokenPacketData(denom, amount, sender, receiver, memo) {
|
|
35
36
|
var _this = _super.call(this) || this;
|
|
36
37
|
_this.denom = denom;
|
|
37
38
|
_this.amount = amount;
|
|
38
39
|
_this.sender = sender;
|
|
39
40
|
_this.receiver = receiver;
|
|
41
|
+
_this.memo = memo;
|
|
40
42
|
return _this;
|
|
41
43
|
}
|
|
42
44
|
FungibleTokenPacketData.fromAmino = function (data) {
|
|
43
|
-
var denom = data.denom, amount = data.amount, sender = data.sender, receiver = data.receiver;
|
|
44
|
-
return new FungibleTokenPacketData(denom, amount, sender, receiver);
|
|
45
|
+
var denom = data.denom, amount = data.amount, sender = data.sender, receiver = data.receiver, memo = data.memo;
|
|
46
|
+
return new FungibleTokenPacketData(denom, amount, sender, receiver, memo);
|
|
45
47
|
};
|
|
46
48
|
FungibleTokenPacketData.prototype.toAmino = function () {
|
|
47
|
-
var _a = this, denom = _a.denom, amount = _a.amount, sender = _a.sender, receiver = _a.receiver;
|
|
49
|
+
var _a = this, denom = _a.denom, amount = _a.amount, sender = _a.sender, receiver = _a.receiver, memo = _a.memo;
|
|
48
50
|
var res = {
|
|
49
51
|
denom: denom,
|
|
50
52
|
amount: amount,
|
|
51
53
|
sender: sender,
|
|
52
54
|
receiver: receiver,
|
|
55
|
+
memo: memo,
|
|
53
56
|
};
|
|
54
57
|
return res;
|
|
55
58
|
};
|
|
56
59
|
FungibleTokenPacketData.fromData = function (data) {
|
|
57
|
-
var denom = data.denom, amount = data.amount, sender = data.sender, receiver = data.receiver;
|
|
58
|
-
return new FungibleTokenPacketData(denom, amount, sender, receiver);
|
|
60
|
+
var denom = data.denom, amount = data.amount, sender = data.sender, receiver = data.receiver, memo = data.memo;
|
|
61
|
+
return new FungibleTokenPacketData(denom, amount, sender, receiver, memo);
|
|
59
62
|
};
|
|
60
63
|
FungibleTokenPacketData.prototype.toData = function () {
|
|
61
|
-
var _a = this, denom = _a.denom, amount = _a.amount, sender = _a.sender, receiver = _a.receiver;
|
|
64
|
+
var _a = this, denom = _a.denom, amount = _a.amount, sender = _a.sender, receiver = _a.receiver, memo = _a.memo;
|
|
62
65
|
var res = {
|
|
63
66
|
denom: denom,
|
|
64
67
|
amount: amount,
|
|
65
68
|
sender: sender,
|
|
66
69
|
receiver: receiver,
|
|
70
|
+
memo: memo,
|
|
67
71
|
};
|
|
68
72
|
return res;
|
|
69
73
|
};
|
|
70
74
|
FungibleTokenPacketData.fromProto = function (proto) {
|
|
71
|
-
return new FungibleTokenPacketData(proto.denom, proto.amount, proto.sender, proto.receiver);
|
|
75
|
+
return new FungibleTokenPacketData(proto.denom, proto.amount, proto.sender, proto.receiver, proto.memo);
|
|
72
76
|
};
|
|
73
77
|
FungibleTokenPacketData.prototype.toProto = function () {
|
|
74
|
-
var _a = this, denom = _a.denom, amount = _a.amount, sender = _a.sender, receiver = _a.receiver;
|
|
78
|
+
var _a = this, denom = _a.denom, amount = _a.amount, sender = _a.sender, receiver = _a.receiver, memo = _a.memo;
|
|
75
79
|
return packet_1.FungibleTokenPacketData.fromPartial({
|
|
76
80
|
denom: denom,
|
|
77
81
|
amount: amount,
|
|
78
82
|
sender: sender,
|
|
79
83
|
receiver: receiver,
|
|
84
|
+
memo: memo,
|
|
80
85
|
});
|
|
81
86
|
};
|
|
82
87
|
return FungibleTokenPacketData;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FungibleTokenPacketData.js","sourceRoot":"","sources":["../../../../../../src/core/ibc/applications/transfer/v2/FungibleTokenPacketData.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,mFAAiI;AACjI,iDAA4D;AAE5D;;;;GAIG;AACH;IAA6C,2CAI5C;IACC
|
|
1
|
+
{"version":3,"file":"FungibleTokenPacketData.js","sourceRoot":"","sources":["../../../../../../src/core/ibc/applications/transfer/v2/FungibleTokenPacketData.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,mFAAiI;AACjI,iDAA4D;AAE5D;;;;GAIG;AACH;IAA6C,2CAI5C;IACC;;;;;;OAMG;IACH,iCACS,KAAa,EACb,MAAc,EACd,MAAc,EACd,QAAgB,EAChB,IAAa;QALtB,YAOE,iBAAO,SACR;QAPQ,WAAK,GAAL,KAAK,CAAQ;QACb,YAAM,GAAN,MAAM,CAAQ;QACd,YAAM,GAAN,MAAM,CAAQ;QACd,cAAQ,GAAR,QAAQ,CAAQ;QAChB,U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L,CAAC;QACF,OAAO,GAAG,CAAC;IACb,CAAC;IAEa,iCAAS,GAAvB,UACE,KAAoC;QAEpC,OAAO,IAAI,uBAAuB,CAChC,KAAK,CAAC,KAAK,EACX,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,MAAM,EACZ,KAAK,CAAC,QAAQ,EACd,KAAK,CAAC,IAAI,CACX,CAAC;IACJ,CAAC;IAEM,yCAAO,GAAd;QACQ,IAAA,KAA4C,IAAI,EAA9C,KAAK,WAAA,EAAE,MAAM,YAAA,EAAE,MAAM,YAAA,EAAE,QAAQ,cAAA,EAAE,IAAI,UAAS,CAAC;QACvD,OAAO,gCAA0B,CAAC,WAAW,CAAC;YAC5C,KAAK,OAAA;YACL,MAAM,QAAA;YACN,MAAM,QAAA;YACN,QAAQ,UAAA;YACR,IAAI,MAAA;SACL,CAAC,CAAC;IACL,CAAC;IACH,8BAAC;AAAD,CAAC,AAlFD,CAA6C,uBAAgB,GAkF5D;AAlFY,0DAAuB"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { JSONSerializable } from '../../../util/json';
|
|
2
|
+
import { Any } from '@initia/initia.proto/google/protobuf/any';
|
|
3
|
+
import { ExecuteOperation as ExecuteOperation_pb } from '@initia/initia.proto/initia/move//v1/proposal';
|
|
4
|
+
import { AccAddress } from '../../bech32';
|
|
5
|
+
/**
|
|
6
|
+
* ExecuteOperation gov proposal operation type to execute entry function to the system
|
|
7
|
+
*/
|
|
8
|
+
export declare class ExecuteOperation extends JSONSerializable<ExecuteOperation.Amino, ExecuteOperation.Data, ExecuteOperation.Proto> {
|
|
9
|
+
module_address: AccAddress;
|
|
10
|
+
module_name: string;
|
|
11
|
+
function_name: string;
|
|
12
|
+
type_args: string[];
|
|
13
|
+
args: string[];
|
|
14
|
+
/**
|
|
15
|
+
* @param module_address module address of entry function
|
|
16
|
+
* @param module_name move module name
|
|
17
|
+
* @param function_name move function name
|
|
18
|
+
* @param type_args move function type args
|
|
19
|
+
* @param args move function args
|
|
20
|
+
*/
|
|
21
|
+
constructor(module_address: AccAddress, module_name: string, function_name: string, type_args: string[], args: string[]);
|
|
22
|
+
static fromAmino(data: ExecuteOperation.Amino): ExecuteOperation;
|
|
23
|
+
toAmino(): ExecuteOperation.Amino;
|
|
24
|
+
static fromData(data: ExecuteOperation.Data): ExecuteOperation;
|
|
25
|
+
toData(): ExecuteOperation.Data;
|
|
26
|
+
static fromProto(proto: ExecuteOperation.Proto): ExecuteOperation;
|
|
27
|
+
toProto(): ExecuteOperation.Proto;
|
|
28
|
+
packAny(): Any;
|
|
29
|
+
static unpackAny(msgAny: Any): ExecuteOperation;
|
|
30
|
+
}
|
|
31
|
+
export declare namespace ExecuteOperation {
|
|
32
|
+
interface Amino {
|
|
33
|
+
type: 'move/ExecuteOperation';
|
|
34
|
+
value: {
|
|
35
|
+
module_address: string;
|
|
36
|
+
module_name: string;
|
|
37
|
+
function_name: string;
|
|
38
|
+
type_args: string[];
|
|
39
|
+
args: string[];
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
interface Data {
|
|
43
|
+
'@type': '/initia.move.v1.ExecuteOperation';
|
|
44
|
+
module_address: string;
|
|
45
|
+
module_name: string;
|
|
46
|
+
function_name: string;
|
|
47
|
+
type_args: string[];
|
|
48
|
+
args: string[];
|
|
49
|
+
}
|
|
50
|
+
type Proto = ExecuteOperation_pb;
|
|
51
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
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.ExecuteOperation = 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
|
+
* ExecuteOperation gov proposal operation type to execute entry function to the system
|
|
24
|
+
*/
|
|
25
|
+
var ExecuteOperation = /** @class */ (function (_super) {
|
|
26
|
+
__extends(ExecuteOperation, _super);
|
|
27
|
+
/**
|
|
28
|
+
* @param module_address module address of entry function
|
|
29
|
+
* @param module_name move module name
|
|
30
|
+
* @param function_name move function name
|
|
31
|
+
* @param type_args move function type args
|
|
32
|
+
* @param args move function args
|
|
33
|
+
*/
|
|
34
|
+
function ExecuteOperation(module_address, module_name, function_name, type_args, args) {
|
|
35
|
+
var _this = _super.call(this) || this;
|
|
36
|
+
_this.module_address = module_address;
|
|
37
|
+
_this.module_name = module_name;
|
|
38
|
+
_this.function_name = function_name;
|
|
39
|
+
_this.type_args = type_args;
|
|
40
|
+
_this.args = args;
|
|
41
|
+
return _this;
|
|
42
|
+
}
|
|
43
|
+
ExecuteOperation.fromAmino = function (data) {
|
|
44
|
+
var _a = data.value, module_address = _a.module_address, module_name = _a.module_name, function_name = _a.function_name, type_args = _a.type_args, args = _a.args;
|
|
45
|
+
return new ExecuteOperation(module_address, module_name, function_name, type_args, args);
|
|
46
|
+
};
|
|
47
|
+
ExecuteOperation.prototype.toAmino = function () {
|
|
48
|
+
var _a = this, module_address = _a.module_address, module_name = _a.module_name, function_name = _a.function_name, type_args = _a.type_args, args = _a.args;
|
|
49
|
+
return {
|
|
50
|
+
type: 'move/ExecuteOperation',
|
|
51
|
+
value: {
|
|
52
|
+
module_address: module_address,
|
|
53
|
+
module_name: module_name,
|
|
54
|
+
function_name: function_name,
|
|
55
|
+
type_args: type_args,
|
|
56
|
+
args: args,
|
|
57
|
+
},
|
|
58
|
+
};
|
|
59
|
+
};
|
|
60
|
+
ExecuteOperation.fromData = function (data) {
|
|
61
|
+
var module_address = data.module_address, module_name = data.module_name, function_name = data.function_name, type_args = data.type_args, args = data.args;
|
|
62
|
+
return new ExecuteOperation(module_address, module_name, function_name, type_args, args);
|
|
63
|
+
};
|
|
64
|
+
ExecuteOperation.prototype.toData = function () {
|
|
65
|
+
var _a = this, module_address = _a.module_address, module_name = _a.module_name, function_name = _a.function_name, type_args = _a.type_args, args = _a.args;
|
|
66
|
+
return {
|
|
67
|
+
'@type': '/initia.move.v1.ExecuteOperation',
|
|
68
|
+
module_address: module_address,
|
|
69
|
+
module_name: module_name,
|
|
70
|
+
function_name: function_name,
|
|
71
|
+
type_args: type_args,
|
|
72
|
+
args: args,
|
|
73
|
+
};
|
|
74
|
+
};
|
|
75
|
+
ExecuteOperation.fromProto = function (proto) {
|
|
76
|
+
return new ExecuteOperation(proto.moduleAddress, proto.moduleName, proto.functionName, proto.typeArgs, proto.args.map(function (arg) { return Buffer.from(arg).toString('base64'); }));
|
|
77
|
+
};
|
|
78
|
+
ExecuteOperation.prototype.toProto = function () {
|
|
79
|
+
var _a = this, module_address = _a.module_address, module_name = _a.module_name, function_name = _a.function_name, type_args = _a.type_args, args = _a.args;
|
|
80
|
+
return proposal_1.ExecuteOperation.fromPartial({
|
|
81
|
+
moduleAddress: module_address,
|
|
82
|
+
moduleName: module_name,
|
|
83
|
+
functionName: function_name,
|
|
84
|
+
typeArgs: type_args,
|
|
85
|
+
args: args.map(function (arg) { return Buffer.from(arg, 'base64'); }),
|
|
86
|
+
});
|
|
87
|
+
};
|
|
88
|
+
ExecuteOperation.prototype.packAny = function () {
|
|
89
|
+
return any_1.Any.fromPartial({
|
|
90
|
+
typeUrl: '/initia.move.v1.ExecuteOperation',
|
|
91
|
+
value: proposal_1.ExecuteOperation.encode(this.toProto()).finish(),
|
|
92
|
+
});
|
|
93
|
+
};
|
|
94
|
+
ExecuteOperation.unpackAny = function (msgAny) {
|
|
95
|
+
return ExecuteOperation.fromProto(proposal_1.ExecuteOperation.decode(msgAny.value));
|
|
96
|
+
};
|
|
97
|
+
return ExecuteOperation;
|
|
98
|
+
}(json_1.JSONSerializable));
|
|
99
|
+
exports.ExecuteOperation = ExecuteOperation;
|
|
100
|
+
//# sourceMappingURL=ExecuteOperation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExecuteOperation.js","sourceRoot":"","sources":["../../../../src/core/move/proposals/ExecuteOperation.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAsD;AACtD,gEAA+D;AAC/D,0EAAwG;AAGxG;;GAEG;AACH;IAAsC,oCAIrC;IACC;;;;;;OAMG;IACH,0BACS,cAA0B,EAC1B,WAAmB,EACnB,aAAqB,EACrB,SAAmB,EACnB,IAAc;QALvB,YAOE,iBAAO,SACR;QAPQ,oBAAc,GAAd,cAAc,CAAY;QAC1B,iBAAW,GAAX,WAAW,CAAQ;QACnB,mBAAa,GAAb,aAAa,CAAQ;QACrB,eAAS,GAAT,SAAS,CAAU;QACnB,UAAI,GAAJ,IAAI,CAAU;;IAGvB,CAAC;IAEa,0BAAS,GAAvB,UACE,IAA4B;QAG1B,IAAA,KAOE,IAAI,MADL,EALC,cAAc,oBAAA,EACd,WAAW,iBAAA,EACX,aAAa,mBAAA,EACb,SAAS,eAAA,EACT,IAAI,UACL,CACM;QACT,OAAO,IAAI,gBAAgB,CACzB,cAAc,EACd,WAAW,EACX,aAAa,EACb,SAAS,EACT,IAAI,CACL,CAAC;IACJ,CAAC;IAEM,kCAAO,GAAd;QACQ,IAAA,KAAkE,IAAI,EAApE,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,IAAA,KAAkE,IAAI,EAApE,cAAc,oBAAA,EAAE,WAAW,iBAAA,EAAE,aAAa,mBAAA,EAAE,SAAS,eAAA,EAAE,IAAI,UAAS,CAAC;QAC7E,OAAO,2BAAmB,CAAC,WAAW,CAAC;YACrC,aAAa,EAAE,cAAc;YAC7B,UAAU,EAAE,WAAW;YACvB,YAAY,EAAE,aAAa;YAC3B,QAAQ,EAAE,SAAS;YACnB,IAAI,EAAE,IAAI,CAAC,GAAG,CAAC,UAAA,GAAG,IAAI,OAAA,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,QAAQ,CAAC,EAA1B,CAA0B,CAAC;SAClD,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,AAtHD,CAAsC,uBAAgB,GAsHrD;AAtHY,4CAAgB"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { JSONSerializable } from '../../../util/json';
|
|
2
|
+
import { Any } from '@initia/initia.proto/google/protobuf/any';
|
|
3
|
+
import { ExecuteOperation } from './ExecuteOperation';
|
|
4
|
+
import { PublishOperation } from './PublishOperation';
|
|
5
|
+
import { OperationsProposal as OperationsProposal_pb } from '@initia/initia.proto/initia/move//v1/proposal';
|
|
6
|
+
/**
|
|
7
|
+
* OperationsProposal proposal which supports submitting arbitrary move operations
|
|
8
|
+
*/
|
|
9
|
+
export declare class OperationsProposal extends JSONSerializable<OperationsProposal.Amino, OperationsProposal.Data, OperationsProposal.Proto> {
|
|
10
|
+
title: string;
|
|
11
|
+
description: string;
|
|
12
|
+
operations: OperationsProposal.Operation[];
|
|
13
|
+
/**
|
|
14
|
+
* @param title a short summary
|
|
15
|
+
* @param description a human readable text
|
|
16
|
+
* @param operations arbitrary move operations
|
|
17
|
+
*/
|
|
18
|
+
constructor(title: string, description: string, operations: OperationsProposal.Operation[]);
|
|
19
|
+
static fromAmino(data: OperationsProposal.Amino): OperationsProposal;
|
|
20
|
+
toAmino(): OperationsProposal.Amino;
|
|
21
|
+
static fromData(data: OperationsProposal.Data): OperationsProposal;
|
|
22
|
+
toData(): OperationsProposal.Data;
|
|
23
|
+
static fromProto(proto: OperationsProposal.Proto): OperationsProposal;
|
|
24
|
+
toProto(): OperationsProposal.Proto;
|
|
25
|
+
packAny(): Any;
|
|
26
|
+
static unpackAny(msgAny: Any): OperationsProposal;
|
|
27
|
+
}
|
|
28
|
+
export declare namespace OperationsProposal {
|
|
29
|
+
type Operation = ExecuteOperation | PublishOperation;
|
|
30
|
+
namespace Operation {
|
|
31
|
+
type Amino = ExecuteOperation.Amino | PublishOperation.Amino;
|
|
32
|
+
type Data = ExecuteOperation.Data | PublishOperation.Data;
|
|
33
|
+
type Proto = ExecuteOperation.Proto | PublishOperation.Proto;
|
|
34
|
+
function fromAmino(amino: OperationsProposal.Operation.Amino): OperationsProposal.Operation;
|
|
35
|
+
function fromData(data: OperationsProposal.Operation.Data): OperationsProposal.Operation;
|
|
36
|
+
function fromProto(anyProto: Any): OperationsProposal.Operation;
|
|
37
|
+
}
|
|
38
|
+
interface Amino {
|
|
39
|
+
type: 'move/OperationsProposal';
|
|
40
|
+
value: {
|
|
41
|
+
title: string;
|
|
42
|
+
description: string;
|
|
43
|
+
operations: {
|
|
44
|
+
operation: Operation.Amino;
|
|
45
|
+
}[];
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
interface Data {
|
|
49
|
+
'@type': '/initia.move.v1.OperationsProposal';
|
|
50
|
+
title: string;
|
|
51
|
+
description: string;
|
|
52
|
+
operations: {
|
|
53
|
+
operation: Operation.Data;
|
|
54
|
+
}[];
|
|
55
|
+
}
|
|
56
|
+
type Proto = OperationsProposal_pb;
|
|
57
|
+
}
|
|
@@ -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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,CAAC,CAAC;aAC5C;QACH,CAAC;QAPe,mBAAS,YAOxB,CAAA;QAED,SAAgB,QAAQ,CAAC,IAAuC;YAC9D,QAAQ,IAAI,CAAC,OAAO,CAAC,EAAE;gBACrB,KAAK,kCAAkC;oBACrC,OAAO,mCAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;gBACzC,KAAK,kCAAkC;oBACrC,OAAO,mCAAgB,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;aAC1C;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
|
+
}
|