Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@infinitywallet/infinity-connector
Advanced tools
Infinity Wallet connection SDK for DApp web3 connect integration
Infinity Wallet provides users with the ability to access DApps & Web3 platforms directly within the Infinity Wallet, through a feature we call “Browser-less DApps”. This feature provides users, DApps and chains with a wide range of benefits, while enhancing the overall user experience and allowing for more fluid and uninterrupted use.
If you integrate the Infinity Connector and make a tweet tagging @infinitywallet on Twitter regarding your support for Infinity Wallet connecting, we may retweet your tweet.
To integrate Infinity Wallet connecting to your DApp please follow this Integration Guide.
You will need to add to your interface an option to connect with the Infinity Wallet, either with the Infinity Wallet logo or Infinity Wallet logo + text. As an example:
To integrate Infinity Wallet Connector for a DApp on a supported EVM Chain please use the following guide. If you already support the web3 standards within your DApp the integration of Infinity Wallet connecting should take no longer than 5 minutes.
To support Infinity Wallet connecting your DApp should be EIP1193 compatible. This is the same protocol that is used to interact with other EVM compatible wallets such as Metamask. Meaning if your DApp supports Metamask connecting you will be able to support Infinity Wallet connecting with a few lines of code.
To use the SDK you can install the package in your project by:
yarn add @infinitywallet/infinity-connector
npm install @infinitywallet/infinity-connector
The first thing you are going to need to do is detect whether your DApp is being accessed via the Infinity Wallet and if the Infinity Wallet is installed. To do this please use:
window.ethereum && window.ethereum?.isInfinityWallet
If returns TRUE then the DApp is currently running within the Infinity Wallet, you can initialize the wallet connection with Initiate Connector followed by calling the web3 method Activate
If returns FALSE then it means the Infinity Wallet needs to be opened using Open Infinity Wallet function;
This function should be called when Detect Infinity Wallet returns TRUE.
import { InfinityWalletConnector } from '@infinitywallet/infinity-connector';
const infinitywalletConnector = new InfinityWalletConnector({
supportedChainIds: [CHAIN_ID]
});
This function should be called when Detect Infinity Wallet returns TRUE and after initiating InfinityWalletConnector as shown in Initiate Connector. Pass the initialized connector into the useWeb3ReactCore method (activate) to activate the wallet connection.
const { activate, active } = useWeb3ReactCore()
activate(infinitywalletConnector)
This function should be called when Detect Infinity Wallet Wallet returns FALSE.
By calling this function and passing your DApp url (replace "YOUR_DAPP_URL") and Chain ID (replace "CHAIN_ID") it will open your DApp in the Infinity Wallet if the user has the Infinity Wallet installed. If the user does not have Infinity Wallet installed it will redirect them to download the Infinity Wallet.
import { openInfinityWallet } from '@infinitywallet/infinity-connector';
openInfinityWallet(YOUR_DAPP_URL, CHAIN_ID);
The following is an example on how to use the SDK to detect, connect and open the Infinity Wallet to connect with a DApp.
Using this example make sure to replace the following:
import { InfinityWalletConnector, openInfinityWallet } from '@infinitywallet/infinity-connector';
const { activate, active } = useWeb3ReactCore();
const infinitywalletConnector = new InfinityWalletConnector({
supportedChainIds: [CHAIN_ID]
});
if(window.ethereum && window.ethereum?.isInfinityWallet){
activate(infinitywalletConnector);
console.log('Infinity Wallet is connected and can be used with the DApp');
} else {
openInfinityWallet(YOUR_DAPP_URL, CHAIN_ID);
console.log('Open DApp on a specific chain in Infinity Wallet if installed, or if not installed it will redirect to download Infinity Wallet');
}
FAQs
Infinity Wallet connection SDK for DApp web3 connect integration
The npm package @infinitywallet/infinity-connector receives a total of 566 weekly downloads. As such, @infinitywallet/infinity-connector popularity was classified as not popular.
We found that @infinitywallet/infinity-connector demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.