SINAI STANDARD

AllowlistManager

Manage the Allowlist Transfer Hook — KYC/AML gating for token transfers

Import

import { AllowlistManager } from "@sinai-standard/sdk";
const mgr = new AllowlistManager(anchorProgram, mintPubkey);

Properties

PropertyTypeDescription
registryPDAPublicKeyThe AllowlistRegistry PDA address
extraAccountMetasPDAPublicKeyThe ExtraAccountMetas PDA address

Methods

initialize(authority, mode)

Creates the AllowlistRegistry PDA for the mint.

ParameterTypeDescription
authorityPublicKeyAdmin who can manage the registry
modeAllowlistMode"allowlist" (only listed wallets can transfer) or "denylist" (listed wallets are blocked)

initializeExtraAccountMetas(payer)

Creates the ExtraAccountMetaList PDA required for Token-2022 TransferHook CPI.

Must be called before any transfer.

addWallets(authority, wallets)

Batch-adds wallets to the registry. Maximum 20 wallets per call, ~300 total.

removeWallets(authority, wallets)

Batch-removes wallets from the registry using O(1) swap-remove.

updateAuthority(authority, newAuthority)

Transfers registry management to a new authority.

toggleActive(authority, isActive)

Emergency kill switch. When isActive=false, all transfers are permitted regardless of the allowlist.

fetchRegistry()

Fetches the current on-chain registry state.

interface AllowlistRegistryData {
  authority: PublicKey;
  mint: PublicKey;
  isActive: boolean;
  mode: AllowlistMode;
  walletCount: number;
  wallets: PublicKey[];
}

On this page