Socket
Socket
Sign inDemoInstall

@terra-money/terra.js

Package Overview
Dependencies
53
Maintainers
4
Versions
230
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.1 to 0.4.2

dist/client/lcd/api/MsgAuthAPI.d.ts

1

dist/client/lcd/api/index.d.ts

@@ -6,2 +6,3 @@ export * from './AuthAPI';

export * from './MarketAPI';
export * from './MsgAuthAPI';
export * from './OracleAPI';

@@ -8,0 +9,0 @@ export * from './SlashingAPI';

@@ -18,2 +18,3 @@ "use strict";

__exportStar(require("./MarketAPI"), exports);
__exportStar(require("./MsgAuthAPI"), exports);
__exportStar(require("./OracleAPI"), exports);

@@ -20,0 +21,0 @@ __exportStar(require("./SlashingAPI"), exports);

import { BaseAPI } from './BaseAPI';
import { ValAddress, Denom, ExchangeRateVote, Coin, Coins, ExchangeRatePrevote, AccAddress, Dec } from '../../../core';
import { ValAddress, Denom, ExchangeRateVote, Coin, Coins, ExchangeRatePrevote, AccAddress, Dec, AggregateExchangeRatePrevote, AggregateExchangeRateVote } from '../../../core';
export interface OracleParams {

@@ -75,2 +75,12 @@ /** Number of blocks that define the period over which new votes must be submitted for the exchange rate of LUNA. */

/**
* Gets the validator's current submitted aggregate prevote
* @param validator validator's operator address
*/
aggregatePrevote(validator: ValAddress): Promise<AggregateExchangeRatePrevote>;
/**
* Gets the validator's current submitted aggregate vote
* @param validator validator's operator address
*/
aggregateVote(validator: ValAddress): Promise<AggregateExchangeRateVote>;
/**
* Gets the current Oracle module's parameters.

@@ -77,0 +87,0 @@ */

@@ -197,2 +197,28 @@ "use strict";

/**
* Gets the validator's current submitted aggregate prevote
* @param validator validator's operator address
*/
OracleAPI.prototype.aggregatePrevote = function (validator) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.c
.get("/oracle/voters/" + validator + "/aggregate_prevote")
.then(function (d) { return core_1.AggregateExchangeRatePrevote.fromData(d.result); })];
});
});
};
/**
* Gets the validator's current submitted aggregate vote
* @param validator validator's operator address
*/
OracleAPI.prototype.aggregateVote = function (validator) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.c
.get("/oracle/voters/" + validator + "/aggregate_vote")
.then(function (d) { return core_1.AggregateExchangeRateVote.fromData(d.result); })];
});
});
};
/**
* Gets the current Oracle module's parameters.

@@ -199,0 +225,0 @@ */

@@ -12,2 +12,3 @@ import { BaseAPI } from './BaseAPI';

init_msg: any;
migratable: boolean;
}

@@ -20,4 +21,19 @@ export declare namespace ContractInfo {

init_msg: string;
migratable: boolean;
}
}
export interface WasmParams {
max_contract_size: number;
max_contract_gas: number;
max_contract_msg_size: number;
gas_multiplier: number;
}
export declare namespace WasmParams {
interface Data {
max_contract_size: string;
max_contract_gas: string;
max_contract_msg_size: string;
gas_multiplier: string;
}
}
export declare class WasmAPI extends BaseAPI {

@@ -27,2 +43,3 @@ codeInfo(codeID: number): Promise<CodeInfo>;

contractQuery<T>(contractAddress: AccAddress, query: object): Promise<T>;
parameters(): Promise<WasmParams>;
}

@@ -77,2 +77,3 @@ "use strict";

init_msg: JSON.parse(Buffer.from(d.init_msg, 'base64').toString()),
migratable: d.migratable,
}); })];

@@ -93,2 +94,17 @@ });

};
WasmAPI.prototype.parameters = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this.c
.get("/wasm/parameters")
.then(function (d) { return d.result; })
.then(function (d) { return ({
max_contract_size: Number.parseInt(d.max_contract_size),
max_contract_gas: Number.parseInt(d.max_contract_gas),
max_contract_msg_size: Number.parseInt(d.max_contract_msg_size),
gas_multiplier: Number.parseInt(d.gas_multiplier),
}); })];
});
});
};
return WasmAPI;

