[docs]classTransferSchema(BaseModel):"""Schema for transfer operations."""address:str=Field(...,description="Address to transfer AIN to")amount:int=Field(...,description="Amount of AIN to transfer")
[docs]classAINTransfer(AINBaseTool):# type: ignore[override, override]"""Tool for transfer operations."""name:str="AINtransfer"description:str="Transfers AIN to a specified address"args_schema:Type[TransferSchema]=TransferSchemaasyncdef_arun(self,address:str,amount:int,run_manager:Optional[AsyncCallbackManagerForToolRun]=None,)->str:try:res=awaitself.interface.wallet.transfer(address,amount,nonce=-1)returnjson.dumps(res,ensure_ascii=False)exceptExceptionase:returnf"{type(e).__name__}: {str(e)}"