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

@walletconnect/utils

Package Overview
Dependencies
Maintainers
1
Versions
661
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@walletconnect/utils - npm Package Compare versions

Comparing version 1.0.0-rc.1 to 1.0.0-rc.2

2

dist/cjs/ethereum.d.ts
import { ITxData } from "@walletconnect/types";
export declare const toChecksumAddress: (address: string) => string;
export declare function toChecksumAddress(address: string): string;
export declare const isValidAddress: (address?: string | undefined) => boolean;

@@ -4,0 +4,0 @@ export declare function parsePersonalSign(params: string[]): string[];

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const address_1 = require("@ethersproject/address");
const js_sha3_1 = require("js-sha3");
const encoding_1 = require("./encoding");
const misc_1 = require("./misc");
const validators_1 = require("./validators");
exports.toChecksumAddress = (address) => {
return address_1.getAddress(address);
};
const enc_utils_1 = require("enc-utils");
function toChecksumAddress(address) {
address = enc_utils_1.removeHexPrefix(address);
const hash = misc_1.sanitizeHex(js_sha3_1.keccak_256(encoding_1.convertUtf8ToBuffer(address)));
let checksum = "";
for (let i = 0; i < address.length; i++) {
if (parseInt(hash[i], 16) > 7) {
checksum += address[i].toUpperCase();
}
else {
checksum += address[i];
}
}
return enc_utils_1.addHexPrefix(checksum);
}
exports.toChecksumAddress = toChecksumAddress;
exports.isValidAddress = (address) => {

@@ -27,3 +40,3 @@ function isAddressAllLowercase(str) {

else {
return address === exports.toChecksumAddress(address);
return address === toChecksumAddress(address);
}

@@ -30,0 +43,0 @@ };

{
"name": "@walletconnect/utils",
"version": "1.0.0-rc.1",
"version": "1.0.0-rc.2",
"description": "Utility Library for WalletConnect",

@@ -59,8 +59,8 @@ "scripts": {

"dependencies": {
"@ethersproject/address": "5.0.0-beta.134",
"@walletconnect/types": "^1.0.0-rc.1",
"@walletconnect/types": "^1.0.0-rc.2",
"detect-browser": "5.1.0",
"enc-utils": "2.1.0"
"enc-utils": "2.1.0",
"js-sha3": "0.8.0"
},
"gitHead": "165f7993c2acc907c653c02847fb02721052c6e7"
}

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 too big to display

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