@@ -95,0 +111,0 @@ }(BaseAPI_1.BaseAPI));

3

dist/client/lcd/LCDClient.d.ts
import { APIRequester } from './APIRequester';
import { AuthAPI, BankAPI, DistributionAPI, GovAPI, MarketAPI, OracleAPI, SlashingAPI, StakingAPI, SupplyAPI, TendermintAPI, TreasuryAPI, TxAPI, WasmAPI } from './api';
import { AuthAPI, BankAPI, DistributionAPI, GovAPI, MarketAPI, MsgAuthAPI, OracleAPI, SlashingAPI, StakingAPI, SupplyAPI, TendermintAPI, TreasuryAPI, TxAPI, WasmAPI } from './api';
import { Wallet } from './Wallet';

@@ -49,2 +49,3 @@ import { Numeric, Coins } from '../../core';

market: MarketAPI;
msgauth: MsgAuthAPI;
oracle: OracleAPI;

@@ -51,0 +52,0 @@ slashing: SlashingAPI;

@@ -54,2 +54,3 @@ "use strict";

this.market = new api_1.MarketAPI(this.apiRequester);
this.msgauth = new api_1.MsgAuthAPI(this.apiRequester);
this.oracle = new api_1.OracleAPI(this.apiRequester);

@@ -56,0 +57,0 @@ this.slashing = new api_1.SlashingAPI(this.apiRequester);

@@ -44,2 +44,3 @@ import { JSONSerializable } from '../util/json';

toString(): string;
static fromString(str: string): Coin;
/**

@@ -46,0 +47,0 @@ * Creates a new Coin adding to the current value.

@@ -81,4 +81,17 @@ "use strict";

Coin.prototype.toString = function () {
return "" + this.amount.toFixed() + this.denom;
var amount = this.amount.toFixed();
if (this.isDecCoin() && amount.indexOf('.') === -1) {
return amount + ".0" + this.denom;
}
return "" + amount + this.denom;
};
Coin.fromString = function (str) {
var m = str.match(/^([0-9]+(\.[0-9]+)?)([a-zA-Z]+)$/);
if (m === null) {
throw new Error("failed to parse to Coin: " + str);
}
var amount = m[1];
var denom = m[3];
return new Coin(denom, amount);
};
/**

@@ -85,0 +98,0 @@ * Creates a new Coin adding to the current value.

@@ -15,6 +15,14 @@ import { Coin } from './Coin';

*
* Eg: `15000ukrw, 12000uluna`
* Eg: `15000ukrw,12000uluna`
*/
toString(): string;
/**
* Converts a comma-separated list of coins to a Coins object
*
* Eg. `1500ukrw,12302uluna`
*
* @param str comma-separated list of coins
*/
static fromString(str: string): Coins;
/**
* Gets the list of denominations

@@ -21,0 +29,0 @@ */

@@ -85,3 +85,3 @@ "use strict";

*
* Eg: `15000ukrw, 12000uluna`
* Eg: `15000ukrw,12000uluna`
*/

@@ -91,5 +91,17 @@ Coins.prototype.toString = function () {

.map(function (c) { return c.toString(); })
.join(', ');
.join(',');
};
/**
* Converts a comma-separated list of coins to a Coins object
*
* Eg. `1500ukrw,12302uluna`
*
* @param str comma-separated list of coins
*/
Coins.fromString = function (str) {
var coin_strings = str.split(/,\s*/);
var coins = coin_strings.map(function (s) { return Coin_1.Coin.fromString(s); });
return new Coins(coins);
};
/**
* Gets the list of denominations

@@ -96,0 +108,0 @@ */

