web3-eth-abi
Advanced tools
Comparing version 1.0.0-beta.26 to 1.0.0-beta.27
{ | ||
"name": "web3-eth-abi", | ||
"namespace": "ethereum", | ||
"version": "1.0.0-beta.26", | ||
"version": "1.0.0-beta.27", | ||
"description": "Web3 module encode and decode EVM in/output.", | ||
@@ -12,5 +12,5 @@ "repository": "https://github.com/ethereum/web3.js/tree/master/packages/web3-eth-abi", | ||
"underscore": "1.8.3", | ||
"web3-core-helpers": "^1.0.0-beta.26", | ||
"web3-utils": "^1.0.0-beta.26" | ||
"web3-core-helpers": "1.0.0-beta.27", | ||
"web3-utils": "1.0.0-beta.27" | ||
} | ||
} |
@@ -145,4 +145,8 @@ /* | ||
var formatOutputInt = function (param) { | ||
var value = param.staticPart() || "0"; | ||
var value = param.staticPart(); | ||
if(!value && !param.rawValue) { | ||
throw new Error('Couldn\'t decode '+ name +' from ABI: 0x'+ param.rawValue); | ||
} | ||
// check if it's negative number | ||
@@ -166,3 +170,3 @@ // it it is, return two's complement | ||
if(!value && param.rawValue) { | ||
if(!value && !param.rawValue) { | ||
throw new Error('Couldn\'t decode '+ name +' from ABI: 0x'+ param.rawValue); | ||
@@ -181,2 +185,3 @@ } | ||
* @param {SolidityParam} param | ||
* @param {String} name type name | ||
* @returns {Boolean} right-aligned input bytes formatted to bool | ||
@@ -187,3 +192,3 @@ */ | ||
if(!value) { | ||
if(!value && !param.rawValue) { | ||
throw new Error('Couldn\'t decode '+ name +' from ABI: 0x'+ param.rawValue); | ||
@@ -219,6 +224,13 @@ } | ||
* @param {SolidityParam} param left-aligned hex representation of string | ||
* @param {String} name type name | ||
* @returns {String} hex string | ||
*/ | ||
var formatOutputDynamicBytes = function (param) { | ||
var length = (new BN(param.dynamicPart().slice(0, 64), 16)).toNumber() * 2; | ||
var formatOutputDynamicBytes = function (param, name) { | ||
var hex = param.dynamicPart().slice(0, 64); | ||
if (!hex) { | ||
throw new Error('Couldn\'t decode '+ name +' from ABI: 0x'+ param.rawValue); | ||
} | ||
var length = (new BN(hex, 16)).toNumber() * 2; | ||
return '0x' + param.dynamicPart().substr(64, length); | ||
@@ -236,8 +248,9 @@ }; | ||
var hex = param.dynamicPart().slice(0, 64); | ||
if(hex) { | ||
var length = (new BN(hex, 16)).toNumber() * 2; | ||
return length ? utils.hexToUtf8('0x'+ param.dynamicPart().substr(64, length).replace(/^0x/i, '')) : ''; | ||
} else { | ||
if(!hex) { | ||
throw new Error('ERROR: The returned value is not a convertible string:'+ hex); | ||
} | ||
var length = (new BN(hex, 16)).toNumber() * 2; | ||
return length ? utils.hexToUtf8('0x'+ param.dynamicPart().substr(64, length).replace(/^0x/i, '')) : ''; | ||
}; | ||
@@ -249,7 +262,13 @@ | ||
* @method formatOutputAddress | ||
* @param {Object} param right-aligned input bytes | ||
* @param {SolidityParam} param right-aligned input bytes | ||
* @param {String} name type name | ||
* @returns {String} address | ||
*/ | ||
var formatOutputAddress = function (param) { | ||
var formatOutputAddress = function (param, name) { | ||
var value = param.staticPart(); | ||
if (!value) { | ||
throw new Error('Couldn\'t decode '+ name +' from ABI: 0x'+ param.rawValue); | ||
} | ||
return utils.toChecksumAddress("0x" + value.slice(value.length - 40, value.length)); | ||
@@ -256,0 +275,0 @@ }; |
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
38379
1080
+ Addedaccepts@1.3.8(transitive)
+ Addedajv@6.12.6(transitive)
+ Addedarray-flatten@1.1.1(transitive)
+ Addedasn1@0.2.6(transitive)
+ Addedassert-plus@1.0.0(transitive)
+ Addedasync-limiter@1.0.1(transitive)
+ Addedasynckit@0.4.0(transitive)
+ Addedaws-sign2@0.7.0(transitive)
+ Addedaws4@1.13.2(transitive)
+ Addedbcrypt-pbkdf@1.0.2(transitive)
+ Addedbn.js@4.12.0(transitive)
+ Addedbody-parser@1.20.3(transitive)
+ Addedbrorand@1.1.0(transitive)
+ Addedbuffer-to-arraybuffer@0.0.5(transitive)
+ Addedbytes@3.1.2(transitive)
+ Addedcall-bind@1.0.7(transitive)
+ Addedcaseless@0.12.0(transitive)
+ Addedcombined-stream@1.0.8(transitive)
+ Addedcontent-disposition@0.5.4(transitive)
+ Addedcontent-type@1.0.5(transitive)
+ Addedcookie@0.7.1(transitive)
+ Addedcookie-signature@1.0.6(transitive)
+ Addedcore-util-is@1.0.2(transitive)
+ Addedcors@2.8.5(transitive)
+ Addeddashdash@1.14.1(transitive)
+ Addeddebug@2.6.9(transitive)
+ Addeddecode-uri-component@0.2.2(transitive)
+ Addeddecompress-response@3.3.0(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddelayed-stream@1.0.0(transitive)
+ Addeddepd@2.0.0(transitive)
+ Addeddestroy@1.2.0(transitive)
+ Addeddom-walk@0.1.2(transitive)
+ Addedecc-jsbn@0.1.2(transitive)
+ Addedee-first@1.1.1(transitive)
+ Addedelliptic@6.6.0(transitive)
+ Addedencodeurl@1.0.22.0.0(transitive)
+ Addedes-define-property@1.0.0(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedescape-html@1.0.3(transitive)
+ Addedetag@1.8.1(transitive)
+ Addedeth-lib@0.1.29(transitive)
+ Addedexpress@4.21.1(transitive)
+ Addedextend@3.0.2(transitive)
+ Addedextsprintf@1.3.0(transitive)
+ Addedfast-deep-equal@3.1.3(transitive)
+ Addedfast-json-stable-stringify@2.1.0(transitive)
+ Addedfinalhandler@1.3.1(transitive)
+ Addedforever-agent@0.6.1(transitive)
+ Addedform-data@2.3.3(transitive)
+ Addedforwarded@0.2.0(transitive)
+ Addedfresh@0.5.2(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.4(transitive)
+ Addedgetpass@0.1.7(transitive)
+ Addedglobal@4.4.0(transitive)
+ Addedgopd@1.0.1(transitive)
+ Addedhar-schema@2.0.0(transitive)
+ Addedhar-validator@5.1.5(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-proto@1.0.3(transitive)
+ Addedhas-symbols@1.0.3(transitive)
+ Addedhash.js@1.1.7(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedhmac-drbg@1.0.1(transitive)
+ Addedhttp-errors@2.0.0(transitive)
+ Addedhttp-signature@1.2.0(transitive)
+ Addediconv-lite@0.4.24(transitive)
+ Addedinherits@2.0.4(transitive)
+ Addedipaddr.js@1.9.1(transitive)
+ Addedis-function@1.0.2(transitive)
+ Addedis-typedarray@1.0.0(transitive)
+ Addedisstream@0.1.2(transitive)
+ Addedjsbn@0.1.1(transitive)
+ Addedjson-schema@0.4.0(transitive)
+ Addedjson-schema-traverse@0.4.1(transitive)
+ Addedjson-stringify-safe@5.0.1(transitive)
+ Addedjsprim@1.4.2(transitive)
+ Addedmedia-typer@0.3.0(transitive)
+ Addedmerge-descriptors@1.0.3(transitive)
+ Addedmethods@1.1.2(transitive)
+ Addedmime@1.6.0(transitive)
+ Addedmime-db@1.52.0(transitive)
+ Addedmime-types@2.1.35(transitive)
+ Addedmimic-response@1.0.1(transitive)
+ Addedmin-document@2.19.0(transitive)
+ Addedminimalistic-assert@1.0.1(transitive)
+ Addedminimalistic-crypto-utils@1.0.1(transitive)
+ Addedms@2.0.02.1.3(transitive)
+ Addednano-json-stream-parser@0.1.2(transitive)
+ Addednegotiator@0.6.3(transitive)
+ Addedoauth-sign@0.9.0(transitive)
+ Addedobject-assign@4.1.1(transitive)
+ Addedobject-inspect@1.13.3(transitive)
+ Addedon-finished@2.4.1(transitive)
+ Addedonce@1.4.0(transitive)
+ Addedparse-headers@2.0.5(transitive)
+ Addedparseurl@1.3.3(transitive)
+ Addedpath-to-regexp@0.1.10(transitive)
+ Addedperformance-now@2.1.0(transitive)
+ Addedprocess@0.11.10(transitive)
+ Addedproxy-addr@2.0.7(transitive)
+ Addedpsl@1.10.0(transitive)
+ Addedpunycode@2.3.1(transitive)
+ Addedqs@6.13.06.5.3(transitive)
+ Addedquery-string@5.1.1(transitive)
+ Addedrandomhex@0.1.5(transitive)
+ Addedrange-parser@1.2.1(transitive)
+ Addedraw-body@2.5.2(transitive)
+ Addedrequest@2.88.2(transitive)
+ Addedsafe-buffer@5.1.2(transitive)
+ Addedsafer-buffer@2.1.2(transitive)
+ Addedsend@0.19.0(transitive)
+ Addedserve-static@1.16.2(transitive)
+ Addedservify@0.1.12(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedsetprototypeof@1.2.0(transitive)
+ Addedside-channel@1.0.6(transitive)
+ Addedsimple-concat@1.0.1(transitive)
+ Addedsimple-get@2.8.2(transitive)
+ Addedsshpk@1.18.0(transitive)
+ Addedstatuses@2.0.1(transitive)
+ Addedstrict-uri-encode@1.1.0(transitive)
+ Addedtimed-out@4.0.1(transitive)
+ Addedtoidentifier@1.0.1(transitive)
+ Addedtough-cookie@2.5.0(transitive)
+ Addedtunnel-agent@0.6.0(transitive)
+ Addedtweetnacl@0.14.5(transitive)
+ Addedtype-is@1.6.18(transitive)
+ Addedultron@1.1.1(transitive)
+ Addedunpipe@1.0.0(transitive)
+ Addeduri-js@4.4.1(transitive)
+ Addedurl-set-query@1.0.0(transitive)
+ Addedutf8@2.1.1(transitive)
+ Addedutils-merge@1.0.1(transitive)
+ Addeduuid@3.4.0(transitive)
+ Addedvary@1.1.2(transitive)
+ Addedverror@1.10.0(transitive)
+ Addedweb3-core-helpers@1.0.0-beta.27(transitive)
+ Addedweb3-eth-iban@1.0.0-beta.27(transitive)
+ Addedweb3-utils@1.0.0-beta.27(transitive)
+ Addedwrappy@1.0.2(transitive)
+ Addedws@3.3.3(transitive)
+ Addedxhr@2.6.0(transitive)
+ Addedxhr-request@1.1.0(transitive)
+ Addedxhr-request-promise@0.1.3(transitive)
+ Addedxtend@4.0.2(transitive)
- Removed@ethereumjs/rlp@4.0.1(transitive)
- Removed@ethereumjs/util@8.1.0(transitive)
- Removed@noble/curves@1.4.2(transitive)
- Removed@noble/hashes@1.4.01.5.0(transitive)
- Removed@scure/base@1.1.9(transitive)
- Removed@scure/bip32@1.4.0(transitive)
- Removed@scure/bip39@1.3.0(transitive)
- Removedbn.js@5.2.1(transitive)
- Removedethereum-bloom-filters@1.2.0(transitive)
- Removedethereum-cryptography@2.2.1(transitive)
- Removedmicro-ftch@0.3.1(transitive)
- Removedrandombytes@2.1.0(transitive)
- Removedutf8@3.0.0(transitive)
- Removedweb3-core-helpers@1.10.4(transitive)
- Removedweb3-eth-iban@1.10.4(transitive)
- Removedweb3-utils@1.10.4(transitive)
Updatedweb3-utils@1.0.0-beta.27