RouterManager
Manage the Router Hook — chain multiple compliance hooks on a single Token-2022 token
Import
Properties
| Property | Type | Description |
|---|---|---|
configPDA | PublicKey | The RouterConfig PDA address |
extraAccountMetasPDA | PublicKey | The ExtraAccountMetas PDA address |
Methods
initialize(authority, allowlistHookProgram, taxHookProgram, holdHookProgram, maxBalanceHookProgram?)
Creates the RouterConfig PDA. Pass PublicKey.default for hooks you don't want.
| Parameter | Type | Description |
|---|---|---|
authority | PublicKey | Admin who can manage the router |
allowlistHookProgram | PublicKey | Allowlist Hook program ID (or PublicKey.default to skip) |
taxHookProgram | PublicKey | Tax Hook program ID (or PublicKey.default to skip) |
holdHookProgram | PublicKey | Hold Hook program ID (or PublicKey.default to skip) |
maxBalanceHookProgram | PublicKey (optional) | Max Balance Hook program ID (defaults to PublicKey.default) |
initializeExtraAccountMetas(payer)
Creates the ExtraAccountMetaList PDA.
updateHooks(authority, allowlistHookProgram, taxHookProgram, holdHookProgram, maxBalanceHookProgram?)
Updates the sub-hook program addresses.
toggleActive(authority, isActive)
Kill switch for the entire router. When isActive=false, all sub-hooks are bypassed.
updateAuthority(authority, newAuthority)
Transfers admin rights.
fetchConfig()
Fetches the current on-chain router config.