MaxBalanceManager
Manage the Max Balance Transfer Hook — per-wallet balance cap enforcement for Token-2022 tokens
Import
Properties
| Property | Type | Description |
|---|---|---|
configPDA | PublicKey | The MaxBalanceConfig PDA address |
extraAccountMetasPDA | PublicKey | The ExtraAccountMetas PDA address |
Methods
initialize(authority, maxBalance)
Creates the MaxBalanceConfig PDA for the mint.
| Parameter | Type | Description |
|---|---|---|
authority | PublicKey | Admin who can manage the max balance config |
maxBalance | number | BN | Maximum allowed token balance per wallet |
initializeExtraAccountMetas(payer)
Creates the ExtraAccountMetaList PDA.
Must be called before any transfer.
updateMaxBalance(authority, newMaxBalance)
Changes the maximum balance limit. Takes effect immediately for all future transfers.
| Parameter | Type | Description |
|---|---|---|
authority | PublicKey | MaxBalanceConfig authority |
newMaxBalance | number | BN | New maximum balance per wallet |
toggleActive(authority, isActive)
Kill switch. When isActive=false, max balance checks are not enforced.
updateAuthority(authority, newAuthority)
Transfers admin rights.
fetchConfig()
Fetches the current on-chain max balance config.