Connect Protocol
The Akita Connect protocol enables secure peer-to-peer communication between applications using WebRTC data channels. It’s primarily used for the agent wallet installation flow — connecting an AI agent to a user’s mobile wallet.
How It Works
Section titled “How It Works”- Generate URI — The initiator creates a
liquid://URI containing a signaling server address and session ID - Display QR Code — The URI is shown as a QR code (or shared as a link)
- Scan & Connect — The mobile app scans the QR code and connects via the signaling server
- WebRTC Channel — A peer-to-peer data channel is established
- Exchange Payloads — Structured request/response messages are sent over the channel
URI Helpers
Section titled “URI Helpers”import { encodeConnectUri, decodeConnectUri } from '@akta/sdk/connect'
// Create a connect URIconst uri = encodeConnectUri({ origin: 'signal.akita.community', requestId: 'uuid-here',})// Returns: "liquid://signal.akita.community/uuid-here"
// Parse a connect URIconst parsed = decodeConnectUri(uri)// Returns: { origin: "signal.akita.community", requestId: "uuid-here" }Request Types
Section titled “Request Types”Agent Install Request
Section titled “Agent Install Request”Used by the agent wallet setup to request installation on a user’s wallet:
import type { AgentInstallRequest } from '@akta/sdk/connect'
const request: AgentInstallRequest = { type: 'agent-install', v: 2, agent: { name: 'My AI Agent', address: 'AGENT_ADDRESS...', }, network: 'mainnet', escrowName: 'agent:My AI Agent', newAgentAccount: true, plugins: [ { id: 'payPlugin', coverFees: true }, { id: 'optinPlugin' }, { id: 'stakingPlugin' }, ], allowances: [ { asset: '0', type: 'flat', amount: '10000000' }, ],}Agent Install Response
Section titled “Agent Install Response”The mobile app responds with wallet details:
import type { AgentInstallResponse } from '@akta/sdk/connect'
// Successconst response: AgentInstallResponse = { type: 'agent-install', success: true, walletAppId: '3368395481', escrowAddress: 'ESCROW_ADDR...', network: 'mainnet',}Plugin Identifiers
Section titled “Plugin Identifiers”Plugins are referenced by their NetworkAppIds key:
| ID | Plugin |
|---|---|
payPlugin | Send ALGO/ASA payments |
optinPlugin | Opt into assets |
stakingPlugin | Stake tokens |
rewardsPlugin | Claim rewards |
socialPlugin | Social interactions |
daoPlugin | DAO governance |
subscriptionsPlugin | Subscriptions |
marketplacePlugin | NFT marketplace |
hyperSwapPlugin | Token swaps |
auctionPlugin | Auctions |
rafflePlugin | Raffles |
pollPlugin | Poll voting |
asaMintPlugin | Mint assets |
Allowance Types
Section titled “Allowance Types”// Flat — fixed total spending limit{ asset: '0', type: 'flat', amount: '10000000' }
// Window — replenishes over a time interval{ asset: '0', type: 'window', amount: '10000000', interval: '86400' }
// Drip — continuous linear replenishment{ asset: '0', type: 'drip', rate: '100', max: '10000000', interval: '3600' }