Gates
The GateSDK manages the Akita gate system — a composable access control mechanism with 16 different subgate types. Gates can be used to restrict who can perform specific operations.
Concepts
Section titled “Concepts”Gate Architecture
Section titled “Gate Architecture”The gate system has two layers:
- Gate contract — The main gate that coordinates subgate checks
- Subgates — Individual contracts that check specific conditions
A gate check passes if the caller satisfies all required subgates (AND logic).
Subgate Types
Section titled “Subgate Types”| Subgate | Description |
|---|---|
| Asset Gate | Requires holding a minimum amount of a specific ASA |
| Akita Referrer Gate | Requires being referred by a registered referrer |
| Merkle Address Gate | Requires address to be in a merkle tree (allowlist) |
| Merkle Asset Gate | Requires holding an asset from a merkle tree set |
| NFD Gate | Requires owning a specific NFD (Non-Fungible Domain) |
| NFD Root Gate | Requires owning an NFD under a specific root |
| Poll Gate | Requires having voted in a specific poll |
| Social Activity Gate | Requires minimum social activity level |
| Social Follower Count Gate | Requires minimum follower count |
| Social Follower Index Gate | Requires following specific accounts |
| Social Impact Gate | Requires minimum social impact score |
| Social Moderator Gate | Requires moderator status |
| Staking Amount Gate | Requires staking a minimum amount |
| Staking Power Gate | Requires minimum staking power |
| Subscription Gate | Requires an active subscription to a service |
| Subscription Streak Gate | Requires a minimum subscription payment streak |
Initialization
Section titled “Initialization”import { GateSDK } from '@akta/sdk/gates'
const gate = new GateSDK({ algorand })Use Cases
Section titled “Use Cases”Token-Gating a Feature
Section titled “Token-Gating a Feature”Use the Asset Gate to require holding a minimum token balance:
Gate + Asset Subgate (min 1000 AKTA) → Only AKTA holdersAllowlist Access
Section titled “Allowlist Access”Use the Merkle Address Gate with a merkle tree of approved addresses:
Gate + Merkle Address Subgate → Only allowlisted addressesReputation-Based Access
Section titled “Reputation-Based Access”Combine multiple social gates:
Gate + Social Impact Subgate (min 100) + Social Follower Count Subgate (min 50) → Reputable community members onlySubscriber-Only Features
Section titled “Subscriber-Only Features”Gate + Subscription Subgate (service ID) + Subscription Streak Subgate (min 3 payments) → Active subscribers with payment historyIntegration with Wallet Plugins
Section titled “Integration with Wallet Plugins”Gates integrate with the wallet plugin system through the GatePlugin. When a gate plugin is installed on a wallet, it can gate any plugin execution:
Wallet → Gate Plugin → Check subgates → Allow/Deny → Execute pluginSee Wallet Plugins for gate plugin usage.