Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@terra-money/terra.js

Package Overview
Dependencies
Maintainers
4
Versions
230
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@terra-money/terra.js - npm Package Compare versions

Comparing version 0.1.0 to 0.1.1

2

package.json
{
"version": "0.1.0",
"version": "0.1.1",
"license": "MIT",

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

@@ -10,2 +10,6 @@ <p>&nbsp;</p>

<br/>
![diagram](./img/terrajs-diagram.png)
<div align="center">

@@ -82,3 +86,3 @@ <h3>

<div align="center">
<sub><em>Empowering the innovation of money.</em></sub>
<sub><em>Powering the innovation of money.</em></sub>
</div>

@@ -34,5 +34,5 @@ import { APIRequester } from '../APIRequester';

const acct = await auth.accountInfo(mk.accAddress);
expect((<Account>acct).address).toBe('');
expect((acct as Account).address).toBe('');
});
});
});

@@ -10,5 +10,3 @@ import { APIRequester } from '../APIRequester';

it('account exists', async () => {
const coins = await bank.balance(
'terra1ax7xtll5v6u6vdnymxa4k4648w80zhkggl0u24'
);
await bank.balance('terra1ax7xtll5v6u6vdnymxa4k4648w80zhkggl0u24');
});

@@ -15,0 +13,0 @@

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

let rewards: Rewards['rewards'] = {};
const rewards: Rewards['rewards'] = {};
for (const reward of rewardsData.rewards) {

@@ -93,0 +93,0 @@ rewards[reward.validator_address] = Coins.fromData(reward.reward);

@@ -42,3 +42,3 @@ import { Coin, Dec, Numeric, Denom } from '../../../core';

public async swapRate(offerCoin: Coin, askDenom: Denom): Promise<Coin> {
let params = {
const params = {
offer_coin: offerCoin.toString(),

@@ -45,0 +45,0 @@ ask_denom: askDenom,

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

if (validator !== undefined && denom !== undefined) {
let vote = await this.c.get<ExchangeRateVote.Data>(
const vote = await this.c.get<ExchangeRateVote.Data>(
`/oracle/denoms/${denom}/votes/${validator}`

@@ -71,3 +71,3 @@ );

} else if (validator !== undefined) {
let votes = await this.c.get<ExchangeRateVote.Data[]>(
const votes = await this.c.get<ExchangeRateVote.Data[]>(
`/oracle/voters/${validator}/votes`

@@ -77,3 +77,3 @@ );

} else if (denom !== undefined) {
let votes = await this.c.get<ExchangeRateVote.Data[]>(
const votes = await this.c.get<ExchangeRateVote.Data[]>(
`/oracle/denoms/${denom}/votes`

@@ -99,3 +99,3 @@ );

if (validator !== undefined && denom !== undefined) {
let prevote = await this.c.get<ExchangeRatePrevote.Data>(
const prevote = await this.c.get<ExchangeRatePrevote.Data>(
`/oracle/denoms/${denom}/prevotes/${validator}`

@@ -105,3 +105,3 @@ );

} else if (validator !== undefined) {
let prevotes = await this.c.get<ExchangeRatePrevote.Data[]>(
const prevotes = await this.c.get<ExchangeRatePrevote.Data[]>(
`/oracle/voters/${validator}/prevotes`

@@ -111,3 +111,3 @@ );

} else if (denom !== undefined) {
let prevotes = await this.c.get<ExchangeRatePrevote.Data[]>(
const prevotes = await this.c.get<ExchangeRatePrevote.Data[]>(
`/oracle/denoms/${denom}/prevotes`

@@ -114,0 +114,0 @@ );

@@ -6,3 +6,2 @@ import {

Coin,
Coins,
} from '../../../core';

@@ -159,3 +158,3 @@ import { BaseAPI } from './BaseAPI';

): Promise<Redelegation[]> {
let params = {
const params = {
delegator,

@@ -193,3 +192,3 @@ validator_from: validatorSrc,

*/
public async validator(validator: ValAddress) {
public async validator(validator: ValAddress): Promise<Validator> {
return this.c

@@ -196,0 +195,0 @@ .get<Validator.Data>(`/staking/validators/${validator}`)

@@ -1,2 +0,2 @@

import { Denom, Coins, Coin } from '../../../core';
import { Coins } from '../../../core';
import { BaseAPI } from './BaseAPI';

@@ -3,0 +3,0 @@

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

public async validatorSet(height?: number): Promise<ValidatorSet> {
let url =
const url =
height !== undefined

@@ -37,5 +37,5 @@ ? `/validatorsets/${height}`

public async block(height?: number): Promise<BlockInfo> {
let url = height !== undefined ? `/blocks/${height}` : `/blocks/latest`;
const url = height !== undefined ? `/blocks/${height}` : `/blocks/latest`;
return this.c.getRaw<BlockInfo>(url);
}
}

@@ -107,3 +107,6 @@ import { BaseAPI } from './BaseAPI';

const data = {
tx: tx instanceof StdSignMsg ? tx.toStdTx().toData() : tx.toData(),
tx:
tx instanceof StdSignMsg
? tx.toStdTx().toData().value
: tx.toData().value,
gas_prices: gasPrices && new Coins(gasPrices).toData(),

@@ -110,0 +113,0 @@ gas_adjustment: gasAdjustment && gasAdjustment.toString(),

@@ -5,3 +5,3 @@ import { LCDClient } from './LCDClient';

it('runs', async () => {
const terra = new LCDClient({
new LCDClient({
chainID: 'columbus-3',

@@ -8,0 +8,0 @@ URL: 'https://lcd.terra.dev',

@@ -1,5 +0,5 @@

import { MsgSwap, Coin, StdFee } from '../../core';
import { MnemonicKey } from '../../key';
import { LCDClient } from './LCDClient';
import { TreasuryAPI, Broadcast } from './api';
// import { MsgSwap, Coin, StdFee } from '../../core';
// import { MnemonicKey } from '../../key';
// import { LCDClient } from './LCDClient';
// import { TreasuryAPI, Broadcast } from './api';

@@ -6,0 +6,0 @@ describe('Wallet', () => {

@@ -7,3 +7,3 @@ const data = require('./Redelegation.data.json');

data.forEach((redelgExample: Redelegation.Data) => {
const redelg = Redelegation.fromData(redelgExample);
Redelegation.fromData(redelgExample);
// expect(redelg.toData()).toMatchObject(redelgExample);

@@ -10,0 +10,0 @@ // JavaScript's Date does not preserve ns precision

@@ -7,3 +7,3 @@ const data = require('./UnbondingDelegation.data.json');

data.forEach((udelgExample: UnbondingDelegation.Data) => {
const udelg = UnbondingDelegation.fromData(udelgExample);
UnbondingDelegation.fromData(udelgExample);
// expect(udelg.toData()).toMatchObject(udelgExample);

@@ -10,0 +10,0 @@ // JavaScript's Date does not preserve ns precision

@@ -132,3 +132,3 @@ import { MnemonicKey } from './MnemonicKey';

it('txid', () => {
const stdTx = new StdTx(
new StdTx(
[

@@ -135,0 +135,0 @@ new MsgSend(

import SHA256 from 'crypto-js/sha256';
import CryptoJS from 'crypto-js';
function byteArrayToWordArray(ba: Uint8Array) {
function byteArrayToWordArray(ba: Uint8Array): CryptoJS.LibWordArray {
const wa: number[] = [];

@@ -6,0 +6,0 @@ for (let i = 0; i < ba.length; i += 1) {

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc