@walletconnect/utils
Advanced tools
Comparing version 1.0.0-beta.29 to 1.0.0-beta.30
@@ -38,2 +38,3 @@ /// <reference types="node" /> | ||
export declare function promisify(originalFn: (...args: any[]) => void, thisArg?: any): (...callArgs: any[]) => Promise<IJsonRpcResponseSuccess | IJsonRpcResponseError>; | ||
export declare function isEmptyArray(array: any[]): boolean; | ||
export declare function parsePersonalSign(params: string[]): string[]; | ||
@@ -40,0 +41,0 @@ export declare function parseTransactionData(txData: Partial<ITxData>): Partial<ITxData>; |
{ | ||
"name": "@walletconnect/utils", | ||
"version": "1.0.0-beta.29", | ||
"version": "1.0.0-beta.30", | ||
"description": "Utility Library for WalletConnect", | ||
@@ -61,3 +61,3 @@ "scripts": { | ||
"@ethersproject/strings": "^5.0.0-beta.125", | ||
"@walletconnect/types": "^1.0.0-beta.29", | ||
"@walletconnect/types": "^1.0.0-beta.30", | ||
"bignumber.js": "^8.1.1" | ||
@@ -64,0 +64,0 @@ }, |
@@ -41,2 +41,3 @@ # WalletConnect Utils | ||
function isEmptyString (value: string): boolean | ||
function isEmptyArray (array: any[]): boolean | ||
@@ -43,0 +44,0 @@ function payloadId (): number |
@@ -102,3 +102,3 @@ import BigNumber from 'bignumber.js' | ||
export function convertUtf8ToBuffer (utf8: string): Buffer { | ||
const result = new Buffer(utf8, 'utf8') | ||
const result = Buffer.from(utf8, 'utf8') | ||
return result | ||
@@ -153,3 +153,3 @@ } | ||
hex = removeHexPrefix(hex) | ||
const buffer = new Buffer(hex, 'hex') | ||
const buffer = Buffer.from(hex, 'hex') | ||
return buffer | ||
@@ -473,4 +473,8 @@ } | ||
export function isEmptyArray (array: any[]): boolean { | ||
return !(array && array.length) | ||
} | ||
export function parsePersonalSign (params: string[]): string[] { | ||
if (!isHexString(params[0])) { | ||
if (!isEmptyArray(params) && !isHexString(params[0])) { | ||
params[0] = convertUtf8ToHex(params[0]) | ||
@@ -477,0 +481,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
717865
1119
67