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

walletlink

Package Overview
Dependencies
Maintainers
2
Versions
40
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

walletlink - npm Package Compare versions

Comparing version 2.1.5 to 2.1.6

2

dist/provider/WalletLinkProvider.d.ts

@@ -28,2 +28,3 @@ import { AddressString, Callback } from "../types";

private hasMadeFirstChainChangedEmission;
private isChainOverridden;
constructor(options: Readonly<WalletLinkProviderOptions>);

@@ -43,2 +44,3 @@ get selectedAddress(): AddressString | undefined;

setProviderInfo(jsonRpcUrl: string, chainId: number): void;
private updateProviderInfo;
setAppInfo(appName: string, appLogoUrl: string | null): void;

@@ -45,0 +47,0 @@ enable(): Promise<AddressString[]>;

@@ -27,4 +27,18 @@ "use strict";

this.hasMadeFirstChainChangedEmission = false;
// true if mobile client has sent message to override jsonRpcUrl+chainId
this.isChainOverridden = false;
this._send = this.send;
this._sendAsync = this.sendAsync;
this.setProviderInfo = this.setProviderInfo.bind(this);
this.updateProviderInfo = this.updateProviderInfo.bind(this);
this.setAppInfo = this.setAppInfo.bind(this);
this.enable = this.enable.bind(this);
this.close = this.close.bind(this);
this.send = this.send.bind(this);
this.sendAsync = this.sendAsync.bind(this);
this.request = this.request.bind(this);
this._setAddresses = this._setAddresses.bind(this);
this.scanQRCode = this.scanQRCode.bind(this);
this.arbitraryRequest = this.arbitraryRequest.bind(this);
this.childRequestEthereumAccounts = this.childRequestEthereumAccounts.bind(this);
this._chainId = util_1.ensureIntNumber(options.chainId || 1);

@@ -86,6 +100,13 @@ this._jsonRpcUrl = options.jsonRpcUrl;

setProviderInfo(jsonRpcUrl, chainId) {
this._jsonRpcUrl = jsonRpcUrl;
if (this.isChainOverridden)
return;
this.updateProviderInfo(jsonRpcUrl, chainId, false);
}
updateProviderInfo(jsonRpcUrl, chainId, fromRelay) {
if (fromRelay)
this.isChainOverridden = true;
const originalChainId = this._chainId;
this._chainId = util_1.ensureIntNumber(chainId);
const chainChanged = this._chainId !== originalChainId;
this._jsonRpcUrl = jsonRpcUrl;
if (chainChanged || !this.hasMadeFirstChainChangedEmission) {

@@ -615,4 +636,8 @@ this.emit("chainChanged", this._chainId);

return this._relayProvider().then(relay => {
relay.setChainIdCallback((chainId) => this.setProviderInfo(this._jsonRpcUrl, parseInt(chainId, 10)));
relay.setJsonRpcUrlCallback((jsonRpcUrl) => this.setProviderInfo(jsonRpcUrl, this._chainId));
relay.setChainIdCallback((chainId) => {
this.updateProviderInfo(this._jsonRpcUrl, parseInt(chainId, 10), true);
});
relay.setJsonRpcUrlCallback((jsonRpcUrl) => {
this.updateProviderInfo(jsonRpcUrl, this._chainId, true);
});
this._relay = relay;

@@ -619,0 +644,0 @@ return relay;

2

package.json
{
"name": "walletlink",
"version": "2.1.5",
"version": "2.1.6",
"description": "WalletLink JavaScript SDK",

@@ -5,0 +5,0 @@ "keywords": [

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