Built-in networks
Powfi.load({ networkId }) picks one of these configurations (defaultNetworks):
An unknown
networkId throws Network <id> not found.
Overriding endpoints
UsenetworkOverrides to replace any field except id:
Network fields:
NetworkId
required
'mainnet' | 'testnet' | 'devnet'. Selects both the endpoints and the bundled contract deployments.string
Display name.
string
Full node REST endpoint.
string
Optional API key sent to the node.
string
Explorer backend endpoint (used by
powfi.explorerProvider).string
Explorer web UI, for building links.
string
JSON token list with shape
{ tokens: TokenInfo[] }.Contract addresses
Each module loads its contract IDs from the deployment files bundled with the SDK (cpmm/deployments, clmm/deployments, staking/deployments) for the chosen networkId:
To point a module at a different deployment (a fork, or your own devnet), override its config after loading:
powfi.cpmm.getConfig(), powfi.clmm.getClmmConfig(), and powfi.staking.getConfig().
Groups and addresses
Alephium is sharded into address groups, and every Powfi contract for a module lives in one group (config.groupIndex). Pool, position, and vault IDs are derived as sub-contracts in that group, so they can be computed offline:
:group suffix) are normalized with normalizeAddress(address, group), which appends :<group> when needed. The SDK does this internally for sender, owner, recipient, and fee-recipient arguments.
Local devnet
The SDK’s integration tests run against a local Alephium devnet:networkId: 'devnet', the SDK uses 127.0.0.1:22973 and the devnet deployments. The devnet unstake duration is 1 minute instead of 30 days.