The Agent interface
export type Agent = {
name: string;
description: string;
tick(ctx: AgentContext): Promise<Dispatch[]>;
};AgentContext
type AgentContext = {
safe: Address; // the SMA address
account: Address; // alias of `safe`
chainId: number;
blockNumber: bigint;
timestamp: number; // unix seconds
now: Date; // wall-clock time of this tick
client: ISailorClient; // a ready SailorClient (see SailorClient)
publicClient: PublicClient; // viem client for arbitrary reads (QuoterV2, custom views, multicall)
manager: ILocalKeyring; // the manager keyring used to sign dispatches
log: (msg: string) => void; // console + appends to .sail/activity.jsonl
data: Record<string, unknown>; // your own data slot (see below)
read: {
balance: (token: Address | "native") => Promise<bigint>;
allowance: (token: Address, owner: Address, spender: Address) => Promise<bigint>;
decimals: (token: Address) => Promise<number>;
};
};Field
Use it for
The data slot
data slotA minimal tick
Last updated

