@terra-money/terra.js
Advanced tools
Comparing version 2.1.16 to 2.1.17
@@ -164,6 +164,2 @@ import { BaseAPI } from './BaseAPI'; | ||
/** | ||
* convert message if msg is amino-typed object. | ||
*/ | ||
private convertMsg; | ||
/** | ||
* Builds a [[StdSignMsg]] that is ready to be signed by a [[Key]]. The appropriate | ||
@@ -170,0 +166,0 @@ * account number and sequence will be fetched live from the blockchain and added to |
@@ -101,12 +101,2 @@ "use strict"; | ||
/** | ||
* convert message if msg is amino-typed object. | ||
*/ | ||
TxAPI.prototype.convertMsg = function (msg) { | ||
// amino case | ||
if ('type' in msg && 'value' in msg) { | ||
return core_1.Msg.fromAmino(msg); | ||
} | ||
return msg; | ||
}; | ||
/** | ||
* Builds a [[StdSignMsg]] that is ready to be signed by a [[Key]]. The appropriate | ||
@@ -124,3 +114,2 @@ * account number and sequence will be fetched live from the blockchain and added to | ||
var fee, msgs, memo, timeoutHeight, signerDatas, _i, signers_1, signer, sequenceNumber, publicKey, account; | ||
var _this = this; | ||
return __generator(this, function (_a) { | ||
@@ -131,4 +120,2 @@ switch (_a.label) { | ||
msgs = options.msgs, memo = options.memo, timeoutHeight = options.timeoutHeight; | ||
// TODO: remove it when amino is completely abandoned | ||
options.msgs = msgs.map(function (m) { return _this.convertMsg(m); }); | ||
signerDatas = []; | ||
@@ -167,11 +154,4 @@ _i = 0, signers_1 = signers; | ||
fee = _a.sent(); | ||
return [3 /*break*/, 8]; | ||
case 7: | ||
if (!(fee instanceof core_1.Fee)) { | ||
// fee is NOT proto-compatible | ||
// TODO: remove it when amino is completely abandoned | ||
fee = core_1.Fee.fromAmino(fee); | ||
} | ||
_a.label = 8; | ||
case 8: return [2 /*return*/, new core_1.Tx(new core_1.TxBody(options.msgs, memo || '', timeoutHeight || 0), new core_1.AuthInfo([], fee), [])]; | ||
_a.label = 7; | ||
case 7: return [2 /*return*/, new core_1.Tx(new core_1.TxBody(msgs, memo || '', timeoutHeight || 0), new core_1.AuthInfo([], fee), [])]; | ||
} | ||
@@ -178,0 +158,0 @@ }); |
@@ -31,3 +31,2 @@ import { JSONSerializable } from '../util/json'; | ||
constructor(chain_id: string, account_number: number, sequence: number, auth_info: AuthInfo, tx_body: TxBody); | ||
static fromAmino(data: SignDoc.Amino): SignDoc; | ||
toAmino(): SignDoc.Amino; | ||
@@ -34,0 +33,0 @@ toData(): SignDoc.Data; |
@@ -39,4 +39,2 @@ "use strict"; | ||
var json_1 = require("../util/json"); | ||
var Fee_1 = require("./Fee"); | ||
var Msg_1 = require("./Msg"); | ||
var Long = __importStar(require("long")); | ||
@@ -74,6 +72,2 @@ var tx_1 = require("@terra-money/terra.proto/cosmos/tx/v1beta1/tx"); | ||
} | ||
SignDoc.fromAmino = function (data) { | ||
var doc = new SignDoc(data.chain_id, Number.parseInt(data.account_number), Number.parseInt(data.sequence), new Tx_1.AuthInfo([], Fee_1.Fee.fromAmino(data.fee)), new Tx_1.TxBody(data.msgs.map(function (msg) { return Msg_1.Msg.fromAmino(msg); }), data.memo, Number.parseInt(data.timeout_height || '0'))); | ||
return doc; | ||
}; | ||
SignDoc.prototype.toAmino = function () { | ||
@@ -80,0 +74,0 @@ var _a = this, chain_id = _a.chain_id, account_number = _a.account_number, sequence = _a.sequence, _b = _a.tx_body, memo = _b.memo, messages = _b.messages, timeout_height = _b.timeout_height, fee = _a.auth_info.fee; |
{ | ||
"name": "@terra-money/terra.js", | ||
"version": "2.1.16", | ||
"version": "2.1.17", | ||
"description": "The JavaScript SDK for Terra", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
13251251
35250