import { MsgModifyWithdrawAddress } from './MsgModifyWithdrawAddress';
import { MsgWithdrawDelegationReward } from './MsgWithdrawDelegationReward';
import { MsgWithdrawValidatorCommission } from './MsgWithdrawValidatorCommission';
import { MsgFundCommunityPool } from './MsgFundCommunityPool';
export * from './MsgModifyWithdrawAddress';
export * from './MsgWithdrawDelegationReward';
export * from './MsgWithdrawValidatorCommission';
export declare type DistributionMsg = MsgModifyWithdrawAddress | MsgWithdrawDelegationReward | MsgWithdrawValidatorCommission;
export * from './MsgFundCommunityPool';
export declare type DistributionMsg = MsgModifyWithdrawAddress | MsgWithdrawDelegationReward | MsgWithdrawValidatorCommission | MsgFundCommunityPool;
export declare namespace DistributionMsg {
type Data = MsgModifyWithdrawAddress.Data | MsgWithdrawDelegationReward.Data | MsgWithdrawValidatorCommission.Data;
type Data = MsgModifyWithdrawAddress.Data | MsgWithdrawDelegationReward.Data | MsgWithdrawValidatorCommission.Data | MsgFundCommunityPool.Data;
}

@@ -16,2 +16,3 @@ "use strict";

__exportStar(require("./MsgWithdrawValidatorCommission"), exports);
__exportStar(require("./MsgFundCommunityPool"), exports);
//# sourceMappingURL=index.js.map

@@ -23,5 +23,9 @@ export * from './Block';

export * from './market/msgs';
export * from './msgauth/msgs';
export * from './msgauth/Authorization';
export * from './oracle/msgs';
export * from './oracle/ExchangeRatePrevote';
export * from './oracle/ExchangeRateVote';
export * from './oracle/AggregateExchangeRatePrevote';
export * from './oracle/AggregateExchangeRateVote';
export * from './params/proposals';

@@ -28,0 +32,0 @@ export * from './params/ParamChange';

@@ -40,2 +40,5 @@ "use strict";

__exportStar(require("./market/msgs"), exports);
// MsgAuth
__exportStar(require("./msgauth/msgs"), exports);
__exportStar(require("./msgauth/Authorization"), exports);
// Oracle

@@ -45,2 +48,4 @@ __exportStar(require("./oracle/msgs"), exports);

__exportStar(require("./oracle/ExchangeRateVote"), exports);
__exportStar(require("./oracle/AggregateExchangeRatePrevote"), exports);
__exportStar(require("./oracle/AggregateExchangeRateVote"), exports);
// Parameters

@@ -47,0 +52,0 @@ __exportStar(require("./params/proposals"), exports);

@@ -5,2 +5,3 @@ import { BankMsg } from './bank/msgs';

import { MarketMsg } from './market/msgs';
import { MsgAuthMsg } from './msgauth/msgs';
import { OracleMsg } from './oracle/msgs';

@@ -10,6 +11,6 @@ import { SlashingMsg } from './slashing/msgs';

import { WasmMsg } from './wasm/msgs';
export declare type Msg = BankMsg | DistributionMsg | GovMsg | MarketMsg | OracleMsg | SlashingMsg | StakingMsg | WasmMsg;
export declare type Msg = BankMsg | DistributionMsg | GovMsg | MarketMsg | MsgAuthMsg | OracleMsg | SlashingMsg | StakingMsg | WasmMsg;
export declare namespace Msg {
type Data = BankMsg.Data | DistributionMsg.Data | GovMsg.Data | MarketMsg.Data | OracleMsg.Data | SlashingMsg.Data | StakingMsg.Data | WasmMsg.Data;
type Data = BankMsg.Data | DistributionMsg.Data | GovMsg.Data | MarketMsg.Data | MsgAuthMsg.Data | OracleMsg.Data | SlashingMsg.Data | StakingMsg.Data | WasmMsg.Data;
function fromData(data: Msg.Data): Msg;
}

@@ -8,6 +8,7 @@ "use strict";

var msgs_4 = require("./market/msgs");
var msgs_5 = require("./oracle/msgs");
var msgs_6 = require("./slashing/msgs");
var msgs_7 = require("./staking/msgs");
var msgs_8 = require("./wasm/msgs");
var msgs_5 = require("./msgauth/msgs");
var msgs_6 = require("./oracle/msgs");
var msgs_7 = require("./slashing/msgs");
var msgs_8 = require("./staking/msgs");
var msgs_9 = require("./wasm/msgs");
var Msg;

