@walletconnect/utils
Advanced tools
Comparing version 1.0.0-beta.35 to 1.0.0-beta.36
@@ -28,2 +28,3 @@ /// <reference types="node" /> | ||
export declare function removeHexPrefix(hex: string): string; | ||
export declare function removeHexLeadingZeros(hex: string): string; | ||
export declare function isHexString(value: any): boolean; | ||
@@ -30,0 +31,0 @@ export declare function isEmptyString(value: string): boolean; |
{ | ||
"name": "@walletconnect/utils", | ||
"version": "1.0.0-beta.35", | ||
"version": "1.0.0-beta.36", | ||
"description": "Utility Library for WalletConnect", | ||
@@ -61,3 +61,3 @@ "scripts": { | ||
"@ethersproject/strings": "^5.0.0-beta.125", | ||
"@walletconnect/types": "^1.0.0-beta.35", | ||
"@walletconnect/types": "^1.0.0-beta.36", | ||
"bignumber.js": "^8.1.1" | ||
@@ -64,0 +64,0 @@ }, |
@@ -198,2 +198,9 @@ import BigNumber from 'bignumber.js' | ||
export function removeHexLeadingZeros (hex: string): string { | ||
hex = removeHexPrefix(hex) | ||
hex = hex.startsWith('0') ? hex.substring(1) : hex | ||
hex = addHexPrefix(hex) | ||
return hex | ||
} | ||
export function isHexString (value: any): boolean { | ||
@@ -263,3 +270,3 @@ return _isHexString(value) | ||
const links: HTMLCollectionOf< | ||
HTMLLinkElement | ||
HTMLLinkElement | ||
> = document.getElementsByTagName('link') | ||
@@ -312,3 +319,3 @@ const icons: string[] = [] | ||
const metaTags: HTMLCollectionOf< | ||
HTMLMetaElement | ||
HTMLMetaElement | ||
> = document.getElementsByTagName('meta') | ||
@@ -453,4 +460,4 @@ | ||
): ( | ||
...callArgs: any[] | ||
) => Promise<IJsonRpcResponseSuccess | IJsonRpcResponseError> { | ||
...callArgs: any[] | ||
) => Promise<IJsonRpcResponseSuccess | IJsonRpcResponseError> { | ||
const promisifiedFunction = async ( | ||
@@ -505,2 +512,5 @@ ...callArgs: any[] | ||
} | ||
if (typeof result === 'string') { | ||
result = removeHexLeadingZeros(result) | ||
} | ||
return result | ||
@@ -507,0 +517,0 @@ } |
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
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
734614
1133