Skip to content

Commit

Permalink
docs: fixing remaining outdated snippets (#3557)
Browse files Browse the repository at this point in the history
Fixing remaining snippets
  • Loading branch information
arboleya authored Jan 7, 2025
1 parent cec345c commit 4ee1e15
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { Provider } from 'fuels';

const NETWORK_URL = 'https://mainnet.fuel.network/v1/graphql';

const provider = await Provider.create(NETWORK_URL);
const provider = new Provider(NETWORK_URL);

const chainId = provider.getChainId();
const gasConfig = provider.getGasConfig();
Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/guide/contracts/using-different-wallets.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Similarly, you can assign a custom provider to a contract instance by modifying
<!-- TODO: Replace with a proper snippet. We lost this snippet because this test had to be removed/changed -->

```ts
const newProvider = await Provider.create(NEW_URL);
const newProvider = new Provider(NEW_URL);
deployedContract.provider = newProvider;
```

Expand Down
2 changes: 1 addition & 1 deletion apps/docs/src/guide/getting-started/cdn-usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
} from "https://cdnjs.cloudflare.com/ajax/libs/fuels/{{fuels}}/browser.mjs";
const main = async () => {
const provider = await Provider.create(
const provider = new Provider(
"https://mainnet.fuel.network/v1/graphql",
);
const { name } = provider.getChain();
Expand Down
4 changes: 1 addition & 3 deletions apps/docs/src/guide/getting-started/react-example.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,7 @@ function App() {

useEffect(() => {
const main = async () => {
const provider = await Provider.create(
"https://mainnet.fuel.network/v1/graphql",
);
const provider = new Provider("https://mainnet.fuel.network/v1/graphql");

const wallet = Wallet.fromAddress("0x...", provider);
const { balances } = await wallet.getBalances();
Expand Down

0 comments on commit 4ee1e15

Please sign in to comment.