@@ -29,2 +30,4 @@ (function (Msg) {

return msgs_2.MsgWithdrawValidatorCommission.fromData(data);
case 'distribution/MsgFundCommunityPool':
return msgs_2.MsgFundCommunityPool.fromData(data);
// gov

@@ -42,34 +45,45 @@ case 'gov/MsgDeposit':

return msgs_4.MsgSwapSend.fromData(data);
// msgauth
case 'msgauth/MsgGrantAuthorization':
return msgs_5.MsgGrantAuthorization.fromData(data);
case 'msgauth/MsgRevokeAuthorization':
return msgs_5.MsgRevokeAuthorization.fromData(data);
case 'msgauth/MsgExecAuthorized':
return msgs_5.MsgExecAuthorized.fromData(data);
// oracle
case 'oracle/MsgExchangeRateVote':
return msgs_5.MsgExchangeRateVote.fromData(data);
return msgs_6.MsgExchangeRateVote.fromData(data);
case 'oracle/MsgExchangeRatePrevote':
return msgs_5.MsgExchangeRatePrevote.fromData(data);
return msgs_6.MsgExchangeRatePrevote.fromData(data);
case 'oracle/MsgDelegateFeedConsent':
return msgs_5.MsgDelegateFeedConsent.fromData(data);
return msgs_6.MsgDelegateFeedConsent.fromData(data);
case 'oracle/MsgAggregateExchangeRatePrevote':
return msgs_6.MsgAggregateExchangeRatePrevote.fromData(data);
case 'oracle/MsgAggregateExchangeRateVote':
return msgs_6.MsgAggregateExchangeRateVote.fromData(data);
// slashing
case 'cosmos/MsgUnjail':
return msgs_6.MsgUnjail.fromData(data);
return msgs_7.MsgUnjail.fromData(data);
// staking
case 'staking/MsgDelegate':
return msgs_7.MsgDelegate.fromData(data);
return msgs_8.MsgDelegate.fromData(data);
case 'staking/MsgUndelegate':
return msgs_7.MsgUndelegate.fromData(data);
return msgs_8.MsgUndelegate.fromData(data);
case 'staking/MsgBeginRedelegate':
return msgs_7.MsgBeginRedelegate.fromData(data);
return msgs_8.MsgBeginRedelegate.fromData(data);
case 'staking/MsgCreateValidator':
return msgs_7.MsgCreateValidator.fromData(data);
return msgs_8.MsgCreateValidator.fromData(data);
case 'staking/MsgEditValidator':
return msgs_7.MsgEditValidator.fromData(data);
return msgs_8.MsgEditValidator.fromData(data);
// wasm
case 'wasm/MsgStoreCode':
return msgs_8.MsgStoreCode.fromData(data);
return msgs_9.MsgStoreCode.fromData(data);
case 'wasm/MsgInstantiateContract':
return msgs_8.MsgInstantiateContract.fromData(data);
return msgs_9.MsgInstantiateContract.fromData(data);
case 'wasm/MsgExecuteContract':
return msgs_8.MsgExecuteContract.fromData(data);
return msgs_9.MsgExecuteContract.fromData(data);
case 'wasm/MsgMigrateContract':
return msgs_8.MsgMigrateContract.fromData(data);
return msgs_9.MsgMigrateContract.fromData(data);
case 'wasm/MsgUpdateContractOwner':
return msgs_8.MsgUpdateContractOwner.fromData(data);
return msgs_9.MsgUpdateContractOwner.fromData(data);
}

@@ -76,0 +90,0 @@ }

import { MsgDelegateFeedConsent } from './MsgDelegateFeedConsent';
import { MsgExchangeRatePrevote } from './MsgExchangeRatePrevote';
import { MsgExchangeRateVote } from './MsgExchangeRateVote';
import { MsgAggregateExchangeRatePrevote } from './MsgAggregateExchangeRatePrevote';
import { MsgAggregateExchangeRateVote } from './MsgAggregateExchangeRateVote';
export * from './MsgDelegateFeedConsent';
export * from './MsgExchangeRatePrevote';
export * from './MsgExchangeRateVote';
export declare type OracleMsg = MsgExchangeRateVote | MsgExchangeRatePrevote | MsgDelegateFeedConsent;
export * from './MsgAggregateExchangeRateVote';
export * from './MsgAggregateExchangeRatePrevote';
export declare type OracleMsg = MsgExchangeRateVote | MsgExchangeRatePrevote | MsgDelegateFeedConsent | MsgAggregateExchangeRateVote | MsgAggregateExchangeRatePrevote;
export declare namespace OracleMsg {
type Data = MsgExchangeRateVote.Data | MsgExchangeRatePrevote.Data | MsgDelegateFeedConsent.Data;
type Data = MsgExchangeRateVote.Data | MsgExchangeRatePrevote.Data | MsgDelegateFeedConsent.Data | MsgAggregateExchangeRateVote.Data | MsgAggregateExchangeRatePrevote.Data;
}

