small set of tools used to easily connect an injected wallet (Metamask, Tally Oh!, Coinbase), when creating a web3 wesbite with svelte.
This small library exports a few functions and stores that can be used in your svelte application
- svelte is added as a peer dependency (it must be installed in your project).
- It works with ethers.js and expects it to be passed in the
init()
function
Initialize the providers and tries to reach the current injected wallet.
If the user has already connected to the current website in the past, it will try to call connectAccount()
too.
Asks the current connected wallet to connect the account.
Requires init() to be called prior
Disconnects the current account
Allows consumer to st Ethereum Provider and EthersProvider externally without relying on the injected wallet.
Asks the current wallet to switch the current network to network corresponding to chainId
true if there is a provider known.
the current ethereum provider; by default the injected wallet, else the wallet provided when calling connectWithGivenProvider()
the current ethers provider
the current chain id
the current signer (if connectAccount has been called)
the current signerAddress (if connectAccount has been called)
if the current account is connected
gets the value of current chainId store
gets the value of current signer store
gets the value of current provider store
gets the value of current signer or provider stores
gets the value of current ethereumProvider store