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

chore: bumped fuels version to 0.98.0 #456

Draft
wants to merge 6 commits into
base: main
Choose a base branch
from
Draft
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
18 changes: 18 additions & 0 deletions .changeset/fifty-chairs-fail.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
"@fuel-connectors/burner-wallet-connector": patch
"@fuel-connectors/fuel-development-wallet": patch
"@fuel-connectors/walletconnect-connector": patch
"@fuel-connectors/solana-connector": patch
"@fuel-connectors/evm-predicates": patch
"@fuel-connectors/evm-connector": patch
"@fuel-connectors/fuelet-wallet": patch
"@fuel-connectors/fuel-wallet": patch
"@fuels/connectors": patch
"@fuel-connectors/bako-safe": patch
"@e2e-tests/runner": patch
"@fuel-connectors/common": patch
"@fuels/react": patch
"docs": patch
---

chore: bumped `fuels` version to `0.98.0`
4 changes: 2 additions & 2 deletions e2e-tests/react-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"@tanstack/react-query": "5.35.1",
"@wagmi/connectors": "5.1.7",
"@wagmi/core": "2.13.4",
"fuels": "0.96.1",
"fuels": "0.98.0",
"clsx": "2.1.1",
"connectkit": "1.8.2",
"next": "14.2.22",
Expand All @@ -29,6 +29,6 @@
"postcss": "8.4.38",
"tailwindcss": "3.4.3",
"typescript": "5.4.5",
"vite": "5.2.11"
"vite": "5.4.11"
}
}
2 changes: 1 addition & 1 deletion e2e-tests/react-next/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ const FUEL_CONFIG = {
wcProjectId: WC_PROJECT_ID,
ethWagmiConfig: wagmiConfig,
chainId: CHAIN_ID,
fuelProvider: Provider.create(PROVIDER_URL),
fuelProvider: new Provider(PROVIDER_URL),
}),
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ test.describe('BurnerWalletConnector', async () => {
}

const burnerWallet = Wallet.fromPrivateKey(privateKey);
const fuelProvider = await Provider.create(VITE_FUEL_PROVIDER_URL);
const fuelProvider = new Provider(VITE_FUEL_PROVIDER_URL);
burnerWallet.connect(fuelProvider);
await transferMaxBalance({
fromWallet: burnerWallet,
Expand Down
4 changes: 2 additions & 2 deletions e2e-tests/runner/examples/connectors/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export const testSetup = async ({
extensionId: string;
amountToFund: BNInput;
}) => {
const fuelProvider = await Provider.create(VITE_FUEL_PROVIDER_URL);
const fuelProvider = new Provider(VITE_FUEL_PROVIDER_URL);
const masterWallet = Wallet.fromMnemonic(VITE_MASTER_WALLET_MNEMONIC);
masterWallet.connect(fuelProvider);
if (VITE_WALLET_SECRET) {
Expand All @@ -54,7 +54,7 @@ export const testSetup = async ({
fuelExtensionId: extensionId,
fuelProvider: {
url: fuelProvider.url,
chainId: fuelProvider.getChainId(),
chainId: await fuelProvider.getChainId(),
},
chainName,
mnemonic: randomMnemonic,
Expand Down
10 changes: 7 additions & 3 deletions e2e-tests/runner/fuels.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,21 @@ export default createConfig({
privateKey:
'0xa449b1ffee0e2205fa924c6740cc48b3b473aa28587df6dab12abc245d1f5298',
providerUrl: process.env.PROVIDER_URL || 'http://localhost:4000/v1/graphql',
onDeploy: (_, contracts) => {
onDeploy: (_, deployed) => {
if (!deployed.contracts) {
throw new Error('No contracts deployed');
}

const contractIdsPath = join(__dirname, './src/contract-ids.json');
let contractIds = {};
let contractIds: Record<string, string> = {};
if (existsSync(contractIdsPath)) {
contractIds = JSON.parse(
readFileSync(contractIdsPath, 'utf8').toString(),
);
}

contractIds[process.env.CONTRACT_NAME || 'contract'] =
contracts[0].contractId;
deployed.contracts[0].contractId;
writeFileSync(contractIdsPath, JSON.stringify(contractIds, null, 2));
},
});
2 changes: 1 addition & 1 deletion e2e-tests/runner/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,6 @@
"@synthetixio/synpress-cache": "0.0.4",
"dotenv": "16.4.5",
"@phantom/synpress": "4.0.0-alpha.53",
"fuels": "0.96.1"
"fuels": "0.98.0"
}
}
4 changes: 2 additions & 2 deletions examples/react-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"@wagmi/connectors": "5.1.7",
"@wagmi/core": "2.13.4",
"clsx": "2.1.1",
"fuels": "0.96.1",
"fuels": "0.98.0",
"react": "18.3.1",
"react-dom": "18.3.1"
},
Expand All @@ -31,6 +31,6 @@
"postcss": "8.4.38",
"tailwindcss": "3.4.3",
"typescript": "5.4.5",
"vite": "5.2.11"
"vite": "5.4.11"
}
}
2 changes: 1 addition & 1 deletion examples/react-app/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ const FUEL_CONFIG: FuelConfig = {
wcProjectId: WC_PROJECT_ID,
ethWagmiConfig: wagmiConfig,
chainId: CHAIN_ID,
fuelProvider: Provider.create(PROVIDER_URL),
fuelProvider: new Provider(PROVIDER_URL),
}),
};

Expand Down
7 changes: 2 additions & 5 deletions examples/react-app/src/types/contracts/Counter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

import { Contract, Interface } from 'fuels';
import type {
AbstractAddress,
Account,
Address,
BN,
BigNumberish,
FunctionFragment,
Expand Down Expand Up @@ -93,10 +93,7 @@ export class Counter extends Contract {
increment_counter: InvokeFunction<[], BN>;
};

constructor(
id: string | AbstractAddress,
accountOrProvider: Account | Provider,
) {
constructor(id: string | Address, accountOrProvider: Account | Provider) {
super(id, abi, accountOrProvider);
}
}
2 changes: 1 addition & 1 deletion examples/react-next/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
"@fuels/react": "workspace:*",
"@tanstack/react-query": "5.35.1",
"connectkit": "1.8.2",
"fuels": "0.96.1",
"fuels": "0.98.0",
"next": "14.2.22",
"react": "18.3.1",
"react-dom": "18.3.1",
Expand Down
2 changes: 1 addition & 1 deletion examples/react-next/src/components/FuelProviders.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const FUEL_CONFIG = createConfig(() => {
wcProjectId: process.env.NEXT_PUBLIC_WC_PROJECT_ID,
ethWagmiConfig: DEFAULT_WAGMI_CONFIG,
chainId: NETWORKS[0].chainId,
fuelProvider: Provider.create(NETWORKS[0].url),
fuelProvider: new Provider(NETWORKS[0].url),
}),
};
});
Expand Down
4 changes: 2 additions & 2 deletions packages/bako-safe/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"socket.io-client": "4.7.2"
},
"peerDependencies": {
"fuels": ">=0.96.1",
"fuels": ">=0.98.0",
"socket.io-client": "4.7.2"
},
"devDependencies": {
"fuels": "0.96.1",
"fuels": "0.98.0",
"tsup": "8.0.2",
"typescript": "5.4.2",
"undici": "6.9.0"
Expand Down
4 changes: 2 additions & 2 deletions packages/bako-safe/src/BakoSafeConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -292,11 +292,11 @@ export class BakoSafeConnector extends FuelConnector {
`/connections/${this.sessionId}/currentNetwork`,
);

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

return {
url: provider.url,
chainId: provider.getChainId(),
chainId: await provider.getChainId(),
};
}

