Understanding Intents
Intents are the fundamental way users interact with the Skainet ecosystem. Each intent represents a user's desired outcome, which is then processed and executed by appropriate agents.
Intent Types
1. Basic Intents
These are single-operation intents that map directly to specific capabilities:
interface BaseIntent {
// User context - required for all intents
user: {
address: string; // User's wallet address
chain: string; // Current chain
};
metadata: {
timestamp: number;
priority: "low" | "medium" | "high";
maxFee: string;
deadline?: number;
};
capabilities: string[];
data: {
[key: string]: any;
};
}
interface ReasoningIntent extends BaseIntent {
capabilities: ["REASONING"];
data: {
rawIntent: string;
context?: {
history?: string[]; // Current Chat history
};
};
}
// Example: Swap Intent
interface SwapIntent extends BaseIntent {
capabilities: ["SWAP"];
data: {
inputToken: string;
outputToken: string;
amount: string;
slippage: number;
dex?: string;
};
}
// Example: Bridge Intent
interface BridgeIntent extends BaseIntent {
capabilities: ["BRIDGE"];
data: {
sourceChain: string;
destinationChain: string;
token: string;
amount: string;
bridge?: string;
};
}
Examples
{
"user": {
"address": "0x123...",
"chain": "ftm"
},
"metadata": {
"timestamp": 1704604439,
"priority": "medium",
"maxFee": "1000000000000000000"
},
"capabilities": ["SWAP"],
"data": {
"inputToken": "0xANON...",
"outputToken": "0xUSDC...",
"amount": "50000000000000000000",
"slippage": 0.5,
"dex": "WAGMI"
}
}