Powfi holds the network configuration, the node and explorer providers, the optional signer, and one instance of each protocol module.
Powfi.load(params)
new Powfi(params). Synchronous, with no network calls. Registers the instance’s providers as the global @alephium/web3 defaults (see setCurrentProviders()).
'mainnet' | 'testnet' | 'devnet'
required
Selects built-in endpoints and bundled contract deployments.
SignerProvider
Any
@alephium/web3 signer (PrivateKeyWallet, NodeWallet, a browser wallet connector). Required for write methods.Partial<Omit<Network, 'id'>>
Override
nodeUrl, nodeApiKey, explorerApiUrl, explorerUrl, tokenListUrl, or name. See Networks.Modules
Properties
Methods
setCurrentProviders()
Registers this instance’s nodeProvider and explorerProvider as the global @alephium/web3 providers (web3.setCurrentNodeProvider, web3.setCurrentExplorerProvider). Powfi.load already calls it, so you only need it when you run several SDK instances and want to switch which one the raw contract artifacts and other global-provider libraries use.
clearSigner() / clearAccount()
Remove the signer or account, for example on wallet disconnect. Write methods then throw until a new signer is set.
Switching wallets
The signer can change at runtime without reloading the SDK:powfi.signer on every call, so no other state needs resetting. The CLMM module caches fee-tier configs and the token module caches the token list. Both caches are network-scoped, not wallet-scoped.