UNPKG

@bitte-ai/types

Version:
1,169 lines (1,165 loc) 34.9 kB
import { Transaction as Transaction$1 } from '@mysten/sui/transactions'; import { FunctionCallAction, Wallet, FinalExecutionOutcome, Transaction as Transaction$2 } from '@near-wallet-selector/core'; import { WalletContextState as WalletContextState$1 } from '@solana/wallet-adapter-react'; import { Connection, VersionedTransaction } from '@solana/web3.js'; import { WalletContextState } from '@suiet/wallet-kit'; import { UIMessage, Message as Message$1, CreateMessage, ChatRequestOptions } from 'ai'; import BN from 'bn.js'; import { Account } from 'near-api-js'; import { OpenAPIV3 } from 'openapi-types'; import { ComponentType } from 'react'; import { Address, Hex, Hash, Signature, Transaction } from 'viem'; import { Config } from 'wagmi'; import { SendTransactionMutate, SignMessageMutate, SignTypedDataMutate, SwitchChainMutate } from 'wagmi/query'; interface MetaTransaction { to: Address; data: Hex; value: Hex; from?: Address; } interface EthSendTransactionRequest { method: 'eth_sendTransaction'; chainId: number; params: MetaTransaction[]; } interface PersonalSignRequest { method: 'personal_sign'; chainId: number; params: [Hex, Address]; } interface EthSignRequest { method: 'eth_sign'; chainId: number; params: [Address, Hex]; } interface EthSignTypedDataRequest { method: 'eth_signTypedData' | 'eth_signTypedData_v4'; chainId: number; params: [Address, string]; } type SignRequest = EthSendTransactionRequest | PersonalSignRequest | EthSignRequest | EthSignTypedDataRequest; declare const ChainType: { readonly EVM: "evm"; readonly NEAR: "near"; readonly SUI: "sui"; }; type ChainType = (typeof ChainType)[keyof typeof ChainType]; type BitteMetadata = Record<string, unknown>; type JSONValue = string | number | boolean | null | { [key: string]: JSONValue; } | JSONValue[]; type FunctionDefinition = { name: string; description: string; parameters: Record<string, unknown>; }; type PluginToolSpec = { id: string; agentId: string; type: 'function'; function: FunctionDefinition; execution: ExecutionDefinition; verified: boolean; }; type ExecutionDefinition = { baseUrl: string; path: string; httpMethod: string; }; type FunctionTool = { type: 'function'; function: FunctionDefinition; }; type CoreTool = unknown; type AssistantTool = unknown; type BitteToolSpec = PluginToolSpec | FunctionTool; type BitteCoreTool<TArgs = Record<string, JSONValue>, TResult = unknown> = { toolSpec: FunctionTool; execute?: BitteToolExecutor<TArgs, TResult>; chainIds?: string[]; }; type BitteToolExecutor<TArgs = Record<string, JSONValue>, TResult = unknown> = (args: TArgs, metadata?: BitteMetadata) => Promise<BitteToolResult<TResult>>; type BitteToolResult<TResult = unknown> = { data: TResult; error?: never; prompt?: string; } | { data?: never; error: string; }; type BitteToolWarning = { message: string; final: boolean; }; type BittePrimitiveRef = { type: string; }; type BitteAgentConfig = { id: string; name: string; accountId?: string | null; description: string; instructions: string; verified: boolean; tools?: BitteToolSpec[]; image?: string | null; repo?: string | null; categories?: string[]; chainIds?: number[]; primitives?: string[]; }; type BitteAgent = Omit<BitteAgentConfig, 'tools'> & { toolSpecs?: FunctionTool[]; tools?: Record<string, CoreTool>; }; type BitteAgentBase = { name: string; description: string; instructions: string; tools?: BitteToolSpec[]; image?: string; chainIds?: number[]; categories?: string[]; repo?: string; }; type AgentMetadata = { evmAddress?: string; accountId?: string; network: string; localAgent?: LocalAgentSpec; agentId: string; }; type LocalAgentSpec = { pluginId: string; accountId: string; spec: BitteOpenAPISpec; }; type BitteOpenAPISpec = OpenAPIV3.Document & { 'x-mb': { 'account-id'?: string; assistant?: Pick<BitteAssistantConfig, 'name' | 'description' | 'instructions' | 'tools' | 'image'> & { tools?: (AssistantTool | BittePrimitiveRef)[]; }; }; }; type BitteAssistantConfig = { id: string; name: string; accountId: string; description: string; instructions: string; verified: boolean; tools?: BitteToolSpec[]; image?: string; }; type BitteAssistant = Omit<BitteAssistantConfig, 'tools'> & { toolSpecs?: FunctionTool[]; tools?: Record<string, CoreTool>; }; interface BitteAIOptions { apiKey?: string; baseUrl?: string; timeout?: number; } interface NearTransaction { signerId: string; receiverId: string; actions: unknown[]; } interface EVMWalletAdapter { sendTransaction: SendTransactionMutate<Config, unknown>; signMessage?: SignMessageMutate<unknown>; signTypedData?: SignTypedDataMutate<unknown>; switchChain: SwitchChainMutate<Config, unknown>; address: string | `0x${string}` | undefined; chainId?: number; hash?: Hash | string | `0x${string}` | undefined; signature?: Signature; authorization?: string | `0x${string}`; } interface CardanoSignRequest { transactionBytes: string; partialSign?: boolean; } interface CardanoWalletAdapter { signTx?: (unsignedTx: string, partialSign?: boolean) => Promise<string>; submitTx?: (signedTx: string) => Promise<string>; address?: string; } type AssistantsMode = 'default' | 'debug'; interface ToolInvocation { toolName: string; toolCallId: string; state: 'result' | 'running' | 'error'; args: Record<string, JSONValue> & { message?: string; nonce?: string; recipient?: string; callbackUrl?: string; }; result?: { data?: { transactions?: unknown[]; warnings?: string[]; suiTransactionBytes?: unknown; evmSignRequest?: unknown; url?: string; title?: string; description?: string; chartConfig?: unknown; chartData?: unknown; metricData?: unknown; metricLabels?: unknown; dataFormat?: string; chartType?: string; } | JSONValue; error?: string; }; } interface MessagePart { type: 'tool-invocation' | string; toolInvocation?: ToolInvocation; } type SmartAction = { id: string; agentId: string; message: string; creator: string; createdAt: number; }; type SmartActionMessage = { id?: string; agentId?: string; content: string; role: ExtendedMessageRole; parts?: UIMessage['parts']; }; type ExtendedMessageRole = 'user' | 'assistant' | 'system' | 'function' | 'data' | 'tool'; type SmartActionAiMessage = Omit<Message, 'role'> & { id?: string; agentId?: string; agentImage?: string; agentName?: string; parts?: MessagePart[]; role: ExtendedMessageRole; }; type SmartActionChat = SmartAction & { messages: SmartActionMessage[]; }; type SaveSmartAction = { agentId: string; creator: string; message: string; }; type SaveSmartActionMessages = { id: string; agentId: string; creator: string; messages: SmartActionMessage[]; }; interface BaseTokenInfo { name: string; symbol: string; decimals: number; icon?: string; tokenIcon?: string; contractAddress?: string; } interface TokenMeta extends BaseTokenInfo { isSpam?: boolean; } interface TokenInfo extends BaseTokenInfo { amount: string; usdValue: number; } interface SwapFTData { network: { name: string; icon: string; }; type: 'swap'; fee: string; tokenIn: TokenInfo; tokenOut: TokenInfo; } interface TransferFTData { network: { name: string; icon: string; }; type: 'transfer-ft'; sender: string; receiver: string; token: TokenInfo; } interface TransferResponse { data: TransferFTData; evmSignRequest: EthSendTransactionRequest; type: 'transfer-ft'; } interface SwapResponse { data: SwapFTData; evmSignRequest: EthSendTransactionRequest; type: 'swap'; } interface PriceChange { day: number; week: number; month: number; } type EVMTransactionAction = FunctionCallAction | TransferAction; interface NearTransferAction { type: 'Transfer'; params: { deposit: string; }; } type AccountEVMTransaction = Omit<Transaction, 'actions'> & { actions: Array<FunctionCallAction | TransferAction>; }; interface PriceData { day: [number, number][]; week: [number, number][]; month: [number, number][]; } interface TokenBalances { balance: number; usdBalance: number; price?: number; } interface BaseAsset { symbol: string; usdValue: number; chains: string[]; icon: string | null; balances: TokenBalances; meta: TokenMeta; } interface EnhancedAsset extends BaseAsset { priceChanges?: PriceChange; priceData?: PriceData; volume24h: number; marketcap: number; } interface WalletAgentContext { portfolioValue: number; chainsWithGas: string[]; significantAssets: BaseAsset[]; actionableSummary: string; } interface PortfolioResponse extends WalletAgentContext { significantAssets: EnhancedAsset[]; } interface TransferFtResult { EVMTransactions: AccountEVMTransaction[]; warnings?: string[]; } interface GenerateEVMTransactionParams { EVMTransactions: AccountEVMTransaction[]; network?: 'mainnet' | 'testnet'; } type TransferFtParams = { signerId: string; receiverId: string; tokenIdentifier: string; amount: string; network?: 'mainnet' | 'testnet'; }; type PortfolioComponentProps = { data: PortfolioResponse; sendPrompt?: SendPromptFunction; }; type TransferToolProps = { data: TransferFTData; sendPrompt?: SendPromptFunction; }; type SwapComponentDataProps = { data: SwapFTData; sendPrompt?: SendPromptFunction; }; interface BaseTool<T = unknown> { name: string; component: React.ComponentType<T>; } interface BitteTool<T = unknown> extends BaseTool<T> { } interface TransferTool extends BitteTool<TransferToolProps> { name: 'transfer-ft'; } interface PortfolioTool extends BitteTool<PortfolioComponentProps> { name: 'portfolio'; } interface SwapTool extends BitteTool<SwapComponentDataProps> { name: 'swap'; } interface GenerateImageResponse { url: string; hash: string; } interface SignMessageParams { message: string; callbackUrl: string; recipient: string; nonce: string; } interface SignMessageResult { accountId: string; publicKey: string; signature: string; message: string; nonce: string; recipient: string; callbackUrl: string; state: string; } type BittePrimitiveName = 'transfer-ft' | 'generate-EVMTransaction' | 'submit-query' | 'generate-image' | 'getSwapEVMTransactions' | 'getTokenMetadata' | 'generate-evm-tx' | 'generate-sui-tx' | 'generate-sol-tx' | 'render-chart' | 'sign-message' | 'get-portfolio' | 'aftermath-sui-swap' | 'get-sui-balances' | 'sui-lst'; interface TransferAction { type: 'Transfer'; params: Record<string, unknown>; } interface NearFunctionCallAction { type: 'FunctionCall'; params: { methodName: string; args: Record<string, JSONValue>; deposit?: string; gas?: string; }; } interface WidgetChatProps { widgetWelcomePrompts?: WelcomeQuestionAction; customTriggerButton?: React.ReactElement; triggerButtonStyles?: { backgroundColor?: string; logoColor?: string; }; } interface Message { id: string; role: ExtendedMessageRole; content: string; } type ChatComponentColors = { generalBackground?: string; messageBackground?: string; textColor?: string; buttonColor?: string; borderColor?: string; }; type SendPromptFunction = (prompt: string) => Promise<void> | void; interface MessageGroupComponentProps { message: SmartActionAiMessage; isUser: boolean; userName: string; children: React.ReactNode; style: { backgroundColor: string; borderColor: string; textColor: string; }; uniqueKey: string; showBorder?: boolean; } interface ChatContainerComponentProps { children: React.ReactNode; style?: { backgroundColor?: string; borderColor?: string; }; } interface InputContainerProps { children: React.ReactNode; style?: { backgroundColor?: string; borderColor?: string; }; } interface LoadingIndicatorComponentProps { textColor?: string; } interface SendButtonComponentProps { input: string; isLoading: boolean; buttonColor?: string; textColor?: string; onClick?: () => void; } interface TransactionButtonProps { onClick: ButtonHandler; disabled?: boolean; isLoading?: boolean; label?: string; } interface TransactionContainerProps { children: React.ReactNode; style: { backgroundColor: string; borderColor: string; textColor: string; }; } interface CustomTransactionComponents { Container?: React.ComponentType<TransactionContainerProps>; ApproveButton?: React.ComponentType<TransactionButtonProps>; DeclineButton?: React.ComponentType<TransactionButtonProps>; } interface WelcomeQuestionAction { title?: string; description?: string; questions?: string[]; actions?: string[]; } type WelcomeComponentConfig = { type: 'component'; component: JSX.Element; } | { type: 'account-overview'; info: Partial<WelcomeQuestionAction>; data: PortfolioResponse; }; interface BitteAiChatOptions { agentName?: string; agentImage?: string; chatId?: string; prompt?: string; localAgent?: { pluginId: string; accountId: string; spec: BitteOpenAPISpec; }; mcpServerUrl?: string; placeholderText?: string; colors?: ChatComponentColors; customComponents?: { welcomeMessageComponent?: WelcomeComponentConfig; mobileInputExtraButton?: JSX.Element; messageContainer?: ComponentType<MessageGroupComponentProps>; chatContainer?: ComponentType<ChatContainerComponentProps>; inputContainer?: ComponentType<InputContainerProps>; sendButtonComponent?: ComponentType<SendButtonComponentProps>; loadingIndicator?: ComponentType<LoadingIndicatorComponentProps>; }; hideToolCall?: boolean; } interface CustomToolComponentProps { data: PortfolioResponse | TransferResponse | SwapResponse | Record<string, JSONValue>; type: ToolName; } interface ReactToolComponent { name: string; component: React.ComponentType<CustomToolComponentProps>; } type CustomToolComponent = PortfolioTool | TransferTool | SwapTool | ReactToolComponent; type ToolName = 'get-portfolio' | 'transfer-ft' | 'swap'; interface ToolConfigMap { 'get-portfolio': { component: React.ComponentType<PortfolioComponentProps>; getToolData: (data: unknown) => PortfolioResponse; }; 'transfer-ft': { component: React.ComponentType<TransferToolProps>; getToolData: (data: unknown) => TransferFTData; }; swap: { component: React.ComponentType<SwapComponentDataProps>; getToolData: (data: unknown) => SwapFTData; }; } interface AccountContextType { wallet?: Wallet; account?: Account; accountId: string | null; nearWalletId: string | undefined; evmWallet?: EVMWalletAdapter; evmAddress?: string; chainId?: number; suiWallet?: WalletContextState; suiAddress?: string; cardanoWallet?: CardanoWalletAdapter; cardanoAddress?: string; solanaWallet?: WalletContextState$1; solanaConnection?: Connection; } type WalletOptions = { near?: { wallet?: Wallet; account?: Account; accountId: string; nearWalletId: string | undefined; }; evm?: EVMWalletAdapter; sui?: { wallet?: WalletContextState; }; cardano?: CardanoWalletAdapter; solana?: { wallet?: WalletContextState$1; connection?: Connection; }; }; interface BitteAiChatProps { options?: BitteAiChatOptions; agentId: string; wallet: WalletOptions; apiUrl: string; historyApiUrl?: string; apiKey?: string; messages?: Message[]; customToolComponents?: CustomToolComponent[]; onChatLoaded?: () => void; onMessageReceived?: (message: Message) => void; widget?: WidgetChatProps; isWidgetChat?: boolean; format?: 'markdown' | 'plaintext'; } interface UnifiedChatContentProps extends BitteAiChatProps { urlChatId?: string; isWidgetChat?: boolean; } interface ChatRequestBody { id?: string; config?: { mode?: string; agentId?: string; model?: string; mcpServerUrl?: string; format?: 'markdown' | 'plaintext'; }; accountId?: string; network?: string; evmAddress?: Hex; suiAddress?: string; nearWalletId?: string; cardanoAddress?: string; solanaAddress?: string; chainId?: number; localAgent?: { pluginId: string; accountId: string; spec: BitteOpenAPISpec; }; } type BitteAiChat = (props: BitteAiChatProps) => JSX.Element; interface BaseInfo { name: string; icon: string; } interface BaseTokenData extends BaseInfo { amount: string; usdValue: number; } type TokenTransactionData<T extends 'swap' | 'transfer-ft'> = { network: BaseInfo; txnData: NearTransaction | SignRequest | Transaction$1; } & (T extends 'swap' ? { type: 'swap'; tokenIn: BaseTokenData; tokenOut: BaseTokenData; } : { type: 'transfer-ft'; sender: string; receiver: string; token: BaseTokenData; }); type SwapFTDataResponse = TokenTransactionData<'swap'>; type TransferFTDataResponse = TokenTransactionData<'transfer-ft'>; interface CommonStyleProps { textColor: string; messageBackgroundColor: string; borderColor: string; } interface TransactionComponentProps { customTxContainer?: React.ComponentType<TransactionContainerProps>; customApproveTxButton?: React.ComponentType<TransactionButtonProps>; customDeclineTxButton?: React.ComponentType<TransactionButtonProps>; } interface ReviewSignMessageProps extends CommonStyleProps, TransactionComponentProps { message: string; recipient?: string; nonce?: string; callbackUrl?: string; chatId: string | undefined; toolCallId: string; addToolResult: (result: BitteToolResult<SignMessageResult>) => void; } interface TransactionResultProps<T = { evm?: { txHash?: string; chainId: number; }; near?: { receipts?: { transaction: { hash: string; }; }[]; }; sui?: { digest?: string; }; solana?: { signature?: string; }; }> { result: T; accountId: string; textColor: string; } interface SmartActionsInputProps { input: string; isLoading: boolean; agentName?: string; agentImage?: string; handleChange: (e: React.ChangeEvent<HTMLTextAreaElement>) => void; handleSubmit: (e: React.FormEvent<HTMLFormElement>) => void; buttonColor: string; borderColor: string; textColor: string; backgroundColor: string; mobileInputExtraButton?: React.JSX.Element; customSendButtonComponent?: React.ComponentType<SendButtonComponentProps>; placeholderText?: string; } type AIMessageLike = Message$1 | CreateMessage; type MessageAppend = (message: AIMessageLike, chatRequestOptions?: ChatRequestOptions) => Promise<string | null | undefined>; interface MessageGroupProps extends CommonStyleProps, TransactionComponentProps { chatId: string | undefined; groupKey: string; messages: Message[]; accountId: string; creator?: string; isLoading?: boolean; agentImage?: string; agentName?: string; evmAdapter?: EVMWalletAdapter; account?: Account; wallet?: Wallet; addToolResult: (params: { toolCallId: string; result: BitteToolResult<unknown>; }) => void; append: MessageAppend; customMessageContainer?: React.ComponentType<MessageGroupComponentProps>; customToolComponents?: CustomToolComponent[]; showBorder?: boolean; hideToolCall?: boolean; } type TransactionListComponentProps = { accountId: string; operation?: TransactionOperation; transaction: NearTransaction[]; modifiedUrl: string; showDetails: boolean; showTxnDetail: boolean; setShowTxnDetail: (showTxnDetail: boolean) => void; costs: Cost[]; gasPrice: string; borderColor: string; }; interface ActionComponentProps<T> { data: T; onApprove?: ButtonHandler; onExplain?: ButtonHandler; onFunctionCall?: ButtonHandler; sendPrompt?: SendPromptFunction; } interface SwapComponentProps extends ActionComponentProps<SwapFTData> { } interface TransferComponentProps extends ActionComponentProps<TransferFTData> { } interface NetworkInfo { name: string; icon: string | React.ReactNode; } interface NetworkBadgeProps { network: NetworkInfo; iconOverride?: string; } interface WelcomeListProps { items: string[]; label: string; bgColor: string; onItemClick: (item: string) => void; } type ButtonHandler = () => void; interface ButtonOptions { label?: string; show?: boolean; handler?: ButtonHandler; } interface TransactionDataProps { transactions?: NearTransaction[]; evmData?: SignRequest; suiTransaction?: Transaction$1; suiTransactionBytes?: string; messageId?: string; append?: MessageAppend; txnData?: any; } interface ActionHandlers { onFunctionCall?: ButtonHandler; onExplain?: ButtonHandler; onApprove?: ButtonHandler; } interface ActionVisibility { showFunctionCall?: boolean; showExplain?: boolean; showApprove?: boolean; } interface ActionLabels { functionCall?: string; explain?: string; approve?: string; } interface ActionButtonsProps extends TransactionDataProps { handlers: ActionHandlers; actions?: ActionVisibility; labels?: ActionLabels; } interface TransactionReceipt { transaction: { hash: string; }; [key: string]: unknown; } interface TransactionResult { near?: { receipts: TransactionReceipt[]; transactions: NearTransaction[]; encodedTxn?: string; }; sui?: { digest: string; effects: string; }; evm?: { txHash: string; chainId: number; }; } type MessageLike = Message | Omit<Message, 'id'> | { id?: string; role: string; content: string; createdAt: Date | string; [key: string]: unknown; }; type MessageAppendFunction = (message: MessageLike) => Promise<string | null | undefined>; type TransactionApprovalOptions = { messageId?: string; append?: MessageAppend; }; type TransactionStatus = 'success' | 'fail' | 'pending'; interface TransactionState { isLoading: boolean; errorMsg: string; result: TransactionResult | null; txHash?: string; txDigest?: string; } type TransactionStateAction = { type: 'SET_LOADING'; payload: boolean; } | { type: 'SET_ERROR'; payload: string; } | { type: 'SET_RESULT'; payload: TransactionResult; } | { type: 'SET_TX_HASH'; payload: string; } | { type: 'SET_TX_DIGEST'; payload: string; } | { type: 'RESET_ERROR'; }; type ToolInvocationManagerProps = { message: SmartActionAiMessage; chatId: string; creator?: string; isLoading?: boolean; borderColor?: string; messageBackgroundColor?: string; textColor?: string; addToolResult: (params: { toolCallId: string; result: BitteToolResult<unknown>; }) => void; append: MessageAppend; customTxContainer?: React.ComponentType<TransactionContainerProps>; customApproveTxButton?: React.ComponentType<TransactionButtonProps>; customDeclineTxButton?: React.ComponentType<TransactionButtonProps>; customToolComponents?: CustomToolComponent[]; uniqueKey: string; }; type MessageContentProps = { message: SmartActionAiMessage; borderColor?: string; append: MessageAppend; customToolComponents?: (CustomToolComponent | ReactToolComponent)[]; }; type ToolInvocationRendererProps = { toolName: string; toolCallId: string; state: string; result: BitteToolResult<PortfolioResponse | TransferFTData | SwapFTData>; borderColor?: string; customToolComponents?: (CustomToolComponent | ReactToolComponent)[]; append: MessageAppend; }; interface AccountCreationData { devicePublicKey: string; accountId: string; isCreated: boolean; txnHash?: string; } interface SuccessInfo { near: { receipts: FinalExecutionOutcome[]; transactions: Transaction$2[]; encodedTxn?: string; }; sui?: { digest: string; effects: string; }; cardano?: { txHash: string; }; solana?: { signature: string; }; } interface UseTransactionProps { account?: Account; wallet?: Wallet; evmWallet?: EVMWalletAdapter; suiWallet?: WalletContextState; cardanoWallet?: CardanoWalletAdapter; solanaWallet?: WalletContextState$1; solanaConnection?: Connection; } interface HandleTxnOptions { transactions?: Transaction$2[]; evmData?: SignRequest; suiTransaction?: Transaction$1; cardanoData?: CardanoSignRequest; solanaTransaction?: VersionedTransaction; } type ActionObject = { send: () => Promise<void>; show: () => void; try: () => void; }; type Arguments = { autotransfer?: boolean; account_id?: string; msg?: string; token_id?: string; metadata?: Metadata | string; num_to_mint?: number; owner_id?: string; royalty_args?: string | number | null; split_owners?: string | number | null; token_ids_to_mint?: string | number | null; receiver_id?: string; token_ids?: string[]; methodName?: string; amount?: string | number; memo?: string | null; nft_contract_id?: string | null; title?: string; tokenImg?: string; }; type Metadata = { media: string; reference: string; title?: string; description?: string; }; type TransactionListProps = { transaction: Transaction$2[]; operation?: TransactionOperation; actions?: ActionObject; modifiedUrl: string; showDetails: boolean; showTxnDetail: boolean; setShowTxnDetail: (showTxnDetail: boolean) => void; }; type TxnDetailWrapperProps = { accountId: string; transaction: Transaction$2[]; modifiedUrl: string; showDetails: boolean; showTxnDetail: boolean; costs: Cost[]; gasPrice: string; }; type TransactionDetailProps = { transaction: Transaction$2; showDetails: boolean; modifiedUrl: string; gas: string | number; deposit: string | number; }; type FlattenTransactionResults = { hash: string; sender: string; receiver: string; txn: Transaction$2[]; type: string; }; type ActionCosts = 'CreateAccount' | 'Transfer' | 'Stake' | 'AddFullAccessKey' | 'DeleteKey'; interface NearTransactionState { sponsor?: string; isLoading: boolean; exportLoading: boolean; migrationError: string | null; migrationLoading: boolean; results: FinalExecutionOutcome[] | null; error?: { message: string; }; } type SendTransactionParams = { data?: TransactionDetails; operation?: TransactionOperation; account?: Account; disableLoading?: boolean; disableSuccess?: boolean; }; type NearTransactionParams = { transactions: Transaction$2[]; account: Account; }; type SendTransactionFunction = (args?: SendTransactionParams) => Promise<SuccessInfo | undefined>; type TransactionOperation = { operation: Operation; sponsorId?: string; paymasterId?: string; cost?: string; fee?: string; }; interface UrlData { successUrl?: string; callbackUrl?: string; } interface TransactionDetails { transactions: Transaction$2[]; isDrop?: boolean; evmData?: SignRequest; } interface TransactionProps { operation?: TransactionOperation; accountData?: AccountCreationData; transactionData?: TransactionDetails; urlData?: UrlData; agentId?: string; } interface TransactionPageProps extends TransactionProps { referer: string | null; } interface SendTransactionData { operation: TransactionOperation; account: Account; details: TransactionDetails; urlData?: UrlData; } interface TransactionErrorProps { error: string; transactions: Transaction$2[]; accountId: string; urlData?: UrlData; } declare enum Operation { NEAR = "near", RELAY = "relay", SPONSOR = "sponsor" } interface Cost { deposit: BN; gas: BN; } interface NearReceipt { transaction: { hash: string; }; [key: string]: unknown; } interface GenerateSuiTxParams { transactionBytes?: string; recipientAddress?: string; senderAddress?: string; amountInSui?: number; network?: 'mainnet' | 'testnet' | 'devnet'; } interface GenerateSuiTxResult { suiTransactionBytes: string; } interface SuiBalancesParams { address: string; } interface SuiObject { objectId: string; version: string; digest: string; type: string; owner: { AddressOwner: string; }; content: { dataType: string; type: string; hasPublicTransfer: boolean; fields: { balance: string; id: { id: string; }; }; }; } interface SuiCoin { coinType: string; coinObjectCount: number; totalBalance: string; lockedBalance: { epochId: number; number: string; }; } interface SuiBalance { coinType: string; balance: string; name: string; symbol: string; iconUrl: string; decimals: number; usdValue: number; } interface SuiBalancesResult { balances: SuiBalance[]; totalUsdValue: number; } interface SuiLstParams { address: string; amount: string; validator: string; operation: 'stake' | 'unstake'; } interface SuiLstResult { suiTransactionBytes: string; } interface AftermathSwapParams { fromCoin: string; toCoin: string; amount: number; slippage?: number; address: string; } interface AftermathSwapResult { suiTransactionBytes: string; } export { type AIMessageLike, type AccountContextType, type AccountCreationData, type AccountEVMTransaction, type ActionButtonsProps, type ActionComponentProps, type ActionCosts, type ActionHandlers, type ActionLabels, type ActionVisibility, type AftermathSwapParams, type AftermathSwapResult, type AgentMetadata, type Arguments, type AssistantTool, type AssistantsMode, type BaseAsset, type BaseInfo, type BaseTokenData, type BaseTokenInfo, type BaseTool, type BitteAIOptions, type BitteAgent, type BitteAgentBase, type BitteAgentConfig, type BitteAiChat, type BitteAiChatOptions, type BitteAiChatProps, type BitteAssistant, type BitteAssistantConfig, type BitteCoreTool, type BitteMetadata, type BitteOpenAPISpec, type BittePrimitiveName, type BittePrimitiveRef, type BitteTool, type BitteToolExecutor, type BitteToolResult, type BitteToolSpec, type BitteToolWarning, type ButtonHandler, type ButtonOptions, type CardanoSignRequest, type CardanoWalletAdapter, ChainType, type ChatComponentColors, type ChatContainerComponentProps, type ChatRequestBody, type CommonStyleProps, type CoreTool, type Cost, type CustomToolComponent, type CustomToolComponentProps, type CustomTransactionComponents, type EVMTransactionAction, type EVMWalletAdapter, type EnhancedAsset, type EthSendTransactionRequest, type EthSignRequest, type EthSignTypedDataRequest, type ExecutionDefinition, type ExtendedMessageRole, type FlattenTransactionResults, type FunctionDefinition, type FunctionTool, type GenerateEVMTransactionParams, type GenerateImageResponse, type GenerateSuiTxParams, type GenerateSuiTxResult, type HandleTxnOptions, type InputContainerProps, type JSONValue, type LoadingIndicatorComponentProps, type LocalAgentSpec, type Message, type MessageAppend, type MessageAppendFunction, type MessageContentProps, type MessageGroupComponentProps, type MessageGroupProps, type MessageLike, type MessagePart, type MetaTransaction, type NearFunctionCallAction, type NearReceipt, type NearTransaction, type NearTransactionParams, type NearTransactionState, type NearTransferAction, type NetworkBadgeProps, type NetworkInfo, Operation, type PersonalSignRequest, type PluginToolSpec, type PortfolioComponentProps, type PortfolioResponse, type PortfolioTool, type PriceChange, type PriceData, type ReactToolComponent, type ReviewSignMessageProps, type SaveSmartAction, type SaveSmartActionMessages, type SendButtonComponentProps, type SendPromptFunction, type SendTransactionData, type SendTransactionFunction, type SendTransactionParams, type SignMessageParams, type SignMessageResult, type SignRequest, type SmartAction, type SmartActionAiMessage, type SmartActionChat, type SmartActionMessage, type SmartActionsInputProps, type SuccessInfo, type SuiBalance, type SuiBalancesParams, type SuiBalancesResult, type SuiCoin, type SuiLstParams, type SuiLstResult, type SuiObject, type SwapComponentDataProps, type SwapComponentProps, type SwapFTData, type SwapFTDataResponse, type SwapResponse, type SwapTool, type TokenBalances, type TokenInfo, type TokenMeta, type TokenTransactionData, type ToolConfigMap, type ToolInvocation, type ToolInvocationManagerProps, type ToolInvocationRendererProps, type ToolName, type TransactionApprovalOptions, type TransactionButtonProps, type TransactionComponentProps, type TransactionContainerProps, type TransactionDataProps, type TransactionDetailProps, type TransactionDetails, type TransactionErrorProps, type TransactionListComponentProps, type TransactionListProps, type TransactionOperation, type TransactionPageProps, type TransactionProps, type TransactionResult, type TransactionResultProps, type TransactionState, type TransactionStateAction, type TransactionStatus, type TransferAction, type TransferComponentProps, type TransferFTData, type TransferFTDataResponse, type TransferFtParams, type TransferFtResult, type TransferResponse, type TransferTool, type TransferToolProps, type TxnDetailWrapperProps, type UnifiedChatContentProps, type UrlData, type UseTransactionProps, type WalletAgentContext, type WalletOptions, type WelcomeComponentConfig, type WelcomeListProps, type WelcomeQuestionAction, type WidgetChatProps };