Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fixing remaining outdated snippets #3557

Merged
merged 2 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading