@terra-money/terra.js
Advanced tools
Comparing version 2.0.15-beta.1 to 2.0.15
@@ -130,3 +130,9 @@ import { BaseAPI } from './BaseAPI'; | ||
*/ | ||
estimateFee(sourceAddress: string, msgs: Msg[], options?: Partial<CreateTxOptions>): Promise<StdFee>; | ||
estimateFee(sourceAddress: string, msgs: Msg[], options?: { | ||
memo?: string; | ||
gas?: string; | ||
gasPrices?: Coins.Input; | ||
gasAdjustment?: Numeric.Input; | ||
feeDenoms?: string[]; | ||
}): Promise<StdFee>; | ||
/** | ||
@@ -133,0 +139,0 @@ * Encode a transaction to Amino-encoding |
@@ -169,9 +169,10 @@ "use strict"; | ||
TxAPI.prototype.estimateFee = function (sourceAddress, msgs, options) { | ||
if (options === void 0) { options = {}; } | ||
return __awaiter(this, void 0, void 0, function () { | ||
var gasPrices, gasAdjustment, feeDenoms, gasPricesCoins, gasPricesCoinsFiltered, data; | ||
var memo, gas, gasPrices, gasAdjustment, feeDenoms, gasPricesCoins, gasPricesCoinsFiltered, data; | ||
return __generator(this, function (_a) { | ||
gasPrices = options.gasPrices || this.lcd.config.gasPrices; | ||
gasAdjustment = options.gasAdjustment || this.lcd.config.gasAdjustment; | ||
feeDenoms = options.feeDenoms || ['uluna']; | ||
memo = options === null || options === void 0 ? void 0 : options.memo; | ||
gas = options === null || options === void 0 ? void 0 : options.gas; | ||
gasPrices = (options === null || options === void 0 ? void 0 : options.gasPrices) || this.lcd.config.gasPrices; | ||
gasAdjustment = (options === null || options === void 0 ? void 0 : options.gasAdjustment) || this.lcd.config.gasAdjustment; | ||
feeDenoms = (options === null || options === void 0 ? void 0 : options.feeDenoms) || ['uluna']; | ||
if (gasPrices) { | ||
@@ -191,9 +192,7 @@ gasPricesCoins = new core_1.Coins(gasPrices); | ||
chain_id: this.lcd.config.chainID, | ||
memo: options.memo, | ||
memo: memo, | ||
from: sourceAddress, | ||
gas: options.gas || 'auto', | ||
gas: gas || 'auto', | ||
gas_prices: gasPricesCoins && gasPricesCoins.toData(), | ||
gas_adjustment: gasAdjustment && gasAdjustment.toString(), | ||
account_number: typeof options.account_number === 'number' && options.account_number.toString(), | ||
sequence: typeof options.sequence === 'number' && options.sequence.toString(), | ||
}, | ||
@@ -200,0 +199,0 @@ msgs: msgs.map(function (m) { return m.toData(); }), |
@@ -0,1 +1,2 @@ | ||
/// <reference types="node" /> | ||
import { CreateTxOptions } from '../client'; | ||
@@ -14,2 +15,6 @@ interface ResponseData { | ||
} | ||
interface SignBytesOption { | ||
bytes: Buffer; | ||
purgeQueue?: boolean; | ||
} | ||
declare global { | ||
@@ -117,2 +122,16 @@ interface Window { | ||
/** | ||
* Request for signing bytes | ||
* | ||
* @return {string} name 'onSign' | ||
* @return {object} payload | ||
* @return {number} payload.id identifier | ||
* @return {string} payload.origin origin address | ||
* @return {Msg[]} payload.msgs requested msgs | ||
* @return {boolean} payload.success | ||
* @return {string} payload.result.public_key Base64 encoded public key | ||
* @return {string} payload.result.signature Base64 encoded signature | ||
* @return {number} payload.result.recid Recovery id | ||
*/ | ||
signBytes(options: SignBytesOption): number; | ||
/** | ||
* Request for sign and post to LCD server | ||
@@ -119,0 +138,0 @@ * |
@@ -198,2 +198,21 @@ "use strict"; | ||
/** | ||
* Request for signing bytes | ||
* | ||
* @return {string} name 'onSign' | ||
* @return {object} payload | ||
* @return {number} payload.id identifier | ||
* @return {string} payload.origin origin address | ||
* @return {Msg[]} payload.msgs requested msgs | ||
* @return {boolean} payload.success | ||
* @return {string} payload.result.public_key Base64 encoded public key | ||
* @return {string} payload.result.signature Base64 encoded signature | ||
* @return {number} payload.result.recid Recovery id | ||
*/ | ||
Extension.prototype.signBytes = function (options) { | ||
return this.send('sign', { | ||
bytes: options.bytes.toString('base64'), | ||
purgeQueue: options.purgeQueue, | ||
}); | ||
}; | ||
/** | ||
* Request for sign and post to LCD server | ||
@@ -200,0 +219,0 @@ * |
{ | ||
"name": "@terra-money/terra.js", | ||
"version": "2.0.15-beta.1", | ||
"version": "2.0.15", | ||
"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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
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
Long strings
Supply chain riskContains long string literals, which may be a sign of obfuscated or packed code.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
2
5173810
360
17842