@walletconnect/utils
Advanced tools
Comparing version 1.0.0-beta.22 to 1.0.0-beta.23
@@ -30,5 +30,6 @@ /// <reference types="node" /> | ||
export declare function uuid(): string; | ||
export declare const toChecksumAddress: (address: string) => string; | ||
export declare const toChecksumAddress: (address: string) => any; | ||
export declare const isValidAddress: (address?: string | undefined) => boolean; | ||
export declare function getMeta(): IClientMeta | null; | ||
export declare function parseQueryString(queryString: string): any; | ||
export declare function parseWalletConnectUri(str: string): IParseURIResult; | ||
@@ -35,0 +36,0 @@ export declare function promisify(originalFn: (...args: any[]) => void, thisArg?: any): (...callArgs: any[]) => Promise<IJsonRpcResponseSuccess | IJsonRpcResponseError>; |
{ | ||
"name": "@walletconnect/utils", | ||
"version": "1.0.0-beta.22", | ||
"version": "1.0.0-beta.23", | ||
"description": "Utility Library for WalletConnect", | ||
@@ -58,6 +58,6 @@ "scripts": { | ||
"dependencies": { | ||
"@walletconnect/types": "^1.0.0-beta.21", | ||
"ethers": "^4.0.27" | ||
"@walletconnect/types": "^1.0.0-beta.23", | ||
"ethers-utils": "^2.1.11" | ||
}, | ||
"gitHead": "165f7993c2acc907c653c02847fb02721052c6e7" | ||
} |
@@ -1,2 +0,2 @@ | ||
import { utils } from 'ethers' | ||
const utils = require('ethers-utils') | ||
@@ -350,2 +350,23 @@ import { | ||
export function parseQueryString (queryString: string): any { | ||
const result: any = {} | ||
const pairs = (queryString[0] === '?' | ||
? queryString.substr(1) | ||
: queryString | ||
).split('&') | ||
for (let i = 0; i < pairs.length; i++) { | ||
const keyArr: string[] = pairs[i].match(/\w+(?==)/i) || [] | ||
const valueArr: string[] = pairs[i].match(/=.+/i) || [] | ||
if (keyArr[0]) { | ||
result[decodeURIComponent(keyArr[0])] = decodeURIComponent( | ||
valueArr[0].substr(1) | ||
) | ||
} | ||
} | ||
return result | ||
} | ||
export function parseWalletConnectUri (str: string): IParseURIResult { | ||
@@ -380,20 +401,5 @@ const pathStart: number = str.indexOf(':') | ||
function parseQueryParams (queryString: string): IQueryParamsResult { | ||
const result: any = {} | ||
const result = parseQueryString(queryString) | ||
const pairs = (queryString[0] === '?' | ||
? queryString.substr(1) | ||
: queryString | ||
).split('&') | ||
for (let i = 0; i < pairs.length; i++) { | ||
const keyArr: string[] = pairs[i].match(/\w+(?==)/i) || [] | ||
const valueArr: string[] = pairs[i].match(/=.+/i) || [] | ||
if (keyArr[0]) { | ||
result[decodeURIComponent(keyArr[0])] = decodeURIComponent( | ||
valueArr[0].substr(1) | ||
) | ||
} | ||
} | ||
const parameters = { | ||
const parameters: IQueryParamsResult = { | ||
key: result.key || '', | ||
@@ -400,0 +406,0 @@ bridge: result.bridge || '' |
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
579894
964
+ Addedethers-utils@^2.1.11
+ Addedethers-utils@2.1.11(transitive)
+ Addedhash.js@1.1.7(transitive)
- Removedethers@^4.0.27
- Removedaes-js@3.0.0(transitive)
- Removedbrorand@1.1.0(transitive)
- Removedelliptic@6.5.4(transitive)
- Removedethers@4.0.49(transitive)
- Removedhash.js@1.1.3(transitive)
- Removedhmac-drbg@1.0.1(transitive)
- Removedminimalistic-crypto-utils@1.0.1(transitive)
- Removedscrypt-js@2.0.4(transitive)
- Removedsetimmediate@1.0.4(transitive)
- Removeduuid@2.0.1(transitive)