You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -173,9 +205,9 @@ export class UniswapPairSettings {
173
205
}
174
206
```
175
207
176
-
### Ethereum provider
208
+
### With only the chainId
177
209
178
-
This will use your ethereum provider you pass in. This will work with any web3 provider, ethers provider or custom provider. For example when using MetaMask you can pass in the window.ethereum and it work. You must supply the ethereum address and the wallet be approved to use for the dApp and unlocked before passing it in. The uniswap sdk makes those assumptions without them it will not work as MetaMask is not allowed access to your dApp. Any change of network or ethereum address change you will need to handle in your dApp and regenerate the uniswap pair context. Most the time the contract addresses for your tokens are different anyway.
210
+
This will use a infura endpoint without you having to pass in a node
179
211
180
212
```ts
181
213
import { UniswapPair, ChainId, UniswapVersion, ETH } from'simple-uniswap-sdk';
@@ -187,7 +219,7 @@ const uniswapPair = new UniswapPair({
This will use a infura endpoint without you having to pass in a node
247
+
This will use your node you pass in you must pass us the chainId as well, this stops the ethers instance calling pointless `JSONRPC` calls to get the chain id before every `JSONRPC` call.
216
248
217
249
```ts
218
250
import { UniswapPair, ChainId, UniswapVersion, ETH } from'simple-uniswap-sdk';
@@ -225,6 +257,7 @@ const uniswapPair = new UniswapPair({
225
257
// the ethereum address of the user using this part of the dApp
This will use your node you pass inyou must pass us the chainId as well, this stops the ethers instance calling pointless `JSONRPC` calls to get the chain id before every `JSONRPC` call.
285
+
This will use your ethereum provider you pass in. This will work with any web3 provider, ethers provider or custom provider. For example when using MetaMask you can pass in the window.ethereum and it work. You must supply the ethereum address and the wallet be approved to use for the dApp and unlocked before passing it in. The uniswap sdk makes those assumptions without them it will not work as MetaMask is not allowed access to your dApp. Any change of network or ethereum address change you will need to handle in your dApp and regenerate the uniswap pair context. Most the time the contract addresses for your tokens are different anyway.
253
286
254
287
```ts
255
288
import { UniswapPair, ChainId, UniswapVersion, ETH } from'simple-uniswap-sdk';
@@ -261,8 +294,7 @@ const uniswapPair = new UniswapPair({
0 commit comments