Socket
Socket
Sign inDemoInstall

@solana/wallet-adapter-base

Package Overview
Dependencies
Maintainers
12
Versions
42
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@solana/wallet-adapter-base - npm Package Compare versions

Comparing version 0.9.3 to 0.9.4

2

lib/cjs/adapter.d.ts

@@ -70,2 +70,2 @@ import { Connection, PublicKey, SendOptions, Signer, Transaction, TransactionSignature } from '@solana/web3.js';

}
export declare function scopePollingDetectionStrategy(performDetection: () => boolean): void;
export declare function scopePollingDetectionStrategy(detect: () => boolean): void;

@@ -44,7 +44,20 @@ "use strict";

exports.BaseWalletAdapter = BaseWalletAdapter;
function scopePollingDetectionStrategy(performDetection) {
function scopePollingDetectionStrategy(detect) {
// Early return when server-side rendering
if (typeof window === 'undefined' || typeof document === 'undefined')
return;
const poll = () => {
// Wallet detected, nothing more to do
if (detect())
return;
// Wallet not detected yet, try detecting every second
const interval = setInterval(() => {
// Wallet detected, nothing more to do
if (detect()) {
clearInterval(interval);
}
}, 1000);
};
if (document.readyState === 'complete') {
performDetection();
poll();
return;

@@ -54,3 +67,3 @@ }

window.removeEventListener('load', listener);
performDetection();
poll();
}

@@ -57,0 +70,0 @@ window.addEventListener('load', listener);

@@ -70,2 +70,2 @@ import { Connection, PublicKey, SendOptions, Signer, Transaction, TransactionSignature } from '@solana/web3.js';

}
export declare function scopePollingDetectionStrategy(performDetection: () => boolean): void;
export declare function scopePollingDetectionStrategy(detect: () => boolean): void;
{
"name": "@solana/wallet-adapter-base",
"version": "0.9.3",
"version": "0.9.4",
"author": "Solana Maintainers <maintainers@solana.foundation>",

@@ -33,3 +33,3 @@ "repository": "https://github.com/solana-labs/wallet-adapter",

},
"gitHead": "0373f0da94309cc72d4cdb3c56176ca9355f95cc"
"gitHead": "42bcf2853e268be2bb0eb5fac71a5b9d7204f420"
}

@@ -92,13 +92,29 @@ import { Connection, PublicKey, SendOptions, Signer, Transaction, TransactionSignature } from '@solana/web3.js';

export function scopePollingDetectionStrategy(performDetection: () => boolean): void {
export function scopePollingDetectionStrategy(detect: () => boolean): void {
// Early return when server-side rendering
if (typeof window === 'undefined' || typeof document === 'undefined') return;
const poll = () => {
// Wallet detected, nothing more to do
if (detect()) return;
// Wallet not detected yet, try detecting every second
const interval = setInterval(() => {
// Wallet detected, nothing more to do
if (detect()) {
clearInterval(interval);
}
}, 1000);
};
if (document.readyState === 'complete') {
performDetection();
poll();
return;
}
function listener() {
window.removeEventListener('load', listener);
performDetection();
poll();
}
window.addEventListener('load', listener);
}

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

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