Expand Down
6 changes: 3 additions & 3 deletions packages/burner-wallet-connector/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@
"test": "vitest"
},
"peerDependencies": {
"fuels": ">=0.96.1"
"fuels": ">=0.98.0"
},
"devDependencies": {
"@fuel-connectors/common": "workspace:*",
"fuels": "0.96.1",
"fuels": "0.98.0",
"jsdom": "24.0.0",
"tsup": "8.0.2",
"typescript": "5.4.5",
"vite": "5.2.11",
"vite": "5.4.11",
"vite-plugin-dts": "3.9.1",
"vitest": "2.0.2"
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export class BurnerWalletConnector extends FuelConnector {

constructor(config: BurnerWalletConfig = {}) {
super();

this.storage = this.getStorage(config.storage);
if (HAS_WINDOW) {
this.configProvider(config);
Expand All @@ -61,7 +60,7 @@ export class BurnerWalletConnector extends FuelConnector {
private configProvider(config: BurnerWalletConfig = {}) {
const network = getProviderUrl(config.chainId ?? CHAIN_IDS.fuel.testnet);
this.config = Object.assign(config, {
fuelProvider: config.fuelProvider || Provider.create(network),
fuelProvider: config.fuelProvider ?? new Provider(network),
});
}

Expand Down Expand Up @@ -264,7 +263,7 @@ export class BurnerWalletConnector extends FuelConnector {

async currentNetwork(): Promise<Network> {
const { fuelProvider } = await this.getProvider();
const chainId = fuelProvider.getChainId();
const chainId = await fuelProvider.getChainId();

return {
chainId,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ describe('Burner Wallet Connector', () => {
});

test('Creates a new BurnerWalletConnector instance with non default Provider url', async () => {
const nonDefaultProvider = await Provider.create(TESTNET_NETWORK.url);
const nonDefaultProvider = new Provider(TESTNET_NETWORK.url);

const config: BurnerWalletConfig = {
fuelProvider: nonDefaultProvider,
Expand All @@ -161,7 +161,7 @@ describe('Burner Wallet Connector', () => {
});

test('Creates a new BurnerWalletConnector instance with non default Promise Provider url', async () => {
const nonDefaultProvider = Provider.create(TESTNET_NETWORK.url);
const nonDefaultProvider = new Provider(TESTNET_NETWORK.url);

const config: BurnerWalletConfig = {
fuelProvider: nonDefaultProvider,
Expand Down Expand Up @@ -287,8 +287,9 @@ describe('Burner Wallet Connector', () => {
await connector.connect();

const network = await connector.currentNetwork();
const expectedChainId = await fuelProvider.getChainId();

expect(network.chainId).to.be.equal(fuelProvider.getChainId());
expect(network.chainId).to.be.equal(expectedChainId);
expect(network.url).to.be.equal(fuelProvider.url);
});
});
Expand All @@ -304,7 +305,7 @@ describe('Burner Wallet Connector', () => {
const network = networks.pop();

const networkChainId = network?.chainId;
const expectedChainId = fuelProvider.getChainId();
const expectedChainId = await fuelProvider.getChainId();

expect(networks).to.be.an('array');

Expand Down
4 changes: 2 additions & 2 deletions packages/common/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
"test": "vitest"
},
"peerDependencies": {
"fuels": ">=0.96.1"
"fuels": ">=0.98.0"
},
"dependencies": {
"@ethersproject/bytes": "5.7.0",
Expand All @@ -37,7 +37,7 @@
},
"devDependencies": {
"@types/memoizee": "0.4.11",
"fuels": "0.96.1",
"fuels": "0.98.0",
"terser": "5.31.0",
"tsup": "8.0.2",
"typescript": "5.4.5",
Expand Down
6 changes: 3 additions & 3 deletions packages/common/src/PredicateConnector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ export abstract class PredicateConnector extends FuelConnector {

const b256Address = Address.fromDynamicInput(address).toString();
const { fuelProvider } = await this.getProviders();
const chainId = fuelProvider.getChainId();
const chainId = await fuelProvider.getChainId();
const walletAccount = this.predicateAccount.getAccountAddress(
b256Address,
await this.walletAccounts(),
Expand Down Expand Up @@ -212,7 +212,7 @@ export abstract class PredicateConnector extends FuelConnector {
ZeroBytes32,
]);

const { gasPriceFactor } = predicate.provider.getGasConfig();
const { gasPriceFactor } = await predicate.provider.getGasConfig();
const { maxFee, gasPrice } = await predicate.provider.estimateTxGasAndFee({
transactionRequest: requestWithPredicateAttached,
});
Expand Down Expand Up @@ -301,7 +301,7 @@ export abstract class PredicateConnector extends FuelConnector {

public async currentNetwork(): Promise<Network> {
const { fuelProvider } = await this.getProviders();
const chainId = fuelProvider.getChainId();
const chainId = await fuelProvider.getChainId();

return { url: fuelProvider.url, chainId: chainId };
}
Expand Down
2 changes: 1 addition & 1 deletion packages/common/src/PredicateFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ export class PredicateFactory {

getMaxPredicateGasUsed = memoize(async (provider: Provider): Promise<BN> => {
const fakeAccount = this.adapter.generateFakeAccount();
const chainId = provider.getChainId();
const chainId = await provider.getChainId();
const fakePredicate = this.build(fakeAccount.getAddress(), provider, [0]);
const request = new ScriptTransactionRequest();
request.addCoinInput({
Expand Down
4 changes: 2 additions & 2 deletions packages/connectors/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"ts:check": "tsc --noEmit"
},
"peerDependencies": {
"fuels": ">=0.96.1"
"fuels": ">=0.98.0"
},
"dependencies": {
"@ethereumjs/util": "9.0.3",
Expand All @@ -42,7 +42,7 @@
"@fuel-connectors/fuelet-wallet": "workspace:*",
"@fuel-connectors/solana-connector": "workspace:*",
"@fuel-connectors/walletconnect-connector": "workspace:*",
"fuels": "0.96.1",
"fuels": "0.98.0",
"terser": "5.31.0",
"tsup": "8.0.2",
"typescript": "5.4.5"
Expand Down
2 changes: 1 addition & 1 deletion packages/docs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"dependencies": {
"@fuel-ts/errors": "0.96.0",
"@fuel-ts/versions": "0.96.0",
"fuels": "0.96.1",
"fuels": "0.98.0",
"typedoc-plugin-markdown": "^3.15.3"
},
"devDependencies": {
Expand Down
1 change: 0 additions & 1 deletion packages/docs/spell-check-custom-words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,6 @@ configs
WSL
WalletUnlocked
WalletLocked
AbstractAddress
ContractFactory
ScriptTransactionRequest
CDN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ console.log(isSupportedNetwork);
```

#### Defined in
[packages/react/src/hooks/useIsSupportedNetwork.tsx:29](https://github.com/fuellabs/fuel-connectors/blob/main/packages/react/src/hooks/useIsSupportedNetwork.tsx#L29)
[packages/react/src/hooks/useIsSupportedNetwork.tsx:30](https://github.com/fuellabs/fuel-connectors/blob/main/packages/react/src/hooks/useIsSupportedNetwork.tsx#L30)

___
4 changes: 4 additions & 0 deletions packages/docs/src/guide/react-hooks/useProvider.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ An object containing:
- `provider`: The provider data or `null`.
- [`...queryProps`](https://tanstack.com/query/latest/docs/framework/react/reference/useQuery): Destructured properties from `useQuery` result.

| Name | Type |
| :------ | :------ |
| `provider` | `undefined` \| `default` |

#### Examples

To get the current provider:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,6 @@ await sendTransactionAsync({ address: '0x...', transaction: {...} });
```

#### Defined in
[packages/react/src/hooks/useSendTransaction.ts:47](https://github.com/fuellabs/fuel-connectors/blob/main/packages/react/src/hooks/useSendTransaction.ts#L47)
[packages/react/src/hooks/useSendTransaction.ts:43](https://github.com/fuellabs/fuel-connectors/blob/main/packages/react/src/hooks/useSendTransaction.ts#L43)

___
Loading
Loading