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

@harmony-js/transaction

Package Overview
Dependencies
Maintainers
1
Versions
74
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@harmony-js/transaction - npm Package Compare versions

Comparing version 0.1.4 to 0.1.6

36

dist/index.cjs.js

@@ -329,8 +329,17 @@ /**

this.nonce = params && params.nonce ? params.nonce : 0;
this.gasPrice = params && params.gasPrice ? params.gasPrice : new crypto.BN(0);
this.gasLimit = params && params.gasLimit ? params.gasLimit : new crypto.BN(0);
this.gasPrice =
params && params.gasPrice
? new utils.Unit(params.gasPrice).asWei().toWei()
: new utils.Unit(0).asWei().toWei();
this.gasLimit =
params && params.gasLimit
? new utils.Unit(params.gasLimit).asWei().toWei()
: new utils.Unit(0).asWei().toWei();
this.shardID = params && params.shardID ? params.shardID : 0;
this.toShardID = params && params.toShardID ? params.toShardID : 0;
this.to = params && params.to ? this.normalizeAddress(params.to) : '0x';
this.value = params && params.value ? params.value : new crypto.BN(0);
this.value =
params && params.value
? new utils.Unit(params.value).asWei().toWei()
: new utils.Unit(0).asWei().toWei();
this.data = params && params.data ? params.data : '0x';

@@ -446,8 +455,8 @@ // chainid should change with different network settings

nonce: this.nonce || 0,
gasPrice: this.gasPrice || new crypto.BN(0),
gasLimit: this.gasLimit || new crypto.BN(0),
gasPrice: this.gasPrice || new utils.Unit(0).asWei().toWei(),
gasLimit: this.gasLimit || new utils.Unit(0).asWei().toWei(),
shardID: this.shardID || 0,
toShardID: this.toShardID || 0,
to: this.normalizeAddress(this.to) || '0x',
value: this.value || new crypto.BN(0),
value: this.value || new utils.Unit(0).asWei().toWei(),
data: this.data || '0x',

@@ -467,8 +476,17 @@ chainId: this.chainId || 0,

this.nonce = params && params.nonce ? params.nonce : 0;
this.gasPrice = params && params.gasPrice ? params.gasPrice : new crypto.BN(0);
this.gasLimit = params && params.gasLimit ? params.gasLimit : new crypto.BN(0);
this.gasPrice =
params && params.gasPrice
? new utils.Unit(params.gasPrice).asWei().toWei()
: new utils.Unit(0).asWei().toWei();
this.gasLimit =
params && params.gasLimit
? new utils.Unit(params.gasLimit).asWei().toWei()
: new utils.Unit(0).asWei().toWei();
this.shardID = params && params.shardID ? params.shardID : 0;
this.toShardID = params && params.toShardID ? params.toShardID : 0;
this.to = params && params.to ? this.normalizeAddress(params.to) : '0x';
this.value = params && params.value ? params.value : new crypto.BN(0);
this.value =
params && params.value
? new utils.Unit(params.value).asWei().toWei()
: new utils.Unit(0).asWei().toWei();
this.data = params && params.data ? params.data : '0x';

@@ -475,0 +493,0 @@ this.chainId = params && params.chainId ? params.chainId : 0;

@@ -5,3 +5,3 @@ /**

import { hexToNumber, isHex, isAddress, strip0x, add0xToString, numberToHex } from '@harmony-js/utils';
import { hexToNumber, isHex, isAddress, strip0x, add0xToString, numberToHex, Unit } from '@harmony-js/utils';
import { decode, encode, keccak256, hexlify, BN, hexZeroPad, recoverAddress, getAddress, sign, arrayify, stripZeros, splitSignature, HarmonyAddress, getContractAddress } from '@harmony-js/crypto';

@@ -327,8 +327,17 @@ import { HttpProvider, Messenger, Emitter, NewHeaders } from '@harmony-js/network';

this.nonce = params && params.nonce ? params.nonce : 0;
this.gasPrice = params && params.gasPrice ? params.gasPrice : new BN(0);
this.gasLimit = params && params.gasLimit ? params.gasLimit : new BN(0);
this.gasPrice =
params && params.gasPrice
? new Unit(params.gasPrice).asWei().toWei()
: new Unit(0).asWei().toWei();
this.gasLimit =
params && params.gasLimit
? new Unit(params.gasLimit).asWei().toWei()
: new Unit(0).asWei().toWei();
this.shardID = params && params.shardID ? params.shardID : 0;
this.toShardID = params && params.toShardID ? params.toShardID : 0;
this.to = params && params.to ? this.normalizeAddress(params.to) : '0x';
this.value = params && params.value ? params.value : new BN(0);
this.value =
params && params.value
? new Unit(params.value).asWei().toWei()
: new Unit(0).asWei().toWei();
this.data = params && params.data ? params.data : '0x';

@@ -444,8 +453,8 @@ // chainid should change with different network settings

nonce: this.nonce || 0,
gasPrice: this.gasPrice || new BN(0),
gasLimit: this.gasLimit || new BN(0),
gasPrice: this.gasPrice || new Unit(0).asWei().toWei(),
gasLimit: this.gasLimit || new Unit(0).asWei().toWei(),
shardID: this.shardID || 0,
toShardID: this.toShardID || 0,
to: this.normalizeAddress(this.to) || '0x',
value: this.value || new BN(0),
value: this.value || new Unit(0).asWei().toWei(),
data: this.data || '0x',

@@ -465,8 +474,17 @@ chainId: this.chainId || 0,

this.nonce = params && params.nonce ? params.nonce : 0;
this.gasPrice = params && params.gasPrice ? params.gasPrice : new BN(0);
this.gasLimit = params && params.gasLimit ? params.gasLimit : new BN(0);
this.gasPrice =
params && params.gasPrice
? new Unit(params.gasPrice).asWei().toWei()
: new Unit(0).asWei().toWei();
this.gasLimit =
params && params.gasLimit
? new Unit(params.gasLimit).asWei().toWei()
: new Unit(0).asWei().toWei();
this.shardID = params && params.shardID ? params.shardID : 0;
this.toShardID = params && params.toShardID ? params.toShardID : 0;
this.to = params && params.to ? this.normalizeAddress(params.to) : '0x';
this.value = params && params.value ? params.value : new BN(0);
this.value =
params && params.value
? new Unit(params.value).asWei().toWei()
: new Unit(0).asWei().toWei();
this.data = params && params.data ? params.data : '0x';

@@ -473,0 +491,0 @@ this.chainId = params && params.chainId ? params.chainId : 0;

@@ -327,8 +327,17 @@ /**

this.nonce = params && params.nonce ? params.nonce : 0;
this.gasPrice = params && params.gasPrice ? params.gasPrice : new crypto.BN(0);
this.gasLimit = params && params.gasLimit ? params.gasLimit : new crypto.BN(0);
this.gasPrice =
params && params.gasPrice
? new utils.Unit(params.gasPrice).asWei().toWei()
: new utils.Unit(0).asWei().toWei();
this.gasLimit =
params && params.gasLimit
? new utils.Unit(params.gasLimit).asWei().toWei()
: new utils.Unit(0).asWei().toWei();
this.shardID = params && params.shardID ? params.shardID : 0;
this.toShardID = params && params.toShardID ? params.toShardID : 0;
this.to = params && params.to ? this.normalizeAddress(params.to) : '0x';
this.value = params && params.value ? params.value : new crypto.BN(0);
this.value =
params && params.value
? new utils.Unit(params.value).asWei().toWei()
: new utils.Unit(0).asWei().toWei();
this.data = params && params.data ? params.data : '0x';

@@ -444,8 +453,8 @@ // chainid should change with different network settings

nonce: this.nonce || 0,
gasPrice: this.gasPrice || new crypto.BN(0),
gasLimit: this.gasLimit || new crypto.BN(0),
gasPrice: this.gasPrice || new utils.Unit(0).asWei().toWei(),
gasLimit: this.gasLimit || new utils.Unit(0).asWei().toWei(),
shardID: this.shardID || 0,
toShardID: this.toShardID || 0,
to: this.normalizeAddress(this.to) || '0x',
value: this.value || new crypto.BN(0),
value: this.value || new utils.Unit(0).asWei().toWei(),
data: this.data || '0x',

@@ -465,8 +474,17 @@ chainId: this.chainId || 0,

this.nonce = params && params.nonce ? params.nonce : 0;
this.gasPrice = params && params.gasPrice ? params.gasPrice : new crypto.BN(0);
this.gasLimit = params && params.gasLimit ? params.gasLimit : new crypto.BN(0);
this.gasPrice =
params && params.gasPrice
? new utils.Unit(params.gasPrice).asWei().toWei()
: new utils.Unit(0).asWei().toWei();
this.gasLimit =
params && params.gasLimit
? new utils.Unit(params.gasLimit).asWei().toWei()
: new utils.Unit(0).asWei().toWei();
this.shardID = params && params.shardID ? params.shardID : 0;
this.toShardID = params && params.toShardID ? params.toShardID : 0;
this.to = params && params.to ? this.normalizeAddress(params.to) : '0x';
this.value = params && params.value ? params.value : new crypto.BN(0);
this.value =
params && params.value
? new utils.Unit(params.value).asWei().toWei()
: new utils.Unit(0).asWei().toWei();
this.data = params && params.data ? params.data : '0x';

@@ -473,0 +491,0 @@ this.chainId = params && params.chainId ? params.chainId : 0;

@@ -23,8 +23,17 @@ "use strict";

this.nonce = params && params.nonce ? params.nonce : 0;
this.gasPrice = params && params.gasPrice ? params.gasPrice : new crypto_1.BN(0);
this.gasLimit = params && params.gasLimit ? params.gasLimit : new crypto_1.BN(0);
this.gasPrice =
params && params.gasPrice
? new utils_1.Unit(params.gasPrice).asWei().toWei()
: new utils_1.Unit(0).asWei().toWei();
this.gasLimit =
params && params.gasLimit
? new utils_1.Unit(params.gasLimit).asWei().toWei()
: new utils_1.Unit(0).asWei().toWei();
this.shardID = params && params.shardID ? params.shardID : 0;
this.toShardID = params && params.toShardID ? params.toShardID : 0;
this.to = params && params.to ? this.normalizeAddress(params.to) : '0x';
this.value = params && params.value ? params.value : new crypto_1.BN(0);
this.value =
params && params.value
? new utils_1.Unit(params.value).asWei().toWei()
: new utils_1.Unit(0).asWei().toWei();
this.data = params && params.data ? params.data : '0x';

@@ -140,8 +149,8 @@ // chainid should change with different network settings

nonce: this.nonce || 0,
gasPrice: this.gasPrice || new crypto_1.BN(0),
gasLimit: this.gasLimit || new crypto_1.BN(0),
gasPrice: this.gasPrice || new utils_1.Unit(0).asWei().toWei(),
gasLimit: this.gasLimit || new utils_1.Unit(0).asWei().toWei(),
shardID: this.shardID || 0,
toShardID: this.toShardID || 0,
to: this.normalizeAddress(this.to) || '0x',
value: this.value || new crypto_1.BN(0),
value: this.value || new utils_1.Unit(0).asWei().toWei(),
data: this.data || '0x',

@@ -161,8 +170,17 @@ chainId: this.chainId || 0,

this.nonce = params && params.nonce ? params.nonce : 0;
this.gasPrice = params && params.gasPrice ? params.gasPrice : new crypto_1.BN(0);
this.gasLimit = params && params.gasLimit ? params.gasLimit : new crypto_1.BN(0);
this.gasPrice =
params && params.gasPrice
? new utils_1.Unit(params.gasPrice).asWei().toWei()
: new utils_1.Unit(0).asWei().toWei();
this.gasLimit =
params && params.gasLimit
? new utils_1.Unit(params.gasLimit).asWei().toWei()
: new utils_1.Unit(0).asWei().toWei();
this.shardID = params && params.shardID ? params.shardID : 0;
this.toShardID = params && params.toShardID ? params.toShardID : 0;
this.to = params && params.to ? this.normalizeAddress(params.to) : '0x';
this.value = params && params.value ? params.value : new crypto_1.BN(0);
this.value =
params && params.value
? new utils_1.Unit(params.value).asWei().toWei()
: new utils_1.Unit(0).asWei().toWei();
this.data = params && params.data ? params.data : '0x';

@@ -169,0 +187,0 @@ this.chainId = params && params.chainId ? params.chainId : 0;

@@ -8,8 +8,8 @@ /// <reference types="bn.js" />

nonce: number | string;
gasLimit: BN;
gasPrice: BN;
gasLimit: number | string | BN;
gasPrice: number | string | BN;
shardID: number | string;
toShardID: number | string;
data: string;
value: BN;
value: number | string | BN;
chainId: number;

@@ -16,0 +16,0 @@ rawTransaction: string;

{
"name": "@harmony-js/transaction",
"version": "0.1.4",
"version": "0.1.6",
"description": "transaction package for harmony",

@@ -21,7 +21,7 @@ "main": "dist/index.js",

"dependencies": {
"@harmony-js/crypto": "0.1.0",
"@harmony-js/network": "0.1.1",
"@harmony-js/utils": "0.1.0"
"@harmony-js/crypto": "0.1.6",
"@harmony-js/network": "0.1.6",
"@harmony-js/utils": "0.1.6"
},
"gitHead": "1a0a5300c7261e0a9abab96dada48a3e1c2fb7f0"
"gitHead": "f3c50b210d7f83f4c9aa92d7eca8fe73c988a114"
}

@@ -12,3 +12,3 @@ import {

} from '@harmony-js/crypto';
import {add0xToString, numberToHex, ChainType} from '@harmony-js/utils';
import {add0xToString, numberToHex, ChainType, Unit} from '@harmony-js/utils';
import {

@@ -71,4 +71,10 @@ Messenger,

this.nonce = params && params.nonce ? params.nonce : 0;
this.gasPrice = params && params.gasPrice ? params.gasPrice : new BN(0);
this.gasLimit = params && params.gasLimit ? params.gasLimit : new BN(0);
this.gasPrice =
params && params.gasPrice
? new Unit(params.gasPrice).asWei().toWei()
: new Unit(0).asWei().toWei();
this.gasLimit =
params && params.gasLimit
? new Unit(params.gasLimit).asWei().toWei()
: new Unit(0).asWei().toWei();
this.shardID = params && params.shardID ? params.shardID : 0;

@@ -78,3 +84,6 @@ this.toShardID = params && params.toShardID ? params.toShardID : 0;

this.to = params && params.to ? this.normalizeAddress(params.to) : '0x';
this.value = params && params.value ? params.value : new BN(0);
this.value =
params && params.value
? new Unit(params.value).asWei().toWei()
: new Unit(0).asWei().toWei();
this.data = params && params.data ? params.data : '0x';

@@ -207,8 +216,8 @@ // chainid should change with different network settings

nonce: this.nonce || 0,
gasPrice: this.gasPrice || new BN(0),
gasLimit: this.gasLimit || new BN(0),
gasPrice: this.gasPrice || new Unit(0).asWei().toWei(),
gasLimit: this.gasLimit || new Unit(0).asWei().toWei(),
shardID: this.shardID || 0,
toShardID: this.toShardID || 0,
to: this.normalizeAddress(this.to) || '0x',
value: this.value || new BN(0),
value: this.value || new Unit(0).asWei().toWei(),
data: this.data || '0x',

@@ -225,8 +234,17 @@ chainId: this.chainId || 0,

this.nonce = params && params.nonce ? params.nonce : 0;
this.gasPrice = params && params.gasPrice ? params.gasPrice : new BN(0);
this.gasLimit = params && params.gasLimit ? params.gasLimit : new BN(0);
this.gasPrice =
params && params.gasPrice
? new Unit(params.gasPrice).asWei().toWei()
: new Unit(0).asWei().toWei();
this.gasLimit =
params && params.gasLimit
? new Unit(params.gasLimit).asWei().toWei()
: new Unit(0).asWei().toWei();
this.shardID = params && params.shardID ? params.shardID : 0;
this.toShardID = params && params.toShardID ? params.toShardID : 0;
this.to = params && params.to ? this.normalizeAddress(params.to) : '0x';
this.value = params && params.value ? params.value : new BN(0);
this.value =
params && params.value
? new Unit(params.value).asWei().toWei()
: new Unit(0).asWei().toWei();
this.data = params && params.data ? params.data : '0x';

@@ -233,0 +251,0 @@ this.chainId = params && params.chainId ? params.chainId : 0;

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

import { BN, Signature } from '@harmony-js/crypto';
import {BN, Signature} from '@harmony-js/crypto';
export interface TxParams {

@@ -7,8 +7,8 @@ id: string;

nonce: number | string;
gasLimit: BN;
gasPrice: BN;
gasLimit: number | string | BN;
gasPrice: number | string | BN;
shardID: number | string;
toShardID: number | string;
data: string;
value: BN;
value: number | string | BN;
chainId: number;

@@ -15,0 +15,0 @@ rawTransaction: string;

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc