wevm / wagmi Goto Github PK
View Code? Open in Web Editor NEWReact Hooks for Ethereum
Home Page: https://wagmi.sh
License: MIT License
React Hooks for Ethereum
Home Page: https://wagmi.sh
License: MIT License
0.2.18
I use Next.js to build the login flow with crypto wallet. When a user closes the WalletConnect modal without establishing a connection, the application breaks and throw a Runtime Error
This issue happens in web3-react library as well: https://github.com/NoahZinsmeister/web3-react/issues/454
When the user closes the WalletConnect without establishing a connection, an error message will be shown on the UI instead of breaking the UI
Follow the steps described on the wagmi library documentation
No response
No response
0.2.9
When using the autoConnect
prop on the Provider, if a user connects via Wallet Connect using MetaMask (I did not test other Wallet Connect clients) and refreshes the page, the user appears connected from the perspective of wagmi (useAccount
) returns an address, but actions involving the user's wallet will fail. Specifically, prompting a signature with useSignMessage
seems to send a message across the Wallet Connect bridge and displays within the user's wallet, but never resolves in wagmi. Prompting a transaction with useTransaction
calcuates gas, but does not display the transaction within the user's wallet.
After connecting via Wallet Connect and refreshing the page, the user remains connected and is able to complete actions with their wallet.
autoConnect
set on wagmi provideruseTransaction
or useSignMessage
No response
No response
0.2.9
Access to fetch at 'https://cloudflare-eth.com/' from origin 'https://xxxx.vercel.app' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.
POST https://cloudflare-eth.com/ net::ERR_FAILED
Successfully read contract
const NFTId = () => {
const provider = useProvider()
const [{ data, error, loading }, read] = useContractRead(
{
addressOrName: '0xe538B351070C02d17b5878D3017932A68606fbaE',
contractInterface: passABI,
signerOrProvider: provider,
},
'totalSupply',
{
args: [0],
}
)
console.log(data)
return (
<div>
<span className="nes-text">{loading
?
null
: data}</span>
</div>
)
}
No response
No response
0.2.21
When a user connects a wallet using either the injected providers (wallet link or metamask) or the wallet connect provider, there is no emit('connect')
called. This is useful for syncing with logic that may exist outside of react or need to be invoked using the event listeners (since .on('connect')
is provided)
Whenever a wallet is connected, there should be a call to wallet.emit('connect')
in order to send those events.
https://codesandbox.io/s/holy-thunder-t4yzxb?file=/src/App.tsx
No response
0.2.9
When using the existing Remix example the alchemy
, etherscan
, infuraId
API keys stored in the .env
files are exposed to the client allowing anyone access to the keys. This seems like this shouldn't be the case given some api keys are not for free accounts. Am I missing something here?
The keys are returned from the loader function
export function loader() {
require('dotenv').config()
return {
alchemy: process.env.REMIX_ALCHEMY_ID as string,
etherscan: process.env.REMIX_ETHERSCAN_API_KEY as string,
infuraId: process.env.REMIX_INFURA_ID as string,
}
}
and exposed via the provider
in the App()
const provider = ({ chainId }: ProviderConfig) =>
providers.getDefaultProvider(
isChainSupported(chainId) ? chainId : defaultChain.id,
{
alchemy,
etherscan,
infuraId,
},
)
Even in the build these keys are easily found by searching for getDefaultProvider
.
provider: ({chainId: x})=>Tg.providers.getDefaultProvider(s(x) ? x : i.id, {
alchemy: t,
etherscan: e,
infuraId: r
}),
No response
No response
No response
No response
0.2.21
With a hook call such as const [{ data , loading }] = useAccount({ fetchEns: true });
, the value for loading
will be false during initial render as the initial state for useEnsLookup
is { loading: false }
. This introduces a need for application developers to track load status until "second load" to ensure that ENS lookup has been performed.
The initial state for useEnsLookup
should reflect the fetchEns
parameter. If fetchEns
is true, the initial state for useEnsLookup
should be { loading: true }
. This will allow applications to withhold actions through initial account connection until ENS data has been fetched.
No response
https://codesandbox.io/s/dazzling-wright-4405hb?file=/src/App.tsx:0-32
No response
0.2.21
When I try to connect to coinbase wallet, the modal for Coinbase Wallet correctly opens up, but throws the following error (which stalls the web app). It seems to be related to the QR code they try to show.
Uncaught ReferenceError: Buffer is not defined
at Object.__ (QRCode.js:28:1)
at j (index.js:368:1)
at Array.forEach (<anonymous>)
at preact__WEBPACK_IMPORTED_MODULE_0__.options.__r (index.js:36:1)
at j (index.js:171:1)
at w (children.js:137:1)
at L (index.js:392:1)
at j (index.js:224:1)
at w (children.js:137:1)
at L (index.js:392:1)
To be able to connect to coinbase wallet.
I tried following both the set up guide from both Wagmi and Coinbase (https://docs.cloud.coinbase.com/wallet-sdk/docs/wagmi#additional-resources), including trying their troubleshooting solution at the bottom of the page.
No response
I've tried copying my package list into the working codesandbox example (that does work), but it doesn't seem to break when I do this, so I'm at a loss for what is causing my issue. I'm also unable to get WalletConnect to open on my machine but can in CodeSandbox, so is this maybe expected that these connections will not work when running from localhost or something?
1.0.0
For those who copy + paste code, the example on the useTransaction hook (Link to docs) calls the signMessage function, which is undefined.
<button disabled={loading} onClick={async () => **await signMessage**()}> Send Transaction </button>
Should call sendTransaction instead
No response
No response
^0.2.17
When clicking on MetaMask to connect your wallet the Coinbase browser extension also pops up.
If you have the CoinBase wallet extension downloaded just like MetaMask it opens up when you click on MetaMask as your chosen provider for connection. However, when you click on CoinBase as your chosen wallet provider MetaMask doesn't open up as it should. So the problem is only when you click on MetaMask the CoinBase wallet extension pops up when it shouldn't because I clicked on MetaMask, not CoinBase.
I first noticed this within my app but then went back to docs to see if I was missing something but noticed it also happens within the docs in the connect wallet guide section (https://wagmi.sh/guides/connect-wallet).
The expected behavior should be when I click on MetaMask to connect my wallet only the MetaMask extension should popup and not any other wallet provider extension.
Download the CoinBase wallet extension got to the docs here : https://wagmi.sh/guides/connect-wallet
Click on MetaMask then watch both MetaMask and CoinBase wallet extension pop up
CoinBase Extension Download https://chrome.google.com/webstore/detail/coinbase-wallet-extension/hnfanknocfeofbddgcijnmhnfnkdnaad?hl=en
https://wagmi.sh/guides/connect-wallet
Browser: Google Chrome Version 99.0.4844.74 (Official Build) (x86_64)
MetaMask Version: 10.11.1
CoinBase Version: 2.10.3
WAGMI Version: ^0.2.17
0.2.12
const connectors = ({ chainId }) => {
const rpcUrl = chain.hardhat.rpcUrls[0];
// console.log("rpcUrl", rpcUrl, developmentChains, chain.hardhat);
return [
new InjectedConnector({
chains: [chain.hardhat],
options: { shimDisconnect: true },
}),
];
};
I am trying to get my hardhat localhost balance, but instead the browser requesting to mainnet.infura?
it should return the balance of my current selected network balance... and provide a way set a default network.
const connectors = ({ chainId }) => {
const rpcUrl = chain.hardhat.rpcUrls[0];
// console.log("rpcUrl", rpcUrl, developmentChains, chain.hardhat);
return [
new InjectedConnector({
chains: [chain.hardhat],
options: { shimDisconnect: true },
}),
];
};
const [{ data: accountData }, disconnect] = useAccount({
fetchEns: true,
});
console.log("accountData?.address", accountData?.address);
const [
{ data: balanceData, error: balanceError, loading: loadingBalance },
getBalance,
] = useBalance({
addressOrName: accountData?.address,
// watch: true,
});
No response
0.2.24
https://github.com/tmm/wagmi/tree/main/examples/next
I am using the above example project to display the page properly in the TokenPoket Dapp browser for iPhone XR, iPhone 11Pro, and iPhone 11. Using JSConsole debugging, I can't see any obvious error messages.
No response
No response
https://github.com/tmm/wagmi/tree/main/examples/next
No response
0.2.21
In the examples/vite-react
example project it works with
yarn dev;
It does not work with the vite build process:
โฏ yarn build
yarn run v1.22.17
$ tsc && vite build
node_modules/walletlink/dist/index.d.ts:10:9 - error TS2717: Subsequent property declarations must have the same type. Property 'ethereum' must be of type '(InjectedProviders & { on?: ((...args: any[]) => void) | undefined; removeListener?: ((...args: any[]) => void) | undefined; request<T = any>(args: RequestArguments): Promise<...>; }) | undefined', but here has type 'WalletLinkProvider | undefined'.
10 ethereum?: WalletLinkProvider;
~~~~~~~~
node_modules/wagmi-core/dist/declarations/src/types/declarations.d.ts:41:3
41 ethereum?: InjectedProviders & {
~~~~~~~~
'ethereum' was also declared here.
Found 1 error in node_modules/walletlink/dist/index.d.ts:10
error Command failed with exit code 2.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
This looks to be related specifically with WalletLinkConnector
, because when you comment out this section from the example, everything works properly.
Builds without any errors and are able to run yarn preview
afterwards.
git clone https://github.com/tmm/wagmi;
cd wagmi/examples/vite-react;
yarn install;
yarn build;
No response
No response
"wagmi": "^0.2.9"
Typescript fails to add a new Property to an IronSession as shown in the example
./pages/api/verify.ts:21:21
Type error: Property 'siwe' does not exist on type 'IronSession'.
19 | const siweMessage = new SiweMessage(message)
20 | const fields = await siweMessage.validate(signature)
> 21 | req.session.siwe = fields
| ^
22 | await req.session.save()
23 | res.json({ ok: true })
24 | } catch (_error) {
error Command failed with exit code 1.
No response
No response
No response
No response
0.1.2
When installing the latest version (in a nextjs 11 app), I get the error:
error - Error [ERR_PACKAGE_PATH_NOT_EXPORTED]: Package subpath './connectors/injected' is not defined by "exports" in /Users/gosset/Dev/frontend/node_modules/wagmi/package.json
No response
Install the latest version of the package inside of a nextjs 11 app and then run it.
No response
0.2.21
When switching from BSC Mainnet to BSC Testnet for the first time, when not 'autoconnected' it will disconnect metamask without any error.
Not sure why this happens. I first commented here as it seemed related able.
#180 (comment)
Metamask should stay connected during network switch.
https://codesandbox.io/s/wagmi-issue-287-9o9cos
This Error bubbles up in our Dapp if this behaviour occurs., but can't see it in the CodeSandbox.
Not sure where this is coming from. Can't find the source. Might be related.
Error: underlying network changed (
event="changed",
network={"name":"bnb","chainId":56,"ensAddress":null,"_defaultProvider":null},
detectedNetwork={"name":"bnbt","chainId":97,"ensAddress":null,"_defaultProvider":null},
code=NETWORK_ERROR,
version=providers/5.6.1
)
at Logger.makeError (index.js?dd68:219:1)
at Web3Provider.eval (base-provider.js?4ba1:971:1)
at Generator.next (<anonymous>)
at fulfilled (base-provider.js?4ba1:5:43)
1
Is there a way to use the lib with React Class Components?
No response
No response
No response
No response
0.2.18
When running editSwap
with the following code
const [{ data: editData, error: editError, loading: editLoading }, editSwap] =
useContractWrite(
{
addressOrName: genStore.currentContract,
contractInterface: contractInterface,
},
"extendAllotedTime",
{ args: [0] }
);
I get the following error:
Error: missing argument: passed to contract (count=0, expectedCount=1, code=MISSING_ARGUMENT, version=contracts/5.5.0)
I tried placing the argument with and without an array and successfully used useContractWrite on other functions with no args.
No response
No response
No response
No response
0.2.24
My project is reporting an error in the TokenPoket Dapp browser on iPhone XR,iPhone 11 Pro, it can't bring up the wallet, I tried to switch to another version but still can't solve it.
No response
No response
No response
No response
0.1.5
I have a contractWrite:
const [{ data, error, loading }, write] = useContractWrite(
{
addressOrName: SMART_CONTRACT, // Ropsten ERC1155 contract
contractInterface: AccessTokenABI.abi,
signerOrProvider: signerData,
},
"buy"
)
I'm calling the write method and passing value
in overrides
:
const writeResult = await write({
args: [id],
overrides: {
gasLimit: "1000000",
value: ethers.utils.parseEther("0.01"),
},
})
I'm getting a typescript error:
Object literal may only specify known properties, and 'value' does not exist in type 'Overrides'.
The actual request works as intended, so I'm not sure why TS is throwing an error. Couldn't find anything in the ethers doc either.
No typescript error when passing value as an override.
Use the above code.
Originally posted by math-marcellino January 15, 2022
Hello, I'm quite new with wagmi. I'm using wagmi version 0.1.4. So I want to fetch an event emitted in a transaction from useContractWrite. I used useContractEvent and followed the example on the docs, but I'm getting a runtime error (TypeError: contract_.on is not a function) on node_modules\wagmi\dist\wagmi.esm.js (920:49). The code that I wrote looks like this :
useContractEvent(
{
addressOrName: myContractAddress,
contractInterface: myContractInterface,
},
'myEventName',
(event) => console.log(event),
)
Is there something that I'm missing?
latest
the official listed website shows 404: https://wagmi-xyz.vercel.app
should not 404
visit https://wagmi-xyz.vercel.app/
No response
0.2.12
Currently if my wallet is connected to a network and that network is down (for example; at the time of writing https://matic-mumbai.chainstacklabs.com is down), then the connect
function does nothing.
It appears to eventually time out, after a good 3-4 minutes:
It'd be nice to have the connect function timeout / reject after a configurable amount of time. Right now it just looks like my site is broken, so I'm keen to feed back to the user that the issue is with the network they've currently got selected in metamask.
Set your metamask wallet to a network that's done, any RPC address that times out will do.
Attempt to connect using an injected connector
Wait
No response
No response
0.2.21
If you wrap your app with the wagmi provider and give it the WalletConnectConnector it will work just fine on any macbook and any browser but on any mobile device third party modals like https://chakra-ui.com/ wont open anymore.
Its most likely cause of the Support for the experimental syntax 'classPrivateMethods' isn't currently enabled
error you see in sandbox, but i am not sure.
So if you recreate the sandbox repo locally on your computer (I use nextjs, next build && next export && next start) it will work just fine on the mac but not on your ios device anymore. i did not check android.
Problem lies with the WalletConnectConnector
that it works
read "current behavior"
https://codesandbox.io/s/reverent-gould-ryzlsx
Bug is gone on ios 15 but present on ios 14
0.0.17
I think I may have come across a bug in the useContract
hook that surfaces when any of the hook arguments change throughout the lifetime of the component. Will provide an example below using a changing signer
object.
Using the hook to instantiate a contract w/ a signer:
const contract = useContract({
addressOrName: '0xa50f703771d04d9e76e03b20720539fc014aaa40',
contractInterface: Erc20Abi,
signerOrProvider: signer,
});
This seems to work fine if the signer
object is available on first component render (i.e. the first time the hook runs), but if the signer
is undefined
on first render (which it typically would be since account.connector.getSigner()
is an async call), then the contract
object returned by useContract
will not be updated with the proper signer
object, and it will instead take an additional render to see the contract
object you're expecting.
This can be verified by forcing a re-render of the consumer component after signer
is available, but this shouldn't be necessary and is indicative of a bug in the useContract
hook. The logic in the useEffect
block of the hook says "instantiate a new contract object if the contract address, ABI, or signer/provider has changed", which is correct, but because it's being stored in a ref (and not React state) it doesn't trigger the consumer component to re-render after the ref value is updated, causing the component to have a stale version of the contract
object until a subsequent re-render is triggered.
From React useRef docs:
Keep in mind that useRef doesnโt notify you when its content changes. Mutating the
.current
property doesnโt cause a re-render.
Based on the way the hook is written, this bug will also surface when any of the other hook arguments change.
When any of the useContract
hook arguments change throughout the lifetime of the component, a newly instantiated contract
object should be provided to the component by the hook.
import { useState, useEffect } from 'react';
import { useAccount, useContract } from 'wagmi';
import { Signer } from 'ethers';
export default () => {
const [{ data: account }] = useAccount();
const [signer, setSigner] = useState<Signer>();
// get signer
useEffect(() => {
(async () => {
try {
const res = await account?.connector?.getSigner();
setSigner(res);
} catch (e) {
setSigner(undefined);
}
})();
}, [account?.connector]);
// instantiate contract
const contract = useContract({
addressOrName: '0xa50f703771d04d9e76e03b20720539fc014aaa40',
contractInterface: Erc20Abi,
signerOrProvider: signer,
});
useEffect(() => {
// this is incorrectly `null` even after `signer` is available
console.log(contract.signer);
}, [contract]);
return null;
}
This issue may be related to this discussion: #49
0.2.7
I added some new chains when setting up the providers.
When i use SwitchNetwork from the useNetwork hook with chains i added e.g BSC, BSC Testnet etc, the selected network and list of networks do not show any longer.
There is no error and if i refresh the page, it now shows that i am connected to the right network
SwitchNetwork should work well with default and non default chains
Add new chains to the provider on setup and then use the code below to select and switch between chains
import { useNetwork } from 'wagmi'
const App = () => {
const [{ data, error, loading }, switchNetwork] = useNetwork()
return (
<>
<div>
{data.chain?.name ?? networkData.chain?.id}{' '}
{data.chain?.unsupported && '(unsupported)'}
</div>
{switchNetwork &&
data.chains.map((x) =>
x.id === data.chain?.id ? null : (
<button key={x.id} onClick={() => switchNetwork(x.id)}>
Switch to {x.name}
</button>
),
)}
{error && <div>{error?.message}</div>}
</>
)
}
No response
No response
0.2.21
I have cloned the repo of the remix example merged into wagmi over at a examples/remix
- Upon installing the dependencies and making no changes beside configuring the ENV file - starting the app with npm run dev
leads to an application error on the root with the following error.
TypeError: Cannot read properties of undefined (reading 'root')
How can we fix this official example so that we can start using wagmi with Remix?
The expected behavior is to compile without error on a clone.
examples/remix
example in the tmm/wagmi
repo.npm install && npm run dev
No response
No response
1.0.0
Whenever an Injected connector is initiated and found, the connection prompt (in my case MetaMask) is always initiated, asking me which MetaMask account I want to connect with. From a UX perspective, it would be nicer to wait until the user clicks one of the wallet buttons to trigger this. I've essentially copied the code from the example docs.
Wait for the connection to be initiated by the user, or have an option to toggle this off. I checked the source, seems like getAccounts() is called when an InjectedConnector is initiated, which in turn triggers a window.ethereum.requestAccounts() call.
No response
No response
latest
I am keep getting Ethereum mainnet balance while I am connected to Polygon Mainnet.
No response
No response
No response
No response
0.0.17
Not sure if this is a Next.js specific thing - it's happening for me in the example + in my own fresh Next.js app
Simple setup - just following the guide
export const Example = () => {
const [{ data, error }, connect] = useConnect();
return (
<div>
{data.connectors.map((x) => (
<button disabled={!x.ready} key={x.id} onClick={() => connect(x)}>
{x.name}
{!x.ready && ' (unsupported)'}
</button>
))}
{error && <div>{error?.message ?? 'Failed to connect'}</div>}
</div>
);
};
No response
No response
No response
wagmie-core 0.1.15
Safari iOS doesnt support private instance fields in a class, this causes an exception on devices due to the #
character.
Ideally it would be transpiled and targeted at a lower version
No response
No response
No response
0.2.17
Hooks that return tuples do not have their indexes named
A hook should return [result: Data, disconnect: () => void]
so that it's clear what the function does rather than having to consult the docs.
I was writing the code below getting started with wagmi
and wanted to quickly see what useAccount
would do in the second item in the tuple
No response
No response
No response
0.2.21
When I try to connect to Wallet Connect, it throws the following error and does not display QR code:
ReferenceError: Buffer is not defined
at typedarrayToBuffer (index.js:15:1)
at Module.arrayToBuffer (index.js:28:1)
at Module.generateKey (index.js:7:1)
at WalletConnect._generateKey (index.js:847:1)
at WalletConnect.createSession (index.js:299:1)
at SignerConnection.create (index.js:136:1)
at index.js:54:1
at new Promise (<anonymous>)
at SignerConnection.open (index.js:47:1)
at JsonRpcProvider.open (provider.js:84:1)
To be able to connect using Wallet Connect
Buffer is not defined
No response
Related: #261
0.0.17
Using a Next.js app, Im calling the disconnect
function from the useAccount
hook. It does disconnect but then after refreshing the page it reconnects again and the account info re-populates
I would expect to be disconnected from ym wallet so that I may be able to reconnect again with a different wallet or simply use the site in its disconnected state
connected:true
.disconnect
function. -> useAccount returns empty data as expected and connected: false
.connected:true
No response
Edit: It seems as though if I remove autoConnect
prop on the provider then it does indeed keep me disconnected however that then means on every refresh I need to reconnect. Ideally I would like connect automatically until I explicitly call disconnect
1.2.0
It shows duplicate fetch requests upon route transition in next.js
What is the getUrl
and is there any way i can deduplicate the requests
No response
No response
No response
0.0.17
The disconnect wallet feature from the useAccount hook doesn't seem to disconnect the wallet completely and just shows that it is disconnected on the client side as I have autoconnect enabled while declaring the Provider in the App.js even after disconnecting the wallet if I reload the app it gets connected to the account that I connected previously.
The disconnect feature should remove the app from the metamask connected sites of the user is what I believe and I'm not sure if its possible but what I've seen other packages do is they change the account state to undefined and even after a reload it stays undefined unless and until the user connects wallet again.
Codesandbox link:- https://codesandbox.io/s/thirsty-butterfly-6i0ct
No response
0.2.15
When building a page with next.js using getStaticProps, it attempts to use the commonjs module version of wagmi and breaks as it looks like wagmi-core doesnt export or include the required module.
No response
Create a next.js app
Use get static props to force serverside build of the page.
Attempt to load the page
No response
No response
0.1.3
Tried using the WalletConnectConnector from the module import as stated in the docs as usual, getting an error with a message that it's not a constructor.
Expecting to instantiate the WalletConnectConnector
Function for instantiating wallet connectors
export const walletConnectors = ({ chainId }) => {
const rpcUrl =
chains.find((x) => x.id === chainId)?.rpcUrls?.[0] ??
chain.mainnet.rpcUrls[0];
return [
new InjectedConnector({ chains }),
new WalletConnectConnector({
options: {
infuraId: INFURA_ID,
qrcode: true,
},
}),
new WalletLinkConnector({
options: {
appName: "AppName",
jsonRpcUrl: `${rpcUrl}/${INFURA_ID}`,
},
}),
];
};
latest
I cloned the vite-react example from https://github.com/tmm/wagmi/tree/main/examples/vite-react and found the following issues:
MirrorERC20FactoryContract
is imported but it doesn't exist: https://github.com/tmm/wagmi/blob/21d6de32e4cdbf40a6d9c01f0993876af33f89b7/examples/vite-react/src/components/ContractFunction.tsx#L6tsconfig.json
file extends another config file that's not accessible: https://github.com/tmm/wagmi/blob/21d6de32e4cdbf40a6d9c01f0993876af33f89b7/examples/vite-react/tsconfig.json#L2The example should run as a standalone without breaking issues. Currently cloning the vite-react example locally or using stackblitz or codestandbox fails to run.
Stackblitz: https://stackblitz.com/github/tmm/wagmi/tree/main/examples/vite-react
Codesandbox: https://githubbox.com/tmm/wagmi/tree/main/examples/vite-react
Use a separate repo for the examples to ensure the examples are not relying on external files that are not part of dependencies.
0.2.1
The following should detect account change:
provider.on("accountsChanged", (accounts) => {
console.log("accountsChanged", accounts);
})
// This also should work
provider.once("accountsChanged", (accounts) => {
console.log("accountsChanged", accounts);
})
However neither works. When using window.ethereum
instead of the wagmi provider, it works.
I'm using the official example provided in the package.
Should emit account change activity.
provider.on("accountsChanged", (accounts) => {
console.log("accountsChanged", accounts);
})
No response
0.2.1
I am using the package in my next.js application.
When I send transactions to a wallet connected with WalletConnect, the transaction promise never returns.
In the following code snippet, the transaction is picked up by the wallet and will successfully send, but the notifications aren't displayed and the receipt isn't logged.
I tried this with multiple wallets (Metamask and Valora) and neither of them work. Metamask works as expected.
const setStorage = async (values) => {
let tx = await contract.store(values.number);
notification.open({
message: "Updating Storage",
description: `Contract storage updating to: ${values.number}`,
});
let receipt = await tx.wait();
console.log("receipt", receipt);
}
I expect the transaction promise to resolve when it is sent by the wallet.
No response
No response
0.0.17
When I clone examples/next to local, visit index page, found that MetaMask button is disabled, it seems that MetaMask in connectors is not ready, and there is another warning says
Warning: Text content did not match. Server: "Injected" Client: "MetaMask" at button
So, what's the reason leads that issue?
No response
No response
0.2.15
https://github.com/liran319/next-wagmi-demo
I have install [email protected]
into my project with Nextjs, it works well when start project with 'yarn dev'.
But Uncaught SyntaxError: Unexpected template string
occurs when run 'yarn build && yarn start'.
It seems that only occurs on production mode.And there is no stack to debug.
Could you please have a check?
Both development and production mode work well.
https://github.com/liran319/next-wagmi-demo
, and enter that folder;yarn
to install deps;No response
No response
Module parse failed: Unexpected token (255:5)
CRA with package [email protected]
fails with this error:
./node_modules/wagmi-core/dist/wagmi-core.esm.js 255:5
Module parse failed: Unexpected token (255:5)
File was processed with these loaders:
* ./node_modules/react-scripts/node_modules/babel-loader/lib/index.js
You may need an additional loader to handle the result of these loaders.
|
| class InjectedConnector extends Connector {
> id = 'injected';
| ready = typeof window != 'undefined' && !!window.ethereum;
| #provider;
wgami
versions below 0.2.15
work fine.
[email protected]
should still be supported.
[email protected]
and [email protected]
No response
No response
2.0.1
Component re-render infinitely
Component rerender only when data is not loaded
Nope
0.2.1
When a wallet is connected the useAccount
hook returns an address, but this address is not checksummed.
It would be much more canonical if the address returned was in the checksummed format.
No response
Not sure if this is dependent on the connector but it would be good to normalise thise
0.0.17
I connected my metamask wallet while I was connected to the avalache c chain network, the app crashes and show this screen. The tab also hangs and console shows that the app goes into an infinite loop trying to reconnect.
The app should catch errors on unsupported networks and gracefully show the user a prompt.
In metamask, switch to a network that's unsupported, then try to "Connect Wallet".
No response
0.2.24
Using latest version of React (18)
$ npx create-react-app my-app
Appears not be supported
$ npm add wagmi ethers
npm ERR! code ERESOLVE
npm ERR! ERESOLVE unable to resolve dependency tree
npm ERR!
npm ERR! While resolving: [email protected]
npm ERR! Found: [email protected]
npm ERR! node_modules/react
npm ERR! react@"^18.0.0" from the root project
npm ERR!
npm ERR! Could not resolve dependency:
npm ERR! peer react@"^17.0.0" from [email protected]
npm ERR! node_modules/wagmi
npm ERR! wagmi@"*" from the root project
npm ERR!
npm ERR! Fix the upstream dependency conflict, or retry
npm ERR! this command with --force, or --legacy-peer-deps
npm ERR! to accept an incorrect (and potentially broken) dependency resolution.
No response
No response
No response
No response
0.0.17
when i instead create a new ethers instance manually by providing the injected ethereum instance from window into the ethers web3 provider constructor, the network is correctly set to localhost.
it should connect to localhost, not mainnet
see current behaviour
just tried using "useNetwork" to check what wagmi thinks is the current network...
useNetwork correctly return 1337 as chain id... weird
0.2.17
In a Next.js application, just adding
import {WagmiProvider} from "wagmi";
Even without using it, causes:
SyntaxError: Unexpected token '.'
The same happens when importing:
import {Provider} from "wagmi"
Shouldn't crash the app.
In a working Next.js app:
import {Provider} from "wagmi"
in your index file or _app fileNo response
0.1.2
Using the example code from https://wagmi-xyz.vercel.app/guides/connect-wallet, I am connecting to my Ethereum wallet which has an ENS entry
The avatar does not display and the console reads Fetch API cannot load ipfs://QmPMc4tcBsMqLRuCQtPmPe84bpSjrC3Ky7t3JWuHXYB4aS/8929. URL scheme "ipfs" is not supported.
That my ENS avatar displays correctly
Run the example code from the wagmi
docs (https://wagmi-xyz.vercel.app/guides/connect-wallet) and connect to an Ethereum address that has an ENS entry with an avatar set according to these docs
This package is amazing! Thank you.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.