Skip to main content
Powfi holds the network configuration, the node and explorer providers, the optional signer, and one instance of each protocol module.

Powfi.load(params)

Equivalent to 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

CpmmModule
Constant-product pools. Reference
ClmmModule
Concentrated-liquidity pools. Reference
StakingModule
xALPH staking. Reference
TokenModule
Token metadata. Reference

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:
Modules read 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.