1.0.5 • Published 11 months ago

lync-wallet-sdk v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
11 months ago

LYNC Wallet Integration SDK

LYNC Wallet Integration SDK allows anyone to integrate Web3 Wallets inside any project in few lines of code.

Steps to setup Wallet inside any project:

Install NPM Package: npm install lync-wallet-sdk

Integrate MetamaskConnect:

Wrap App component with AuthContextProvider

import { AuthContextProvider } from "lync-wallet-sdk";

  <AuthContextProvider chainToConnect={ChainID}>
  <App />
  </AuthContextProvider>

Integrate Metamask Connect Template:

import { AuthContext, MetamaskConnect } from "lync-wallet-sdk";

<MetamaskConnect chainId={ChainID} />
// Pass Chain ID

Integrate Metamask Connect Login on any component:

import { walletConnect, AuthContext } from "lync-wallet-sdk";

  <button onClick={() => walletConnect(ChainID)}>Connect Wallet</button> 

// Pass Chain ID

After user signed in via metamask, can be used to get the user's wallet address, provider for contract Interactions and Chain user is connected to.

  const { connectedChainId, provider, walletAddress } = useContext(AuthContext);

List of chain IDs:

Chain NameChain ID
Ethereum Mainnet0x1
Polygon0x89
Astar Mainnet0x250
Avalanche Mainnet0xa86a
OKC Mainnet0x42
Arbitrum One Mainnet0xa4b1
zkSync Mainnet0x144
Eth Goerli testnet0x5
Mumbai Testnet0x13881
Polygon Zkevm Testnet0x5a2
Astar Shibuya Testnet0x51
zkSync Testnet0x118
Mantle Testnet0x1389
Arbitrum Goerli Testnet0x66eed
Avalanche Fuji Testnet0xa869
OKC Testnet0x41