@initia/initia.js 0.0.15 → 0.0.17
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 +0 -2
- package/dist/bundle.node.js.map +1 -1
- package/dist/client/lcd/api/MoveAPI.d.ts +15 -1
- package/dist/client/lcd/api/MoveAPI.js +28 -0
- package/dist/client/lcd/api/MoveAPI.js.map +1 -1
- package/dist/core/Msg.js +0 -12
- package/dist/core/Msg.js.map +1 -1
- package/dist/core/bech32.js +3 -6
- package/dist/core/bech32.js.map +1 -1
- package/dist/core/gov/Proposal.d.ts +5 -5
- package/dist/core/gov/Proposal.js +6 -6
- package/dist/core/gov/Proposal.js.map +1 -1
- package/dist/core/index.d.ts +1 -1
- package/dist/core/index.js +1 -1
- package/dist/core/index.js.map +1 -1
- package/dist/core/move/StorageFee.d.ts +34 -0
- package/dist/core/move/StorageFee.js +78 -0
- package/dist/core/move/StorageFee.js.map +1 -0
- package/dist/core/move/msgs/MsgExecuteEntryFunction.d.ts +7 -7
- package/dist/core/move/msgs/MsgExecuteEntryFunction.js +17 -17
- package/dist/core/move/msgs/MsgExecuteEntryFunction.js.map +1 -1
- package/dist/core/move/msgs/index.d.ts +4 -8
- package/dist/core/move/msgs/index.js +0 -2
- package/dist/core/move/msgs/index.js.map +1 -1
- package/dist/core/move/proposals/ExecuteEntryFunctionProposal.d.ts +54 -0
- package/dist/core/move/proposals/ExecuteEntryFunctionProposal.js +105 -0
- package/dist/core/move/proposals/ExecuteEntryFunctionProposal.js.map +1 -0
- package/dist/core/move/proposals/index.d.ts +1 -1
- package/dist/core/move/proposals/index.js +1 -1
- package/dist/core/move/proposals/index.js.map +1 -1
- package/dist/key/MnemonicKey.d.ts +1 -1
- package/dist/key/MnemonicKey.js +3 -3
- package/dist/key/MnemonicKey.js.map +1 -1
- package/package.json +2 -3
|
@@ -24,16 +24,16 @@ var MsgExecuteEntryFunction = /** @class */ (function (_super) {
|
|
|
24
24
|
__extends(MsgExecuteEntryFunction, _super);
|
|
25
25
|
/**
|
|
26
26
|
* @param sender contract user
|
|
27
|
-
* @param
|
|
27
|
+
* @param module_address module deployer address
|
|
28
28
|
* @param module_name name of module to execute
|
|
29
29
|
* @param function_name name of function to execute
|
|
30
30
|
* @param type_args type arguments of function to execute
|
|
31
31
|
* @param args arguments of function to execute
|
|
32
32
|
*/
|
|
33
|
-
function MsgExecuteEntryFunction(sender,
|
|
33
|
+
function MsgExecuteEntryFunction(sender, module_address, module_name, function_name, type_args, args) {
|
|
34
34
|
var _this = _super.call(this) || this;
|
|
35
35
|
_this.sender = sender;
|
|
36
|
-
_this.
|
|
36
|
+
_this.module_address = module_address;
|
|
37
37
|
_this.module_name = module_name;
|
|
38
38
|
_this.function_name = function_name;
|
|
39
39
|
_this.type_args = type_args;
|
|
@@ -41,16 +41,16 @@ var MsgExecuteEntryFunction = /** @class */ (function (_super) {
|
|
|
41
41
|
return _this;
|
|
42
42
|
}
|
|
43
43
|
MsgExecuteEntryFunction.fromAmino = function (data) {
|
|
44
|
-
var _a = data.value, sender = _a.sender,
|
|
45
|
-
return new MsgExecuteEntryFunction(sender,
|
|
44
|
+
var _a = data.value, sender = _a.sender, 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 MsgExecuteEntryFunction(sender, module_address, module_name, function_name, type_args, args);
|
|
46
46
|
};
|
|
47
47
|
MsgExecuteEntryFunction.prototype.toAmino = function () {
|
|
48
|
-
var _a = this, sender = _a.sender,
|
|
48
|
+
var _a = this, sender = _a.sender, module_address = _a.module_address, module_name = _a.module_name, function_name = _a.function_name, type_args = _a.type_args, args = _a.args;
|
|
49
49
|
return {
|
|
50
50
|
type: 'move/MsgExecuteEntryFunction',
|
|
51
51
|
value: {
|
|
52
52
|
sender: sender,
|
|
53
|
-
|
|
53
|
+
module_address: module_address,
|
|
54
54
|
module_name: module_name,
|
|
55
55
|
function_name: function_name,
|
|
56
56
|
type_args: type_args,
|
|
@@ -59,13 +59,13 @@ var MsgExecuteEntryFunction = /** @class */ (function (_super) {
|
|
|
59
59
|
};
|
|
60
60
|
};
|
|
61
61
|
MsgExecuteEntryFunction.fromProto = function (data) {
|
|
62
|
-
return new MsgExecuteEntryFunction(data.sender, data.
|
|
62
|
+
return new MsgExecuteEntryFunction(data.sender, data.moduleAddress, data.moduleName, data.functionName, data.typeArgs, data.args.map(function (arg) { return Buffer.from(arg).toString('base64'); }));
|
|
63
63
|
};
|
|
64
64
|
MsgExecuteEntryFunction.prototype.toProto = function () {
|
|
65
|
-
var _a = this, sender = _a.sender,
|
|
65
|
+
var _a = this, sender = _a.sender, module_address = _a.module_address, module_name = _a.module_name, function_name = _a.function_name, type_args = _a.type_args, args = _a.args;
|
|
66
66
|
return tx_1.MsgExecuteEntryFunction.fromPartial({
|
|
67
67
|
sender: sender,
|
|
68
|
-
|
|
68
|
+
moduleAddress: module_address,
|
|
69
69
|
moduleName: module_name,
|
|
70
70
|
functionName: function_name,
|
|
71
71
|
typeArgs: type_args,
|
|
@@ -82,15 +82,15 @@ var MsgExecuteEntryFunction = /** @class */ (function (_super) {
|
|
|
82
82
|
return MsgExecuteEntryFunction.fromProto(tx_1.MsgExecuteEntryFunction.decode(msgAny.value));
|
|
83
83
|
};
|
|
84
84
|
MsgExecuteEntryFunction.fromData = function (data) {
|
|
85
|
-
var sender = data.sender,
|
|
86
|
-
return new MsgExecuteEntryFunction(sender,
|
|
85
|
+
var sender = data.sender, module_address = data.module_address, module_name = data.module_name, function_name = data.function_name, type_args = data.type_args, args = data.args;
|
|
86
|
+
return new MsgExecuteEntryFunction(sender, module_address, module_name, function_name, type_args, args);
|
|
87
87
|
};
|
|
88
88
|
MsgExecuteEntryFunction.prototype.toData = function () {
|
|
89
|
-
var _a = this, sender = _a.sender,
|
|
89
|
+
var _a = this, sender = _a.sender, module_address = _a.module_address, module_name = _a.module_name, function_name = _a.function_name, type_args = _a.type_args, args = _a.args;
|
|
90
90
|
return {
|
|
91
91
|
'@type': '/initia.move.v1.MsgExecuteEntryFunction',
|
|
92
92
|
sender: sender,
|
|
93
|
-
|
|
93
|
+
module_address: module_address,
|
|
94
94
|
module_name: module_name,
|
|
95
95
|
function_name: function_name,
|
|
96
96
|
type_args: type_args,
|
|
@@ -131,7 +131,7 @@ var MsgExecuteEntryFunction = /** @class */ (function (_super) {
|
|
|
131
131
|
* console.assert(msg1.toJSON(), msg2.toJSON()
|
|
132
132
|
*
|
|
133
133
|
* @param sender
|
|
134
|
-
* @param
|
|
134
|
+
* @param module_address
|
|
135
135
|
* @param module_name
|
|
136
136
|
* @param function_name
|
|
137
137
|
* @param type_args
|
|
@@ -139,13 +139,13 @@ var MsgExecuteEntryFunction = /** @class */ (function (_super) {
|
|
|
139
139
|
* @param abi // base64 encoded module abi
|
|
140
140
|
* @returns
|
|
141
141
|
*/
|
|
142
|
-
MsgExecuteEntryFunction.fromPlainArgs = function (sender,
|
|
142
|
+
MsgExecuteEntryFunction.fromPlainArgs = function (sender, module_address, module_name, function_name, type_args, args, abi) {
|
|
143
143
|
var module = JSON.parse(Buffer.from(abi, 'base64').toString());
|
|
144
144
|
var functionAbi = module.exposed_functions.find(function (exposedFunction) { return exposedFunction.name === function_name; });
|
|
145
145
|
if (!functionAbi) {
|
|
146
146
|
throw Error('function not found');
|
|
147
147
|
}
|
|
148
|
-
return new MsgExecuteEntryFunction(sender,
|
|
148
|
+
return new MsgExecuteEntryFunction(sender, module_address, module_name, function_name, type_args, (0, util_1.argsEncodeWithABI)(args, functionAbi));
|
|
149
149
|
};
|
|
150
150
|
return MsgExecuteEntryFunction;
|
|
151
151
|
}(json_1.JSONSerializable));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MsgExecuteEntryFunction.js","sourceRoot":"","sources":["../../../../src/core/move/msgs/MsgExecuteEntryFunction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAsD;AAEtD,gEAA+D;AAC/D,6DAA+G;AAC/G,sCAAkD;AAGlD;IAA6C,2CAI5C;IACC;;;;;;;OAOG;IACH,iCACS,MAAkB,EAClB,
|
|
1
|
+
{"version":3,"file":"MsgExecuteEntryFunction.js","sourceRoot":"","sources":["../../../../src/core/move/msgs/MsgExecuteEntryFunction.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAsD;AAEtD,gEAA+D;AAC/D,6DAA+G;AAC/G,sCAAkD;AAGlD;IAA6C,2CAI5C;IACC;;;;;;;OAOG;IACH,iCACS,MAAkB,EAClB,cAA0B,EAC1B,WAAmB,EACnB,aAAqB,EACrB,SAAmB,EACnB,IAAc;QANvB,YAQE,iBAAO,SACR;QARQ,YAAM,GAAN,MAAM,CAAY;QAClB,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,iCAAS,GAAvB,UACE,IAAmC;QAGjC,IAAA,KAQE,IAAI,MADL,EANC,MAAM,YAAA,EACN,cAAc,oBAAA,EACd,WAAW,iBAAA,EACX,aAAa,mBAAA,EACb,SAAS,eAAA,EACT,IAAI,UACL,CACM;QACT,OAAO,IAAI,uBAAuB,CAChC,MAAM,EACN,cAAc,EACd,WAAW,EACX,aAAa,EACb,SAAS,EACT,IAAI,CACL,CAAC;IACJ,CAAC;IAEM,yCAAO,GAAd;QACQ,IAAA,KACJ,IAAI,EADE,MAAM,YAAA,EAAE,cAAc,oBAAA,EAAE,WAAW,iBAAA,EAAE,aAAa,mBAAA,EAAE,SAAS,eAAA,EAAE,IAAI,UACrE,CAAC;QAEP,OAAO;YACL,IAAI,EAAE,8BAA8B;YACpC,KAAK,EAAE;gBACL,MAAM,QAAA;gBACN,c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oBAAoB,CAAC,CAAC;SACnC;QAED,OAAO,IAAI,uBAAuB,CAChC,MAAM,EACN,cAAc,EACd,WAAW,EACX,aAAa,EACb,SAAS,EACT,IAAA,wBAAiB,EAAC,IAAI,EAAE,WAAW,CAAC,CACrC,CAAC;IACJ,CAAC;IACH,8BAAC;AAAD,CAAC,AA1MD,CAA6C,uBAAgB,GA0M5D;AA1MY,0DAAuB"}
|
|
@@ -1,16 +1,12 @@
|
|
|
1
1
|
import { MsgPublishModuleBundle } from './MsgPublishModuleBundle';
|
|
2
2
|
import { MsgExecuteEntryFunction } from './MsgExecuteEntryFunction';
|
|
3
3
|
import { MsgExecuteScript } from './MsgExecuteScript';
|
|
4
|
-
import { MsgConvertNativeCoin } from './MsgConvertNativeCoin';
|
|
5
|
-
import { MsgConvertMoveCoin } from './MsgConvertMoveCoin';
|
|
6
4
|
export * from './MsgPublishModuleBundle';
|
|
7
5
|
export * from './MsgExecuteEntryFunction';
|
|
8
6
|
export * from './MsgExecuteScript';
|
|
9
|
-
export
|
|
10
|
-
export * from './MsgConvertMoveCoin';
|
|
11
|
-
export declare type MoveMsg = MsgPublishModuleBundle | MsgExecuteEntryFunction | MsgExecuteScript | MsgConvertNativeCoin | MsgConvertMoveCoin;
|
|
7
|
+
export declare type MoveMsg = MsgPublishModuleBundle | MsgExecuteEntryFunction | MsgExecuteScript;
|
|
12
8
|
export declare namespace MoveMsg {
|
|
13
|
-
type Amino = MsgPublishModuleBundle.Amino | MsgExecuteEntryFunction.Amino | MsgExecuteScript.Amino
|
|
14
|
-
type Data = MsgPublishModuleBundle.Data | MsgExecuteEntryFunction.Data | MsgExecuteScript.Data
|
|
15
|
-
type Proto = MsgPublishModuleBundle.Proto | MsgExecuteEntryFunction.Proto | MsgExecuteScript.Proto
|
|
9
|
+
type Amino = MsgPublishModuleBundle.Amino | MsgExecuteEntryFunction.Amino | MsgExecuteScript.Amino;
|
|
10
|
+
type Data = MsgPublishModuleBundle.Data | MsgExecuteEntryFunction.Data | MsgExecuteScript.Data;
|
|
11
|
+
type Proto = MsgPublishModuleBundle.Proto | MsgExecuteEntryFunction.Proto | MsgExecuteScript.Proto;
|
|
16
12
|
}
|
|
@@ -17,6 +17,4 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
17
17
|
__exportStar(require("./MsgPublishModuleBundle"), exports);
|
|
18
18
|
__exportStar(require("./MsgExecuteEntryFunction"), exports);
|
|
19
19
|
__exportStar(require("./MsgExecuteScript"), exports);
|
|
20
|
-
__exportStar(require("./MsgConvertNativeCoin"), exports);
|
|
21
|
-
__exportStar(require("./MsgConvertMoveCoin"), exports);
|
|
22
20
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/move/msgs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/move/msgs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAIA,2DAAyC;AACzC,4DAA0C;AAC1C,qDAAmC"}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { JSONSerializable } from '../../../util/json';
|
|
2
|
+
import { Any } from '@initia/initia.proto/google/protobuf/any';
|
|
3
|
+
import { ExecuteEntryFunctionProposal as ExecuteEntryFunctionProposal_pb } from '@initia/initia.proto/initia/move//v1/proposal';
|
|
4
|
+
/**
|
|
5
|
+
* ExecuteEntryFunctionProposal gov proposal content type to execute entry function to the system
|
|
6
|
+
*/
|
|
7
|
+
export declare class ExecuteEntryFunctionProposal extends JSONSerializable<ExecuteEntryFunctionProposal.Amino, ExecuteEntryFunctionProposal.Data, ExecuteEntryFunctionProposal.Proto> {
|
|
8
|
+
title: string;
|
|
9
|
+
description: string;
|
|
10
|
+
module_name: string;
|
|
11
|
+
function_name: string;
|
|
12
|
+
type_args: string[];
|
|
13
|
+
args: string[];
|
|
14
|
+
/**
|
|
15
|
+
* @param title a short summary
|
|
16
|
+
* @param description a human readable text
|
|
17
|
+
* @param module_name a move module name
|
|
18
|
+
* @param function_name a move function name
|
|
19
|
+
* @param type_args move function type args
|
|
20
|
+
* @param args move function args
|
|
21
|
+
*/
|
|
22
|
+
constructor(title: string, description: string, module_name: string, function_name: string, type_args: string[], args: string[]);
|
|
23
|
+
static fromAmino(data: ExecuteEntryFunctionProposal.Amino): ExecuteEntryFunctionProposal;
|
|
24
|
+
toAmino(): ExecuteEntryFunctionProposal.Amino;
|
|
25
|
+
static fromData(data: ExecuteEntryFunctionProposal.Data): ExecuteEntryFunctionProposal;
|
|
26
|
+
toData(): ExecuteEntryFunctionProposal.Data;
|
|
27
|
+
static fromProto(proto: ExecuteEntryFunctionProposal.Proto): ExecuteEntryFunctionProposal;
|
|
28
|
+
toProto(): ExecuteEntryFunctionProposal.Proto;
|
|
29
|
+
packAny(): Any;
|
|
30
|
+
static unpackAny(msgAny: Any): ExecuteEntryFunctionProposal;
|
|
31
|
+
}
|
|
32
|
+
export declare namespace ExecuteEntryFunctionProposal {
|
|
33
|
+
interface Amino {
|
|
34
|
+
type: 'move/ExecuteEntryFunctionProposal';
|
|
35
|
+
value: {
|
|
36
|
+
title: string;
|
|
37
|
+
description: string;
|
|
38
|
+
module_name: string;
|
|
39
|
+
function_name: string;
|
|
40
|
+
type_args: string[];
|
|
41
|
+
args: string[];
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
interface Data {
|
|
45
|
+
'@type': '/initia.move.v1.ExecuteEntryFunctionProposal';
|
|
46
|
+
title: string;
|
|
47
|
+
description: string;
|
|
48
|
+
module_name: string;
|
|
49
|
+
function_name: string;
|
|
50
|
+
type_args: string[];
|
|
51
|
+
args: string[];
|
|
52
|
+
}
|
|
53
|
+
type Proto = ExecuteEntryFunctionProposal_pb;
|
|
54
|
+
}
|
|
@@ -0,0 +1,105 @@
|
|
|
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.ExecuteEntryFunctionProposal = 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
|
+
* ExecuteEntryFunctionProposal gov proposal content type to execute entry function to the system
|
|
24
|
+
*/
|
|
25
|
+
var ExecuteEntryFunctionProposal = /** @class */ (function (_super) {
|
|
26
|
+
__extends(ExecuteEntryFunctionProposal, _super);
|
|
27
|
+
/**
|
|
28
|
+
* @param title a short summary
|
|
29
|
+
* @param description a human readable text
|
|
30
|
+
* @param module_name a move module name
|
|
31
|
+
* @param function_name a move function name
|
|
32
|
+
* @param type_args move function type args
|
|
33
|
+
* @param args move function args
|
|
34
|
+
*/
|
|
35
|
+
function ExecuteEntryFunctionProposal(title, description, module_name, function_name, type_args, args) {
|
|
36
|
+
var _this = _super.call(this) || this;
|
|
37
|
+
_this.title = title;
|
|
38
|
+
_this.description = description;
|
|
39
|
+
_this.module_name = module_name;
|
|
40
|
+
_this.function_name = function_name;
|
|
41
|
+
_this.type_args = type_args;
|
|
42
|
+
_this.args = args;
|
|
43
|
+
return _this;
|
|
44
|
+
}
|
|
45
|
+
ExecuteEntryFunctionProposal.fromAmino = function (data) {
|
|
46
|
+
var _a = data.value, title = _a.title, description = _a.description, module_name = _a.module_name, function_name = _a.function_name, type_args = _a.type_args, args = _a.args;
|
|
47
|
+
return new ExecuteEntryFunctionProposal(title, description, module_name, function_name, type_args, args);
|
|
48
|
+
};
|
|
49
|
+
ExecuteEntryFunctionProposal.prototype.toAmino = function () {
|
|
50
|
+
var _a = this, title = _a.title, description = _a.description, module_name = _a.module_name, function_name = _a.function_name, type_args = _a.type_args, args = _a.args;
|
|
51
|
+
return {
|
|
52
|
+
type: 'move/ExecuteEntryFunctionProposal',
|
|
53
|
+
value: {
|
|
54
|
+
title: title,
|
|
55
|
+
description: description,
|
|
56
|
+
module_name: module_name,
|
|
57
|
+
function_name: function_name,
|
|
58
|
+
type_args: type_args,
|
|
59
|
+
args: args,
|
|
60
|
+
},
|
|
61
|
+
};
|
|
62
|
+
};
|
|
63
|
+
ExecuteEntryFunctionProposal.fromData = function (data) {
|
|
64
|
+
var title = data.title, description = data.description, module_name = data.module_name, function_name = data.function_name, type_args = data.type_args, args = data.args;
|
|
65
|
+
return new ExecuteEntryFunctionProposal(title, description, module_name, function_name, type_args, args);
|
|
66
|
+
};
|
|
67
|
+
ExecuteEntryFunctionProposal.prototype.toData = function () {
|
|
68
|
+
var _a = this, title = _a.title, description = _a.description, module_name = _a.module_name, function_name = _a.function_name, type_args = _a.type_args, args = _a.args;
|
|
69
|
+
return {
|
|
70
|
+
'@type': '/initia.move.v1.ExecuteEntryFunctionProposal',
|
|
71
|
+
title: title,
|
|
72
|
+
description: description,
|
|
73
|
+
module_name: module_name,
|
|
74
|
+
function_name: function_name,
|
|
75
|
+
type_args: type_args,
|
|
76
|
+
args: args,
|
|
77
|
+
};
|
|
78
|
+
};
|
|
79
|
+
ExecuteEntryFunctionProposal.fromProto = function (proto) {
|
|
80
|
+
return new ExecuteEntryFunctionProposal(proto.title, proto.description, proto.moduleName, proto.functionName, proto.typeArgs, proto.args.map(function (arg) { return Buffer.from(arg).toString('base64'); }));
|
|
81
|
+
};
|
|
82
|
+
ExecuteEntryFunctionProposal.prototype.toProto = function () {
|
|
83
|
+
var _a = this, title = _a.title, description = _a.description, module_name = _a.module_name, function_name = _a.function_name, type_args = _a.type_args, args = _a.args;
|
|
84
|
+
return proposal_1.ExecuteEntryFunctionProposal.fromPartial({
|
|
85
|
+
title: title,
|
|
86
|
+
description: description,
|
|
87
|
+
moduleName: module_name,
|
|
88
|
+
functionName: function_name,
|
|
89
|
+
typeArgs: type_args,
|
|
90
|
+
args: args.map(function (arg) { return Buffer.from(arg, 'base64'); }),
|
|
91
|
+
});
|
|
92
|
+
};
|
|
93
|
+
ExecuteEntryFunctionProposal.prototype.packAny = function () {
|
|
94
|
+
return any_1.Any.fromPartial({
|
|
95
|
+
typeUrl: '/initia.move.v1.ExecuteEntryFunctionProposal',
|
|
96
|
+
value: proposal_1.ExecuteEntryFunctionProposal.encode(this.toProto()).finish(),
|
|
97
|
+
});
|
|
98
|
+
};
|
|
99
|
+
ExecuteEntryFunctionProposal.unpackAny = function (msgAny) {
|
|
100
|
+
return ExecuteEntryFunctionProposal.fromProto(proposal_1.ExecuteEntryFunctionProposal.decode(msgAny.value));
|
|
101
|
+
};
|
|
102
|
+
return ExecuteEntryFunctionProposal;
|
|
103
|
+
}(json_1.JSONSerializable));
|
|
104
|
+
exports.ExecuteEntryFunctionProposal = ExecuteEntryFunctionProposal;
|
|
105
|
+
//# sourceMappingURL=ExecuteEntryFunctionProposal.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExecuteEntryFunctionProposal.js","sourceRoot":"","sources":["../../../../src/core/move/proposals/ExecuteEntryFunctionProposal.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,2CAAsD;AACtD,gEAA+D;AAC/D,0EAAgI;AAEhI;;GAEG;AACH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,CAAC;IAEM,8CAAO,GAAd;QACE,OAAO,SAAG,CAAC,WAAW,CAAC;YACrB,OAAO,EAAE,8CAA8C;YACvD,KAAK,EAAE,uCAA+B,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC,CAAC,MAAM,EAAE;SACvE,CAAC,CAAC;IACL,CAAC;IAEa,sCAAS,GAAvB,UAAwB,MAAW;QACjC,OAAO,4BAA4B,CAAC,SAAS,CAC3C,uCAA+B,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CACrD,CAAC;IACJ,CAAC;IACH,mCAAC;AAAD,CAAC,AAlID,CAAkD,uBAAgB,GAkIjE;AAlIY,oEAA4B"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './PublishStdModuleProposal';
|
|
2
|
-
export * from './
|
|
2
|
+
export * from './ExecuteEntryFunctionProposal';
|
|
@@ -15,5 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./PublishStdModuleProposal"), exports);
|
|
18
|
-
__exportStar(require("./
|
|
18
|
+
__exportStar(require("./ExecuteEntryFunctionProposal"), exports);
|
|
19
19
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/move/proposals/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/core/move/proposals/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,6DAA2C;AAC3C,iEAA+C"}
|
package/dist/key/MnemonicKey.js
CHANGED
|
@@ -49,15 +49,15 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
49
49
|
return result;
|
|
50
50
|
};
|
|
51
51
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
-
exports.MnemonicKey = exports.
|
|
52
|
+
exports.MnemonicKey = exports.INIT_COIN_TYPE = void 0;
|
|
53
53
|
var bip32 = __importStar(require("bip32"));
|
|
54
54
|
var bip39 = __importStar(require("bip39"));
|
|
55
55
|
var RawKey_1 = require("./RawKey");
|
|
56
|
-
exports.
|
|
56
|
+
exports.INIT_COIN_TYPE = 118;
|
|
57
57
|
var DEFAULT_OPTIONS = {
|
|
58
58
|
account: 0,
|
|
59
59
|
index: 0,
|
|
60
|
-
coinType: exports.
|
|
60
|
+
coinType: exports.INIT_COIN_TYPE,
|
|
61
61
|
};
|
|
62
62
|
/**
|
|
63
63
|
* Implements a BIP39 mnemonic wallet with standard key derivation from a word list. Note
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MnemonicKey.js","sourceRoot":"","sources":["../../src/key/MnemonicKey.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+B;AAC/B,2CAA+B;AAC/B,mCAAkC;AAErB,QAAA,
|
|
1
|
+
{"version":3,"file":"MnemonicKey.js","sourceRoot":"","sources":["../../src/key/MnemonicKey.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA+B;AAC/B,2CAA+B;AAC/B,mCAAkC;AAErB,QAAA,cAAc,GAAG,GAAG,CAAC;AAwBlC,IAAM,eAAe,GAAG;IACtB,OAAO,EAAE,CAAC;IACV,KAAK,EAAE,CAAC;IACR,QAAQ,EAAE,sBAAc;CACzB,CAAC;AAEF;;;;GAIG;AACH;IAAiC,+BAAM;IAMrC;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,qBAAY,OAAgC;QAAhC,wBAAA,EAAA,YAAgC;QAA5C,iBAqBC;QApBO,IAAA,2BACD,eAAe,GACf,OAAO,CACX,EAHO,OAAO,aAAA,EAAE,KAAK,WAAA,EAAE,QAAQ,cAG/B,CAAC;QACI,IAAA,QAAQ,GAAK,OAAO,SAAZ,CAAa;QAC3B,IAAI,QAAQ,KAAK,SAAS,EAAE;YAC1B,QAAQ,GAAG,KAAK,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC;SACxC;QACD,IAAM,IAAI,GAAW,KAAK,CAAC,kBAAkB,CAAC,QAAQ,CAAC,CAAC;QACxD,IAAM,SAAS,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;QACvC,IAAM,YAAY,GAAG,gBAAS,QAAQ,eAAK,OAAO,iBAAO,KAAK,CAAE,CAAC;QACjE,IAAM,QAAQ,GAAG,SAAS,CAAC,UAAU,CAAC,YAAY,CAAC,CAAC;QACpD,IAAM,UAAU,GAAG,QAAQ,CAAC,UAAU,CAAC;QAEvC,IAAI,CAAC,UAAU,EAAE;YACf,MAAM,IAAI,KAAK,CAAC,2BAA2B,CAAC,CAAC;SAC9C;gBAED,kBAAM,UAAU,CAAC;QACjB,KAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;;IAC3B,CAAC;IACH,kBAAC;AAAD,CAAC,AAlDD,CAAiC,eAAM,GAkDtC;AAlDY,kCAAW"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@initia/initia.js",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.17",
|
|
4
4
|
"description": "The JavaScript SDK for Initia",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "InitiaLabs",
|
|
@@ -82,11 +82,10 @@
|
|
|
82
82
|
"webpack-cli": "^4.10.0"
|
|
83
83
|
},
|
|
84
84
|
"dependencies": {
|
|
85
|
-
"@initia/initia.proto": "^0.0.
|
|
85
|
+
"@initia/initia.proto": "^0.0.4-alpha1",
|
|
86
86
|
"@mysten/bcs": "^0.5.0",
|
|
87
87
|
"axios": "^0.27.2",
|
|
88
88
|
"bech32": "^2.0.0",
|
|
89
|
-
"bech32-converting": "^1.0.9",
|
|
90
89
|
"bignumber.js": "^9.1.0",
|
|
91
90
|
"bip32": "^2.0.6",
|
|
92
91
|
"bip39": "^3.0.4",
|