Skip to content

Commit

Permalink
chore: removing obsolete Provider.create method (#3556)
Browse files Browse the repository at this point in the history
* Removing obsolete `Provider.create` method

* Adding changeset
  • Loading branch information
arboleya authored Jan 7, 2025
1 parent 68821a9 commit 75fae34
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 14 deletions.
5 changes: 5 additions & 0 deletions .changeset/strange-experts-roll.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@fuel-ts/account": patch
---

chore: removing obsolete `Provider.create` method
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,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 baseAssetId = provider.getBaseAssetId();
const chainId = provider.getChainId();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Provider, ScriptTransactionRequest, Wallet } from 'fuels';
import { LOCAL_NETWORK_URL, WALLET_PVT_KEY } from '../../../../env';
import { ScriptSum } from '../../../../typegend';

const provider = await Provider.create(LOCAL_NETWORK_URL);
const provider = new Provider(LOCAL_NETWORK_URL);
const wallet = Wallet.fromPrivateKey(WALLET_PVT_KEY, provider);

// #region auto-cost
Expand Down
12 changes: 0 additions & 12 deletions packages/account/src/providers/provider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -507,18 +507,6 @@ export default class Provider {
};
}

/**
* Creates a new instance of the Provider class. This is the recommended way to initialize a Provider.
* @deprecated Use `new Provider(...)` instead.
*
* @param url - GraphQL endpoint of the Fuel node
* @param options - Additional options for the provider
* @returns A promise that resolves to a Provider instance.
*/
static async create(url: string, options: ProviderOptions = {}): Promise<Provider> {
return new Provider(url, options).init();
}

/**
* Initialize Provider async stuff
*/
Expand Down

0 comments on commit 75fae34

Please sign in to comment.