Fuel Stack Sept Breaking Changes Update
This guide assumes you have already followed the previous September beta-4
migration guide and are looking to bump to the latest versions of the toolchain below.
Sway
No breaking changes this week!
TS SDK
Provider is used so widely in our SDK, there are multiple breaking changes that we need to be aware of and need to communicate to our users:
/* BEFORE - v0.57.0 */
const provider = new Provider(url)
/* AFTER - v0.60.0 */
const provider = await Provider.create(url)
All of these methods now require a Provider to be passed in:
- Wallet Methods Some of these methods used to accept a URL instead of a
Provider
object. Note that theprovider
param has to be aProvider
object now.
const provider = await Provider.create(url);
/* BEFORE - v0.57.0 */
WalletUnlocked.fromSeed(seed, path);
WalletUnlocked.fromMnemonic(mnemonic, path, passphrase);
WalletUnlocked.fromExtendedKey(extendedKey);
await WalletUnlocked.fromEncryptedJson(jsonWallet, password);
Wallet.fromAddress(address);
Wallet.fromPrivateKey(pk);
Wallet.generate();
/* AFTER - v0.60.0 */
WalletUnlocked.fromSeed(seed, provider, path);
WalletUnlocked.fromMnemonic(mnemonic, provider, path, passphrase);
WalletUnlocked.fromExtendedKey(extendedKey, provider);
await WalletUnlocked.fromEncryptedJson(jsonWallet, password, provider);
Wallet.fromAddress(address, provider);
Wallet.fromPrivateKey(pk, provider);
Wallet.generate({ provider });
- Account Class
/* BEFORE - v0.57.0 */
const account = new Account(address);
/* AFTER - v0.60.0 */
const account = new Account(address, provider);
- PrivateKeyVault
These are the options that are accepted by the PrivateKeyVault
constructor. provider
is now a required input.
/* BEFORE - v0.57.0 */
interface PkVaultOptions {
secret?: string;
accounts?: Array<string>;
}
/* AFTER - v0.60.0 */
interface PkVaultOptions {
secret?: string;
accounts?: Array<string>;
provider: Provider;
}
- MnemonicVault
/* BEFORE - v0.57.0 */
interface MnemonicVaultOptions {
secret?: string;
accounts?: Array<string>;
}
/* AFTER - v0.60.0 */
interface MnemonicVaultOptions {
secret?: string;
accounts?: Array<string>;
provider: Provider;
}
- WalletManager
/* BEFORE - v0.57.0 */
export type VaultConfig = {
type: string;
title?: string;
secret?: string;
};
/* AFTER - v0.60.0 */
export type VaultConfig = {
type: string;
title?: string;
secret?: string;
provider: Provider;
};
- Predicates
The provider
is no longer optional. Note the change in parameter order, and that chainId
is no longer required to be passed.
/* BEFORE - v0.57.0 */
const predicate = new Predicate(bytes, chainId, jsonAbi);
/* AFTER - v0.60.0 */
const predicate = new Predicate(bytes, provider, jsonAbi);
Rust SDK
No breaking changes this week!