Types
A glossary of types in the Owney SDK.
General
AgentId
type AgentId = "zyfai" | "sail";
Asset
type Asset = string;
DailyApyDays
type DailyApyDays = "7D" | "14D" | "30D";
OwneySupportedChainId
type OwneySupportedChainId = 8453 | 42161;
OwneySupportedChains
type OwneySupportedChains = "BASE" | "ARBITRUM";
OwneySupportedTokens
type OwneySupportedTokens = "USDC" | "USDT";
AgentSupportedAssets
type AgentSupportedAssets = {
readonly chainId: number;
readonly chain?: string;
readonly assets: readonly string[];
};
ConnectionState
interface ConnectionState {
provider: any;
walletAddress: `0x${string}`;
chainId: number | null;
}
OwneySDKConfig
interface OwneySDKConfig {
apiKey: string;
}
Input Options
DepositOptions
type DepositOptions = {
amount: string;
asset: Asset;
depositCallback: DepositCallback;
agentId?: AgentId;
};
WithdrawOptions
type WithdrawOptions = {
asset: Asset;
amount?: string;
agentId?: AgentId;
};
AccountApyOptions
type AccountApyOptions = {
agentId?: AgentId;
days: DailyApyDays;
};
AgentsApyOptions
type AgentsApyOptions = {
agentId?: AgentId;
days: DailyApyDays;
tokenSymbol?: string;
chainId?: number;
};
HistoryFilters
type HistoryFilters = {
fromDate?: string;
toDate?: string;
};
HistoryOptions
type HistoryOptions = {
agentId?: AgentId;
filters?: HistoryFilters;
};
Callbacks
DepositCallback
type DepositCallback = (
smartWalletAddress: string,
chainId: number,
amount: string,
) => Promise<`0x${string}`> | `0x${string}`;
Responses
OwneyDepositResult
interface OwneyDepositResult {
txHash: string;
smartWallet: string;
amount: string;
}
OwneyMultiDepositResult
interface OwneyMultiDepositResult {
agentResults: Record<string, OwneyDepositResult>;
}
AgentWithdrawResult
interface AgentWithdrawResult {
txHash?: string;
type: "full" | "partial";
amount: string;
}
OwneyWithdrawResult
interface OwneyWithdrawResult {
agentResult: Record<AgentId, AgentWithdrawResult>;
}
OwneyToken
interface OwneyToken {
chain: OwneySupportedChains;
chainId: OwneySupportedChainId;
asset: OwneySupportedTokens;
amount: string;
}
AgentBalance
interface AgentBalance {
smartWallet?: `0x${string}`;
totalBalance: string;
tokens: OwneyToken[];
}
OwneyBalances
interface OwneyBalances {
totalBalance: string;
agentBalances: Record<AgentId, AgentBalance>;
}
AgentEarnings
interface AgentEarnings {
smartWallet: `0x${string}`;
lifetimeEarnings: number;
}
OwneyEarnings
interface OwneyEarnings {
totalEarnings: string;
agentEarnings: Record<AgentId, AgentEarnings>;
}
AccountAgentApy
interface AccountAgentApy {
walletAddress: string;
weightedApyAfterFee?: number;
weightedApyAfterFeeDetails?: AgentApyDetails;
}
OwneyAccountApy
interface OwneyAccountApy {
totalApy: string;
agentApy: Record<AgentId, AccountAgentApy>;
}
HistoryAction
type HistoryAction = "Rebalance" | "Deposit" | "Top up" | "Withdraw" | "Earned";
HistoryTransaction
interface HistoryTransaction {
txHashes: string[];
chainId?: number;
tokenSymbol?: string;
amount?: string;
}
RebalanceLog
interface RebalanceLog {
fromProtocol: string;
toProtocol: string;
tokenSymbol: string;
amount: string;
status: "success" | "failed";
}
AgentHistoryEntry
interface AgentHistoryEntry {
agent: AgentId;
action: HistoryAction;
date: string;
oldApy: string | null;
newApy: string | null;
transactions: HistoryTransaction[];
rebalanceLog: RebalanceLog[];
}
OwneyAgentHistory
interface OwneyAgentHistory {
data: AgentHistoryEntry[];
total: number;
}
OwneyAgentStatus
interface OwneyAgentStatus {
success: boolean;
strategy?: string;
protocols?: string[];
}
AgentUserProfile
interface AgentUserProfile {
address: string;
smartWallet: string;
chains: number[];
strategy?: string;
hasActiveSessionKey: boolean;
protocols: string[];
}
OwneyUserProfile
interface OwneyUserProfile {
agentUserProfile: Record<AgentId, AgentUserProfile>;
}
AgentApyDetails
interface AgentApyDetails {
apyPerAsset: Partial<
Record<OwneySupportedChainId, Partial<Record<OwneySupportedTokens, number>>>
>;
}
AgentApy
interface AgentApy {
averageApy: number;
detailedApys?: AgentApyDetails;
}
OwneyAgentApy
interface OwneyAgentApy {
agentApy: Record<AgentId, AgentApy>;
}
OwneyAgentAllocation
interface OwneyAgentAllocation {
agentAllocation: Record<AgentId, number>;
}