@@ -16,2 +16,4 @@ "use strict";

__exportStar(require("./MsgExchangeRateVote"), exports);
__exportStar(require("./MsgAggregateExchangeRateVote"), exports);
__exportStar(require("./MsgAggregateExchangeRatePrevote"), exports);
//# sourceMappingURL=index.js.map

@@ -6,3 +6,3 @@ import { JSONSerializable } from '../../../util/json';

owner: AccAddress;
code_id: string;
code_id: number;
init_msg: object;

@@ -18,3 +18,3 @@ init_coins: Coins;

*/
constructor(owner: AccAddress, code_id: string, init_msg: object, init_coins: Coins, migratable: boolean);
constructor(owner: AccAddress, code_id: number, init_msg: object, init_coins: Coins, migratable: boolean);
static fromData(data: MsgInstantiateContract.Data): MsgInstantiateContract;

@@ -21,0 +21,0 @@ toData(): MsgInstantiateContract.Data;

@@ -39,3 +39,3 @@ "use strict";

var _a = data.value, owner = _a.owner, code_id = _a.code_id, init_msg = _a.init_msg, init_coins = _a.init_coins, migratable = _a.migratable;
return new MsgInstantiateContract(owner, code_id, JSON.parse(Buffer.from(init_msg, 'base64').toString()), Coins_1.Coins.fromData(init_coins), migratable);
return new MsgInstantiateContract(owner, Number.parseInt(code_id), JSON.parse(Buffer.from(init_msg, 'base64').toString()), Coins_1.Coins.fromData(init_coins), migratable);
};

@@ -48,3 +48,3 @@ MsgInstantiateContract.prototype.toData = function () {

owner: owner,
code_id: code_id,
code_id: code_id.toFixed(),
init_msg: Buffer.from(JSON.stringify(init_msg)).toString('base64'),

@@ -51,0 +51,0 @@ init_coins: init_coins.toData(),

@@ -6,3 +6,3 @@ import { JSONSerializable } from '../../../util/json';

contract: AccAddress;
new_code_id: string;
new_code_id: number;
migrate_msg: string;

@@ -15,3 +15,3 @@ /**

*/
constructor(owner: AccAddress, contract: AccAddress, new_code_id: string, migrate_msg: string);
constructor(owner: AccAddress, contract: AccAddress, new_code_id: number, migrate_msg: string);
static fromData(data: MsgMigrateContract.Data): MsgMigrateContract;

@@ -18,0 +18,0 @@ toData(): MsgMigrateContract.Data;

@@ -36,3 +36,3 @@ "use strict";

var _a = data.value, owner = _a.owner, contract = _a.contract, new_code_id = _a.new_code_id, migrate_msg = _a.migrate_msg;
return new MsgMigrateContract(owner, contract, new_code_id, JSON.parse(Buffer.from(migrate_msg, 'base64').toString()));
return new MsgMigrateContract(owner, contract, Number.parseInt(new_code_id), JSON.parse(Buffer.from(migrate_msg, 'base64').toString()));
};

@@ -46,3 +46,3 @@ MsgMigrateContract.prototype.toData = function () {

contract: contract,
new_code_id: new_code_id,
new_code_id: new_code_id.toFixed(),
migrate_msg: Buffer.from(JSON.stringify(migrate_msg)).toString('base64'),

@@ -49,0 +49,0 @@ },

export * from './Key';
export * from './MnemonicKey';
export * from './RawKey';

@@ -15,2 +15,3 @@ "use strict";

__exportStar(require("./MnemonicKey"), exports);
__exportStar(require("./RawKey"), exports);
//# sourceMappingURL=index.js.map
{
"version": "0.4.1",
"version": "0.4.2",
"license": "MIT",

@@ -4,0 +4,0 @@ "main": "dist/index.js",

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

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

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

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

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc